Different thumbnails zoom levels for tab ribbon and main file browser, plus save (see issue #325)
This commit is contained in:
@@ -76,6 +76,7 @@ void Options::setDefaults () {
|
||||
multiUser = false;
|
||||
version = 290;
|
||||
thumbSize = 80;
|
||||
thumbSizeTab = 80;
|
||||
showHistory = true;
|
||||
showFilePanelState = 0;
|
||||
showInfo = false;
|
||||
@@ -217,6 +218,7 @@ if (keyFile.has_group ("Profiles")) {
|
||||
|
||||
if (keyFile.has_group ("File Browser")) {
|
||||
if (keyFile.has_key ("File Browser", "ThumbnailSize")) thumbSize = keyFile.get_integer ("File Browser", "ThumbnailSize");
|
||||
if (keyFile.has_key ("File Browser", "ThumbnailSizeTab")) thumbSizeTab = keyFile.get_integer ("File Browser", "ThumbnailSizeTab");
|
||||
if (keyFile.has_key ("File Browser", "BrowseOnlyRaw")) fbOnlyRaw = keyFile.get_boolean ("File Browser", "BrowseOnlyRaw");
|
||||
if (keyFile.has_key ("File Browser", "BrowserShowsDate")) fbShowDateTime = keyFile.get_boolean ("File Browser", "BrowserShowsDate");
|
||||
if (keyFile.has_key ("File Browser", "BrowserShowsExif")) fbShowBasicExif = keyFile.get_boolean ("File Browser", "BrowserShowsExif");
|
||||
@@ -327,6 +329,7 @@ int Options::saveToFile (Glib::ustring fname) {
|
||||
keyFile.set_boolean ("File Browser", "BrowserShowsExif", fbShowBasicExif);
|
||||
keyFile.set_boolean ("File Browser", "BrowserShowsHidden", fbShowHidden);
|
||||
keyFile.set_integer ("File Browser", "ThumbnailSize", thumbSize);
|
||||
keyFile.set_integer ("File Browser", "ThumbnailSizeTab", thumbSizeTab);
|
||||
keyFile.set_integer ("File Browser", "MaxPreviewHeight", maxThumbnailHeight);
|
||||
keyFile.set_integer ("File Browser", "MaxCacheEntries", maxCacheEntries);
|
||||
keyFile.set_integer ("File Browser", "ThumbnailFormat", (int)thumbnailFormat);
|
||||
|
@@ -84,7 +84,7 @@ class Options {
|
||||
bool multiUser;
|
||||
static Glib::ustring rtdir;
|
||||
int version;
|
||||
int thumbSize;
|
||||
int thumbSize,thumbSizeTab;
|
||||
bool showHistory;
|
||||
int showFilePanelState; // 0: normal, 1: maximized, 2: normal, 3: hidden
|
||||
bool showInfo;
|
||||
@@ -131,6 +131,7 @@ class Options {
|
||||
bool overlayedFileNames;
|
||||
bool showFileNames;
|
||||
bool tabbedUI;
|
||||
int previewSizeTab,previewSizeBrowser;
|
||||
|
||||
|
||||
Options ();
|
||||
|
@@ -343,7 +343,7 @@ void RTWindow::MoveFileBrowserToMain()
|
||||
FileCatalog *fCatalog = fpanel->fileCatalog;
|
||||
epanel->catalogPane->remove(*fCatalog);
|
||||
fpanel->ribbonPane->add(*fCatalog);
|
||||
fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Vertical);
|
||||
fCatalog->fileBrowser->enableTabMode(false);
|
||||
fCatalog->redrawAll();
|
||||
}
|
||||
}
|
||||
@@ -355,7 +355,7 @@ void RTWindow::MoveFileBrowserToEditor()
|
||||
FileCatalog *fCatalog = fpanel->fileCatalog;
|
||||
fpanel->ribbonPane->remove(*fCatalog);
|
||||
epanel->catalogPane->add(*fCatalog);
|
||||
fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal);
|
||||
fCatalog->fileBrowser->enableTabMode(true);
|
||||
fCatalog->redrawAll();
|
||||
fCatalog->refreshHeight();
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
ThumbBrowserBase::ThumbBrowserBase ()
|
||||
: lastClicked(NULL), previewHeight(options.thumbSize) {
|
||||
|
||||
inTabMode=false; // corresponding to take thumbSize
|
||||
inW = -1; inH = -1;
|
||||
|
||||
Gtk::HBox* hb1 = new Gtk::HBox ();
|
||||
@@ -467,19 +467,22 @@ void ThumbBrowserBase::zoomChanged (bool zoomIn) {
|
||||
|
||||
int newHeight;
|
||||
int i=0;
|
||||
int optThumbSize=inTabMode ? options.thumbSizeTab : options.thumbSize;
|
||||
if (zoomIn)
|
||||
for (i=0; i<options.thumbnailZoomRatios.size(); i++) {
|
||||
newHeight = (int)(options.thumbnailZoomRatios[i] * options.maxThumbnailHeight);
|
||||
if (newHeight > options.thumbSize)
|
||||
if (newHeight > optThumbSize)
|
||||
break;
|
||||
}
|
||||
else
|
||||
for (i=options.thumbnailZoomRatios.size()-1; i>=0; i--) {
|
||||
newHeight = (int)(options.thumbnailZoomRatios[i] * options.maxThumbnailHeight);
|
||||
if (newHeight < options.thumbSize)
|
||||
if (newHeight < optThumbSize)
|
||||
break;
|
||||
}
|
||||
previewHeight = options.thumbSize = newHeight;
|
||||
previewHeight = newHeight;
|
||||
if (inTabMode) options.thumbSizeTab = newHeight; else options.thumbSize = newHeight;
|
||||
|
||||
for (int i=0; i<fd.size(); i++)
|
||||
fd[i]->resize (previewHeight);
|
||||
redraw ();
|
||||
@@ -490,7 +493,7 @@ void ThumbBrowserBase::zoomChanged (bool zoomIn) {
|
||||
void ThumbBrowserBase::refreshThumbImages () {
|
||||
|
||||
for (int i=0; i<fd.size(); i++){
|
||||
previewHeight = options.thumbSize;
|
||||
previewHeight = inTabMode ? options.thumbSizeTab : options.thumbSize;
|
||||
fd[i]->resize (previewHeight);// TODO!!! Might be performance bottleneck
|
||||
fd[i]->refreshThumbnailImage ();
|
||||
}
|
||||
@@ -518,6 +521,16 @@ void ThumbBrowserBase::setArrangement (Arrangement a) {
|
||||
redraw ();
|
||||
}
|
||||
|
||||
void ThumbBrowserBase::enableTabMode(bool enable) {
|
||||
inTabMode = enable;
|
||||
arrangement = inTabMode ? ThumbBrowserBase::TB_Horizontal : ThumbBrowserBase::TB_Vertical;
|
||||
|
||||
if (options.thumbSizeTab!=options.thumbSize)
|
||||
refreshThumbImages();
|
||||
else
|
||||
redraw();
|
||||
}
|
||||
|
||||
void ThumbBrowserBase::initEntry (ThumbBrowserEntryBase* entry) {
|
||||
|
||||
entry->setOffset ((int)(hscroll.get_value()), (int)(vscroll.get_value()));
|
||||
|
@@ -56,6 +56,8 @@ class ThumbBrowserBase : public Gtk::VBox {
|
||||
|
||||
int inW, inH;
|
||||
|
||||
bool inTabMode; // Tab mode has e.g. different preview heights
|
||||
|
||||
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);
|
||||
@@ -105,6 +107,8 @@ class ThumbBrowserBase : public Gtk::VBox {
|
||||
void setScrollPosition (double h, double v);
|
||||
|
||||
void setArrangement (Arrangement a);
|
||||
void enableTabMode(bool enable); // set both thumb sizes and arrangements
|
||||
|
||||
virtual bool checkFilter (ThumbBrowserEntryBase* entry) { return true; }
|
||||
virtual void rightClicked (ThumbBrowserEntryBase* entry) {}
|
||||
virtual void doubleClicked (ThumbBrowserEntryBase* entry) {}
|
||||
|
Reference in New Issue
Block a user