small component patches + code cleanup

This commit is contained in:
SomeElse
2026-05-17 22:30:27 +00:00
parent 262fd8afa0
commit 6db876fc8a
21 changed files with 469 additions and 465 deletions

View File

@@ -8,25 +8,17 @@ import Quickshell.Widgets
import "../../config" as Cfg
import "../../components"
Item {
ModuleChip {
id: root
property real panelRadius: Cfg.Config.radius / 2
property int borderWidth: Cfg.Config.panelBorderWidth
property var targetScreen: null
property string barSide: "right"
property bool isTop: true
readonly property var t: Cfg.Config.theme
property string barSide: "right"
property bool expanded: false
property bool manuallyExpanded: false
readonly property bool effectiveExpanded: expanded || trayMenuPopup.popupOpen
implicitWidth: bgRect.width
implicitHeight: bgRect.height
implicitWidth: mainRow.width
implicitHeight: Cfg.Config.barHeight
readonly property color tmBg: t.trayMenuBg
readonly property color tmBorder: t.trayMenuBorder
@@ -36,47 +28,37 @@ Item {
readonly property color tmCheck: t.trayMenuCheck
readonly property color tmSeparator: t.trayMenuSeparator
Rectangle {
id: bgRect
anchors.verticalCenter: parent.verticalCenter
chipColor: t.trayBg
chipColorHovered: t.trayBgHover
chipBorderColor: t.trayBorder
chipBorderColorHovered: t.trayBorderHover
popupOpen: trayMenuPopup.popupOpen
height: parent.height
width: mainRow.width
radius: root.panelRadius
color: bgHover.hovered ? root.t.trayBgHover : root.t.trayBg
border.color: bgHover.hovered ? root.t.trayBorderHover : root.t.trayBorder
border.width: root.borderWidth
Behavior on color { ColorAnimation { duration: 150 } }
Behavior on border.color { ColorAnimation { duration: 150 } }
HoverHandler {
id: bgHover
onHoveredChanged: {
if (!root.manuallyExpanded) {
root.expanded = hovered;
}
HoverHandler {
onHoveredChanged: {
if (!root.manuallyExpanded) {
root.expanded = hovered;
}
}
}
Row {
id: mainRow
anchors.verticalCenter: parent.verticalCenter
Row {
id: mainRow
anchors.verticalCenter: parent.verticalCenter
leftPadding: root.effectiveExpanded && root.barSide === "right" ? 8 : 0
rightPadding: root.effectiveExpanded && root.barSide === "left" ? 8 : 0
leftPadding: root.effectiveExpanded && root.barSide === "right" ? 8 : 0
rightPadding: root.effectiveExpanded && root.barSide === "left" ? 8 : 0
Behavior on leftPadding { NumberAnimation { duration: 200; easing.type: Easing.OutCubic } }
Behavior on rightPadding { NumberAnimation { duration: 200; easing.type: Easing.OutCubic } }
Behavior on leftPadding { NumberAnimation { duration: 200; easing.type: Easing.OutCubic } }
Behavior on rightPadding { NumberAnimation { duration: 200; easing.type: Easing.OutCubic } }
layoutDirection: root.barSide === "left" ? Qt.LeftToRight : Qt.RightToLeft
spacing: root.effectiveExpanded ? 4 : 0
layoutDirection: root.barSide === "left" ? Qt.LeftToRight : Qt.RightToLeft
spacing: root.effectiveExpanded ? 4 : 0
Behavior on spacing { NumberAnimation { duration: 180; easing.type: Easing.OutCubic } }
Behavior on spacing { NumberAnimation { duration: 180; easing.type: Easing.OutCubic } }
Item {
id: toggleArea
Item {
id: toggleArea
width: Cfg.Config.trayToggleSize
height: Cfg.Config.trayToggleSize
z: 10
@@ -149,8 +131,8 @@ Item {
}
}
}
}
}
}