summaryrefslogtreecommitdiff
path: root/src/interface.cpp
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2015-11-30 00:33:41 +0100
committerWolfgang Ulbrich <[email protected]>2015-12-01 21:50:40 +0100
commit346e96a1be7bc54d1bc63fa45ab81df19a02b687 (patch)
tree1cf8ef213b632b0fb7940a7586eeea5f51e312d4 /src/interface.cpp
parent4534e68bb0cb31734be338efa06cb6d3e00180f6 (diff)
downloadmate-system-monitor-346e96a1be7bc54d1bc63fa45ab81df19a02b687.tar.bz2
mate-system-monitor-346e96a1be7bc54d1bc63fa45ab81df19a02b687.tar.xz
GTK3: do not use deprecated GtkMisc
Diffstat (limited to 'src/interface.cpp')
-rw-r--r--src/interface.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/interface.cpp b/src/interface.cpp
index d981c9a..f4f5b81 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -256,7 +256,11 @@ make_title_label (const char *text)
label = gtk_label_new (full);
g_free (full);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.5f);
+#endif
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
return label;
@@ -351,7 +355,11 @@ create_sys_view (ProcData *procdata)
g_free (label_text);
cpu_label = gtk_label_new (NULL);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (cpu_label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (cpu_label), 0.0, 0.5);
+#endif
gtk_box_pack_start (GTK_BOX (temp_hbox), cpu_label, TRUE, TRUE, 0);
load_graph_get_labels(cpu_graph)->cpu[i] = cpu_label;
@@ -407,7 +415,11 @@ create_sys_view (ProcData *procdata)
label = gtk_label_new (label_text);
g_free(label_text);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+#endif
gtk_table_attach (GTK_TABLE (table), label, 1, 7, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
gtk_table_attach (GTK_TABLE (table),
@@ -438,7 +450,11 @@ create_sys_view (ProcData *procdata)
label = gtk_label_new (label_text);
g_free(label_text);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+#endif
gtk_table_attach (GTK_TABLE (table), label, 1, 7, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
gtk_table_attach (GTK_TABLE (table),
@@ -504,24 +520,42 @@ create_sys_view (ProcData *procdata)
label = gtk_label_new (label_text);
g_free(label_text);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+#endif
gtk_table_attach (GTK_TABLE (table), label, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (load_graph_get_labels(net_graph)->net_in, GTK_ALIGN_END);
+ gtk_widget_set_valign (load_graph_get_labels(net_graph)->net_in, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (load_graph_get_labels(net_graph)->net_in),
1.0,
0.5);
+#endif
gtk_widget_set_size_request(GTK_WIDGET(load_graph_get_labels(net_graph)->net_in), 100, -1);
gtk_table_attach (GTK_TABLE (table), load_graph_get_labels(net_graph)->net_in, 2, 3, 0, 1,
static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), GTK_FILL, 0, 0);
label = gtk_label_new (_("Total Received"));
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+#endif
gtk_table_attach (GTK_TABLE (table), label, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (load_graph_get_labels(net_graph)->net_in_total, GTK_ALIGN_END);
+ gtk_widget_set_valign (load_graph_get_labels(net_graph)->net_in_total, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (load_graph_get_labels(net_graph)->net_in_total),
1.0,
0.5);
+#endif
gtk_table_attach (GTK_TABLE (table),
load_graph_get_labels(net_graph)->net_in_total,
2,
@@ -556,24 +590,42 @@ create_sys_view (ProcData *procdata)
label = gtk_label_new (label_text);
g_free(label_text);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+#endif
gtk_table_attach (GTK_TABLE (table), label, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (load_graph_get_labels(net_graph)->net_out, GTK_ALIGN_END);
+ gtk_widget_set_valign (load_graph_get_labels(net_graph)->net_out, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (load_graph_get_labels(net_graph)->net_out),
1.0,
0.5);
+#endif
gtk_widget_set_size_request(GTK_WIDGET(load_graph_get_labels(net_graph)->net_out), 100, -1);
gtk_table_attach (GTK_TABLE (table), load_graph_get_labels(net_graph)->net_out, 2, 3, 0, 1,
static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), GTK_FILL, 0, 0);
label = gtk_label_new (_("Total Sent"));
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+#endif
gtk_table_attach (GTK_TABLE (table), label, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (load_graph_get_labels(net_graph)->net_out_total, GTK_ALIGN_END);
+ gtk_widget_set_valign (load_graph_get_labels(net_graph)->net_out_total, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (load_graph_get_labels(net_graph)->net_out_total),
1.0,
0.5);
+#endif
gtk_table_attach (GTK_TABLE (table),
load_graph_get_labels(net_graph)->net_out_total,
2,