Skip to content

Commit

Permalink
fix modal window bg color
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Nov 3, 2024
1 parent 4cf8429 commit 3242a48
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
12 changes: 9 additions & 3 deletions dialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func showFailWindow(msg string) {
layoutRoot.RemovePage("fail")
})

fail.SetTitle(S_MODAL_TITLE_ERROR)
fail.Box.SetBackgroundColor(tcell.ColorDarkRed)
fail.SetBackgroundColor(tcell.ColorDarkRed)

layoutRoot.AddPage("fail", fail, true, true)
Expand All @@ -42,12 +44,14 @@ func showSuccessWindow(msg string, callback func()) {
}
})

succ.SetTitle(S_MODAL_TITLE_SUCCESS)
succ.Box.SetBackgroundColor(tcell.ColorDarkGreen)
succ.SetBackgroundColor(tcell.ColorDarkGreen)
layoutRoot.AddPage("success", succ, true, true)
}

func showInfoWindow(msg string, callback func()) {
succ := tview.NewModal().
info := tview.NewModal().
SetText(msg).
AddButtons([]string{S_MODAL_BUTTON_OK}).
SetDoneFunc(func(buttonIndex int, buttonLabel string) {
Expand All @@ -58,6 +62,8 @@ func showInfoWindow(msg string, callback func()) {
}
})

succ.SetBackgroundColor(tcell.ColorDarkBlue)
layoutRoot.AddPage("info", succ, true, true)
info.SetTitle(S_MODAL_TITLE_INFO)
info.Box.SetBackgroundColor(tcell.ColorDarkBlue)
info.SetBackgroundColor(tcell.ColorDarkBlue)
layoutRoot.AddPage("info", info, true, true)
}
7 changes: 5 additions & 2 deletions literal.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const (
S_WINDOW_SHOWLOADPASSWORD_TITLE = " 🔓 Decrypting masterkey... "
S_WINDOW_SHOW_LOADKEY_TITLE = " Loading master key... "

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

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

S_MODAL_BUTTON_OK = "OK"
S_MODAL_BUTTON_OK = "OK"
S_MODAL_TITLE_ERROR = "<ERROR>"
S_MODAL_TITLE_SUCCESS = "<SUCCESS>"
S_MODAL_TITLE_INFO = "<INFO>"

S_MSG_PASSWORD_MISMATCH = "Password mismatch"
S_MSG_PASSWORD_CHANGED = "Masterkey Password changed"
Expand Down
3 changes: 2 additions & 1 deletion mainframe.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func mainFrameWindow() (content *tview.Flex) {
layoutMainBody = tview.NewFlex()
layoutMainBody.SetDirection(tview.FlexRow).
SetBorder(true).
SetTitle(S_MAIN_FRAME_TITLE)
SetTitle(fmt.Sprintf(S_MAIN_FRAME_TITLE, VERSION))

refreshMainFrame()
return layoutMainBody
Expand Down Expand Up @@ -163,6 +163,7 @@ export LANG=en_US.UTF-8
layoutMainBodyTable.SetCell(int(idx)+1, 0,
tview.NewTableCell(fmt.Sprint(idx)).
SetAlign(tview.AlignLeft).
SetTextColor(tcell.ColorGray).
SetSelectable(false))

layoutMainBodyTable.SetCell(int(idx)+1, 1,
Expand Down
6 changes: 3 additions & 3 deletions theme.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ var theme = tview.Theme{
BorderColor: tcell.ColorDarkSeaGreen,
TitleColor: tcell.ColorForestGreen,
GraphicsColor: tcell.ColorOrchid,
PrimaryTextColor: tcell.ColorWhite,
SecondaryTextColor: tcell.ColorAntiqueWhite,
TertiaryTextColor: tcell.ColorWhite,
PrimaryTextColor: tcell.ColorLightGray,
SecondaryTextColor: tcell.ColorLightGreen,
TertiaryTextColor: tcell.ColorLightGreen,
InverseTextColor: tcell.ColorBlack,
ContrastSecondaryTextColor: tcell.ColorDarkCyan,
}

0 comments on commit 3242a48

Please sign in to comment.