webui-dev / webui

Use any web browser or WebView as GUI, with your preferred language in the backend and modern web technologies in the frontend, all in a lightweight portable library.
https://webui.me
MIT License
2.9k stars 164 forks source link

disable window resize ?? #209

Closed skinkairewalker closed 11 months ago

skinkairewalker commented 11 months ago

Hello everyone, is there any way to disable the resizing of the webui window?

AlbertShown commented 11 months ago

I guess not. The window is not an object in your application, but it's a web browser. But you can try some JavaScript to disable the resizing of the window probbaly.

malisipi commented 11 months ago

There're a little tricky way to do it

window.allow_height = 480;
window.allow_width = 640;

window.resizeTo(window.allow_width, window.allow_height);
window.addEventListener("resize", ()=>{
    if(window.outerHeight==window.allow_height && window.outerWidth==allow_width) return;
    window.resizeTo(window.allow_width, window.allow_height);
});