Auto-sizing of single tab thumbnail ribbon, also on zoomin/out. Stops autosizing once you manually move the ribbon splitter.
This commit is contained in:
@@ -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<Thumbnail*> 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<Glib::ustring>& efiles) {
|
||||
|
@@ -148,6 +148,7 @@ class FileCatalog : public Gtk::VBox,
|
||||
|
||||
void redrawAll ();
|
||||
void refreshAll ();
|
||||
void refreshHeight ();
|
||||
|
||||
void openRequested (std::vector<Thumbnail*> tbe);
|
||||
void deleteRequested (std::vector<FileBrowserEntry*> tbe);
|
||||
@@ -179,6 +180,8 @@ class FileCatalog : public Gtk::VBox,
|
||||
void openPrevImage () { fileBrowser->openPrevImage(); }
|
||||
|
||||
bool handleShortcutKey (GdkEventKey* event);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -349,6 +349,7 @@ void RTWindow::MoveFileBrowserToEditor()
|
||||
epanel->catalogPane->add(*fCatalog);
|
||||
fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal);
|
||||
fCatalog->redrawAll();
|
||||
fCatalog->refreshHeight();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -90,6 +90,7 @@ class ThumbBrowserBase : public Gtk::VBox {
|
||||
|
||||
void zoomIn () { zoomChanged (true); }
|
||||
void zoomOut () { zoomChanged (false); }
|
||||
int getEffectiveHeight ();
|
||||
|
||||
const std::vector<ThumbBrowserEntryBase*>& getEntries () { return fd; }
|
||||
void styleChanged (const Glib::RefPtr<Gtk::Style>& style);
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user