Skip to content

Commit 4967e51

Browse files
committed
Show radio buttons in the show log graph and commit sort order menus
1 parent 68c9665 commit 4967e51

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/gui/controllers/local_commits_controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,7 @@ func (self *LocalCommitsController) handleOpenLogMenu() error {
10851085
Label: self.c.Tr.ShowGitGraph,
10861086
OpensMenu: true,
10871087
OnPress: func() error {
1088+
currentValue := self.c.GetAppState().GitLogShowGraph
10881089
onPress := func(value string) func() error {
10891090
return func() error {
10901091
self.c.GetAppState().GitLogShowGraph = value
@@ -1101,14 +1102,17 @@ func (self *LocalCommitsController) handleOpenLogMenu() error {
11011102
{
11021103
Label: "always",
11031104
OnPress: onPress("always"),
1105+
Widget: types.MakeMenuRadioButton(currentValue == "always"),
11041106
},
11051107
{
11061108
Label: "never",
11071109
OnPress: onPress("never"),
1110+
Widget: types.MakeMenuRadioButton(currentValue == "never"),
11081111
},
11091112
{
11101113
Label: "when maximised",
11111114
OnPress: onPress("when-maximised"),
1115+
Widget: types.MakeMenuRadioButton(currentValue == "when-maximised"),
11121116
},
11131117
},
11141118
})
@@ -1118,6 +1122,7 @@ func (self *LocalCommitsController) handleOpenLogMenu() error {
11181122
Label: self.c.Tr.SortCommits,
11191123
OpensMenu: true,
11201124
OnPress: func() error {
1125+
currentValue := self.c.GetAppState().GitLogOrder
11211126
onPress := func(value string) func() error {
11221127
return func() error {
11231128
self.c.GetAppState().GitLogOrder = value
@@ -1139,14 +1144,17 @@ func (self *LocalCommitsController) handleOpenLogMenu() error {
11391144
{
11401145
Label: "topological (topo-order)",
11411146
OnPress: onPress("topo-order"),
1147+
Widget: types.MakeMenuRadioButton(currentValue == "topo-order"),
11421148
},
11431149
{
11441150
Label: "date-order",
11451151
OnPress: onPress("date-order"),
1152+
Widget: types.MakeMenuRadioButton(currentValue == "date-order"),
11461153
},
11471154
{
11481155
Label: "author-date-order",
11491156
OnPress: onPress("author-date-order"),
1157+
Widget: types.MakeMenuRadioButton(currentValue == "author-date-order"),
11501158
},
11511159
},
11521160
})

0 commit comments

Comments
 (0)