summaryrefslogtreecommitdiff
path: root/typing-break
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-07-14 18:41:42 +0200
committerraveit65 <[email protected]>2017-07-14 23:31:08 +0200
commitcbab3221add93b6fc5058cb81222dbb5c4ecf284 (patch)
tree5a46b40d0de6e619474974aecfef288be0b796e7 /typing-break
parent8c51b0139982af5831ab75313ef9d7f2341a5765 (diff)
downloadmate-control-center-cbab3221add93b6fc5058cb81222dbb5c4ecf284.tar.bz2
mate-control-center-cbab3221add93b6fc5058cb81222dbb5c4ecf284.tar.xz
typing-break: avoid deprecated GtkMisc
- replace gtk_misc_get_alignment () - replace gtk_misc_get_padding ()
Diffstat (limited to 'typing-break')
-rw-r--r--typing-break/drw-break-window.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/typing-break/drw-break-window.c b/typing-break/drw-break-window.c
index 896d0860..c4132db8 100644
--- a/typing-break/drw-break-window.c
+++ b/typing-break/drw-break-window.c
@@ -531,19 +531,36 @@ get_layout_location (GtkLabel *label,
gint *xp,
gint *yp)
{
+#if !GTK_CHECK_VERSION (3, 16, 0)
GtkMisc *misc;
+#endif
GtkWidget *widget;
GtkAllocation widget_allocation;
GtkRequisition widget_requisition;
gfloat xalign, yalign;
gint x, y;
gint xpad, ypad;
+#if GTK_CHECK_VERSION (3, 16, 0)
+ gint margin_start, margin_end, margin_top, margin_bottom;
+
+ widget = GTK_WIDGET (label);
+ xalign = gtk_label_get_xalign (GTK_LABEL (label));
+ yalign = gtk_label_get_yalign (GTK_LABEL (label));
+ margin_start = gtk_widget_get_margin_start (widget);
+ margin_end = gtk_widget_get_margin_end (widget);
+ margin_top = gtk_widget_get_margin_top (widget);
+ margin_bottom = gtk_widget_get_margin_bottom (widget);
+
+ xpad = margin_start + margin_end;
+ ypad = margin_top + margin_bottom;
+#else
misc = GTK_MISC (label);
widget = GTK_WIDGET (label);
gtk_misc_get_alignment (misc, &xalign, &yalign);
gtk_misc_get_padding (misc, &xpad, &ypad);
+#endif
gtk_widget_get_allocation (widget, &widget_allocation);
gtk_widget_get_requisition (widget, &widget_requisition);