[gtksourceview] Do not set the widget inside a scrolled window by default
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Do not set the widget inside a scrolled window by default
- Date: Tue, 30 Dec 2014 16:59:46 +0000 (UTC)
commit 8baa8915da957f19668a3af5c07dcbe8e025e86b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue Dec 30 16:25:39 2014 +0100
Do not set the widget inside a scrolled window by default
gtksourceview/Makefile.am | 1 -
gtksourceview/gtksourcestyleschemechooserbutton.c | 23 ++++++++++------
gtksourceview/gtksourcestyleschemechooserwidget.c | 12 +++-----
gtksourceview/gtksourcestyleschemechooserwidget.ui | 28 --------------------
gtksourceview/gtksourceview.gresource.xml | 1 -
5 files changed, 19 insertions(+), 46 deletions(-)
---
diff --git a/gtksourceview/Makefile.am b/gtksourceview/Makefile.am
index d5bd555..2777504 100644
--- a/gtksourceview/Makefile.am
+++ b/gtksourceview/Makefile.am
@@ -229,7 +229,6 @@ stamp-gtksourceview-typebuiltins.h: Makefile.am $(libgtksourceview_headers)
EXTRA_DIST = \
GtkSource-3.0.metadata \
gtksourcecompletion.ui \
- gtksourcestyleschemechooserwidget.ui \
gtksourceview.gresource.xml
CLEANFILES = \
diff --git a/gtksourceview/gtksourcestyleschemechooserbutton.c
b/gtksourceview/gtksourcestyleschemechooserbutton.c
index 8b37745..6c98888 100644
--- a/gtksourceview/gtksourcestyleschemechooserbutton.c
+++ b/gtksourceview/gtksourcestyleschemechooserbutton.c
@@ -168,7 +168,7 @@ static void
ensure_dialog (GtkSourceStyleSchemeChooserButton *button)
{
GtkSourceStyleSchemeChooserButtonPrivate *priv = GET_PRIV (button);
- GtkWidget *parent, *dialog;
+ GtkWidget *parent, *dialog, *scrolled_window;
GtkWidget *content_area;
if (priv->dialog != NULL)
@@ -188,15 +188,20 @@ ensure_dialog (GtkSourceStyleSchemeChooserButton *button)
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
- priv->chooser = g_object_new (GTK_SOURCE_TYPE_STYLE_SCHEME_CHOOSER_WIDGET,
- "height-request", 325,
- "style-scheme", priv->scheme,
- "visible", TRUE,
- "width-request", 450,
- NULL);
-
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_set_size_request (scrolled_window, 325, 450);
+ gtk_widget_show (scrolled_window);
+ gtk_widget_set_hexpand (scrolled_window, TRUE);
+ gtk_widget_set_vexpand (scrolled_window, TRUE);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
- gtk_container_add (GTK_CONTAINER (content_area), GTK_WIDGET (priv->chooser));
+ gtk_container_add (GTK_CONTAINER (content_area), scrolled_window);
+
+ priv->chooser = GTK_SOURCE_STYLE_SCHEME_CHOOSER_WIDGET (gtk_source_style_scheme_chooser_widget_new
());
+ gtk_widget_show (GTK_WIDGET (priv->chooser));
+ gtk_source_style_scheme_chooser_set_style_scheme (GTK_SOURCE_STYLE_SCHEME_CHOOSER (priv->chooser),
+ priv->scheme);
+
+ gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (priv->chooser));
if (gtk_widget_is_toplevel (parent) && GTK_IS_WINDOW (parent))
{
diff --git a/gtksourceview/gtksourcestyleschemechooserwidget.c
b/gtksourceview/gtksourcestyleschemechooserwidget.c
index 4cfe2de..f0e8a6d 100644
--- a/gtksourceview/gtksourcestyleschemechooserwidget.c
+++ b/gtksourceview/gtksourcestyleschemechooserwidget.c
@@ -182,24 +182,22 @@ static void
gtk_source_style_scheme_chooser_widget_class_init (GtkSourceStyleSchemeChooserWidgetClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->get_property = gtk_source_style_scheme_chooser_widget_get_property;
object_class->set_property = gtk_source_style_scheme_chooser_widget_set_property;
object_class->constructed = gtk_source_style_scheme_chooser_widget_constructed;
g_object_class_override_property (object_class, PROP_STYLE_SCHEME, "style-scheme");
-
- /* Bind class to template */
- gtk_widget_class_set_template_from_resource (widget_class,
-
"/org/gnome/gtksourceview/ui/gtksourcestyleschemechooserwidget.ui");
- gtk_widget_class_bind_template_child_private (widget_class, GtkSourceStyleSchemeChooserWidget,
list_box);
}
static void
gtk_source_style_scheme_chooser_widget_init (GtkSourceStyleSchemeChooserWidget *widget)
{
- gtk_widget_init_template (GTK_WIDGET (widget));
+ GtkSourceStyleSchemeChooserWidgetPrivate *priv = GET_PRIV (widget);
+
+ priv->list_box = GTK_LIST_BOX (gtk_list_box_new ());
+ gtk_widget_show (GTK_WIDGET (priv->list_box));
+ gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (priv->list_box));
}
static GtkSourceStyleScheme *
diff --git a/gtksourceview/gtksourceview.gresource.xml b/gtksourceview/gtksourceview.gresource.xml
index 9321b92..8c8d5f0 100644
--- a/gtksourceview/gtksourceview.gresource.xml
+++ b/gtksourceview/gtksourceview.gresource.xml
@@ -2,6 +2,5 @@
<gresources>
<gresource prefix="/org/gnome/gtksourceview/ui">
<file preprocess="xml-stripblanks">gtksourcecompletion.ui</file>
- <file preprocess="xml-stripblanks">gtksourcestyleschemechooserwidget.ui</file>
</gresource>
</gresources>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]