Skip to content

Commit

Permalink
Merge pull request #96 from vkbo/gui_tweaks
Browse files Browse the repository at this point in the history
GUI Tweaks: Set Qt5 default style to 'Fusion'
  • Loading branch information
vkbo committed Oct 30, 2019
2 parents 30ff34d + ec05986 commit 886a679
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions nw/__init__.py
Expand Up @@ -85,6 +85,7 @@ def main(sysArgs):
"config=",
"testmode",
"spell=",
"style=",
]

helpMsg = (
Expand All @@ -99,8 +100,9 @@ def main(sysArgs):
" -D, --debuggui Shows additional debug GUI elements. Includes -d.\n"
" -q, --quiet Disable output to command line. Does not affect log file.\n"
" -t, --time Shows time stamp in logging output. Adds milliseconds when --verbose.\n"
" -l, --logfile Specify log file.\n"
" --config Alternative config file.\n"
" -l, --logfile= Specify log file.\n"
" --style= Set Qt5 style flag. Defaults to Fusion.\n"
" --config= Alternative config file.\n"
" --headless Do not display GUI. Useful for testing scripts.\n"
).format(
appname = __package__,
Expand All @@ -121,6 +123,7 @@ def main(sysArgs):
testMode = False
debugGUI = False
spellTool = None
qtStyle = "Fusion"

# Parse Options
try:
Expand Down Expand Up @@ -149,6 +152,8 @@ def main(sysArgs):
timeStr = "[{asctime:}.{msecs:03.0f}] "
elif inOpt in ("-t","--time"):
showTime = True
elif inOpt in ("--style"):
qtStyle = inArg
elif inOpt in ("--config"):
confPath = inArg
elif inOpt in ("--testmode"):
Expand Down Expand Up @@ -195,7 +200,7 @@ def main(sysArgs):
nwGUI = GuiMain()
return nwGUI
else:
nwApp = QApplication([__package__])
nwApp = QApplication([__package__,("-style=%s" % qtStyle)])
nwGUI = GuiMain()
sys.exit(nwApp.exec_())

Expand Down

0 comments on commit 886a679

Please sign in to comment.