feat: Workspace view closing by pressing current workspace or empty space
This commit is contained in:
parent
e032b0b5ee
commit
fd0bdeebbf
2 changed files with 16 additions and 8 deletions
|
|
@ -505,6 +505,11 @@ impl Application for App {
|
|||
return self.hide();
|
||||
}
|
||||
Msg::ActivateWorkspace(workspace_handle) => {
|
||||
if let Some(workspace) = self.workspace_for_handle(&workspace_handle) {
|
||||
if workspace.is_active {
|
||||
return self.hide();
|
||||
}
|
||||
}
|
||||
self.send_wayland_cmd(backend::Cmd::ActivateWorkspace(workspace_handle));
|
||||
}
|
||||
Msg::ActivateToplevel(toplevel_handle) => {
|
||||
|
|
|
|||
|
|
@ -359,14 +359,17 @@ fn toplevel_previews<'a>(
|
|||
.map(|t| toplevel_previews_entry(t, output, drag_toplevel == Some(&t.handle)))
|
||||
.collect();
|
||||
//row(entries)
|
||||
widget::container(crate::widgets::toplevels(entries))
|
||||
.align_x(iced::alignment::Horizontal::Center)
|
||||
.width(width)
|
||||
.height(height)
|
||||
//.spacing(16)
|
||||
.padding(12)
|
||||
//.align_items(iced::Alignment::Center)
|
||||
.into()
|
||||
widget::mouse_area(
|
||||
widget::container(crate::widgets::toplevels(entries))
|
||||
.align_x(iced::alignment::Horizontal::Center)
|
||||
.width(width)
|
||||
.height(height)
|
||||
//.spacing(16)
|
||||
.padding(12),
|
||||
)
|
||||
.on_press(Msg::Close)
|
||||
//.align_items(iced::Alignment::Center)
|
||||
.into()
|
||||
}
|
||||
|
||||
fn bg_element<'a>(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue