Skip to content

Commit 1d7d0ba

Browse files
committed
hack: added the ability to force window layout
Don't use this method. In some cases the layout is incorrect, this is of course a UI design error, but it may be that there are no more ideas, and the problem is serious
1 parent e59ebb6 commit 1d7d0ba

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/framework/dockwindow/view/dockpageview.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,11 @@ void DockPageView::setDefaultNavigationControl(muse::ui::NavigationControl* cont
427427
navigationController()->setDefaultNavigationControl(_control);
428428
}
429429

430+
void DockPageView::forceLayout()
431+
{
432+
emit layoutRequested();
433+
}
434+
430435
QVariant DockPageView::tours() const
431436
{
432437
return m_tours;

src/framework/dockwindow/view/dockpageview.h

+3
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ class DockPageView : public QQuickItem, public muse::Injectable
102102

103103
Q_INVOKABLE void setDefaultNavigationControl(muse::ui::NavigationControl* control);
104104

105+
Q_INVOKABLE void forceLayout();
106+
105107
QVariant tours() const;
106108
void setTours(const QVariant& newTours);
107109

@@ -118,6 +120,7 @@ public slots:
118120
void statusBarChanged(DockStatusBarView* statusBar);
119121

120122
void toursChanged();
123+
void layoutRequested();
121124

122125
private:
123126
void componentComplete() override;

src/framework/dockwindow/view/dockwindow.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,11 @@ bool DockWindow::doLoadPage(const QString& uri, const QVariantMap& params)
550550
newPage->setParams(params);
551551

552552
m_currentPage = newPage;
553+
554+
connect(m_currentPage, &DockPageView::layoutRequested, this, [this](){
555+
m_mainWindow->layoutEqually();
556+
}, Qt::UniqueConnection);
557+
553558
m_currentPage->setVisible(true);
554559

555560
return true;

0 commit comments

Comments
 (0)