1
0
Fork 0
forked from Mirrors/gomuks

Enforce title bar styling on display mode switch

This commit is contained in:
FIGBERT 2023-04-16 16:27:48 -07:00
parent 6bb265cc66
commit 3b26a8fbd1
No known key found for this signature in database
GPG key ID: 67F1598D607A844B

View file

@ -132,15 +132,9 @@ func NewRoomView(parent *MainView, room *rooms.Room) *RoomView {
} }
// TODO: update when displaymode toggled // TODO: update when displaymode toggled
if view.config.Preferences.DisplayMode != config.DisplayModeModern {
view.topic. view.topic.
SetTextColor(tcell.ColorWhite). SetTextColor(tcell.ColorWhite).
SetBackgroundColor(tcell.ColorDarkGreen) SetBackgroundColor(tcell.ColorDarkGreen)
} else {
view.topic.
SetTextColor(tcell.ColorDefault).
SetTextAlign(mauview.AlignCenter)
}
view.status.SetBackgroundColor(tcell.ColorDimGray) view.status.SetBackgroundColor(tcell.ColorDimGray)
@ -314,7 +308,20 @@ func (view *RoomView) Draw(screen mauview.Screen) {
if view.config.Preferences.DisplayMode == config.DisplayModeModern { if view.config.Preferences.DisplayMode == config.DisplayModeModern {
view.topicScreen.Height = 2 view.topicScreen.Height = 2
view.contentScreen.OffsetY = 2 view.contentScreen.OffsetY = 2
contentHeight -= 1 contentHeight--
view.topic.
SetTextColor(tcell.ColorDefault).
SetBackgroundColor(tcell.ColorDefault).
SetTextAlign(mauview.AlignCenter)
} else {
view.topicScreen.Height = TopicBarHeight
view.contentScreen.OffsetY = StatusBarHeight
view.topic.
SetTextColor(tcell.ColorWhite).
SetBackgroundColor(tcell.ColorDarkGreen).
SetTextAlign(mauview.AlignLeft)
} }
view.topicScreen.Width = width view.topicScreen.Width = width