Add selection on firmware libraries panel by double-clicking (#17481)

I minor, and last, follow up of #17459 and #17442 allowing to
check/uncheck an entry in the firmware libraries panel by
double-clicking.
For that panel, a solution based on single-clicking was preferrable but
it seems it was conflicting with the existing itemChanged (single click
was triggered twice so producing no state change).
IMO, better than nothing.

---------

Co-authored-by: Megamouse <studienricky89@googlemail.com>
This commit is contained in:
Antonino Di Guardo 2025-09-10 16:25:47 +02:00 committed by GitHub
parent f63bb4c7fb
commit 09f8c6ddcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1787,6 +1787,14 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
} }
}); });
connect(ui->lleList, &QListWidget::itemDoubleClicked, this, [](QListWidgetItem* item)
{
if (!item)
return;
item->setCheckState(item->checkState() != Qt::CheckState::Unchecked ? Qt::CheckState::Unchecked : Qt::CheckState::Checked);
});
connect(ui->hleList, &QListWidget::itemChanged, [this](QListWidgetItem* item) connect(ui->hleList, &QListWidget::itemChanged, [this](QListWidgetItem* item)
{ {
for (auto cb : ui->hleList->selectedItems()) for (auto cb : ui->hleList->selectedItems())
@ -1795,6 +1803,14 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
} }
}); });
connect(ui->hleList, &QListWidget::itemDoubleClicked, this, [](QListWidgetItem* item)
{
if (!item)
return;
item->setCheckState(item->checkState() != Qt::CheckState::Unchecked ? Qt::CheckState::Unchecked : Qt::CheckState::Checked);
});
connect(this, &settings_dialog::signal_restore_dependant_defaults, this, reset_library_lists); connect(this, &settings_dialog::signal_restore_dependant_defaults, this, reset_library_lists);
// ______ _ _ _______ _ // ______ _ _ _______ _