Merge branch '1991_toggle_panels_view'

* 1991_toggle_panels_view:
  Ticket #1991: toggle panels view
This commit is contained in:
Slava Zanko 2010-02-04 11:30:00 +02:00
commit 40164d039e
7 changed files with 18 additions and 1 deletions

View File

@ -229,6 +229,7 @@ CmdSwapPanel = ctrl-u
CmdHistory = alt-h CmdHistory = alt-h
CmdToggleListing = alt-t CmdToggleListing = alt-t
CmdToggleShowHidden = alt-dot CmdToggleShowHidden = alt-dot
CmdTogglePanelsSplit = alt-comma
ShowCommandLine = ctrl-o ShowCommandLine = ctrl-o
CmdCopyCurrentPathname = alt-a CmdCopyCurrentPathname = alt-a
CmdCopyOtherPathname = alt-shift-a CmdCopyOtherPathname = alt-shift-a

View File

@ -233,6 +233,7 @@ CmdSwapPanel = ctrl-u
CmdHistory = alt-h CmdHistory = alt-h
CmdToggleListing = alt-t CmdToggleListing = alt-t
CmdToggleShowHidden = alt-dot CmdToggleShowHidden = alt-dot
CmdTogglePanelsSplit = alt-comma
ShowCommandLine = ctrl-o ShowCommandLine = ctrl-o
CmdCopyCurrentPathname = alt-a CmdCopyCurrentPathname = alt-a
CmdCopyOtherPathname = alt-shift-a CmdCopyOtherPathname = alt-shift-a

View File

@ -366,6 +366,7 @@
#define CK_ViewFileCmd 7071 #define CK_ViewFileCmd 7071
#define CK_HelpCmd 7072 #define CK_HelpCmd 7072
#define CK_MenuCmd 7073 #define CK_MenuCmd 7073
#define CK_TogglePanelsSplit 7074
/* panels */ /* panels */
#define CK_PanelChdirOtherPanel 8001 #define CK_PanelChdirOtherPanel 8001

View File

@ -366,6 +366,7 @@ static name_keymap_t command_names[] = {
{ "CmdCopyCurrentTagged", CK_CopyCurrentTagged }, { "CmdCopyCurrentTagged", CK_CopyCurrentTagged },
{ "CmdCopyOtherTagged", CK_CopyOtherTagged }, { "CmdCopyOtherTagged", CK_CopyOtherTagged },
{ "CmdToggleShowHidden", CK_ToggleShowHidden }, { "CmdToggleShowHidden", CK_ToggleShowHidden },
{ "CmdTogglePanelsSplit", CK_TogglePanelsSplit },
/* panel */ /* panel */
{ "PanelChdirOtherPanel", CK_PanelChdirOtherPanel }, { "PanelChdirOtherPanel", CK_PanelChdirOtherPanel },
@ -830,6 +831,7 @@ const global_keymap_t default_main_map[] = {
/* View output */ /* View output */
{ XCTRL ('o'), CK_ShowCommandLine, "C-o" }, { XCTRL ('o'), CK_ShowCommandLine, "C-o" },
{ ALT ('.'), CK_ToggleShowHidden, "M-." }, { ALT ('.'), CK_ToggleShowHidden, "M-." },
{ ALT (','), CK_TogglePanelsSplit, "M-," },
{ XCTRL ('x'), CK_StartExtMap1, "C-x" }, { XCTRL ('x'), CK_StartExtMap1, "C-x" },
/* Select/unselect group */ /* Select/unselect group */
{ KEY_KP_ADD, CK_SelectCmd, "+" }, { KEY_KP_ADD, CK_SelectCmd, "+" },

View File

@ -509,7 +509,7 @@ init_layout (void)
radio_widget->sel = horizontal_split; radio_widget->sel = horizontal_split;
} }
static void void
layout_change (void) layout_change (void)
{ {
setup_panels (); setup_panels ();

View File

@ -9,6 +9,7 @@
#include "panel.h" #include "panel.h"
#include "widget.h" #include "widget.h"
void layout_change (void);
void layout_cmd (void); void layout_cmd (void);
void setup_panels (void); void setup_panels (void);
void destroy_panels (void); void destroy_panels (void);

View File

@ -903,6 +903,14 @@ toggle_show_hidden (void)
update_panels (UP_RELOAD, UP_KEEPSEL); update_panels (UP_RELOAD, UP_KEEPSEL);
} }
static void
toggle_panels_split (void)
{
horizontal_split = !horizontal_split;
layout_change ();
do_refresh();
}
void void
toggle_kilobyte_si (void) toggle_kilobyte_si (void)
{ {
@ -1348,6 +1356,9 @@ midnight_execute_cmd (Widget *sender, unsigned long command)
case CK_ToggleShowHidden: case CK_ToggleShowHidden:
toggle_show_hidden (); toggle_show_hidden ();
break; break;
case CK_TogglePanelsSplit:
toggle_panels_split ();
break;
case CK_TreeCmd: case CK_TreeCmd:
tree_cmd (); tree_cmd ();
break; break;