mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 02:23:38 +02:00
Changed boolean style.
This commit is contained in:
parent
f0f69eabe6
commit
c460a582e4
2 changed files with 64 additions and 63 deletions
|
@ -11,47 +11,69 @@ Item {
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
width: parent.width;
|
width: parent.width - 10;
|
||||||
height: parent.height;
|
height: parent.height;
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter;
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
color: settingEnabled ? "#077e30" : "darkgray";
|
|
||||||
height: parent.parent.height - 15;
|
|
||||||
width: 90;
|
|
||||||
radius: 10;
|
|
||||||
id: toggleButton
|
|
||||||
|
|
||||||
Text {
|
|
||||||
width: parent.width;
|
|
||||||
height: parent.height;
|
|
||||||
text: settingEnabled ? "On" : "Off";
|
|
||||||
color: "white";
|
|
||||||
horizontalAlignment: Text.AlignHCenter;
|
|
||||||
verticalAlignment: Text.AlignVCenter;
|
|
||||||
font.pointSize: 14;
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
settingEnabled = !settingEnabled
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: 70
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.left: toggleButton.right + 5;
|
id: settingTextElem
|
||||||
height: parent.height;
|
height: parent.height;
|
||||||
text: settingText;
|
text: settingText;
|
||||||
color: "white";
|
color: "white";
|
||||||
font.pointSize: 14;
|
font.pointSize: 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.alignment: Qt.AlignRight;
|
||||||
|
anchors.left: settingTextElem.right + 5;
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: "<";
|
||||||
|
font.pointSize: 16;
|
||||||
|
color: "white";
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
color: "transparent";
|
||||||
|
height: parent.parent.height - 15;
|
||||||
|
width: 200;
|
||||||
|
radius: 10;
|
||||||
|
border.color: settingEnabled ? "white" : "#333";
|
||||||
|
border.width: 1;
|
||||||
|
|
||||||
|
Text {
|
||||||
|
width: parent.width;
|
||||||
|
height: parent.height;
|
||||||
|
text: settingEnabled ? "Enabled" : "Disabled";
|
||||||
|
color: settingEnabled ? "white" : "gray";
|
||||||
|
horizontalAlignment: Text.AlignHCenter;
|
||||||
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
font.pointSize: 14;
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
settingEnabled = !settingEnabled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: 70
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: ">";
|
||||||
|
font.pointSize: 16;
|
||||||
|
color: "white";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -87,40 +87,21 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rendering Effects
|
// Rendering Effects
|
||||||
RowLayout {
|
SettingBoolean {
|
||||||
width: parent.width
|
settingText: "Rendering effects";
|
||||||
|
settingEnabled: Render.renderMethod == 0
|
||||||
|
|
||||||
Text {
|
onSettingEnabledChanged: {
|
||||||
text: "Rendering effects"
|
Render.renderMethod = settingEnabled ? 0 : 1;
|
||||||
color: "white"
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width - 150
|
|
||||||
font.pointSize: 14
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
CheckBox {
|
|
||||||
id: rendering_effects_state
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
checked: Render.renderMethod == 1
|
|
||||||
}
|
|
||||||
|
|
||||||
onCheckedChanged: {
|
|
||||||
if (checked){
|
|
||||||
Render.renderMethod = 0;
|
|
||||||
} else {
|
|
||||||
Render.renderMethod = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rendering Effects sub options
|
// Rendering Effects sub options
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true;
|
Layout.fillWidth: true;
|
||||||
visible: rendering_effects_state.checked == true;
|
visible: Render.renderMethod == 0;
|
||||||
height: children[0].height;
|
height: children[0].height;
|
||||||
|
width: parent.width;
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: "#222222";
|
color: "#222222";
|
||||||
|
@ -128,15 +109,13 @@ Rectangle {
|
||||||
height: children[0].height;
|
height: children[0].height;
|
||||||
radius: 10;
|
radius: 10;
|
||||||
|
|
||||||
GridLayout {
|
ColumnLayout {
|
||||||
columns: 2;
|
|
||||||
width: parent.width - 10;
|
width: parent.width - 10;
|
||||||
anchors.horizontalCenter: parent.horizontalCenter;
|
|
||||||
id: renderSettingsContainer;
|
id: renderSettingsContainer;
|
||||||
|
|
||||||
SettingBoolean {
|
SettingBoolean {
|
||||||
settingText: "Shadows";
|
settingText: "Shadows";
|
||||||
settingEnabled: Render.shadowsEnabled
|
settingEnabled: Render.shadowsEnabled;
|
||||||
|
|
||||||
onSettingEnabledChanged: {
|
onSettingEnabledChanged: {
|
||||||
Render.shadowsEnabled = settingEnabled;
|
Render.shadowsEnabled = settingEnabled;
|
||||||
|
|
Loading…
Reference in a new issue