Skip to content

Commit

Permalink
installer smarter window sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
Die4Ever committed Apr 15, 2024
1 parent f999e40 commit 739f9e0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions installer/GUI/InstallerWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setgrid(self, control, advanced:bool, **gridargs):


def ShowAdvanced(self):
self.root.geometry(str(self.width-1)+"x"+str(self.height-1))
self.root.geometry(str(self.width)+"x499")
self.installButton.grid_forget()
for (control, val) in self.controls.items():
control.grid(**val['gridargs'])
Expand All @@ -39,8 +39,6 @@ def initWindow(self):
self.advanced = False
self.width = 350
self.height = 500
if IsVanillaFixer():
self.height = 350

self.controls = {}

Expand Down Expand Up @@ -108,10 +106,13 @@ def initWindow(self):
Hovertip(self.installButton, 'Dew it!')

# advanced button
self.installButton = Button(self.frame,text='Show Advanced Options',width=20,height=1,font=self.font, command=self.ShowAdvanced)
self.installButton.grid(column=1,row=102, sticky='SW', padx=pad, pady=pad)
Hovertip(self.installButton, 'For the brave and technical')
self.advancedButton = Button(self.frame,text='Show Advanced Options',width=20,height=1,font=self.font, command=self.ShowAdvanced)
self.advancedButton.grid(column=1,row=102, sticky='SW', padx=pad, pady=pad)
Hovertip(self.advancedButton, 'For the brave and technical')

self.root.update()
end_y = self.advancedButton.winfo_y() + self.advancedButton.winfo_height()
self.height = min(self.height, end_y + pad*2)
self.root.geometry(str(self.width)+"x"+str(self.height))
self.scroll.ReConf()

Expand Down

0 comments on commit 739f9e0

Please sign in to comment.