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


Python Icon.standard方法代码示例

本文整理汇总了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
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:25,代码来源:Main.py

示例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)
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:68,代码来源:Main.py


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