Skip to content

Commit

Permalink
up 修复深色主题
Browse files Browse the repository at this point in the history
  • Loading branch information
Coloryr committed Jul 18, 2024
1 parent f1f9f6e commit d589c98
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 35 deletions.
26 changes: 25 additions & 1 deletion src/ColorMC.Gui/Manager/ThemeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ public static IBrush GetColor(string key)
{
return s_theme.AllBorder;
}
else if (key == "ButtonBG")
{
return s_theme.ButtonBG;
}
else if (key == "ButtonOver")
{
return s_theme.ButtonOver;
}
else if (key == "ButtonBorder")
{
return s_theme.ButtonBorder;
Expand Down Expand Up @@ -203,6 +211,14 @@ public static IBrush GetColor(string key)
{
return s_theme.OverBrushColor;
}
else if (key == "SelectItemBG")
{
return s_theme.SelectItemBG;
}
else if (key == "SelectItemOver")
{
return s_theme.SelectItemOver;
}
else if (key == "RandomColor")
{
return s_colors[s_random.Next(s_colors.Length)];
Expand Down Expand Up @@ -410,11 +426,15 @@ static ThemeManager()
GameItemBG = Brush.Parse("#FFF2F2F2"),
TopViewBG = Brush.Parse("#886D6D6D"),
AllBorder = Brush.Parse("#FFe5e7eb"),
ButtonBG = Brush.Parse("#FFFFFFFF"),
ButtonOver = Brush.Parse("#FFFFFFFF"),
ButtonBorder = Brush.Parse("#FFD4D4D8"),
TopBGColor = Brush.Parse("#CFF4F4F5"),
TopGridColor = Brush.Parse("#FFFFFFFF"),
OverBGColor = Brush.Parse("#FFFFFFFF"),
OverBrushColor = Brush.Parse("#FFe5e5e5")
OverBrushColor = Brush.Parse("#FFe5e5e5"),
SelectItemBG = Brush.Parse("#FFE8E8E8"),
SelectItemOver = Brush.Parse("#FFCCCCCC"),
};

s_dark = new()
Expand All @@ -430,11 +450,15 @@ static ThemeManager()
GameItemBG = Brush.Parse("#FFc7c7cb"),
TopViewBG = Brush.Parse("#886D6D6D"),
AllBorder = Brush.Parse("#FFe5e7eb"),
ButtonBG = Brush.Parse("#FF000000"),
ButtonOver = Brush.Parse("#FF141414"),
ButtonBorder = Brush.Parse("#FFD4D4D8"),
TopBGColor = Brush.Parse("#CFF4F4F5"),
TopGridColor = Brush.Parse("#FF202020"),
OverBGColor = Brush.Parse("#FF000000"),
OverBrushColor = Brush.Parse("#FF1d1d1d"),
SelectItemBG = Brush.Parse("#FF353535"),
SelectItemOver = Brush.Parse("#FF454545"),
};
}
}
4 changes: 4 additions & 0 deletions src/ColorMC.Gui/Objs/ThemeObj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public record ThemeObj
public IBrush GameItemBG;
public IBrush TopViewBG;
public IBrush AllBorder;
public IBrush ButtonBG;
public IBrush ButtonOver;
/// <summary>
/// 按钮边框背景色
/// </summary>
Expand All @@ -41,4 +43,6 @@ public record ThemeObj
/// 覆盖层边框颜色
/// </summary>
public IBrush OverBrushColor;
public IBrush SelectItemBG;
public IBrush SelectItemOver;
}
14 changes: 7 additions & 7 deletions src/ColorMC.Gui/Resource/Icon/AddMenu/item4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/ColorMC.Gui/Style/Button.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<Style Selector="Button">
<Setter Property="Foreground" Value="{setting:Theme FontColor}" />
<Setter Property="BorderBrush" Value="{setting:Theme ButtonBorder}" />
<Setter Property="Background" Value="#FFFFFF" />
<Setter Property="Background" Value="{setting:Theme ButtonBG}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="1" />
Expand All @@ -42,7 +42,7 @@
<Setter Property="RenderTransform" Value="scale(0.95)" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="#FFf4f4f5" />
<Setter Property="Background" Value="{setting:Theme ButtonOver}" />
<Setter Property="BorderBrush" Value="{setting:Theme ButtonBorder}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
Expand Down Expand Up @@ -77,7 +77,7 @@
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="#FFFFFF" />
<Setter Property="Background" Value="{setting:Theme ButtonOver}" />
</Style>
<Style Selector="^ /template/ Border#PART_Border">
<Setter Property="BoxShadow" Value="0 1 2 0 #1A000000" />
Expand Down Expand Up @@ -117,7 +117,7 @@
<Setter Property="RenderTransform" Value="scale(1)" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="#FFCCCCCC" />
<Setter Property="Background" Value="Transparent" />
</Style>
</Style>
</Styles>
4 changes: 2 additions & 2 deletions src/ColorMC.Gui/Style/ColorPicker.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</Design.PreviewWith>

<Style Selector="ColorPicker DropDownButton">
<Setter Property="Background" Value="{setting:Theme TopBGColor}" />
<Setter Property="BorderBrush" Value="#44808080" />
<Setter Property="Background" Value="{setting:Theme ButtonBG}" />
<Setter Property="BorderBrush" Value="{setting:Theme AllBorder}" />
<Setter Property="BorderThickness" Value="1" />

<Style Selector="^:pointerover /template/ Border#RootBorder">
Expand Down
2 changes: 1 addition & 1 deletion src/ColorMC.Gui/Style/ComboBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Style Selector="ComboBox">
<Setter Property="MaxDropDownHeight" Value="300" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="#FFFFFFFF" />
<Setter Property="Background" Value="{setting:Theme ButtonBG}" />
<Setter Property="BorderBrush" Value="{setting:Theme AllBorder}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="5" />
Expand Down
18 changes: 4 additions & 14 deletions src/ColorMC.Gui/Style/ListBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
<Design.PreviewWith>
<Border Padding="20">
<StackPanel>
<ListBox>
<Label Margin="0,3,0,0" Content="{setting:Localize AddGameWindow.Tabs.Text1}" />
<Label Margin="0,3,0,0" Content="{setting:Localize AddGameWindow.Tabs.Text2}" />
<Label Margin="0,3,0,0" Content="{setting:Localize AddGameWindow.Tabs.Text3}" />
</ListBox>
<ListBoxItem Content="test" IsSelected="True" />
<ListBoxItem
Classes="down"
Expand All @@ -19,13 +14,8 @@
</Border>
</Design.PreviewWith>

<Style Selector="ListBox">
<Setter Property="Foreground" Value="{setting:Theme FontColor}" />
<Setter Property="Background" Value="Transparent" />
</Style>

<Style Selector="ListBoxItem">
<Setter Property="Padding" Value="5,5,15,5" />
<Style Selector="ListBoxItem.t1">
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0,2,0,2" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
Expand Down Expand Up @@ -71,10 +61,10 @@
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^:selected /template/Border#PART_ContentBorder">
<Setter Property="Background" Value="#FFE8E8E8" />
<Setter Property="Background" Value="{setting:Theme SelectItemBG}" />
</Style>
<Style Selector="^:pointerover /template/Border#PART_ContentBorder">
<Setter Property="Background" Value="#FFCCCCCC" />
<Setter Property="Background" Value="{setting:Theme SelectItemOver}" />
</Style>
<Style Selector="^:disabled /template/Border#PART_ContentBorder">
<Setter Property="Background" Value="#EEAAAAAA" />
Expand Down
2 changes: 1 addition & 1 deletion src/ColorMC.Gui/Style/NumericUpDown.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<Style Selector="NumericUpDown">
<Setter Property="Foreground" Value="{setting:Theme FontColor}" />
<Setter Property="Background" Value="#FFFFFFFF" />
<Setter Property="Background" Value="{setting:Theme ButtonBG}" />
<Setter Property="BorderBrush" Value="{setting:Theme AllBorder}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="5" />
Expand Down
2 changes: 0 additions & 2 deletions src/ColorMC.Gui/UI/Controls/HeadControl.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,12 @@
Name="TitleShow"
Margin="5,0,0,0"
VerticalAlignment="Center"
Foreground="#000000"
Text="{Binding Title}"
TextTrimming="CharacterEllipsis" />
<TextBlock
Name="TitleShow1"
Margin="5,0,0,0"
VerticalAlignment="Center"
Foreground="#000000"
Text="{Binding Title1}"
TextTrimming="CharacterEllipsis" />
</DockPanel>
Expand Down
3 changes: 2 additions & 1 deletion src/ColorMC.Gui/UI/Controls/Main/Live2dControl.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
Margin="0,0,0,50"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
BorderBrush="Black"
Background="{setting:Theme ButtonBG}"
BorderBrush="{setting:Theme AllBorder}"
BorderThickness="1"
CornerRadius="30"
IsVisible="False">
Expand Down
8 changes: 6 additions & 2 deletions src/ColorMC.Gui/UI/Controls/MenuSideControl.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<ListBoxItem IsSelected="{Binding IsCheck}">
<ListBoxItem
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
Classes="t1"
IsSelected="{Binding IsCheck}">
<Button
Padding="0"
Padding="5,5,15,5"
Classes="items"
Command="{Binding Select}">
<StackPanel Orientation="Horizontal">
Expand Down

0 comments on commit d589c98

Please sign in to comment.