[gtk+] gtk-demo: Fix the overlay demo
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtk-demo: Fix the overlay demo
- Date: Sat, 7 Oct 2017 01:36:01 +0000 (UTC)
commit f352a0ec2bc639ac66878456af72c34f712802cc
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Oct 6 21:35:21 2017 -0400
gtk-demo: Fix the overlay demo
We must make the label and the entry separate overlays, or
the entry will also be clickthru.
demos/gtk-demo/overlay.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/demos/gtk-demo/overlay.c b/demos/gtk-demo/overlay.c
index 976c62e..3e8223f 100644
--- a/demos/gtk-demo/overlay.c
+++ b/demos/gtk-demo/overlay.c
@@ -64,11 +64,15 @@ do_overlay (GtkWidget *do_widget)
label = gtk_label_new ("<span foreground='blue' weight='ultrabold' font='40'>Numbers</span>");
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_widget_set_margin_top (label, 8);
- gtk_widget_set_margin_bottom (label, 8);
+ gtk_widget_set_margin_bottom (label, 50);
gtk_box_pack_start (GTK_BOX (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, 8);
+ gtk_widget_set_margin_top (entry, 50);
gtk_widget_set_margin_bottom (entry, 8);
gtk_box_pack_start (GTK_BOX (vbox), entry);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]