From 7ad9d6cf140d868a03dcd10645a4ecaa3ca446b8 Mon Sep 17 00:00:00 2001 From: jpirnay Date: Mon, 23 Mar 2026 21:37:49 +0100 Subject: [PATCH] Hide buttons when empty --- src/activities/home/RecentBooksActivity.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/activities/home/RecentBooksActivity.cpp b/src/activities/home/RecentBooksActivity.cpp index e991f65a..ffbd8319 100644 --- a/src/activities/home/RecentBooksActivity.cpp +++ b/src/activities/home/RecentBooksActivity.cpp @@ -119,7 +119,9 @@ void RecentBooksActivity::render(RenderLock&&) { } // Help text - const auto labels = mappedInput.mapLabels(tr(STR_HOME), tr(STR_OPEN), tr(STR_REMOVE), ""); + const bool hasBooks = !recentBooks.empty(); + const auto labels = + mappedInput.mapLabels(tr(STR_HOME), hasBooks ? tr(STR_OPEN) : "", hasBooks ? tr(STR_REMOVE) : "", ""); GUI.drawButtonHints(renderer, labels.btn1, labels.btn2, labels.btn3, labels.btn4); renderer.displayBuffer();