Added missing fullscreen monitor selection.

This commit is contained in:
armored-dragon 2024-11-23 09:28:34 -06:00
parent 2fd7c44ac6
commit f7833fa6b3
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B
2 changed files with 41 additions and 0 deletions

View file

@ -6,6 +6,8 @@ Item {
id: root;
property string settingText: "";
property int optionIndex: 0;
property var _optionText: ""
readonly property string optionText: _optionText
property var options: [];
signal valueChanged(int index);
@ -37,6 +39,7 @@ Item {
onCurrentIndexChanged: {
valueChanged(currentIndex);
_optionText = options[currentIndex];
}
delegate: ItemDelegate {
@ -118,4 +121,20 @@ Item {
}
}
}
// 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.
function setOptions(newOptions) {
// Clear the model
options = [];
// Add the new options to the model
for (var opt of newOptions){
options.push(opt);
}
// Whack it with a hammer
control.model = options;
}
}

View file

@ -257,6 +257,28 @@ Rectangle {
}
}
// Fullscreen Display
SettingComboBox {
settingText: "Fullscreen Display";
Component.onCompleted: {
var screens = Render.getScreens();
var selected = Render.getFullScreenScreen();
setOptions(screens);
for (let i = 0; screens.length > i; i++) {
if (screens[i] == selected) {
optionIndex = i;
return;
}
}
}
onValueChanged: {
Render.setFullScreenScreen(optionText);
}
}
// FOV
SettingSlider {
settingText: "Field of View";