diff options
| -rw-r--r-- | bar/ActiveWindow.qml | 48 | ||||
| -rw-r--r-- | bar/Bar.qml | 8 | ||||
| -rw-r--r-- | bar/Workspace.qml | 10 |
3 files changed, 34 insertions, 32 deletions
diff --git a/bar/ActiveWindow.qml b/bar/ActiveWindow.qml index bc5ce04..70c9783 100644 --- a/bar/ActiveWindow.qml +++ b/bar/ActiveWindow.qml @@ -11,34 +11,30 @@ Item { property var toplevel: Hyprland.activeToplevel property var icon: Quickshell.iconPath(AppSearch.guessIcon(toplevel?.wayland.appId), "image-missing") - Rectangle { - // use IRect - implicitWidth: rowLayout.implicitWidth + General.rectMargin * 2 - implicitHeight: rowLayout.implicitHeight + General.rectMargin * 2 - anchors.centerIn: parent - color: Colors.alt - radius: Style.rounding.smaller + // use IRect + implicitWidth: rowLayout.implicitWidth + General.rectMargin * 2 + implicitHeight: rowLayout.implicitHeight + General.rectMargin * 2 + anchors.centerIn: parent - RowLayout { - id: rowLayout - anchors.centerIn: parent - spacing: Bar.resourceIconTextSpacing + 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 - } + 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 43dfff8..2f484e7 100644 --- a/bar/Bar.qml +++ b/bar/Bar.qml @@ -74,10 +74,16 @@ Scope { } } - Item { + Rectangle { id: centerRow anchors.centerIn: parent + implicitWidth: activeWindow.implicitWidth + General.rectMargin * 2 + implicitHeight: activeWindow.implicitHeight + + color: Colors.alt + radius: Style.rounding.smaller ActiveWindow { + id: activeWindow anchors.fill: parent } } diff --git a/bar/Workspace.qml b/bar/Workspace.qml index 71bc0df..cf8e482 100644 --- a/bar/Workspace.qml +++ b/bar/Workspace.qml @@ -40,20 +40,20 @@ Item { id: workspaceRect property var st: getWorkspaceStats(index) - implicitWidth: !st?.isActive ? Config.Bar.workspaceIconSize : Config.Bar.workspaceActiveIconSize + implicitWidth: !st.isActive ? Config.Bar.workspaceIconSize : Config.Bar.workspaceActiveIconSize implicitHeight: Config.Bar.workspaceIconSize - Config.Bar.workspaceHorizontalSpacing radius: Config.Bar.workspaceRounding Icons { anchors.centerIn: parent - text: Config.Icons.ws[index + 1] + text: !st.isUrgent ? Config.Icons.ws[index + 1] : Config.Icons.ws['urgent'] // TODO: urgent = red font.pixelSize: Config.Bar.workspaceIconSize / 2 color: Config.Colors.foreground // TODO make IText w/ ts default color - opacity: !st?.isOccupied ? 0 : 1 // less contrast? + opacity: !st.isOccupied ? 0 : 1 // less contrast // opacity: isActive(index) ? Config.Bar.workspaceActiveOpacity : isOccupied(index) ? Config.Bar.workspaceOpacity : Config.Bar.workspaceEmptyOpacity } - color: st?.isOccupied ? Config.Colors.alt : Config.Colors.foreground - opacity: st?.isActive && st?.isOccupied ? Config.Bar.workspaceActiveOpacity : st?.isOccupied ? Config.Bar.workspaceOpacity : Config.Bar.workspaceEmptyOpacity + color: st.isOccupied ? Config.Colors.alt : Config.Colors.foreground + opacity: st.isActive && st.isOccupied ? Config.Bar.workspaceActiveOpacity : st.isOccupied ? Config.Bar.workspaceOpacity : Config.Bar.workspaceEmptyOpacity } } } |
