Skip to content

Commit

Permalink
scaling and font changes are Windows only
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeSullivan7 committed Nov 27, 2023
1 parent b393ac0 commit 1299d90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mantidimaging/main.py
Original file line number Diff line number Diff line change
@@ -55,9 +55,6 @@ def parse_args() -> argparse.Namespace:


def setup_application() -> QApplication:
os.environ["QT_ENABLE_HIGHDPI_SCALING"] = "1"
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
os.environ["QT_SCALE_FACTOR"] = "1"
QGuiApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
q_application = QApplication(sys.argv)
q_application.setStyle('Fusion')
@@ -66,6 +63,9 @@ def setup_application() -> QApplication:
q_application.setOrganizationDomain("mantidproject.org")
screens = q_application.screens()
if sys.platform == 'win32':
os.environ["QT_ENABLE_HIGHDPI_SCALING"] = "1"
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
os.environ["QT_SCALE_FACTOR"] = "1"
base_font_size = int(q_application.font().pointSize() * 0.8)
font_scale_factor = screens[0].physicalDotsPerInch() / 90
font = QFont(q_application.font().family(), int(font_scale_factor * base_font_size))

0 comments on commit 1299d90

Please sign in to comment.