From 26a9b5d95f6f7870be8e3d6952ef923fd483cd9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 7 Oct 2025 15:51:13 -0600 Subject: [PATCH 1/2] Replaces '+'/'-' with pin/unpin icons. Thanks Nabn00b. This doesn't yet use the new pinned-folder icon though. Might do that later. --- UI/MainScreen.cpp | 9 ++++--- UI/UIAtlas.cpp | 3 +++ assets/ui_images/images.svg | 53 ++++++++++++++++++++++++++++--------- 3 files changed, 49 insertions(+), 16 deletions(-) diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 33cdcc79ad..f999a9ab74 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -78,7 +78,7 @@ bool MainScreen::showHomebrewTab = false; static void LaunchFile(ScreenManager *screenManager, Screen *currentScreen, const Path &path) { if (path.GetFileExtension() == ".zip") { - // If it's a zip file, we have a screen for that. + // If is a zip file, we have a screen for that. screenManager->push(new InstallZipScreen(path)); } else { if (currentScreen) { @@ -938,12 +938,13 @@ void GameBrowser::Refresh() { // Show a button to toggle pinning at the very end. if ((browseFlags_ & BrowseFlags::PIN) && !path_.GetPath().empty()) { - std::string caption = IsCurrentPathPinned() ? "-" : "+"; + std::string caption = ""; // IsCurrentPathPinned() ? "-" : "+"; if (!*gridStyle_) { caption = IsCurrentPathPinned() ? mm->T("UnpinPath", "Unpin") : mm->T("PinPath", "Pin"); } - gameList_->Add(new UI::Button(caption, new UI::LinearLayoutParams(UI::FILL_PARENT, UI::FILL_PARENT)))-> - OnClick.Handle(this, &GameBrowser::PinToggleClick); + UI::Button *pinButton = gameList_->Add(new UI::Button(caption, new UI::LinearLayoutParams(UI::FILL_PARENT, UI::FILL_PARENT))); + pinButton->OnClick.Handle(this, &GameBrowser::PinToggleClick); + pinButton->SetImageID(ImageID(IsCurrentPathPinned() ? "I_UNPIN" : "I_PIN")); } if (path_.GetPath().empty()) { diff --git a/UI/UIAtlas.cpp b/UI/UIAtlas.cpp index fa37b7d65a..be5b6cf04a 100644 --- a/UI/UIAtlas.cpp +++ b/UI/UIAtlas.cpp @@ -116,6 +116,9 @@ static const std::string imageIDs[] = { "I_SPEAKER_OFF", "I_WINNER_CUP", "I_EMPTY", + "I_PIN", + "I_UNPIN", + "I_FOLDER_PINNED", }; static std::string PNGNameFromID(std::string_view id) { diff --git a/assets/ui_images/images.svg b/assets/ui_images/images.svg index 206b3ac134..384665aa3f 100644 --- a/assets/ui_images/images.svg +++ b/assets/ui_images/images.svg @@ -7,7 +7,7 @@ viewBox="0 0 158.75 158.75" version="1.1" id="svg1" - inkscape:version="1.4.2 (f4327f4, 2025-05-13)" + inkscape:version="1.4 (86a8ad7, 2024-10-11)" sodipodi:docname="images.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" @@ -3741,17 +3741,6 @@ d="M -23.732181,30.229779 V 49.775586 H -4.4463411 V 30.229779 Z m 2.49666,2.529991 H -6.9405211 V 47.245604 H -21.235521 Z" style="fill:#ffffff;fill-opacity:1;stroke:none" transform="matrix(0.38768981,0,0,0.38768981,58.043664,46.774929)" /> -