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

@@ -1,121 +1,115 @@
<Window xmlns="https://github.com/avaloniaui" <Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
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"
mc:Ignorable="d" xmlns:symbols="clr-namespace:Pilz.UI.Symbols;assembly=Pilz.UI"
x:Class="ModpackUpdater.Apps.Client.Gui.MainForm" mc:Ignorable="d"
Width="520" x:Class="ModpackUpdater.Apps.Client.Gui.MainForm"
SizeToContent="Height" Width="520"
WindowStartupLocation="CenterScreen" SizeToContent="Height"
CanMaximize="false" WindowStartupLocation="CenterScreen"
Title="Minecraft Modpack Updater" CanMaximize="false"
Icon="/Assets/app.ico" Title="Minecraft Modpack Updater"
> 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"/>
<ColumnDefinition Width="*" MinWidth="250"/> <ColumnDefinition Width="*" MinWidth="250"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</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>
<!-- TextBoxes: Profile --> <!-- TextBoxes: Profile -->
<TextBox <TextBox
x:Name="TextBoxMinecraftProfileFolder" x:Name="TextBoxMinecraftProfileFolder"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Margin="3" Margin="3"
VerticalAlignment="Center" VerticalAlignment="Center"
Watermark="C:\..." Watermark="C:\..."
TextChanged="TextBoxMinecraftProfileFolder_TextChanged" TextChanged="TextBoxMinecraftProfileFolder_TextChanged"/>
/>
<!-- TextBoxes: ModpackConfig -->
<!-- TextBoxes: ModpackConfig --> <TextBox
<TextBox x:Name="TextBoxModpackConfig"
x:Name="TextBoxModpackConfig" Grid.Row="1"
Grid.Row="1" Grid.Column="1"
Grid.Column="1" Grid.ColumnSpan="2"
Grid.ColumnSpan="2" Margin="3"
Margin="3" VerticalAlignment="Center"
VerticalAlignment="Center" Watermark="https://..."
Watermark="https://..." TextChanged="TextBoxModpackConfig_TextChanged"/>
TextChanged="TextBoxModpackConfig_TextChanged"
/> <!-- TextBoxes: InstallKey -->
<TextBox
<!-- TextBoxes: InstallKey --> x:Name="TextBoxInstallKey"
<TextBox Grid.Row="2"
x:Name="TextBoxInstallKey" Grid.Column="1"
Grid.Row="2" Grid.ColumnSpan="2"
Grid.Column="1" Margin="3"
Grid.ColumnSpan="2" VerticalAlignment="Center"
Margin="3" Watermark="XXXXX-YYYYY-ZZZZZ-AAAAA-BBBBB"
VerticalAlignment="Center" TextChanged="TextBoxInstallKey_TextChanged"
Watermark="XXXXX-YYYYY-ZZZZZ-AAAAA-BBBBB" IsVisible="false"/>
TextChanged="TextBoxInstallKey_TextChanged"
IsVisible="false" <!-- Button: SearchProfileFolder -->
/> <pilz:ImageButton
x:Name="ButtonSearchProfileFolder"
<!-- Button: SearchProfileFolder --> Grid.Row="0"
<pilz:ImageButton Grid.Column="2"
x:Name="ButtonSearchProfileFolder" Margin="3"
Grid.Row="0" VerticalAlignment="Stretch"
Grid.Column="2" HorizontalAlignment="Stretch"
Margin="3" Text="{x:Static lang:GeneralLangRes.Select}"
VerticalAlignment="Stretch" Click="ButtonSearchProfileFolder_Click"/>
HorizontalAlignment="Stretch"
Text="{x:Static lang:GeneralLangRes.Select}" <!-- Button: CheckForUpdates -->
Click="ButtonSearchProfileFolder_Click" <pilz:ImageButton
/> x:Name="ButtonCheckForUpdates"
Grid.Row="4"
<!-- Button: CheckForUpdates --> Grid.Column="1"
<pilz:ImageButton Margin="3"
x:Name="ButtonCheckForUpdates" VerticalAlignment="Stretch"
Grid.Row="4" HorizontalAlignment="Stretch"
Grid.Column="1" Text="{x:Static lang:GeneralLangRes.CheckForUpdates}"
Margin="3" Click="ButtonCheckForUpdates_Click"/>
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" <!-- Button: Install -->
Text="{x:Static lang:GeneralLangRes.CheckForUpdates}" <pilz:ImageSplitButton
Click="ButtonCheckForUpdates_Click" x:Name="ButtonInstall"
/> Grid.Row="4"
Grid.Column="2"
<!-- Button: Install --> Margin="3"
<pilz:ImageSplitButton VerticalAlignment="Stretch"
x:Name="ButtonInstall" HorizontalAlignment="Stretch"
Grid.Row="4" HorizontalContentAlignment="Center"
Grid.Column="2" Text="{x:Static lang:GeneralLangRes.Install}"
Margin="3" Click="ButtonInstall_Click">
VerticalAlignment="Stretch" <SplitButton.Flyout>
HorizontalAlignment="Stretch" <MenuFlyout>
HorizontalContentAlignment="Center" <MenuItem x:Name="MenuItemRepair" Header="{x:Static lang:GeneralLangRes.Repair}" Click="MenuItemRepair_Click"/>
Text="{x:Static lang:GeneralLangRes.Install}" </MenuFlyout>
Click="ButtonInstall_Click" </SplitButton.Flyout>
> </pilz:ImageSplitButton>
<SplitButton.Flyout> </Grid>
<MenuFlyout> </Window>
<MenuItem x:Name="MenuItemRepair" Header="{x:Static lang:GeneralLangRes.Repair}" Click="MenuItemRepair_Click" />
</MenuFlyout>
</SplitButton.Flyout>
</pilz:ImageSplitButton>
</Grid>
</Window>

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,431 +11,410 @@
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 <Grid
RowDefinitions="Auto,*"> x:Name="GridMain"
RowDefinitions="Auto,*"
ColumnDefinitions="Auto,*,500"
RowSpacing="6"
ColumnSpacing="6"
Margin="3">
<!-- StackPanel: Workspace -->
<StackPanel
Grid.Column="0"
Grid.Row="0"
Orientation="Horizontal">
<!-- Button: Workspace -->
<pilz:ImageButton
x:Name="ButtonWorkspace"
Text="Workspace"
Background="Transparent">
<pilz:ImageButton.Flyout>
<MenuFlyout>
<MenuFlyout.Items>
<MenuItem x:Name="MenuItemWorkspacePreferences" Header="Workspace _preferences"/>
<MenuItem x:Name="MenuItemSaveWorkspace" Header="_Save workspace" HotKey="Ctrl+S"/>
<Separator/>
<MenuItem x:Name="MenuItemNewWorkspace" Header="_New workspace"/>
<Separator/>
<MenuItem x:Name="MenuItemRecentWorkspaces" Header="_Recent workspaces"/>
</MenuFlyout.Items>
</MenuFlyout>
</pilz:ImageButton.Flyout>
</pilz:ImageButton>
<!-- Button: Update -->
<pilz:ImageButton
x:Name="ButtonUpdate"
Text="Update"
Background="Transparent">
<pilz:ImageButton.Flyout>
<MenuFlyout>
<MenuFlyout.Items>
<MenuItem x:Name="MenuItemCreateUpdate" Header="_Create update" Click="MenuItemCreateUpdate_OnClick"/>
<MenuItem x:Name="MenuItemRemoveUpdate" Header="_Remove update" Click="MenuItemRemoveUpdate_OnClick"/>
</MenuFlyout.Items>
</MenuFlyout>
</pilz:ImageButton.Flyout>
</pilz:ImageButton>
<!-- Button: Tools -->
<pilz:ImageButton
x:Name="ButtonTools"
Text="Tools"
Background="Transparent"/>
</StackPanel>
<!-- Tree view --> <!-- TreeView: Workspace -->
<Grid <ScrollViewer
x:Name="GridMain" Grid.Column="0"
Grid.Row="1" Grid.Row="1"
ColumnDefinitions="Auto,*,500" VerticalScrollBarVisibility="Auto">
Margin="3">
<StackPanel>
<StackPanel <TreeView
Grid.Column="0" ItemsSource="{Binding CurrentTreeNodes}"
Margin="3" SelectedItem="{Binding SelectedTreeNode}">
Spacing="6">
<TreeView.ItemTemplate>
<!-- StackPanel: Menu for updates --> <TreeDataTemplate
<StackPanel ItemsSource="{Binding Nodes}">
Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Spacing="6">
<!-- Button: Workspace --> <Image
<pilz:ImageButton Source="{Binding Image}"
x:Name="ButtonWorkspace" Width="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}"/>
Text="Workspace" <TextBlock Text="{Binding DisplayText}"/>
Background="Transparent">
<pilz:ImageButton.Flyout>
<MenuFlyout>
<MenuFlyout.Items>
<MenuItem x:Name="MenuItemWorkspacePreferences" Header="Workspace _preferences"/>
<MenuItem x:Name="MenuItemSaveWorkspace" Header="_Save workspace" HotKey="Ctrl+S"/>
<Separator/>
<MenuItem x:Name="MenuItemNewWorkspace" Header="_New workspace"/>
<Separator/>
<MenuItem x:Name="MenuItemRecentWorkspaces" Header="_Recent workspaces"/>
</MenuFlyout.Items>
</MenuFlyout>
</pilz:ImageButton.Flyout>
</pilz:ImageButton>
<!-- Button: Update -->
<pilz:ImageButton
x:Name="ButtonUpdate"
Text="Update"
Background="Transparent">
<pilz:ImageButton.Flyout>
<MenuFlyout>
<MenuFlyout.Items>
<MenuItem x:Name="MenuItemCreateUpdate" Header="_Create update" Click="MenuItemCreateUpdate_OnClick"/>
<MenuItem x:Name="MenuItemRemoveUpdate" Header="_Remove update" Click="MenuItemRemoveUpdate_OnClick"/>
</MenuFlyout.Items>
</MenuFlyout>
</pilz:ImageButton.Flyout>
</pilz:ImageButton>
<!-- Button: Tools -->
<pilz:ImageButton
x:Name="ButtonTools"
Text="Tools"
Background="Transparent"/>
</StackPanel>
<!-- TreeView: Updates -->
<ScrollViewer
VerticalScrollBarVisibility="Auto">
<StackPanel>
<TreeView
ItemsSource="{Binding CurrentTreeNodes}"
SelectedItem="{Binding SelectedTreeNode}">
<TreeView.ItemTemplate>
<TreeDataTemplate
ItemsSource="{Binding Nodes}">
<StackPanel Orientation="Horizontal" Spacing="6">
<Image
Source="{Binding Image}"
Width="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}"/>
<TextBlock Text="{Binding DisplayText}"/>
</StackPanel>
</TreeDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</StackPanel>
</ScrollViewer>
</StackPanel>
<!-- List editor -->
<StackPanel
Grid.Column="1"
Margin="3"
Spacing="6">
<!-- Header -->
<ContentControl
Content="{Binding SelectedTreeNode}">
<ContentControl.DataTemplates>
<DataTemplate
DataType="vm:ActionSetTreeNode">
<StackPanel
Orientation="Horizontal">
<!-- Button: Add action -->
<pilz:ImageButton
x:Name="ButtonAddAction"
Text="Add"
ImageSource="{x:Static local:MainWindow.ButtonImageAddAction}"
Background="Transparent"
Click="ButtonAddAction_OnClick"/>
<!-- Button: Remove action -->
<pilz:ImageButton
x:Name="ButtonRemoveAction"
Text="Remove"
ImageSource="{x:Static local:MainWindow.ButtonImageRemoveAction}"
Background="Transparent"
Click="ButtonRemoveAction_OnClick"/>
<!-- TextBox: Version -->
<TextBox
Margin="3, 0, 3, 0"
Width="100"
Text="{Binding Version}"/>
<!-- CheckBox: Is public -->
<CheckBox
Margin="3, 0, 3, 0"
Content="Public"
IsChecked="{Binding IsPublic}"/>
</StackPanel> </StackPanel>
</DataTemplate> </TreeDataTemplate>
</TreeView.ItemTemplate>
<DataTemplate </TreeView>
DataType="vm:MainWindowTreeNode"/>
</ContentControl.DataTemplates>
</ContentControl>
<!-- DataGrid -->
<DataGrid
x:Name="DataGridActions"
VerticalAlignment="Stretch"
ItemsSource="{Binding CurrentGridRows}"
SelectedItem="{Binding SelectedGridRow}">
<DataGrid.Columns>
<DataGridTextColumn
Header="Id"
Binding="{Binding InheritedId}"/>
<DataGridTextColumn
Header="Side"
Binding="{Binding InheritedSide}"/>
<DataGridTextColumn
Header="Update type"
Binding="{Binding InheritedUpdateType}"
IsVisible="{Binding IsUpdate}"/>
<DataGridTextColumn
Header="Source type"
Binding="{Binding InheritedSourceType}"/>
<DataGridTextColumn
Header="Dest path"
Binding="{Binding InheritedDestPath}"/>
</DataGrid.Columns>
</DataGrid>
</StackPanel> </StackPanel>
</ScrollViewer>
<!-- Action editor --> <!-- Panel: List header -->
<ScrollViewer <ContentControl
x:Name="ScrollViewerInstallAction" Grid.Column="1"
Grid.Column="2" Grid.Row="0"
Margin="3" Content="{Binding SelectedTreeNode}">
DataContext="{Binding SelectedGridRow}"
VerticalScrollBarVisibility="Auto">
<ScrollViewer.Styles>
<Style Selector="Label">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</ScrollViewer.Styles>
<StackPanel
Spacing="6">
<!-- Update --> <ContentControl.DataTemplates>
<Grid <DataTemplate
ColumnDefinitions="150,*" DataType="vm:ActionSetTreeNode">
RowDefinitions="Auto,Auto,Auto,Auto"
RowSpacing="6"
ColumnSpacing="6"
IsVisible="{Binding IsUpdate}">
<!-- Header --> <StackPanel
<StackPanel Orientation="Horizontal">
Grid.ColumnSpan="2"
Orientation="Horizontal"
Spacing="6">
<Image x:Name="ImageUpdate" Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
<TextBlock Text="Update" FontSize="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
</StackPanel>
<!-- Inherit from --> <!-- Button: Add action -->
<Label Grid.Row="1" Grid.Column="0" Content="Inherit from" Target="TextBoxUpdateActionInheritFrom"/> <pilz:ImageButton
x:Name="ButtonAddAction"
Text="Add"
ImageSource="{x:Static local:MainWindow.ButtonImageAddAction}"
Background="Transparent"
Click="ButtonAddAction_OnClick"/>
<!-- Button: Remove action -->
<pilz:ImageButton
x:Name="ButtonRemoveAction"
Text="Remove"
ImageSource="{x:Static local:MainWindow.ButtonImageRemoveAction}"
Background="Transparent"
Click="ButtonRemoveAction_OnClick"/>
<!-- TextBox: Version -->
<TextBox <TextBox
Grid.Row="1" Grid.Column="1" Margin="3, 0, 3, 0"
x:Name="TextBoxUpdateActionInheritFrom" Width="100"
Text="{Binding InheritFrom}"/> Text="{Binding Version}"/>
<!-- Source type --> <!-- CheckBox: Is public -->
<Label Grid.Row="2" Grid.Column="0" Content="Source type" Target="ComboBoxUpdateActionSourceType"/>
<ComboBox
Grid.Row="2" Grid.Column="1"
x:Name="ComboBoxUpdateActionSourceType"
ItemsSource="{x:Static vm:MainWindowGridRow.UpdateActionTypes}"
DisplayMemberBinding="{Binding Value}"
SelectedValueBinding="{Binding Key}"
SelectedValue="{Binding UpdateType}"/>
<!-- Is Directory -->
<CheckBox Grid.Row="3" Grid.Column="1"
x:Name="CheckBoxUpdateActionIsDir"
Content="Is Directory"
IsChecked="{Binding IsDirectory}"/>
</Grid>
<!-- General -->
<Grid
ColumnDefinitions="150,*"
RowDefinitions="Auto,Auto,Auto,Auto,Auto"
RowSpacing="6"
ColumnSpacing="6">
<!-- Header -->
<StackPanel
Grid.ColumnSpan="2"
Orientation="Horizontal"
Spacing="6">
<Image
x:Name="ImageGeneral"
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
<TextBlock Text="General" FontSize="20"/>
</StackPanel>
<!-- Id -->
<Label Grid.Row="1" Grid.Column="0" Content="Id" Target="TextBoxInstallActionId"/>
<TextBox
Grid.Row="1" Grid.Column="1"
x:Name="TextBoxInstallActionId"
Text="{Binding Id}"/>
<!-- Name -->
<Label Grid.Row="2" Grid.Column="0" Content="Name" Target="TextBoxInstallActionName"/>
<TextBox
Grid.Row="2" Grid.Column="1"
x:Name="TextBoxInstallActionName"
Text="{Binding Name}"/>
<!-- Side -->
<Label Grid.Row="3" Grid.Column="0" Content="Side" Target="ComboBoxInstallActionSide"/>
<ComboBox
Grid.Row="3" Grid.Column="1"
x:Name="ComboBoxInstallActionSide"
ItemsSource="{x:Static vm:MainWindowGridRow.Sides}"
DisplayMemberBinding="{Binding Value}"
SelectedValueBinding="{Binding Key}"
SelectedValue="{Binding Side}"/>
<!-- Is Extra -->
<CheckBox <CheckBox
Grid.Row="4" Grid.Column="1" Margin="3, 0, 3, 0"
x:Name="CheckBoxInstallActionIsExtra" Content="Public"
Content="Is Extra" IsChecked="{Binding IsPublic}"/>
IsChecked="{Binding IsExtra}"/> </StackPanel>
</Grid> </DataTemplate>
<!-- Destination --> <DataTemplate
<Grid DataType="vm:MainWindowTreeNode"/>
ColumnDefinitions="150,*" </ContentControl.DataTemplates>
RowDefinitions="Auto,Auto" </ContentControl>
RowSpacing="6"
ColumnSpacing="6">
<!-- Header --> <!-- DataGrid -->
<StackPanel <DataGrid
Grid.ColumnSpan="2" Grid.Column="1"
Orientation="Horizontal" Grid.Row="1"
Spacing="6"> x:Name="DataGridActions"
VerticalAlignment="Stretch"
<Image ItemsSource="{Binding CurrentGridRows}"
x:Name="ImageDestination" SelectedItem="{Binding SelectedGridRow}">
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
<TextBlock Text="Destination" FontSize="20"/>
</StackPanel>
<!-- Destination path --> <DataGrid.Columns>
<Label Grid.Row="1" Grid.Column="0" Content="Destination path" Target="TextBoxInstallDestPath"/> <DataGridTextColumn
<TextBox Header="Id"
Grid.Row="1" Grid.Column="1" Binding="{Binding InheritedId}"/>
x:Name="TextBoxInstallDestPath"
Text="{Binding DestPath}"/>
</Grid>
<!-- Source --> <DataGridTextColumn
<Grid Header="Side"
ColumnDefinitions="150,*" Binding="{Binding InheritedSide}"/>
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
RowSpacing="6"
ColumnSpacing="6">
<!-- Header --> <DataGridTextColumn
<StackPanel Header="Update type"
Grid.ColumnSpan="2" Binding="{Binding InheritedUpdateType}"
Orientation="Horizontal" IsVisible="{Binding IsUpdate}"/>
Spacing="6">
<Image
x:Name="ImageSource"
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
<TextBlock Text="Source" FontSize="20"/>
</StackPanel>
<!-- Source types --> <DataGridTextColumn
<Label Grid.Row="1" Grid.Column="0" Content="Source type" Target="CheckBoxInstallActionSourceType"/> Header="Source type"
<ComboBox Binding="{Binding InheritedSourceType}"/>
Grid.Row="1" Grid.Column="1"
x:Name="CheckBoxInstallActionSourceType"
ItemsSource="{x:Static vm:MainWindowGridRow.SourceTypes}"
DisplayMemberBinding="{Binding Value}"
SelectedValueBinding="{Binding Key}"
SelectedValue="{Binding SourceType}"/>
<!-- Is Zip --> <DataGridTextColumn
<CheckBox Grid.Row="2" Grid.Column="1" Header="Dest path"
x:Name="CheckBoxInstallActionIsZip" Binding="{Binding InheritedDestPath}"/>
Content="Is Zip archive" </DataGrid.Columns>
IsChecked="{Binding IsZip}"/> </DataGrid>
<!-- Source owner --> <!-- Action editor -->
<Label Grid.Row="3" Grid.Column="0" Content="Source owner" Target="TextBoxInstallActionSourceOwner"/> <ScrollViewer
<TextBox x:Name="ScrollViewerInstallAction"
Grid.Row="3" Grid.Column="1" Grid.Column="2"
x:Name="TextBoxInstallActionSourceOwner" Grid.Row="1"
Text="{Binding SourceOwner}"/> DataContext="{Binding SelectedGridRow}"
VerticalScrollBarVisibility="Auto">
<!-- Source name --> <StackPanel
<Label Grid.Row="4" Grid.Column="0" Content="Source name" Target="TextBoxInstallActionSourceName"/> Spacing="6">
<TextBox
Grid.Row="4" Grid.Column="1"
x:Name="TextBoxInstallActionSourceName"
Text="{Binding SourceName}"/>
<!-- Source RegEx --> <!-- Update -->
<Label Grid.Row="5" Grid.Column="0" Content="Source RegEx" Target="TextBoxInstallActionSourceRegEx"/> <Grid
<TextBox ColumnDefinitions="150,*"
Grid.Row="5" Grid.Column="1" RowDefinitions="Auto,Auto,Auto,Auto,Auto"
x:Name="TextBoxInstallActionSourceRegEx" RowSpacing="6"
Text="{Binding SourceRegex}"/> ColumnSpacing="6"
IsVisible="{Binding IsUpdate}">
<!-- Source url --> <!-- Header -->
<Label Grid.Row="6" Grid.Column="0" Content="Source URL" Target="TextBoxInstallActionSourceUrl"/> <StackPanel
<TextBox Grid.ColumnSpan="2"
Grid.Row="6" Grid.Column="1" Orientation="Horizontal"
x:Name="TextBoxInstallActionSourceUrl" Text="{Binding SourceUrl}"/> Spacing="6">
<!-- Zip archive path --> <Image x:Name="ImageUpdate" Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
<Label Grid.Row="7" Grid.Column="0" Content="ZIP archive path" Target="TextBoxInstallActionZipArchivePath"/> <TextBlock Text="Update" FontSize="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
<TextBox </StackPanel>
Grid.Row="7" Grid.Column="1"
x:Name="TextBoxInstallActionZipArchivePath"
Text="{Binding SourceUrl}"/>
<!-- Source path --> <!-- Inherit from -->
<Label Grid.Row="8" Grid.Column="0" Content="Source path" Target="TextBoxInstallActionSourcePath"/> <Label Grid.Row="1" Grid.Column="0" Content="Inherit from" Target="TextBoxUpdateActionInheritFrom"/>
<TextBox <TextBox
Grid.Row="8" Grid.Column="1" Grid.Row="1" Grid.Column="1"
x:Name="TextBoxInstallActionSourcePath" x:Name="TextBoxUpdateActionInheritFrom"
Text="{Binding SrcPath}"/> Text="{Binding InheritFrom}"/>
</Grid>
<!-- Metadata --> <!-- Update type -->
<Grid <Label Grid.Row="2" Grid.Column="0" Content="Update type" Target="ComboBoxUpdateActionSourceType"/>
ColumnDefinitions="150,*" <ComboBox
RowDefinitions="Auto,Auto" Grid.Row="2" Grid.Column="1"
RowSpacing="6" x:Name="ComboBoxUpdateActionSourceType"
ColumnSpacing="6" ItemsSource="{x:Static vm:MainWindowGridRow.UpdateActionTypes}"
VerticalAlignment="Center"> DisplayMemberBinding="{Binding Value}"
SelectedValueBinding="{Binding Key}"
SelectedValue="{Binding UpdateType}"/>
<!-- Header --> <!-- Source path -->
<StackPanel <Label Grid.Row="3" Grid.Column="0" Content="Source path" Target="TextBoxInstallActionSourcePath"/>
Grid.ColumnSpan="2" <TextBox
Orientation="Horizontal" Grid.Row="3" Grid.Column="1"
Spacing="6"> x:Name="TextBoxInstallActionSourcePath"
Text="{Binding SrcPath}"/>
<Image
x:Name="ImageMetadata" <!-- Is Directory -->
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/> <CheckBox Grid.Row="4" Grid.Column="1"
<TextBlock Text="Metadata" FontSize="20"/> x:Name="CheckBoxUpdateActionIsDir"
</StackPanel> Content="Is Directory"
IsChecked="{Binding IsDirectory}"/>
<!-- Website --> </Grid>
<Label Grid.Row="1" Grid.Column="0" Content="Website" Target="TextBoxInstallActionWebsite"/>
<TextBox <!-- General -->
Grid.Row="1" Grid.Column="1" <Grid
x:Name="TextBoxInstallActionWebsite" ColumnDefinitions="150,*"
Text="{Binding Website}"/> RowDefinitions="Auto,Auto,Auto,Auto,Auto"
</Grid> RowSpacing="6"
</StackPanel> ColumnSpacing="6">
</ScrollViewer>
</Grid> <!-- Header -->
<StackPanel
Grid.ColumnSpan="2"
Orientation="Horizontal"
Spacing="6">
<Image
x:Name="ImageGeneral"
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
<TextBlock Text="General" FontSize="20"/>
</StackPanel>
<!-- Id -->
<Label Grid.Row="1" Grid.Column="0" Content="Id" Target="TextBoxInstallActionId"/>
<TextBox
Grid.Row="1" Grid.Column="1"
x:Name="TextBoxInstallActionId"
Text="{Binding Id}"/>
<!-- Name -->
<Label Grid.Row="2" Grid.Column="0" Content="Name" Target="TextBoxInstallActionName"/>
<TextBox
Grid.Row="2" Grid.Column="1"
x:Name="TextBoxInstallActionName"
Text="{Binding Name}"/>
<!-- Side -->
<Label Grid.Row="3" Grid.Column="0" Content="Side" Target="ComboBoxInstallActionSide"/>
<ComboBox
Grid.Row="3" Grid.Column="1"
x:Name="ComboBoxInstallActionSide"
ItemsSource="{x:Static vm:MainWindowGridRow.Sides}"
DisplayMemberBinding="{Binding Value}"
SelectedValueBinding="{Binding Key}"
SelectedValue="{Binding Side}"/>
<!-- Is Extra -->
<CheckBox
Grid.Row="4" Grid.Column="1"
x:Name="CheckBoxInstallActionIsExtra"
Content="Is Extra"
IsChecked="{Binding IsExtra}"/>
</Grid>
<!-- Destination -->
<Grid
ColumnDefinitions="150,*"
RowDefinitions="Auto,Auto"
RowSpacing="6"
ColumnSpacing="6">
<!-- Header -->
<StackPanel
Grid.ColumnSpan="2"
Orientation="Horizontal"
Spacing="6">
<Image
x:Name="ImageDestination"
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
<TextBlock Text="Destination" FontSize="20"/>
</StackPanel>
<!-- Destination path -->
<Label Grid.Row="1" Grid.Column="0" Content="Destination path" Target="TextBoxInstallDestPath"/>
<TextBox
Grid.Row="1" Grid.Column="1"
x:Name="TextBoxInstallDestPath"
Text="{Binding DestPath}"/>
</Grid>
<!-- Source -->
<Grid
ColumnDefinitions="150,*"
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
RowSpacing="6"
ColumnSpacing="6">
<!-- Header -->
<StackPanel
Grid.ColumnSpan="2"
Orientation="Horizontal"
Spacing="6">
<Image
x:Name="ImageSource"
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
<TextBlock Text="Source" FontSize="20"/>
</StackPanel>
<!-- Source types -->
<Label Grid.Row="1" Grid.Column="0" Content="Source type" Target="CheckBoxInstallActionSourceType"/>
<ComboBox
Grid.Row="1" Grid.Column="1"
x:Name="CheckBoxInstallActionSourceType"
ItemsSource="{x:Static vm:MainWindowGridRow.SourceTypes}"
DisplayMemberBinding="{Binding Value}"
SelectedValueBinding="{Binding Key}"
SelectedValue="{Binding SourceType}"/>
<!-- Is Zip -->
<CheckBox Grid.Row="2" Grid.Column="1"
x:Name="CheckBoxInstallActionIsZip"
Content="Is Zip archive"
IsChecked="{Binding IsZip}"/>
<!-- Source owner -->
<Label Grid.Row="3" Grid.Column="0" Content="Source owner" Target="TextBoxInstallActionSourceOwner"/>
<TextBox
Grid.Row="3" Grid.Column="1"
x:Name="TextBoxInstallActionSourceOwner"
Text="{Binding SourceOwner}"/>
<!-- Source name -->
<Label Grid.Row="4" Grid.Column="0" Content="Source name" Target="TextBoxInstallActionSourceName"/>
<TextBox
Grid.Row="4" Grid.Column="1"
x:Name="TextBoxInstallActionSourceName"
Text="{Binding SourceName}"/>
<!-- Source RegEx -->
<Label Grid.Row="5" Grid.Column="0" Content="Source RegEx" Target="TextBoxInstallActionSourceRegEx"/>
<TextBox
Grid.Row="5" Grid.Column="1"
x:Name="TextBoxInstallActionSourceRegEx"
Text="{Binding SourceRegex}"/>
<!-- Source url -->
<Label Grid.Row="6" Grid.Column="0" Content="Source URL" Target="TextBoxInstallActionSourceUrl"/>
<TextBox
Grid.Row="6" Grid.Column="1"
x:Name="TextBoxInstallActionSourceUrl" Text="{Binding SourceUrl}"/>
<!-- Zip archive path -->
<Label Grid.Row="7" Grid.Column="0" Content="ZIP archive path" Target="TextBoxInstallActionZipArchivePath"/>
<TextBox
Grid.Row="7" Grid.Column="1"
x:Name="TextBoxInstallActionZipArchivePath"
Text="{Binding SourceUrl}"/>
</Grid>
<!-- Metadata -->
<Grid
ColumnDefinitions="150,*"
RowDefinitions="Auto,Auto"
RowSpacing="6"
ColumnSpacing="6"
VerticalAlignment="Center">
<!-- Header -->
<StackPanel
Grid.ColumnSpan="2"
Orientation="Horizontal"
Spacing="6">
<Image
x:Name="ImageMetadata"
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
<TextBlock Text="Metadata" FontSize="20"/>
</StackPanel>
<!-- Website -->
<Label Grid.Row="1" Grid.Column="0" Content="Website" Target="TextBoxInstallActionWebsite"/>
<TextBox
Grid.Row="1" Grid.Column="1"
x:Name="TextBoxInstallActionWebsite"
Text="{Binding Website}"/>
</Grid>
</StackPanel>
</ScrollViewer>
</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" />