add app name tooltip on hover for lock screen notification pills
This commit is contained in:
parent
d20fdf8fa0
commit
dff70f18d1
1 changed files with 20 additions and 3 deletions
|
|
@ -167,6 +167,7 @@ WlSessionLockSurface {
|
|||
model: parent._notifGroups
|
||||
|
||||
delegate: Rectangle {
|
||||
id: _pill
|
||||
required property var modelData
|
||||
width: _pillRow.implicitWidth + 12
|
||||
height: 24
|
||||
|
|
@ -175,6 +176,22 @@ WlSessionLockSurface {
|
|||
border.color: Qt.rgba(S.Theme.base03.r, S.Theme.base03.g, S.Theme.base03.b, 0.3)
|
||||
border.width: 1
|
||||
|
||||
HoverHandler {
|
||||
id: _pillHover
|
||||
}
|
||||
|
||||
// App name tooltip
|
||||
Text {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.top
|
||||
anchors.bottomMargin: 4
|
||||
text: _pill.modelData.name || ""
|
||||
color: S.Theme.base04
|
||||
font.pixelSize: S.Theme.fontSize - 2
|
||||
font.family: S.Theme.fontFamily
|
||||
visible: _pillHover.hovered && text !== ""
|
||||
}
|
||||
|
||||
Row {
|
||||
id: _pillRow
|
||||
anchors.centerIn: parent
|
||||
|
|
@ -185,7 +202,7 @@ WlSessionLockSurface {
|
|||
width: 14
|
||||
height: 14
|
||||
source: {
|
||||
const icon = modelData.icon;
|
||||
const icon = _pill.modelData.icon;
|
||||
if (!icon)
|
||||
return "";
|
||||
if (icon.startsWith("/"))
|
||||
|
|
@ -198,11 +215,11 @@ WlSessionLockSurface {
|
|||
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: modelData.count > 1 ? modelData.count.toString() : ""
|
||||
text: _pill.modelData.count > 1 ? _pill.modelData.count.toString() : ""
|
||||
color: S.Theme.base04
|
||||
font.pixelSize: S.Theme.fontSize - 2
|
||||
font.family: S.Theme.fontFamily
|
||||
visible: modelData.count > 1
|
||||
visible: _pill.modelData.count > 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue