From b5046fa6dc6ff455896daeafe36fde081acc6ff4 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 23 Jun 2025 01:34:32 +0200 Subject: [PATCH] content subsection: add info tooltip --- .../common/widgets/ContentSubsection.qml | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/.config/quickshell/modules/common/widgets/ContentSubsection.qml b/.config/quickshell/modules/common/widgets/ContentSubsection.qml index 6df0c8fa9..0eb3b3b50 100644 --- a/.config/quickshell/modules/common/widgets/ContentSubsection.qml +++ b/.config/quickshell/modules/common/widgets/ContentSubsection.qml @@ -7,16 +7,37 @@ import "root:/modules/common/widgets/" ColumnLayout { id: root property string title: "" + property string tooltip: "" default property alias data: sectionContent.data Layout.fillWidth: true Layout.topMargin: 4 spacing: 2 - ContentSubsectionLabel { - Layout.fillWidth: true - visible: root.title && root.title.length > 0 - text: root.title + RowLayout { + ContentSubsectionLabel { + visible: root.title && root.title.length > 0 + 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 { id: sectionContent