Browse Source

wxGUI/lmgr: increasing width for some platforms because of missing menu items (https://trac.osgeo.org/grass/ticket/1742)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57518 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 11 years ago
parent
commit
0583d4e045
2 changed files with 16 additions and 2 deletions
  1. 15 1
      gui/wxpython/core/globalvar.py
  2. 1 1
      gui/wxpython/lmgr/frame.py

+ 15 - 1
gui/wxpython/core/globalvar.py

@@ -116,7 +116,21 @@ DIALOG_LAYER_SIZE = (100, -1)
 DIALOG_COLOR_SIZE = (30, 30)
 DIALOG_COLOR_SIZE = (30, 30)
 
 
 MAP_WINDOW_SIZE = (800, 600)
 MAP_WINDOW_SIZE = (800, 600)
-GM_WINDOW_SIZE = (525, 600)
+
+GM_WINDOW_MIN_SIZE = (525, 400)
+# small for ms window which wraps the menu
+# small for max os x which has the global menu
+# small for ubuntu when menuproxy is defined
+# not defined UBUNTU_MENUPROXY on linux means standard menu,
+# so the probably problem
+# UBUNTU_MENUPROXY= means ubuntu with disabled global menu [1]
+# use UBUNTU_MENUPROXY=0 to disbale global menu on ubuntu but in the same time
+# to get smaller lmgr
+# [1] https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationMenu#Troubleshooting
+if sys.platform in ('win32', 'darwin') or os.environ.get('UBUNTU_MENUPROXY'):
+    GM_WINDOW_SIZE = (GM_WINDOW_MIN_SIZE[0], 600)
+else:
+    GM_WINDOW_SIZE = (600, 600)
 
 
 if sys.platform == 'win32':
 if sys.platform == 'win32':
     BIN_EXT = '.exe'
     BIN_EXT = '.exe'

+ 1 - 1
gui/wxpython/lmgr/frame.py

@@ -172,7 +172,7 @@ class GMFrame(wx.Frame):
         self._giface.updateMap.connect(self._updateCurrentMap)
         self._giface.updateMap.connect(self._updateCurrentMap)
 
 
         # minimal frame size
         # minimal frame size
-        self.SetMinSize((globalvar.GM_WINDOW_SIZE[0], 400))
+        self.SetMinSize(globalvar.GM_WINDOW_MIN_SIZE)
 
 
         # AUI stuff
         # AUI stuff
         self._auimgr.AddPane(self.notebook, wx.aui.AuiPaneInfo().
         self._auimgr.AddPane(self.notebook, wx.aui.AuiPaneInfo().