Skip to content

Commit 410782c

Browse files
committed
custom scrollbar colors, adjust minimize and close buttons to have better hitbox and text, add statusbar, hide cell selection from row selection
1 parent fe9f3f4 commit 410782c

File tree

2 files changed

+236
-39
lines changed

2 files changed

+236
-39
lines changed

UnityLauncherPro/MainWindow.xaml

Lines changed: 224 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</Setter>
3636
</Style>
3737

38-
<!-- datagrid -->
38+
<!-- datagrid header -->
3939
<Style x:Key="HeaderStyle" TargetType="DataGridColumnHeader">
4040
<Setter Property="Background" Value="#4C3F3F46" />
4141
<Setter Property="Foreground" Value="#FFB6B6B6" />
@@ -47,6 +47,37 @@
4747
<Setter Property="Padding" Value="6,2,2,2" />
4848
</Style>
4949

50+
<!-- datagrid row selection -->
51+
<Style TargetType="DataGridRow">
52+
<Setter Property="Background" Value="#FF3F3F46" />
53+
<Setter Property="BorderBrush" Value="{x:Null}" />
54+
<Setter Property="BorderThickness" Value="0,0,0,0" />
55+
<Style.Triggers>
56+
<Trigger Property="IsMouseOver" Value="True">
57+
<Setter Property="Background" Value="#FF007ACC"/>
58+
<Setter Property="Foreground" Value="White"/>
59+
</Trigger>
60+
<Trigger Property="IsSelected" Value="True">
61+
<Setter Property="Background" Value="#FF007ACC" />
62+
<Setter Property="Foreground" Value="White"/>
63+
</Trigger>
64+
</Style.Triggers>
65+
</Style>
66+
67+
<!-- datagrid hide selected cell borders -->
68+
<Style TargetType="{x:Type DataGridCell}">
69+
<Setter Property="BorderBrush" Value="Transparent" />
70+
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
71+
<Style.Triggers>
72+
<Trigger Property="IsSelected" Value="True">
73+
<Setter Property="Background" Value="Transparent" />
74+
</Trigger>
75+
<Trigger Property="IsSelected" Value="False">
76+
<Setter Property="Background" Value="Transparent" />
77+
</Trigger>
78+
</Style.Triggers>
79+
</Style>
80+
5081
<!-- custom buttons -->
5182
<Style x:Key="CustomButton" TargetType="Button">
5283
<Setter Property="SnapsToDevicePixels" Value="true"/>
@@ -72,27 +103,167 @@
72103
</Setter>
73104
</Style>
74105

106+
<!-- datagrid scrollbar customization -->
107+
108+
<!-- scrollbar top/bottom arrow buttons -->
109+
<Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
110+
<Setter Property="SnapsToDevicePixels" Value="True"/>
111+
<Setter Property="OverridesDefaultStyle" Value="true"/>
112+
<Setter Property="Focusable" Value="false"/>
113+
<Setter Property="Template">
114+
<Setter.Value>
115+
<ControlTemplate TargetType="{x:Type RepeatButton}">
116+
<!-- button background -->
117+
<Border Name="Border" Margin="1" CornerRadius="0" BorderThickness="0" Background="#FF303032" BorderBrush="{x:Null}">
118+
<!-- arrow sign -->
119+
<Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#FF5E5E64" Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" />
120+
</Border>
121+
<ControlTemplate.Triggers>
122+
<!-- NOTE order matters, if pressed is before mouseover, then it gets overwritten -->
123+
<Trigger Property="IsMouseOver" Value="true">
124+
<Setter TargetName="Border" Property="Background" Value="#FF3E3E3E" />
125+
</Trigger>
126+
<Trigger Property="IsPressed" Value="true">
127+
<Setter TargetName="Border" Property="Background" Value="#FF838383" />
128+
</Trigger>
129+
<Trigger Property="IsEnabled" Value="false">
130+
<Setter Property="Foreground" Value="Black"/>
131+
</Trigger>
132+
</ControlTemplate.Triggers>
133+
</ControlTemplate>
134+
</Setter.Value>
135+
</Setter>
136+
</Style>
137+
138+
<Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
139+
<Setter Property="SnapsToDevicePixels" Value="True"/>
140+
<Setter Property="OverridesDefaultStyle" Value="true"/>
141+
<Setter Property="IsTabStop" Value="false"/>
142+
<Setter Property="Focusable" Value="false"/>
143+
<Setter Property="Template">
144+
<Setter.Value>
145+
<ControlTemplate TargetType="{x:Type RepeatButton}">
146+
<Border Background="Transparent" />
147+
</ControlTemplate>
148+
</Setter.Value>
149+
</Setter>
150+
</Style>
151+
152+
<!-- scroll thumb bar -->
153+
<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
154+
<Setter Property="SnapsToDevicePixels" Value="True"/>
155+
<Setter Property="OverridesDefaultStyle" Value="true"/>
156+
<Setter Property="IsTabStop" Value="false"/>
157+
<Setter Property="Focusable" Value="false"/>
158+
<Setter Property="Template">
159+
<Setter.Value>
160+
<ControlTemplate TargetType="{x:Type Thumb}">
161+
<Border Name="Border" CornerRadius="0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" />
162+
<ControlTemplate.Triggers>
163+
<Trigger Property="IsMouseOver" Value="true">
164+
<Setter TargetName="Border" Property="Background" Value="#FF6A6969" />
165+
</Trigger>
166+
</ControlTemplate.Triggers>
167+
</ControlTemplate>
168+
</Setter.Value>
169+
</Setter>
170+
</Style>
171+
172+
<ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
173+
<Grid >
174+
<Grid.RowDefinitions>
175+
<RowDefinition MaxHeight="18"/>
176+
<RowDefinition Height="0.00001*"/>
177+
<RowDefinition MaxHeight="18"/>
178+
</Grid.RowDefinitions>
179+
<!-- scrollbar background -->
180+
<Border Grid.RowSpan="3" CornerRadius="0" Background="#FF151515" />
181+
<!-- scrollbar top button -->
182+
<RepeatButton Grid.Row="0" Style="{StaticResource ScrollBarLineButton}" Height="18" Command="ScrollBar.LineUpCommand" Content="M 0 4 L 8 4 L 4 0 Z" />
183+
<Track Name="PART_Track" Grid.Row="1" IsDirectionReversed="true">
184+
<Track.DecreaseRepeatButton>
185+
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" />
186+
</Track.DecreaseRepeatButton>
187+
<Track.Thumb>
188+
<!-- scrollbar foreground -->
189+
<Thumb Style="{StaticResource ScrollBarThumb}" Margin="1,0,1,0" Background="#FF47474B" BorderBrush="{x:Null}"/>
190+
</Track.Thumb>
191+
<Track.IncreaseRepeatButton>
192+
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
193+
</Track.IncreaseRepeatButton>
194+
</Track>
195+
<!-- scrollbar bottom button -->
196+
<RepeatButton Grid.Row="3" Style="{StaticResource ScrollBarLineButton}" Height="18" Command="ScrollBar.LineDownCommand" Content="M 0 0 L 4 4 L 8 0 Z" />
197+
</Grid>
198+
</ControlTemplate>
199+
200+
<ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
201+
<Grid >
202+
<Grid.ColumnDefinitions>
203+
<ColumnDefinition MaxWidth="18"/>
204+
<ColumnDefinition Width="0.00001*"/>
205+
<ColumnDefinition MaxWidth="18"/>
206+
</Grid.ColumnDefinitions>
207+
<Border Grid.ColumnSpan="3" CornerRadius="2" Background="#F0F0F0" />
208+
<RepeatButton Grid.Column="0" Style="{StaticResource ScrollBarLineButton}" Width="18" Command="ScrollBar.LineLeftCommand" Content="M 4 0 L 4 8 L 0 4 Z" />
209+
<Track Name="PART_Track" Grid.Column="1" IsDirectionReversed="False">
210+
<Track.DecreaseRepeatButton>
211+
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageLeftCommand" />
212+
</Track.DecreaseRepeatButton>
213+
<Track.Thumb>
214+
<Thumb Style="{StaticResource ScrollBarThumb}" Margin="0,1,0,1" Background="#FF34587C" BorderBrush="Blue" />
215+
</Track.Thumb>
216+
<Track.IncreaseRepeatButton>
217+
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageRightCommand" />
218+
</Track.IncreaseRepeatButton>
219+
</Track>
220+
<RepeatButton Grid.Column="3" Style="{StaticResource ScrollBarLineButton}" Width="18" Command="ScrollBar.LineRightCommand" Content="M 0 0 L 4 4 L 0 8 Z"/>
221+
</Grid>
222+
</ControlTemplate>
223+
224+
<Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
225+
<Setter Property="SnapsToDevicePixels" Value="True"/>
226+
<Setter Property="OverridesDefaultStyle" Value="true"/>
227+
<Style.Triggers>
228+
<Trigger Property="Orientation" Value="Horizontal">
229+
<Setter Property="Width" Value="Auto"/>
230+
<Setter Property="Height" Value="18" />
231+
<Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
232+
</Trigger>
233+
<Trigger Property="Orientation" Value="Vertical">
234+
<Setter Property="Width" Value="18"/>
235+
<Setter Property="Height" Value="Auto" />
236+
<Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
237+
</Trigger>
238+
</Style.Triggers>
239+
</Style>
240+
75241
</Window.Resources>
76242

243+
244+
<!-- UI -->
77245
<Grid Margin="0">
78246
<Grid.RowDefinitions>
79247
<RowDefinition Height="23" />
80-
<RowDefinition />
248+
<RowDefinition Height="*" />
249+
<RowDefinition Height="25" />
81250
</Grid.RowDefinitions>
82251

252+
<!-- menubar -->
83253
<Grid Grid.Row="0" UseLayoutRounding="False">
84254
<Rectangle Fill="#FF0C0C0C" MouseDown="OnRectangleMouseDown" />
85255
<Image Source="Images/icon.png" RenderOptions.BitmapScalingMode="NearestNeighbor" HorizontalAlignment="Left" Width="16" Height="16" Margin="4,0,0,0" SnapsToDevicePixels="True" UseLayoutRounding="True" />
86256
<Label Content="UnityLauncherPro" IsHitTestVisible="False" Margin="19,0,0,-5" Foreground="#FFB8B8B8" FontSize="12" HorizontalAlignment="Left" />
87-
<Button Name="btnMinimize" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" HorizontalAlignment="Right" VerticalAlignment="Top" Height="23" Width="23" Background="{x:Null}" Click="BtnMinimize_Click" Margin="0,0,27,0">
88-
<TextBlock Text="-" Margin="0,-5,0,0" FontSize="18" Foreground="#FFC3C3C3"/>
257+
<Button Name="btnMinimize" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" HorizontalAlignment="Right" VerticalAlignment="Top" Height="23" Width="23" Background="Transparent" Click="BtnMinimize_Click" Margin="0,0,27,0" Padding="2,0,2,8">
258+
<TextBlock Text="" FontSize="15" Foreground="#FFC3C3C3" Padding="0" Height="23" HorizontalAlignment="Center"/>
89259
</Button>
90-
<Button Name="btnClose" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" HorizontalAlignment="Right" VerticalAlignment="Top" Height="23" Width="23" Background="{x:Null}" Click="BtnClose_Click">
91-
<TextBlock Text="x" Margin="0,-5,0,0" FontSize="18" Foreground="#FFC3C3C3"/>
260+
<Button Name="btnClose" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" HorizontalAlignment="Right" VerticalAlignment="Top" Height="23" Width="23" Background="Transparent" Click="BtnClose_Click" Padding="0,2">
261+
<TextBlock Text="" FontSize="10" Foreground="#FFC3C3C3" Padding="5,3,4,4" HorizontalAlignment="Center" />
92262
</Button>
93263
</Grid>
94264

95-
<TabControl Grid.Row="1" x:Name="tabControl" Background="#FF262626" BorderBrush="{x:Null}" Padding="0">
265+
<!-- main content : tabbar -->
266+
<TabControl Grid.Row="1" x:Name="tabControl" Background="#FF262626" BorderBrush="{x:Null}" Padding="0" Margin="0">
96267
<TabItem Header="Projects" Style="{DynamicResource TabItemStyle1}" Padding="0,0,0,0" Margin="-1,1,1,-1" BorderBrush="{x:Null}" Background="Black">
97268
<Grid>
98269
<TextBox x:Name="SearchTermTextBox" Height="19" TextWrapping="Wrap" Width="230" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="8,6,0,0" Background="#FF333337" Foreground="Gainsboro" BorderBrush="#FF434346" TextChanged="OnSearchTextChanged" PreviewKeyDown="OnSearchPreviewKeyDown"/>
@@ -110,10 +281,11 @@
110281
</TextBlock.Style>
111282
</TextBlock>
112283

113-
<Button Style="{StaticResource CustomButton}" x:Name="btnAddProjectFolder" Content="Add Project.." Height="22" Width="78" HorizontalAlignment="Right" VerticalAlignment="Top" Background="#FF3F3F46" Foreground="#FFC1C1C1" Margin="0,4,34,0" Click="BtnAddProjectFolder_Click" BorderBrush="{x:Null}" />
114-
<Button Style="{StaticResource CustomButton}" x:Name="btnRefreshProjectList" Content="" Height="22" Width="22" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="16" Background="#FF3F3F46" Foreground="#FFC1C1C1" Margin="0,4,3,0" Padding="1,-2,1,1" BorderBrush="{x:Null}"/>
284+
<Button Style="{StaticResource CustomButton}" ToolTip="Add existing project" x:Name="btnAddProjectFolder" Content="Add Project.." Height="22" Width="78" HorizontalAlignment="Right" VerticalAlignment="Top" Background="#FF3F3F46" Foreground="#FFC1C1C1" Margin="0,4,34,0" Click="BtnAddProjectFolder_Click" BorderBrush="{x:Null}" />
285+
<Button Style="{StaticResource CustomButton}" ToolTip="Refresh list (F5)" x:Name="btnRefreshProjectList" Content="" Height="22" Width="22" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="16" Background="#FF3F3F46" Foreground="#FFC1C1C1" Margin="0,4,3,0" Padding="1,-2,1,1" BorderBrush="{x:Null}"/>
286+
287+
<DataGrid x:Name="dataGrid" SelectionMode="Single" Margin="0,30,0,42" Background="{x:Null}" BorderBrush="{x:Null}" ColumnHeaderStyle="{StaticResource HeaderStyle}" Padding="0" HorizontalScrollBarVisibility="Disabled" HeadersVisibility="Column" Foreground="#FFD8D8D8" HorizontalGridLinesBrush="#4C000000" VerticalGridLinesBrush="#19000000">
115288

116-
<DataGrid x:Name="dataGrid" SelectionMode="Single" Margin="0,30,0,81" Background="{x:Null}" BorderBrush="{x:Null}" ColumnHeaderStyle="{StaticResource HeaderStyle}" Padding="0" HorizontalScrollBarVisibility="Disabled" HeadersVisibility="Column" Foreground="#FFD8D8D8" HorizontalGridLinesBrush="#4C000000" VerticalGridLinesBrush="#19000000">
117289
<DataGrid.Columns>
118290
<DataGridTextColumn Binding="{Binding Title}" ClipboardContentBinding="{x:Null}" Header="Project" IsReadOnly="True" MinWidth="123"/>
119291
<DataGridTextColumn Binding="{Binding Version}" ClipboardContentBinding="{x:Null}" Header="Version" IsReadOnly="True"/>
@@ -122,23 +294,45 @@
122294
<DataGridTextColumn Binding="{Binding Arguments}" ClipboardContentBinding="{x:Null}" Header="Arguments" IsReadOnly="True"/>
123295
<DataGridTextColumn Binding="{Binding GITBranch}" ClipboardContentBinding="{x:Null}" Header="GITBranch" IsReadOnly="True"/>
124296
</DataGrid.Columns>
125-
<DataGrid.RowStyle>
126-
<Style TargetType="DataGridRow">
127-
<Setter Property="Background" Value="#FF3F3F46" />
128-
<Setter Property="BorderBrush" Value="{x:Null}" />
129-
<Setter Property="BorderThickness" Value="0,0,0,0" />
130-
<Style.Triggers>
131-
<Trigger Property="IsMouseOver" Value="True">
132-
<Setter Property="Background" Value="#FF007ACC"/>
133-
<Setter Property="Foreground" Value="White"/>
134-
</Trigger>
135-
</Style.Triggers>
136-
</Style>
137-
</DataGrid.RowStyle>
297+
298+
299+
<!-- sample data for testing -->
300+
<local:Project GITBranch="" Modified="" Title="M dfgh dfghMO" Path="A:/temp" Version="2099.1.2.3"/>
301+
<local:Project GITBranch="" Modified="" Title="asdgdfg" Path="A:/temp" Version="2099.1.2.3"/>
302+
<local:Project GITBranch="" Modified="" Title="Mghdfghdf dfghdfgMO" Path="A:/temp" Version="2099.1.2.3"/>
303+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
304+
<local:Project GITBranch="" Modified="" Title="fghdhdfgh" Path="A:/temp" Version="2099.1.2.3"/>
305+
<local:Project GITBranch="" Modified="" Title="MdfMO" Path="A:/temp" Version="2099.1.2.3"/>
138306
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
307+
<local:Project GITBranch="" Modified="" Title="MdfgMO" Path="A:/temp" Version="2099.1.2.3"/>
308+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
309+
<local:Project GITBranch="" Modified="" Title="MdfghMO" Path="A:/temp" Version="2099.1.2.3"/>
310+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
311+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
312+
<local:Project GITBranch="" Modified="" Title="ddfghfghdfgh" Path="A:/temp" Version="2099.1.2.3"/>
313+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
314+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
315+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
316+
<local:Project GITBranch="" Modified="" Title="MMdfghO" Path="A:/temp" Version="2099.1.2.3"/>
317+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
318+
<local:Project GITBranch="" Modified="" Title="MdfghMO" Path="A:/temp" Version="2099.1.2.3"/>
319+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
320+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
321+
<local:Project GITBranch="" Modified="" Title="dfgh" Path="A:/temp" Version="2099.1.2.3"/>
322+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
323+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
324+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
325+
<local:Project GITBranch="" Modified="" Title="Mdfg hMO" Path="A:/temp" Version="2099.1.2.3"/>
326+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
327+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
328+
<local:Project GITBranch="" Modified="" Title="MMd fghO" Path="A:/temp" Version="2099.1.2.3"/>
329+
<local:Project GITBranch="" Modified="" Title="MMO" Path="A:/temp" Version="2099.1.2.3"/>
330+
<local:Project GITBranch="" Modified="" Title="MMdfg hO" Path="A:/temp" Version="2099.1.2.3"/>
331+
<local:Project GITBranch="" Modified="" Title="Md fghMO" Path="A:/temp" Version="2099.1.2.3"/>
139332
</DataGrid>
140333

141-
<Grid VerticalAlignment="Bottom" Margin="4,0,8,30">
334+
<!-- bottom buttoms row -->
335+
<Grid VerticalAlignment="Bottom" Margin="4,0,8,5">
142336
<Grid.ColumnDefinitions>
143337
<ColumnDefinition Width="20*" />
144338
<ColumnDefinition Width="20*" />
@@ -159,8 +353,13 @@
159353
<TabItem Header="Packages" Style="{DynamicResource TabItemStyle1}" Padding="0,0,0,0" Margin="-1,1,1,-1" BorderBrush="{x:Null}" Background="Black" />
160354
<TabItem Header="Updates" Style="{DynamicResource TabItemStyle1}" Padding="0,0,0,0" Margin="-1,1,1,-1" BorderBrush="{x:Null}" Background="Black" />
161355
<TabItem Header="Settings" Style="{DynamicResource TabItemStyle1}" Padding="0,0,0,0" Margin="-1,1,1,-1" BorderBrush="{x:Null}" Background="Black" />
356+
</TabControl>
162357

358+
<Grid Grid.Row="2" UseLayoutRounding="False">
359+
<StatusBar VerticalAlignment="Bottom" Margin="3,1,20,1" Background="{x:Null}" Foreground="#FF595959">
360+
<TextBlock Margin="6,1,3,0" VerticalAlignment="Center" Text="Ready"/>
361+
</StatusBar>
362+
</Grid>
163363

164-
</TabControl>
165364
</Grid>
166365
</Window>

0 commit comments

Comments
 (0)