diff options
Diffstat (limited to 'src/network/network_content_gui.cpp')
-rw-r--r-- | src/network/network_content_gui.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index e4209d0e5..bb77aea6d 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -164,7 +164,7 @@ public: DrawStringMultiLine(r.left + 2, r.right - 2, y, y + FONT_HEIGHT_NORMAL * 2, str, TC_FROMSTRING, SA_CENTER); } - virtual void OnClick(Point pt, int widget) + virtual void OnClick(Point pt, int widget, int click_count) { if (widget == NCDSWW_CANCELOK) { if (this->downloaded_bytes != this->total_bytes) _network_content_client.Close(); @@ -583,16 +583,7 @@ public: } } - virtual void OnDoubleClick(Point pt, int widget) - { - /* Double clicking on a line in the matrix toggles the state of the checkbox */ - if (widget != NCLWW_MATRIX) return; - - pt.x = this->GetWidget<NWidgetBase>(NCLWW_CHECKBOX)->pos_x; - this->OnClick(pt, widget); - } - - virtual void OnClick(Point pt, int widget) + virtual void OnClick(Point pt, int widget, int click_count) { switch (widget) { case NCLWW_MATRIX: { @@ -607,7 +598,7 @@ public: this->list_pos = id_v; const NWidgetBase *checkbox = this->GetWidget<NWidgetBase>(NCLWW_CHECKBOX); - if (IsInsideBS(pt.x, checkbox->pos_x, checkbox->current_x)) { + if (click_count > 1 || IsInsideBS(pt.x, checkbox->pos_x, checkbox->current_x)) { _network_content_client.ToggleSelectedState(this->selected); this->content.ForceResort(); } |