Theme selection dialog now automatically selects the currently active theme. Fixes bug #2706967.

svn-id: r39703
This commit is contained in:
Vicent Marti 2009-03-26 20:24:16 +00:00
parent e5e1615280
commit 053b7b8a9b

View File

@ -97,12 +97,20 @@ void ThemeBrowser::updateListing() {
ThemeEngine::listUsableThemes(_themes);
const Common::String currentThemeId = g_gui.theme()->getThemeId();
int currentThemeIndex = 0, index = 0;
Common::StringList list;
for (ThemeDescList::const_iterator i = _themes.begin(); i != _themes.end(); ++i)
for (ThemeDescList::const_iterator i = _themes.begin(); i != _themes.end(); ++i, ++index) {
list.push_back(i->name);
if (i->id == currentThemeId)
currentThemeIndex = index;
}
_fileList->setList(list);
_fileList->scrollTo(0);
_fileList->setSelected(currentThemeIndex);
// Finally, redraw
draw();