1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 10:52:41 +01:00

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.
This commit is contained in:
Peter Nelson
2025-04-21 13:20:52 +01:00
committed by GitHub
parent 9ff2b4991f
commit 0cf7048a67

View File

@@ -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<NWidgetBase>(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()) {