vanilla icon indicating copy to clipboard operation
vanilla copied to clipboard

Last pane in SplitView collapses forever.

Open RafalBuchner opened this issue 6 years ago • 1 comments

If you collapse the last pane, you are not able to retrieve it.

class DesignSpaceWindow(BaseWindowController):
    def __init__(self):
        self.winMinSize = (200,400)
        winMaxSize = (400,1200) 
        self.w = Window(self.winMinSize,"Master Tools",minSize=self.winMinSize,maxSize=winMaxSize)
        
        # build groups
        self.initFontsGroup()
        self.initInfoGroup()
        self.initToolsGroup()

        # build splitView
        descriptions = [
            dict(label="fonts",
                view=self.fontPane,
                identifier="fontPane",
                size=self.fontPaneHeight,
                minSize=100,
                canCollapse=False),
            dict(label="tools",
                view=self.toolsPane,
                identifier="toolsPane",
                size=self.toolsPaneHeight,
                minSize=100,
                canCollapse=True),
            dict(label="design space info",
                view=self.infoPane,
                identifier="infoPane",
                size=self.infoPaneHeight,
                minSize=100,
                canCollapse=True),
        ]
        self.w.SplitView = SplitView((0, 0, -0, -40), descriptions,isVertical=False,
        dividerStyle="thick")
            #autosaveName = "com.rafalbuchner.masterTools.panes")
        self.setUpBaseWindowBehavior()
        self.w.open()
        
    # initilazing groups
    def initFontsGroup(self):
        self.fontPane = Group((0, 0, -0, -0))
        self.fontPane.caption = TextBox((5, 5, 150,20), "fonts")
        self.fontPaneHeight = self.winMinSize[1]/3
    def initInfoGroup(self):
        self.toolsPane = Group((0, 0, -0, -0))
        self.toolsPane.caption = TextBox((5, 5, 150,20), "tools")
        self.toolsPaneHeight = self.winMinSize[1]/3
    def initToolsGroup(self):
        self.infoPane = Group((0, 0, -0, -0))
        self.infoPane.caption = TextBox((5, 5, 150,20), "design space info")
        self.infoPaneHeight = self.winMinSize[1]/3
        
def test():
    DesignSpaceWindow()

RafalBuchner avatar Apr 10 '19 19:04 RafalBuchner

simplified the example:

import vanilla

w = vanilla.Window((400, 400))


descriptions = [
    dict(view=vanilla.TextEditor((0, 0, 0, 0)), identifier="1"),
    dict(view=vanilla.TextEditor((0, 0, 0, 0)), identifier="2"),
    dict(view=vanilla.TextEditor((0, 0, 0, 0)), identifier="3"),            
]
w.s = vanilla.SplitView((0, 0, -0, -0), descriptions, isVertical=True, dividerStyle="thick")

w.open()

I would opt for a extra argument in a SplitView: canHideDividers with as default True to mimic the current behaviour.

This is possible as the simple split view in DrawBot works like this: see https://github.com/typemytype/drawbot/blob/master/drawBot/ui/splitView.py

typemytype avatar Apr 11 '19 10:04 typemytype

This is a limitation of NSSplitView as far as I can tell.

typesupply avatar Dec 20 '23 16:12 typesupply