本文整理汇总了Python中lollypop.view_container.ViewContainer.get_allocation方法的典型用法代码示例。如果您正苦于以下问题:Python ViewContainer.get_allocation方法的具体用法?Python ViewContainer.get_allocation怎么用?Python ViewContainer.get_allocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lollypop.view_container.ViewContainer
的用法示例。
在下文中一共展示了ViewContainer.get_allocation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from lollypop.view_container import ViewContainer [as 别名]
# 或者: from lollypop.view_container.ViewContainer import get_allocation [as 别名]
#.........这里部分代码省略.........
"""
view = PlaylistsManageView(object_id, genre_ids, artist_ids, is_album)
view.populate()
view.show()
self._stack.add(view)
self._stack.set_visible_child(view)
def show_playlist_editor(self, playlist_id):
"""
Show playlist editor for playlist
Current view stay present in ViewContainer
@param playlist id as int
@param playlist name as str
"""
view = PlaylistEditView(playlist_id)
view.show()
self._stack.add(view)
self._stack.set_visible_child(view)
self._stack.clean_old_views(view)
view.populate()
def main_widget(self):
"""
Get main widget
@return Gtk.HPaned
"""
return self._paned_main_list
def get_view_width(self):
"""
Return view width
@return width as int
"""
return self._stack.get_allocation().width
def stop_all(self):
"""
Stop current view from processing
"""
view = self._stack.get_visible_child()
if view is not None:
self._stack.clean_old_views(None)
def show_genres(self, show):
"""
Show/Hide genres
@param bool
"""
self._show_genres = show
self._list_one.clear()
self._update_list_one(None)
def destroy_current_view(self):
"""
Destroy current view
"""
view = self._stack.get_visible_child()
for child in self._stack.get_children():
if child != view:
self._stack.set_visible_child(child)
self._stack.clean_old_views(child)
break
def disable_overlays(self):
"""
Disable overlays
示例2: __init__
# 需要导入模块: from lollypop.view_container import ViewContainer [as 别名]
# 或者: from lollypop.view_container.ViewContainer import get_allocation [as 别名]
#.........这里部分代码省略.........
@param genre ids as [int]
@param artist ids as [int]
@param is_album as bool
"""
from lollypop.view_playlists import PlaylistsManageView
current = self.__stack.get_visible_child()
view = PlaylistsManageView(object_id, genre_ids, artist_ids, is_album)
view.populate()
view.show()
self.__stack.add(view)
self.__stack.set_visible_child(view)
current.disable_overlay()
def show_playlist_editor(self, playlist_id):
"""
Show playlist editor for playlist
Current view stay present in ViewContainer
@param playlist id as int
@param playlist name as str
"""
from lollypop.view_playlists import PlaylistEditView
view = PlaylistEditView(playlist_id)
view.show()
self.__stack.add(view)
self.__stack.set_visible_child(view)
self.__stack.clean_old_views(view)
view.populate()
def get_view_width(self):
"""
Return view width
@return width as int
"""
return self.__stack.get_allocation().width
def stop_all(self):
"""
Stop current view from processing
"""
view = self.__stack.get_visible_child()
if view is not None:
self.__stack.clean_old_views(None)
def show_genres(self, show):
"""
Show/Hide genres
@param bool
"""
self.__show_genres = show
self.__list_one.clear()
self.__list_two.clear()
self.__list_two.hide()
self.__update_list_one(None)
self.__list_one.select_ids([Type.POPULARS])
def destroy_current_view(self):
"""
Destroy current view
"""
view = self.__stack.get_visible_child()
for child in self.__stack.get_children():
if child != view:
self.__stack.set_visible_child(child)
self.__stack.clean_old_views(child)
break