mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
common: refactor common library pt2 (#8588)
- remove common lib - split settings, remove common-md - move ipc interop/kb_layout to interop - rename core -> settings, settings -> old_settings - os-detect header-only; interop -> PowerToysInterop - split notifications, move single-use headers where they're used - winstore lib - rename com utils - rename Updating and Telemetry projects - rename core -> settings-ui and remove examples folder - rename settings-ui folder + consisent common/version include
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Style x:Key="AddItemAppBarButtonStyle" TargetType="AppBarButton">
|
||||
<Setter Property="Background" Value="{ThemeResource AppBarButtonBackground}"/>
|
||||
<Setter Property="Foreground" Value="{ThemeResource AppBarButtonForeground}"/>
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource AppBarButtonBorderBrush}"/>
|
||||
<Setter Property="Width" Value="Auto"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="MaxWidth" Value="500"/>
|
||||
<Setter Property="VerticalAlignment" Value="Top"/>
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
|
||||
<Setter Property="FontWeight" Value="Normal"/>
|
||||
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}"/>
|
||||
<Setter Property="AllowFocusOnInteraction" Value="False"/>
|
||||
<Setter Property="KeyboardAcceleratorPlacementMode" Value="Hidden"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="AppBarButton">
|
||||
<Grid x:Name="Root" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding CornerRadius}" MinWidth="{TemplateBinding MinWidth}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal"/>
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemListLowColor}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<PointerUpThemeAnimation Storyboard.TargetName="ContentRoot"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemListMediumColor}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<PointerDownThemeAnimation Storyboard.TargetName="ContentRoot"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundDisabled}"/>
|
||||
<Setter Target="AppBarButtonInnerBorder.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushDisabled}"/>
|
||||
<Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundDisabled}"/>
|
||||
<Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundDisabled}"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
|
||||
|
||||
<Grid x:Name="ContentRoot">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="320"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border x:Name="AppBarButtonInnerBorder" Margin="10" CornerRadius="4" Height="40" Width="40" Background="{ThemeResource ButtonBackground}">
|
||||
<ContentPresenter x:Name="Content" Content="{TemplateBinding Icon}" Foreground="{TemplateBinding Foreground}" RenderTransformOrigin="0.5,0.5">
|
||||
<ContentPresenter.RenderTransform>
|
||||
<CompositeTransform ScaleX="0.8" ScaleY="0.8"/>
|
||||
</ContentPresenter.RenderTransform>
|
||||
</ContentPresenter>
|
||||
</Border>
|
||||
|
||||
<TextBlock x:Name="TextLabel" Grid.Column="1" AutomationProperties.AccessibilityView="Raw" Foreground="{TemplateBinding Foreground}" Margin="0,-2,0,0" VerticalAlignment="Center" FontSize="14" Text="{TemplateBinding Label}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,9 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Style TargetType="Page" x:Key="PageStyle">
|
||||
<Setter Property="Background" Value="{ThemeResource ApplicationPageBackgroundThemeBrush}" />
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,31 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<!--Common texts-->
|
||||
<Style x:Key="PageTitleStyle" TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="FontWeight" Value="SemiLight" />
|
||||
<Setter Property="FontSize" Value="{StaticResource LargeFontSize}" />
|
||||
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
|
||||
<Setter Property="TextWrapping" Value="NoWrap" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="BodyTextStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="FontSize" Value="{StaticResource MediumFontSize}" />
|
||||
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
</Style>
|
||||
|
||||
|
||||
<Style x:Key="SettingsGroupTitleStyle" TargetType="TextBlock" BasedOn="{StaticResource SubtitleTextBlockStyle}">
|
||||
<Setter Property="Margin" Value="0,34,0,4" />
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="AutomationProperties.HeadingLevel" Value="Level2" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SettingsGroupTitleStyleAsHeader" TargetType="TextBlock" BasedOn="{StaticResource SettingsGroupTitleStyle}">
|
||||
<Setter Property="Margin" Value="0,0,0,4" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,5 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SolidColorBrush x:Key="ThemeControlForegroundBaseHighBrush" Color="{ThemeResource SystemBaseHighColor}"/>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,8 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<x:Double x:Key="LargeFontSize">24</x:Double>
|
||||
<x:Double x:Key="MediumFontSize">16</x:Double>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,19 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Styles">
|
||||
|
||||
<x:Double x:Key="SidePanelWidth">240</x:Double>
|
||||
|
||||
<!-- Breakpoint for wide layout (side panel next to content) -->
|
||||
<x:Double x:Key="WideLayoutMinWidth">720</x:Double>
|
||||
|
||||
<!-- Breakpoint for small layout (side panel above content) -->
|
||||
<x:Double x:Key="SmallLayoutMinWidth">600</x:Double>
|
||||
|
||||
<!-- Column spacing between content and sidepanel -->
|
||||
<x:Double x:Key="DefaultColumnSpacing">24</x:Double>
|
||||
|
||||
<!-- Row spacing between content and sidepanel (in small mode) -->
|
||||
<x:Double x:Key="DefaultRowSpacing">24</x:Double>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,36 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<!--Medium size margins-->
|
||||
<Thickness x:Key="MediumLeftMargin">24,0,0,0</Thickness>
|
||||
<Thickness x:Key="MediumTopMargin">0,24,0,0</Thickness>
|
||||
<Thickness x:Key="MediumLeftRightMargin">24,0,24,0</Thickness>
|
||||
<Thickness x:Key="MediumRightMargin">0,0,24,0</Thickness>
|
||||
<Thickness x:Key="MediumTopBottomMargin">0,24,0,24</Thickness>
|
||||
<Thickness x:Key="MediumLeftTopRightBottomMargin">24,24,24,24</Thickness>
|
||||
<Thickness x:Key="MediumLeftRightBottomMargin">24,0,24,24</Thickness>
|
||||
<Thickness x:Key="MediumBottomMargin">0,0,0,24</Thickness>
|
||||
|
||||
<!--Small size margins-->
|
||||
<Thickness x:Key="SmallLeftMargin">12, 0, 0, 0</Thickness>
|
||||
<Thickness x:Key="SmallTopMargin">0, 12, 0, 0</Thickness>
|
||||
<Thickness x:Key="SmallTopBottomMargin">0, 12, 0, 12</Thickness>
|
||||
<Thickness x:Key="SmallBottomMargin">0, 0, 0, 12</Thickness>
|
||||
<Thickness x:Key="SmallLeftRightMargin">12, 0, 12, 0</Thickness>
|
||||
<Thickness x:Key="SmallRightMargin">0, 0, 12, 0</Thickness>
|
||||
<Thickness x:Key="SmallLeftRightBottomMargin">12, 0, 12, 12</Thickness>
|
||||
<Thickness x:Key="SmallLeftTopRightBottomMargin">12, 12, 12, 12</Thickness>
|
||||
|
||||
<Thickness x:Key="AddItemButtonMargin">-10, 12, 0, 0</Thickness>
|
||||
|
||||
<!--Extra Small size margins-->
|
||||
<Thickness x:Key="XSmallLeftMargin">8, 0, 0, 0</Thickness>
|
||||
<Thickness x:Key="XSmallTopMargin">0, 8, 0, 0</Thickness>
|
||||
<Thickness x:Key="XSmallBottomMargin">0, 0, 0, 8</Thickness>
|
||||
<Thickness x:Key="XSmallLeftTopRightBottomMargin">8, 8, 8, 8</Thickness>
|
||||
|
||||
<!--Extra Extra Small size margins-->
|
||||
<Thickness x:Key="XXSmallTopMargin">0, 4, 0, 0</Thickness>
|
||||
<Thickness x:Key="XXSmallTopRightBottomMargin">0, 4, 4, 4</Thickness>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user