replace wraperRectangle with normal rectangle

This commit is contained in:
lucy 2026-05-17 14:48:09 +02:00
commit a62d313b29
9 changed files with 77 additions and 38 deletions

View file

@ -6,13 +6,16 @@ import qs
import qs.widgets import qs.widgets
import qs.settings import qs.settings
ClippingWrapperRectangle { Rectangle {
id: root id: root
required property double moduleHeight
implicitHeight: moduleHeight
implicitWidth: titleLayout.width + 32
color: Colors.base01 color: Colors.base01
radius: Config.rounding radius: Config.rounding
leftMargin: 8 RowLayout {
rightMargin: 8 id: titleLayout
child: RowLayout { anchors.centerIn: root
WrapperRectangle { WrapperRectangle {
Layout.maximumWidth: 400 Layout.maximumWidth: 400
color: 'transparent' color: 'transparent'

View file

@ -11,6 +11,7 @@ Variants {
delegate: WlrLayershell { delegate: WlrLayershell {
id: root id: root
required property var modelData required property var modelData
property double moduleHeight: implicitHeight - 8
screen: modelData screen: modelData
anchors { anchors {
top: true top: true
@ -28,16 +29,21 @@ Variants {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 10 anchors.leftMargin: 10
Ws { Ws {
moduleHeight: root.moduleHeight
barScreen: root.modelData barScreen: root.modelData
} }
ActiveWindow {} ActiveWindow {
moduleHeight: root.moduleHeight
}
} }
RowLayout { RowLayout {
id: centerLayout id: centerLayout
anchors.centerIn: parent anchors.centerIn: parent
spacing: 5 spacing: 5
Clock {} Clock {
moduleHeight: root.moduleHeight
}
} }
RowLayout { RowLayout {
@ -46,10 +52,18 @@ Variants {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: 5 spacing: 5
anchors.rightMargin: 10 anchors.rightMargin: 10
Mpris {} Mpris {
Bat {} moduleHeight: root.moduleHeight
Pw {} }
Tray {} Bat {
moduleHeight: root.moduleHeight
}
Pw {
moduleHeight: root.moduleHeight
}
Tray {
moduleHeight: root.moduleHeight
}
} }
} }
} }

View file

@ -6,15 +6,16 @@ import qs
import qs.widgets import qs.widgets
import qs.settings import qs.settings
WrapperRectangle { Rectangle {
id: root id: root
clip: true clip: true
color: Colors.base01 color: Colors.base01
property double percent: UPower.displayDevice.percentage * 100 property double percent: UPower.displayDevice.percentage * 100
property bool hasBattery: UPower.displayDevice.isLaptopBattery property bool hasBattery: UPower.displayDevice.isLaptopBattery
property bool charging: UPower.displayDevice.state == UPowerDeviceState.Charging property bool charging: UPower.displayDevice.state == UPowerDeviceState.Charging
leftMargin: 8 required property double moduleHeight
rightMargin: 8 implicitHeight: moduleHeight
implicitWidth: batLayout.implicitWidth + 16
radius: Config.rounding radius: Config.rounding
function batteryIcon(percent, charging) { function batteryIcon(percent, charging) {
if (percent <= 15) if (percent <= 15)
@ -31,7 +32,9 @@ WrapperRectangle {
return charging ? "battery_charging_90" : "battery_6_bar"; return charging ? "battery_charging_90" : "battery_6_bar";
return charging ? "battery_charging_full" : "battery_full"; return charging ? "battery_charging_full" : "battery_full";
} }
child: RowLayout { RowLayout {
id: batLayout
anchors.centerIn: root
MaterialIcon { MaterialIcon {
text: root.batteryIcon(root.percent, root.charging) text: root.batteryIcon(root.percent, root.charging)
} }

View file

@ -5,18 +5,21 @@ import qs
import qs.widgets import qs.widgets
import qs.settings import qs.settings
WrapperRectangle { Rectangle {
id: root id: root
clip: true clip: true
required property double moduleHeight
implicitHeight: moduleHeight
implicitWidth: clockText.implicitWidth + 32
color: Colors.base01 color: Colors.base01
leftMargin: 8
rightMargin: 8
radius: Config.rounding radius: Config.rounding
SystemClock { SystemClock {
id: clock id: clock
precision: SystemClock.Seconds precision: SystemClock.Seconds
} }
child: StyledText { StyledText {
id: clockText
anchors.centerIn: root
text: Qt.formatDateTime(clock.date, "d.M.yy - hh:mm") text: Qt.formatDateTime(clock.date, "d.M.yy - hh:mm")
} }
} }

View file

@ -6,8 +6,11 @@ import qs
import qs.widgets import qs.widgets
import qs.settings import qs.settings
WrapperRectangle { Rectangle {
id: root id: root
required property double moduleHeight
implicitHeight: moduleHeight
implicitWidth: songLayout.implicitWidth + 32
property MprisPlayer spotify: { property MprisPlayer spotify: {
for (const player of Mpris.players.values) { for (const player of Mpris.players.values) {
if (player.identity === "Spotify") if (player.identity === "Spotify")
@ -16,16 +19,18 @@ WrapperRectangle {
return null; return null;
} }
visible: spotify !== null && spotify.playbackState === MprisPlaybackState.Playing visible: spotify !== null && spotify.playbackState === MprisPlaybackState.Playing
leftMargin: 8 clip: true
rightMargin: 8
color: Colors.base01 color: Colors.base01
radius: Config.rounding radius: Config.rounding
child: RowLayout { RowLayout {
id: songLayout
anchors.centerIn: root
MaterialIcon { MaterialIcon {
text: "music_note_2" text: "music_note_2"
} }
StyledText { StyledText {
Layout.maximumWidth: 400 Layout.maximumWidth: 400
Layout.maximumHeight: Config.barHeight / 1.6
text: root.spotify?.trackTitle + " - " + root.spotify?.trackArtists text: root.spotify?.trackTitle + " - " + root.spotify?.trackArtists
elide: Text.ElideRight elide: Text.ElideRight
} }

View file

@ -6,14 +6,15 @@ import qs
import qs.widgets import qs.widgets
import qs.settings import qs.settings
WrapperRectangle { Rectangle {
id: root id: root
color: Colors.base01 color: Colors.base01
property PwNode defaultAudio: Pipewire.ready ? Pipewire.preferredDefaultAudioSink : null property PwNode defaultAudio: Pipewire.ready ? Pipewire.preferredDefaultAudioSink : null
property bool mute: Pipewire.ready ? defaultAudio?.audio.muted : null property bool mute: Pipewire.ready ? defaultAudio?.audio.muted : null
radius: Config.rounding radius: Config.rounding
leftMargin: 8 required property double moduleHeight
rightMargin: 8 implicitHeight: moduleHeight
implicitWidth: pwLayout.implicitWidth + 16
function getVolumeIcon() { function getVolumeIcon() {
let volume = Pipewire.ready ? root.defaultAudio.audio.volume : null; let volume = Pipewire.ready ? root.defaultAudio.audio.volume : null;
if (root.mute) { if (root.mute) {
@ -32,7 +33,10 @@ WrapperRectangle {
PwObjectTracker { PwObjectTracker {
objects: [Pipewire.ready ? Pipewire.defaultAudioSink : null] objects: [Pipewire.ready ? Pipewire.defaultAudioSink : null]
} }
child: RowLayout {
RowLayout {
id: pwLayout
anchors.centerIn: root
spacing: 4 spacing: 4
MaterialIcon { MaterialIcon {
text: root.getVolumeIcon() text: root.getVolumeIcon()

View file

@ -7,17 +7,19 @@ import QtQuick.Layouts
import qs import qs
import qs.settings import qs.settings
WrapperRectangle { Rectangle {
id: root id: root
color: Colors.base01 color: Colors.base01
visible: iconRepeater.count != 0 visible: iconRepeater.count != 0
radius: Config.rounding radius: Config.rounding
Layout.fillHeight: true Layout.fillHeight: true
leftMargin: 8 required property double moduleHeight
rightMargin: 8 implicitHeight: moduleHeight
implicitWidth: iconlayout.implicitWidth + 16
child: RowLayout { RowLayout {
id: iconlayout id: iconlayout
anchors.centerIn: root
Repeater { Repeater {
id: iconRepeater id: iconRepeater
model: SystemTray.items model: SystemTray.items

View file

@ -8,22 +8,27 @@ import qs
import qs.widgets import qs.widgets
import qs.settings import qs.settings
WrapperRectangle { Rectangle {
id: root id: root
required property ShellScreen barScreen required property ShellScreen barScreen
required property double moduleHeight
property HyprlandMonitor hyprBarScreen: Hyprland.monitorFor(root.barScreen) property HyprlandMonitor hyprBarScreen: Hyprland.monitorFor(root.barScreen)
radius: Config.rounding radius: Config.rounding
color: Colors.base01 color: Colors.base01
leftMargin: 8 implicitWidth: wsLayout.implicitWidth + 32
rightMargin: 8 implicitHeight: moduleHeight
child: RowLayout {
RowLayout {
id: wsLayout id: wsLayout
anchors.centerIn: parent
anchors.horizontalCenter: parent.horizontalCenter
spacing: 8 spacing: 8
Repeater { Repeater {
id: wsRepeater id: wsRepeater
model: Hyprland.workspaces model: Hyprland.workspaces
delegate: WrapperRectangle { delegate: WrapperRectangle {
id: wsWrapper id: wsWrapper
anchors.verticalCenter: parent.verticalCenter
parent: wsLayout parent: wsLayout
color: 'transparent' color: 'transparent'
visible: modelData.monitor == root.hyprBarScreen visible: modelData.monitor == root.hyprBarScreen

View file

@ -1,7 +1,7 @@
[General] [General]
barHeight=34 barHeight=34
font=Maple Mono font=ProFont IIx Nerd Font
fontSize=16 fontSize=14
opacity=0.5 opacity=0.5
roudning=16 roudning=20
wallpaper=@Variant(\0\0\0\x11\0\0\0!file:///home/lucy/.wall/mooon.png) wallpaper=@Variant(\0\0\0\x11\0\0\0!file:///home/lucy/.wall/mooon.png)