From f589bbc67ca5de28fc2b85179c26ba50ee3e4442 Mon Sep 17 00:00:00 2001
From: Ilia Maslakov <il.smind@gmail.com>
Date: Fri, 18 Mar 2011 13:12:11 +0000
Subject: [PATCH 1/2] Ticket #2465 (dynamically resize panels)
added two actions to dynamically resize panels (PanelEnlangeRight, PanelEnlangeLeft)
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
---
lib/keybind.c | 2 ++
lib/keybind.h | 2 ++
src/filemanager/layout.c | 18 ++++++++++++++++++
src/filemanager/layout.h | 2 ++
src/filemanager/midnight.c | 6 ++++++
5 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/lib/keybind.c b/lib/keybind.c
index a4f4093..c2b412a 100644
a
|
b
|
static name_keymap_t command_names[] = { |
437 | 437 | {"PanelSortOrderBySize", CK_PanelSortOrderBySize}, |
438 | 438 | {"PanelSortOrderByMTime", CK_PanelSortOrderByMTime}, |
439 | 439 | {"PanelSmartGotoParentDir", CK_PanelSmartGotoParentDir}, |
| 440 | {"PanelEnlangeLeft", CK_EnlargeLeftPanel}, |
| 441 | {"PanelEnlangeRight", CK_EnlargeRightPanel}, |
440 | 442 | |
441 | 443 | /* input line */ |
442 | 444 | {"InputBol", CK_InputBol}, |
diff --git a/lib/keybind.h b/lib/keybind.h
index 7a7f1b8..7d725d2 100644
a
|
b
|
|
415 | 415 | #define CK_DialogNextCmd 7080 |
416 | 416 | #define CK_DialogPrevCmd 7081 |
417 | 417 | #define CK_EditForceInternalCmd 7082 |
| 418 | #define CK_EnlargeLeftPanel 7083 |
| 419 | #define CK_EnlargeRightPanel 7084 |
418 | 420 | |
419 | 421 | /* panels */ |
420 | 422 | #define CK_PanelChdirOtherPanel 8001 |
diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c
index c84f139..4ec55ab 100644
a
|
b
|
mc_refresh (void) |
736 | 736 | /* --------------------------------------------------------------------------------------------- */ |
737 | 737 | |
738 | 738 | void |
| 739 | layout_enlarge_left_panel (void) |
| 740 | { |
| 741 | first_panel_size++; |
| 742 | layout_change (); |
| 743 | } |
| 744 | |
| 745 | /* --------------------------------------------------------------------------------------------- */ |
| 746 | |
| 747 | void |
| 748 | layout_enlarge_right_panel (void) |
| 749 | { |
| 750 | first_panel_size--; |
| 751 | layout_change (); |
| 752 | } |
| 753 | |
| 754 | /* --------------------------------------------------------------------------------------------- */ |
| 755 | |
| 756 | void |
739 | 757 | setup_panels (void) |
740 | 758 | { |
741 | 759 | int start_y; |
diff --git a/src/filemanager/layout.h b/src/filemanager/layout.h
index ad250e5..6e71d8a 100644
a
|
b
|
extern int nice_rotating_dash; |
35 | 35 | |
36 | 36 | /*** declarations of public functions ************************************************************/ |
37 | 37 | |
| 38 | void layout_enlarge_left_panel (void); |
| 39 | void layout_enlarge_right_panel (void); |
38 | 40 | void layout_change (void); |
39 | 41 | void layout_box (void); |
40 | 42 | void setup_panels (void); |
diff --git a/src/filemanager/midnight.c b/src/filemanager/midnight.c
index f99774c..c1a4541 100644
a
|
b
|
midnight_execute_cmd (Widget * sender, unsigned long command) |
1151 | 1151 | jobs_cmd (); |
1152 | 1152 | break; |
1153 | 1153 | #endif |
| 1154 | case CK_EnlargeLeftPanel: |
| 1155 | layout_enlarge_left_panel (); |
| 1156 | break; |
| 1157 | case CK_EnlargeRightPanel: |
| 1158 | layout_enlarge_right_panel (); |
| 1159 | break; |
1154 | 1160 | case CK_LayoutBox: |
1155 | 1161 | layout_box (); |
1156 | 1162 | break; |