Simplify title bar (#442)
Fixes #407 (partially) and #441 Description of the changes: Remove TitleBarHelper and all <Border x:Name="CustomTitleBar" /> Let the system defines the draggable region Centralize all events and functions associated to the title bar in a single control TitleBar instead of code splitted between MainPage/TitleBar/HistoryList/Memory. Use the standard title bar when high contrast is activated instead of the custom one. Modify the color of the title when the window doesn't have focus Fix the right padding of the title bar with high contrast How changes were validated: Manually tested with LtR and RtL languages Manually tested with high contrast Tested when History and Memory flyout are opened
This commit is contained in:
		
				
					committed by
					
						 Daniel Belcher
						Daniel Belcher
					
				
			
			
				
	
			
			
			
						parent
						
							0d31d5a5a2
						
					
				
				
					commit
					bd04c92c1c
				
			| @@ -1,4 +1,4 @@ | ||||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||||
| // Licensed under the MIT License. | ||||
|  | ||||
| #pragma once | ||||
| @@ -7,26 +7,36 @@ | ||||
|  | ||||
| namespace CalculatorApp | ||||
| { | ||||
|  | ||||
|     /// <summary> | ||||
|     /// Standalone control managing the title bar of the application. | ||||
|     /// Display a transparent custom title bar when high-contrast is off and the native title bar when on. | ||||
|     /// Automatically react to color changes, tablet mode, etc... | ||||
|     /// </summary> | ||||
|     public ref class TitleBar sealed | ||||
|     { | ||||
|     public: | ||||
|         TitleBar(); | ||||
|  | ||||
|         void SetTitleBar(); | ||||
|     private: | ||||
|         void OnLoaded(_In_ Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); | ||||
|         void OnUnloaded(_In_ Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); | ||||
|  | ||||
|         void Initialize(); | ||||
|         void RegisterForLayoutChanged(); | ||||
|         void RegisterForVisibilityChanged(); | ||||
|         void SetTitleBarText(Platform::String^ text); | ||||
|         void SetTitleBarHeight(double height); | ||||
|         void SetTitleBarVisibility(bool isVisible); | ||||
|         void SetTitleBarVisibility(); | ||||
|         void SetTitleBarPadding(); | ||||
|         void SetTitleBarControlColors(); | ||||
|         void SetTitleBarExtendView(); | ||||
|         void ColorValuesChanged(_In_ Windows::UI::ViewManagement::UISettings^ sender, _In_ Platform::Object^ e); | ||||
|         void OnHighContrastChanged(Windows::UI::ViewManagement::AccessibilitySettings ^sender, Platform::Object ^args); | ||||
|         void OnWindowActivated(Platform::Object ^sender, Windows::UI::Core::WindowActivatedEventArgs ^e); | ||||
|  | ||||
|         Platform::Agile<Windows::ApplicationModel::Core::CoreApplicationViewTitleBar^> m_coreTitleBar; | ||||
|         Windows::Foundation::EventRegistrationToken m_layoutChangedToken; | ||||
|         Windows::Foundation::EventRegistrationToken m_visibilityChangedToken; | ||||
|         Windows::Foundation::EventRegistrationToken m_colorValuesChangedToken; | ||||
|         Windows::Foundation::EventRegistrationToken m_windowActivatedToken; | ||||
|         Windows::Foundation::EventRegistrationToken m_accessibilitySettingsToken; | ||||
|         Windows::UI::ViewManagement::UISettings^ m_uiSettings; | ||||
|         Windows::UI::ViewManagement::AccessibilitySettings^ m_accessibilitySettings; | ||||
|     }; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user