Skip to content

Commit

Permalink
change default size of window based on center widget
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Aug 9, 2024
1 parent 6e21bc4 commit c02f90d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,15 @@ def __init__(self, parent, center_widget):

def showEvent(self, event):
layout = self.layout()
cw_size = self._center_widget.size()
layout.insertWidget(0, self._center_widget)
super().showEvent(event)
if self._first_show:
self._first_show = False
self.resize(700, 400)
self.resize(
max(cw_size.width(), 700),
max(cw_size.height(), 400)
)
super().showEvent(event)

def closeEvent(self, event):
super().closeEvent(event)
Expand Down

0 comments on commit c02f90d

Please sign in to comment.