summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2020-05-21 20:15:31 +0200
committerCanop <cano.petrole@gmail.com>2020-05-21 20:15:31 +0200
commit9260e84c065b32f8593c86d231683c1f0da1c00c (patch)
tree5fe16cab157dccfe7a1c278582b7a9257f41a078
parent055c3236f6f5bd22c0a46bc234ae0e9988180955 (diff)
status line covers the whole terminal width
I'm not sure it's really better. This behavior is behind a constant and may change
-rw-r--r--src/app/panel.rs6
-rw-r--r--src/conf.rs12
-rw-r--r--src/display/areas.rs11
-rw-r--r--src/display/mod.rs4
-rw-r--r--src/skin/style_map.rs4
5 files changed, 31 insertions, 6 deletions
diff --git a/src/app/panel.rs b/src/app/panel.rs
index 2d91f48..1061920 100644
--- a/src/app/panel.rs
+++ b/src/app/panel.rs
@@ -2,7 +2,7 @@ use {
super::*,
crate::{
command::*,
- display::{status_line, Areas, Screen, W, write_flags},
+ display::{status_line, Areas, Screen, W, WIDE_STATUS, write_flags},
errors::ProgramError,
keys,
skin::PanelSkin,
@@ -158,7 +158,9 @@ impl Panel {
) -> Result<(), ProgramError> {
let state_area = self.areas.state.clone();
self.mut_state().display(w, screen, state_area, panel_skin, con)?;
- self.write_status(w, panel_skin, screen)?;
+ if active || !WIDE_STATUS {
+ self.write_status(w, panel_skin, screen)?;
+ }
self.input_field.set_normal_style(panel_skin.styles.input.clone());
self.input_field.focused = active;
self.input_field.area = self.areas.input.clone();
diff --git a/src/conf.rs b/src/conf.rs
index 3a1e522..5e8a32a 100644
--- a/src/conf.rs
+++ b/src/conf.rs
@@ -311,6 +311,18 @@ execution = "$PAGER {file}"
# key = "ctrl-g"
# execution = ":toggle_git_status"
+# You can reproduce the bindings of Norton Commander
+# on copying or moving to the other panel:
+#
+# [[verbs]]
+# key = "F5"
+# execution = ":copy_to_panel"
+#
+# [[verbs]]
+# key = "F6"
+# execution = ":move_to_panel"
+
+
###############################################################
# Skin
# If you want to change the colors of broot,
diff --git a/src/display/areas.rs b/src/display/areas.rs
index 048cb3a..236051d 100644
--- a/src/display/areas.rs
+++ b/src/display/areas.rs
@@ -1,5 +1,8 @@
use {
- super::Screen,
+ super::{
+ Screen,
+ WIDE_STATUS,
+ },
crate::{
app::Panel,
errors::ProgramError,
@@ -88,7 +91,11 @@ impl Areas {
};
let y = screen.height - 2;
areas.state = Area::new(x, 0, panel_width, y);
- areas.status = Area::new(x, y, panel_width, 1);
+ areas.status = if WIDE_STATUS {
+ Area::new(0, y, screen.width, 1)
+ } else {
+ Area::new(x, y, panel_width, 1)
+ };
let y = y + 1;
areas.input = Area::new(x, y, panel_width, 1);
areas.purpose = if slot_idx > 0 {
diff --git a/src/display/mod.rs b/src/display/mod.rs
index 59d33d5..3aabddc 100644
--- a/src/display/mod.rs
+++ b/src/display/mod.rs
@@ -39,6 +39,10 @@ pub use {
screen::Screen,
};
+/// if true then the status of a panel covers the whole width
+/// of the terminal (over the other panels)
+pub const WIDE_STATUS: bool = true;
+
/// the type used by all GUI writing functions
pub type W = BufWriter<std::io::Stderr>;
diff --git a/src/skin/style_map.rs b/src/skin/style_map.rs
index f230c4c..3989783 100644
--- a/src/skin/style_map.rs
+++ b/src/skin/style_map.rs
@@ -114,7 +114,7 @@ macro_rules! StyleMap {
// (if missing the style is the same than for focused panels)
StyleMap! {
default: gray(22), gray(1), [] / gray(20), gray(1), []
- tree: gray(5), None, [] / gray(3), None, []
+ tree: gray(6), None, [] / gray(3), None, []
file: gray(18), None, [] / gray(15), None, []
directory: ansi(110), None, [Bold] / ansi(110), None, []
exe: Some(Cyan), None, []
@@ -142,7 +142,7 @@ StyleMap! {
file_error: Some(Red), None, []
flag_label: gray(15), None, []
flag_value: ansi(178), None, [Bold]
- input: Some(White), None, [] / gray(15), None, []
+ input: Some(White), None, [] / gray(15), gray(2), []
status_error: gray(22), ansi(124), []
status_job: ansi(220), gray(5), []
status_normal: gray(20), gray(3), [] / gray(2), gray(2), []