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:
parent
ec5dceeed2
commit
99aeca0f2f
4 changed files with 234 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue