Skip to content

Commit

Permalink
修复系统颜色主题与黑板贴颜色主题不同时,设置界面颜色异常的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
STBBRD committed Jul 21, 2024
1 parent 3f93a72 commit 70dc8bf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
d:DesignHeight="450" d:DesignWidth="800">
<Border HorizontalAlignment="Stretch" Height="68"
Background="{DynamicResource {x:Static ui:ThemeKeys.CardBackgroundFillColorDefaultBrushKey}}"
CornerRadius="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
CornerRadius="4" BorderBrush="{DynamicResource {x:Static ui:ThemeKeys.CardStrokeColorDefaultBrushKey}}" BorderThickness="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48"/>
Expand All @@ -18,8 +18,8 @@
</Grid.ColumnDefinitions>
<ui:FontIcon Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Icon="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:GenericSettingsCard}, Mode=FindAncestor}, Path=Icon}" FontSize="20"/>
<ikw:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<TextBlock Foreground="{DynamicResource ForegroundColor}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:GenericSettingsCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource ForegroundColor}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:GenericSettingsCard}, Mode=FindAncestor}, Path=Tip}"/>
<TextBlock Foreground="{DynamicResource {x:Static ui:ThemeKeys.TextControlForegroundKey}}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:GenericSettingsCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource {x:Static ui:ThemeKeys.TextControlForegroundKey}}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:GenericSettingsCard}, Mode=FindAncestor}, Path=Tip}"/>
</ikw:SimpleStackPanel>
<ui:ContentPresenterEx Grid.Column="2" Margin="12,0" VerticalAlignment="Center" Content="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:GenericSettingsCard}, Mode=FindAncestor}, Path=CardContent}"/>
</Grid>
Expand Down
8 changes: 4 additions & 4 deletions ZongziTEK_Blackboard_Sticker/Controls/Cards/SliderCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
d:DesignHeight="450" d:DesignWidth="800" Loaded="SliderCard_Loaded">
<Border HorizontalAlignment="Stretch" Height="68"
Background="{DynamicResource {x:Static ui:ThemeKeys.CardBackgroundFillColorDefaultBrushKey}}"
CornerRadius="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
CornerRadius="4" BorderBrush="{DynamicResource {x:Static ui:ThemeKeys.CardStrokeColorDefaultBrushKey}}" BorderThickness="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48"/>
Expand All @@ -18,8 +18,8 @@
</Grid.ColumnDefinitions>
<ui:FontIcon Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Icon="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:SliderCard}, Mode=FindAncestor}, Path=Icon}" FontSize="20"/>
<ikw:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<TextBlock Foreground="{DynamicResource ForegroundColor}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:SliderCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource ForegroundColor}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:SliderCard}, Mode=FindAncestor}, Path=Tip}"/>
<TextBlock Foreground="{DynamicResource {x:Static ui:ThemeKeys.TextControlForegroundKey}}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:SliderCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource {x:Static ui:ThemeKeys.TextControlForegroundKey}}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:SliderCard}, Mode=FindAncestor}, Path=Tip}"/>
</ikw:SimpleStackPanel>
<Button Grid.Column="2" Margin="12,0" Height="32" Content="调整该项设置" Background="Transparent" Foreground="{DynamicResource {x:Static ui:ThemeKeys.AccentButtonBackgroundKey}}" BorderThickness="0">
<ui:FlyoutService.Flyout>
Expand All @@ -30,7 +30,7 @@
<ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions>
<Slider x:Name="MainSlider" Grid.Column="0" ValueChanged="MainSlider_ValueChanged" IsSnapToTickEnabled="True" VerticalAlignment="Center" TickPlacement="Both" AutoToolTipPlacement="None"/>
<TextBlock Grid.Column="1" Text="{Binding Path=Value,Source={x:Reference Name=MainSlider}}" Foreground="{DynamicResource ForegroundColor}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="12,0,0,0"/>
<TextBlock Grid.Column="1" Text="{Binding Path=Value,Source={x:Reference Name=MainSlider}}" Foreground="{DynamicResource {x:Static ui:ThemeKeys.TextControlForegroundKey}}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="12,0,0,0"/>
</Grid>
</ui:Flyout>
</ui:FlyoutService.Flyout>
Expand Down
6 changes: 3 additions & 3 deletions ZongziTEK_Blackboard_Sticker/Controls/Cards/TextBoxCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
d:DesignHeight="450" d:DesignWidth="800">
<Border HorizontalAlignment="Stretch" Height="68"
Background="{DynamicResource {x:Static ui:ThemeKeys.CardBackgroundFillColorDefaultBrushKey}}"
CornerRadius="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
CornerRadius="4" BorderBrush="{DynamicResource {x:Static ui:ThemeKeys.CardStrokeColorDefaultBrushKey}}" BorderThickness="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48"/>
Expand All @@ -18,8 +18,8 @@
</Grid.ColumnDefinitions>
<ui:FontIcon Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Icon="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:TextBoxCard}, Mode=FindAncestor}, Path=Icon}" FontSize="20"/>
<ikw:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<TextBlock Foreground="{DynamicResource ForegroundColor}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:TextBoxCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource ForegroundColor}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:TextBoxCard}, Mode=FindAncestor}, Path=Tip}"/>
<TextBlock Foreground="{DynamicResource {x:Static ui:ThemeKeys.TextControlForegroundKey}}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:TextBoxCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource {x:Static ui:ThemeKeys.TextControlForegroundKey}}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:TextBoxCard}, Mode=FindAncestor}, Path=Tip}"/>
</ikw:SimpleStackPanel>
<TextBox Grid.Column="2" TextChanged="TextBox_TextChanged" VerticalAlignment="Center" Margin="12,0" Width="200" Height="32" Text="{Binding Mode=TwoWay,RelativeSource={RelativeSource AncestorType={x:Type local:TextBoxCard},Mode=FindAncestor},Path=Text}"/>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
d:DesignHeight="450" d:DesignWidth="800">
<Border HorizontalAlignment="Stretch" Height="68"
Background="{DynamicResource {x:Static ui:ThemeKeys.CardBackgroundFillColorDefaultBrushKey}}"
CornerRadius="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
CornerRadius="4" BorderBrush="{DynamicResource {x:Static ui:ThemeKeys.CardStrokeColorDefaultBrushKey}}" BorderThickness="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48"/>
Expand All @@ -18,8 +18,8 @@
</Grid.ColumnDefinitions>
<ui:FontIcon Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Icon="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=Icon}" FontSize="20"/>
<ikw:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<TextBlock Foreground="{DynamicResource ForegroundColor}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource ForegroundColor}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=Tip}"/>
<TextBlock Foreground="{DynamicResource {x:Static ui:ThemeKeys.TextControlForegroundKey}}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource {x:Static ui:ThemeKeys.TextControlForegroundKey}}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=Tip}"/>
</ikw:SimpleStackPanel>
<ui:ToggleSwitch Grid.Column="2" Toggled="ToggleSwitch_Toggled" OnContent="{Binding Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=OnContent}" OffContent="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=OffContent}" MinWidth="0" Margin="12,0" IsOn="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=IsOn}"/>
</Grid>
Expand Down

0 comments on commit 70dc8bf

Please sign in to comment.