Move TitleBar::supportsMinimize|MaximizeButton into FloatingWindow
Just a minor refactoring so FloatingWindow can save it during serialization. So we can support per-floating window settings.
This commit is contained in:
@@ -729,3 +729,13 @@ void FloatingWindow::ensureRectIsOnScreen(QRect &geometry)
|
||||
geometry.moveBottom(scrGeom.bottom());
|
||||
}
|
||||
}
|
||||
|
||||
bool FloatingWindow::supportsMinimizeButton() const
|
||||
{
|
||||
return (Config::self().flags() & Config::Flag_TitleBarHasMinimizeButton) == Config::Flag_TitleBarHasMinimizeButton; // this specific flag is not base^2
|
||||
}
|
||||
|
||||
bool FloatingWindow::supportsMaximizeButton() const
|
||||
{
|
||||
return Config::self().flags() & Config::Flag_TitleBarHasMaximizeButton;
|
||||
}
|
||||
|
||||
@@ -222,6 +222,12 @@ public:
|
||||
/// be open ended
|
||||
static Qt::WindowFlags s_windowFlagsOverride;
|
||||
|
||||
/// @brief Returns whether this floating window supports showing a minimize button
|
||||
bool supportsMinimizeButton() const;
|
||||
|
||||
/// @brief Returns whether this floating window supports showing a maximize button
|
||||
bool supportsMaximizeButton() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void activatedChanged();
|
||||
void numFramesChanged();
|
||||
|
||||
@@ -306,18 +306,12 @@ bool TitleBar::supportsFloatingButton() const
|
||||
|
||||
bool TitleBar::supportsMaximizeButton() const
|
||||
{
|
||||
if (!(Config::self().flags() & Config::Flag_TitleBarHasMaximizeButton))
|
||||
return false;
|
||||
|
||||
return m_floatingWindow != nullptr;
|
||||
return m_floatingWindow && m_floatingWindow->supportsMaximizeButton();
|
||||
}
|
||||
|
||||
bool TitleBar::supportsMinimizeButton() const
|
||||
{
|
||||
if ((Config::self().flags() & Config::Flag_TitleBarHasMinimizeButton) != Config::Flag_TitleBarHasMinimizeButton) // this specific flag is not base^2
|
||||
return false;
|
||||
|
||||
return m_floatingWindow != nullptr;
|
||||
return m_floatingWindow && m_floatingWindow->supportsMinimizeButton();
|
||||
}
|
||||
|
||||
bool TitleBar::supportsAutoHideButton() const
|
||||
|
||||
Reference in New Issue
Block a user