From 059917b83cb38b7ef552026e66aebcc29ac5e12e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 27 Mar 2020 22:57:10 -0400 Subject: [PATCH] gtk-demo: Fix the overlay demo We must use two separate boxes for the label and the entry, otherwise we can't keep their can-target properties apart. --- demos/gtk-demo/overlay.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/demos/gtk-demo/overlay.c b/demos/gtk-demo/overlay.c index a663580b3b..afc7c534df 100644 --- a/demos/gtk-demo/overlay.c +++ b/demos/gtk-demo/overlay.c @@ -56,23 +56,25 @@ do_overlay (GtkWidget *do_widget) } vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_overlay_add_overlay (GTK_OVERLAY (overlay), vbox); gtk_widget_set_can_target (vbox, FALSE); + gtk_overlay_add_overlay (GTK_OVERLAY (overlay), vbox); gtk_widget_set_halign (vbox, GTK_ALIGN_CENTER); - gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER); + gtk_widget_set_valign (vbox, GTK_ALIGN_START); label = gtk_label_new ("Numbers"); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_widget_set_can_target (label, FALSE); gtk_widget_set_margin_top (label, 8); - gtk_widget_set_margin_bottom (label, 50); + gtk_widget_set_margin_bottom (label, 8); gtk_container_add (GTK_CONTAINER (vbox), label); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), vbox); gtk_widget_set_halign (vbox, GTK_ALIGN_CENTER); gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER); + gtk_entry_set_placeholder_text (GTK_ENTRY (entry), "Your Lucky Number"); - gtk_widget_set_margin_top (entry, 50); + gtk_widget_set_margin_top (entry, 8); gtk_widget_set_margin_bottom (entry, 8); gtk_container_add (GTK_CONTAINER (vbox), entry);