diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-06-01 20:26:24 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-06-23 12:53:15 +0200 |
commit | 4967e5136e641bfc2bdb3eaa3ca0bd81ba68878f (patch) | |
tree | f5a601c67bb48a1da748d46cbf2216fedbe22e89 /pkg | |
parent | 68c966567cbff30dddfa2a30c8b2518f30498b58 (diff) |
Show radio buttons in the show log graph and commit sort order menus
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/gui/controllers/local_commits_controller.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/gui/controllers/local_commits_controller.go b/pkg/gui/controllers/local_commits_controller.go index de5116b74..f95062fdb 100644 --- a/pkg/gui/controllers/local_commits_controller.go +++ b/pkg/gui/controllers/local_commits_controller.go @@ -1085,6 +1085,7 @@ func (self *LocalCommitsController) handleOpenLogMenu() error { Label: self.c.Tr.ShowGitGraph, OpensMenu: true, OnPress: func() error { + currentValue := self.c.GetAppState().GitLogShowGraph onPress := func(value string) func() error { return func() error { self.c.GetAppState().GitLogShowGraph = value @@ -1101,14 +1102,17 @@ func (self *LocalCommitsController) handleOpenLogMenu() error { { Label: "always", OnPress: onPress("always"), + Widget: types.MakeMenuRadioButton(currentValue == "always"), }, { Label: "never", OnPress: onPress("never"), + Widget: types.MakeMenuRadioButton(currentValue == "never"), }, { Label: "when maximised", OnPress: onPress("when-maximised"), + Widget: types.MakeMenuRadioButton(currentValue == "when-maximised"), }, }, }) @@ -1118,6 +1122,7 @@ func (self *LocalCommitsController) handleOpenLogMenu() error { Label: self.c.Tr.SortCommits, OpensMenu: true, OnPress: func() error { + currentValue := self.c.GetAppState().GitLogOrder onPress := func(value string) func() error { return func() error { self.c.GetAppState().GitLogOrder = value @@ -1139,14 +1144,17 @@ func (self *LocalCommitsController) handleOpenLogMenu() error { { Label: "topological (topo-order)", OnPress: onPress("topo-order"), + Widget: types.MakeMenuRadioButton(currentValue == "topo-order"), }, { Label: "date-order", OnPress: onPress("date-order"), + Widget: types.MakeMenuRadioButton(currentValue == "date-order"), }, { Label: "author-date-order", OnPress: onPress("author-date-order"), + Widget: types.MakeMenuRadioButton(currentValue == "author-date-order"), }, }, }) |