refactor: adjust tooltip
This commit is contained in:
parent
65601cb855
commit
9bb5241e49
1 changed files with 8 additions and 21 deletions
|
|
@ -21,10 +21,6 @@ Rectangle {
|
||||||
radius: Math.round(Style.radiusM * scaling)
|
radius: Math.round(Style.radiusM * scaling)
|
||||||
color: Color.mSurfaceVariant
|
color: Color.mSurfaceVariant
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
Logger.log("Taskbar", "Taskbar loaded")
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: taskbarRow
|
id: taskbarRow
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
@ -62,7 +58,6 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: appMouseArea
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
|
@ -85,23 +80,15 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
onEntered: taskbarTooltip.show()
|
||||||
|
onExited: taskbarTooltip.hide()
|
||||||
|
}
|
||||||
|
|
||||||
ToolTip {
|
NTooltip {
|
||||||
parent: appIcon
|
id: taskbarTooltip
|
||||||
visible: appMouseArea.containsMouse
|
text: taskbarItem.modelData.title || taskbarItem.modelData.appId || "Unknown App"
|
||||||
delay: 500
|
target: taskbarItem
|
||||||
text: taskbarItem.modelData.title || taskbarItem.modelData.appId || "Unknown App"
|
positionAbove: Settings.data.bar.position === "bottom"
|
||||||
background: Rectangle {
|
|
||||||
color: Color.mSurface
|
|
||||||
border.color: Color.mOutline
|
|
||||||
radius: Style.radiusS * root.scaling
|
|
||||||
}
|
|
||||||
contentItem: Label {
|
|
||||||
color: Color.mOnSurface
|
|
||||||
font.pixelSize: Style.fontSizeS * root.scaling
|
|
||||||
text: taskbarItem.modelData.title || taskbarItem.modelData.appId || "Unknown App"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue