settings: about page

This commit is contained in:
end-4
2025-06-19 18:58:30 +02:00
parent 0416ddbf3f
commit e8414c88ba
10 changed files with 195 additions and 35 deletions
-3
View File
@@ -456,7 +456,6 @@ Scope {
bottom: ConfigOptions.bar.bottom ? barContent.top : undefined bottom: ConfigOptions.bar.bottom ? barContent.top : undefined
} }
height: Appearance.rounding.screenRounding height: Appearance.rounding.screenRounding
visible: showBarBackground
RoundCorner { RoundCorner {
anchors.top: parent.top anchors.top: parent.top
@@ -464,7 +463,6 @@ Scope {
size: Appearance.rounding.screenRounding size: Appearance.rounding.screenRounding
corner: ConfigOptions.bar.bottom ? cornerEnum.bottomLeft : cornerEnum.topLeft corner: ConfigOptions.bar.bottom ? cornerEnum.bottomLeft : cornerEnum.topLeft
color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" color: showBarBackground ? Appearance.colors.colLayer0 : "transparent"
opacity: 1.0 - Appearance.transparency
} }
RoundCorner { RoundCorner {
anchors.top: parent.top anchors.top: parent.top
@@ -472,7 +470,6 @@ Scope {
size: Appearance.rounding.screenRounding size: Appearance.rounding.screenRounding
corner: ConfigOptions.bar.bottom ? cornerEnum.bottomRight : cornerEnum.topRight corner: ConfigOptions.bar.bottom ? cornerEnum.bottomRight : cornerEnum.topRight
color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" color: showBarBackground ? Appearance.colors.colLayer0 : "transparent"
opacity: 1.0 - Appearance.transparency
} }
} }
@@ -6,14 +6,18 @@ import "root:/modules/common/widgets/"
Flickable { Flickable {
id: root id: root
property real baseWidth: 400 property real baseWidth: 500
property bool forceWidth: false
default property alias data: contentColumn.data default property alias data: contentColumn.data
clip: true clip: true
contentHeight: contentColumn.implicitHeight contentHeight: contentColumn.implicitHeight
implicitWidth: Math.max(contentColumn.implicitWidth, baseWidth) implicitWidth: contentColumn.implicitWidth
ColumnLayout { ColumnLayout {
id: contentColumn id: contentColumn
width: root.forceWidth ? root.baseWidth : Math.max(root.baseWidth, implicitWidth)
anchors { anchors {
top: parent.top top: parent.top
bottom: parent.bottom bottom: parent.bottom
@@ -226,12 +226,8 @@ Item { // Notification item area
Qt.openUrlExternally(link) Qt.openUrlExternally(link)
Hyprland.dispatch("global quickshell:sidebarRightClose") Hyprland.dispatch("global quickshell:sidebarRightClose")
} }
MouseArea {
anchors.fill: parent PointingHandLinkHover {}
acceptedButtons: Qt.NoButton // Only for hover
hoverEnabled: true
cursorShape: parent.hoveredLink !== "" ? Qt.PointingHandCursor : Qt.ArrowCursor
}
} }
Flickable { // Notification actions Flickable { // Notification actions
@@ -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
}
@@ -7,7 +7,8 @@ import "root:/modules/common/widgets/"
RippleButton { RippleButton {
id: buttonWithIconRoot id: buttonWithIconRoot
property string nerdIcon property string nerdIcon
property string iconText property string materialIcon
property bool materialIconFill: true
property string mainText: "Button text" property string mainText: "Button text"
property Component mainContentComponent: Component { property Component mainContentComponent: Component {
StyledText { StyledText {
@@ -29,10 +30,10 @@ RippleButton {
anchors.centerIn: parent anchors.centerIn: parent
active: !nerdIcon active: !nerdIcon
sourceComponent: MaterialSymbol { sourceComponent: MaterialSymbol {
text: buttonWithIconRoot.iconText text: buttonWithIconRoot.materialIcon
iconSize: Appearance.font.pixelSize.larger iconSize: Appearance.font.pixelSize.larger
color: Appearance.colors.colOnSecondaryContainer color: Appearance.colors.colOnSecondaryContainer
fill: 1 fill: buttonWithIconRoot.materialIconFill ? 1 : 0
} }
} }
Loader { Loader {
+142 -4
View File
@@ -1,13 +1,151 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell
import Quickshell.Io
import Quickshell.Widgets
import "root:/services/" import "root:/services/"
import "root:/modules/common/" import "root:/modules/common/"
import "root:/modules/common/widgets/" import "root:/modules/common/widgets/"
ContentPage { ContentPage {
StyledText { forceWidth: true
text: qsTr("About page")
font.pixelSize: Appearance.font.pixelSize.larger 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)
}
}
}
} }
} 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")
}
}
}
}
}
@@ -43,7 +43,7 @@ ContentPage {
id: rndWallBtn id: rndWallBtn
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
buttonRadius: Appearance.rounding.small buttonRadius: Appearance.rounding.small
iconText: "wallpaper" materialIcon: "wallpaper"
mainText: konachanWallProc.running ? "Be patient..." : "Random: Konachan" mainText: konachanWallProc.running ? "Be patient..." : "Random: Konachan"
onClicked: { onClicked: {
console.log(konachanWallProc.command.join(" ")) console.log(konachanWallProc.command.join(" "))
@@ -54,7 +54,7 @@ ContentPage {
} }
} }
RippleButtonWithIcon { RippleButtonWithIcon {
iconText: "wallpaper" materialIcon: "wallpaper"
StyledToolTip { StyledToolTip {
content: "Pick wallpaper image on your system" content: "Pick wallpaper image on your system"
} }
@@ -162,12 +162,7 @@ Rectangle {
Qt.openUrlExternally(link) Qt.openUrlExternally(link)
Hyprland.dispatch("global quickshell:sidebarLeftClose") Hyprland.dispatch("global quickshell:sidebarLeftClose")
} }
MouseArea { PointingHandLinkHover {}
anchors.fill: parent
acceptedButtons: Qt.NoButton // Only for hover
hoverEnabled: true
cursorShape: parent.hoveredLink !== "" ? Qt.PointingHandCursor : Qt.ArrowCursor
}
} }
Repeater { Repeater {
+22 -1
View File
@@ -9,10 +9,17 @@ import Quickshell.Io
* Provides some system info: distro, username. * Provides some system info: distro, username.
*/ */
Singleton { Singleton {
id: root
property string distroName: "Unknown" property string distroName: "Unknown"
property string distroId: "unknown" property string distroId: "unknown"
property string distroIcon: "linux-symbolic" property string distroIcon: "linux-symbolic"
property string username: "user" property string username: "user"
property string homeUrl: ""
property string documentationUrl: ""
property string supportUrl: ""
property string bugReportUrl: ""
property string privacyPolicyUrl: ""
property string logo: ""
Timer { Timer {
triggeredOnStart: true triggeredOnStart: true
@@ -33,6 +40,20 @@ Singleton {
const logoMatch = textOsRelease.match(/^LOGO=(.+)$/m) const logoMatch = textOsRelease.match(/^LOGO=(.+)$/m)
distroId = logoMatch ? logoMatch[1].replace(/"/g, "") : "unknown" 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 // Update the distroIcon property based on distroId
switch (distroId) { switch (distroId) {
case "arch": distroIcon = "arch-symbolic"; break; case "arch": distroIcon = "arch-symbolic"; break;
@@ -57,7 +78,7 @@ Singleton {
command: ["whoami"] command: ["whoami"]
stdout: SplitParser { stdout: SplitParser {
onRead: data => { onRead: data => {
username = data.trim() root.username = data.trim()
} }
} }
} }
+8 -8
View File
@@ -138,7 +138,7 @@ ApplicationWindow {
id: rndWallBtn id: rndWallBtn
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
buttonRadius: Appearance.rounding.small buttonRadius: Appearance.rounding.small
iconText: "wallpaper" materialIcon: "wallpaper"
mainText: konachanWallProc.running ? "Be patient..." : "Random: Konachan" mainText: konachanWallProc.running ? "Be patient..." : "Random: Konachan"
onClicked: { onClicked: {
console.log(konachanWallProc.command.join(" ")) console.log(konachanWallProc.command.join(" "))
@@ -149,7 +149,7 @@ ApplicationWindow {
} }
} }
RippleButtonWithIcon { RippleButtonWithIcon {
iconText: "wallpaper" materialIcon: "wallpaper"
StyledToolTip { StyledToolTip {
content: "Pick wallpaper image on your system" content: "Pick wallpaper image on your system"
} }
@@ -284,10 +284,10 @@ ApplicationWindow {
Flow { Flow {
Layout.fillWidth: true Layout.fillWidth: true
spacing: 10 spacing: 5
RippleButtonWithIcon { RippleButtonWithIcon {
iconText: "keyboard_alt" materialIcon: "keyboard_alt"
onClicked: { onClicked: {
Hyprland.dispatch("global quickshell:cheatsheetOpen") Hyprland.dispatch("global quickshell:cheatsheetOpen")
} }
@@ -317,14 +317,14 @@ ApplicationWindow {
} }
RippleButtonWithIcon { RippleButtonWithIcon {
iconText: "help" materialIcon: "help"
mainText: "Usage" mainText: "Usage"
onClicked: { onClicked: {
Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/02usage/") Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/02usage/")
} }
} }
RippleButtonWithIcon { RippleButtonWithIcon {
iconText: "construction" materialIcon: "construction"
mainText: "Configuration" mainText: "Configuration"
onClicked: { onClicked: {
Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/03config/") Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/03config/")
@@ -338,7 +338,7 @@ ApplicationWindow {
Flow { Flow {
Layout.fillWidth: true Layout.fillWidth: true
spacing: 10 spacing: 5
RippleButtonWithIcon { RippleButtonWithIcon {
nerdIcon: "󰊤" nerdIcon: "󰊤"
@@ -348,7 +348,7 @@ ApplicationWindow {
} }
} }
RippleButtonWithIcon { RippleButtonWithIcon {
iconText: "favorite" materialIcon: "favorite"
mainText: "Funny number" mainText: "Funny number"
onClicked: { onClicked: {
Qt.openUrlExternally("https://github.com/sponsors/end-4") Qt.openUrlExternally("https://github.com/sponsors/end-4")