Package schrodinger :: Package application :: Package bioluminate :: Module pml_menus :: Class ColorLabel
[hide private]
[frames] | no frames]

Class ColorLabel

PyQt4.QtGui.QLabel --+
                     |
                    ColorLabel

A label that shows off the color each element will be colored if this menu item is chosen.

The label changes its background color when the mouse is over it

Instance Methods [hide private]
 
__init__(self, text, menu, bg_normal='black', bg_mouseover='grey')
Create a ColorLabel instance
 
enterEvent(self, event)
Flip the background color when the mouse enters the label
 
leaveEvent(self, event)
Restore the background color when the mouse leaves the label
 
mousePressEvent(self, event)
Trigger this labels action when it is clicked on and close the menu
Method Details [hide private]

__init__(self, text, menu, bg_normal='black', bg_mouseover='grey')
(Constructor)

 

Create a ColorLabel instance

Parameters:
  • text (str) - The text this label will display - should be rich text with background-color:bg_normal within it in order to change colors when the mouse is over the label.
  • menu (str) - The menu this label will be placed in
  • bg_normal (str) - the normal background color of the label
  • bg_mouseover (str) - the background color of the label when the mouse is over it

enterEvent(self, event)

 

Flip the background color when the mouse enters the label

Parameters:
  • event (unused) - unused

leaveEvent(self, event)

 

Restore the background color when the mouse leaves the label

Parameters:
  • event (unused) - unused

mousePressEvent(self, event)

 

Trigger this labels action when it is clicked on and close the menu

Parameters:
  • event (unused) - unused