-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.Import full customed title bar 2.Remove Windows App SDK dependency
- Loading branch information
1 parent
04abc72
commit 6c747c6
Showing
53 changed files
with
3,883 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
|
||
<!-- 标题栏按钮资源值定义 --> | ||
<ResourceDictionary.ThemeDictionaries> | ||
<ResourceDictionary x:Key="Light"> | ||
<Color x:Key="CloseButtonColor">#C42B1C</Color> | ||
<StaticResource x:Key="CaptionButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondary" /> | ||
<StaticResource x:Key="CaptionButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiary" /> | ||
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SystemControlForegroundBaseHighBrush" /> | ||
<StaticResource x:Key="CaptionButtonForegroundColor" ResourceKey="SystemBaseHighColor" /> | ||
<StaticResource x:Key="CaptionButtonForegroundPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" /> | ||
<StaticResource x:Key="CaptionButtonForegroundPressed" ResourceKey="SystemControlForegroundBaseHighBrush" /> | ||
<SolidColorBrush x:Key="CaptionButtonBackground" Color="Transparent" /> | ||
<Color x:Key="CaptionButtonBackgroundColor">Transparent</Color> | ||
<Color x:Key="CaptionButtonNotActiveColor">Black</Color> | ||
<Color x:Key="CaptionButtonDisabledColor">Black</Color> | ||
<SolidColorBrush x:Key="CloseButtonBackgroundPointerOver" Color="{ThemeResource CloseButtonColor}" /> | ||
<SolidColorBrush x:Key="CloseButtonForegroundPointerOver" Color="White" /> | ||
<SolidColorBrush | ||
x:Key="CaptionButtonForegroundNotActive" | ||
Opacity="0.38" | ||
Color="{StaticResource CaptionButtonNotActiveColor}" /> | ||
<SolidColorBrush | ||
x:Key="CaptionButtonForegroundDisabled" | ||
Opacity="0.38" | ||
Color="{StaticResource CaptionButtonDisabledColor}" /> | ||
<SolidColorBrush | ||
x:Key="CloseButtonBackgroundPressed" | ||
Opacity="0.9" | ||
Color="{ThemeResource CloseButtonColor}" /> | ||
<SolidColorBrush | ||
x:Key="CloseButtonForegroundPressed" | ||
Opacity="0.7" | ||
Color="White" /> | ||
<SolidColorBrush x:Key="CloseButtonBackground" Color="#00C42B1C" /> | ||
<Color x:Key="CloseButtonBackgroundColor">#00C42B1C</Color> | ||
<StaticResource x:Key="RestoreButtonGlyph" ResourceKey="RestoreGlyph" /> | ||
</ResourceDictionary> | ||
|
||
<ResourceDictionary x:Key="Dark"> | ||
<Color x:Key="CloseButtonColor">#C42B1C</Color> | ||
<StaticResource x:Key="CaptionButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondary" /> | ||
<StaticResource x:Key="CaptionButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiary" /> | ||
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SystemControlForegroundBaseHighBrush" /> | ||
<StaticResource x:Key="CaptionButtonForegroundColor" ResourceKey="SystemBaseHighColor" /> | ||
<StaticResource x:Key="CaptionButtonForegroundPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" /> | ||
<StaticResource x:Key="CaptionButtonForegroundPressed" ResourceKey="SystemControlForegroundBaseHighBrush" /> | ||
<SolidColorBrush x:Key="CaptionButtonBackground" Color="Transparent" /> | ||
<Color x:Key="CaptionButtonBackgroundColor">Transparent</Color> | ||
<Color x:Key="CaptionButtonNotActiveColor">White</Color> | ||
<Color x:Key="CaptionButtonDisabledColor">White</Color> | ||
<SolidColorBrush x:Key="CloseButtonBackgroundPointerOver" Color="{ThemeResource CloseButtonColor}" /> | ||
<SolidColorBrush x:Key="CloseButtonForegroundPointerOver" Color="White" /> | ||
<SolidColorBrush | ||
x:Key="CaptionButtonForegroundNotActive" | ||
Opacity="0.35" | ||
Color="{StaticResource CaptionButtonNotActiveColor}" /> | ||
<SolidColorBrush | ||
x:Key="CaptionButtonForegroundDisabled" | ||
Opacity="0.35" | ||
Color="{StaticResource CaptionButtonDisabledColor}" /> | ||
<SolidColorBrush | ||
x:Key="CloseButtonBackgroundPressed" | ||
Opacity="0.9" | ||
Color="{ThemeResource CloseButtonColor}" /> | ||
<SolidColorBrush | ||
x:Key="CloseButtonForegroundPressed" | ||
Opacity="0.7" | ||
Color="White" /> | ||
<SolidColorBrush x:Key="CloseButtonBackground" Color="#00C42B1C" /> | ||
<Color x:Key="CloseButtonBackgroundColor">#00C42B1C</Color> | ||
<StaticResource x:Key="RestoreButtonGlyph" ResourceKey="RestoreGlyph" /> | ||
</ResourceDictionary> | ||
|
||
<ResourceDictionary x:Key="HighContrast"> | ||
<SolidColorBrush x:Key="CaptionButtonBackground" Color="{ThemeResource SystemColorButtonFaceColor}" /> | ||
<StaticResource x:Key="CaptionButtonBackgroundColor" ResourceKey="SystemColorButtonFaceColor" /> | ||
<SolidColorBrush x:Key="CaptionButtonBackgroundPointerOver" Color="{ThemeResource SystemColorHighlightColor}" /> | ||
<SolidColorBrush x:Key="CaptionButtonBackgroundPressed" Color="{ThemeResource SystemColorHighlightColor}" /> | ||
<SolidColorBrush x:Key="CaptionButtonForeground" Color="{ThemeResource SystemColorButtonTextColor}" /> | ||
<StaticResource x:Key="CaptionButtonForegroundColor" ResourceKey="SystemColorButtonTextColor" /> | ||
<SolidColorBrush x:Key="CaptionButtonForegroundPointerOver" Color="{ThemeResource SystemColorHighlightTextColor}" /> | ||
<SolidColorBrush x:Key="CaptionButtonForegroundPressed" Color="{ThemeResource SystemColorHighlightTextColor}" /> | ||
<SolidColorBrush x:Key="CloseButtonBackgroundPointerOver" Color="{ThemeResource SystemColorHighlightColor}" /> | ||
<SolidColorBrush x:Key="CloseButtonForegroundPointerOver" Color="{ThemeResource SystemColorHighlightTextColor}" /> | ||
<SolidColorBrush x:Key="CloseButtonBackgroundPressed" Color="{ThemeResource SystemColorHighlightColor}" /> | ||
<SolidColorBrush x:Key="CloseButtonForegroundPressed" Color="{ThemeResource SystemColorHighlightTextColor}" /> | ||
<StaticResource x:Key="RestoreButtonGlyph" ResourceKey="RestoreGlyphContrast" /> | ||
</ResourceDictionary> | ||
</ResourceDictionary.ThemeDictionaries> | ||
|
||
<x:String x:Key="CaptionButtonGlyph"></x:String> | ||
<x:String x:Key="MinimizeGlyph"></x:String> | ||
<x:String x:Key="MaximizeGlyph"></x:String> | ||
<x:String x:Key="RestoreGlyph"></x:String> | ||
<x:String x:Key="CloseGlyph"></x:String> | ||
<x:String x:Key="MinimizeGlyphContrast"></x:String> | ||
<x:String x:Key="MaximizeGlyphContrast"></x:String> | ||
<x:String x:Key="RestoreGlyphContrast"></x:String> | ||
<x:String x:Key="CloseGlyphContrast"></x:String> | ||
<x:Double x:Key="CaptionButtonHeightWindowed">30.0</x:Double> | ||
<x:Double x:Key="CaptionButtonHeightMaximized">32.0</x:Double> | ||
|
||
<Style x:Key="CaptionButton" TargetType="Button"> | ||
<Setter Property="BorderThickness" Value="0" /> | ||
<Setter Property="Background" Value="{ThemeResource CaptionButtonBackground}" /> | ||
<Setter Property="IsTabStop" Value="False" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="Button"> | ||
<Border | ||
x:Name="ButtonBaseElement" | ||
Padding="{TemplateBinding Padding}" | ||
AutomationProperties.AccessibilityView="Raw" | ||
Background="{TemplateBinding Background}" | ||
BackgroundSizing="{TemplateBinding BackgroundSizing}" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
CornerRadius="{TemplateBinding CornerRadius}"> | ||
<Viewbox Width="10" Height="10"> | ||
<FontIcon | ||
x:Name="ButtonIcon" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
Foreground="{ThemeResource CaptionButtonForeground}" | ||
Glyph="{ThemeResource CaptionButtonGlyph}" /> | ||
</Viewbox> | ||
|
||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup x:Name="CommonStates"> | ||
<VisualStateGroup.Transitions> | ||
<VisualTransition From="PointerOver" To="Normal"> | ||
<Storyboard> | ||
<ColorAnimation | ||
Storyboard.TargetName="ButtonBaseElement" | ||
Storyboard.TargetProperty="(UIElement.Background).(SolidColorBrush.Color)" | ||
To="{ThemeResource CaptionButtonBackgroundColor}" | ||
Duration="0:0:0.15" /> | ||
<ColorAnimation | ||
Storyboard.TargetName="ButtonIcon" | ||
Storyboard.TargetProperty="(UIElement.Foreground).(SolidColorBrush.Color)" | ||
To="{ThemeResource CaptionButtonForegroundColor}" | ||
Duration="0:0:0.1" /> | ||
</Storyboard> | ||
</VisualTransition> | ||
</VisualStateGroup.Transitions> | ||
|
||
<VisualState x:Name="Normal"> | ||
<VisualState.Setters> | ||
<Setter Target="ButtonBaseElement.Background" Value="{ThemeResource CaptionButtonBackground}" /> | ||
<Setter Target="ButtonIcon.Foreground" Value="{ThemeResource CaptionButtonForeground}" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
|
||
<VisualState x:Name="PointerOver"> | ||
<VisualState.Setters> | ||
<Setter Target="ButtonBaseElement.Background" Value="{ThemeResource CaptionButtonBackgroundPointerOver}" /> | ||
<Setter Target="ButtonIcon.Foreground" Value="{ThemeResource CaptionButtonForegroundPointerOver}" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
|
||
<VisualState x:Name="Pressed"> | ||
<VisualState.Setters> | ||
<Setter Target="ButtonBaseElement.Background" Value="{ThemeResource CaptionButtonBackgroundPressed}" /> | ||
<Setter Target="ButtonIcon.Foreground" Value="{ThemeResource CaptionButtonForegroundPressed}" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
|
||
<VisualState x:Name="NotActive"> | ||
<VisualState.Setters> | ||
<Setter Target="ButtonBaseElement.Background" Value="{ThemeResource CaptionButtonBackground}" /> | ||
<Setter Target="ButtonIcon.Foreground" Value="{ThemeResource CaptionButtonForegroundNotActive}" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
|
||
<VisualState x:Name="Disabled"> | ||
<VisualState.Setters> | ||
<Setter Target="ButtonBaseElement.Background" Value="{ThemeResource CaptionButtonBackground}" /> | ||
<Setter Target="ButtonIcon.Foreground" Value="{ThemeResource CaptionButtonForegroundDisabled}" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
|
||
<VisualStateGroup x:Name="MinMaxStates"> | ||
<VisualState x:Name="WindowStateNormal" /> | ||
|
||
<VisualState x:Name="WindowStateMaximized"> | ||
<VisualState.Setters> | ||
<Setter Target="ButtonIcon.Glyph" Value="{ThemeResource RestoreButtonGlyph}" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
</Border> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
</ResourceDictionary> |
Oops, something went wrong.