summaryrefslogtreecommitdiff
path: root/font-viewer/font-view.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-01-14 17:16:29 +0300
committermonsta <[email protected]>2016-01-15 13:26:42 +0300
commita8899801fa1d25346f4d7da783be758763f760c8 (patch)
tree5b384acfeabc8e5d4893b667904f3480c1ad3474 /font-viewer/font-view.c
parent337b331a8f2d75b0ba91d4cf1bc2235a8e771df5 (diff)
downloadmate-control-center-a8899801fa1d25346f4d7da783be758763f760c8.tar.bz2
mate-control-center-a8899801fa1d25346f4d7da783be758763f760c8.tar.xz
[GTK+3] font-viewer: fix deprecated usage of GtkMisc and GdkColor
Diffstat (limited to 'font-viewer/font-view.c')
-rw-r--r--font-viewer/font-view.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/font-viewer/font-view.c b/font-viewer/font-view.c
index 15b1a524..359ffcb5 100644
--- a/font-viewer/font-view.c
+++ b/font-viewer/font-view.c
@@ -46,10 +46,15 @@ draw_string (cairo_t *cr,
const gchar *text,
gint *pos_y)
{
- GdkColor black = { 0, 0, 0, 0 };
cairo_text_extents_t extents;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 };
+ gdk_cairo_set_source_rgba (cr, &black);
+#else
+ GdkColor black = { 0, 0, 0, 0 };
gdk_cairo_set_source_color (cr, &black);
+#endif
cairo_text_extents (cr, text, &extents);
cairo_move_to (cr, 4, *pos_y);
@@ -250,7 +255,12 @@ add_row (GtkWidget *table,
bold_name = g_strconcat ("<b>", name, "</b>", NULL);
name_w = gtk_label_new (bold_name);
g_free (bold_name);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_set_halign (name_w, GTK_ALIGN_START);
+ gtk_widget_set_valign (name_w, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (name_w), 0.0, 0.0);
+#endif
gtk_label_set_use_markup (GTK_LABEL (name_w), TRUE);
#if GTK_CHECK_VERSION (3, 4, 0)
@@ -269,7 +279,12 @@ add_row (GtkWidget *table,
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
gtk_widget_set_size_request (label, 200, -1);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+ gtk_widget_set_valign (label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+#endif
swin = GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL));
gtk_scrolled_window_set_policy (swin,
@@ -305,7 +320,12 @@ add_row (GtkWidget *table,
gtk_container_add (GTK_CONTAINER (viewport), label);
} else {
GtkWidget *label = gtk_label_new (value);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+ gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+#endif
gtk_label_set_selectable (GTK_LABEL(label), TRUE);
#if GTK_CHECK_VERSION (3, 4, 0)
gtk_grid_attach_next_to (GTK_GRID (grid), label,