本文整理汇总了Python中theme.ui_theme.get_pixbuf函数的典型用法代码示例。如果您正苦于以下问题:Python get_pixbuf函数的具体用法?Python get_pixbuf怎么用?Python get_pixbuf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_pixbuf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self,
width=180,
height=180):
'''
Initialize DateTime class.
@param width: Width of widget, default is 180 pixels.
@param height: Height of widget, default is 180 pixels.
'''
gtk.VBox.__init__(self)
self.hour_value = time.localtime().tm_hour
self.minute_value = time.localtime().tm_min
self.second_value = time.localtime().tm_sec
self.width = width
self.height = height
self.set_size_request(self.width, self.height)
self.clockface = ui_theme.get_pixbuf("datetime/clockface.png")
self.clockface_width = self.clockface.get_pixbuf().get_width()
self.clockface_height = self.clockface.get_pixbuf().get_height()
self.hourhand = ui_theme.get_pixbuf("datetime/hourhand.png")
self.hourhand_width = self.hourhand.get_pixbuf().get_width()
self.hourhand_height = self.hourhand.get_pixbuf().get_height()
self.minhand = ui_theme.get_pixbuf("datetime/minhand.png")
self.minhand_width = self.minhand.get_pixbuf().get_width()
self.minhand_height = self.minhand.get_pixbuf().get_height()
self.sechand = ui_theme.get_pixbuf("datetime/sechand.png")
self.sechand_width = self.sechand.get_pixbuf().get_width()
self.sechand_height = self.sechand.get_pixbuf().get_height()
self.connect("expose-event", self.__expose)
SecondThread(self).start()
开发者ID:Jiarui315,项目名称:deepin-ui,代码行数:35,代码来源:datetime.py
示例2: expose_button
def expose_button(self, widget, event):
'''Expose button.'''
# Init.
cr = widget.window.cairo_create()
rect = widget.allocation
x, y, w, h = rect.x, rect.y, rect.width, rect.height
# Get color info.
if widget.state == gtk.STATE_NORMAL:
text_color = ui_theme.get_color("button_font").get_color()
border_color = ui_theme.get_color("button_border_normal").get_color()
background_color = ui_theme.get_shadow_color("button_background_normal").get_color_info()
elif widget.state == gtk.STATE_PRELIGHT:
text_color = ui_theme.get_color("button_font").get_color()
border_color = ui_theme.get_color("button_border_prelight").get_color()
background_color = ui_theme.get_shadow_color("button_background_prelight").get_color_info()
elif widget.state == gtk.STATE_ACTIVE:
text_color = ui_theme.get_color("button_font").get_color()
border_color = ui_theme.get_color("button_border_active").get_color()
background_color = ui_theme.get_shadow_color("button_background_active").get_color_info()
elif widget.state == gtk.STATE_INSENSITIVE:
text_color = ui_theme.get_color("disable_text").get_color()
border_color = ui_theme.get_color("disable_frame").get_color()
disable_background_color = ui_theme.get_color("disable_background").get_color()
background_color = [(0, (disable_background_color, 1.0)),
(1, (disable_background_color, 1.0))]
# Draw background.
draw_vlinear(
cr,
x + 1, y + 1, w - 2, h - 2,
background_color)
# Draw border.
cr.set_source_rgb(*color_hex_to_cairo(border_color))
draw_line(cr, x + 2, y + 1, x + w - 2, y + 1) # top
draw_line(cr, x + 2, y + h, x + w - 2, y + h) # bottom
draw_line(cr, x + 1, y + 2, x + 1, y + h - 2) # left
draw_line(cr, x + w, y + 2, x + w, y + h - 2) # right
# Draw four point.
if widget.state == gtk.STATE_INSENSITIVE:
top_left_point = ui_theme.get_pixbuf("button/disable_corner.png").get_pixbuf()
else:
top_left_point = ui_theme.get_pixbuf("button/corner.png").get_pixbuf()
top_right_point = top_left_point.rotate_simple(270)
bottom_right_point = top_left_point.rotate_simple(180)
bottom_left_point = top_left_point.rotate_simple(90)
draw_pixbuf(cr, top_left_point, x, y)
draw_pixbuf(cr, top_right_point, x + w - top_left_point.get_width(), y)
draw_pixbuf(cr, bottom_left_point, x, y + h - top_left_point.get_height())
draw_pixbuf(cr, bottom_right_point, x + w - top_left_point.get_width(), y + h - top_left_point.get_height())
# Draw font.
draw_text(cr, self.label, x, y, w, h, self.font_size, text_color,
alignment=pango.ALIGN_CENTER)
return True
开发者ID:netphi,项目名称:deepin-ui,代码行数:59,代码来源:button.py
示例3: __init__
def __init__(self, width=20, height = 30,
font_size = 10, font_x_padding=5, font_width=120, font_height = 0,
font_align=pango.ALIGN_LEFT,
arrow_x_padding = 10,
normal_pixbuf = ui_theme.get_pixbuf("treeview/arrow_right.png"),
press_pixbuf = ui_theme.get_pixbuf("treeview/arrow_down.png"),
normal_hover_pixbuf = ui_theme.get_pixbuf("treeview/arrow_right_hover.png"),
press_hover_pixbuf = ui_theme.get_pixbuf("treeview/arrow_down_hover.png")):
gtk.DrawingArea.__init__(self)
self.root = Tree()
self.tree_list = []
self.tree_all_node_list = [] # Save all node.
self.tree_id_list = []
self.tree_id_num = 0
self.scan_save_item = None
self.set_can_focus(True)
# Init DrawingArea event.
self.add_events(gtk.gdk.ALL_EVENTS_MASK)
self.connect("button-press-event", self.tree_view_press_event)
self.connect("motion-notify-event", self.tree_view_motion_event)
self.connect("expose-event", self.tree_view_expose_event)
self.connect("key-press-event", self.tree_view_key_press_event)
self.connect("leave-notify-event", self.tree_view_leave_notify_event)
self.connect("realize", lambda w: self.grab_focus()) # focus key after realize
self.width = width
self.height = height
# Draw icon.
self.normal_pixbuf = normal_pixbuf
self.press_pixbuf = press_pixbuf
self.normal_hover_pixbuf = normal_hover_pixbuf
self.press_hover_pixbuf = press_hover_pixbuf
self.arrow_x_padding = arrow_x_padding
# Draw move background.
self.move_height = -1
self.move_draw_bool = False
self.move_index_num = None
# Draw press background.
self.press_height = -1
self.press_draw_bool = False
# Draw font.
self.font_x_padding = font_x_padding
self.font_width = font_width
self.font_height = font_height
self.font_align = font_align
self.font_size = font_size
self.highlight_index = None
if not self.font_size:
self.font_size = self.height/2 - 4
if self.font_size > self.height - 15:
self.font_size = self.height - 15
开发者ID:netphi,项目名称:deepin-ui,代码行数:56,代码来源:treeview.py
示例4: __init__
def __init__(self,
items,
add_separator=False,
font_size=DEFAULT_FONT_SIZE,
padding_x=10,
padding_y=10,
vertical=True,
item_hover_pixbuf=ui_theme.get_pixbuf("navigatebar/nav_item_hover.png"),
item_press_pixbuf=ui_theme.get_pixbuf("navigatebar/nav_item_press.png"),
):
'''
Initialize Navigatebar class.
@param items: A list of navigate item, item format: (item_icon_dpixbuf, item_content, clicked_callback)
@param add_separator: Whether add separator between navigatebar and body, default is False.
@param font_size: Font size, default is DEFAULT_FONT_SIZE.
@param padding_x: Padding value horizontal.
@param padding_y: Padding value vertical.
@param vertical: Draw direction, default is vertical.
@param item_hover_pixbuf: Item hover dpixbuf.
@param item_press_pixbuf: Item press dpixbuf.
'''
# Init event box.
EventBox.__init__(self)
self.nav_index = 0
self.item_hover_pixbuf = item_hover_pixbuf
self.item_press_pixbuf = item_press_pixbuf
self.nav_items = []
# Init nav box.
self.nav_box = gtk.VBox()
self.add(self.nav_box)
# Init item box.
self.nav_item_box = gtk.HBox()
self.nav_box.pack_start(self.nav_item_box, False, False)
# Add navigate item.
if items:
for (index, item) in enumerate(items):
nav_item = NavItem(item, index, font_size, padding_x, padding_y, vertical,
self.set_index, self.get_index,
self.item_hover_pixbuf,
self.item_press_pixbuf)
self.nav_items.append(nav_item)
self.nav_item_box.pack_start(nav_item.item_box, False, False)
# Add separator.
if add_separator:
self.separator = gtk.HBox()
self.separator.set_size_request(-1, 2)
self.separator.connect("expose-event", self.expose_nav_separator)
self.nav_box.pack_start(self.separator, False, False)
# Show.
self.show_all()
开发者ID:chenzhiwei,项目名称:deepin-ui,代码行数:56,代码来源:navigatebar.py
示例5: expose_menu_item
def expose_menu_item(self, widget, event):
'''Expose menu item.'''
# Init.
cr = widget.window.cairo_create()
rect = widget.allocation
font_color = ui_theme.get_color("menu_font").get_color()
(item_icons, item_content, item_node) = self.item[0:3]
# Draw select effect.
if self.submenu_active or widget.state in [gtk.STATE_PRELIGHT, gtk.STATE_ACTIVE]:
# Draw background.
draw_vlinear(cr, rect.x, rect.y, rect.width, rect.height,
ui_theme.get_shadow_color("menu_item_select").get_color_info(),
MENU_ITEM_RADIUS)
# Set font color.
font_color = ui_theme.get_color("menu_select_font").get_color()
# Draw item icon.
pixbuf = None
pixbuf_width = 0
if item_icons:
(item_normal_dpixbuf, item_hover_dpixbuf) = item_icons
if self.submenu_active or widget.state in [gtk.STATE_PRELIGHT, gtk.STATE_ACTIVE]:
if item_hover_dpixbuf == None:
pixbuf = item_normal_dpixbuf.get_pixbuf()
else:
pixbuf = item_hover_dpixbuf.get_pixbuf()
else:
pixbuf = item_normal_dpixbuf.get_pixbuf()
pixbuf_width += pixbuf.get_width()
draw_pixbuf(cr, pixbuf, rect.x + self.item_padding_x, rect.y + (rect.height - pixbuf.get_height()) / 2)
# Draw item content.
draw_text(cr, item_content,
rect.x + self.item_padding_x * 2 + self.icon_width,
rect.y,
rect.width,
rect.height,
self.font_size, font_color,
)
# Draw submenu arrow.
if isinstance(item_node, Menu):
if self.submenu_active or widget.state in [gtk.STATE_PRELIGHT, gtk.STATE_ACTIVE]:
submenu_pixbuf = ui_theme.get_pixbuf("menu/arrow_hover.png").get_pixbuf()
else:
submenu_pixbuf = ui_theme.get_pixbuf("menu/arrow_normal.png").get_pixbuf()
draw_pixbuf(cr, submenu_pixbuf,
rect.x + rect.width - self.item_padding_x - submenu_pixbuf.get_width() - self.arrow_padding_x,
rect.y + (rect.height - submenu_pixbuf.get_height()) / 2)
# Propagate expose to children.
propagate_expose(widget, event)
return True
开发者ID:netphi,项目名称:deepin-ui,代码行数:56,代码来源:menu.py
示例6: __init__
def __init__(self):
'''Init close button.'''
gtk.Button.__init__(self)
self.cache_pixbuf = CachePixbuf()
draw_button(
self,
self.cache_pixbuf,
ui_theme.get_pixbuf("button/window_close_normal.png"),
ui_theme.get_pixbuf("button/window_close_hover.png"),
ui_theme.get_pixbuf("button/window_close_press.png"))
开发者ID:netphi,项目名称:deepin-ui,代码行数:10,代码来源:button.py
示例7: __init__
def __init__(self,
dir=HOME_DIR,
view_mode=ICONVIEW
):
HPaned.__init__(self)
self.categorybar = Categorybar([
(ui_theme.get_pixbuf("filemanager/computer.png"), _("Computer"), None),
(ui_theme.get_pixbuf("filemanager/user-home.png"), _("Home"), lambda : self.open_dir(self.HOME_DIR)),
(ui_theme.get_pixbuf("filemanager/user-desktop.png"), _("Desktop"), lambda : self.open_dir(self.HOME_DIR + "Desktop/")),
(ui_theme.get_pixbuf("filemanager/folder-documents.png"), _("Documents"), lambda : self.open_dir(self.HOME_DIR + "Documents/")),
(ui_theme.get_pixbuf("filemanager/folder-download.png"), _("Downloads"), lambda : self.open_dir(self.HOME_DIR + "Downloads/")),
(ui_theme.get_pixbuf("filemanager/folder-music.png"), _("Music"), lambda : self.open_dir(self.HOME_DIR + "Music/")),
(ui_theme.get_pixbuf("filemanager/folder-pictures.png"), _("Pictures"), lambda : self.open_dir(self.HOME_DIR + "Pictures/")),
(ui_theme.get_pixbuf("filemanager/folder-videos.png"), _("Videos"), lambda : self.open_dir(self.HOME_DIR + "Videos/")),
(ui_theme.get_pixbuf("filemanager/user-trash.png"), _("Trash"), lambda : self.open_dir("trash:///"))
])
self.icon_size = 48
self.iconview = FileIconView()
self.iconview.add_items(iconview_get_dir_items(dir, self.icon_size))
self.treeview = TreeView(get_dir_items(dir))
self.add1(self.categorybar)
if view_mode == self.ICONVIEW:
self.add2(self.iconview)
else:
self.add2(self.treeview)
开发者ID:chenzhiwei,项目名称:deepin-ui,代码行数:25,代码来源:file_manager.py
示例8: init_button
def init_button(self, status):
if self.get_orientation() == gtk.ORIENTATION_HORIZONTAL:
if self.shrink_first:
self.button_pixbuf = ui_theme.get_pixbuf("paned/paned_left_%s.png" % status).get_pixbuf()
else:
self.button_pixbuf = ui_theme.get_pixbuf("paned/paned_right_%s.png" % status).get_pixbuf()
else:
if self.shrink_first:
self.button_pixbuf = ui_theme.get_pixbuf("paned/paned_up_%s.png" % status).get_pixbuf()
else:
self.button_pixbuf = ui_theme.get_pixbuf("paned/paned_down_%s.png" % status).get_pixbuf()
开发者ID:Jiarui315,项目名称:deepin-ui,代码行数:11,代码来源:paned.py
示例9: __init__
def __init__(self, items, droplist_height=None, select_index=0, max_width=None):
'''Init combo box.'''
# Init.
gtk.VBox.__init__(self)
self.set_can_focus(True)
self.items = items
self.droplist_height = droplist_height
self.select_index = select_index
self.focus_flag = False
self.droplist = Droplist(self.items, max_width=max_width)
if self.droplist_height:
self.droplist.set_size_request(-1, self.droplist_height)
self.width = self.droplist.get_droplist_width()
self.height = 22
self.label_padding_left = 6
self.box = gtk.HBox()
self.dropbutton_width = ui_theme.get_pixbuf("combo/dropbutton_normal.png").get_pixbuf().get_width()
self.label = Label(self.items[select_index][0],
label_width=self.width - self.dropbutton_width - 1 - self.label_padding_left,
enable_select=False,
enable_double_click=False)
self.label.text_color = ui_theme.get_color("menu_font")
self.dropbutton = DisableButton(
(ui_theme.get_pixbuf("combo/dropbutton_normal.png"),
ui_theme.get_pixbuf("combo/dropbutton_hover.png"),
ui_theme.get_pixbuf("combo/dropbutton_press.png"),
ui_theme.get_pixbuf("combo/dropbutton_disable.png")),
)
self.align = gtk.Alignment()
self.align.set(0.5, 0.5, 0.0, 0.0)
self.align.set_padding(1, 1, 1 + self.label_padding_left, 1)
self.pack_start(self.align, False, False)
self.align.add(self.box)
self.box.pack_start(self.label, False, False)
self.box.pack_start(self.dropbutton, False, False)
self.align.connect("expose-event", self.expose_combobox_frame)
self.label.connect("button-press-event", self.click_drop_button)
self.dropbutton.connect("button-press-event", self.click_drop_button)
self.droplist.connect("item-selected", self.update_select_content)
self.droplist.connect("key-release", lambda dl, s, o, i: self.emit("key-release", s, o, i))
self.connect("key-press-event", self.key_press_combo)
self.connect("key-release-event", self.key_release_combo)
self.connect("focus-in-event", self.focus_in_combo)
self.connect("focus-out-event", self.focus_out_combo)
self.keymap = {
"Home" : self.select_first_item,
"End" : self.select_last_item,
"Up" : self.select_prev_item,
"Down" : self.select_next_item}
开发者ID:netphi,项目名称:deepin-ui,代码行数:54,代码来源:combo.py
示例10: create_simple_button
def create_simple_button(self, name, callback=None):
button = DisableButton(
(
ui_theme.get_pixbuf("spin/spin_arrow_%s_normal.png" % name),
ui_theme.get_pixbuf("spin/spin_arrow_%s_hover.png" % name),
ui_theme.get_pixbuf("spin/spin_arrow_%s_press.png" % name),
ui_theme.get_pixbuf("spin/spin_arrow_%s_disable.png" % name),
)
)
if callback:
button.connect("button-press-event", callback)
button.connect("button-release-event", self.handle_key_release)
return button
开发者ID:netphi,项目名称:deepin-ui,代码行数:13,代码来源:spin.py
示例11: expose_nav_item
def expose_nav_item(self, widget, event):
'''Expose navigate item.'''
# Init.
cr = widget.window.cairo_create()
rect = widget.allocation
select_index = self.get_index()
hover_pixbuf = ui_theme.get_pixbuf("navigatebar/nav_item_hover.png").get_pixbuf()
press_pixbuf = ui_theme.get_pixbuf("navigatebar/nav_item_press.png").get_pixbuf()
# Draw background.
if widget.state == gtk.STATE_NORMAL:
if select_index == self.index:
select_pixbuf = press_pixbuf
else:
select_pixbuf = None
elif widget.state == gtk.STATE_PRELIGHT:
if select_index == self.index:
select_pixbuf = press_pixbuf
else:
select_pixbuf = hover_pixbuf
elif widget.state == gtk.STATE_ACTIVE:
select_pixbuf = press_pixbuf
if select_pixbuf:
draw_pixbuf(cr, select_pixbuf, rect.x, rect.y)
# Draw navigate item.
nav_item_pixbuf = self.icon_dpixbuf.get_pixbuf()
draw_pixbuf(
cr, nav_item_pixbuf,
rect.x + (rect.width - nav_item_pixbuf.get_width()) / 2,
rect.y)
# Draw font.
draw_text(cr,
self.content,
rect.x,
rect.y + nav_item_pixbuf.get_height() - 3,
rect.width,
rect.height - nav_item_pixbuf.get_height(),
text_color="#FFFFFF",
alignment=pango.ALIGN_CENTER,
gaussian_radious=2, gaussian_color="#000000",
border_radious=1, border_color="#000000",
)
# Propagate expose to children.
propagate_expose(widget, event)
return True
开发者ID:netphi,项目名称:deepin-ui,代码行数:50,代码来源:navigatebar.py
示例12: __init__
def __init__(self,
shrink_first,
enable_animation=False,
always_show_button=False,
enable_drag=False,
handle_color=ui_theme.get_color("paned_line")
):
'''
Initialize Paned class.
'''
gtk.Paned.__init__(self)
self.shrink_first = shrink_first
self.enable_animation = enable_animation
self.always_show_button = always_show_button
self.enable_drag = enable_drag
self.handle_color = handle_color
self.bheight = ui_theme.get_pixbuf("paned/paned_up_normal.png").get_pixbuf().get_width()
self.saved_position = -1
self.handle_size = PANED_HANDLE_SIZE - 1
self.show_button = False
self.init_button("normal")
self.animation_delay = 20 # milliseconds
self.animation_times = 10
self.animation_position_frames = []
self.press_coordinate = None
开发者ID:Jiarui315,项目名称:deepin-ui,代码行数:25,代码来源:paned.py
示例13: render_name
def render_name(self, cr, rect):
'''
Render icon and name of DirItem.
'''
# Draw select background.
if self.is_select:
draw_vlinear(cr, rect.x ,rect.y, rect.width, rect.height,
ui_theme.get_shadow_color("listview_select").get_color_info())
# Init.
expand_indicator_pixbuf = ui_theme.get_pixbuf("treeview/arrow_right.png").get_pixbuf()
# Draw directory icon.
draw_pixbuf(cr, self.pixbuf,
rect.x + COLUMN_OFFSET * self.column_index + INDICATOR_PADDING_LEFT + expand_indicator_pixbuf.get_width() + INDICATOR_PADDING_RIGHT + ICON_PADDING_LEFT,
rect.y + (rect.height - ICON_SIZE) / 2,
)
# Draw directory name.
draw_text(cr, self.name,
rect.x + COLUMN_OFFSET * self.column_index + INDICATOR_PADDING_LEFT + expand_indicator_pixbuf.get_width() + INDICATOR_PADDING_RIGHT + ICON_PADDING_LEFT + ICON_SIZE + ICON_PADDING_RIGHT,
rect.y,
rect.width, rect.height)
# Draw drag line.
if self.drag_line:
with cairo_disable_antialias(cr):
cr.set_line_width(1)
if self.drag_line_at_bottom:
cr.rectangle(rect.x, rect.y + rect.height - 1, rect.width, 1)
else:
cr.rectangle(rect.x, rect.y, rect.width, 1)
cr.fill()
开发者ID:liuhuan520,项目名称:deepin-ui,代码行数:33,代码来源:file_treeview.py
示例14: draw_handle
def draw_handle(self, e):
'''
Draw the cusom handle apperance.
'''
handle = self.get_handle_window()
line_width = 1
cr = handle.cairo_create()
cr.set_source_rgb(*color_hex_to_cairo(ui_theme.get_color("paned_line").get_color()))
(width, height) = handle.get_size()
if self.get_orientation() == gtk.ORIENTATION_HORIZONTAL:
if self.shrink_first:
cr.rectangle(0, 0, line_width, height)
cr.fill()
if self.show_button:
draw_pixbuf(cr,
ui_theme.get_pixbuf("paned/paned_left_normal.png").get_pixbuf(),
0,
(height - self.bheight) / 2)
else:
cr.rectangle(width - line_width, 0, line_width, height)
cr.fill()
if self.show_button:
draw_pixbuf(cr,
ui_theme.get_pixbuf("paned/paned_right_normal.png").get_pixbuf(),
0,
(height - self.bheight) / 2)
else:
if self.shrink_first:
cr.rectangle(0, 0, width, line_width)
cr.fill()
if self.show_button:
draw_pixbuf(cr,
ui_theme.get_pixbuf("paned/paned_up_normal.png").get_pixbuf(),
(width - self.bheight) / 2,
0)
else:
cr.rectangle(0, height - line_width, width, line_width)
cr.fill()
if self.show_button:
draw_pixbuf(cr,
ui_theme.get_pixbuf("paned/paned_down_normal.png").get_pixbuf(),
(width - self.bheight) / 2,
0)
开发者ID:liuhuan520,项目名称:deepin-ui,代码行数:47,代码来源:paned.py
示例15: __init__
def __init__(self,
slider_images=None,
pointer_images=None,
button_images=None,
show_button=True,
slide_delay=10000,
):
'''
Initialize WizardBox class.
@param slider_images: Slider images, default is None.
@param pointer_images: Pointer images, default is None.
@param pointer_images: Button images, default is None.
@param show_button: Set as True to show button.
@param slide_delay: The time of delay between slider image, default is 10000ms.
'''
gtk.EventBox.__init__(self)
self.set_visible_window(False)
self.add_events(gtk.gdk.BUTTON_PRESS_MASK |
gtk.gdk.BUTTON_RELEASE_MASK |
gtk.gdk.POINTER_MOTION_MASK |
gtk.gdk.ENTER_NOTIFY_MASK |
gtk.gdk.LEAVE_NOTIFY_MASK
)
self.connect("expose-event", self.on_expose_event)
self.connect("motion-notify-event", self.on_motion_notify)
self.connect("button-press-event", self.on_button_press)
# Init images.
self.slider_pixbufs = map(gtk.gdk.pixbuf_new_from_file, slider_images)
self.slider_numuber = len(slider_images)
self.dot_normal_pixbuf, self.dot_active_pixbuf = map(gtk.gdk.pixbuf_new_from_file, pointer_images)
self.button_normal_pixbuf, self.button_press_pixbuf = map(gtk.gdk.pixbuf_new_from_file, button_images)
self.close_dpixbuf = ui_theme.get_pixbuf("button/window_close_normal.png")
self.show_button = show_button
# Init sizes.
self.init_size()
self.pointer_coords = {}
# Move animation.
self.active_index = 0
self.target_index = None
self.active_alpha = 1.0
self.target_index = 0.0
self.active_x = 0
self.target_x = None
self.slider_y = 0
self.auto_animation_id = None
self.auto_animation_timeout = slide_delay # millisecond.
self.slider_timeout = 1000 # millisecond.
self.in_animation = False
self.motion_index = None
self.auto_animation()
开发者ID:Jiarui315,项目名称:deepin-ui,代码行数:59,代码来源:slider.py
示例16: __init__
def __init__(self, preference_name):
'''
Initialize ExpandPreferenceItem class.
'''
IconTextItem.__init__(
self,
preference_name,
(ui_theme.get_pixbuf("treeview/arrow_right.png"),
ui_theme.get_pixbuf("treeview/arrow_right_hover.png")),
(ui_theme.get_pixbuf("treeview/arrow_down.png"),
ui_theme.get_pixbuf("treeview/arrow_down_hover.png")),
)
self.text_size = 10
self.text_padding = 0
self.alignment = pango.ALIGN_LEFT
self.icon_padding = 15
self.column_offset = 15
self.height = 37
开发者ID:Jiarui315,项目名称:deepin-ui,代码行数:18,代码来源:dialog.py
示例17: get_star_pixbufs
def get_star_pixbufs(self):
star_paths = ["star_background.png"] * 5
for index in range(0, self.star_level / 2):
star_paths[index] = "star_foreground.png"
if self.star_level % 2 == 1:
star_paths[self.star_level / 2] = "halfstar_background.png"
return map(lambda path: ui_theme.get_pixbuf("star/%s" % path).get_pixbuf(), star_paths)
开发者ID:web3d,项目名称:deepin-ui,代码行数:10,代码来源:star_view.py
示例18: __init__
def __init__(self,
timezone=0,
width=800,
height=409,
padding_top=0,
padding_left=0,
):
'''
Initialize TimeZone class.
@param timezone: Timezone, default is 0.
@param width: The width of timezone, default is 800 pixels.
@param height: The height of timezone, default is 409 pixels.
@param padding_top: The padding value of top, default is 0.
@param padding_left: The padding value of left, default is 0.
'''
gtk.EventBox.__init__(self)
self.__timezone = timezone + 9
self.width = width
self.height = height
self.set_size_request(self.width, self.height)
self.padding_top = padding_top
self.padding_left = padding_left
self.__const_width = 800
self.__const_height = 409
self.cache_bg_pixbuf = CachePixbuf()
self.bg_pixbuf = ui_theme.get_pixbuf("timezone/bg.png")
self.cache_timezone_pixbuf = CachePixbuf()
self.timezone_pixbuf = []
i = -9
while i <= 13:
self.timezone_pixbuf.append(ui_theme.get_pixbuf("timezone/timezone_%d.png" % i))
i += 1
self.connect("button-press-event", self.__button_press)
self.connect("expose-event", self.__expose)
开发者ID:chenzhiwei,项目名称:deepin-ui,代码行数:42,代码来源:timezone.py
示例19: draw_max_button
def draw_max_button(widget, cache_pixbuf, sub_dir, max_path_prefix, unmax_path_prefix):
'''Create max button.'''
# Init request size.
pixbuf = ui_theme.get_pixbuf("%s/%s_normal.png" % (sub_dir, unmax_path_prefix)).get_pixbuf()
widget.set_size_request(pixbuf.get_width(), pixbuf.get_height())
# Redraw.
widget.connect("expose-event", lambda w, e:
expose_max_button(w, e,
cache_pixbuf,
sub_dir, max_path_prefix, unmax_path_prefix))
开发者ID:netphi,项目名称:deepin-ui,代码行数:11,代码来源:button.py
示例20: top_paned_paint
def top_paned_paint(cr, handle_pos):
in_pixbuf = ui_theme.get_pixbuf("paned/in.png").get_pixbuf()
out_pixbuf = ui_theme.get_pixbuf("paned/out.png").get_pixbuf()
#
if handle_pos.can_visible:
# 绘制例子.
if handle_pos.can_in:
# 判断要向那个方向的控件靠拢.
if handle_pos.can_move_child2:
pixbuf = in_pixbuf
else:
pixbuf = out_pixbuf
else:
# 判断要向那个方向的控件靠拢.
if handle_pos.can_move_child2:
pixbuf = out_pixbuf
else:
pixbuf = in_pixbuf
# 判断是否为纵向.
if top_paned.get_type() == gtk.ORIENTATION_VERTICAL:
pixbuf = pixbuf.rotate_simple(270)
#
draw_pixbuf(cr, pixbuf, handle_pos.x, handle_pos.y)
开发者ID:Jiarui315,项目名称:deepin-ui,代码行数:23,代码来源:new_paned.py
注:本文中的theme.ui_theme.get_pixbuf函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论