remove useless margin stuff
This commit is contained in:
parent
608d8bbfce
commit
0d20fc7313
9 changed files with 64 additions and 53 deletions
|
|
@ -1,24 +1,27 @@
|
|||
import Quickshell.Widgets
|
||||
import Quickshell.Hyprland
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs
|
||||
import qs.widgets
|
||||
import qs.settings
|
||||
|
||||
WrapperRectangle {
|
||||
ClippingWrapperRectangle {
|
||||
id: root
|
||||
clip: true
|
||||
color: Colors.base01
|
||||
required property int barHeight
|
||||
required property double vertMargin
|
||||
radius: Config.rounding
|
||||
topMargin: vertMargin
|
||||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
child: StyledText {
|
||||
text: Hyprland.activeToplevel?.title ?? "Desktop"
|
||||
width: root.width - root.leftMargin - root.rightMargin
|
||||
elide: Text.ElideRight
|
||||
child: RowLayout {
|
||||
|
||||
WrapperRectangle {
|
||||
Layout.fillHeight: true
|
||||
color: 'transparent'
|
||||
clip: true
|
||||
StyledText {
|
||||
text: Hyprland.activeToplevel?.title ?? "Desktop"
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,25 +26,15 @@ Variants {
|
|||
anchors.leftMargin: 10
|
||||
Ws {
|
||||
barScreen: root.modelData
|
||||
barHeight: root.implicitHeight
|
||||
}
|
||||
ActiveWindow {
|
||||
vertMargin: barHeight / 4 - 4
|
||||
barHeight: root.implicitHeight
|
||||
Layout.maximumWidth: 300
|
||||
Layout.maximumHeight: barHeight - (barHeight / 4 + 2)
|
||||
Layout.fillWidth: false
|
||||
}
|
||||
ActiveWindow {}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: centerLayout
|
||||
anchors.centerIn: parent
|
||||
spacing: 5
|
||||
Clock {
|
||||
vertMargin: barHeight / 4 - 4
|
||||
barHeight: root.implicitHeight
|
||||
}
|
||||
Clock {}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
|
@ -53,15 +43,10 @@ Variants {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 5
|
||||
anchors.rightMargin: 10
|
||||
Mpris {
|
||||
barHeight: root.implicitHeight
|
||||
}
|
||||
Pw {
|
||||
barHeight: root.implicitHeight
|
||||
}
|
||||
Tray {
|
||||
barHeight: root.implicitHeight
|
||||
}
|
||||
Mpris {}
|
||||
Bat {}
|
||||
Pw {}
|
||||
Tray {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
42
modules/bar/Bat.qml
Normal file
42
modules/bar/Bat.qml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import Quickshell.Widgets
|
||||
import Quickshell.Services.UPower
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs
|
||||
import qs.widgets
|
||||
import qs.settings
|
||||
|
||||
WrapperRectangle {
|
||||
id: root
|
||||
clip: true
|
||||
color: Colors.base01
|
||||
property double percent: UPower.displayDevice.percentage * 100
|
||||
property bool hasBattery: UPower.displayDevice.isLaptopBattery
|
||||
property bool charging: UPower.displayDevice.state == UPowerDeviceState.Charging
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
radius: Config.rounding
|
||||
function batteryIcon(percent, charging) {
|
||||
if (percent <= 15)
|
||||
return charging ? "battery_charging_20" : "battery_alert";
|
||||
if (percent <= 30)
|
||||
return charging ? "battery_charging_30" : "battery_2_bar";
|
||||
if (percent <= 50)
|
||||
return charging ? "battery_charging_50" : "battery_3_bar";
|
||||
if (percent <= 70)
|
||||
return charging ? "battery_charging_60" : "battery_4_bar";
|
||||
if (percent <= 85)
|
||||
return charging ? "battery_charging_80" : "battery_5_bar";
|
||||
if (percent <= 95)
|
||||
return charging ? "battery_charging_90" : "battery_6_bar";
|
||||
return charging ? "battery_charging_full" : "battery_full";
|
||||
}
|
||||
child: RowLayout {
|
||||
MaterialIcon {
|
||||
text: root.batteryIcon(root.percent, root.charging)
|
||||
}
|
||||
StyledText {
|
||||
text: Math.floor(root.percent) + "%"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,10 +9,6 @@ WrapperRectangle {
|
|||
id: root
|
||||
clip: true
|
||||
color: Colors.base01
|
||||
required property int barHeight
|
||||
required property double vertMargin
|
||||
topMargin: vertMargin
|
||||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
radius: Config.rounding
|
||||
|
|
|
|||
|
|
@ -9,11 +9,7 @@ import qs.settings
|
|||
WrapperRectangle {
|
||||
id: root
|
||||
property MprisPlayer spotify: findSpotify()
|
||||
required property int barHeight
|
||||
property double vertMargin: barHeight / 4 - 4
|
||||
visible: spotify != null
|
||||
topMargin: vertMargin
|
||||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
color: Colors.base01
|
||||
|
|
|
|||
|
|
@ -9,13 +9,9 @@ import qs.settings
|
|||
WrapperRectangle {
|
||||
id: root
|
||||
color: Colors.base01
|
||||
required property int barHeight
|
||||
property double vertMargin: barHeight / 4 - 4
|
||||
property PwNode defaultAudio: Pipewire.ready ? Pipewire.preferredDefaultAudioSink : null
|
||||
property bool mute: Pipewire.ready ? defaultAudio?.audio.muted : null
|
||||
radius: Config.rounding
|
||||
topMargin: vertMargin
|
||||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
function getVolumeIcon() {
|
||||
|
|
|
|||
|
|
@ -11,13 +11,10 @@ WrapperRectangle {
|
|||
id: root
|
||||
color: Colors.base01
|
||||
visible: iconRepeater.count != 0
|
||||
required property int barHeight
|
||||
property double vertMargin: barHeight / 4 - 4
|
||||
topMargin: vertMargin
|
||||
radius: Config.rounding
|
||||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
margin: 1
|
||||
|
||||
child: RowLayout {
|
||||
id: iconlayout
|
||||
|
|
|
|||
|
|
@ -11,13 +11,9 @@ import qs.settings
|
|||
WrapperRectangle {
|
||||
id: root
|
||||
required property ShellScreen barScreen
|
||||
required property int barHeight
|
||||
readonly property double vertMargin: barHeight / 4 - 4
|
||||
property HyprlandMonitor hyprBarScreen: Hyprland.monitorFor(root.barScreen)
|
||||
radius: Config.rounding
|
||||
color: Colors.base01
|
||||
topMargin: vertMargin
|
||||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
child: RowLayout {
|
||||
|
|
|
|||
Loading…
Reference in a new issue