fix: tristate toggle logic for tab visibilty (#5530)

Co-authored-by: Nerixyz <nerixdev@outlook.de>
This commit is contained in:
pajlada
2024-08-24 11:42:42 +02:00
committed by GitHub
parent f36c73019d
commit 5170085d7c
14 changed files with 326 additions and 199 deletions
+12 -9
View File
@@ -116,9 +116,6 @@ public:
bool getAllowUserTabManagement() const;
void setAllowUserTabManagement(bool value);
bool getShowTabs() const;
void setShowTabs(bool value);
bool getShowAddButton() const;
void setShowAddButton(bool value);
@@ -133,6 +130,9 @@ public:
void refresh();
protected:
bool getShowTabs() const;
void setShowTabs(bool value);
void scaleChangedEvent(float scale_) override;
void resizeEvent(QResizeEvent *) override;
void mousePressEvent(QMouseEvent *event) override;
@@ -178,7 +178,6 @@ private:
* @brief Updates the visibility state of all tabs
**/
void updateTabVisibility();
void updateTabVisibilityMenuAction();
void resizeAddButton();
bool containsPage(QWidget *page);
@@ -209,7 +208,6 @@ private:
NotebookTabLocation tabLocation_ = NotebookTabLocation::Top;
QAction *lockNotebookLayoutAction_;
QAction *showTabsAction_;
QAction *toggleTopMostAction_;
// This filter, if set, is used to figure out the visibility of
@@ -230,7 +228,15 @@ public:
void themeChangedEvent() override;
void addNotebookActionsToMenu(QMenu *menu) override;
void toggleOfflineTabs();
/**
* Toggles between the "Show all tabs" and "Hide all tabs" tab visibility states
*/
void toggleTabVisibility();
QAction *showAllTabsAction;
QAction *onlyShowLiveTabsAction;
QAction *hideAllTabsAction;
protected:
void showEvent(QShowEvent *event) override;
@@ -240,9 +246,6 @@ private:
pajlada::Signals::SignalHolder signalHolder_;
QAction *toggleOfflineTabsAction_;
void updateToggleOfflineTabsHotkey(NotebookTabVisibility newTabVisibility);
// Main window on Windows has basically a duplicate of this in Window
NotebookButton *streamerModeIcon_{};
void updateStreamerModeIcon();