本文整理汇总了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))
示例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))
示例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()
示例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()
示例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()