From 6b5e8c588d2b9471eb01858a618532be0555448e Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 6 Jan 2025 20:17:20 +0800 Subject: [PATCH] ux: add a group header for advanced histories options --- src/Resources/Locales/en_US.axaml | 2 ++ src/Resources/Locales/zh_CN.axaml | 2 ++ src/Resources/Locales/zh_TW.axaml | 2 ++ src/Views/Repository.axaml.cs | 10 ++++++++++ 4 files changed, 16 insertions(+) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 81bbbaa6..e3ffd44d 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -562,8 +562,10 @@ Unset Hide in commit graph Filter in commit graph + LAYOUT Horizontal Vertical + COMMITS ORDER Commit Date (--date-order) Topologically (--topo-order) LOCAL BRANCHES diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 9f2927fe..7589678c 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -566,8 +566,10 @@ 不指定 在提交列表中隐藏 使用其对提交列表过滤 + 布局方式 水平排布 竖直排布 + 提交列表排序规则 按提交时间 (--date-order) 按拓扑排序 (--topo-order) 本地分支 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 93b37257..21b1967a 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -565,8 +565,10 @@ 取消指定 在提交列表中隱藏 以其篩選提交列表 + 佈局方式 橫向顯示 縱向顯示 + 提交顯示順序 依提交時間排序 (--date-order) 依拓撲排序 (--topo-order) 本機分支 diff --git a/src/Views/Repository.axaml.cs b/src/Views/Repository.axaml.cs index feccb686..e12d1c15 100644 --- a/src/Views/Repository.axaml.cs +++ b/src/Views/Repository.axaml.cs @@ -400,6 +400,10 @@ namespace SourceGit.Views { if (sender is Button button && DataContext is ViewModels.Repository repo) { + var layout = new MenuItem(); + layout.Header = App.Text("Repository.HistoriesLayout"); + layout.IsEnabled = false; + var isHorizontal = ViewModels.Preference.Instance.UseTwoColumnsLayoutInHistories; var horizontal = new MenuItem(); horizontal.Header = App.Text("Repository.HistoriesLayout.Horizontal"); @@ -421,6 +425,10 @@ namespace SourceGit.Views ev.Handled = true; }; + var order = new MenuItem(); + order.Header = App.Text("Repository.HistoriesOrder"); + order.IsEnabled = false; + var dateOrder = new MenuItem(); dateOrder.Header = App.Text("Repository.HistoriesOrder.ByDate"); if (!repo.EnableTopoOrderInHistories) @@ -442,9 +450,11 @@ namespace SourceGit.Views }; var menu = new ContextMenu(); + menu.Items.Add(layout); menu.Items.Add(horizontal); menu.Items.Add(vertical); menu.Items.Add(new MenuItem() { Header = "-" }); + menu.Items.Add(order); menu.Items.Add(dateOrder); menu.Items.Add(topoOrder); menu.Open(button);