Example #1
0
    def _refresh_layout(self, layout):
        """ Create the layout for all the plugins


        """
        if not self.dock_items:
            return AreaLayout()
        items = layout.pop('main')
        if not items:
            raise EnvironmentError("At least one main layout item must be "
                                   "defined!")

        left_items = layout.pop('main-left', [])
        bottom_items = layout.pop('main-bottom', [])

        main = TabLayout(*items)

        if bottom_items:
            main = VSplitLayout(main, *bottom_items)
        if left_items:
            main = HSplitLayout(*left_items, main)

        dockbars = [
            DockBarLayout(*items, position=side)
            for side, items in layout.items() if items
        ]

        #: Update layout
        self.dock_layout = AreaLayout(main, dock_bars=dockbars)
 def _full_layout_default(self):
     return HSplitLayout(
         'attributes',
         VSplitLayout(
             'model',
             'data',
         ),
         sizes=[150, 650],  # Default widths
     )
Example #3
0
def test_validation_dock_layout1(enaml_qtbot, enaml_sleep):
    """Test that the validation of a layout.

    We check in particular that the proper warnings are raised and that doing
    so does not corrupt the globals.

    """
    win = compile_source(DOCK_AREA_TEMPLATE, 'Main')()
    win.show()
    wait_for_window_displayed(enaml_qtbot, win)
    enaml_qtbot.wait(enaml_sleep)
    win.area.layout = HSplitLayout('item1', 'item2')
    enaml_qtbot.wait(enaml_sleep)
Example #4
0
 def _base_layout_default(self):
     return HSplitLayout(
         VSplitLayout(
             'result_variables',
             'input_variables',
             sizes = [300, 300],
         ),
         VSplitLayout(
             'result_table',
             'input_table',
             sizes = [300, 300],
         ),
         sizes = [200, 1024 - 200], # Default widths
     )
Example #5
0
    def _refresh_layout(self, layout):
        """ Create the layout for all the plugins


        """
        items = layout.pop('main')
        main = HSplitLayout(*items) if len(items) > 1 else items[0]

        dockbars = [
            DockBarLayout(*items, position=side)
            for side, items in layout.items() if items
        ]

        #: Update layout
        self.dock_layout = AreaLayout(main, dock_bars=dockbars)
Example #6
0
    def _refresh_layout(self, layout):
        """ Create the layout for all the plugins


        """
        if not self.dock_items:
            return AreaLayout()
        items = layout.pop('main')
        if not items:
            raise EnvironmentError("At least one main layout item must be "
                                   "defined!")
        main = (HSplitLayout(TabLayout(
            *items[1:]), items[0]) if len(items) > 1 else items[0])

        dockbars = [
            DockBarLayout(*items, position=side)
            for side, items in layout.items() if items
        ]

        #: Update layout
        self.dock_layout = AreaLayout(main, dock_bars=dockbars)