x11: Workaround nvidia driver lacking DRI
feat(mouse area): add double click
mouse area: add double click
compositor: Add code to extract adapter from x11
refactor: Extract ids_from_dev from wayland specific code
wayland: Don't crash if libwayland isn't available
feat(sctk): support for overflow widget
sctk: Fixes for cursor icon
* With multiple windows, `SetCursor` is only sent for the focused
window. Fixing a flicker between icons when two windows are using
different cursors.
* If there is a drag surface, let that surface set the cursor. And not
any other.
* Set cursor on `enter`, and when switching between CSDs and app area.
Fixes https://github.com/pop-os/libcosmic/issues/533.
improv(sctk): per-surface cursor position tracking
feat(sctk): support ShowWindowMenu
Make text wrap configurable
fix(core): state order and handling of new trees
fix: settings.decorations enables SSD
refactor(sctk): convert window actions
fix: enable the tokio feature for accesskit_unix
fix: only try to connect to clipboard if on linux
iced_wgpu: don't query Wayland on macos
Update `window_clipboard`
sctk: Unmap subsurfaces instead of immediately destroying them
Destroying a surface is immediate, rather than synchronized with
commits.
This fixes a flickering behavior with drag and drop in
cosmic-workspaces.
sctk: Add alpha setting to `Subsurface` widget
sctk: Update `sctk`, `wayland-protocols`
Update for cosmic-text undefined buffer size
Adapt to cosmic-text undefined width change
fix: unset VK_LOADER_DRIVERS_DISABLE after enumeration
Allows applications to be launched on the NVIDIA GPU with Vulkan support
Adapt to new cosmic-text
wgpu: Fix wayland device id conversion
wgpu: Fix querying adapter, even if we already have one
wgpu: fix nvidia gpu powering up in hybrid setups
cargo fmt
fix: refactor dnd impl to support responsive widget
fix: update read and write methods so they don't recurse
fix(core): replace debug_assert in diff
fix: avoid with_borrow_mut
fix: better handling of state tree
This persists widget state associated with widgets assigned custom IDs even when the tree structure changes, but resets state if the custom ID is not found.
fix: emit Event::Resized to fix nav bar in cosmic-settings
fix(image): guess the image format before decoding
iced_wgpu: Query wayland for the device to use, if possible
sctk: Support `start_drag` with drags started from touch events
sctk: Add touch support
fix: update widnow-clipboard tag
fix: clean up dnd surfaces when a window is removed
Adjust to line ending needing to be specified as part of cosmic_text::BufferLine
sctk: Add support for drag-and-drop surface offsets
This adds an offset `Vector` as an argument to `on_drag`, and allows
passing an offset to `start_drag`.
Some applications using drag and drop want the top left corner of the
drag surface (as happens without an offset). But others want the drag
surface to be offset based on where the cursor is on the widget when
starting the drag. This can just be `-1 * offset`, but may be scaled if
the drag surface is a different size from the original widget.
fix(sctk): nested popup parent
feat(mouseare): mouse enter and exit
fix(tiny_skia): damage
fix(scrollable): filter scroll events in the wrong direction
sctk: Use empty input region for subsurfaces
This seems to work, and is a better way to deal with subsurface input if
there aren't any problems. This way, input events simply go to the
parent surface, so we don't have to deal with various edge cases related
to that. (Though for compositor-side issues, we still need to fix those
for other clients.)
This helps with an issue with drag-and-drop and subsurfaces on Smithay,
and a different issue on Kwin (in KDE 5.27, at least).
Send `DataSource` events to all surfaces
Previously these events are directed to the first surface, then removed
from `sctk_events`. Which is definitely not right.
slider & toggler roundness
Update window_clipboard to pop-dnd-4
fix(tiny-skia): non-simple border scaling
the issue can be seen with sharp corners when using the screenshot portal with scaling
Add read_primary/write_primary
chore: update tag
fix: translate offer positions in scrollable
fix(winit multi-window): handle exit_on_close request
fix(scrollable): pass child layout when calculating drag destinations
fix(container): id and set_id should use content
Clean up after lock surfaces are destroyed
Call unlock on session lock
chore: update tag
fixes for dnd
sctk: Fix handling of DnD with subsurfaces (#122)
Map subsurface to parent and add offset.
refactor: remove Sync bound for Message
fix: pass correct state and layout for container widgets
fix: docs
feat: update advertised drag destinations after rebuilding an interface
fix: color format & multi-window
fix: doc
feat: winit dnd
fix: ambiguous import
chore: reexport mime from window_clipboard
chore: use tag
clippy
feat: add actions and commands for new clipboard methods
cleanup docs
feat: custom mime types for Clipboard
sctk: Fix handling of layer surface `pointer_interactivity` (#115)
A null `region` represents an infinite region (the default). To set an
empty region, we need to create a `wl_region`.
fix(tiny_skia): disable shadows due to rendering glitch
fix(winit): add static lifetimes to multi-window application update
fix(winit): add static lifetimes to application update
Use `TypeId` to identify `subscription::Map`
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| arc | ||
| bezier_tool | ||
| changelog | ||
| checkbox | ||
| clock | ||
| color_palette | ||
| combo_box | ||
| counter | ||
| custom_quad | ||
| custom_shader | ||
| custom_widget | ||
| delineate | ||
| download_progress | ||
| editor | ||
| events | ||
| exit | ||
| ferris | ||
| gallery | ||
| game_of_life | ||
| geometry | ||
| gradient | ||
| integration | ||
| layout | ||
| lazy | ||
| loading_spinners | ||
| loupe | ||
| markdown | ||
| modal | ||
| multi_window | ||
| multitouch | ||
| pane_grid | ||
| pick_list | ||
| pokedex | ||
| progress_bar | ||
| qr_code | ||
| screenshot | ||
| scrollable | ||
| sctk_drag | ||
| sctk_lazy | ||
| sctk_session_lock | ||
| sctk_subsurface | ||
| sctk_subsurface_gst | ||
| sctk_todos | ||
| sierpinski_triangle | ||
| slider | ||
| solar_system | ||
| stopwatch | ||
| styling | ||
| svg | ||
| table | ||
| the_matrix | ||
| toast | ||
| todos | ||
| tooltip | ||
| tour | ||
| vectorial_text | ||
| websocket | ||
| README.md | ||
Examples
Iced moves fast and the master branch can contain breaking changes! If you want to browse examples that are compatible with the latest release,
then switch to the latest branch.
Tour
A simple UI tour that can run both on native platforms and the web! It showcases different widgets that can be built using Iced.
The main file contains all the code of the example! All the cross-platform GUI is defined in terms of state, messages, update logic and view logic.
You can run the native version with cargo run:
cargo run --package tour
Todos
A todos tracker inspired by TodoMVC. It showcases dynamic layout, text input, checkboxes, scrollables, icons, and async actions! It automatically saves your tasks in the background, even if you did not finish typing them.
The example code is located in the main file.
You can run the native version with cargo run:
cargo run --package todos
Game of Life
An interactive version of the Game of Life, invented by John Horton Conway.
It runs a simulation in a background thread while allowing interaction with a Canvas that displays an infinite grid with zooming, panning, and drawing support.
The relevant code is located in the main file.
You can run it with cargo run:
cargo run --package game_of_life
Styling
An example showcasing custom styling with a light and dark theme.
The example code is located in the main file.
You can run it with cargo run:
cargo run --package styling
Extras
A bunch of simpler examples exist:
bezier_tool, a Paint-like tool for drawing Bézier curves using theCanvaswidget.clock, an application that uses theCanvaswidget to draw a clock and its hands to display the current time.color_palette, a color palette generator based on a user-defined root color.counter, the classic counter example explained in theREADME.custom_widget, a demonstration of how to build a custom widget that draws a circle.download_progress, a basic application that asynchronously downloads a dummy file of 100 MB and tracks the download progress.events, a log of native events displayed using a conditionalSubscription.geometry, a custom widget showcasing how to draw geometry with theMesh2Dprimitive iniced_wgpu.integration, a demonstration of how to integrate Iced in an existingwgpuapplication.pane_grid, a grid of panes that can be split, resized, and reorganized.pick_list, a dropdown list of selectable options.pokedex, an application that displays a random Pokédex entry (sprite included!) by using the PokéAPI.progress_bar, a simple progress bar that can be filled by using a slider.scrollable, a showcase of various scrollable content configurations.sierpinski_triangle, a sierpiński triangle Emulator, useCanvasandSlider.solar_system, an animated solar system drawn using theCanvaswidget and showcasing how to compose different transforms.stopwatch, a watch with start/stop and reset buttons showcasing how to listen to time.svg, an application that renders the Ghostscript Tiger by leveraging theSvgwidget.
All of them are packaged in their own crate and, therefore, can be run using cargo:
cargo run --package <example>
Coffee
Since Iced was born in May 2019, it has been powering the user interfaces in Coffee, an experimental 2D game engine.