From 4eeb83b5239a8a5c16dd438a46eef13cda40a042 Mon Sep 17 00:00:00 2001 From: ser-drephs Date: Wed, 10 Mar 2021 19:48:04 +0100 Subject: [PATCH] fix(StatusTab): cleanup status tab - Moved `copy` to back - `pull` and `branches` not shown or available when diff has focus - `psuh` and `force push` only available when something can be pushed Fixes #572 --- src/components/diff.rs | 12 ++++++------ src/tabs/status.rs | 30 ++++++++++++++---------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/components/diff.rs b/src/components/diff.rs index 2e9809308b..df732f8f40 100644 --- a/src/components/diff.rs +++ b/src/components/diff.rs @@ -639,12 +639,6 @@ impl Component for DiffComponent { self.focused, )); - out.push(CommandInfo::new( - strings::commands::copy(&self.key_config), - true, - self.focused, - )); - out.push( CommandInfo::new( strings::commands::diff_home_end(&self.key_config), @@ -680,6 +674,12 @@ impl Component for DiffComponent { )); } + out.push(CommandInfo::new( + strings::commands::copy(&self.key_config), + true, + self.focused, + )); + CommandBlocking::PassingOn } diff --git a/src/tabs/status.rs b/src/tabs/status.rs index 3009d39c8c..9e586bbd38 100644 --- a/src/tabs/status.rs +++ b/src/tabs/status.rs @@ -461,36 +461,34 @@ impl Component for Status { force_all, self.components().as_slice(), ); - - out.push(CommandInfo::new( - strings::commands::open_branch_select_popup( - &self.key_config, - ), - true, - true, - )); - out.push(CommandInfo::new( strings::commands::status_push(&self.key_config), self.can_push(), - true, + self.can_push(), )); out.push(CommandInfo::new( strings::commands::status_force_push( &self.key_config, ), self.can_push(), - true, - )); - out.push(CommandInfo::new( - strings::commands::status_pull(&self.key_config), - true, - true, + self.can_push(), )); } { let focus_on_diff = self.focus == Focus::Diff; + out.push(CommandInfo::new( + strings::commands::status_pull(&self.key_config), + !focus_on_diff, + !focus_on_diff, + )); + out.push(CommandInfo::new( + strings::commands::open_branch_select_popup( + &self.key_config, + ), + !focus_on_diff, + !focus_on_diff, + )); out.push(CommandInfo::new( strings::commands::edit_item(&self.key_config), if focus_on_diff {