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

Double clicking flet.WindowDragArea causes window to expand even when page.window_frameless = True and/or page.window_maximizable = False #1056

Closed
JasonSettings opened this issue Feb 18, 2023 · 2 comments
Labels
bug Something isn't working enhancement Improvement/Optimization

Comments

@JasonSettings
Copy link

Description

Setting page.window_frameless = True and using flet.WindowDragArea instead of native title bar to move page around is somewhat awkward because Windows "expand window by double clicking title bar" behaviour is still in effect.

Code example to reproduce the issue:

import flet as ft


def main(page: ft.Page):
    page.window_bgcolor = ft.colors.TRANSPARENT
    page.bgcolor = ft.colors.TRANSPARENT
    page.window_frameless = True
    
    page.add(
        ft.WindowDragArea(
            ft.Container(
                width=300,
                height=300,
                bgcolor=ft.colors.BROWN_700,
                border_radius=ft.border_radius.all(20),
                padding=20,
                alignment=ft.alignment.center,
                content=ft.Column(
                    controls=[ft.Text('Double click here', size=28)],
                    alignment='center',
                ),
            )))
    page.update()


if __name__ == '__main__':
    ft.app(target=main)

Describe the results you received:

Double clicking anywhere inside of drag area causes window to enter this weird pseudo-maximized state - the expand animation plays, the window moves to upper left corner (or maybe center) and locks in this "maximized" state until you drag it a bit.
Also placing the window near display border invokes Windows expand/layout manager.

Describe the results you expected:

Would be cool to fix (or I guess block) this behaviour. Not sure if it is actually possible.

Flet version:

Name: flet
Version: 0.4.0
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page: 
Author: Appveyor Systems Inc.
Author-email: [email protected]
License: MIT
Location: C:\Python Installs\Venvs\venv_main\Lib\site-packages
Requires: flet-core, httpx, oauthlib, packaging, watchdog, websocket-client, websockets

Operating system:

Windows 11 22H2

@FeodorFitsner
Copy link
Contributor

I think we could add maximizable property to WindowDragArea, so double-click could be enabled/disabled programmatically - how does it sound?

@FeodorFitsner FeodorFitsner added bug Something isn't working enhancement Improvement/Optimization labels Feb 19, 2023
@JasonSettings
Copy link
Author

Any method you deem convenient and logical will suffice (I'm not really in a position to discuss details with a dev)! In my opinion, the option to turn off/block maximization completely is needed for drag area.

berecik pushed a commit to Marysia-Software-Limited/flet that referenced this issue Apr 3, 2023
* Fix window transparency

Related issue: leanflutter/window_manager#293

* Custom `WindowDragArea` with `maximizable` prop

Close flet-dev#1056
zrr1999 pushed a commit to zrr1999/flet that referenced this issue Jul 17, 2024
* Fix window transparency

Related issue: leanflutter/window_manager#293

* Custom `WindowDragArea` with `maximizable` prop

Close flet-dev#1056
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement Improvement/Optimization
Projects
None yet
Development

No branches or pull requests

2 participants