diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 76ce7536d..d8052b562 100755 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -1181,6 +1181,7 @@ void FileBrowser::applyFilter (const BrowserFilter& filter) { if (selchanged) notifySelectionListener (); + tbl->filterApplied(); redraw (); } diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index 7e51866b0..c7e1fd09b 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -38,6 +38,7 @@ class FileBrowserListener { public: virtual ~FileBrowserListener () {} + virtual void filterApplied () {} virtual void openRequested (std::vector tbe) {} virtual void developRequested (std::vector tbe, bool fastmode) {} virtual void renameRequested (std::vector tbe) {} diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 28c22dd80..f850e0f49 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -547,7 +547,7 @@ void FileCatalog::enableTabMode(bool enable) { redrawAll(); } - + void FileCatalog::_refreshProgressBar () { // In tab mode, no progress bar at all // Also mention that this progress bar only measures the FIRST pass (quick thumbnails) @@ -564,7 +564,7 @@ void FileCatalog::_refreshProgressBar () { hbb = Gtk::manage (new Gtk::HBox ()); if (!previewsToLoad ) { hbb->pack_start (*Gtk::manage (new Gtk::Image (Gtk::Stock::DIRECTORY, Gtk::ICON_SIZE_MENU))); - int filteredCount=fileBrowser->getNumFiltered(); + int filteredCount = min(fileBrowser->getNumFiltered(),previewsLoaded); label = Gtk::manage (new Gtk::Label (M("MAIN_FRAME_FILEBROWSER")+ (filteredCount!=previewsLoaded ? " ["+ Glib::ustring::format(filteredCount)+"/" : " (") @@ -589,6 +589,11 @@ int refreshProgressBarUI (void* data) { (static_cast(data))->_refreshProgressBar (); return 0; } + +void FileCatalog::filterApplied() { + g_idle_add (refreshProgressBarUI, this); +} + void FileCatalog::previewReady (int dir_id, FileBrowserEntry* fdn) { diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 6671c763c..b2ba9d691 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -259,6 +259,7 @@ class FileCatalog : public Gtk::VBox, void showToolBar(); void hideToolBar(); + void filterApplied(); #ifndef _WIN32 void on_dir_changed (const Glib::RefPtr& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, bool internal);