def create_lyrics_dir_table(self): main_table = gtk.Table(3, 2) main_table.set_row_spacings(CONTENT_ROW_SPACING) dir_title_label = Label(_("Lyrics directory")) dir_title_label.set_size_request(200, 12) label_align = gtk.Alignment() label_align.set_padding(0, 0, 0, 0) label_align.add(dir_title_label) self.dir_entry = InputEntry() self.dir_entry.set_text(os.path.expanduser(config.get("lyrics", "save_lrc_path", "~/.lyrics"))) self.dir_entry.set_editable(False) self.dir_entry.set_size(250, 25) modify_button = Button(_("Change")) modify_button.connect("clicked", self.change_lyrics_save_dir) hbox = gtk.HBox(spacing=5) hbox.pack_start(self.dir_entry, False, False) hbox.pack_start(modify_button, False, False) main_table.attach(label_align, 0, 2, 0, 1, yoptions=gtk.FILL, xpadding=8) main_table.attach(create_separator_box(), 0, 2, 1, 2, yoptions=gtk.FILL) main_table.attach(hbox, 0, 2, 2, 3, xpadding=10, xoptions=gtk.FILL) return main_table
def create_play_box(self): main_table = gtk.Table(4, 2) main_table.set_row_spacings(10) play_title_label = Label(_("Playing")) play_title_label.set_size_request(350, 12) fade_check_hbox = gtk.HBox() self.fade_check_button = CheckButton(_("Crossfade")) fade_check_hbox.pack_start(self.fade_check_button, False, False) fade_check_hbox.pack_start(create_right_align(), True, True) self.album_check_button = CheckButton(_("Crossfade gapless album")) fade_label = Label(_("Fade timeout:")) self.fade_spin = SpinBox(300, 1, 1000, 100) millisecond_lablel = Label(_(" ms")) millisecond_lablel.set_size_request(50, 12) spin_hbox = gtk.HBox(spacing=3) spin_hbox.pack_start(fade_label, False, False) spin_hbox.pack_start(self.fade_spin, False, False) spin_hbox.pack_start(millisecond_lablel, False, False) main_table.attach(play_title_label, 0, 2, 0, 1, yoptions=gtk.FILL, xpadding=8) main_table.attach(create_separator_box(), 0, 2, 1, 2, yoptions=gtk.FILL) main_table.attach(fade_check_hbox, 0, 1, 2, 3, yoptions=gtk.FILL) main_table.attach(self.album_check_button, 1, 2, 2, 3, yoptions=gtk.FILL) main_table.attach(spin_hbox, 0, 1, 3, 4, yoptions=gtk.FILL, xpadding=8) return main_table
def create_play_box(self): main_table = gtk.Table(5, 2) main_table.set_row_spacings(CONTENT_ROW_SPACING) play_title_label = Label(_("Playback settings")) play_title_label.set_size_request(350, 12) fade_check_hbox = gtk.HBox() self.fade_check_button = CheckButton(_("Enable crossfade")) fade_check_hbox.pack_start(self.fade_check_button, False, False) fade_check_hbox.pack_start(create_right_align(), True, True) self.album_check_button = CheckButton(_("Seamless switching between the same album")) album_check_hbox = gtk.HBox() album_check_hbox.pack_start(self.album_check_button, False, False) album_check_hbox.pack_start(create_right_align(), True, True) fade_label = Label("%s" % _("Crossfade")) self.fade_spin = SpinBox(200, 0, 900, 100) millisecond_lablel = Label(_(" ms")) millisecond_lablel.set_size_request(50, 12) spin_hbox = gtk.HBox(spacing=3) spin_hbox.pack_start(fade_label, False, False) spin_hbox.pack_start(self.fade_spin, False, False) spin_hbox.pack_start(millisecond_lablel, False, False) main_table.attach(play_title_label, 0, 2, 0, 1, yoptions=gtk.FILL, xpadding=8) main_table.attach(create_separator_box(), 0, 2, 1, 2, yoptions=gtk.FILL) main_table.attach(fade_check_hbox, 0, 2, 2, 3, yoptions=gtk.FILL) main_table.attach(album_check_hbox, 0, 2, 3, 4, yoptions=gtk.FILL) main_table.attach(spin_hbox, 0, 1, 4, 5, yoptions=gtk.FILL, xpadding=8) return main_table
def create_style_table(self): main_table = gtk.Table(5, 2) main_table.set_row_spacings(10) style_title_label = Label(_("Lyrics style")) # font_name font_families = get_font_families() font_name = config.get("scroll_lyrics", "font_name") try: font_item_index = font_families.index(font_name) except: font_item_index = 0 font_name_hbox, self.font_name_combo_box = self.create_combo_widget(_("Font:"), [(font_name, None) for font_name in font_families], font_item_index) font_type_hbox = self.create_font_type_box() font_size = int(config.get("scroll_lyrics", "font_size", 10)) font_size_hbox, self.font_size_spin = self.create_combo_spin(_("Size:"), font_size, 5, 30, 1) # alignment. line_align_index = int(config.get("scroll_lyrics", "line_align", 1)) line_align_hbox, self.line_align_combo_box = self.create_combo_widget(_("Alignment:"), [(value, index) for index, value in enumerate([_("Left-aligned"), _("Centered"), _("Right-aligned")])], line_align_index) # scroll mode. scroll_mode_index = int(config.get("scroll_lyrics", "scroll_mode", 0)) scroll_mode_hbox, self.scroll_mode_combo_box = self.create_combo_widget(_("Rolling:"), [(value, index) for index, value in enumerate([_("Always"), _("By line")])], scroll_mode_index) inactive_color_label = Label(_("Coming:")) active_color_label = Label(_("Played:")) self.inactive_color_button = ColorButton(config.get("scroll_lyrics", "inactive_color")) self.active_color_button = ColorButton(config.get("scroll_lyrics", "active_color")) inactive_color_hbox = gtk.HBox(spacing=5) inactive_color_hbox.pack_start(inactive_color_label, False, False) inactive_color_hbox.pack_start(self.inactive_color_button, False, False) active_color_hbox = gtk.HBox(spacing=5) active_color_hbox.pack_start(active_color_label, False, False) active_color_hbox.pack_start(self.active_color_button, False, False) main_table.attach(style_title_label, 0, 2, 0, 1, yoptions=gtk.FILL, xpadding=8) main_table.attach(create_separator_box(), 0, 2, 1, 2, yoptions=gtk.FILL) main_table.attach(font_name_hbox, 0, 2, 2, 3, xpadding=20, xoptions=gtk.FILL) main_table.attach(font_type_hbox, 0, 1, 3, 4, xpadding=20) main_table.attach(font_size_hbox, 1, 2, 3, 4) main_table.attach(line_align_hbox, 0, 1, 4, 5, xpadding=20) main_table.attach(scroll_mode_hbox, 1, 2, 4, 5) main_table.attach(inactive_color_hbox, 0, 1, 5, 6, xpadding=20) main_table.attach(active_color_hbox, 1, 2, 5, 6) return main_table
def __init__(self, song=None): super(SongInfo, self).__init__() self.set_spacing(10) block_box = gtk.EventBox() block_box.set_visible_window(False) block_box.set_size_request(-1, 10) self.detail_table = gtk.Table(5, 4) self.detail_table.set_row_spacings(5) self.create_detail_box() self.pack_start(block_box, False, True) self.pack_start(self.create_simpler_box(), False, True) self.pack_start(create_separator_box(), False, True) self.pack_start(self.detail_table, False, True) self.pack_start(create_separator_box(), False, True) self.pack_start(self.create_location_box(), False, True) # update_song. if song: self.update_song(song)
def create_close_box(self): main_table = gtk.Table(3, 2) main_table.set_row_spacings(CONTENT_ROW_SPACING) close_title_label = Label(_("When pressing the close button")) close_title_label.set_size_request(350, 12) # mini_check_button self.tray_radio_button = RadioButton(_("Minimize to tray")) self.quit_radio_button = RadioButton(_("Quit")) main_table.attach(close_title_label, 0, 2, 0, 1, yoptions=gtk.FILL, xpadding=8) main_table.attach(create_separator_box(), 0, 2, 1, 2, yoptions=gtk.FILL) main_table.attach(self.tray_radio_button, 0, 1, 2, 3, yoptions=gtk.FILL) main_table.attach(self.quit_radio_button, 1, 2, 2, 3) return main_table
def __init__(self): gtk.VBox.__init__(self) main_box = gtk.VBox(spacing=15) logo_image = gtk.image_new_from_pixbuf(gtk.gdk.pixbuf_new_from_file(os.path.join(get_parent_dir(__file__, 3), "image", "logo1.png"))) light_color = app_theme.get_color("labelText") logo_name = Label(PROGRAM_NAME_LONG, text_size=10) logo_box = gtk.HBox(spacing=2) logo_box.pack_start(logo_image, False, False) logo_box.pack_start(logo_name, False, False) version_label = Label("%s" % _("Version")) version_content = Label(PROGRAM_VERSION, light_color) # publish_label = Label(_("Release date:")) # publish_content = Label("2012.07.12", light_color) info_box = gtk.HBox(spacing=5) info_box.pack_start(version_label, False, False) info_box.pack_start(version_content, False, False) # info_box.pack_start(publish_label, False, False) # info_box.pack_start(publish_content, False, False) title_box = gtk.HBox() title_box.pack_start(logo_box, False, False) title_box.pack_start(create_right_align(), True, True) title_box.pack_start(info_box, False, False) describe = _("Deepin Music is a music application designed for Linux " "users. It's characterized with lyrics searching, desktop " "lyrics display,album cover downloading, resume playing, " "music management and skin selection.\n" "\n" "Deepin Music is free software licensed under GNU GPLv3.") describe_label = Label(describe, enable_select=False, wrap_width=400, text_size=10) main_box.pack_start(title_box, False, False) main_box.pack_start(create_separator_box(), False, True) main_box.pack_start(describe_label, False, False) main_align = gtk.Alignment() main_align.set_padding(25, 0, 0, 0) main_align.set(0, 0, 1, 1) main_align.add(main_box) self.add(main_align)
def create_start_box(self): main_table = gtk.Table(4, 2) main_table.set_row_spacings(CONTENT_ROW_SPACING) start_title_label = Label(_("On starting the player")) start_title_label.set_size_request(350, 12) label_align = gtk.Alignment() label_align.set_padding(20, 0, 0, 0) label_align.add(start_title_label) # splash check_button self.splash_check_button = CheckButton(_("Display splash-screen")) splash_hbox = gtk.HBox() splash_hbox.pack_start(self.splash_check_button, False, False) splash_hbox.pack_start(create_right_align(), True, True) # open_lyrics_check_button. open_lyrics_hbox = gtk.HBox() self.open_lyrics_check_button = CheckButton(_("Show lyrics")) open_lyrics_hbox.pack_start(self.open_lyrics_check_button, False, False) # startup_check_button. self.auto_play_check_button = CheckButton(_("Start playback automatically")) auto_play_hbox = gtk.HBox() auto_play_hbox.pack_start(self.auto_play_check_button, False, False) auto_play_hbox.pack_start(create_right_align(), True, True) # resume last check_button. self.resume_last_check_button = CheckButton(_("Resume playback")) resume_hbox = gtk.HBox() resume_hbox.pack_start(self.resume_last_check_button, False, False) main_table.attach(label_align, 0, 2, 0, 1, yoptions=gtk.FILL, xpadding=8) main_table.attach(create_separator_box(), 0, 2, 1, 2, gtk.FILL) #main_table.attach(splash_hbox, 0, 1, 2, 3) main_table.attach(open_lyrics_hbox, 0, 1, 2, 3) main_table.attach(auto_play_hbox, 1, 2, 2, 3, yoptions=gtk.EXPAND) main_table.attach(resume_hbox, 0, 1, 3, 4) return main_table
def __init__(self): gtk.VBox.__init__(self) main_box = gtk.VBox(spacing=15) logo_image = ImageBox(app_theme.get_pixbuf("skin/logo1.png")) light_color = app_theme.get_color("labelText") logo_name = Label(_("Deepin Music Player"), text_size=10) logo_box = gtk.HBox(spacing=2) logo_box.pack_start(logo_image, False, False) logo_box.pack_start(logo_name, False, False) version_label = Label(_("Version:")) version_content = Label("V1.0", light_color) # publish_label = Label(_("Release date:")) # publish_content = Label("2012.07.12", light_color) info_box = gtk.HBox(spacing=5) info_box.pack_start(version_label, False, False) info_box.pack_start(version_content, False, False) # info_box.pack_start(publish_label, False, False) # info_box.pack_start(publish_content, False, False) title_box = gtk.HBox() title_box.pack_start(logo_box, False, False) title_box.pack_start(create_right_align(), True, True) title_box.pack_start(info_box, False, False) describe = _(" Deepin Music Player is a music application designed for Linux users.It features lyrics searching and downloading, desktop lyrics display,album cover downloading, resume playing, music management and skin selection.\n\nDeepin Music Player is free software licensed under GNU GPLv3.") describe_label = Label(describe, enable_select=False, wrap_width=400, text_size=10) main_box.pack_start(title_box, False, False) main_box.pack_start(create_separator_box(), False, True) main_box.pack_start(describe_label, False, False) main_align = gtk.Alignment() main_align.set_padding(25, 0, 0, 0) main_align.set(0, 0, 1, 1) main_align.add(main_box) self.add(main_align)
def create_hotkey_box(self): hotkey_title_label = Label(_("Hotkeys")) hotkey_title_label.set_size_request(350, 12) label_align = gtk.Alignment() label_align.set_padding(20, 0, 0, 0) label_align.add(hotkey_title_label) self.main_table.attach(label_align, 0, 2, 0, 1, yoptions=gtk.FILL, xpadding=8) self.main_table.attach(create_separator_box(), 0, 2, 1, 2, yoptions=gtk.FILL) # using check button. using_hbox = gtk.HBox() self.using_check_button = CheckButton(_("Enable hotkeys")) using_hbox.pack_start(self.using_check_button, False, False) using_hbox.pack_start(create_right_align(), False, True) self.main_table.attach(using_hbox, 0, 2, 2, 3, yoptions=gtk.FILL) self.toggle_window_entry = self.create_combo_entry(3, 4, _("Minimize/Show window"), config.get("globalkey", "toggle_window")) self.toggle_lyrics_status_entry = self.create_combo_entry(4, 5, _("Show/Hide lyrics"), config.get("globalkey", "toggle_lyrics_status")) self.toggle_lyrics_lock_entry = self.create_combo_entry(5, 6, _("Lock/Unlock lyrics"), config.get("globalkey", "toggle_lyrics_lock")) self.playpause_entry = self.create_combo_entry(6, 7, _("Play/Pause"), config.get("globalkey", "playpause")) self.previous_entry = self.create_combo_entry(7, 8, _("Previous"), config.get("globalkey", "previous")) self.next_entry = self.create_combo_entry(8, 9, _("Next"), config.get("globalkey", "next")) self.increase_vol_entry = self.create_combo_entry(9, 10, _("Volume Up"), config.get("globalkey", "increase_vol")) self.decrease_vol_entry = self.create_combo_entry(10, 11, _("Volume Down"), config.get("globalkey", "decrease_vol")) # Button. default_button = Button(_("Reset")) default_button.connect("clicked", self.restore_to_default) button_hbox = gtk.HBox() button_hbox.pack_start(create_right_align(), True, True) button_hbox.pack_start(default_button, False, False) self.main_table.attach(button_hbox, 0, 2, 11, 12, xpadding=10)
def __init__(self, db_query): # Init. gtk.VBox.__init__(self) SignalContainer.__init__(self) self.__db_query = db_query self.update_interval = 3000 # 3000 millisecond. self.reload_flag = False self.search_flag = False self.cache_search_list = [] self.cache_search_view = [] self.__selected_tag = {"album": [], "artist": [], "genre": []} Dispatcher.connect("reload-browser", self.on_dispatcher_reload_browser) gobject.timeout_add(self.update_interval, self.on_interval_loaded_view) # The saving song Classification presented to the user. self.artists_view, self.artists_sw = self.get_icon_view(14) self.albums_view, self.albums_sw = self.get_icon_view(14) self.genres_view, self.genres_sw = self.get_icon_view(14) self.folders_view, self.folders_sw = self.get_icon_view(20) self.folders_view.connect("motion-notify-item", self.on_folders_view_motion_notify) # Song list for temporarily storing # self.songs_view, self.songs_view_sw = self.get_song_view() self.songs_view = self.get_song_view() # Classification navigation bar. self.filterbar = OptionBar( [(app_theme.get_pixbuf("filter/artist_normal.png"), app_theme.get_pixbuf("filter/artist_press.png"), _("Artist"), lambda : self.switch_filter_view("artist")), (app_theme.get_pixbuf("filter/album_normal.png"), app_theme.get_pixbuf("filter/album_press.png"), _("Album"), lambda : self.switch_filter_view("album")), (app_theme.get_pixbuf("filter/genre_normal.png"), app_theme.get_pixbuf("filter/genre_press.png"), _("Genre"), lambda : self.switch_filter_view("genre")), (app_theme.get_pixbuf("filter/local_normal.png"), app_theme.get_pixbuf("filter/local_press.png"), _("Folder"), lambda : self.switch_filter_view("folder")) ]) # Manage the media library (import, refresh) self.importbar = SongImportBar() self.importbar.reload_items( [ (_("Quick Scan"), lambda : ImportFolderJob([os.path.expanduser("~")])), (_("Scan"), lambda : ImportFolderJob()), (_("Refresh"), lambda : ReloadDBJob()) ]) # Left box invailed_box = gtk.VBox() invailed_box.set_size_request(-1, 10) left_vbox = gtk.VBox(spacing=10) left_vbox.set_size_request(121, -1) # left_vbox.pack_start(invailed_box, False, True) left_vbox.pack_start(self.filterbar, False, False) left_vbox.pack_start(create_separator_box(), False, False) left_vbox.pack_start(self.importbar, False, False) # Used to switch songs category view, in the right side of the layout. self.switch_view_box = gtk.VBox() self.switch_view_box.add(self.artists_sw) # self.switch_view_box.add(TaskView()) # Control back on a view. self.back_hbox = gtk.HBox() self.back_hbox.set_size_request(-1, 26) self.back_hbox.set_no_show_all(True) self.back_button = BackButton() self.back_button.connect("clicked", self.on_back_button_clicked) self.prompt_button = PromptButton() self.back_hbox.pack_start(self.back_button, False, False, 5) self.back_hbox.pack_start(self.prompt_button, False, False) # searchbar self.search_entry, search_align = self.get_search_entry() search_hbox = gtk.HBox() search_hbox.pack_start(self.back_hbox, False, False) search_hbox.pack_start(create_right_align(), True, True) # search_hbox.pack_start(search_align, False, False) search_hbox_align = gtk.Alignment() search_hbox_align.set_padding(5, 0, 0, 0) search_hbox_align.set(0, 0, 1, 1) search_hbox_align.add(search_hbox) # Layout on the right. content_box = gtk.VBox(spacing=5) content_box.pack_start(search_hbox_align, False, False) content_box.pack_start(self.switch_view_box, True, True) body_paned = HPaned(handle_color=app_theme.get_color("panedHandler"), enable_drag=True) body_paned.add1(left_vbox) body_paned.add2(content_box) self.pack_start(body_paned, True, True)
def __init__(self, db_query): # Init. gtk.VBox.__init__(self) SignalContainer.__init__(self) self.__db_query = db_query self.update_interval = 3000 # 3000 millisecond. self.reload_flag = False self.search_flag = False self.cache_search_list = [] self.cache_search_view = [] self.__selected_tag = {"album": [], "artist": [], "genre": []} Dispatcher.connect("reload-browser", self.on_dispatcher_reload_browser) gobject.timeout_add(self.update_interval, self.on_interval_loaded_view) # The saving song Classification presented to the user. self.artists_view, self.artists_sw = self.get_icon_view(14) self.albums_view, self.albums_sw = self.get_icon_view(14) self.genres_view, self.genres_sw = self.get_icon_view(14) self.folders_view, self.folders_sw = self.get_icon_view(20) self.folders_view.connect("motion-notify-item", self.on_folders_view_motion_notify) # Song list for temporarily storing # self.songs_view, self.songs_view_sw = self.get_song_view() self.songs_view = self.get_song_view() # Classification navigation bar. self.filterbar = OptionBar([ (app_theme.get_pixbuf("filter/artist_normal.png"), app_theme.get_pixbuf("filter/artist_press.png"), _("Artist"), lambda: self.switch_filter_view("artist")), (app_theme.get_pixbuf("filter/album_normal.png"), app_theme.get_pixbuf("filter/album_press.png"), _("Album"), lambda: self.switch_filter_view("album")), (app_theme.get_pixbuf("filter/genre_normal.png"), app_theme.get_pixbuf("filter/genre_press.png"), _("Genre"), lambda: self.switch_filter_view("genre")), (app_theme.get_pixbuf("filter/local_normal.png"), app_theme.get_pixbuf("filter/local_press.png"), _("Folder"), lambda: self.switch_filter_view("folder")) ]) # Manage the media library (import, refresh) self.importbar = SongImportBar() self.importbar.reload_items([ (_("Quick Scan"), lambda: ImportFolderJob([os.path.expanduser("~")])), (_("Scan"), lambda: ImportFolderJob()), (_("Refresh"), lambda: ReloadDBJob()) ]) # Left box invailed_box = gtk.VBox() invailed_box.set_size_request(-1, 10) left_vbox = gtk.VBox(spacing=10) left_vbox.set_size_request(121, -1) # left_vbox.pack_start(invailed_box, False, True) left_vbox.pack_start(self.filterbar, False, False) left_vbox.pack_start(create_separator_box(), False, False) left_vbox.pack_start(self.importbar, False, False) # Used to switch songs category view, in the right side of the layout. self.switch_view_box = gtk.VBox() self.switch_view_box.add(self.artists_sw) # self.switch_view_box.add(TaskView()) # Control back on a view. self.back_hbox = gtk.HBox() self.back_hbox.set_size_request(-1, 26) self.back_hbox.set_no_show_all(True) self.back_button = BackButton() self.back_button.connect("clicked", self.on_back_button_clicked) self.prompt_button = PromptButton() self.back_hbox.pack_start(self.back_button, False, False, 5) self.back_hbox.pack_start(self.prompt_button, False, False) # searchbar self.search_entry, search_align = self.get_search_entry() search_hbox = gtk.HBox() search_hbox.pack_start(self.back_hbox, False, False) search_hbox.pack_start(create_right_align(), True, True) # search_hbox.pack_start(search_align, False, False) search_hbox_align = gtk.Alignment() search_hbox_align.set_padding(5, 0, 0, 0) search_hbox_align.set(0, 0, 1, 1) search_hbox_align.add(search_hbox) # Layout on the right. content_box = gtk.VBox(spacing=5) content_box.pack_start(search_hbox_align, False, False) content_box.pack_start(self.switch_view_box, True, True) body_paned = HPaned(handle_color=app_theme.get_color("panedHandler"), enable_drag=True) body_paned.add1(left_vbox) body_paned.add2(content_box) self.pack_start(body_paned, True, True)
def create_style_table(self): main_table = gtk.Table(12, 2) main_table.set_row_spacings(CONTENT_ROW_SPACING) self.create_single_line_box() self.create_double_line_box() style_title_label = Label(_("Lyrics style")) # font_name font_families = get_font_families() font_name = config.get("lyrics", "font_name") try: font_item_index = font_families.index(font_name) except: font_item_index = 0 font_name_hbox, self.font_name_combo_box = self.create_combo_widget(_("Font"), [(font_name, None) for font_name in font_families], font_item_index) font_type_hbox = self.create_font_type_box() font_size = int(config.get("lyrics", "font_size", 30)) font_size_hbox, self.font_size_spin = self.create_combo_spin(_("Size"), font_size, 16, 70, 1) line_number = config.getint("lyrics", "line_count") line_number_hbox, self.line_number_combo_box = self.create_combo_widget(_("Lines"), [(_("Single"), 1), (_("Double"), 2)], select_index=line_number - 1) self.line_align_hbox = gtk.HBox() line_align_label = Label("%s:" % _("Alignment")) if line_number == 2: self.line_align_hbox.add(self.double_align_combo_box) else: self.line_align_hbox.add(self.single_align_combo_box) part_align_hbox = set_widget_resize(line_align_label, self.line_align_hbox) outline_hbox, self.outline_spin = self.create_combo_spin(_("Outline"), int(config.get("lyrics", "outline_width", "3")), 0, 8, 1) # blur_color_button. blur_color_label = Label("%s:" % _("Stroke")) self.blur_color_button = ColorButton(config.get("lyrics", "blur_color", "#000000")) blur_color_hbox = set_widget_resize(blur_color_label, self.blur_color_button) predefine_color_hbox = self.create_predefine_box() inactive_color_label = Label("%s:" % _("Unplayed")) self.inactive_upper_color_button = ColorButton(config.get("lyrics", "inactive_color_upper")) self.inactive_middle_color_button = ColorButton(config.get("lyrics", "inactive_color_middle")) self.inactive_bottom_color_button = ColorButton(config.get("lyrics", "inactive_color_bottom")) inactive_color_subbox = gtk.HBox(spacing=10) inactive_color_subbox.pack_start(self.inactive_upper_color_button, False, False) inactive_color_subbox.pack_start(self.inactive_middle_color_button, False, False) inactive_color_subbox.pack_start(self.inactive_bottom_color_button, False, False) inactive_color_box = set_widget_resize(inactive_color_label, inactive_color_subbox, sizes2=(160, 22)) active_color_label = Label("%s:" % _("Played")) self.active_upper_color_button = ColorButton(config.get("lyrics", "active_color_upper")) self.active_middle_color_button = ColorButton(config.get("lyrics", "active_color_middle")) self.active_bottom_color_button = ColorButton(config.get("lyrics", "active_color_bottom")) active_color_subbox = gtk.HBox(spacing=10) active_color_subbox.pack_start(self.active_upper_color_button, False, False) active_color_subbox.pack_start(self.active_middle_color_button, False, False) active_color_subbox.pack_start(self.active_bottom_color_button, False, False) active_color_box = set_widget_resize(active_color_label, active_color_subbox, sizes2=(160, 22)) main_table.attach(style_title_label, 0, 2, 0, 1, yoptions=gtk.FILL, xpadding=8) main_table.attach(create_separator_box(), 0, 2, 1, 2, yoptions=gtk.FILL) main_table.attach(font_name_hbox, 0, 2, 2, 3) main_table.attach(font_type_hbox, 0, 2, 3, 4) main_table.attach(font_size_hbox, 0, 2, 4, 5) main_table.attach(line_number_hbox, 0, 2, 5, 6) main_table.attach(part_align_hbox, 0, 2, 6, 7) main_table.attach(outline_hbox, 0, 2, 7, 8) main_table.attach(blur_color_hbox, 0, 2, 8, 9) main_table.attach(predefine_color_hbox, 0, 2, 9, 10) main_table.attach(inactive_color_box, 0, 2, 10, 11) main_table.attach(active_color_box, 0, 2, 11, 12) return main_table
def create_style_table(self): main_table = gtk.Table(9, 2) main_table.set_row_spacings(10) self.create_single_line_box() self.create_double_line_box() style_title_label = Label(_("Lyrics style")) # font_name font_families = get_font_families() font_name = config.get("lyrics", "font_name") try: font_item_index = font_families.index(font_name) except: font_item_index = 0 font_name_hbox, self.font_name_combo_box = self.create_combo_widget(_("Font:"), [(font_name, None) for font_name in font_families], font_item_index) font_type_hbox = self.create_font_type_box() font_size = int(config.get("lyrics", "font_size", 30)) font_size_hbox, self.font_size_spin = self.create_combo_spin(_("Size:"), font_size, 16, 70, 1) line_number = config.getint("lyrics", "line_count") line_number_hbox, self.line_number_combo_box = self.create_combo_widget(_("Lines:"), [(name, index + 1) for index, name in enumerate([_("Single"), _("Double")])], line_number - 1) self.line_align_hbox = gtk.HBox() part_align_hbox = gtk.HBox(spacing=5) line_align_label = Label(_("Alignment:")) if line_number == 2: self.line_align_hbox.add(self.double_align_combo_box) else: self.line_align_hbox.add(self.single_align_combo_box) part_align_hbox.pack_start(line_align_label, False, False) part_align_hbox.pack_start(self.line_align_hbox, False, False) outline_hbox, self.outline_spin = self.create_combo_spin(_("Outline:"), int(config.get("lyrics", "outline_width", "3")), 0, 8, 1) # blur_color_button. blur_color_hbox = gtk.HBox(spacing=5) blur_color_label = Label(_("Stroke:")) self.blur_color_button = ColorButton(config.get("lyrics", "blur_color", "#000000")) blur_color_hbox.pack_start(blur_color_label, False, False) blur_color_hbox.pack_start(self.blur_color_button, False, False) predefine_color_hbox = self.create_predefine_box() inactive_color_box = gtk.HBox(spacing=10) inactive_color_label = Label(_("Coming:")) self.inactive_upper_color_button = ColorButton(config.get("lyrics", "inactive_color_upper")) self.inactive_middle_color_button = ColorButton(config.get("lyrics", "inactive_color_middle")) self.inactive_bottom_color_button = ColorButton(config.get("lyrics", "inactive_color_bottom")) inactive_color_box.pack_start(inactive_color_label, False, False) inactive_color_box.pack_start(self.inactive_upper_color_button, False, False) inactive_color_box.pack_start(self.inactive_middle_color_button, False, False) inactive_color_box.pack_start(self.inactive_bottom_color_button, False, False) active_color_box = gtk.HBox(spacing=10) active_color_label = Label(_("Played:")) self.active_upper_color_button = ColorButton(config.get("lyrics", "active_color_upper")) self.active_middle_color_button = ColorButton(config.get("lyrics", "active_color_middle")) self.active_bottom_color_button = ColorButton(config.get("lyrics", "active_color_bottom")) active_color_box.pack_start(active_color_label, False, False) active_color_box.pack_start(self.active_upper_color_button, False, False) active_color_box.pack_start(self.active_middle_color_button, False, False) active_color_box.pack_start(self.active_bottom_color_button, False, False) main_table.attach(style_title_label, 0, 2, 0, 1, yoptions=gtk.FILL, xpadding=8) main_table.attach(create_separator_box(), 0, 2, 1, 2, yoptions=gtk.FILL) main_table.attach(font_name_hbox, 0, 2, 2, 3, xpadding=20, xoptions=gtk.FILL) main_table.attach(font_type_hbox, 0, 1, 3, 4, xpadding=20) main_table.attach(font_size_hbox, 1, 2, 3, 4) main_table.attach(line_number_hbox, 0, 1, 4, 5, xpadding=20) main_table.attach(part_align_hbox, 1, 2, 4, 5) main_table.attach(outline_hbox, 0, 1, 5, 6, xpadding=20) main_table.attach(blur_color_hbox, 1, 2, 5, 6) main_table.attach(predefine_color_hbox, 0, 2, 6, 7, xpadding=20, xoptions=gtk.FILL) main_table.attach(inactive_color_box, 0, 2, 7, 8, xpadding=35, xoptions=gtk.FILL) main_table.attach(active_color_box, 0, 2, 8, 9, xpadding=35, xoptions=gtk.FILL) return main_table