mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
9f8bf988f0
- Switch most settings from onEditingFinished to onTextChanged so changes save on every keystroke - Replace onAccepted with onEditingFinished (Enter + blur) for search, pager, wifi, bluetooth - Keep onEditingFinished for pager, wallhaven, path inputs, and validation fields
35 lines
879 B
QML
35 lines
879 B
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import qs.Commons
|
|
import qs.Widgets
|
|
|
|
ColumnLayout {
|
|
id: root
|
|
spacing: Style.marginM
|
|
|
|
// Properties to receive data from parent
|
|
property var screen: null
|
|
property var widgetData: null
|
|
property var widgetMetadata: null
|
|
|
|
signal settingsChanged(var settings)
|
|
|
|
function saveSettings() {
|
|
var settings = Object.assign({}, widgetData || {});
|
|
settings.width = parseInt(widthInput.text) || widgetMetadata.width;
|
|
settingsChanged(settings);
|
|
}
|
|
|
|
NTextInput {
|
|
id: widthInput
|
|
Layout.fillWidth: true
|
|
label: I18n.tr("common.width")
|
|
description: I18n.tr("bar.spacer.width-description")
|
|
text: widgetData.width || widgetMetadata.width
|
|
placeholderText: I18n.tr("placeholders.enter-width-pixels")
|
|
onTextChanged: saveSettings()
|
|
defaultValue: String(widgetMetadata.width)
|
|
}
|
|
}
|