diff options
author | Vicent Marti | 2009-03-26 20:24:16 +0000 |
---|---|---|
committer | Vicent Marti | 2009-03-26 20:24:16 +0000 |
commit | 053b7b8a9b9105f5b94df485c74d537366caeff6 (patch) | |
tree | c57e4114bcb60e165332e1e80924ee423ff11aa9 | |
parent | e5e16152808bfc44681a5ea217685fb474339064 (diff) | |
download | scummvm-rg350-053b7b8a9b9105f5b94df485c74d537366caeff6.tar.gz scummvm-rg350-053b7b8a9b9105f5b94df485c74d537366caeff6.tar.bz2 scummvm-rg350-053b7b8a9b9105f5b94df485c74d537366caeff6.zip |
Theme selection dialog now automatically selects the currently active theme. Fixes bug #2706967.
svn-id: r39703
-rw-r--r-- | gui/themebrowser.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp index d20320ad3e..f5dfd5950c 100644 --- a/gui/themebrowser.cpp +++ b/gui/themebrowser.cpp @@ -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(); |