complete visual ui

This commit is contained in:
2025-11-16 13:36:47 +01:00
parent a5db244bc1
commit 8f132afe92
11 changed files with 499 additions and 550 deletions

View File

@@ -5,8 +5,7 @@
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> <!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
<Application.Styles> <Application.Styles>
<FluentTheme DensityStyle="Normal" /> <FluentTheme />
<!-- <FluentTheme DensityStyle="Compact" /> --> <StyleInclude Source="avares://Pilz.UI.AvaloniaUI/Assets/Styles/EnhancedDefaults.axaml"/>
<!-- <SimpleTheme /> -->
</Application.Styles> </Application.Styles>
</Application> </Application>

View File

@@ -9,6 +9,7 @@ public partial class App : Application
public override void Initialize() public override void Initialize()
{ {
AvaloniaXamlLoader.Load(this); AvaloniaXamlLoader.Load(this);
AppGlobals.Initialize();
} }
public override void OnFrameworkInitializationCompleted() public override void OnFrameworkInitializationCompleted()

View File

@@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lang="clr-namespace:ModpackUpdater.Apps.Client.Gui.LangRes" xmlns:lang="clr-namespace:ModpackUpdater.Apps.Client.Gui.LangRes"
xmlns:pilz="https://git.pilzinsel64.de/pilz-framework/pilz" xmlns:pilz="https://git.pilzinsel64.de/pilz-framework/pilz"
xmlns:symbols="clr-namespace:Pilz.UI.Symbols;assembly=Pilz.UI"
mc:Ignorable="d" mc:Ignorable="d"
x:Class="ModpackUpdater.Apps.Client.Gui.MainForm" x:Class="ModpackUpdater.Apps.Client.Gui.MainForm"
Width="520" Width="520"
@@ -11,15 +12,14 @@
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
CanMaximize="false" CanMaximize="false"
Title="Minecraft Modpack Updater" Title="Minecraft Modpack Updater"
Icon="/Assets/app.ico" Icon="/Assets/app.ico">
>
<Grid <Grid
RowDefinitions="Auto,Auto,Auto,Auto,Auto" RowDefinitions="Auto,Auto,Auto,Auto,Auto"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Top" VerticalAlignment="Top"
x:Name="MainGrid" Margin="3"
> x:Name="MainGrid">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
@@ -28,14 +28,14 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- Labels --> <!-- Labels -->
<Label Grid.Row="0" Grid.Column="0" Margin="3" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.MinecraftProfile}" /> <Label Grid.Row="0" Grid.Column="0" Margin="3" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.MinecraftProfile}"/>
<Label Grid.Row="1" Grid.Column="0" Margin="3" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.ModpackConfigUrl}" /> <Label Grid.Row="1" Grid.Column="0" Margin="3" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.ModpackConfigUrl}"/>
<Label Grid.Row="2" Grid.Column="0" Margin="3" VerticalAlignment="Center" IsVisible="false" x:Name="LabelInstallKey" Content="{x:Static lang:GeneralLangRes.InstallationKey}" /> <Label Grid.Row="2" Grid.Column="0" Margin="3" VerticalAlignment="Center" IsVisible="false" x:Name="LabelInstallKey" Content="{x:Static lang:GeneralLangRes.InstallationKey}"/>
<Label Grid.Row="3" Grid.Column="0" Margin="3" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.Status}" /> <Label Grid.Row="3" Grid.Column="0" Margin="3" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.Status}"/>
<Label Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Margin="3" VerticalAlignment="Center"> <Label Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Margin="3" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" Spacing="6"> <StackPanel Orientation="Horizontal" Spacing="6">
<Image Width="16" Height="16" x:Name="ImageStatus" /> <Image Width="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}" x:Name="ImageStatus"/>
<TextBlock x:Name="TextStatus" /> <TextBlock x:Name="TextStatus"/>
</StackPanel> </StackPanel>
</Label> </Label>
@@ -47,8 +47,7 @@
Margin="3" Margin="3"
VerticalAlignment="Center" VerticalAlignment="Center"
Watermark="C:\..." Watermark="C:\..."
TextChanged="TextBoxMinecraftProfileFolder_TextChanged" TextChanged="TextBoxMinecraftProfileFolder_TextChanged"/>
/>
<!-- TextBoxes: ModpackConfig --> <!-- TextBoxes: ModpackConfig -->
<TextBox <TextBox
@@ -59,8 +58,7 @@
Margin="3" Margin="3"
VerticalAlignment="Center" VerticalAlignment="Center"
Watermark="https://..." Watermark="https://..."
TextChanged="TextBoxModpackConfig_TextChanged" TextChanged="TextBoxModpackConfig_TextChanged"/>
/>
<!-- TextBoxes: InstallKey --> <!-- TextBoxes: InstallKey -->
<TextBox <TextBox
@@ -72,8 +70,7 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Watermark="XXXXX-YYYYY-ZZZZZ-AAAAA-BBBBB" Watermark="XXXXX-YYYYY-ZZZZZ-AAAAA-BBBBB"
TextChanged="TextBoxInstallKey_TextChanged" TextChanged="TextBoxInstallKey_TextChanged"
IsVisible="false" IsVisible="false"/>
/>
<!-- Button: SearchProfileFolder --> <!-- Button: SearchProfileFolder -->
<pilz:ImageButton <pilz:ImageButton
@@ -84,8 +81,7 @@
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Text="{x:Static lang:GeneralLangRes.Select}" Text="{x:Static lang:GeneralLangRes.Select}"
Click="ButtonSearchProfileFolder_Click" Click="ButtonSearchProfileFolder_Click"/>
/>
<!-- Button: CheckForUpdates --> <!-- Button: CheckForUpdates -->
<pilz:ImageButton <pilz:ImageButton
@@ -96,8 +92,7 @@
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Text="{x:Static lang:GeneralLangRes.CheckForUpdates}" Text="{x:Static lang:GeneralLangRes.CheckForUpdates}"
Click="ButtonCheckForUpdates_Click" Click="ButtonCheckForUpdates_Click"/>
/>
<!-- Button: Install --> <!-- Button: Install -->
<pilz:ImageSplitButton <pilz:ImageSplitButton
@@ -109,11 +104,10 @@
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
Text="{x:Static lang:GeneralLangRes.Install}" Text="{x:Static lang:GeneralLangRes.Install}"
Click="ButtonInstall_Click" Click="ButtonInstall_Click">
>
<SplitButton.Flyout> <SplitButton.Flyout>
<MenuFlyout> <MenuFlyout>
<MenuItem x:Name="MenuItemRepair" Header="{x:Static lang:GeneralLangRes.Repair}" Click="MenuItemRepair_Click" /> <MenuItem x:Name="MenuItemRepair" Header="{x:Static lang:GeneralLangRes.Repair}" Click="MenuItemRepair_Click"/>
</MenuFlyout> </MenuFlyout>
</SplitButton.Flyout> </SplitButton.Flyout>
</pilz:ImageSplitButton> </pilz:ImageSplitButton>

View File

@@ -63,7 +63,7 @@
<PackageReference Include="Pilz.Cryptography" Version="2.1.2" /> <PackageReference Include="Pilz.Cryptography" Version="2.1.2" />
<PackageReference Include="Pilz.IO" Version="2.1.0" /> <PackageReference Include="Pilz.IO" Version="2.1.0" />
<PackageReference Include="Pilz.UI" Version="3.1.4" /> <PackageReference Include="Pilz.UI" Version="3.1.4" />
<PackageReference Include="Pilz.UI.AvaloniaUI" Version="1.2.13" /> <PackageReference Include="Pilz.UI.AvaloniaUI" Version="1.2.15" />
<PackageReference Include="Avalonia" Version="11.3.8" /> <PackageReference Include="Avalonia" Version="11.3.8" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.8" /> <PackageReference Include="Avalonia.Desktop" Version="11.3.8" />
<PackageReference Include="Avalonia.Svg" Version="11.3.0" /> <PackageReference Include="Avalonia.Svg" Version="11.3.0" />

View File

@@ -10,6 +10,6 @@
<!-- <SimpleTheme /> --> <!-- <SimpleTheme /> -->
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/> <StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>
<!-- <StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Simple.xaml"/> --> <!-- <StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Simple.xaml"/> -->
<StyleInclude Source="avares://MinecraftModpackUpdateManager/Assets/Styles/StylesEnhancedDefaults.axaml"/> <StyleInclude Source="avares://Pilz.UI.AvaloniaUI/Assets/Styles/EnhancedDefaults.axaml"/>
</Application.Styles> </Application.Styles>
</Application> </Application>

View File

@@ -3,7 +3,6 @@ using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using ModpackUpdater.Apps.Manager.Ui; using ModpackUpdater.Apps.Manager.Ui;
using Pilz.Features; using Pilz.Features;
using Pilz.UI.Symbols;
namespace ModpackUpdater.Apps.Manager; namespace ModpackUpdater.Apps.Manager;
@@ -11,7 +10,6 @@ public partial class App : Application
{ {
public override void Initialize() public override void Initialize()
{ {
SymbolGlobals.DefaultImageSmallSize = 17;
AvaloniaXamlLoader.Load(this); AvaloniaXamlLoader.Load(this);
AppGlobals.Initialize(); AppGlobals.Initialize();
PluginFeatureController.Instance.RegisterAllOwn(); PluginFeatureController.Instance.RegisterAllOwn();

View File

@@ -1,16 +0,0 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith>
<Border Padding="20">
<!-- Add Controls for Previewer Here -->
</Border>
</Design.PreviewWith>
<Style Selector="Label">
<Setter Property="Padding" Value="0"/>
</Style>
<Style Selector="ComboBox">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
</Styles>

View File

@@ -27,7 +27,7 @@
<PackageReference Include="Pilz.Cryptography" Version="2.1.2" /> <PackageReference Include="Pilz.Cryptography" Version="2.1.2" />
<PackageReference Include="Pilz.Features" Version="2.12.0" /> <PackageReference Include="Pilz.Features" Version="2.12.0" />
<PackageReference Include="Pilz.UI" Version="3.1.4" /> <PackageReference Include="Pilz.UI" Version="3.1.4" />
<PackageReference Include="Pilz.UI.AvaloniaUI" Version="1.2.13" /> <PackageReference Include="Pilz.UI.AvaloniaUI" Version="1.2.15" />
<PackageReference Include="Pilz.UI.AvaloniaUI.Features" Version="1.0.0" /> <PackageReference Include="Pilz.UI.AvaloniaUI.Features" Version="1.0.0" />
<PackageReference Include="Avalonia" Version="11.3.8" /> <PackageReference Include="Avalonia" Version="11.3.8" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.8" /> <PackageReference Include="Avalonia.Desktop" Version="11.3.8" />

View File

@@ -11,33 +11,21 @@
x:Class="ModpackUpdater.Apps.Manager.Ui.MainWindow" x:Class="ModpackUpdater.Apps.Manager.Ui.MainWindow"
x:DataType="vm:MainWindowViewModel" x:DataType="vm:MainWindowViewModel"
Title="Minecraft Modpack Manager" Title="Minecraft Modpack Manager"
Padding="3"
WindowState="Maximized" WindowState="Maximized"
Loaded="Window_OnLoaded"> Loaded="Window_OnLoaded">
<Window.Styles>
<Style Selector="DropDownButton /template/ Path#PART_DropDownGlyph">
<Setter Property="IsVisible" Value="False"/>
</Style>
</Window.Styles>
<Grid
RowDefinitions="Auto,*">
<!-- Tree view -->
<Grid <Grid
x:Name="GridMain" x:Name="GridMain"
Grid.Row="1" RowDefinitions="Auto,*"
ColumnDefinitions="Auto,*,500" ColumnDefinitions="Auto,*,500"
RowSpacing="6"
ColumnSpacing="6"
Margin="3"> Margin="3">
<!-- StackPanel: Workspace -->
<StackPanel <StackPanel
Grid.Column="0" Grid.Column="0"
Margin="3" Grid.Row="0"
Spacing="6">
<!-- StackPanel: Menu for updates -->
<StackPanel
Orientation="Horizontal"> Orientation="Horizontal">
<!-- Button: Workspace --> <!-- Button: Workspace -->
@@ -83,8 +71,10 @@
Background="Transparent"/> Background="Transparent"/>
</StackPanel> </StackPanel>
<!-- TreeView: Updates --> <!-- TreeView: Workspace -->
<ScrollViewer <ScrollViewer
Grid.Column="0"
Grid.Row="1"
VerticalScrollBarVisibility="Auto"> VerticalScrollBarVisibility="Auto">
<StackPanel> <StackPanel>
@@ -107,16 +97,11 @@
</TreeView> </TreeView>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</StackPanel>
<!-- List editor --> <!-- Panel: List header -->
<StackPanel
Grid.Column="1"
Margin="3"
Spacing="6">
<!-- Header -->
<ContentControl <ContentControl
Grid.Column="1"
Grid.Row="0"
Content="{Binding SelectedTreeNode}"> Content="{Binding SelectedTreeNode}">
<ContentControl.DataTemplates> <ContentControl.DataTemplates>
@@ -163,6 +148,8 @@
<!-- DataGrid --> <!-- DataGrid -->
<DataGrid <DataGrid
Grid.Column="1"
Grid.Row="1"
x:Name="DataGridActions" x:Name="DataGridActions"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
ItemsSource="{Binding CurrentGridRows}" ItemsSource="{Binding CurrentGridRows}"
@@ -191,29 +178,22 @@
Binding="{Binding InheritedDestPath}"/> Binding="{Binding InheritedDestPath}"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</StackPanel>
<!-- Action editor --> <!-- Action editor -->
<ScrollViewer <ScrollViewer
x:Name="ScrollViewerInstallAction" x:Name="ScrollViewerInstallAction"
Grid.Column="2" Grid.Column="2"
Margin="3" Grid.Row="1"
DataContext="{Binding SelectedGridRow}" DataContext="{Binding SelectedGridRow}"
VerticalScrollBarVisibility="Auto"> VerticalScrollBarVisibility="Auto">
<ScrollViewer.Styles>
<Style Selector="Label">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</ScrollViewer.Styles>
<StackPanel <StackPanel
Spacing="6"> Spacing="6">
<!-- Update --> <!-- Update -->
<Grid <Grid
ColumnDefinitions="150,*" ColumnDefinitions="150,*"
RowDefinitions="Auto,Auto,Auto,Auto" RowDefinitions="Auto,Auto,Auto,Auto,Auto"
RowSpacing="6" RowSpacing="6"
ColumnSpacing="6" ColumnSpacing="6"
IsVisible="{Binding IsUpdate}"> IsVisible="{Binding IsUpdate}">
@@ -235,8 +215,8 @@
x:Name="TextBoxUpdateActionInheritFrom" x:Name="TextBoxUpdateActionInheritFrom"
Text="{Binding InheritFrom}"/> Text="{Binding InheritFrom}"/>
<!-- Source type --> <!-- Update type -->
<Label Grid.Row="2" Grid.Column="0" Content="Source type" Target="ComboBoxUpdateActionSourceType"/> <Label Grid.Row="2" Grid.Column="0" Content="Update type" Target="ComboBoxUpdateActionSourceType"/>
<ComboBox <ComboBox
Grid.Row="2" Grid.Column="1" Grid.Row="2" Grid.Column="1"
x:Name="ComboBoxUpdateActionSourceType" x:Name="ComboBoxUpdateActionSourceType"
@@ -245,8 +225,15 @@
SelectedValueBinding="{Binding Key}" SelectedValueBinding="{Binding Key}"
SelectedValue="{Binding UpdateType}"/> SelectedValue="{Binding UpdateType}"/>
<!-- Source path -->
<Label Grid.Row="3" Grid.Column="0" Content="Source path" Target="TextBoxInstallActionSourcePath"/>
<TextBox
Grid.Row="3" Grid.Column="1"
x:Name="TextBoxInstallActionSourcePath"
Text="{Binding SrcPath}"/>
<!-- Is Directory --> <!-- Is Directory -->
<CheckBox Grid.Row="3" Grid.Column="1" <CheckBox Grid.Row="4" Grid.Column="1"
x:Name="CheckBoxUpdateActionIsDir" x:Name="CheckBoxUpdateActionIsDir"
Content="Is Directory" Content="Is Directory"
IsChecked="{Binding IsDirectory}"/> IsChecked="{Binding IsDirectory}"/>
@@ -333,7 +320,7 @@
<!-- Source --> <!-- Source -->
<Grid <Grid
ColumnDefinitions="150,*" ColumnDefinitions="150,*"
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
RowSpacing="6" RowSpacing="6"
ColumnSpacing="6"> ColumnSpacing="6">
@@ -398,13 +385,6 @@
Grid.Row="7" Grid.Column="1" Grid.Row="7" Grid.Column="1"
x:Name="TextBoxInstallActionZipArchivePath" x:Name="TextBoxInstallActionZipArchivePath"
Text="{Binding SourceUrl}"/> Text="{Binding SourceUrl}"/>
<!-- Source path -->
<Label Grid.Row="8" Grid.Column="0" Content="Source path" Target="TextBoxInstallActionSourcePath"/>
<TextBox
Grid.Row="8" Grid.Column="1"
x:Name="TextBoxInstallActionSourcePath"
Text="{Binding SrcPath}"/>
</Grid> </Grid>
<!-- Metadata --> <!-- Metadata -->
@@ -437,5 +417,4 @@
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</Grid> </Grid>
</Grid>
</Window> </Window>

View File

@@ -1,4 +1,5 @@
using Pilz.UI.AvaloniaUI.Symbols; using Pilz.UI.AvaloniaUI.Symbols;
using Pilz.UI.Symbols;
namespace ModpackUpdater.Apps; namespace ModpackUpdater.Apps;
@@ -8,13 +9,6 @@ public static class AppGlobals
public static void Initialize() public static void Initialize()
{ {
// ThemeHelper.ApplyApplicationTheme(new ThemeDefinition(ApplicationTheme.Auto, HighContrastMode.Auto), n => n.Theme switch SymbolGlobals.DefaultImageSmallSize = 17;
// {
// ApplicationTheme.Light => new Windows11CompactTheme(),
// ApplicationTheme.Gray or ApplicationTheme.Dark => new Windows11CompactDarkTheme(),
// _ => throw new NotImplementedException(),
// });
// RadFlyoutBase.ConfirmSvg = Symbols.GetSvgImage(AppSymbols.checkmark, Pilz.UI.Symbols.SymbolSize.Small);
// RadFlyoutBase.CancelSvg = Symbols.GetSvgImage(AppSymbols.cancel, Pilz.UI.Symbols.SymbolSize.Small);
} }
} }

View File

@@ -17,7 +17,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Pilz" Version="2.6.1" /> <PackageReference Include="Pilz" Version="2.6.1" />
<PackageReference Include="Pilz.UI" Version="3.1.4" /> <PackageReference Include="Pilz.UI" Version="3.1.4" />
<PackageReference Include="Pilz.UI.AvaloniaUI" Version="1.2.13" /> <PackageReference Include="Pilz.UI.AvaloniaUI" Version="1.2.15" />
<PackageReference Include="Avalonia" Version="11.3.8" /> <PackageReference Include="Avalonia" Version="11.3.8" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.8" /> <PackageReference Include="Avalonia.Desktop" Version="11.3.8" />
<PackageReference Include="Avalonia.Svg" Version="11.3.0" /> <PackageReference Include="Avalonia.Svg" Version="11.3.0" />