GregVido / mica-electron

Library to add mica effect of windows 11 in electron app
Apache License 2.0
126 stars 7 forks source link

Not run, need basic example #5

Open dariomadeira opened 1 year ago

dariomadeira commented 1 year ago

Hi! thanks for your work! I have tried to create a basic example by cloning the electron js repository and adding mica-electron to it, I had some problems with the nove version, but when I try to run , I get an error in the main.js. I used the example at https://www.npmjs.com/package/mica-electron the problem seems to be that EFFECT is not defined, I had to fetch the values with const { PARAMS, VALUE, EFFECT, MicaBrowserWindow } = require('mica-electron'); but it doesn't work and gives me another error, is it possible to have a basic example? I haven't been able to run it at all. Thank you! Captura de pantalla 2022-10-24 191142

GregVido commented 1 year ago

Hello, sorry it's a fail, replace

win.setVisualEffect(EFFECT.CORNER, PARAMS.CORNER.ROUNDSMALL); // Small rounded

By

win.setVisualEffect(PARAMS.CORNER, VALUE.CORNER.ROUNDSMALL); // Small rounded

dariomadeira commented 1 year ago

Hello @GregVido your work is fabulous! Now I have made it run, but the background is still black, the title does have the Mica effect as it should be, I have no idea what I am doing wrong, I put the background of the transparent window but it seems not to take it. If you can tell me what's wrong, I'd appreciate it. Captura de pantalla 2022-10-27 102645 Captura de pantalla 2022-10-27 102712

GregVido commented 1 year ago

Hello, thanks hehe, try to put a transparent background with css, you have an example of this here : https://github.com/GregVido/mica-electron/tree/main/files

dariomadeira commented 1 year ago

Thanks @GregVido but it hasn't worked for me, I've tried making the css transparent, copying the files folder, using the devtools, trying to get code out of the example.js and it hasn't worked. He has told me that executeDwm is not defined when imported. I guess I'll wait a bit and try to do the steps from scratch again, I'll try to see what the correct steps are since I clone the electron repository and install this package. Thank you very very much! Captura de pantalla 2022-10-27 190405 Captura de pantalla 2022-10-27 190300

GregVido commented 1 year ago

Hello, I don't understand why it's no work, why is your windows 11 version ? (windows + r -> winver)

dariomadeira commented 1 year ago

he tried to do everything from scratch but i get the same result my steps are: 1) clone the electron repository 2) npm i mica-electron 3) modify the main.js as I put the screenshots 4) change the style.css putting the body and the htm with transparent background Captura de pantalla 2022-10-29 162059

GregVido commented 1 year ago

Have you done all Windows updates?

dariomadeira commented 1 year ago

Yes, i update windows11 to last version