From 4066c1f093b572b949f9b1f5b0dc1c1a646b7552 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sat, 15 Dec 2018 15:48:28 +0100 Subject: Move tab actions to Subwindow menu --- src/subwindow/subwindow.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/subwindow/subwindow.h') diff --git a/src/subwindow/subwindow.h b/src/subwindow/subwindow.h index 1fc0097..eb7973f 100644 --- a/src/subwindow/subwindow.h +++ b/src/subwindow/subwindow.h @@ -22,9 +22,16 @@ class SubWindow : public QMdiSubWindow Q_OBJECT public: + struct TabData + { + bool closeLocked = false; + bool refreshLocked = false; + }; + explicit SubWindow(const Configuration *config, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()); ~SubWindow() override; + int currentTabIndex() const; WebView *currentView(); WebView *view(int index) const; int tabCount() const; @@ -32,13 +39,19 @@ public: void setProfile(WebProfile *profile); WebProfile *profile() const; + void setTabData(TabData &data, int index); + TabData tabData(int index) const; + signals: void currentViewChanged(WebView *view); void showStatusMessage(const QString &message, int timeout = 0); public slots: int addTab(const QUrl &url = QUrl(), WebProfile *profile = nullptr); + void closeTab(int index); + void setCurrentTab(int index); + void moveTab(int from, int to); int restoreLastTab(); void restoreTabMenu(QMenu *menu); @@ -51,4 +64,6 @@ private: QMetaObject::Connection linkHoveredConnection; }; +Q_DECLARE_METATYPE(SubWindow::TabData) + #endif // SMOLBOTE_SUBWINDOW_H -- cgit v1.2.1