diff options
Diffstat (limited to 'modules/bar')
| -rw-r--r-- | modules/bar/Bar.qml | 4 | ||||
| -rw-r--r-- | modules/bar/components/Settings.qml | 41 | ||||
| -rw-r--r-- | modules/bar/components/SettingsIcon.qml | 41 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/OccupiedBg.qml | 103 | ||||
| -rw-r--r-- | modules/bar/popouts/Audio.qml | 13 | ||||
| -rw-r--r-- | modules/bar/popouts/Background.qml | 2 | ||||
| -rw-r--r-- | modules/bar/popouts/Bluetooth.qml | 13 | ||||
| -rw-r--r-- | modules/bar/popouts/Content.qml | 5 | ||||
| -rw-r--r-- | modules/bar/popouts/LockStatus.qml | 16 | ||||
| -rw-r--r-- | modules/bar/popouts/Wrapper.qml | 56 | ||||
| -rw-r--r-- | modules/bar/popouts/kblayout/KbLayoutModel.qml | 2 |
11 files changed, 3 insertions, 293 deletions
diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 95c166e..550fbeb 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -68,10 +68,6 @@ ColumnLayout { popouts.hasCurrent = false; item.expanded = true; } - } else if (id === "activeWindow" && Config.bar.popouts.activeWindow && Config.bar.activeWindow.showOnHover) { - popouts.currentName = id.toLowerCase(); - popouts.currentCenter = item.mapToItem(root, 0, itemHeight / 2).y; - popouts.hasCurrent = true; } } diff --git a/modules/bar/components/Settings.qml b/modules/bar/components/Settings.qml deleted file mode 100644 index 5d562ce..0000000 --- a/modules/bar/components/Settings.qml +++ /dev/null @@ -1,41 +0,0 @@ -import qs.components -import qs.modules.controlcenter -import qs.services -import qs.config -import Quickshell -import QtQuick - -Item { - id: root - - implicitWidth: icon.implicitHeight + Appearance.padding.small * 2 - implicitHeight: icon.implicitHeight - - StateLayer { - // Cursed workaround to make the height larger than the parent - anchors.fill: undefined - anchors.centerIn: parent - implicitWidth: implicitHeight - implicitHeight: icon.implicitHeight + Appearance.padding.small * 2 - - radius: Appearance.rounding.full - - function onClicked(): void { - WindowFactory.create(null, { - active: "network" - }); - } - } - - MaterialIcon { - id: icon - - anchors.centerIn: parent - anchors.horizontalCenterOffset: -1 - - text: "settings" - color: Colours.palette.m3onSurface - font.bold: true - font.pointSize: Appearance.font.size.normal - } -} diff --git a/modules/bar/components/SettingsIcon.qml b/modules/bar/components/SettingsIcon.qml deleted file mode 100644 index 5d562ce..0000000 --- a/modules/bar/components/SettingsIcon.qml +++ /dev/null @@ -1,41 +0,0 @@ -import qs.components -import qs.modules.controlcenter -import qs.services -import qs.config -import Quickshell -import QtQuick - -Item { - id: root - - implicitWidth: icon.implicitHeight + Appearance.padding.small * 2 - implicitHeight: icon.implicitHeight - - StateLayer { - // Cursed workaround to make the height larger than the parent - anchors.fill: undefined - anchors.centerIn: parent - implicitWidth: implicitHeight - implicitHeight: icon.implicitHeight + Appearance.padding.small * 2 - - radius: Appearance.rounding.full - - function onClicked(): void { - WindowFactory.create(null, { - active: "network" - }); - } - } - - MaterialIcon { - id: icon - - anchors.centerIn: parent - anchors.horizontalCenterOffset: -1 - - text: "settings" - color: Colours.palette.m3onSurface - font.bold: true - font.pointSize: Appearance.font.size.normal - } -} diff --git a/modules/bar/components/workspaces/OccupiedBg.qml b/modules/bar/components/workspaces/OccupiedBg.qml deleted file mode 100644 index 56b215e..0000000 --- a/modules/bar/components/workspaces/OccupiedBg.qml +++ /dev/null @@ -1,103 +0,0 @@ -pragma ComponentBehavior: Bound - -import qs.components -import qs.services -import qs.config -import Quickshell -import QtQuick - -Item { - id: root - - required property Repeater workspaces - required property var occupied - required property int groupOffset - - property list<var> pills: [] - - onOccupiedChanged: { - if (!occupied) - return; - let count = 0; - const start = groupOffset; - const end = start + Config.bar.workspaces.shown; - for (const [ws, occ] of Object.entries(occupied)) { - if (ws > start && ws <= end && occ) { - const isFirstInGroup = Number(ws) === start + 1; - const isLastInGroup = Number(ws) === end; - if (isFirstInGroup || !occupied[ws - 1]) { - if (pills[count]) - pills[count].start = ws; - else - pills.push(pillComp.createObject(root, { - start: ws - })); - count++; - } - if ((isLastInGroup || !occupied[ws + 1]) && pills[count - 1]) - pills[count - 1].end = ws; - } - } - if (pills.length > count) - pills.splice(count, pills.length - count).forEach(p => p.destroy()); - } - - Repeater { - model: ScriptModel { - values: root.pills.filter(p => p) - } - - StyledRect { - id: rect - - required property var modelData - - readonly property Workspace start: root.workspaces.count > 0 ? root.workspaces.itemAt(getWsIdx(modelData.start)) ?? null : null - readonly property Workspace end: root.workspaces.count > 0 ? root.workspaces.itemAt(getWsIdx(modelData.end)) ?? null : null - - function getWsIdx(ws: int): int { - let i = ws - 1; - while (i < 0) - i += Config.bar.workspaces.shown; - return i % Config.bar.workspaces.shown; - } - - anchors.horizontalCenter: root.horizontalCenter - - y: (start?.y ?? 0) - 1 - implicitWidth: Config.bar.sizes.innerWidth - Appearance.padding.small * 2 + 2 - implicitHeight: start && end ? end.y + end.size - start.y + 2 : 0 - - color: Colours.layer(Colours.palette.m3surfaceContainerHigh, 2) - radius: Appearance.rounding.full - - scale: 0 - Component.onCompleted: scale = 1 - - Behavior on scale { - Anim { - easing.bezierCurve: Appearance.anim.curves.standardDecel - } - } - - Behavior on y { - Anim {} - } - - Behavior on implicitHeight { - Anim {} - } - } - } - - component Pill: QtObject { - property int start - property int end - } - - Component { - id: pillComp - - Pill {} - } -} diff --git a/modules/bar/popouts/Audio.qml b/modules/bar/popouts/Audio.qml index 58b29ba..2bfb1c7 100644 --- a/modules/bar/popouts/Audio.qml +++ b/modules/bar/popouts/Audio.qml @@ -9,7 +9,6 @@ import Quickshell.Services.Pipewire import QtQuick import QtQuick.Layouts import QtQuick.Controls -import "../../controlcenter/network" Item { id: root @@ -104,17 +103,5 @@ Item { } } } - - IconTextButton { - Layout.fillWidth: true - Layout.topMargin: Appearance.spacing.normal - inactiveColour: Colours.palette.m3primaryContainer - inactiveOnColour: Colours.palette.m3onPrimaryContainer - verticalPadding: Appearance.padding.small - text: qsTr("Open settings") - icon: "settings" - - onClicked: root.wrapper.detach("audio") - } } } diff --git a/modules/bar/popouts/Background.qml b/modules/bar/popouts/Background.qml index 075b698..983650c 100644 --- a/modules/bar/popouts/Background.qml +++ b/modules/bar/popouts/Background.qml @@ -9,7 +9,7 @@ ShapePath { required property Wrapper wrapper required property bool invertBottomRounding - readonly property real rounding: wrapper.isDetached ? Appearance.rounding.normal : Config.border.rounding + readonly property real rounding: Config.border.rounding readonly property bool flatten: wrapper.width < rounding * 2 readonly property real roundingX: flatten ? wrapper.width / 2 : rounding property real ibr: invertBottomRounding ? -1 : 1 diff --git a/modules/bar/popouts/Bluetooth.qml b/modules/bar/popouts/Bluetooth.qml index 676da82..151891f 100644 --- a/modules/bar/popouts/Bluetooth.qml +++ b/modules/bar/popouts/Bluetooth.qml @@ -9,7 +9,6 @@ import Quickshell import Quickshell.Bluetooth import QtQuick import QtQuick.Layouts -import "../../controlcenter/network" ColumnLayout { id: root @@ -164,18 +163,6 @@ ColumnLayout { } } - IconTextButton { - Layout.fillWidth: true - Layout.topMargin: Appearance.spacing.normal - inactiveColour: Colours.palette.m3primaryContainer - inactiveOnColour: Colours.palette.m3onPrimaryContainer - verticalPadding: Appearance.padding.small - text: qsTr("Open settings") - icon: "settings" - - onClicked: root.wrapper.detach("bluetooth") - } - component Toggle: RowLayout { required property string label property alias checked: toggle.checked diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml index 779cc5f..6bcc9f7 100644 --- a/modules/bar/popouts/Content.qml +++ b/modules/bar/popouts/Content.qml @@ -114,11 +114,6 @@ Item { } } - Popout { - name: "lockstatus" - sourceComponent: LockStatus {} - } - Repeater { model: ScriptModel { values: SystemTray.items.values.filter(i => !Config.bar.tray.hiddenIcons.includes(i.id)) diff --git a/modules/bar/popouts/LockStatus.qml b/modules/bar/popouts/LockStatus.qml deleted file mode 100644 index 7d74530..0000000 --- a/modules/bar/popouts/LockStatus.qml +++ /dev/null @@ -1,16 +0,0 @@ -import qs.components -import qs.services -import qs.config -import QtQuick.Layouts - -ColumnLayout { - spacing: Appearance.spacing.small - - StyledText { - text: qsTr("Capslock: %1").arg(Hypr.capsLock ? "Enabled" : "Disabled") - } - - StyledText { - text: qsTr("Numlock: %1").arg(Hypr.numLock ? "Enabled" : "Disabled") - } -} diff --git a/modules/bar/popouts/Wrapper.qml b/modules/bar/popouts/Wrapper.qml index 05a1d3c..73a7556 100644 --- a/modules/bar/popouts/Wrapper.qml +++ b/modules/bar/popouts/Wrapper.qml @@ -3,8 +3,6 @@ pragma ComponentBehavior: Bound import qs.components import qs.services import qs.config -import qs.modules.windowinfo -import qs.modules.controlcenter import Quickshell import Quickshell.Wayland import Quickshell.Hyprland @@ -23,29 +21,15 @@ Item { property real currentCenter property bool hasCurrent - property string detachedMode property string queuedMode - readonly property bool isDetached: detachedMode.length > 0 property int animLength: Appearance.anim.durations.normal property list<real> animCurve: Appearance.anim.curves.emphasized - function detach(mode: string): void { - animLength = Appearance.anim.durations.large; - if (mode === "winfo") { - detachedMode = mode; - } else { - queuedMode = mode; - detachedMode = "any"; - } - focus = true; - } - function close(): void { hasCurrent = false; animCurve = Appearance.anim.curves.emphasizedAccel; animLength = Appearance.anim.durations.normal; - detachedMode = ""; animCurve = Appearance.anim.curves.emphasized; } @@ -75,20 +59,6 @@ Item { } } - HyprlandFocusGrab { - active: root.isDetached - windows: [QsWindow.window] - onCleared: root.close() - } - - Binding { - when: root.isDetached - - target: QsWindow.window - property: "WlrLayershell.keyboardFocus" - value: WlrKeyboardFocus.OnDemand - } - Binding { when: root.hasCurrent && root.currentName === "wirelesspassword" @@ -100,7 +70,7 @@ Item { Comp { id: content - shouldBeActive: root.hasCurrent && !root.detachedMode + shouldBeActive: root.hasCurrent anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter @@ -109,30 +79,6 @@ Item { } } - Comp { - shouldBeActive: root.detachedMode === "winfo" - anchors.centerIn: parent - - sourceComponent: WindowInfo { - screen: root.screen - client: Hypr.activeToplevel - } - } - - Comp { - shouldBeActive: root.detachedMode === "any" - anchors.centerIn: parent - - sourceComponent: ControlCenter { - screen: root.screen - active: root.queuedMode - - function close(): void { - root.close(); - } - } - } - Behavior on x { Anim { duration: root.animLength diff --git a/modules/bar/popouts/kblayout/KbLayoutModel.qml b/modules/bar/popouts/kblayout/KbLayoutModel.qml index 4371095..d1845af 100644 --- a/modules/bar/popouts/kblayout/KbLayoutModel.qml +++ b/modules/bar/popouts/kblayout/KbLayoutModel.qml @@ -199,7 +199,7 @@ Item { arr = arr.filter(i => i.layoutIndex !== activeIndex); arr.forEach(i => _visibleModel.append(i)); - if (!Config.utilities.toasts.kbLimit) + if (!Config.toasts.kbLimit) return; if (_layoutsModel.count > 4) { |