Skip to content
New issue

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

page.window.right #4730

Open
1 task done
SKD8 opened this issue Jan 17, 2025 · 0 comments
Open
1 task done

page.window.right #4730

SKD8 opened this issue Jan 17, 2025 · 0 comments

Comments

@SKD8
Copy link

SKD8 commented Jan 17, 2025

Duplicate Check

Describe the requested feature

I want to keep my window on the left or to the right based on a condition. and it's hard to get the maximum width of the display. so what if we have page.window.right it will be way easier.

import flet as ft
async def main(page: ft.Page):
max_width = 1280
async def check_window_position():
nonlocal max_width
while True:
if page.window.top > 0 and page.window.bgcolor == ft.colors.TRANSPARENT:
if page.window.left < max_width/2:
page.window.left = 0
page.update()
else:
page.window.left = max_width-10
page.update()
await asyncio.sleep(0.1) # Check every 100ms
asyncio.create_task(check_window_position())
page.add(ft.Text(""))
ft.app(main)

Suggest a solution

get a page.window.right

Screenshots

No response

Additional details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant