refactor: single instance

This commit is contained in:
Ashley Wulber 2023-11-21 16:15:02 -05:00 committed by Ashley Wulber
parent a0a11b6e02
commit 791441ca10
13 changed files with 271 additions and 195 deletions

View file

@ -3,6 +3,7 @@ use cctk::{
wayland_client::protocol::wl_output,
};
use cosmic::{
cctk,
iced::{
self,
widget::{column, row},
@ -36,17 +37,19 @@ pub(crate) fn layer_surface<'a>(
})
}));
match layout {
WorkspaceLayout::Vertical => row![sidebar, toplevels]
.spacing(12)
.height(iced::Length::Fill)
.width(iced::Length::Fill)
.into(),
WorkspaceLayout::Horizontal => column![sidebar, toplevels]
.spacing(12)
.height(iced::Length::Fill)
.width(iced::Length::Fill)
.into(),
WorkspaceLayout::Vertical => widget::cosmic_container::container(
row![sidebar, toplevels]
.spacing(12)
.height(iced::Length::Fill)
.width(iced::Length::Fill),
),
WorkspaceLayout::Horizontal => widget::cosmic_container::container(
column![sidebar, toplevels]
.spacing(12)
.height(iced::Length::Fill),
),
}
.into()
}
fn close_button(on_press: Msg) -> cosmic::Element<'static, Msg> {