def __init__(self, **kvargs):
super(ProgressLoad, self).__init__(**kvargs)
box = BoxLayout(orientation="vertical", padding=20)
self.label_already_loaded = Label(
text="", size_hint=(1, .1), markup=True)
self.label_total_size = Label(
text="", size_hint=(1, .1), markup=True)
self.progress_load = KProgress()
self.button_cancel = \
Button(text=self.text_button_cancel, on_press=self.events_callback,
background_normal=self.button_cancel_background_normal,
background_down=self.button_cancel_background_down,
size_hint=(1, .2))
self.label_already_loaded.bind(
size=lambda *args: self._update_text_size(args))
self.label_total_size.bind(
size=lambda *args: self._update_text_size(args))
box.add_widget(self.label_already_loaded)
box.add_widget(self.label_total_size)
box.add_widget(Widget(size_hint=(None, .02)))
box.add_widget(SettingSpacer())
box.add_widget(Widget(size_hint=(None, .02)))
box.add_widget(self.progress_load)
box.add_widget(Widget(size_hint=(None, .3)))
box.add_widget(SettingSpacer())
box.add_widget(Widget(size_hint=(None, .02)))
box.add_widget(self.button_cancel)
self.progress_load.min = 0
self.progress_load.max = 100
self.progress_load.bar_value = 0
self.progress_load.spacing_widget = 2
self.progress_load.height_widget = 1
self.progress_load.color = self.progress_line_color
self.progress_load.background_color = self.progress_background_color
self.progress_load.border_color = self.progress_border_color
self.body = Popup(title=self.title, content=box, auto_dismiss=False,
size_hint=self.size_hint)
评论列表
文章目录