Browse Source

Change the calculation of the ButtonsChoiceDialog frame's size

doc-issue-template
MrS0m30n3 8 years ago
parent
commit
1d885e1b45
1 changed files with 2 additions and 12 deletions
  1. 14
      youtube_dl_gui/mainframe.py

14
youtube_dl_gui/mainframe.py

@ -1328,22 +1328,12 @@ class ButtonsChoiceDialog(wx.Dialog):
panel.SetSizer(vertical_sizer)
# Calculate & set frame's size
calc_width = ButtonsChoiceDialog._calc_dialog_width(len(choices), max_width)
min_width = msg_text.GetSize()[0] + 100
if calc_width < min_width:
calc_width = min_width
self.SetSize((calc_width, 130))
width, height = panel.GetBestSize()
self.SetSize((width, height * 1.25))
def _on_close(self, event):
self.EndModal(event.GetEventObject().GetId())
@staticmethod
def _calc_dialog_width(buttons_count, max_button_width):
return (buttons_count + 1) * max_button_width
class ButtonsGroup(object):

Loading…
Cancel
Save