quickshell: minor

This commit is contained in:
2025-10-13 04:02:04 +02:00
parent c4eeff7e50
commit ba194b8fa4
5 changed files with 14 additions and 4 deletions

View File

@@ -5,12 +5,14 @@ import qs.Modules.Bar.Misc
import qs.Services import qs.Services
MonitorItem { MonitorItem {
property bool showPercent: false
symbol: Icons.memory symbol: Icons.memory
fillColor: Colors.green fillColor: Colors.green
value: Math.round(SystemStatService.memPercent) value: Math.round(SystemStatService.memPercent)
maxValue: 100 maxValue: 100
textValue: SystemStatService.memGb textValue: showPercent ? SystemStatService.memPercent : SystemStatService.memGb
textSuffix: "G" textSuffix: showPercent ? "%" : "GB"
onClicked: { onClicked: {
if (action.running) { if (action.running) {
action.signal(15); action.signal(15);
@@ -18,6 +20,9 @@ MonitorItem {
} }
action.exec(["ghostty", "-e", "btop"]); action.exec(["ghostty", "-e", "btop"]);
} }
onRightClicked: {
showPercent = !showPercent;
}
Process { Process {
id: action id: action

View File

@@ -22,6 +22,7 @@ Item {
SymbolButton { SymbolButton {
symbol: Icons.tray symbol: Icons.tray
buttonColor: Colors.green buttonColor: Colors.green
disabledHover: true
} }
Item { Item {

View File

@@ -15,11 +15,13 @@ Item {
property string textSuffix: "" property string textSuffix: ""
property bool pointerCursor: true property bool pointerCursor: true
property alias hovered: mouseArea.containsMouse property alias hovered: mouseArea.containsMouse
property bool disableHover: false
readonly property real ratio: value / maxValue readonly property real ratio: value / maxValue
signal wheelUp() signal wheelUp()
signal wheelDown() signal wheelDown()
signal clicked() signal clicked()
signal rightClicked()
implicitHeight: parent.height - 5 implicitHeight: parent.height - 5
implicitWidth: parent.height + (hovered ? textDisplay.width : 0) implicitWidth: parent.height + (hovered ? textDisplay.width : 0)
@@ -28,7 +30,7 @@ Item {
id: mouseArea id: mouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: !disableHover
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
cursorShape: pointerCursor ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: pointerCursor ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: (mouse) => { onClicked: (mouse) => {

View File

@@ -11,6 +11,7 @@ Item {
readonly property alias hovered: mouseArea.containsMouse readonly property alias hovered: mouseArea.containsMouse
property real iconSize: Fonts.icon property real iconSize: Fonts.icon
property real radius: Style.radiusS property real radius: Style.radiusS
property bool disabledHover: false
signal clicked() signal clicked()
signal rightClicked() signal rightClicked()
@@ -23,7 +24,7 @@ Item {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
hoverEnabled: true hoverEnabled: !disabledHover
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: (mouse) => { onClicked: (mouse) => {
if (mouse.button === Qt.RightButton) if (mouse.button === Qt.RightButton)

View File

@@ -151,6 +151,7 @@ PopupWindow {
pointSize: Style.fontSizeS pointSize: Style.fontSizeS
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
family: Fonts.sans
} }
Image { Image {