mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Bluetooth: Add display settings for Bluetooth bar pill.
This commit is contained in:
@@ -122,6 +122,7 @@ Popup {
|
|||||||
const widgetSettingsMap = {
|
const widgetSettingsMap = {
|
||||||
"ActiveWindow": "WidgetSettings/ActiveWindowSettings.qml",
|
"ActiveWindow": "WidgetSettings/ActiveWindowSettings.qml",
|
||||||
"Battery": "WidgetSettings/BatterySettings.qml",
|
"Battery": "WidgetSettings/BatterySettings.qml",
|
||||||
|
"Bluetooth": "WidgetSettings/BluetoothSettings.qml",
|
||||||
"Brightness": "WidgetSettings/BrightnessSettings.qml",
|
"Brightness": "WidgetSettings/BrightnessSettings.qml",
|
||||||
"Clock": "WidgetSettings/ClockSettings.qml",
|
"Clock": "WidgetSettings/ClockSettings.qml",
|
||||||
"ControlCenter": "WidgetSettings/ControlCenterSettings.qml",
|
"ControlCenter": "WidgetSettings/ControlCenterSettings.qml",
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import qs.Commons
|
||||||
|
import qs.Widgets
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
spacing: Style.marginM
|
||||||
|
|
||||||
|
// Properties to receive data from parent
|
||||||
|
property var widgetData: null
|
||||||
|
property var widgetMetadata: null
|
||||||
|
|
||||||
|
// Local state
|
||||||
|
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||||
|
|
||||||
|
function saveSettings() {
|
||||||
|
var settings = Object.assign({}, widgetData || {})
|
||||||
|
settings.displayMode = valueDisplayMode
|
||||||
|
return settings
|
||||||
|
}
|
||||||
|
|
||||||
|
NComboBox {
|
||||||
|
label: I18n.tr("bar.widget-settings.battery.display-mode.label")
|
||||||
|
description: I18n.tr("bar.widget-settings.battery.display-mode.description")
|
||||||
|
minimumWidth: 134
|
||||||
|
model: [{
|
||||||
|
"key": "onhover",
|
||||||
|
"name": I18n.tr("options.display-mode.on-hover")
|
||||||
|
}, {
|
||||||
|
"key": "alwaysShow",
|
||||||
|
"name": I18n.tr("options.display-mode.always-show")
|
||||||
|
}, {
|
||||||
|
"key": "alwaysHide",
|
||||||
|
"name": I18n.tr("options.display-mode.always-hide")
|
||||||
|
}]
|
||||||
|
currentKey: root.valueDisplayMode
|
||||||
|
onSelected: key => root.valueDisplayMode = key
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -53,6 +53,10 @@ Singleton {
|
|||||||
"displayMode": "onhover",
|
"displayMode": "onhover",
|
||||||
"warningThreshold": 30
|
"warningThreshold": 30
|
||||||
},
|
},
|
||||||
|
"Bluetooth": {
|
||||||
|
"allowUserSettings": true,
|
||||||
|
"displayMode": "onhover"
|
||||||
|
},
|
||||||
"Brightness": {
|
"Brightness": {
|
||||||
"allowUserSettings": true,
|
"allowUserSettings": true,
|
||||||
"displayMode": "onhover"
|
"displayMode": "onhover"
|
||||||
|
|||||||
Reference in New Issue
Block a user