bugGNUstep - Bugs: bug #29899, NSToolbarItem setView: sets...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #29899: NSToolbarItem setView: sets minSize and maxSize

Submitted by:  Doug Simons <theeggcamefirst>
Submitted on:  Mon 17 May 2010 04:29:26 PM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Closed

Tue 18 May 2010 07:46:40 PM UTC, comment #5:

Great to hear that you are working on improving the resize code.

Passing on a part of the available space to the flexible space items will only be a couple of extra lines of code. But getting the balance right will surely require a lot a trying.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Mon 17 May 2010 08:46:54 PM UTC, comment #4:

The fix to NSToolbarItem works fine for me.

Regarding the resizing code: As it happens, I had also started to work on the toolbar resizing code (the _takeInAccountFlexibleSpaces method) a couple of days ago, before I saw your changes. I tried both versions, and found they both had some problems, but I have my version working almost perfectly now (needs a couple more tweaks). I favored my code, because it divides extra space evenly between both flexibleSpace items and any resizable items with maxSize > minSize, which matches the behavior on Cocoa. I'll send it to you soon for your comments before I commit it.

Doug Simons <theeggcamefirst>
Mon 17 May 2010 08:20:01 PM UTC, comment #3:

Should be fixed in SVN now.

Could you please report back whether this works and how the new resizing code behaves for you?

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Mon 17 May 2010 06:31:51 PM UTC, comment #2:

Okay, good. That documentation is helpful. I'm currently running on 10.6, and I believe my code functioned the same on earlier versions as well. From the documentation it seems clear to me that the correct behavior is to do as I suggested and set the min and max sizes if they haven't already been set (if they're still zero when setView: is called).

That should produce the desired behavior.

Doug Simons <theeggcamefirst>
Mon 17 May 2010 05:48:24 PM UTC, comment #1:

What version of Cocoa are you referring to? For 10.5 Apple has documented the following:

Note: As of Mac OS X v10.5, if you call setView: on an NSToolbarItem object without also calling setMinSize: or setMaxSize:, the toolbar item sets its minimum and maximum size equal to the view’s frame.

This leaves it somewhat open whether setting the min/max values before setting the view has the expected effect. If a Cocoa system > 10.5 still handles your code, we will need to adjust the min/max setting in NSToolbarItem.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Mon 17 May 2010 04:29:26 PM UTC, original submission:

This behavior appears to be different from Cocoa. I had code that initialized my toolbarItem by first setting the minSize and the maxSize and then calling setView:, but on GNUstep the call to setView: resets the minSize and maxSize to the size of the view.

In this case I can work around it by simply changing the order of my calls, but this incompatibility is likely to cause trouble for someone else one of these days. Maybe it would make sense for that method to set the min and max sizes only if they haven't already been set?

Doug Simons <theeggcamefirst>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by FredKiefer (Posted a comment)
  • -unavailable- added by theeggcamefirst (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 18 May 2010 07:46:40 PM UTCFredKieferStatusReady For Test=>Fixed
      Open/ClosedIn Test=>Closed
    Mon 17 May 2010 08:20:01 PM UTCFredKieferStatusNone=>Ready For Test
      Open/ClosedOpen=>In Test
    Mon 17 May 2010 05:48:24 PM UTCFredKieferAssigned toNone=>FredKiefer

    Back to the top


    Powered by Savane 3.1-cleanup1