Add the possibility of setting the margin used for overlay docks
(cherry-picked from commit 9b8759c472)
This commit is contained in:
@@ -128,6 +128,7 @@ public:
|
||||
Controllers::DockWidget *m_persistentCentralDockWidget = nullptr;
|
||||
KDBindings::ScopedConnection m_visibleWidgetCountConnection;
|
||||
const bool m_supportsAutoHide;
|
||||
int m_overlayMargin = 1;
|
||||
};
|
||||
|
||||
MainWindow::MainWindow(View *view, const QString &uniqueName, MainWindowOptions options)
|
||||
@@ -299,7 +300,7 @@ QRect MainWindow::Private::rectForOverlay(Controllers::Frame *frame, SideBarLoca
|
||||
const QMargins centerWidgetMargins = q->centerWidgetMargins();
|
||||
|
||||
QRect rect;
|
||||
const int margin = 1;
|
||||
const int margin = m_overlayMargin;
|
||||
switch (location) {
|
||||
case SideBarLocation::North:
|
||||
case SideBarLocation::South: {
|
||||
@@ -842,3 +843,18 @@ QRect MainWindow::centralAreaGeometry() const
|
||||
auto v = dynamic_cast<Views::MainWindowViewInterface *>(view());
|
||||
return v->centralAreaGeometry();
|
||||
}
|
||||
|
||||
int MainWindow::overlayMargin() const
|
||||
{
|
||||
return d->m_overlayMargin;
|
||||
}
|
||||
|
||||
void MainWindow::setOverlayMargin(int margin)
|
||||
{
|
||||
if (margin == d->m_overlayMargin)
|
||||
return;
|
||||
|
||||
|
||||
d->m_overlayMargin = margin;
|
||||
Q_EMIT overlayMarginChanged(margin);
|
||||
}
|
||||
|
||||
@@ -187,6 +187,13 @@ public:
|
||||
/// if all dock widgets were closed (0 or more)
|
||||
bool closeDockWidgets(bool force = false);
|
||||
|
||||
/// @brief Returns the margin used by overlay docks. Default: 1
|
||||
int overlayMargin() const;
|
||||
|
||||
/// @brief Sets the margin used by overlay docks.
|
||||
/// Does not modify currently overlayed docks
|
||||
void setOverlayMargin(int margin);
|
||||
|
||||
/// @brief Sets the content's margins
|
||||
void setContentsMargins(int, int, int, int);
|
||||
|
||||
@@ -229,6 +236,8 @@ Q_SIGNALS:
|
||||
/// can be tabbed together, in which case this signal isn't emitted.
|
||||
void frameCountChanged(int);
|
||||
|
||||
void overlayMarginChanged(int margin);
|
||||
|
||||
private:
|
||||
void init(const QString &name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user