1
0
Fork 0
flightgear/src/GUI/qml/SettingCheckbox.qml
James Turner 1bf52662ae Launcher converted to QQ2
This simplifies the launcher's rendering since the widget-based
code is gone, various things get hooked up as a result. Styling
fixes everywhere as well.

Menubar on Linux/Windows needs to be re-added.
2018-06-23 17:14:21 +01:00

47 lines
1 KiB
QML

import QtQuick 2.4
import "."
SettingControl {
id: root
property alias checked: toggle.checked
property alias value: toggle.checked
property bool defaultValue: false
// should we set the option, if the current value matches the default?
// this is used to suppress setting needless options to their default
// value
property bool setIfDefault: false
implicitHeight: toggle.height + Style.margin + description.height
ToggleSwitch {
id: toggle
label: root.label
enabled: root.enabled
}
SettingDescription {
id: description
enabled: root.enabled
text: root.description
anchors.top: toggle.bottom
anchors.topMargin: Style.margin
width: root.width
}
function apply()
{
if (option == "")
return;
if (setIfDefault || (value != defaultValue)) {
_config.setEnableDisableOption(option, checked)
}
}
function setValue(newValue)
{
toggle.setValue(newValue)
}
}