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

dialogs are opened shifted to top left #62

Open
0ssamaak0 opened this issue Nov 24, 2023 · 0 comments
Open

dialogs are opened shifted to top left #62

0ssamaak0 opened this issue Nov 24, 2023 · 0 comments
Labels
bug Something isn't working Easy

Comments

@0ssamaak0
Copy link
Owner

when using a windows device with small screen (zoom 125%)

dialogs are opened shifted to top left like the following image:
image

Expected behavior: to render correctly in the middle:
image

Why this happen?
since we migrated to PyQt6 from PyQt5 in order to extend support for more devices, especially ARM based processors (mainyl apple silicon)
we used QtCore.Qt.HighDpiScaleFactorRoundingPolicy to fix the default zoom behavior made by PyQt6

Check line 20 in __main__.py

    QtWidgets.QApplication.setHighDpiScaleFactorRoundingPolicy(QtCore.Qt.HighDpiScaleFactorRoundingPolicy.RoundPreferFloor)

our suggestion to the most straightforward solution is to shift all dialogs internally to the middle, by capturing the screensize and shifting it accordingly, we made similar behavior in splash screen

Check lines 31 to 39 in __main__.py

        from screeninfo import get_monitors

        original_width = get_monitors()[0].width
        original_heigth = get_monitors()[0].height

        slapsh_width = splash.width()
        splash_height = splash.height()

        splash.move(int((original_width - slapsh_width) / 2), int((original_heigth - splash_height) / 2))
@0ssamaak0 0ssamaak0 added Easy bug Something isn't working labels Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Easy
Projects
None yet
Development

No branches or pull requests

1 participant