Index: sources/gui/qml/compounds/NumPad.qml =================================================================== diff -u -rbfdee4cd41dfc4609cbd6045e64217731433f79d -rc749ecd5dc413ce091250af652ccba4d96f7a582 --- sources/gui/qml/compounds/NumPad.qml (.../NumPad.qml) (revision bfdee4cd41dfc4609cbd6045e64217731433f79d) +++ sources/gui/qml/compounds/NumPad.qml (.../NumPad.qml) (revision c749ecd5dc413ce091250af652ccba4d96f7a582) @@ -38,12 +38,12 @@ width : Variables.numPadWidth height : Variables.numPadHeight - visible : false +// visible : false radius : 9 color : Colors.backgroundMain x : Math.round((Variables.applicationWidth - _root.width) / 2) y : Math.round((Variables.applicationHeight - _root.height) / 2) - onVisibleChanged : if ( ! _root.visible ) { reset() } +// onVisibleChanged : if ( ! _root.visible ) { reset() } onDisplayValueChanged : if ( _root.setter ) { _root.setter( _valueLabel.text ) } onSettingValueChanged : _valueLabel.text = _root.settingValue !== undefined ? _root.settingValue : "" @@ -54,6 +54,22 @@ function open(entry, title, min, max, unit) { reset() + setup(entry, title, min, max, unit) +// _root.settingValue = Qt.binding(function () { return entry.text }) +// _root.title = title +// _root.unit = unit +// _root.range = min.isEmpty && +// max.isEmpty ? "" : ("%1 %2 - %3") .arg(qsTr("Range:")) +// .arg(min) +// .arg(max) +// _root.getter = entry.text +// _root.setter = function (value) { entry.text = value } +// _root.validator = function (value) { { return value >= min && value <= max } } + _keyboard.setVisible(false) + show() + } + + function setup(entry, title, min, max, unit) { _root.settingValue = Qt.binding(function () { return entry.text }) _root.title = title _root.unit = unit @@ -64,8 +80,6 @@ _root.getter = entry.text _root.setter = function (value) { entry.text = value } _root.validator = function (value) { { return value >= min && value <= max } } - _keyboard.setVisible(false) - show() } function show() {