diff options
| author | Aram Drevekenin <aram@poor.dev> | 2024-11-24 16:46:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-24 16:46:13 +0100 |
| commit | 971fd4a4f7519dca7a5dfaf5f4868424e99a80a6 (patch) | |
| tree | 24d6b0d50549574bc1d4b843e630c0849f055375 /default-plugins | |
| parent | docs(changelog): focus_pane_with_id fix (diff) | |
| download | sl0ppij-971fd4a4f7519dca7a5dfaf5f4868424e99a80a6.tar.gz sl0ppij-971fd4a4f7519dca7a5dfaf5f4868424e99a80a6.tar.xz sl0ppij-971fd4a4f7519dca7a5dfaf5f4868424e99a80a6.zip | |
fix(plugins): properly pad UI elements when they have a background (#3806)
* fix(plugins): mark selected background up until component width
* style(fmt): rustfmt
Diffstat (limited to 'default-plugins')
| -rw-r--r-- | default-plugins/configuration/src/presets_screen.rs | 16 | ||||
| -rw-r--r-- | default-plugins/configuration/src/rebind_leaders_screen.rs | 6 |
2 files changed, 6 insertions, 16 deletions
diff --git a/default-plugins/configuration/src/presets_screen.rs b/default-plugins/configuration/src/presets_screen.rs index 9a29b790..d783c00f 100644 --- a/default-plugins/configuration/src/presets_screen.rs +++ b/default-plugins/configuration/src/presets_screen.rs @@ -533,13 +533,7 @@ impl PresetsScreen { } else { (rows.saturating_sub(ui_size) / 2) + 2 }; - print_nested_list_with_coordinates( - list_items, - left_padding, - top_coordinates, - Some(max_width), - None, - ); + print_nested_list_with_coordinates(list_items, left_padding, top_coordinates, None, None); } fn render_second_bulletin( &self, @@ -672,13 +666,7 @@ impl PresetsScreen { } else { (rows.saturating_sub(ui_size) / 2) + 6 }; - print_nested_list_with_coordinates( - list_items, - left_padding, - top_coordinates, - Some(max_width), - None, - ); + print_nested_list_with_coordinates(list_items, left_padding, top_coordinates, None, None); } fn render_leader_keys_indication( &self, diff --git a/default-plugins/configuration/src/rebind_leaders_screen.rs b/default-plugins/configuration/src/rebind_leaders_screen.rs index f87f3cfa..4e177228 100644 --- a/default-plugins/configuration/src/rebind_leaders_screen.rs +++ b/default-plugins/configuration/src/rebind_leaders_screen.rs @@ -304,6 +304,7 @@ impl RebindLeadersScreen { } else { (format!("{}", primary_modifier_key_text), 0) }; + let primary_modifier_menu_width = primary_modifier_text.chars().count(); print_text_with_coordinates( Text::new(primary_modifier_text).color_range(3, primary_modifier_start_position..), base_x, @@ -330,7 +331,7 @@ impl RebindLeadersScreen { .collect(), base_x, base_y + 6, - Some(screen_width / 2), + Some(primary_modifier_menu_width), None, ); } @@ -504,6 +505,7 @@ impl RebindLeadersScreen { (format!("{}", secondary_modifier_key_text), 0) }; let secondary_modifier_menu_x_coords = base_x + (screen_width / 2); + let secondary_modifier_menu_width = secondary_modifier_text.chars().count(); print_text_with_coordinates( Text::new(secondary_modifier_text).color_range(0, secondary_modifier_start_position..), secondary_modifier_menu_x_coords, @@ -530,7 +532,7 @@ impl RebindLeadersScreen { .collect(), secondary_modifier_menu_x_coords, base_y + 6, - Some(screen_width / 2), + Some(secondary_modifier_menu_width), None, ); } |
