Fixed minimap. That's good enough for release

This commit is contained in:
pelya
2017-04-02 23:39:38 +03:00
committed by Sergii Pylypenko
parent cf413c4c82
commit cd0032e33d
2 changed files with 7 additions and 4 deletions

View File

@@ -680,7 +680,10 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count, boo
focused_widget_changed |= w->SetFocusedWidget(widget_index);
}
Point pt = { x, y };
if (!_settings_client.gui.windows_titlebars && mouse_down) {
// TODO: this should be handled inside window or widget methods, not here
if (widget_type == NWID_VSCROLLBAR || widget_type == NWID_HSCROLLBAR) {
ScrollbarClickHandler(w, nw, x, y);
_dragging_widget = true;
@@ -689,6 +692,10 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count, boo
StartWindowSizing(w, (int)nw->pos_x < (w->width / 2));
nw->SetDirty(w);
}
if (w->window_class == WC_SMALLMAP && widget_index == WID_SM_MAP) {
w->OnClick(pt, widget_index, click_count);
_dragging_widget = true;
}
return;
}
@@ -698,8 +705,6 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count, boo
if ((widget_type & ~WWB_PUSHBUTTON) < WWT_LAST && (widget_type & WWB_PUSHBUTTON)) w->HandleButtonClick(widget_index);
Point pt = { x, y };
switch (widget_type) {
case NWID_VSCROLLBAR:
case NWID_HSCROLLBAR:

View File

@@ -13,5 +13,3 @@
- Draggable combo boxes.
- Cannot scroll minimap.