FLUID: Fix live resize for windows and tabs

This commit is contained in:
Matthias Melcher 2024-04-26 19:30:47 +02:00
parent 1408a87425
commit 445dcb829d
2 changed files with 8 additions and 5 deletions

View File

@ -720,10 +720,13 @@ void Fl_Tabs_Type::remove_child(Fl_Type* cc) {
}
Fl_Widget *Fl_Tabs_Type::enter_live_mode(int) {
Fl_Tabs *grp = new Fl_Tabs(o->x(), o->y(), o->w(), o->h());
propagate_live_mode(grp);
grp->value(((Fl_Tabs*)o)->value());
return grp;
Fl_Tabs *original = static_cast<Fl_Tabs*>(o);
Fl_Tabs *clone = new Fl_Tabs(o->x(), o->y(), o->w(), o->h());
propagate_live_mode(clone);
int tab_index = original->find(original->value());
if ((tab_index>=0) && (tab_index<clone->children()))
clone->value(clone->child(tab_index));
return clone;
}
// ---- Fl_Scroll_Type ------------------------------------------------- MARK: -

View File

@ -1519,7 +1519,7 @@ void Fl_Widget_Class_Type::write_code2(Fd_Code_Writer& f) {
// live mode support
Fl_Widget *Fl_Window_Type::enter_live_mode(int) {
Fl_Window *win = new Fl_Window(o->x(), o->y(), o->w(), o->h());
Fl_Window *win = new Fl_Window(10, 10, o->w(), o->h());
return propagate_live_mode(win);
}