mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-15 07:43:20 +08:00
Add About option to settings page
--- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/babalae/better-genshin-impact?shareId=XXXX-XXXX-XXXX-XXXX).
This commit is contained in:
@@ -621,16 +621,12 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
FontTypography="Body"
|
||||
<ui:TextBlock Grid.Row="0" Grid.Column="0"
|
||||
Text="七天神像设置"
|
||||
TextWrapping="Wrap" />
|
||||
<ui:TextBlock Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
|
||||
FontTypography="Body" />
|
||||
<ui:TextBlock Grid.Row="1" Grid.Column="0"
|
||||
Text="用于指定回血的七天神像"
|
||||
TextWrapping="Wrap" />
|
||||
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}" />
|
||||
</Grid>
|
||||
</ui:CardExpander.Header>
|
||||
<StackPanel>
|
||||
@@ -880,13 +876,13 @@
|
||||
<ui:TextBlock Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
FontTypography="Body"
|
||||
Text="查看地图(开发者)"
|
||||
TextWrapping="Wrap" />
|
||||
TextWrapping="Wrap"
|
||||
Text="查看地图(开发者)" />
|
||||
<ui:TextBlock Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
|
||||
Text="查看当前识别到的位置"
|
||||
TextWrapping="Wrap" />
|
||||
TextWrapping="Wrap"
|
||||
Text="查看当前识别到的位置" />
|
||||
</Grid>
|
||||
</ui:CardControl.Header>
|
||||
<ui:Button Margin="0,0,36,0"
|
||||
@@ -919,5 +915,29 @@
|
||||
Margin="0,0,36,0"
|
||||
IsChecked="{Binding Config.MaskWindowConfig.ShowLogBox, Mode=TwoWay}"/>
|
||||
</ui:CardControl>-->
|
||||
<!-- About Option -->
|
||||
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Info24}">
|
||||
<ui:CardControl.Header>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ui:TextBlock Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
FontTypography="Body"
|
||||
Text="关于"
|
||||
TextWrapping="Wrap" />
|
||||
<ui:TextBlock Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
|
||||
Text="查看项目相关信息"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</ui:CardControl.Header>
|
||||
<ui:Button Margin="0,0,36,0"
|
||||
Command="{Binding OpenAboutWindowCommand}"
|
||||
Content="查看" />
|
||||
</ui:CardControl>
|
||||
</StackPanel>
|
||||
</Page>
|
||||
</Page>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using BetterGenshinImpact.ViewModel.Pages;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using BetterGenshinImpact.View.Windows;
|
||||
|
||||
namespace BetterGenshinImpact.View.Pages;
|
||||
|
||||
@@ -12,4 +14,23 @@ public partial class CommonSettingsPage : Page
|
||||
DataContext = ViewModel = viewModel;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private ICommand _openAboutWindowCommand;
|
||||
public ICommand OpenAboutWindowCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_openAboutWindowCommand == null)
|
||||
{
|
||||
_openAboutWindowCommand = new RelayCommand(OpenAboutWindow);
|
||||
}
|
||||
return _openAboutWindowCommand;
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenAboutWindow()
|
||||
{
|
||||
var aboutWindow = new AboutWindow();
|
||||
aboutWindow.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
38
BetterGenshinImpact/View/Windows/AboutWindow.xaml
Normal file
38
BetterGenshinImpact/View/Windows/AboutWindow.xaml
Normal file
@@ -0,0 +1,38 @@
|
||||
<ui:FluentWindow x:Class="BetterGenshinImpact.View.Windows.AboutWindow"
|
||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
Title="关于"
|
||||
Width="400"
|
||||
Height="300"
|
||||
Background="#202020"
|
||||
ExtendsContentIntoTitleBar="True"
|
||||
FontFamily="{DynamicResource TextThemeFontFamily}"
|
||||
WindowBackdropType="None"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<ui:Grid Margin="0,48,0,0" RowDefinitions="Auto,*,Auto">
|
||||
<ui:TextBlock Grid.Row="0" Margin="16,0,16,0" FontSize="16" FontWeight="Bold" Text="Better Genshin Impact" />
|
||||
<ui:TextBlock Grid.Row="1" Margin="16,0,16,0" TextWrapping="Wrap">
|
||||
<Run Text="开源地址: " />
|
||||
<Hyperlink NavigateUri="https://github.com/babalae/better-genshin-impact" RequestNavigate="Hyperlink_RequestNavigate">https://github.com/babalae/better-genshin-impact</Hyperlink>
|
||||
<LineBreak />
|
||||
<Run Text="协议: GPLv3" />
|
||||
<LineBreak />
|
||||
<Run Text="作者: huiyadanli" />
|
||||
<LineBreak />
|
||||
<Run Text="捐赠: " />
|
||||
<Hyperlink NavigateUri="https://github.com/babalae/better-genshin-impact#捐赠" RequestNavigate="Hyperlink_RequestNavigate">https://github.com/babalae/better-genshin-impact#捐赠</Hyperlink>
|
||||
</ui:TextBlock>
|
||||
<ui:Button Grid.Row="2" Margin="16" HorizontalAlignment="Right" Width="80" Content="关闭" Click="CloseButton_Click" />
|
||||
</ui:Grid>
|
||||
<ui:TitleBar Title="关于">
|
||||
<ui:TitleBar.Icon>
|
||||
<ui:ImageIcon Source="pack://application:,,,/Assets/Images/logo.png" />
|
||||
</ui:TitleBar.Icon>
|
||||
</ui:TitleBar>
|
||||
</Grid>
|
||||
</ui:FluentWindow>
|
||||
25
BetterGenshinImpact/View/Windows/AboutWindow.xaml.cs
Normal file
25
BetterGenshinImpact/View/Windows/AboutWindow.xaml.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
namespace BetterGenshinImpact.View.Windows
|
||||
{
|
||||
public partial class AboutWindow : Window
|
||||
{
|
||||
public AboutWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user