Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
72630f8
Add `popover` widget
hecrj Sep 9, 2026
68d95ef
Redesign `popover` to a controlled widget
hecrj Sep 9, 2026
1bc1026
Make `popover` always display its overlay
hecrj Sep 9, 2026
7c25b9d
Center the popover example and unify the trigger button
hecrj Sep 9, 2026
399c94e
Add missing `mouse_interaction` to the popover `Widget` impl
hecrj Sep 9, 2026
fe58804
Make the popover's popup an `Option` (`Some` = open, `None` = closed)
hecrj Sep 9, 2026
1328ef7
Simplify the popover example view
hecrj Sep 9, 2026
325f19b
Inline the `is_press` helper
hecrj Sep 9, 2026
d79d5fd
Run `cargo fmt` on the popover changes
hecrj Sep 9, 2026
cbd121c
Add `Position::Auto` (the default) and a `position` setter
hecrj Sep 9, 2026
5862b3e
Clarify the `position` setter docs
hecrj Sep 9, 2026
26105ec
Drop the `position` argument from `popover` and `Popover::new`
hecrj Sep 9, 2026
d005aac
Remove `padding` from `popover`; delegate layout directly to the popup
hecrj Sep 9, 2026
1e577a1
Fix the `Overlay`'s use of the popup layout
hecrj Sep 9, 2026
c09cfec
Add `overlay::Position` and move popup positioning into `Position::re…
hecrj Sep 9, 2026
9f2d9e2
Add a `position` method to `tooltip`; drop it from `new`/`tooltip`
hecrj Sep 9, 2026
2d24c2e
Remove `padding` and `style` from `tooltip`; delegate to the content
hecrj Sep 9, 2026
e69b303
Drop the `padding` argument from `Position::resolve`; test it directly
hecrj Sep 9, 2026
62a1b9b
Fold `popover` and `tooltip` into the `tour` example
hecrj Sep 9, 2026
5cc8c4e
Style the `tooltip` in the `tour` example
hecrj Sep 9, 2026
1445f6e
Make `Position::Auto` account for the popup size
hecrj Sep 9, 2026
a01a423
Make the `position` module private; tidy the popup overlays
hecrj Sep 9, 2026
cad3321
Move the `snap_within_viewport` logic into `Position::resolve`
hecrj Sep 9, 2026
a336a50
Drop the `unreachable!`s from `Position::resolve`
hecrj Sep 9, 2026
ca98876
Use `unwrap_or` in `Side::with_most_available_space`
hecrj Sep 9, 2026
5161026
Drop the redundant `position` argument from `Position::resolve`
hecrj Sep 9, 2026
6be0388
Make the `inputs` a bunch of `const` in `overlay::position`
hecrj Sep 9, 2026
145d452
Implement `Overlay::overlay` for `popover`
hecrj Sep 9, 2026
eebc0cc
Add a `preference: Side` to the `Position::Auto` variant
hecrj Sep 9, 2026
4d550e4
Leverage `opaque` in the tour; update the popover contents unconditio…
hecrj Sep 9, 2026
6af5546
Remove the `Unreleased` section from the changelog
hecrj Sep 9, 2026
39fd3a2
Link `unreleased changes` in the changelog to the compare view
hecrj Sep 9, 2026
9f8c829
Move `opaque` into its own module; make popover bases opaque by default
hecrj Sep 9, 2026
780681f
Make the popover's `passthrough` method take a flag
hecrj Sep 9, 2026
0c53322
Clarify the docs of the popover's `passthrough` method
hecrj Sep 9, 2026
9a3874f
Wrap the overlay instead of the base in `popover`
hecrj Sep 9, 2026
fd1a945
Move the `popover` and `layout` integration tests to the `widget` crate
hecrj Sep 10, 2026
33f4fca
Disable the `advanced` feature in the `iced` dev-dependency
hecrj Sep 10, 2026
026d59b
Adapt `popover` and `tooltip` to the new `overlay` API
hecrj Sep 13, 2026
16ebc84
Bound `core::Renderer` instead of `text::Renderer` for `popover` widget
hecrj Sep 16, 2026
9f78c33
Merge branch 'master' into popover-widget
hecrj Sep 16, 2026
6e93023
Merge master into popover-widget
hecrj Oct 6, 2026
58b2c8f
Drop `passthrough` in `popover` widget
hecrj Oct 6, 2026
690d5e6
Use the full viewport in the popover overlay
hecrj Oct 6, 2026
47e7664
Fix formatting and broken intra-doc links
hecrj Oct 6, 2026
492dd2d
Use `opaque` in `popover` helper
hecrj Oct 6, 2026
04f3de3
Add `passthrough` method to `popover` widget
hecrj Oct 7, 2026
e1170d7
Fix `popover` tests
hecrj Oct 7, 2026
ca5e23e
Remove superfluous `Renderer: core::Renderer` bounds
hecrj Oct 7, 2026
f37dc11
Remove `From<Popover> for Element` implementation
hecrj Oct 7, 2026
bbd4c26
Invalidate layout with diffing in `Component` overlay
hecrj Oct 7, 2026
8836286
Make `translation` take `Size` as `bounds` in `scrollable`
hecrj Oct 7, 2026
6a351fe
Use `viewport` for positioning in `popover`
hecrj Oct 7, 2026
8ea4ad6
Merge branch 'master' into popover-widget
hecrj Oct 31, 2026
2e08a73
Add `capture_scroll` to `opaque` and `popover` widgets
hecrj Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
This file does not track [unreleased changes][Unreleased].

## [0.14.0] - 2025-12-07
### Added
Expand Down
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
iced_widget.workspace = true
iced_winit.workspace = true

iced_devtools.workspace = true

Check warning on line 104 in Cargo.toml

View workflow job for this annotation

GitHub Actions / all (ubuntu-latest, beta)

unused dependency `iced_devtools`

Check warning on line 104 in Cargo.toml

View workflow job for this annotation

GitHub Actions / all (macOS-latest, beta)

unused dependency `iced_devtools`

Check warning on line 104 in Cargo.toml

View workflow job for this annotation

GitHub Actions / all (windows-latest, beta)

unused dependency `iced_devtools`

Check warning on line 104 in Cargo.toml

View workflow job for this annotation

GitHub Actions / all (ubuntu-latest, beta)

unused dependency `iced_devtools`

Check warning on line 104 in Cargo.toml

View workflow job for this annotation

GitHub Actions / all (macOS-latest, beta)

unused dependency `iced_devtools`

Check warning on line 104 in Cargo.toml

View workflow job for this annotation

GitHub Actions / all (windows-latest, beta)

unused dependency `iced_devtools`
iced_devtools.optional = true

iced_tester.workspace = true
Expand All @@ -117,13 +117,11 @@

[dev-dependencies]
criterion = "0.5"
iced.workspace = true
iced_test.workspace = true
iced_wgpu.workspace = true
iced_renderer.workspace = true

iced.workspace = true
iced.features = ["advanced"]

[[bench]]
name = "wgpu"
harness = false
Expand Down
5 changes: 1 addition & 4 deletions core/src/layout/flex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ pub fn resolve<Message, Theme, Renderer>(
children: &mut [widget::Tree],
items: &mut [impl Widget<Message, Theme, Renderer>],
cache: &mut Cache,
) -> Size
where
Renderer: crate::Renderer,
{
) -> Size {
let limits = limits.width(width).height(height).shrink(padding);
let total_spacing = spacing * items.len().saturating_sub(1) as f32;
let max_cross = axis.cross(limits.max);
Expand Down
10 changes: 2 additions & 8 deletions core/src/overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ use crate::widget::Tree;
use crate::{Event, Layout, Rectangle, Shell, Size, Vector, Widget};

/// An interactive component that can be displayed on top of other widgets.
pub trait Overlay<Message, Theme, Renderer>
where
Renderer: crate::Renderer,
{
pub trait Overlay<Message, Theme, Renderer> {
/// Draws the [`Overlay`] using the associated `Renderer`.
///
/// Implementors are expected to call
Expand Down Expand Up @@ -86,10 +83,7 @@ pub fn from_children<'a, Message, Theme, Renderer>(
viewport: &Rectangle,
translation: Vector,
window: Size,
) -> Vec<Element<'a, Message, Theme, Renderer>>
where
Renderer: crate::Renderer,
{
) -> Vec<Element<'a, Message, Theme, Renderer>> {
children
.iter_mut()
.zip(layout.iter_mut(&mut tree.children))
Expand Down
10 changes: 2 additions & 8 deletions core/src/overlay/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ pub struct Element<'a, Message, Theme, Renderer> {
overlay: Box<dyn Overlay<Message, Theme, Renderer> + 'a>,
}

impl<'a, Message, Theme, Renderer> Element<'a, Message, Theme, Renderer>
where
Renderer: crate::Renderer,
{
impl<'a, Message, Theme, Renderer> Element<'a, Message, Theme, Renderer> {
/// Creates a new [`Element`] containing the given [`Overlay`].
pub fn new(overlay: Box<dyn Overlay<Message, Theme, Renderer> + 'a>) -> Self {
Self { overlay }
Expand Down Expand Up @@ -58,10 +55,7 @@ impl<'a, A, B, Theme, Renderer> Map<'a, A, B, Theme, Renderer> {
}
}

impl<A, B, Theme, Renderer> Overlay<B, Theme, Renderer> for Map<'_, A, B, Theme, Renderer>
where
Renderer: crate::Renderer,
{
impl<A, B, Theme, Renderer> Overlay<B, Theme, Renderer> for Map<'_, A, B, Theme, Renderer> {
fn operate(&mut self, renderer: &Renderer, operation: &mut dyn widget::Operation) {
self.content.operate(renderer, operation);
}
Expand Down
27 changes: 6 additions & 21 deletions core/src/overlay/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ pub struct Group<'a, Message, Theme, Renderer> {

fn sort_overlays<'a, Message, Theme, Renderer>(
children: &mut [overlay::Element<'a, Message, Theme, Renderer>],
) where
Renderer: renderer::Renderer,
{
) {
use std::cmp;

children.sort_by(|a, b| {
Expand All @@ -25,10 +23,7 @@ fn sort_overlays<'a, Message, Theme, Renderer>(
});
}

impl<'a, Message, Theme, Renderer> Group<'a, Message, Theme, Renderer>
where
Renderer: renderer::Renderer,
{
impl<'a, Message, Theme, Renderer> Group<'a, Message, Theme, Renderer> {
/// Creates a [`Group`] container for the given overlays.
///
/// The overlays are sorted by their
Expand All @@ -53,9 +48,7 @@ where
theme: &Theme,
style: &renderer::Style,
cursor: mouse::Cursor,
) where
Renderer: renderer::Renderer,
{
) {
for element in children {
// TODO: Get rid of cursor argument in `draw`
let is_over = cursor.position().is_some_and(|cursor_position| {
Expand Down Expand Up @@ -97,9 +90,7 @@ where
children: &mut [overlay::Element<'_, Message, Theme, Renderer>],
renderer: &Renderer,
operation: &mut dyn widget::Operation,
) where
Renderer: renderer::Renderer,
{
) {
for element in children {
let overlay = element.as_overlay_mut();

Expand Down Expand Up @@ -132,10 +123,7 @@ where
cursor: mouse::Cursor,
renderer: &Renderer,
shell: &mut Shell<'_, Message>,
) -> bool
where
Renderer: renderer::Renderer,
{
) -> bool {
let mut is_over = false;

for element in children {
Expand Down Expand Up @@ -196,10 +184,7 @@ where
children: &mut [overlay::Element<'_, Message, Theme, Renderer>],
cursor: mouse::Cursor,
renderer: &Renderer,
) -> mouse::Interaction
where
Renderer: renderer::Renderer,
{
) -> mouse::Interaction {
children
.iter_mut()
.map(|element| {
Expand Down
4 changes: 1 addition & 3 deletions core/src/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ where

impl<T, Message, Theme, Renderer> Widget<Message, Theme, Renderer> for &mut T
where
Renderer: crate::Renderer,
T: Widget<Message, Theme, Renderer>,
{
fn size(&self) -> Size<Length> {
Expand Down Expand Up @@ -316,7 +315,7 @@ where
B: 'static,
F: Fn(A) -> B,
Theme: 'static,
Renderer: crate::Renderer + 'static,
Renderer: 'static,
{
fn size(&self) -> Size<Length> {
self.widget.size()
Expand Down Expand Up @@ -433,7 +432,6 @@ where
impl<T, Message, Theme, Renderer> Widget<Message, Theme, Renderer> for Option<T>
where
T: Widget<Message, Theme, Renderer>,
Renderer: crate::Renderer,
{
fn size(&self) -> Size<Length> {
let Some(widget) = self else {
Expand Down
17 changes: 4 additions & 13 deletions core/src/widget/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ impl Tree {
}

/// Creates a new [`Tree`] for the provided [`Widget`].
pub fn new<Message, Theme, Renderer>(widget: &impl Widget<Message, Theme, Renderer>) -> Self
where
Renderer: crate::Renderer,
{
pub fn new<Message, Theme, Renderer>(widget: &impl Widget<Message, Theme, Renderer>) -> Self {
Self {
tag: widget.tag(),
state: widget.state(),
Expand All @@ -62,9 +59,7 @@ impl Tree {
pub fn diff<Message, Theme, Renderer>(
&mut self,
new: &mut impl Widget<Message, Theme, Renderer>,
) where
Renderer: crate::Renderer,
{
) {
if self.tag != new.tag() {
*self = Self::new(new);
}
Expand All @@ -76,9 +71,7 @@ impl Tree {
pub fn diff_children<Message, Theme, Renderer>(
&mut self,
new_children: &mut [impl Widget<Message, Theme, Renderer>],
) where
Renderer: crate::Renderer,
{
) {
diff_children(&mut self.children, new_children);
}

Expand All @@ -98,9 +91,7 @@ impl Tree {
pub fn diff_children<Message, Theme, Renderer>(
old_children: &mut Vec<Tree>,
new_children: &mut [impl Widget<Message, Theme, Renderer>],
) where
Renderer: crate::Renderer,
{
) {
diff_children_custom(old_children, new_children, Tree::diff, |widget| {
Tree::new(widget)
});
Expand Down
5 changes: 2 additions & 3 deletions examples/editor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,9 @@ fn action<'a, Message: Clone + 'a>(
if let Some(on_press) = on_press {
tooltip(
action.on_press(on_press),
label,
tooltip::Position::FollowCursor,
container(label).padding(10).style(container::rounded_box),
)
.style(container::rounded_box)
.position(tooltip::Position::FollowCursor)
.boxed()
} else {
action.style(button::secondary).boxed()
Expand Down
8 changes: 4 additions & 4 deletions examples/table/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ impl Table {
tooltip(
slider(range.clone(), x, move |x| on_change(x, y)),
text!("{x:.0}px").font(Font::MONOSPACE).size(10),
tooltip::Position::Left
),
)
.position(tooltip::Position::Left),
tooltip(
slider(range, y, move |y| on_change(x, y)),
text!("{y:.0}px").font(Font::MONOSPACE).size(10),
tooltip::Position::Right
),
)
.position(tooltip::Position::Right),
]
.spacing(10)
.align_y(Center)
Expand Down
10 changes: 0 additions & 10 deletions examples/tooltip/Cargo.toml

This file was deleted.

14 changes: 0 additions & 14 deletions examples/tooltip/README.md

This file was deleted.

73 changes: 0 additions & 73 deletions examples/tooltip/src/main.rs

This file was deleted.

Loading
Loading