Changeset 9c391946 in sasview


Ignore:
Timestamp:
Apr 7, 2017 10:12:53 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
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.