Skip to content

Commit a38f8bd

Browse files
committed
cleanup xaml
1 parent 0435851 commit a38f8bd

File tree

2 files changed

+33
-52
lines changed

2 files changed

+33
-52
lines changed

UnityLauncherPro/MainWindow.xaml

Lines changed: 21 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
</Border>
2020
<ControlTemplate.Triggers>
2121
<Trigger Property="IsSelected" Value="False">
22-
<Setter Property="TextElement.Foreground" TargetName="ContentSite" Value="#FFC1C1C1"/>
23-
<Setter TargetName="Border" Property="Background" Value="#FF1D1D1D" />
22+
<Setter Property="TextElement.Foreground" TargetName="ContentSite" Value="{StaticResource DeactiveTabForeground}"/>
23+
<Setter TargetName="Border" Property="Background" Value="{StaticResource DeactiveTabBackground}" />
2424
</Trigger>
2525
<Trigger Property="IsSelected" Value="True">
2626
<Setter Property="TextElement.Foreground" TargetName="ContentSite" Value="White"/>
27-
<Setter TargetName="Border" Property="Background" Value="#FF262626"/>
27+
<Setter TargetName="Border" Property="Background" Value="{StaticResource MainBackgroundColor}"/>
2828
</Trigger>
2929
<Trigger Property="IsMouseOver" Value="True">
30-
<Setter TargetName="Border" Property="Background" Value="#FF262626"/>
30+
<Setter TargetName="Border" Property="Background" Value="{StaticResource MainBackgroundColor}"/>
3131
</Trigger>
3232
</ControlTemplate.Triggers>
3333
</ControlTemplate>
@@ -37,34 +37,32 @@
3737

3838
<!-- datagrid header -->
3939
<Style x:Key="HeaderStyle" TargetType="DataGridColumnHeader">
40-
<Setter Property="Background" Value="#4C3F3F46" />
41-
<Setter Property="Foreground" Value="#FFB6B6B6" />
42-
<Setter Property="BorderBrush" Value="#4C000000" />
40+
<Setter Property="Background" Value="{StaticResource DatagridHeaderBackground}" />
41+
<Setter Property="Foreground" Value="{StaticResource DatagridHeaderForeground}" />
42+
<Setter Property="BorderBrush" Value="{StaticResource DatagridHeaderBorder}" />
4343
<Setter Property="BorderThickness" Value="0,0,1,1" />
4444
<Setter Property="SnapsToDevicePixels" Value="True" />
4545
<Setter Property="HorizontalContentAlignment" Value="Left" />
4646
<Setter Property="Height" Value="28" />
4747
<Setter Property="Padding" Value="6,2,2,2" />
4848
<Style.Triggers>
4949
<Trigger Property="IsMouseOver" Value="True">
50-
<Setter Property="Background" Value="#FF3F3F46"/>
50+
<Setter Property="Background" Value="{StaticResource ButtonBackground}"/>
5151
</Trigger>
5252
</Style.Triggers>
5353
</Style>
5454

5555
<!-- datagrid rows & row selection -->
5656
<Style TargetType="DataGridRow">
57-
<Setter Property="Background" Value="#FF3F3F46" />
57+
<Setter Property="Background" Value="{StaticResource ButtonBackground}" />
5858
<Setter Property="BorderBrush" Value="{x:Null}" />
5959
<Setter Property="BorderThickness" Value="0,0,0,0" />
6060
<Style.Triggers>
6161
<Trigger Property="IsMouseOver" Value="True">
62-
<Setter Property="Background" Value="#7F007ACC"/>
63-
<Setter Property="Foreground" Value="White"/>
62+
<Setter Property="Background" Value="{StaticResource DataGridRowMouseOver}"/>
6463
</Trigger>
6564
<Trigger Property="IsSelected" Value="True">
66-
<Setter Property="Background" Value="#FF007ACC" />
67-
<Setter Property="Foreground" Value="White"/>
65+
<Setter Property="Background" Value="{StaticResource DataGridRowSelectedBackground}" />
6866
</Trigger>
6967
</Style.Triggers>
7068
</Style>
@@ -120,17 +118,17 @@
120118
<Setter.Value>
121119
<ControlTemplate TargetType="{x:Type RepeatButton}">
122120
<!-- button background -->
123-
<Border Name="Border" Margin="1" CornerRadius="0" BorderThickness="0" Background="#FF303032" BorderBrush="{x:Null}">
121+
<Border Name="Border" Margin="1" CornerRadius="0" BorderThickness="0" Background="{DynamicResource ButtonBackground}" BorderBrush="{x:Null}">
124122
<!-- arrow sign -->
125-
<Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#FF5E5E64" Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" />
123+
<Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{DynamicResource ScrollArrowForeground}" Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" />
126124
</Border>
127125
<ControlTemplate.Triggers>
128126
<!-- NOTE order matters, if pressed is before mouseover, then it gets overwritten -->
129127
<Trigger Property="IsMouseOver" Value="true">
130-
<Setter TargetName="Border" Property="Background" Value="#FF3E3E3E" />
128+
<Setter TargetName="Border" Property="Background" Value="{StaticResource TextBoxBackground}" />
131129
</Trigger>
132130
<Trigger Property="IsPressed" Value="true">
133-
<Setter TargetName="Border" Property="Background" Value="#FF838383" />
131+
<Setter TargetName="Border" Property="Background" Value="{StaticResource ScrollArrowPressed}" />
134132
</Trigger>
135133
<Trigger Property="IsEnabled" Value="false">
136134
<Setter Property="Foreground" Value="Black"/>
@@ -155,7 +153,7 @@
155153
</Setter>
156154
</Style>
157155

158-
<!-- scroll thumb bar -->
156+
<!-- scroll thumb (elevator) bar -->
159157
<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
160158
<Setter Property="SnapsToDevicePixels" Value="True"/>
161159
<Setter Property="OverridesDefaultStyle" Value="true"/>
@@ -167,7 +165,7 @@
167165
<Border Name="Border" CornerRadius="0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" />
168166
<ControlTemplate.Triggers>
169167
<Trigger Property="IsMouseOver" Value="true">
170-
<Setter TargetName="Border" Property="Background" Value="#FF6A6969" />
168+
<Setter TargetName="Border" Property="Background" Value="{StaticResource ScrollBarThumbFill}" />
171169
</Trigger>
172170
</ControlTemplate.Triggers>
173171
</ControlTemplate>
@@ -183,7 +181,7 @@
183181
<RowDefinition MaxHeight="18"/>
184182
</Grid.RowDefinitions>
185183
<!-- scrollbar background -->
186-
<Border Grid.RowSpan="3" CornerRadius="0" Background="#FF151515" />
184+
<Border Grid.RowSpan="3" CornerRadius="0" Background="{DynamicResource ScrollBarBackground}" />
187185
<!-- scrollbar top button -->
188186
<RepeatButton Grid.Row="0" Style="{StaticResource ScrollBarLineButton}" Height="18" Command="ScrollBar.LineUpCommand" Content="M 0 4 L 8 4 L 4 0 Z" />
189187
<Track Name="PART_Track" Grid.Row="1" IsDirectionReversed="true">
@@ -192,7 +190,7 @@
192190
</Track.DecreaseRepeatButton>
193191
<Track.Thumb>
194192
<!-- scrollbar foreground -->
195-
<Thumb Style="{StaticResource ScrollBarThumb}" Margin="1,0,1,0" Background="#FF47474B" BorderBrush="{x:Null}"/>
193+
<Thumb Style="{StaticResource ScrollBarThumb}" Margin="1,0,1,0" Background="{DynamicResource ScrollBarFill}" BorderBrush="{x:Null}"/>
196194
</Track.Thumb>
197195
<Track.IncreaseRepeatButton>
198196
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
@@ -203,39 +201,10 @@
203201
</Grid>
204202
</ControlTemplate>
205203

206-
<ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
207-
<Grid >
208-
<Grid.ColumnDefinitions>
209-
<ColumnDefinition MaxWidth="18"/>
210-
<ColumnDefinition Width="0.00001*"/>
211-
<ColumnDefinition MaxWidth="18"/>
212-
</Grid.ColumnDefinitions>
213-
<Border Grid.ColumnSpan="3" CornerRadius="2" Background="#F0F0F0" />
214-
<RepeatButton Grid.Column="0" Style="{StaticResource ScrollBarLineButton}" Width="18" Command="ScrollBar.LineLeftCommand" Content="M 4 0 L 4 8 L 0 4 Z" />
215-
<Track Name="PART_Track" Grid.Column="1" IsDirectionReversed="False">
216-
<Track.DecreaseRepeatButton>
217-
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageLeftCommand" />
218-
</Track.DecreaseRepeatButton>
219-
<Track.Thumb>
220-
<Thumb Style="{StaticResource ScrollBarThumb}" Margin="0,1,0,1" Background="#FF34587C" BorderBrush="Blue" />
221-
</Track.Thumb>
222-
<Track.IncreaseRepeatButton>
223-
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageRightCommand" />
224-
</Track.IncreaseRepeatButton>
225-
</Track>
226-
<RepeatButton Grid.Column="3" Style="{StaticResource ScrollBarLineButton}" Width="18" Command="ScrollBar.LineRightCommand" Content="M 0 0 L 4 4 L 0 8 Z"/>
227-
</Grid>
228-
</ControlTemplate>
229-
230204
<Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
231205
<Setter Property="SnapsToDevicePixels" Value="True"/>
232206
<Setter Property="OverridesDefaultStyle" Value="true"/>
233207
<Style.Triggers>
234-
<Trigger Property="Orientation" Value="Horizontal">
235-
<Setter Property="Width" Value="Auto"/>
236-
<Setter Property="Height" Value="18" />
237-
<Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
238-
</Trigger>
239208
<Trigger Property="Orientation" Value="Vertical">
240209
<Setter Property="Width" Value="18"/>
241210
<Setter Property="Height" Value="Auto" />
@@ -248,7 +217,7 @@
248217

249218
</Window.Resources>
250219

251-
220+
252221
<!-- UI -->
253222

254223
<Grid Margin="0">
@@ -276,7 +245,7 @@
276245
<!-- main content : Tabs -->
277246
<TabControl Grid.Row="1" x:Name="tabControl" Background="{DynamicResource MainBackgroundColor}" BorderBrush="{x:Null}" Padding="0" Margin="0">
278247
<!-- Tab: Projects-->
279-
<TabItem Header="Projects" Style="{DynamicResource TabItemStyle1}" Padding="0,0,0,0" Margin="-1,1,1,-1" BorderBrush="{x:Null}" Background="Black">
248+
<TabItem Header="Projects" Style="{DynamicResource TabItemStyle1}" Padding="0,0,0,0" Margin="-1,1,1,-1" BorderBrush="{x:Null}">
280249
<Grid>
281250
<!-- search box -->
282251
<Grid Background="{DynamicResource TextBoxBackground}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="222" Margin="6,5,0,0" Height="20" >

UnityLauncherPro/Resources/Colors.xaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,17 @@
66
<SolidColorBrush x:Key="MainBackgroundColor" Color="#FF262626"/>
77
<SolidColorBrush x:Key="TextBoxBackground" Color="#FF333337"/>
88
<SolidColorBrush x:Key="ButtonBackground" Color="#FF3F3F46"/>
9+
<SolidColorBrush x:Key="DeactiveTabForeground" Color="#FFC1C1C1"/>
10+
<SolidColorBrush x:Key="DeactiveTabBackground" Color="#FF1D1D1D"/>
11+
<SolidColorBrush x:Key="DatagridHeaderBackground" Color="#4C3F3F46"/>
12+
<SolidColorBrush x:Key="DatagridHeaderForeground" Color="#FFB6B6B6"/>
13+
<SolidColorBrush x:Key="DatagridHeaderBorder" Color="#4C000000"/>
14+
<SolidColorBrush x:Key="DataGridRowMouseOver" Color="#7F007ACC"/>
15+
<SolidColorBrush x:Key="DataGridRowSelectedBackground" Color="#FF007ACC"/>
16+
<SolidColorBrush x:Key="ScrollArrowPressed" Color="#FF838383"/>
17+
<SolidColorBrush x:Key="ScrollArrowForeground" Color="#FF5E5E64"/>
18+
<SolidColorBrush x:Key="ScrollBarThumbFill" Color="#FF6A6969"/>
19+
<SolidColorBrush x:Key="ScrollBarBackground" Color="#FF151515"/>
20+
<SolidColorBrush x:Key="ScrollBarFill" Color="#FF47474B"/>
921

1022
</ResourceDictionary>

0 commit comments

Comments
 (0)