[GRASS-SVN] r70534 - grass/trunk/gui/wxpython/lmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 11 14:24:38 PST 2017


Author: wenzeslaus
Date: 2017-02-11 14:24:38 -0800 (Sat, 11 Feb 2017)
New Revision: 70534

Modified:
   grass/trunk/gui/wxpython/lmgr/layertree.py
Log:
wxGUI/lmgr: center forms in Layers (layer props and v.colors) on parent, not screen

This reverts behavior from r42374, see also r32519.

Centering on lmgr is consistent with adding new layers.
It is not consistent with some other forms started from
layer context menu (e.g. r.colors).


Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py	2017-02-11 21:23:15 UTC (rev 70533)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py	2017-02-11 22:24:38 UTC (rev 70534)
@@ -154,6 +154,8 @@
         # if cursor points at layer checkbox (to cancel selection changes)
         self.hitCheckbox = False
         self.forceCheck = False              # force check layer if CheckItem is called
+        # forms default to centering on screen, this will put on lmgr
+        self.centreFromsOnParent = True
 
         try:
             ctstyle |= CT.TR_ALIGN_WINDOWS
@@ -1014,8 +1016,8 @@
     def OnVectorColorTable(self, event):
         """Set color table for vector map"""
         name = self.GetLayerInfo(self.layer_selected, key='maplayer').GetName()
-        GUI(parent=self, centreOnParent=False).ParseCommand(['v.colors',
-                                                             'map=%s' % name])
+        GUI(parent=self, centreOnParent=self.centreFromsOnParent).ParseCommand(
+            ['v.colors', 'map=%s' % name])
 
     def OnCopyMap(self, event):
         """Copy selected map into current mapset"""
@@ -1530,7 +1532,8 @@
 
         cmd = None
         if self.GetLayerInfo(layer, key='cmd'):
-            module = GUI(parent=self, show=show, centreOnParent=False)
+            module = GUI(parent=self, show=show,
+                         centreOnParent=self.centreFromsOnParent)
             module.ParseCommand(self.GetLayerInfo(layer, key='cmd'),
                                 completed=(self.GetOptData, layer, params))
             self.SetLayerInfo(layer, key='cmd', value=module.GetCmd())
@@ -1544,7 +1547,7 @@
                 cmd += GetDisplayVectSettings()
 
         if cmd:
-            module = GUI(parent=self, centreOnParent=False)
+            module = GUI(parent=self, centreOnParent=self.centreFromsOnParent)
             module.ParseCommand(cmd,
                                 completed=(self.GetOptData, layer, params))
 



More information about the grass-commit mailing list