[anjuta] sourceview: fix compile warnings
- From: Carl-Anton Ingmarsson <carlantoni src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] sourceview: fix compile warnings
- Date: Mon, 10 Jun 2013 20:43:19 +0000 (UTC)
commit 625a386773744e2cc9c074609beaabab1fcb0a60
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date: Mon Jun 10 09:58:00 2013 +0200
sourceview: fix compile warnings
plugins/sourceview/anjuta-view.c | 18 +++++-------------
plugins/sourceview/anjuta-view.h | 1 +
plugins/sourceview/assist-tip.c | 14 ++++++++------
plugins/sourceview/sourceview.c | 8 ++++++--
4 files changed, 20 insertions(+), 21 deletions(-)
---
diff --git a/plugins/sourceview/anjuta-view.c b/plugins/sourceview/anjuta-view.c
index cdc14c1..9aa89dc 100644
--- a/plugins/sourceview/anjuta-view.c
+++ b/plugins/sourceview/anjuta-view.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* anjuta-view.c
*
@@ -556,22 +557,13 @@ anjuta_view_set_font (AnjutaView *view,
font_desc = pango_font_description_from_string (font_name);
g_return_if_fail (font_desc != NULL);
- gtk_widget_modify_font (GTK_WIDGET (view), font_desc);
-
- pango_font_description_free (font_desc);
+ gtk_widget_override_font (GTK_WIDGET (view), font_desc);
+
+ pango_font_description_free (font_desc);
}
else
{
- GtkRcStyle *rc_style;
-
- rc_style = gtk_widget_get_modifier_style (GTK_WIDGET (view));
-
- if (rc_style->font_desc)
- pango_font_description_free (rc_style->font_desc);
-
- rc_style->font_desc = NULL;
-
- gtk_widget_modify_style (GTK_WIDGET (view), rc_style);
+ gtk_widget_override_font (GTK_WIDGET (view), NULL);
}
}
diff --git a/plugins/sourceview/anjuta-view.h b/plugins/sourceview/anjuta-view.h
index 6792f57..fc0fb8a 100644
--- a/plugins/sourceview/anjuta-view.h
+++ b/plugins/sourceview/anjuta-view.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* anjuta-view.h
*
diff --git a/plugins/sourceview/assist-tip.c b/plugins/sourceview/assist-tip.c
index 1dd804a..ee0f90c 100644
--- a/plugins/sourceview/assist-tip.c
+++ b/plugins/sourceview/assist-tip.c
@@ -42,17 +42,19 @@ assist_tip_init (AssistTip *object)
{
GtkWidget* alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
GtkWidget* window = GTK_WIDGET(object);
- GtkStyle* style;
+ GtkStyleContext* context;
+ GtkBorder padding;
gtk_widget_set_name (GTK_WIDGET(object), "gtk-tooltip");
gtk_widget_set_app_paintable (GTK_WIDGET(object), TRUE);
- style = gtk_widget_get_style (window);
+ context = gtk_widget_get_style_context (window);
+ gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL, &padding);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment),
- style->ythickness,
- style->ythickness,
- style->xthickness,
- style->xthickness);
+ padding.top,
+ padding.bottom,
+ padding.left,
+ padding.right);
object->label = gtk_label_new ("");
gtk_widget_show (object->label);
diff --git a/plugins/sourceview/sourceview.c b/plugins/sourceview/sourceview.c
index 092d1eb..be2cf58 100644
--- a/plugins/sourceview/sourceview.c
+++ b/plugins/sourceview/sourceview.c
@@ -957,6 +957,10 @@ sourceview_instance_init(Sourceview* sv)
sv->priv = G_TYPE_INSTANCE_GET_PRIVATE (sv,
ANJUTA_TYPE_SOURCEVIEW,
SourceviewPrivate);
+
+ /* set properties */
+ g_object_set (G_OBJECT (sv), "orientation", GTK_ORIENTATION_VERTICAL,
+ NULL);
}
static void
@@ -1209,7 +1213,7 @@ static void ieditor_goto_position(IAnjutaEditor *editor, IAnjutaIterable* icell,
sourceview_cell_get_iter (cell, &iter);
gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (sv->priv->document), &iter);
gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (sv->priv->view),
- gtk_text_buffer_get_insert (sv->priv->document));
+ gtk_text_buffer_get_insert (GTK_TEXT_BUFFER
(sv->priv->document)));
}
/* Return a newly allocated pointer containing the whole text */
@@ -2639,7 +2643,7 @@ iglade_iface_init(IAnjutaEditorGladeSignalIface* iface)
/* only signals */
}
-ANJUTA_TYPE_BEGIN(Sourceview, sourceview, GTK_TYPE_VBOX);
+ANJUTA_TYPE_BEGIN(Sourceview, sourceview, GTK_TYPE_BOX);
ANJUTA_TYPE_ADD_INTERFACE(idocument, IANJUTA_TYPE_DOCUMENT);
ANJUTA_TYPE_ADD_INTERFACE(ifile, IANJUTA_TYPE_FILE);
ANJUTA_TYPE_ADD_INTERFACE(isavable, IANJUTA_TYPE_FILE_SAVABLE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]