Changeset 9f9bb88 in sasview


Ignore:
Timestamp:
May 4, 2012 8:52:32 AM (12 years ago)
Author:
Robert Whitley <robert.whitley@…>
Branches:
master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
805bfe9
Parents:
bf0acea
Message:

Refs #54. Make window 90% of the screen as default.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/gui_manager.py

    r56acb5d r9f9bb88  
    174174DEFAULT_STYLE = config.DEFAULT_STYLE 
    175175 
    176  
    177 PLOPANEL_HEIGTH = config.PLOPANEL_HEIGTH 
    178 DATAPANEL_HEIGHT = config.DATAPANEL_HEIGHT 
    179176PLUGIN_STATE_EXTENSIONS =  config.PLUGIN_STATE_EXTENSIONS 
    180177OPEN_SAVE_MENU = config.OPEN_SAVE_PROJECT_MENU 
     
    878875        get the proper panel width and height 
    879876        """ 
    880         panel_height_min = self._window_height 
    881         panel_width_min = self._window_width  
     877        ## Check and set the size 
     878        if DATAPANEL_WIDTH < 0: 
     879            panel_width = int(self._window_width * 0.22) 
     880        else: 
     881            panel_width = DATAPANEL_WIDTH 
     882        panel_height = int(self._window_height * 0.9) 
    882883        style = self.__gui_style & (GUIFRAME.MANAGER_ON) 
    883884        if self._data_panel is not None  and (p == self._data_panel): 
    884             panel_width_min = DATAPANEL_WIDTH 
    885             panel_height_min = self._window_height * 0.8 
    886             return panel_width_min, panel_height_min 
     885            return panel_width, panel_height 
    887886        if hasattr(p, "CENTER_PANE") and p.CENTER_PANE: 
    888887            style = self.__gui_style & (GUIFRAME.PLOTTING_ON|GUIFRAME.MANAGER_ON) 
    889888            if style == (GUIFRAME.PLOTTING_ON|GUIFRAME.MANAGER_ON): 
    890                 panel_width_min = self._window_width -\ 
    891                             (DATAPANEL_WIDTH +config.PLOPANEL_WIDTH) 
    892             return panel_width_min, panel_height_min 
    893         return panel_width_min, panel_height_min 
     889                panel_width = self._window_width - panel_width 
     890            return panel_width, panel_height 
     891        return panel_width, panel_height 
    894892     
    895893    def _load_panels(self): 
     
    947945            p = panel_class 
    948946            id = wx.NewId() 
    949             #w, h = self._get_panels_size(p) 
    950947            # Check whether we need to put this panel 
    951948            # in the center pane 
     
    10861083        style1 = self.__gui_style & GUIFRAME.FIXED_PANEL 
    10871084        style2 = self.__gui_style & GUIFRAME.FLOATING_PANEL 
     1085         
     1086        ## Check and set the size 
     1087        if PLOPANEL_WIDTH < 0: 
     1088            p_panel_width = int(self._window_width * 0.36) 
     1089        else: 
     1090            p_panel_width = PLOPANEL_WIDTH 
     1091        p_panel_height = int(p_panel_width * 0.75) 
     1092         
    10881093        if style1 == GUIFRAME.FIXED_PANEL: 
    10891094            self._mgr.AddPane(p, wx.aui.AuiPaneInfo(). 
     
    10981103                              # Use a large best size to make sure the AUI  
    10991104                              # manager takes all the available space 
    1100                               BestSize(wx.Size(PLOPANEL_WIDTH,  
    1101                                                PLOPANEL_HEIGTH))) 
    1102          
     1105                              BestSize(wx.Size(p_panel_width,  
     1106                                               p_panel_height))) 
    11031107            self._popup_fixed_panel(p) 
    11041108     
     
    11101114                              # Use a large best size to make sure the AUI 
    11111115                              #  manager takes all the available space 
    1112                               BestSize(wx.Size(PLOPANEL_WIDTH,  
    1113                                                PLOPANEL_HEIGTH))) 
     1116                              BestSize(wx.Size(p_panel_width,  
     1117                                               p_panel_height))) 
    11141118             
    11151119            self._popup_floating_panel(p) 
    1116          
    11171120        # Register for closing of panels 
    11181121        self.Bind(wx.aui.EVT_AUI_PANE_CLOSE, self.on_panel_close) 
     
    28482851        style = self.__gui_style & GUIFRAME.FIXED_PANEL 
    28492852        if style == GUIFRAME.FIXED_PANEL: 
    2850             self._mgr.GetPane(p.window_name).Dock() 
    2851             self._mgr.GetPane(p.window_name).Floatable() 
    2852             self._mgr.GetPane(p.window_name).Right() 
    2853             self._mgr.GetPane(p.window_name).TopDockable(False) 
    2854             self._mgr.GetPane(p.window_name).BottomDockable(False) 
    2855             self._mgr.GetPane(p.window_name).LeftDockable(False) 
    2856             self._mgr.GetPane(p.window_name).RightDockable(True) 
     2853            pane = self._mgr.GetPane(p.window_name) 
     2854            pane.Dock() 
     2855            pane.Floatable() 
     2856            pane.Right() 
     2857            pane.TopDockable(False) 
     2858            pane.BottomDockable(False) 
     2859            pane.LeftDockable(False) 
     2860            pane.RightDockable(True) 
    28572861            self._mgr.Update() 
    28582862             
     
    28622866        style = self.__gui_style &  GUIFRAME.FLOATING_PANEL 
    28632867        if style == GUIFRAME.FLOATING_PANEL:  
    2864             self._mgr.GetPane(p.window_name).Floatable(True) 
    2865             self._mgr.GetPane(p.window_name).Float() 
    2866             self._mgr.GetPane(p.window_name).Dockable(False) 
     2868            pane = self._mgr.GetPane(p.window_name) 
     2869            pane.Floatable(True) 
     2870            pane.Float() 
     2871            pane.Dockable(False) 
    28672872            self._mgr.Update() 
    28682873             
     
    34783483        customWidth, customHeight = size 
    34793484         
    3480         # If the custom screen is bigger than the  
    3481         # window screen than make maximum size 
    3482         if customWidth > displayWidth: 
    3483             customWidth = displayWidth 
    3484         if customHeight > displayHeight: 
    3485             customHeight = displayHeight 
     3485        # If the custom size is default, set 90% of the screen size 
     3486        if customWidth < 0 and customHeight < 0: 
     3487            customWidth = displayWidth * 0.9 
     3488            customHeight = displayHeight * 0.9 
     3489        else: 
     3490            # If the custom screen is bigger than the  
     3491            # window screen than make maximum size 
     3492            if customWidth > displayWidth: 
     3493                customWidth = displayWidth 
     3494            if customHeight > displayHeight: 
     3495                customHeight = displayHeight 
    34863496             
    34873497        # Note that when running Linux and using an Xming (X11) server on a PC 
     
    34943504        # If dual screen registered as 1 screen. Make width half. 
    34953505        if displayWidth > (displayHeight*2): 
    3496             customWidth = displayWidth/2 
     3506            if (customWidth == displayWidth): 
     3507                customWidth = displayWidth/2 
     3508            # and set the position to be the corner of the screen. 
    34973509            posX = 0 
    34983510            posY = 0 
     
    35043516         
    35053517        # Return the suggested position and size for the application frame.     
    3506         return (posX, posY), (min(displayWidth, customWidth), min(displayHeight, customHeight)) 
     3518        return (posX, posY), (customWidth, customHeight) 
    35073519 
    35083520     
  • sansview/custom_config.py

    r7343319 r9f9bb88  
    22    Application appearance custom configuration 
    33""" 
    4 DATAPANEL_WIDTH = 260 
     4DATAPANEL_WIDTH = -1 
    55CLEANUP_PLOT = False 
    66FIXED_PANEL = True 
    7 PLOPANEL_WIDTH = 420 
     7PLOPANEL_WIDTH = -1 
    88DATALOADER_SHOW = True 
    9 GUIFRAME_HEIGHT = 840 
    10 GUIFRAME_WIDTH = 1180 
     9GUIFRAME_HEIGHT = -1  
     10GUIFRAME_WIDTH = -1 
    1111DEFAULT_OPEN_FOLDER = None 
    1212WELCOME_PANEL_SHOW = False 
Note: See TracChangeset for help on using the changeset viewer.