-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from Leo-Corporation/vNext
Version 2.2.0.2202
- Loading branch information
Showing
26 changed files
with
1,715 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<Page x:Class="Passliss.Pages.FirstRunPages.LanguagePage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:Passliss.Pages.FirstRunPages" | ||
xmlns:lang="clr-namespace:Passliss.Properties" | ||
mc:Ignorable="d" FontFamily="..\..\Fonts\#Montserrat" | ||
d:DesignHeight="450" d:DesignWidth="800" Foreground="{Binding Source={StaticResource Foreground1}}" | ||
Title="LanguagePage"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
|
||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<TextBlock Text="" Foreground="{Binding Source={StaticResource Foreground1}}" FontSize="100" HorizontalAlignment="Center" FontFamily="..\..\Fonts\#FluentSystemIcons-Regular"/> | ||
<TextBlock Text="{x:Static lang:Resources.Language}" Foreground="{Binding Source={StaticResource Foreground1}}" FontWeight="Bold" FontSize="20" Margin="0,10,0,0" HorizontalAlignment="Center"/> | ||
|
||
<ComboBox SelectionChanged="LangComboBox_SelectionChanged" BorderThickness="2" Padding="5" Style="{DynamicResource ComboBoxStyle1}" x:Name="LangComboBox" Background="Transparent" BorderBrush="{Binding Source={StaticResource AccentColor}}" Foreground="{Binding Source={StaticResource Foreground1}}" HorizontalAlignment="Center" Margin="0,5,0,0" VerticalAlignment="Center"/> | ||
<Button x:Name="LangApplyBtn" Background="{Binding Source={StaticResource AccentColor}}" Foreground="{Binding Source={StaticResource WindowButtonsHoverForeground1}}" Padding="10,5,10,5" Style="{StaticResource TabButtonStyle}" FontWeight="Bold" Cursor="Hand" VerticalAlignment="Center" Click="LangApplyBtn_Click" Visibility="Hidden" HorizontalAlignment="Center" Margin="0,10,0,0"> | ||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock Text="" FontWeight="Regular" FontFamily="..\..\Fonts\#FluentlyIcons" Margin="0,0,5,0" VerticalAlignment="Center"/> | ||
<TextBlock Text="{x:Static lang:Resources.Apply}" VerticalAlignment="Center"/> | ||
</StackPanel> | ||
</Button> | ||
</StackPanel> | ||
|
||
<Border x:Name="border" Background="{Binding Source={StaticResource LightAccentColor}}" CornerRadius="5" Padding="10" Margin="10" Grid.Row="1"> | ||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"> | ||
<TextBlock Foreground="{Binding Source={StaticResource AccentColor}}" Text="" FontSize="14" FontFamily="..\..\Fonts\#FluentlyIcons" Margin="0,0,10,0" VerticalAlignment="Center"/> | ||
<TextBlock Foreground="{Binding Source={StaticResource AccentColor}}" Text="{x:Static lang:Resources.ChangesApplyAfterRestart}" FontSize="14" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" MaxWidth="766" Width="500"/> | ||
</StackPanel> | ||
</Border> | ||
</Grid> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
MIT License | ||
Copyright (c) Léo Corporation | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
using Passliss.Classes; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
|
||
namespace Passliss.Pages.FirstRunPages | ||
{ | ||
/// <summary> | ||
/// Interaction logic for LanguagePage.xaml | ||
/// </summary> | ||
public partial class LanguagePage : Page | ||
{ | ||
public LanguagePage() | ||
{ | ||
InitializeComponent(); | ||
InitUI(); // Load the UI | ||
} | ||
|
||
private void InitUI() | ||
{ | ||
// Load LangComboBox | ||
LangComboBox.Items.Clear(); // Clear | ||
LangComboBox.Items.Add(Properties.Resources.Default); // Add "default" | ||
|
||
for (int i = 0; i < Global.LanguageList.Count; i++) | ||
{ | ||
LangComboBox.Items.Add(Global.LanguageList[i]); | ||
} | ||
|
||
LangComboBox.SelectedIndex = (Global.Settings.Language == "_default") ? 0 : Global.LanguageCodeList.IndexOf(Global.Settings.Language) + 1; | ||
LangApplyBtn.Visibility = Visibility.Collapsed; // Hide | ||
} | ||
|
||
private void LangComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||
{ | ||
LangApplyBtn.Visibility = Visibility.Visible; // Show | ||
} | ||
|
||
private void LangApplyBtn_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Global.Settings.Language = LangComboBox.Text switch | ||
{ | ||
"English (United States)" => Global.LanguageCodeList[0], // Set the settings value | ||
"Français (France)" => Global.LanguageCodeList[1], // Set the settings value | ||
"中文(简体)" => Global.LanguageCodeList[2], // Set the settings value | ||
_ => "_default" // Set the settings value | ||
}; | ||
SettingsManager.Save(); // Save the changes | ||
LangApplyBtn.Visibility = Visibility.Hidden; // Hide | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<Page x:Class="Passliss.Pages.FirstRunPages.ThemePage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:Passliss.Pages.FirstRunPages" | ||
xmlns:lang="clr-namespace:Passliss.Properties" | ||
mc:Ignorable="d" FontFamily="..\..\Fonts\#Montserrat" | ||
d:DesignHeight="450" d:DesignWidth="800" Foreground="{Binding Source={StaticResource Foreground1}}" | ||
Title="ThemePage"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
|
||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto"/> | ||
<ColumnDefinition/> | ||
</Grid.ColumnDefinitions> | ||
|
||
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> | ||
<TextBlock Text="" Margin="30 0" FontSize="100" FontFamily="..\..\Fonts\#FluentSystemIcons-Regular" VerticalAlignment="Center"/> | ||
<TextBlock Text="{x:Static lang:Resources.Theme}" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center"/> | ||
</StackPanel> | ||
|
||
<StackPanel Margin="10" Grid.Column="1"> | ||
<TextBlock Text="{x:Static lang:Resources.WelcomeThemeTitle}" FontWeight="Bold" FontSize="16"/> | ||
<TextBlock Text="{x:Static lang:Resources.ChangeTheme}" Foreground="{Binding Source={StaticResource Foreground1}}" FontSize="14" Margin="0,0,0,15"/> | ||
|
||
<StackPanel Orientation="Horizontal"> | ||
<Border x:Name="LightBorder" CornerRadius="10" Margin="5,20,5,5" Background="{Binding Source={StaticResource Background1}}" BorderThickness="3" BorderBrush="{x:Null}" MouseEnter="Border_MouseEnter" MouseLeave="Border_MouseLeave" Cursor="Hand" MouseLeftButtonUp="LightBorder_MouseLeftButtonUp"> | ||
<StackPanel Orientation="Vertical"> | ||
<Rectangle RadiusX="10" RadiusY="10" Width="100" Height="100" HorizontalAlignment="Center"> | ||
<Rectangle.Fill> | ||
<ImageBrush ImageSource="..\..\Images\LightTheme.png"/> | ||
</Rectangle.Fill> | ||
</Rectangle> | ||
<RadioButton Style="{DynamicResource RadioButtonStyle1}" x:Name="LightRadioBtn" Checked="LightRadioBtn_Checked" GroupName="ThemeRadioGroup" Content="{x:Static lang:Resources.Light}" Foreground="{Binding Source={StaticResource Foreground1}}" Background="{Binding Source={StaticResource Background1}}" BorderBrush="{Binding Source={StaticResource AccentColor}}" FontWeight="Bold" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,2,0,2"/> | ||
</StackPanel> | ||
|
||
<Border.Triggers> | ||
<EventTrigger RoutedEvent="Loaded"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" BeginTime="00:00:00"> | ||
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="5,20,5,5" /> | ||
<SplineThicknessKeyFrame KeyTime="00:00:00.2" Value="5,5,5,5" /> | ||
</ThicknessAnimationUsingKeyFrames> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
</Border.Triggers> | ||
</Border> | ||
<Border x:Name="DarkBorder" CornerRadius="10" Margin="5,21,5,5" Background="{Binding Source={StaticResource Background1}}" BorderThickness="3" BorderBrush="{x:Null}" MouseEnter="Border_MouseEnter" MouseLeave="Border_MouseLeave" Cursor="Hand" MouseLeftButtonUp="DarkBorder_MouseLeftButtonUp"> | ||
<StackPanel Orientation="Vertical"> | ||
<Rectangle RadiusX="10" RadiusY="10" Width="100" Height="100" HorizontalAlignment="Center"> | ||
<Rectangle.Fill> | ||
<ImageBrush ImageSource="..\..\Images\DarkTheme.png"/> | ||
</Rectangle.Fill> | ||
</Rectangle> | ||
<RadioButton Style="{DynamicResource RadioButtonStyle1}" x:Name="DarkRadioBtn" Checked="DarkRadioBtn_Checked" GroupName="ThemeRadioGroup" Content="{x:Static lang:Resources.Dark}" Foreground="{Binding Source={StaticResource Foreground1}}" Background="{Binding Source={StaticResource Background1}}" BorderBrush="{Binding Source={StaticResource AccentColor}}" FontWeight="Bold" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,2,0,2"/> | ||
</StackPanel> | ||
|
||
<Border.Triggers> | ||
<EventTrigger RoutedEvent="Loaded"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" BeginTime="00:00:0.2"> | ||
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="5,20,5,5" /> | ||
<SplineThicknessKeyFrame KeyTime="00:00:00.2" Value="5,5,5,5" /> | ||
</ThicknessAnimationUsingKeyFrames> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
</Border.Triggers> | ||
</Border> | ||
<Border x:Name="SystemBorder" CornerRadius="10" Margin="5,20,5,5" Background="{Binding Source={StaticResource Background1}}" BorderThickness="3" BorderBrush="{x:Null}" MouseEnter="Border_MouseEnter" MouseLeave="Border_MouseLeave" Cursor="Hand" MouseLeftButtonUp="SystemBorder_MouseLeftButtonUp"> | ||
<StackPanel Orientation="Vertical"> | ||
<Rectangle RadiusX="10" RadiusY="10" Width="100" Height="100" HorizontalAlignment="Center"> | ||
<Rectangle.Fill> | ||
<ImageBrush ImageSource="..\..\Images\SystemTheme.png"/> | ||
</Rectangle.Fill> | ||
</Rectangle> | ||
<RadioButton Style="{DynamicResource RadioButtonStyle1}" x:Name="SystemRadioBtn" Checked="SystemRadioBtn_Checked" GroupName="ThemeRadioGroup" Content="{x:Static lang:Resources.System}" Foreground="{Binding Source={StaticResource Foreground1}}" Background="{Binding Source={StaticResource Background1}}" BorderBrush="{Binding Source={StaticResource AccentColor}}" FontWeight="Bold" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,2,0,2"/> | ||
</StackPanel> | ||
|
||
<Border.Triggers> | ||
<EventTrigger RoutedEvent="Loaded"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" BeginTime="00:00:0.4"> | ||
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="5,20,5,5" /> | ||
<SplineThicknessKeyFrame KeyTime="00:00:00.2" Value="5,5,5,5" /> | ||
</ThicknessAnimationUsingKeyFrames> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
</Border.Triggers> | ||
</Border> | ||
<Button x:Name="ThemeApplyBtn" Background="{Binding Source={StaticResource AccentColor}}" Foreground="{Binding Source={StaticResource WindowButtonsHoverForeground1}}" Padding="10,5,10,5" Style="{StaticResource TabButtonStyle}" FontWeight="Bold" Cursor="Hand" VerticalAlignment="Center" Click="ThemeApplyBtn_Click" Visibility="Hidden"> | ||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock Text="" FontWeight="Regular" FontFamily="..\..\Fonts\#FluentlyIcons" Margin="0,0,5,0" VerticalAlignment="Center"/> | ||
<TextBlock Text="{x:Static lang:Resources.Apply}" VerticalAlignment="Center"/> | ||
</StackPanel> | ||
</Button> | ||
</StackPanel> | ||
</StackPanel> | ||
|
||
<Border x:Name="border" Background="{Binding Source={StaticResource LightAccentColor}}" CornerRadius="5" Padding="10" Margin="10" Grid.Row="1" Grid.ColumnSpan="2"> | ||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"> | ||
<TextBlock Foreground="{Binding Source={StaticResource AccentColor}}" Text="" FontSize="14" FontFamily="..\..\Fonts\#FluentlyIcons" Margin="0,0,10,0" VerticalAlignment="Center"/> | ||
<TextBlock Foreground="{Binding Source={StaticResource AccentColor}}" Text="{x:Static lang:Resources.ChangesApplyAfterRestart}" FontSize="14" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" MaxWidth="766" Width="500"/> | ||
</StackPanel> | ||
</Border> | ||
</Grid> | ||
</Page> |
Oops, something went wrong.