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. -->
<Application.Styles>
<FluentTheme DensityStyle="Normal" />
<!-- <FluentTheme DensityStyle="Compact" /> -->
<!-- <SimpleTheme /> -->
<FluentTheme />
<StyleInclude Source="avares://Pilz.UI.AvaloniaUI/Assets/Styles/EnhancedDefaults.axaml"/>
</Application.Styles>
</Application>

View File

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

View File

@@ -1,121 +1,115 @@
<Window xmlns="https://github.com/avaloniaui"
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:lang="clr-namespace:ModpackUpdater.Apps.Client.Gui.LangRes"
xmlns:pilz="https://git.pilzinsel64.de/pilz-framework/pilz"
mc:Ignorable="d"
x:Class="ModpackUpdater.Apps.Client.Gui.MainForm"
Width="520"
SizeToContent="Height"
WindowStartupLocation="CenterScreen"
CanMaximize="false"
Title="Minecraft Modpack Updater"
Icon="/Assets/app.ico"
>
<Grid
RowDefinitions="Auto,Auto,Auto,Auto,Auto"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
x:Name="MainGrid"
>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*" MinWidth="250"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Labels -->
<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="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="1" Grid.ColumnSpan="2" Margin="3" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" Spacing="6">
<Image Width="16" Height="16" x:Name="ImageStatus" />
<TextBlock x:Name="TextStatus" />
</StackPanel>
</Label>
<!-- TextBoxes: Profile -->
<TextBox
x:Name="TextBoxMinecraftProfileFolder"
Grid.Row="0"
Grid.Column="1"
Margin="3"
VerticalAlignment="Center"
Watermark="C:\..."
TextChanged="TextBoxMinecraftProfileFolder_TextChanged"
/>
<!-- TextBoxes: ModpackConfig -->
<TextBox
x:Name="TextBoxModpackConfig"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2"
Margin="3"
VerticalAlignment="Center"
Watermark="https://..."
TextChanged="TextBoxModpackConfig_TextChanged"
/>
<!-- TextBoxes: InstallKey -->
<TextBox
x:Name="TextBoxInstallKey"
Grid.Row="2"
Grid.Column="1"
Grid.ColumnSpan="2"
Margin="3"
VerticalAlignment="Center"
Watermark="XXXXX-YYYYY-ZZZZZ-AAAAA-BBBBB"
TextChanged="TextBoxInstallKey_TextChanged"
IsVisible="false"
/>
<!-- Button: SearchProfileFolder -->
<pilz:ImageButton
x:Name="ButtonSearchProfileFolder"
Grid.Row="0"
Grid.Column="2"
Margin="3"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Text="{x:Static lang:GeneralLangRes.Select}"
Click="ButtonSearchProfileFolder_Click"
/>
<!-- Button: CheckForUpdates -->
<pilz:ImageButton
x:Name="ButtonCheckForUpdates"
Grid.Row="4"
Grid.Column="1"
Margin="3"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Text="{x:Static lang:GeneralLangRes.CheckForUpdates}"
Click="ButtonCheckForUpdates_Click"
/>
<!-- Button: Install -->
<pilz:ImageSplitButton
x:Name="ButtonInstall"
Grid.Row="4"
Grid.Column="2"
Margin="3"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Text="{x:Static lang:GeneralLangRes.Install}"
Click="ButtonInstall_Click"
>
<SplitButton.Flyout>
<MenuFlyout>
<MenuItem x:Name="MenuItemRepair" Header="{x:Static lang:GeneralLangRes.Repair}" Click="MenuItemRepair_Click" />
</MenuFlyout>
</SplitButton.Flyout>
</pilz:ImageSplitButton>
</Grid>
</Window>
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:lang="clr-namespace:ModpackUpdater.Apps.Client.Gui.LangRes"
xmlns:pilz="https://git.pilzinsel64.de/pilz-framework/pilz"
xmlns:symbols="clr-namespace:Pilz.UI.Symbols;assembly=Pilz.UI"
mc:Ignorable="d"
x:Class="ModpackUpdater.Apps.Client.Gui.MainForm"
Width="520"
SizeToContent="Height"
WindowStartupLocation="CenterScreen"
CanMaximize="false"
Title="Minecraft Modpack Updater"
Icon="/Assets/app.ico">
<Grid
RowDefinitions="Auto,Auto,Auto,Auto,Auto"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Margin="3"
x:Name="MainGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*" MinWidth="250"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Labels -->
<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="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="1" Grid.ColumnSpan="2" Margin="3" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" Spacing="6">
<Image Width="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}" x:Name="ImageStatus"/>
<TextBlock x:Name="TextStatus"/>
</StackPanel>
</Label>
<!-- TextBoxes: Profile -->
<TextBox
x:Name="TextBoxMinecraftProfileFolder"
Grid.Row="0"
Grid.Column="1"
Margin="3"
VerticalAlignment="Center"
Watermark="C:\..."
TextChanged="TextBoxMinecraftProfileFolder_TextChanged"/>
<!-- TextBoxes: ModpackConfig -->
<TextBox
x:Name="TextBoxModpackConfig"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2"
Margin="3"
VerticalAlignment="Center"
Watermark="https://..."
TextChanged="TextBoxModpackConfig_TextChanged"/>
<!-- TextBoxes: InstallKey -->
<TextBox
x:Name="TextBoxInstallKey"
Grid.Row="2"
Grid.Column="1"
Grid.ColumnSpan="2"
Margin="3"
VerticalAlignment="Center"
Watermark="XXXXX-YYYYY-ZZZZZ-AAAAA-BBBBB"
TextChanged="TextBoxInstallKey_TextChanged"
IsVisible="false"/>
<!-- Button: SearchProfileFolder -->
<pilz:ImageButton
x:Name="ButtonSearchProfileFolder"
Grid.Row="0"
Grid.Column="2"
Margin="3"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Text="{x:Static lang:GeneralLangRes.Select}"
Click="ButtonSearchProfileFolder_Click"/>
<!-- Button: CheckForUpdates -->
<pilz:ImageButton
x:Name="ButtonCheckForUpdates"
Grid.Row="4"
Grid.Column="1"
Margin="3"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Text="{x:Static lang:GeneralLangRes.CheckForUpdates}"
Click="ButtonCheckForUpdates_Click"/>
<!-- Button: Install -->
<pilz:ImageSplitButton
x:Name="ButtonInstall"
Grid.Row="4"
Grid.Column="2"
Margin="3"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Text="{x:Static lang:GeneralLangRes.Install}"
Click="ButtonInstall_Click">
<SplitButton.Flyout>
<MenuFlyout>
<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.IO" Version="2.1.0" />
<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.Desktop" Version="11.3.8" />
<PackageReference Include="Avalonia.Svg" Version="11.3.0" />

View File

@@ -10,6 +10,6 @@
<!-- <SimpleTheme /> -->
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.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>

View File

@@ -3,7 +3,6 @@ using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using ModpackUpdater.Apps.Manager.Ui;
using Pilz.Features;
using Pilz.UI.Symbols;
namespace ModpackUpdater.Apps.Manager;
@@ -11,7 +10,6 @@ public partial class App : Application
{
public override void Initialize()
{
SymbolGlobals.DefaultImageSmallSize = 17;
AvaloniaXamlLoader.Load(this);
AppGlobals.Initialize();
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.Features" Version="2.12.0" />
<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="Avalonia" 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:DataType="vm:MainWindowViewModel"
Title="Minecraft Modpack Manager"
Padding="3"
WindowState="Maximized"
Loaded="Window_OnLoaded">
<Window.Styles>
<Style Selector="DropDownButton /template/ Path#PART_DropDownGlyph">
<Setter Property="IsVisible" Value="False"/>
</Style>
</Window.Styles>
<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 -->
<Grid
x:Name="GridMain"
<!-- TreeView: Workspace -->
<ScrollViewer
Grid.Column="0"
Grid.Row="1"
ColumnDefinitions="Auto,*,500"
Margin="3">
<StackPanel
Grid.Column="0"
Margin="3"
Spacing="6">
<!-- StackPanel: Menu for updates -->
<StackPanel
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>
<!-- 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}"/>
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>
</DataTemplate>
<DataTemplate
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>
</TreeDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</StackPanel>
</ScrollViewer>
<!-- Action editor -->
<ScrollViewer
x:Name="ScrollViewerInstallAction"
Grid.Column="2"
Margin="3"
DataContext="{Binding SelectedGridRow}"
VerticalScrollBarVisibility="Auto">
<ScrollViewer.Styles>
<Style Selector="Label">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</ScrollViewer.Styles>
<StackPanel
Spacing="6">
<!-- Panel: List header -->
<ContentControl
Grid.Column="1"
Grid.Row="0"
Content="{Binding SelectedTreeNode}">
<!-- Update -->
<Grid
ColumnDefinitions="150,*"
RowDefinitions="Auto,Auto,Auto,Auto"
RowSpacing="6"
ColumnSpacing="6"
IsVisible="{Binding IsUpdate}">
<ContentControl.DataTemplates>
<DataTemplate
DataType="vm:ActionSetTreeNode">
<!-- Header -->
<StackPanel
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>
<StackPanel
Orientation="Horizontal">
<!-- Inherit from -->
<Label Grid.Row="1" Grid.Column="0" Content="Inherit from" Target="TextBoxUpdateActionInheritFrom"/>
<!-- 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
Grid.Row="1" Grid.Column="1"
x:Name="TextBoxUpdateActionInheritFrom"
Text="{Binding InheritFrom}"/>
Margin="3, 0, 3, 0"
Width="100"
Text="{Binding Version}"/>
<!-- Source type -->
<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: Is public -->
<CheckBox
Grid.Row="4" Grid.Column="1"
x:Name="CheckBoxInstallActionIsExtra"
Content="Is Extra"
IsChecked="{Binding IsExtra}"/>
</Grid>
Margin="3, 0, 3, 0"
Content="Public"
IsChecked="{Binding IsPublic}"/>
</StackPanel>
</DataTemplate>
<!-- Destination -->
<Grid
ColumnDefinitions="150,*"
RowDefinitions="Auto,Auto"
RowSpacing="6"
ColumnSpacing="6">
<DataTemplate
DataType="vm:MainWindowTreeNode"/>
</ContentControl.DataTemplates>
</ContentControl>
<!-- 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>
<!-- DataGrid -->
<DataGrid
Grid.Column="1"
Grid.Row="1"
x:Name="DataGridActions"
VerticalAlignment="Stretch"
ItemsSource="{Binding CurrentGridRows}"
SelectedItem="{Binding SelectedGridRow}">
<!-- 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>
<DataGrid.Columns>
<DataGridTextColumn
Header="Id"
Binding="{Binding InheritedId}"/>
<!-- Source -->
<Grid
ColumnDefinitions="150,*"
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
RowSpacing="6"
ColumnSpacing="6">
<DataGridTextColumn
Header="Side"
Binding="{Binding InheritedSide}"/>
<!-- 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>
<DataGridTextColumn
Header="Update type"
Binding="{Binding InheritedUpdateType}"
IsVisible="{Binding IsUpdate}"/>
<!-- 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}"/>
<DataGridTextColumn
Header="Source type"
Binding="{Binding InheritedSourceType}"/>
<!-- Is Zip -->
<CheckBox Grid.Row="2" Grid.Column="1"
x:Name="CheckBoxInstallActionIsZip"
Content="Is Zip archive"
IsChecked="{Binding IsZip}"/>
<DataGridTextColumn
Header="Dest path"
Binding="{Binding InheritedDestPath}"/>
</DataGrid.Columns>
</DataGrid>
<!-- 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}"/>
<!-- Action editor -->
<ScrollViewer
x:Name="ScrollViewerInstallAction"
Grid.Column="2"
Grid.Row="1"
DataContext="{Binding SelectedGridRow}"
VerticalScrollBarVisibility="Auto">
<!-- 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}"/>
<StackPanel
Spacing="6">
<!-- 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}"/>
<!-- Update -->
<Grid
ColumnDefinitions="150,*"
RowDefinitions="Auto,Auto,Auto,Auto,Auto"
RowSpacing="6"
ColumnSpacing="6"
IsVisible="{Binding IsUpdate}">
<!-- 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}"/>
<!-- Header -->
<StackPanel
Grid.ColumnSpan="2"
Orientation="Horizontal"
Spacing="6">
<!-- 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}"/>
<Image x:Name="ImageUpdate" Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
<TextBlock Text="Update" FontSize="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
</StackPanel>
<!-- 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>
<!-- Inherit from -->
<Label Grid.Row="1" Grid.Column="0" Content="Inherit from" Target="TextBoxUpdateActionInheritFrom"/>
<TextBox
Grid.Row="1" Grid.Column="1"
x:Name="TextBoxUpdateActionInheritFrom"
Text="{Binding InheritFrom}"/>
<!-- Metadata -->
<Grid
ColumnDefinitions="150,*"
RowDefinitions="Auto,Auto"
RowSpacing="6"
ColumnSpacing="6"
VerticalAlignment="Center">
<!-- Update type -->
<Label Grid.Row="2" Grid.Column="0" Content="Update 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}"/>
<!-- 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>
<!-- 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 -->
<CheckBox Grid.Row="4" 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
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>
</Window>

View File

@@ -1,4 +1,5 @@
using Pilz.UI.AvaloniaUI.Symbols;
using Pilz.UI.Symbols;
namespace ModpackUpdater.Apps;
@@ -8,13 +9,6 @@ public static class AppGlobals
public static void Initialize()
{
// ThemeHelper.ApplyApplicationTheme(new ThemeDefinition(ApplicationTheme.Auto, HighContrastMode.Auto), n => n.Theme switch
// {
// 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);
SymbolGlobals.DefaultImageSmallSize = 17;
}
}

View File

@@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="Pilz" Version="2.6.1" />
<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.Desktop" Version="11.3.8" />
<PackageReference Include="Avalonia.Svg" Version="11.3.0" />