summaryrefslogtreecommitdiff
path: root/src/sysinfo.cpp
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-01-28 16:12:08 +0300
committermonsta <[email protected]>2016-02-08 16:13:14 +0300
commit7de773a2060f70968eddf1562e33ff3a2b4fd5f0 (patch)
tree475a8b0117fec71093367ba3845c2e3b524987ae /src/sysinfo.cpp
parent406e9c33b9434ce398177a1137567e8c7abb78c8 (diff)
downloadmate-system-monitor-7de773a2060f70968eddf1562e33ff3a2b4fd5f0.tar.bz2
mate-system-monitor-7de773a2060f70968eddf1562e33ff3a2b4fd5f0.tar.xz
use x/y align functions for GtkLabel with GTK+ >= 3.16
Conflicts: src/interface.cpp src/procdialogs.cpp src/sysinfo.cpp src/util.cpp
Diffstat (limited to 'src/sysinfo.cpp')
-rw-r--r--src/sysinfo.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/sysinfo.cpp b/src/sysinfo.cpp
index 6e8e122..e5e0546 100644
--- a/src/sysinfo.cpp
+++ b/src/sysinfo.cpp
@@ -708,14 +708,22 @@ add_row(GtkGrid * table, const char * label, const char * value, int row)
GtkWidget *header = gtk_label_new(NULL);
gtk_label_set_markup(GTK_LABEL(header), label);
gtk_label_set_selectable(GTK_LABEL(header), TRUE);
- gtk_widget_set_halign (header, GTK_ALIGN_START);
+#if GTK_CHECK_VERSION (3, 16, 0)
+ gtk_label_set_xalign (GTK_LABEL (header), 0.0);
+#else
+ gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5);
+#endif
gtk_grid_attach(
table, header,
0, row, 1, 1);
GtkWidget *label_widget = gtk_label_new(value);
gtk_label_set_selectable(GTK_LABEL(label_widget), TRUE);
- gtk_widget_set_halign (label_widget, GTK_ALIGN_START);
+#if GTK_CHECK_VERSION (3, 16, 0)
+ gtk_label_set_xalign (GTK_LABEL (label_widget), 0.0);
+#else
+ gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
+#endif
gtk_grid_attach(
table, label_widget,
1, row, 1, 1);
@@ -794,7 +802,11 @@ procman_create_sysinfo_view(void)
distro_release_label = gtk_label_new("???");
gtk_label_set_selectable(GTK_LABEL(distro_release_label), TRUE);
- gtk_widget_set_halign (distro_release_label, GTK_ALIGN_START);
+#if GTK_CHECK_VERSION (3, 16, 0)
+ gtk_label_set_xalign (GTK_LABEL (distro_release_label), 0.0);
+#else
+ gtk_misc_set_alignment (GTK_MISC (distro_release_label), 0.0, 0.5);
+#endif
gtk_grid_attach(
GTK_GRID(distro_table), distro_release_label,
0, table_count, 1, 1);
@@ -805,7 +817,11 @@ procman_create_sysinfo_view(void)
header = gtk_label_new(markup);
gtk_label_set_selectable(GTK_LABEL(header), TRUE);
g_free(markup);
- gtk_widget_set_halign (header, GTK_ALIGN_START);
+#if GTK_CHECK_VERSION (3, 16, 0)
+ gtk_label_set_xalign (GTK_LABEL (header), 0.0);
+#else
+ gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5);
+#endif
gtk_grid_attach(
GTK_GRID(distro_table), header,
0, table_count, 1, 1);
@@ -817,7 +833,11 @@ procman_create_sysinfo_view(void)
header = gtk_label_new(markup);
gtk_label_set_selectable(GTK_LABEL(header), TRUE);
g_free(markup);
- gtk_widget_set_halign (header, GTK_ALIGN_START);
+#if GTK_CHECK_VERSION (3, 16, 0)
+ gtk_label_set_xalign (GTK_LABEL (header), 0.0);
+#else
+ gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5);
+#endif
gtk_grid_attach(
GTK_GRID(distro_table), header,
0, table_count, 1, 1);