mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-24 19:39:16 +02:00
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.
This commit is contained in:
@@ -40,7 +40,7 @@ func NewModeHelper(
|
|||||||
|
|
||||||
type ModeStatus struct {
|
type ModeStatus struct {
|
||||||
IsActive func() bool
|
IsActive func() bool
|
||||||
Description func() string
|
InfoLabel func() string
|
||||||
Reset func() error
|
Reset func() error
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
|
|||||||
return []ModeStatus{
|
return []ModeStatus{
|
||||||
{
|
{
|
||||||
IsActive: self.c.Modes().Diffing.Active,
|
IsActive: self.c.Modes().Diffing.Active,
|
||||||
Description: func() string {
|
InfoLabel: func() string {
|
||||||
return self.withResetButton(
|
return self.withResetButton(
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"%s %s",
|
"%s %s",
|
||||||
@@ -62,14 +62,14 @@ func (self *ModeHelper) Statuses() []ModeStatus {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
IsActive: self.c.Git().Patch.PatchBuilder.Active,
|
IsActive: self.c.Git().Patch.PatchBuilder.Active,
|
||||||
Description: func() string {
|
InfoLabel: func() string {
|
||||||
return self.withResetButton(self.c.Tr.BuildingPatch, style.FgYellow.SetBold())
|
return self.withResetButton(self.c.Tr.BuildingPatch, style.FgYellow.SetBold())
|
||||||
},
|
},
|
||||||
Reset: self.patchBuildingHelper.Reset,
|
Reset: self.patchBuildingHelper.Reset,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
IsActive: self.c.Modes().Filtering.Active,
|
IsActive: self.c.Modes().Filtering.Active,
|
||||||
Description: func() string {
|
InfoLabel: func() string {
|
||||||
filterContent := lo.Ternary(self.c.Modes().Filtering.GetPath() != "", self.c.Modes().Filtering.GetPath(), self.c.Modes().Filtering.GetAuthor())
|
filterContent := lo.Ternary(self.c.Modes().Filtering.GetPath() != "", self.c.Modes().Filtering.GetPath(), self.c.Modes().Filtering.GetAuthor())
|
||||||
return self.withResetButton(
|
return self.withResetButton(
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
@@ -84,7 +84,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
IsActive: self.c.Modes().MarkedBaseCommit.Active,
|
IsActive: self.c.Modes().MarkedBaseCommit.Active,
|
||||||
Description: func() string {
|
InfoLabel: func() string {
|
||||||
return self.withResetButton(
|
return self.withResetButton(
|
||||||
self.c.Tr.MarkedBaseCommitStatus,
|
self.c.Tr.MarkedBaseCommitStatus,
|
||||||
style.FgCyan,
|
style.FgCyan,
|
||||||
@@ -94,7 +94,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
IsActive: self.c.Modes().CherryPicking.Active,
|
IsActive: self.c.Modes().CherryPicking.Active,
|
||||||
Description: func() string {
|
InfoLabel: func() string {
|
||||||
copiedCount := len(self.c.Modes().CherryPicking.CherryPickedCommits)
|
copiedCount := len(self.c.Modes().CherryPicking.CherryPickedCommits)
|
||||||
text := self.c.Tr.CommitsCopied
|
text := self.c.Tr.CommitsCopied
|
||||||
if copiedCount == 1 {
|
if copiedCount == 1 {
|
||||||
@@ -116,7 +116,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
|
|||||||
IsActive: func() bool {
|
IsActive: func() bool {
|
||||||
return !self.suppressRebasingMode && self.c.Git().Status.WorkingTreeState().Any()
|
return !self.suppressRebasingMode && self.c.Git().Status.WorkingTreeState().Any()
|
||||||
},
|
},
|
||||||
Description: func() string {
|
InfoLabel: func() string {
|
||||||
workingTreeState := self.c.Git().Status.WorkingTreeState()
|
workingTreeState := self.c.Git().Status.WorkingTreeState()
|
||||||
return self.withResetButton(
|
return self.withResetButton(
|
||||||
workingTreeState.Title(self.c.Tr), style.FgYellow,
|
workingTreeState.Title(self.c.Tr), style.FgYellow,
|
||||||
@@ -128,7 +128,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
|
|||||||
IsActive: func() bool {
|
IsActive: func() bool {
|
||||||
return self.c.Model().BisectInfo.Started()
|
return self.c.Model().BisectInfo.Started()
|
||||||
},
|
},
|
||||||
Description: func() string {
|
InfoLabel: func() string {
|
||||||
return self.withResetButton(self.c.Tr.Bisect.Bisecting, style.FgGreen)
|
return self.withResetButton(self.c.Tr.Bisect.Bisecting, style.FgGreen)
|
||||||
},
|
},
|
||||||
Reset: self.bisectHelper.Reset,
|
Reset: self.bisectHelper.Reset,
|
||||||
|
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
func (gui *Gui) informationStr() string {
|
func (gui *Gui) informationStr() string {
|
||||||
if activeMode, ok := gui.helpers.Mode.GetActiveMode(); ok {
|
if activeMode, ok := gui.helpers.Mode.GetActiveMode(); ok {
|
||||||
return activeMode.Description()
|
return activeMode.InfoLabel()
|
||||||
}
|
}
|
||||||
|
|
||||||
if gui.g.Mouse {
|
if gui.g.Mouse {
|
||||||
|
Reference in New Issue
Block a user