示例#1
0
 def create_book_author_menu_button(self,
                                    s,
                                    constr,
                                    action,
                                    show_img=True,
                                    show_label=True):
     """ Create Author Menu button
     
     :param s: button state
     :param constr: bounding box
     :param action: button event listener
     :param show_img: True - show image, False - don't show image
     :param show_label: True - show label, False - don't show label
     
     :return: genre menu button
     """
     s.bounding_box = constr
     s.img_x = None
     s.img_y = None
     s.auto_update = True
     s.show_bgr = True
     s.show_img = show_img
     s.show_label = show_label
     s.text_color_normal = self.config[COLORS][COLOR_BRIGHT]
     s.text_color_selected = self.config[COLORS][COLOR_CONTRAST]
     s.text_color_disabled = self.config[COLORS][COLOR_MEDIUM]
     s.text_color_current = s.text_color_normal
     s.label_text_height = 35
     button = Button(self.util, s)
     button.bgr = self.config[COLORS][COLOR_DARK]
     button.add_release_listener(action)
     return button
示例#2
0
 def create_menu_button(self, s, constr, action, scale, label_area_percent, label_text_height, show_img=True):
     """ Create Menu button
     
     :param s: button state
     :param constr: scaling constraints
     :param action: button event listener
     :param scale: True - scale images, False - don't scale images
     
     :return: menu button
     """          
     if scale:
         self.set_state_scaled_icons(s, constr)
     s.bounding_box = constr
     s.img_x = None
     s.img_y = None
     s.auto_update = True
     s.show_bgr = True
     s.show_img = show_img
     s.show_label = True
     s.image_location = CENTER
     s.label_location = BOTTOM
     s.label_area_percent = label_area_percent
     s.label_text_height = label_text_height
     s.text_color_normal = self.config[COLORS][COLOR_BRIGHT]
     s.text_color_selected = self.config[COLORS][COLOR_CONTRAST]
     s.text_color_disabled = self.config[COLORS][COLOR_MEDIUM]
     s.text_color_current = s.text_color_normal
     button = Button(self.util, s)
     button.bgr = self.config[COLORS][COLOR_DARK]
     button.add_release_listener(action)         
     if getattr(s, "icon_base", False):
         button.components[1].content = s.icon_base
     button.scaled = scale        
     return button
示例#3
0
    def create_collection_track_menu_button(self,
                                            s,
                                            constr,
                                            action,
                                            show_img=True,
                                            show_label=True):
        """ Create Collection Track Menu button

        :param s: button state
        :param constr: scaling constraints
        :param action: button event listener
        :param show_img: True - show button image, False - not
        :param show_label: True - show button label, False - not

        :return: menu button
        """
        s.bounding_box = constr
        s.img_x = None
        s.img_y = None
        s.auto_update = True
        s.show_bgr = True
        s.show_img = show_img
        s.show_label = show_label
        s.source = TRACK_MENU
        s.text_color_normal = self.config[COLORS][COLOR_BRIGHT]
        s.text_color_selected = self.config[COLORS][COLOR_CONTRAST]
        s.text_color_disabled = self.config[COLORS][COLOR_MEDIUM]
        s.text_color_current = s.text_color_normal
        s.wrap_labels = self.config[WRAP_LABELS]

        button = Button(self.util, s)
        button.bgr = self.config[COLORS][COLOR_DARK]
        button.add_release_listener(action)

        return button
示例#4
0
    def create_cyrillic_menu_button(self, s, constr, action, scale, font_size=45):
        """ Create Cyrillic Menu button

        :param s: button state
        :param constr: scaling constraints
        :param action: button event listener
        :param show_img: True - show image, False - don't show image
        :param show_label: True - show label, False - don't show label

        :return: menu button
        """
        s.bounding_box = constr
        s.img_x = None
        s.img_y = None
        s.auto_update = True
        s.show_bgr = True
        s.show_img = False
        s.show_label = True
        s.text_color_normal = self.config[COLORS][COLOR_BRIGHT]
        if s.name in ABC_RU:
            s.bgr = self.config[BACKGROUND][MENU_BGR_COLOR]
        else:
            s.bgr = (0, 0, 0, self.config[BACKGROUND][MENU_BGR_OPACITY])
        s.text_color_selected = self.config[COLORS][COLOR_CONTRAST]
        s.text_color_disabled = self.config[COLORS][COLOR_MEDIUM]
        s.text_color_current = s.text_color_normal
        s.fixed_height = font_size

        button = Button(self.util, s)
        button.bgr = self.config[COLORS][COLOR_DARK]
        button.add_release_listener(action)

        return button
示例#5
0
    def create_track_menu_button(self, s, constr, action, show_img=True, show_label=True):
        """ Create Menu button
        
        :param s: button state
        :param constr: scaling constraints
        :param action: button event listener
        :param scale: True - scale images, False - don't scale images
        
        :return: menu button
        """       
        
        s.bounding_box = constr
        s.img_x = None
        s.img_y = None
        s.auto_update = True
        s.show_bgr = True
        s.show_img = show_img
        s.show_label = show_label
        s.source = TRACK_MENU
        if s.name in ABC_RU:
            s.text_color_normal = self.config[COLORS][COLOR_BRIGHT]
        else:
            s.text_color_normal = (255, 255, 255)
        s.text_color_selected = self.config[COLORS][COLOR_CONTRAST]
        s.text_color_disabled = self.config[COLORS][COLOR_MEDIUM]
        s.text_color_current = s.text_color_normal
        
        button = Button(self.util, s)
        button.bgr = self.config[COLORS][COLOR_DARK]
        button.add_release_listener(action)

        return button