mirror of
				https://github.com/Swordfish90/cool-retro-term.git
				synced 2025-10-31 07:04:20 +00:00 
			
		
		
		
	Fix: update sliders when profile changes.
This commit is contained in:
		| @@ -23,12 +23,12 @@ import QtQuick.Controls 1.1 | |||||||
| import QtQuick.Layouts 1.1 | import QtQuick.Layouts 1.1 | ||||||
|  |  | ||||||
| RowLayout { | RowLayout { | ||||||
|     property string name |     property alias name: check.text | ||||||
|     property double value: (check.checked) ? _value : 0.0 |     property double value: (check.checked) ? _value : 0.0 | ||||||
|     property double _value: 0.0 |     property alias _value: slider.value | ||||||
|     property double min_value: 0.0 |     property alias min_value: slider.minimumValue | ||||||
|     property double max_value: 1.0 |     property alias max_value: slider.maximumValue | ||||||
|     property double stepSize: 0.01 |     property alias stepSize: slider.stepSize | ||||||
|  |  | ||||||
|     id: setting_component |     id: setting_component | ||||||
|     anchors.left: parent.left |     anchors.left: parent.left | ||||||
| @@ -38,21 +38,13 @@ RowLayout { | |||||||
|     CheckBox{ |     CheckBox{ | ||||||
|         id: check |         id: check | ||||||
|         implicitWidth: 150 |         implicitWidth: 150 | ||||||
|  |  | ||||||
|         text: name |  | ||||||
|         Component.onCompleted: checked = (_value !== 0); |         Component.onCompleted: checked = (_value !== 0); | ||||||
|     } |     } | ||||||
|     Slider{ |     Slider{ | ||||||
|         id: slider |         id: slider | ||||||
|         stepSize: parent.stepSize |         stepSize: parent.stepSize | ||||||
|         minimumValue: min_value |  | ||||||
|         maximumValue: max_value |  | ||||||
|         onValueChanged: setting_component._value = slider.value; |  | ||||||
|         Layout.fillWidth: true |         Layout.fillWidth: true | ||||||
|         enabled: check.checked |         enabled: check.checked | ||||||
|         value: setting_component._value |  | ||||||
|  |  | ||||||
|         Component.onCompleted: slider.value = setting_component._value |  | ||||||
|     } |     } | ||||||
|     Text{ |     Text{ | ||||||
|         id: textfield |         id: textfield | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||||
| <!DOCTYPE QtCreatorProject> | <!DOCTYPE QtCreatorProject> | ||||||
| <!-- Written by QtCreator 3.0.1, 2014-06-26T21:03:57. --> | <!-- Written by QtCreator 3.0.1, 2014-06-27T16:14:00. --> | ||||||
| <qtcreator> | <qtcreator> | ||||||
|  <data> |  <data> | ||||||
|   <variable>ProjectExplorer.Project.ActiveTarget</variable> |   <variable>ProjectExplorer.Project.ActiveTarget</variable> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user