mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
40 lines
1.0 KiB
QML
40 lines
1.0 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import qs.Commons
|
|
import qs.Services.System
|
|
import qs.Widgets
|
|
|
|
ColumnLayout {
|
|
id: root
|
|
spacing: Style.marginM
|
|
width: 700
|
|
|
|
// Properties to receive data from parent
|
|
property var widgetData: null
|
|
property var widgetMetadata: null
|
|
|
|
signal settingsChanged(var settings)
|
|
|
|
// Local state
|
|
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : (widgetData.colorName !== undefined ? widgetData.colorName : widgetMetadata.iconColor)
|
|
|
|
function saveSettings() {
|
|
var settings = Object.assign({}, widgetData || {});
|
|
settings.iconColor = valueIconColor;
|
|
return settings;
|
|
}
|
|
|
|
NComboBox {
|
|
label: I18n.tr("common.select-icon-color")
|
|
description: I18n.tr("common.select-color-description")
|
|
model: Color.colorKeyModel
|
|
currentKey: root.valueIconColor
|
|
onSelected: key => {
|
|
root.valueIconColor = key;
|
|
settingsChanged(saveSettings());
|
|
}
|
|
minimumWidth: 200
|
|
}
|
|
}
|