本文整理汇总了Python中efl.elementary.icon.Icon.standard方法的典型用法代码示例。如果您正苦于以下问题:Python Icon.standard方法的具体用法?Python Icon.standard怎么用?Python Icon.standard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.icon.Icon
的用法示例。
在下文中一共展示了Icon.standard方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: content_get
# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard [as 别名]
def content_get(self, obj, part, item_data):
if part == "elm.swallow.icon":
h = item_data
s = h.status()
ic = Icon(obj)
if h.is_paused():
try:
ic.standard = "player_pause"
except RuntimeError:
self.log.debug("Setting torrent ic failed")
elif h.is_seed():
try:
ic.standard = "up"
except RuntimeError:
self.log.debug("Setting torrent ic failed")
else:
try:
ic.standard = "down"
except RuntimeError:
self.log.debug("Setting torrent ic failed")
ic.tooltip_text_set(self.state_str[s.state])
ic.size_hint_aspect_set(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1)
return ic
示例2: __init__
# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard [as 别名]
def __init__(self, parent, session):
Table.__init__(self, parent)
self.session = session
s = session.status()
self.padding = 5, 5
ses_pause_ic = self.ses_pause_ic = Icon(parent)
ses_pause_ic.size_hint_align = -1.0, -1.0
try:
if session.is_paused():
ses_pause_ic.standard = "player_pause"
else:
ses_pause_ic.standard = "player_play"
except RuntimeError:
self.log.debug("Setting session ic failed")
self.pack(ses_pause_ic, 1, 0, 1, 1)
ses_pause_ic.show()
title_l = Label(parent)
title_l.text = "<b>Session</b>"
self.pack(title_l, 0, 0, 1, 1)
title_l.show()
d_ic = Icon(parent)
try:
d_ic.standard = "down"
except RuntimeError:
self.log.debug("Setting d_ic failed")
d_ic.size_hint_align = -1.0, -1.0
self.pack(d_ic, 0, 2, 1, 1)
d_ic.show()
d_l = self.d_l = Label(parent)
d_l.text = "{}/s".format(intrepr(s.payload_download_rate))
self.pack(d_l, 1, 2, 1, 1)
d_l.show()
u_ic = Icon(self)
try:
u_ic.standard = "up"
except RuntimeError:
self.log.debug("Setting u_ic failed")
u_ic.size_hint_align = -1.0, -1.0
self.pack(u_ic, 0, 3, 1, 1)
u_ic.show()
u_l = self.u_l = Label(parent)
u_l.text = "{}/s".format(intrepr(s.payload_upload_rate))
self.pack(u_l, 1, 3, 1, 1)
u_l.show()
peer_t = Label(parent)
peer_t.text = "Peers"
self.pack(peer_t, 0, 4, 1, 1)
peer_t.show()
peer_l = self.peer_l = Label(parent)
peer_l.text = str(s.num_peers)
self.pack(peer_l, 1, 4, 1, 1)
peer_l.show()
self.show()
self.update_timer = Timer(1.0, self.update)