Пример #1
0
    def ConstructTeamsList(self):
        self.USERNAME = self.root.current_screen.ids.username.text
        self.root.current = "teams"
        self.root.transition.direction = "left"

        network = threading.Thread(target=Networking)
        network.start()
        time.sleep(2)

        if incoming_data:
            for team_name in incoming_data:
                button = IconRightWidget(icon="remove_icon.png")
                info = TooltipMDIconButton(
                    icon="information",
                    tooltip_text=incoming_data[team_name][2],
                    pos_hint={
                        "center_x": .5,
                        "center_y": .5
                    })
                button.add_widget(info)

                item = TwoLineAvatarIconListItem(
                    text=team_name,
                    secondary_text=incoming_data[team_name][0],
                    secondary_theme_text_color='Custom',
                    secondary_text_color=(1, 0, 0, 0.6),
                    on_release=self.ListItemPressed)
                item.add_widget(button)

                tooltips[team_name] = info

                self.root.current_screen.ids.container.add_widget(item)
                list_items.append(item)
Пример #2
0
 def dish_filler(self, hotel_selected):
     self.ids.list_dish.clear_widgets()
     self.cursor = db.cursor()
     search = "select dish, price from dish where username = \"" + hotel_selected + "\" and available = 1"
     self.cursor.execute(search)
     HotelScreen.dish_available_in_currentSelectedHotel = pd.DataFrame(self.cursor.fetchall()).rename(columns={0: "Dish", 1: "Price"})
     self.cursor.close()
     for i in range(len(HotelScreen.dish_available_in_currentSelectedHotel)):
         l = IconLeftWidget(icon="minus", on_release=self.minus_dish)
         r = IconRightWidget(icon="plus", on_release=self.plus_dish)
         dish_toShow = TwoLineAvatarIconListItem(text=HotelScreen.dish_available_in_currentSelectedHotel.loc[i, "Dish"],
                                                 secondary_text=str('\u20B9') + str(HotelScreen.dish_available_in_currentSelectedHotel.loc[i, "Price"]))
         dish_toShow.add_widget(l)
         dish_toShow.add_widget(r)
         self.ids.list_dish.add_widget(dish_toShow)
Пример #3
0
    def build(self):
        screen = Screen()
        scroll = ScrollView()
        my_list = MDList()

        for i in range(30):
            img = ImageLeftWidget(source='gerFlag.png')
            icon = IconRightWidget(icon='android')
            item = TwoLineAvatarIconListItem(text='Item ' + str(i),
                                             secondary_text='Hello world')
            item.add_widget(icon)
            item.add_widget(img)
            my_list.add_widget(item)
        scroll.add_widget(my_list)
        screen.add_widget(scroll)
        return screen
 def add_item(model):
     description = self.modelinfos.get(model).get('description', '')
     description = 'No description' if description == '' else description
     item = TwoLineAvatarIconListItem(text=model,
                                      secondary_text=description,
                                      on_release=partial(
                                          self.set_model, model),
                                      size_hint=(None, None),
                                      size=(600, 1))
     if model not in self.checked_models:
         self.checked_models[model] = False
     item.add_widget(LeftCheckbox(active=self.checked_models[model]))
     item.add_widget(
         IconRightWidget(icon='file-edit',
                         on_release=partial(self.edit_description,
                                            model, description)))
     self.layout.add_widget(item)
 def add_profile(profile, profileparam, profileparamstr):
     item = TwoLineAvatarIconListItem(
         text=profile,
         secondary_text="Settings: " + profileparamstr,
         on_release=partial(self.load_profile, profileparam),
     )
     item.add_widget(IconRightWidget(icon="trash-can", on_release=partial(self.remove_profile, profile)))
     if 'default' in profileparam and profileparam['default'] == False:
         item.add_widget(IconLeftWidget(icon="star-outline", on_release=partial(self.set_to_default, profile)))
     else:
         item.add_widget(IconLeftWidget(icon="star", on_release=partial(self.unset_default, profile)))
     self.layout.add_widget(item)
 def new_message(self, name, message, image_name):
     new_message = TwoLineAvatarIconListItem(text=name,
                                             secondary_text=message)
     new_message.add_widget(ImageLeftWidget(source=image_name))
     self.root.ids.list.add_widget(new_message)
Пример #7
0
 def new_message_private(self, name, message):
     new_message = TwoLineAvatarIconListItem(text=name, secondary_text=message)
     new_message.add_widget(IconLeftWidget(icon="message-outline"))
     self.chatscreen.ids.privatelist.add_widget(new_message)
Пример #8
0
 def new_message(self, name, text, image_location):
     new_message = TwoLineAvatarIconListItem(text=name, secondary_text=text)
     new_message.add_widget(ImageLeftWidget(source=image_location))
     new_message.add_widget(IconRightWidget(icon="minus"))
     self.root.ids.list.add_widget(new_message)