For those who'd like to use their mouse scroll wheel to scroll the tool panel, there's a new option in Preference to disable the vertical scrollbar (see issue 735). The side effect of that is better stability of the curve editor's size.

This commit is contained in:
Hombre 2011-09-08 21:50:29 +02:00
parent 2617c6bccf
commit e56f3958e1
16 changed files with 114 additions and 21 deletions

View File

@ -681,6 +681,7 @@ PREFERENCES_TAB_IMPROC;Traitement de l'image
PREFERENCES_TAB_OUTPUT;Options de sortie
PREFERENCES_TAB_SOUND;Sons
PREFERENCES_THUMBSIZE;Tailles des vignettes
PREFERENCES_TP_VSCROLLBAR;Cacher la barre de défilement verticale du panneau des outils
PREFERENCES_TUNNELMETADATA;Copier les données IPTC/XMP sans les\nchanger dans fichier de sortie
PREFERENCES_USESYSTEMTHEME;Utiliser le thème système
PREFERENCES_WORKFLOW;Habitudes de travail

View File

@ -676,6 +676,7 @@ PREFERENCES_TAB_IMPROC;Image Processing
PREFERENCES_TAB_OUTPUT;Output Options
PREFERENCES_TAB_SOUND;Sounds
PREFERENCES_THUMBSIZE;Thumbnail Size
PREFERENCES_TP_VSCROLLBAR;Hide tool panel's vertical scrollbar
PREFERENCES_TUNNELMETADATA;Copy IPTC/XMP unchanged to output file (when tagging with other program)
PREFERENCES_USESYSTEMTHEME; Use System Theme
PREFERENCES_WORKFLOW;Layout

View File

@ -1321,3 +1321,7 @@ void EditorPanel::tbShowHideSidePanels_managestate(){
ShowHideSidePanelsconn.block (false);
}
void EditorPanel::updateTPVScrollbar (bool hide) {
tpc->updateTPVScrollbar (hide);
}

View File

@ -177,6 +177,7 @@ class EditorPanel : public Gtk::VBox,
bool handleShortcutKey (GdkEventKey* event);
bool getIsProcessing() const { return isProcessing; }
void updateTPVScrollbar (bool hide);
Gtk::Paned *catalogPane;
};

View File

@ -252,3 +252,7 @@ void FilePanel::loadingThumbs(Glib::ustring str, double rate)
parent->setProgressStr(str);
parent->setProgress( rate );
}
void FilePanel::updateTPVScrollbar (bool hide) {
tpc->updateTPVScrollbar (hide);
}

View File

@ -82,6 +82,7 @@ class FilePanel : public Gtk::HPaned,
bool imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::InitialImage*> * );
bool handleShortcutKey (GdkEventKey* event);
void updateTPVScrollbar (bool hide);
};
#endif

View File

@ -236,6 +236,44 @@ void drawCrop (Cairo::RefPtr<Cairo::Context> cr, int imx, int imy, int imw, int
* otherwise the mouse wheel will scroll the editor's tabs content.
*
*/
MyScrolledWindow::MyScrolledWindow () {
set_size_request(-1,30);
}
bool MyScrolledWindow::on_scroll_event (GdkEventScroll* event) {
if (!options.hideTPVScrollbar) {
Gtk::ScrolledWindow::on_scroll_event (event);
return true;
}
Gtk::Adjustment *adjust = get_vadjustment();
Gtk::VScrollbar *scroll = get_vscrollbar();
if (adjust && scroll) {
double upper = adjust->get_upper();
double lower = adjust->get_lower();
double value = adjust->get_value();
double step = adjust->get_step_increment();
double value2 = 0.;
if (event->direction == GDK_SCROLL_DOWN) {
value2 = value+step;
if (value2 > upper)
value2 = upper;
if (value2 != value) {
scroll->set_value(value2);
}
}
else {
value2 = value-step;
if (value2 < lower)
value2 = lower;
if (value2 != value) {
scroll->set_value(value2);
}
}
}
return true;
}
MyComboBoxText::MyComboBoxText () {
set_size_request(40, -1);
}

View File

@ -71,6 +71,14 @@ public:
}
};
class MyScrolledWindow : public Gtk::ScrolledWindow {
bool on_scroll_event (GdkEventScroll* event);
public:
MyScrolledWindow();
};
class MyComboBox : public Gtk::ComboBox {
bool on_scroll_event (GdkEventScroll* event);

View File

@ -153,6 +153,7 @@ void Options::setDefaults () {
histogramBar = true;
showProfileSelector = true;
FileBrowserToolbarSingleRow = true;
hideTPVScrollbar = false;
squareDetailWindow = false;
menuGroupRank = true;
menuGroupLabel = true;
@ -403,6 +404,7 @@ if (keyFile.has_group ("GUI")) {
if (keyFile.has_key ("GUI", "ShowProfileSelector")) showProfileSelector = keyFile.get_boolean ("GUI", "ShowProfileSelector");
if (keyFile.has_key ("GUI", "SquareDetailWindow")) squareDetailWindow = keyFile.get_boolean ("GUI", "SquareDetailWindow");
if (keyFile.has_key ("GUI", "FileBrowserToolbarSingleRow")) FileBrowserToolbarSingleRow = keyFile.get_boolean ("GUI", "FileBrowserToolbarSingleRow");
if (keyFile.has_key ("GUI", "HideTPVScrollbar")) hideTPVScrollbar = keyFile.get_boolean ("GUI", "HideTPVScrollbar");
}
@ -574,6 +576,7 @@ int Options::saveToFile (Glib::ustring fname) {
keyFile.set_boolean ("GUI", "ShowProfileSelector", showProfileSelector);
keyFile.set_boolean ("GUI", "SquareDetailWindow", squareDetailWindow);
keyFile.set_boolean ("GUI", "FileBrowserToolbarSingleRow", FileBrowserToolbarSingleRow);
keyFile.set_boolean ("GUI", "HideTPVScrollbar", hideTPVScrollbar);
//Glib::ArrayHandle<int> crvopen = crvOpen;
//keyFile.set_integer_list ("GUI", "CurvePanelsExpanded", crvopen);

View File

@ -154,6 +154,7 @@ class Options {
bool showProfileSelector;
bool squareDetailWindow;
bool FileBrowserToolbarSingleRow;
bool hideTPVScrollbar;
bool menuGroupRank;
bool menuGroupLabel;

View File

@ -439,6 +439,9 @@ Gtk::Widget* Preferences::getGeneralPanel () {
hbworkflow3->pack_start (*ckbFileBrowserToolbarSingleRow, Gtk::PACK_SHRINK, 4);
vbworkflow->pack_start (*hbworkflow3, Gtk::PACK_SHRINK, 0);
ckbHideTPVScrollbar = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_TP_VSCROLLBAR")) );
vbworkflow->pack_start (*ckbHideTPVScrollbar, Gtk::PACK_SHRINK, 4);
fworklflow->add (*vbworkflow);
mvbsd->pack_start (*fworklflow, Gtk::PACK_SHRINK, 4);
@ -1037,6 +1040,7 @@ void Preferences::storePreferences () {
moptions.showProfileSelector = ckbShowProfileSelector->get_active();
moptions.squareDetailWindow = ckbSquareDetailWindow->get_active();
moptions.FileBrowserToolbarSingleRow = ckbFileBrowserToolbarSingleRow->get_active();
moptions.hideTPVScrollbar = ckbHideTPVScrollbar->get_active();
moptions.overwriteOutputFile = chOverwriteOutputFile->get_active ();
// Sounds
@ -1150,6 +1154,7 @@ void Preferences::fillPreferences () {
ckbShowProfileSelector->set_active(moptions.showProfileSelector);
ckbSquareDetailWindow->set_active(moptions.squareDetailWindow);
ckbFileBrowserToolbarSingleRow->set_active(moptions.FileBrowserToolbarSingleRow);
ckbHideTPVScrollbar->set_active(moptions.hideTPVScrollbar);
//darkFrameDir->set_filename( moptions.rtSettings.darkFramesPath );
//updateDFinfos();
@ -1315,8 +1320,7 @@ void Preferences::switchThemeTo(Glib::ustring newTheme, bool slimInterface) {
void Preferences::workflowUpdate (){
if(moptions.tabbedUI != options.tabbedUI)
{
if(moptions.tabbedUI != options.tabbedUI) {
parent->MoveFileBrowserToMain();
parent->SetMainCurrent();
if(moptions.tabbedUI)
@ -1324,6 +1328,10 @@ void Preferences::workflowUpdate (){
else
parent->epanel->show_all();
}
if (moptions.hideTPVScrollbar != options.hideTPVScrollbar) {
// Update the tool panels
parent->updateTPVScrollbar (moptions.hideTPVScrollbar);
}
}
void Preferences::switchFontTo(Glib::ustring newFont) {

View File

@ -132,6 +132,7 @@ class Preferences : public Gtk::Dialog {
Gtk::CheckButton* ckbHistogramPositionLeft;
Gtk::CheckButton* ckbShowProfileSelector;
Gtk::CheckButton* ckbFileBrowserToolbarSingleRow;
Gtk::CheckButton* ckbHideTPVScrollbar;
Gtk::CheckButton* ckbSquareDetailWindow;

View File

@ -21,7 +21,6 @@
#include <preferences.h>
#include <cursormanager.h>
RTWindow::RTWindow ()
:fpanel(NULL)
,epanel(NULL)
@ -467,3 +466,12 @@ void RTWindow::MoveFileBrowserToEditor()
}
}
void RTWindow::updateTPVScrollbar (bool hide) {
fpanel->updateTPVScrollbar (hide);
epanel->updateTPVScrollbar (hide);
std::map<Glib::ustring, EditorPanel*>::const_iterator itr;
for(itr = epanels.begin(); itr != epanels.end(); ++itr){
((*itr).second)->updateTPVScrollbar (hide);
}
}

View File

@ -77,6 +77,7 @@ class RTWindow : public Gtk::Window, public rtengine::ProgressListener{
void MoveFileBrowserToEditor();
void MoveFileBrowserToMain();
void updateTPVScrollbar (bool hide);
bool getIsFullscreen() { return is_fullscreen; }
};

View File

@ -26,6 +26,7 @@
#include <improcfun.h>
#include <procevents.h>
#include <refreshmap.h>
#include <guiutils.h>
using namespace rtengine::procparams;
@ -110,16 +111,13 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) {
metadataPanel->append_page (*exifpanel, M("MAIN_TAB_EXIF"));
metadataPanel->append_page (*iptcpanel, M("MAIN_TAB_IPTC"));
exposurePanelSW = Gtk::manage (new Gtk::ScrolledWindow ());
detailsPanelSW = Gtk::manage (new Gtk::ScrolledWindow ());
colorPanelSW = Gtk::manage (new Gtk::ScrolledWindow ());
transformPanelSW = Gtk::manage (new Gtk::ScrolledWindow ());
rawPanelSW = Gtk::manage (new Gtk::ScrolledWindow ());
exposurePanelSW->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
detailsPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
colorPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
transformPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
rawPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
exposurePanelSW = Gtk::manage (new MyScrolledWindow ());
detailsPanelSW = Gtk::manage (new MyScrolledWindow ());
colorPanelSW = Gtk::manage (new MyScrolledWindow ());
transformPanelSW = Gtk::manage (new MyScrolledWindow ());
rawPanelSW = Gtk::manage (new MyScrolledWindow ());
updateVScrollbars (options.hideTPVScrollbar);
// load panel endings
for (int i=0; i<5; i++) {
@ -448,8 +446,8 @@ rtengine::RawImage* ToolPanelCoordinator::getFF()
return NULL;
const rtengine::ImageMetaData *imd = ipc->getInitialImage()->getMetaData();
if(imd){
int iso = imd->getISOSpeed();
double shutter = imd->getShutterSpeed();
// int iso = imd->getISOSpeed(); temporarilly removed because unused
// double shutter = imd->getShutterSpeed(); temporarilly removed because unused
double aperture = imd->getFNumber();
double focallength = imd->getFocalLen();
std::string maker( imd->getMake() );
@ -529,8 +527,8 @@ void ToolPanelCoordinator::foldAllButOne (Gtk::Box* parent, FoldableToolPanel* o
bool ToolPanelCoordinator::handleShortcutKey (GdkEventKey* event) {
bool ctrl = event->state & GDK_CONTROL_MASK;
bool shift = event->state & GDK_SHIFT_MASK;
//bool ctrl = event->state & GDK_CONTROL_MASK; temporarilly removed because unused
//bool shift = event->state & GDK_SHIFT_MASK; temporarilly removed because unused
bool alt = event->state & GDK_MOD1_MASK;
if (alt){
@ -561,3 +559,16 @@ bool ToolPanelCoordinator::handleShortcutKey (GdkEventKey* event) {
}
return false;
}
void ToolPanelCoordinator::updateVScrollbars (bool hide) {
Gtk::PolicyType policy = hide ? Gtk::POLICY_NEVER : Gtk::POLICY_AUTOMATIC;
exposurePanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
detailsPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
colorPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
transformPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
rawPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
}
void ToolPanelCoordinator::updateTPVScrollbar (bool hide) {
updateVScrollbars (hide);
}

View File

@ -135,6 +135,7 @@ class ToolPanelCoordinator : public ToolPanelListener,
void addPanel (Gtk::Box* where, FoldableToolPanel* panel, Glib::ustring label);
void foldThemAll (GdkEventButton* event);
void updateVScrollbars (bool hide);
public:
@ -201,6 +202,7 @@ class ToolPanelCoordinator : public ToolPanelListener,
int getSpotWBRectSize ();
CropGUIListener* startCropEditing (Thumbnail* thm=NULL) { return crop; }
void updateTPVScrollbar (bool hide);
bool handleShortcutKey (GdkEventKey* event);
};