Skip to content

Commit 3e608dd

Browse files
committed
enhance: disable Show lost commits option with Focus on Current Branch mode (#2836)
Signed-off-by: leo <longshuang@msn.cn>
1 parent 1b08075 commit 3e608dd

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎src/Models/RepositoryUIStates.cs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,6 @@ public string BuildHistoryParams_FocusOnCurrentBranchMode(string upstream)
455455
else
456456
builder.Append("--date-order ");
457457

458-
if (HistoryShowFlags.HasFlag(HistoryShowFlags.Reflog))
459-
builder.Append("--reflog ");
460-
461458
if (HistoryShowFlags.HasFlag(HistoryShowFlags.FirstParentOnly))
462459
builder.Append("--first-parent ");
463460

‎src/ViewModels/Histories.cs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ public bool EnableTopoOrder
5050
}
5151
}
5252

53+
public bool CanToggleReflog
54+
{
55+
get => !_repo.UIStates.FocusOnCurrentBranch;
56+
}
57+
5358
public bool IsAuthorColumnVisible
5459
{
5560
get => _repo.UIStates.IsAuthorColumnVisibleInHistory;

‎src/Views/Histories.axaml.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ private void OnOpenAdvancedOptions(object sender, RoutedEventArgs e)
565565
var reflog = new MenuItem();
566566
reflog.Header = App.Text("Repository.ShowLostCommits");
567567
reflog.Tag = "--reflog";
568+
reflog.IsEnabled = histories.CanToggleReflog;
568569
if (histories.HasShowFlag(Models.HistoryShowFlags.Reflog))
569570
reflog.Icon = this.CreateMenuIcon("Icons.Check");
570571
reflog.Click += (_, ev) =>

0 commit comments

Comments
 (0)