Comments (13)
In fltk 1.4.x, [Ctrl]- and [Ctrl]+ does this. Should work with all of the fltk test programs.
from fltk.
Oh that's great news!
Just to be sure I've got this right, so an application with two windows can have one enlarged, while the other one stays the same. Is that right?
from fltk.
Oh, per-window in a multiwindow app? Offhand I don't think it works that way, no, so your request should stand unless there's something I'm missing.
I believe the Ctrl+/- scaling is for all windows in the app, not just the one you're currently in, the goal being to help the application look right on high dpi displays.
from fltk.
Also, in Apple MacOS, you can scale the entire screen simply by holding Ctrl and dragging the scroll wheel (or the two-finger scroll on the touch pad). It's really a fantastic help for sight impaired people and aging programmers.
from fltk.
What is currently possible with FLTK 1.4 is to define a global shortcut key
that would enlarge all windows on a screen, and, for example, reset all windows
to their previous size if repeated.
That is nearly what you asked for except that other windows of the FLTK app
get enlarged too, which may be acceptable since switching is very simple.
The following example defines ctrl-P as that global shortcut
and have it enlarge all window content 3-fold. That won't work if the ctrl-P
shortcut is used for something else by the FLTK app (say, a menu item shortcut).
-
add this function to your code:
#include <src/Fl_Screen_Driver.H>
int my_scale_handler(int event) {
if ( event != FL_SHORTCUT || (!Fl::event_ctrl()) ) return 0;
int key = Fl::event_key() & ~(FL_SHIFT+FL_CTRL);
if (key != 'p') return 0;
static float current_scale = 1;
static int current_screen = -1;
if (current_screen == -1 ) {
current_screen = Fl::first_window()->screen_num();
current_scale = Fl::screen_scale(current_screen);
Fl::screen_driver()->rescale_all_windows_from_screen(current_screen, 3);
}
else {
Fl::screen_driver()->rescale_all_windows_from_screen(current_screen, current_scale);
current_screen = -1;
}
return 1;
} -
put this statement very early in your program, possibly as 1st statement in main():
Fl::add_handler(my_scale_handler);
from fltk.
I believe there's no convenient hook to the code to rescale an FLTK window
individually. That is because FLTK defines a per-display scaling factor
and refers to that value in many places under the logic that all windows
of the same display share the same value of the scaling factor.
That property allows all FLTK apps to become rescalable with FLTK 1.4 without
change to their source code.
from fltk.
Thanks for the updates. A bit disappointing, but still an impovement on the overall fixed size of fltk V 1.3
from fltk.
I believe that this issue has been discussed and will not be fixed, at least not in the near or middle future.
I suggest to close this issue. It will be closed no later than 1 week from now if there's no further action.
from fltk.
We could plan for such changes, perhaps as a discussion on fltk.coredev.
Or an RFE/STR that remains open so the request and implementation suggestions don't get lost,
as I imagine there's several needs, each with its own details. (multi-monitor/screen specific vs. window specific, etc)
I imagine implementation could be tricky, since deparented windows like menus and
dialogs would probably have to be affected too.
from fltk.
This seems like a good compromise. While I appreciate this isn't a high priority for most people, I wouldn't want it to get lost completely.
from fltk.
Okay, points taken. I removed the 'wontfix' label and added 'enhancement' so we can leave this issue open for now and discuss the possible improvements further.
from fltk.
Just as a matter of interest, we've been able to get what we wanted with fltk1.3.5. We set the windows as resizable, and work with a fixed W/H ratio (so circles remain circles), then store the default width. When resizing we multiply text font size by the ratio of the current width against the default.
Menu bars and tabs (with text) don't work correctly so we synthesize these.
If anyone is interested the project is Yoshimi soft-synth and is on here and sourceforge.
from fltk.
In fltk 1.4.x, [Ctrl]- and [Ctrl]+ does this. Should work with all of the fltk test programs.
Dear @Albrecht-S ,
I read this now, and really super thanks for announcing this feature to test high DPI affects on 96 DPI screen !
from fltk.
Related Issues (20)
- Naseem HOT 2
- FLUID: compilation warnings HOT 1
- Wayland use of alpha in glClearColor/glClear() -- bug or misfeature? HOT 13
- Building OpenGL Examples on Windows with MSVC does not work HOT 5
- Consider adding compile-definition "FL_DLL" to MSVC 2022 builds with shared libraries HOT 6
- macOS: Generating fltk.framework HOT 13
- Avoiding wrong includes (only include from FLTK's repository not from CMAKE_PREFIX_PATH) HOT 5
- FLTK 1.4: X11 Clipping bugs HOT 8
- Fluid/MSVC compilation warnings HOT 1
- FLTK hangs when a GL visible subwindow goes partially below the screen on Wayland-Gnome HOT 14
- macOS regression with glwindow, glsubwindow and tile. HOT 14
- Selected Fl_Menu_Item's are not drawn with selection color background under Windows HOT 8
- Cannot build project with CMake (add_library cannot create ALIAS target "fltk" because target "fltk::fltk" is imported but not globally visible) HOT 7
- Fl_Tree handler might refer to a null root causing a crash HOT 4
- Fl_Tree doesn't use system colors HOT 6
- Wayland: subwindow redraw issues from timeouts with NVidia driver HOT 26
- needing the set of C++ root or top classes of FLTK 1.4 HOT 4
- fltk.org is down HOT 4
- Bug in callbacks generated by fluid on macOS using system menu bar inside C++ Classes HOT 22
- Discrepant behaviour between Fl_Choice and Fl_Input_Choice HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fltk.