Bug 504116 - Switch shows background when using a circle button smaller than background
Summary: Switch shows background when using a circle button smaller than background
Status: RESOLVED FIXED
Alias: None
Product: libplasma
Classification: Frameworks and Libraries
Component: components (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-12 19:33 UTC by Andres Betts
Modified: 2026-03-04 19:23 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.6.3
Sentry Crash Report:


Attachments
switchbackground (248.89 KB, image/png)
2025-05-12 19:33 UTC, Andres Betts
Details
switch (2.67 KB, image/svg+xml)
2025-05-13 19:41 UTC, Andres Betts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andres Betts 2025-05-12 19:33:39 UTC
Created attachment 181224 [details]
switchbackground

Issue appears when the design requires that there is a circle button in the switch is smaller than the switch background. For some reason, the inactive state uses margins that come from the active background state. Meaning that in the inactive state, the transparent background around the margins of the circle show the active background around margins.

Discussed this issue in the VDG channel and with @ndavis
Comment 1 Nate Graham 2025-05-13 19:09:54 UTC
Could you attach an SVG or Plasma theme that shows the issue, so we can test with it?
Comment 2 Andres Betts 2025-05-13 19:41:24 UTC
Created attachment 181257 [details]
switch

You should see it using this svg
Comment 3 Filip Fila 2026-02-22 18:59:49 UTC
I can also confirm this. Parts of the 'active' element are shown when in an 'inactive' state.

The problem exists in Breeze, but is actually hidden because the handle covers the glitch.

Basically 'active' shouldn't show up at all when the switch is in an inactive state but there is no check for this now. I have simple patch I'm going to submit now.
Comment 4 Bug Janitor Service 2026-02-22 19:12:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libplasma/-/merge_requests/1444
Comment 5 Nate Graham 2026-03-04 19:23:11 UTC
Git commit 6c8cb51c3b0066e4d093fda5539334f803ef2cfa by Nate Graham, on behalf of Filip Fila.
Committed on 04/03/2026 at 19:23.
Pushed by ngraham into branch 'master'.

plasmacomponents3/SwitchIndicator: Fix 'active' elements being shown when inactive

The problem is currently hidden with Breeze because the handle is bigger than the
socket so it covers the glitch.

If we were to design a switch that sits only inside the socket, we observe that
the active state is bleeding into the inactive one.

'Active' has no checks for visiblity so this commit adds one and makes the state
show up only when the control is not inactive (0).
FIXED-IN: 6.6.3

M  +2    -0    src/declarativeimports/plasmacomponents3/SwitchIndicator.qml

https://invent.kde.org/plasma/libplasma/-/commit/6c8cb51c3b0066e4d093fda5539334f803ef2cfa
Comment 6 Nate Graham 2026-03-04 19:23:37 UTC
Git commit 4e3bd91eeed424372a3f325c2a17dbb9d6a02891 by Nate Graham.
Committed on 04/03/2026 at 19:23.
Pushed by ngraham into branch 'Plasma/6.6'.

plasmacomponents3/SwitchIndicator: Fix 'active' elements being shown when inactive

The problem is currently hidden with Breeze because the handle is bigger than the
socket so it covers the glitch.

If we were to design a switch that sits only inside the socket, we observe that
the active state is bleeding into the inactive one.

'Active' has no checks for visiblity so this commit adds one and makes the state
show up only when the control is not inactive (0).
FIXED-IN: 6.6.3


(cherry picked from commit 6c8cb51c3b0066e4d093fda5539334f803ef2cfa)

34ca76c9 plasmacomponents3: Fix 'active' elements being shown when the switch is inactive

Co-authored-by: Filip Fila <filipfila.kde@gmail.com>

M  +2    -0    src/declarativeimports/plasmacomponents3/SwitchIndicator.qml

https://invent.kde.org/plasma/libplasma/-/commit/4e3bd91eeed424372a3f325c2a17dbb9d6a02891