فهرست منبع

wxGUI: fix r.colors dropdown to show at least names when it can't find the thumbnails (merged from trunk, https://trac.osgeo.org/grass/changeset/59550)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@59551 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 11 سال پیش
والد
کامیت
503df804f7
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      gui/wxpython/gui_core/widgets.py

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

@@ -1279,8 +1279,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):