Use same weight for all conversation views

This commit is contained in:
Jaidyn Ann 2021-05-30 13:45:08 -05:00
parent 641e8b1fb4
commit 5dbcfc1a52

View File

@ -239,6 +239,10 @@ MainWindow::WorkspaceActivated(int32 workspace, bool active)
void void
MainWindow::SetConversation(Conversation* chat) MainWindow::SetConversation(Conversation* chat)
{ {
// Save current size of chat and textbox
float weightChat = fRightView->ItemWeight(0);
float weightSend = fRightView->ItemWeight(1);
fRightView->RemoveChild(fRightView->FindView("chatView")); fRightView->RemoveChild(fRightView->FindView("chatView"));
fRightView->RemoveChild(fRightView->FindView("fSendScroll")); fRightView->RemoveChild(fRightView->FindView("fSendScroll"));
@ -247,6 +251,12 @@ MainWindow::SetConversation(Conversation* chat)
fRightView->AddChild(fChatView, 9); fRightView->AddChild(fChatView, 9);
fRightView->AddChild(fSendScroll, 1); fRightView->AddChild(fSendScroll, 1);
// Apply saved chat and textbox size to new views
if (weightChat * weightSend != 0) {
fRightView->SetItemWeight(0, weightChat, true);
fRightView->SetItemWeight(1, weightSend, true);
}
} }