summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-04 00:05:05 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-04 00:05:05 +0300
commit6c5309d9eb006bd7d9505f217798964803531b58 (patch)
tree53c8620b32bf005191414b7398a33082e5965f6d /include
parentAdd build target for doxygen (diff)
downloadnheko-6c5309d9eb006bd7d9505f217798964803531b58.tar.xz
Fix regressions regarding UI resizing
The room list would be hidden only through window resizing.
Diffstat (limited to 'include')
-rw-r--r--include/ChatPage.h8
-rw-r--r--include/Config.h1
-rw-r--r--include/MainWindow.h6
-rw-r--r--include/Splitter.h2
-rw-r--r--include/TopRoomBar.h5
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