Bar Widget Settings: One file per Widget settings, refactor - wip
This commit is contained in:
parent
c01167c9da
commit
45af873a6f
27 changed files with 707 additions and 765 deletions
31
Modules/SettingsPanel/Bar/WidgetSettings/VolumeSettings.qml
Normal file
31
Modules/SettingsPanel/Bar/WidgetSettings/VolumeSettings.qml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
import qs.Services
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM * scaling
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
// Local state
|
||||
property bool valueAlwaysShowPercentage: widgetData.alwaysShowPercentage
|
||||
!== undefined ? widgetData.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.alwaysShowPercentage = valueAlwaysShowPercentage
|
||||
return settings
|
||||
}
|
||||
|
||||
NCheckbox {
|
||||
label: "Always show percentage"
|
||||
checked: valueAlwaysShowPercentage
|
||||
onToggled: checked => valueAlwaysShowPercentage = checked
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue