Fix rounded borders

Summary: This makes borders of elements using plasmoidHeading rounded again

Test Plan:
After:
{F8289023}

Clearing cache might be needed here.

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: broulik, ngraham, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D29479
This commit is contained in:
Niccolò Venerandi 2020-05-06 13:11:49 +02:00
parent 416f82f8f7
commit 1bc004e5c6
2 changed files with 20 additions and 8 deletions

View File

@ -52,15 +52,15 @@ import QtQuick.Templates 2.12 as T
property int location: PlasmoidHeading.Location.Header
Layout.fillWidth: true
bottomPadding: location == PlasmoidHeading.Location.Footer ? 0 : headingSvg.margins.top
topPadding: location == PlasmoidHeading.Location.Footer ? headingSvg.margins.bottom : 0
bottomPadding: location == PlasmoidHeading.Location.Footer ? 0 : headingSvg.fixedMargins.top
topPadding: location == PlasmoidHeading.Location.Footer ? headingSvg.fixedMargins.bottom : 0
implicitHeight: contentHeight + topPadding + bottomPadding
contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
leftInset: -headingSvg.fixedMargins.left
rightInset: -headingSvg.fixedMargins.right
topInset: location == PlasmoidHeading.Location.Footer ? 0 : -headingSvg.margins.top
topInset: location == PlasmoidHeading.Location.Footer ? 0 : -headingSvg.fixedMargins.top
bottomInset: location == PlasmoidHeading.Location.Footer ? -headingSvg.fixedMargins.bottom : 0
background: PlasmaCore.FrameSvgItem {
@ -68,5 +68,17 @@ import QtQuick.Templates 2.12 as T
visible: fromCurrentTheme
imagePath: "widgets/plasmoidheading"
prefix: location == PlasmoidHeading.Location.Header? 'header' : 'footer'
enabledBorders: {
var borders = 0
borders |= PlasmaCore.FrameSvg.LeftBorder
borders |= PlasmaCore.FrameSvg.RightBorder
if (plasmoid.location !== PlasmaCore.Types.TopEdge || location != PlasmoidHeading.Location.Header) {
borders |= PlasmaCore.FrameSvg.TopBorder
}
if (plasmoid.location !== PlasmaCore.Types.BottomEdge || location != PlasmoidHeading.Location.Footer) {
borders |= PlasmaCore.FrameSvg.BottomBorder
}
return borders
}
}
}

View File

@ -8,7 +8,7 @@
<path id="hint-stretch-borders" d="m-7-7h5v5h-5z" opacity=".6"/>
<path id="header-center" class="ColorScheme-Background" d="m19 12h32v32h-32z" fill="currentColor" opacity=".75"/>
<path id="header-right" class="ColorScheme-Background" d="m51 12h6v32h-6z" fill="currentColor" opacity=".75"/>
<path id="header-top" class="ColorScheme-Background" d="m19 6h32v6h-32z" fill="currentColor" opacity=".75"/>
<path id="header-top" class="ColorScheme-Background" transform="rotate(-90)" d="m-12 19h6v32h-6z" fill="currentColor" opacity=".75"/>
<g id="header-bottom">
<path id="rect3152" class="ColorScheme-Background" fill="currentColor" transform="rotate(90)" d="m44-51h6v32h-6z" opacity=".75"/>
<path id="rect3154" class="ColorScheme-Text" fill="currentColor" transform="rotate(90)" d="m49-51h1v32h-1z" opacity=".15"/>
@ -22,8 +22,8 @@
<path id="path3182" class="ColorScheme-Background" fill="currentColor" d="m19 50v-6h-6v6c6 4e-5 0 0 4 0h1z" opacity=".75"/>
<path id="path3184" class="ColorScheme-Text" fill="currentColor" d="m19 50v-1h-4l-2-2e-5v1l2 2e-5h1z" fill-rule="evenodd" opacity=".15"/>
</g>
<path id="header-topleft" class="ColorScheme-Background" d="m13 6h6v6h-6z" fill="currentColor" opacity=".75"/>
<path id="header-topright" class="ColorScheme-Background" d="m51 6h6v6h-6z" fill="currentColor" opacity=".75"/>
<path id="header-topleft" class="ColorScheme-Background" d="m16 6c-2 0-3 1-3 3v3h6v-6h-1 1z" fill="currentColor" opacity=".75"/>
<path id="header-topright" class="ColorScheme-Background" d="m51 6v6h6v-3c0-2-1-3-3-3h-2z" fill="currentColor" opacity=".75"/>
<path id="footer-center" class="ColorScheme-Background" transform="scale(1 -1)" d="m67-44h32v32h-32z" fill="currentColor" opacity=".75"/>
<path id="footer-right" class="ColorScheme-Background" transform="scale(1 -1)" d="m99-44h6v32h-6z" fill="currentColor" opacity=".75"/>
<path id="footer-bottom" class="ColorScheme-Background" transform="matrix(0 1 1 0 0 0)" d="m44 67h6v32h-6z" fill="currentColor" opacity=".75"/>
@ -40,8 +40,8 @@
<path id="path3182-1" class="ColorScheme-Background" fill="currentColor" d="m67 6v6h-6v-6c6-4e-5 0 0 4 0h1z" opacity=".75"/>
<path id="path3184-8" class="ColorScheme-Text" fill="currentColor" d="m67 6v1h-4l-2 2e-5v-1l2-2e-5h1z" fill-rule="evenodd" opacity=".15"/>
</g>
<path id="footer-bottomleft" class="ColorScheme-Background" d="m61 44h6v6h-6z" fill="currentColor" opacity=".75"/>
<path id="footer-bottomright" class="ColorScheme-Background" d="m99 44h6v6h-6z" fill="currentColor" opacity=".75"/>
<path id="footer-bottomleft" class="ColorScheme-Background" d="m64 50c-2 0-3-1-3-3v-3h6v6h-1 1z" fill="currentColor" opacity=".75"/>
<path id="footer-bottomright" class="ColorScheme-Background" d="m99 50v-6h6v3c0 2-1 3-3 3h-2z" fill="currentColor" opacity=".75"/>
<path id="hint-top-margin" d="m33 12h4v6h-4z" fill="#f0f"/>
<path id="hint-bottom-margin" d="m33 38h4v6h-4z" fill="#f0f"/>
<path id="hint-right-margin" transform="rotate(90)" d="m26-51h4v6h-4z" fill="#f0f"/>

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB