applet: remove unnecessary delegate width override
This gets computed automatically and correctly from the parent ListView's width, taking into accounts margins and scrollbar visibility. The hardcoded width did neither, so removing it fixes both issues.
-
Developer
Oh, nice one! I had an alternative patch coming up. Didn't know it could work without any explicit width at all.
From 4918bd8093ea39f067f9dc94dffaa044ff14f6e8 Mon Sep 17 00:00:00 2001 From: ivan tkachenko <me@ratijas.tk> Date: Mon, 24 Jan 2022 05:57:49 +0300 Subject: [PATCH] [applet] Fix width calculation for a device delegate Flickable's margins are not accounted for in ListView.view.width, so unfortunately we have to manage it manually. Also, since we already do margins anyway, we can safely skip that extra gap before a scrollbar. Amends 7c5db54b9675e9f65af921ad5a2c4777e4394d9d. --- src/applet/package/contents/ui/FullRepresentation.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applet/package/contents/ui/FullRepresentation.qml b/src/applet/package/contents/ui/FullRepresentation.qml index 92034ac6..cf1785a0 100644 --- a/src/applet/package/contents/ui/FullRepresentation.qml +++ b/src/applet/package/contents/ui/FullRepresentation.qml @@ -103,7 +103,7 @@ PlasmaExtras.Representation { highlightMoveDuration: 0 highlightResizeDuration: 0 delegate: DeviceItem { - width: listView.width - (scrollView.PlasmaComponents3.ScrollBar.vertical.visible ? PlasmaCore.Units.smallSpacing * 4 : 0) + width: ListView.view.width - ListView.view.leftMargin - ListView.view.rightMargin } PlasmaExtras.PlaceholderMessage { -- 2.34.1
-
Author Developer
Yeah, I tried that too before realizing I would just delete the line entirely. Not all delegates can get away without a width specified, but most seem to be able to.
Please register or sign in to comment