src/widget.cpp
changeset 8418 afae92fe35f1
parent 8411 591f0c085e10
child 8729 1f57e8a0d5b3
equal deleted inserted replaced
8417:2f68ba2e6523 8418:afae92fe35f1
   581 			ResizeButtons(w, widget + 1, right);
   581 			ResizeButtons(w, widget + 1, right);
   582 		}
   582 		}
   583 	}
   583 	}
   584 }
   584 }
   585 
   585 
       
   586 void ResizeWindowForWidget(Window *w, int widget, int delta_x, int delta_y)
       
   587 {
       
   588 	int right  = w->widget[widget].right;
       
   589 	int bottom = w->widget[widget].bottom;
       
   590 
       
   591 	for (uint i = 0; i < w->widget_count; i++) {
       
   592 		if (w->widget[i].left >= right) w->widget[i].left += delta_x;
       
   593 		if (w->widget[i].right >= right) w->widget[i].right += delta_x;
       
   594 		if (w->widget[i].top >= bottom) w->widget[i].top += delta_y;
       
   595 		if (w->widget[i].bottom >= bottom) w->widget[i].bottom += delta_y;
       
   596 	}
       
   597 
       
   598 	w->width  += delta_x;
       
   599 	w->height += delta_y;
       
   600 	w->resize.width  += delta_x;
       
   601 	w->resize.height += delta_y;
       
   602 }
       
   603 
   586 /** Draw a sort button's up or down arrow symbol.
   604 /** Draw a sort button's up or down arrow symbol.
   587  * @param w Window of widget
   605  * @param w Window of widget
   588  * @param widget Sort button widget
   606  * @param widget Sort button widget
   589  * @param state State of sort button
   607  * @param state State of sort button
   590  */
   608  */