2
#include <libgd/gd-header-bar.h>
5
on_switch_clicked (GtkWidget *button,
8
GtkWidget *image = NULL;
9
static gboolean use_custom = TRUE;
13
image = gtk_image_new_from_icon_name ("face-wink-symbolic", GTK_ICON_SIZE_MENU);
21
gd_header_bar_set_custom_title (bar, image);
28
GtkWidget *window, *bar, *box, *button;
30
gtk_init (&argc, &argv);
33
gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
35
gtk_widget_set_default_direction (GTK_TEXT_DIR_LTR);
37
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
38
gtk_widget_set_size_request (window, 300, 300);
40
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
41
gtk_container_add (GTK_CONTAINER (window), box);
43
bar = gd_header_bar_new ();
44
gtk_box_pack_start (GTK_BOX (box), bar, FALSE, TRUE, 0);
46
gd_header_bar_set_title (GD_HEADER_BAR (bar), "Title Title Title Title Title Title");
47
gd_header_bar_set_subtitle (GD_HEADER_BAR (bar), "Subtitle Subtitle Subtitle Subtitle Subtitle Subtitle");
48
button = gtk_button_new_with_label ("Switch");
49
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
50
gtk_style_context_add_class (gtk_widget_get_style_context (button), GTK_STYLE_CLASS_RAISED);
51
gd_header_bar_pack_start (GD_HEADER_BAR (bar), button);
52
g_signal_connect (button, "clicked", G_CALLBACK (on_switch_clicked), bar);
54
button = gtk_button_new_with_label ("Done");
55
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
56
gtk_style_context_add_class (gtk_widget_get_style_context (button), "suggested-action");
58
gd_header_bar_pack_end (GD_HEADER_BAR (bar), button);
60
button = gtk_button_new_with_label ("Almost");
61
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
62
gtk_style_context_add_class (gtk_widget_get_style_context (button), GTK_STYLE_CLASS_RAISED);
63
gd_header_bar_pack_end (GD_HEADER_BAR (bar), button);
65
gtk_widget_show_all (window);
68
gtk_widget_destroy (window);