mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:47:30 +02:00
Added missing fullscreen monitor selection.
This commit is contained in:
parent
2fd7c44ac6
commit
f7833fa6b3
2 changed files with 41 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue