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
|
model: parent._notifGroups
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
|
id: _pill
|
||||||
required property var modelData
|
required property var modelData
|
||||||
width: _pillRow.implicitWidth + 12
|
width: _pillRow.implicitWidth + 12
|
||||||
height: 24
|
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.color: Qt.rgba(S.Theme.base03.r, S.Theme.base03.g, S.Theme.base03.b, 0.3)
|
||||||
border.width: 1
|
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 {
|
Row {
|
||||||
id: _pillRow
|
id: _pillRow
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
@ -185,7 +202,7 @@ WlSessionLockSurface {
|
||||||
width: 14
|
width: 14
|
||||||
height: 14
|
height: 14
|
||||||
source: {
|
source: {
|
||||||
const icon = modelData.icon;
|
const icon = _pill.modelData.icon;
|
||||||
if (!icon)
|
if (!icon)
|
||||||
return "";
|
return "";
|
||||||
if (icon.startsWith("/"))
|
if (icon.startsWith("/"))
|
||||||
|
|
@ -198,11 +215,11 @@ WlSessionLockSurface {
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: modelData.count > 1 ? modelData.count.toString() : ""
|
text: _pill.modelData.count > 1 ? _pill.modelData.count.toString() : ""
|
||||||
color: S.Theme.base04
|
color: S.Theme.base04
|
||||||
font.pixelSize: S.Theme.fontSize - 2
|
font.pixelSize: S.Theme.fontSize - 2
|
||||||
font.family: S.Theme.fontFamily
|
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