Custom Toplevels widget

Fixes centering on toplevels.

Need to use fewer hacks, and add equal scale factor.

See if Iced layout system can be improved.
This commit is contained in:
Ian Douglas Scott 2024-01-19 15:32:54 -08:00
parent ec5dceeed2
commit 99aeca0f2f
4 changed files with 234 additions and 4 deletions

View file

@ -1,5 +1,7 @@
// TODO rename
// combine widgets
// Hack: this widget defines it's width as the second child's width
// So the width of the image will be the overall width.
use cosmic::iced::{
advanced::{
@ -62,7 +64,10 @@ pub struct WorkspaceItem<'a, Msg> {
impl<'a, Msg> Widget<Msg, cosmic::Renderer> for WorkspaceItem<'a, Msg> {
fn width(&self) -> Length {
Length::Fill
//Length::Fill
// XXX doesn't work when used in standard `row` widget
// But fixes allocation of `dnd_source` wrapping this, within `Workspaces` row
Length::Shrink
}
fn height(&self) -> Length {