Improve the look of the search field (better margins etc)

This commit is contained in:
Henrik Rydgård committed 2026-04-15 09:47:35 -06:00
1 parent 9d436ce281
commit 3c6782a38f
2 files changed
+10 -9

No files matched your search

+6 -4
View File
@@ -138,10 +138,11 @@ void MainScreen::CreateRecentTab() {
using namespace UI;
auto mm = GetI18NCategory(I18NCat::MAINMENU);
LinearLayout *recentContainer = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
SearchBar *search = recentContainer->Add(new SearchBar(new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
LinearLayout *tabContainer = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
tabContainer->SetSpacing(0.0f);
SearchBar *search = tabContainer->Add(new SearchBar(new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(8, 8, 8, 0))));
ScrollView *scrollView = recentContainer->Add(new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f)));
ScrollView *scrollView = tabContainer->Add(new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f)));
scrollView->SetTag("MainScreenRecentGames");
bool portrait = GetDeviceOrientation() == DeviceOrientation::Portrait;
@@ -154,7 +155,7 @@ void MainScreen::CreateRecentTab() {
scrollView->Add(tabRecentGames);
gameBrowsers_.push_back(tabRecentGames);
tabHolder_->AddTab(mm->T("Recent"), ImageID::invalid(), recentContainer);
tabHolder_->AddTab(mm->T("Recent"), ImageID::invalid(), tabContainer);
tabRecentGames->OnChoice.Handle(this, &MainScreen::OnGameSelectedInstant);
tabRecentGames->OnHoldChoice.Handle(this, &MainScreen::OnGameSelected);
tabRecentGames->OnHighlight.Handle(this, &MainScreen::OnGameHighlight);
@@ -167,6 +168,7 @@ GameBrowser *MainScreen::CreateBrowserTab(const Path &path, std::string_view tit
const bool portrait = GetDeviceOrientation() == DeviceOrientation::Portrait;
LinearLayout *tabContainer = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
tabContainer->SetSpacing(0.0f);
SearchBar *search = tabContainer->Add(new SearchBar(new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
ScrollView *scrollView = tabContainer->Add(new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f)));