mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-25 10:05:49 +08:00
重构任务节点对话框和JS脚本选择窗口,调整命名空间,优化代码结构
This commit is contained in:
@@ -0,0 +1,221 @@
|
||||
<ui:FluentWindow x:Class="BetterGenshinImpact.View.Windows.GearTask.JsScriptSelectionWindow"
|
||||
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:local="clr-namespace:BetterGenshinImpact.View.Windows"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:vio="http://schemas.lepo.co/wpfui/2022/xaml/violeta"
|
||||
xmlns:gearTask="clr-namespace:BetterGenshinImpact.ViewModel.Windows.GearTask"
|
||||
Title="选择JS脚本"
|
||||
Width="900"
|
||||
Height="600"
|
||||
MinWidth="800"
|
||||
MinHeight="500"
|
||||
Background="#202020"
|
||||
ExtendsContentIntoTitleBar="True"
|
||||
FontFamily="{DynamicResource TextThemeFontFamily}"
|
||||
d:DataContext="{d:DesignInstance Type=gearTask:JsScriptSelectionViewModel}"
|
||||
WindowBackdropType="None"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="48" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 标题栏 -->
|
||||
<ui:TitleBar Grid.Row="0"
|
||||
Title="选择JS脚本"
|
||||
ShowMaximize="False"
|
||||
ShowMinimize="False">
|
||||
<ui:TitleBar.Icon>
|
||||
<ui:ImageIcon Source="pack://application:,,,/Resources/Images/logo.png" />
|
||||
</ui:TitleBar.Icon>
|
||||
</ui:TitleBar>
|
||||
|
||||
<!-- 主内容区域 -->
|
||||
<Grid Grid.Row="1" Margin="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="300" />
|
||||
<ColumnDefinition Width="5" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 左侧脚本列表 -->
|
||||
<Border Grid.Column="0"
|
||||
Background="{ui:ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{ui:ThemeResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="8">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 标题和刷新按钮 -->
|
||||
<Grid Grid.Row="0" Margin="12,12,12,8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="JS脚本列表"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
VerticalAlignment="Center" />
|
||||
|
||||
<ui:Button Grid.Column="1"
|
||||
Command="{Binding RefreshScriptsCommand}"
|
||||
Content="刷新"
|
||||
Appearance="Secondary"
|
||||
Padding="8,4" />
|
||||
</Grid>
|
||||
|
||||
<!-- 脚本列表 -->
|
||||
<ScrollViewer Grid.Row="1"
|
||||
Margin="8,0,8,8"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<ListBox ItemsSource="{Binding JsScripts}"
|
||||
SelectedItem="{Binding SelectedScript}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Padding="8"
|
||||
Margin="2"
|
||||
Background="Transparent"
|
||||
BorderBrush="{ui:ThemeResource ControlStrokeColorDefaultBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Manifest.Name}"
|
||||
FontWeight="SemiBold"
|
||||
TextWrapping="Wrap" />
|
||||
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding FolderName}"
|
||||
FontSize="12"
|
||||
Foreground="{ui:ThemeResource TextFillColorSecondaryBrush}"
|
||||
Margin="0,2,0,4" />
|
||||
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding Description}"
|
||||
FontSize="11"
|
||||
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
|
||||
TextWrapping="Wrap"
|
||||
MaxHeight="60" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 分隔线 -->
|
||||
<GridSplitter Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="Transparent" />
|
||||
|
||||
<!-- 右侧详情区域 -->
|
||||
<Border Grid.Column="2"
|
||||
Background="{ui:ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{ui:ThemeResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="8">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 脚本信息标题 -->
|
||||
<Border Grid.Row="0"
|
||||
Background="{ui:ThemeResource CardBackgroundFillColorSecondaryBrush}"
|
||||
BorderBrush="{ui:ThemeResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
CornerRadius="8,8,0,0"
|
||||
Padding="12,8">
|
||||
<TextBlock Text="{Binding SelectedScript.DisplayName, FallbackValue='请选择一个脚本'}"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold" />
|
||||
</Border>
|
||||
|
||||
<!-- TabControl -->
|
||||
<TabControl Grid.Row="1"
|
||||
Margin="8"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
SelectedIndex="{Binding SelectedTabIndex}">
|
||||
<TabItem Header="README.md">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto"
|
||||
Padding="8">
|
||||
<TextBox Text="{Binding ReadmeContent, Mode=OneWay}"
|
||||
IsReadOnly="True"
|
||||
TextWrapping="Wrap"
|
||||
AcceptsReturn="True"
|
||||
VerticalScrollBarVisibility="Disabled"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
FontFamily="Consolas, 'Courier New', monospace" />
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Header="main.js">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto"
|
||||
Padding="8">
|
||||
<TextBox Text="{Binding MainJsContent, Mode=OneWay}"
|
||||
IsReadOnly="True"
|
||||
TextWrapping="Wrap"
|
||||
AcceptsReturn="True"
|
||||
VerticalScrollBarVisibility="Disabled"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
FontFamily="Consolas, 'Courier New', monospace" />
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- 底部按钮区域 -->
|
||||
<Border Grid.Row="2"
|
||||
Background="{ui:ThemeResource CardBackgroundFillColorSecondaryBrush}"
|
||||
BorderBrush="{ui:ThemeResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="0,1,0,0"
|
||||
Padding="12">
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<ui:Button Content="确定"
|
||||
Appearance="Primary"
|
||||
Margin="0,0,8,0"
|
||||
Padding="16,8"
|
||||
IsDefault="True"
|
||||
Click="OnOkClick" />
|
||||
<ui:Button Content="取消"
|
||||
Appearance="Secondary"
|
||||
Padding="16,8"
|
||||
IsCancel="True"
|
||||
Click="OnCancelClick" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ui:FluentWindow>
|
||||
Reference in New Issue
Block a user