From e23f80d772efde098085282cbf5249e0b3808055 Mon Sep 17 00:00:00 2001 From: Collecting Date: Fri, 30 Jan 2026 22:52:07 +0100 Subject: [PATCH] fix(ui): Coloring of Search Field & Game list Signed-off-by: Collecting --- src/citron/game_list.cpp | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/citron/game_list.cpp b/src/citron/game_list.cpp index 0d8d82325..1c01e4111 100644 --- a/src/citron/game_list.cpp +++ b/src/citron/game_list.cpp @@ -392,19 +392,7 @@ GameListSearchField::GameListSearchField(GameList* parent) : QWidget{parent} { edit_filter->clear(); edit_filter->installEventFilter(key_release_eater); edit_filter->setClearButtonEnabled(true); - // Add rounded corners styling to the search field - edit_filter->setStyleSheet(QStringLiteral( - "QLineEdit {" - " border: 1px solid palette(mid);" - " border-radius: 6px;" - " padding: 4px 8px;" - " background: palette(base);" - "}" - "QLineEdit:focus {" - " border: 1px solid palette(highlight);" - " background: palette(base);" - "}" - )); + connect(edit_filter, &QLineEdit::textChanged, parent, &GameList::OnTextChanged); label_filter_result = new QLabel; button_filter_close = new QToolButton(this); @@ -2305,7 +2293,7 @@ void GameList::UpdateAccentColorStyles() { .arg(hover_background_color.alpha()); QString accent_style = QStringLiteral( - /* Tree View (List View) Selection & Hover Style - Final */ + /* Tree View (List View) Selection & Hover Style */ "QTreeView::item:hover {" " background-color: %3;" /* Use the new accent-based hover color */ " border-radius: 4px;" /* Add a subtle rounding to the hover effect */ @@ -2321,7 +2309,7 @@ void GameList::UpdateAccentColorStyles() { " border: none;" /* NO BORDER */ "}" - /* List View (Grid View) Selection Style - This remains correct */ + /* List View (Grid View) Selection Style */ "QListView::item:selected {" " background-color: palette(light);" " border: 3px solid %1;" @@ -2371,6 +2359,19 @@ void GameList::UpdateAccentColorStyles() { btn_list_view->setStyleSheet(button_base_style + button_checked_style); btn_grid_view->setStyleSheet(button_base_style + button_checked_style); + + search_field->setStyleSheet(QStringLiteral( + "QLineEdit {" + " border: 1px solid palette(mid);" + " border-radius: 6px;" + " padding: 4px 8px;" + " background: palette(base);" + "}" + "QLineEdit:focus {" + " border: 1px solid %1;" + " background: palette(base);" + "}" + ).arg(color_name)); } void GameList::ToggleHidden(const QString& path) { @@ -2414,4 +2415,8 @@ void GameList::OnEmulationEnded() { fade_out_anim->start(QAbstractAnimation::DeleteWhenStopped); } +void GameListSearchField::setStyleSheet(const QString& sheet) { + edit_filter->setStyleSheet(sheet); +} + #include "game_list.moc"