Skip to content

Commit 0f6cd4b

Browse files
committed
Rename ModeStatus.Description to InfoLabel
It is styled and includes a "(Reset)" button, so it's really not a general-purpose description, but very specific to the Information view.
1 parent e92fed5 commit 0f6cd4b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

pkg/gui/controllers/helpers/mode_helper.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ func NewModeHelper(
3939
}
4040

4141
type ModeStatus struct {
42-
IsActive func() bool
43-
Description func() string
44-
Reset func() error
42+
IsActive func() bool
43+
InfoLabel func() string
44+
Reset func() error
4545
}
4646

4747
func (self *ModeHelper) Statuses() []ModeStatus {
4848
return []ModeStatus{
4949
{
5050
IsActive: self.c.Modes().Diffing.Active,
51-
Description: func() string {
51+
InfoLabel: func() string {
5252
return self.withResetButton(
5353
fmt.Sprintf(
5454
"%s %s",
@@ -62,14 +62,14 @@ func (self *ModeHelper) Statuses() []ModeStatus {
6262
},
6363
{
6464
IsActive: self.c.Git().Patch.PatchBuilder.Active,
65-
Description: func() string {
65+
InfoLabel: func() string {
6666
return self.withResetButton(self.c.Tr.BuildingPatch, style.FgYellow.SetBold())
6767
},
6868
Reset: self.patchBuildingHelper.Reset,
6969
},
7070
{
7171
IsActive: self.c.Modes().Filtering.Active,
72-
Description: func() string {
72+
InfoLabel: func() string {
7373
filterContent := lo.Ternary(self.c.Modes().Filtering.GetPath() != "", self.c.Modes().Filtering.GetPath(), self.c.Modes().Filtering.GetAuthor())
7474
return self.withResetButton(
7575
fmt.Sprintf(
@@ -84,7 +84,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
8484
},
8585
{
8686
IsActive: self.c.Modes().MarkedBaseCommit.Active,
87-
Description: func() string {
87+
InfoLabel: func() string {
8888
return self.withResetButton(
8989
self.c.Tr.MarkedBaseCommitStatus,
9090
style.FgCyan,
@@ -94,7 +94,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
9494
},
9595
{
9696
IsActive: self.c.Modes().CherryPicking.Active,
97-
Description: func() string {
97+
InfoLabel: func() string {
9898
copiedCount := len(self.c.Modes().CherryPicking.CherryPickedCommits)
9999
text := self.c.Tr.CommitsCopied
100100
if copiedCount == 1 {
@@ -116,7 +116,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
116116
IsActive: func() bool {
117117
return !self.suppressRebasingMode && self.c.Git().Status.WorkingTreeState().Any()
118118
},
119-
Description: func() string {
119+
InfoLabel: func() string {
120120
workingTreeState := self.c.Git().Status.WorkingTreeState()
121121
return self.withResetButton(
122122
workingTreeState.Title(self.c.Tr), style.FgYellow,
@@ -128,7 +128,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
128128
IsActive: func() bool {
129129
return self.c.Model().BisectInfo.Started()
130130
},
131-
Description: func() string {
131+
InfoLabel: func() string {
132132
return self.withResetButton(self.c.Tr.Bisect.Bisecting, style.FgGreen)
133133
},
134134
Reset: self.bisectHelper.Reset,

pkg/gui/information_panel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func (gui *Gui) informationStr() string {
1212
if activeMode, ok := gui.helpers.Mode.GetActiveMode(); ok {
13-
return activeMode.Description()
13+
return activeMode.InfoLabel()
1414
}
1515

1616
if gui.g.Mouse {

0 commit comments

Comments
 (0)