Skip to content

Commit

Permalink
SolidColorBrushリソースを作成
Browse files Browse the repository at this point in the history
  • Loading branch information
yuto-trd committed Sep 3, 2024
1 parent 755afca commit f30b94b
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 22 deletions.
6 changes: 3 additions & 3 deletions samples/ReDocking.Sample/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<ui:SymbolIcon Symbol="Setting" />
</Button>
</Grid>
<Border Grid.Row="1" Background="{DynamicResource SideDividerBrush}" />
<Border Grid.Row="1" Background="{DynamicResource ReDockingDividerBrush}" />
<dock:ReDockHost Grid.Row="2"
ButtonDisplayModeChanged="OnSideBarButtonDisplayModeChanged"
ButtonMove="OnSideBarButtonDrop"
Expand Down Expand Up @@ -113,7 +113,7 @@
</dock:ReDockHost.DockAreas>
<Grid ColumnDefinitions="40,*,40">
<dock:SideBar Name="LeftSideBar"
BorderBrush="{DynamicResource SideDividerBrush}"
BorderBrush="{DynamicResource ReDockingDividerBrush}"
BorderThickness="0,0,1,0"
ItemTemplate="{StaticResource LeftSideBarButtonDataTemplate}"
Location="Left"
Expand Down Expand Up @@ -179,7 +179,7 @@
</dock:ReDock>
<dock:SideBar Name="RightSideBar"
Grid.Column="2"
BorderBrush="{DynamicResource SideDividerBrush}"
BorderBrush="{DynamicResource ReDockingDividerBrush}"
BorderThickness="1,0,0,0"
ItemTemplate="{StaticResource RightSideBarButtonDataTemplate}"
Location="Right"
Expand Down
2 changes: 1 addition & 1 deletion src/ReDocking/ControlThemes/HorizontallySplittedView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Border Background="{TemplateBinding Background}">
<Border Width="1"
Margin="2,0"
Background="{DynamicResource SideDividerBrush}" />
Background="{DynamicResource ReDockingDividerBrush}" />
</Border>
</ControlTemplate>
</Setter>
Expand Down
4 changes: 2 additions & 2 deletions src/ReDocking/ControlThemes/SideBar.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<Border Name="PART_UpperDivider"
Height="1"
Margin="2,8"
Background="{DynamicResource DividerStrokeColorDefaultBrush}" />
Background="{DynamicResource ReDockingSideBarDividerBrush}" />
<ItemsControl Name="PART_UpperBottomTools"
ItemTemplate="{TemplateBinding ItemTemplate}"
ItemsPanel="{StaticResource SideBarButtonItemsPanelTemplate}"
Expand All @@ -46,7 +46,7 @@
<Border Name="PART_LowerDivider"
Height="1"
Margin="2,8"
Background="{DynamicResource DividerStrokeColorDefaultBrush}" />
Background="{DynamicResource ReDockingSideBarDividerBrush}" />
<ItemsControl Name="PART_LowerBottomTools"
ItemTemplate="{TemplateBinding ItemTemplate}"
ItemsPanel="{StaticResource SideBarButtonItemsPanelTemplate}"
Expand Down
24 changes: 14 additions & 10 deletions src/ReDocking/ControlThemes/SideBarButton.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="Padding" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ReDockingSideBarButtonBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ReDockingSideBarButtonForeground}" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="CornerRadius" Value="{DynamicResource ReDockingSideBarButtonCornerRadius}" />
<Setter Property="BackgroundSizing" Value="InnerBorderEdge" />
<Setter Property="Template">
<ControlTemplate>
Expand All @@ -39,23 +39,27 @@
</Setter>

<Style Selector="^:checked /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ControlAltFillColorQuarternaryBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ReDockingSideBarButtonBackgroundChecked}" />
<Setter Property="Foreground" Value="{DynamicResource ReDockingSideBarButtonForegroundChecked}" />
</Style>

<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ReDockingSideBarButtonBackgroundPointerOver}" />
<Setter Property="Foreground" Value="{DynamicResource ReDockingSideBarButtonForegroundPointerOver}" />
</Style>

<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorSecondaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ReDockingSideBarButtonBackgroundPressed}" />
<Setter Property="Foreground" Value="{DynamicResource ReDockingSideBarButtonForegroundPressed}" />
</Style>

<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorDisabledBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="Background" Value="{DynamicResource ReDockingSideBarButtonBackgroundDisabled}" />
<Setter Property="Foreground" Value="{DynamicResource ReDockingSideBarButtonForegroundDisabled}" />
</Style>

<Style Selector="^.ghost /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ReDockingGhostBackground}" />
</Style>
</ControlTheme>
</ResourceDictionary>
2 changes: 1 addition & 1 deletion src/ReDocking/ControlThemes/VerticallySplittedView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Border Background="{TemplateBinding Background}">
<Border Height="1"
Margin="0,2"
Background="{DynamicResource SideDividerBrush}" />
Background="{DynamicResource ReDockingDividerBrush}" />
</Border>
</ControlTemplate>
</Setter>
Expand Down
3 changes: 1 addition & 2 deletions src/ReDocking/DockAreaDragDropBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,8 @@ private void CreateDragGhost()
{
DragGhost = new Border
{
Background = AssociatedObject!.FindResource("AccentFillColorDefaultBrush") as IBrush,
Background = AssociatedObject!.FindResource("ReDockingGhostBackground") as IBrush,
IsHitTestVisible = false,
Opacity = 0.5,
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Stretch
};
Expand Down
2 changes: 1 addition & 1 deletion src/ReDocking/SideBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private void OnDragEnter(object? sender, DragEventArgs e)
SupportsLocation(SideBarButtonLocation.LowerBottom);
}

_dragGhost = new SideBarButton { IsChecked = true, IsHitTestVisible = false, Opacity = 0.8 };
_dragGhost = new SideBarButton { IsHitTestVisible = false, Classes = { "ghost" } };
_layer = AdornerLayer.GetAdornerLayer(this);
_layer?.Children.Add(_dragGhost);

Expand Down
43 changes: 41 additions & 2 deletions src/ReDocking/Styles.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,47 @@
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="SideDividerBrush">#0F000000</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingDividerBrush">#0F000000</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingSideBarDividerBrush">#0F000000</SolidColorBrush>

<SolidColorBrush x:Key="ReDockingSideBarButtonBackground">Transparent</SolidColorBrush>
<!-- TextFillColorPrimary -->
<SolidColorBrush x:Key="ReDockingSideBarButtonForeground">#E4000000</SolidColorBrush>
<!-- ControlAltFillColorQuarternary -->
<SolidColorBrush x:Key="ReDockingSideBarButtonBackgroundChecked">#18000000</SolidColorBrush>
<!-- TextFillColorPrimary -->
<SolidColorBrush x:Key="ReDockingSideBarButtonForegroundChecked">#E4000000</SolidColorBrush>
<!-- SubtleFillColorSecondary -->
<SolidColorBrush x:Key="ReDockingSideBarButtonBackgroundPointerOver">#09000000</SolidColorBrush>
<!-- TextFillColorPrimary -->
<SolidColorBrush x:Key="ReDockingSideBarButtonForegroundPointerOver">#E4000000</SolidColorBrush>
<!-- SubtleFillColorTertiary -->
<SolidColorBrush x:Key="ReDockingSideBarButtonBackgroundPressed">#06000000</SolidColorBrush>
<!-- TextFillColorSecondary -->
<SolidColorBrush x:Key="ReDockingSideBarButtonForegroundPressed">#9E000000</SolidColorBrush>
<!-- SubtleFillColorDisabled -->
<SolidColorBrush x:Key="ReDockingSideBarButtonBackgroundDisabled">#00FFFFFF</SolidColorBrush>
<!-- TextFillColorDisabled -->
<SolidColorBrush x:Key="ReDockingSideBarButtonForegroundDisabled">#5C000000</SolidColorBrush>

<SolidColorBrush x:Key="ReDockingGhostBackground">#06000000</SolidColorBrush>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="SideDividerBrush">#12FFFFFF</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingDividerBrush">#15FFFFFF</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingSideBarDividerBrush">#15FFFFFF</SolidColorBrush>

<SolidColorBrush x:Key="ReDockingSideBarButtonBackground">Transparent</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingSideBarButtonForeground">#FFFFFF</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingSideBarButtonBackgroundChecked">#12FFFFFF</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingSideBarButtonForegroundChecked">#FFFFFF</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingSideBarButtonBackgroundPointerOver">#0FFFFFFF</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingSideBarButtonForegroundPointerOver">#FFFFFF</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingSideBarButtonBackgroundPressed">#0AFFFFFF</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingSideBarButtonForegroundPressed">#C5FFFFFF</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingSideBarButtonBackgroundDisabled">#00FFFFFF</SolidColorBrush>
<SolidColorBrush x:Key="ReDockingSideBarButtonForegroundDisabled">#5DFFFFFF</SolidColorBrush>

<SolidColorBrush x:Key="ReDockingGhostBackground">#0AFFFFFF</SolidColorBrush>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<ResourceDictionary.MergedDictionaries>
Expand All @@ -17,6 +54,8 @@
<MergeResourceInclude Source="ControlThemes/HorizontallySplittedView.axaml" />
<MergeResourceInclude Source="ControlThemes/ReDock.axaml" />
</ResourceDictionary.MergedDictionaries>

<CornerRadius x:Key="ReDockingSideBarButtonCornerRadius">4</CornerRadius>
</ResourceDictionary>
</Styles.Resources>
</Styles>

0 comments on commit f30b94b

Please sign in to comment.