forked from Shinonome/dots-hyprland
content subsection: add info tooltip
This commit is contained in:
@@ -7,16 +7,37 @@ import "root:/modules/common/widgets/"
|
|||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: root
|
id: root
|
||||||
property string title: ""
|
property string title: ""
|
||||||
|
property string tooltip: ""
|
||||||
default property alias data: sectionContent.data
|
default property alias data: sectionContent.data
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 4
|
Layout.topMargin: 4
|
||||||
spacing: 2
|
spacing: 2
|
||||||
|
|
||||||
ContentSubsectionLabel {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
ContentSubsectionLabel {
|
||||||
visible: root.title && root.title.length > 0
|
visible: root.title && root.title.length > 0
|
||||||
text: root.title
|
text: root.title
|
||||||
|
}
|
||||||
|
MaterialSymbol {
|
||||||
|
visible: root.tooltip && root.tooltip.length > 0
|
||||||
|
text: "info"
|
||||||
|
iconSize: Appearance.font.pixelSize.large
|
||||||
|
|
||||||
|
color: Appearance.colors.colSubtext
|
||||||
|
MouseArea {
|
||||||
|
id: infoMouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.WhatsThisCursor
|
||||||
|
StyledToolTip {
|
||||||
|
extraVisibleCondition: false
|
||||||
|
alternativeVisibleCondition: infoMouseArea.containsMouse
|
||||||
|
content: root.tooltip
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item { Layout.fillWidth: true }
|
||||||
}
|
}
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: sectionContent
|
id: sectionContent
|
||||||
|
|||||||
Reference in New Issue
Block a user