clean up refreshes

This is a larger clean-up of the refresh situation.
The general shift is that refreshes are now mainly triggered by
the (top-level) widgets when they get shown or closed via UIManager.

All refreshes for the widgets when they are in use were handled by
themselves before. This adds the case of showing/closing.

It is the desired result of not having UIManager:show()/:close()
do (full screen) refreshes on its own.
This commit is contained in:
Hans-Werner Hilse
2014-12-01 14:39:41 +00:00
parent 9c4088a3ac
commit 94ce08937a
20 changed files with 159 additions and 62 deletions

View File

@@ -87,6 +87,10 @@ function InputText:initTextBox(text)
text_widget,
}
self.dimen = self[1]:getSize()
UIManager:setDirty(self.parent, function()
return "partial", self[1].dimen
end)
end
function InputText:initCharlist(text)
@@ -154,9 +158,6 @@ function InputText:addChar(char)
table.insert(self.charlist, self.charpos, char)
self.charpos = self.charpos + 1
self:initTextBox(table.concat(self.charlist))
UIManager:setDirty(self.parent, function()
return "ui", self.dimen
end)
end
function InputText:delChar()
@@ -164,13 +165,12 @@ function InputText:delChar()
self.charpos = self.charpos - 1
table.remove(self.charlist, self.charpos)
self:initTextBox(table.concat(self.charlist))
UIManager:setDirty(self.parent, "ui")
end
function InputText:clear()
self:initTextBox("")
UIManager:setDirty(self.parent, function()
return "ui", self.dimen
return "ui", self[1][1].dimen
end)
end
@@ -181,7 +181,7 @@ end
function InputText:setText(text)
self:initTextBox(text)
UIManager:setDirty(self.parent, function()
return "partial", self.dimen
return "partial", self[1].dimen
end)
end