flaskwebgui icon indicating copy to clipboard operation
flaskwebgui copied to clipboard

Dimensions for window not working.

Open gadhagod opened this issue 4 years ago • 5 comments

Hi. When setting fullscreen, width, or height, it does not render in the window that is opened.

from flask import Flask  
from flask import render_template
from flaskwebgui import FlaskUI

app = Flask(__name__)
ui = FlaskUI(app, fullscreen=True)


@app.route('/')
def hello():  
    return render_template('index.jinja')

if __name__ == '__main__':
    ui.run()

I still get the default dimensions opened. Is this happening to anyone else? Any fix? I am using the latest version. By the way, this library is super useful! Thanks for making this.

gadhagod avatar Feb 20 '21 02:02 gadhagod

Yes, not sure why this issue appears... the --window-size flag is ignored, there may be the case of sistem defaults which I mentioned here: https://github.com/ClimenteA/flaskwebgui/issues/23, I saw this is an issue also on chromium (on which chrome is based).

The line which should set the window size is here, feel free to take a look, I didn't found a solution for this issue.

ClimenteA avatar Feb 21 '21 10:02 ClimenteA

Hi @ClimenteA. Thanks for your reply. I'll take a look, but am not an expert, so I don't know if I can solve the issue. Also, I think it might be a good idea to add a note of this to the README or something, because I spent quite some time debugging before realizing that this was a problem with the library.

gadhagod avatar Feb 22 '21 03:02 gadhagod

The readme and code examples probably should remove mentions of width, height and fullscreen etc. because they don't work - so why confuse people and say that they are a feature of this library? I too spent quite some time chasing this.

abulka avatar Aug 11 '21 04:08 abulka

@gadhagod @abulka Are you still having problems on implementing the window size? if so can you provide de OS you're using and the version of chromium/chrome.

baezfb avatar Nov 13 '21 03:11 baezfb

I added script to base template:

.

And it works for me.

hitnik avatar Nov 14 '21 15:11 hitnik

Updated docs to point out that issue may appear in some cases

ClimenteA avatar Sep 22 '22 10:09 ClimenteA