fix gui scale slider (#3466)
Some checks are pending
Nightly Build / Check Recent Commit (push) Successful in 15s
Nightly Build / Build Nightly (push) Waiting to run
Nightly Build / Recreate Release (push) Blocked by required conditions

This commit is contained in:
lonelybud 2024-07-29 14:53:38 +05:30 committed by GitHub
parent fee95df844
commit 6c5a653d1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,8 +6,13 @@ namespace big
void view::gui_settings() void view::gui_settings()
{ {
components::sub_title("SETTINGS_UI_SCALE"_T); components::sub_title("SETTINGS_UI_SCALE"_T);
if (ImGui::SliderFloat("##gui-scale", &g.window.gui_scale, 0.75f, 1.5f, "%.2f")) static auto gui_scale = g.window.gui_scale;
ImGui::SliderFloat("##gui-scale", &gui_scale, 0.75f, 1.5f, "%.2f");
if (ImGui::IsItemDeactivatedAfterEdit())
{
g.window.gui_scale = gui_scale;
g_renderer.rescale(g.window.gui_scale); g_renderer.rescale(g.window.gui_scale);
}
components::sub_title("SETTINGS_UI_COLOR"_T); components::sub_title("SETTINGS_UI_COLOR"_T);
static ImVec4 col_gui = ImGui::ColorConvertU32ToFloat4(g.window.background_color); static ImVec4 col_gui = ImGui::ColorConvertU32ToFloat4(g.window.background_color);