add hover glow to all bar modules
This commit is contained in:
parent
8d074af824
commit
43c2541ccd
3 changed files with 40 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import Quickshell
|
||||
import "." as M
|
||||
|
||||
|
|
@ -6,6 +7,7 @@ Text {
|
|||
id: root
|
||||
property string icon: ""
|
||||
property string tooltip: ""
|
||||
property bool _hovered: false
|
||||
|
||||
text: icon
|
||||
color: M.Theme.base05
|
||||
|
|
@ -13,8 +15,18 @@ Text {
|
|||
font.family: M.Theme.iconFontFamily
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
layer.enabled: _hovered
|
||||
layer.effect: MultiEffect {
|
||||
shadowEnabled: true
|
||||
shadowColor: M.Theme.base05
|
||||
shadowBlur: 0.5
|
||||
shadowVerticalOffset: 0
|
||||
shadowHorizontalOffset: 0
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
onHoveredChanged: {
|
||||
root._hovered = hovered;
|
||||
if (hovered && root.tooltip !== "") {
|
||||
M.FlyoutState.text = root.tooltip;
|
||||
M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue