New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPSplitView doesn't honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window #41
Comments
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window The docs on Apple’s page say the following: This method is invoked before the NSSplitView begins tracking the cursor to position a divider. You may further constrain the limits that have been already set, but you cannot extend the divider limits. proposedMin is specified in the NSSplitView’s flipped coordinate system. If the split bars are horizontal (views are one on top of the other), proposedMin is the top limit. If the split bars are vertical (views are side by side), proposedMin is the left limit. The initial value of proposedMin is the top (or left side) of the subview before the divider. offset specifies the divider the user is moving, with the first divider being 0 and going up from top to bottom (or left to right). So it sounds like it should only be called during repositioning of the divider. Could you possibly do a test against Cocoa to see whether this is actually the case? by Francisco Tolmasky |
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window Ok, I wrote a little cocoa app and this method does get called when the window is resized as well as when the divider is repositioned. I attached the project if you care to see for yourself... by Patrick Crosby |
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window Cool, I’ll try to fix this tomorrow then by Francisco Tolmasky |
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window This hasn’t been fixed in 0.7b yet. by Thomas Balthazar |
http://github.com/stevegeek/CappuccinoBugs/tree/master/i0041/ I have commited the test here, and I do not see the problem anymore |
I do not believe this is a bug. Cocoa's NSSplitView performs in the exact same manner (unfortunately). |
This still happens in Cappuccino, I need to check if it happens in Cocoa. |
The behavior you are seeing is correct according to Cocoa. The way to do what you want is covered here: The -adjustSubviews method has been added to CPSplitView. |
If I have the following method in a CPSplitView delegate:
@@@
{
if (index == 0) {
return 200;
}
else {
return minCoord;
}
}
@@@
it correctly keeps the subview at index 0 from ever being less than 200 pixels wide when moving the splitter around.
But if I resize the window and make the window smaller, the subview does get resized with a width less than 200 pixels...
I added a log message to the above method to check whether it ever gets called. When resizing the window, the method never gets called. It gets called plenty when moving the splitter.
original LH ticket
This ticket has 1 attachment(s).
The text was updated successfully, but these errors were encountered: