- fixed a bug in Tool Transform that made the user to not be able to capture the click coordinates with SHIFT + LMB click combo
- added the ability to choose an App QStyle out of the offered choices (different for each OS) to be applied at the next app start (Preferences -> General -> Gui Pref -> Style Combobox) - added support for FlatCAM usage with High DPI monitors (4k). It is applied on the next app startup after change in Preferences -> General -> Gui Pref -> HDPI Support Checkbox
This commit is contained in:
27
FlatCAM.py
27
FlatCAM.py
@@ -1,7 +1,8 @@
|
||||
import sys
|
||||
import sys, os
|
||||
from PyQt5 import sip
|
||||
|
||||
from PyQt5 import QtGui, QtCore, QtWidgets
|
||||
from PyQt5.QtCore import QSettings, Qt
|
||||
from FlatCAMApp import App
|
||||
from multiprocessing import freeze_support
|
||||
import VisPyPatches
|
||||
@@ -31,7 +32,31 @@ if __name__ == '__main__':
|
||||
debug_trace()
|
||||
VisPyPatches.apply_patches()
|
||||
|
||||
# apply High DPI support
|
||||
settings = QSettings("Open Source", "FlatCAM")
|
||||
if settings.contains("hdpi"):
|
||||
hdpi_support = settings.value('hdpi', type=int)
|
||||
else:
|
||||
hdpi_support = 0
|
||||
|
||||
if hdpi_support == 2:
|
||||
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
|
||||
else:
|
||||
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "0"
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
|
||||
# apply style
|
||||
settings = QSettings("Open Source", "FlatCAM")
|
||||
if settings.contains("style"):
|
||||
style = settings.value('style', type=str)
|
||||
app.setStyle(style)
|
||||
|
||||
if hdpi_support == 2:
|
||||
app.setAttribute(Qt.AA_EnableHighDpiScaling, True)
|
||||
else:
|
||||
app.setAttribute(Qt.AA_EnableHighDpiScaling, False)
|
||||
|
||||
fc = App()
|
||||
|
||||
sys.exit(app.exec_())
|
||||
|
||||
Reference in New Issue
Block a user