Comments (12)
I did take a look at a program that I use to flash my keyboard's firmware with as that is build with Wails and on their Linux version, they don't have an icon set. Looking through the documentation, apparently Linux isn't supported as far as easy packaging and since they "bundled" the conversation of the program's icon with packaging, I would say that it includes setting the icon as well for Linux.
from nimview.
I changed the way I import webview. This should hopefully avoid the "bad import".
Also, I changed the way webview is closed, so hopefully, the application stops when stopping webview now.
Currently, the only problem left is that the icon needs to be in some file when nimview starts and it is not compiled into the binary. I guess using nimassets is one do-able way to handle this.
Will close this for now and will create a new tag soon.
Let me know if you still have some issues and thx for the hints and for trying out :)
from nimview.
I haven't tried, but I think this might already work when unsing a .rc and an .ico file. Nimview is using the same webview code as wails and there already was a fix to wails for this:
wailsapp/wails#424
from nimview.
Aaahhh ok. I'll go digging around and see what I can come up with.
Thanks for the help.
from nimview.
Will probably also have a deeper look at this when I have time.
Keep me up to date if you somehow find a way to set the icon. Maybe it just works different for "Wails". Maybe this still is simple.
Thx for creating the issue. I completely forgot about the icon :)
from nimview.
Nothing so far, but it could be related to the fact that I'm on Linux, even that issue only referenced windows and mac, so even if I do have it right, it may still not be showing up due to being on Linux and having to run .png versus .ico and I'm still getting the standard x11 window icon for webkit.
from nimview.
Thx for having a look.
It seems that this might be something that gtk could do.
Nimview is using webview and webview is using gtk on linux. Using internal gtk functions could do the trick on linux.
Accoring to this gh issue webview/webview#28
There is a gtk api to change the icon.
https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-set-icon
So - it might be necessary to call plain C functions and/or change webview.h to implement this.
Not sure if this function still exists, if this actually works or if this just might be complicate to implement.
Just wanted to let you know.
from nimview.
I just added an option to add an icon. You can call a function before calling run:
startDesktop("dist/index.html", run=false)
setIcon(currentSourcePath.parentDir() / "icon.ico")
run()
I only tested it on windows, but it may also work on linux. There is a sample icon in "tests/icon.ico"
Not sure if this is the final version. It would probably be better to have the icon included in the binary. But this is at least some good start.
Edit:
Oh - and this isn't included yet in the latest tag. It is only available in the main branch.
from nimview.
Oh cool, I'll give this a shot when I'm back at that computer and see how that work for Linux.
Thanks!
from nimview.
It works if the html file isn't declared anywhere outside of the location that the program looks for to bundle it in the binary on it's own. When I try to point it to the temp location that's when the icon doesn't show up. Since I use nimassets to bundle everything, I would be declaring outside of the normal location.
It also doesn't appear to close out the connection when closing out the program. I notice that my CLI is still going after exiting the gui portion of the program.
from nimview.
It appears that if I were to install your version of webview, further in nimview's source, and import webview, I am able to do everything as expected with using nimassets and having the icon show up. At least on the Linux side. I have not tried this on my Windows machines yet.
Just thought I would mention that, hope it helps.
from nimview.
@wwderw
Thx. This helps a lot. I need to find out how my own library can prefer its webview folder instead of using an installed webview. No idea yet how to do this in Nim.
from nimview.
Related Issues (20)
- Backend not working in Webview HOT 22
- full screen mode in nim view HOT 4
- publish apk to playstore. HOT 8
- Adding event system to send async information to client
- callFrontendJs on Android HOT 2
- Building in release mode does not seem to work HOT 4
- Create a bigger usefull application HOT 1
- Create some good tutorial HOT 1
- "callFrontendJs" in Webview mode doesn't update DOM HOT 1
- SIGSEGV after ~254 times calling "callFrontendJs" / "callJs" when threads enabled and using "--gc:refc" HOT 5
- How to create application icons for the taskbar and main window? HOT 2
- Compiling with "just_core" flag - Error redefinition of "compileWithWebview" const HOT 2
- Add React Typescript example HOT 10
- Build error on react example HOT 3
- Switch rendering engine HOT 1
- [SupportRequest] Angular usage impossible as app-component does not get loaded, but only in webview (?) HOT 3
- Unicode support in release mode HOT 2
- How do you compile, debug-run & deploy on android? HOT 4
- Feature request: run "nimview.start()" with the first parameter as a string of html, rather than a file path
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nimview.