Gray out anti-aliasing on forward renderer.

Added disabled property to combo-box.
This commit is contained in:
armored-dragon 2025-07-15 04:58:50 -05:00
parent 44cc890de2
commit 5f7336c341
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B
2 changed files with 16 additions and 2 deletions

View file

@ -10,6 +10,7 @@ Item {
property var _optionText: "";
readonly property string optionText: _optionText;
property var options: [""];
property bool disabled: false;
signal valueChanged(int index);
@ -92,7 +93,7 @@ Item {
background: Rectangle {
id: comboBoxBackground;
color: "#333";
color: disabled ? "gray" : "#333";
radius: 10;
width: parent.width;
}
@ -152,15 +153,18 @@ Item {
propagateComposedEvents: true;
onPressed: {
mouse.accepted = false
if (disabled) return;
mouse.accepted = false;
}
onEntered: {
if (disabled) return;
backgroundElement.color = "#333";
comboBoxBackground.color = "#444";
}
onExited: {
if (disabled) return;
backgroundElement.color = "transparent";
comboBoxBackground.color = "#333";
}
@ -174,6 +178,11 @@ Item {
}
}
onDisabledChanged: {
if (disabled) comboBoxBackground.color = "gray";
else comboBoxBackground.color = "#333";
}
// Updates the contents of a combobox.
// This is only required if the desired contents needs to be gathered from a javascript function and then set after the fact.
// Ideally, this would not be used, but sometimes you gotta do what you gotta do.

View file

@ -311,10 +311,15 @@ Flickable {
settingText: "Anti-aliasing";
optionIndex: Render.antialiasingMode;
options: ["None", "TAA", "FXAA"];
disabled: Render.renderMethod;
onValueChanged: {
Render.antialiasingMode = index;
}
onDisabledChanged: {
if (disabled) setOptionIndex(0);
}
}
}