mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Add hover highlights and tooltips to convergence UI
Dock buttons, running-app icons, and favourite delegates had no mouse-over feedback. Add 3-state highlight backgrounds (hover and press), Kirigami.Icon active state, and tooltips following existing Plasma patterns. Favourite delegate hover is gated on convergence mode to avoid overlap with touch press events.
This commit is contained in:
parent
ba0df4328a
commit
d2cfa5497f
3 changed files with 49 additions and 10 deletions
|
|
@ -99,6 +99,10 @@ Item {
|
|||
Layout.preferredHeight: Kirigami.Units.iconSizes.medium
|
||||
onClicked: folio.HomeScreenState.closeAppDrawer()
|
||||
|
||||
QQC2.ToolTip.text: i18n("Close")
|
||||
QQC2.ToolTip.visible: hovered
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
|
||||
Kirigami.Theme.inherit: false
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,19 +50,29 @@ MouseArea {
|
|||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
width: root.navButtonWidth
|
||||
color: "transparent"
|
||||
color: homeMouseArea.containsPress
|
||||
? Qt.rgba(255, 255, 255, 0.2)
|
||||
: (homeMouseArea.containsMouse ? Qt.rgba(255, 255, 255, 0.1) : "transparent")
|
||||
radius: Kirigami.Units.cornerRadius
|
||||
|
||||
Kirigami.Icon {
|
||||
anchors.centerIn: parent
|
||||
width: Math.min(parent.width, parent.height) * 0.75
|
||||
height: width
|
||||
source: "start-here-kde"
|
||||
active: homeMouseArea.containsMouse
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: homeMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: MobileShellState.ShellDBusClient.openHomeScreen()
|
||||
}
|
||||
|
||||
Controls.ToolTip.text: i18n("Home")
|
||||
Controls.ToolTip.visible: homeMouseArea.containsMouse
|
||||
Controls.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
}
|
||||
|
||||
// Overview button (convergence mode, right end)
|
||||
|
|
@ -73,19 +83,29 @@ MouseArea {
|
|||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
width: root.navButtonWidth
|
||||
color: "transparent"
|
||||
color: overviewMouseArea.containsPress
|
||||
? Qt.rgba(255, 255, 255, 0.2)
|
||||
: (overviewMouseArea.containsMouse ? Qt.rgba(255, 255, 255, 0.1) : "transparent")
|
||||
radius: Kirigami.Units.cornerRadius
|
||||
|
||||
Kirigami.Icon {
|
||||
anchors.centerIn: parent
|
||||
width: Math.min(parent.width, parent.height) * 0.75
|
||||
height: width
|
||||
source: "view-grid-symbolic"
|
||||
active: overviewMouseArea.containsMouse
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: overviewMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: root.folio.triggerOverview()
|
||||
}
|
||||
|
||||
Controls.ToolTip.text: i18n("Overview")
|
||||
Controls.ToolTip.visible: overviewMouseArea.containsMouse
|
||||
Controls.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
}
|
||||
|
||||
TaskManager.VirtualDesktopInfo {
|
||||
|
|
@ -443,12 +463,22 @@ MouseArea {
|
|||
width: root.dockCellWidth
|
||||
height: root.dockCellHeight
|
||||
|
||||
// Hover highlight background
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: Kirigami.Units.cornerRadius
|
||||
color: taskMouseArea.containsPress
|
||||
? Qt.rgba(255, 255, 255, 0.2)
|
||||
: (taskMouseArea.containsMouse ? Qt.rgba(255, 255, 255, 0.1) : "transparent")
|
||||
}
|
||||
|
||||
// Task icon
|
||||
Kirigami.Icon {
|
||||
anchors.centerIn: parent
|
||||
width: Math.min(parent.width, parent.height) * 0.6
|
||||
height: width
|
||||
source: taskDelegate.model.decoration
|
||||
active: taskMouseArea.containsMouse
|
||||
}
|
||||
|
||||
// Active-window indicator dot
|
||||
|
|
@ -465,7 +495,9 @@ MouseArea {
|
|||
|
||||
// Click to activate
|
||||
MouseArea {
|
||||
id: taskMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onClicked: (mouse) => {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
|
|
@ -476,6 +508,10 @@ MouseArea {
|
|||
}
|
||||
}
|
||||
|
||||
Controls.ToolTip.text: taskDelegate.model.display || ""
|
||||
Controls.ToolTip.visible: taskMouseArea.containsMouse && (taskDelegate.model.display || "") !== ""
|
||||
Controls.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
|
||||
Controls.Menu {
|
||||
id: taskContextMenu
|
||||
Controls.MenuItem {
|
||||
|
|
|
|||
|
|
@ -122,14 +122,13 @@ Folio.DelegateTouchArea {
|
|||
Layout.minimumHeight: folio.FolioSettings.delegateIconSize
|
||||
Layout.preferredHeight: Layout.minimumHeight
|
||||
|
||||
// darken effect when hovered
|
||||
// TODO: removed for now, since hovered property seems to overlap with the touch pressed event
|
||||
// layer {
|
||||
// enabled: root.hovered
|
||||
// effect: ColorOverlay {
|
||||
// color: Qt.rgba(0, 0, 0, 0.3)
|
||||
// }
|
||||
// }
|
||||
// Hover highlight in convergence mode (disabled for touch to avoid overlap with press)
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: Kirigami.Units.cornerRadius
|
||||
color: Qt.rgba(255, 255, 255, 0.1)
|
||||
visible: ShellSettings.Settings.convergenceModeEnabled && root.hovered
|
||||
}
|
||||
}
|
||||
|
||||
DelegateLabel {
|
||||
|
|
|
|||
Loading…
Reference in a new issue