当前位置: 首页>>代码示例>>Python>>正文


Python app_theme.get_pixbuf函数代码示例

本文整理汇总了Python中theme.app_theme.get_pixbuf函数的典型用法代码示例。如果您正苦于以下问题:Python get_pixbuf函数的具体用法?Python get_pixbuf怎么用?Python get_pixbuf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_pixbuf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, message, default_width=300, default_height=140, is_succeed=True):
        DialogBox.__init__(self, "", default_width, default_height, self.DIALOG_MASK_SINGLE_PAGE)

        self.hbox = gtk.HBox()
        self.image_align = gtk.Alignment()
        self.image_align.set(0, 0, 0, 0)
        self.image_align.set_padding(0, 0, 20, 0)
        self.image_box = ImageBox(app_theme.get_pixbuf("bluetooth/succeed.png"))
        if not is_succeed:
            self.image_box = ImageBox(app_theme.get_pixbuf("bluetooth/failed.png"))
        self.image_align.add(self.image_box)
        self.message_align = gtk.Alignment()
        self.message_align.set(0, 0, 0, 0)
        self.message_align.set_padding(20, 0, 10, 0)
        if not is_succeed:
            self.message_align.set_padding(0, 0, 10, 0)
        self.message_label = Label(message, wrap_width = 200)
        self.message_align.add(self.message_label)
        self.hbox.pack_start(self.image_align)
        self.hbox.pack_start(self.message_align)
        self.confirm_align = gtk.Alignment()
        self.confirm_align.set(0, 0, 0, 0)
        self.confirm_align.set_padding(20, 0, 200, 0)
        self.confirm_button = Button(_("Ok"))
        self.confirm_button.set_size_request(70, WIDGET_HEIGHT)
        self.confirm_button.connect("clicked", lambda widget : self.destroy())
        self.confirm_align.add(self.confirm_button)

        self.body_box.pack_start(self.hbox, False, False)
        self.body_box.pack_start(self.confirm_align, False, False)
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:30,代码来源:bluetooth_dialog.py

示例2: __init__

    def __init__(self, display_manager):
        ResizableBox.__init__(self, resizable = False)

        self.__display_manager = display_manager

        self.select_output_name = None

        self.output_width = 220
        self.output_height = 120
        self.output_padding = 3
        self.output_small_size = 20
        self.line_width = 1.0
        self.text_size = 10

        self.primary_pixbuf = app_theme.get_pixbuf("display/n01.png")
        self.other_pixbuf = app_theme.get_pixbuf("display/n00.png")

        self.__eventx = 0
        self.__eventy = 0

        output_names = self.__display_manager.get_connect_output_names()
        self.output_infos = []
        for name in output_names:
            info = {}
            info['name'] = name
            info['is_primary'] = name == self.__display_manager.get_primary_output_name()
            info['output_x'] = None
            info['output_width'] = None
            self.output_infos.append(info)

        self.connect("button-press-event", self.__button_press)
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:31,代码来源:display_view.py

示例3: __init__

    def __init__(self, account_setting):
        gtk.VBox.__init__(self)
        self.account_setting = account_setting
        
        self.camera_pixbuf = app_theme.get_pixbuf("account/camera.png").get_pixbuf()
        self.error_pixbuf = app_theme.get_pixbuf("account/error.png").get_pixbuf()
        self.success_pixbuf = app_theme.get_pixbuf("account/success.png").get_pixbuf()

        self.camera_box_align = gtk.Alignment(0.5, 0, 0, 0)
        self.camera_box = gtk.VBox()
        self.camera_box.set_size_request(CAMERA_BOX_SIZE, CAMERA_BOX_SIZE)
        self.camera_box.connect("expose-event", self.__camera_box_expose)
        self.camera_box_align.add(self.camera_box)

        self.under_camera_box = gtk.VBox(spacing=10)
        self.under_camera_box_align = gtk.Alignment(0.5, 0, 0, 0)
        self.under_camera_box_align.set_padding(WIDGET_SPACING, 0, 0, 0)
        self.under_camera_box_align.add(self.under_camera_box)
        self.__init_widgets()
        if Webcam.has_device():
            self.under_camera_box.pack_start(self.start_record_button)
        else:
            self.under_camera_box.pack_start(self.no_device_warning)

        self.pack_start(self.camera_box_align, False, False)
        self.pack_start(self.under_camera_box_align, False, False)
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:26,代码来源:face_record_page.py

示例4: __init__

    def __init__(self, module_path):
        '''
        init docs
        '''
        self.path = module_path
        self.config = Config(os.path.join(self.path, "config.ini"))
        self.config.load()
        self.id = self.config.get("main", "id")
        # TODO: lihongwu req to support i18n
        self.name = MODULES_NAME_FOR_L18N.get(self.id, "")
        self.default_name = self.config.get("name", "default")

        """
        self.name = self.default_name
        if MAIN_LANG != "en_US":
            self.name = self.config.get("name", MAIN_LANG)
        """

        icon_infos = [self.get_system_icon_info(self.id, 48), 
                      self.get_system_icon_info(self.id, 16),
                     ]
        
        self.icon_pixbuf = None
        self.menu_icon_pixbuf = None
        try:
            self.icon_pixbuf = gtk.gdk.pixbuf_new_from_file(icon_infos[0])
            self.menu_icon_pixbuf = gtk.gdk.pixbuf_new_from_file(icon_infos[1])
        except:
            self.icon_pixbuf = app_theme.get_pixbuf("navigate/none-big.png").get_pixbuf()
            self.menu_icon_pixbuf = app_theme.get_pixbuf("navigate/none-small.png").get_pixbuf()
            
        self.search_keyword = self.config.get("main", "search_keyword")
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:32,代码来源:module_info.py

示例5: __init__

    def __init__(self, path, theme):
        '''
        Initialize ItemIcon class.
        
        @param pixbuf: Icon pixbuf.
        '''
        gobject.GObject.__init__(self)

        self.image_path = path
        self.theme = theme
        self.pixbuf = None
        self.hover_flag = False
        self.highlight_flag = False
        self.wallpaper_width = SMALL_SIZE["x"]
        self.wallpaper_height = SMALL_SIZE["y"]
        self.width = self.wallpaper_width + ITEM_PADDING_X * 2
        self.height = self.wallpaper_height + ITEM_PADDING_Y * 2
        
        self.is_hover = False
        self.hover_stroke_dcolor = app_theme.get_color("globalHoverStroke")
        self.hover_response_rect = gtk.gdk.Rectangle(
            ITEM_PADDING_X, ITEM_PADDING_Y ,
            self.wallpaper_width, self.wallpaper_height
            ) 

        self.cross_normal_dpixbuf = app_theme.get_pixbuf("individuation/cross_normal.png")
        self.cross_gray_dpixbuf = app_theme.get_pixbuf("individuation/cross_gray.png")
        
        self.is_tick = False
        self.tick_area = None
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:30,代码来源:wallpaper_item.py

示例6: __init__

    def __init__(self, pixbuf=None, image_path='', padding_x=4, padding_y=4, has_frame=True, can_del=False):
        super(IconButton, self).__init__()
        self.connect("expose-event", self.__expose_cb)
        self.padding_x = padding_x
        self.padding_y = padding_y
        self.image_path = image_path
        self.has_frame = has_frame
        self.can_del = can_del

        self.add_events(gtk.gdk.ENTER_NOTIFY_MASK)
        self.add_events(gtk.gdk.LEAVE_NOTIFY_MASK)
        self.add_events(gtk.gdk.BUTTON_PRESS_MASK)
        self.add_events(gtk.gdk.BUTTON_RELEASE_MASK)

        self.connect("enter-notify-event", lambda w,e: self.set_state(gtk.STATE_PRELIGHT))
        self.connect("leave-notify-event", lambda w,e: self.set_state(gtk.STATE_NORMAL))
        self.connect("button-press-event", self.__on_button_press_cb)

        self.del_bg_pixbuf = app_theme.get_pixbuf("account/X_bg.png")
        self.del_fg_pixbuf = app_theme.get_pixbuf("account/X_fg.png")
        self.bg_offset_x = 0
        self.bg_offset_y = 0
        self.bg_width = 0
        self.bg_height = 0
        self.set_from_pixbuf(pixbuf)
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:25,代码来源:icon_button.py

示例7: __init__

    def __init__(self,
                 name,
                 ap_list,
                 setting_page,
                 slide_to_setting_page_cb,
                 send_to_crumb,
                 check_state=2,
                 font_size=DEFAULT_FONT_SIZE):

        TreeItem.__init__(self)

        self.name = name
        self.ap_list = ap_list
        self.setting = setting_page
        self.slide_to_setting = slide_to_setting_page_cb
        self.send_to_crumb = send_to_crumb
        self.font_size = font_size
        self.check_width = self.get_check_width()
        self.essid_width = self.get_essid_width(self.name)
        self.jumpto_width = self.get_jumpto_width()
        self.network_state = check_state

        self.is_last = True
        self.position = 0

        '''
        Pixbufs
        '''
        self.border_color = border_normal_color
        self.bg_color = bg_normal_color
        self.loading_pixbuf = app_theme.get_pixbuf("network/loading.png")
        self.check_pixbuf = app_theme.get_pixbuf("network/check_box-2.png")
        self.jumpto_pixbuf = app_theme.get_pixbuf("network/jump_to.png")
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:33,代码来源:lists.py

示例8: create_color_button

 def create_color_button(self, box, name):
     '''
     create color button
     @param box: a gtk.HBox
     @param name: the button's name
     '''
     button = ImageButton(
         app_theme.get_pixbuf("color/" + name + ".png"),
         app_theme.get_pixbuf("color/" + name + "_hover.png"),
         app_theme.get_pixbuf("color/" + name + "_hover.png"))
     button.connect('pressed', lambda w:self._color_button_pressed(name))
     box.pack_start(button)
开发者ID:ChanningBJ,项目名称:deepin-screenshot,代码行数:12,代码来源:toolbar.py

示例9: __make_playback_box

 def __make_playback_box(self, stream, index):
     process_id = int(stream['proplist']['application.process.id'])
     if process_id == os.getpid():
         return
     # if it has show mpris, then don't show sink_input
     if process_id in self.mpris_list:
         self.mpris_stream[process_id] = index
         self.stream_mpris[index] = process_id
         return
     icon_name, is_filtered = self.__white_list_check(stream, index)
     if is_filtered:
         return
     self.stream_list[index] = {}
     volume_max_percent = pypulse.MAX_VOLUME_VALUE * 100 / pypulse.NORMAL_VOLUME_VALUE
     if icon_name:
         if icon_name[0] == '/':
             try:
                 img = gtk.image_new_from_pixbuf(gtk.gdk.pixbuf_new_from_file(
                     icon_name).scale_simple(16, 16, gtk.gdk.INTERP_TILES))
             except:
                 img = gtk.image_new_from_pixbuf(self.stream_icon)
         else:
             image_pixbuf = self.__get_pixbuf_from_icon_name(icon_name)
             if image_pixbuf:
                 img = gtk.image_new_from_pixbuf(image_pixbuf)
             else:
                 img = gtk.image_new_from_pixbuf(self.stream_icon)
                 #img = gtk.image_new_from_icon_name(icon_name, gtk.ICON_SIZE_MENU)
     else:
         img = gtk.image_new_from_pixbuf(self.stream_icon)
     img.set_size_request(16, 16)
     scale = HScalebar(show_value=False, format_value="%", value_min=0, value_max=volume_max_percent)
     scale.set_magnetic_values([(0, 5), (100, 5), (volume_max_percent, 5)])
     scale.set_size_request(90, 10)
     mute_button = SwitchButton(
         inactive_disable_dpixbuf=app_theme.get_pixbuf("toggle_button/inactive_normal.png"), 
         active_disable_dpixbuf=app_theme.get_pixbuf("toggle_button/inactive_normal.png"))
     hbox = gtk.HBox()
     hbox.pack_start(self.__make_align(img), False, False)
     hbox.pack_start(self.__make_align(scale, yalign=0.0, yscale=1.0, padding_left=5, padding_right=5, height=25), False, False)
     hbox.pack_start(self.__make_align(mute_button), False, False)
     self.stream_list[index]['scale'] = scale
     self.stream_list[index]['button'] = mute_button
     self.stream_list[index]['container'] = hbox
     self.stream_list[index]['process_id'] = process_id
     self.stream_list[index]['stream_id'] = index
     self.stream_process[process_id] = self.stream_list[index]
     self.__set_playback_status(stream, scale, mute_button)
     if stream['volume_writable']:
         scale.connect("value-changed", self.playback_stream_scale_changed_cb, index, mute_button)
         mute_button.connect("toggled", self.playback_stream_toggled_cb, index, scale)
     hbox.show_all()
     self.__app_vbox.pack_start(hbox, False, False)
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:53,代码来源:tray_sound_gui_small.py

示例10: __draw_mpris_button_cb

 def __draw_mpris_button_cb(self, bt, event):
     if bt.get_state() == gtk.STATE_PRELIGHT:
         pixbuf = app_theme.get_pixbuf("sound/%s_hover.png" % bt.pixbuf).get_pixbuf()
     elif bt.get_state() == gtk.STATE_ACTIVE:
         pixbuf = app_theme.get_pixbuf("sound/%s_press.png" % bt.pixbuf).get_pixbuf()
     else:
         pixbuf = app_theme.get_pixbuf("sound/%s_normal.png" % bt.pixbuf).get_pixbuf()
     cr = bt.window.cairo_create()
     pix_height = pixbuf.get_height()
     cr.set_source_pixbuf(pixbuf, bt.allocation.x, bt.allocation.y + (bt.allocation.height - pix_height) / 2)
     cr.paint()
     return True
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:12,代码来源:tray_sound_gui_small.py

示例11: create_toggle_button

 def create_toggle_button(self, name):
     '''
     create a togglebutton
     @param name: the button's name
     @return: a dtk.ui.ToggleButton
     '''
     button = ToggleButton(
         app_theme.get_pixbuf("size/" + name + ".png"),
         app_theme.get_pixbuf("size/" + name + "_press.png"),
         app_theme.get_pixbuf("size/" + name + "_hover.png"),
         app_theme.get_pixbuf("size/" + name + "_press.png"))
     button.set_name(name)
     return button
开发者ID:ChanningBJ,项目名称:deepin-screenshot,代码行数:13,代码来源:toolbar.py

示例12: __init__

    def __init__(self):
        gobject.GObject.__init__(self)
        
        self.progress = 0

        self.percentage_dpixbuf = [app_theme.get_pixbuf("power/10.png"), 
                                   app_theme.get_pixbuf("power/20.png"), 
                                   app_theme.get_pixbuf("power/30.png"), 
                                   app_theme.get_pixbuf("power/40.png"), 
                                   app_theme.get_pixbuf("power/50.png"), 
                                   app_theme.get_pixbuf("power/60.png"), 
                                   app_theme.get_pixbuf("power/70.png"), 
                                   app_theme.get_pixbuf("power/80.png"), 
                                   app_theme.get_pixbuf("power/90.png"), 
                                   app_theme.get_pixbuf("power/100.png")]
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:15,代码来源:power_progressbar.py

示例13: friendships_add_thread

 def friendships_add_thread(self, button, weibo, box):
     '''add friendships'''
     if weibo.friendships_create() is not None:
         gtk.gdk.threads_enter()
         button.destroy()
         if not default_locale.startswith("zh_"):
             button = gtk.image_new_from_pixbuf(
                 app_theme.get_pixbuf("share/followed_en.png").get_pixbuf())
         else:
             button = gtk.image_new_from_pixbuf(
                 app_theme.get_pixbuf("share/followed.png").get_pixbuf())
         button.show()
         box.pack_start(button, False, False)
         #button.set_label("已关注")
         gtk.gdk.threads_leave()
开发者ID:jaycococ,项目名称:deepin-screenshot,代码行数:15,代码来源:share.py

示例14: __create_widget

    def __create_widget(self):
        # label widget
        self.label_widgets["copyright"] = Label("%s%s" % ("Copyright © 2011 - %s " % datetime.today().year, 
                                                          _("Wuhan Deepin Technology Co.Ltd, All rights reserved")), 
                                                enable_select=False, enable_double_click=False)
        self.label_widgets["version"] = Label(_("Version"), enable_select=False, enable_double_click=False)
        self.label_widgets["cpu"] = Label(_("CPU"), enable_select=False, enable_double_click=False)
        self.label_widgets["mem"] = Label(_("Memory"), enable_select=False, enable_double_click=False)
        self.label_widgets["arch"] = Label(_("OS Type"), enable_select=False, enable_double_click=False)
        self.label_widgets["disk"] = Label(_("Disk"), enable_select=False, enable_double_click=False)
        self.label_widgets["version_info"] = Label("", enable_select=False, enable_double_click=False)
        self.label_widgets["cpu_info"] = Label("", enable_select=False, enable_double_click=False)
        self.label_widgets["mem_info"] = Label("", enable_select=False, enable_double_click=False)
        self.label_widgets["arch_info"] = Label("", enable_select=False, enable_double_click=False)
        self.label_widgets["disk_info"] = Label("", enable_select=False, enable_double_click=False)

        # image widget
        self.image_widgets["logo"] = ImageBox(app_theme.get_pixbuf('%s/logo.png' % MODULE_NAME))
        
        # container widget
        self.container_widgets["main_hbox"] = gtk.HBox(False)
        self.container_widgets["left_vbox"] = gtk.VBox(False)
        self.container_widgets["right_vbox"] = gtk.VBox(False)
        self.container_widgets["info_vbox"] = gtk.VBox(False)
        self.container_widgets["info_table"] = gtk.Table(5, 2)

        # alignment widget
        self.alignment_widgets["main_hbox"] = gtk.Alignment()
        self.alignment_widgets["logo"] = gtk.Alignment()
        self.alignment_widgets["right_vbox"] = gtk.Alignment()
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:30,代码来源:main.py

示例15: __init__

    def __init__(self, network_interface):
        gtk.VBox.__init__(self)

        self.theme = None

        self.set_spacing(10)

        self.cache_view = CacheView(network_interface, download_dir=get_download_wallpaper_dir())
        self.cache_view_sw = self.cache_view.get_scrolled_window()

        self.nolink_image = ImageBox(app_theme.get_pixbuf("individuation/notlink.png"))

        self.back_button = Button(_("Back"))
        self.back_button.connect("clicked", self.__on_back)
        download_button = Button(_("Download All"))
        download_button.connect("clicked", self.on_download_button_clicked)

        control_box = gtk.HBox(spacing=10)
        control_box.pack_start(self.back_button, False, False)

        self.control_align = gtk.Alignment()
        self.control_align.set(1.0, 0.5, 0, 0)
        self.control_align.set_padding(0, 5, 0, 10)
        self.control_align.add(control_box)

        self.pack_start(self.cache_view_sw, True, True)
        self.pack_start(self.control_align, False, True)

        event_manager.add_callback("fetch-failed", self.__fetch_failed)
开发者ID:martyr-deepin,项目名称:deepin-system-settings,代码行数:29,代码来源:cache_page.py


注:本文中的theme.app_theme.get_pixbuf函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。