mirror of
https://github.com/wez/wezterm.git
synced 2024-11-27 02:25:28 +03:00
integrated-title-bar: Add option to remove useless buttons
This commit is contained in:
parent
2333046e1b
commit
d39bccca10
@ -241,7 +241,13 @@ impl TabBarState {
|
||||
},
|
||||
);
|
||||
|
||||
let button_order = if config.fancy_window_decorations.is_left {
|
||||
let window::FancyWindowDecorations {
|
||||
is_left,
|
||||
remove_hide_button,
|
||||
remove_maximize_button,
|
||||
} = config.fancy_window_decorations;
|
||||
|
||||
let button_order = if is_left {
|
||||
['X', '.', '-']
|
||||
} else {
|
||||
['.', '-', 'X']
|
||||
@ -250,7 +256,7 @@ impl TabBarState {
|
||||
for button in button_order {
|
||||
let (title, item) = match button {
|
||||
// Window hide button
|
||||
'.' => {
|
||||
'.' if !remove_hide_button => {
|
||||
let hover = is_tab_hover(mouse_x, *x, window_hide_hover.len());
|
||||
|
||||
let window_hide_button = if hover {
|
||||
@ -261,7 +267,7 @@ impl TabBarState {
|
||||
|
||||
(window_hide_button, TabBarItem::WindowHideButton)
|
||||
}
|
||||
'-' => {
|
||||
'-' if !remove_maximize_button => {
|
||||
// Window maximize button
|
||||
let hover = is_tab_hover(mouse_x, *x, window_maximize_hover.len());
|
||||
|
||||
@ -285,7 +291,7 @@ impl TabBarState {
|
||||
|
||||
(window_close_button, TabBarItem::WindowCloseButton)
|
||||
}
|
||||
_ => unreachable!(),
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
// let button_start = *x;
|
||||
|
@ -1455,6 +1455,10 @@ impl Default for WindowDecorations {
|
||||
pub struct FancyWindowDecorations {
|
||||
#[dynamic(default)]
|
||||
pub is_left: bool,
|
||||
#[dynamic(default)]
|
||||
pub remove_hide_button: bool,
|
||||
#[dynamic(default)]
|
||||
pub remove_maximize_button: bool,
|
||||
}
|
||||
|
||||
/// Map c to its Ctrl equivalent.
|
||||
|
Loading…
Reference in New Issue
Block a user