Skip to content

Commit b9e9d46

Browse files
authored
Merge pull request #9 from Float3/dev
Dev 9
2 parents 2d19d3d + 2052300 commit b9e9d46

8 files changed

Lines changed: 436 additions & 189 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# VRCLauncher
2-
![VRCLauncher_WAk3wehSfJ](https://user-images.githubusercontent.com/86748455/159505766-f11bdf63-6117-4051-98c9-57f871d96fe8.png)
2+
![VRCLauncher_9mqY6RYlZd](https://user-images.githubusercontent.com/86748455/161536489-70a9eed6-f054-47b9-b30e-f19272189316.png)

VRCLauncher/App.xaml

Lines changed: 201 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,206 @@
11
<Application x:Class="VRCLauncher.App"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
Startup="Application_Startup">
4+
xmlns:view="clr-namespace:VRCLauncher.View"
5+
StartupUri="View/MainWindow.xaml">
56
<Application.Resources>
6-
7+
<BooleanToVisibilityConverter x:Key="Bool2VisibilityConverter" />
8+
9+
<Color x:Key="WindowBackgroundColor">#333333</Color>
10+
<Color x:Key="TextBackgroundColor">#444444</Color>
11+
<Color x:Key="ForegroundColor">#f5f5f5</Color>
12+
<Color x:Key="ButtonColor">#353535</Color>
13+
<Color x:Key="ButtonBorderColor">#404040</Color>
14+
<Color x:Key="HighlightColor">#737373</Color>
15+
<Color x:Key="DisabledColor">#9fa5a9</Color>
16+
17+
<Color x:Key="BlueColor">#FF007ACC</Color>
18+
19+
<SolidColorBrush x:Key="WindowBackgroundColorBrush" Color="{StaticResource WindowBackgroundColor}" />
20+
<SolidColorBrush x:Key="TextBackgroundColorBrush" Color="{StaticResource TextBackgroundColor}" />
21+
<SolidColorBrush x:Key="ForegroundColorBrush" Color="{StaticResource ForegroundColor}" />
22+
<SolidColorBrush x:Key="ButtonColorBrush" Color="{StaticResource ButtonColor}" />
23+
<SolidColorBrush x:Key="ButtonBorderColorBrush" Color="{StaticResource ButtonBorderColor}" />
24+
<SolidColorBrush x:Key="HighlightColorBrush" Color="{StaticResource HighlightColor}" />
25+
<SolidColorBrush x:Key="DisabledColorBrush" Color="{StaticResource DisabledColor}" />
26+
27+
<SolidColorBrush x:Key="BlueColorBrush" Color="{StaticResource BlueColor}" />
28+
29+
<Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
30+
<Setter Property="Background" Value="{DynamicResource ButtonColorBrush}" />
31+
<Setter Property="Foreground" Value="{DynamicResource ForegroundColorBrush}" />
32+
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColorBrush}" />
33+
<Setter Property="BorderThickness" Value="2" />
34+
<Setter Property="Padding" Value="5" />
35+
</Style>
36+
37+
38+
<Style x:Key="WindowButtonStyle" TargetType="{x:Type Button}">
39+
<Setter Property="Foreground" Value="{DynamicResource ForegroundColorBrush}" />
40+
<Setter Property="Background" Value="Transparent" />
41+
<Setter Property="HorizontalContentAlignment" Value="Center" />
42+
<Setter Property="VerticalContentAlignment" Value="Center" />
43+
<Setter Property="Padding" Value="1" />
44+
<Setter Property="Template">
45+
<Setter.Value>
46+
<ControlTemplate TargetType="{x:Type Button}">
47+
<Grid Background="{TemplateBinding Background}">
48+
<ContentPresenter x:Name="contentPresenter"
49+
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
50+
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
51+
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
52+
Margin="{TemplateBinding Padding}"
53+
RecognizesAccessKey="True" />
54+
</Grid>
55+
<ControlTemplate.Triggers>
56+
<Trigger Property="IsMouseOver" Value="True">
57+
<Setter Property="Background" Value="{StaticResource HighlightColorBrush}" />
58+
</Trigger>
59+
<Trigger Property="IsPressed" Value="True">
60+
<Setter Property="Background" Value="{DynamicResource BlueColorBrush}" />
61+
</Trigger>
62+
<Trigger Property="IsEnabled" Value="false">
63+
<Setter TargetName="contentPresenter" Property="Opacity" Value=".5" />
64+
</Trigger>
65+
</ControlTemplate.Triggers>
66+
</ControlTemplate>
67+
</Setter.Value>
68+
</Setter>
69+
</Style>
70+
71+
<Style x:Key="WindowStyle" TargetType="view:MainWindow">
72+
<Setter Property="Foreground" Value="{DynamicResource ForegroundColorBrush}" />
73+
<Setter Property="Background" Value="{DynamicResource WindowBackgroundColorBrush}" />
74+
<Setter Property="ResizeMode" Value="CanResizeWithGrip" />
75+
<Setter Property="SizeToContent" Value="WidthAndHeight" />
76+
<Setter Property="UseLayoutRounding" Value="True" />
77+
<Setter Property="TextOptions.TextFormattingMode" Value="Display" />
78+
<Setter Property="Template">
79+
<Setter.Value>
80+
<ControlTemplate TargetType="view:MainWindow">
81+
<Border x:Name="WindowBorder"
82+
Margin="{Binding Source={x:Static SystemParameters.WindowNonClientFrameThickness}}"
83+
Background="{StaticResource WindowBackgroundColorBrush}">
84+
<Grid>
85+
<Border BorderThickness="1">
86+
<AdornerDecorator>
87+
<Grid x:Name="LayoutRoot">
88+
<Grid.RowDefinitions>
89+
<RowDefinition Height="25" />
90+
<RowDefinition Height="*" />
91+
<RowDefinition Height="15" />
92+
</Grid.RowDefinitions>
93+
<ContentPresenter Grid.Row="1" Grid.RowSpan="2" Margin="7" />
94+
<Rectangle x:Name="HeaderBackground" Height="25"
95+
Fill="{DynamicResource WindowBackgroundColorBrush}"
96+
VerticalAlignment="Top" Grid.Row="0" />
97+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"
98+
VerticalAlignment="Top"
99+
WindowChrome.IsHitTestVisibleInChrome="True" Grid.Row="0">
100+
<Button
101+
Command="{Binding Source={x:Static SystemCommands.MinimizeWindowCommand}}"
102+
ToolTip="minimize" Style="{StaticResource WindowButtonStyle}">
103+
<Button.Content>
104+
<Grid Width="30" Height="25" RenderTransform="1,0,0,1,0,1">
105+
<Path Data="M0,6 L8,6 Z" Width="8" Height="7"
106+
VerticalAlignment="Center"
107+
HorizontalAlignment="Center"
108+
Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}"
109+
StrokeThickness="2" />
110+
</Grid>
111+
</Button.Content>
112+
</Button>
113+
<Grid Margin="1,0,1,0">
114+
<Button x:Name="Restore"
115+
Command="{Binding Source={x:Static SystemCommands.RestoreWindowCommand}}"
116+
ToolTip="restore" Visibility="Collapsed"
117+
Style="{StaticResource WindowButtonStyle}">
118+
<Button.Content>
119+
<Grid Width="30" Height="25" UseLayoutRounding="True"
120+
RenderTransform="1,0,0,1,.5,.5">
121+
<Path
122+
Data="M2,0 L8,0 L8,6 M0,3 L6,3 M0,2 L6,2 L6,8 L0,8 Z"
123+
Width="8" Height="8" VerticalAlignment="Center"
124+
HorizontalAlignment="Center"
125+
Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}"
126+
StrokeThickness="1" />
127+
</Grid>
128+
</Button.Content>
129+
</Button>
130+
<Button x:Name="Maximize"
131+
Command="{Binding Source={x:Static SystemCommands.MaximizeWindowCommand}}"
132+
ToolTip="maximize"
133+
Style="{StaticResource WindowButtonStyle}">
134+
<Button.Content>
135+
<Grid Width="31" Height="25">
136+
<Path Data="M0,1 L9,1 L9,8 L0,8 Z" Width="9" Height="8"
137+
VerticalAlignment="Center"
138+
HorizontalAlignment="Center"
139+
Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}"
140+
StrokeThickness="2" />
141+
</Grid>
142+
</Button.Content>
143+
</Button>
144+
</Grid>
145+
<Button
146+
Command="{Binding Source={x:Static SystemCommands.CloseWindowCommand}}"
147+
ToolTip="close" Style="{StaticResource WindowButtonStyle}">
148+
<Button.Content>
149+
<Grid Width="30" Height="25" RenderTransform="1,0,0,1,0,1">
150+
<Path Data="M0,0 L8,7 M8,0 L0,7 Z" Width="8" Height="7"
151+
VerticalAlignment="Center"
152+
HorizontalAlignment="Center"
153+
Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}"
154+
StrokeThickness="1.5" />
155+
</Grid>
156+
</Button.Content>
157+
</Button>
158+
</StackPanel>
159+
<TextBlock x:Name="WindowTitleTextBlock" Grid.Row="0"
160+
Text="{TemplateBinding Title}" HorizontalAlignment="Left"
161+
TextTrimming="CharacterEllipsis" VerticalAlignment="Center"
162+
Margin="8 -1 0 0" FontSize="16"
163+
Foreground="{TemplateBinding Foreground}" />
164+
<Grid Grid.Row="2">
165+
<Path x:Name="ResizeGrip" Visibility="Collapsed" Width="12" Height="12"
166+
Margin="1" HorizontalAlignment="Right"
167+
Stroke="{StaticResource BlueColorBrush}" StrokeThickness="1"
168+
Stretch="None"
169+
Data="F1 M1,10 L3,10 M5,10 L7,10 M9,10 L11,10 M2,9 L2,11 M6,9 L6,11 M10,9 L10,11 M5,6 L7,6 M9,6 L11,6 M6,5 L6,7 M10,5 L10,7 M9,2 L11,2 M10,1 L10,3" />
170+
</Grid>
171+
</Grid>
172+
</AdornerDecorator>
173+
</Border>
174+
<Border BorderBrush="{StaticResource BlueColorBrush}" BorderThickness="1"
175+
Visibility="{Binding IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Converter={StaticResource Bool2VisibilityConverter}}" />
176+
</Grid>
177+
</Border>
178+
<ControlTemplate.Triggers>
179+
<Trigger Property="WindowState" Value="Maximized">
180+
<Setter TargetName="Maximize" Property="Visibility" Value="Collapsed" />
181+
<Setter TargetName="Restore" Property="Visibility" Value="Visible" />
182+
<Setter TargetName="LayoutRoot" Property="Margin" Value="7" />
183+
</Trigger>
184+
<Trigger Property="WindowState" Value="Normal">
185+
<Setter TargetName="Maximize" Property="Visibility" Value="Visible" />
186+
<Setter TargetName="Restore" Property="Visibility" Value="Collapsed" />
187+
</Trigger>
188+
<MultiTrigger>
189+
<MultiTrigger.Conditions>
190+
<Condition Property="ResizeMode" Value="CanResizeWithGrip" />
191+
<Condition Property="WindowState" Value="Normal" />
192+
</MultiTrigger.Conditions>
193+
<Setter TargetName="ResizeGrip" Property="Visibility" Value="Visible" />
194+
</MultiTrigger>
195+
</ControlTemplate.Triggers>
196+
</ControlTemplate>
197+
</Setter.Value>
198+
</Setter>
199+
<Setter Property="WindowChrome.WindowChrome">
200+
<Setter.Value>
201+
<WindowChrome CornerRadius="0" GlassFrameThickness="1" UseAeroCaptionButtons="False" />
202+
</Setter.Value>
203+
</Setter>
204+
</Style>
7205
</Application.Resources>
8-
</Application>
206+
</Application>

VRCLauncher/App.xaml.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
using System.Windows;
2-
3-
namespace VRCLauncher;
1+
namespace VRCLauncher;
42

53
/// <summary>
64
/// Interaction logic for App.xaml
75
/// </summary>
86
public partial class App
97
{
10-
private void Application_Startup(object sender, StartupEventArgs e)
11-
{
12-
View.MainWindow wnd = new View.MainWindow(e.Args);
13-
wnd.Show();
14-
}
158
}

VRCLauncher/Model/Config.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public static Config Load()
9393
try
9494
{
9595
config = JsonSerializer.Deserialize<Config>(json)!;
96+
config.LaunchInstance = "";
9697
}
9798
catch (Exception e)
9899
{

VRCLauncher/VRCLauncher.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
55
<TargetFramework>net6.0-windows</TargetFramework>
6-
<Nullable>enable</Nullable>
6+
<Nullable>disable</Nullable>
77
<UseWPF>true</UseWPF>
88
<PackageVersion>0.3</PackageVersion>
99
<Title>VRCLauncher</Title>

0 commit comments

Comments
 (0)