[gtksourceview/wip/chergert/gsv-gtk4: 103/117] view: use new gutter creation widgets
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/gsv-gtk4: 103/117] view: use new gutter creation widgets
- Date: Wed, 29 Jan 2020 17:36:03 +0000 (UTC)
commit 99c96db799a0449f3f390c2b9e784a448459ae94
Author: Christian Hergert <chergert redhat com>
Date: Wed Jan 15 15:40:43 2020 -0800
view: use new gutter creation widgets
And warn if we get something we don't support.
gtksourceview/gtksourceview.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 3b4895bd..b4ef6a7d 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -4807,20 +4807,28 @@ gtk_source_view_get_gutter (GtkSourceView *view,
{
if (priv->left_gutter == NULL)
{
- priv->left_gutter = _gtk_source_gutter_new (view, window_type);
+ priv->left_gutter = _gtk_source_gutter_new (window_type);
+ gtk_text_view_set_gutter (GTK_TEXT_VIEW (view),
+ GTK_TEXT_WINDOW_LEFT,
+ GTK_WIDGET (priv->left_gutter));
}
return priv->left_gutter;
}
- else
+ else if (window_type == GTK_TEXT_WINDOW_RIGHT)
{
if (priv->right_gutter == NULL)
{
- priv->right_gutter = _gtk_source_gutter_new (view, window_type);
+ priv->right_gutter = _gtk_source_gutter_new (window_type);
+ gtk_text_view_set_gutter (GTK_TEXT_VIEW (view),
+ GTK_TEXT_WINDOW_RIGHT,
+ GTK_WIDGET (priv->right_gutter));
}
return priv->right_gutter;
}
+
+ g_return_val_if_reached (NULL);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]