summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/helpers/app_status_helper.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/controllers/helpers/app_status_helper.go')
-rw-r--r--pkg/gui/controllers/helpers/app_status_helper.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/pkg/gui/controllers/helpers/app_status_helper.go b/pkg/gui/controllers/helpers/app_status_helper.go
index 8e4741bd5..fd6bc247f 100644
--- a/pkg/gui/controllers/helpers/app_status_helper.go
+++ b/pkg/gui/controllers/helpers/app_status_helper.go
@@ -5,6 +5,7 @@ import (
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/gui/status"
+ "github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
)
@@ -23,7 +24,7 @@ func NewAppStatusHelper(c *HelperCommon, statusMgr func() *status.StatusManager,
}
}
-func (self *AppStatusHelper) Toast(message string) {
+func (self *AppStatusHelper) Toast(message string, kind types.ToastKind) {
if self.c.RunningIntegrationTest() {
// Don't bother showing toasts in integration tests. You can't check for
// them anyway, and they would only slow down the test unnecessarily by
@@ -31,7 +32,7 @@ func (self *AppStatusHelper) Toast(message string) {
return
}
- self.statusMgr().AddToastStatus(message)
+ self.statusMgr().AddToastStatus(message, kind)
self.renderAppStatus()
}
@@ -87,7 +88,8 @@ func (self *AppStatusHelper) HasStatus() bool {
}
func (self *AppStatusHelper) GetStatusString() string {
- return self.statusMgr().GetStatusString()
+ appStatus, _ := self.statusMgr().GetStatusString()
+ return appStatus
}
func (self *AppStatusHelper) renderAppStatus() {
@@ -95,7 +97,8 @@ func (self *AppStatusHelper) renderAppStatus() {
ticker := time.NewTicker(time.Millisecond * utils.LoaderAnimationInterval)
defer ticker.Stop()
for range ticker.C {
- appStatus := self.statusMgr().GetStatusString()
+ appStatus, color := self.statusMgr().GetStatusString()
+ self.c.Views().AppStatus.FgColor = color
self.c.OnUIThread(func() error {
self.c.SetViewContent(self.c.Views().AppStatus, appStatus)
return nil
@@ -127,7 +130,8 @@ func (self *AppStatusHelper) renderAppStatusSync(stop chan struct{}) {
for {
select {
case <-ticker.C:
- appStatus := self.statusMgr().GetStatusString()
+ appStatus, color := self.statusMgr().GetStatusString()
+ self.c.Views().AppStatus.FgColor = color
self.c.SetViewContent(self.c.Views().AppStatus, appStatus)
// Redraw all views of the bottom line:
bottomLineViews := []*gocui.View{