Fix keyboard flickering when select entities

Fix entities list footer count of selected entities in the process.
This commit is contained in:
David Rowe 2016-09-29 16:53:20 +13:00
parent 8e44096981
commit e3be34528f

View file

@ -122,6 +122,8 @@ function loaded() {
focus: false, focus: false,
entityIds: selection, entityIds: selection,
})); }));
refreshFooter();
} }
function onRowDoubleClicked() { function onRowDoubleClicked() {
@ -184,6 +186,7 @@ function loaded() {
function clearEntities() { function clearEntities() {
entities = {}; entities = {};
entityList.clear(); entityList.clear();
refreshFooter();
} }
var elSortOrder = { var elSortOrder = {
@ -236,13 +239,16 @@ function loaded() {
refreshFooter(); refreshFooter();
} }
function updateSelectedEntities(selectedEntities) { function updateSelectedEntities(selectedIDs) {
var notFound = false; var notFound = false;
for (var id in entities) { for (var id in entities) {
entities[id].el.className = ''; entities[id].el.className = '';
} }
for (var i = 0; i < selectedEntities.length; i++) {
var id = selectedEntities[i]; selectedEntities = [];
for (var i = 0; i < selectedIDs.length; i++) {
var id = selectedIDs[i];
selectedEntities.push(id);
if (id in entities) { if (id in entities) {
var entity = entities[id]; var entity = entities[id];
entity.el.className = 'selected'; entity.el.className = 'selected';
@ -251,10 +257,7 @@ function loaded() {
} }
} }
// HACK: Fixes the footer and header text sometimes not displaying after adding or deleting entities. refreshFooter();
// The problem appears to be a bug in the Qt HTML/CSS rendering (Qt 5.5).
document.getElementById("radius").focus();
document.getElementById("radius").blur();
return notFound; return notFound;
} }