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