[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 09/10: Fix recent icon view not scrolling to top.
noreply at xfce.org
noreply at xfce.org
Tue Dec 31 11:39:58 CET 2019
This is an automated email from the git hooks/post-receive script.
g o t t c o d e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-whiskermenu-plugin.
commit 3514547a79bffdf663308182836f5537bfa402ac
Author: Graeme Gott <graeme at gottcode.org>
Date: Wed Dec 25 11:59:36 2019 -0500
Fix recent icon view not scrolling to top.
---
panel-plugin/page.cpp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/panel-plugin/page.cpp b/panel-plugin/page.cpp
index ef59fca..c631df1 100644
--- a/panel-plugin/page.cpp
+++ b/panel-plugin/page.cpp
@@ -67,16 +67,22 @@ void Page::reset_selection()
{
m_view->collapse_all();
- // Clear selection and scroll to top
+ // Set keyboard focus on first item
GtkTreeModel* model = m_view->get_model();
GtkTreeIter iter;
if (model && gtk_tree_model_get_iter_first(model, &iter))
{
GtkTreePath* path = gtk_tree_model_get_path(model, &iter);
- get_view()->scroll_to_path(path);
- get_view()->set_cursor(path);
+ m_view->set_cursor(path);
gtk_tree_path_free(path);
}
+
+ // Scroll to top
+ GtkAdjustment* adjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(m_view->get_widget()));
+ gtk_adjustment_set_value(adjustment, gtk_adjustment_get_lower(adjustment));
+
+ // Clear selection
+ m_view->clear_selection();
}
//-----------------------------------------------------------------------------
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list