|
|
@@ -157,6 +157,11 @@ void BibliothecaWindow::buildHeaderBar() {
|
|
|
m_backButton.set_tooltip_text("Back");
|
|
|
m_backButton.signal_clicked().connect([this]() {
|
|
|
m_stack.set_visible_child("shelf");
|
|
|
+ // Restore search filter when returning from details
|
|
|
+ if (!m_lastQuery.empty()) {
|
|
|
+ m_shelf->setFilter(m_lastQuery);
|
|
|
+ updateVisibleView();
|
|
|
+ }
|
|
|
});
|
|
|
m_headerBar.pack_start(m_backButton);
|
|
|
|
|
|
@@ -305,7 +310,12 @@ void BibliothecaWindow::onSearchModeChanged() {
|
|
|
m_searchEntry.grab_focus();
|
|
|
m_searchEntry.select_region(0, -1);
|
|
|
} else if (!m_searchEntry.get_text().empty()) {
|
|
|
- m_searchEntry.set_text("");
|
|
|
+ // Only clear search when explicitly closing search mode (not when navigating)
|
|
|
+ // Check if we're on the shelf view - only clear if user is closing search there
|
|
|
+ if (m_stack.get_visible_child_name() == "shelf" ||
|
|
|
+ m_stack.get_visible_child_name() == "noresults") {
|
|
|
+ m_searchEntry.set_text("");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|