Skip to content

Commit d9ace67

Browse files
committed
start moving color/brush definitions to resource dictionary
1 parent 17b15d9 commit d9ace67

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

UnityLauncherPro/App.xaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
xmlns:local="clr-namespace:UnityLauncherPro"
55
StartupUri="MainWindow.xaml">
66
<Application.Resources>
7-
8-
</Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<ResourceDictionary Source="Resources/Colors.xaml"/>
10+
</ResourceDictionary.MergedDictionaries>
11+
</ResourceDictionary>
12+
</Application.Resources>
913
</Application>

UnityLauncherPro/MainWindow.xaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
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" WindowStyle="None" ResizeMode="CanResizeWithGrip" AllowsTransparency="True">
8+
Title="UnityLauncherPro" Height="600" Width="500" WindowStartupLocation="CenterScreen" Background="{DynamicResource DarkestBackground}" MinWidth="500" MinHeight="300" WindowStyle="None" ResizeMode="CanResizeWithGrip" AllowsTransparency="True">
99

1010
<Window.Resources>
11-
1211
<!-- tabs -->
1312
<Style x:Key="TabItemStyle1" TargetType="{x:Type TabItem}">
1413
<Setter Property="Template">
@@ -255,7 +254,7 @@
255254

256255
<!-- menubar -->
257256
<Grid Grid.Row="0" UseLayoutRounding="False">
258-
<Rectangle Fill="#FF0C0C0C" MouseDown="OnRectangleMouseDown" />
257+
<Rectangle Fill="{DynamicResource DarkMenuBar}" MouseDown="OnRectangleMouseDown" />
259258
<Image Source="Images/icon.png" RenderOptions.BitmapScalingMode="NearestNeighbor" HorizontalAlignment="Left" Width="16" Height="16" Margin="4,0,0,0" SnapsToDevicePixels="True" UseLayoutRounding="True" />
260259
<Label Content="UnityLauncherPro" IsHitTestVisible="False" Margin="19,0,0,-5" Foreground="#FFB8B8B8" FontSize="12" HorizontalAlignment="Left" />
261260
<!-- minimize -->
@@ -269,12 +268,12 @@
269268
</Grid>
270269

271270
<!-- main content : Tabs -->
272-
<TabControl Grid.Row="1" x:Name="tabControl" Background="#FF262626" BorderBrush="{x:Null}" Padding="0" Margin="0">
271+
<TabControl Grid.Row="1" x:Name="tabControl" Background="{DynamicResource MainBackgroundColor}" BorderBrush="{x:Null}" Padding="0" Margin="0">
273272
<!-- Tab: Projects-->
274273
<TabItem Header="Projects" Style="{DynamicResource TabItemStyle1}" Padding="0,0,0,0" Margin="-1,1,1,-1" BorderBrush="{x:Null}" Background="Black">
275274
<Grid>
276275
<!-- search box -->
277-
<Grid Background="#FF333337" HorizontalAlignment="Left" VerticalAlignment="Top" Width="222" Margin="6,5,0,0" Height="20" >
276+
<Grid Background="{DynamicResource TextBoxBackground}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="222" Margin="6,5,0,0" Height="20" >
278277
<TextBlock Margin="3,2" MinWidth="100" Text="Search" Foreground="#7F919191" Visibility="{Binding ElementName=txtSearchBox, Path=Text.IsEmpty, Converter={StaticResource MyBoolToVisibilityConverter}}" Height="24" />
279278
<TextBox MinWidth="100" CaretBrush="#FFE2E2E2" Name="txtSearchBox" Background="Transparent" BorderBrush="{x:Null}" Foreground="#FFC7C7C7" SelectionBrush="#FF003966" BorderThickness="0" Margin="2,2,0,0" UndoLimit="64" />
280279
<Button Name="btnClearSearch" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" BorderThickness="0" HorizontalAlignment="Right" VerticalAlignment="Top" Height="23" Width="23" Background="Transparent" Padding="0,2" Visibility="Visible" BorderBrush="{x:Null}">
@@ -370,18 +369,18 @@
370369
<Grid.RowDefinitions>
371370
<RowDefinition Height="32" />
372371
</Grid.RowDefinitions>
373-
<Button Grid.Column="0" Style="{StaticResource CustomButton}" x:Name="btnUpgradeProject" Background="#FF3F3F46" Foreground="#FFC1C1C1" Margin="5,0,0,0" BorderBrush="{x:Null}">
372+
<Button Grid.Column="0" Style="{StaticResource CustomButton}" x:Name="btnUpgradeProject" Background="{DynamicResource ButtonBackground}" Foreground="#FFC1C1C1" Margin="5,0,0,0" BorderBrush="{x:Null}">
374373
<Label Foreground="#FFC1C1C1">_Upgrade</Label>
375374
</Button>
376-
<Button Grid.Column="1" Style="{StaticResource CustomButton}" x:Name="btnLaunchUnity" Background="#FF3F3F46" Foreground="#FFC1C1C1" Margin="8,0,0,0" BorderBrush="{x:Null}" >
375+
<Button Grid.Column="1" Style="{StaticResource CustomButton}" x:Name="btnLaunchUnity" Background="{DynamicResource ButtonBackground}" Foreground="#FFC1C1C1" Margin="8,0,0,0" BorderBrush="{x:Null}" >
377376
<Label Foreground="#FFC1C1C1">_Run Unity</Label>
378377
</Button>
379378

380-
<Button Grid.Column="2" Style="{StaticResource CustomButton}" x:Name="btnLaunchProject" Background="#FF3F3F46" Foreground="#FFC1C1C1" Margin="8,0,0,0" BorderBrush="{x:Null}" >
379+
<Button Grid.Column="2" Style="{StaticResource CustomButton}" x:Name="btnLaunchProject" Background="{DynamicResource ButtonBackground}" Foreground="#FFC1C1C1" Margin="8,0,0,0" BorderBrush="{x:Null}" >
381380
<Label Foreground="#FFC1C1C1">_Open Project</Label>
382381
</Button>
383382

384-
<Button Grid.Column="3" Style="{StaticResource CustomButton}" x:Name="btnExplore" Background="#FF3F3F46" Foreground="#FFC1C1C1" Margin="8,0,0,0" BorderBrush="{x:Null}" >
383+
<Button Grid.Column="3" Style="{StaticResource CustomButton}" x:Name="btnExplore" Background="{DynamicResource ButtonBackground}" Foreground="#FFC1C1C1" Margin="8,0,0,0" BorderBrush="{x:Null}" >
385384
<Label Foreground="#FFC1C1C1">_Explore</Label>
386385
</Button>
387386

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:local="clr-namespace:UnityLauncherPro">
4+
<SolidColorBrush x:Key="DarkestBackground" Color="#FF121212"/>
5+
<SolidColorBrush x:Key="DarkMenuBar" Color="#FF0C0C0C"/>
6+
<SolidColorBrush x:Key="MainBackgroundColor" Color="#FF262626"/>
7+
<SolidColorBrush x:Key="TextBoxBackground" Color="#FF333337"/>
8+
<SolidColorBrush x:Key="ButtonBackground" Color="#FF3F3F46"/>
9+
10+
</ResourceDictionary>

UnityLauncherPro/UnityLauncherPro.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
<Generator>MSBuild:Compile</Generator>
7676
<SubType>Designer</SubType>
7777
</ApplicationDefinition>
78+
<Page Include="Resources\Colors.xaml">
79+
<SubType>Designer</SubType>
80+
<Generator>MSBuild:Compile</Generator>
81+
</Page>
7882
<Page Include="MainWindow.xaml">
7983
<Generator>MSBuild:Compile</Generator>
8084
<SubType>Designer</SubType>

0 commit comments

Comments
 (0)