diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2013-01-13 15:39:53 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2013-01-13 15:39:53 -0600 |
| commit | c6e8239fd93e1670daa538eced2dcbbfbfd84e47 (patch) | |
| tree | 84e31a3855467bc5821276d1e220278baa71c9da /Source | |
| parent | a9ff3709e485a4f38189c694c540652468cc1d19 (diff) | |
theme selection working now
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinWX/Src/ConfigMain.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index 0277a117ea..1f1d8a3619 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -17,10 +17,12 @@ #include <string> // System #include <vector> +#include <algorithm> #include <wx/spinbutt.h> #include "Common.h" #include "CommonPaths.h" +#include "FileSearch.h" #include "Core.h" // Core #include "HW/EXI.h" @@ -576,10 +578,40 @@ void CConfigMain::CreateGUIControls() sInterface->Add(InterfaceLang, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); sInterface->AddStretchSpacer(); sInterface->Add(HotkeyConfig, 0, wxALIGN_RIGHT | wxALL, 5); + + // theme selection + auto const theme_selection = new wxChoice(DisplayPage, wxID_ANY); + + CFileSearch cfs(CFileSearch::XStringVector(1, "*"), CFileSearch::XStringVector(1, File::GetUserPath(D_THEMES_IDX))); + auto const& sv = cfs.GetFileNames(); + std::for_each(sv.begin(), sv.end(), [theme_selection](const std::string& filename) + { + std::string name, ext; + SplitPath(filename, NULL, &name, &ext); + + name += ext; + theme_selection->Append(name); + + if (SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name == name) + theme_selection->SetSelection(theme_selection->GetCount() - 1); + }); + + theme_selection->Bind(wxEVT_COMMAND_CHOICE_SELECTED, [this,theme_selection](wxEvent&) + { + SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name = theme_selection->GetStringSelection(); + main_frame->InitBitmaps(); + }); + + auto const scInterface = new wxBoxSizer(wxHORIZONTAL); + scInterface->Add(TEXT_BOX(DisplayPage, _("Theme:")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + scInterface->Add(theme_selection, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + scInterface->AddStretchSpacer(); + sbInterface = new wxStaticBoxSizer(wxVERTICAL, DisplayPage, _("Interface Settings")); sbInterface->Add(ConfirmStop, 0, wxALL, 5); sbInterface->Add(UsePanicHandlers, 0, wxALL, 5); sbInterface->Add(OnScreenDisplayMessages, 0, wxALL, 5); + sbInterface->Add(scInterface, 0, wxEXPAND | wxALL, 5); sbInterface->Add(sInterface, 0, wxEXPAND | wxALL, 5); sDisplayPage = new wxBoxSizer(wxVERTICAL); sDisplayPage->Add(sbInterface, 0, wxEXPAND | wxALL, 5); |
