diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-09-27 10:02:28 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-09-27 10:02:39 +0200 |
| commit | 06504e1840e8c8d316022f817f6b6b4dc2def00d (patch) | |
| tree | 81f4ab287430cbc62fffcad801b143f3f0c9c72a /fluid/alignment_panel.cxx | |
| parent | d20c68a4954f975f8a84306ab5d05b34e459ecff (diff) | |
Add Fl_Option::OPTION_SHOW_SCALING to fluid's "Global FLTK Settings".
Diffstat (limited to 'fluid/alignment_panel.cxx')
| -rw-r--r-- | fluid/alignment_panel.cxx | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/fluid/alignment_panel.cxx b/fluid/alignment_panel.cxx index 280cec0b6..8ce1725b0 100644 --- a/fluid/alignment_panel.cxx +++ b/fluid/alignment_panel.cxx @@ -554,6 +554,7 @@ static void refreshUI() { wDNDText->value(opt[Fl::OPTION_DND_TEXT][mode]); wGTKText->value(opt[Fl::OPTION_FNFC_USES_GTK][mode]); wPrintGTKText->value(opt[Fl::OPTION_PRINTER_USES_GTK][mode]); + wShowZoomFactor->value(opt[Fl::OPTION_SHOW_SCALING][mode]); } /** @@ -570,6 +571,7 @@ static void readPrefs() { opt_prefs.get("ShowTooltips", opt[Fl::OPTION_SHOW_TOOLTIPS][1], 2); opt_prefs.get("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK ][1], 2); opt_prefs.get("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK ][1], 2); + opt_prefs.get("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING ][1], 2); } { Fl_Preferences prefs(Fl_Preferences::USER, "fltk.org", "fltk"); @@ -580,6 +582,7 @@ static void readPrefs() { opt_prefs.get("ShowTooltips", opt[Fl::OPTION_SHOW_TOOLTIPS][0], 2); opt_prefs.get("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK ][0], 2); opt_prefs.get("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK ][0], 2); + opt_prefs.get("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING ][0], 2); } refreshUI(); } @@ -604,6 +607,8 @@ static void writePrefs() { else opt_prefs.set("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK][1]); if (opt[Fl::OPTION_PRINTER_USES_GTK][1]==2) opt_prefs.deleteEntry("PrintUsesGTK"); else opt_prefs.set("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK][1]); + if (opt[Fl::OPTION_SHOW_SCALING][1]==2) opt_prefs.deleteEntry("ShowZoomFactor"); + else opt_prefs.set("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING][1]); } { Fl_Preferences prefs(Fl_Preferences::USER, "fltk.org", "fltk"); @@ -620,6 +625,8 @@ static void writePrefs() { else opt_prefs.set("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK][0]); if (opt[Fl::OPTION_PRINTER_USES_GTK][0]==2) opt_prefs.deleteEntry("PrintUsesGTK"); else opt_prefs.set("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK][0]); + if (opt[Fl::OPTION_SHOW_SCALING][0]==2) opt_prefs.deleteEntry("ShowZoomFactor"); + else opt_prefs.set("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING][0]); } } @@ -724,6 +731,20 @@ Fl_Menu_Item menu_wPrintGTKText[] = { {0,0,0,0,0,0,0,0,0} }; +Fl_Choice *wShowZoomFactor=(Fl_Choice *)0; + +static void cb_wShowZoomFactor(Fl_Choice*, void*) { + int mode = wUserOrSystem->value(); +opt[Fl::OPTION_SHOW_SCALING ][mode] = wShowZoomFactor->value(); +} + +Fl_Menu_Item menu_wShowZoomFactor[] = { + {"off", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0}, + {"on", 0, 0, (void*)(1), 128, (uchar)FL_NORMAL_LABEL, 0, 14, 0}, + {"default", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0}, + {0,0,0,0,0,0,0,0,0} +}; + Fl_Choice *wUserOrSystem=(Fl_Choice *)0; static void cb_wUserOrSystem(Fl_Choice*, void*) { @@ -746,7 +767,7 @@ global_settings_window->hide(); } Fl_Double_Window* make_global_settings_window() { - { global_settings_window = new Fl_Double_Window(400, 455, "FLTK Preferences"); + { global_settings_window = new Fl_Double_Window(400, 531, "FLTK Preferences"); global_settings_window->color(FL_LIGHT1); { Fl_Group* o = new Fl_Group(10, 10, 380, 100, "Keyboard Focus Options"); o->box(FL_GTK_DOWN_BOX); @@ -832,7 +853,22 @@ f disabled, the Fl_Printer class\nalways uses FLTK\'s own print dialog even if\ } // Fl_Choice* wPrintGTKText o->end(); } // Fl_Group* o - { wUserOrSystem = new Fl_Choice(10, 420, 141, 25); + { Fl_Group* o = new Fl_Group(10, 421, 380, 66, "Scaling Factor Options"); + o->box(FL_GTK_DOWN_BOX); + o->labelfont(2); + o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE)); + { wShowZoomFactor = new Fl_Choice(245, 442, 100, 25, "Transiently show scaling factor:"); + wShowZoomFactor->tooltip("OPTION_SHOW_SCALING\n\nIf \'Transiently show scaling factor\' is enabled, the\ + library shows in a transient yellow window the display\nscaling factor value \ +when it is changed. If disabled, no such transient window is used.\n\nDefault \ +is on."); + wShowZoomFactor->down_box(FL_BORDER_BOX); + wShowZoomFactor->callback((Fl_Callback*)cb_wShowZoomFactor); + wShowZoomFactor->menu(menu_wShowZoomFactor); + } // Fl_Choice* wShowZoomFactor + o->end(); + } // Fl_Group* o + { wUserOrSystem = new Fl_Choice(10, 496, 141, 25); wUserOrSystem->tooltip("Change settings for the current user, or default values for all users of this\ computer. Individual users can override system options, if they set their opt\ ions to specific values (not \'default\')."); @@ -840,10 +876,10 @@ ions to specific values (not \'default\')."); wUserOrSystem->callback((Fl_Callback*)cb_wUserOrSystem); wUserOrSystem->menu(menu_wUserOrSystem); } // Fl_Choice* wUserOrSystem - { Fl_Button* o = new Fl_Button(230, 420, 75, 25, "Cancel"); + { Fl_Button* o = new Fl_Button(230, 496, 75, 25, "Cancel"); o->callback((Fl_Callback*)cb_Cancel1); } // Fl_Button* o - { Fl_Button* o = new Fl_Button(315, 420, 75, 25, "OK"); + { Fl_Button* o = new Fl_Button(315, 496, 75, 25, "OK"); o->callback((Fl_Callback*)cb_OK); } // Fl_Button* o global_settings_window->end(); |
