mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2026-03-17 14:52:57 +00:00
feat: Create a new GUI project based on Avalonia. (Powered by Claude)
This commit is contained in:
81
src/ZonyLrcTools.Desktop/Views/MainWindow.axaml
Normal file
81
src/ZonyLrcTools.Desktop/Views/MainWindow.axaml
Normal file
@@ -0,0 +1,81 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:ZonyLrcTools.Desktop.ViewModels"
|
||||
xmlns:pages="using:ZonyLrcTools.Desktop.Views.Pages"
|
||||
xmlns:loc="using:ZonyLrcTools.Desktop.Infrastructure.Localization"
|
||||
x:Class="ZonyLrcTools.Desktop.Views.MainWindow"
|
||||
x:DataType="vm:MainWindowViewModel"
|
||||
Title="{Binding Title}"
|
||||
Width="1200" Height="800"
|
||||
MinWidth="900" MinHeight="600"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
|
||||
<Grid ColumnDefinitions="220,*">
|
||||
<!-- Left Navigation Panel -->
|
||||
<Border Grid.Column="0"
|
||||
Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
Padding="8">
|
||||
<DockPanel>
|
||||
<!-- App Title -->
|
||||
<StackPanel DockPanel.Dock="Top" Margin="8,16,8,24">
|
||||
<TextBlock Text="ZonyLrcTools"
|
||||
FontSize="24"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Center" />
|
||||
<TextBlock Text="{Binding HomeDescription}"
|
||||
FontSize="12"
|
||||
Opacity="0.7"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,4,0,0" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Theme Toggle -->
|
||||
<Button DockPanel.Dock="Bottom"
|
||||
Content="{Binding ThemeButtonText}"
|
||||
Command="{Binding ToggleThemeCommand}"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center"
|
||||
Margin="8" />
|
||||
|
||||
<!-- Navigation Menu -->
|
||||
<ListBox SelectedIndex="{Binding SelectedNavigationIndex}"
|
||||
Margin="0,8"
|
||||
SelectionChanged="OnNavigationSelectionChanged">
|
||||
<ListBoxItem>
|
||||
<TextBlock Text="{Binding NavHome}" VerticalAlignment="Center" />
|
||||
</ListBoxItem>
|
||||
<ListBoxItem>
|
||||
<TextBlock Text="{Binding NavLyricsDownload}" VerticalAlignment="Center" />
|
||||
</ListBoxItem>
|
||||
<ListBoxItem>
|
||||
<TextBlock Text="{Binding NavAlbumDownload}" VerticalAlignment="Center" />
|
||||
</ListBoxItem>
|
||||
<ListBoxItem>
|
||||
<TextBlock Text="{Binding NavSettings}" VerticalAlignment="Center" />
|
||||
</ListBoxItem>
|
||||
</ListBox>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Right Content Area -->
|
||||
<Border Grid.Column="1" Padding="24">
|
||||
<ContentControl Content="{Binding CurrentPage}">
|
||||
<ContentControl.DataTemplates>
|
||||
<DataTemplate DataType="vm:HomeViewModel">
|
||||
<pages:HomePage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="vm:LyricsDownloadViewModel">
|
||||
<pages:LyricsDownloadPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="vm:AlbumDownloadViewModel">
|
||||
<pages:AlbumDownloadPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="vm:SettingsViewModel">
|
||||
<pages:SettingsPage />
|
||||
</DataTemplate>
|
||||
</ContentControl.DataTemplates>
|
||||
</ContentControl>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
</Window>
|
||||
38
src/ZonyLrcTools.Desktop/Views/MainWindow.axaml.cs
Normal file
38
src/ZonyLrcTools.Desktop/Views/MainWindow.axaml.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Avalonia.Controls;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using ZonyLrcTools.Desktop.ViewModels;
|
||||
|
||||
namespace ZonyLrcTools.Desktop.Views;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnNavigationSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (DataContext is not MainWindowViewModel viewModel) return;
|
||||
if (sender is not ListBox listBox) return;
|
||||
|
||||
var services = App.Services;
|
||||
if (services == null) return;
|
||||
|
||||
switch (listBox.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
viewModel.CurrentPage = services.GetRequiredService<HomeViewModel>();
|
||||
break;
|
||||
case 1:
|
||||
viewModel.CurrentPage = services.GetRequiredService<LyricsDownloadViewModel>();
|
||||
break;
|
||||
case 2:
|
||||
viewModel.CurrentPage = services.GetRequiredService<AlbumDownloadViewModel>();
|
||||
break;
|
||||
case 3:
|
||||
viewModel.CurrentPage = services.GetRequiredService<SettingsViewModel>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
142
src/ZonyLrcTools.Desktop/Views/Pages/AlbumDownloadPage.axaml
Normal file
142
src/ZonyLrcTools.Desktop/Views/Pages/AlbumDownloadPage.axaml
Normal file
@@ -0,0 +1,142 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:ZonyLrcTools.Desktop.ViewModels"
|
||||
x:Class="ZonyLrcTools.Desktop.Views.Pages.AlbumDownloadPage"
|
||||
x:DataType="vm:AlbumDownloadViewModel">
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto,*,Auto">
|
||||
<!-- Title -->
|
||||
<StackPanel Grid.Row="0" Margin="0,0,0,24">
|
||||
<TextBlock Text="{Binding AlbumTitle}"
|
||||
FontSize="28"
|
||||
FontWeight="SemiBold" />
|
||||
<TextBlock Text="{Binding AlbumDescription}"
|
||||
Opacity="0.7"
|
||||
Margin="0,4,0,0" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Controls -->
|
||||
<Border Grid.Row="1"
|
||||
Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
CornerRadius="8"
|
||||
Padding="16"
|
||||
Margin="0,0,0,16">
|
||||
<StackPanel Spacing="16">
|
||||
<!-- Row 1: Folder Selection -->
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<TextBox Grid.Column="0"
|
||||
Text="{Binding SelectedFolderPath}"
|
||||
Watermark="{Binding AlbumSelectFolder}"
|
||||
IsReadOnly="True"
|
||||
Margin="0,0,12,0" />
|
||||
<Button Grid.Column="1"
|
||||
Content="{Binding AlbumBrowse}"
|
||||
Command="{Binding SelectFolderCommand}"
|
||||
MinWidth="80" />
|
||||
</Grid>
|
||||
|
||||
<!-- Row 2: Options and Actions -->
|
||||
<Grid ColumnDefinitions="Auto,Auto,*,Auto">
|
||||
<!-- Parallel Count -->
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding AlbumParallel}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding ParallelCount}"
|
||||
Width="60"
|
||||
TextAlignment="Center"
|
||||
VerticalContentAlignment="Center" />
|
||||
|
||||
<!-- Spacer -->
|
||||
<Panel Grid.Column="2" />
|
||||
|
||||
<!-- Download Buttons -->
|
||||
<StackPanel Grid.Column="3" Orientation="Horizontal" Spacing="8">
|
||||
<Button Command="{Binding StartDownloadCommand}"
|
||||
Content="{Binding AlbumStartDownload}"
|
||||
IsVisible="{Binding !IsDownloading}"
|
||||
Classes="accent"
|
||||
MinWidth="100" />
|
||||
<Button Command="{Binding CancelDownloadCommand}"
|
||||
Content="{Binding AlbumStopDownload}"
|
||||
IsVisible="{Binding IsDownloading}"
|
||||
MinWidth="100" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Progress Bar (visible during download) -->
|
||||
<StackPanel IsVisible="{Binding IsDownloading}" Spacing="8">
|
||||
<ProgressBar Value="{Binding ProgressPercentage}"
|
||||
Maximum="100"
|
||||
Height="6" />
|
||||
<TextBlock HorizontalAlignment="Center" FontSize="12" Opacity="0.8">
|
||||
<Run Text="{Binding CompletedCount}" />
|
||||
<Run Text=" / " />
|
||||
<Run Text="{Binding TotalCount}" />
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- File List -->
|
||||
<Border Grid.Row="2"
|
||||
Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
CornerRadius="8"
|
||||
Padding="1">
|
||||
<DataGrid ItemsSource="{Binding MusicFiles}"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal"
|
||||
BorderThickness="0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{Binding ColumnSongName}"
|
||||
Binding="{Binding Name}"
|
||||
Width="*" />
|
||||
<DataGridTextColumn Header="{Binding ColumnArtist}"
|
||||
Binding="{Binding Artist}"
|
||||
Width="200" />
|
||||
<DataGridTextColumn Header="{Binding ColumnStatus}"
|
||||
Binding="{Binding StatusMessage}"
|
||||
Width="120" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Border>
|
||||
|
||||
<!-- Status Bar -->
|
||||
<Border Grid.Row="3"
|
||||
Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
Padding="16,12"
|
||||
Margin="0,16,0,0"
|
||||
CornerRadius="8">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
|
||||
<!-- Total -->
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal" Spacing="4">
|
||||
<TextBlock Text="{Binding CommonTotal}" Opacity="0.8" />
|
||||
<TextBlock Text="{Binding TotalCount}" FontWeight="SemiBold" />
|
||||
<TextBlock Text="{Binding CommonFiles}" Opacity="0.8" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Spacer -->
|
||||
<Panel Grid.Column="1" />
|
||||
|
||||
<!-- Success -->
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="4" Margin="0,0,24,0">
|
||||
<TextBlock Text="{Binding CommonSuccess}" Opacity="0.8" />
|
||||
<TextBlock Text="{Binding CompletedCount}"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="#4CAF50" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Failed -->
|
||||
<StackPanel Grid.Column="3" Orientation="Horizontal" Spacing="4">
|
||||
<TextBlock Text="{Binding CommonFailed}" Opacity="0.8" />
|
||||
<TextBlock Text="{Binding FailedCount}"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="#F44336" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace ZonyLrcTools.Desktop.Views.Pages;
|
||||
|
||||
public partial class AlbumDownloadPage : UserControl
|
||||
{
|
||||
public AlbumDownloadPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
97
src/ZonyLrcTools.Desktop/Views/Pages/HomePage.axaml
Normal file
97
src/ZonyLrcTools.Desktop/Views/Pages/HomePage.axaml
Normal file
@@ -0,0 +1,97 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:ZonyLrcTools.Desktop.ViewModels"
|
||||
x:Class="ZonyLrcTools.Desktop.Views.Pages.HomePage"
|
||||
x:DataType="vm:HomeViewModel">
|
||||
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="24">
|
||||
<!-- Header -->
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Text="{Binding WelcomeMessage}"
|
||||
FontSize="32"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Text="{Binding Description}"
|
||||
FontSize="14"
|
||||
Opacity="0.7"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Quick Actions -->
|
||||
<Border Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
CornerRadius="8"
|
||||
Padding="24">
|
||||
<StackPanel Spacing="16">
|
||||
<TextBlock Text="Quick Actions"
|
||||
FontSize="18"
|
||||
FontWeight="SemiBold" />
|
||||
|
||||
<WrapPanel Orientation="Horizontal">
|
||||
<Button Margin="0,0,16,16"
|
||||
Padding="24,16"
|
||||
CornerRadius="8">
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Text="Download Lyrics"
|
||||
FontWeight="SemiBold" />
|
||||
<TextBlock Text="Batch download lyrics for your music"
|
||||
FontSize="12"
|
||||
Opacity="0.7" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Button Margin="0,0,16,16"
|
||||
Padding="24,16"
|
||||
CornerRadius="8">
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Text="Download Album Covers"
|
||||
FontWeight="SemiBold" />
|
||||
<TextBlock Text="Get album artwork for your collection"
|
||||
FontSize="12"
|
||||
Opacity="0.7" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Features -->
|
||||
<Border Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
CornerRadius="8"
|
||||
Padding="24">
|
||||
<StackPanel Spacing="16">
|
||||
<TextBlock Text="Features"
|
||||
FontSize="18"
|
||||
FontWeight="SemiBold" />
|
||||
|
||||
<ItemsControl>
|
||||
<ItemsControl.Items>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" Margin="0,4">
|
||||
<TextBlock Text="*" FontWeight="Bold" Foreground="{DynamicResource AppAccentBrush}" />
|
||||
<TextBlock Text="Multiple lyrics sources: NetEase, QQ Music, KuGou, KuWo" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" Margin="0,4">
|
||||
<TextBlock Text="*" FontWeight="Bold" Foreground="{DynamicResource AppAccentBrush}" />
|
||||
<TextBlock Text="Batch processing with parallel downloads" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" Margin="0,4">
|
||||
<TextBlock Text="*" FontWeight="Bold" Foreground="{DynamicResource AppAccentBrush}" />
|
||||
<TextBlock Text="Support for translation lyrics" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" Margin="0,4">
|
||||
<TextBlock Text="*" FontWeight="Bold" Foreground="{DynamicResource AppAccentBrush}" />
|
||||
<TextBlock Text="Cross-platform: Windows, macOS, Linux" />
|
||||
</StackPanel>
|
||||
</ItemsControl.Items>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Version Info -->
|
||||
<TextBlock Opacity="0.5" FontSize="12">
|
||||
<Run Text="Version " />
|
||||
<Run Text="{Binding Version}" />
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
</UserControl>
|
||||
11
src/ZonyLrcTools.Desktop/Views/Pages/HomePage.axaml.cs
Normal file
11
src/ZonyLrcTools.Desktop/Views/Pages/HomePage.axaml.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace ZonyLrcTools.Desktop.Views.Pages;
|
||||
|
||||
public partial class HomePage : UserControl
|
||||
{
|
||||
public HomePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
145
src/ZonyLrcTools.Desktop/Views/Pages/LyricsDownloadPage.axaml
Normal file
145
src/ZonyLrcTools.Desktop/Views/Pages/LyricsDownloadPage.axaml
Normal file
@@ -0,0 +1,145 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:ZonyLrcTools.Desktop.ViewModels"
|
||||
x:Class="ZonyLrcTools.Desktop.Views.Pages.LyricsDownloadPage"
|
||||
x:DataType="vm:LyricsDownloadViewModel">
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto,*,Auto">
|
||||
<!-- Title -->
|
||||
<StackPanel Grid.Row="0" Margin="0,0,0,24">
|
||||
<TextBlock Text="{Binding LyricsTitle}"
|
||||
FontSize="28"
|
||||
FontWeight="SemiBold" />
|
||||
<TextBlock Text="{Binding LyricsDescription}"
|
||||
Opacity="0.7"
|
||||
Margin="0,4,0,0" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Controls -->
|
||||
<Border Grid.Row="1"
|
||||
Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
CornerRadius="8"
|
||||
Padding="16"
|
||||
Margin="0,0,0,16">
|
||||
<StackPanel Spacing="16">
|
||||
<!-- Row 1: Folder Selection -->
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<TextBox Grid.Column="0"
|
||||
Text="{Binding SelectedFolderPath}"
|
||||
Watermark="{Binding LyricsSelectFolder}"
|
||||
IsReadOnly="True"
|
||||
Margin="0,0,12,0" />
|
||||
<Button Grid.Column="1"
|
||||
Content="{Binding LyricsBrowse}"
|
||||
Command="{Binding SelectFolderCommand}"
|
||||
MinWidth="80" />
|
||||
</Grid>
|
||||
|
||||
<!-- Row 2: Options and Actions -->
|
||||
<Grid ColumnDefinitions="Auto,Auto,*,Auto">
|
||||
<!-- Parallel Count -->
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding LyricsParallel}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding ParallelCount}"
|
||||
Width="60"
|
||||
TextAlignment="Center"
|
||||
VerticalContentAlignment="Center" />
|
||||
|
||||
<!-- Spacer -->
|
||||
<Panel Grid.Column="2" />
|
||||
|
||||
<!-- Download Buttons -->
|
||||
<StackPanel Grid.Column="3" Orientation="Horizontal" Spacing="8">
|
||||
<Button Command="{Binding StartDownloadCommand}"
|
||||
Content="{Binding LyricsStartDownload}"
|
||||
IsVisible="{Binding !IsDownloading}"
|
||||
Classes="accent"
|
||||
MinWidth="100" />
|
||||
<Button Command="{Binding CancelDownloadCommand}"
|
||||
Content="{Binding LyricsStopDownload}"
|
||||
IsVisible="{Binding IsDownloading}"
|
||||
MinWidth="100" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Progress Bar (visible during download) -->
|
||||
<StackPanel IsVisible="{Binding IsDownloading}" Spacing="8">
|
||||
<ProgressBar Value="{Binding ProgressPercentage}"
|
||||
Maximum="100"
|
||||
Height="6" />
|
||||
<TextBlock HorizontalAlignment="Center" FontSize="12" Opacity="0.8">
|
||||
<Run Text="{Binding CompletedCount}" />
|
||||
<Run Text=" / " />
|
||||
<Run Text="{Binding TotalCount}" />
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- File List -->
|
||||
<Border Grid.Row="2"
|
||||
Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
CornerRadius="8"
|
||||
Padding="1">
|
||||
<DataGrid ItemsSource="{Binding MusicFiles}"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal"
|
||||
BorderThickness="0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{Binding ColumnSongName}"
|
||||
Binding="{Binding Name}"
|
||||
Width="*" />
|
||||
<DataGridTextColumn Header="{Binding ColumnArtist}"
|
||||
Binding="{Binding Artist}"
|
||||
Width="150" />
|
||||
<DataGridTextColumn Header="{Binding ColumnFilePath}"
|
||||
Binding="{Binding FilePath}"
|
||||
Width="250" />
|
||||
<DataGridTextColumn Header="{Binding ColumnStatus}"
|
||||
Binding="{Binding StatusMessage}"
|
||||
Width="100" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Border>
|
||||
|
||||
<!-- Status Bar -->
|
||||
<Border Grid.Row="3"
|
||||
Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
Padding="16,12"
|
||||
Margin="0,16,0,0"
|
||||
CornerRadius="8">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
|
||||
<!-- Total -->
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal" Spacing="4">
|
||||
<TextBlock Text="{Binding CommonTotal}" Opacity="0.8" />
|
||||
<TextBlock Text="{Binding TotalCount}" FontWeight="SemiBold" />
|
||||
<TextBlock Text="{Binding CommonFiles}" Opacity="0.8" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Spacer -->
|
||||
<Panel Grid.Column="1" />
|
||||
|
||||
<!-- Success -->
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="4" Margin="0,0,24,0">
|
||||
<TextBlock Text="{Binding CommonSuccess}" Opacity="0.8" />
|
||||
<TextBlock Text="{Binding CompletedCount}"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="#4CAF50" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Failed -->
|
||||
<StackPanel Grid.Column="3" Orientation="Horizontal" Spacing="4">
|
||||
<TextBlock Text="{Binding CommonFailed}" Opacity="0.8" />
|
||||
<TextBlock Text="{Binding FailedCount}"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="#F44336" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace ZonyLrcTools.Desktop.Views.Pages;
|
||||
|
||||
public partial class LyricsDownloadPage : UserControl
|
||||
{
|
||||
public LyricsDownloadPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
141
src/ZonyLrcTools.Desktop/Views/Pages/SettingsPage.axaml
Normal file
141
src/ZonyLrcTools.Desktop/Views/Pages/SettingsPage.axaml
Normal file
@@ -0,0 +1,141 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:ZonyLrcTools.Desktop.ViewModels"
|
||||
x:Class="ZonyLrcTools.Desktop.Views.Pages.SettingsPage"
|
||||
x:DataType="vm:SettingsViewModel">
|
||||
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="24">
|
||||
<!-- Title -->
|
||||
<StackPanel Margin="0,0,0,8">
|
||||
<TextBlock Text="{Binding SettingsTitle}"
|
||||
FontSize="28"
|
||||
FontWeight="SemiBold" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Language Settings -->
|
||||
<Border Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
CornerRadius="8"
|
||||
Padding="24">
|
||||
<StackPanel Spacing="16">
|
||||
<TextBlock Text="{Binding SettingsLanguage}"
|
||||
FontSize="18"
|
||||
FontWeight="SemiBold" />
|
||||
|
||||
<CheckBox Content="{Binding SettingsFollowSystem}"
|
||||
IsChecked="{Binding FollowSystemLanguage}" />
|
||||
|
||||
<StackPanel Orientation="Horizontal" Spacing="16" IsEnabled="{Binding !FollowSystemLanguage}">
|
||||
<RadioButton GroupName="Language"
|
||||
Content="{Binding SettingsChinese}"
|
||||
IsChecked="{Binding IsChineseSelected}" />
|
||||
<RadioButton GroupName="Language"
|
||||
Content="{Binding SettingsEnglish}"
|
||||
IsChecked="{Binding IsEnglishSelected}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Network Settings -->
|
||||
<Border Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
CornerRadius="8"
|
||||
Padding="24">
|
||||
<StackPanel Spacing="16">
|
||||
<TextBlock Text="{Binding SettingsProxy}"
|
||||
FontSize="18"
|
||||
FontWeight="SemiBold" />
|
||||
|
||||
<CheckBox Content="{Binding SettingsProxyEnable}"
|
||||
IsChecked="{Binding IsProxyEnabled}" />
|
||||
|
||||
<Grid ColumnDefinitions="*,Auto,120" IsEnabled="{Binding IsProxyEnabled}">
|
||||
<TextBox Grid.Column="0"
|
||||
Text="{Binding ProxyIp}"
|
||||
Watermark="{Binding SettingsProxyAddress}"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBlock Grid.Column="1"
|
||||
Text=":"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,8,0" />
|
||||
<NumericUpDown Grid.Column="2"
|
||||
Value="{Binding ProxyPort}"
|
||||
Minimum="1"
|
||||
Maximum="65535" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Lyrics Settings -->
|
||||
<Border Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
CornerRadius="8"
|
||||
Padding="24">
|
||||
<StackPanel Spacing="16">
|
||||
<TextBlock Text="Lyrics"
|
||||
FontSize="18"
|
||||
FontWeight="SemiBold" />
|
||||
|
||||
<CheckBox Content="Enable translation lyrics"
|
||||
IsChecked="{Binding IsTranslationEnabled}" />
|
||||
|
||||
<CheckBox Content="One-line mode (original + translation on same line)"
|
||||
IsChecked="{Binding IsOneLineMode}" />
|
||||
|
||||
<CheckBox Content="Skip existing lyrics files"
|
||||
IsChecked="{Binding SkipExistingLyrics}" />
|
||||
|
||||
<StackPanel Orientation="Horizontal" Spacing="16">
|
||||
<TextBlock Text="File Encoding:"
|
||||
VerticalAlignment="Center" />
|
||||
<ComboBox ItemsSource="{Binding AvailableEncodings}"
|
||||
SelectedItem="{Binding SelectedEncoding}"
|
||||
Width="150" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Lyrics Providers -->
|
||||
<Border Background="{DynamicResource NavigationBackgroundBrush}"
|
||||
CornerRadius="8"
|
||||
Padding="24">
|
||||
<StackPanel Spacing="16">
|
||||
<TextBlock Text="{Binding SettingsLyricsProvider}"
|
||||
FontSize="18"
|
||||
FontWeight="SemiBold" />
|
||||
|
||||
<ItemsControl ItemsSource="{Binding LyricsProviders}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:LyricsProviderSettingViewModel">
|
||||
<Border Background="{DynamicResource AppBackgroundBrush}"
|
||||
CornerRadius="4"
|
||||
Padding="12,8"
|
||||
Margin="0,4">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<CheckBox Grid.Column="0"
|
||||
IsChecked="{Binding IsEnabled}"
|
||||
Margin="0,0,12,0" />
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding Name}"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
Opacity="0.5">
|
||||
<Run Text="Priority: " />
|
||||
<Run Text="{Binding Priority}" />
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Actions -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="16" HorizontalAlignment="Right">
|
||||
<Button Content="{Binding SettingsReset}"
|
||||
Command="{Binding ResetToDefaultsCommand}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
</UserControl>
|
||||
11
src/ZonyLrcTools.Desktop/Views/Pages/SettingsPage.axaml.cs
Normal file
11
src/ZonyLrcTools.Desktop/Views/Pages/SettingsPage.axaml.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace ZonyLrcTools.Desktop.Views.Pages;
|
||||
|
||||
public partial class SettingsPage : UserControl
|
||||
{
|
||||
public SettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user