Browse Source

wxGUI: hack writing workspace for wxPython (incorrect height) (TODO: find out why this bug appears with wxPython)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64766 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 years ago
parent
commit
c1ce0ff74e
2 changed files with 6 additions and 2 deletions
  1. 3 0
      gui/wxpython/core/workspace.py
  2. 3 2
      gui/wxpython/lmgr/frame.py

+ 3 - 0
gui/wxpython/core/workspace.py

@@ -20,6 +20,7 @@ import os
 
 import wx
 
+from core.globalvar import wxPython3
 from core.utils     import normalize_whitespace, _
 from core.settings  import UserSettings
 from core.gcmd      import EncodeString, GetDefaultEncoding
@@ -739,6 +740,8 @@ class WriteWorkspaceFile(object):
             
             displayPos = mapdisp.GetPosition()
             displaySize = mapdisp.GetSize()
+            if wxPython3:
+                displaySize[1] -= 32 # see related hack on line lmgr.frame.LoadWorkspaceFile()
             if mapdisp.toolbars['map'].combo.GetSelection() == 1:
                 viewmode = '3d'
             else:

+ 3 - 2
gui/wxpython/lmgr/frame.py

@@ -1282,8 +1282,9 @@ class GMFrame(wx.Frame):
                     mapdisp.SetPosition(display['pos'])
                 if display['size']:
                     if globalvar.wxPython3:
-                        # incorrect height
-                        # TODO: fix it in better way (...)
+                        # Incorrect height
+                        # TODO: fix it in better way !!!
+                        # Then also remove hack in core.workspace.WriteWorkspaceFile() ...
                         display['size'] = (display['size'][0], display['size'][1] + 32)
                     mapdisp.SetSize(display['size'])