From 0cf7048a670e46356555e208c44730c69764e53f Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 21 Apr 2025 13:20:52 +0100 Subject: [PATCH] Change: Don't select content when toggling its download status. (#14059) This improves usability when toggling content sorted by status, as the list position no longer jumps to the now (de)selected item, making it easier to (de)select multiple items. --- src/network/network_content_gui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 5974f0f1bb..a782d5aa48 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -785,14 +785,14 @@ public: auto it = this->vscroll->GetScrolledItemFromWidget(this->content, pt.y, this, WID_NCL_MATRIX); if (it == this->content.end()) return; // click out of bounds - this->selected = *it; - this->list_pos = it - this->content.begin(); - const NWidgetBase *checkbox = this->GetWidget(WID_NCL_CHECKBOX); if (click_count > 1 || IsInsideBS(pt.x, checkbox->pos_x, checkbox->current_x)) { - _network_content_client.ToggleSelectedState(*this->selected); + _network_content_client.ToggleSelectedState(**it); this->content.ForceResort(); this->content.ForceRebuild(); + } else { + this->selected = *it; + this->list_pos = it - this->content.begin(); } if (this->filter_data.types.any()) {