Jelajahi Sumber

wxGUI: fix r.colors dropdown to show at least names when it can't find the thumbnails

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59550 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 11 tahun lalu
induk
melakukan
12c73c13d8
1 mengubah file dengan 4 tambahan dan 1 penghapusan
  1. 4 1
      gui/wxpython/gui_core/widgets.py

+ 4 - 1
gui/wxpython/gui_core/widgets.py

@@ -1290,8 +1290,11 @@ class PictureComboBox(wx.combo.OwnerDrawnComboBox):
         bitmap = self.GetPictureBitmap(self.GetString(item))
         if bitmap:
             dc.DrawBitmap(bitmap, r.x, r.y + (r.height - bitmap.GetHeight()) / 2)
+            width = bitmap.GetWidth() + 10
+        else:
+            width = 0
         dc.DrawText(self.GetString(item),
-                    r.x + bitmap.GetWidth() + 10,
+                    r.x + width,
                     (r.y + 0) + (r.height - dc.GetCharHeight()) / 2)
 
     def OnMeasureItem(self, item):