[gtksourceview/wip/chergert/gsv-gtk4: 120/125] 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: 120/125] view: use new gutter creation widgets
- Date: Wed, 15 Jan 2020 23:56:27 +0000 (UTC)
commit 39463008852bb9b474de7e7bd36f2ae28c3faf07
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 15009040..2d6c71a8 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -4804,20 +4804,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]