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