A cross-platform GUI library for Rust, inspired by Elm

Overview

Iced

Documentation Crates.io License Downloads Test Status Discord Server

A cross-platform GUI library for Rust focused on simplicity and type-safety. Inspired by Elm.

Features

Iced is currently experimental software. Take a look at the roadmap, check out the issues, and feel free to contribute!

Installation

Add iced as a dependency in your Cargo.toml:

iced = "0.4"

If your project is using a Rust edition older than 2021, then you will need to set resolver = "2" in the [package] section as well.

Iced moves fast and the master branch can contain breaking changes! If you want to learn about a specific release, check out the release list.

Overview

Inspired by The Elm Architecture, Iced expects you to split user interfaces into four different concepts:

  • State — the state of your application
  • Messages — user interactions or meaningful events that you care about
  • View logic — a way to display your state as widgets that may produce messages on user interaction
  • Update logic — a way to react to messages and update your state

We can build something to see how this works! Let's say we want a simple counter that can be incremented and decremented using two buttons.

We start by modelling the state of our application:

use iced::button;

struct Counter {
    // The counter value
    value: i32,

    // The local state of the two buttons
    increment_button: button::State,
    decrement_button: button::State,
}

Next, we need to define the possible user interactions of our counter: the button presses. These interactions are our messages:

#[derive(Debug, Clone, Copy)]
pub enum Message {
    IncrementPressed,
    DecrementPressed,
}

Now, let's show the actual counter by putting it all together in our view logic:

use iced::{Button, Column, Text};

impl Counter {
    pub fn view(&mut self) -> Column<Message> {
        // We use a column: a simple vertical layout
        Column::new()
            .push(
                // The increment button. We tell it to produce an
                // `IncrementPressed` message when pressed
                Button::new(&mut self.increment_button, Text::new("+"))
                    .on_press(Message::IncrementPressed),
            )
            .push(
                // We show the value of the counter here
                Text::new(self.value.to_string()).size(50),
            )
            .push(
                // The decrement button. We tell it to produce a
                // `DecrementPressed` message when pressed
                Button::new(&mut self.decrement_button, Text::new("-"))
                    .on_press(Message::DecrementPressed),
            )
    }
}

Finally, we need to be able to react to any produced messages and change our state accordingly in our update logic:

impl Counter {
    // ...

    pub fn update(&mut self, message: Message) {
        match message {
            Message::IncrementPressed => {
                self.value += 1;
            }
            Message::DecrementPressed => {
                self.value -= 1;
            }
        }
    }
}

And that's everything! We just wrote a whole user interface. Iced is now able to:

  1. Take the result of our view logic and layout its widgets.
  2. Process events from our system and produce messages for our update logic.
  3. Draw the resulting user interface.

Browse the documentation and the examples to learn more!

Implementation details

Iced was originally born as an attempt at bringing the simplicity of Elm and The Elm Architecture into Coffee, a 2D game engine I am working on.

The core of the library was implemented during May 2019 in this pull request. The first alpha version was eventually released as a renderer-agnostic GUI library. The library did not provide a renderer and implemented the current tour example on top of ggez, a game library.

Since then, the focus has shifted towards providing a batteries-included, end-user-oriented GUI library, while keeping the ecosystem modular:

The Iced Ecosystem

Troubleshooting

GraphicsAdapterNotFound

This occurs when the selected built-in renderer is not able to create a context.

Often this will occur while using iced_wgpu as the renderer without supported hardware (needs Vulkan, Metal or DX12). In this case, you could try using the iced_glow renderer:

First, check if it works with

$ cargo run --features iced/glow --package game_of_life

and then use it in your project with

iced = { version = "0.4", default-features = false, features = ["glow"] }

NOTE: Chances are you have hardware that supports at least OpenGL 2.1 or OpenGL ES 2.0, but if you don't, right now there's no software fallback, so it means your hardware doesn't support Iced.

Contributing / Feedback

Contributions are greatly appreciated! If you want to contribute, please read our contributing guidelines for more details.

Feedback is also welcome! You can open an issue or, if you want to talk, come chat to our Discord server. Moreover, you can find me (and a bunch of awesome folks) over the #games-and-graphics and #gui-and-ui channels in the Rust Community Discord. I go by lone_scientist#9554 there.

Sponsors

The development of Iced is sponsored by the Cryptowatch team at Kraken.com

Comments
  • Iced branding

    Iced branding

    Hey everyone !

    In order for the new website to happen, we need to define some sort of branding for Iced. Since this should be a community effort, here are my first thoughts / mind map of how I reasoned about the logo and color scheme.

    Logo

    What is Iced ?

    • GUI Framework
    • Platform-agnostic
    • Written in Rust
    • Elm Architecture

    What does iced mean ?

    • Ice

      • Ice Cubes
      • Snowflakes
      • Mountains / Glacier
      • Icebergs
      • Sharp edges
      • Mostly light-blue colors
    • Iced Coffee

      • Ice cubes
      • Brown / Orange colors
    • Modern GUI / Elm

      • Font has to be sans-serif. Having serif makes everything look automatically older.
      • Flat
      • Square-ish shape
      • Draft / Prototyping
    • Rust

      • Light-Orange color (Github) and black color
      • "Jagged R" Rust Logo : maybe we can have a slight reminder of Rust in the shape of the logo ?

    Possible inspiration

    This whole article on the amethyst.rs website Logo of Flutter Logo of Electron Logo of Elm Logo of OrbTX Logo of Amethyst image

    Colors

    We need to define :

    • One main color - 3 shades
    • One "accent" color - 3 shades
    • One shade of light color
    • One shade of dark color

    In my opinion, it is obvious that Iced's main color should be light-blue. White could also largely be used as a reminder of snow. I'm thinking a slightly brown dark color could be used for texts.

    I'm undecided for the accent : I like light-green together with light-blue, though I think an orange accent would make for a better result because they are often used as opposite colors in video games. Take Rocket League for example. I also tried brown/orange as an alternative.

    My suggestions

    So here are my 2 cents. I'm terrible at graphic design (I'm just an engineer) and this is of course a draft that I hope someone will take further.

    For the color scheme, I took images of a glacier and extracted some colors. This would be my "main color" suggestion. I took another image of an emerald glacier and extracted shades of green - I think it's called teal. Finally, I got an image of an iced coffee and exrtacted shades of orange / brown.

    image

    As per the logo, I think I'm on to something. These are the result of my first iteration. I'm willing to add some sort of gradient to the ice cubes when I can figure out how to do that in Inkscape.

    image

    I think it's simple enough. A cool logo should never be complex as evidenced by the "possible inspirations" part, and should work in a monochrome context (both black and white), which I think is kind of the case here.

    What are your thoughts ? Any help welcome! :pray:

    improvement feature help wanted good first issue 
    opened by AlisCode 118
  • Scrolling programmatically

    Scrolling programmatically

    The scroll_to method on the State in Scrollable is useful for scrolling programmatically but it requires knowledge of the layout bounds which isn't public.

    Either this information should be exposed, probably for all widgets, or the State should contain the bounds of the Scrollable so that scroll_to can be used as public api without needing to create a custom widget.

    What do you think?

    EDIT: zulip links https://iced.zulipchat.com/#narrow/stream/213316-general/topic/infinite.20list https://iced.zulipchat.com/#narrow/stream/213445-help/topic/Scrollable.3A.3Apush_back https://iced.zulipchat.com/#narrow/stream/213445-help/topic/how.20to.20scroll.20programmatically.3F https://iced.zulipchat.com/#narrow/stream/213445-help/topic/scroll_to

    feature question 
    opened by krooq 25
  • A lot of examples in `iced` are not working

    A lot of examples in `iced` are not working

    Tried the clock, game_of_life, integration_wgpu examples in iced

    All give the same error

    thread 'main' panicked at 'Error in Surface::configure: parent device is lost', /home/username/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.12.0/src/backend/direct.rs:214:9
    

    Other examples like, stopwatch, pokedex work awesome!

    Does anyone know the reason?

    bug rendering shell compatibility 
    opened by VarLad 24
  • Another run example error: `cargo run --example tour`

    Another run example error: `cargo run --example tour`

    I'm trying to run the example on my Windows 10, but I come across this:

    iced> $Env:RUST_BACKTRACE="full"
    iced> cargo run --example tour  
        Finished dev [unoptimized + debuginfo] target(s) in 0.63s
         Running `target\debug\examples\tour.exe`
    [2019-12-01T05:21:46Z INFO  winit::platform_impl::platform::window] Guessed window DPI factor: 1
    error: process didn't exit successfully: `target\debug\examples\tour.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
    

    I tried to backtrace the log, But it seems to only print a line of log about DPI factor. How could I log more to locate this issue?

    bug 
    opened by huangjj27 24
  • Iced on Raspberry PI 4 (almost working)

    Iced on Raspberry PI 4 (almost working)

    Hi,

    I'm trying to use iced on my Raspberry 4. So far I managed to make it compile. It even runs and the window is shown, but no frame is rendered. Eventually it exits with the following error:

    thread 'main' panicked at 'Next frame: TimeOut', /home/pi/work/iced/wgpu/src/window/compositor.rs:110:21
    

    Before I patched the iced dependencies it failed to compile:

    error[E0308]: mismatched types
       --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.6.0/src/loaders/freetype.rs:804:20
        |
    804 |                 x: vector.x() as i64,
        |                    ^^^^^^^^^^^^^^^^^ expected `i32`, found `i64`
    
    error[E0308]: mismatched types
       --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.6.0/src/loaders/freetype.rs:805:20
        |
    805 |                 y: -vector.y() as i64,
        |                    ^^^^^^^^^^^^^^^^^^ expected `i32`, found `i64`
    
    error[E0308]: mismatched types
       --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.6.0/src/loaders/freetype.rs:808:21
        |
    808 |                 xx: matrix.x() as i64,
        |                     ^^^^^^^^^^^^^^^^^ expected `i32`, found `i64`
    
    error[E0308]: mismatched types
       --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.6.0/src/loaders/freetype.rs:809:21
        |
    809 |                 xy: matrix.y() as i64,
        |                     ^^^^^^^^^^^^^^^^^ expected `i32`, found `i64`
    
    error[E0308]: mismatched types
       --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.6.0/src/loaders/freetype.rs:810:21
        |
    810 |                 yx: matrix.z() as i64,
        |                     ^^^^^^^^^^^^^^^^^ expected `i32`, found `i64`
    
    error[E0308]: mismatched types
       --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.6.0/src/loaders/freetype.rs:811:21
        |
    811 |                 yy: matrix.w() as i64,
        |                     ^^^^^^^^^^^^^^^^^ expected `i32`, found `i64`
    
    error: aborting due to 6 previous errors
    
    For more information about this error, try `rustc --explain E0308`.
    error: could not compile `font-kit`.
    

    I updated iced_graphics' font-kit dependency to 0.9 and the error disappeared. I was able to build and execute examples, but rendering fails for some reason. Here's the typical output: https://gist.github.com/0x7CFE/3f29f6d7fccd67bd8804ad47c97daaa5 Also, please notice a ton of font errors.

    Currently Raspberry Pi 4 has only experimental but working Vulkan support. Yet I thought that for 2D stuff it should probably be enough.

    I will be happy to hear any suggestions.

    P.S.: Since iced is render agnostc, is it possible to build it on top of OpenGL? Maybe that would be easier than trying to debug alpha version of the Vulkan driver.

    question rendering 
    opened by 0x7CFE 22
  • Panic when running any of the examples under Linux Intel GPU

    Panic when running any of the examples under Linux Intel GPU

    Environment:

    openSUSE Tumbleweed, kernel 5.3.11. KDE Plasma 5.17.3 System font: Noto Sans Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) Mesa 19.2.4 Vulkan Instance Version: 1.1.127

    Running cargo run --example tour causes panic with the following stack trace (snipped):

      15: core::result::Result<T,E>::unwrap
                 at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/result.rs:933
      16: wgpu_glyph::builder::GlyphBrushBuilder<()>::using_fonts_bytes::{{closure}}
                 at /home/dmitry/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu_glyph-0.6.0/src/builder.rs:44
      17: core::iter::adapters::map_fold::{{closure}}
                 at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/iter/adapters/mod.rs:694
      18: core::iter::traits::iterator::Iterator::fold::ok::{{closure}}
                 at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/iter/traits/iterator.rs:1813
      19: core::iter::traits::iterator::Iterator::try_fold
                 at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/iter/traits/iterator.rs:1694
      20: core::iter::traits::iterator::Iterator::fold
                 at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/iter/traits/iterator.rs:1816
      21: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
                 at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/iter/adapters/mod.rs:727
      22: core::iter::traits::iterator::Iterator::for_each
                 at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/iter/traits/iterator.rs:616
      23: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::spec_extend
                 at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/liballoc/vec.rs:1966
      24: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
                 at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/liballoc/vec.rs:1949
      25: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
                 at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/liballoc/vec.rs:1836
      26: core::iter::traits::iterator::Iterator::collect
                 at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/iter/traits/iterator.rs:1478
      27: wgpu_glyph::builder::GlyphBrushBuilder<()>::using_fonts_bytes
                 at /home/dmitry/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu_glyph-0.6.0/src/builder.rs:41
      28: iced_wgpu::text::Pipeline::new
                 at wgpu/src/text.rs:36
      29: iced_wgpu::renderer::Renderer::new
                 at wgpu/src/renderer.rs:64
      30: <iced_wgpu::renderer::Renderer as iced_native::renderer::windowed::Windowed>::new
                 at wgpu/src/renderer.rs:417
      31: iced_winit::application::Application::run
                 at ./winit/src/application.rs:115
      32: iced::application::Application::run
                 at ./src/application.rs:140
      33: iced::sandbox::Sandbox::run
                 at ./src/sandbox.rs:128
      34: tour::main
                 at examples/tour.rs:10
    
    bug 
    opened by ancwrd1 22
  • Experimental WebGL wgpu backend support

    Experimental WebGL wgpu backend support

    Made changes to allow the use of WebGL wgpu backend. The basic functionality works, but text rendering is still buggy - Somehow, if the initial value of the text control was changed, some parts of the text start to disappear/show artifacts.

    UPD: Strange issue with text rendering is only reproducing in Firefox (v93). It is not directly related to the iced, I created an issue in wgpu_glyph here: https://github.com/hecrj/wgpu_glyph/issues/78

    The current implementation provides neither Application nor Sandbox implementations for this backend, and does not implement proper Clipboard in iced_winit, however, this should be at least some starting point.

    Changes list:

    • Added new integration_wgpu_webgl example, based on integration_wgpu and wgpu's hello-triangle example (can't use integration_wgpu example directly because it fails with its spirv shaders on WebGL)
    • Lifted Sync requirement for Runtime and Tracker in iced_futures
    • Aded webgl feature to iced_wgpu which enables wgpu/webgl
    • Created stub implementation for Clipboard in iced_winit
    Images

    iced running inside WebGL canvas: image

    Text issues after changing text value: image

    Same example running on desktop backend: image

    rendering shell web 
    opened by pacmancoder 21
  • Implement dynamic linking feature

    Implement dynamic linking feature

    The Bevy game engine has a nice dynamic linking features which, coupled with the lld linker, significantly improves compile times. I have added this to iced for faster compiling iterations (down to about 2.3 from 3.8 for a personal project) . What do you think? Relevant issue: #849

    feature 
    opened by zyansheep 21
  • Application closes immediately after launched on Linux

    Application closes immediately after launched on Linux

    I am trying to run my application compiled in Ubuntu and I can't get it working. If launched by double clicking the application it just says mentions something like:

    there's no application installed for "shared library" files

    Event though the file already has execution permission with chmod +x app. If I run it through the console, it appears to work but closes immediately. No GUI interface is shown at all.

    I installed a panic hook but there's no panic going on, it closes without explanation.

    When compiling and running on Windows it works fine.

    Is there any mechanism in Iced to debug this kind of error?

    help wanted question rendering wgpu 
    opened by sum-elier 21
  • Canvas examples on MacOS don't work

    Canvas examples on MacOS don't work

    0.1.1 seems to have broken the Canvas widget on Mac OS. When trying to run the clock, solar_system, bezier_tool examples on MacOS 10.14.6 get a blank, white, screen where I believe the Canvas is supposed to be. Running game_of_life presents a gray screen, and all the surrounding menu components but does not show any of the white "cell" pieces.

    Manually switching to the 0.1 branch and testing the ones that exist there seems to work fine.

    bug 
    opened by andrewmh20 21
  • Text Selection for text_input widget

    Text Selection for text_input widget

    TL;DR Based on Finnerales fork, still WIP but looking for tips and/or wishes.

    First of all, this is based on work done by @Finnerale (#184). It's the biggest and imo most difficult part of what has been done in this pull request (as of now). My problem was, that I wasn't patient enough to wait any longer and i wanted this functionality for my side project. So although I'm an absolute beginner regarding Rust/GUI/Collab Work, I thought I'd give it a go.

    What's implemented:

    • Selection via Mouse dragging (by Finnerale)
    • Ctrl + A or 3 clicks to select everything
    • double click to select a word

    What's left afaik:

    • Shift + Left/Right = Expand selection by one character
    • Ctrl + Shift + Left/Right = Expand selection by one "word"
    • Shift + Home/End = Expand selection to Start/End (* I really need to work on Comments/Documention huh -> should be added tomorrow)

    So most importantly I'd like to know if i did something wrong or inappropriate (regarding the code(style)) and if there is something i forgot to add. Oh and also tell me if this is a waste of time for you (or me).

    I'm gonna post this as a draft pull request, because it's obviously still WIP :)

    P.S. Yea, i noticed the failing builds :P

    feature 
    opened by FabianLars 20
  • Error compiling to linux

    Error compiling to linux

    Is there an existing issue for this?

    • [X] I have searched the existing issues.

    Is this issue related to iced?

    • [X] My hardware is compatible and my graphics drivers are up-to-date.

    What happened?

    Error compiling to the linux target

    What is the expected behavior?

    Compiling succesfully

    Version

    0.6

    Operative System

    Windows

    Do you have any log output?

    error[E0277]: the trait bound `u128: num_traits::Zero` is not satisfied
       --> C:\Users\alves\.cargo\registry\src\github.com-1ecc6299db9ec823\palette-0.6.1\src\component.rs:204:22
        |
    204 |                 impl IntoComponent<$target> for $uint {
        |                      ^^^^^^^^^^^^^^^^^^^^^^ the trait `num_traits::Zero` is not implemented for `u128`
    ...
    243 | convert_uint_to_uint!(u64; via f64 (u8, u16, u32, u128););
        | --------------------------------------------------------- in this macro invocation
        |
        = help: the following other types implement trait `num_traits::Zero`:
                  f32
                  f64
                  i16
                  i32
                  i64
                  i8
                  isize
                  u16
                and 4 others
    note: required by a bound in `IntoComponent`
       --> C:\Users\alves\.cargo\registry\src\github.com-1ecc6299db9ec823\palette-0.6.1\src\component.rs:80:28
    
    bug 
    opened by ItsRedly 0
  • Flex layout panics when forced to too small place

    Flex layout panics when forced to too small place

    Is there an existing issue for this?

    • [X] I have searched the existing issues.

    Is this issue related to iced?

    • [X] My hardware is compatible and my graphics drivers are up-to-date.

    What happened?

    When moving a window with large components to too small place in a tiling window manager (in this case Sway), flex container may panic with window size being too small.

    What is the expected behavior?

    The expected behavior is for the application to draw for example top-left corner of the application to the restricted space and not to crash (allowing the user to resize the app)

    Version

    master

    Operative System

    Linux

    Do you have any log output?

    RUST_BACKTRACE=1 cargo run --features iced/glow --package game_of_life                       
        Finished dev [unoptimized + debuginfo] target(s) in 0.09s
         Running `target/debug/game_of_life`
    thread 'main' panicked at 'assertion failed: min <= max', /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/core/src/num/f32.rs:1394:9
    stack backtrace:
       0: rust_begin_unwind
                 at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/panicking.rs:575:5
       1: core::panicking::panic_fmt
                 at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/core/src/panicking.rs:64:14
       2: core::panicking::panic
                 at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/core/src/panicking.rs:111:5
       3: core::f32::<impl f32>::clamp
                 at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/core/src/num/f32.rs:1394:9
       4: iced_native::layout::limits::Limits::resolve
                 at ./native/src/layout/limits.rs:158:13
       5: <iced_native::widget::text::Text<Renderer> as iced_native::widget::Widget<Message,Renderer>>::layout
                 at ./native/src/widget/text.rs:144:20
       6: iced_native::layout::flex::resolve
                 at ./native/src/layout/flex.rs:135:26
       7: <iced_native::widget::row::Row<Message,Renderer> as iced_native::widget::Widget<Message,Renderer>>::layout
                 at ./native/src/widget/row.rs:122:9
       8: iced_native::layout::flex::resolve
                 at ./native/src/layout/flex.rs:184:26
       9: <iced_native::widget::row::Row<Message,Renderer> as iced_native::widget::Widget<Message,Renderer>>::layout
                 at ./native/src/widget/row.rs:122:9
      10: iced_native::layout::flex::resolve
                 at ./native/src/layout/flex.rs:135:26
      11: <iced_native::widget::column::Column<Message,Renderer> as iced_native::widget::Widget<Message,Renderer>>::layout
                 at ./native/src/widget/column.rs:135:9
      12: <iced_native::widget::container::Container<Message,Renderer> as iced_native::widget::Widget<Message,Renderer>>::layout::{{closure}}
                 at ./native/src/widget/container.rs:163:17
      13: iced_native::widget::container::layout
                 at ./native/src/widget/container.rs:300:23
      14: <iced_native::widget::container::Container<Message,Renderer> as iced_native::widget::Widget<Message,Renderer>>::layout
                 at ./native/src/widget/container.rs:152:9
      15: <iced_graphics::renderer::Renderer<B,T> as iced_native::renderer::Renderer>::layout
                 at ./graphics/src/renderer.rs:61:22
      16: iced_native::user_interface::UserInterface<Message,Renderer>::build
                 at ./native/src/user_interface.rs:103:13
      17: iced_native::user_interface::UserInterface<Message,Renderer>::relayout
                 at ./native/src/user_interface.rs:520:9
      18: iced_glutin::application::run_instance::{{closure}}
                 at ./glutin/src/application.rs:355:25
      19: iced_glutin::application::run::{{closure}}
                 at ./glutin/src/application.rs:167:24
      20: winit::platform_impl::platform::sticky_exit_callback
                 at /home/jaakko/.local/share/cargo/git/checkouts/winit-57d3141eaf559308/9404575/src/platform_impl/linux/mod.rs:849:9
      21: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run_return
                 at /home/jaakko/.local/share/cargo/git/checkouts/winit-57d3141eaf559308/9404575/src/platform_impl/linux/wayland/event_loop/mod.rs:529:21
      22: winit::platform_impl::platform::EventLoop<T>::run_return
                 at /home/jaakko/.local/share/cargo/git/checkouts/winit-57d3141eaf559308/9404575/src/platform_impl/linux/mod.rs:748:56
      23: <winit::event_loop::EventLoop<T> as winit::platform::run_return::EventLoopExtRunReturn>::run_return
                 at /home/jaakko/.local/share/cargo/git/checkouts/winit-57d3141eaf559308/9404575/src/platform/run_return.rs:62:9
      24: iced_glutin::application::run
                 at ./glutin/src/application.rs:142:13
      25: iced::application::Application::run
                 at ./src/application.rs:216:12
      26: game_of_life::main
                 at ./examples/game_of_life/src/main.rs:23:5
      27: core::ops::function::FnOnce::call_once
                 at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/core/src/ops/function.rs:507:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    bug 
    opened by Jaakkonen 1
  • Immediate crash on Winit wayland backend and wgpu Vulkan renderer

    Immediate crash on Winit wayland backend and wgpu Vulkan renderer

    Is there an existing issue for this?

    • [X] I have searched the existing issues.

    Is this issue related to iced?

    • [X] My hardware is compatible and my graphics drivers are up-to-date.

    What happened?

    All Iced programs (in the panic sample the game of life example) immediately crash when having vulkan & wayland backends chosen.

    Environment: Sway 1.7 Intel alder lake graphics with Mesa 22.3.1

    What is the expected behavior?

    The application doesn't crash or errors that vulkan & wayland is an unsupported combination (-> Use x11 & vulkan for actually working experience or wayland & gl for experience where most things excluding images work)

    Version

    master

    Operative System

    Linux

    Do you have any log output?

    RUST_BACKTRACE=1 WINIT_UNIX_BACKEND=wayland WGPU_BACKEND=vulkan cargo run --features iced/wgpu --package game_of_life
        Finished dev [unoptimized + debuginfo] target(s) in 0.09s
         Running `target/debug/game_of_life`
    thread 'main' panicked at 'Error in Surface::configure: parent device is lost', /home/jaakko/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.14.2/src/backend/direct.rs:274:9
    stack backtrace:
       0: rust_begin_unwind
                 at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/panicking.rs:575:5
       1: core::panicking::panic_fmt
                 at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/core/src/panicking.rs:64:14
       2: wgpu::backend::direct::Context::handle_error_fatal
                 at /home/jaakko/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.14.2/src/backend/direct.rs:274:9
       3: <wgpu::backend::direct::Context as wgpu::Context>::surface_configure
                 at /home/jaakko/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.14.2/src/backend/direct.rs:1017:13
       4: wgpu::Surface::configure
                 at /home/jaakko/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.14.2/src/lib.rs:3715:9
       5: <iced_wgpu::window::compositor::Compositor<Theme> as iced_graphics::window::compositor::Compositor>::configure_surface
                 at ./wgpu/src/window/compositor.rs:157:9
       6: iced_winit::application::run_instance::{{closure}}
                 at ./winit/src/application.rs:258:5
       7: iced_winit::application::run::{{closure}}
                 at ./winit/src/application.rs:218:24
       8: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run_return
                 at /home/jaakko/.local/share/cargo/git/checkouts/winit-57d3141eaf559308/9404575/src/platform_impl/linux/wayland/event_loop/mod.rs:233:9
       9: winit::platform_impl::platform::EventLoop<T>::run_return
                 at /home/jaakko/.local/share/cargo/git/checkouts/winit-57d3141eaf559308/9404575/src/platform_impl/linux/mod.rs:748:56
      10: <winit::event_loop::EventLoop<T> as winit::platform::run_return::EventLoopExtRunReturn>::run_return
                 at /home/jaakko/.local/share/cargo/git/checkouts/winit-57d3141eaf559308/9404575/src/platform/run_return.rs:62:9
      11: iced_winit::application::platform::run
                 at ./winit/src/application.rs:749:17
      12: iced_winit::application::run
                 at ./winit/src/application.rs:193:5
      13: iced::application::Application::run
                 at ./src/application.rs:216:12
      14: game_of_life::main
                 at ./examples/game_of_life/src/main.rs:23:5
      15: core::ops::function::FnOnce::call_once
                 at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/core/src/ops/function.rs:507:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    bug 
    opened by Jaakkonen 2
  • Use same name & order for toggler::new and helper

    Use same name & order for toggler::new and helper

    The helper function for the toggler widget switched the order and name of the arguments passed when creating the toggler widget. This just standardizes the order whether the dev is using the helper or the associated function.

    opened by 13r0ck 0
  • Vectorial text for `Canvas`

    Vectorial text for `Canvas`

    This PR implements vectorial text support for the Canvas widget by leveraging cosmic-text :tada:

    This means that text now is no different than any other kind of geometry in a Canvas and, as a result, it can be transformed (translated, rotated, and scaled) and composed (layering!) freely.

    Also, cosmic-text implements both text shaping and font fallback, so a Canvas should now be able to support different scripts as well.

    https://user-images.githubusercontent.com/518289/208642436-759ad908-e4ac-4333-b55a-933bf3ad5036.mp4

    The bitmap font support is wonky (and very inefficient), as you can see in the example above. This is just the start of a series of PRs that will improve our text handling and rendering. Further improvements are coming!

    text widget rendering canvas 
    opened by hecrj 0
Releases(0.6.0)
  • 0.6.0(Dec 7, 2022)

    Added

    • Support for non-uniform border radius for Primitive::Quad. #1506
    • Operation to query the current focused widget. #1526
    • Additional operations for TextInput. #1529
    • Styling support for Svg. #1578

    Changed

    • Triangle geometry using a solid color is now drawn in a single draw call. #1538

    Fixed

    • Gradients for WebAssembly target. #1524
    • Overlay layout cache not being invalidated. #1528
    • Operations not working for PaneGrid. #1533
    • Mapped widget::Operation always returning Outcome::None. #1536
    • Padding of TextInput with Length::Units width. #1539
    • Clipping of Image and Svg widgets in iced_glow. #1557
    • Invalid links in documentation. #1560
    • Custom style of PickList widget. #1570
    • Scroller in Scrollable always being drawn. #1574

    Many thanks to...

    • @bungoboingo
    • @l1Dan
    • @mmstick
    • @mtkennerly
    • @PolyMeilex
    • @rksm
    • @rs017991
    • @tarkah
    • @wash2
    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Nov 10, 2022)

    COSMIC Desktop icy_term SlimeVR Wrangler

    New features

    • Stabilization of stateless widgets (#1393)
      The old widget API has been completely replaced by stateless widgets (introduced in #1284). Alongside the new API, there are a bunch of new helper functions and macros for easily describing view logic (like row! and column!).

    • First-class theming (#1362)
      A complete overhaul of our styling primitives, introducing a Theme as a first-class concept of the library.

    • Widget operations (#1399)
      An abstraction that can be used to traverse (and operate on) the widget tree of an application in order to query or update some widget state.

    • Lazy widget (#1400)
      A widget that can call some view logic lazily only when some data has changed. Thanks to @nicksenger!

    • Linear gradient support for Canvas (#1448)
      The Canvas widget can draw linear gradients now. Thanks to @bungoboingo!

    • Touch support for Canvas (#1305)
      The Canvas widget now supports touch events. Thanks to @artursapek!

    • Image and Svg support for iced_glow (#1485)
      Our OpenGL renderer now is capable of rendering both the Image and Svg widgets. Thanks to @ids1024!

    Thank you! :tada:

    • @0x192 exported overlay::menu publicly (#1425).
    • @13r0ck updated the documentation for the integration examples after a rename (#1433).
    • @aentity added an application feature to iced_winit (#1196).
    • @AlistairKeiller fixed the supported backends listed in the README of iced_wgpu (#1458).
    • @artursapek added touch support for the Canvas widget (#1305).
    • @bungoboingo
      • added supported for linear gradients to the Canvas widget (#1448), and
      • fixed issues with old OpenGL versions in iced_glow (#1518).
    • @casperstorm changed the images in the README to have similar height (#1356).
    • @clarkmoody tweaked the system information queries (#1445).
    • @Cupnfish updated wgpu to 0.13 (#1378).
    • @daladim added convenience functions for window::Icon (#1174).
    • @derezzedex implemented commands to query system information (#1314).
    • @fralonra
      • fixed the import path in the documentation example of the pure Canvas widget (#1373), and
      • fixed the documentation for running integration_wgpu (#1434).
    • @icedrocket enabled the application feature in iced_glutin (#1502).
    • @ids1024
      • documented that window::Action::Move is unsupported on Wayland (#1440)
      • replaced lazy_static! with once_cell (#1497)
      • added support for Cow<'static, [u8]> in the Image and Svg widgets (#1453)
      • implemented Image and Svg support for iced_glow (#1485)
      • fixed wrong conversion to BGRA before passing to image shaders (#1507), and
      • combined the glow_default_system_font and default_system_font features (#1505).
    • @jhannyjimenez clarified the position and alignment of text in the documentation of Canvas (#1370).
    • @kaimast improved the integration of event processing for custom shells (#1230).
    • @LordRatte implemented a color! macro helper (#1227).
    • @Luni-4
      • added a release-opt profile to our Cargo.toml (#1346), and
      • improved our GitHub CI workflows (#1387).
    • @maxwell8888 added a pure version of the color_palette example (#1326).
    • @mmstick introduced additional actions for window controls (#1471).
    • @mtkennerly
      • added a note about the resolver requirement (#1339)
      • added missing version to the issue template (#1340)
      • changed the title bar of the PaneGrid widget to prevent content and controls from overlapping (#1361), and
      • changed the title bar of the PaneGrid widget to still show content until hover when cramped (#1424).
    • @nicksenger
      • fixed Component building overlay with stale layout (#1341)
      • implemented custom border_radius support for pick_list::Menu (#1396), and
      • implemented the Lazy widget (#1400).
    • @pheki removed the old pure feature from docs.rs build metadata (#1429).
    • @PolyMeilex addressed a bunch of clippy lints (#1379).
    • @RamType0 introduced Cow support for the Text widget (#1107).
    • @tarkah
      • fixed processing logic of captured events for overlays (#1353)
      • fixed alpha blending for MSAA in iced_wgpu (#1367)
      • allowed overriding the value of a pure TextInput during draw (#1371)
      • implemented Widget::operate for the Component widget (#1402)
      • fixed a double translation bug in the text clipping rectangle for the Canvas widget (#1411)
      • fixed the Tooltip widget when inside a Scrollable (#1405)
      • changed the Tooltip text layout to not be constricted by the viewport size (#1414)
      • changed the rendering order of the PaneGrid title bar and its body (#1463)
      • fixed some issues with the PaneGrid widget (#1480)
      • fixed PickList menu not closing when inside a Scrollable (#1496)
      • constrained Padding to fit available space during layout (#1494), and
      • added pane maximize and restore functionality for the PaneGrid widget (#1504).
    • @ThatsNoMoon fixed the implementation of arc_to for the Canvas widget (#1358).
    • @thenlevy fixed some issues with the integration_wgpu example (#1139).
    • @ThisIsRex added an is_selected argument to the StyleSheet of a Radio widget (#1331).
    • @traxys implemented support to replace an existing DOM element when targeting Wasm (#1443).
    • @xkenmon implemented a sierpinski-triangle example (#1136).
    • @xTeKc updated the test badge in the README (#1450).
    • @wash2
      • fixed synchronization of window and viewport (#1437), and
      • added a Custom variant to the built-in Theme (#1432).
    • @wuxianucw relaxed the Fn trait bounds for Command and Action (#1409).
    • @wyatt-herkamp
      • added an on_paste handler to the TextInput widget (#1350)
      • updated winit to 0.27 and glutin to 0.29 (#1410), and
      • updated wgpu to 0.14 and wgpu_glyph to 0.18 (#1462).
    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(May 3, 2022)

    OctaSine Universal Android Debloater Borderlands 3 Save Edtor

    New features

    • Stateless widgets (#1284)
      A brand new widget API that removes the need to keep track of internal widget state. No more button::State in your application!

    • Component trait (#1131)
      A new trait to implement custom widgets with internal mutable state while using composition and The Elm Architecture.

    • Responsive widget (#1193)
      A widget that is aware of its dimensions and can be used to easily build responsive user interfaces.

    • Experimental WebGL support (#1096)
      Applications can now be rendered into an HTML canvas when targeting Wasm by leveraging the WebGL support in wgpu. Thanks to @pacmancoder and @kaimast!

    • Support for Raspberry Pis and older devices (#1160)
      The compatibility of our OpenGL renderer has been improved and should run on any hardware that supports OpenGL 2.1+ or OpenGL ES 2.0+. Additionally, we started maintaining Docker images for aarch64 and armv7 to easily cross-compile iced applications and target Raspberry Pis. Thanks to @derezzedex!

    • Simpler Renderer APIs (#1110)
      The surface of the Renderer APIs of the library has been considerably reduced. Instead of a Renderer trait per widget, now there are only 3 traits that are reused by all the widgets.

    Thank you! :tada:

    • @0x192 implemented the Default trait for pure::State (#1298).
    • @13r0ck added support for selecting a value of a PickList by scrolling (#872).
    • @Ace4896 added placeholder support for the PickList widget (#888).
    • @aentity fixed a bug causing high memory usage of the Svg widget (#952).
    • @akavel implemented proper handling of Exif orientation for raster images in iced_wgpu.
    • @akhilman fixed an issue with window transparency in iced_glow (#1021).
    • @Alch-Emi introduced ContentFit support for the Image and Svg widgets (#1219).
    • @AldoMX added a select_all method to text_input::State (#776).
    • @AlisCode decoupled image::Handle from iced_native and lowered the trait bound of text::Renderer::Font (#1155).
    • @AndiHofi allowed Application::run to return on native platforms (#1112).
    • @ATiltedTree improved the compatibility of iced_wgpu by using the preferred texture format of the window surface (#978).
    • @BillyDM
      • fixed iced_wgpu panicking when a SwapChain frame is outdated (#667), and
      • tweaked the default styling of the Rule widget (#994).
    • @blefevre added support for asymmetrical padding (#630).
    • @casperstorm implemented a pure version of the Tooltip widget (#1315).
    • @Chiheisen
      • fixed the layout logic of PickList to respect custom fonts (#886), and
      • improved the layout logic of the image::Viewer widget (#885).
    • @clarkmoody
      • added support for generic elements in the title bars of a PaneGrid (#892), and
      • introduced overlay support for the title bar of a PaneGrid (#920).
    • @cmot17 fixed an issue with text selection in the TextInput widget (#1098).
    • @cossonleo fixed the overlay position of the Component widget (#1205).
    • @Cupnfish
      • fixed a typo in the documentation (#810),
      • and added a primary backend option to the WGPU_BACKEND environment variable (#876).
    • @daladim added the iced logo to the documentation (#1147).
    • @derezzedex added support for ARM devices and older hardware (#1160).
    • @diegodox fixed a typo in the documentation of canvas::Program (#927).
    • @Dispersia upgraded wgpu to 0.8 (#830).
    • @EkardNT added support for Sandbox applications to quit gracefully (#1175).
    • @feylinara fixed a memory leak in the integration_opengl example (#1181).
    • @gonsor added text_color to the Style of a Checkbox (#1116).
    • @Imberflur
      • upgraded winit to 0.25 (#919),
      • fixed a few links in the documentation (#1121), and
      • fixed the hash_layout implementation of the Container widget (#1140).
    • @Kaiden42 implemented a Toggler widget (#535).
    • @LordRatte updated links in the documentation to point to the new iced-rs organization (#1168).
    • @Luni-4
      • added executable permissions to the todos example in CI for macOS builds (#956), and
      • stopped the shell from opening on Windows (#1049).
    • @marienz fixed overlay calls not being forwarded when using Element::map (#1294).
    • @mettz fixed an incorrect color being used with Element::explain (#1109).
    • @mtsr documented how to disable a Button (#646).
    • @nicksenger
      • fixed the Widget::height implementation of the Component widget (#1149),
      • implemented Widget::overlay for Component (#1154),
      • fixed layout invalidation of nested components (#1169),
      • fixed the overlay layout for the Responsive widget (#1262),
      • fixed the diffing strategy for nested pure components (#1301),
      • fixed the diffing strategy for pure stateless components (#1309), and
      • fixed a panic when using a pure Component in a pure Responsive widget (#1319).
    • @n8henrie fixed the path to ferris.png in the tour example (#1157).
    • @oknozor fixed the visibility of the constants in the blit shader in iced_wgpu (#1084).
    • @PolyMeilex
      • upgraded wgpu to 0.9 (#925),
      • upgraded wgpu to 0.10 (#1000), and
      • upgraded wgpu to 0.11 (#1081).
    • @pacmancoder implemented experimental WebGL support in iced_wgpu (#1096).
    • @RamType0 removed unnecessary String allocation in some examples (#1106).
    • @RDambrosio016 fixed example links in the documentation to point to the latest release (#877).
    • @sundy-li fixed the README of the integration_opengl example.
    • @taiki_e enabled the qr_code feature in docs.rs (#815).
    • @TannerRogalsky
      • disabled the default features in the twox-hash dependency (#1117)
      • fixed async traits for Wasm (#1118).
    • @tarkah
      • added a new Hidden variant to window::Mode (#825),
      • introduced a new Moved variant to window::Event (#965),
      • fixed the overlays on a PaneGrid title bar not closing when dragging a pane (#971),
      • added a Fill variant for Alignment (#1044),
      • removed redundant Slider messages (#1114),
      • added a line dash API for the Canvas widget (#1225), and
      • fixed the text wrapping of the selected option of a PickList (#1318).
    • @thenlevy
      • fixed the dimensions of scissor_rect in iced_wgpu being too large in some circumstances (#818), and
      • implemented event handling of the Enter key for TextInput (#1150).
    • @ThisIsRex fixed the position of the handle and rail of a Slider (#1286).
    • @traxys introduced a window::Setting to toggle drag and drop on Windows (#893).
    • @xy37v replaced Zulip mentions in the README with the new Discord server (#1151).
    • @yamadapc improved the support of iced_glow for multi-windowed applications (#980).
    • @yusdacra
      • added methods to control a Scrollable programmatically (#607),
      • introduced a flag to toggle multithreaded rasterization of text primitives (#914), and
      • updated links in the documentation (#915).
    • @ZakisM optimized the RGBA / BGRA conversion for vectorial images in iced_wgpu (#875).
    • @zdevwu added text_color and font methods to Radio and Checkbox (#831).
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Mar 31, 2021)

    Added

    • Touch support. #57 #650 (thanks to @simlay and @discordance!)
    • Clipboard write access for
      • TextInput widget. #770
      • Application::update. #773
    • image::Viewer widget. It allows panning and scaling of an image. #319 (thanks to @tarkah!)
    • Tooltip widget. It annotates content with some text on mouse hover. #465 (thanks to @yusdacra!)
    • Support for the smol async runtime. #699 (thanks to @JayceFayne!)
    • Support for graceful exiting when using the Application trait. #804
    • Image format features in iced_wgpu to reduce code bloat. #392 (thanks to @unrelentingtech!)
    • Focused and Unfocused variant to window::Event. #701 (thanks to @cossonleo!)
    • WGPU_BACKEND environment variable to configure the internal graphics backend of iced_wgpu. #789 (thanks to @Cupnfish!)

    Changed

    • The TitleBar of a PaneGrid now supports generic elements. #657 (thanks to @clarkmoody!)
    • The Error type now implements Send and Sync. #719 (thanks to @taiki-e!)
    • The Style types in iced_style now implement Clone and Copy. #720 (thanks to @taiki-e!)
    • The following dependencies have been updated:
      • font-kit0.10 #669
      • glutin0.26 #658
      • resvg0.12 #669
      • tokio1.0 #672 (thanks to @yusdacra!)
      • winit0.24 #658
      • wgpu0.7 #725 (thanks to @PolyMeilex!)
    • The following examples were improved:
      • download_progress now showcases multiple file downloads at once. #283 (thanks to @Folyd!)
      • solar_system uses the new rand API. #760 (thanks to @TriedAngle!)

    Fixed

    • Button events not being propagated to contents. #668
    • Incorrect overlay implementation for the Button widget. #764 (thanks to @thenlevy!)
    • Viewport::physical_width returning the wrong value. #700 (thanks to @TannerRogalsky!)
    • Outdated documentation for the Sandbox trait. #710 (thanks to @GunpowderGuy!)
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Nov 26, 2020)

    Game of Life Cryptowatch Desktop

    New features

    Thank you! :tada:

    • @AberrantWolf updated the Radio widget to make it consistent with Checkbox (#345).
    • @aentity updated winit in iced_winit to 0.23 (#542) and guillotiere to 0.6 (#600).
    • @AlisCode fixed some async examples by feature-gating the Command implementations (#322).
    • @atsuzaki added a transparent field to window::Settings (#484).
    • @Azorlogh implemented conversion traits for Point, Size, and [f32; 2] (#558).
    • @azriel91 introduced feature gates to disable the font-kit dependency (#370).
    • @bitshifter upgraded glam to 0.9 (#482).
    • @clarkmoody created the color_palette example showcasing conversion traits for palette (#200), improved the spacing of the PaneGrid widget (#361), and implemented scrollbar customization for the Scrollable widget (#575).
    • @derezzedex removed an empty bind group in the integration example (#390).
    • @ethanpailes improved the documentation of theimage::Handle constructors (#324).
    • @frapa introduced support to set a window icon (#285).
    • @Imberflur fixed the Clone trait implementation for the Text widget (#363).
    • @Kaiden42 implemented the From<Color> trait for Option<Background> (#487).
    • @Limeth fixed a typo in the hash_layout implementation of Column and Row (#563) and added conversion fuctions for Size and Vector (#583).
    • @Masterchef365 added an on_release handler to the Slider widget (#378).
    • @mobile-bungalow implemented an always_show_controls method for pane_grid::TitleBar (#463).
    • @MonliH removed an outdated comment in the documentation of Column and Row (#545).
    • @mtkennerly fixed a panic when pasting in a TextInput (#445).
    • @myfreeweb added explicit background color support, including transparency (#371).
    • @oknozor introduced a focus method to text_input::State (#598).
    • @rubik83 fixed a bug with empty ranges in ProgressBar and Slider (#527).
    • @sum-elier fixed the description of an error message in a window::icon (#592).
    • @TomPridham introduced accessibility attributes to the iced_web widgets (#292).
    • @twitchyliquid64 added support for always_on_top in window::Settings (#543).
    • @valbendan upgraded tokio to 0.3 (#595).
    • @Vanille-N fixed the ellipse implementation of path::Builder (#401).
    • @Veykril updated the dependencies of iced_wgpu (#334).
    • @Voker57 fixed the documentation of the progress_bar module (#396).
    • @ZakisM fixed a bug with "select all" in a text input on macOS (#605).
    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Apr 15, 2020)

    Added

    • Settings::with_flags to easily initialize some default settings with flags. #266
    • Default implementation for canvas::layer::Cache. #267
    • Ctrl + Del support for TextInput. #268
    • Helper methods in canvas::Path to easily draw lines, rectangles, and circles. #293
    • From<Color> implementation for canvas::Fill. #293
    • From<String> implementation for canvas::Text. #293
    • From<&str> implementation for canvas::Text. #293

    Changed

    • new method of Radio and Checkbox now take a generic Into<String> for the label. #260
    • Frame::fill now takes a generic Into<canvas::Fill>. #293
    • Frame::stroke now takes a generic Into<canvas::Stroke>. #293
    • Frame::fill_text now takes a generic Into<canvas::Text>. #293

    Fixed

    • Feature flags not being referenced in documentation. #259
    • Crash in some graphics drivers when displaying an empty Canvas. #278
    • Text measuring when spaces where present at the beginning of a TextInput value. #279
    • TextInput producing a Clip primitive when unnecessary. #279
    • Alignment of Text primitive in iced_wgpu. #281
    • CursorEntered and CursorLeft not being generated. #289

    Removed

    • Unnecessary 'static lifetimes in Renderer bounds. #290
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Apr 2, 2020)

    New features

    More examples

    • bezier_tool, a Paint-like tool for drawing Bézier curves using lyon.
    • clock, an application that uses the Canvas widget to draw a clock and its hands to display the current time.
    • counter, the classic counter example explained in the README.
    • custom_widget, 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 conditional Subscription.
    • geometry, a custom widget showcasing how to draw geometry with the Mesh2D primitive in iced_wgpu.
    • integration, an example demonstrating how to integrate Iced in an existing graphical application.
    • pane_grid, a grid of panes that can be split, resized, and reorganized.
    • 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.
    • styling, an example showcasing custom styling with a light and dark theme.
    • solar_system, an animated solar system drawn using the Canvas widget 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 the Svg widget.

    Thank you! :tada:

    • @AlisCode created iced-pancurses, started a great issue to find a project logo (#143), and worked on a potential website (#115).
    • @artursapek contributed a Mesh2D primitive for iced_wgpu (#140) which ended up being the foundations of the Canvas widget.
    • @clarkmoody added customization support for the Checkbox widget (#192).
    • @daxpedda improved the Node API (#187) and has been working on the Grid widget (#189).
    • @ejmahler removed the Clone bound on the Message associated type of Application (#155).
    • @FabianLars contributed text selection for TextInput (#202) on top of @Finnerale's work.
    • @Friz64 enhanced the scrolling behavior of the Scrollable widget (#95).
    • @Gohla introduced missing style attributes in iced_web (#127), removed unnecessary bounds (#128), and built a cool Space Engineers calculator.
    • @hatoo added platform-specific settings to iced_winit (#94), implemented the bezier_tool example (#144), and provided feedback related to using the library for building VST plugins (#118).
    • @Imberflur updated winit to 0.21 (#181) and exposed the Clipboard type in iced_winit (#178).
    • @kaimast removed unnecessary lifetimes in the integration example (#240) and contributed other minor code cleanups (#242).
    • @maaku fixed some formatting to comply with cargo fmt (#228).
    • @Maldela implemented the Svg widget (#111) and a texture atlas for iced_wgpu (#154).
    • @memoryruins cleaned up some code and made it more idiomatic (#45).
    • @michael-swan implemented Ctrl+Backspace behavior for TextInput (#249).
    • @mrkgnao added support for displaying already-decoded images (#211).
    • @nvzqz made a bunch of functions const (#91) and added some From implementations (#92).
    • @piaoger fixed the file path of the svg example (#196).
    • @Plecra improved the scaling of the hands in the clock example (#251).
    • @rowungiles introduced a with_children method for Column and Row (#220).
    • @Shootertrex fixed the hash_layout implementation of the Image widget (#101).
    • @simlay experimented with iOS support and touch events (#57) while contributing to winit.
    • @Songtronix wrote the ProgressBar widget (#141), contributed the download_progress example (#232), and has been using the library in Airshipper, a cross-platform launcher for Veloren.
    • @sumibi-yakitori enabled custom fonts for TextInput (#171).
    • @tirz removed unnecessary 'static lifetimes in a bunch of generic types (#245).
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0-beta(Nov 25, 2019)

  • 0.1.0-alpha(Sep 5, 2019)

Owner
A cross-platform GUI library for Rust, inspired by Elm.
null
Idiomatic, GTK+-based, GUI library, inspired by Elm, written in Rust

Relm Asynchronous, GTK+-based, GUI library, inspired by Elm, written in Rust. This library is in beta stage: it has not been thoroughly tested and its

null 2.2k Dec 31, 2022
An idiomatic GUI library inspired by Elm and based on gtk4-rs

An idiomatic GUI library inspired by Elm and based on gtk4-rs. Relm4 is a new version of relm that's built from scratch and is compatible with GTK4 an

Aaron Erhardt 722 Dec 31, 2022
Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.

libui: a portable GUI library for C This README is being written. Status It has come to my attention that I have not been particularly clear about how

Pietro Gagliardi 10.4k Dec 31, 2022
A cross-platform GUI library for Rust focused on simplicity and type-safety

A cross-platform GUI library for Rust, inspired by Elm

Héctor Ramón 17.5k Jan 8, 2023
A single-header ANSI C immediate mode cross-platform GUI library

Nuklear This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed a

Immediate Mode UIs, Nuklear, etc. 6.9k Jan 8, 2023
A simple, cross-platform GUI automation module for Rust.

AutoPilot AutoPilot is a Rust port of the Python C extension AutoPy, a simple, cross-platform GUI automation library for Python. For more information,

null 271 Dec 27, 2022
Truly cross platform, truly native. multiple backend GUI for rust

WIP: Sauron-native a rust UI library that conquers all platforms ranging from desktop to mobile devices. An attempt to create a truly native, truly cr

Jovansonlee Cesar 627 Jan 5, 2023
Cross-platform GUI toolkit written in Rust

Tuix is a cross-platform GUI toolkit written in Rust. The driving principle behind tuix is to be a self-contained, small-as-possible, but still fast,

George Atkinson 166 Dec 13, 2022
A cross-platform GUI toolkit in Rust

NXUI - Native X UI A cross-platform GUI toolkit in Rust NXUI is a GUI toolkit that calls OS native APIs as much as possible to achieve fast operation.

らて 11 Jun 3, 2022
rsautogui aims to be a cross-platform GUI automation rust crate.

rsautogui rsautogui aims to be a cross-platform GUI automation rust crate. It lets you control the mouse and keyboard to automate interactions with ot

null 5 Sep 18, 2022
A lightweight cross-platform system-monitoring fltk gui application based on sysinfo

Sysinfo-gui A lightweight cross-platform system-monitoring fltk gui application based on sysinfo. The UI design is inspired by stacer. The svg icons a

Mohammed Alyousef 22 Dec 31, 2022
Cross-platform native Rust menu library

A cross-platform Rust library for managing the native operating system menus.

Mads Marquart 16 Jan 6, 2023
Rust bindings to the minimalist, native, cross-platform UI toolkit `libui`

Improved User Interface A cross-platform UI toolkit for Rust based on libui iui: ui-sys: iui is a simple (about 4 kLOC of Rust), small (about 800kb, i

Rust Native UI Group 865 Dec 27, 2022
A Rust binding of the wxWidgets cross platform toolkit.

wxRust master: / mac(0.10): This is a Rust binding for the wxWidgets cross platform toolkit. API wxRust API documentation How it works The wxRust libr

KENZ 129 Jan 4, 2023
Alerion is a cross-platform Rust rewrite of Pterodactyl Wings

alerion ?? A complete rewrite of pterodactyl wings. Caution Here be dragons. This project is still a huge work in progress and is not ready for produc

Pyro 5 Apr 15, 2024
An easy-to-use, 2D GUI library written entirely in Rust.

Conrod An easy-to-use, 2D GUI library written entirely in Rust. Guide What is Conrod? A Brief Summary Screenshots and Videos Feature Overview Availabl

PistonDevelopers 3.3k Jan 1, 2023
Rust bindings for the FLTK GUI library.

fltk-rs Rust bindings for the FLTK Graphical User Interface library. The FLTK crate is a crossplatform lightweight gui library which can be statically

Mohammed Alyousef 1.1k Jan 9, 2023
Clear Coat is a Rust wrapper for the IUP GUI library.

Clear Coat Clear Coat is a Rust wrapper for the IUP GUI library. IUP uses native controls and has Windows and GTK backends. A macOS backend has been o

Jordan Miner 18 Feb 13, 2021
Rust bindings for the FLTK GUI library.

fltk-rs Rust bindings for the FLTK Graphical User Interface library. The fltk crate is a cross-platform lightweight gui library which can be staticall

fltk-rs 1.1k Jan 9, 2023