Changeset 8189:8bc60d1059dd in orange


Ignore:
Timestamp:
08/16/11 19:41:42 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
cd73227788bd47c1691c1ac1a688283e83dba05d
Message:

Re-color the legend without errors when showing a gradient

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/plot/owlegend.py

    r8172 r8189  
    240240        for lst in self.items.itervalues(): 
    241241            for item in lst: 
    242                 item.text_item.setDefaultTextColor(self.graph.color(OWPalette.Text)) 
    243                 item.rect_item.setBrush(self.graph.color(OWPalette.Canvas)) 
     242                if hasattr(item, 'text_item'): 
     243                    item.text_item.setDefaultTextColor(self.graph.color(OWPalette.Text)) 
     244                if hasattr(item, 'rect_item'): 
     245                    item.rect_item.setBrush(self.graph.color(OWPalette.Canvas)) 
    244246        if self._orientation == Qt.Vertical: 
    245247            for lst in self.items.itervalues(): 
Note: See TracChangeset for help on using the changeset viewer.