bugGNUstep - Bugs: bug #40761, NSScroller -rectForPart:...

 
 

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

bug #40761: NSScroller -rectForPart: NSScrollerIncrementLine returns zero

Submitted by:  Jeff Teunissen <Deek>
Submitted on:  Sun 01 Dec 2013 12:21:25 AM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Tue 03 Dec 2013 09:43:27 PM UTC, comment #7:

Thank you for your patch. I experimented with changes to the _usableParts myself. But there is the risk that somebody later changes the code in -rectForPart: to match that in -testPart: and that would again break your [horizontalScroller rectForPart: NSScrollerIncrementLine] call.

What I finally came up with was an enable check in -mouseDown:, which should be fine and another switch in -drawRect:, which I don't like that much.

I also made two minor changes to improve the drawing code for NSScroller and NSScrollerView, as the separator line got blured on my machine.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Tue 03 Dec 2013 09:09:52 PM UTC, comment #6:

Patch against trunk attached, pulled from my tree.

Some optimization might further take advantage of the fact that the knob slot is all the space not taken up by buttons (so there's no need to do much checking of its rectangle).

(file #29778)

Jeff Teunissen <Deek>
Mon 02 Dec 2013 08:23:17 PM UTC, comment #5:

Now it does this:

The knob slot is now drawn except for where the buttons would be (if they were being drawn). For extra fun, if you click in that space, the formerly-invisible button you "clicked" appears and highlights.

(file #29759, file #29760)

Jeff Teunissen <Deek>
Mon 02 Dec 2013 07:00:11 PM UTC, comment #4:

Please try again, I changed the code to always draw the knob slot.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Mon 02 Dec 2013 04:28:24 PM UTC, comment #3:

Scratch that last comment, now the scroller background isn't being displayed if there are no displayed controls.

Jeff Teunissen <Deek>
Mon 02 Dec 2013 08:02:51 AM UTC, comment #2:

Seems to work.

Jeff Teunissen <Deek>
Sun 01 Dec 2013 09:00:05 PM UTC, comment #1:

I submitted a patch that implements the described behaviour. Please give it a try.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Sun 01 Dec 2013 12:21:25 AM UTC, original submission:

In multi-page mode, TextEdit sends [horizontalScroller rectForPart: NSScrollerIncrementLine] to determine the height of the horizontal scroll bar, for inserting an NSPopUpButton onto the end of it.

All is well, until/unless the window is wide enough that no scroll buttons/thumb are needed, at which point the button disappears as well.

After some investigation, the reason is that the above call returns zero when the scroller is not displaying its controls. On OpenStep, and most likely Mac OS X, the rects do not change just because the controls are not being displayed.

Jeff Teunissen <Deek>

 

Attached Files
file #29778:  0001-Fix-up-NSScroller.patch added by Deek (4KiB - text/x-patch)
file #29759:  Goofy-Scrollers.png added by Deek (38KiB - image/png)
file #29760:  Goofy-Scrollers2.png added by Deek (25KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rmottola (Updated the item)
  • -unavailable- added by FredKiefer (Posted a comment)
  • -unavailable- added by Deek (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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 09 Jan 2015 02:13:11 PM UTCrmottolaStatusReady For Test=>Fixed
      Open/ClosedIn Test=>Closed
    Tue 03 Dec 2013 09:09:52 PM UTCDeekAttached File-=>Added 0001-Fix-up-NSScroller.patch, #29778
    Mon 02 Dec 2013 08:23:17 PM UTCDeekAttached File-=>Added Goofy-Scrollers.png, #29759
      Attached File-=>Added Goofy-Scrollers2.png, #29760
    Sun 01 Dec 2013 09:00:05 PM UTCFredKieferStatusNone=>Ready For Test
      Assigned toNone=>FredKiefer
      Open/ClosedOpen=>In Test

    Back to the top


    Powered by Savane 3.1-cleanup1