Merge pull request #10052 from vladest/tablet-ui-ambient-occlusion

Set z-order of comboboxes to make sure lowest will no overlap higher …
This commit is contained in:
Zach Fox 2017-03-30 15:19:43 -07:00 committed by GitHub
commit 0bdd0f5c08

View file

@ -89,14 +89,17 @@ Preference {
if (categoryPreferences) { if (categoryPreferences) {
console.log("Category " + root.name + " with " + categoryPreferences.length + " preferences"); console.log("Category " + root.name + " with " + categoryPreferences.length + " preferences");
for (var j = 0; j < categoryPreferences.length; ++j) { for (var j = 0; j < categoryPreferences.length; ++j) {
buildPreference(categoryPreferences[j]); //provide component position within column
//lowest numbers on top
buildPreference(categoryPreferences[j], j);
} }
} }
} }
function buildPreference(preference) { function buildPreference(preference, itemNum) {
console.log("\tPreference type " + preference.type + " name " + preference.name) console.log("\tPreference type " + preference.type + " name " + preference.name)
var builder; var builder;
var zpos;
switch (preference.type) { switch (preference.type) {
case Preference.Editable: case Preference.Editable:
checkBoxCount = 0; checkBoxCount = 0;
@ -136,11 +139,14 @@ Preference {
case Preference.ComboBox: case Preference.ComboBox:
checkBoxCount = 0; checkBoxCount = 0;
builder = comboBoxBuilder; builder = comboBoxBuilder;
//make sure that combo boxes sitting higher will have higher z coordinate
//to be not overlapped when drop down is active
zpos = root.z + 1000 - itemNum
break; break;
}; };
if (builder) { if (builder) {
preferences.push(builder.createObject(contentContainer, { preference: preference, isFirstCheckBox: (checkBoxCount === 1) })); preferences.push(builder.createObject(contentContainer, { preference: preference, isFirstCheckBox: (checkBoxCount === 1) , z: zpos}));
} }
} }
} }