Changeset 9c391946 in sasview


Ignore:
Timestamp:
Apr 7, 2017 10:12:53 AM (6 months ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_SasView245
Children:
71361f0
Parents:
d7ff531
Message:

Reisze the perspective if it is too big to fit the workspace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/GuiManager.py

    r6fd4e36 r9c391946  
    184184        # Default perspective 
    185185        self._current_perspective = Perspectives.PERSPECTIVES[str(perspective_name)](parent=self) 
     186 
    186187        self._workspace.workspace.addWindow(self._current_perspective) 
     188        # Resize to the workspace height 
     189        workspace_height = self._workspace.workspace.sizeHint().height() 
     190        perspective_size = self._current_perspective.sizeHint() 
     191        if workspace_height < perspective_size.height: 
     192            perspective_width = perspective_size.width() 
     193            self._current_perspective.resize(perspective_width, workspace_height-10) 
    187194        self._current_perspective.show() 
    188195 
Note: See TracChangeset for help on using the changeset viewer.