Exemple #1
0
 def select_color(cls, color, callback):
     '''select color, receives a e3.Message.Color with the current
     color the callback receives a new color object woth the new selection
     '''
     qt_color = Utils.e3_color_to_qcolor(color)
     new_qt_color = QtGui.QColorDialog.getColor(qt_color)
     if new_qt_color.isValid() and not new_qt_color == qt_color:
         color = Utils.qcolor_to_e3_color(new_qt_color)
         callback(color)
Exemple #2
0
 def select_color(cls, color, callback):
     '''select color, receives a e3.Message.Color with the current
     color the callback receives a new color object woth the new selection
     '''
     qt_color = Utils.e3_color_to_qcolor(color)
     new_qt_color = QtGui.QColorDialog.getColor(qt_color)
     if new_qt_color.isValid() and not new_qt_color == qt_color:
         color = Utils.qcolor_to_e3_color(new_qt_color)
         callback(color)
Exemple #3
0
    def _set_e3_style(self, e3_style):
        '''Sets the font style, given an e3 style'''
        qt_color =  Utils.e3_color_to_qcolor(e3_style.color)
        qt_font = QtGui.QFont()
        qt_font.setFamily(      e3_style.font   )
        qt_font.setBold(        e3_style.bold   )
        qt_font.setItalic(      e3_style.italic )
        qt_font.setStrikeOut(   e3_style.strike )
        qt_font.setPointSize(   e3_style.size   )

        self._set_qt_color(qt_color)
        self._set_qt_font(qt_font)
Exemple #4
0
    def _set_e3_style(self, e3_style):
        '''Sets the font style, given an e3 style'''
        qt_color = Utils.e3_color_to_qcolor(e3_style.color)
        qt_font = QtGui.QFont()
        qt_font.setFamily(e3_style.font)
        qt_font.setBold(e3_style.bold)
        qt_font.setItalic(e3_style.italic)
        qt_font.setStrikeOut(e3_style.strike)
        qt_font.setPointSize(e3_style.size)

        self._set_qt_color(qt_color)
        self._set_qt_font(qt_font)