Browse Source

wxGUI: display background color (global)
(merge from devbr6, https://trac.osgeo.org/grass/changeset/34158)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@34159 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 years ago
parent
commit
522770bb4a
2 changed files with 27 additions and 2 deletions
  1. 23 1
      gui/wxpython/gui_modules/preferences.py
  2. 4 1
      gui/wxpython/gui_modules/render.py

+ 23 - 1
gui/wxpython/gui_modules/preferences.py

@@ -100,6 +100,9 @@ class Settings:
                 'statusbarMode': {
                     'selection' : 0
                     },
+                'bgcolor': {
+                    'color' : (255, 255, 255, 255),
+                    }
                 },
             #
             # advanced
@@ -1013,6 +1016,25 @@ class PreferencesDialog(wx.Dialog):
                       pos=(row, 1))
 
         #
+        # Background color
+        #
+        row += 1
+        gridSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
+                                         label=_("Background color:")),
+                      flag=wx.ALIGN_LEFT |
+                      wx.ALIGN_CENTER_VERTICAL,
+                      pos=(row, 0))
+        bgColor = csel.ColourSelect(parent=panel, id=wx.ID_ANY,
+                                    colour=self.settings.Get(group='display', key='bgcolor', subkey='color'),
+                                    size=(35, 35))
+        bgColor.SetName('GetColour')
+        self.winId['display:bgcolor:color'] = bgColor.GetId()
+        
+        gridSizer.Add(item=bgColor,
+                      flag=wx.ALIGN_RIGHT,
+                      pos=(row, 1))
+        
+        #
         # Use computation resolution
         #
         row += 1
@@ -1185,7 +1207,7 @@ class PreferencesDialog(wx.Dialog):
         label = wx.StaticText(parent=panel, id=wx.ID_ANY, label="Color")
         hlColor = csel.ColourSelect(parent=panel, id=wx.ID_ANY,
                                     colour=self.settings.Get(group='atm', key='highlight', subkey='color'),
-                                    size=(25, 25))
+                                    size=(35, 35))
         hlColor.SetName('GetColour')
         self.winId['atm:highlight:color'] = hlColor.GetId()
 

+ 4 - 1
gui/wxpython/gui_modules/render.py

@@ -896,11 +896,14 @@ class Map(object):
             mapoutstr = self.mapfile.replace('\\', '/')
 
         # compose command
+        bgcolor = ':'.join(map(str, UserSettings.Get(group='display', key='bgcolor',
+                                                     subkey='color')))
+        
         complist = ["g.pnmcomp",
                     "in=%s" % ",".join(maps),
                     "mask=%s" % ",".join(masks),
                     "opacity=%s" % ",".join(opacities),
-                    "background=255:255:255",
+                    "background=%s" % bgcolor,
                     "width=%s" % str(self.width),
                     "height=%s" % str(self.height),
                     "output=%s" % self.mapfile]