Skip to content

Implement all permutations of InputTransparent and CascadeInputTransparent#14846

Merged
hartez merged 36 commits into
mainfrom
dev/input-transparency
Jul 7, 2023
Merged

Implement all permutations of InputTransparent and CascadeInputTransparent#14846
hartez merged 36 commits into
mainfrom
dev/input-transparency

Conversation

@mattleibow
Copy link
Copy Markdown
Member

@mattleibow mattleibow commented Apr 29, 2023

Description of Change

There are several input transparency issues and most of the fixes we have done fix some and potentially create new issues because of the way things are set up. My proposed fix is going to be similar to the changes for IsEnabled when the IsEnabled is controlled by 3 parts: IsEnabled, Parent.IsEnabled and ICommand.CanExecute.

The InputTransparent result value is controlled by a few parts:

  • The InputTransparent property on the element
  • The InputTransparent property on the PARENT but only iff the CascadeInputTransparent permits

I also assume that:

Setting the initial state X is the same as going from some arbitrary state into state X. For example, if the state is the layout being transparent and the control not transparent will result in the same final state even if the initial state was different.

However, this is semi-ambiguous as what happens when there are multiple nested layouts with different values? The table below tries to capture all the things in a truth table.

So far my observations are:

  1. The control always overrides everything when set to transparent
  2. The layout always overrides when set to transparent AND cascade
  3. A nested layout cannot not un-set a parent-set transparency

Given the code:

new Layout {
    Tag = "Root",
    new Layout {
        Tag = "Nested"
        new Control {
            Tag = "Control"
        }
    }
}

✅ = True
❌ = False

Root.Tr Root.Cas Nested.Tr Nested.Cas Control.Tr = Nested.Tr = Control.Tr

Issues Fixed

@mattleibow mattleibow force-pushed the dev/input-transparency branch from 16a1694 to 1895907 Compare April 29, 2023 18:08
@mattleibow mattleibow changed the title Adding some tests for the baseline Implement all permutations of InputTransparent and CascadeInputTransparent Apr 30, 2023
@jfversluis
Copy link
Copy Markdown
Member

Probably also related: #9153

@mattleibow mattleibow marked this pull request as draft May 9, 2023 13:55
Comment thread src/Controls/tests/Xaml.UnitTests/Issues/Bz54334.xaml.cs
# Conflicts:
#	src/Controls/tests/Xaml.UnitTests/Issues/Bz54334.xaml.cs
@mattleibow mattleibow force-pushed the dev/input-transparency branch from 76157e7 to 2ed88fe Compare May 30, 2023 16:55
@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Jun 20, 2023
@mattleibow
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

// There are 2 Layout types: Controls and Compatibility
interface IInputTransparentContainerElement
{
bool InputTransparent { get; }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you include inline comments here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-8.0.0-preview.7.8842 Look for this fix in 8.0.0-preview.7.8842!

Projects

None yet

6 participants