Bug 416310

Summary: No highlight on hover over CompactRepresentation
Product: [Plasma] plasmashell Reporter: Nate Graham <nate>
Component: Battery MonitorAssignee: Kai Uwe Broulik <kde>
Status: RESOLVED FIXED    
Severity: minor CC: kde, materka, me, plasma-bugs, postix
Priority: NOR Keywords: junior-jobs
Version: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 6.0
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 400295    

Description Nate Graham 2020-01-15 20:24:26 UTC
That way it will get a highlight effect when the cursor passes over it in the system tray. See Bug 400295 for more details.
Comment 1 Konrad Materka 2020-01-16 15:24:42 UTC
Or implement glow effect in PlasmaCore.SvgItem
Comment 2 Kai Uwe Broulik 2020-01-16 15:33:55 UTC
The icon is composed of different layers and parts, not just a single icon.
Comment 3 Konrad Materka 2020-01-16 21:26:17 UTC
Hmm, then maybe we can implement this effect in QML, like:

import QtGraphicalEffects 1.12
...
GammaAdjust {
    anchors.fill: batteryIcon
    source: batteryItem
    gamma: root.containsMouse ? (1.0 / 0.7) : 1

    Behavior on gamma {
        PropertyAnimation {
            easing: Easing.InOutQuad
            duration: 250
        }
    }
}

I can provide a patch. The only problem is to maintain consistency with IconItem (animation easing, duration) and with KIconEffect (effect type, values). Some parameters are hardcoded, some are read from kglobalconfig, like: ["DesktopIcons"]["ActiveEffect"]["value"]. I was not able to find any usage of these config values, but some themes may use it. 
In addition, it might be a good idea to extract this as a separate component.
Comment 4 Kai Uwe Broulik 2020-01-17 07:43:40 UTC
I was wondering if perhaps an IconEffects QML item should be added where you can tell it what effects to apply (disabled, hovered, etc) on any item.
Comment 5 Konrad Materka 2020-01-17 09:00:12 UTC
(In reply to Kai Uwe Broulik from comment #4)
> I was wondering if perhaps an IconEffects QML item should be added where you
> can tell it what effects to apply (disabled, hovered, etc) on any item.

Yes, I had something like that in my mind.
Can we discuss it in https://phabricator.kde.org/D26719 ?
Comment 6 ratijas 2022-10-07 15:36:59 UTC
Luckily with mostly white icon this issue is barely noticable. However, it does feel inconsistent when an applet is placed on a desktop, and enters Edit Mode.
Comment 7 Bug Janitor Service 2023-08-01 06:06:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3138
Comment 8 Nate Graham 2023-08-22 22:30:20 UTC
PlasmaCore.IconItem is no more, and we even use Kirigami.Icon here now, but it still doesn't work. Will investigate; re-titling to be more accurate,
Comment 9 Nate Graham 2023-08-24 18:16:11 UTC
Git commit 39f05d2d5b74057ed6d9a0a8a1022865ff5046e8 by Nate Graham.
Committed on 24/08/2023 at 20:13.
Pushed by ngraham into branch 'master'.

applets/{batterymonitor,notifications}: Show CompactRep hover highlights

Battery Monitor and Notifications have custom CompactRepresentations,
but were not conditionally setting the active: property on hover for
their custom icon items, causing them to lack the hover highlight
effect that all other System Tray icons have.
Related: bug 416311
FIXED-IN: 6.0

M  +3    -1    applets/batterymonitor/package/contents/ui/CompactRepresentation.qml
M  +4    -0    applets/notifications/package/contents/ui/CompactRepresentation.qml
M  +5    -0    components/workspace/BatteryIcon.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/39f05d2d5b74057ed6d9a0a8a1022865ff5046e8