Backend abstraction + added android support + partial high DPI scaling
This commit is contained in:
@@ -23,8 +23,11 @@ namespace thememenu {
|
||||
it = std::find(themeNames.begin(), themeNames.end(), "Dark");
|
||||
selectedThemeName = "Dark";
|
||||
}
|
||||
gui::themeManager.applyTheme(selectedThemeName);
|
||||
themeId = std::distance(themeNames.begin(), it);
|
||||
applyTheme();
|
||||
|
||||
// Apply scaling
|
||||
ImGui::GetStyle().ScaleAllSizes(style::uiScale);
|
||||
|
||||
themeNamesTxt = "";
|
||||
for (auto name : themeNames) {
|
||||
@@ -33,12 +36,16 @@ namespace thememenu {
|
||||
}
|
||||
}
|
||||
|
||||
void applyTheme() {
|
||||
gui::themeManager.applyTheme(themeNames[themeId]);
|
||||
}
|
||||
|
||||
void draw(void* ctx) {
|
||||
float menuWidth = ImGui::GetContentRegionAvailWidth();
|
||||
ImGui::LeftLabel("Theme");
|
||||
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
||||
if (ImGui::Combo("##theme_select_combo", &themeId, themeNamesTxt.c_str())) {
|
||||
gui::themeManager.applyTheme(themeNames[themeId]);
|
||||
applyTheme();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["theme"] = themeNames[themeId];
|
||||
core::configManager.release(true);
|
||||
|
||||
Reference in New Issue
Block a user