Skip to content

Commit

Permalink
Try to handle stacked widget layout differently. Ref #2605
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed Mar 13, 2019
1 parent dbbcdf0 commit 7f234aa
Show file tree
Hide file tree
Showing 5 changed files with 422 additions and 406 deletions.
11 changes: 9 additions & 2 deletions gns3/dialogs/preferences_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,17 @@ def _showPreferencesPageSlot(self, current, previous):
self.uiTitleLabel.setText("{} preferences".format(name))
index = self.uiStackedWidget.indexOf(preferences_page)
widget = self.uiStackedWidget.widget(index)
self.uiStackedWidget.setMinimumSize(widget.size())
self.uiStackedWidget.resize(widget.size())
#self.uiStackedWidget.setMinimumSize(widget.size()) # FIXME: this seems to not work on Windows and OSX
#self.uiStackedWidget.resize(widget.size())
self.uiStackedWidget.setCurrentIndex(index)

for index in range(0, self.uiStackedWidget.count()):
page = self.uiStackedWidget.widget(index)
if self.uiStackedWidget.currentIndex() == index:
page.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
else:
page.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)

def _applyPreferences(self):
"""
Saves all the preferences.
Expand Down
Loading

0 comments on commit 7f234aa

Please sign in to comment.