chore: updates after iced rebase
This commit is contained in:
parent
7bb5ae7cfe
commit
a48c4fc47d
16 changed files with 753 additions and 736 deletions
|
|
@ -52,13 +52,13 @@ where
|
|||
}
|
||||
|
||||
fn layout(
|
||||
&self,
|
||||
&mut self,
|
||||
state: &mut Tree,
|
||||
renderer: &cosmic::Renderer,
|
||||
limits: &layout::Limits,
|
||||
) -> layout::Node {
|
||||
let state = &mut state.children[0];
|
||||
let node = self.elem.as_widget().layout(state, renderer, limits);
|
||||
let node = self.elem.as_widget_mut().layout(state, renderer, limits);
|
||||
layout::Node::with_children(node.size(), vec![node])
|
||||
}
|
||||
|
||||
|
|
@ -81,6 +81,7 @@ where
|
|||
|
||||
renderer.fill_quad(
|
||||
Quad {
|
||||
snap: true,
|
||||
bounds: layout.bounds(),
|
||||
border: Border {
|
||||
radius: styling.border_radius,
|
||||
|
|
@ -128,7 +129,7 @@ where
|
|||
}
|
||||
|
||||
fn operate(
|
||||
&self,
|
||||
&mut self,
|
||||
state: &mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &cosmic::Renderer,
|
||||
|
|
@ -137,21 +138,21 @@ where
|
|||
let state = &mut state.children[0];
|
||||
let layout = layout.children().next().unwrap();
|
||||
self.elem
|
||||
.as_widget()
|
||||
.as_widget_mut()
|
||||
.operate(state, layout, renderer, operation)
|
||||
}
|
||||
|
||||
fn on_event(
|
||||
fn update(
|
||||
&mut self,
|
||||
state: &mut Tree,
|
||||
event: Event,
|
||||
event: &Event,
|
||||
layout: Layout<'_>,
|
||||
cursor: mouse::Cursor,
|
||||
renderer: &cosmic::Renderer,
|
||||
clipboard: &mut dyn Clipboard,
|
||||
shell: &mut Shell<'_, Message>,
|
||||
viewport: &Rectangle,
|
||||
) -> event::Status {
|
||||
) {
|
||||
let mut bounds = layout.bounds();
|
||||
|
||||
// fix padding 1 and event... don't ask.
|
||||
|
|
@ -180,9 +181,9 @@ where
|
|||
|
||||
let state = &mut state.children[0];
|
||||
let layout = layout.children().next().unwrap();
|
||||
self.elem.as_widget_mut().on_event(
|
||||
self.elem.as_widget_mut().update(
|
||||
state, event, layout, cursor, renderer, clipboard, shell, viewport,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
fn mouse_interaction(
|
||||
|
|
@ -203,15 +204,16 @@ where
|
|||
fn overlay<'b>(
|
||||
&'b mut self,
|
||||
state: &'b mut Tree,
|
||||
layout: Layout<'_>,
|
||||
layout: Layout<'b>,
|
||||
renderer: &cosmic::Renderer,
|
||||
viewport: &Rectangle,
|
||||
translation: cosmic::iced::Vector,
|
||||
) -> Option<overlay::Element<'b, Message, cosmic::Theme, cosmic::Renderer>> {
|
||||
let state = &mut state.children[0];
|
||||
let layout = layout.children().next().unwrap();
|
||||
self.elem
|
||||
.as_widget_mut()
|
||||
.overlay(state, layout, renderer, translation)
|
||||
.overlay(state, layout, renderer, viewport, translation)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ use cosmic::{
|
|||
iced_core::{Border, Length, Rectangle as IcedRectangle, alignment::Horizontal},
|
||||
iced_widget::{self, Column, Row, text::Style as TextStyle},
|
||||
theme,
|
||||
widget::{button, divider, horizontal_space, icon::from_name, text},
|
||||
widget::{button, divider, icon::from_name, space, text},
|
||||
};
|
||||
use smithay::{
|
||||
backend::{
|
||||
|
|
@ -392,7 +392,7 @@ impl Program for ContextMenu {
|
|||
match item {
|
||||
Item::Separator => divider::horizontal::light().into(),
|
||||
Item::Submenu { title, .. } => Row::with_children(vec![
|
||||
horizontal_space().width(16).into(),
|
||||
space::horizontal().width(16).into(),
|
||||
text::body(title).width(mode).into(),
|
||||
from_name("go-next-symbolic")
|
||||
.size(16)
|
||||
|
|
@ -425,7 +425,7 @@ impl Program for ContextMenu {
|
|||
}))
|
||||
.into()
|
||||
} else {
|
||||
horizontal_space().width(16).into()
|
||||
space::horizontal().width(16).into()
|
||||
},
|
||||
text::body(title)
|
||||
.width(mode)
|
||||
|
|
@ -441,7 +441,7 @@ impl Program for ContextMenu {
|
|||
theme::Text::Default
|
||||
})
|
||||
.into(),
|
||||
horizontal_space().width(16).into(),
|
||||
space::horizontal().width(16).into(),
|
||||
];
|
||||
if let Some(shortcut) = shortcut.as_ref() {
|
||||
components.push(
|
||||
|
|
@ -479,6 +479,7 @@ impl Program for ContextMenu {
|
|||
let cosmic = theme.cosmic();
|
||||
let component = &cosmic.background.component;
|
||||
iced_widget::container::Style {
|
||||
snap: true,
|
||||
icon_color: Some(cosmic.accent.base.into()),
|
||||
text_color: Some(component.on.into()),
|
||||
background: Some(Background::Color(component.base.into())),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue