summaryrefslogtreecommitdiff
path: root/src/Fl_Screen_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2018-08-08 20:08:10 +0000
committerManolo Gouy <Manolo>2018-08-08 20:08:10 +0000
commitcd399d989897e650cc7928c4ebd9bf89892d7995 (patch)
treed0e6d7f02a53a9ead62c88c34cb84580a24a3fc2 /src/Fl_Screen_Driver.cxx
parentfb0f940c517d4f0f0f2f22f92acc54c9f5b37242 (diff)
Support for GUI scaling: add API to get/set the scaling factor value.
Also, define an FLTK event triggered when the scaling is changed and an option to disable the transient window showing the new scaling factor. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13011 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Screen_Driver.cxx')
-rw-r--r--src/Fl_Screen_Driver.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx
index d04db7094..9c0857972 100644
--- a/src/Fl_Screen_Driver.cxx
+++ b/src/Fl_Screen_Driver.cxx
@@ -336,7 +336,9 @@ static void del_transient_window(void *data) {
}
void Fl_Screen_Driver::transient_scale_display(float f, int nscreen)
-{ // transiently show the new scaling value using a shaped window
+{
+ if (!Fl::option(Fl::OPTION_SHOW_SCALING)) return;
+ // transiently show the new scaling value using a shaped window
int w = 150;
// draw a white rounded box on black background
Fl_Screen_Driver *d = Fl::screen_driver();
@@ -427,6 +429,7 @@ int Fl_Screen_Driver::scale_handler(int event)
screen_dr->rescale_all_windows_from_screen(screen, f*initial_scale);
Fl_Screen_Driver::transient_scale_display(f, screen);
screen_dr->init_workarea();
+ Fl::handle(FL_ZOOM_EVENT, NULL);
return 1;
}
return 0;