GUI: Fix Dialog's and TabWidget's reflowLayout()

This commit is contained in:
Alexander Tkachev 2016-06-23 22:54:07 +06:00 committed by Eugene Sandulenko
parent 421f9826c8
commit 24963ac97d
2 changed files with 6 additions and 6 deletions

View File

@ -113,13 +113,13 @@ void Dialog::reflowLayout() {
// changed, so any cached image may be invalid. The subsequent redraw // changed, so any cached image may be invalid. The subsequent redraw
// should be treated as the very first draw. // should be treated as the very first draw.
GuiObject::reflowLayout();
Widget *w = _firstWidget; Widget *w = _firstWidget;
while (w) { while (w) {
w->reflowLayout(); w->reflowLayout();
w = w->_next; w = w->_next;
} }
GuiObject::reflowLayout();
} }
void Dialog::lostFocus() { void Dialog::lostFocus() {

View File

@ -258,6 +258,10 @@ void TabWidget::adjustTabs(int value) {
void TabWidget::reflowLayout() { void TabWidget::reflowLayout() {
Widget::reflowLayout(); Widget::reflowLayout();
_tabHeight = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Height");
_tabWidth = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Width");
_titleVPad = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Padding.Top");
for (uint i = 0; i < _tabs.size(); ++i) { for (uint i = 0; i < _tabs.size(); ++i) {
Widget *w = _tabs[i].firstWidget; Widget *w = _tabs[i].firstWidget;
while (w) { while (w) {
@ -266,10 +270,6 @@ void TabWidget::reflowLayout() {
} }
} }
_tabHeight = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Height");
_tabWidth = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Width");
_titleVPad = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Padding.Top");
if (_tabWidth == 0) { if (_tabWidth == 0) {
_tabWidth = 40; _tabWidth = 40;
#ifdef __DS__ #ifdef __DS__