Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/resources/xviewer-app-menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<item>
<attribute name="label" translatable="yes">_View</attribute>
<link name="submenu">
<item>
<attribute name="action">app.menubar</attribute>
<attribute name="label" translatable="yes">_Menubar</attribute>
</item>
<item>
<attribute name="action">app.toolbar</attribute>
<attribute name="label" translatable="yes">_Toolbar</attribute>
Expand Down
1 change: 1 addition & 0 deletions src/resources/xviewer-ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<menuitem action="EditPreferences"/>
</menu>
<menu action="View">
<menuitem name="MenubarToggle" action="ViewMenubar"/>
<menuitem name="ToolbarToggle" action="ViewToolbar"/>
<menuitem name="StatusbarToggle" action="ViewStatusbar"/>
<menuitem name="ImageGalleryToggle" action="ViewImageGallery"/>
Expand Down
8 changes: 7 additions & 1 deletion src/xviewer-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -2731,7 +2731,10 @@ xviewer_window_cmd_show_hide_bar (GtkAction *action, gpointer user_data)

visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

if (g_ascii_strcasecmp (gtk_action_get_name (action), "ViewToolbar") == 0) {
if (g_ascii_strcasecmp (gtk_action_get_name (action), "ViewMenubar") == 0) {
GtkWidget* menubar = gtk_ui_manager_get_widget (priv->ui_mgr, "/MainMenu");
g_object_set (G_OBJECT (menubar), "visible", visible, NULL);
} else if (g_ascii_strcasecmp (gtk_action_get_name (action), "ViewToolbar") == 0) {
g_object_set (G_OBJECT (priv->toolbar_revealer), "reveal-child", visible, NULL);

if (priv->mode == XVIEWER_WINDOW_MODE_NORMAL)
Expand Down Expand Up @@ -4252,6 +4255,9 @@ static const GtkActionEntry action_entries_window[] = {
};

static const GtkToggleActionEntry toggle_entries_window[] = {
{ "ViewMenubar", NULL, N_("_Menubar"), "F8",
N_("Changes the visibility of the menubar in the current window"),
G_CALLBACK (xviewer_window_cmd_show_hide_bar), TRUE },
{ "ViewToolbar", NULL, N_("_Toolbar"), NULL,
N_("Changes the visibility of the toolbar in the current window"),
G_CALLBACK (xviewer_window_cmd_show_hide_bar), TRUE },
Expand Down