Exemple #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)
Exemple #2
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)
Exemple #3
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)