diff --git a/src/private/Frame.cpp b/src/private/Frame.cpp index fb688620..637bc26b 100644 --- a/src/private/Frame.cpp +++ b/src/private/Frame.cpp @@ -541,7 +541,7 @@ bool Frame::isInFloatingWindow() const bool Frame::isInMainWindow() const { - return m_dropArea && m_dropArea->isInMainWindow(); + return mainWindow() != nullptr; } bool Frame::event(QEvent *e) diff --git a/src/private/Frame_p.h b/src/private/Frame_p.h index 6a9598ca..70ae9a31 100644 --- a/src/private/Frame_p.h +++ b/src/private/Frame_p.h @@ -112,8 +112,12 @@ public: QString title() const; QIcon icon() const; const QVector dockWidgets() const; + void setDropArea(DropArea *); + ///@brief Returns the drop area this Frame is in. + DropArea *dropArea() const; + bool isTheOnlyFrame() const; /** @@ -136,13 +140,6 @@ public: */ bool isInMainWindow() const; - - /** - * @brief Returns the main window this frame is in. - * nullptr if not inside a main window. - */ - MainWindowBase *mainWindow() const; - /** * @brief returns if this widget is the central frame * MainWindow supports a mode where the middle frame is persistent even if no dock widget is there. @@ -162,14 +159,18 @@ public: */ bool alwaysShowsTabs() const { return m_options & FrameOption_AlwaysShowsTabs; } - /// @brief returns whether the dockwidget @p w is inside this frame bool contains(DockWidgetBase *w) const; - ///@brief returns the FloatingWindow this frame is in, if any FloatingWindow *floatingWindow() const; + /** + * @brief Returns the main window this frame is in. + * nullptr if not inside a main window. + */ + MainWindowBase *mainWindow() const; + /** * @brief Puts the Frame back in its previous main window position * @@ -228,9 +229,6 @@ public: */ virtual QRect dragRect() const; - ///@brief Returns the drop area this Frame is in. - DropArea *dropArea() const; - Q_SIGNALS: void currentDockWidgetChanged(KDDockWidgets::DockWidgetBase *); void numDockWidgetsChanged();