Show radio button images in the server list

This commit is contained in:
Henrik Rydgård
2026-03-10 09:21:19 +01:00
parent e0f1b6b7d9
commit 33c8bdc05b
5 changed files with 27 additions and 7 deletions
+4
View File
@@ -193,7 +193,11 @@ AdhocServerRow::AdhocServerRow(std::string *editValue, const AdhocServerListEntr
: UI::LinearLayout(ORIENT_HORIZONTAL, new UI::LinearLayoutParams(UI::FILL_PARENT, UI::WRAP_CONTENT, UI::Margins(5.0f, 0.0f))), value_(editValue), entry_(entry) {
using namespace UI;
SetSpacing(5.0f);
// Show as radio button to make it really clear that selection actually is the choice.
int number = 0;
Add(new ImageView([editValue, host = entry.host]() { return host == *editValue ? ImageID("I_RADIO_SELECTED") : ImageID("I_RADIO_EMPTY"); },
new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT, Gravity::G_VCENTER, Margins(5, 0, 0, 0))));
LinearLayout *lines = Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(Margins(5, 5))));
lines->SetSpacing(0.0f);