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.Widgets
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
import qs
|
import qs
|
||||||
import qs.widgets
|
import qs.widgets
|
||||||
import qs.settings
|
import qs.settings
|
||||||
|
|
||||||
WrapperRectangle {
|
ClippingWrapperRectangle {
|
||||||
id: root
|
id: root
|
||||||
clip: true
|
|
||||||
color: Colors.base01
|
color: Colors.base01
|
||||||
required property int barHeight
|
|
||||||
required property double vertMargin
|
|
||||||
radius: Config.rounding
|
radius: Config.rounding
|
||||||
topMargin: vertMargin
|
|
||||||
bottomMargin: vertMargin
|
|
||||||
leftMargin: 8
|
leftMargin: 8
|
||||||
rightMargin: 8
|
rightMargin: 8
|
||||||
child: StyledText {
|
child: RowLayout {
|
||||||
|
|
||||||
|
WrapperRectangle {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
color: 'transparent'
|
||||||
|
clip: true
|
||||||
|
StyledText {
|
||||||
text: Hyprland.activeToplevel?.title ?? "Desktop"
|
text: Hyprland.activeToplevel?.title ?? "Desktop"
|
||||||
width: root.width - root.leftMargin - root.rightMargin
|
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,25 +26,15 @@ Variants {
|
||||||
anchors.leftMargin: 10
|
anchors.leftMargin: 10
|
||||||
Ws {
|
Ws {
|
||||||
barScreen: root.modelData
|
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 {
|
RowLayout {
|
||||||
id: centerLayout
|
id: centerLayout
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: 5
|
spacing: 5
|
||||||
Clock {
|
Clock {}
|
||||||
vertMargin: barHeight / 4 - 4
|
|
||||||
barHeight: root.implicitHeight
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
@ -53,15 +43,10 @@ Variants {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: 5
|
spacing: 5
|
||||||
anchors.rightMargin: 10
|
anchors.rightMargin: 10
|
||||||
Mpris {
|
Mpris {}
|
||||||
barHeight: root.implicitHeight
|
Bat {}
|
||||||
}
|
Pw {}
|
||||||
Pw {
|
Tray {}
|
||||||
barHeight: root.implicitHeight
|
|
||||||
}
|
|
||||||
Tray {
|
|
||||||
barHeight: root.implicitHeight
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
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
|
id: root
|
||||||
clip: true
|
clip: true
|
||||||
color: Colors.base01
|
color: Colors.base01
|
||||||
required property int barHeight
|
|
||||||
required property double vertMargin
|
|
||||||
topMargin: vertMargin
|
|
||||||
bottomMargin: vertMargin
|
|
||||||
leftMargin: 8
|
leftMargin: 8
|
||||||
rightMargin: 8
|
rightMargin: 8
|
||||||
radius: Config.rounding
|
radius: Config.rounding
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,7 @@ import qs.settings
|
||||||
WrapperRectangle {
|
WrapperRectangle {
|
||||||
id: root
|
id: root
|
||||||
property MprisPlayer spotify: findSpotify()
|
property MprisPlayer spotify: findSpotify()
|
||||||
required property int barHeight
|
|
||||||
property double vertMargin: barHeight / 4 - 4
|
|
||||||
visible: spotify != null
|
visible: spotify != null
|
||||||
topMargin: vertMargin
|
|
||||||
bottomMargin: vertMargin
|
|
||||||
leftMargin: 8
|
leftMargin: 8
|
||||||
rightMargin: 8
|
rightMargin: 8
|
||||||
color: Colors.base01
|
color: Colors.base01
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,9 @@ import qs.settings
|
||||||
WrapperRectangle {
|
WrapperRectangle {
|
||||||
id: root
|
id: root
|
||||||
color: Colors.base01
|
color: Colors.base01
|
||||||
required property int barHeight
|
|
||||||
property double vertMargin: barHeight / 4 - 4
|
|
||||||
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
|
||||||
topMargin: vertMargin
|
|
||||||
bottomMargin: vertMargin
|
|
||||||
leftMargin: 8
|
leftMargin: 8
|
||||||
rightMargin: 8
|
rightMargin: 8
|
||||||
function getVolumeIcon() {
|
function getVolumeIcon() {
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,10 @@ WrapperRectangle {
|
||||||
id: root
|
id: root
|
||||||
color: Colors.base01
|
color: Colors.base01
|
||||||
visible: iconRepeater.count != 0
|
visible: iconRepeater.count != 0
|
||||||
required property int barHeight
|
|
||||||
property double vertMargin: barHeight / 4 - 4
|
|
||||||
topMargin: vertMargin
|
|
||||||
radius: Config.rounding
|
radius: Config.rounding
|
||||||
bottomMargin: vertMargin
|
|
||||||
leftMargin: 8
|
leftMargin: 8
|
||||||
rightMargin: 8
|
rightMargin: 8
|
||||||
|
margin: 1
|
||||||
|
|
||||||
child: RowLayout {
|
child: RowLayout {
|
||||||
id: iconlayout
|
id: iconlayout
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,9 @@ import qs.settings
|
||||||
WrapperRectangle {
|
WrapperRectangle {
|
||||||
id: root
|
id: root
|
||||||
required property ShellScreen barScreen
|
required property ShellScreen barScreen
|
||||||
required property int barHeight
|
|
||||||
readonly property double vertMargin: barHeight / 4 - 4
|
|
||||||
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
|
||||||
topMargin: vertMargin
|
|
||||||
bottomMargin: vertMargin
|
|
||||||
leftMargin: 8
|
leftMargin: 8
|
||||||
rightMargin: 8
|
rightMargin: 8
|
||||||
child: RowLayout {
|
child: RowLayout {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[General]
|
[General]
|
||||||
barHeight=30
|
barHeight=30
|
||||||
font=Maple Mono
|
font=Maple Mono
|
||||||
fontSize=12
|
fontSize=14
|
||||||
roudning=16
|
roudning=16
|
||||||
wallpaper=@Variant(\0\0\0\x11\0\0\0 file:///home/lucy/.wall/Kita.png)
|
wallpaper=@Variant(\0\0\0\x11\0\0\0\x31\x66ile:///home/lucy/.wall/kikis_deliveryservice.png)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue