diff --git a/src/Views/CommandLogContentPresenter.cs b/src/Views/CommandLogContentPresenter.cs index 637a592f0..8aaa3df9d 100644 --- a/src/Views/CommandLogContentPresenter.cs +++ b/src/Views/CommandLogContentPresenter.cs @@ -91,8 +91,10 @@ public string PureText VerticalScrollBarVisibility = ScrollBarVisibility.Auto; TextArea.TextView.Margin = new Thickness(4, 0); - TextArea.TextView.Options.EnableHyperlinks = false; - TextArea.TextView.Options.EnableEmailHyperlinks = false; + TextArea.TextView.Options.EnableHyperlinks = true; + TextArea.TextView.Options.EnableEmailHyperlinks = true; + TextArea.TextView.Options.RequireControlModifierForHyperlinkClick = false; + TextArea.TextView.Options.AllowScrollBelowDocument = false; } public void OnReceiveCommandLog(string line) @@ -144,11 +146,15 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang { Text = string.Empty; } + ScrollToEnd(); } else if (change.Property == PureTextProperty) { if (!string.IsNullOrEmpty(PureText)) + { Text = PureText; + ScrollToEnd(); + } } } diff --git a/src/Views/ViewLogs.axaml b/src/Views/ViewLogs.axaml index bba5da8eb..f77e9856a 100644 --- a/src/Views/ViewLogs.axaml +++ b/src/Views/ViewLogs.axaml @@ -5,15 +5,16 @@ xmlns:vm="using:SourceGit.ViewModels" xmlns:v="using:SourceGit.Views" xmlns:c="using:SourceGit.Converters" - mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="600" x:Class="SourceGit.Views.ViewLogs" x:DataType="vm:ViewLogs" x:Name="ThisControl" Title="{DynamicResource Text.ViewLogs}" Icon="/App.ico" - Width="800" Height="500" + Width="1200" Height="600" CanResize="True" - WindowStartupLocation="CenterOwner"> + WindowStartupLocation="CenterOwner" + Loaded="OnLoaded"> diff --git a/src/Views/ViewLogs.axaml.cs b/src/Views/ViewLogs.axaml.cs index b88147d36..a6214e575 100644 --- a/src/Views/ViewLogs.axaml.cs +++ b/src/Views/ViewLogs.axaml.cs @@ -1,5 +1,6 @@ using Avalonia.Controls; using Avalonia.Input; +using Avalonia.Interactivity; namespace SourceGit.Views { @@ -11,6 +12,12 @@ public ViewLogs() InitializeComponent(); } + private void OnLoaded(object sender, RoutedEventArgs e) + { + if (DataContext is ViewModels.ViewLogs vm && vm.Logs.Count > 0) + vm.SelectedLog = vm.Logs[0]; + } + private void OnLogContextRequested(object sender, ContextRequestedEventArgs e) { if (sender is not Grid { DataContext: ViewModels.CommandLog log } grid || DataContext is not ViewModels.ViewLogs vm)