diff --git a/plugins/kdecorations/aurorae/src/aurorae.cpp b/plugins/kdecorations/aurorae/src/aurorae.cpp --- a/plugins/kdecorations/aurorae/src/aurorae.cpp +++ b/plugins/kdecorations/aurorae/src/aurorae.cpp @@ -451,6 +451,23 @@ return; } setBorders(*b); + + // extended sizes + const int extSize = settings()->largeSpacing(); + int extSides = 0; + int extBottom = 0; + if( settings()->borderSize() == KDecoration2::BorderSize::None ) + { + if( !client().data()->isMaximizedHorizontally() ) extSides = extSize; + if( !client().data()->isMaximizedVertically() ) extBottom = extSize; + + } else if( settings()->borderSize() == KDecoration2::BorderSize::NoSides && !client().data()->isMaximizedHorizontally() ) { + + extSides = extSize; + + } + + setResizeOnlyBorders(QMargins(extSides, 0, extSides, extBottom)); } void Decoration::paint(QPainter *painter, const QRect &repaintRegion) diff --git a/plugins/kdecorations/aurorae/src/lib/auroraetheme.cpp b/plugins/kdecorations/aurorae/src/lib/auroraetheme.cpp --- a/plugins/kdecorations/aurorae/src/lib/auroraetheme.cpp +++ b/plugins/kdecorations/aurorae/src/lib/auroraetheme.cpp @@ -208,63 +208,69 @@ break; } } else { + int minMargin; + int maxMargin; switch (d->borderSize) { + case KDecoration2::BorderSize::NoSides: case KDecoration2::BorderSize::Tiny: - // TODO: this looks wrong - if (isCompositingActive()) { - left = qMin(0, (int)left - d->themeConfig.borderLeft() - d->themeConfig.paddingLeft()); - right = qMin(0, (int)right - d->themeConfig.borderRight() - d->themeConfig.paddingRight()); - bottom = qMin(0, (int)bottom - d->themeConfig.borderBottom() - d->themeConfig.paddingBottom()); - } else { - left = qMin(0, (int)left - d->themeConfig.borderLeft()); - right = qMin(0, (int)right - d->themeConfig.borderRight()); - bottom = qMin(0, (int)bottom - d->themeConfig.borderBottom()); - } + minMargin = 1; + maxMargin = 4; + break; + case KDecoration2::BorderSize::Normal: + minMargin = 4; + maxMargin = 6; break; case KDecoration2::BorderSize::Large: - left = right = bottom = top = 4; + minMargin = 6; + maxMargin = 8; break; case KDecoration2::BorderSize::VeryLarge: - left = right = bottom = top = 8; + minMargin = 8; + maxMargin = 12; break; case KDecoration2::BorderSize::Huge: - left = right = bottom = top = 12; + minMargin = 12; + maxMargin = 20; break; case KDecoration2::BorderSize::VeryHuge: - left = right = bottom = top = 23; + minMargin = 23; + maxMargin = 30; break; case KDecoration2::BorderSize::Oversized: - left = right = bottom = top = 36; + minMargin = 36; + maxMargin = 48; break; - case KDecoration2::BorderSize::Normal: default: - left = right = bottom = top = 0; + minMargin = 0; + maxMargin = 0; + } + + left = qBound(minMargin, d->themeConfig.borderLeft(), maxMargin); + right = qBound(minMargin, d->themeConfig.borderRight(), maxMargin); + bottom = qBound(minMargin, d->themeConfig.borderBottom(), maxMargin); + + if (d->borderSize == KDecoration2::BorderSize::None) { + left = 0; + right = 0; + bottom = 0; + } else if (d->borderSize == KDecoration2::BorderSize::NoSides) { + left = 0; + right = 0; } + const qreal title = titleHeight + d->themeConfig.titleEdgeTop() + d->themeConfig.titleEdgeBottom(); switch ((DecorationPosition)d->themeConfig.decorationPosition()) { case DecorationTop: - left += d->themeConfig.borderLeft(); - right += d->themeConfig.borderRight(); - bottom += d->themeConfig.borderBottom(); top = title; break; case DecorationBottom: - left += d->themeConfig.borderLeft(); - right += d->themeConfig.borderRight(); bottom = title; - top += d->themeConfig.borderTop(); break; case DecorationLeft: left = title; - right += d->themeConfig.borderRight(); - bottom += d->themeConfig.borderBottom(); - top += d->themeConfig.borderTop(); break; case DecorationRight: - left += d->themeConfig.borderLeft(); right = title; - bottom += d->themeConfig.borderBottom(); - top += d->themeConfig.borderTop(); break; default: left = right = bottom = top = 0; diff --git a/plugins/kdecorations/aurorae/src/qml/aurorae.qml b/plugins/kdecorations/aurorae/src/qml/aurorae.qml --- a/plugins/kdecorations/aurorae/src/qml/aurorae.qml +++ b/plugins/kdecorations/aurorae/src/qml/aurorae.qml @@ -188,6 +188,11 @@ topMargin: parent.padding.top + parent.borders.top - margins.top bottomMargin: parent.padding.bottom + parent.borders.bottom - margins.bottom } + visible: parent.borders.left > fixedMargins.left + && parent.borders.right > fixedMargins.right + && parent.borders.top > fixedMargins.top + && parent.borders.bottom > fixedMargins.bottom + imagePath: backgroundSvg.imagePath prefix: "innerborder" opacity: (decoration.client.active && !decoration.client.maximized && backgroundSvg.supportsInnerBorder) ? 1 : 0 @@ -207,6 +212,12 @@ topMargin: parent.padding.top + parent.borders.top - margins.top bottomMargin: parent.padding.bottom + parent.borders.bottom - margins.bottom } + + visible: parent.borders.left > fixedMargins.left + && parent.borders.right > fixedMargins.right + && parent.borders.top > fixedMargins.top + && parent.borders.bottom > fixedMargins.bottom + imagePath: backgroundSvg.imagePath prefix: "innerborder-inactive" opacity: (!decoration.client.active && !decoration.client.maximized && backgroundSvg.supportsInnerBorderInactive) ? 1 : 0