Update iced/libcosmic
This commit is contained in:
parent
e0c0f27f67
commit
b70828e23f
17 changed files with 2019 additions and 1262 deletions
|
|
@ -5,11 +5,11 @@ use cosmic::{
|
|||
advanced::{
|
||||
layout::{self},
|
||||
mouse, overlay, renderer,
|
||||
widget::{tree, Operation, OperationOutputWrapper, Tree},
|
||||
widget::{tree, Operation, Tree},
|
||||
Clipboard, Layout, Shell, Widget,
|
||||
},
|
||||
event::{self, Event},
|
||||
Length, Rectangle, Size,
|
||||
Length, Rectangle, Size, Vector,
|
||||
},
|
||||
iced_core::Renderer,
|
||||
};
|
||||
|
|
@ -52,7 +52,7 @@ impl<'a, Msg> Widget<Msg, cosmic::Theme, cosmic::Renderer> for ImageBg<'a, Msg>
|
|||
tree: &mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
operation: &mut dyn Operation<OperationOutputWrapper<Msg>>,
|
||||
operation: &mut dyn Operation<()>,
|
||||
);
|
||||
fn mouse_interaction(
|
||||
&self,
|
||||
|
|
@ -82,6 +82,7 @@ impl<'a, Msg> Widget<Msg, cosmic::Theme, cosmic::Renderer> for ImageBg<'a, Msg>
|
|||
tree: &'b mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
translation: Vector,
|
||||
) -> Option<overlay::Element<'b, Msg, cosmic::Theme, cosmic::Renderer>>;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
use cosmic::iced::{
|
||||
advanced::{
|
||||
layout, mouse, overlay, renderer,
|
||||
widget::{tree, Id, Operation, OperationOutputWrapper, Tree},
|
||||
widget::{tree, Id, Operation, Tree},
|
||||
Clipboard, Layout, Shell, Widget,
|
||||
},
|
||||
event::{self, Event},
|
||||
Length, Rectangle, Size,
|
||||
Length, Rectangle, Size, Vector,
|
||||
};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ impl<'a, Msg> Widget<Msg, cosmic::Theme, cosmic::Renderer> for LayoutWrapper<'a,
|
|||
tree: &mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
operation: &mut dyn Operation<OperationOutputWrapper<Msg>>,
|
||||
operation: &mut dyn Operation<()>,
|
||||
);
|
||||
fn draw(
|
||||
&self,
|
||||
|
|
@ -102,6 +102,7 @@ impl<'a, Msg> Widget<Msg, cosmic::Theme, cosmic::Renderer> for LayoutWrapper<'a,
|
|||
tree: &'b mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
transation: Vector,
|
||||
) -> Option<overlay::Element<'b, Msg, cosmic::Theme, cosmic::Renderer>>;
|
||||
fn set_id(&mut self, id: Id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
use cosmic::iced::{
|
||||
advanced::{
|
||||
layout, mouse, overlay, renderer,
|
||||
widget::{tree, Id, Operation, OperationOutputWrapper, Tree},
|
||||
widget::{tree, Id, Operation, Tree},
|
||||
Clipboard, Layout, Shell, Widget,
|
||||
},
|
||||
event::{self, Event},
|
||||
Length, Rectangle, Size,
|
||||
Length, Rectangle, Size, Vector,
|
||||
};
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
|
@ -46,7 +46,7 @@ impl<'a, Msg> Widget<Msg, cosmic::Theme, cosmic::Renderer> for MouseInteractionW
|
|||
tree: &mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
operation: &mut dyn Operation<OperationOutputWrapper<Msg>>,
|
||||
operation: &mut dyn Operation<()>,
|
||||
);
|
||||
fn draw(
|
||||
&self,
|
||||
|
|
@ -79,6 +79,7 @@ impl<'a, Msg> Widget<Msg, cosmic::Theme, cosmic::Renderer> for MouseInteractionW
|
|||
tree: &'b mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
translation: Vector,
|
||||
) -> Option<overlay::Element<'b, Msg, cosmic::Theme, cosmic::Renderer>>;
|
||||
fn set_id(&mut self, id: Id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use cosmic::iced::{
|
|||
advanced::{
|
||||
layout::{self, flex::Axis},
|
||||
mouse, renderer,
|
||||
widget::{Operation, OperationOutputWrapper, Tree},
|
||||
widget::{Operation, Tree},
|
||||
Clipboard, Layout, Shell, Widget,
|
||||
},
|
||||
event::{self, Event},
|
||||
|
|
@ -120,7 +120,7 @@ impl<'a, Msg> Widget<Msg, cosmic::Theme, cosmic::Renderer> for ToplevelItem<'a,
|
|||
tree: &mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
operation: &mut dyn Operation<OperationOutputWrapper<Msg>>,
|
||||
operation: &mut dyn Operation<()>,
|
||||
) {
|
||||
operation.container(None, layout.bounds(), &mut |operation| {
|
||||
self.children
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use cosmic::iced::{
|
|||
advanced::{
|
||||
layout::{self, flex::Axis},
|
||||
mouse, renderer,
|
||||
widget::{Operation, OperationOutputWrapper, Tree},
|
||||
widget::{Operation, Tree},
|
||||
Clipboard, Layout, Shell, Widget,
|
||||
},
|
||||
event::{self, Event},
|
||||
|
|
@ -130,7 +130,7 @@ impl<'a, Msg> Widget<Msg, cosmic::Theme, cosmic::Renderer> for Toplevels<'a, Msg
|
|||
tree: &mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
operation: &mut dyn Operation<OperationOutputWrapper<Msg>>,
|
||||
operation: &mut dyn Operation<()>,
|
||||
) {
|
||||
operation.container(None, layout.bounds(), &mut |operation| {
|
||||
self.children
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
use cosmic::iced::{
|
||||
advanced::{
|
||||
layout, mouse, renderer,
|
||||
widget::{Operation, OperationOutputWrapper, Tree},
|
||||
widget::{Operation, Tree},
|
||||
Clipboard, Layout, Shell, Widget,
|
||||
},
|
||||
event::{self, Event},
|
||||
|
|
@ -42,7 +42,7 @@ impl<'a, Msg> Widget<Msg, cosmic::Theme, cosmic::Renderer> for VisibilityWrapper
|
|||
tree: &mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
operation: &mut dyn Operation<OperationOutputWrapper<Msg>>,
|
||||
operation: &mut dyn Operation<()>,
|
||||
) {
|
||||
self.content
|
||||
.as_widget()
|
||||
|
|
|
|||
|
|
@ -5,9 +5,10 @@ use cosmic::iced::{
|
|||
advanced::{
|
||||
layout::{self, flex::Axis},
|
||||
mouse, renderer,
|
||||
widget::{Operation, OperationOutputWrapper, Tree},
|
||||
widget::{Operation, Tree},
|
||||
Clipboard, Layout, Shell, Widget,
|
||||
},
|
||||
core::clipboard::DndDestinationRectangles,
|
||||
event::{self, Event},
|
||||
Length, Point, Rectangle, Size,
|
||||
};
|
||||
|
|
@ -122,7 +123,7 @@ impl<'a, Msg> Widget<Msg, cosmic::Theme, cosmic::Renderer> for WorkspaceBar<'a,
|
|||
tree: &mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
operation: &mut dyn Operation<OperationOutputWrapper<Msg>>,
|
||||
operation: &mut dyn Operation<()>,
|
||||
) {
|
||||
operation.container(None, layout.bounds(), &mut |operation| {
|
||||
self.children
|
||||
|
|
@ -219,6 +220,24 @@ impl<'a, Msg> Widget<Msg, cosmic::Theme, cosmic::Renderer> for WorkspaceBar<'a,
|
|||
fn diff(&mut self, tree: &mut Tree) {
|
||||
tree.diff_children(&mut self.children);
|
||||
}
|
||||
|
||||
fn drag_destinations(
|
||||
&self,
|
||||
state: &Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
dnd_rectangles: &mut DndDestinationRectangles,
|
||||
) {
|
||||
for ((e, layout), state) in self
|
||||
.children
|
||||
.iter()
|
||||
.zip(layout.children())
|
||||
.zip(state.children.iter())
|
||||
{
|
||||
e.as_widget()
|
||||
.drag_destinations(state, layout, renderer, dnd_rectangles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, Msg: 'static> From<WorkspaceBar<'a, Msg>> for cosmic::Element<'a, Msg> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue