diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 65fdf7e0a..901d52070 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -409,6 +409,11 @@ void FileCatalog::refreshAll () { fileBrowser->refreshThumbImages (); } +void FileCatalog::refreshHeight () { + int newHeight=fileBrowser->getEffectiveHeight(); + set_size_request(0, newHeight); +} + void FileCatalog::_openImage (std::vector tmb) { if (enabled && listener!=NULL) { @@ -838,14 +843,14 @@ bool FileCatalog::trashIsEmpty () { void FileCatalog::zoomIn () { - fileBrowser->zoomIn (); + refreshHeight(); } void FileCatalog::zoomOut () { - fileBrowser->zoomOut (); + refreshHeight(); } void FileCatalog::refreshEditedState (const std::set& efiles) { diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 0eaf3c01c..9e5e1962f 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -148,6 +148,7 @@ class FileCatalog : public Gtk::VBox, void redrawAll (); void refreshAll (); + void refreshHeight (); void openRequested (std::vector tbe); void deleteRequested (std::vector tbe); @@ -179,6 +180,8 @@ class FileCatalog : public Gtk::VBox, void openPrevImage () { fileBrowser->openPrevImage(); } bool handleShortcutKey (GdkEventKey* event); + + }; #endif diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 6dd3cfe40..a627c1a2b 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -349,6 +349,7 @@ void RTWindow::MoveFileBrowserToEditor() epanel->catalogPane->add(*fCatalog); fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal); fCatalog->redrawAll(); + fCatalog->refreshHeight(); } } diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index cea0bbc83..29eb9502e 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -534,6 +534,14 @@ void ThumbBrowserBase::setScrollPosition (double h, double v) { vscroll.set_value (v>vscroll.get_adjustment()->get_upper() ? vscroll.get_adjustment()->get_upper() : v); } +// needed for auto-height in single tab +int ThumbBrowserBase::getEffectiveHeight() { + int h=0; + if (fd.size()>0) h=fd[0]->getEffectiveHeight(); + return h; +} + + /*void PreviewImgUpdater::processCustomOrder () { // find first filtered entry, if any diff --git a/rtgui/thumbbrowserbase.h b/rtgui/thumbbrowserbase.h index 801a96756..f4e8a3268 100644 --- a/rtgui/thumbbrowserbase.h +++ b/rtgui/thumbbrowserbase.h @@ -90,6 +90,7 @@ class ThumbBrowserBase : public Gtk::VBox { void zoomIn () { zoomChanged (true); } void zoomOut () { zoomChanged (false); } + int getEffectiveHeight (); const std::vector& getEntries () { return fd; } void styleChanged (const Glib::RefPtr& style); diff --git a/rtgui/thumbbrowserentrybase.h b/rtgui/thumbbrowserentrybase.h index 6562633d0..abf69f88c 100644 --- a/rtgui/thumbbrowserentrybase.h +++ b/rtgui/thumbbrowserentrybase.h @@ -101,6 +101,9 @@ protected: void addButtonSet (LWButtonSet* bs); int getMinimalHeight () { return height; } int getMinimalWidth () { return width; } + + int getEffectiveHeight () { return fnlabh+dtlabh+upperMargin+lowerMargin+textGap+height; } + bool inside (int x, int y); bool insideWindow (int x, int y, int w, int h); void setPosition (int x, int y, int w, int h);