Skip to content

Commit

Permalink
Code cleanup and UI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sjclayton committed Sep 25, 2017
1 parent c828f67 commit 1f30356
Showing 1 changed file with 37 additions and 34 deletions.
71 changes: 37 additions & 34 deletions BodyCalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
mainWindow = Tk()

mainWindow.title('BodyCalc')
mainWindow.configure(background='#222')
mainWindow.minsize(460, 270)
mainWindow.maxsize(460, 270)
mainWindow.configure(background='#333')
mainWindow.resizable(False, False)
mainWindow.minsize(418, 270)

if getattr(sys, 'frozen', False):
application_path = sys._MEIPASS
Expand Down Expand Up @@ -222,59 +222,62 @@ def cleartxt(event):
heightIn.focus()


frameMain = Frame(mainWindow)
frameMain.configure(bg='#444')
frameOutput = Frame(mainWindow)
frameOutput.configure(bg='#444')
frameInput = Frame(mainWindow)
frameInput.configure(bg='#444')

Label(frameInput, text='Height (M)', bg='#444', fg='#fff').grid(row=0, column=0, pady=10)
Label(frameInput, text='Weight (KG)', bg='#444', fg='#fff').grid(row=1, column=0, pady=10)
Label(frameInput, text='Bust / Cup', bg='#444', fg='#fff').grid(row=2, column=0, pady=10)
Label(frameInput, text='Waist', bg='#444', fg='#fff').grid(row=3, column=0, pady=10)
Label(frameInput, text='Hip', bg='#444', fg='#fff').grid(row=4, column=0, pady=10)

heightLbl = Label(frameMain, text='Height (M)', bg='#444', fg='#fff').grid(row=0, column=0, pady=10)
heightIn = Entry(frameMain, width=4)
heightIn = Entry(frameInput, width=4)
heightIn.grid(row=0, column=1, pady=10)
weightLbl = Label(frameMain, text='Weight (KG)', bg='#444', fg='#fff').grid(row=1, column=0, pady=10)
weightIn = Entry(frameMain, width=4)
weightIn = Entry(frameInput, width=4)
weightIn.grid(row=1, column=1, pady=10)
bustLbl = Label(frameMain, text='Bust / Cup', bg='#444', fg='#fff').grid(row=2, column=0, pady=10)
bustIn = Entry(frameMain, width=4)
bustIn = Entry(frameInput, width=4)
bustIn.grid(row=2, column=1, pady=10)
cupIn = Entry(frameMain, width=4)
cupIn = Entry(frameInput, width=4)
cupIn.grid(row=2, column=2, padx=5, pady=10)
waistLbl = Label(frameMain, text='Waist', bg='#444', fg='#fff').grid(row=3, column=0, pady=10)
waistIn = Entry(frameMain, width=4)
waistIn = Entry(frameInput, width=4)
waistIn.grid(row=3, column=1, pady=10)
hipLbl = Label(frameMain, text='Hip', bg='#444', fg='#fff').grid(row=4, column=0, pady=10)
hipIn = Entry(frameMain, width=4)
hipIn = Entry(frameInput, width=4)
hipIn.grid(row=4, column=1, pady=10)

bmiLbl = Label(frameOutput, text='BMI', bg='#444', fg='#fff', pady=5)
bmiLbl.grid(row=0, column=0, pady=10)

frameOutput = Frame(mainWindow)
frameOutput.configure(bg='#444')

Label(frameOutput, text='BMI', bg='#444', fg='#fff', pady=5).grid(row=0, column=0, pady=10)
Label(frameOutput, text='Breasts', bg='#444', fg='#fff', pady=5).grid(row=1, column=0, pady=5)
Label(frameOutput, text='Butt', bg='#444', fg='#fff', pady=5).grid(row=2, column=0, pady=5)
Label(frameOutput, text='Body Shape', bg='#444', fg='#fff', pady=5).grid(row=3, column=0, pady=5)
Label(frameOutput, text='Body Type', bg='#444', fg='#fff', pady=5).grid(row=4, column=0, pady=5)

bmiTxt = Text(frameOutput, state='disabled', width=10, height=1, bg='#444', fg='#fff', pady=5)
bmiTxt.grid(row=0, column=1, pady=5, sticky=W)
breastLbl = Label(frameOutput, text='Breasts', bg='#444', fg='#fff', pady=5)
breastLbl.grid(row=1, column=0, pady=5)
breastTxt = Text(frameOutput, state='disabled', width=10, height=1, bg='#444', fg='#fff', pady=5)
breastTxt.grid(row=1, column=1, pady=5, sticky=W)
buttLbl = Label(frameOutput, text='Butt', bg='#444', fg='#fff', pady=5)
buttLbl.grid(row=2, column=0, pady=5)
buttTxt = Text(frameOutput, state='disabled', width=10, height=1, bg='#444', fg='#fff', pady=5)
buttTxt.grid(row=2, column=1, pady=5, sticky=W)
shapeLbl = Label(frameOutput, text='Body Shape', bg='#444', fg='#fff', pady=5)
shapeLbl.grid(row=3, column=0, pady=5)
shapeTxt = Text(frameOutput, state='disabled', width=10, height=1, bg='#444', fg='#fff', pady=5)
shapeTxt.grid(row=3, column=1, pady=5, sticky=W)
typeLbl = Label(frameOutput, text='Body Type', bg='#444', fg='#fff', pady=5)
typeLbl.grid(row=4, column=0, pady=5)
typeTxt = Text(frameOutput, state='disabled', width=20, height=1, bg='#444', fg='#fff', pady=5)
typeTxt.grid(row=4, column=1, pady=5, sticky=W)

calcBtn = Button(mainWindow, text='Calculate', width=10)
frameButtons = Frame(mainWindow)
frameButtons.configure(bg='#333')

calcBtn = Button(frameButtons, text='Calculate', width=9)
calcBtn.bind('<Button-1>', calculate)
calcBtn.place(x=26, y=230)
clearBtn = Button(mainWindow, text='Clear', width=10)
calcBtn.grid(row=0, column=0, padx=3)
clearBtn = Button(frameButtons, text='Clear', width=7)
clearBtn.bind('<Button-1>', cleartxt)
clearBtn.place(x=110, y=230)
clearBtn.grid(row=0, column=1, padx=2)

frameMain.pack(side=LEFT, anchor=N, ipadx=5, padx=25, pady=10, fill=X)
frameOutput.pack(side=LEFT, anchor=N, ipadx=5, pady=10, fill=X)
frameInput.grid(row=0, column=0, padx=10, pady=10)
frameOutput.grid(row=0, column=1, ipadx=10, pady=10)
frameButtons.grid(row=1, column=0, pady=5)

mainWindow.bind('<Return>', calculate)
mainWindow.bind('<\>', cleartxt)
Expand Down

0 comments on commit 1f30356

Please sign in to comment.