Show
Ignore:
Timestamp:
10/16/06 14:49:05 (2 years ago)
Author:
jordi
Message:

Applied Enrico Tröger's patch for full screen support. This closes ticket #33.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gtk/MainView.cxx

    r251 r253  
    5353                                            gpointer); 
    5454static void main_window_find_cb (GtkWidget *, gpointer); 
     55static void main_window_fullscreen_cb (GtkToggleAction *, gpointer); 
    5556static gboolean main_window_moved_or_resized_cb (GtkWidget *, 
    5657                                                 GdkEventConfigure *, gpointer); 
     
    8283 
    8384// The actions for menus and toolbars. 
    84 static const GtkActionEntry g_NormalEntries[] =  
     85static const GtkActionEntry g_NormalEntries[] = 
    8586{ 
    8687    { "FileMenu", NULL, N_("_File"), NULL, NULL, NULL }, 
     
    163164static GtkToggleActionEntry g_ToggleEntries[] = 
    164165{ 
     166    { "FullScreen", NULL, N_("F_ull screen"), NULL, 
     167      N_("Toggle full screen window"), 
     168      G_CALLBACK (main_window_fullscreen_cb), FALSE }, 
     169 
    165170    { "ShowToolBar", NULL, N_("Show _Toolbar"), NULL, 
    166171      N_("Show or hide the toolbar"), 
    167172      G_CALLBACK (main_window_show_toolbar_cb), TRUE }, 
     173 
    168174    { "ShowStatusBar", NULL, N_("Show _Statusbar"), NULL, 
    169175      N_("Show or hide the statusbar"), 
    170176      G_CALLBACK (main_window_show_statusbar_cb), TRUE }, 
     177 
    171178    { "ShowIndex", NULL, N_("Show I_ndex"), "F9", 
    172179      N_("Show or hide the document's outline"), 
     
    568575                                 config.getWindowHeight ()); 
    569576    gtk_widget_show (m_MainWindow); 
    570     gtk_window_move (GTK_WINDOW (m_MainWindow),  
     577    gtk_window_move (GTK_WINDOW (m_MainWindow), 
    571578                     config.getWindowX (), config.getWindowY ()); 
    572579} 
     
    598605        gtk_widget_hide (m_Sidebar); 
    599606    } 
    600     GtkAction *showIndex =  
    601         gtk_ui_manager_get_action (m_UIManager,  
     607    GtkAction *showIndex = 
     608        gtk_ui_manager_get_action (m_UIManager, 
    602609                                   "/MenuBar/ViewMenu/ShowIndex"); 
    603610    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (showIndex), show); 
     
    629636    } 
    630637    gdk_flush (); 
     638} 
     639 
     640void 
     641MainView::setFullScreen (gboolean fullScreen) 
     642{ 
     643    if ( fullScreen ) 
     644    { 
     645        gtk_window_fullscreen (GTK_WINDOW (m_MainWindow)); 
     646    } 
     647    else 
     648    { 
     649        gtk_window_unfullscreen (GTK_WINDOW (m_MainWindow)); 
     650    } 
    631651} 
    632652 
     
    10591079 
    10601080/// 
     1081/// @brief The user tried to switch to full screen. 
     1082/// 
     1083void 
     1084main_window_fullscreen_cb (GtkToggleAction *action, gpointer data) 
     1085{ 
     1086    g_assert ( NULL != data && "The data parameter is NULL."); 
     1087 
     1088    MainPter *pter = (MainPter *)data; 
     1089    pter->fullScreenActivated (gtk_toggle_action_get_active (action)); 
     1090} 
     1091 
     1092/// 
    10611093/// @brief Called when the window is moved or resized. 
    10621094///