diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-07-13 17:16:14 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-07-13 17:16:14 +0800 |
| commit | b520eb490c7b99659bdb685995e5ad4a3507cbb3 (patch) | |
| tree | bc11bb0a8c48df3347cbb4766851aa6d92dc971a | |
| parent | 8127908623a6f1737537a7b53d479bf9039a4afd (diff) | |
workspace more fix + activewindow]
| -rw-r--r-- | bar/ActiveWindow.qml | 40 | ||||
| -rw-r--r-- | bar/Bar.qml | 6 | ||||
| -rw-r--r-- | bar/Mpris.qml | 21 | ||||
| -rw-r--r-- | bar/Workspace.qml | 4 | ||||
| -rw-r--r-- | config/Bar.qml | 14 | ||||
| -rw-r--r-- | config/General.qml | 4 | ||||
| -rw-r--r-- | config/Style.qml | 1 | ||||
| -rw-r--r-- | config/WallustColors.qml | 38 |
8 files changed, 84 insertions, 44 deletions
diff --git a/bar/ActiveWindow.qml b/bar/ActiveWindow.qml index 25e87e2..915ee25 100644 --- a/bar/ActiveWindow.qml +++ b/bar/ActiveWindow.qml @@ -11,22 +11,34 @@ Item { property var toplevel: ToplevelManager.activeToplevel property var icon: Quickshell.iconPath(AppSearch.guessIcon(toplevel?.appId), "image-missing") - RowLayout { + Rectangle { + // use IRect + implicitWidth: rowLayout.implicitWidth + General.rectMargin * 2 + implicitHeight: rowLayout.implicitHeight + General.rectMargin * 2 anchors.centerIn: parent - spacing: Bar.resourceIconTextSpacing + color: Colors.alt + radius: Style.rounding.smaller - anchors.verticalCenter: parent.verticalCenter - IconImage { - source: root.icon - implicitWidth: Bar.appIconSize - implicitHeight: Bar.appIconSize - Layout.fillHeight: true - Layout.fillWidth: false - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - } - Text { - // TOOD: if not exist, use lazyloader or something hide this - text: root.toplevel?.title + RowLayout { + id: rowLayout + anchors.centerIn: parent + spacing: Bar.resourceIconTextSpacing + + anchors.verticalCenter: parent.verticalCenter + IconImage { + source: root.icon + implicitWidth: Bar.appIconSize + implicitHeight: Bar.appIconSize + Layout.fillHeight: true + Layout.fillWidth: false + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + } + Text { + // TOOD: if not exist, use lazyloader or something hide this + // TODO: use IText + font.pixelSize: General.fontSize + text: root.toplevel?.title + } } } } diff --git a/bar/Bar.qml b/bar/Bar.qml index 3428b06..6ec1670 100644 --- a/bar/Bar.qml +++ b/bar/Bar.qml @@ -44,7 +44,7 @@ Scope { anchors { left: parent.left } - implicitWidth: workspace.width + leftRow.anchors.leftMargin + mpris.width + implicitWidth: workspace.width + leftRow.anchors.leftMargin + leftRow.anchors.rightMargin + leftRow.spacing + mpris.width implicitHeight: leftRow.height color: Qt.rgba(Colors.r, Colors.g, Colors.b, Bar.bgTransparency) radius: Bar.moduleRadius @@ -53,9 +53,11 @@ Scope { RowLayout { id: leftRow anchors.left: parent.left - anchors.leftMargin: 20 + anchors.leftMargin: Bar.moduleLeftMargin + anchors.rightMargin: Bar.moduleRightMargin // does nothing but more consistent code style (as leftRow's right is middle but leftRow will never reach middle) implicitWidth: (child.width - centerRow.width) / 2 implicitHeight: child.height + spacing: Bar.leftModuleSpacing Workspace { id: workspace diff --git a/bar/Mpris.qml b/bar/Mpris.qml index 8d56335..5abd2d4 100644 --- a/bar/Mpris.qml +++ b/bar/Mpris.qml @@ -46,10 +46,27 @@ Item { } } - Text { + implicitWidth: rect.width + 3 // +3 cause it look better somehow + + // TODO fancy animation progress bar etc. + Rectangle { + id: rect anchors.verticalCenter: parent.verticalCenter - text: root.state + " " + root.cleanedTitle + " [" + root.progress + "]" + // TODO: move to IRect + implicitWidth: text.width + General.rectMargin * 2 + implicitHeight: parent.height + color: Colors.alt + radius: Style.rounding.smaller + Text { + id: text + // TODO: use IText + font.pixelSize: General.fontSize + anchors.centerIn: parent + anchors.verticalCenter: parent.verticalCenter + text: root.state + " " + root.cleanedTitle + " [" + root.progress + "]" + } } + // hover // Text { // text: root.activePlayer.trackTitle + " by " + root.activePlayer.trackArtist + " - " + root.activePlayer.trackAlbum + root.activePlayer.position + "/" + root.activePlayer.length diff --git a/bar/Workspace.qml b/bar/Workspace.qml index 27acf03..d9e1c0a 100644 --- a/bar/Workspace.qml +++ b/bar/Workspace.qml @@ -68,12 +68,12 @@ Item { // text: isActive(index) implicitWidth: !isActive(index) ? Config.Bar.workspaceIconSize : Config.Bar.workspaceActiveIconSize - implicitHeight: Config.Bar.workspaceIconSize - 10 + implicitHeight: Config.Bar.workspaceIconSize - Config.Bar.workspaceHorizontalSpacing radius: Config.Bar.workspaceRounding Icons { anchors.centerIn: parent text: Config.Icons.ws[index + 1] - font.pixelSize: Config.Bar.workspaceIconSize / 1.9 + font.pixelSize: Config.Bar.workspaceIconSize / 2 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 diff --git a/config/Bar.qml b/config/Bar.qml index 58629be..7e0ef9a 100644 --- a/config/Bar.qml +++ b/config/Bar.qml @@ -5,24 +5,28 @@ import Quickshell Singleton { id: root - readonly property int height: 35 + readonly property int height: 40 readonly property int borderRadius: Style.rounding.small readonly property int topMargin: Style.spacing.small readonly property int leftMargin: Style.spacing.larger readonly property int rightMargin: Style.spacing.larger - readonly property int innerLeftMargin: Style.spacing.small + + readonly property int moduleLeftMargin: Style.spacing.large + readonly property int moduleRightMargin: 0 + + readonly property int leftModuleSpacing: Style.spacing.smaller readonly property int workspaces: 10 - readonly property int workspaceIconSize: 32 + readonly property int workspaceIconSize: 34 readonly property int workspaceSpacing: 2 - readonly property int workspaceHorizontalSpacing: Style.spacing.small + readonly property int workspaceHorizontalSpacing: Style.spacing.smaller readonly property int workspaceActiveIconSize: workspaceIconSize * 1.5 readonly property int workspaceRounding: Style.rounding.small readonly property double workspaceOpacity: 0.8 readonly property int workspaceActiveOpacity: 1 readonly property double workspaceEmptyOpacity: 0.2 - readonly property int appIconSize: 32 + readonly property int appIconSize: 25 readonly property int resourceIconTextSpacing: Style.spacing.small diff --git a/config/General.qml b/config/General.qml index 2b71635..f66d5d5 100644 --- a/config/General.qml +++ b/config/General.qml @@ -12,4 +12,8 @@ Singleton { readonly property real iconSize: Style.font.size.small ?? 16 readonly property string cpuThermalPath: "/sys/class/thermal/thermal_zone0/temp" + + readonly property int rectMargin: Style.spacing.small + + readonly property int fontSize: Style.font.size.larger } diff --git a/config/Style.qml b/config/Style.qml index dc2a0ca..1a15305 100644 --- a/config/Style.qml +++ b/config/Style.qml @@ -13,6 +13,7 @@ Singleton { readonly property Anim anim: Anim {} component Rounding: QtObject { + readonly property int smaller: 10 readonly property int small: 12 readonly property int normal: 17 readonly property int large: 25 diff --git a/config/WallustColors.qml b/config/WallustColors.qml index 79a51b4..890f360 100644 --- a/config/WallustColors.qml +++ b/config/WallustColors.qml @@ -4,23 +4,23 @@ import Quickshell import QtQuick Singleton { - 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" + property color foreground: "#F8E4DE" + property color background: "#24242C" + property color cursor: "#BB968E" + property color color0: "#4A4A53" + property color color1: "#4A4A1F" + property color color2: "#7D493E" + property color color3: Qt.rgba(78,93,57,0.25) + property color color4: Qt.rgba(180,149,109,0.25) + property color color5: "#ABA67E" + property color color6: "#EBB3A2" + property color color7: "#EDD0C8" + property color color8: "#A6928C" + property color color9: "#4A4A1F" + property color color10: "#7D493E" + property color color11: "#4E5D39" + property color color12: "#B4956D" + property color color13: "#ABA67E" + property color color14: "#EBB3A2" + property color color15: "#EDD0C8" } |
