Compare commits
3 Commits
python-ins
...
1.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
def85228d0 | ||
|
|
a1578c92ab | ||
|
|
8fe0bcf1b3 |
@@ -1,5 +1,5 @@
|
||||
* v1.4.1 (unreleased)
|
||||
-
|
||||
- Fixed overlayed dock widgets being misplaced when removing a toolbar (#227)
|
||||
|
||||
* v1.4.0 (16 July 2021)
|
||||
- No longer supports Qt versions less than 5.12
|
||||
|
||||
@@ -39,6 +39,7 @@ using namespace KDDockWidgets;
|
||||
namespace KDDockWidgets {
|
||||
class MyCentralWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyCentralWidget(QWidget *parent = nullptr)
|
||||
: QWidget(parent)
|
||||
@@ -47,6 +48,14 @@ public:
|
||||
}
|
||||
|
||||
~MyCentralWidget() override;
|
||||
|
||||
void resizeEvent(QResizeEvent *ev) override
|
||||
{
|
||||
QWidget::resizeEvent(ev);
|
||||
Q_EMIT resized(ev->oldSize(), ev->size());
|
||||
}
|
||||
Q_SIGNALS:
|
||||
void resized(QSize oldSize, QSize newSize);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -114,6 +123,8 @@ MainWindow::MainWindow(const QString &name, MainWindowOptions options,
|
||||
d->updateMargins(); // logical dpi might have changed
|
||||
Q_EMIT DockRegistry::self()->windowChangedScreen(windowHandle());
|
||||
});
|
||||
|
||||
connect(d->m_centralWidget, &MyCentralWidget::resized, this, &MainWindowBase::centralWidgetResized);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
@@ -147,3 +158,5 @@ QRect MainWindow::centralAreaGeometry() const
|
||||
{
|
||||
return centralWidget()->geometry();
|
||||
}
|
||||
|
||||
#include "MainWindow.moc"
|
||||
|
||||
@@ -56,6 +56,13 @@ public:
|
||||
return m_options & MainWindowOption_HasCentralFrame;
|
||||
}
|
||||
|
||||
|
||||
void updateOverlayedDockWidgetGeometries()
|
||||
{
|
||||
if (m_overlayedDockWidget)
|
||||
updateOverlayGeometry(m_overlayedDockWidget->d->frame()->QWidgetAdapter::size());
|
||||
}
|
||||
|
||||
CursorPositions allowedResizeSides(SideBarLocation loc) const;
|
||||
|
||||
QRect rectForOverlay(Frame *, SideBarLocation) const;
|
||||
@@ -80,6 +87,10 @@ MainWindowBase::MainWindowBase(const QString &uniqueName, KDDockWidgets::MainWin
|
||||
|
||||
connect(d->m_layoutWidget, &LayoutWidget::visibleWidgetCountChanged, this,
|
||||
&MainWindowBase::frameCountChanged);
|
||||
|
||||
connect(this, &MainWindowBase::centralWidgetResized, this, [this] {
|
||||
d->updateOverlayedDockWidgetGeometries();
|
||||
});
|
||||
}
|
||||
|
||||
MainWindowBase::~MainWindowBase()
|
||||
@@ -636,8 +647,7 @@ void MainWindowBase::setUniqueName(const QString &uniqueName)
|
||||
|
||||
void MainWindowBase::onResized(QResizeEvent *)
|
||||
{
|
||||
if (d->m_overlayedDockWidget)
|
||||
d->updateOverlayGeometry(d->m_overlayedDockWidget->d->frame()->QWidgetAdapter::size());
|
||||
d->updateOverlayedDockWidgetGeometries();
|
||||
}
|
||||
|
||||
bool MainWindowBase::deserialize(const LayoutSaver::MainWindow &mw)
|
||||
|
||||
@@ -225,6 +225,9 @@ Q_SIGNALS:
|
||||
/// can be tabbed together, in which case this signal isn't emitted.
|
||||
void frameCountChanged(int);
|
||||
|
||||
/// @brief emitted when the MainWindow::centralWidget() changes size
|
||||
void centralWidgetResized(QSize oldSize, QSize newSize);
|
||||
|
||||
private:
|
||||
class Private;
|
||||
Private *const d;
|
||||
|
||||
Reference in New Issue
Block a user