[gnome-commander] Add "view.maximize_pane" to user actions



commit e2ed4b6aec9766f3e7a90d6833137d73f4deb620
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Tue Dec 20 19:30:27 2011 +0100

    Add "view.maximize_pane" to user actions

 doc/C/gnome-commander.xml     |    5 +++++
 src/gnome-cmd-main-menu.cc    |    6 ++++++
 src/gnome-cmd-main-win.cc     |    9 +++++++++
 src/gnome-cmd-main-win.h      |    1 +
 src/gnome-cmd-user-actions.cc |    7 +++++++
 src/gnome-cmd-user-actions.h  |    1 +
 6 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/doc/C/gnome-commander.xml b/doc/C/gnome-commander.xml
index 46f77fe..1e5aa9d 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -6541,6 +6541,11 @@
                         <entry><para><keycombo><keycap>CTRL</keycap><keycap>SHIFT</keycap><keycap>=</keycap></keycombo></para></entry>
                     </row>
                     <row valign="top">
+                        <entry><para>view.maximize_pane</para></entry>
+                        <entry><para>Maximize panel size</para></entry>
+                        <entry><para></para></entry>
+                    </row>
+                    <row valign="top">
                         <entry><para>view.first</para></entry>
                         <entry><para>Go forward to the first visited directory</para></entry>
                         <entry><para></para></entry>
diff --git a/src/gnome-cmd-main-menu.cc b/src/gnome-cmd-main-menu.cc
index 9d8eb0a..cf7034f 100644
--- a/src/gnome-cmd-main-menu.cc
+++ b/src/gnome-cmd-main-menu.cc
@@ -678,6 +678,12 @@ static void init (GnomeCmdMainMenu *main_menu)
             GNOME_APP_PIXMAP_NONE, NULL,
             NULL
         },
+        {
+            MENU_TYPE_ITEM, _("Maximize Panel Size"), "", NULL,
+            (gpointer) view_maximize_pane, NULL,
+            GNOME_APP_PIXMAP_NONE, NULL,
+            NULL
+        },
         MENUTYPE_END
     };
 
diff --git a/src/gnome-cmd-main-win.cc b/src/gnome-cmd-main-win.cc
index d8f1c54..3ce438c 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -1326,6 +1326,15 @@ void GnomeCmdMainWin::set_equal_panes()
 }
 
 
+void GnomeCmdMainWin::maximize_pane()
+{
+    if (priv->current_fs==LEFT)
+        slide_set_100_0 (NULL, NULL);
+    else
+        slide_set_0_100 (NULL, NULL);
+}
+
+
 XML::xstream &operator << (XML::xstream &xml, GnomeCmdMainWin &mw)
 {
     xml << XML::tag("Layout");
diff --git a/src/gnome-cmd-main-win.h b/src/gnome-cmd-main-win.h
index 59fd5fa..ad057d1 100644
--- a/src/gnome-cmd-main-win.h
+++ b/src/gnome-cmd-main-win.h
@@ -79,6 +79,7 @@ struct GnomeCmdMainWin
     void set_fs_directory_to_opposite(FileSelectorID fsID);
 
     void set_equal_panes();
+    void maximize_pane();
     GnomeCmdState *get_state() const;
     void set_cap_state(gboolean state);
 
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index 28b32df..bf6e383 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -206,6 +206,7 @@ static UserActionData user_actions_data[] = {
                                              {view_directory, "view.directory", N_("Change directory")},
                                              {view_dir_history, "view.dir_history", N_("Show directory history")},
                                              {view_equal_panes, "view.equal_panes", N_("Equal panel size")},
+                                             {view_maximize_pane, "view.maximize_pane", N_("Maximize panel size")},
                                              {view_first, "view.first", N_("Back to the first directory")},
                                              {view_forward, "view.forward", N_("Forward one directory")},
                                              {view_home, "view.home", N_("Home directory")},
@@ -1589,6 +1590,12 @@ void view_equal_panes (GtkMenuItem *menuitem, gpointer not_used)
 }
 
 
+void view_maximize_pane (GtkMenuItem *menuitem, gpointer not_used)
+{
+    main_win->maximize_pane();
+}
+
+
 void view_in_left_pane (GtkMenuItem *menuitem, gpointer not_used)
 {
     main_win->set_fs_directory_to_opposite(LEFT);
diff --git a/src/gnome-cmd-user-actions.h b/src/gnome-cmd-user-actions.h
index 1be70cd..7fa662d 100644
--- a/src/gnome-cmd-user-actions.h
+++ b/src/gnome-cmd-user-actions.h
@@ -293,6 +293,7 @@ GNOME_CMD_USER_ACTION(view_forward);
 GNOME_CMD_USER_ACTION(view_last);
 GNOME_CMD_USER_ACTION(view_refresh);
 GNOME_CMD_USER_ACTION(view_equal_panes);
+GNOME_CMD_USER_ACTION(view_maximize_pane);
 GNOME_CMD_USER_ACTION(view_in_left_pane);
 GNOME_CMD_USER_ACTION(view_in_right_pane);
 GNOME_CMD_USER_ACTION(view_in_active_pane);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]