From 43fe6ee02720782ce9da715b57c8d0037e6ef641 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 20 Jul 2023 13:48:43 +0200 Subject: 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 --- fluid/Fl_Window_Type.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fluid/Fl_Window_Type.cxx') diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index 236a736a8..f74e0eae1 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -207,7 +207,7 @@ int Overlay_Window::handle(int e) { */ Fl_Type *Fl_Window_Type::make(Strategy strategy) { Fl_Type *p = Fl_Type::current; - while (p && !p->is_code_block()) p = p->parent; + while (p && (!p->is_code_block() || p->is_a(ID_Widget_Class))) p = p->parent; if (!p) { fl_message("Please select a function"); return 0; @@ -307,8 +307,8 @@ void Fl_Window_Type::ideal_size(int &w, int &h) { 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); } + Fd_Snap_Action::better_size(w, h); } @@ -966,7 +966,7 @@ int Fl_Window_Type::handle(int event) { { Fl_Type *cc = Fl_Type::current; Fl_Type::current = Fl_Type::current_dnd; - add_new_widget_from_user(prototype, kAddAfterCurrent); + add_new_widget_from_user(prototype, kAddAsLastChild); Fl_Type::current = cc; } else { add_new_widget_from_user(prototype, kAddAsLastChild); -- cgit v1.2.3