Bug 487653 - Top margin of first ItemDelegate-based list item is smaller than left and right margins
Summary: Top margin of first ItemDelegate-based list item is smaller than left and rig...
Status: CONFIRMED
Alias: None
Product: frameworks-qqc2-desktop-style
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.2.0
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords: qt6
: 491185 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-27 22:15 UTC by yellow.dog625
Modified: 2024-09-08 20:53 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot showing the first item in the sidebar with the inconsistent padding. (106.45 KB, image/png)
2024-05-27 22:15 UTC, yellow.dog625
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yellow.dog625 2024-05-27 22:15:41 UTC
Created attachment 169893 [details]
Screenshot showing the first item in the sidebar with the inconsistent padding.

SUMMARY

In applications such as "Discover" and "System Monitor", the highlight for the first item in the sidebar has inconsistent padding. The top padding differs from the padding on the bottom, right, and left sides. It should be consistent on all sides.

STEPS TO REPRODUCE

1. Open applications like "Discover" or "System Monitor."
2. Select the first item in the sidebar.
3. Observe the padding around the highlight of the first item.
4. Notice the discrepancy in padding, with the top padding being different from the other sides.

OBSERVED RESULT

In applications that feature a sidebar, such as "Discover" and "System Monitor", there is an inconsistency in the padding of the highlight for the first item. When the first item in the sidebar is selected, it is highlighted, but the padding at the top is different from the padding on the other sides (bottom, right, and left). For a more polished and consistent user interface, the padding should be the same on all sides of the highlighted element.

EXPECTED RESULT

The padding around the highlighted item in the sidebar should be consistent on all sides (top, bottom, right, and left) to ensure a uniform appearance.
Comment 1 ratijas 2024-05-29 12:22:08 UTC
Definitely not specific to Discover. The style was changed to have rounded background, and that does not play nicely with tiny delegates in lists.  Unfortunately, there is no easy straightforward solution without breaking the First law (by introducing margins) or changing the size of the first/last delegate (technically impossible, because delegates don't know if they are the last ones or if they are the first one in a section.
Comment 2 Nate Graham 2024-08-03 20:11:38 UTC
*** Bug 491185 has been marked as a duplicate of this bug. ***
Comment 3 Arjen Hiemstra 2024-08-05 08:17:52 UTC
I created https://bugreports.qt.io/browse/QTBUG-127729 for the first/last item thing, currently there isn't really a good way to know when a delegate is the first or last item without some pretty nasty code that may still fail in some cases.