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


Python InfosPopover.should_be_shown方法代码示例

本文整理汇总了Python中lollypop.pop_infos.InfosPopover.should_be_shown方法的典型用法代码示例。如果您正苦于以下问题:Python InfosPopover.should_be_shown方法的具体用法?Python InfosPopover.should_be_shown怎么用?Python InfosPopover.should_be_shown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lollypop.pop_infos.InfosPopover的用法示例。


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

示例1: on_current_changed

# 需要导入模块: from lollypop.pop_infos import InfosPopover [as 别名]
# 或者: from lollypop.pop_infos.InfosPopover import should_be_shown [as 别名]
 def on_current_changed(self, player):
     """
         Update buttons on current changed
         @param player as Player
     """
     if InfosPopover.should_be_shown():
         if player.current_track.id != Type.RADIOS:
             self._artist_infos_btn.set_sensitive(True)
         else:
             self._artist_infos_btn.set_sensitive(False)
     self._play_btn.set_sensitive(True)
     self._prev_btn.set_sensitive(True)
     self._next_btn.set_sensitive(True)
     # Can add a \n in markup
     # GTK bug => https://bugzilla.gnome.org/show_bug.cgi?id=749965
     prev_artist = escape(player.prev_track.artist)
     prev_title = escape(player.prev_track.title)
     next_artist = escape(player.next_track.artist)
     next_title = escape(player.next_track.title)
     self._next_btn.set_tooltip_markup("<b>%s</b> - %s" %
                                       (next_artist,
                                        next_title))
     self._prev_btn.set_tooltip_markup("<b>%s</b> - %s" %
                                       (prev_artist,
                                        prev_title))
开发者ID:serkanalgur,项目名称:lollypop,代码行数:27,代码来源:toolbar_playback.py

示例2: _on_label_realize

# 需要导入模块: from lollypop.pop_infos import InfosPopover [as 别名]
# 或者: from lollypop.pop_infos.InfosPopover import should_be_shown [as 别名]
 def _on_label_realize(self, eventbox):
     """
         Change pointer on label
         @param eventbox as Gtk.EventBox
     """
     if InfosPopover.should_be_shown() and self._artist_id != Type.COMPILATIONS:
         eventbox.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.HAND1))
开发者ID:goncalor,项目名称:lollypop,代码行数:9,代码来源:view_artist.py

示例3: _on_label_button_release

# 需要导入模块: from lollypop.pop_infos import InfosPopover [as 别名]
# 或者: from lollypop.pop_infos.InfosPopover import should_be_shown [as 别名]
 def _on_label_button_release(self, eventbox, event):
     """
         On clicked label, show artist informations in a popover
         @param eventbox as Gtk.EventBox
         @param event as Gdk.Event
     """
     if InfosPopover.should_be_shown() and self._artist_id != Type.COMPILATIONS:
         pop = InfosPopover(self._artist_id, False)
         pop.set_relative_to(eventbox)
         pop.show()
开发者ID:goncalor,项目名称:lollypop,代码行数:12,代码来源:view_artist.py

示例4: _on_infos_btn_clicked

# 需要导入模块: from lollypop.pop_infos import InfosPopover [as 别名]
# 或者: from lollypop.pop_infos.InfosPopover import should_be_shown [as 别名]
 def _on_infos_btn_clicked(self, button):
     """
         Show current artist informations
         @param button as Gtk.Button
     """
     if InfosPopover.should_be_shown():
         artist_id = Lp.player.current_track.aartist_id
         if artist_id == Type.COMPILATIONS:
             artist = Lp.player.current_track.artist
         else:
             artist = Lp.player.current_track.aartist
         popover = InfosPopover(artist, Lp.player.current_track.id)
         popover.set_relative_to(button)
         popover.populate()
         popover.show()
开发者ID:serkanalgur,项目名称:lollypop,代码行数:17,代码来源:toolbar_playback.py

示例5: __init__

# 需要导入模块: from lollypop.pop_infos import InfosPopover [as 别名]
# 或者: from lollypop.pop_infos.InfosPopover import should_be_shown [as 别名]
    def __init__(self):
        """
            Init toolbar
        """
        Gtk.Bin.__init__(self)
        builder = Gtk.Builder()
        builder.add_from_resource('/org/gnome/Lollypop/ToolbarPlayback.ui')
        builder.connect_signals(self)

        self.add(builder.get_object('playback'))

        self._prev_btn = builder.get_object('previous_button')
        self._play_btn = builder.get_object('play_button')
        self._next_btn = builder.get_object('next_button')
        self._play_image = builder.get_object('play_image')
        self._pause_image = builder.get_object('pause_image')

        if InfosPopover.should_be_shown():
            self._artist_infos_btn = builder.get_object('artist_infos_btn')
            self._artist_infos_btn.show()
开发者ID:serkanalgur,项目名称:lollypop,代码行数:22,代码来源:toolbar_playback.py


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