Skip to content

Theme updates fixes - #3715

Merged
MatFillion merged 11 commits into
masterfrom
dev/djo/theme-updates-fix
Aug 5, 2020
Merged

MatFillion merged 11 commits into
masterfrom
dev/djo/theme-updates-fix

Conversation

@davidjohnoliver

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): fixes #3388, fixes #3644

  • fix bugs with ThemeResource updates when app theme changes
  • adds v. limited support for FrameworkElement.RequestedTheme (modifies entire app theme)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

…ource values

This change will ensure newly-applied setters after a theme changes will have the correct value, but more is needed to update values at theme change for currently-applied visual states.
This ensures that DPs on animations inside visual states are updated accordingly after theme changes. (This doesn't fix the case where the animation is in effect at the time the theme changes, more work would be needed to handle this.)
Setting FrameworkElement.RequestedTheme will apply the nominated RequestedTheme to the entire application. This does not allow setting a different RequestedTheme for individual pages or controls, but does support the use case of overriding the system theme while the application is running.
@gitpod-io

gitpod-io Bot commented Aug 4, 2020 •

Copy link
Copy Markdown

@davidjohnoliver
davidjohnoliver force-pushed the dev/djo/theme-updates-fix branch from 1bb0512 to b0958ff Compare August 4, 2020 18:06
Aligns with UWP, fixes bug where XamlControlsResources can't be assigned directly to App.Resources in Xaml.

public static readonly DependencyProperty MyTagProperty =
DependencyProperty.Register("MyTag", typeof(string), typeof(MyExtControl), new FrameworkPropertyMetadata("Default"));
DependencyProperty.Register("MyTag", typeof(string), typeof(MyExtControl), new PropertyMetadata("Default"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why ? (/cc @dr1rrb)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

doesn't compile on UWP.

Note all these replacements are in Uno.UI.Tests, not Uno.UI itself

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 18271 found UI Test snapshots differences: android-28: 31, android-28-Snap: 28, ios: 15, ios-Snap: 39, skia-gtk-screenshots: 26, wasm: 18, wasm-automated: 8

Details
  • android-28: 31 changed over 411

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BasicNavigationView_SamplesApp_Samples_Windows_UI_Xaml_Controls_NavigationViewTests_NavigationView_Pane_Automated
    • ComboBoxTests_Fullscreen_Popup_Generic_Closed
    • ContentDialog_Closing_PrimaryDialogCancelClosing_UITests_Shared_Windows_UI_Xaml_Controls_ContentDialogTests_ContentDialog_Closing
    • Keyboard_Textbox_InsideScrollViewer_Validation_3_-_Remove_Focus_on_disabledTextBox
    • Keyboard_Textbox_InsideScrollViewer_Validation_4_-_Remove_Focus_on_multilineTextBox
    • Keyboard_Textbox_InsideScrollViewer_Validation_5_-_Remove_Focus_on_numberTextBox
    • CommandTest_UITests_Microsoft_UI_Xaml_Controls_SplitButtonTests_SplitButtonPage
    • Dismiss_MenuFlyout_AfterSuccess
    • Keyboard_Textbox_NoScrollViewer_Validation_2_-_Remove_Focus_on_placeholderTextTextBox
    • ComboBoxTests_Fullscreen_Popup_Generic_Opened
    • Dismiss_MenuFlyout_fileMenu
    • MenuFlyoutItem_ClickTest_AfterSuccess
    • PopupWithOverlay_After
    • Simple_MenuFlyout_openMenu
    • Simple_MenuFlyout_Toggle_AfterSuccess
    • Simple_MenuFlyout_Toggle_RepeatToggleMenuFlyoutItem
    • Simple_MenuFlyout_Toggle_ShuffleToggleMenuFlyoutItem
    • Simple_MenuFlyout_AfterSuccess
    • Simple_MenuFlyout_exitMenu
    • Simple_MenuFlyout_xamlUIMenu
  • android-28-Snap: 28 changed over 748

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Button_Custom_Button_With_ContentTemplate_Uno_UI_Samples_Content_UITests_ButtonTestsControl_Custom_Button_With_ContentTemplate
    • ComboBox_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_DropDownPlacement_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_DropDownPlacement
    • CommandBar_Native_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Native
    • Default_Uno_UI_Samples_UITests_Image_Image_UseTargetSize_Uno_UI_Samples_UITests_Image_Image_UseTargetSize
    • Default_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name
    • ImageBrushTestControl_EllipsemaskingEllipseGrid_Uno_UI_Samples_UITests_ImageBrushTestControl_EllipsemaskingEllipseGrid
    • ListView_ListViewIncrementalLoading_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewIncrementalLoading
    • MediaPlayerElement_Using__ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • ListView_ListViewChangeView_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewChangeView
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal
    • TextBlockControl_TextBlock_FixedWidth_With_DataBound_Run_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlock_FixedWidth_With_DataBound_Run
    • TextBlockControl_TextBoxSizeChanging_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBoxSizeChanging
    • TextBox_Uno_UI_Samples_Content_UITests_TextBoxControl_PasswordBox_Reveal_Scroll_Uno_UI_Samples_Content_UITests_TextBoxControl_PasswordBox_Reveal_Scroll
    • Time_Picker_TimePicker_TimePickerFlyoutStyle_UITests_Windows_UI_Xaml_Controls_TimePicker_TimePicker_TimePickerFlyoutStyle
    • TextBlockControl_TextBlockMultilineInStarStackPanel_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlockMultilineInStarStackPanel
    • XBind_Phase_Large_Uno_UI_Samples_Content_UITests_XBind_PhaseBinding_Large
    • XBind_Phase_Simple_Uno_UI_Samples_Content_UITests_XBind_PhaseBinding
    • XBind_UITests_Shared_Windows_UI_Xaml_xBindTests_xBind_Functions_UITests_Shared_Windows_UI_Xaml_xBindTests_xBind_Functions
    • XBind_XBind_Simple_Uno_UI_Samples_Content_UITests_XBind_XBind_Simple
  • ios: 15 changed over 211

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DatePicker_Flyout_DatePicker_-_Flyout
    • ImageStretch_None_Uno_UI_Samples_UITests_ImageTestsControl_Image_Stretch_None
    • Keyboard_Textbox_NoScrollViewer_Validation_5_-_Remove_Focus_on_numberTextBox
    • ListView_ExpandableItemLarge_ExpandHeader_Validation_Collapsed_State
    • ListView_ExpandableItemLarge_ExpandHeader_Validation_Expanded_State
    • Screenshots_Image_Stretch_Alignment_Equal_Mode-0
    • Keyboard_Textbox_NoScrollViewer_Validation_2_-_Remove_Focus_on_placeholderTextTextBox
    • ListView_ExpandableItemLarge_ExpandHeaderWithMultipleItems_Validation_Collapsed_State
    • ListView_ExpandableItemLarge_ExpandHeaderWithMultipleItems_Validation_Expanded_State
    • ListView_ExpandableItemLarge_ExpandHeaderWithMultipleItems_Validation_Initial_State
    • ListView_ExpandableItemLarge_ExpandHeaderWithMultipleItems_Validation_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Expandable_Item_Large
    • Keyboard_Textbox_NoScrollViewer_Validation_4_-_Remove_Focus_on_multilineTextBox
    • ListView_ExpandableItemLarge_ExpandHeader_Validation_Initial_State
    • ListView_ExpandableItemLarge_ExpandHeader_Validation_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Expandable_Item_Large
    • Button_NestedButtons_Validation_nVentive_Umbrella_Views_UI_Samples_Content_UITests_ButtonTestsControl_Nested_Buttons
  • ios-Snap: 39 changed over 740

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Animations_DoubleAnimationUsingKeyFrames_TranslateX_GenericApp_Views_Content_UITests_Animations_DoubleAnimationUsingKeyFrames_TranslateX
    • Animations_DoubleAnimation_RenderTransformOrigin_GenericApp_Views_Content_UITests_Animations_DoubleAnimation_RenderTransformOrigin
    • Border_AutoBorderStretchwithbottommargin_Uno_UI_Samples_UITests_BorderTestsControl_AutoBorderStretchwithbottommargin
    • Border_Border_Simple_No_Background_With_TextBox_Uno_UI_Samples_UITests_BorderTestsControl_Border_Simple_No_Background_With_TextBox
    • Border_Simple_with_Radius_Uno_UI_Samples_UITests_BorderTestsControl_Simple_with_Radius
    • Border_UITests_Shared_Windows_UI_Xaml_Controls_BorderTests_Border_Clipped_Change_Property_UITests_Shared_Windows_UI_Xaml_Controls_BorderTests_Border_Clipped_Change_Property
    • Border_Uniform_Thickness_and_Small_Radius_Uno_UI_Samples_UITests_BorderTestsControl_Uniform_Thickness_and_Small_Radius
    • ContentPresenter_ContentPresenter_TextProperties_Uno_UI_Samples_Content_UITests_ContentPresenter_ContentPresenter_TextProperties
    • ImageBrushTestControl_ImageBrushWithRotateTransform_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushWithRotateTransform
    • ListView_ListViewMarginTest_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewMarginTest
    • MediaPlayerElement_Using__mov_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mov_Extension
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • MediaPlayerElement_Original_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Original
    • MediaPlayerElement_Using__3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension
    • GridTestsControl_Grid_with_Stack_Panel_and_Trimming_Uno_UI_Samples_Content_UITests_GridTestsControl_Grid_with_Stack_Panel_and_Trimming
    • Image_ImageUniformWithinScrollViewer_Uno_UI_Samples_UITests_ImageTestsControl_ImageUniformWithinScrollViewer
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Bigger_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Bigger
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Equal_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Equal
    • ListView_ListView_ItemsPanel_HotSwap_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_ItemsPanel_HotSwap
    • Pointers_DragCoordinates_Automated_UITests_Shared_Windows_UI_Xaml_Input_Pointers_DragCoordinates_Automated
  • skia-gtk-screenshots: 26 changed over 734

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CommandBar-Native
    • Image-Image_Stretch_Alignment_SizeOnControl
    • Image-Image_Stretch_Alignment_Taller
    • ImageBrushTestControl-ImageBrushWithCompositeTransform
    • ImageBrushTestControl-PanelImageBrush
    • ListView-ListViewResizableText
    • Image-Image_Stretch
    • Image-Image_Stretch_Algmnt_Inf_Vertical
    • ListView-ListViewGroupedLargeLegacy
    • ListView-ListView_Image
    • ListView-ListViewGrouped
    • ListView-ListView_SelectedItem
    • TwoPaneView-MUX_Test
    • Transform-Image_With_RotateTransform
    • XAML-BasicThemeResources
    • XAML-DataContextProperty
    • XAML-MarkupExtension
    • XAML-XamlGlobalResources
    • XAML-xBind
    • XAML-xBind_Field
  • wasm: 18 changed over 749

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRingPage
    • UITests.Shared.Windows_UI_Xaml.MarkupExtension.MarkupExtension
    • UITests.Shared.Windows_UI_Xaml.Properties.DataContextProperty
    • UITests.Shared.Windows_UI_Xaml.Resources.XamlGlobalResources
    • UITests.Shared.Windows_UI_Xaml.ThemeResources.BasicThemeResources
    • UITests.Shared.Windows_UI_Xaml.xBind.xBind
    • UITests.Shared.Windows_UI_Xaml.xBindTests.xBind_Field
    • UITests.Shared.Windows_UI_Xaml.xBindTests.xBind_Functions
    • UITests.Shared.Windows_UI_Xaml_Controls.ImageTests.Image_Stretch_Algmnt_Inf_Horizontal
    • Uno.UI.Samples.Content.UITests.XBind.NoPhaseBinding_Large
    • Uno.UI.Samples.Content.UITests.XBind.PhaseBinding
    • Uno.UI.Samples.Content.UITests.XBind.PhaseBinding_Large
    • Uno.UI.Samples.Content.UITests.XBind.PhaseBinding_StartOne
    • Uno.UI.Samples.Content.UITests.XBind.XBind_Simple
    • Uno.UI.Samples.UITests.ImageBrushTestControl.ImageBrushWithCompositeTransform
    • Uno.UI.Samples.UITests.Image.Image_Stretch
    • Uno.UI.Samples.UITests.Image.Image_Stretch_Alignment_Equal
    • Uno.UI.Samples.UITests.Image.Image_Stretch_Alignment_Taller
  • wasm-automated: 8 changed over 464

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Expanded
    • Compact again
    • Draw_polyline_PolylinePage_-_ChangeShape
    • FocusManager_GetFocusedElement_ListViewItem_LostFocus_Validation_FocusManager_-_LostFocus_-_ListViewItem_-_2_-_Click_outside
    • ImageStretch_None_Uno_UI_Samples_UITests_ImageTestsControl_Image_Stretch_None
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • LoadEmptyContentControl_ContentControlNoTemplateNoContent_-_bntContentClear
    • Screenshots_Image_Stretch_Alignment_Smaller_Mode-0

@jeromelaban

Copy link
Copy Markdown
Member

@davidjohnoliver there's an odd change in the screenshots:

image

@jeromelaban

Copy link
Copy Markdown
Member

Looks like it's caused by the comparison being from an older version which did not have the Fluent style checkbox.

@MatFillion
MatFillion merged commit 9fe9004 into master Aug 5, 2020
@MatFillion
MatFillion deleted the dev/djo/theme-updates-fix branch August 5, 2020 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ThemeResource bindings in ResourceDictionary not re-evaluated on runtime changes Switching theme at runtime does not apply to visual states

5 participants