def __init__(self, container, package, exit_callback): themedFrame.ThemedFrame.__init__(self, container) self.place(relwidth=1, relheight=1) self.tkraise() self.original_package = package.copy() self.package = package self.assets = [] self.left_column = themedFrame.ThemedFrame( self, background=style.primary_color) self.left_column.place(relheight=1, width=SIDECOLUMNWIDTH) self.column_header = themedLabel.ThemedLabel( self.left_column, text="ASSETS", font=style.mediumboldtext, foreground=style.primary_text_color) self.column_header.place(y=+style.offset, x=+style.offset, relwidth=1, width=style.offset) self.left_column_listboxes = themedFrame.ThemedFrame( self.left_column, background=style.primary_color) self.left_column_listboxes.place(y=30, relheight=1, relwidth=1, height=-60) self.assetsindexlist = scrollingWidgets.ScrolledThemedListBox( self.left_column_listboxes, background=style.primary_color) self.assetsindexlist.place(relheight=1, width=20, x=+2 * style.offset) self.assetstypelist = scrollingWidgets.ScrolledThemedListBox( self.left_column_listboxes, background=style.primary_color) self.assetstypelist.place(relheight=1, relwidth=1, x=20 + 2 * style.offset, width=-(20 + 4 * style.offset)) bindlist = [self.assetsindexlist, self.assetstypelist] if platform.system() == 'Windows' or platform.system() == "Darwin": for b in bindlist: b.bind("<MouseWheel>", self.on_mouse_wheel) elif platform.system() == "Linux": for b in bindlist: b.bind("<Button-4>", self.on_mouse_wheel) b.bind("<Button-5>", self.on_mouse_wheel) self.body = themedFrame.ThemedFrame(self, background=style.secondary_color) self.body.place(relwidth=1, relheight=1, x=SIDECOLUMNWIDTH, width=SIDECOLUMNWIDTH) self.load() self.assetstypelist.bind("<<ListboxSelect>>", self.on_listbox_selection)
def __init__(self, app, container, handler): categoryPage.CategoryPage.__init__(self, app, container, handler, "PLUGINS", handler.all) self.warning_acknowledged = False self.warningframe = themedFrame.ThemedFrame(self) self.warningframe.place(relwidth=1, relheight=1) self.warning_label = tk.Label(self.warningframe, text=WARNING, background=style.primary_color, font=style.smalltext, foreground=style.primary_text_color) self.warning_label.place(relx=0.5, rely=0.5, width=500, height=50, y=-25, x=-250) self.ack_button = button.Button(self.warningframe, self.ack, text_string="OK") self.ack_button.place(relx=0.5, rely=0.5, width=100, height=30, y=50, x=-50) self.bind("<Configure>", self.configure)
def __init__(self, frame): DetailPage.__init__(self, frame) self.place(relwidth=1, relheight=1) #since page is dynamic, need a trash can self.frame = frame self.destroyables = [] #Want to reuse a lot of the page but need to do some cleanup self.column_downloads.destroy() self.column_title.destroy() self.column_author.destroy() self.column_version.destroy() self.column_license.destroy() self.column_package.destroy() self.column_downloads.destroy() self.column_updated.destroy() self.column_uninstall_button.destroy() self.column_install_button.destroy() self.details.destroy() self.body.place(relwidth=1, relheight=1, width=-2 * style.sidecolumnwidth) self.column.place(relx=1, rely=0, width=2 * style.sidecolumnwidth, relheight=1, x=-2 * style.sidecolumnwidth) #Move buttons to be pretty self.column_open_url_button.place( rely=1, relwidth=1, x=+2 * style.offset, y=-2 * (style.buttonsize + 2 * style.offset), width=-4 * style.offset, height=style.buttonsize) self.column_backbutton.place(rely=1, relx=1, x=-(style.buttonsize + style.offset), y=-(style.buttonsize + 2 * style.offset)) self.text_boxes_frame = themedFrame.ThemedFrame( self.body, background=style.secondary_color) self.text_boxes_frame.place(relwidth=1, relheight=1 - style.details_page_image_fraction, rely=style.details_page_image_fraction, x=2 * style.offset, width=-4 * style.offset, y=+2 * style.offset, height=-4 * style.offset) description_label = themedLabel.ThemedLabel( self.text_boxes_frame, "Description:", anchor="w", font=style.smallboldtext, foreground=style.primary_text_color, background=style.secondary_color) description_label.place(relwidth=1, height=20) self.description = scrollingWidgets.ScrolledThemedText( self.text_boxes_frame, font=style.smalltext, foreground=style.detail_page_label_color) self.description.place(y=20, relwidth=1, height=20) details_label = themedLabel.ThemedLabel( self.text_boxes_frame, "Details:", anchor="w", font=style.smallboldtext, foreground=style.primary_text_color, background=style.secondary_color) details_label.place(y=40 + 2 * style.offset, relwidth=1, height=20) self.details = scrollingWidgets.ScrolledThemedText( self.text_boxes_frame, font=style.smalltext, foreground=style.detail_page_label_color) self.details.place(relheight=0.75, y=60 + 2 * style.offset, relwidth=1, height=-(60 + 4 * style.offset)) changes_label = themedLabel.ThemedLabel( self.text_boxes_frame, "Changelog:", anchor="w", font=style.smallboldtext, foreground=style.primary_text_color, background=style.secondary_color) changes_label.place(rely=0.75, relwidth=1, height=20) self.changes = scrollingWidgets.ScrolledThemedText( self.text_boxes_frame, font=style.smalltext, foreground=style.detail_page_label_color) self.changes.place(relheight=0.25, rely=0.75, relwidth=1, y=+20, height=-20) self.column_save_button = button.Button( self.column_body, callback=self.save_json, text_string="SAVE", font=style.mediumboldtext, background=style.secondary_color) self.column_save_button.place( rely=1, relwidth=1, x=+2 * style.offset, y=-(style.buttonsize + 2 * style.offset), width=-(4 * style.offset + style.buttonsize), height=style.buttonsize) self.editor_button = button.Button(self.column_body, callback=self.spawn_editor, text_string="ASSET EDITOR", font=style.mediumboldtext, background=style.secondary_color) self.editor_button.place(rely=1, relwidth=1, x=+2 * style.offset, y=-3 * (style.buttonsize + 2 * style.offset), width=-(4 * style.offset), height=style.buttonsize)
def __init__(self, parent): themedFrame.ThemedFrame.__init__(self, parent) self.app = parent self.appstore_handler = None self.package_parser = None self.selected_version = None self.version_index = None self.package = None self.bind("<Configure>", self.on_configure) self.body = themedFrame.ThemedFrame(self, background=style.secondary_color) self.body.place(relwidth=1, relheight=1, width=-style.sidecolumnwidth) self.image_frame = themedFrame.ThemedFrame( self.body, background=style.secondary_color) self.image_frame.place(relwidth=1, relheight=style.details_page_image_fraction, x=+2 * style.offset, width=-4 * style.offset, y=+2 * style.offset, height=-2 * style.offset) self.banner_image = themedLabel.ThemedLabel( self.image_frame, "", background=style.secondary_color, anchor="center", wraplength=None) self.banner_image.place(relwidth=1, relheight=1) self.details = scrollingWidgets.ScrolledThemedText( self.body, font=style.smalltext, foreground=style.detail_page_label_color) self.details.place(relwidth=1, relheight=1 - style.details_page_image_fraction, rely=style.details_page_image_fraction, x=2 * style.offset, width=-4 * style.offset, y=+2 * style.offset, height=-4 * style.offset) #RIGHT COLUMN self.column = themedFrame.ThemedFrame(self, background=style.primary_color) self.column.place(relx=1, rely=0, width=style.sidecolumnwidth, relheight=1, x=-style.sidecolumnwidth) self.column_body = themedFrame.ThemedFrame( self.column, background=style.primary_color) self.column_body.place(relwidth=1, relheight=1) self.column_title = themedLabel.ThemedLabel( self.column_body, "", anchor="w", font=style.smallboldtext, foreground=style.primary_text_color, background=style.primary_color) self.column_title.place(x=style.offset, width=-style.offset, rely=0, relwidth=1, height=style.detais_page_title_height) self.column_author = themedLabel.ThemedLabel( self.column_body, "", anchor="w", font=style.smalltext, foreground=style.detail_page_label_color, background=style.primary_color) self.column_author.place( x=style.offset, width=-style.offset, y=style.detais_page_title_height + style.details_item_y_multiplier, relwidth=1, height=0.333 * style.details_item_y_multiplier) self.column_version = themedLabel.ThemedLabel( self.column_body, "", anchor="w", font=style.smalltext, foreground=style.detail_page_label_color, background=style.primary_color) self.column_version.place(x=style.offset, width=-style.offset, y=style.detais_page_title_height + 0.333 * style.details_item_y_multiplier, relwidth=1, height=0.333 * style.details_item_y_multiplier) self.column_license = themedLabel.ThemedLabel( self.column_body, "", anchor="w", font=style.smalltext, foreground=style.detail_page_label_color, background=style.primary_color) self.column_license.place(x=style.offset, width=-style.offset, y=style.detais_page_title_height + 0.666 * style.details_item_y_multiplier, relwidth=1, height=0.333 * style.details_item_y_multiplier) self.column_package = themedLabel.ThemedLabel( self.column_body, "", anchor="w", font=style.smalltext, foreground=style.detail_page_label_color, background=style.primary_color) self.column_package.place(x=style.offset, width=-style.offset, y=style.detais_page_title_height + 1.000 * style.details_item_y_multiplier, relwidth=1, height=0.333 * style.details_item_y_multiplier) self.column_downloads = themedLabel.ThemedLabel( self.column_body, "", anchor="w", font=style.smalltext, foreground=style.detail_page_label_color, background=style.primary_color) self.column_downloads.place(x=style.offset, width=-style.offset, y=style.detais_page_title_height + 1.333 * style.details_item_y_multiplier, relwidth=1, height=0.333 * style.details_item_y_multiplier) self.column_updated = themedLabel.ThemedLabel( self.column_body, "", anchor="w", font=style.smalltext, foreground=style.detail_page_label_color, background=style.primary_color) self.column_updated.place(x=style.offset, width=-style.offset, y=style.detais_page_title_height + 1.666 * style.details_item_y_multiplier, relwidth=1, height=0.333 * style.details_item_y_multiplier) # self.column_separator_top = ThemedLabel(self.column_body, "", background=style.lg) # self.column_separator_top.place(rely=1,relwidth = 1, x = + style.offset, y = - 3 * (style.buttonsize + style.offset) - 3 * style.offset - style.buttonsize - 1 - 0.5 * style.buttonsize, width = - 2 * style.offset, height = 1) # self.column_separator_bot = ThemedLabel(self.column_body, "", background=style.lg) # self.column_separator_bot.place(rely=1,relwidth = 1, x = + style.offset, y = - 3 * (style.buttonsize + style.offset) - style.offset - 1, width = - 2 * style.offset, height = 1) self.column_open_url_button = button.Button( self.column_body, callback=self.trigger_open_tab, text_string="VISIT PAGE", font=style.mediumboldtext, background=style.secondary_color, ).place(rely=1, relwidth=1, x=+2 * style.offset, y=-3 * (style.buttonsize + style.offset), width=-4 * style.offset, height=style.buttonsize) self.column_install_button = button.Button( self.column_body, callback=self.trigger_install, text_string="INSTALL", font=style.mediumboldtext, background=style.secondary_color) self.column_install_button.place(rely=1, relwidth=1, x=+2 * style.offset, y=-2 * (style.buttonsize + style.offset), width=-4 * style.offset, height=style.buttonsize) self.column_uninstall_button = button.Button( self.column_body, callback=self.trigger_uninstall, text_string="UNINSTALL", font=style.mediumboldtext, background=style.secondary_color) self.back_image = ImageTk.PhotoImage( Image.open("gui/assets/return.png").resize( (style.buttonsize, style.buttonsize), Image.ANTIALIAS)) self.column_backbutton = button.Button(self.column_body, image_object=self.back_image, callback=self.leave, background=style.primary_color) self.column_backbutton.place(rely=1, relx=1, x=-(style.buttonsize + style.offset), y=-(style.buttonsize + style.offset)) self.progress_bar = progressFrame.ProgressFrame(self) self.yesnoPage = YesNoPage(self)
def build_listframe(self): self.header = tk.Frame(self, background=style.primary_color) self.header = themedFrame.ThemedFrame(self) self.header.place(relx=0, rely=0, relwidth=1, height=style.searchboxheight) self.content_frame_header_search_bar = searchBox.SearchBox( self.header, command=self.search, entry_background=style.secondary_color, borderwidth=0, entry_foreground=style.primary_text_color) self.selected_sort_method = tk.StringVar() self.selected_sort_method.set(SORT_OPTIONS[0]) self.content_frame_header_sort_method_dropdown = tk.OptionMenu( self.header, self.selected_sort_method, *SORT_OPTIONS) self.content_frame_header_sort_method_dropdown.configure( foreground=style.primary_text_color) self.content_frame_header_sort_method_dropdown.configure( background=style.secondary_color) self.content_frame_header_sort_method_dropdown.configure( highlightthickness=0) self.content_frame_header_sort_method_dropdown.configure(borderwidth=0) self.content_frame_header_sort_method_dropdown.place( relx=1, x=-(style.offset + style.sortdropdownwidth), width=style.sortdropdownwidth, y=+1.5 * style.offset, relheight=1, height=-2 * style.offset) self.content_frame_header_sort_method_dropdown.unbind("<F10>") self.content_frame_header_search_bar.place( x=0, y=+1.5 * style.offset, relheight=1, relwidth=1, width=-(2 * style.offset + style.sortdropdownwidth), height=-2 * style.offset) self.body_frame = tk.Frame(self, background=style.primary_color) self.body_frame.place(y=style.searchboxheight, height=-style.searchboxheight, relwidth=1, relheight=1) self.scrollbar = tk.Scrollbar(self.body_frame, troughcolor=style.primary_color, bg=style.secondary_color) self.scrollbar.place(relheight=1, width=style.scrollbarwidth, relx=1, x=-style.scrollbarwidth, height=-(style.listbox_footer_height), y=+style.listbox_header_height) self.listbox_frame = tk.Frame(self.body_frame, background=style.secondary_color) self.listbox_frame.place(relwidth=1, relheight=1, width=-style.scrollbarwidth) self.scaling_listboxes_frame = tk.Frame( self.listbox_frame, background=style.secondary_color) self.scaling_listboxes_frame.place(relwidth=1, relheight=1) self.scaling_listboxes_frame_header = tk.Frame( self.scaling_listboxes_frame, background=style.secondary_color) self.scaling_listboxes_frame_header.place( relwidth=1, height=style.listbox_header_height) self.scaling_listboxes_frame_body = tk.Frame( self.scaling_listboxes_frame, background=style.secondary_color) self.scaling_listboxes_frame_body.place( relwidth=1, relheight=1, y=style.listbox_header_height, height=-style.listbox_header_height) self.package_listbox = themedListbox.ThemedListbox( self.scaling_listboxes_frame_body, background=style.secondary_color, font=style.smallboldtext, borderwidth=1, foreground=style.primary_text_color) self.package_listbox.place(relx=0, relwidth=0.33333, relheight=1) self.package_listbox_label = themedLabel.ThemedLabel( self.scaling_listboxes_frame_header, text="Package", background=style.primary_color, font=style.mediumboldtext) self.package_listbox_label.place(relx=0, relwidth=0.33333, relheight=1) self.title_listbox = themedListbox.ThemedListbox( self.scaling_listboxes_frame_body, background=style.secondary_color, font=style.smalltext, borderwidth=1) self.title_listbox.place(relx=0.33333, relwidth=0.33333, relheight=1) self.title_listbox_label = themedLabel.ThemedLabel( self.scaling_listboxes_frame_header, text="Title", background=style.primary_color, font=style.mediumboldtext) self.title_listbox_label.place(relx=0.33333, relwidth=0.33333, relheight=1) self.author_listbox = themedListbox.ThemedListbox( self.scaling_listboxes_frame_body, background=style.secondary_color, font=style.smalltext, borderwidth=1) self.author_listbox.place(relx=0.66666, relwidth=0.33333, relheight=1) self.author_listbox_label = themedLabel.ThemedLabel( self.scaling_listboxes_frame_header, text="Author", background=style.primary_color, font=style.mediumboldtext) self.author_listbox_label.place(relx=0.66666, relwidth=0.33333, relheight=1) self.listbox_list = [ self.package_listbox, self.title_listbox, self.author_listbox, ] self.package_listbox.configure({"selectbackground": style.lg}) self.package_listbox.configure({"selectmode": "single"}) self.package_listbox.bind("<<ListboxSelect>>", self.on_listbox_selection) self.scrollbar.config(command=self.on_scroll_bar) self.package_listbox.config(yscrollcommand=self.scrollbar.set) bindlist = [ self, self.package_listbox, self.title_listbox, self.author_listbox, ] if platform.system() == 'Windows' or platform.system() == "Darwin": for b in bindlist: b.bind("<MouseWheel>", self.on_mouse_wheel) elif platform.system() == "Linux": for b in bindlist: b.bind("<Button-4>", self.on_mouse_wheel) b.bind("<Button-5>", self.on_mouse_wheel) self.set_sort_type(None) self.rebuild() self.sort_check_loop()