Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/Views/CommandLogContentPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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();
}
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/Views/ViewLogs.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<Grid RowDefinitions="Auto,*,Auto">
<!-- TitleBar -->
<Grid Grid.Row="0" Height="28" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
Expand Down
7 changes: 7 additions & 0 deletions src/Views/ViewLogs.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;

namespace SourceGit.Views
{
Expand All @@ -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)
Expand Down