forked from Shinonome/dots-hyprland
scroll hint: no more Layout, add tooltip
This commit is contained in:
@@ -2,7 +2,6 @@ import qs
|
|||||||
import qs.modules.common
|
import qs.modules.common
|
||||||
import qs.modules.common.widgets
|
import qs.modules.common.widgets
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
|
||||||
|
|
||||||
Revealer { // Scroll hint
|
Revealer { // Scroll hint
|
||||||
id: root
|
id: root
|
||||||
@@ -11,10 +10,11 @@ Revealer { // Scroll hint
|
|||||||
property string tooltipText: ""
|
property string tooltipText: ""
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
anchors.right: root.side === "left" ? parent.right : undefined
|
anchors.right: root.side === "left" ? parent.right : undefined
|
||||||
anchors.left: root.side === "right" ? parent.left : undefined
|
anchors.left: root.side === "right" ? parent.left : undefined
|
||||||
implicitWidth: contentColumnLayout.implicitWidth
|
implicitWidth: contentColumn.implicitWidth
|
||||||
implicitHeight: contentColumnLayout.implicitHeight
|
implicitHeight: contentColumn.implicitHeight
|
||||||
property bool hovered: false
|
property bool hovered: false
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
@@ -22,32 +22,36 @@ Revealer { // Scroll hint
|
|||||||
onExited: hovered = false
|
onExited: hovered = false
|
||||||
acceptedButtons: Qt.NoButton
|
acceptedButtons: Qt.NoButton
|
||||||
|
|
||||||
// StyledToolTip {
|
property bool showHintTimedOut: false
|
||||||
// extraVisibleCondition: tooltipText.length > 0
|
onHoveredChanged: showHintTimedOut = false
|
||||||
// text: tooltipText
|
Timer {
|
||||||
// }
|
running: mouseArea.hovered
|
||||||
|
interval: 500
|
||||||
|
onTriggered: mouseArea.showHintTimedOut = true
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
PopupToolTip {
|
||||||
id: contentColumnLayout
|
extraVisibleCondition: (tooltipText.length > 0 && mouseArea.showHintTimedOut)
|
||||||
anchors.centerIn: parent
|
text: tooltipText
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: contentColumn
|
||||||
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
}
|
||||||
spacing: -5
|
spacing: -5
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
Layout.leftMargin: 5
|
|
||||||
Layout.rightMargin: 5
|
|
||||||
text: "keyboard_arrow_up"
|
text: "keyboard_arrow_up"
|
||||||
iconSize: 14
|
iconSize: 14
|
||||||
color: Appearance.colors.colSubtext
|
color: Appearance.colors.colSubtext
|
||||||
}
|
}
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
Layout.leftMargin: 5
|
|
||||||
Layout.rightMargin: 5
|
|
||||||
text: root.icon
|
text: root.icon
|
||||||
iconSize: 14
|
iconSize: 14
|
||||||
color: Appearance.colors.colSubtext
|
color: Appearance.colors.colSubtext
|
||||||
}
|
}
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
Layout.leftMargin: 5
|
|
||||||
Layout.rightMargin: 5
|
|
||||||
text: "keyboard_arrow_down"
|
text: "keyboard_arrow_down"
|
||||||
iconSize: 14
|
iconSize: 14
|
||||||
color: Appearance.colors.colSubtext
|
color: Appearance.colors.colSubtext
|
||||||
|
|||||||
Reference in New Issue
Block a user