summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-03-28 02:46:10 +0000
committeryexo <yexo@openttd.org>2009-03-28 02:46:10 +0000
commited330197c4de8c55b929b44f51f78bc0c56a3fd1 (patch)
tree909f9906b55db6f3bb4dc2e4e070fd1faa443425 /src/window.cpp
parent4a4ee9fb37956dd489f1b45faec6170948cbf6f4 (diff)
downloadopenttd-ed330197c4de8c55b929b44f51f78bc0c56a3fd1.tar.xz
(svn r15867) -Codechange: remove the assumption that the first widgets are the close box/title bar.
Most work already done by r15756.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 9791dd49c..f2d238ead 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -285,7 +285,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, bool double_click)
/* If clicked on a window that previously did dot have focus */
if (_focused_window != w &&
(w->desc_flags & WDF_NO_FOCUS) == 0 && // Don't lose focus to toolbars
- !(w->desc_flags & WDF_STD_BTN && widget == 0)) { // Don't change focused window if 'X' (close button) was clicked
+ !(w->desc_flags & WDF_STD_BTN && w->widget[widget].type == WWT_CLOSEBOX)) { // Don't change focused window if 'X' (close button) was clicked
focused_widget_changed = true;
if (_focused_window != NULL) {
_focused_window->OnFocusLost();
@@ -348,12 +348,12 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, bool double_click)
if (HideDropDownMenu(w) == widget) return;
if (w->desc_flags & WDF_STD_BTN) {
- if (widget == 0) { // 'X'
+ if (w->widget[widget].type == WWT_CLOSEBOX) { // 'X'
delete w;
return;
}
- if (widget == 1) { // 'Title bar'
+ if (w->widget[widget].type == WWT_CAPTION) { // 'Title bar'
StartWindowDrag(w);
return;
}