summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-15 10:40:06 +0000
committerrubidium <rubidium@openttd.org>2009-11-15 10:40:06 +0000
commitb812a48a8dda9de3a2bd177b6ced4c69995746e5 (patch)
tree6a693afb77aa2af7437f9b9d545ba749fbc771a0 /src
parent884561f431301d60fae96be21daae933b5562311 (diff)
downloadopenttd-b812a48a8dda9de3a2bd177b6ced4c69995746e5.tar.xz
(svn r18089) -Codechange: remove ResizeWindowForWidget
Diffstat (limited to 'src')
-rw-r--r--src/widget.cpp27
-rw-r--r--src/window_gui.h2
2 files changed, 0 insertions, 29 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index adaaef7eb..e1718983c 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -717,33 +717,6 @@ void Window::DrawWidgets() const
}
}
-/** Resize a widget and shuffle other widgets around to fit. */
-void ResizeWindowForWidget(Window *w, uint widget, int delta_x, int delta_y)
-{
- int right = w->widget[widget].right;
- int bottom = w->widget[widget].bottom;
-
- for (uint i = 0; i < w->widget_count; i++) {
- if (w->widget[i].left >= right && i != widget) w->widget[i].left += delta_x;
- if (w->widget[i].right >= right) w->widget[i].right += delta_x;
- if (w->widget[i].top >= bottom && i != widget) w->widget[i].top += delta_y;
- if (w->widget[i].bottom >= bottom) w->widget[i].bottom += delta_y;
- }
-
- /* A hidden widget has bottom == top or right == left, we need to make it
- * one less to fit in its new gap. */
- if (right == w->widget[widget].left) w->widget[widget].right--;
- if (bottom == w->widget[widget].top) w->widget[widget].bottom--;
-
- if (w->widget[widget].left > w->widget[widget].right) w->widget[widget].right = w->widget[widget].left;
- if (w->widget[widget].top > w->widget[widget].bottom) w->widget[widget].bottom = w->widget[widget].top;
-
- w->width += delta_x;
- w->height += delta_y;
- w->resize.width += delta_x;
- w->resize.height += delta_y;
-}
-
/**
* Draw a sort button's up or down arrow symbol.
* @param widget Sort button widget
diff --git a/src/window_gui.h b/src/window_gui.h
index d31769b5f..478772916 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -964,6 +964,4 @@ bool EditBoxInGlobalFocus();
void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y);
void ScrollbarClickHandler(Window *w, const NWidgetCore *nw, int x, int y);
-void ResizeWindowForWidget(Window *w, uint widget, int delta_x, int delta_y);
-
#endif /* WINDOW_GUI_H */