Fix regressions regarding UI resizing
The room list would be hidden only through window resizing.
5 files changed, 19 insertions, 3 deletions
diff --git a/include/ChatPage.h b/include/ChatPage.h
index 234aabfd..faabd6db 100644
--- a/include/ChatPage.h
+++ b/include/ChatPage.h
@@ -69,6 +69,14 @@ public:
QSharedPointer<UserSettings> userSettings() { return userSettings_; }
void deleteConfigs();
+ //! Calculate the width of the message timeline.
+ int timelineWidth();
+ bool isSideBarExpanded();
+ //! Hide the room & group list (if it was visible).
+ void hideSideBars();
+ //! Show the room/group list (if it was visible).
+ void showSideBars();
+
public slots:
void leaveRoom(const QString &room_id);
diff --git a/include/Config.h b/include/Config.h
index abf5dc05..3a3296d6 100644
--- a/include/Config.h
+++ b/include/Config.h
@@ -8,6 +8,7 @@
// Font sizes are in pixels.
namespace conf {
+constexpr int sideBarCollapsePoint = 450;
// Global settings.
constexpr int fontSize = 14;
constexpr int textInputFontSize = 14;
diff --git a/include/MainWindow.h b/include/MainWindow.h
index 10750e00..3840bd9a 100644
--- a/include/MainWindow.h
+++ b/include/MainWindow.h
@@ -73,9 +73,13 @@ public:
void openMemberListDialog(const QString &room_id = "");
protected:
- void closeEvent(QCloseEvent *event);
+ void closeEvent(QCloseEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void showEvent(QShowEvent *event) override;
private slots:
+ //! Show or hide the sidebars based on window's size.
+ void adjustSideBars();
//! Handle interaction with the tray icon.
void iconActivated(QSystemTrayIcon::ActivationReason reason);
diff --git a/include/Splitter.h b/include/Splitter.h
index d4c34430..99e02eed 100644
--- a/include/Splitter.h
+++ b/include/Splitter.h
@@ -29,8 +29,8 @@ public:
void restoreSizes(int fallback);
public slots:
- void showSidebar();
void hideSidebar();
+ void showFullRoomList();
void showChatView();
signals:
diff --git a/include/TopRoomBar.h b/include/TopRoomBar.h
index 981e3e40..994486e0 100644
--- a/include/TopRoomBar.h
+++ b/include/TopRoomBar.h
@@ -55,11 +55,14 @@ public:
void setBorderColor(QColor &color) { borderColor_ = color; }
public slots:
+ //! Add a "back-arrow" button that can switch to roomlist only view.
void enableBackButton();
+ //! Replace the "back-arrow" button with the avatar of the room.
+ void disableBackButton();
signals:
void inviteUsers(QStringList users);
- void showSidebar();
+ void showRoomList();
protected:
void mousePressEvent(QMouseEvent *) override
|