Skip to content

Commit

Permalink
chore: update iced
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Dec 4, 2023
1 parent acb5aa6 commit 6b358cd
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 45 deletions.
40 changes: 0 additions & 40 deletions examples/cosmic/src/window/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,49 +475,9 @@ impl State {
&self.entry_value,
)
.on_input(Message::InputChanged)
// .on_submit(Message::Activate(None))
.size(20)
.id(INPUT_ID.clone())
.into(),
cosmic::widget::text_input("test", &self.entry_value)
.on_clear(Message::InputChanged("".to_string()))
.width(Length::Fill)
.on_input(Message::InputChanged)
.into(),
cosmic::widget::text_input("test", &self.entry_value)
.width(Length::Fixed(600.0))
.padding(32)
.on_input(Message::InputChanged)
.into(),
cosmic::widget::search_input("test", &self.entry_value)
.on_clear(Message::InputChanged("".to_string()))
.width(Length::Fill)
.on_input(Message::InputChanged)
.into(),
cosmic::widget::text_input("test", &self.entry_value)
.width(Length::Fixed(600.0))
.on_input(Message::InputChanged)
.into(),
cosmic::widget::search_input("test", &self.entry_value)
.width(Length::Fixed(100.0))
.on_input(Message::InputChanged)
.into(),
cosmic::widget::search_input("test", &self.entry_value)
.on_clear(Message::InputChanged("".to_string()))
.padding([24, 48])
.width(Length::Fixed(400.0))
.on_input(Message::InputChanged)
.into(),
cosmic::widget::search_input("test", &self.entry_value)
.on_clear(Message::InputChanged("".to_string()))
.width(Length::Fixed(400.0))
.on_input(Message::InputChanged)
.into(),
cosmic::widget::search_input("test", &self.entry_value)
.on_clear(Message::InputChanged("".to_string()))
.width(Length::Fixed(800.0))
.on_input(Message::InputChanged)
.into(),
self.color_picker_model
.picker_button(Message::ColorPickerUpdate, None)
.width(Length::Fixed(128.0))
Expand Down
2 changes: 1 addition & 1 deletion iced
Submodule iced updated 55 files
+1 −1 Cargo.toml
+1 −1 README.md
+17 −0 core/src/event/wayland/mod.rs
+2 −1 core/src/overlay.rs
+16 −4 core/src/overlay/element.rs
+5 −4 core/src/overlay/group.rs
+20 −0 core/src/rectangle.rs
+3 −0 core/src/renderer/null.rs
+4 −1 core/src/text.rs
+4 −1 core/src/widget/text.rs
+8 −13 examples/custom_shader/src/main.rs
+3 −3 examples/custom_shader/src/scene.rs
+13 −8 examples/custom_shader/src/scene/pipeline.rs
+1 −1 examples/integration/Cargo.toml
+2 −0 examples/modal/src/main.rs
+1 −1 examples/progress_bar/README.md
+1 −0 examples/toast/src/main.rs
+24 −1 futures/src/runtime.rs
+16 −10 graphics/src/primitive.rs
+6 −0 graphics/src/renderer.rs
+6 −1 graphics/src/text.rs
+10 −3 renderer/src/lib.rs
+34 −1 runtime/src/command.rs
+8 −1 runtime/src/command/action.rs
+8 −7 runtime/src/overlay/nested.rs
+23 −7 runtime/src/user_interface.rs
+5 −0 sctk/src/application.rs
+10 −5 src/lib.rs
+31 −23 tiny_skia/src/backend.rs
+9 −6 tiny_skia/src/geometry.rs
+4 −4 wgpu/src/backend.rs
+9 −6 wgpu/src/geometry.rs
+14 −8 wgpu/src/layer.rs
+17 −0 wgpu/src/layer/pipeline.rs
+5 −0 wgpu/src/layer/text.rs
+2 −3 wgpu/src/primitive/pipeline.rs
+14 −9 wgpu/src/text.rs
+3 −1 widget/src/checkbox.rs
+11 −9 widget/src/column.rs
+2 −1 widget/src/combo_box.rs
+21 −19 widget/src/container.rs
+3 −2 widget/src/lazy.rs
+2 −1 widget/src/lazy/component.rs
+4 −2 widget/src/lazy/responsive.rs
+2 −0 widget/src/overlay/menu.rs
+6 −2 widget/src/pick_list.rs
+2 −1 widget/src/radio.rs
+11 −9 widget/src/row.rs
+9 −1 widget/src/scrollable.rs
+0 −1 widget/src/shader.rs
+2 −1 widget/src/text_editor.rs
+27 −30 widget/src/text_input/text_input.rs
+2 −1 widget/src/toggler.rs
+10 −1 widget/src/tooltip.rs
+6 −1 winit/src/application.rs
1 change: 1 addition & 0 deletions src/widget/context_drawer/overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ where
renderer: &crate::Renderer,
bounds: Size,
position: Point,
_translation: iced::Vector,
) -> layout::Node {
let limits = layout::Limits::new(Size::ZERO, bounds)
.width(self.width)
Expand Down
2 changes: 2 additions & 0 deletions src/widget/dropdown/menu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ impl<'a, Message> iced_core::Overlay<Message, crate::Renderer> for Overlay<'a, M
renderer: &crate::Renderer,
bounds: Size,
position: Point,
_translation: iced::Vector,
) -> layout::Node {
let space_below = bounds.height - (position.y + self.target_height);
let space_above = position.y;
Expand Down Expand Up @@ -514,6 +515,7 @@ impl<'a, S: AsRef<str>, Message> Widget<Message, crate::Renderer> for List<'a, S
},
bounds.position(),
color,
*viewport,
);
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/widget/dropdown/multi/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ impl<'a, Message> iced_core::Overlay<Message, crate::Renderer> for Overlay<'a, M
renderer: &crate::Renderer,
bounds: Size,
position: Point,
_translation: iced::Vector,
) -> layout::Node {
let space_below = bounds.height - (position.y + self.target_height);
let space_above = position.y;
Expand Down Expand Up @@ -603,6 +604,7 @@ where
},
bounds.position(),
color,
*viewport,
);
}

Expand Down Expand Up @@ -651,6 +653,7 @@ where
},
bounds.position(),
appearance.description_color,
*viewport,
);
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/widget/dropdown/multi/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl<'a, S: AsRef<str>, Message: 'a, Item: Clone + PartialEq + 'static>
_style: &iced_core::renderer::Style,
layout: Layout<'_>,
cursor: mouse::Cursor,
_viewport: &Rectangle,
viewport: &Rectangle,
) {
let font = self
.font
Expand All @@ -168,6 +168,7 @@ impl<'a, S: AsRef<str>, Message: 'a, Item: Clone + PartialEq + 'static>
.as_ref()
.and_then(|id| self.selections.get(id)),
tree.state.downcast_ref::<State<Item>>(),
viewport,
);
}

Expand Down Expand Up @@ -486,6 +487,7 @@ pub fn draw<'a, S, Item: Clone + PartialEq + 'static>(
font: crate::font::Font,
selected: Option<&'a S>,
state: &'a State<Item>,
viewport: &Rectangle,
) where
S: AsRef<str> + 'a,
{
Expand Down Expand Up @@ -547,6 +549,7 @@ pub fn draw<'a, S, Item: Clone + PartialEq + 'static>(
},
bounds.position(),
style.text_color,
*viewport,
);
}
}
5 changes: 4 additions & 1 deletion src/widget/dropdown/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl<'a, S: AsRef<str>, Message: 'a> Widget<Message, crate::Renderer> for Dropdo
_style: &iced_core::renderer::Style,
layout: Layout<'_>,
cursor: mouse::Cursor,
_viewport: &Rectangle,
viewport: &Rectangle,
) {
let font = self
.font
Expand All @@ -209,6 +209,7 @@ impl<'a, S: AsRef<str>, Message: 'a> Widget<Message, crate::Renderer> for Dropdo
font,
self.selected.and_then(|id| self.selections.get(id)),
tree.state.downcast_ref::<State>(),
viewport,
);
}

Expand Down Expand Up @@ -479,6 +480,7 @@ pub fn draw<'a, S>(
font: crate::font::Font,
selected: Option<&'a S>,
state: &'a State,
viewport: &Rectangle,
) where
S: AsRef<str> + 'a,
{
Expand Down Expand Up @@ -538,6 +540,7 @@ pub fn draw<'a, S>(
},
bounds.position(),
style.text_color,
*viewport,
);
}
}
8 changes: 7 additions & 1 deletion src/widget/menu/menu_inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,13 @@ where
Renderer: renderer::Renderer,
Renderer::Theme: StyleSheet,
{
fn layout(&mut self, renderer: &Renderer, bounds: Size, position: Point) -> Node {
fn layout(
&mut self,
renderer: &Renderer,
bounds: Size,
position: Point,
_translation: iced::Vector,
) -> Node {
// layout children
let state = self.tree.state.downcast_mut::<MenuBarState>();
let overlay_offset = Point::ORIGIN - position;
Expand Down
8 changes: 7 additions & 1 deletion src/widget/popover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,13 @@ impl<'a, 'b, Message, Renderer> overlay::Overlay<Message, Renderer>
where
Renderer: iced_core::Renderer,
{
fn layout(&mut self, renderer: &Renderer, bounds: Size, mut position: Point) -> layout::Node {
fn layout(
&mut self,
renderer: &Renderer,
bounds: Size,
mut position: Point,
_translation: iced::Vector,
) -> layout::Node {
let limits = layout::Limits::new(Size::UNIT, bounds);
let mut node = self
.content
Expand Down
1 change: 1 addition & 0 deletions src/widget/segmented_button/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ where
},
bounds.position(),
status_appearance.text_color,
*viewport,
);
}

Expand Down
3 changes: 3 additions & 0 deletions src/widget/text_input/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,7 @@ pub fn draw<'a, Message>(
},
bounds.position(),
appearance.label_color,
*viewport,
);
}
let mut child_index = 0;
Expand Down Expand Up @@ -2044,6 +2045,7 @@ pub fn draw<'a, Message>(
},
bounds.position(),
color,
*viewport,
);
};

Expand Down Expand Up @@ -2091,6 +2093,7 @@ pub fn draw<'a, Message>(
},
helper_text_layout.bounds().position(),
appearance.text_color,
*viewport,
);
}
}
Expand Down

0 comments on commit 6b358cd

Please sign in to comment.