DMSplitView icon indicating copy to clipboard operation
DMSplitView copied to clipboard

applyPriorityResizeFromOldSize: can incorrectly skip height resizing on certain views

Open chrismcs opened this issue 11 years ago • 0 comments

High level overview of the bug: You're using a dictionary for priorityIndexes, so you effectively loose sight of view indexes if you have 2 or more subviews set to the same priority.

Here was my specific scenario: I have a vertical DMSplitView with 3 subviews. I want the middle subview to be resized when the window is resized, but I'd like the outer subviews to stay at a fixed size (unless they are manually resized).

So in my setup, I had the following priorities set for my subviews: subview 0: 490 subview 1: 1 subview 2: 490

Because priorityIndexes uses priority as the key, it lost sight of subview 0 (because when I made the call to setPriority: 490 ofSubviewIndex: 2, that overwrote the entry in the dictionary for subview 0.

The main problem this created was that subview 0 would no longer get vertically resized because subview 0 wasn't in the priorityIndexes dictionary anymore.

The obvious workaround for my case was to simply set subview 2's priority to 489 and now it resizes as expected.

chrismcs avatar Apr 07 '14 22:04 chrismcs