Don't make all DropArea views all DropArea::onResized()
Do it in the controller once, instead of repeating it
This commit is contained in:
@@ -33,6 +33,8 @@ Layout::Layout(Type type, View *view)
|
||||
view->layoutInvalidated.connect([this] {
|
||||
updateSizeConstraints();
|
||||
});
|
||||
|
||||
view->resized.connect(&Layout::onResize, this);
|
||||
}
|
||||
|
||||
Layout::~Layout()
|
||||
|
||||
@@ -199,10 +199,6 @@ public:
|
||||
/// @brief Emitted when the count of visible widgets changes
|
||||
KDBindings::Signal<int> visibleWidgetCountChanged;
|
||||
|
||||
/// TODOm3: Better a signal, so that derived classes don't have to remember to call these
|
||||
bool onResize(QSize newSize);
|
||||
|
||||
/// TODOm3: Remove
|
||||
void viewAboutToBeDeleted();
|
||||
|
||||
Layouting::ItemContainer *rootItem() const;
|
||||
@@ -234,6 +230,7 @@ protected:
|
||||
QList<Controllers::Frame *> framesFrom(View *frameOrMultiSplitter) const;
|
||||
|
||||
private:
|
||||
bool onResize(QSize newSize);
|
||||
bool m_inResizeEvent = false;
|
||||
Layouting::ItemContainer *m_rootItem = nullptr;
|
||||
KDBindings::ConnectionHandle m_minSizeChangedHandler;
|
||||
|
||||
@@ -31,8 +31,3 @@ DropArea_qtquick::~DropArea_qtquick()
|
||||
if (!freed())
|
||||
m_dropArea->viewAboutToBeDeleted();
|
||||
}
|
||||
|
||||
bool DropArea_qtquick::onResize(QSize newSize)
|
||||
{
|
||||
return m_dropArea->onResize(newSize);
|
||||
}
|
||||
|
||||
@@ -28,9 +28,6 @@ public:
|
||||
explicit DropArea_qtquick(Controllers::DropArea *, View *parent);
|
||||
~DropArea_qtquick();
|
||||
|
||||
/// TODOm3
|
||||
bool onResize(QSize newSize) override;
|
||||
|
||||
private:
|
||||
Controllers::DropArea *const m_dropArea;
|
||||
};
|
||||
|
||||
@@ -27,8 +27,3 @@ MDILayout_qtquick::~MDILayout_qtquick()
|
||||
if (!freed())
|
||||
m_controller->viewAboutToBeDeleted();
|
||||
}
|
||||
|
||||
bool MDILayout_qtquick::onResize(QSize newSize)
|
||||
{
|
||||
return m_controller->onResize(newSize);
|
||||
}
|
||||
|
||||
@@ -28,9 +28,6 @@ public:
|
||||
explicit MDILayout_qtquick(Controllers::MDILayout *controller, View *parent);
|
||||
~MDILayout_qtquick();
|
||||
|
||||
/// TODOm3
|
||||
bool onResize(QSize newSize) override;
|
||||
|
||||
private:
|
||||
Controllers::MDILayout *const m_controller;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,3 @@ DropArea_qtwidgets::~DropArea_qtwidgets()
|
||||
if (!freed())
|
||||
m_dropArea->viewAboutToBeDeleted();
|
||||
}
|
||||
|
||||
bool DropArea_qtwidgets::onResize(QSize newSize)
|
||||
{
|
||||
return m_dropArea->onResize(newSize);
|
||||
}
|
||||
|
||||
@@ -38,9 +38,6 @@ public:
|
||||
explicit DropArea_qtwidgets(Controllers::DropArea *, View *parent);
|
||||
~DropArea_qtwidgets();
|
||||
|
||||
/// TODOm3
|
||||
bool onResize(QSize newSize) override;
|
||||
|
||||
private:
|
||||
Controllers::DropArea *const m_dropArea;
|
||||
};
|
||||
|
||||
@@ -27,8 +27,3 @@ MDILayout_qtwidgets::~MDILayout_qtwidgets()
|
||||
if (!freed())
|
||||
m_controller->viewAboutToBeDeleted();
|
||||
}
|
||||
|
||||
bool MDILayout_qtwidgets::onResize(QSize newSize)
|
||||
{
|
||||
return m_controller->onResize(newSize);
|
||||
}
|
||||
|
||||
@@ -29,9 +29,6 @@ public:
|
||||
explicit MDILayout_qtwidgets(Controllers::MDILayout *controller, View *parent);
|
||||
~MDILayout_qtwidgets();
|
||||
|
||||
/// TODOm3
|
||||
bool onResize(QSize newSize) override;
|
||||
|
||||
private:
|
||||
Controllers::MDILayout *const m_controller;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user