Skip to content

Commit 3242a48

Browse files
committed
fix modal window bg color
1 parent 4cf8429 commit 3242a48

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

dialog.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ func showFailWindow(msg string) {
2525
layoutRoot.RemovePage("fail")
2626
})
2727

28+
fail.SetTitle(S_MODAL_TITLE_ERROR)
29+
fail.Box.SetBackgroundColor(tcell.ColorDarkRed)
2830
fail.SetBackgroundColor(tcell.ColorDarkRed)
2931

3032
layoutRoot.AddPage("fail", fail, true, true)
@@ -42,12 +44,14 @@ func showSuccessWindow(msg string, callback func()) {
4244
}
4345
})
4446

47+
succ.SetTitle(S_MODAL_TITLE_SUCCESS)
48+
succ.Box.SetBackgroundColor(tcell.ColorDarkGreen)
4549
succ.SetBackgroundColor(tcell.ColorDarkGreen)
4650
layoutRoot.AddPage("success", succ, true, true)
4751
}
4852

4953
func showInfoWindow(msg string, callback func()) {
50-
succ := tview.NewModal().
54+
info := tview.NewModal().
5155
SetText(msg).
5256
AddButtons([]string{S_MODAL_BUTTON_OK}).
5357
SetDoneFunc(func(buttonIndex int, buttonLabel string) {
@@ -58,6 +62,8 @@ func showInfoWindow(msg string, callback func()) {
5862
}
5963
})
6064

61-
succ.SetBackgroundColor(tcell.ColorDarkBlue)
62-
layoutRoot.AddPage("info", succ, true, true)
65+
info.SetTitle(S_MODAL_TITLE_INFO)
66+
info.Box.SetBackgroundColor(tcell.ColorDarkBlue)
67+
info.SetBackgroundColor(tcell.ColorDarkBlue)
68+
layoutRoot.AddPage("info", info, true, true)
6369
}

literal.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const (
44
S_WINDOW_SHOWLOADPASSWORD_TITLE = " 🔓 Decrypting masterkey... "
55
S_WINDOW_SHOW_LOADKEY_TITLE = " Loading master key... "
66

7-
S_MAIN_FRAME_TITLE = " SAFEBOX KEY MANGEMENT SYSTEM "
7+
S_MAIN_FRAME_TITLE = " SAFEBOX KEY MANGEMENT SYSTEM (ver:%v) "
88
S_MAIN_FRAME_CELL_ID = "Id"
99
S_MAIN_FRAME_CELL_LABEL = "Label"
1010
S_MAIN_FRAME_CELL_DERIVED_KEYS = "Derived Keys"
@@ -35,7 +35,10 @@ const (
3535

3636
S_WINDOW_SHOWDIR_TITLE = " Select a path to save masterkey... "
3737

38-
S_MODAL_BUTTON_OK = "OK"
38+
S_MODAL_BUTTON_OK = "OK"
39+
S_MODAL_TITLE_ERROR = "<ERROR>"
40+
S_MODAL_TITLE_SUCCESS = "<SUCCESS>"
41+
S_MODAL_TITLE_INFO = "<INFO>"
3942

4043
S_MSG_PASSWORD_MISMATCH = "Password mismatch"
4144
S_MSG_PASSWORD_CHANGED = "Masterkey Password changed"

mainframe.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func mainFrameWindow() (content *tview.Flex) {
9191
layoutMainBody = tview.NewFlex()
9292
layoutMainBody.SetDirection(tview.FlexRow).
9393
SetBorder(true).
94-
SetTitle(S_MAIN_FRAME_TITLE)
94+
SetTitle(fmt.Sprintf(S_MAIN_FRAME_TITLE, VERSION))
9595

9696
refreshMainFrame()
9797
return layoutMainBody
@@ -163,6 +163,7 @@ export LANG=en_US.UTF-8
163163
layoutMainBodyTable.SetCell(int(idx)+1, 0,
164164
tview.NewTableCell(fmt.Sprint(idx)).
165165
SetAlign(tview.AlignLeft).
166+
SetTextColor(tcell.ColorGray).
166167
SetSelectable(false))
167168

168169
layoutMainBodyTable.SetCell(int(idx)+1, 1,

theme.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ var theme = tview.Theme{
1212
BorderColor: tcell.ColorDarkSeaGreen,
1313
TitleColor: tcell.ColorForestGreen,
1414
GraphicsColor: tcell.ColorOrchid,
15-
PrimaryTextColor: tcell.ColorWhite,
16-
SecondaryTextColor: tcell.ColorAntiqueWhite,
17-
TertiaryTextColor: tcell.ColorWhite,
15+
PrimaryTextColor: tcell.ColorLightGray,
16+
SecondaryTextColor: tcell.ColorLightGreen,
17+
TertiaryTextColor: tcell.ColorLightGreen,
1818
InverseTextColor: tcell.ColorBlack,
1919
ContrastSecondaryTextColor: tcell.ColorDarkCyan,
2020
}

0 commit comments

Comments
 (0)