def __init__( self, app, parent, name=None ):
super().__init__( parent )
self.name = name
self.style_normal = self.STYLE_DEFAULT
self.style_line_numbers = self.STYLE_LASTPREDEFINED + 1
self.style_line_numbers_for_diff = self.STYLE_LASTPREDEFINED
self.emptyUndoBuffer()
self.setMarginWidth( 0, 0 )
self.setMarginWidth( 1, 0 )
self.setMarginWidth( 2, 0 )
# make some styles
self.styleSetFromSpec( self.style_normal,
'size:%d,face:%s,fore:#000000,back:#e0e0e0' % (wb_config.point_size, wb_config.face) )
self.styleSetFromSpec( self.style_line_numbers,
'size:%d,face:%s,fore:#000000,back:#f0f0f0' % (wb_config.point_size, wb_config.face) )
self.styleSetFromSpec( self.style_line_numbers_for_diff,
'size:%d,face:%s,fore:#000000,back:#d0d0d0' % (wb_config.point_size, wb_config.face) )
# Calculate space for 6 digits
font = QtGui.QFont( wb_config.face, wb_config.point_size )
self.setFont( font )
fontmetrics = QtGui.QFontMetrics( font )
width = fontmetrics.width( '123456' )
self.setScrollWidth( width )
self.setMaximumWidth( width )
self.setMinimumWidth( width )
# no scroll bars on the line number control
self.setVScrollBar( False )
self.setHScrollBar( False )
wb_diff_side_by_side_view.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录