Fix hover, systray menu and theming

This commit is contained in:
Amaro Lopes
2025-09-24 17:02:46 -03:00
parent 161988cbb6
commit c66d043ece
8 changed files with 116 additions and 53 deletions

View File

@@ -14,12 +14,13 @@ Singleton {
function start(component, type) {
HoverMediator.component = component
HoverMediator.type = type
hoverPopUp.anchor.updateAnchor()
hoverTimer.start()
}
function exit() {
hoverTimer.stop()
wsPopUp.opacity=0
hoverPopUp.visible = false
}
PopupWindow {
@@ -31,25 +32,58 @@ Singleton {
anchor.rect.x: (HoverMediator.x - this.implicitWidth)/2
implicitHeight: wsPopUp.implicitHeight
implicitWidth: wsPopUp.implicitWidth
// implicitHeight: HoverMediator.height
// implicitWidth: HoverMediator.width
color:"transparent"
visible:true
Component {
id: stub
Text {
text: "stub"
font.bold: true
font.pixelSize: Theme.pixelSize
font.family: Theme.fontFamily
color: Theme.textColor
}
}
Component {
id: systray
Text {
text: {
if (!HoverMediator.component.model) return ""
if (HoverMediator.component.model.tooltipTitle) return HoverMediator.component.model.tooltipTitle
if (HoverMediator.component.model.title) return HoverMediator.component.model.title
else return ""
}
font.bold: true
font.pixelSize: Theme.pixelSize
font.family: Theme.fontFamily
color: Theme.textColor
}
}
Component {
id: time
Text {
property string calendar:(HoverMediator.component.calendar)? HoverMediator.component.calendar: ""
text: calendar
font.bold: true
font.pixelSize: Theme.pixelSize
font.family: Theme.fontFamilyMono
color: Theme.textColor
}
}
Component {
id: audio
Text {
property string sinkDescription:(HoverMediator.component && HoverMediator.component.sink)? HoverMediator.component.sink.description : ""
property string sinkDescription:(HoverMediator.component.sink)? HoverMediator.component.sink.description : ""
text: sinkDescription
color:"white"
font.bold: true
font.pixelSize: Theme.pixelSize
font.family: Theme.fontFamily
color: Theme.textColor
}
}
@@ -86,7 +120,7 @@ Singleton {
bottomMargin: Theme.gaps
color: Theme.backgroudColor
radius: 25
opacity: 0
opacity: 1
Behavior on opacity {
NumberAnimation { property: "opacity"; duration: Theme.animationDuration}
}
@@ -97,6 +131,8 @@ Singleton {
if(!HoverMediator.type) return stub
if(HoverMediator.type === "workspace") return workspaceComponent
if(HoverMediator.type === "audio") return audio
if(HoverMediator.type === "time") return time
if(HoverMediator.type === "systray") return systray
}
}
}
@@ -108,8 +144,8 @@ Singleton {
interval: 300
onTriggered: {
wsPopUp.opacity = 1
// hoverPopUp.visible = true
// wsPopUp.opacity = 1
hoverPopUp.visible = true
}
}
}