Tauri
Alright, i decided to crate a suppport thread for this -as i have multiple questions.
For starters i have migrated the app and the router from
solid-start
to solidjs
with success. All of the previous issues i mentioned are now solved and working as expected.
I have a new issue, two in fact. One major and one minor.
I'll start with the major one.
tauri
uses data-params on the html elements to allow attaching certain html elements to the rust backend - this workedfine inreact. It not longer works as expected in solidjs. What i mean by this is the following.
Take this example html:
This is all i should need to create a custom titlebar. Now, the titlebar renders correctly, however there is no functionality. I should be able to click on the html element, minimize for example, and it minimizes the app. This does not happen, in fact nothing happens. However, i can click and drag on the titlebar and move the window around - so that is one functionality that is working correctly. I can also resize the window, though resizing the window is much less responsive than it should be.42 Replies
The second issue i am facing, much lower on the proirity list, is that the window can not be made transparent. The body is black, no matter what i do. I need a transparent window so that i set the corners as rounded. I did this in the react version of my app by setting the body to no color and rounding the corners of a wrapper div in the html (
main-div
in the example above). This used to work, now it does not.Regarding the titlebar, can you verify that the html rendered by solid (in the DOM) is the same (or different) than that rendered by react
Regarding the second issue, something probably has a color set somewhere that shouldn't...
since i made this post i have verified that the html is the same - the issue lies in the custom JS.
in my react-app i use a
custom.js
file to register the button events. Seems i am not implementing this correctly for solid
so, it's my mistakeI have done exactly what you're trying to do đ
https://github.com/dev-rb/glass
If you need reference for how to make it work
cheers, thank you for the link
This will help a lot xD
okay, and i see my mistake
Nice to know i got 99% of the way there though
what was the issue?
i am not setting up the transparency correctly, and i was not setting the event listeners onMount
seems you are using Solid itself to set the event listeners - i was trying to import a global script
custom.js
ahh yeah that could be why
actually, i just cloned your repo to test it
your titlebar buttons do not work either
I think I didn't enable them đ
I forgot about that
ah, okay. That makes sense
It's supposed to just render the titlebar, right? As you made the main window transparent?
I made the titlebar and window transparent from what I remember đ¤ Only the titlebar buttons are visible
yeah, that's all i get. Flourescent yellow titlebar
You can right click on the titlebar
alright, cool.
neat - i like the menu design
oh oop I was testing stuff and left the yellow đ¤Śââď¸
ooooh, you smart cookie.
You're using the winAPI on the rust side
I was wondering about that as well
I tried đ
It was very confusing
I couldn't get exactly what I wanted so I kind of abandoned the project
fair
I'll go back to it eventually but the winAPI was hurting my head after a few days
tauri is really awesome - but super finicky. I am trying to use it to teach myself front-end design. I am used to c++ and rust backend.
It was my first project with tauri
I mostly used electron
i hear that - its a nightmare
i want to like electron .... but i dont xD lmfao
tried it so many times
Tauri didn't exist when I started playing around with desktop apps
So electron was good enough
Plus, rust is scary đ
still is, i have nothing bad to say - don't know it well enough. I just always found it super bloated and annoyed that it packaged chromium everytime i tried to build an app
but those are personal gripes
Honestly, it can be an advantage to have chromium shipped with it
You can use chrome apis that don't exist in other browsers
đ¤
fair point, you are not bound to browser support issues
I needed local font access for a previous project and since I was using electron and because chromium was shipped with it, I had access to the Local Fonts Access api
If it was tauri, I wouldn't have had that access
yeah, that is true. Tauri does expose the browser native api's - but you,as the dev, have to be aware of the browser your app is intended to run in
For me, i havent explored beyond windows (yet) - so accessing Edge's apis from webView hasn't been too bad.
Same here
I'll try electron soon with a fresher mindset. I do like rust though xD - hard to move away from rust for me.
I need to learn rust but I haven't found a use case for it yet
Also, I just pushed changes to add the functionality for the titlebar and fix the color issue
i work in embedded development - so it's a given for me.
Yeah that's what I want to learn it for, but I haven't started working with embedded tech yet
soon though
will pull now, thanks again.
np
Ah, no more flourescent yellow screaming at me. woah o.o the always on top setting is super funky haha- i assume it's not supposed to behave like that, but interesting none the less
Oh, the always on top is intended. The window should be above everything else
mm, it is, but you can't click on anything inside of the window
Yeah I couldn't figure that part out đ
That's what I was trying to figure out with the win api
Technically I had it so you could click through the window but I was trying to figure out how to isolate the titlebar so you could at least drag it around too
But the only way to do it was through hotkeys but I also wanted a way for the user to use the mouse
yeah, now that's some complex UX
i like the vision
thanks đ