summaryrefslogtreecommitdiff
path: root/typing-break
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-07-14 15:39:08 +0200
committerraveit65 <[email protected]>2017-07-14 23:31:08 +0200
commit8c51b0139982af5831ab75313ef9d7f2341a5765 (patch)
tree304b016f8c57afd0befe3b2919a0a218c85df037 /typing-break
parent2beed0401df9f88847a0ef47d35a5bf25b1c2b73 (diff)
downloadmate-control-center-8c51b0139982af5831ab75313ef9d7f2341a5765.tar.bz2
mate-control-center-8c51b0139982af5831ab75313ef9d7f2341a5765.tar.xz
typing-break: avoid deprecated gtk_alignment_new ()
Diffstat (limited to 'typing-break')
-rw-r--r--typing-break/drw-break-window.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/typing-break/drw-break-window.c b/typing-break/drw-break-window.c
index 66db00f1..896d0860 100644
--- a/typing-break/drw-break-window.c
+++ b/typing-break/drw-break-window.c
@@ -119,8 +119,6 @@ drw_break_window_init (DrwBreakWindow *window)
DrwBreakWindowPrivate *priv;
GtkWidget *vbox;
GtkWidget *hbox;
- GtkWidget *align;
- GtkWidget *monitor_box;
gchar *str;
GtkWidget *outer_vbox;
GtkWidget *button_box;
@@ -159,27 +157,19 @@ drw_break_window_init (DrwBreakWindow *window)
gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
drw_setup_background (GTK_WIDGET (window));
- align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
- gtk_widget_show (align);
-
- outer_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_widget_show (outer_vbox);
-
right_padding = gdk_screen_get_width (screen) - monitor.width - monitor.x;
bottom_padding = gdk_screen_get_height (screen) - monitor.height - monitor.y;
- monitor_box = gtk_alignment_new (0.5, 0.5, 1, 1);
- gtk_alignment_set_padding (GTK_ALIGNMENT (monitor_box),
- monitor.y,
- bottom_padding,
- monitor.x,
- right_padding);
- gtk_widget_show (monitor_box);
-
- gtk_container_add (GTK_CONTAINER (window), monitor_box);
- gtk_container_add (GTK_CONTAINER (monitor_box), outer_vbox);
+ outer_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_widget_set_hexpand (outer_vbox, TRUE);
+ gtk_widget_set_vexpand (outer_vbox, TRUE);
+ gtk_widget_set_margin_top (outer_vbox, monitor.y);
+ gtk_widget_set_margin_bottom (outer_vbox, bottom_padding);
+ gtk_widget_set_margin_start (outer_vbox, monitor.x);
+ gtk_widget_set_margin_end (outer_vbox, right_padding);
+ gtk_widget_show (outer_vbox);
- gtk_box_pack_start (GTK_BOX (outer_vbox), align, TRUE, TRUE, 0);
+ gtk_container_add (GTK_CONTAINER (window), outer_vbox);
if (allow_postpone) {
button_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -216,9 +206,11 @@ drw_break_window_init (DrwBreakWindow *window)
}
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_widget_set_halign (vbox, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER);
gtk_widget_show (vbox);
- gtk_container_add (GTK_CONTAINER (align), vbox);
+ gtk_box_pack_start (GTK_BOX (outer_vbox), vbox, TRUE, TRUE, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (hbox);