diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 763234f12b3407c4996f28b31991812c29847ec4..b59af06667fb208b92d1f60ed1f17d41069c32c5 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -432,7 +432,7 @@ StringXNumber GeneralOptions_Number[] = { "planes window" }, { F|O, "ClipWholeElements" , opt_general_clip_whole_elements , 0. , "Clip whole elements" }, - { F|O, "ColorScheme", opt_general_color_scheme , 1. , + { F|S, "ColorScheme", opt_general_color_scheme , 1. , "Default color scheme for graphics (0=dark, 1=light or 2=grayscale)" }, { F|O, "ConfirmOverwrite" , opt_general_confirm_overwrite, 1. , "Ask confirmation before overwriting files?" }, @@ -1341,7 +1341,7 @@ StringXNumber ViewOptions_Number[] = { "Draw the `N minus b'-dimensional boundary of the element (N=element " "dimension, b=option value)" }, - { F|O, "CenterGlyphs" , opt_view_center_glyphs , 1, + { F|O, "CenterGlyphs" , opt_view_center_glyphs , 0, "Center glyphs (arrows, numbers, etc.)? (0=left, 1=centered, 2=right)" }, { F, "Clip" , opt_view_clip , 0., "Enable clipping planes? (Plane[i]=2^i, i=0,...,5)" }, @@ -1684,22 +1684,22 @@ StringXNumber PrintOptions_Number[] = { StringXColor GeneralOptions_Color[] = { { F|O, "Background" , opt_general_color_background , - {0, 0, 0, 255}, {255, 255, 255, 255}, {255, 255, 255, 255}, + {245, 245, 245, 255}, {255, 255, 255, 255}, {245, 245, 245, 255}, "Background color" }, { F|O, "BackgroundGradient" , opt_general_color_background_gradient , - {0, 0, 128, 255}, {208, 215, 255, 255}, {125, 125, 125, 255}, + {145, 145, 145, 255}, {208, 215, 255, 255}, {145, 145, 145, 255}, "Background gradient color" }, { F|O, "Foreground" , opt_general_color_foreground , - {170, 170, 170, 255}, {85, 85, 85, 255}, {128, 128, 128, 255}, + {85, 85, 85, 255}, {85, 85, 85, 255}, {128, 128, 128, 255}, "Foreground color" }, { F|O, "Text" , opt_general_color_text , - {255, 255, 255, 255}, {0, 0, 0, 255}, {0, 0, 0, 255}, + {0, 0, 0, 255}, {0, 0, 0, 255}, {0, 0, 0, 255}, "Text color" }, { F|O, "Axes" , opt_general_color_axes , - {255, 255, 255, 255}, {0, 0, 0, 255}, {0, 0, 0, 255}, + {0, 0, 0, 255}, {0, 0, 0, 255}, {0, 0, 0, 255}, "Axes color" }, { F|O, "SmallAxes" , opt_general_color_small_axes , - {255, 255, 255, 255}, {0, 0, 0, 255}, {0, 0, 0, 255}, + {0, 0, 0, 255}, {0, 0, 0, 255}, {0, 0, 0, 255}, "Small axes color" }, { F|O, "AmbientLight" , opt_general_color_ambient_light, {25, 25, 25, 255}, {25, 25, 25, 255}, {25, 25, 25, 255}, @@ -1715,7 +1715,7 @@ StringXColor GeneralOptions_Color[] = { StringXColor GeometryOptions_Color[] = { { F|O, "Points" , opt_geometry_color_points , - {178, 182, 129, 255}, {90, 90, 90, 255}, {0, 0, 0, 255}, + {90, 90, 90, 255}, {90, 90, 90, 255}, {0, 0, 0, 255}, "Normal geometry point color" }, { F|O, "Lines" , opt_geometry_color_lines , {0, 0, 255, 255}, {0, 0, 255, 255}, {0, 0, 0, 255}, @@ -1862,7 +1862,7 @@ StringXColor PostProcessingOptions_Color[] = { { 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 } } ; -#define ELECOL {255, 255, 255, 255}, {0, 0, 0, 255}, {0, 0, 0, 255} +#define ELECOL {0, 0, 0, 255}, {0, 0, 0, 255}, {0, 0, 0, 255} StringXColor ViewOptions_Color[] = { { F|O, "Points" , opt_view_color_points , ELECOL, "Point color" }, diff --git a/Common/Options.cpp b/Common/Options.cpp index a0f30d8b92917b0cd578bb9ecd02c95d0df955cf..557639ca669ddf10060aa2ce0424fb8676c57a7c 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1946,6 +1946,11 @@ double opt_general_gui_color_scheme(OPT_ARGS_NUM) { if(action & GMSH_SET) CTX::instance()->guiColorScheme = (int)val; +#if defined(HAVE_FLTK) + if(FlGui::available() && (action & GMSH_GUI)) + FlGui::instance()->options->general.butt[21]->value + (CTX::instance()->guiColorScheme); +#endif return CTX::instance()->guiColorScheme; } @@ -3417,15 +3422,14 @@ double opt_general_stereo_mode(OPT_ARGS_NUM) { if(action & GMSH_SET) CTX::instance()->stereo = (int)val; - if (CTX::instance()->stereo) opt_general_camera_mode(num, action, 1.); - + if (CTX::instance()->stereo) + opt_general_camera_mode(num, action, 1.); #if defined(HAVE_FLTK) /* - if(FlGui::available() && (action & GMSH_GUI)) - FlGui::instance()->options->general.butt[17]->value(CTX::instance()->stereo); -*/ + if(FlGui::available() && (action & GMSH_GUI)) + FlGui::instance()->options->general.butt[17]->value(CTX::instance()->stereo); + */ #endif - return CTX::instance()->stereo ; } diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp index 142a2c89e3f0b6bfc22ac5417717af0727630bdd..1068d9bf78e924fc8547433d4a36d2411a50c15b 100644 --- a/Fltk/FlGui.cpp +++ b/Fltk/FlGui.cpp @@ -254,8 +254,8 @@ FlGui::FlGui(int argc, char **argv) if(CTX::instance()->guiColorScheme){ // dark mode Fl::background(50, 50, 50); - Fl::background2(130, 130, 130); - Fl::foreground(245, 245, 245); + Fl::background2(120, 120, 120); + Fl::foreground(240, 240, 240); for (int i = 0; i < FL_NUM_GRAY; i++) { double min = 0., max = 135.; int d = (int)(min + i * (max - min) / (FL_NUM_GRAY - 1.)); diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp index 596ec685e05ad3552277391f6f6a1a7b652705f8..897408bd2c6814f218d6baa35dfeca8ffff3ccbc 100644 --- a/Fltk/onelabGroup.cpp +++ b/Fltk/onelabGroup.cpp @@ -390,7 +390,7 @@ static unsigned char gear_bits[] = { onelabGroup::onelabGroup(int x, int y, int w, int h, const char *l) : Fl_Group(x,y,w,h,l), _stop(false), _enableTreeWidgetResize(false) { - int col = FL_BACKGROUND2_COLOR; + int col = CTX::instance()->guiColorScheme ? FL_BACKGROUND2_COLOR : FL_BACKGROUND2_COLOR; color(col); box(GMSH_SIMPLE_RIGHT_BOX); diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp index d5fb62376aa11d22f8ac7508e744552bb17a8048..070ed0f00b34fdca7c5498261eaa2b3eadced9d8 100644 --- a/Fltk/optionWindow.cpp +++ b/Fltk/optionWindow.cpp @@ -299,6 +299,12 @@ static void general_options_ok_cb(Fl_Widget *w, void *data) (CTX::instance()->homeDir + CTX::instance()->sessionFileName).c_str()); opt_general_options_save(0, GMSH_SET, o->general.butt[9]->value()); opt_general_expert_mode(0, GMSH_SET, o->general.butt[10]->value()); + + if(opt_general_gui_color_scheme(0, GMSH_GET, 0) != o->general.butt[21]->value()){ + opt_general_gui_color_scheme(0, GMSH_SET, o->general.butt[21]->value()); + opt_general_color_scheme(0, GMSH_SET|GMSH_GUI, o->general.butt[21]->value() ? 0. : 1.); + } + opt_general_tooltips(0, GMSH_SET, o->general.butt[13]->value()); opt_general_confirm_overwrite(0, GMSH_SET, o->general.butt[14]->value()); opt_general_rotation_center_cg(0, GMSH_SET, o->general.butt[15]->value()); @@ -368,7 +374,6 @@ static void general_options_ok_cb(Fl_Widget *w, void *data) opt_general_camera_mode(0, GMSH_SET, o->general.butt[18]->value()); o->activate((const char*)data); - opt_general_eye_sep_ratio(0, GMSH_SET, o->general.value[29]->value()); opt_general_focallength_ratio(0, GMSH_SET, o->general.value[30]->value()); opt_general_camera_aperture(0, GMSH_SET, o->general.value[31]->value()); @@ -1362,67 +1367,73 @@ optionWindow::optionWindow(int deltaFontSize) { Fl_Group *o = new Fl_Group (L + WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "General"); + general.butt[10] = new Fl_Check_Button (L + 2 * WB, 2 * WB + 1 * BH, BW, BH, "Enable expert mode"); general.butt[10]->type(FL_TOGGLE_BUTTON); general.butt[10]->callback(general_options_ok_cb); + general.butt[21] = new Fl_Check_Button + (L + 2 * WB, 2 * WB + 2 * BH, BW, BH, "Use dark interface (requires restart)"); + general.butt[21]->type(FL_TOGGLE_BUTTON); + general.butt[21]->callback(general_options_ok_cb); + general.butt[13] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 2 * BH, BW, BH, "Show tooltips"); + (L + 2 * WB, 2 * WB + 3 * BH, BW, BH, "Show tooltips"); general.butt[13]->type(FL_TOGGLE_BUTTON); general.butt[13]->callback(general_options_ok_cb); general.butt[6] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 3 * BH, BW, BH, "Show bounding boxes"); + (L + 2 * WB, 2 * WB + 4 * BH, BW, BH, "Show bounding boxes"); general.butt[6]->tooltip("(Alt+b)"); general.butt[6]->type(FL_TOGGLE_BUTTON); general.butt[6]->callback(general_options_ok_cb); general.butt[2] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 4 * BH, BW, BH, + (L + 2 * WB, 2 * WB + 5 * BH, BW, BH, "Draw simplified model during user interaction"); general.butt[2]->tooltip("(Alt+f)"); general.butt[2]->type(FL_TOGGLE_BUTTON); general.butt[2]->callback(general_options_ok_cb, (void*)"fast_redraw"); general.butt[11] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 5 * BH, BW, BH, "Enable mouse hover over meshes"); + (L + 2 * WB, 2 * WB + 6 * BH, BW, BH, "Enable mouse hover over meshes"); general.butt[11]->type(FL_TOGGLE_BUTTON); general.butt[11]->callback(general_options_ok_cb); general.butt[3] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 6 * BH, BW, BH, "Enable double buffering"); + (L + 2 * WB, 2 * WB + 7 * BH, BW, BH, "Enable double buffering"); general.butt[3]->type(FL_TOGGLE_BUTTON); general.butt[3]->callback(general_options_ok_cb); general.butt[12] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 7 * BH, BW, BH, "Enable antialiasing"); + (L + 2 * WB, 2 * WB + 8 * BH, BW, BH, "Enable antialiasing"); general.butt[12]->type(FL_TOGGLE_BUTTON); general.butt[12]->callback(general_options_ok_cb); general.butt[5] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 8 * BH, BW, BH, + (L + 2 * WB, 2 * WB + 9 * BH, BW, BH, "Use trackball rotation instead of Euler angles"); general.butt[5]->type(FL_TOGGLE_BUTTON); general.butt[5]->callback(general_options_ok_cb); general.butt[15] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 9 * BH, BW, BH, "Rotate around pseudo center of mass"); + (L + 2 * WB, 2 * WB + 10 * BH, BW, BH, "Rotate around pseudo center of mass"); general.butt[15]->type(FL_TOGGLE_BUTTON); general.butt[15]->callback(general_options_ok_cb, (void*)"rotation_center"); general.push[0] = new Fl_Button - (L + 2 * IW - 2 * WB, 2 * WB + 10 * BH, BB, BH, "Select"); + (L + 2 * IW - 2 * WB, 2 * WB + 11 * BH, BB, BH, "Select"); general.push[0]->callback(general_options_rotation_center_select_cb); general.value[8] = new Fl_Value_Input - (L + 2 * WB, 2 * WB + 10 * BH, IW / 3, BH); + (L + 2 * WB, 2 * WB + 11 * BH, IW / 3, BH); general.value[8]->callback(general_options_ok_cb, (void*)"rotation_center_coord"); general.value[9] = new Fl_Value_Input - (L + 2 * WB + IW / 3, 2 * WB + 10 * BH, IW / 3, BH); + (L + 2 * WB + IW / 3, 2 * WB + 11 * BH, IW / 3, BH); general.value[9]->callback(general_options_ok_cb, (void*)"rotation_center_coord"); general.value[10] = new Fl_Value_Input - (L + 2 * WB + 2 * IW / 3, 2 * WB + 10 * BH, IW / 3, BH, "Rotation center"); + (L + 2 * WB + 2 * IW / 3, 2 * WB + 11 * BH, IW / 3, BH, "Rotation center"); general.value[10]->align(FL_ALIGN_RIGHT); general.value[10]->callback(general_options_ok_cb, (void*)"rotation_center_coord"); diff --git a/Fltk/optionWindow.h b/Fltk/optionWindow.h index bbe00f3d9c2e208a5460d43b115bf9d93d347407..9ea3a6d80dbfbbb39b91e275c16e1e07ac4c0c2f 100644 --- a/Fltk/optionWindow.h +++ b/Fltk/optionWindow.h @@ -33,7 +33,7 @@ class optionWindow{ struct{ Fl_Group *group; - Fl_Check_Button *butt[21]; + Fl_Check_Button *butt[22]; Fl_Button *push[20]; Fl_Value_Input *value[50]; Fl_Button *color[50];