mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Show radio buttons in the show log graph and commit sort order menus
This commit is contained in:
parent
68c966567c
commit
4967e5136e
1 changed files with 8 additions and 0 deletions
|
@ -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"),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue