Make Ctrl+Shift+T open new tab, expand tab bar width
This commit is contained in:
parent
04601284af
commit
adb2d2ed3d
1 changed files with 15 additions and 6 deletions
21
src/main.rs
21
src/main.rs
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue