mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 14:59:27 -05:00
hefty: bar: add "left sidebar" button
for now... i'll probably replace the left sidebar later
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user