-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
383 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<UserControl x:Class="Starward.Controls.CloseWindowDialog" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:lang="using:Starward.Language" | ||
xmlns:local="using:Starward.Controls" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
x:DefaultBindMode="OneWay" | ||
mc:Ignorable="d"> | ||
|
||
<StackPanel Spacing="4"> | ||
|
||
<TextBlock Margin="0,0,0,8" | ||
Foreground="{ThemeResource TextFillColorSecondaryBrush}" | ||
Text="{x:Bind lang:Lang.CloseWindowDialog_YouCouldChangeTheOptionAgainInSettingPage}" | ||
TextWrapping="Wrap" /> | ||
<RadioButton Click="RadioButton_Click" | ||
Content="{x:Bind lang:Lang.ExperienceSettingPage_MinimizeToSystemTray}" | ||
GroupName="CloseWindowOption" | ||
IsChecked="True" | ||
Tag="Hide" /> | ||
<RadioButton Click="RadioButton_Click" | ||
Content="{x:Bind lang:Lang.ExperienceSettingPage_ExitCompletely}" | ||
GroupName="CloseWindowOption" | ||
Tag="Exit" /> | ||
<RadioButton Click="RadioButton_Click" | ||
Content="{x:Bind lang:Lang.ExperienceSettingPage_CloseWindowButKeepSystemTray}" | ||
GroupName="CloseWindowOption" | ||
Tag="Close" /> | ||
</StackPanel> | ||
|
||
</UserControl> |
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,43 @@ | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Starward.Models; | ||
|
||
// To learn more about WinUI, the WinUI project structure, | ||
// and more about our project templates, see: http://aka.ms/winui-project-info. | ||
|
||
namespace Starward.Controls; | ||
|
||
public sealed partial class CloseWindowDialog : UserControl | ||
{ | ||
|
||
|
||
public CloseWindowOption CloseWindowOption { get; private set; } = CloseWindowOption.Hide; | ||
|
||
|
||
public CloseWindowDialog() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
|
||
private void RadioButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
if (sender is FrameworkElement element) | ||
{ | ||
if (element.Tag is "Hide") | ||
{ | ||
CloseWindowOption = CloseWindowOption.Hide; | ||
} | ||
else if (element.Tag is "Exit") | ||
{ | ||
CloseWindowOption = CloseWindowOption.Exit; | ||
} | ||
else if (element.Tag is "Close") | ||
{ | ||
CloseWindowOption = CloseWindowOption.Close; | ||
} | ||
} | ||
} | ||
|
||
|
||
} |
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,13 @@ | ||
namespace Starward.Models; | ||
|
||
public enum CloseWindowOption | ||
{ | ||
|
||
Undefined = 0, | ||
|
||
Hide = 1, | ||
|
||
Exit = 2, | ||
|
||
Close = 3, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<sp:PageBase x:Class="Starward.Pages.Setting.ExperienceSettingPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:lang="using:Starward.Language" | ||
xmlns:local="using:Starward.Pages.Setting" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:sp="using:Starward.Pages" | ||
x:DefaultBindMode="OneWay" | ||
mc:Ignorable="d"> | ||
|
||
<ScrollViewer> | ||
<StackPanel> | ||
|
||
<!-- close window option --> | ||
<TextBlock FontSize="20" | ||
FontWeight="SemiBold" | ||
Text="{x:Bind lang:Lang.ExperienceSettingPage_CloseWindowOption}" /> | ||
<Border Height="36" | ||
Margin="0,12,0,0" | ||
HorizontalAlignment="Left" | ||
Background="{ThemeResource CustomOverlayAcrylicBrush}" | ||
CornerRadius="8,18,18,8"> | ||
<ComboBox Name="ComboBox_CloseWindowOption" | ||
Height="36" | ||
MinWidth="280" | ||
Padding="18.5,0,0,0" | ||
BorderThickness="0" | ||
CornerRadius="8,18,18,8" | ||
SelectionChanged="ComboBox_CloseWindowOption_SelectionChanged" /> | ||
</Border> | ||
|
||
|
||
|
||
</StackPanel> | ||
</ScrollViewer> | ||
|
||
</sp:PageBase> |
Oops, something went wrong.