Skip to content

Commit 0435851

Browse files
committed
add row spacing, make window resizable from any edge, mouseover color for grid headers
1 parent d9ace67 commit 0435851

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

UnityLauncherPro/MainWindow.xaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:UnityLauncherPro"
7-
mc:Ignorable="d"
8-
Title="UnityLauncherPro" Height="600" Width="500" WindowStartupLocation="CenterScreen" Background="{DynamicResource DarkestBackground}" MinWidth="500" MinHeight="300" WindowStyle="None" ResizeMode="CanResizeWithGrip" AllowsTransparency="True">
7+
mc:Ignorable="d"
8+
Title="UnityLauncherPro" Height="600" Width="500" WindowStartupLocation="CenterScreen" Background="{DynamicResource DarkestBackground}" MinWidth="500" MinHeight="300" AllowsTransparency="True" WindowStyle="None" Margin="0" >
99

10-
<Window.Resources>
10+
<Window.Resources>
1111
<!-- tabs -->
1212
<Style x:Key="TabItemStyle1" TargetType="{x:Type TabItem}">
1313
<Setter Property="Template">
@@ -45,16 +45,21 @@
4545
<Setter Property="HorizontalContentAlignment" Value="Left" />
4646
<Setter Property="Height" Value="28" />
4747
<Setter Property="Padding" Value="6,2,2,2" />
48+
<Style.Triggers>
49+
<Trigger Property="IsMouseOver" Value="True">
50+
<Setter Property="Background" Value="#FF3F3F46"/>
51+
</Trigger>
52+
</Style.Triggers>
4853
</Style>
4954

50-
<!-- datagrid row selection -->
55+
<!-- datagrid rows & row selection -->
5156
<Style TargetType="DataGridRow">
5257
<Setter Property="Background" Value="#FF3F3F46" />
5358
<Setter Property="BorderBrush" Value="{x:Null}" />
5459
<Setter Property="BorderThickness" Value="0,0,0,0" />
5560
<Style.Triggers>
5661
<Trigger Property="IsMouseOver" Value="True">
57-
<Setter Property="Background" Value="#B2007ACC"/>
62+
<Setter Property="Background" Value="#7F007ACC"/>
5863
<Setter Property="Foreground" Value="White"/>
5964
</Trigger>
6065
<Trigger Property="IsSelected" Value="True">
@@ -68,6 +73,7 @@
6873
<Style TargetType="{x:Type DataGridCell}">
6974
<Setter Property="BorderBrush" Value="Transparent" />
7075
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
76+
<Setter Property="Margin" Value="0,0.5,0,0.5" />
7177
<Style.Triggers>
7278
<Trigger Property="IsSelected" Value="True">
7379
<Setter Property="Background" Value="Transparent" />
@@ -405,8 +411,5 @@
405411
<TextBlock Margin="6,1,3,0" VerticalAlignment="Center" Text="Ready"/>
406412
</StatusBar>
407413
</Grid>
408-
409-
410-
411414
</Grid>
412415
</Window>

UnityLauncherPro/MainWindow.xaml.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Windows;
44
using System.Windows.Controls;
55
using System.Windows.Input;
6+
using System.Windows.Shell;
67

78
namespace UnityLauncherPro
89
{
@@ -22,16 +23,24 @@ public MainWindow()
2223

2324
void Start()
2425
{
26+
// make window resizable (didnt work within xaml..)
27+
WindowChrome Resizable_BorderLess_Chrome = new WindowChrome();
28+
Resizable_BorderLess_Chrome.GlassFrameThickness = new Thickness(0);
29+
Resizable_BorderLess_Chrome.CornerRadius = new CornerRadius(0);
30+
Resizable_BorderLess_Chrome.CaptionHeight = 1.0;
31+
WindowChrome.SetWindowChrome(this, Resizable_BorderLess_Chrome);
32+
33+
2534
// test data
2635
dataGrid.Items.Clear();
2736
for (int i = 0; i < 6; i++)
2837
{
29-
dataGrid.Items.Add(new Project { Title = "asdf"+i, Version = "5000", Path = "A:/", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
38+
dataGrid.Items.Add(new Project { Title = "asdf" + i, Version = "5000", Path = "A:/", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
3039
dataGrid.Items.Add(new Project { Title = "asdf asd", Version = "2", Path = "C:/", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
31-
dataGrid.Items.Add(new Project { Title = "kuykkyu" + i*2, Version = "23.23.23", Path = "8,1", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
40+
dataGrid.Items.Add(new Project { Title = "kuykkyu" + i * 2, Version = "23.23.23", Path = "8,1", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
3241
dataGrid.Items.Add(new Project { Title = "RT435y", Version = "3333", Path = "X:/", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
3342
dataGrid.Items.Add(new Project { Title = "asdf", Version = "5000", Path = "A:/", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
34-
dataGrid.Items.Add(new Project { Title = "asdf asd" + i*3, Version = "2", Path = "C:/", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
43+
dataGrid.Items.Add(new Project { Title = "asdf asd" + i * 3, Version = "2", Path = "C:/", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
3544
dataGrid.Items.Add(new Project { Title = "kuykkyu", Version = "23.23.23", Path = "8,1", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
3645
}
3746

0 commit comments

Comments
 (0)