Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added native mode icon support #634

Closed
wants to merge 6 commits into from
Closed

Conversation

Skjolbir
Copy link

@Skjolbir Skjolbir commented Mar 25, 2023

Originated from #620.

from nicegui import ui,app

ui.label("hello")

ui.run(native=True, title="example", reload=True, icon_dir="favicon.ico")

Example image

First pull request ever, so please excuse any faux pas, or poor process.
All feedback is really appreciated.

@rodja
Copy link
Member

rodja commented Mar 27, 2023

Thank you for this contribution @Skjolbir. I hope I can do review/testing of this soon. It is somewhat related to #640.

@rodja rodja added the enhancement New feature or request label Mar 27, 2023


def activate(url: str, title: str, width: int, height: int, fullscreen: bool) -> None:
def open_window(url: str, title: str, width: int, height: int, fullscreen: bool, icon_dir = None) -> None:
def icon_callback():
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a pretty way of making a callback from window.events.shown with an argument, but I couldn't figure out a way to make that event callback with the icon_dir argument otherwise.

@rodja
Copy link
Member

rodja commented May 4, 2023

I'm super sorry for not giving feedback for such a long time. I've still not taken the time to dive into this. But it is not forgotten.

@firai
Copy link

firai commented Jul 20, 2023

FYI, there's a stale PR upstream in pywebview that I believe is supposed to do something similar (r0x0r/pywebview#786). It might be helpful as a reference.

@rodja
Copy link
Member

rodja commented Sep 18, 2023

We would like to see icon support in native mode. But it does not feel right to add platform specific code to the NiceGUI project. Hopefully pywebview will come to the rescue and provide a clean interface for us in the future.

@rodja rodja closed this Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

favicon arg for ui.run does not work when native is true, even with default nicegui favicon.
3 participants