haecker-felix / Gradio

GNU General Public License v3.0
326 stars 51 forks source link

Icons do not show up in Mac OS X using new homebrew build #339

Open krrk opened 6 years ago

krrk commented 6 years ago

I made a formula to build Gradio using Homebrew and the menu icons do not show up on the main window. I am not sure if this is related to the build or the code, but perhaps you could provide a clue as to where the problem is?

Expected Behavior

Icons should show up (Menu, Search, Check, Minimize, Maximize, Close, Stop, and Connection Information)

Current Behavior

A generic symbol is shown instead.

Steps to Reproduce

  1. Pull the new formula from Homebrew/homebrew-core/pull/30602
  2. brew install --HEAD gradio or brew install gradio
  3. Run gradio from command line

Detailed Description

Screenshot: screen shot 2018-07-30 at 3 07 43 am

Also the tray icon does not show properly and it doesn't work, but I suspect that to be an OSX issue.

haecker-felix commented 6 years ago

Wow! It seems that the standard icon theme is missing. Is "adwaita-icon-theme" installed?

krrk commented 6 years ago

Great, thanks! That fixed that. The icon theme was not installed by default with GTK+3, but my formula to build Gradio now depends on it. Now the only remaining issues I cannot figure out are the tray icon and app icon in the Dock/Task Switcher.

The tray icon appears like this: screen shot 2018-07-30 at 10 26 51 am and when I click on it it appears like this: screen shot 2018-07-30 at 10 34 59 am The tray icon also do not do anything with a left click or right click.

The dock icon does not show any icon, perhaps because I've launched gradio from the terminal? The .desktop file cannot be used in OSX. I believe it'll be fixed if I make an application bundle to launch Gradio.

screen shot 2018-07-30 at 10 42 06 am .

haecker-felix commented 6 years ago

The tray icon is broken. There is a issue in my .svg file. Someone needs to fix it. I don't know how. The icon should be fine on a dark menubar. This is not a macOS issue.

I'm not sure, but I belive to have a proper app icon, we need to create a real application bundle.

krrk commented 6 years ago

I made a simple application bundle which embeds an icon in the Mac style. The app bundle launches gradio from a shell script, but there still is no icon in the dock or application switcher. I found out that if I copy the gradio binary into the app bundle (instead of launching with a shell script) and put de.haeckerfelix.gradio.png next to it then finally the icon shows up.

The icons were installed as expected in /usr/local/share/icons/hicolor and when I ran gradio via gradio --gtk-debug=icontheme I can see that Gtk is looking for the file in that directory. I found the same behavior with glade, also installed via homebrew. So there is likely something broken about the homebrew setup.

It would be preferrable to launch gradio via a shell script as opposed to copying the binary then the app bundle wouldn't need to be rebuilt for every version change.

I also tried using a symbolic link to the gradio executable and this does work, but when copying the application bundle to the canonical location "/Applications" OSX actually dereferenced the symbolic link, putting the binary instead.

So perhaps this is something to take up with one of the Gtk homebrew formula or maybe it is even a bug with Gtk.

Here is my simple app bundle, currently with a symbolic link as long as homebrew was installed to /usr/local this should work. Gradio.app.zip

krrk commented 6 years ago

I also found this for building proper app bundles though this is much better for distribution say via the Apple App Store and it is not suitable for homebrew; however, I think the build can be performed with homebrew while using that tool to make the app bundle.

haecker-felix commented 6 years ago

Well, i think for the normal user it's easier to have a application bundle with all dependencies in it (like other macOS applications). Do know a suitable way, to make a app bundle from a homebrew pacakge?

Also, the symbolic link in the app bundle it's rather a workaround, than a real solution. And it's known, that GTK is a bit buggy on macOS.

krrk commented 6 years ago

I agree an application bundle with all dependencies would be best. As I said in my latest comment GNOME does provides a tool for making an application bundle after building and I think it is okay to build it with homebrew. Although I haven't yet tried the tool.

Here is the link again: https://wiki.gnome.org/Projects/GTK%2B/OSX/Bundling

haecker-felix commented 6 years ago

Me neither, unfortunately I haven't access to a macOS system right now - so i cannot test it.