コード例 #1
0
ファイル: listview.py プロジェクト: nemesiscodex/jarabe
    def _show_message(self, message, show_clear_query=False):
        canvas = hippo.Canvas()
        self.remove(self.child)
        self.add(canvas)
        canvas.show()

        box = hippo.CanvasBox(orientation=hippo.ORIENTATION_VERTICAL,
                              background_color=style.COLOR_WHITE.get_int(),
                              yalign=hippo.ALIGNMENT_CENTER,
                              spacing=style.DEFAULT_SPACING,
                              padding_bottom=style.GRID_CELL_SIZE)
        canvas.set_root(box)

        icon = CanvasIcon(size=style.LARGE_ICON_SIZE,
                          icon_name='activity-journal',
                          stroke_color=style.COLOR_BUTTON_GREY.get_svg(),
                          fill_color=style.COLOR_TRANSPARENT.get_svg())
        box.append(icon)

        text = hippo.CanvasText(text=message,
                                xalign=hippo.ALIGNMENT_CENTER,
                                font_desc=style.FONT_BOLD.get_pango_desc(),
                                color=style.COLOR_BUTTON_GREY.get_int())
        box.append(text)

        if show_clear_query:
            button = gtk.Button(label=_('Clear search'))
            button.connect('clicked', self.__clear_button_clicked_cb)
            button.props.image = Icon(icon_name='dialog-cancel',
                                      icon_size=gtk.ICON_SIZE_BUTTON)
            canvas_button = hippo.CanvasWidget(widget=button,
                                               xalign=hippo.ALIGNMENT_CENTER)
            box.append(canvas_button)
コード例 #2
0
    def __init__(self):
        logging.debug('STARTUP: Loading the group view')

        gobject.GObject.__init__(self)

        self._box = hippo.CanvasBox()
        self._box.props.background_color = style.COLOR_WHITE.get_int()
        self.set_root(self._box)

        self._friends = {}

        self._layout = SpreadLayout()
        self._box.set_layout(self._layout)

        client = gconf.client_get_default()
        color = XoColor(client.get_string('/desktop/sugar/user/color'))

        self._owner_icon = CanvasIcon(icon_name='computer-xo', cache=True,
                                      xo_color=color)
        self._owner_icon.props.size = style.LARGE_ICON_SIZE

        self._owner_icon.set_palette(BuddyMenu(get_owner_instance()))
        self._layout.add(self._owner_icon)

        friends_model = friends.get_model()

        for friend in friends_model:
            self.add_friend(friend)

        friends_model.connect('friend-added', self._friend_added_cb)
        friends_model.connect('friend-removed', self._friend_removed_cb)
コード例 #3
0
ファイル: expandedentry.py プロジェクト: nemesiscodex/jarabe
    def __init__(self, buddies):
        hippo.CanvasBox.__init__(self,
                                 xalign=hippo.ALIGNMENT_START,
                                 orientation=hippo.ORIENTATION_HORIZONTAL)

        for buddy in buddies:
            nick_, color = buddy
            hbox = hippo.CanvasBox(orientation=hippo.ORIENTATION_HORIZONTAL)
            icon = CanvasIcon(icon_name='computer-xo',
                              xo_color=XoColor(color),
                              size=style.STANDARD_ICON_SIZE)
            icon.set_palette(BuddyPalette(buddy))
            hbox.append(icon)
            self.append(hbox)
コード例 #4
0
ファイル: expandedentry.py プロジェクト: nemesiscodex/jarabe
    def _create_icon(self):
        icon = CanvasIcon(file_name=misc.get_icon_name(self._metadata))
        icon.connect_after('button-release-event',
                           self._icon_button_release_event_cb)

        if misc.is_activity_bundle(self._metadata):
            xo_color = XoColor('%s,%s' % (style.COLOR_BUTTON_GREY.get_svg(),
                                          style.COLOR_TRANSPARENT.get_svg()))
        else:
            xo_color = misc.get_icon_color(self._metadata)
        icon.props.xo_color = xo_color

        icon.set_palette(ObjectPalette(self._metadata))

        return icon
コード例 #5
0
    def _create_entry_icon(self):
        bundle_id = self._activity.metadata.get('activity', '')
        if not bundle_id:
            bundle_id = self._activity.metadata.get('bundle_id', '')

        if bundle_id == '':
            file_name = _get_icon_name(self._activity.metadata)
        else:
            activity_bundle = ActivityBundle(self._bundle_path)
            file_name = activity_bundle.get_icon()
        entry_icon = CanvasIcon(file_name=file_name)
        if self._activity.metadata.has_key('icon-color') and \
                self._activity.metadata['icon-color']:
            entry_icon.props.xo_color = XoColor( \
                self._activity.metadata['icon-color'])
        return entry_icon
コード例 #6
0
ファイル: friendview.py プロジェクト: nemesiscodex/jarabe
    def __init__(self, buddy, **kwargs):
        hippo.CanvasBox.__init__(self, **kwargs)

        self._buddy = buddy
        self._buddy_icon = BuddyIcon(buddy)
        self._buddy_icon.props.size = style.LARGE_ICON_SIZE
        self.append(self._buddy_icon)

        self._activity_icon = CanvasIcon(size=style.LARGE_ICON_SIZE)
        self._activity_icon_visible = False

        self._update_activity()

        self._buddy.connect('notify::current-activity',
                            self.__buddy_notify_current_activity_cb)
        self._buddy.connect('notify::present', self.__buddy_notify_present_cb)
        self._buddy.connect('notify::color', self.__buddy_notify_color_cb)
コード例 #7
0
def idle_cb():
    global countdown

    for i in range(0, 100):
        entry = hippo.CanvasBox(border=2,
                                border_color=0x000000ff,
                                orientation=hippo.ORIENTATION_HORIZONTAL,
                                padding=10,
                                spacing=10)

        for j in range(0, 3):
            icon = CanvasIcon(icon_name='go-left')
            entry.append(icon)

        for j in range(0, 2):
            text = hippo.CanvasText(text='Text %s %s' % (countdown, j))
            entry.append(text)

        box.append(entry)

        countdown -= 1

    return countdown > 0
コード例 #8
0
ファイル: detailview.py プロジェクト: nemesiscodex/jarabe
    def __init__(self):
        hippo.CanvasBox.__init__(
            self,
            orientation=hippo.ORIENTATION_HORIZONTAL,
            border=style.LINE_WIDTH,
            background_color=style.COLOR_PANEL_GREY.get_int(),
            border_color=style.COLOR_SELECTION_GREY.get_int(),
            padding=style.DEFAULT_PADDING,
            padding_left=style.DEFAULT_SPACING,
            spacing=style.DEFAULT_SPACING)

        icon = CanvasIcon(icon_name='go-previous',
                          size=style.SMALL_ICON_SIZE,
                          fill_color=style.COLOR_TOOLBAR_GREY.get_svg())
        self.append(icon)

        label = hippo.CanvasText(text=_('Back'),
                                 font_desc=style.FONT_NORMAL.get_pango_desc())
        self.append(label)

        if gtk.widget_get_default_direction() == gtk.TEXT_DIR_RTL:
            self.reverse()

        self.connect('motion-notify-event', self.__motion_notify_event_cb)