def set_genre_button_image(self, genre): """ Set genre button image :param genre: genre button """ s = State() s.__dict__ = genre.__dict__ s.bounding_box = self.genres_button.state.bounding_box s.bgr = self.genres_button.bgr s.show_label = False s.keyboard_key = kbd_keys[KEY_MENU] self.genres_button.set_state(s)
def set_genre_button_image(self, genre): """ Set genre button image :param genre: genre button """ if self.favorites_mode: favorites_button_state = self.favorites_util.get_favorites_button_state( self.genres_button.state.bounding_box) self.genres_button.selected = False self.genres_button.set_state(favorites_button_state) else: s = State() s.__dict__ = genre.__dict__ s.bounding_box = self.genres_button.state.bounding_box s.bgr = self.genres_button.bgr s.show_label = False s.keyboard_key = kbd_keys[KEY_MENU] self.factory.scale_genre_button_image(s, PERCENT_GENRE_IMAGE_AREA) self.genres_button.set_state(s)
def create_genre_button(self, bb, state, image_area): """ Create Genre button :param bb: bounding box :param state: button state :return: genre button """ s = State() s.__dict__ = state.__dict__ s.bgr = (0, 0, 0) s.bounding_box = bb s.keyboard_key = kbd_keys[KEY_MENU] s.img_x = None s.img_y = None s.auto_update = True s.image_align_v = V_ALIGN_CENTER s.show_bgr = True s.show_img = True s.show_label = False self.scale_genre_button_image(s, image_area) return Button(self.util, s)