forked from Shinonome/dots-hyprland
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 QtQuick.Layouts
|
||||||
import Quickshell.Services.UPower
|
import Quickshell.Services.UPower
|
||||||
|
|
||||||
|
import qs
|
||||||
import qs.services as S
|
import qs.services as S
|
||||||
import qs.modules.common as C
|
import qs.modules.common as C
|
||||||
import qs.modules.common.functions as F
|
import qs.modules.common.functions as F
|
||||||
@@ -26,7 +27,7 @@ HBarWidgetWithPopout {
|
|||||||
showPopup: root.showPopup
|
showPopup: root.showPopup
|
||||||
contentImplicitWidth: activeItem.implicitWidth
|
contentImplicitWidth: activeItem.implicitWidth
|
||||||
contentImplicitHeight: activeItem.implicitHeight
|
contentImplicitHeight: activeItem.implicitHeight
|
||||||
// onClicked: root.showPopup = !root.showPopup
|
onClicked: GlobalStates.sidebarRightOpen = !GlobalStates.sidebarRightOpen; // TODO: use own popup
|
||||||
property var activeItem: content
|
property var activeItem: content
|
||||||
|
|
||||||
SystemIndicatorsContent {
|
SystemIndicatorsContent {
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ RippleButton {
|
|||||||
CustomIcon {
|
CustomIcon {
|
||||||
id: distroIcon
|
id: distroIcon
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: 19.5
|
width: 20
|
||||||
height: 19.5
|
height: 20
|
||||||
source: Config.options.bar.topLeftIcon == 'distro' ? SystemInfo.distroIcon : `${Config.options.bar.topLeftIcon}-symbolic`
|
source: Config.options.bar.topLeftIcon == 'distro' ? SystemInfo.distroIcon : `${Config.options.bar.topLeftIcon}-symbolic`
|
||||||
colorize: true
|
colorize: true
|
||||||
color: Appearance.colors.colOnLayer0
|
color: Appearance.colors.colOnLayer0
|
||||||
|
|||||||
Reference in New Issue
Block a user