From 30ff43ad367618bdee518c1411dd4553692cae51 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Fri, 8 Dec 2017 23:24:42 +0100 Subject: [PATCH 1/3] Tool panel vertical scrollbar bug in Linux #3413 When the vertical scrollbar is set to hidden, one cannot scroll the toolbox vertically using the mouse scrollwheel in Linux. This patch works around the problem by forcing the scrollbar to always be visible in Linux. --- rtgui/options.cc | 6 +++++- rtgui/preferences.cc | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/rtgui/options.cc b/rtgui/options.cc index d1b91c3ac..69e5c4bc9 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -1366,10 +1366,14 @@ void Options::readFromFile (Glib::ustring fname) FileBrowserToolbarSingleRow = keyFile.get_boolean ("GUI", "FileBrowserToolbarSingleRow"); } +#ifdef __linux__ + // Cannot scroll toolbox with mousewheel when HideTPVScrollbar=true #3413 + hideTPVScrollbar = false; +#else if (keyFile.has_key ("GUI", "HideTPVScrollbar")) { hideTPVScrollbar = keyFile.get_boolean ("GUI", "HideTPVScrollbar"); } - +#endif if (keyFile.has_key ("GUI", "UseIconNoText")) { UseIconNoText = keyFile.get_boolean ("GUI", "UseIconNoText"); } diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 7e6018ff0..ac3f4991c 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -1003,6 +1003,11 @@ Gtk::Widget* Preferences::getGeneralPanel () setExpandAlignProperties (hb4label, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); ckbHideTPVScrollbar = Gtk::manage ( new Gtk::CheckButton (M ("PREFERENCES_TP_VSCROLLBAR")) ); setExpandAlignProperties (ckbHideTPVScrollbar, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); +#ifdef __linux__ + // Cannot scroll toolbox with mousewheel when HideTPVScrollbar=true #3413 + ckbHideTPVScrollbar->set_active(false); + ckbHideTPVScrollbar->set_sensitive(false); +#endif ckbUseIconNoText = Gtk::manage ( new Gtk::CheckButton (M ("PREFERENCES_TP_USEICONORTEXT")) ); setExpandAlignProperties (ckbUseIconNoText, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); workflowGrid->attach_next_to (*hb4label, *ckbFileBrowserToolbarSingleRow, Gtk::POS_BOTTOM, 1, 1); From ec24784d10ca870a46e45919c9764f6af51f5ef2 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Fri, 8 Dec 2017 23:24:42 +0100 Subject: [PATCH 2/3] Tool panel vertical scrollbar bug in Linux #3413 When the vertical scrollbar is set to hidden, one cannot scroll the toolbox vertically using the mouse scrollwheel in Linux. This patch works around the problem by forcing the scrollbar to always be visible in Linux. --- rtgui/options.cc | 6 +++++- rtgui/preferences.cc | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/rtgui/options.cc b/rtgui/options.cc index d1b91c3ac..69e5c4bc9 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -1366,10 +1366,14 @@ void Options::readFromFile (Glib::ustring fname) FileBrowserToolbarSingleRow = keyFile.get_boolean ("GUI", "FileBrowserToolbarSingleRow"); } +#ifdef __linux__ + // Cannot scroll toolbox with mousewheel when HideTPVScrollbar=true #3413 + hideTPVScrollbar = false; +#else if (keyFile.has_key ("GUI", "HideTPVScrollbar")) { hideTPVScrollbar = keyFile.get_boolean ("GUI", "HideTPVScrollbar"); } - +#endif if (keyFile.has_key ("GUI", "UseIconNoText")) { UseIconNoText = keyFile.get_boolean ("GUI", "UseIconNoText"); } diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 7e6018ff0..ac3f4991c 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -1003,6 +1003,11 @@ Gtk::Widget* Preferences::getGeneralPanel () setExpandAlignProperties (hb4label, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); ckbHideTPVScrollbar = Gtk::manage ( new Gtk::CheckButton (M ("PREFERENCES_TP_VSCROLLBAR")) ); setExpandAlignProperties (ckbHideTPVScrollbar, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); +#ifdef __linux__ + // Cannot scroll toolbox with mousewheel when HideTPVScrollbar=true #3413 + ckbHideTPVScrollbar->set_active(false); + ckbHideTPVScrollbar->set_sensitive(false); +#endif ckbUseIconNoText = Gtk::manage ( new Gtk::CheckButton (M ("PREFERENCES_TP_USEICONORTEXT")) ); setExpandAlignProperties (ckbUseIconNoText, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); workflowGrid->attach_next_to (*hb4label, *ckbFileBrowserToolbarSingleRow, Gtk::POS_BOTTOM, 1, 1); From 8e151e97c82826bf51dd84d4e23ac66b2a21f0be Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Sun, 17 Dec 2017 03:52:07 +0100 Subject: [PATCH 3/3] Linux GTK+ >=3.19 only. Force the toolbox vertical scrollbar to be visible only if using Linux and GTK+ >=3.19. #3413 --- rtgui/options.cc | 2 +- rtgui/preferences.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rtgui/options.cc b/rtgui/options.cc index 69e5c4bc9..031678ddd 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -1366,7 +1366,7 @@ void Options::readFromFile (Glib::ustring fname) FileBrowserToolbarSingleRow = keyFile.get_boolean ("GUI", "FileBrowserToolbarSingleRow"); } -#ifdef __linux__ +#if defined(__linux__) && ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION > 18) || GTK_MAJOR_VERSION > 3) // Cannot scroll toolbox with mousewheel when HideTPVScrollbar=true #3413 hideTPVScrollbar = false; #else diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index ac3f4991c..cfa10265b 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -1003,7 +1003,7 @@ Gtk::Widget* Preferences::getGeneralPanel () setExpandAlignProperties (hb4label, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); ckbHideTPVScrollbar = Gtk::manage ( new Gtk::CheckButton (M ("PREFERENCES_TP_VSCROLLBAR")) ); setExpandAlignProperties (ckbHideTPVScrollbar, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); -#ifdef __linux__ +#if defined(__linux__) && ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION > 18) || GTK_MAJOR_VERSION > 3) // Cannot scroll toolbox with mousewheel when HideTPVScrollbar=true #3413 ckbHideTPVScrollbar->set_active(false); ckbHideTPVScrollbar->set_sensitive(false);