[Battery Monitor] Glow icon on hover
Needs ReviewPublic

Authored by kmaterka on Jan 16 2020, 10:03 PM.

Details

Summary

All icons in System Tray "glow" a little bit when mouse is over the icon. This is easy to implement using IconItem, but for SvgItem this eefect must be applied manually.

BUG: 416310

Test Plan

Move mouse over the baterry icon, it should be a little bit brighter.

Diff Detail

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 21302
Build 21320: arc lint + arc unit
kmaterka created this revision.Jan 16 2020, 10:03 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 16 2020, 10:03 PM
kmaterka requested review of this revision.Jan 16 2020, 10:03 PM
kmaterka added inline comments.Jan 16 2020, 10:20 PM
applets/batterymonitor/package/contents/ui/CompactRepresentation.qml
67

batteryLabel does not exist anymore, it was replaced by BadgeOverlay

85–87

Is it a good candidate for a component? It can be reused in Notifications applet.

86

Must be a sibling

88

0.7 is from KIconEffect::init(). Theoretically it can be overwritten by kglobalconfig: ["DesktopIcons"]["ActiveEffect"]["value"], but I looked and found no usage of this config parameter.
In fact, the effect itself can be overwritten by a config value...

92–93

These two are from IconItem:

m_animation->setEasingCurve(QEasingCurve::InOutQuad);
m_animation->setDuration(250); //FIXME from theme

Animation duration is hardcoded, how to get theme value (in QML)?

As proposed by @broulik in Bug 416310 it might be a good idea to create IconEffects.qml (or IconEffect.qml?). Ideally, it should have a feature parity with KIconEffect.
Any recommendations?
Where to put this component (org.kde.plasma.core, org.kde.plasma.components 3.0, org.kde.plasma.extras, org.kde.plasma.workspace.components)?
How to correctly document it?
How to read KSharedConfig from QML?

BTW. Will it help with T11637?

kmaterka updated this revision to Diff 73766.Jan 17 2020, 1:57 PM

Separate component

kmaterka updated this revision to Diff 73767.Jan 17 2020, 2:30 PM

Apply to notification icon

kmaterka updated this revision to Diff 73799.Jan 17 2020, 9:57 PM

Remove leftovers from tests

kmaterka marked an inline comment as done.Jan 17 2020, 9:58 PM

The question is: should I move this component somewhere else? PlasmaComponents3?

Issue, notification icon is "bold" now:


before changes:

I need to fix it first.

The question is: should I move this component somewhere else? PlasmaComponents3?

It would live in PlasmaExtras; PlasmaComponents3 is just a theme for QtQuickControls2 components.

bam added a subscriber: bam.EditedSep 9 2022, 10:23 AM

Nice. Could the same technique be applied for keyboardlayout applet?
Currently, it glows a bit on hover when showing a flag icon only. No such effect when in text label mode.