Skip to content

Commit c57a10d

Browse files
committed
add test titlebar icon, remove default window titlebar, add custom titlebar with dragging, add searchbox placeholder text,
1 parent e9001dc commit c57a10d

File tree

4 files changed

+61
-4
lines changed

4 files changed

+61
-4
lines changed

UnityLauncherPro/Images/icon.png

303 Bytes
Loading

UnityLauncherPro/MainWindow.xaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:UnityLauncherPro"
77
mc:Ignorable="d"
8-
Title="UnityLauncherPro" Height="600" Width="500" WindowStartupLocation="CenterScreen" Background="#FF121212" MinWidth="500" MinHeight="300">
8+
Title="UnityLauncherPro" Height="600" Width="500" WindowStartupLocation="CenterScreen" Background="#FF121212" MinWidth="500" MinHeight="300" WindowStyle="None" ResizeMode="CanResizeWithGrip" AllowsTransparency="True">
99

1010
<Window.Resources>
1111
<Style x:Key="TabItemStyle1" TargetType="{x:Type TabItem}">
@@ -46,10 +46,35 @@
4646
</Window.Resources>
4747

4848
<Grid Margin="0">
49-
<TabControl x:Name="tabControl" Background="#FF262626" BorderBrush="{x:Null}" Padding="0">
49+
<Grid.RowDefinitions>
50+
<RowDefinition Height="23" />
51+
<RowDefinition />
52+
</Grid.RowDefinitions>
53+
54+
<Grid>
55+
<Rectangle Grid.Row="0" Fill="#FF0C0C0C" MouseDown="OnRectangleMouseDown" />
56+
<Image Source="Images/icon.png" HorizontalAlignment="Left" Width="16" Height="16" Margin="4,0,0,0" />
57+
<Label Content="UnityLauncherPro 1.0" IsHitTestVisible="False" Margin="19,0,0,-5" Foreground="#FFB8B8B8" FontSize="12" HorizontalAlignment="Left" />
58+
</Grid>
59+
60+
<TabControl Grid.Row="1" x:Name="tabControl" Background="#FF262626" BorderBrush="{x:Null}" Padding="0">
5061
<TabItem Header="Projects" Style="{DynamicResource TabItemStyle1}" Padding="0,0,0,0" Margin="-1,1,1,-1" BorderBrush="{x:Null}" Background="Black">
5162
<Grid>
52-
<TextBox x:Name="textBox" Height="19" TextWrapping="Wrap" Text="Search" Width="230" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="8,6,0,0" Background="#FF333337" Foreground="Gainsboro" BorderBrush="#FF434346"/>
63+
<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"/>
64+
65+
<TextBlock IsHitTestVisible="False" Text="Search" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0" Foreground="#FF707070" Height="29" Padding="12,6.5,0,0">
66+
<TextBlock.Style>
67+
<Style TargetType="{x:Type TextBlock}">
68+
<Setter Property="Visibility" Value="Collapsed"/>
69+
<Style.Triggers>
70+
<DataTrigger Binding="{Binding Text, ElementName=SearchTermTextBox}" Value="">
71+
<Setter Property="Visibility" Value="Visible"/>
72+
</DataTrigger>
73+
</Style.Triggers>
74+
</Style>
75+
</TextBlock.Style>
76+
</TextBlock>
77+
5378
<Button x:Name="button" 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"/>
5479

5580
<DataGrid x:Name="dataGrid" Margin="0,30" Background="{x:Null}" BorderBrush="{x:Null}" ColumnHeaderStyle="{StaticResource HeaderStyle}" Padding="0" HorizontalScrollBarVisibility="Disabled" HeadersVisibility="Column" Foreground="#FFD8D8D8" HorizontalGridLinesBrush="#4C000000" VerticalGridLinesBrush="#19000000">

UnityLauncherPro/MainWindow.xaml.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,32 @@ void Start()
3434
dataGrid.Items.Add(new TestData { Project = "kuykkyu", Version = "23.23.23", Path = "8,1", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
3535
dataGrid.Items.Add(new TestData { Project = "RT435y", Version = "3333", Path = "X:/", Modified = DateTime.Now, Arguments = "", GITBranch = "-" });
3636
}
37+
38+
39+
private void OnRectangleMouseDown(object sender, MouseButtonEventArgs e)
40+
{
41+
if (e.ChangedButton == MouseButton.Left) this.DragMove();
42+
}
43+
44+
private void OnSearchTextChanged(object sender, TextChangedEventArgs e)
45+
{
46+
TextBox textbox = (TextBox)sender;
47+
//FilterProjects(textbox.Text);
48+
}
49+
50+
private void OnSearchPreviewKeyDown(object sender, KeyEventArgs e)
51+
{
52+
switch (e.Key)
53+
{
54+
case Key.Escape:
55+
((TextBox)sender).Text = "";
56+
//FilterProjects(null);
57+
break;
58+
default:
59+
break;
60+
}
61+
}
62+
3763
}
3864

3965
public struct TestData
@@ -46,4 +72,6 @@ public struct TestData
4672
public string GITBranch { set; get; }
4773
}
4874

49-
}
75+
76+
77+
}

UnityLauncherPro/UnityLauncherPro.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,9 @@
9494
<ItemGroup>
9595
<None Include="App.config" />
9696
</ItemGroup>
97+
<ItemGroup />
98+
<ItemGroup>
99+
<Resource Include="Images\icon.png" />
100+
</ItemGroup>
97101
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
98102
</Project>

0 commit comments

Comments
 (0)