tazweb rev 22

Add FULLSCREEN and UNFULLSCREEN mode with a nice button :-)
author Christophe Lincoln <pankso@slitaz.org>
date Mon Apr 04 22:54:32 2011 +0200 (2011-04-04)
parents bbb8e2f36488
children 45fe7984b87e
files src/main.c
line diff
     1.1 --- a/src/main.c	Mon Apr 04 21:19:12 2011 +0200
     1.2 +++ b/src/main.c	Mon Apr 04 22:54:32 2011 +0200
     1.3 @@ -74,6 +74,19 @@
     1.4      webkit_web_view_go_forward (web_view);
     1.5  }
     1.6  
     1.7 +/* Fullscreen and unfullscreen action */
     1.8 +static void 
     1.9 +fullscreen_cb (GtkWindow* window, gpointer data)
    1.10 +{
    1.11 +    GdkWindowState state;
    1.12 +    state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (main_window)));
    1.13 +
    1.14 +    if (state & GDK_WINDOW_STATE_FULLSCREEN)
    1.15 +        gtk_window_unfullscreen (GTK_WINDOW (main_window));
    1.16 +    else
    1.17 +        gtk_window_fullscreen (GTK_WINDOW (main_window));
    1.18 +}
    1.19 +
    1.20  /* TazWeb doc function */
    1.21  static void
    1.22  tazweb_doc_cb (GtkWidget* widget, gpointer data)
    1.23 @@ -133,6 +146,11 @@
    1.24      g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (tazweb_doc_cb), NULL);
    1.25      gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
    1.26  
    1.27 +    /* The Fullscreen button */
    1.28 +    item = gtk_tool_button_new_from_stock (GTK_STOCK_FULLSCREEN);
    1.29 +    g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (fullscreen_cb), NULL);
    1.30 +    gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
    1.31 +
    1.32      return toolbar;
    1.33  }
    1.34