Skip to content

Commit 14ba091

Browse files
committed
Profile's Json file can be located in the Profile Editor view
1 parent bd1ed7f commit 14ba091

File tree

7 files changed

+97
-14
lines changed

7 files changed

+97
-14
lines changed

Source/vj0.Shared/Framework/Base/BaseProfile.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ protected virtual void NameChanged() { }
6464

6565
[ObservableProperty] private EAudioFormatType _audioFormat = EAudioFormatType.Decompressed;
6666

67-
[ObservableProperty] private string _fileName = "";
67+
[ObservableProperty]
68+
[NotifyPropertyChangedFor(nameof(FileID))]
69+
private string _fileName = "";
70+
71+
[JsonIgnore] public string FileID => FileName.Split(".json")[0];
6872

6973
/* Detection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
7074
[ObservableProperty]

Source/vj0/Models/Profiles/Profile.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.Globalization;
45
using System.IO;
56
using System.Linq;
@@ -758,4 +759,13 @@ public static void CreateNewProfile(Window window = null!)
758759
}
759760

760761
public static IRelayCommand<Window> CreateNewProfileCommand { get; } = new RelayCommand<Window>(CreateNewProfile!);
762+
763+
public void OpenInFileExplorer(Window window = null!)
764+
{
765+
if (File.Exists(SavedFilePath))
766+
{
767+
var argument = $"/select,\"{SavedFilePath}\"";
768+
Process.Start(new ProcessStartInfo("explorer.exe", argument) { UseShellExecute = true });
769+
}
770+
}
761771
}

Source/vj0/Services/DiscordService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class DiscordService : IService
1818
{
1919
LargeImageKey = "logo",
2020

21-
SmallImageText = $"v{Globals.VERSION} ({Globals.COMMIT})",
21+
SmallImageText = $"{Globals.VERSION} ({Globals.COMMIT})",
2222
SmallImageKey = $"small_image",
2323
},
2424
Buttons =

Source/vj0/Styles/ButtonStyles.axaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,46 @@
168168
<Style Selector="Button.BlueShine:disabled">
169169
<Setter Property="Opacity" Value="0.5" />
170170
</Style>
171+
172+
<!-- Empty Button -->
173+
<Style Selector="Button.Empty">
174+
<Setter Property="Background" Value="Transparent" />
175+
<Setter Property="Template">
176+
<ControlTemplate>
177+
<Border
178+
Background="{TemplateBinding Background}"
179+
BorderBrush="{TemplateBinding BorderBrush}"
180+
BorderThickness="{TemplateBinding BorderThickness}"
181+
CornerRadius="{TemplateBinding CornerRadius}">
182+
<ContentPresenter
183+
Name="PART_ContentPresenter"
184+
Content="{TemplateBinding Content}"
185+
ContentTemplate="{TemplateBinding ContentTemplate}"
186+
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
187+
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
188+
Padding="{TemplateBinding Padding}"
189+
Background="{x:Null}"
190+
Foreground="{TemplateBinding Foreground}"
191+
RecognizesAccessKey="True"/>
192+
</Border>
193+
</ControlTemplate>
194+
</Setter>
195+
</Style>
196+
197+
<Style Selector="Button.Empty /template/ ContentPresenter">
198+
<Setter Property="Background" Value="{x:Null}" />
199+
<Setter Property="TextBlock.Foreground" Value="{Binding $parent[Button].Foreground}" />
200+
</Style>
201+
202+
<Style Selector="Button.Empty /template/ ContentPresenter">
203+
<Setter Property="Background" Value="{x:Null}" />
204+
</Style>
205+
206+
<Style Selector="Button.Empty:pointerover">
207+
<Setter Property="Background" Value="Transparent" />
208+
</Style>
209+
210+
<Style Selector="Button.Empty:pressed">
211+
<Setter Property="Background" Value="Transparent" />
212+
</Style>
171213
</Styles>

Source/vj0/Views/HomeView.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
xmlns:viewModels="clr-namespace:vj0.ViewModels"
88
xmlns:framework="clr-namespace:vj0.Services.Framework"
99
xmlns:navigation="clr-namespace:vj0.Controls.Navigation"
10-
xmlns:application="clr-namespace:vj0.Application"
1110
xmlns:properties="clr-namespace:vj0.Extensions.Animations.Properties"
1211
xmlns:vj0="clr-namespace:vj0"
1312
x:Class="vj0.Views.HomeView"

Source/vj0/Views/TitleBar.axaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,20 @@
6262
<Button Name="Profile" ClipToBounds="True" Opacity="{Binding ProfileButtonOpacity}" BorderThickness="0" Padding="5 0 10 0" Background="Transparent" Height="45" CornerRadius="10">
6363
<Button.Flyout>
6464
<Flyout>
65-
<Grid Margin="3">
66-
<StackPanel Spacing="8">
67-
<Button Cursor="Hand" Click="EditProfile" HorizontalAlignment="Stretch" Padding="10 0" Height="35" Background="Transparent" CornerRadius="8" HorizontalContentAlignment="Left" VerticalContentAlignment="Center">
65+
<Grid Margin="5">
66+
<StackPanel Spacing="15">
67+
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0 0 20 0">
68+
<profiles:ProfileSplashControl Radius="12" SplashScale="1.5" DataContext="{Binding CurrentProfile}"/>
69+
70+
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Spacing="0">
71+
<TextBlock MaxWidth="250" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" FontSize="18" FontWeight="DemiBold" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding ProfileDisplayName}"/>
72+
<TextBlock FontFamily="Consolas" FontSize="14" Opacity="0.5" Text="{Binding CurrentProfile.FileID}"/>
73+
</StackPanel>
74+
</StackPanel>
75+
76+
<Border Background="White" Height="1" Opacity="0.06" Margin="-50 5 -50 0"></Border>
77+
78+
<Button Cursor="Hand" Click="EditProfile" HorizontalAlignment="Stretch" Padding="10 0" Height="45" Background="Transparent" CornerRadius="8" HorizontalContentAlignment="Left" VerticalContentAlignment="Center">
6879
<ToolTip.Tip>
6980
<StackPanel Orientation="Horizontal">
7081
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">Edit Settings</TextBlock>
@@ -73,9 +84,9 @@
7384
</ToolTip.Tip>
7485

7586
<StackPanel Orientation="Horizontal" Spacing="12" Opacity="1">
76-
<avalonia:FluentIcon Icon="Settings" IconSize="Size32" FontSize="17" IconVariant="Regular"/>
87+
<avalonia:FluentIcon Icon="Settings" IconSize="Size32" FontSize="19" IconVariant="Regular"/>
7788

78-
<TextBlock FontWeight="Light" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center">
89+
<TextBlock FontWeight="Light" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center">
7990
Settings
8091
</TextBlock>
8192
</StackPanel>
@@ -110,15 +121,15 @@
110121
<Button.Flyout>
111122
<Flyout Placement="Bottom" VerticalOffset="3">
112123
<StackPanel Spacing="15" Margin="5">
113-
<StackPanel Orientation="Horizontal" Spacing="10" Margin="0 0 10 0">
124+
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0 0 10 0">
114125
<Border Width="40" Height="40" CornerRadius="10" Background="Black">
115126
<Image
116127
Source="/Assets/Views/Version.png"
117128
Width="30"
118129
HorizontalAlignment="Center"
119130
VerticalAlignment="Center"
120131
IsHitTestVisible="False"
121-
Height="16"
132+
Height="17"
122133
Margin="0 2 0 0"/>
123134
</Border>
124135

@@ -132,10 +143,11 @@
132143
<StackPanel Orientation="Horizontal" Spacing="5" HorizontalAlignment="Center">
133144
<Button Click="CopyGitCloneCommand" Cursor="Hand"
134145
HorizontalAlignment="Stretch"
135-
Padding="10"
136146
FontWeight="Normal"
137147
Opacity="0.95"
138148
Background="Black"
149+
Height="30"
150+
BorderThickness="1"
139151
BorderBrush="#1f2023"
140152
CornerRadius="15">
141153

@@ -170,7 +182,7 @@
170182
<avalonia1:MaterialIcon Kind="Git"/>
171183
</Button>
172184

173-
<Button HorizontalAlignment="Stretch" ToolTip.Tip="View Commit" Background="Black" CornerRadius="15" Cursor="Hand" IsVisible="{x:Static vj0:Globals.IS_COMMIT_AVAILABLE}" Click="OpenGitHubLink" Height="30">
185+
<Button HorizontalAlignment="Stretch" BorderThickness="1" ToolTip.Tip="View Commit" Background="Black" CornerRadius="15" Cursor="Hand" IsVisible="{x:Static vj0:Globals.IS_COMMIT_AVAILABLE}" Click="OpenGitHubLink" Height="30">
174186
<Button.Resources>
175187
<ResourceDictionary>
176188
<SolidColorBrush x:Key="ButtonBackgroundPointerOver">#0f0f0f</SolidColorBrush>
@@ -185,7 +197,7 @@
185197
<avalonia1:MaterialIcon Kind="Github"/>
186198
</Button>
187199

188-
<Button HorizontalAlignment="Stretch" ToolTip.Tip="View License" Background="Black" CornerRadius="15" Cursor="Hand" Click="OpenGitHubLicense" Height="30">
200+
<Button HorizontalAlignment="Stretch" BorderThickness="1" ToolTip.Tip="View License" Background="Black" CornerRadius="15" Cursor="Hand" Click="OpenGitHubLicense" Height="30">
189201
<Button.Resources>
190202
<ResourceDictionary>
191203
<SolidColorBrush x:Key="ButtonBackgroundPointerOver">#0f0f0f</SolidColorBrush>

Source/vj0/Windows/ProfileEditorWindow.axaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
Width="900" Height="750"
2020
MinWidth="860" MinHeight="550"
2121

22+
CanResize="False"
23+
2224
Background="{DynamicResource BackgroundBrush}"
2325
FontWeight="Light"
2426

@@ -171,7 +173,21 @@
171173

172174
<StackPanel Orientation="Horizontal"
173175
Height="60"
174-
Margin="0 5 15 5"
176+
Margin="25 5 0 5"
177+
HorizontalAlignment="Left"
178+
Spacing="10"
179+
VerticalAlignment="Bottom">
180+
<StackPanel Opacity="0.11" IsVisible="{Binding !IsUncompletedProfile}" HorizontalAlignment="Center" Orientation="Horizontal" VerticalAlignment="Center">
181+
<TextBlock Margin="0 0 5 0">Saved to</TextBlock>
182+
<Button Cursor="Hand" Classes="Empty" Padding="0" Command="{Binding Profile.OpenInFileExplorer}">
183+
<TextBlock Text="{Binding Profile.FileID}"/>
184+
</Button>
185+
</StackPanel>
186+
</StackPanel>
187+
188+
<StackPanel Orientation="Horizontal"
189+
Height="60"
190+
Margin="0 5 25 5"
175191
HorizontalAlignment="Right"
176192
Spacing="10"
177193
VerticalAlignment="Bottom">

0 commit comments

Comments
 (0)