feat: test on Windows, implement autoscrolling

This commit is contained in:
alphafetus committed 2025-09-18 17:46:01 -04:00
1 parent 71ab0fe1f4
commit 650948eb7b
7 files changed
+28 -17

No files matched your search

+7
View File
@@ -12,4 +12,11 @@
<Application.Styles>
<FluentTheme />
</Application.Styles>
<Application.Resources>
<Thickness x:Key="ExpanderHeaderBorderThickness">0</Thickness>
<SolidColorBrush x:Key="ExpanderHeaderBackground" Color="Transparent"/>
<SolidColorBrush x:Key="ExpanderHeaderBackgroundPointerOver" Color="Transparent"/>
<SolidColorBrush x:Key="ExpanderHeaderBackgroundPressed" Color="Transparent"/>
</Application.Resources>
</Application>
+3 -1
View File
@@ -31,7 +31,9 @@ public partial class App : Application {
// Avoid duplicate validations from both Avalonia and the CommunityToolkit.
// More info: https://docs.avaloniaui.net/docs/guides/development-guides/data-validation#manage-validationplugins
DisableAvaloniaDataAnnotationValidation();
desktop.MainWindow = new MainWindow(new MainWindowViewModel());
desktop.MainWindow = new MainWindow {
DataContext = new MainWindowViewModel()
};
var services = new ServiceCollection();
services.AddSingleton<IFileSaveService>(x => new FileService(desktop.MainWindow));
@@ -153,6 +153,8 @@ public partial class MainWindowViewModel : ViewModelBase {
FileName = args[0],
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true
};
info.ArgumentList.AddRange(args[1..]);
+5 -4
View File
@@ -11,7 +11,8 @@
TransparencyLevelHint="AcrylicBlur"
Background="Transparent"
SizeToContent="WidthAndHeight"
CanMaximize="False"
ExtendClientAreaToDecorationsHint="True"
CanResize="False"
WindowStartupLocation="CenterScreen">
<Design.DataContext>
@@ -27,13 +28,13 @@
<ExperimentalAcrylicMaterial
BackgroundSource="Digger"
TintColor="Black"
TintOpacity="1"
MaterialOpacity="0.65"/>
TintOpacity="0.5"
MaterialOpacity="0.5"/>
</ExperimentalAcrylicBorder.Material>
</ExperimentalAcrylicBorder>
<Grid
Margin="20"
Margin="20 35 20 20"
ShowGridLines="False"
Width="500"
RowDefinitions="Auto, Auto, Auto, Auto, Auto, Auto"
+1 -3
View File
@@ -6,10 +6,8 @@ using PantherByte.ViewModels;
namespace PantherByte.Views;
public partial class MainWindow : Window {
public MainWindow(MainWindowViewModel viewModel) {
public MainWindow() {
InitializeComponent();
DataContext = viewModel;
WeakReferenceMessenger.Default.Register<MainWindow, OpenProgressDialogMessage>(this,
static (w, m) => {
+8 -7
View File
@@ -7,7 +7,7 @@
x:Class="PantherByte.Views.ProgressWindow"
x:DataType="vm:ProgressWindowViewModel"
Title="Loading..."
TransparencyLevelHint="AcrylicBlur"
Background="Gray"
SizeToContent="WidthAndHeight"
CanMaximize="False"
WindowStartupLocation="CenterOwner">
@@ -28,17 +28,18 @@
</StackPanel>
<Expander VerticalAlignment="Top" HorizontalAlignment="Stretch"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="1"
Header="More information..."
Margin="5">
Margin="5"
BorderThickness="0"
Background="Transparent">
<Expander.Header>More information...</Expander.Header>
<Grid RowDefinitions="*" ColumnDefinitions="*">
<ScrollViewer Grid.Row="0"
x:Name="ScrollView"
Height="100"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<TextBlock Text="{Binding ProcessStdOut}"
<TextBlock x:Name="StdOutText"
Text="{Binding ProcessStdOut}"
TextWrapping="Wrap"/>
</ScrollViewer>
</Grid>
+2 -2
View File
@@ -1,6 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using PantherByte.ViewModels;
namespace PantherByte.Views;
@@ -16,5 +14,7 @@ public partial class ProgressWindow : Window {
await vm.RunProcessAsync();
};
StdOutText.SizeChanged += (_, _) => ScrollView.ScrollToEnd();
}
}