From 8fab33012e5ac7c03ab00ec30118dcb2c5218051 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Wed, 9 May 2018 15:23:40 +0200 Subject: Remove ability to hide rosters via QSplitter Previously, you could move the QSplitter slider all to one side and thereby hide the account and MUC rosters. However, these splitters can be hard to get back their previous positions. Test-Information: Verified in Swift that you can not hide/collapse the roster in the UI anymore on macOS 10.13.4. Change-Id: If6622684feb47e5b4172405fe15c3a90178d7b9d diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index e0881d5..231a9b9 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -113,6 +113,9 @@ QtChatWindow::QtChatWindow(const QString& contact, QtChatTheme* theme, UIEventSt else { messageLog_ = new QtWebKitChatView(this, eventStream_, theme, this, settings); // I accept that passing the ChatWindow in so that the view can call the signals is somewhat inelegant, but it saves a lot of boilerplate. This patch is unpleasant enough already. So let's fix this soon (it at least needs fixing by the time history is sorted), but not now. } + // When used with QSplitter and setChildrenCollapsible(false), the following prevents + // this widget to be hidden, i.e. resized to zero width. + messageLog_->setMinimumWidth(20); logRosterSplitter_->addWidget(messageLog_); treeWidget_ = new QtOccupantListWidget(eventStream_, settings_, QtTreeWidget::MessageDisplayJID, this); @@ -356,6 +359,7 @@ void QtChatWindow::handleChangeSplitterState(QByteArray state) { #ifdef SWIFTEN_PLATFORM_MACOSX logRosterSplitter_->setHandleWidth(0); #endif + logRosterSplitter_->setChildrenCollapsible(false); } void QtChatWindow::handleSplitterMoved(int, int) { diff --git a/Swift/QtUI/QtMainWindow.cpp b/Swift/QtUI/QtMainWindow.cpp index cd38259..7eec8d1 100644 --- a/Swift/QtUI/QtMainWindow.cpp +++ b/Swift/QtUI/QtMainWindow.cpp @@ -78,6 +78,10 @@ QtMainWindow::QtMainWindow(Chattables& chattables, SettingsProvider* settings, U overviewScroll->setWidgetResizable(true); overviewScroll->setWidget(chatOverview_); tabs_->addTab(overviewScroll, tr("&All")); + + // When used with QSplitter and setChildrenCollapsible(false), the following prevents + // this widget to be hidden, i.e. resized to zero width. + chatOverview_->setMinimumWidth(20); } contactsTabWidget_ = new QWidget(this); diff --git a/Swift/QtUI/QtSingleWindow.cpp b/Swift/QtUI/QtSingleWindow.cpp index 5956172..2e88968 100644 --- a/Swift/QtUI/QtSingleWindow.cpp +++ b/Swift/QtUI/QtSingleWindow.cpp @@ -24,7 +24,7 @@ QtSingleWindow::QtSingleWindow(QtSettingsProvider* settings) : QSplitter() { } connect(this, SIGNAL(splitterMoved(int, int)), this, SLOT(handleSplitterMoved(int, int))); restoreSplitters(); - + setChildrenCollapsible(false); #ifdef SWIFTEN_PLATFORM_MACOSX setHandleWidth(0); #endif diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp index 6a7018e..92f0a2c 100644 --- a/Swift/QtUI/QtWebKitChatView.cpp +++ b/Swift/QtUI/QtWebKitChatView.cpp @@ -11,9 +11,9 @@ #include #include #include +#include #include #include -#include #include #include #include -- cgit v0.10.2-6-g49f6