From 62ef20da5f3539cbb13c8fda75f8f2dc299fe7ec Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Sat, 20 Nov 2010 13:52:09 +0100 Subject: [PATCH] Fixed two thumb size related bugs (see issue #346) --- rtgui/filebrowser.cc | 2 +- rtgui/thumbbrowserbase.cc | 9 ++++++--- rtgui/thumbbrowserbase.h | 3 ++- rtgui/thumbbrowserentrybase.cc | 3 +++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 0be846d28..b7cb61da3 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -195,7 +195,7 @@ void FileBrowser::addEntry_ (FileBrowserEntry* entry) { entry->getThumbButtonSet()->setRank (entry->thumbnail->getRank()); entry->getThumbButtonSet()->setInTrash (entry->thumbnail->getStage()==1); entry->getThumbButtonSet()->setButtonListener (this); - entry->resize (options.thumbSize); + entry->resize (getCurrentThumbSize()); // find place in abc order std::vector::iterator i = fd.begin(); diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index 354d42144..99ca1a4f5 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -467,7 +467,7 @@ void ThumbBrowserBase::zoomChanged (bool zoomIn) { int newHeight; int i=0; - int optThumbSize=inTabMode ? options.thumbSizeTab : options.thumbSize; + int optThumbSize=getCurrentThumbSize(); if (zoomIn) for (i=0; igobj(), true); #endif } + +int ThumbBrowserBase::getCurrentThumbSize() { return inTabMode ? options.thumbSizeTab : options.thumbSize; } + void ThumbBrowserBase::refreshThumbImages () { for (int i=0; iresize (previewHeight);// TODO!!! Might be performance bottleneck fd[i]->refreshThumbnailImage (); // TODO: This might cause crashes on some installations } @@ -527,7 +530,7 @@ void ThumbBrowserBase::enableTabMode(bool enable) { if (options.thumbSizeTab!=options.thumbSize) { for (int i=0; iresize (inTabMode ? options.thumbSizeTab : options.thumbSize); + fd[i]->resize (getCurrentThumbSize()); } redraw (); diff --git a/rtgui/thumbbrowserbase.h b/rtgui/thumbbrowserbase.h index 3728e64cb..60b1f24ce 100644 --- a/rtgui/thumbbrowserbase.h +++ b/rtgui/thumbbrowserbase.h @@ -57,7 +57,8 @@ class ThumbBrowserBase : public Gtk::VBox { int inW, inH; bool inTabMode; // Tab mode has e.g. different preview heights - + int getCurrentThumbSize(); // depending on filmstrip/file browser mode + void resizeThumbnailArea (int w, int h); void internalAreaResized (Gtk::Allocation& req); void buttonPressed (int x, int y, int button, GdkEventType type, int state, int clx, int cly, int clw, int clh); diff --git a/rtgui/thumbbrowserentrybase.cc b/rtgui/thumbbrowserentrybase.cc index e94f2605b..51e605180 100644 --- a/rtgui/thumbbrowserentrybase.cc +++ b/rtgui/thumbbrowserentrybase.cc @@ -271,6 +271,9 @@ void ThumbBrowserEntryBase::resize (int h) { // dimensions of the info text getTextSizes (infow, infoh); preh -= infoh + textGap; + + // If the text size was selected very high in preferences this may go negative + if (preh<0) preh=0; } calcThumbnailSize ();