Skip to content

Commit

Permalink
Merge pull request vnpy#1308 from nanoric/fix_app_ui_blank_after_maxi…
Browse files Browse the repository at this point in the history
…miize

[Fix] 修正一个UI错误:修复了最大化app之后关闭再打开会显示一大片空白的问题
  • Loading branch information
vnpy authored Dec 28, 2018
2 parents 119d881 + ac9048b commit ae5151c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions vnpy/trader/uiMainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,15 @@ def openAppByDetail(self, appDetail):
:return 返回app的窗口
"""
appName = appDetail['appName']
try:
self.widgetDict[appName].show()
except KeyError:
appEngine = self.mainEngine.getApp(appName)
self.widgetDict[appName] = appDetail['appWidget'](appEngine, self.eventEngine)
self.widgetDict[appName].show()
return self.widgetDict[appName]
if appName not in self.widgetDict:
self.widgetDict[appName] = appDetail['appWidget'](self.mainEngine.getApp(appName),
self.eventEngine)
app = self.widgetDict[appName] # type: QtWidgets.QWidget
app.show()
app.resize(app.size()) # 修正最大化后的空白
app.raise_() # 移到前台
app.activateWindow() # 移到前台并获取焦点
return app

#----------------------------------------------------------------------
def createOpenAppFunction(self, appDetail):
Expand Down

0 comments on commit ae5151c

Please sign in to comment.