From e8414c88bafbc6ce46da0281569873403296a2a1 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:58:30 +0200 Subject: [PATCH] settings: about page --- .config/quickshell/modules/bar/Bar.qml | 3 - .../modules/common/widgets/ContentPage.qml | 8 +- .../common/widgets/NotificationItem.qml | 8 +- .../common/widgets/PointingHandLinkHover.qml | 8 + .../common/widgets/RippleButtonWithIcon.qml | 7 +- .config/quickshell/modules/settings/About.qml | 146 +++++++++++++++++- .config/quickshell/modules/settings/Style.qml | 4 +- .../sidebarLeft/anime/BooruResponse.qml | 7 +- .config/quickshell/services/SystemInfo.qml | 23 ++- .config/quickshell/welcome.qml | 16 +- 10 files changed, 195 insertions(+), 35 deletions(-) create mode 100644 .config/quickshell/modules/common/widgets/PointingHandLinkHover.qml diff --git a/.config/quickshell/modules/bar/Bar.qml b/.config/quickshell/modules/bar/Bar.qml index 80de4d6a6..51ad4cf12 100644 --- a/.config/quickshell/modules/bar/Bar.qml +++ b/.config/quickshell/modules/bar/Bar.qml @@ -456,7 +456,6 @@ Scope { bottom: ConfigOptions.bar.bottom ? barContent.top : undefined } height: Appearance.rounding.screenRounding - visible: showBarBackground RoundCorner { anchors.top: parent.top @@ -464,7 +463,6 @@ Scope { size: Appearance.rounding.screenRounding corner: ConfigOptions.bar.bottom ? cornerEnum.bottomLeft : cornerEnum.topLeft color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" - opacity: 1.0 - Appearance.transparency } RoundCorner { anchors.top: parent.top @@ -472,7 +470,6 @@ Scope { size: Appearance.rounding.screenRounding corner: ConfigOptions.bar.bottom ? cornerEnum.bottomRight : cornerEnum.topRight color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" - opacity: 1.0 - Appearance.transparency } } diff --git a/.config/quickshell/modules/common/widgets/ContentPage.qml b/.config/quickshell/modules/common/widgets/ContentPage.qml index 5862417e0..e965e12f7 100644 --- a/.config/quickshell/modules/common/widgets/ContentPage.qml +++ b/.config/quickshell/modules/common/widgets/ContentPage.qml @@ -6,14 +6,18 @@ import "root:/modules/common/widgets/" Flickable { id: root - property real baseWidth: 400 + property real baseWidth: 500 + property bool forceWidth: false + default property alias data: contentColumn.data clip: true contentHeight: contentColumn.implicitHeight - implicitWidth: Math.max(contentColumn.implicitWidth, baseWidth) + implicitWidth: contentColumn.implicitWidth + ColumnLayout { id: contentColumn + width: root.forceWidth ? root.baseWidth : Math.max(root.baseWidth, implicitWidth) anchors { top: parent.top bottom: parent.bottom diff --git a/.config/quickshell/modules/common/widgets/NotificationItem.qml b/.config/quickshell/modules/common/widgets/NotificationItem.qml index bf8a76871..e078d503d 100644 --- a/.config/quickshell/modules/common/widgets/NotificationItem.qml +++ b/.config/quickshell/modules/common/widgets/NotificationItem.qml @@ -226,12 +226,8 @@ Item { // Notification item area Qt.openUrlExternally(link) Hyprland.dispatch("global quickshell:sidebarRightClose") } - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Only for hover - hoverEnabled: true - cursorShape: parent.hoveredLink !== "" ? Qt.PointingHandCursor : Qt.ArrowCursor - } + + PointingHandLinkHover {} } Flickable { // Notification actions diff --git a/.config/quickshell/modules/common/widgets/PointingHandLinkHover.qml b/.config/quickshell/modules/common/widgets/PointingHandLinkHover.qml new file mode 100644 index 000000000..4d14c8165 --- /dev/null +++ b/.config/quickshell/modules/common/widgets/PointingHandLinkHover.qml @@ -0,0 +1,8 @@ +import QtQuick + +MouseArea { + anchors.fill: parent + acceptedButtons: Qt.NoButton // Only for hover + hoverEnabled: true + cursorShape: parent.hoveredLink !== "" ? Qt.PointingHandCursor : Qt.ArrowCursor +} diff --git a/.config/quickshell/modules/common/widgets/RippleButtonWithIcon.qml b/.config/quickshell/modules/common/widgets/RippleButtonWithIcon.qml index 60d75cd6f..8e5fb6f2d 100644 --- a/.config/quickshell/modules/common/widgets/RippleButtonWithIcon.qml +++ b/.config/quickshell/modules/common/widgets/RippleButtonWithIcon.qml @@ -7,7 +7,8 @@ import "root:/modules/common/widgets/" RippleButton { id: buttonWithIconRoot property string nerdIcon - property string iconText + property string materialIcon + property bool materialIconFill: true property string mainText: "Button text" property Component mainContentComponent: Component { StyledText { @@ -29,10 +30,10 @@ RippleButton { anchors.centerIn: parent active: !nerdIcon sourceComponent: MaterialSymbol { - text: buttonWithIconRoot.iconText + text: buttonWithIconRoot.materialIcon iconSize: Appearance.font.pixelSize.larger color: Appearance.colors.colOnSecondaryContainer - fill: 1 + fill: buttonWithIconRoot.materialIconFill ? 1 : 0 } } Loader { diff --git a/.config/quickshell/modules/settings/About.qml b/.config/quickshell/modules/settings/About.qml index 1d35b71b3..7868c0e7b 100644 --- a/.config/quickshell/modules/settings/About.qml +++ b/.config/quickshell/modules/settings/About.qml @@ -1,13 +1,151 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts +import Quickshell +import Quickshell.Io +import Quickshell.Widgets import "root:/services/" import "root:/modules/common/" import "root:/modules/common/widgets/" ContentPage { - StyledText { - text: qsTr("About page") - font.pixelSize: Appearance.font.pixelSize.larger + forceWidth: true + + ContentSection { + title: "Distro" + + RowLayout { + Layout.alignment: Qt.AlignHCenter + spacing: 20 + Layout.topMargin: 10 + Layout.bottomMargin: 10 + IconImage { + implicitSize: 100 + source: Quickshell.iconPath(SystemInfo.logo) + } + ColumnLayout { + Layout.alignment: Qt.AlignVCenter + // spacing: 10 + StyledText { + text: SystemInfo.distroName + font.pixelSize: Appearance.font.pixelSize.title + } + StyledText { + font.pixelSize: Appearance.font.pixelSize.normal + text: SystemInfo.homeUrl + textFormat: Text.MarkdownText + onLinkActivated: (link) => { + Qt.openUrlExternally(link) + } + PointingHandLinkHover {} + } + } + } + + Flow { + Layout.fillWidth: true + spacing: 5 + + RippleButtonWithIcon { + materialIcon: "auto_stories" + mainText: "Documentation" + onClicked: { + Qt.openUrlExternally(SystemInfo.documentationUrl) + } + } + RippleButtonWithIcon { + materialIcon: "support" + mainText: "Help & Support" + onClicked: { + Qt.openUrlExternally(SystemInfo.supportUrl) + } + } + RippleButtonWithIcon { + materialIcon: "bug_report" + mainText: "Report a Bug" + onClicked: { + Qt.openUrlExternally(SystemInfo.bugReportUrl) + } + } + RippleButtonWithIcon { + materialIcon: "policy" + materialIconFill: false + mainText: "Privacy Policy" + onClicked: { + Qt.openUrlExternally(SystemInfo.privacyPolicyUrl) + } + } + + } + } -} \ No newline at end of file + ContentSection { + title: "Dotfiles" + + RowLayout { + Layout.alignment: Qt.AlignHCenter + spacing: 20 + Layout.topMargin: 10 + Layout.bottomMargin: 10 + MaterialSymbol { + iconSize: 70 + text: "files" + color: Appearance.colors.colOnSecondaryContainer + } + ColumnLayout { + Layout.alignment: Qt.AlignVCenter + // spacing: 10 + StyledText { + text: "illogical-impulse" + font.pixelSize: Appearance.font.pixelSize.title + } + StyledText { + text: "https://github.com/end-4/dots-hyprland" + font.pixelSize: Appearance.font.pixelSize.normal + textFormat: Text.MarkdownText + onLinkActivated: (link) => { + Qt.openUrlExternally(link) + } + PointingHandLinkHover {} + } + } + } + + Flow { + Layout.fillWidth: true + spacing: 5 + + RippleButtonWithIcon { + materialIcon: "auto_stories" + mainText: "Documentation" + onClicked: { + Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/02usage/") + } + } + RippleButtonWithIcon { + materialIcon: "adjust" + materialIconFill: false + mainText: "Issues" + onClicked: { + Qt.openUrlExternally("https://github.com/end-4/dots-hyprland/issues") + } + } + RippleButtonWithIcon { + materialIcon: "forum" + mainText: "Discussions" + onClicked: { + Qt.openUrlExternally("https://github.com/end-4/dots-hyprland/discussions") + } + } + RippleButtonWithIcon { + materialIcon: "favorite" + mainText: "Donate" + onClicked: { + Qt.openUrlExternally("https://github.com/sponsors/end-4") + } + } + + + } + } +} diff --git a/.config/quickshell/modules/settings/Style.qml b/.config/quickshell/modules/settings/Style.qml index 8041f15cb..9357bfb04 100644 --- a/.config/quickshell/modules/settings/Style.qml +++ b/.config/quickshell/modules/settings/Style.qml @@ -43,7 +43,7 @@ ContentPage { id: rndWallBtn Layout.alignment: Qt.AlignHCenter buttonRadius: Appearance.rounding.small - iconText: "wallpaper" + materialIcon: "wallpaper" mainText: konachanWallProc.running ? "Be patient..." : "Random: Konachan" onClicked: { console.log(konachanWallProc.command.join(" ")) @@ -54,7 +54,7 @@ ContentPage { } } RippleButtonWithIcon { - iconText: "wallpaper" + materialIcon: "wallpaper" StyledToolTip { content: "Pick wallpaper image on your system" } diff --git a/.config/quickshell/modules/sidebarLeft/anime/BooruResponse.qml b/.config/quickshell/modules/sidebarLeft/anime/BooruResponse.qml index 7a207582f..ed8896127 100644 --- a/.config/quickshell/modules/sidebarLeft/anime/BooruResponse.qml +++ b/.config/quickshell/modules/sidebarLeft/anime/BooruResponse.qml @@ -162,12 +162,7 @@ Rectangle { Qt.openUrlExternally(link) Hyprland.dispatch("global quickshell:sidebarLeftClose") } - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Only for hover - hoverEnabled: true - cursorShape: parent.hoveredLink !== "" ? Qt.PointingHandCursor : Qt.ArrowCursor - } + PointingHandLinkHover {} } Repeater { diff --git a/.config/quickshell/services/SystemInfo.qml b/.config/quickshell/services/SystemInfo.qml index ffd478b65..cd3d9f383 100644 --- a/.config/quickshell/services/SystemInfo.qml +++ b/.config/quickshell/services/SystemInfo.qml @@ -9,10 +9,17 @@ import Quickshell.Io * Provides some system info: distro, username. */ Singleton { + id: root property string distroName: "Unknown" property string distroId: "unknown" property string distroIcon: "linux-symbolic" property string username: "user" + property string homeUrl: "" + property string documentationUrl: "" + property string supportUrl: "" + property string bugReportUrl: "" + property string privacyPolicyUrl: "" + property string logo: "" Timer { triggeredOnStart: true @@ -33,6 +40,20 @@ Singleton { const logoMatch = textOsRelease.match(/^LOGO=(.+)$/m) distroId = logoMatch ? logoMatch[1].replace(/"/g, "") : "unknown" + // Extract additional URLs and logo + const homeUrlMatch = textOsRelease.match(/^HOME_URL="(.+?)"/m) + homeUrl = homeUrlMatch ? homeUrlMatch[1] : "" + const documentationUrlMatch = textOsRelease.match(/^DOCUMENTATION_URL="(.+?)"/m) + documentationUrl = documentationUrlMatch ? documentationUrlMatch[1] : "" + const supportUrlMatch = textOsRelease.match(/^SUPPORT_URL="(.+?)"/m) + supportUrl = supportUrlMatch ? supportUrlMatch[1] : "" + const bugReportUrlMatch = textOsRelease.match(/^BUG_REPORT_URL="(.+?)"/m) + bugReportUrl = bugReportUrlMatch ? bugReportUrlMatch[1] : "" + const privacyPolicyUrlMatch = textOsRelease.match(/^PRIVACY_POLICY_URL="(.+?)"/m) + privacyPolicyUrl = privacyPolicyUrlMatch ? privacyPolicyUrlMatch[1] : "" + const logoFieldMatch = textOsRelease.match(/^LOGO="?(.+?)"?$/m) + logo = logoFieldMatch ? logoFieldMatch[1] : "" + // Update the distroIcon property based on distroId switch (distroId) { case "arch": distroIcon = "arch-symbolic"; break; @@ -57,7 +78,7 @@ Singleton { command: ["whoami"] stdout: SplitParser { onRead: data => { - username = data.trim() + root.username = data.trim() } } } diff --git a/.config/quickshell/welcome.qml b/.config/quickshell/welcome.qml index 65f620891..4b7286be6 100644 --- a/.config/quickshell/welcome.qml +++ b/.config/quickshell/welcome.qml @@ -138,7 +138,7 @@ ApplicationWindow { id: rndWallBtn Layout.alignment: Qt.AlignHCenter buttonRadius: Appearance.rounding.small - iconText: "wallpaper" + materialIcon: "wallpaper" mainText: konachanWallProc.running ? "Be patient..." : "Random: Konachan" onClicked: { console.log(konachanWallProc.command.join(" ")) @@ -149,7 +149,7 @@ ApplicationWindow { } } RippleButtonWithIcon { - iconText: "wallpaper" + materialIcon: "wallpaper" StyledToolTip { content: "Pick wallpaper image on your system" } @@ -284,10 +284,10 @@ ApplicationWindow { Flow { Layout.fillWidth: true - spacing: 10 + spacing: 5 RippleButtonWithIcon { - iconText: "keyboard_alt" + materialIcon: "keyboard_alt" onClicked: { Hyprland.dispatch("global quickshell:cheatsheetOpen") } @@ -317,14 +317,14 @@ ApplicationWindow { } RippleButtonWithIcon { - iconText: "help" + materialIcon: "help" mainText: "Usage" onClicked: { Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/02usage/") } } RippleButtonWithIcon { - iconText: "construction" + materialIcon: "construction" mainText: "Configuration" onClicked: { Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/03config/") @@ -338,7 +338,7 @@ ApplicationWindow { Flow { Layout.fillWidth: true - spacing: 10 + spacing: 5 RippleButtonWithIcon { nerdIcon: "󰊤" @@ -348,7 +348,7 @@ ApplicationWindow { } } RippleButtonWithIcon { - iconText: "favorite" + materialIcon: "favorite" mainText: "Funny number" onClicked: { Qt.openUrlExternally("https://github.com/sponsors/end-4")