#Loading icon panics

1 messages · Page 1 of 1 (latest)

oblique river
#
use dioxus::{
    desktop::{tao::window::Icon, LogicalSize, WindowBuilder},
    prelude::*,
};
fn main() {
    // Init logger
    dioxus_logger::init(Level::INFO).expect("failed to init logger");

    let icon = Icon::from_rgba(include_bytes!("../assets/icons/32x32.png").to_vec(), 32, 32)
        .expect("image parse failed");

    let cfg = dioxus::desktop::Config::new().with_window(
        WindowBuilder::new()
            .with_window_icon(Some(icon))
            .with_title("Ledgedash")
            .with_inner_size(LogicalSize::new(800, 700)),
    );
    LaunchBuilder::desktop().with_cfg(cfg).launch(App);
}

See attached for backtrace. I generated the icon according to the tauri instructions (https://tauri.app/v1/guides/features/icons/#command-usage). Also the from_rgba returns an Ok, so I don't think it should be an issue with the icon itself (which is also attached).

I've been frustrating myself trying to get this to work, and I think it's fair to say the documentation for icons isn't great. There's also a Config::with_icon() function that I tried using, but it had no effect. I don't know if I should be using manganis for the icon or not. I don't know if the icon needs to be setup in the Dioxus.toml [bundle] config. Any help would be appreciated

oblique river
#

Maybe the reason using Config::with_icon() had no effect is because something doesn't work with tao on my system (kde plasma 6). For example if I just run:

$ git clone https://github.com/tauri-apps/tao.git
$ cd tao
$ cargo run --example window_icon

The window appears, but with only the default icon. I opened an issue in tao https://github.com/tauri-apps/tao/issues/924

GitHub

Describe the bug cargo run --example window_icon launches a window properly, but the window icon is the default wayland icon. Steps To Reproduce $ git clone https://github.com/tauri-apps/tao.git $ ...

#

Maybe this is an ancient gtk/wayland bug? idk it's confusing searching through old threads on this. I'm out of my depth lol.

spiral quiver