Make Ctrl+Shift+T open new tab, expand tab bar width

This commit is contained in:
Jeremy Soller 2023-12-22 11:09:31 -07:00
parent 04601284af
commit adb2d2ed3d
No known key found for this signature in database
GPG key ID: DCFCA852D3906975

View file

@ -276,16 +276,15 @@ impl cosmic::Application for App {
if self.tab_model.iter().count() > 1 {
tab_column = tab_column.push(
widget::container(row![
widget::container(
widget::view_switcher::horizontal(&self.tab_model)
.button_height(32)
.button_spacing(space_xxs)
.on_activate(Message::TabActivate)
.on_close(Message::TabClose)
.width(Length::Shrink),
widget::horizontal_space(Length::Fill)
])
.style(style::Container::Background),
.on_close(Message::TabClose),
)
.style(style::Container::Background)
.width(Length::Fill),
);
}
@ -323,6 +322,16 @@ impl cosmic::Application for App {
None
}
}
Event::Keyboard(KeyEvent::KeyPressed {
key_code: KeyCode::T,
modifiers,
}) => {
if modifiers == Modifiers::CTRL | Modifiers::SHIFT {
Some(Message::TabNew)
} else {
None
}
}
Event::Keyboard(KeyEvent::KeyPressed {
key_code: KeyCode::V,
modifiers,