Ejemplo n.º 1
0
    def __state_cell_data_func(self, column, cell, model, iter):
        item = model.get_value(iter, 0)

        if isinstance(item, _HeaderItem):
            cell.props.background_gdk = gtk.gdk.Color(0xffff,0xdddd,0xbbbb)
        else:
            cell.props.background_gdk = None

        if isinstance(item, _FileItem):
            cell.props.stock_id = NotebookFile.stock_id_for_state(item.file.state)
        else:
            cell.props.stock_id = None
Ejemplo n.º 2
0
    def __create_editor_item(self, editor):
        def on_activate(item):
            self._make_editor_current(editor)

        item = gtk.ImageMenuItem("")
        editor._menu_item_label = item.get_child()
        editor._menu_item_label.set_markup(format_escaped("<b>%s</b>", editor.title))
        item.connect("activate", on_activate)

        editor._menu_item_status = gtk.Image()
        editor._menu_item_status.props.icon_size = gtk.ICON_SIZE_MENU
        editor._menu_item_status.props.stock = NotebookFile.stock_id_for_state(editor.state)
        item.set_image(editor._menu_item_status)

        return item
Ejemplo n.º 3
0
    def __create_editor_item(self, editor):
        def on_activate(item):
            self._make_editor_current(editor)

        item = gtk.ImageMenuItem("")
        editor._menu_item_label = item.get_child()
        editor._menu_item_label.set_markup(
            format_escaped("<b>%s</b>", editor.title))
        item.connect('activate', on_activate)

        editor._menu_item_status = gtk.Image()
        editor._menu_item_status.props.icon_size = gtk.ICON_SIZE_MENU
        editor._menu_item_status.props.stock = NotebookFile.stock_id_for_state(
            editor.state)
        item.set_image(editor._menu_item_status)

        return item
Ejemplo n.º 4
0
 def _update_editor_state(self, editor):
     BaseNotebookWindow._update_editor_state(self, editor)
     if hasattr(editor, '_menu_item_status'):
         editor._menu_item_status.props.stock = NotebookFile.stock_id_for_state(
             editor.state)
Ejemplo n.º 5
0
 def _update_editor_state(self, editor):
     BaseNotebookWindow._update_editor_state(self, editor)
     if hasattr(editor, "_menu_item_status"):
         editor._menu_item_status.props.stock = NotebookFile.stock_id_for_state(editor.state)
Ejemplo n.º 6
0
 def _update_editor_state(self, editor):
     BaseNotebookWindow._update_editor_state(self, editor)
     editor._notebook_tab_status.props.stock = NotebookFile.stock_id_for_state(editor.state)