diff options
author | Jonas Danielsson <jonas@threetimestwo.org> | 2014-04-11 13:15:45 +0200 |
---|---|---|
committer | Jiří Techet <techet@gmail.com> | 2014-04-12 12:29:35 +0200 |
commit | 1995f16ea28258b76c21eee88766102bb0d3f3f6 (patch) | |
tree | 3b9abff6e0965f2277d8cc02c2e4c4c6609aec73 | |
parent | 1224e9a016bd48b3013057a4e757b4950b91aaf2 (diff) | |
download | libchamplain-1995f16ea28258b76c21eee88766102bb0d3f3f6.tar.gz |
launcher-gtk: Add horizontal wrap toggle button
https://bugzilla.gnome.org/show_bug.cgi?id=577597
-rw-r--r-- | demos/launcher-gtk.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/demos/launcher-gtk.c b/demos/launcher-gtk.c index 80fbdcd..5d30f60 100644 --- a/demos/launcher-gtk.c +++ b/demos/launcher-gtk.c @@ -160,6 +160,17 @@ zoom_out (GtkWidget *widget, static void +toggle_wrap (GtkWidget *widget, + ChamplainView *view) +{ + gboolean wrap; + + wrap = champlain_view_get_horizontal_wrap (view); + champlain_view_set_horizontal_wrap (view, !wrap); +} + + +static void build_combo_box (GtkComboBox *box) { ChamplainMapSourceFactory *factory; @@ -356,6 +367,12 @@ main (int argc, g_signal_connect (button, "toggled", G_CALLBACK (toggle_layer), layer); gtk_container_add (GTK_CONTAINER (bbox), button); + button = gtk_toggle_button_new_with_label ("Toggle wrap"); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), + champlain_view_get_horizontal_wrap (view)); + g_signal_connect (button, "toggled", G_CALLBACK (toggle_wrap), view); + gtk_container_add (GTK_CONTAINER (bbox), button); + button = gtk_combo_box_new (); build_combo_box (GTK_COMBO_BOX (button)); gtk_combo_box_set_active (GTK_COMBO_BOX (button), 0); |