Closed Code4SAFrankie closed 1 year ago
Also page.window_center()
moves the window title bar of the screen sodat you cannot close the window or maximize and minimize it.
Would you mind posting a code you used to test that (if it's public)?
# For page.window_maximized = True
import flet
from flet import Page
def main(page: Page):
page.window_top = 0
page.window_left = 0
page.window_maximized = True
flet.app(target=main)
I notice that this does not actually maximize the window, it just resizes the window to fill the screen; but it's too high and goes under the taskbar, and it is not wide enough. It is about 3/5s of a mouse pointer width short of the entire width of the screen. This was on a 4k monitor.
Just add page.window_center()
to the above for the other comment.
page.window_left
also does not put the page all the way to the left. About 8 pixels out.
Same story with page.window_top
. And it seems to differ depending on what you put in the window.
You should call page.update()
to send page changes to Flet:
import flet
from flet import Page
def main(page: Page):
page.window_top = 0
page.window_left = 0
page.window_maximized = True
page.update()
flet.app(target=main)
Example above on my Windows 11 works like this:
What build of Windows 10 you have? Is there any specific monitors configuration? Could you record a video demonstrating an issue on your side please?
Thanks, adding page.update()
made page.window_maximized = True
work correctly. Is there any way to get the height of the title bar? I'm trying to do a precise layout where I stack text fields onto an image of a crossword puzzle. Adding the page.window_maximized = True
sadly completely breaks and changes my previous efforts, which strangely enough resizing the window to fit the entire screen does not do.
There is an issue to implement Bitsdojo for complete window customization: https://github.com/flet-dev/flet/issues/40 - is it something you are looking for?
Didn't understand too much of the Bitsdojo, but if it can remove the title it could work. Not sure how I would close the window then though. Not sure if it could just change the window content to go all the way up underneath the minimize, maximize and close icons. I assume this means there is no way to get the title bar height?
This is an example of Flet app that removes system title bar and uses it's own controls to move and close window: https://flet.dev/docs/controls/windowdragarea#app-window-without-a-title-that-can-be-moved
Flet does not perform window_maximized correctly on Windows 10.
page.window_maximized = True
sets the height of the window to be the height of the entire screen, instead of the height of the entire screen minus that of the taskbar; like other apps do. Alsopage.window_height
includes the height of the window title bar (with minimize, maximize and close buttons), but there does not seem to be any way to get the height of the window title bar; as such it is difficult to size an image to the page height, especially when targeting both 4k and 720p displays.