diff --git a/demos/gtk-demo/infobar.c b/demos/gtk-demo/infobar.c index 3f66750025..2f2cecf63b 100644 --- a/demos/gtk-demo/infobar.c +++ b/demos/gtk-demo/infobar.c @@ -44,7 +44,6 @@ do_infobar (GtkWidget *do_widget) GtkWidget *frame; GtkWidget *bar; GtkWidget *vbox; - GtkWidget *vbox2; GtkWidget *label; GtkWidget *actions; GtkWidget *button; @@ -52,11 +51,13 @@ do_infobar (GtkWidget *do_widget) if (!window) { actions = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); + gtk_widget_add_css_class (actions, "linked"); window = gtk_window_new (); gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Info Bars"); + gtk_window_set_resizable (GTK_WINDOW (window), FALSE); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); @@ -131,23 +132,18 @@ do_infobar (GtkWidget *do_widget) g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); gtk_container_add (GTK_CONTAINER (actions), button); - frame = gtk_frame_new ("Info bars"); + frame = gtk_frame_new ("An example of different info bars"); gtk_widget_set_margin_top (frame, 8); gtk_widget_set_margin_bottom (frame, 8); gtk_container_add (GTK_CONTAINER (vbox), frame); - vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_widget_set_margin_start (vbox2, 8); - gtk_widget_set_margin_end (vbox2, 8); - gtk_widget_set_margin_top (vbox2, 8); - gtk_widget_set_margin_bottom (vbox2, 8); - gtk_container_add (GTK_CONTAINER (frame), vbox2); + gtk_widget_set_halign (actions, GTK_ALIGN_CENTER); - /* Standard message dialog */ - label = gtk_label_new ("An example of different info bars"); - gtk_container_add (GTK_CONTAINER (vbox2), label); - - gtk_container_add (GTK_CONTAINER (vbox2), actions); + gtk_widget_set_margin_start (actions, 8); + gtk_widget_set_margin_end (actions, 8); + gtk_widget_set_margin_top (actions, 8); + gtk_widget_set_margin_bottom (actions, 8); + gtk_container_add (GTK_CONTAINER (frame), actions); } if (!gtk_widget_get_visible (window)) diff --git a/demos/gtk-demo/links.c b/demos/gtk-demo/links.c index feb2aafeb6..4917176581 100644 --- a/demos/gtk-demo/links.c +++ b/demos/gtk-demo/links.c @@ -1,7 +1,7 @@ /* Links * * GtkLabel can show hyperlinks. The default action is to call - * gtk_show_uri_on_window() on their URI, but it is possible to override + * gtk_show_uri() on their URI, but it is possible to override * this with a custom handler. */ @@ -30,6 +30,8 @@ activate_link (GtkWidget *label, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, + "Keyboard navigation"); + gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog), "The term keynav is a shorthand for " "keyboard navigation and refers to the process of using " "a program (exclusively) via keyboard input."); @@ -56,21 +58,29 @@ do_links (GtkWidget *do_widget) gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Links"); + gtk_window_set_resizable (GTK_WINDOW (window), FALSE); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); label = gtk_label_new ("Some text may be marked up\n" - "as hyperlinks, which can be clicked\n" - "or activated via keynav\n" - "and they work fine with other markup, like when\n" + "title=\"plain text\">text may be marked up " + "as hyperlinks, which can be clicked " + "or activated via keynav " + "and they work fine with other markup, like when " "searching on " "Go" "og" "le" "."); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_label_set_max_width_chars (GTK_LABEL (label), 40); + gtk_label_set_wrap (GTK_LABEL (label), TRUE); + gtk_label_set_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD); g_signal_connect (label, "activate-link", G_CALLBACK (activate_link), NULL); + gtk_widget_set_margin_start (label, 20); + gtk_widget_set_margin_end (label, 20); + gtk_widget_set_margin_top (label, 20); + gtk_widget_set_margin_bottom (label, 20); gtk_container_add (GTK_CONTAINER (window), label); gtk_widget_show (label); } diff --git a/demos/gtk-demo/scale.c b/demos/gtk-demo/scale.c index 9e274265d8..55304e890e 100644 --- a/demos/gtk-demo/scale.c +++ b/demos/gtk-demo/scale.c @@ -1,4 +1,4 @@ -/* Scale +/* Scales * * GtkScale is a way to select a value from a range. * Scales can have marks to help pick special values, diff --git a/demos/gtk-demo/scale.ui b/demos/gtk-demo/scale.ui index 066a7e42f8..9859d17408 100644 --- a/demos/gtk-demo/scale.ui +++ b/demos/gtk-demo/scale.ui @@ -20,6 +20,7 @@ Scales + 0 10 diff --git a/demos/gtk-demo/spinbutton.c b/demos/gtk-demo/spinbutton.c index 3f4a0c91c8..e50379a8db 100644 --- a/demos/gtk-demo/spinbutton.c +++ b/demos/gtk-demo/spinbutton.c @@ -1,4 +1,4 @@ -/* Spin Button +/* Spin Buttons * * GtkSpinButton provides convenient ways to input data * that can be seen as a value in a range. The examples diff --git a/demos/gtk-demo/stack.ui b/demos/gtk-demo/stack.ui index fc3615a5f0..d1f7c7a91c 100644 --- a/demos/gtk-demo/stack.ui +++ b/demos/gtk-demo/stack.ui @@ -2,6 +2,7 @@ Stack + 0 @@ -25,6 +26,7 @@ 20 20 + 100 org.gtk.Demo4