mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 15:04:36 +03:00
update retro tab bar hover state in more cases
refs: https://github.com/wez/wezterm/issues/1764
This commit is contained in:
parent
7f3a29dccb
commit
4035860f45
@ -22,6 +22,7 @@ As features stabilize some brief notes about them will accumulate here.
|
||||
* On Windows, explorer shortcut icons with the maximized setting would fall out of maximized state on startup. Thanks to [@davidrios](https://github.com/davidrios)! [#1502](https://github.com/wez/wezterm/issues/1502)
|
||||
* `LANG` environment variable was not always set on macOS, leading to mojibake when entering CJK. [#1761](https://github.com/wez/wezterm/issues/1761) [#1765](https://github.com/wez/wezterm/issues/1765)
|
||||
* Fonts with only non-unicode names (eg: only using a Chinese multibyte string encoding) were treated as having names like `?????` and were not accessible. [#1761](https://github.com/wez/wezterm/issues/1761)
|
||||
* Hover state of leftmost retro style tab was overly sticky when the mouse moved out of the tab. [#1764](https://github.com/wez/wezterm/issues/1764)
|
||||
|
||||
### 20220319-142410-0fcdea07
|
||||
|
||||
|
@ -1531,9 +1531,19 @@ impl TermWindow {
|
||||
0
|
||||
};
|
||||
|
||||
let tab_bar_height = self.tab_bar_pixel_height().unwrap_or(0.);
|
||||
|
||||
let hovering_in_tab_bar = match &self.current_mouse_event {
|
||||
Some(event) => {
|
||||
let mouse_y = event.coords.y as f32;
|
||||
mouse_y >= tab_bar_y as f32 && mouse_y < tab_bar_y as f32 + tab_bar_height
|
||||
}
|
||||
None => false,
|
||||
};
|
||||
|
||||
let new_tab_bar = TabBarState::new(
|
||||
self.dimensions.pixel_width / self.render_metrics.cell_size.width as usize,
|
||||
if self.last_mouse_coords.1 == tab_bar_y {
|
||||
if hovering_in_tab_bar {
|
||||
Some(self.last_mouse_coords.0)
|
||||
} else {
|
||||
None
|
||||
|
@ -201,6 +201,7 @@ impl super::TermWindow {
|
||||
|
||||
pub fn mouse_leave_impl(&mut self, context: &dyn WindowOps) {
|
||||
self.current_mouse_event = None;
|
||||
self.update_title();
|
||||
context.invalidate();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user