Skip to content

Commit

Permalink
Fix styles not inheriting from theme
Browse files Browse the repository at this point in the history
  • Loading branch information
luizzeroxis committed Dec 10, 2024
1 parent 742fccd commit c0f762e
Show file tree
Hide file tree
Showing 24 changed files with 64 additions and 134 deletions.
8 changes: 4 additions & 4 deletions UndertaleModTool/Controls/AudioFileReference.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Text="{Binding AudioID}">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
<DataTrigger Binding="{Binding GroupID}" Value="0">
<DataTrigger.Setters>
Expand All @@ -36,7 +36,7 @@
ToolTipService.InitialShowDelay="250"
PreviewDragOver="TextBox_DragOver" PreviewDrop="TextBox_Drop" PreviewMouseDoubleClick="TextBox_MouseDoubleClick" PreviewMouseDown="Details_MouseDown">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="Text">
<Setter.Value>
<MultiBinding StringFormat="{}(UndertaleEmbeddedAudio#{0})">
Expand Down Expand Up @@ -69,7 +69,7 @@
</TextBox>
<Button Grid.Column="2" Click="Details_Click" MouseDown="Details_MouseDown" Content=" ... " ToolTip="Open referenced object">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Style.Triggers>
<DataTrigger Binding="{Binding AudioReference, RelativeSource={RelativeSource AncestorType=UserControl}}" Value="{x:Null}">
<Setter Property="IsEnabled" Value="False"/>
Expand All @@ -80,7 +80,7 @@
</Button>
<Button Grid.Column="3" Click="Remove_Click" Content=" X " ToolTip="Remove reference">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Style.Triggers>
<DataTrigger Binding="{Binding AudioReference, RelativeSource={RelativeSource AncestorType=UserControl}}" Value="{x:Null}">
<DataTrigger.Setters>
Expand Down
6 changes: 3 additions & 3 deletions UndertaleModTool/Controls/UndertaleObjectReference.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
PreviewDragOver="TextBox_DragOver" PreviewDrop="TextBox_Drop" PreviewMouseDoubleClick="TextBox_MouseDoubleClick" PreviewMouseDown="Details_MouseDown"
Text="{Binding ObjectReference, ElementName=objectReference}">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
<DataTrigger Binding="{Binding CanChange, ElementName=objectReference}" Value="True">
<Setter Property="ToolTip" Value="This is an object reference. Drag and drop an object of matching type from the tree on the left to change it!" />
Expand All @@ -46,7 +46,7 @@
</TextBox>
<Button Grid.Column="1" x:Name="DetailsButton" Click="Details_Click" MouseDown="Details_MouseDown">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Content" Value=" ... " />
<Setter Property="ToolTip" Value="Open referenced object" />
<Style.Triggers>
Expand All @@ -69,7 +69,7 @@
</Button>
<Button Grid.Column="2" x:Name="RemoveButton" Click="Remove_Click" Content=" X " ToolTip="Remove reference">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Style.Triggers>
<DataTrigger Binding="{Binding CanRemove, ElementName=objectReference}" Value="False">
<DataTrigger.Setters>
Expand Down
4 changes: 2 additions & 2 deletions UndertaleModTool/Controls/UndertaleStringReference.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Text="{Binding ObjectReference.Content, RelativeSource={RelativeSource AncestorType=UserControl}, UpdateSourceTrigger=Explicit}"
PreviewDragOver="TextBox_DragOver" PreviewDrop="TextBox_Drop" LostFocus="TextBox_LostFocus" PreviewMouseDown="Details_MouseDown">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Resources>
<VisualBrush x:Key="EmptyBrush" AlignmentX="Left" AlignmentY="Top" Stretch="None">
<VisualBrush.Visual>
Expand Down Expand Up @@ -53,7 +53,7 @@
</TextBox>
<Button Grid.Column="1" Click="Details_Click" MouseDown="Details_MouseDown" Content=" ... " ToolTip="Open referenced object">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Style.Triggers>
<DataTrigger Binding="{Binding ObjectReference, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" Value="{x:Null}">
<Setter Property="IsEnabled" Value="False"/>
Expand Down
2 changes: 1 addition & 1 deletion UndertaleModTool/Editors/UndertaleBackgroundEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
SelectionChanged="DataGrid_SelectionChanged">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF26A0DA"/>
<Style TargetType="{x:Type DataGridCell}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
Expand Down
2 changes: 1 addition & 1 deletion UndertaleModTool/Editors/UndertaleCodeLocalsEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<DataGrid Grid.Row="3" Grid.Column="1" Margin="3" ItemsSource="{Binding Locals}" AutoGenerateColumns="False" CanUserAddRows="True" CanUserDeleteRows="True" HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray" HeadersVisibility="Column" SelectionMode="Single" SelectionUnit="FullRow" AddingNewItem="DataGrid_AddingNewItem">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF26A0DA"/>
<Style TargetType="{x:Type DataGridCell}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
Expand Down
2 changes: 1 addition & 1 deletion UndertaleModTool/Editors/UndertaleExtensionEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
Visibility="{Binding Mode=OneTime, Converter={StaticResource IsVersionAtLeastConverter}, ConverterParameter=2022.6}"/>

<TextBlock Grid.Row="8" Grid.Column="0" Margin="3" Visibility="{Binding DataContext.IsExtProductIDEligible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}">Product ID</TextBlock>
<TextBox Background="#FF333333" Foreground="#FFFFFFFF" Grid.Row="8" Grid.Column="1" Margin="3" Visibility="{Binding DataContext.IsExtProductIDEligible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}" Text="{Binding ProductIdData, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:UndertaleExtensionEditor}}, Mode = TwoWay, Converter={StaticResource byteArrayConverter}}"/>
<TextBox Grid.Row="8" Grid.Column="1" Margin="3" Visibility="{Binding DataContext.IsExtProductIDEligible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}" Text="{Binding ProductIdData, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:UndertaleExtensionEditor}}, Mode = TwoWay, Converter={StaticResource byteArrayConverter}}"/>

<StackPanel Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2">
<TextBlock Foreground="Red" FontStyle="Italic">
Expand Down
2 changes: 1 addition & 1 deletion UndertaleModTool/Editors/UndertaleExtensionFileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<DataGrid Grid.Row="4" Grid.Column="1" Margin="3" ItemsSource="{Binding Functions}" x:Name="FunctionsList" AutoGenerateColumns="False" CanUserAddRows="True" CanUserDeleteRows="True" HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray" HeadersVisibility="None" SelectionMode="Single" SelectionUnit="FullRow" AddingNewItem="DataGrid_AddingNewItem" IsSynchronizedWithCurrentItem="True">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF26A0DA"/>
<Style TargetType="{x:Type DataGridCell}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<DataGrid Grid.Row="5" Grid.Column="1" Margin="3" ItemsSource="{Binding Arguments}" x:Name="ArgumentTypesList" AutoGenerateColumns="False" CanUserAddRows="True" CanUserDeleteRows="True" HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray" HeadersVisibility="None" SelectionMode="Single" SelectionUnit="FullRow" IsSynchronizedWithCurrentItem="True">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF26A0DA"/>
<Style TargetType="{x:Type DataGridCell}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</Style>
</ItemsControl.ItemContainerStyle>
<ItemsControl.Resources>
<Style TargetType="TextBlock">
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<!-- Hide "{NewItemPlaceholder}" -->
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Grid.Resources>
<local:CharConverter x:Key="CharConverter"/>
<local:IsVersionAtLeastConverter x:Key="IsVersionAtLeastConverter"/>
<Style x:Key="glyphsOperationButtonStyle" TargetType="Button">
<Style x:Key="glyphsOperationButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Style.Triggers>
<DataTrigger Binding="{Binding Glyphs.Count, Mode=OneWay, FallbackValue=0}" Value="0">
<Setter Property="IsEnabled" Value="False"/>
Expand Down Expand Up @@ -207,7 +207,7 @@
<StackPanel Grid.Row="16" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Margin="3" Width="220" Click="EditRectangleButton_Click">
<Button.Style>
<Style TargetType="Button">
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedItem, ElementName=GlyphsGrid, Mode=OneWay}"
Value="{x:Null}">
Expand All @@ -219,7 +219,7 @@
<Button.Content>
<TextBlock>
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="Text" Value="Edit a selected glyph rectangle"/>
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedItem.SourceWidth, ElementName=GlyphsGrid, Mode=OneWay, FallbackValue=-1}"
Expand Down Expand Up @@ -249,7 +249,7 @@
VirtualizingPanel.VirtualizationMode="Recycling">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF26A0DA"/>
<Style TargetType="{x:Type DataGridCell}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
Expand All @@ -271,7 +271,7 @@
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="kerningButtonStyle" TargetType="Button">
<Style x:Key="kerningButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Content" Value="Edit"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Kerning.Count, Mode=OneWay, FallbackValue=0}"
Expand All @@ -289,7 +289,7 @@
Margin="20,0,0,0" MaxLength="1"
ToolTip="{Binding Character, Mode=OneWay}" ToolTipService.InitialShowDelay="250">
<TextBox.Style>
<Style TargetType="TextBox">
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
<DataTrigger Binding="{Binding Character, Mode=OneWay}" Value="0">
<Setter Property="ToolTipService.IsEnabled" Value="False"/>
Expand Down Expand Up @@ -391,7 +391,7 @@
VirtualizingPanel.VirtualizationMode="Recycling">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF26A0DA"/>
<Style TargetType="{x:Type DataGridCell}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
Expand Down Expand Up @@ -421,7 +421,7 @@
<TextBox Text="{Binding Character, Mode=TwoWay, UpdateSourceTrigger=LostFocus, Converter={StaticResource CharConverter}}"
MaxLength="1" ToolTip="{Binding Character, Mode=OneWay}" ToolTipService.InitialShowDelay="250">
<TextBox.Style>
<Style TargetType="TextBox">
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
<DataTrigger Binding="{Binding Character, Mode=OneWay}" Value="0">
<Setter Property="ToolTipService.IsEnabled" Value="False"/>
Expand Down
2 changes: 1 addition & 1 deletion UndertaleModTool/Editors/UndertaleGameEndEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<DataGrid Grid.Row="20" Grid.Column="1" Margin="3" ItemsSource="{Binding GameEnds}" AutoGenerateColumns="False" CanUserAddRows="True" CanUserDeleteRows="True" HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray" HeadersVisibility="None" SelectionMode="Single" SelectionUnit="FullRow">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF26A0DA"/>
<Style TargetType="{x:Type DataGridCell}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
Expand Down
6 changes: 3 additions & 3 deletions UndertaleModTool/Editors/UndertaleGameObjectEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
ScrollViewer.CanContentScroll="False" PreviewMouseWheel="HandlePreviewMouseWheel">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF26A0DA"/>
<Style TargetType="{x:Type DataGridCell}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
Expand Down Expand Up @@ -342,7 +342,7 @@
ScrollViewer.CanContentScroll="False">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF26A0DA"/>
<Style TargetType="{x:Type DataGridCell}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
Expand All @@ -364,7 +364,7 @@
</DataTrigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type ComboBox}">
<Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
<!-- DropDownX events are not routed events -->
<EventSetter Event="Loaded" Handler="ComboBox_Loaded"/>
</Style>
Expand Down
4 changes: 2 additions & 2 deletions UndertaleModTool/Editors/UndertaleGeneralInfoEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
VirtualizingPanel.VirtualizationMode="Recycling">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF26A0DA"/>
<Style TargetType="{x:Type DataGridCell}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
Expand Down Expand Up @@ -301,7 +301,7 @@
<DataGrid Grid.Row="13" Grid.Column="1" Margin="3" ItemsSource="{Binding Options.Constants}" AutoGenerateColumns="False" CanUserAddRows="True" CanUserDeleteRows="True" HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray" HeadersVisibility="Column" SelectionMode="Single" SelectionUnit="FullRow">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF26A0DA"/>
<Style TargetType="{x:Type DataGridCell}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
Expand Down
Loading

0 comments on commit c0f762e

Please sign in to comment.