web-view icon indicating copy to clipboard operation
web-view copied to clipboard

Change app icon on linux system?

Open codic12 opened this issue 4 years ago • 3 comments

I can't figure out how to do this. I'm talking about the titlebar and taskbar default icon, when running the binary directly instead of using a desktop file.

codic12 avatar Aug 09 '20 22:08 codic12

Eg https://gtk-rs.org/docs/gtk/trait.GtkWindowExt.html#tymethod.set_icon_from_file for GTK without using web-view - any way to access this? Would I import the whole gtk and call that function?

codic12 avatar Aug 09 '20 22:08 codic12

On Windows one can use the winres crate. Linux binaries do not have an icon embedded, instead a DesktopEntry is used. For showing an icon in the titlebar, you would need to do it like with gtk in C (I think you will need to modify the crate, because gtk-rs does not help, as the bindings are in C...).

FrankenApps avatar Aug 10 '20 10:08 FrankenApps

A desktop entry is used for showing the icon that you click but upon clicking it, a pixmap is still shown in the titlebar. I will try to find the relevant parts, add a change_icon method, and create a PR. Where would I add my gtk_window_set_icon_from_file() call in https://github.com/Boscop/web-view/blob/master/webview-sys/gtk.rs ?

codic12 avatar Aug 10 '20 16:08 codic12