def __init__(self, highlight_caret_scope=False): Panel.__init__(self) self._native_icons = False self._indicators_icons = ('folding.arrow_right_off', 'folding.arrow_right_on', 'folding.arrow_down_off', 'folding.arrow_down_on') self._block_nbr = -1 self._highlight_caret = False self.highlight_caret_scope = highlight_caret_scope self._indic_size = 16 #: the list of deco used to highlight the current fold region ( #: surrounding regions are darker) self._scope_decos = [] #: the list of folded blocs decorations self._block_decos = [] self.setMouseTracking(True) self.scrollable = True self._mouse_over_line = None self._current_scope = None self._prev_cursor = None self.context_menu = None self.action_collapse = None self.action_expand = None self.action_collapse_all = None self.action_expand_all = None self._original_background = None self._highlight_runner = DelayJobRunner(delay=250)
def __init__(self, highlight_caret_scope=False): Panel.__init__(self) self._native_icons = False self._indicators_icons = ( 'folding.arrow_right_off', 'folding.arrow_right_on', 'folding.arrow_down_off', 'folding.arrow_down_on' ) self._block_nbr = -1 self._highlight_caret = False self.highlight_caret_scope = highlight_caret_scope self._indic_size = 16 #: the list of deco used to highlight the current fold region ( #: surrounding regions are darker) self._scope_decos = [] #: the list of folded blocs decorations self._block_decos = [] self.setMouseTracking(True) self.scrollable = True self._mouse_over_line = None self._current_scope = None self._prev_cursor = None self.context_menu = None self.action_collapse = None self.action_expand = None self.action_collapse_all = None self.action_expand_all = None self._original_background = None self._highlight_runner = DelayJobRunner(delay=250)
def __init__(self, editor): """Initialize IndentationGuide panel. i_width(int): identation width in characters. """ Panel.__init__(self, editor) self.color = Qt.darkGray self.i_width = 4
def __init__(self, editor): Panel.__init__(self, editor) self._editor = editor self._editor.sig_cursor_position_changed.connect( self._handle_cursor_position_change_event ) # The layout hbox = QHBoxLayout() self.class_cb = QComboBox() self.method_cb = QComboBox() hbox.addWidget(self.class_cb) hbox.addWidget(self.method_cb) hbox.setSpacing(0) hbox.setContentsMargins(0, 0, 0, 0) self.setLayout(hbox) # Internal data self.folds = None self.parents = None self.classes = None self.funcs = None # Initial data for the dropdowns. self.class_cb.addItem("<None>", 0) self.method_cb.addItem("<None>", 0) # Attach some events. self.class_cb.activated.connect(self.combobox_activated) self.method_cb.activated.connect(self.combobox_activated)
def __init__(self): Panel.__init__(self) self.setMouseTracking(True) self.scrollable = True self.linenumbers_color = QColor(Qt.darkGray) # Markers self._markers_margin = True # Icons self.error_icon = ima.icon('error') self.warning_icon = ima.icon('warning') self.info_icon = ima.icon('information') self.hint_icon = ima.icon('hint') self.todo_icon = ima.icon('todo') # Line number area management self._margin = True self._pressed = -1 self._released = -1 # This is a tuple composed of (number of digits, current width) self._width_cache = None # Cache line numbers self._static_line_numbers = None self._static_active_line = None # Static text must be flushed when dpi changes (qt bug?) self._static_text_dpi = None
def __init__(self, editor): Panel.__init__(self, editor) self._editor = editor self._editor.sig_cursor_position_changed.connect( self._handle_cursor_position_change_event) # The layout hbox = QHBoxLayout() self.class_cb = QComboBox() self.method_cb = QComboBox() hbox.addWidget(self.class_cb) hbox.addWidget(self.method_cb) hbox.setSpacing(0) hbox.setContentsMargins(0, 0, 0, 0) self.setLayout(hbox) # Internal data self.folds = None self.parents = None self.classes = None self.funcs = None # Initial data for the dropdowns. self.class_cb.addItem("<None>", 0) self.method_cb.addItem("<None>", 0) # Attach some events. self.class_cb.activated.connect(self.combobox_activated) self.method_cb.activated.connect(self.combobox_activated)
def __init__(self, editor): """Initialize IndentationGuide panel. i_width(int): identation width in characters. """ Panel.__init__(self, editor) self.color = Qt.darkGray self.i_width = 4 self.bar_offset = 0 horizontal_scrollbar = editor.horizontalScrollBar() horizontal_scrollbar.valueChanged.connect(self.update_bar_position) horizontal_scrollbar.sliderReleased.connect(self.update)
def __init__(self): """Initialize panel.""" Panel.__init__(self) self.setMouseTracking(True) self.scrollable = True self.line_number_hint = None self._current_line_arrow = None self.stop = False # Diccionary of QIcons to draw in the panel self.icons = {'breakpoint': ima.icon('breakpoint_big'), 'transparent': ima.icon('breakpoint_transparent'), 'condition': ima.icon('breakpoint_cond_big'), 'arrow': ima.icon('arrow_debugger')}
def __init__(self): """Initialize panel.""" Panel.__init__(self) self.setMouseTracking(True) self.scrollable = True self.line_number_hint = None self._current_line_arrow = None # Diccionary of QIcons to draw in the panel self.icons = { 'breakpoint': ima.icon('breakpoint_big'), 'transparent': ima.icon('breakpoint_transparent'), 'condition': ima.icon('breakpoint_cond_big'), 'arrow': ima.icon('arrow_debugger') }
def __init__(self, editor): Panel.__init__(self, editor) self.setAttribute(Qt.WA_OpaquePaintEvent) self.scrollable = True self.setMouseTracking(True) # Define some attributes to be used for unit testing. self._unit_testing = False self._range_indicator_is_visible = False self._alt_key_is_down = False # Define permanent Qt colors that are needed for painting the flags # and the slider range. self._facecolors = { 'warning': QColor(editor.warning_color), 'error': QColor(editor.error_color), 'todo': QColor(editor.todo_color), 'breakpoint': QColor(editor.breakpoint_color), 'occurrence': QColor(editor.occurrence_color), 'found_results': QColor(editor.found_results_color) } self._edgecolors = { key: color.darker(120) for key, color in self._facecolors.items() } self._slider_range_color = QColor(Qt.gray) self._slider_range_color.setAlphaF(.85) self._slider_range_brush = QColor(Qt.gray) self._slider_range_brush.setAlphaF(.5) editor.sig_focus_changed.connect(self.update) editor.sig_key_pressed.connect(self.keyPressEvent) editor.sig_key_released.connect(self.keyReleaseEvent) editor.sig_alt_left_mouse_pressed.connect(self.mousePressEvent) editor.sig_alt_mouse_moved.connect(self.mouseMoveEvent) editor.sig_leave_out.connect(self.update) editor.sig_flags_changed.connect(self.delayed_update_flags) editor.sig_theme_colors_changed.connect(self.update_flag_colors) self._update_list_timer = QTimer(self) self._update_list_timer.setSingleShot(True) self._update_list_timer.timeout.connect(self.update_flags) self._todo_list = [] self._code_analysis_list = [] self._breakpoint_list = []
def __init__(self, editor): Panel.__init__(self, editor) self.setAttribute(Qt.WA_OpaquePaintEvent) self.scrollable = True self.setMouseTracking(True) # Define some attributes to be used for unit testing. self._unit_testing = False self._range_indicator_is_visible = False self._alt_key_is_down = False editor.sig_focus_changed.connect(self.update) editor.sig_key_pressed.connect(self.keyPressEvent) editor.sig_key_released.connect(self.keyReleaseEvent) editor.sig_alt_left_mouse_pressed.connect(self.mousePressEvent) editor.sig_alt_mouse_moved.connect(self.mouseMoveEvent) editor.sig_leave_out.connect(self.update) editor.sig_flags_changed.connect(self.update)
def __init__(self, editor): Panel.__init__(self, editor) self.setMouseTracking(True) self.scrollable = True self.linenumbers_color = QColor(Qt.darkGray) # Markers self._markers_margin = True self._markers_margin_width = 15 self.error_pixmap = ima.icon('error').pixmap(QSize(14, 14)) self.warning_pixmap = ima.icon('warning').pixmap(QSize(14, 14)) self.todo_pixmap = ima.icon('todo').pixmap(QSize(14, 14)) # Line number area management self._margin = True self._pressed = -1 self._released = -1
def __init__(self, editor): Panel.__init__(self, editor) self.setMouseTracking(True) self.scrollable = True self.linenumbers_color = QColor(Qt.darkGray) # Markers self._markers_margin = True # Icons self.error_icon = ima.icon('error') self.warning_icon = ima.icon('warning') self.info_icon = ima.icon('information') self.hint_icon = ima.icon('hint') self.todo_icon = ima.icon('todo') # Line number area management self._margin = True self._pressed = -1 self._released = -1
def __init__(self): Panel.__init__(self) self.setAttribute(Qt.WA_OpaquePaintEvent) self.scrollable = True self.setMouseTracking(True) # Define some attributes to be used for unit testing. self._unit_testing = False self._range_indicator_is_visible = False self._alt_key_is_down = False self._slider_range_color = QColor(Qt.gray) self._slider_range_color.setAlphaF(.85) self._slider_range_brush = QColor(Qt.gray) self._slider_range_brush.setAlphaF(.5) self._update_list_timer = QTimer(self) self._update_list_timer.setSingleShot(True) self._update_list_timer.timeout.connect(self.update_flags) # Dictionary with flag lists self._dict_flag_list = {}
def __init__(self): Panel.__init__(self) self._native_icons = False self._indicators_icons = ( 'folding.arrow_right_off', 'folding.arrow_right_on', 'folding.arrow_down_off', 'folding.arrow_down_on' ) self._block_nbr = -1 self._highlight_caret = False self.highlight_caret_scope = False self._indic_size = 16 #: the list of deco used to highlight the current fold region ( #: surrounding regions are darker) self._scope_decos = [] #: the list of folded blocs decorations self._block_decos = {} self.setMouseTracking(True) self.scrollable = True self._mouse_over_line = None self._current_scope = None self._prev_cursor = None self.context_menu = None self.action_collapse = None self.action_expand = None self.action_collapse_all = None self.action_expand_all = None self._original_background = None self._display_folding = False self._key_pressed = False self._highlight_runner = DelayJobRunner(delay=250) self.current_tree = IntervalTree() self.root = FoldingRegion(None, None) self.folding_regions = {} self.folding_status = {} self.folding_levels = {} self.folding_nesting = {}
def __init__(self): """Initialize panel.""" Panel.__init__(self) self.setMouseTracking(True) self.scrollable = True
def __init__(self, editor): Panel.__init__(self, editor) self.setAttribute(Qt.WA_OpaquePaintEvent) self.scrollable = True
def __init__(self, editor): Panel.__init__(self, editor) self.columns = (79, ) self.color = Qt.darkGray
def __init__(self, editor): Panel.__init__(self, editor) self.setAttribute(Qt.WA_OpaquePaintEvent) self._enabled = None editor.verticalScrollBar().valueChanged.connect( lambda value: self.repaint())