aboutsummaryrefslogtreecommitdiffstats
path: root/default-plugins/configuration/src/presets_screen.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2024-10-31 14:35:13 +0100
committerGitHub <noreply@github.com>2024-10-31 14:35:13 +0100
commit549cfe02be2f2ce3fff74dd24196e2022cc2eba2 (patch)
tree9b2f3a95c5815f8baa30bbe40049b37390b32397 /default-plugins/configuration/src/presets_screen.rs
parentdocs(readme): add https to curl download (diff)
downloadsl0ppij-549cfe02be2f2ce3fff74dd24196e2022cc2eba2.tar.gz
sl0ppij-549cfe02be2f2ce3fff74dd24196e2022cc2eba2.tar.xz
sl0ppij-549cfe02be2f2ce3fff74dd24196e2022cc2eba2.zip
fix(ux): configuration fixes (#3713)
* fix(startup): try create config folder if it doesn't exist * fix(configuration): tab bar ui * fix(configuration): rebind ctrl-s to ctrl-a * fix(configuration): remove extra rebinding leaders screen
Diffstat (limited to 'default-plugins/configuration/src/presets_screen.rs')
-rw-r--r--default-plugins/configuration/src/presets_screen.rs56
1 files changed, 33 insertions, 23 deletions
diff --git a/default-plugins/configuration/src/presets_screen.rs b/default-plugins/configuration/src/presets_screen.rs
index 0551c895..9a29b790 100644
--- a/default-plugins/configuration/src/presets_screen.rs
+++ b/default-plugins/configuration/src/presets_screen.rs
@@ -85,7 +85,7 @@ impl PresetsScreen {
self.reset_selected_index();
}
should_render = true;
- } else if key.bare_key == BareKey::Char('s') && key.has_modifiers(&[KeyModifier::Ctrl]) {
+ } else if key.bare_key == BareKey::Char('a') && key.has_modifiers(&[KeyModifier::Ctrl]) {
if let Some(selected_index) = self.take_selected_index() {
let write_to_disk = true;
self.reconfigure(selected_index, write_to_disk);
@@ -93,12 +93,19 @@ impl PresetsScreen {
should_render = true;
}
} else if key.bare_key == BareKey::Char('l') && key.has_no_modifiers() {
- self.rebind_leaders_screen = Some(
- RebindLeadersScreen::default()
- .with_rebinding_for_presets()
- .with_mode_info(self.latest_mode_info.clone()),
- );
- should_render = true;
+ // for the time being this screen has been disabled because it was deemed too confusing
+ // and its use-cases are very limited (it's possible to achieve the same results by
+ // applying a preset and then rebinding the leader keys)
+ //
+ // the code is left here in case someone feels strongly about implementing this on
+ // their own, and because at the time of writing I'm a little ambiguous about this
+ // decision. At some point it should be refactored away
+ // self.rebind_leaders_screen = Some(
+ // RebindLeadersScreen::default()
+ // .with_rebinding_for_presets()
+ // .with_mode_info(self.latest_mode_info.clone()),
+ // );
+ // should_render = true;
} else if (key.bare_key == BareKey::Esc && key.has_no_modifiers())
|| key.is_key_with_ctrl_modifier(BareKey::Char('c'))
{
@@ -149,9 +156,16 @@ impl PresetsScreen {
should_render = true;
}
} else if key.bare_key == BareKey::Char('l') && key.has_no_modifiers() {
- self.rebind_leaders_screen =
- Some(RebindLeadersScreen::default().with_rebinding_for_presets());
- should_render = true;
+ // for the time being this screen has been disabled because it was deemed too confusing
+ // and its use-cases are very limited (it's possible to achieve the same results by
+ // applying a preset and then rebinding the leader keys)
+ //
+ // the code is left here in case someone feels strongly about implementing this on
+ // their own, and because at the time of writing I'm a little ambiguous about this
+ // decision. At some point it should be refactored away
+ // self.rebind_leaders_screen =
+ // Some(RebindLeadersScreen::default().with_rebinding_for_presets());
+ // should_render = true;
} else if (key.bare_key == BareKey::Esc && key.has_no_modifiers())
|| key.is_key_with_ctrl_modifier(BareKey::Char('c'))
{
@@ -730,16 +744,14 @@ impl PresetsScreen {
};
}
fn render_help_text_setup_wizard(&self, rows: usize, cols: usize) {
- let full_help_text =
- "Help: <↓↑> - navigate, <ENTER> - apply & save, <l> - change leaders, <ESC> - close";
- let short_help_text = "Help: <↓↑> / <ENTER> / <l> / <ESC>";
+ let full_help_text = "Help: <↓↑> - navigate, <ENTER> - apply & save, <ESC> - close";
+ let short_help_text = "Help: <↓↑> / <ENTER> / <ESC>";
if cols >= full_help_text.chars().count() {
print_text_with_coordinates(
Text::new(full_help_text)
.color_range(2, 6..10)
.color_range(2, 23..30)
- .color_range(2, 47..50)
- .color_range(2, 69..74),
+ .color_range(2, 47..=50),
0,
rows,
None,
@@ -750,8 +762,7 @@ impl PresetsScreen {
Text::new(short_help_text)
.color_range(2, 6..10)
.color_range(2, 13..20)
- .color_range(2, 23..26)
- .color_range(2, 29..34),
+ .color_range(2, 23..=27),
0,
rows,
None,
@@ -794,16 +805,16 @@ impl PresetsScreen {
}
}
fn render_help_text_main(&self, rows: usize, cols: usize) {
- let full_help_text = "Help: <↓↑> - navigate, <ENTER> - apply, <Ctrl s> - apply & save, <l> - leaders, <ESC> - close";
- let short_help_text = "Help: <↓↑> / <ENTER> / <Ctrl s> / <l> / <ESC>";
+ let full_help_text =
+ "Help: <↓↑> - navigate, <ENTER> - apply, <Ctrl a> - apply & save, <ESC> - close";
+ let short_help_text = "Help: <↓↑> / <ENTER> / <Ctrl a> / <ESC>";
if cols >= full_help_text.chars().count() {
print_text_with_coordinates(
Text::new(full_help_text)
.color_range(2, 6..10)
.color_range(2, 23..30)
.color_range(2, 40..48)
- .color_range(2, 65..68)
- .color_range(2, 80..85),
+ .color_range(2, 65..=69),
0,
rows,
None,
@@ -815,8 +826,7 @@ impl PresetsScreen {
.color_range(2, 6..10)
.color_range(2, 13..20)
.color_range(2, 23..31)
- .color_range(2, 34..37)
- .color_range(2, 40..45),
+ .color_range(2, 34..=38),
0,
rows,
None,