Changeset 68

Show
Ignore:
Timestamp:
04/15/06 10:59:57 (3 years ago)
Author:
jordi
Message:

Added the "Show toolbar", "Show statusbar" and "Show sidebar" options to the "View menu". Only implemented the "Show Sidebar".

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/data/epdfview-ui.xml

    r64 r68  
    88    </menu> 
    99    <menu action="ViewMenu"> 
     10      <menuitem name="ShowToolBar" action="ShowToolBar"/> 
     11      <menuitem name="ShowStatusBar" action="ShowStatusBar"/> 
     12      <menuitem name="ShowSideBar" action="ShowSideBar"/> 
     13      <separator/> 
    1014      <menuitem name="ZoomIn" action="ZoomIn"/> 
    1115      <menuitem name="ZoomOut" action="ZoomOut"/> 
  • trunk/src/gtk/MainView.cxx

    r67 r68  
    4646                                    GtkTreeViewColumn *, gpointer); 
    4747static void main_window_quit_cb (GtkWidget *, gpointer); 
     48static void main_window_show_sidebar_cb (GtkToggleAction *, gpointer); 
    4849static void main_window_zoom_fit_cb (GtkWidget *, gpointer); 
    4950static void main_window_zoom_in_cb (GtkWidget *, gpointer); 
     
    114115      N_("Display application's credits"),  
    115116      G_CALLBACK (main_window_about_box_cb) } 
     117}; 
     118 
     119static GtkToggleActionEntry g_ToggleEntries[] =  
     120{ 
     121    { "ShowToolBar", NULL, N_("Show _Toolbar"), NULL, 
     122      N_("Show or hidde the toolbar"), 
     123      NULL, TRUE }, 
     124    { "ShowStatusBar", NULL, N_("Show _Statusbar"), NULL, 
     125      N_("Show or hidde the statusbar"), 
     126      NULL, TRUE }, 
     127    { "ShowSideBar", NULL, N_("Show O_utline"), NULL, 
     128      N_("Show or hidde the document's outline"), 
     129      G_CALLBACK (main_window_show_sidebar_cb), FALSE } 
    116130}; 
    117131 
     
    382396        gtk_widget_hide (m_Sidebar); 
    383397    } 
     398    GtkAction *showSideBar =  
     399        gtk_ui_manager_get_action (m_UIManager,  
     400                                   "/MenuBar/ViewMenu/ShowSideBar"); 
     401    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (showSideBar), show); 
    384402} 
    385403 
     
    545563    gtk_action_group_add_actions (actionGroup, g_NormalEntries, 
    546564                                  G_N_ELEMENTS (g_NormalEntries), m_Pter); 
     565    gtk_action_group_add_toggle_actions (actionGroup, g_ToggleEntries, 
     566                                         G_N_ELEMENTS (g_ToggleEntries), 
     567                                         this); 
    547568    m_UIManager = gtk_ui_manager_new (); 
    548569    gtk_ui_manager_insert_action_group (m_UIManager, actionGroup, 0); 
     
    828849 
    829850/// 
     851/// @brief Called when the user clicks on the "Show Outline" action. 
     852/// 
     853void 
     854main_window_show_sidebar_cb (GtkToggleAction *action, gpointer data) 
     855{ 
     856    g_assert ( NULL != data && "The data parameter is NULL."); 
     857 
     858    MainView *view = (MainView *)data; 
     859    view->showSidebar (gtk_toggle_action_get_active (action)); 
     860} 
     861 
     862/// 
    830863/// @brief The user tries to fit the document into the window. 
    831864///