From 3b26a8fbd1c9e1ae19f53b4e7880cfa0ef70705f Mon Sep 17 00:00:00 2001 From: FIGBERT Date: Sun, 16 Apr 2023 16:27:48 -0700 Subject: [PATCH] Enforce title bar styling on display mode switch --- ui/room-view.go | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/ui/room-view.go b/ui/room-view.go index 46a856c..73693eb 100644 --- a/ui/room-view.go +++ b/ui/room-view.go @@ -132,15 +132,9 @@ func NewRoomView(parent *MainView, room *rooms.Room) *RoomView { } // TODO: update when displaymode toggled - if view.config.Preferences.DisplayMode != config.DisplayModeModern { - view.topic. - SetTextColor(tcell.ColorWhite). - SetBackgroundColor(tcell.ColorDarkGreen) - } else { - view.topic. - SetTextColor(tcell.ColorDefault). - SetTextAlign(mauview.AlignCenter) - } + view.topic. + SetTextColor(tcell.ColorWhite). + SetBackgroundColor(tcell.ColorDarkGreen) view.status.SetBackgroundColor(tcell.ColorDimGray) @@ -314,7 +308,20 @@ func (view *RoomView) Draw(screen mauview.Screen) { if view.config.Preferences.DisplayMode == config.DisplayModeModern { view.topicScreen.Height = 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