diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-07-20 13:48:43 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-07-20 13:49:19 +0200 |
| commit | 43fe6ee02720782ce9da715b57c8d0037e6ef641 (patch) | |
| tree | 10ba1b2a287ba93c4dc15b3a5340549c3a9f57b1 /fluid/Fl_Group_Type.cxx | |
| parent | 4ec02555ef84965cc83e62e4181f091103bfb269 (diff) | |
FLUID improves positioning and sizing new widgets
Better default sizes for text based widgets and menu managers
Better Menu refresh on custom text heights
Smarter positioning of menu bars and groups inside tabs
Fixes wrong include guard
Diffstat (limited to 'fluid/Fl_Group_Type.cxx')
| -rw-r--r-- | fluid/Fl_Group_Type.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fluid/Fl_Group_Type.cxx b/fluid/Fl_Group_Type.cxx index 06d5e8013..c0e7526e3 100644 --- a/fluid/Fl_Group_Type.cxx +++ b/fluid/Fl_Group_Type.cxx @@ -5,7 +5,7 @@ // the Fl_Tabs widget, with special stuff to select tab items and // insure that only one is visible. // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2023 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -136,6 +136,18 @@ void ungroup_cb(Fl_Widget *, void *) { set_modflag(1); } +void Fl_Group_Type::ideal_size(int &w, int &h) { + if (parent && parent->is_true_widget()) { + Fl_Widget *p = ((Fl_Widget_Type*)parent)->o; + w = p->w() / 2; + h = p->h() / 2; + } else { + w = 140; + h = 140; + } + Fd_Snap_Action::better_size(w, h); +} + void Fl_Group_Type::write_code1(Fd_Code_Writer& f) { Fl_Widget_Type::write_code1(f); } |
