GUI: add colors base setting
pave the way for.light themes
This commit is contained in:
parent
64146bed5e
commit
e0cda2a77f
|
@ -5440,7 +5440,11 @@ void FurnaceGUI::parseKeybinds() {
|
||||||
|
|
||||||
void FurnaceGUI::applyUISettings() {
|
void FurnaceGUI::applyUISettings() {
|
||||||
ImGuiStyle sty;
|
ImGuiStyle sty;
|
||||||
ImGui::StyleColorsDark(&sty);
|
if (settings.guiColorsBase) {
|
||||||
|
ImGui::StyleColorsLight(&sty);
|
||||||
|
} else {
|
||||||
|
ImGui::StyleColorsDark(&sty);
|
||||||
|
}
|
||||||
|
|
||||||
if (settings.dpiScale>=0.5f) dpiScale=settings.dpiScale;
|
if (settings.dpiScale>=0.5f) dpiScale=settings.dpiScale;
|
||||||
|
|
||||||
|
|
|
@ -493,6 +493,7 @@ class FurnaceGUI {
|
||||||
int statusDisplay;
|
int statusDisplay;
|
||||||
float dpiScale;
|
float dpiScale;
|
||||||
int viewPrevPattern;
|
int viewPrevPattern;
|
||||||
|
int guiColorsBase;
|
||||||
unsigned int maxUndoSteps;
|
unsigned int maxUndoSteps;
|
||||||
String mainFontPath;
|
String mainFontPath;
|
||||||
String patFontPath;
|
String patFontPath;
|
||||||
|
@ -533,6 +534,7 @@ class FurnaceGUI {
|
||||||
statusDisplay(0),
|
statusDisplay(0),
|
||||||
dpiScale(0.0f),
|
dpiScale(0.0f),
|
||||||
viewPrevPattern(1),
|
viewPrevPattern(1),
|
||||||
|
guiColorsBase(0),
|
||||||
maxUndoSteps(100),
|
maxUndoSteps(100),
|
||||||
mainFontPath(""),
|
mainFontPath(""),
|
||||||
patFontPath(""),
|
patFontPath(""),
|
||||||
|
|
|
@ -425,6 +425,13 @@ void FurnaceGUI::drawSettings() {
|
||||||
|
|
||||||
if (ImGui::TreeNode("Color scheme")) {
|
if (ImGui::TreeNode("Color scheme")) {
|
||||||
if (ImGui::TreeNode("General")) {
|
if (ImGui::TreeNode("General")) {
|
||||||
|
ImGui::Text("Color scheme type:");
|
||||||
|
if (ImGui::RadioButton("Dark##gcb0",settings.guiColorsBase==0)) {
|
||||||
|
settings.guiColorsBase=0;
|
||||||
|
}
|
||||||
|
if (ImGui::RadioButton("Light##gcb1",settings.guiColorsBase==1)) {
|
||||||
|
settings.guiColorsBase=1;
|
||||||
|
}
|
||||||
UI_COLOR_CONFIG(GUI_COLOR_BACKGROUND,"Background");
|
UI_COLOR_CONFIG(GUI_COLOR_BACKGROUND,"Background");
|
||||||
UI_COLOR_CONFIG(GUI_COLOR_FRAME_BACKGROUND,"Window background");
|
UI_COLOR_CONFIG(GUI_COLOR_FRAME_BACKGROUND,"Window background");
|
||||||
UI_COLOR_CONFIG(GUI_COLOR_MODAL_BACKDROP,"Modal backdrop");
|
UI_COLOR_CONFIG(GUI_COLOR_MODAL_BACKDROP,"Modal backdrop");
|
||||||
|
@ -856,6 +863,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
settings.statusDisplay=e->getConfInt("statusDisplay",0);
|
settings.statusDisplay=e->getConfInt("statusDisplay",0);
|
||||||
settings.dpiScale=e->getConfFloat("dpiScale",0.0f);
|
settings.dpiScale=e->getConfFloat("dpiScale",0.0f);
|
||||||
settings.viewPrevPattern=e->getConfInt("viewPrevPattern",1);
|
settings.viewPrevPattern=e->getConfInt("viewPrevPattern",1);
|
||||||
|
settings.guiColorsBase=e->getConfInt("guiColorsBase",0);
|
||||||
|
|
||||||
// keybinds
|
// keybinds
|
||||||
LOAD_KEYBIND(GUI_ACTION_OPEN,FURKMOD_CMD|SDLK_o);
|
LOAD_KEYBIND(GUI_ACTION_OPEN,FURKMOD_CMD|SDLK_o);
|
||||||
|
@ -1051,6 +1059,7 @@ void FurnaceGUI::commitSettings() {
|
||||||
e->setConf("statusDisplay",settings.statusDisplay);
|
e->setConf("statusDisplay",settings.statusDisplay);
|
||||||
e->setConf("dpiScale",settings.dpiScale);
|
e->setConf("dpiScale",settings.dpiScale);
|
||||||
e->setConf("viewPrevPattern",settings.viewPrevPattern);
|
e->setConf("viewPrevPattern",settings.viewPrevPattern);
|
||||||
|
e->setConf("guiColorsBase",settings.guiColorsBase);
|
||||||
|
|
||||||
PUT_UI_COLOR(GUI_COLOR_BACKGROUND);
|
PUT_UI_COLOR(GUI_COLOR_BACKGROUND);
|
||||||
PUT_UI_COLOR(GUI_COLOR_FRAME_BACKGROUND);
|
PUT_UI_COLOR(GUI_COLOR_FRAME_BACKGROUND);
|
||||||
|
|
Loading…
Reference in a new issue