fix(compact-bar): make tooltip hints use opaque bg (#4356)
* fix(compact-bar): make tooltip hints use opaque bg * docs(changelog): add PR
This commit is contained in:
parent
03f81eae1a
commit
7fc8a0308c
3 changed files with 16 additions and 5 deletions
|
|
@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|||
* fix: Zellij Web login issue with safari (https://github.com/zellij-org/zellij/pull/4345)
|
||||
* fix: terminal title regression (https://github.com/zellij-org/zellij/pull/4352)
|
||||
* fix: resurrection listing regression (https://github.com/zellij-org/zellij/pull/4354)
|
||||
* fix: tooltip keybinding backgrounds (https://github.com/zellij-org/zellij/pull/4356)
|
||||
|
||||
## [0.43.0] - 2025-08-05
|
||||
* feat: multiple select and bulk pane actions (https://github.com/zellij-org/zellij/pull/4169 and https://github.com/zellij-org/zellij/pull/4171, https://github.com/zellij-org/zellij/pull/4221 and https://github.com/zellij-org/zellij/pull/4286)
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ impl RightSideElementsBuilder {
|
|||
|
||||
fn create_tooltip_indicator(&self, toggle_key: &str, is_active: bool) -> LinePart {
|
||||
let key_text = toggle_key;
|
||||
let key = Text::new(key_text).color_all(3);
|
||||
let key = Text::new(key_text).color_all(3).opaque();
|
||||
let ribbon_text = "Tooltip";
|
||||
let mut ribbon = Text::new(ribbon_text);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ impl<'a> TooltipRenderer<'a> {
|
|||
// if it does
|
||||
if base_x + x + total_element_width > cols {
|
||||
let remaining_space = cols.saturating_sub(base_x + x);
|
||||
let ellipsis = Text::new("...");
|
||||
let ellipsis = Text::new("...").opaque();
|
||||
print_text_with_coordinates(
|
||||
ellipsis,
|
||||
base_x + x,
|
||||
|
|
@ -43,7 +43,7 @@ impl<'a> TooltipRenderer<'a> {
|
|||
print_text_with_coordinates(text, base_x + x, base_y + y, None, None);
|
||||
print_ribbon_with_coordinates(
|
||||
ribbon,
|
||||
base_x + x + text_width + 1,
|
||||
base_x + x + text_width,
|
||||
base_y + y,
|
||||
None,
|
||||
None,
|
||||
|
|
@ -80,15 +80,25 @@ impl<'a> TooltipRenderer<'a> {
|
|||
let mut components = Vec::new();
|
||||
let mut max_columns = 0;
|
||||
|
||||
let mut is_first = true;
|
||||
for (key, description) in actions {
|
||||
let text = Text::new(&key).color_all(3);
|
||||
let text = if is_first {
|
||||
Text::new(format!("{} ", &key)).color_all(3).opaque()
|
||||
} else {
|
||||
Text::new(format!(" {} ", &key)).color_all(3).opaque()
|
||||
};
|
||||
let ribbon = Text::new(&description);
|
||||
|
||||
let line_length = key.chars().count() + 1 + description.chars().count();
|
||||
let line_length = if is_first {
|
||||
key.chars().count() + description.chars().count()
|
||||
} else {
|
||||
key.chars().count() + 1 + description.chars().count()
|
||||
};
|
||||
|
||||
components.push((text, ribbon, running_x, y));
|
||||
running_x += line_length + 5;
|
||||
max_columns = max_columns.max(running_x);
|
||||
is_first = false;
|
||||
}
|
||||
|
||||
let total_rows = 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue