[Xfce4-commits] [apps/xfdashboard] 01/01: Ensure view is visible when allocation changes and scrollbar ranges might have changed.

noreply at xfce.org noreply at xfce.org
Mon Feb 15 11:42:19 CET 2016


This is an automated email from the git hooks/post-receive script.

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit 426b12118af0faedbcaf9e3f773ba9e23d14a684
Author: Stephan Haller <nomad at froevel.de>
Date:   Mon Feb 15 11:40:18 2016 +0100

    Ensure view is visible when allocation changes and scrollbar ranges might have changed.
    
    Scrollbar ranges might get smaller, e.g. in search view when view is greater than viewpad and a new search is started. Then only the scrollbar ranges are adjusted to new size but view's clipping is not. This commit should ensure that the clipping is adjusted to position of scrollbars.
    
    Hopefully fixes GH #112
---
 xfdashboard/search-view.c | 3 +++
 xfdashboard/viewpad.c     | 9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/xfdashboard/search-view.c b/xfdashboard/search-view.c
index fdc3de9..5732d90 100644
--- a/xfdashboard/search-view.c
+++ b/xfdashboard/search-view.c
@@ -1674,6 +1674,9 @@ void xfdashboard_search_view_reset_search(XfdashboardSearchView *self)
 	}
 	g_list_free_full(providers, (GDestroyNotify)_xfdashboard_search_view_provider_data_unref);
 
+	/* Ensure view is visible for next search by moving view to top-left position */
+	// TODO: xfdashboard_view_scroll_to(XFDASHBOARD_VIEW(self), 0.0f, 0.0f);
+
 	/* Reset last search terms used in this view */
 	if(priv->lastTerms)
 	{
diff --git a/xfdashboard/viewpad.c b/xfdashboard/viewpad.c
index 33a02c9..78f244a 100644
--- a/xfdashboard/viewpad.c
+++ b/xfdashboard/viewpad.c
@@ -206,7 +206,6 @@ static void _xfdashboard_viewpad_update_scrollbars(XfdashboardViewpad *self)
 	if(priv->activeView) clutter_actor_get_size(CLUTTER_ACTOR(priv->activeView), &w, &h);
 		else w=h=1.0f;
 
-	xfdashboard_scrollbar_set_range(XFDASHBOARD_SCROLLBAR(priv->hScrollbar), isnan(w)==0 ? w : 0.0f);
 	xfdashboard_scrollbar_set_range(XFDASHBOARD_SCROLLBAR(priv->vScrollbar), isnan(h)==0 ? h : 0.0f);
 
 	/* If any scroll bar policy is automatic then reallocate the
@@ -421,6 +420,14 @@ static gboolean _xfdashboard_viewpad_on_allocation_changed_repaint_callback(gpoi
 	/* Update scrollbars */
 	_xfdashboard_viewpad_update_scrollbars(self);
 
+	/* Ensure view is visible */
+	_xfdashboard_viewpad_on_scrollbar_value_changed(self,
+													xfdashboard_scrollbar_get_value(XFDASHBOARD_SCROLLBAR(priv->hScrollbar)),
+													priv->hScrollbar);
+	_xfdashboard_viewpad_on_scrollbar_value_changed(self,
+													xfdashboard_scrollbar_get_value(XFDASHBOARD_SCROLLBAR(priv->vScrollbar)),
+													priv->vScrollbar);
+
 	/* Do not call this callback again */
 	priv->scrollbarUpdateID=0;
 	return(G_SOURCE_REMOVE);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list