We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I set the window width to 50px, but the result is larger than 50px. Is there a minimum width limit for the window?
package.json
{ "name": "floating-icon-test", "version": "0.0.1", "main": "index.html", "window": { "id": "floating-icon", "width": 50, "height": 50, "frame": false, "transparent": true, "resizable": true, "always_on_top": true, "show_in_taskbar": true } }
index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Floating Icon</title> <style> html, body { padding: 0; margin: 0; background-color: #fff; } .icon { width: 50px; height: 50px; background-color: red; border-radius: 50%; } </style> </head> <body> <div class="icon"></div> <script> const icon = document.querySelector(".icon"); const win = nw.Window.get(); let pos = { x: 0, y: 0 }; function onMouseDown(e) { pos = { x: e.pageX, y: e.pageY }; window.addEventListener("mousemove", onMouseMove); window.addEventListener("mouseup", onMouseUp); } function onMouseMove(e) { win.moveTo(e.screenX - pos.x, e.screenY - pos.y); } function onMouseUp(e) { window.removeEventListener("mousemove", onMouseMove); window.removeEventListener("mouseup", onMouseUp); } icon.addEventListener("mousedown", onMouseDown); </script> </body> </html>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue
I set the window width to 50px, but the result is larger than 50px.
Is there a minimum width limit for the window?
Code snippet
package.json
index.html
The text was updated successfully, but these errors were encountered: