From 8419697542cb150cdaf41f0bdfbe4101470b757d Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Tue, 17 Jun 2025 10:06:23 +0200 Subject: [PATCH] welcome: more buttons --- .config/quickshell/welcome.qml | 138 ++++++++++++++++++++++++++++----- 1 file changed, 117 insertions(+), 21 deletions(-) diff --git a/.config/quickshell/welcome.qml b/.config/quickshell/welcome.qml index dc8559dfd..9d1dcd494 100644 --- a/.config/quickshell/welcome.qml +++ b/.config/quickshell/welcome.qml @@ -25,7 +25,6 @@ ApplicationWindow { property string firstRunFileContent: "This file is just here to confirm you've been greeted :>" property real contentPadding: 5 property bool showNextTime: false - visible: true onClosing: Qt.quit() title: "illogical-impulse Welcome" @@ -58,6 +57,57 @@ ApplicationWindow { } } + component ButtonWithIcon: RippleButton { + id: buttonWithIconRoot + property string nerdIcon + property string iconText + property string mainText: "Button text" + property Component mainContentComponent: Component { + StyledText { + text: buttonWithIconRoot.mainText + font.pixelSize: Appearance.font.pixelSize.small + color: Appearance.colors.colOnSecondaryContainer + } + } + implicitHeight: 35 + horizontalPadding: 15 + buttonRadius: Appearance.rounding.full + colBackground: Appearance.colors.colSecondaryContainer + colBackgroundHover: Appearance.colors.colSecondaryContainerHover + colRipple: Appearance.colors.colSecondaryContainerActive + + contentItem: RowLayout { + Item { + implicitWidth: Math.max(materialIconLoader.implicitWidth, nerdIconLoader.implicitWidth) + Loader { + id: materialIconLoader + anchors.centerIn: parent + active: !nerdIcon + sourceComponent: MaterialSymbol { + text: buttonWithIconRoot.iconText + iconSize: Appearance.font.pixelSize.larger + color: Appearance.colors.colOnSecondaryContainer + } + } + Loader { + id: nerdIconLoader + anchors.centerIn: parent + active: nerdIcon + sourceComponent: StyledText { + text: buttonWithIconRoot.nerdIcon + font.pixelSize: Appearance.font.pixelSize.larger + font.family: Appearance.font.family.iconNerd + color: Appearance.colors.colOnSecondaryContainer + } + } + } + Loader { + sourceComponent: buttonWithIconRoot.mainContentComponent + Layout.alignment: Qt.AlignVCenter + } + } + } + component LightDarkPrefButton: GroupButton { id: lightDarkButtonRoot required property bool dark @@ -259,32 +309,78 @@ ApplicationWindow { Section { title: "Info" - RippleButton { - implicitHeight: 35 - horizontalPadding: 10 - // buttonRadius: Appearance.rounding.full - colBackground: Appearance.colors.colSecondaryContainer - colBackgroundHover: Appearance.colors.colSecondaryContainerHover - colRipple: Appearance.colors.colSecondaryContainerActive + Flow { + Layout.fillWidth: true + spacing: 10 - onClicked: { - Hyprland.dispatch("global quickshell:cheatsheetOpen") + ButtonWithIcon { + iconText: "keyboard_alt" + onClicked: { + Hyprland.dispatch("global quickshell:cheatsheetOpen") + } + mainContentComponent: Component { + RowLayout { + spacing: 10 + StyledText { + font.pixelSize: Appearance.font.pixelSize.small + text: "Open keybind cheatsheet" + color: Appearance.colors.colOnSecondaryContainer + } + RowLayout { + spacing: 3 + KeyboardKey { + key: "󰖳" + } + StyledText { + Layout.alignment: Qt.AlignVCenter + text: "+" + } + KeyboardKey { + key: "/" + } + } + } + } } - contentItem: RowLayout { - KeyboardKey { - key: "󰖳" + ButtonWithIcon { + iconText: "help" + mainText: "Usage" + onClicked: { + Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/02usage/") } - StyledText { - Layout.alignment: Qt.AlignVCenter - text: "+" + } + ButtonWithIcon { + iconText: "construction" + mainText: "Configuration" + onClicked: { + Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/03config/") } - KeyboardKey { - key: "/" + } + } + } + + Section { + title: "Useless buttons" + + Flow { + Layout.fillWidth: true + anchors.left: parent.left + anchors.right: parent.right + spacing: 10 + + ButtonWithIcon { + nerdIcon: "󰊤" + mainText: "GitHub" + onClicked: { + Qt.openUrlExternally("https://github.com/end-4/dots-hyprland") } - StyledText { - text: "Open keybind cheatsheet" - color: Appearance.colors.colOnSecondaryContainer + } + ButtonWithIcon { + iconText: "favorite" + mainText: "Funny number" + onClicked: { + Qt.openUrlExternally("https://github.com/sponsors/end-4") } } }