diff options
author | rubidium <rubidium@openttd.org> | 2010-07-14 17:36:27 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-07-14 17:36:27 +0000 |
commit | 0e078670b7c32646bec6431d5dc48df450babc5d (patch) | |
tree | 47984b82f702d6220cad8185b7ceeda3d8661c8f /src/window.cpp | |
parent | fa3d9d04d386daf3ee92c9ab0f2624fbdcd1abf4 (diff) | |
download | openttd-0e078670b7c32646bec6431d5dc48df450babc5d.tar.xz |
(svn r20145) -Codechange: keep original RMB->tooltip behaviour when hovering is disabled and there is no handled right click event for the widget, i.e. if a widget would handle the right click you won't see the tooltip anymore by right clicking; by enabling hovering you would get access to that tooltip again.
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/window.cpp b/src/window.cpp index 5658e6887..5c9eeb7f5 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -383,12 +383,15 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count) static void DispatchRightClickEvent(Window *w, int x, int y) { NWidgetCore *wid = w->nested_root->GetWidgetFromPos(x, y); + if (wid == NULL) return; /* No widget to handle, or the window is not interested in it. */ - if (wid == NULL || wid->index < 0) return; + if (wid->index >= 0) { + Point pt = { x, y }; + if (w->OnRightClick(pt, wid->index)) return; + } - Point pt = { x, y }; - w->OnRightClick(pt, wid->index); + if (_settings_client.gui.hover_delay == 0 && wid->tool_tip != 0) GuiShowTooltips(wid->tool_tip, 0, NULL, TCC_RIGHT_CLICK); } /** |