0ssamaak0 / DLTA-AI

Data Labeling, Tracking and Annotation with AI
GNU General Public License v3.0
314 stars 39 forks source link

dialogs are opened shifted to top left #62

Open 0ssamaak0 opened 10 months ago

0ssamaak0 commented 10 months ago

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))