Backlight setting

This commit is contained in:
MihailRis
2023-11-23 14:10:08 +03:00
parent f45fcffaf8
commit 568c612970
9 changed files with 44 additions and 9 deletions
+20 -1
View File
@@ -246,7 +246,7 @@ Panel* create_settings_panel(Engine* engine, PagesControl* menu) {
panel->add(trackbar);
}
{
/* V-Sync checkbox */{
Panel* checkpanel = new Panel(vec2(400, 32), vec4(5.0f), 1.0f);
checkpanel->color(vec4(0.0f));
checkpanel->orientation(Orientation::horizontal);
@@ -265,6 +265,25 @@ Panel* create_settings_panel(Engine* engine, PagesControl* menu) {
panel->add(checkpanel);
}
/* Backlight checkbox */{
Panel* checkpanel = new Panel(vec2(400, 32), vec4(5.0f), 1.0f);
checkpanel->color(vec4(0.0f));
checkpanel->orientation(Orientation::horizontal);
CheckBox* checkbox = new CheckBox();
checkbox->margin(vec4(0.0f, 0.0f, 5.0f, 0.0f));
checkbox->supplier([=]() {
return engine->getSettings().graphics.backlight != 0;
});
checkbox->consumer([=](bool checked) {
engine->getSettings().graphics.backlight = checked;
});
checkpanel->add(checkbox);
checkpanel->add(new Label(L"Backlight"));
panel->add(checkpanel);
}
panel->add(gotoButton(L"Controls", "controls", menu));
panel->add(backButton(menu));
panel->refresh();