Fix "Unpin" button not showing up in overlayed widgets
This commit is contained in:
@@ -4,9 +4,7 @@
|
||||
- Co-installable with Qt6
|
||||
- Adds support for non-detachable central widget, MainWindowOption_HasCentralWidget. (#225)
|
||||
- Fix corrupt layout when restoring old JSON
|
||||
|
||||
* v1.4.1 (unreleased)
|
||||
-
|
||||
- Fix "Unpin" button not showing up in overlayed widgets
|
||||
|
||||
* v1.4.0 (16 July 2021)
|
||||
- No longer supports Qt versions less than 5.12
|
||||
|
||||
@@ -285,7 +285,7 @@ bool TitleBar::supportsMinimizeButton() const
|
||||
bool TitleBar::supportsAutoHideButton() const
|
||||
{
|
||||
// Only dock widgets docked into the MainWindow can minimize
|
||||
return m_supportsAutoHide && m_frame && m_frame->isInMainWindow();
|
||||
return m_supportsAutoHide && m_frame && (m_frame->isInMainWindow() || m_frame->isOverlayed());
|
||||
}
|
||||
|
||||
bool TitleBar::hasIcon() const
|
||||
|
||||
@@ -5258,6 +5258,31 @@ void TestDocks::tst_deleteOnCloseWhenOnSideBar()
|
||||
QVERIFY(dock1);
|
||||
}
|
||||
|
||||
void TestDocks::tst_sidebarOverlayShowsAutohide()
|
||||
{
|
||||
// Tests that overlayed widgets show the "Disable auto-hide" button
|
||||
|
||||
EnsureTopLevelsDeleted e;
|
||||
KDDockWidgets::Config::self().setFlags(KDDockWidgets::Config::Flag_AutoHideSupport);
|
||||
|
||||
auto m1 = createMainWindow(QSize(1000, 1000), MainWindowOption_None, "MW1");
|
||||
auto dw1 = new DockWidgetType(QStringLiteral("1"));
|
||||
|
||||
m1->addDockWidget(dw1, Location_OnBottom);
|
||||
QVERIFY(dw1->titleBar()->supportsAutoHideButton());
|
||||
|
||||
m1->moveToSideBar(dw1);
|
||||
m1->overlayOnSideBar(dw1);
|
||||
|
||||
QVERIFY(dw1->isOverlayed());
|
||||
|
||||
auto titleBar = dw1->titleBar();
|
||||
QVERIFY(titleBar->isVisible());
|
||||
QVERIFY(titleBar->supportsAutoHideButton());
|
||||
|
||||
delete dw1;
|
||||
}
|
||||
|
||||
void TestDocks::tst_sidebarOverlayGetsHiddenOnClick()
|
||||
{
|
||||
EnsureTopLevelsDeleted e;
|
||||
|
||||
@@ -261,6 +261,7 @@ private Q_SLOTS:
|
||||
void tst_restoreSideBar();
|
||||
void tst_toggleActionOnSideBar();
|
||||
void tst_deleteOnCloseWhenOnSideBar();
|
||||
void tst_sidebarOverlayShowsAutohide();
|
||||
void tst_sidebarOverlayGetsHiddenOnClick();
|
||||
void tst_floatRemovesFromSideBar();
|
||||
void tst_overlayedGeometryIsSaved();
|
||||
|
||||
Reference in New Issue
Block a user