diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-07-13 16:40:14 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-07-13 16:40:14 +0800 |
| commit | 8127908623a6f1737537a7b53d479bf9039a4afd (patch) | |
| tree | 739df679343db82aeb8c06445a286ebc3f20965a | |
| parent | f5462c3274d008c1bb509cfac4eab8492d822cf5 (diff) | |
margin implicit width not cool
| -rw-r--r-- | bar/Bar.qml | 6 | ||||
| -rw-r--r-- | bar/Workspace.qml | 23 | ||||
| -rw-r--r-- | config/Icons.qml | 2 | ||||
| -rw-r--r-- | config/WallustColors.qml | 38 |
4 files changed, 42 insertions, 27 deletions
diff --git a/bar/Bar.qml b/bar/Bar.qml index a18ad06..3428b06 100644 --- a/bar/Bar.qml +++ b/bar/Bar.qml @@ -11,6 +11,7 @@ Scope { model: Quickshell.screens IWindow { + id: barWindow name: "Bar" anchors { @@ -43,7 +44,7 @@ Scope { anchors { left: parent.left } - implicitWidth: workspace.width + mpris.width + implicitWidth: workspace.width + leftRow.anchors.leftMargin + mpris.width implicitHeight: leftRow.height color: Qt.rgba(Colors.r, Colors.g, Colors.b, Bar.bgTransparency) radius: Bar.moduleRadius @@ -58,7 +59,8 @@ Scope { Workspace { id: workspace - Layout.minimumWidth: 400 // FIXME + // screen: barWindow.screen // multi monitor + // Layout.minimumWidth: 400 // FIXME } Mpris { id: mpris diff --git a/bar/Workspace.qml b/bar/Workspace.qml index 6155bb5..27acf03 100644 --- a/bar/Workspace.qml +++ b/bar/Workspace.qml @@ -2,12 +2,16 @@ import QtQuick.Layouts import QtQuick import Quickshell import Quickshell.Hyprland +import Quickshell.Wayland import qs.config as Config import qs.components Item { id: root + // required property ShellScreen screen // multi monitor + + // readonly property HyprlandMonitor monitor: Hyprland.monitorFor(screen) // multi monitor property list<bool> workspaceOccupied: [] function updateWorkspaceOccupied() { @@ -23,11 +27,20 @@ Item { // dont work no more for some reason function isActive(index: int): bool { return Hyprland.focusedWorkspace?.id === (index + 1); + // return monitor.activeWorkspace.id === (index + 1); // multi monitor } function isOccupied(index: int): bool { return workspaceOccupied[index] === true; } + // TODO: allow specific index after tl can do that + // function isEmpty(): bool { + // for (let i of ToplevelManager.toplevels.values) + // if (i.activated) + // return false; + // return true; + // } + Connections { target: Hyprland.workspaces function onValuesChanged() { @@ -37,6 +50,8 @@ Item { Component.onCompleted: updateWorkspaceOccupied() + implicitWidth: layout.implicitWidth + RowLayout { id: layout implicitWidth: childrenRect.width @@ -54,18 +69,16 @@ Item { implicitWidth: !isActive(index) ? Config.Bar.workspaceIconSize : Config.Bar.workspaceActiveIconSize implicitHeight: Config.Bar.workspaceIconSize - 10 - anchors { - topMargin: 20 - } radius: Config.Bar.workspaceRounding Icons { anchors.centerIn: parent text: Config.Icons.ws[index + 1] font.pixelSize: Config.Bar.workspaceIconSize / 1.9 color: Config.Colors.foreground // TODO make IText w/ ts default color - // opacity: !isOccupied(index) ? 0 : 1 // less contrast - opacity: isActive(index) ? Config.Bar.workspaceActiveOpacity : isOccupied(index) ? Config.Bar.workspaceOpacity : Config.Bar.workspaceEmptyOpacity + opacity: !isOccupied(index) ? 0 : 1 // less contrast + // opacity: isActive(index) ? Config.Bar.workspaceActiveOpacity : isOccupied(index) ? Config.Bar.workspaceOpacity : Config.Bar.workspaceEmptyOpacity } + color: isOccupied(index) ? Config.Colors.alt : Config.Colors.foreground opacity: isActive(index) ? Config.Bar.workspaceActiveOpacity : isOccupied(index) ? Config.Bar.workspaceOpacity : Config.Bar.workspaceEmptyOpacity } diff --git a/config/Icons.qml b/config/Icons.qml index 9720463..7f0dcf4 100644 --- a/config/Icons.qml +++ b/config/Icons.qml @@ -15,7 +15,7 @@ Singleton { 7: "", 8: "", 9: "", - 10: "", + 10: "", urgent: "", active: "", default: " " diff --git a/config/WallustColors.qml b/config/WallustColors.qml index 3419969..79a51b4 100644 --- a/config/WallustColors.qml +++ b/config/WallustColors.qml @@ -4,23 +4,23 @@ import Quickshell import QtQuick Singleton { - property color foreground: "#FBF7DA" - property color background: "#110E17" - property color cursor: "#AFAC98" - property color color0: "#39373F" - property color color1: "#93350C" - property color color2: "#646156" - property color color3: Qt.rgba(148,125,188,0.25) - property color color4: Qt.rgba(209,168,183,0.25) - property color color5: "#D0D4C3" - property color color6: "#F4E994" - property color color7: "#F1ECC1" - property color color8: "#A9A587" - property color color9: "#93350C" - property color color10: "#646156" - property color color11: "#947DBC" - property color color12: "#D1A8B7" - property color color13: "#D0D4C3" - property color color14: "#F4E994" - property color color15: "#F1ECC1" + property color foreground: "#E9CDD3" + property color background: "#382931" + property color cursor: "#B7839F" + property color color0: "#5E4E56" + property color color1: "#6C1564" + property color color2: "#85386C" + property color color3: Qt.rgba(155,58,102,0.25) + property color color4: Qt.rgba(140,71,133,0.25) + property color color5: "#A44265" + property color color6: "#C07081" + property color color7: "#D7AFB8" + property color color8: "#977A80" + property color color9: "#6C1564" + property color color10: "#85386C" + property color color11: "#9B3A66" + property color color12: "#8C4785" + property color color13: "#A44265" + property color color14: "#C07081" + property color color15: "#D7AFB8" } |
