From cb5966de0f0c69de0b47a5002c61587e4f9b09c8 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 12 Mar 2026 13:11:04 +0100 Subject: [PATCH] hefty: bar: add "left sidebar" button for now... i'll probably replace the left sidebar later --- .../bar/widgets/HLeftSidebarButton.qml | 76 +++++++++++++++++++ .../bar/widgets/HSystemIndicators.qml | 3 +- .../ii/modules/ii/bar/LeftSidebarButton.qml | 4 +- 3 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HLeftSidebarButton.qml diff --git a/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HLeftSidebarButton.qml b/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HLeftSidebarButton.qml new file mode 100644 index 000000000..bc84e7837 --- /dev/null +++ b/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HLeftSidebarButton.qml @@ -0,0 +1,76 @@ +pragma ComponentBehavior: Bound +import QtQuick + +import qs +import qs.services +import qs.modules.common +import qs.modules.common.widgets +import ".." + +HBarWidgetWithPopout { + id: root + + property bool showPing: false + + Connections { + target: Ai + function onResponseFinished() { + if (GlobalStates.sidebarLeftOpen) return; + root.showPing = true; + } + } + + Connections { + target: Booru + function onResponseFinished() { + if (GlobalStates.sidebarLeftOpen) return; + root.showPing = true; + } + } + + Connections { + target: GlobalStates + function onSidebarLeftOpenChanged() { + root.showPing = false; + } + } + + HBarWidgetContent { + id: contentRoot + vertical: root.vertical + atBottom: root.atBottom + contentImplicitWidth: 14 + contentImplicitHeight: 18 + showPopup: false + onClicked: GlobalStates.sidebarLeftOpen = !GlobalStates.sidebarLeftOpen; + + CustomIcon { + id: distroIcon + anchors.centerIn: parent + width: 20 + height: 20 + source: Config.options.bar.topLeftIcon == 'distro' ? SystemInfo.distroIcon : `${Config.options.bar.topLeftIcon}-symbolic` + colorize: true + color: Appearance.colors.colOnLayer0 + + Rectangle { + opacity: root.showPing ? 1 : 0 + visible: opacity > 0 + anchors { + bottom: parent.bottom + right: parent.right + bottomMargin: -2 + rightMargin: -2 + } + implicitWidth: 8 + implicitHeight: 8 + radius: Appearance.rounding.full + color: Appearance.colors.colTertiary + + Behavior on opacity { + animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this) + } + } + } + } +} diff --git a/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HSystemIndicators.qml b/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HSystemIndicators.qml index 45e834054..eb25c2815 100644 --- a/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HSystemIndicators.qml +++ b/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HSystemIndicators.qml @@ -4,6 +4,7 @@ import QtQuick.Controls import QtQuick.Layouts import Quickshell.Services.UPower +import qs import qs.services as S import qs.modules.common as C import qs.modules.common.functions as F @@ -26,7 +27,7 @@ HBarWidgetWithPopout { showPopup: root.showPopup contentImplicitWidth: activeItem.implicitWidth contentImplicitHeight: activeItem.implicitHeight - // onClicked: root.showPopup = !root.showPopup + onClicked: GlobalStates.sidebarRightOpen = !GlobalStates.sidebarRightOpen; // TODO: use own popup property var activeItem: content SystemIndicatorsContent { diff --git a/dots/.config/quickshell/ii/modules/ii/bar/LeftSidebarButton.qml b/dots/.config/quickshell/ii/modules/ii/bar/LeftSidebarButton.qml index 6c73ca72e..9274703ec 100644 --- a/dots/.config/quickshell/ii/modules/ii/bar/LeftSidebarButton.qml +++ b/dots/.config/quickshell/ii/modules/ii/bar/LeftSidebarButton.qml @@ -55,8 +55,8 @@ RippleButton { CustomIcon { id: distroIcon anchors.centerIn: parent - width: 19.5 - height: 19.5 + width: 20 + height: 20 source: Config.options.bar.topLeftIcon == 'distro' ? SystemInfo.distroIcon : `${Config.options.bar.topLeftIcon}-symbolic` colorize: true color: Appearance.colors.colOnLayer0