Introducing panning acceleration factor (see issue #945: Paning a 1:1 preview from border to border need several click (& refresh))

This commit is contained in:
natureh
2011-08-28 20:58:53 +02:00
parent 5d049033d7
commit 5a5775edba
7 changed files with 41 additions and 8 deletions

View File

@@ -640,6 +640,8 @@ PREFERENCES_OUTDIRTEMPLATE;Utiliser le modèle
PREFERENCES_OUTDIRTEMPLATEHINT;<i>Vous pouvez utiliser les paramètres de chaîne formatées suivants:</i>\n<b>%f, %d1, %d2, ..., %p1, %p2, ...</b>\n<i>\nCes paramètres de chaînes formatées se réfèrent aux dossiers et sous-chemins du chemin du fichier RAW.\n\nPar exemple, si </i> <b>/home/tom/image/02-09-2006/dsc0012.nef</b><i>a été ouvert, la signification des paramètres est:\n</i><b>%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n</b><i>\nSi vous voulez enregistrer l'image de sortie là où se trouve l'original, écrivez:\n</i><b>%p1/%f\n</b><i>\nSi vous voulez enregistrer l'image de sortie dans un dossier 'convertis' situé dans le dossier de l'original, écrivez:\n</i><b>%p1/convertis/%f\n</b><i>\nSi vous voulez enregistrer l'image de sortie dans le dossier '/home/tom/convertis' en conservant le même sous-dossier de dates, écrivez:\n</i><b>%p2/convertis/%d1/%f</b> PREFERENCES_OUTDIRTEMPLATEHINT;<i>Vous pouvez utiliser les paramètres de chaîne formatées suivants:</i>\n<b>%f, %d1, %d2, ..., %p1, %p2, ...</b>\n<i>\nCes paramètres de chaînes formatées se réfèrent aux dossiers et sous-chemins du chemin du fichier RAW.\n\nPar exemple, si </i> <b>/home/tom/image/02-09-2006/dsc0012.nef</b><i>a été ouvert, la signification des paramètres est:\n</i><b>%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n</b><i>\nSi vous voulez enregistrer l'image de sortie là où se trouve l'original, écrivez:\n</i><b>%p1/%f\n</b><i>\nSi vous voulez enregistrer l'image de sortie dans un dossier 'convertis' situé dans le dossier de l'original, écrivez:\n</i><b>%p1/convertis/%f\n</b><i>\nSi vous voulez enregistrer l'image de sortie dans le dossier '/home/tom/convertis' en conservant le même sous-dossier de dates, écrivez:\n</i><b>%p2/convertis/%d1/%f</b>
PREFERENCES_OVERLAY_FILENAMES;Superposer les noms de fichier sur les vignettes PREFERENCES_OVERLAY_FILENAMES;Superposer les noms de fichier sur les vignettes
PREFERENCES_OVERWRITEOUTPUTFILE;Écraser le fichier s'il existe déjà PREFERENCES_OVERWRITEOUTPUTFILE;Écraser le fichier s'il existe déjà
PREFERENCES_PANFACTORFRAME;Accélération du déplacement
PREFERENCES_PANFACTORLABEL;Facteur
PREFERENCES_PARSEDEXT;Extensions considérées PREFERENCES_PARSEDEXT;Extensions considérées
PREFERENCES_PARSEDEXTADD;Ajout de l'extension PREFERENCES_PARSEDEXTADD;Ajout de l'extension
PREFERENCES_PARSEDEXTADDHINT;Tapez une extension et cliquez ce bouton pour l'ajouter à la liste PREFERENCES_PARSEDEXTADDHINT;Tapez une extension et cliquez ce bouton pour l'ajouter à la liste

View File

@@ -635,6 +635,8 @@ PREFERENCES_OUTDIRTEMPLATE;Use Template
PREFERENCES_OUTDIRTEMPLATEHINT;You can use the following formatting strings:\n<b>%f</b>, <b>%d1</b>, <b>%d2</b>, ..., <b>%p1</b>, <b>%p2</b>, ..., <b>%r</b>\n\nThese formatting strings refer to the different parts of the photo's pathname, or some attributes of the photo.\n\n%r will be replaced by the rank of the photo. If the photo is unranked, %r will be replaced by '0'. If the photo is in trash bin, %r will be replaced by 'x'.\n\nFor example, if the photo being processed has the following pathname:\n<b><i>/home/tom/photos/2010-10-31/dsc0042.nef</i></b>\nthe meaning of the formatting strings are:\n<b>%d4</b> = <i>home</i>\n<b>%d3</b> = <i>tom</i>\n<b>%d2</b> = <i>photos</i>\n<b>%d1</b> = <i>2010-10-31</i>\n<b>%f</b> = <i>dsc0042</i>\n<b>%p1</b> = <i>/home/tom/photos/2010-10-31/</i>\n<b>%p2</b> = <i>/home/tom/photos/</i>\n<b>%p3</b> = <i>/home/tom/</i>\n<b>%p4</b> = <i>/home/</i>\n\nIf you want to save the output image where the original is, write:\n<b>%p1/%f</b>\n\nIf you want to save the output image in a directory named "<i>converted</i>" located in the directory of the opened image, write:\n<b>%p1/converted/%f</b>\n\nIf you want to save the output image in a directory named "<i>/home/tom/photos/converted/2010-10-31</i>", write:\n<b>%p2/converted/%d1/%f</b> PREFERENCES_OUTDIRTEMPLATEHINT;You can use the following formatting strings:\n<b>%f</b>, <b>%d1</b>, <b>%d2</b>, ..., <b>%p1</b>, <b>%p2</b>, ..., <b>%r</b>\n\nThese formatting strings refer to the different parts of the photo's pathname, or some attributes of the photo.\n\n%r will be replaced by the rank of the photo. If the photo is unranked, %r will be replaced by '0'. If the photo is in trash bin, %r will be replaced by 'x'.\n\nFor example, if the photo being processed has the following pathname:\n<b><i>/home/tom/photos/2010-10-31/dsc0042.nef</i></b>\nthe meaning of the formatting strings are:\n<b>%d4</b> = <i>home</i>\n<b>%d3</b> = <i>tom</i>\n<b>%d2</b> = <i>photos</i>\n<b>%d1</b> = <i>2010-10-31</i>\n<b>%f</b> = <i>dsc0042</i>\n<b>%p1</b> = <i>/home/tom/photos/2010-10-31/</i>\n<b>%p2</b> = <i>/home/tom/photos/</i>\n<b>%p3</b> = <i>/home/tom/</i>\n<b>%p4</b> = <i>/home/</i>\n\nIf you want to save the output image where the original is, write:\n<b>%p1/%f</b>\n\nIf you want to save the output image in a directory named "<i>converted</i>" located in the directory of the opened image, write:\n<b>%p1/converted/%f</b>\n\nIf you want to save the output image in a directory named "<i>/home/tom/photos/converted/2010-10-31</i>", write:\n<b>%p2/converted/%d1/%f</b>
PREFERENCES_OVERLAY_FILENAMES;Overlay filenames on thumbnails PREFERENCES_OVERLAY_FILENAMES;Overlay filenames on thumbnails
PREFERENCES_OVERWRITEOUTPUTFILE;Overwrite existing output files PREFERENCES_OVERWRITEOUTPUTFILE;Overwrite existing output files
PREFERENCES_PANFACTORFRAME;Panning acceleration
PREFERENCES_PANFACTORLABEL;Factor
PREFERENCES_PARSEDEXT;Parsed Extensions PREFERENCES_PARSEDEXT;Parsed Extensions
PREFERENCES_PARSEDEXTADD;Add Extension PREFERENCES_PARSEDEXTADD;Add Extension
PREFERENCES_PARSEDEXTADDHINT;Type an extension and press this button to append list PREFERENCES_PARSEDEXTADDHINT;Type an extension and press this button to append list

View File

@@ -380,8 +380,9 @@ void CropWindow::pointerMoved (int x, int y) {
iarea->redraw (); iarea->redraw ();
} }
else if (state==SCropImgMove) { else if (state==SCropImgMove) {
action_x = (press_x - x) / zoomSteps[cropZoom].zoom; double accel = options.panAccelFactor * zoomSteps[cropZoom].zoom;
action_y = (press_y - y) / zoomSteps[cropZoom].zoom; action_x = (press_x - x) / zoomSteps[cropZoom].zoom * accel;
action_y = (press_y - y) / zoomSteps[cropZoom].zoom * accel;
for (std::list<CropWindowListener*>::iterator i=listeners.begin(); i!=listeners.end(); i++) for (std::list<CropWindowListener*>::iterator i=listeners.begin(); i!=listeners.end(); i++)
(*i)->cropPositionChanged (this); (*i)->cropPositionChanged (this);
iarea->redraw (); iarea->redraw ();

View File

@@ -86,6 +86,7 @@ void Options::setDefaults () {
browserToolPanelHeight = 300; browserToolPanelHeight = 300;
historyPanelWidth = 230; // was 150 historyPanelWidth = 230; // was 150
lastScale = 5; // was 4 lastScale = 5; // was 4
panAccelFactor = 5;
lastCropSize = 1; lastCropSize = 1;
fbOnlyRaw = false; fbOnlyRaw = false;
fbShowDateTime = true; fbShowDateTime = true;
@@ -383,6 +384,7 @@ if (keyFile.has_group ("GUI")) {
if (keyFile.has_key ("GUI", "BrowserToolPanelHeight"))browserToolPanelHeight = keyFile.get_integer ("GUI", "BrowserToolPanelHeight"); if (keyFile.has_key ("GUI", "BrowserToolPanelHeight"))browserToolPanelHeight = keyFile.get_integer ("GUI", "BrowserToolPanelHeight");
if (keyFile.has_key ("GUI", "HistoryPanelWidth")) historyPanelWidth = keyFile.get_integer ("GUI", "HistoryPanelWidth"); if (keyFile.has_key ("GUI", "HistoryPanelWidth")) historyPanelWidth = keyFile.get_integer ("GUI", "HistoryPanelWidth");
if (keyFile.has_key ("GUI", "LastPreviewScale")) lastScale = keyFile.get_integer ("GUI", "LastPreviewScale"); if (keyFile.has_key ("GUI", "LastPreviewScale")) lastScale = keyFile.get_integer ("GUI", "LastPreviewScale");
if (keyFile.has_key ("GUI", "PanAccelFactor")) panAccelFactor = keyFile.get_integer ("GUI", "PanAccelFactor");
if (keyFile.has_key ("GUI", "LastCropSize")) lastCropSize = keyFile.get_integer ("GUI", "LastCropSize"); if (keyFile.has_key ("GUI", "LastCropSize")) lastCropSize = keyFile.get_integer ("GUI", "LastCropSize");
if (keyFile.has_key ("GUI", "ShowHistory")) showHistory = keyFile.get_boolean ("GUI", "ShowHistory"); if (keyFile.has_key ("GUI", "ShowHistory")) showHistory = keyFile.get_boolean ("GUI", "ShowHistory");
if (keyFile.has_key ("GUI", "ShowFilePanelState")) showFilePanelState= keyFile.get_integer ("GUI", "ShowFilePanelState"); if (keyFile.has_key ("GUI", "ShowFilePanelState")) showFilePanelState= keyFile.get_integer ("GUI", "ShowFilePanelState");
@@ -553,6 +555,7 @@ int Options::saveToFile (Glib::ustring fname) {
keyFile.set_integer ("GUI", "BrowserToolPanelHeight", browserToolPanelHeight); keyFile.set_integer ("GUI", "BrowserToolPanelHeight", browserToolPanelHeight);
keyFile.set_integer ("GUI", "HistoryPanelWidth", historyPanelWidth); keyFile.set_integer ("GUI", "HistoryPanelWidth", historyPanelWidth);
keyFile.set_integer ("GUI", "LastPreviewScale", lastScale); keyFile.set_integer ("GUI", "LastPreviewScale", lastScale);
keyFile.set_integer ("GUI", "PanAccelFactor", panAccelFactor);
keyFile.set_integer ("GUI", "LastCropSize", lastCropSize); keyFile.set_integer ("GUI", "LastCropSize", lastCropSize);
keyFile.set_boolean ("GUI", "ShowHistory", showHistory); keyFile.set_boolean ("GUI", "ShowHistory", showHistory);
keyFile.set_integer ("GUI", "ShowFilePanelState", showFilePanelState); keyFile.set_integer ("GUI", "ShowFilePanelState", showFilePanelState);

View File

@@ -78,6 +78,7 @@ class Options {
int preferencesWidth; int preferencesWidth;
int preferencesHeight; int preferencesHeight;
int lastScale; int lastScale;
int panAccelFactor;
int lastCropSize; int lastCropSize;
bool fbOnlyRaw; bool fbOnlyRaw;
bool fbShowDateTime; bool fbShowDateTime;

View File

@@ -555,22 +555,42 @@ Gtk::Widget* Preferences::getGeneralPanel () {
hbcd->pack_start (*frl, true, true, 0); hbcd->pack_start (*frl, true, true, 0);
//----- //-----
Gtk::VBox* dfpfvb = Gtk::manage( new Gtk::VBox () );
dfpfvb->set_spacing (4);
Gtk::Frame* fdf = Gtk::manage( new Gtk::Frame (M("PREFERENCES_DATEFORMATFRAME")) ); Gtk::Frame* fdf = Gtk::manage( new Gtk::Frame (M("PREFERENCES_DATEFORMATFRAME")) );
Gtk::HBox* hb6 = Gtk::manage( new Gtk::HBox () ); Gtk::HBox* hb6 = Gtk::manage( new Gtk::HBox () );
hb6->set_border_width (4); hb6->set_border_width (4);
hb6->set_spacing (4); hb6->set_spacing (4);
Gtk::VBox* dfvb = Gtk::manage( new Gtk::VBox () ); Gtk::Label* dflab = Gtk::manage( new Gtk::Label (M("PREFERENCES_DATEFORMAT")+":", Gtk::ALIGN_LEFT));
Gtk::Label* dflab = Gtk::manage( new Gtk::Label (M("PREFERENCES_DATEFORMAT")+":") );
hb6->pack_start (*dflab, Gtk::PACK_SHRINK,4); hb6->pack_start (*dflab, Gtk::PACK_SHRINK,4);
dateformat = Gtk::manage( new Gtk::Entry () ); dateformat = Gtk::manage( new Gtk::Entry () );
dateformat->set_tooltip_markup (M("PREFERENCES_DATEFORMATHINT")); dateformat->set_tooltip_markup (M("PREFERENCES_DATEFORMATHINT"));
dflab->set_tooltip_markup (M("PREFERENCES_DATEFORMATHINT")); dflab->set_tooltip_markup (M("PREFERENCES_DATEFORMATHINT"));
hb6->pack_start (*dateformat); hb6->pack_start (*dflab, Gtk::PACK_SHRINK, 0);
dfvb->pack_start (*hb6, Gtk::PACK_SHRINK, 4); hb6->pack_end (*dateformat, Gtk::PACK_SHRINK, 0);
fdf->add (*dfvb); fdf->add (*hb6);
hbcd->pack_start (*fdf, true, true, 0); dfpfvb->pack_start (*fdf, true, true, 0);
//-----
Gtk::Frame* pff = Gtk::manage( new Gtk::Frame (M("PREFERENCES_PANFACTORFRAME")) );
Gtk::HBox* pfhb = Gtk::manage( new Gtk::HBox () );
pfhb->set_border_width(4);
pfhb->set_spacing(4);
Gtk::Label* pfl = Gtk::manage( new Gtk::Label (M("PREFERENCES_PANFACTORLABEL") + ":", Gtk::ALIGN_LEFT));
panFactor = Gtk::manage( new Gtk::SpinButton () );
panFactor->set_digits (0);
panFactor->set_increments (1, 5);
panFactor->set_range (1, 10);
pfhb->pack_start (*pfl, Gtk::PACK_SHRINK, 0);
pfhb->pack_end (*panFactor, Gtk::PACK_SHRINK, 0);
pff->add (*pfhb);
dfpfvb->pack_start (*pff, true, true, 0);
hbcd->pack_start (*dfpfvb, Gtk::PACK_SHRINK, 4);
mvbsd->pack_start (*hbcd, Gtk::PACK_SHRINK, 4); mvbsd->pack_start (*hbcd, Gtk::PACK_SHRINK, 4);
//----- //-----
@@ -912,6 +932,7 @@ void Preferences::storePreferences () {
moptions.defProfRaw = rprofiles->get_active_text(); moptions.defProfRaw = rprofiles->get_active_text();
moptions.defProfImg = iprofiles->get_active_text(); moptions.defProfImg = iprofiles->get_active_text();
moptions.dateFormat = dateformat->get_text(); moptions.dateFormat = dateformat->get_text();
moptions.panAccelFactor = (int)panFactor->get_value();
moptions.fbShowDateTime = showDateTime->get_active (); moptions.fbShowDateTime = showDateTime->get_active ();
moptions.fbShowBasicExif = showBasicExif->get_active (); moptions.fbShowBasicExif = showBasicExif->get_active ();
moptions.menuGroupRank = ckbmenuGroupRank->get_active(); moptions.menuGroupRank = ckbmenuGroupRank->get_active();
@@ -1033,6 +1054,7 @@ void Preferences::fillPreferences () {
rprofiles->set_active_text (moptions.defProfRaw); rprofiles->set_active_text (moptions.defProfRaw);
iprofiles->set_active_text (moptions.defProfImg); iprofiles->set_active_text (moptions.defProfImg);
dateformat->set_text (moptions.dateFormat); dateformat->set_text (moptions.dateFormat);
panFactor->set_value(moptions.panAccelFactor);
if (safe_file_test (moptions.rtSettings.monitorProfile, Glib::FILE_TEST_EXISTS)) if (safe_file_test (moptions.rtSettings.monitorProfile, Glib::FILE_TEST_EXISTS))
monProfile->set_filename (moptions.rtSettings.monitorProfile); monProfile->set_filename (moptions.rtSettings.monitorProfile);
if (moptions.rtSettings.monitorProfile.empty()) if (moptions.rtSettings.monitorProfile.empty())

View File

@@ -83,6 +83,8 @@ class Preferences : public Gtk::Dialog {
Gtk::SpinButton* hlThresh; Gtk::SpinButton* hlThresh;
Gtk::SpinButton* shThresh; Gtk::SpinButton* shThresh;
Gtk::SpinButton* panFactor;
Gtk::ComboBoxText* intent; Gtk::ComboBoxText* intent;
Gtk::ComboBoxText* theme; Gtk::ComboBoxText* theme;