Ejemplo n.º 1
0
    def __init__(self):
        super(IEnv, self).__init__()
        self._lineheight = LINEHEIGHT           # global lineheight
        self._charwidth = CHARWIDTH             # global charwidth
        self._nascheme = EasyNA()               # default NA scheme
        self._aascheme = AESSN3()               # default AA scheme
        self._header = True
        self._footer = False
        self._split = 1
        self._panesplit = 1
        self._activeview = None
        self._tracesplit = 4

        # basic preference
        self.fonts = {
            'sequence': ('Monospace', 7 ),
            'label': QtGui.QFont('Monospace', 8 )
        }

        # colors
        self.colors = {
            'general-background': QtGui.QColor( 244, 244, 232 ),
            'sequence-selection': QtGui.QColor( 191, 191, 191, 64 ),
            'trace-selection': QtGui.QColor( 'lightblue' ),
        }

        # brush
        self.brushes = {
            'sequence-selection': QtGui.QBrush( self.colors['sequence-selection'] ),
            'trace-selection': QtGui.QBrush( self.colors['trace-selection'] ),
        }

        # pens
        self.pens = {
            'sequence-selection': QtGui.QPen( self.brushes['sequence-selection'], 0 )
        }
Ejemplo n.º 2
0
 def _create_image(self, c, color):
     p = QtGui.QPixmap(self.charwidth(), self.lineheight())
     painter = QtGui.QPainter(p)
     #painter.translate(0, self.font_height - 2)
     if self.shaded:
         fg_color = QtGui.QColor(*color[1])
         bg_color = QtGui.QColor(*color[0])
     else:
         fg_color = QtGui.QColor(*color[0])
         bg_color = QtGui.QColor(255, 255, 255)
     bg_brush = QtGui.QBrush(bg_color)
     painter.setBackground(bg_brush)
     painter.setBrush(bg_brush)
     painter.setPen(bg_color)
     painter.drawRect(0, 0, self.charwidth(), self.lineheight())
     painter.setPen(fg_color)
     painter.setFont(self.seqfont.font)
     painter.drawText(
         1, (self.lineheight() + self.seqfont.fontmetrics.ascent()) / 2,
         chr(c))
     painter.end()
     return p