Exemplo n.º 1
0
    def __init__(self):
        WindowBuilder.__init__(self, 'preferences')

        self.dialog.connect('response', self.__on_response)
        self.dialog.connect('delete-event', self.__on_delete_event)

        global_settings.connect('notify::editor-font-is-custom', self.__on_notify_editor_font_is_custom)
        self.__on_notify_editor_font_is_custom()

        self.editor_font_custom_check_button.connect('toggled', self.__on_editor_font_custom_check_button_toggled)
        self.__on_editor_font_custom_check_button_toggled()

        global_settings.connect('notify::editor-font-name', self.__on_notify_editor_font_name)
        self.__on_notify_editor_font_name()

        self.editor_font_button.connect('font-set', self.__on_editor_font_set)

        global_settings.connect('notify::doc-tooltip-font-is-custom', self.__on_notify_doc_tooltip_font_is_custom)
        self.__on_notify_doc_tooltip_font_is_custom()

        self.doc_tooltip_font_custom_check_button.connect('toggled', self.__on_doc_tooltip_font_custom_check_button_toggled)
        self.__on_doc_tooltip_font_custom_check_button_toggled()

        global_settings.connect('notify::doc-tooltip-font-name', self.__on_notify_doc_tooltip_font_name)
        self.__on_notify_doc_tooltip_font_name()

        self.doc_tooltip_font_button.connect('font-set', self.__on_doc_tooltip_font_set)

        global_settings.connect('notify::autocomplete', self.__on_notify_autocomplete)
        self.__on_notify_autocomplete()

        self.autocomplete_check_button.connect('toggled', self.__on_autocomplete_check_button_toggled)
Exemplo n.º 2
0
    def __init__(self, fixed_height=False, fixed_width=False, max_height=MAX_HEIGHT, can_focus=True):
        Popup.__init__(self)

        self.__fixed_height = fixed_height
        self.__fixed_width = fixed_width
        self.__max_height = max_height
        self.__can_focus = can_focus

        self.__view = gtk.TextView()
        self.__view.set_editable(False)
        
        bg_color = gtk.gdk.Color(0xffff, 0xffff, 0xbfbf)
        self.__view.modify_base(gtk.STATE_NORMAL, bg_color)
        self.modify_bg(gtk.STATE_NORMAL, bg_color)
        self.set_app_paintable(True)
        
        self.__view.modify_text(gtk.STATE_NORMAL, gtk.gdk.Color(0, 0, 0))
        self.__view.set_parent(self)
        self.__view.show()
        self.__view.grab_focus()

        self.__font_is_custom_connection = global_settings.connect('notify::doc-tooltip-font-is-custom', self.__update_font)
        self.__font_name_connection = global_settings.connect('notify::doc-tooltip-font-name', self.__update_font)
        self.__update_font()

        self.__scrollbar = gtk.VScrollbar()
        self.__scrollbar.set_parent(self)
        self.__scrollbar.show()
        self.__view.emit('set-scroll-adjustments', None, self.__scrollbar.get_adjustment())

        self.__vscrolled = False

        self.set_resizable(False)
            
        buf = self.__view.get_buffer()
        self.__bold_tag = buf.create_tag(None, weight=pango.WEIGHT_BOLD)
        self.__heading_type_tag = buf.create_tag(None, weight=pango.WEIGHT_BOLD, pixels_below_lines=5)
        self.__inline_type_tag = self.__bold_tag
        self.__value_tag = buf.create_tag(None, family="monospace")

        self.__target = None
        self.focused = False
Exemplo n.º 3
0
    def __init__(self, notebook):
        Editor.__init__(self, notebook)

        self.buf = ShellBuffer(self.notebook, edit_only=True)
        self.view = ShellView(self.buf)

        self.__font_is_custom_connection = global_settings.connect('notify::editor-font-is-custom', self.__update_font)
        self.__font_name_connection = global_settings.connect('notify::editor-font-name', self.__update_font)
        self.__update_font()

        self.widget = gtk.ScrolledWindow()
        self.widget.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)

        self.widget.add(self.view)

        self.widget.show_all()

        self.buf.worksheet.connect('notify::filename', lambda *args: self._update_filename())
        self.buf.worksheet.connect('notify::file', lambda *args: self._update_file())
        self.buf.worksheet.connect('notify::code-modified', lambda *args: self._update_modified())