From a6b1eb46fd415e31dfad5c97f6893c3d17966889 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Thu, 25 Jul 2019 11:49:17 +0200 Subject: [PATCH 1/4] Filmstrip horizontal scroll rate When scrolling with the mouse scroll-wheel while hovering over a thumbnail in the Filmstrip, now it scrolls by an amount equal to the first thumb's width. Previously it used the height. Spotted by Ingo. --- rtgui/thumbbrowserbase.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index cf3b36d03..b7170856a 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -542,7 +542,7 @@ void ThumbBrowserBase::configScrollBars () vscroll.get_adjustment()->set_upper (inH); hscroll.get_adjustment()->set_lower (0); vscroll.get_adjustment()->set_lower (0); - hscroll.get_adjustment()->set_step_increment (!fd.empty() ? fd[0]->getEffectiveHeight() : 0); + hscroll.get_adjustment()->set_step_increment (!fd.empty() ? fd[0]->getEffectiveWidth() : 0); vscroll.get_adjustment()->set_step_increment (!fd.empty() ? fd[0]->getEffectiveHeight() : 0); hscroll.get_adjustment()->set_page_increment (iw); vscroll.get_adjustment()->set_page_increment (ih); From 4cbc2a9091273abd17e535950984a74dc2204c02 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Thu, 25 Jul 2019 12:04:45 +0200 Subject: [PATCH 2/4] Fix missing filename tooltip When hovering over a thumb which has characters in its filename which are used in markup, such as '&', the tooltip was missing, due to the ampersand being parsed as markup. Now the filename is treated as plain text. --- rtgui/thumbbrowserbase.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index b7170856a..5129620e1 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -749,7 +749,7 @@ bool ThumbBrowserBase::Internal::on_query_tooltip (int x, int y, bool keyboard_t } if (!ttip.empty()) { - tooltip->set_markup (ttip); + tooltip->set_text(ttip); return true; } else { return false; From a9edbcf47bf9120f7e6a73ce4ff9d4d556638d5c Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Thu, 25 Jul 2019 14:11:40 +0200 Subject: [PATCH 3/4] Improve page-up/down scrolling in File Browser Patch by Ingo --- rtgui/thumbbrowserbase.cc | 43 ++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index 5129620e1..8392e1b61 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -534,28 +534,33 @@ void ThumbBrowserBase::configScrollBars () GThreadLock tLock; // Acquire the GUI if (inW > 0 && inH > 0) { - - int iw = internal.get_width (); - int ih = internal.get_height (); - - hscroll.get_adjustment()->set_upper (inW); - vscroll.get_adjustment()->set_upper (inH); - hscroll.get_adjustment()->set_lower (0); - vscroll.get_adjustment()->set_lower (0); - hscroll.get_adjustment()->set_step_increment (!fd.empty() ? fd[0]->getEffectiveWidth() : 0); - vscroll.get_adjustment()->set_step_increment (!fd.empty() ? fd[0]->getEffectiveHeight() : 0); - hscroll.get_adjustment()->set_page_increment (iw); - vscroll.get_adjustment()->set_page_increment (ih); - hscroll.get_adjustment()->set_page_size (iw); - vscroll.get_adjustment()->set_page_size (ih); - - if(iw >= inW) { - hscroll.hide(); + int ih = internal.get_height(); + if (arrangement == TB_Horizontal) { + auto ha = hscroll.get_adjustment(); + int iw = internal.get_width(); + ha->set_upper(inW); + ha->set_lower(0); + ha->set_step_increment(!fd.empty() ? fd[0]->getEffectiveWidth() : 0); + ha->set_page_increment(iw); + ha->set_page_size(iw); + if (iw >= inW) { + hscroll.hide(); + } else { + hscroll.show(); + } } else { - hscroll.show(); + hscroll.hide(); } - if(ih >= inH) { + auto va = vscroll.get_adjustment(); + va->set_upper(inH); + va->set_lower(0); + const auto height = !fd.empty() ? fd[0]->getEffectiveHeight() : 0; + va->set_step_increment(height); + va->set_page_increment(height == 0 ? ih : (ih / height) * height); + va->set_page_size(ih); + + if (ih >= inH) { vscroll.hide(); } else { vscroll.show(); From 13207910528e2f553f3f875503b20f104941d958 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sat, 27 Jul 2019 11:40:01 +0200 Subject: [PATCH 4/4] Backwards thumbnail selection using Shift-key unexpectedly shifts starting point of selection, fixes #5389 --- rtgui/thumbbrowserbase.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index 8392e1b61..dba5390c1 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -178,15 +178,19 @@ void ThumbBrowserBase::selectRange (ThumbBrowserEntryBase* clicked, bool additio if (!additional || !lastClicked) { // Extend the current range w.r.t to first selected entry. ThumbIterator front = std::find(fd.begin(), fd.end(), selected.front()); + ThumbIterator back; ThumbIterator current = std::find(fd.begin(), fd.end(), clicked); if (front > current) { - std::swap(front, current); + front = current; + back = std::find(fd.begin(), fd.end(), selected.back()); + } else { + back = current; } clearSelection(selected); - for (; front <= current && front != fd.end(); ++front) { + for (; front <= back && front != fd.end(); ++front) { addToSelection(*front, selected); } } else {