[gnome-builder/document-manager] GbDocumentMenuButton: select first row when search changes
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/document-manager] GbDocumentMenuButton: select first row when search changes
- Date: Mon, 8 Dec 2014 23:22:52 +0000 (UTC)
commit 453d48410f60610182c61f098660ae5a72c8995f
Author: Christian Hergert <christian hergert me>
Date: Mon Dec 8 15:22:46 2014 -0800
GbDocumentMenuButton: select first row when search changes
src/documents/gb-document-menu-button.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/documents/gb-document-menu-button.c b/src/documents/gb-document-menu-button.c
index 6a297ae..4f6336f 100644
--- a/src/documents/gb-document-menu-button.c
+++ b/src/documents/gb-document-menu-button.c
@@ -484,9 +484,21 @@ static void
gb_document_menu_button_search_changed (GbDocumentMenuButton *button,
GtkEditable *editable)
{
+ GtkListBoxRow *row;
+
g_return_if_fail (GB_IS_DOCUMENT_MENU_BUTTON (button));
gtk_list_box_invalidate_filter (button->priv->list_box);
+
+ /*
+ * WORKAROUND:
+ *
+ * Using a y of 1 since 0 returns NULL. This is a bug in GtkListBoxRow
+ * and has been filed upstream.
+ */
+ row = gtk_list_box_get_row_at_y (button->priv->list_box, 1);
+ if (row)
+ gtk_list_box_select_row (button->priv->list_box, row);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]