diff options
author | raveit65 <[email protected]> | 2015-07-22 14:42:44 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2015-07-22 14:42:44 +0200 |
commit | a012a1220be5092448b92ac611dd978afcb7efd1 (patch) | |
tree | 58e357b98bb461b41fd73d18d1a3540e9d9e3520 /src | |
parent | 5e70b95c8940e4bc1420984359243d407aeffaab (diff) | |
download | mate-notification-daemon-a012a1220be5092448b92ac611dd978afcb7efd1.tar.bz2 mate-notification-daemon-a012a1220be5092448b92ac611dd978afcb7efd1.tar.xz |
Gtk3: replace deprecated gtk_misc_set_alignment
Diffstat (limited to 'src')
-rw-r--r-- | src/themes/coco/coco-theme.c | 19 | ||||
-rw-r--r-- | src/themes/nodoka/nodoka-theme.c | 26 | ||||
-rw-r--r-- | src/themes/slider/theme.c | 19 | ||||
-rw-r--r-- | src/themes/standard/theme.c | 21 |
4 files changed, 83 insertions, 2 deletions
diff --git a/src/themes/coco/coco-theme.c b/src/themes/coco/coco-theme.c index 85ab042..f07479d 100644 --- a/src/themes/coco/coco-theme.c +++ b/src/themes/coco/coco-theme.c @@ -469,7 +469,12 @@ create_notification(UrlClickedCb url_clicked) windata->summary_label = gtk_label_new(NULL); gtk_widget_show(windata->summary_label); gtk_box_pack_start(GTK_BOX(vbox), windata->summary_label, FALSE, FALSE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (windata->summary_label), 0.0); + gtk_label_set_yalign (GTK_LABEL (windata->summary_label), 0.0); +#else gtk_misc_set_alignment(GTK_MISC(windata->summary_label), 0, 0); +#endif gtk_label_set_line_wrap(GTK_LABEL(windata->summary_label), TRUE); #if GTK_CHECK_VERSION (3, 0, 0) gtk_label_set_line_wrap_mode (GTK_LABEL (windata->summary_label), PANGO_WRAP_WORD_CHAR); @@ -480,7 +485,12 @@ create_notification(UrlClickedCb url_clicked) windata->body_label = gtk_label_new(NULL); gtk_box_pack_start(GTK_BOX(vbox), windata->body_label, FALSE, FALSE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (windata->body_label), 0.0); + gtk_label_set_yalign (GTK_LABEL (windata->body_label), 0.0); +#else gtk_misc_set_alignment(GTK_MISC(windata->body_label), 0, 0); +#endif gtk_label_set_line_wrap(GTK_LABEL(windata->body_label), TRUE); #if GTK_CHECK_VERSION (3, 0, 0) gtk_label_set_line_wrap_mode (GTK_LABEL (windata->body_label), PANGO_WRAP_WORD_CHAR); @@ -622,13 +632,22 @@ add_notification_action(GtkWindow *nw, const char *text, const char *key, GtkWidget *image = gtk_image_new_from_pixbuf(pixbuf); gtk_widget_show(image); gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_widget_set_halign (image, GTK_ALIGN_CENTER); + gtk_widget_set_valign (image, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5); +#endif } label = gtk_label_new(NULL); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (label), 0.0); +#else gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); +#endif buf = g_strdup_printf("<small>%s</small>", text); gtk_label_set_markup(GTK_LABEL(label), buf); g_free(buf); diff --git a/src/themes/nodoka/nodoka-theme.c b/src/themes/nodoka/nodoka-theme.c index 72fde60..5d43759 100644 --- a/src/themes/nodoka/nodoka-theme.c +++ b/src/themes/nodoka/nodoka-theme.c @@ -820,7 +820,12 @@ create_notification(UrlClickedCb url_clicked) windata->summary_label = gtk_label_new(NULL); gtk_widget_show(windata->summary_label); gtk_box_pack_start(GTK_BOX(hbox), windata->summary_label, TRUE, TRUE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (windata->summary_label), 0.0); + gtk_label_set_yalign (GTK_LABEL (windata->summary_label), 0.0); +#else gtk_misc_set_alignment(GTK_MISC(windata->summary_label), 0, 0); +#endif gtk_label_set_line_wrap(GTK_LABEL(windata->summary_label), TRUE); #if GTK_CHECK_VERSION (3, 0, 0) gtk_label_set_line_wrap_mode (GTK_LABEL (windata->summary_label), PANGO_WRAP_WORD_CHAR); @@ -861,7 +866,12 @@ create_notification(UrlClickedCb url_clicked) windata->icon = gtk_image_new(); gtk_box_pack_start(GTK_BOX(windata->iconbox), windata->icon, TRUE, TRUE, 0); - gtk_misc_set_alignment(GTK_MISC(windata->icon), 0.5, 0.0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_widget_set_halign (image, GTK_ALIGN_CENTER); + gtk_widget_set_valign (image, GTK_ALIGN_CENTER); +#else + gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5); +#endif vbox = gtk_vbox_new(FALSE, 6); gtk_widget_show(vbox); @@ -869,7 +879,12 @@ create_notification(UrlClickedCb url_clicked) windata->body_label = gtk_label_new(NULL); gtk_box_pack_start(GTK_BOX(vbox), windata->body_label, TRUE, TRUE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (windata->body_label), 0.0); + gtk_label_set_yalign (GTK_LABEL (windata->body_label), 0.0); +#else gtk_misc_set_alignment(GTK_MISC(windata->body_label), 0, 0); +#endif gtk_label_set_line_wrap(GTK_LABEL(windata->body_label), TRUE); #if GTK_CHECK_VERSION (3, 0, 0) gtk_label_set_line_wrap_mode (GTK_LABEL (windata->body_label), PANGO_WRAP_WORD_CHAR); @@ -1019,13 +1034,22 @@ add_notification_action(GtkWindow *nw, const char *text, const char *key, GtkWidget *image = gtk_image_new_from_pixbuf(pixbuf); gtk_widget_show(image); gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_widget_set_halign (image, GTK_ALIGN_CENTER); + gtk_widget_set_valign (image, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5); +#endif } label = gtk_label_new(NULL); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (label), 0.0); +#else gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); +#endif buf = g_strdup_printf("<small>%s</small>", text); gtk_label_set_markup(GTK_LABEL(label), buf); g_free(buf); diff --git a/src/themes/slider/theme.c b/src/themes/slider/theme.c index 1bb6ecf..dc369a7 100644 --- a/src/themes/slider/theme.c +++ b/src/themes/slider/theme.c @@ -669,7 +669,12 @@ GtkWindow* create_notification(UrlClickedCb url_clicked) #endif gtk_widget_show(windata->summary_label); gtk_box_pack_start(GTK_BOX(vbox), windata->summary_label, TRUE, TRUE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (windata->summary_label), 0.0); + gtk_label_set_yalign (GTK_LABEL (windata->summary_label), 0.0); +#else gtk_misc_set_alignment(GTK_MISC(windata->summary_label), 0, 0); +#endif gtk_label_set_line_wrap(GTK_LABEL(windata->summary_label), TRUE); #if GTK_CHECK_VERSION (3, 0, 0) gtk_label_set_line_wrap_mode (GTK_LABEL (windata->summary_label), PANGO_WRAP_WORD_CHAR); @@ -695,7 +700,12 @@ GtkWindow* create_notification(UrlClickedCb url_clicked) #endif gtk_widget_show(windata->body_label); gtk_box_pack_start(GTK_BOX(vbox), windata->body_label, TRUE, TRUE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (windata->body_label), 0.0); + gtk_label_set_yalign (GTK_LABEL (windata->body_label), 0.0); +#else gtk_misc_set_alignment(GTK_MISC(windata->body_label), 0, 0); +#endif gtk_label_set_line_wrap(GTK_LABEL(windata->body_label), TRUE); #if GTK_CHECK_VERSION (3, 0, 0) gtk_label_set_line_wrap_mode (GTK_LABEL (windata->body_label), PANGO_WRAP_WORD_CHAR); @@ -1041,7 +1051,12 @@ void add_notification_action(GtkWindow* nw, const char* text, const char* key, A #endif gtk_widget_show(image); gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_widget_set_halign (image, GTK_ALIGN_CENTER); + gtk_widget_set_valign (image, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5); +#endif } label = gtk_label_new(NULL); @@ -1052,7 +1067,11 @@ void add_notification_action(GtkWindow* nw, const char* text, const char* key, A #endif gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (label), 0.0); +#else gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); +#endif buf = g_strdup_printf("<small>%s</small>", text); gtk_label_set_markup(GTK_LABEL(label), buf); g_free(buf); diff --git a/src/themes/standard/theme.c b/src/themes/standard/theme.c index bf489f0..bdcfc2d 100644 --- a/src/themes/standard/theme.c +++ b/src/themes/standard/theme.c @@ -716,7 +716,12 @@ GtkWindow* create_notification(UrlClickedCb url_clicked) windata->summary_label = gtk_label_new(NULL); gtk_widget_show(windata->summary_label); gtk_box_pack_start(GTK_BOX(hbox), windata->summary_label, TRUE, TRUE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (windata->summary_label), 0.0); + gtk_label_set_yalign (GTK_LABEL (windata->summary_label), 0.0); +#else gtk_misc_set_alignment(GTK_MISC(windata->summary_label), 0, 0); +#endif gtk_label_set_line_wrap(GTK_LABEL(windata->summary_label), TRUE); #if GTK_CHECK_VERSION (3, 0, 0) gtk_label_set_line_wrap_mode (GTK_LABEL (windata->summary_label), PANGO_WRAP_WORD_CHAR); @@ -771,7 +776,12 @@ GtkWindow* create_notification(UrlClickedCb url_clicked) windata->body_label = gtk_label_new(NULL); gtk_box_pack_start(GTK_BOX(vbox), windata->body_label, TRUE, TRUE, 0); - gtk_misc_set_alignment(GTK_MISC(windata->body_label), 0, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (windata->summary_label), 0.0); + gtk_label_set_yalign (GTK_LABEL (windata->summary_label), 0.0); +#else + gtk_misc_set_alignment(GTK_MISC(windata->summary_label), 0, 0); +#endif gtk_label_set_line_wrap(GTK_LABEL(windata->body_label), TRUE); #if GTK_CHECK_VERSION (3, 0, 0) gtk_label_set_line_wrap_mode (GTK_LABEL (windata->body_label), PANGO_WRAP_WORD_CHAR); @@ -1030,13 +1040,22 @@ void add_notification_action(GtkWindow* nw, const char* text, const char* key, A GtkWidget* image = gtk_image_new_from_pixbuf(pixbuf); gtk_widget_show(image); gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_widget_set_halign (image, GTK_ALIGN_CENTER); + gtk_widget_set_valign (image, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5); +#endif } label = gtk_label_new(NULL); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +#if GTK_CHECK_VERSION (3, 15, 2) + gtk_label_set_xalign (GTK_LABEL (label), 0.0); +#else gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); +#endif buf = g_strdup_printf("<small>%s</small>", text); gtk_label_set_markup(GTK_LABEL(label), buf); g_free(buf); |