diff options
Diffstat (limited to 'fluid')
| -rw-r--r-- | fluid/align_widget.cxx | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/fluid/align_widget.cxx b/fluid/align_widget.cxx index a4cd7be56..07dcc910f 100644 --- a/fluid/align_widget.cxx +++ b/fluid/align_widget.cxx @@ -57,13 +57,15 @@ void align_widget_cb(Fl_Widget*, long how) if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize(left, w->y(), w->w(), w->h()); } else { // Otherwise, just do the widget... w->resize(left, w->y(), w->w(), w->h()); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -87,13 +89,15 @@ void align_widget_cb(Fl_Widget*, long how) if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); } else { // Otherwise, just do the widget... w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -114,13 +118,15 @@ void align_widget_cb(Fl_Widget*, long how) if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize(right-w->w(), w->y(), w->w(), w->h()); } else { // Otherwise, just do the widget... w->resize(right-w->w(), w->y(), w->w(), w->h()); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -140,13 +146,15 @@ void align_widget_cb(Fl_Widget*, long how) if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize(w->x(), top, w->w(), w->h()); } else { // Otherwise, just do the widget... w->resize(w->x(), top, w->w(), w->h()); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -170,13 +178,15 @@ void align_widget_cb(Fl_Widget*, long how) if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); } else { // Otherwise, just do the widget... w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -197,13 +207,15 @@ void align_widget_cb(Fl_Widget*, long how) if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize( w->x(), bot-w->h(), w->w(), w->h()); } else { // Otherwise, just do the widget... w->resize( w->x(), bot-w->h(), w->w(), w->h()); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -231,13 +243,15 @@ void align_widget_cb(Fl_Widget*, long how) if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); } else { // Otherwise, just do the widget... w->resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); cnt++; @@ -267,13 +281,15 @@ void align_widget_cb(Fl_Widget*, long how) if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); } else { // Otherwise, just do the widget... w->resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); cnt++; @@ -297,13 +313,15 @@ void align_widget_cb(Fl_Widget*, long how) if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize(w->x(), w->y(), wdt, w->h()); } else { // Otherwise, just do the widget... w->resize(w->x(), w->y(), wdt, w->h()); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -323,13 +341,15 @@ void align_widget_cb(Fl_Widget*, long how) if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize( w->x(), w->y(), w->w(), hgt); } else { // Otherwise, just do the widget... w->resize( w->x(), w->y(), w->w(), hgt); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -351,13 +371,15 @@ void align_widget_cb(Fl_Widget*, long how) if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize( w->x(), w->y(), wdt, hgt); } else { // Otherwise, just do the widget... w->resize( w->x(), w->y(), wdt, hgt); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -374,13 +396,15 @@ void align_widget_cb(Fl_Widget*, long how) if (w->window() == p) center2 = p->w(); else center2 = 2*p->x()+p->w(); - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button() && !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); } else { // Otherwise, just do the widget... w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -396,13 +420,15 @@ void align_widget_cb(Fl_Widget*, long how) if (w->window() == p) center2 = p->h(); else center2 = 2*p->y()+p->h(); - if (o->next && o->next->level > o->level && !o->next->selected) { + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { // When resizing a group, make sure we also move the children... ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); } else { // Otherwise, just do the widget... w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); } + modflag=1; w->redraw(); if (w->window()) w->window()->redraw(); } |
