diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-07-17 20:20:54 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-07-17 20:21:04 +0200 |
| commit | 9bdc7139daef8d9dc7b7e06503cd810d44b6d69c (patch) | |
| tree | bd4fb30d1a2c539a3eb530eb14d1780a9e04db78 /fluid/Fl_Window_Type.cxx | |
| parent | 9794d200b33b438feaf76c960e464b90dd911d58 (diff) | |
FLUID: better initial sizes for buttons and windows
Diffstat (limited to 'fluid/Fl_Window_Type.cxx')
| -rw-r--r-- | fluid/Fl_Window_Type.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index 22f39dfc8..a5a43d0cc 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -299,6 +299,18 @@ uchar *Fl_Window_Type::read_image(int &ww, int &hh) { return idata; } +void Fl_Window_Type::ideal_size(int &w, int &h) { + w = 480, h = 320; + if (main_window) { + int sx, sy, sw, sh; + Fl_Window *win = main_window; + int screen = Fl::screen_num(win->x(), win->y()); + Fl::screen_work_area(sx, sy, sw, sh, screen); + w = fd_min(w, sw*3/4); h = fd_min(h, sh*3/4); + Fd_Snap_Action::better_size(w, h); + } +} + // control panel items: |
