NInputAction: use proper label/description + autoformatting

This commit is contained in:
LemmyCook 2025-09-05 14:13:05 -04:00
parent 1cab452352
commit f04ac180f0
4 changed files with 7 additions and 24 deletions

View file

@ -100,7 +100,7 @@ Item {
AudioService.setInputMuted(!AudioService.inputMuted) AudioService.setInputMuted(!AudioService.inputMuted)
} }
onMiddleClicked: { onMiddleClicked: {
Quickshell.execDetached(["pwvucontrol"]); Quickshell.execDetached(["pwvucontrol"])
} }
} }
} }

View file

@ -63,8 +63,8 @@ Item {
collapsedIconColor: Color.mOnSurface collapsedIconColor: Color.mOnSurface
autoHide: false // Important to be false so we can hover as long as we want autoHide: false // Important to be false so we can hover as long as we want
text: Math.floor(AudioService.volume * 100) + "%" text: Math.floor(AudioService.volume * 100) + "%"
tooltipText: "Volume: " + Math.round( tooltipText: "Volume: " + Math.round(AudioService.volume * 100)
AudioService.volume * 100) + "%\nLeft click for advanced settings.\nScroll up/down to change volume.\nRight click to toggle mute." + "%\nLeft click for advanced settings.\nScroll up/down to change volume.\nRight click to toggle mute."
onWheel: function (delta) { onWheel: function (delta) {
wheelAccumulator += delta wheelAccumulator += delta
@ -85,7 +85,7 @@ Item {
AudioService.setMuted(!AudioService.muted) AudioService.setMuted(!AudioService.muted)
} }
onMiddleClicked: { onMiddleClicked: {
Quickshell.execDetached(["pwvucontrol"]); Quickshell.execDetached(["pwvucontrol"])
} }
} }
} }

View file

@ -22,24 +22,6 @@ ColumnLayout {
// Internal properties // Internal properties
property real scaling: 1.0 property real scaling: 1.0
// Label
NText {
text: root.label
font.pointSize: Style.fontSizeL * scaling
font.weight: Style.fontWeightBold
color: Color.mOnSurface
Layout.fillWidth: true
}
// Description
NText {
text: root.description
font.pointSize: Style.fontSizeS * scaling
color: Color.mOnSurfaceVariant
wrapMode: Text.Wrap
Layout.fillWidth: true
}
// Input and button row // Input and button row
RowLayout { RowLayout {
spacing: Style.marginM * scaling spacing: Style.marginM * scaling
@ -47,6 +29,8 @@ ColumnLayout {
NTextInput { NTextInput {
id: textInput id: textInput
label: root.label
description: root.description
placeholderText: root.placeholderText placeholderText: root.placeholderText
text: root.text text: root.text
onEditingFinished: { onEditingFinished: {

View file

@ -231,8 +231,7 @@ Item {
root.clicked() root.clicked()
} else if (mouse.button === Qt.RightButton) { } else if (mouse.button === Qt.RightButton) {
root.rightClicked() root.rightClicked()
} } else if (mouse.button === Qt.MiddleButton) {
else if (mouse.button === Qt.MiddleButton) {
root.middleClicked() root.middleClicked()
} }
} }