Пример #1
0
    def create_list_widget(self):
        books_list = {}
        if len(self.response['books']) > 0:
            books_list.update(self.response['books'])
        if len(self.response['related_books']) > 0:
            books_list.update(self.response['related_books'])

        related_books_list = build_list(books_list)
        if related_books_list:
            self.simple_list_widget = SimpleList()
            self.simple_list_widget.leafs = related_books_list
            self.popup = Popup(title=self.title,
                               content=self.simple_list_widget,
                               size_hint=(None, None),
                               size=('500dp', '700dp'))

            button = ColorButton(
                text='Click here to see a list of items we have for this book',
                size_hint_max_y='30dp',
                pos_hint={
                    'center_x': 0.5,
                    'center_y': 0.5
                })
            button.bind(on_release=self.popup.open)
            self.r_popup.ids['_extend'].add_widget(button)
            volume = self.screens['search'].ids['_volume'].text or None
            if volume:
                from kivy.uix.label import Label
                label = Label(
                    text='It appears you are working on volume {}.'.format(
                        volume),
                    font_size=20)
                self.r_popup.ids['_extend'].add_widget(label)
Пример #2
0
 def build(self):
     button = ColorButton(text='Open popup',
                          size_hint=(None, None),
                          pos_hint={
                              'center_x': 0.5,
                              'center_y': 0.5
                          })
     button.fbind('on_release', self.show_reject_book_popup)
     return button
Пример #3
0
 def build(self):
     root = ColorButton(text='Open popup',
                        size_hint=(None, None),
                        pos_hint={
                            'center_x': 0.5,
                            'center_y': 0.5
                        })
     root.bind(on_release=self.open_popup)
     return root
Пример #4
0
 def build(self):
     Window.clearcolor = [1.0] * 4
     button = ColorButton(text='Open overlay',
                          size_hint=(None, None),
                          pos_hint={
                              'center_x': 0.5,
                              'center_y': 0.5
                          })
     button.fbind('on_release', self.open_overlay)
     return button
Пример #5
0
 def build(self):
     self.popup = popup = PageTypeFormPopup(target_anchor_x='right')
     popup.bind(on_submit=self.on_data_submit)
     button = ColorButton(text='Open popup',
                          size_hint=(None, None),
                          pos_hint={
                              'center_x': 0.5,
                              'center_y': 0.9
                          })
     button.bind(on_release=popup.open)
     popup.target_widget = button
     return button
Пример #6
0
 def _on_capture_leaf(self, backend, report):
     error = report.get(camera_system.KEY_ERROR, None)
     if isinstance(error, DiskFullError):
         content = ColorButton(text='OK')
         popup = self.create_popup(title='Error: the disk is full',
                                   content=content,
                                   auto_dismiss=False,
                                   size_hint=(None, None),
                                   size=('230dp', '100dp'))
         content.bind(on_release=popup.dismiss)
         popup.open()
     if report.get(camera_system.KEY_CAPTURE_START, False):
         self._on_capture_leaf_start()
     elif report.get(camera_system.KEY_CAPTURE_END, False):
         self._on_capture_leaf_end(report)
Пример #7
0
 def build(self):
     additional_content = PathVisualizationWidget()
     additional_content.make_data(DATA)
     self.popup = popup = CompositeInfoPopup(
         message='Aliquam voluptates vero et delectus. '
         'Qui consequuntur perferendis incidunt consequatur aut '
         'doloremque. Mollitia explicabo nisi magni iure. Amet et '
         'corporis et quas qui quia. Officia qui officiis qui '
         'voluptas ut et maiores voluptatem. Magni et doloremque '
         'assumenda dolores ',
         additional_content=additional_content)
     popup.bind(on_submit=self.on_data_submit)
     button = ColorButton(text='Open popup',
                          size_hint=(None, None),
                          pos_hint={
                              'center_x': 0.5,
                              'center_y': 0.9
                          })
     button.bind(on_release=popup.open)
     popup.target_widget = button
     return button