remove margin in volume and bat
This commit is contained in:
parent
318ca10e44
commit
62f7a986e8
@ -15,7 +15,7 @@ Loader {
|
|||||||
sourceComponent: Rectangle {
|
sourceComponent: Rectangle {
|
||||||
id: container
|
id: container
|
||||||
radius: implicitHeight / 2
|
radius: implicitHeight / 2
|
||||||
color: clickHandler.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
|
color: Colors.surfaceContainer
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
implicitWidth: UPower.displayDevice.isLaptopBattery ? root.implicitWidth + 20 : 0
|
implicitWidth: UPower.displayDevice.isLaptopBattery ? root.implicitWidth + 20 : 0
|
||||||
implicitHeight: Settings.config.barHeight - 10
|
implicitHeight: Settings.config.barHeight - 10
|
||||||
@ -75,50 +75,12 @@ Loader {
|
|||||||
CustomText {
|
CustomText {
|
||||||
id: batText
|
id: batText
|
||||||
|
|
||||||
Layout.topMargin: 2
|
|
||||||
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
|
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
|
||||||
}
|
}
|
||||||
CustomIcon {
|
CustomIcon {
|
||||||
id: batIcon
|
id: batIcon
|
||||||
Layout.topMargin: 2
|
|
||||||
font.family: "Material Symbols Rounded"
|
|
||||||
text: root.getBatteryIcon()
|
text: root.getBatteryIcon()
|
||||||
}
|
}
|
||||||
Item {
|
|
||||||
implicitWidth: 12
|
|
||||||
implicitHeight: 12
|
|
||||||
|
|
||||||
IconImage {
|
|
||||||
id: rawProfileIcon
|
|
||||||
anchors.fill: parent
|
|
||||||
source: Quickshell.iconPath(root.getProfileIcon())
|
|
||||||
visible: false
|
|
||||||
}
|
|
||||||
|
|
||||||
ColorOverlay {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: rawProfileIcon
|
|
||||||
color: Colors.onSurfaceColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MouseArea {
|
|
||||||
id: clickHandler
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: mouse => {
|
|
||||||
const modes = [PowerProfile.PowerSaver, PowerProfile.Balanced, PowerProfile.Performance];
|
|
||||||
let current = PowerProfiles.profile;
|
|
||||||
let currentIndex = modes.indexOf(current);
|
|
||||||
let nextIndex = (currentIndex + 1) % modes.length;
|
|
||||||
let prevIndex = (currentIndex - 1) % modes.length;
|
|
||||||
if (mouse.button == Qt.LeftButton)
|
|
||||||
PowerProfiles.profile = modes[nextIndex];
|
|
||||||
if (mouse.button == Qt.RightButton)
|
|
||||||
PowerProfiles.profile = modes[prevIndex];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
modules/bar/Brightness.qml
Normal file
10
modules/bar/Brightness.qml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import Quickshell
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell.Io
|
||||||
|
import qs
|
||||||
|
import qs.settings
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
implicitHeight: Settings.config.barHeight
|
||||||
|
}
|
||||||
@ -66,7 +66,6 @@ Rectangle {
|
|||||||
id: innerContent
|
id: innerContent
|
||||||
required property var modelData
|
required property var modelData
|
||||||
// THIS fixes the centering issue:
|
// THIS fixes the centering issue:
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
CustomIcon {
|
CustomIcon {
|
||||||
|
|||||||
@ -42,7 +42,6 @@ Rectangle {
|
|||||||
height: parent.height
|
height: parent.height
|
||||||
CustomText {
|
CustomText {
|
||||||
id: volumeText
|
id: volumeText
|
||||||
Layout.topMargin: 1
|
|
||||||
PwObjectTracker {
|
PwObjectTracker {
|
||||||
objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
|
objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user