diff --git a/demo/MainWindow.cpp b/demo/MainWindow.cpp
index 5650540..212d2ad 100644
--- a/demo/MainWindow.cpp
+++ b/demo/MainWindow.cpp
@@ -266,6 +266,19 @@ static ads::CDockWidget* createTableWidget(QMenu* ViewMenu)
DockWidget->setWidget(w);
DockWidget->setIcon(svgIcon(":/adsdemo/images/grid_on.svg"));
DockWidget->setMinimumSizeHintMode(ads::CDockWidget::MinimumSizeHintFromContent);
+ auto ToolBar = DockWidget->createDefaultToolBar();
+ auto Action = ToolBar->addAction(svgIcon(":/adsdemo/images/fullscreen.svg"), "Toggle Fullscreen");
+ QObject::connect(Action, &QAction::triggered, [=]()
+ {
+ if (DockWidget->isFullScreen())
+ {
+ DockWidget->showNormal();
+ }
+ else
+ {
+ DockWidget->showFullScreen();
+ }
+ });
ViewMenu->addAction(DockWidget->toggleViewAction());
return DockWidget;
}
@@ -670,3 +683,10 @@ void CMainWindow::createTable()
FloatingWidget->move(QPoint(40, 40));
}
+
+//============================================================================
+void CMainWindow::onFullscreenActionTriggered()
+{
+ std::cout << "CMainWindow::onFullscreenActionTriggered()" << std::endl;
+}
+
diff --git a/demo/MainWindow.h b/demo/MainWindow.h
index f2fe937..06961a8 100644
--- a/demo/MainWindow.h
+++ b/demo/MainWindow.h
@@ -63,6 +63,7 @@ private slots:
void createEditor();
void createTable();
void onEditorCloseRequested();
+ void onFullscreenActionTriggered();
};
#endif // MAINWINDOW_H
diff --git a/demo/demo.qrc b/demo/demo.qrc
index ddd49d8..d92ca79 100644
--- a/demo/demo.qrc
+++ b/demo/demo.qrc
@@ -13,5 +13,6 @@
app.css
images/plus.svg
images/help_outline.svg
+ images/fullscreen.svg
diff --git a/demo/images/fullscreen.svg b/demo/images/fullscreen.svg
new file mode 100644
index 0000000..2cf89e3
--- /dev/null
+++ b/demo/images/fullscreen.svg
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/src/DockWidget.cpp b/src/DockWidget.cpp
index 8099f21..4185b89 100644
--- a/src/DockWidget.cpp
+++ b/src/DockWidget.cpp
@@ -876,6 +876,48 @@ QList CDockWidget::titleBarActions() const
}
+//============================================================================
+void CDockWidget::showFullScreen()
+{
+ if (isFloating())
+ {
+ dockContainer()->floatingWidget()->showFullScreen();
+ }
+ else
+ {
+ Super::showFullScreen();
+ }
+}
+
+
+//============================================================================
+void CDockWidget::showNormal()
+{
+ if (isFloating())
+ {
+ dockContainer()->floatingWidget()->showNormal();
+ }
+ else
+ {
+ Super::showFullScreen();
+ }
+}
+
+
+//============================================================================
+bool CDockWidget::isFullScreen() const
+{
+ if (isFloating())
+ {
+ return dockContainer()->floatingWidget()->isFullScreen();
+ }
+ else
+ {
+ return Super::isFullScreen();
+ }
+}
+
+
} // namespace ads
//---------------------------------------------------------------------------
diff --git a/src/DockWidget.h b/src/DockWidget.h
index 9d2e2ee..57e121f 100644
--- a/src/DockWidget.h
+++ b/src/DockWidget.h
@@ -449,6 +449,12 @@ public:
void setTabToolTip(const QString &text);
#endif
+ /**
+ * Returns true if the dock widget is floating and if the floating dock
+ * container is full screen
+ */
+ bool isFullScreen() const;
+
public: // reimplements QFrame -----------------------------------------------
/**
* Emits titleChanged signal if title change event occurs
@@ -478,6 +484,20 @@ public slots:
*/
void closeDockWidget();
+ /**
+ * Shows the widget in full-screen mode.
+ * Normally this function only affects windows. To make the interface
+ * compatible to QDockWidget, this function also maximizes a floating
+ * dock widget.
+ */
+ void showFullScreen();
+
+ /**
+ * This function complements showFullScreen() to restore the widget
+ * after it has been in full screen mode.
+ */
+ void showNormal();
+
signals:
/**