[gnome-builder] GbSearchDisplay: resize search results container with child contents
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] GbSearchDisplay: resize search results container with child contents
- Date: Thu, 18 Dec 2014 01:13:05 +0000 (UTC)
commit bde3733ae4ae22035fe742a8fbc3549a6cda0ed6
Author: Christian Hergert <christian hergert me>
Date: Wed Dec 17 17:12:44 2014 -0800
GbSearchDisplay: resize search results container with child contents
src/resources/ui/gb-search-display.ui | 8 +++++---
src/search/gb-search-display.c | 15 ++++++++++-----
2 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/src/resources/ui/gb-search-display.ui b/src/resources/ui/gb-search-display.ui
index a109773..f9b38c1 100644
--- a/src/resources/ui/gb-search-display.ui
+++ b/src/resources/ui/gb-search-display.ui
@@ -3,11 +3,13 @@
<!-- interface-requires gtk+ 3.14 -->
<template class="GbSearchDisplay" parent="GtkBin">
<property name="border_width">10</property>
- <property name="width_request">800</property>
- <property name="height_request">600</property>
<child>
- <object class="GtkScrolledWindow" id="scroller">
+ <object class="GbScrolledWindow" id="scroller">
<property name="visible">true</property>
+ <property name="shadow_type">in</property>
+ <property name="min_content_width">800</property>
+ <property name="min_content_height">100</property>
+ <property name="max_content_height">600</property>
<child>
<object class="GtkListBox" id="list_box">
<property name="visible">true</property>
diff --git a/src/search/gb-search-display.c b/src/search/gb-search-display.c
index 12dde01..22fd04e 100644
--- a/src/search/gb-search-display.c
+++ b/src/search/gb-search-display.c
@@ -21,17 +21,20 @@
#include <glib/gi18n.h>
#include "gb-log.h"
+#include "gb-scrolled-window.h"
#include "gb-search-display.h"
#include "gb-search-provider.h"
#include "gb-search-result.h"
+#include "gb-widget.h"
struct _GbSearchDisplayPrivate
{
/* References owned by widget */
- GbSearchContext *context;
+ GbSearchContext *context;
/* References owned by Gtk template */
- GtkListBox *list_box;
+ GtkListBox *list_box;
+ GbScrolledWindow *scroller;
};
G_DEFINE_TYPE_WITH_PRIVATE (GbSearchDisplay, gb_search_display, GTK_TYPE_BIN)
@@ -369,9 +372,11 @@ gb_search_display_class_init (GbSearchDisplayClass *klass)
1,
GB_TYPE_SEARCH_RESULT);
- gtk_widget_class_set_template_from_resource (widget_class,
- "/org/gnome/builder/ui/gb-search-display.ui");
- gtk_widget_class_bind_template_child_private (widget_class, GbSearchDisplay, list_box);
+ GB_WIDGET_CLASS_TEMPLATE (widget_class, "gb-search-display.ui");
+ GB_WIDGET_CLASS_BIND (widget_class, GbSearchDisplay, list_box);
+ GB_WIDGET_CLASS_BIND (widget_class, GbSearchDisplay, scroller);
+
+ g_type_ensure (GB_TYPE_SCROLLED_WINDOW);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]