From 053b7b8a9b9105f5b94df485c74d537366caeff6 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Thu, 26 Mar 2009 20:24:16 +0000 Subject: Theme selection dialog now automatically selects the currently active theme. Fixes bug #2706967. svn-id: r39703 --- gui/themebrowser.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3