Bug 442929 - Header and footer incorrectly draw corners
Summary: Header and footer incorrectly draw corners
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Digital Clock (show other bugs)
Version: master
Platform: Neon Linux
: NOR minor
Target Milestone: 1.0
Assignee: Marco Martin
URL:
Keywords:
: 454211 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-09-25 05:44 UTC by doncbugs
Modified: 2023-12-18 16:01 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments
aCornerInHeaderWhereNoCornerExistsInPlasmoid (12.56 KB, image/png)
2021-09-25 05:44 UTC, doncbugs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description doncbugs 2021-09-25 05:44:19 UTC
Created attachment 141893 [details]
aCornerInHeaderWhereNoCornerExistsInPlasmoid

SUMMARY
plasmoidheading.svgz has its corner and top/bottom assets drawn when a menu meets with the edge of the screen or panel. This leads to strange edges in the corners of plasmoid headers/footers.

STEPS TO REPRODUCE
1. Apply a plasma style with headers/footers (the rounder the corners, the more noticeable)
2. Position kickoff against the edge of the screen (in a bottom panel with kickoff furthest to the left)
3. 

OBSERVED RESULT
Observe where the plasmoid meets the edge, then observe where the header meets the edge of the plasmoid. The header draws the same corner as on the opposite side. The same is true for the bottom right of the footer.

EXPECTED RESULT
Header/footer should be drawn similarly to plasmoid. When against the side of the screen, corners are omitted from the plasmoid. Similarly, unless there are corners present in the plasmoid, corners of the header/footer should not be drawn.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.22.90
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2021-09-27 21:17:26 UTC
We would probably need to ask for different SVGs, or make that SVG into a 9-grid style one and make the theming engine choose corners dynamically based on instructions from each applet that uses it.
Comment 2 doncbugs 2021-09-28 04:59:47 UTC
(In reply to Nate Graham from comment #1)
> We would probably need to ask for different SVGs, or make that SVG into a
> 9-grid style one and make the theming engine choose corners dynamically
> based on instructions from each applet that uses it.

No SVGs have to be changed, plasmoidheading is already made in a 9x9 grid. Based on what I see, it appears that a rectangle is made from the 9 parts and it just resizes to fit the area of the header/footer. It does not appear to omit sides when the parent dialog has done so, so the 8 parts of the frame are always drawn. This means that the footer of a a plasmoid (say kickoff) has its bottom border drawn when the plasmoid itself is attached to the panel below it, even though the plasmoid has removed its bottom border.

I am unsure if this functionality will harm themes that take advantage of always having the entire frame shown, so an option to decide whether to draw the entire frame or not may be warranted. Without such an option, only floating plasmoids will have the entire frame of the header/footer drawn.
Comment 3 doncbugs 2022-04-07 17:03:45 UTC
Curious if any progress has been made on this since. Only sharp-corner themes can hide it.
Comment 4 veggero 2022-09-21 13:44:29 UTC
I've investigated a bit and I see no easy solutions or workarounds. The header doesn't really know whether it should draw its corners or not...
Comment 5 ratijas 2023-12-08 17:42:00 UTC
With new and rewritten dialogs/popups in Plasma 6, this does not seem to be a problem for Kickoff applet anymore, but Date & Time applet still has top-left "korner" if the secondary pane with events & timezones is shown.
Comment 6 Marco Martin 2023-12-13 13:11:20 UTC
*** Bug 454211 has been marked as a duplicate of this bug. ***
Comment 7 Marco Martin 2023-12-18 16:01:14 UTC
Git commit d2decf06bb4bb5f18bc11b94f74bf12769fb7fb5 by Marco Martin.
Committed on 18/12/2023 at 17:01.
Pushed by mart into branch 'master'.

More heuristics to enable the correct borders

* We need to follow the enabled borders of the associated plasmapopup,
  if exists
* we need to enable the border only if it touches the window borders
* when the item is on desktop, still enable both left and right

M  +28   -3    src/declarativeimports/plasmaextracomponents/qml/PlasmoidHeading.qml
M  +5    -0    src/plasmaquick/plasmawindow.h

https://invent.kde.org/plasma/libplasma/-/commit/d2decf06bb4bb5f18bc11b94f74bf12769fb7fb5