本文整理汇总了Python中lollypop.view_container.ViewContainer.get_children方法的典型用法代码示例。如果您正苦于以下问题:Python ViewContainer.get_children方法的具体用法?Python ViewContainer.get_children怎么用?Python ViewContainer.get_children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lollypop.view_container.ViewContainer
的用法示例。
在下文中一共展示了ViewContainer.get_children方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from lollypop.view_container import ViewContainer [as 别名]
# 或者: from lollypop.view_container.ViewContainer import get_children [as 别名]
#.........这里部分代码省略.........
@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
"""
view = self._stack.get_visible_child()
if view:
view.disable_overlays()
def update_view(self):
"""
Update current view
"""
view = self._stack.get_visible_child()
if view:
view.update_children()
def reload_view(self):
"""
Reload current view
"""
values_two = self._list_two.get_selected_ids()
if not values_two:
values_one = self._list_one.get_selected_ids()
if not values_one:
values_one = [Type.POPULARS]
self._list_one.select_ids([])
self._list_one.select_ids(values_one)
示例2: __init__
# 需要导入模块: from lollypop.view_container import ViewContainer [as 别名]
# 或者: from lollypop.view_container.ViewContainer import get_children [as 别名]
#.........这里部分代码省略.........
self._stack.add(view)
self._stack.set_visible_child(view)
start_new_thread(view.populate, ())
"""
Get main widget
@return Gtk.HPaned
"""
def main_widget(self):
return self._paned_main_list
"""
Stop current view from processing
"""
def stop_all(self):
view = self._stack.get_visible_child()
if view is not None:
self._stack.clean_old_views(None)
"""
Show/Hide genres
@param bool
"""
def show_genres(self, show):
self._show_genres = show
self._list_one.clear()
self._update_list_one(None)
"""
Destroy current view
"""
def destroy_current_view(self):
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
"""
Update current view
"""
def update_view(self):
view = self._stack.get_visible_child()
if view:
start_new_thread(view.update_covers, ())
"""
Mark force scan as False, update lists
@param scanner as CollectionScanner
"""
def on_scan_finished(self, scanner):
if self._list_one.is_populating() or self._list_two.is_populating():
GLib.timeout_add(500, self.on_scan_finished, scanner)
else:
self._update_lists(scanner)
############
# Private #
############
"""
Setup window main view:
- genre list
- artist list
- main view as artist view or album view
"""
def _setup_view(self):
示例3: __init__
# 需要导入模块: from lollypop.view_container import ViewContainer [as 别名]
# 或者: from lollypop.view_container.ViewContainer import get_children [as 别名]
#.........这里部分代码省略.........
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
@property
def view(self):
"""
Disable overlays
"""
return self.__stack.get_visible_child()
@property
def progress(self):
"""
Progress bar
@return ProgressBar
"""
return self.__progress
def add_remove_from(self, value, list_one, add):
"""
Add or remove value to list
@param value as (int, str)
@param list one as bool
@param add as bool
"""
if list_one:
l = self.__list_one
else:
l = self.__list_two
if add:
示例4: __init__
# 需要导入模块: from lollypop.view_container import ViewContainer [as 别名]
# 或者: from lollypop.view_container.ViewContainer import get_children [as 别名]
#.........这里部分代码省略.........
GLib.timeout_add(250, self.load_external, files)
else:
self._scanner.add(files)
"""
Get main widget
@return Gtk.HPaned
"""
def main_widget(self):
return self._paned_main_list
"""
Stop current view from processing
"""
def stop_all(self):
self._scanner.stop()
view = self._stack.get_visible_child()
if view is not None:
self._stack.clean_old_views(None)
"""
Show/Hide genres
@param bool
"""
def show_genres(self, show):
self._show_genres = show
self._update_list_one(None)
"""
Destroy current view
"""
def destroy_current_view(self):
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
"""
Update current view
"""
def update_view(self):
view = self._stack.get_visible_child()
if view:
start_new_thread(view.update_covers, ())
############
# Private #
############
"""
Setup window main view:
- genre list
- artist list
- main view as artist view or album view
"""
def _setup_view(self):
self._paned_main_list = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
self._paned_list_view = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
vgrid = Gtk.Grid()
vgrid.set_orientation(Gtk.Orientation.VERTICAL)
self._list_one = SelectionList()
self._list_one.widget.show()
self._list_two = SelectionList()
self._list_one.connect('item-selected', self._on_list_one_selected)
示例5: __init__
# 需要导入模块: from lollypop.view_container import ViewContainer [as 别名]
# 或者: from lollypop.view_container.ViewContainer import get_children [as 别名]
#.........这里部分代码省略.........
self._stack.add(view)
self._stack.set_visible_child(view)
view.populate()
def main_widget(self):
"""
Get main widget
@return Gtk.HPaned
"""
return self._paned_main_list
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 update_view(self):
"""
Update current view
"""
view = self._stack.get_visible_child()
if view:
view.update_covers()
def on_scan_finished(self, scanner):
"""
Mark force scan as False, update lists
@param scanner as CollectionScanner
"""
self._update_lists(scanner)
############
# Private #
############
def _setup_view(self):
"""
Setup window main view:
- genre list
- artist list
- main view as artist view or album view
"""
self._paned_main_list = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
self._paned_list_view = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)