From d9629dd5374fde5914447646e7a2ca58a7837d0a Mon Sep 17 00:00:00 2001 From: Aleksei Romanenko <478249+slimus@users.noreply.github.com> Date: Sat, 16 Jul 2022 09:35:50 -0500 Subject: [PATCH] Fix PF and RS colors (#1656) Co-authored-by: Aleksei Romanenko --- internal/config/styles.go | 4 ++-- internal/view/pf.go | 7 +++++-- internal/view/rs.go | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/internal/config/styles.go b/internal/config/styles.go index 4a856e39..71f0ad69 100644 --- a/internal/config/styles.go +++ b/internal/config/styles.go @@ -265,7 +265,7 @@ func newStyle() Style { func newDialog() Dialog { return Dialog{ - FgColor: "cadetBlue", + FgColor: "cadetblue", BgColor: "black", ButtonBgColor: "darkslateblue", ButtonFgColor: "black", @@ -278,7 +278,7 @@ func newDialog() Dialog { func newPrompt() Prompt { return Prompt{ - FgColor: "cadetBlue", + FgColor: "cadetblue", BgColor: "black", SuggestColor: "dodgerblue", } diff --git a/internal/view/pf.go b/internal/view/pf.go index 12f1299c..51bd12ad 100644 --- a/internal/view/pf.go +++ b/internal/view/pf.go @@ -158,7 +158,7 @@ func (p *PortForward) deleteCmd(evt *tcell.EventKey) *tcell.EventKey { return nil } } - showModal(p.App().Content.Pages, msg, func() { + showModal(p.App(), msg, func() { for _, s := range selections { var pf dao.PortForward pf.Init(p.App().factory, client.NewGVR("portforwards")) @@ -187,9 +187,12 @@ func pfToHuman(s string) (string, error) { return fmt.Sprintf("%s::%s %s->%s", mm[2], mm[3], mm[4], mm[5]), nil } -func showModal(p *ui.Pages, msg string, ok func()) { +func showModal(a *App, msg string, ok func()) { + p := a.Content.Pages + styles := a.Styles.Dialog() m := tview.NewModal(). AddButtons([]string{"Cancel", "OK"}). + SetButtonBackgroundColor(styles.ButtonBgColor.Color()). SetTextColor(tcell.ColorFuchsia). SetText(msg). SetDoneFunc(func(_ int, b string) { diff --git a/internal/view/rs.go b/internal/view/rs.go index f410cb88..726f6f3c 100644 --- a/internal/view/rs.go +++ b/internal/view/rs.go @@ -79,8 +79,10 @@ func (r *ReplicaSet) dismissModal() { } func (r *ReplicaSet) showModal(msg string, done func(int, string)) { + styles := r.App().Styles.Dialog() confirm := tview.NewModal(). AddButtons([]string{"Cancel", "OK"}). + SetButtonBackgroundColor(styles.ButtonBgColor.Color()). SetTextColor(tcell.ColorFuchsia). SetText(msg). SetDoneFunc(done)