diff --git a/.gitignore b/.gitignore index 4fcf078..7a34431 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ __pycache__/* .idea venv/* +build/* +dist/* +notes.txt +main.spec diff --git a/main.py b/main.py index 6d2acb1..eac41b1 100644 --- a/main.py +++ b/main.py @@ -27,27 +27,51 @@ class MangaReader: self.menu.add_cascade(label="File", menu=item) root.config(menu=self.menu) + # Frames self.buttonFrame = Frame(master) + self.mangaFrame = Frame(master, bg="green") + self.titleFrame = Frame(master) # forward/back buttons self.nextPg = Button(self.buttonFrame, text='>') self.nextPg.bind('', self.nextPage) self.nextPg.grid(row=0, column=2) - self.buttonFrame.pack(side=BOTTOM) + self.buttonFrame.grid_rowconfigure(0, weight=1) + self.buttonFrame.grid_columnconfigure(2,weight=1) + self.buttonFrame.grid(row=2, column=0, columnspan=2) + self.master.grid_rowconfigure(2, weight=1) + self.master.grid_columnconfigure(0,weight=1) + # self.buttonFrame.pack(side=BOTTOM) self.backPg = Button(self.buttonFrame, text='<') self.backPg.bind('', self.backPage) self.backPg.grid(row=0, column=0) + self.buttonFrame.grid_rowconfigure(0, weight=1) + self.buttonFrame.grid_columnconfigure(0,weight=1) # page counter self.pgcount = Label(self.buttonFrame, text= str(self.page) + " of " + str(self.total)) self.pgcount.grid(row=1, columns=1, columnspan=2) + self.buttonFrame.grid_rowconfigure(1, weight=1) + self.buttonFrame.grid_columnconfigure(1,weight=1) - self.mangaTitle = Label(self.buttonFrame, text=self.file) - self.mangaTitle.grid(row=0, column=1) + # title frame + + self.titleFrame.grid(row=0, column=0, sticky="EW") + self.master.grid_rowconfigure(0, weight=1) + self.master.grid_columnconfigure(0,weight=1) + self.mangaTitle = Label(self.titleFrame, text=self.file) + self.mangaTitle.grid(row=0, sticky="EW") + self.titleFrame.grid_rowconfigure(0,weight=1) + self.titleFrame.grid_columnconfigure(0,weight=1) # display image - self.panel = Label(self.master, image=self.img) - self.panel.pack() + self.mangaFrame.grid(row=1, column=0, sticky="NESW") + self.master.grid_rowconfigure(1, weight=1) + self.master.grid_columnconfigure(0,weight=1) + self.panel = Label(self.mangaFrame, image=self.img) + self.panel.grid(row=0, column=0, sticky="NESW") + self.panel.grid_rowconfigure(0, weight=1) + self.panel.grid_columnconfigure(0, weight=1) def open_menu(self): # file dialog. reset page counts, call display Manga passing in starting values @@ -61,6 +85,7 @@ class MangaReader: def displayManga(self, file, pg): basewidth = 500 + basewidth = self.mangaFrame.winfo_width() with zf(file, 'r') as zip: # grab all the manga pages from the cbz file and sort them to put them in the correct order fl = zip.namelist()