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

Cannot override built-in flet icon in title bar when running application (Windows) -- no packaging #991

Closed
flamesjames opened this issue Feb 7, 2023 · 7 comments

Comments

@flamesjames
Copy link

Description

I haven't been able to find documentation or examples on how to override the built-in flet icon in the window title bar when running my python application. I've tried multiple methods from threads found online (1) and (2), including one where a maintainer described a method that seemed to work for them but no luck with either. I went thru the flet discussion boards as well and couldn't find any answers to this issue.

To be clear, creating an assets/icons directory and adding my own favicon.png did not work. I was still left with the default flet icon. Is there any easy way to override this for any time you run the application (without packaging)?

Describe the results you received:

image

Describe the results you expected:

My own defined app icon located within my assets directory.

Additional information you deem important (e.g. issue happens only occasionally):
Should work running app via command line or IDE.

Flet version (pip show flet):

Name: flet
Version: 0.3.2
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page: 
Author: 
Author-email: Appveyor Systems Inc. <hello@flet.dev>
License: MIT
Requires: beartype, oauthlib, packaging, repath, requests, watchdog, websocket-client

Operating system:

Windows 11 Home

Additional environment details:

@FeodorFitsner
Copy link
Contributor

Desktop app icon can be customized on packaging phase only: https://flet.dev/docs/guides/python/packaging-desktop-app#customizing-package-icon

@clstaudt
Copy link

clstaudt commented Feb 7, 2023

@FeodorFitsner Can we turn this into a feature request?

@flamesjames
Copy link
Author

@FeodorFitsner Can we turn this into a feature request?

I also think that this would be valuable

@eeintech
Copy link

eeintech commented Feb 23, 2023

Hello there, I support this request as distributing through PyPI as wheel package isn't compatible with packaging using PyInstaller/flet pack option.

I need to look for workarounds for my app: sparkmicro/Ki-nTree#124
But I'd rather get this icon to be showing at runtime if possible, so much easier to distribute!

@eeintech
Copy link

eeintech commented Feb 23, 2023

Moreover, the icon support appears to be only for Windows and MacOS?

I get this in the PyInstaller output when running flet pack app.py --icon logo.png command on my Ubuntu 22.04 laptop (with Pillow installed):

WARNING: Ignoring icon; supported only on Windows and macOS!

@ndonkoHenri
Copy link
Collaborator

To change the icon of your app without having to package, use page.window.icon, and specify a full path to the .ico icon file.
It works on Windows only for now.

@eeintech
Copy link

@ndonkoHenri Awesome thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants