forked from samhocevar/wincompose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrades to .net 4.8.1 due to 4.7.2 no longer being supported Updated theming to use Fluent design (from Wpf-Ui by wpfui.lepo.co) with dark mode and live theme switching
- Loading branch information
Showing
18 changed files
with
833 additions
and
502 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
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 |
---|---|---|
|
@@ -25,6 +25,7 @@ public Application() | |
try | ||
{ | ||
InitializeComponent(); | ||
Settings.SetTheme(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
|
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,245 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
|
||
<Style TargetType="{x:Type TabControl}"> | ||
<Setter Property="Foreground" Value="{DynamicResource TabViewForeground}" /> | ||
<Setter Property="Background" Value="{DynamicResource TabViewBackground}" /> | ||
<Setter Property="BorderBrush" Value="{DynamicResource TabViewBorderBrush}" /> | ||
<Setter Property="OverridesDefaultStyle" Value="True" /> | ||
<Setter Property="SnapsToDevicePixels" Value="True" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type TabControl}"> | ||
<Grid KeyboardNavigation.TabNavigation="Local"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<TabPanel | ||
x:Name="HeaderPanel" | ||
Grid.Row="0" | ||
Margin="0" | ||
Panel.ZIndex="1" | ||
Background="Transparent" | ||
IsItemsHost="True" | ||
KeyboardNavigation.TabIndex="1" /> | ||
<Border | ||
x:Name="Border" | ||
Grid.Row="1" | ||
Background="{TemplateBinding Background}" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="0,1,0,0" | ||
CornerRadius="0,4,4,4" | ||
KeyboardNavigation.DirectionalNavigation="Contained" | ||
KeyboardNavigation.TabIndex="2" | ||
KeyboardNavigation.TabNavigation="Local"> | ||
<ContentPresenter | ||
x:Name="PART_SelectedContentHost" | ||
Margin="0" | ||
HorizontalAlignment="Stretch" | ||
VerticalAlignment="Stretch" | ||
ContentSource="SelectedContent" | ||
TextElement.Foreground="{TemplateBinding Foreground}" /> | ||
</Border> | ||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup x:Name="CommonStates"> | ||
<VisualState x:Name="Disabled" /> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
</Grid> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
<Style TargetType="{x:Type TabItem}"> | ||
<Setter Property="Background" Value="{DynamicResource TabViewItemHeaderBackground}" /> | ||
<Setter Property="BorderBrush" Value="Transparent" /> | ||
<Setter Property="HorizontalAlignment" Value="Stretch" /> | ||
<Setter Property="VerticalAlignment" Value="Stretch" /> | ||
<Setter Property="VerticalContentAlignment" Value="Stretch" /> | ||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> | ||
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" /> | ||
<Setter Property="KeyboardNavigation.IsTabStop" Value="True" /> | ||
<Setter Property="Focusable" Value="True" /> | ||
<Setter Property="OverridesDefaultStyle" Value="True" /> | ||
<Setter Property="SnapsToDevicePixels" Value="True" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type TabItem}"> | ||
<Grid x:Name="Root"> | ||
<Border | ||
x:Name="Border" | ||
MinHeight="{TemplateBinding MinHeight}" | ||
MinWidth="{TemplateBinding MaxWidth}" | ||
Margin="0" | ||
Padding="6" | ||
Background="{TemplateBinding Background}" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="1,1,1,0" | ||
CornerRadius="8,8,0,0"> | ||
<ContentPresenter | ||
x:Name="ContentSite" | ||
Margin="0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
ContentSource="Header" | ||
RecognizesAccessKey="True" /> | ||
</Border> | ||
|
||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup x:Name="SelectionStates"> | ||
<VisualState x:Name="Unselected" /> | ||
<VisualState x:Name="Selected" /> | ||
|
||
</VisualStateGroup> | ||
<VisualStateGroup x:Name="CommonStates"> | ||
<VisualState x:Name="Normal" /> | ||
<VisualState x:Name="MouseOver" /> | ||
<VisualState x:Name="Disabled"> | ||
<Storyboard> | ||
<DoubleAnimation | ||
Storyboard.TargetName="Border" | ||
Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Opacity)" | ||
From="0.0" | ||
To="0.5" | ||
Duration="0:0:.16" /> | ||
</Storyboard> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
</Grid> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="IsSelected" Value="True"> | ||
<Setter Property="Panel.ZIndex" Value="100" /> | ||
<Setter TargetName="Border" Property="Background" Value="{DynamicResource TabViewItemHeaderBackgroundSelected}" /> | ||
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource TabViewSelectedItemBorderBrush}" /> | ||
<Setter Property="Foreground" Value="{DynamicResource TabViewItemForegroundSelected}" /> | ||
</Trigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
<Style x:Key="DefaultListBoxStyle" TargetType="{x:Type ListBox}"> | ||
<Setter Property="Background" Value="{DynamicResource ListBoxBackground}" /> | ||
<Setter Property="Margin" Value="0" /> | ||
<Setter Property="Padding" Value="0" /> | ||
<Setter Property="BorderThickness" Value="0" /> | ||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> | ||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> | ||
<Setter Property="ScrollViewer.CanContentScroll" Value="True" /> | ||
<Setter Property="VerticalContentAlignment" Value="Center" /> | ||
<Setter Property="VirtualizingPanel.IsVirtualizing" Value="True" /> | ||
<Setter Property="VirtualizingPanel.VirtualizationMode" Value="Standard" /> | ||
<Setter Property="SnapsToDevicePixels" Value="True" /> | ||
<Setter Property="OverridesDefaultStyle" Value="True" /> | ||
<Setter Property="ItemsPanel"> | ||
<Setter.Value> | ||
<ItemsPanelTemplate> | ||
<VirtualizingStackPanel IsVirtualizing="{TemplateBinding VirtualizingPanel.IsVirtualizing}" VirtualizationMode="{TemplateBinding VirtualizingPanel.VirtualizationMode}" /> | ||
</ItemsPanelTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type ListBox}"> | ||
<Border Name="Bd" | ||
Background="{TemplateBinding Background}" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}"> | ||
<ScrollViewer | ||
x:Name="PART_ContentHost" | ||
Padding="{TemplateBinding Padding}" | ||
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}" | ||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" | ||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> | ||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> | ||
</ScrollViewer> | ||
</Border> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="IsGrouping" Value="True"> | ||
<Setter Property="ScrollViewer.CanContentScroll" Value="False" /> | ||
</Trigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
<Style BasedOn="{StaticResource DefaultListBoxStyle}" TargetType="{x:Type ListBox}" /> | ||
|
||
<SolidColorBrush x:Key="GroupBox.Border" Color="LightGray" /> | ||
|
||
<BorderGapMaskConverter x:Key="BorderGapMaskConverter"/> | ||
|
||
<Style x:Key="{x:Type GroupBox}" TargetType="{x:Type GroupBox}"> | ||
<Setter Property="BorderBrush" Value="{StaticResource GroupBox.Border}"/> | ||
<Setter Property="BorderThickness" Value="1"/> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type GroupBox}"> | ||
<Grid SnapsToDevicePixels="true"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="6"/> | ||
<ColumnDefinition Width="Auto"/> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="6"/> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="*"/> | ||
<RowDefinition Height="6"/> | ||
</Grid.RowDefinitions> | ||
<!-- Separate Border for the background because if the background is set in the Border with the Header the opacity mask will be applied to the background as well. --> | ||
<Border Grid.Row="1" | ||
Grid.RowSpan="3" | ||
Grid.Column="0" | ||
Grid.ColumnSpan="4" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
BorderBrush="Transparent" | ||
Background="{TemplateBinding Background}"/> | ||
|
||
<Border Grid.Row="1" | ||
Grid.RowSpan="3" | ||
Grid.ColumnSpan="4" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
BorderBrush="{TemplateBinding BorderBrush}"> | ||
<Border.OpacityMask> | ||
<MultiBinding Converter="{StaticResource BorderGapMaskConverter}" | ||
ConverterParameter="7"> | ||
<Binding ElementName="Header" | ||
Path="ActualWidth"/> | ||
<Binding RelativeSource="{RelativeSource Self}" | ||
Path="ActualWidth"/> | ||
<Binding RelativeSource="{RelativeSource Self}" | ||
Path="ActualHeight"/> | ||
</MultiBinding> | ||
</Border.OpacityMask> | ||
</Border> | ||
|
||
<!-- ContentPresenter for the header --> | ||
<Border x:Name="Header" | ||
Padding="3,0,3,0" | ||
Grid.Row="0" | ||
Grid.RowSpan="2" | ||
Grid.Column="1"> | ||
<ContentPresenter ContentSource="Header" | ||
RecognizesAccessKey="True" | ||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> | ||
</Border> | ||
<!-- Primary content for GroupBox --> | ||
<ContentPresenter Grid.Row="2" | ||
Grid.Column="1" | ||
Grid.ColumnSpan="2" | ||
Margin="{TemplateBinding Padding}" | ||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> | ||
</Grid> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
</ResourceDictionary> |
Oops, something went wrong.