Bar Widgets FrontEnd: Simplified access to editable widget settings
This commit is contained in:
parent
45af873a6f
commit
517c7c97d4
17 changed files with 135 additions and 105 deletions
|
|
@ -12,10 +12,14 @@ Item {
|
|||
|
||||
property ShellScreen screen
|
||||
property real scaling: 1.0
|
||||
|
||||
// Widget properties passed from Bar.qml for per-instance settings
|
||||
property string widgetId: ""
|
||||
property string barSection: ""
|
||||
property int sectionWidgetIndex: 0
|
||||
property int sectionWidgetIndex: -1
|
||||
property int sectionWidgetsCount: 0
|
||||
|
||||
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||
property var widgetSettings: {
|
||||
var section = barSection.replace("Section", "").toLowerCase()
|
||||
if (section && sectionWidgetIndex >= 0) {
|
||||
|
|
@ -27,7 +31,8 @@ Item {
|
|||
return {}
|
||||
}
|
||||
|
||||
readonly property bool userAlwaysShowPercentage: widgetSettings?.alwaysShowPercentage
|
||||
readonly property bool alwaysShowPercentage: (widgetSettings.alwaysShowPercentage
|
||||
!== undefined) ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage
|
||||
|
||||
// Used to avoid opening the pill on Quickshell startup
|
||||
property bool firstInputVolumeReceived: false
|
||||
|
|
@ -91,7 +96,7 @@ Item {
|
|||
collapsedIconColor: Color.mOnSurface
|
||||
autoHide: false // Important to be false so we can hover as long as we want
|
||||
text: Math.floor(AudioService.inputVolume * 100) + "%"
|
||||
forceOpen: userAlwaysShowPercentage
|
||||
forceOpen: alwaysShowPercentage
|
||||
tooltipText: "Microphone: " + Math.round(AudioService.inputVolume * 100)
|
||||
+ "%\nLeft click for advanced settings.\nScroll up/down to change volume.\nRight click to toggle mute."
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue