Better colors with black on white themes

Added ColorDefault to more places by default and override some other
specific places with white for better contrast.

This should not affect White on black themes.
This commit is contained in:
Nicolas Peugnet 2022-11-15 19:50:13 +01:00
parent 5db151d90f
commit 8450651a03
4 changed files with 17 additions and 7 deletions

View File

@ -98,7 +98,7 @@ func NewRoomList(parent *MainView) *RoomList {
scrollOffset: 0,
mainTextColor: tcell.ColorDefault,
selectedTextColor: tcell.ColorDefault,
selectedTextColor: tcell.ColorWhite,
selectedBackgroundColor: tcell.ColorDarkGreen,
}
for _, tag := range list.tags {

View File

@ -132,7 +132,7 @@ func NewRoomView(parent *MainView, room *rooms.Room) *RoomView {
}
view.topic.
SetTextColor(tcell.ColorDefault).
SetTextColor(tcell.ColorWhite).
SetBackgroundColor(tcell.ColorDarkGreen)
view.status.SetBackgroundColor(tcell.ColorDimGray)

View File

@ -48,6 +48,8 @@ type GomuksUI struct {
func init() {
mauview.Styles.PrimitiveBackgroundColor = tcell.ColorDefault
mauview.Styles.PrimaryTextColor = tcell.ColorDefault
mauview.Styles.BorderColor = tcell.ColorDefault
mauview.Styles.ContrastBackgroundColor = tcell.ColorDarkGreen
if tcellDB := os.Getenv("TCELLDB"); len(tcellDB) == 0 {
if info, err := os.Stat("/usr/share/tcell/database"); err == nil && info.IsDir() {

View File

@ -77,12 +77,20 @@ func (ui *GomuksUI) NewLoginView() mauview.Component {
}
hs := ui.gmx.Config().HS
view.homeserver.SetPlaceholder("https://example.com").SetText(hs)
view.username.SetPlaceholder("@user:example.com").SetText(string(ui.gmx.Config().UserID))
view.password.SetPlaceholder("correct horse battery staple").SetMaskCharacter('*')
view.homeserver.SetPlaceholder("https://example.com").SetText(hs).SetTextColor(tcell.ColorWhite)
view.username.SetPlaceholder("@user:example.com").SetText(string(ui.gmx.Config().UserID)).SetTextColor(tcell.ColorWhite)
view.password.SetPlaceholder("correct horse battery staple").SetMaskCharacter('*').SetTextColor(tcell.ColorWhite)
view.quitButton.SetOnClick(func() { ui.gmx.Stop(true) }).SetBackgroundColor(tcell.ColorDarkCyan)
view.loginButton.SetOnClick(view.Login).SetBackgroundColor(tcell.ColorDarkCyan)
view.quitButton.
SetOnClick(func() { ui.gmx.Stop(true) }).
SetBackgroundColor(tcell.ColorDarkCyan).
SetForegroundColor(tcell.ColorWhite).
SetFocusedForegroundColor(tcell.ColorWhite)
view.loginButton.
SetOnClick(view.Login).
SetBackgroundColor(tcell.ColorDarkCyan).
SetForegroundColor(tcell.ColorWhite).
SetFocusedForegroundColor(tcell.ColorWhite)
view.
SetColumns([]int{1, 10, 1, 30, 1}).