ListView scrollbar flicker

ListView scrollbar flicker

Post by Steve Alan » Sat, 08 Apr 2006 18:38:39


If a ListView has a column or more with #isAutoResize set to true, and
Windows is set to "Show window contents while dragging", I see the
horizontal scrollbar flickering when its parent container is being
resized.

An example is the methods pane in a Browser. If I make the browser
wider/narrower etc, the methods pane ListView gets the scrollbar
flicker.

If I change ListView>>layout: to use:

rect := self clientRectangle.

Instead of:

rect := aLayoutContext clientRectangleOf: self.

... it gets rid of the flicker.

Thanks,
Steve
 
 
 

ListView scrollbar flicker

Post by Blair McGl » Sun, 09 Apr 2006 17:45:16


Yes, I see the problem now you mention it. I suspect the problem could be
the calculation of the correct client rectangle from the view rectangle
stored in the layout context from a previous repositioning within the batch.

We'll look at this for the next patch level, but since it is a cosmetic
issue (very on my test machine and through my old eyes, the flicker is very
faint) I'm afraid it will be a low priority item.

Thanks for the report though

Blair

 
 
 

ListView scrollbar flicker

Post by Blair McGl » Sun, 16 Apr 2006 20:51:00


Steve, I've attached a patch fix for this below if you (or anyone else)
would like to try it. With all the different versions of Windows out there
(or should I say versions of Windows in combination with different versions
of IE) it can be difficult to verify that visual glitches are absent
regardless of configuration, so I'd appreciate any feedback.

Regards

Blair

-----------------------
!ListView methodsFor!

onPositionChanged: aPositionEvent
"We must resize any auto-sizing columns *before* WM_WINDOWPOSCHANGED is
passed to the
control, as that is when it updates scrollbars which can cause the
horizontal scrollbar to
briefly flicker if the column widths are not adjusted beforehand (#2103)."

(aPositionEvent isRectangleChanged and: [self isReportMode])
ifTrue:
[| width count |
width := aPositionEvent width.
count := self itemCount.
count > 0
ifTrue:
[| extent |
extent := self
lvmApproximateViewRect: count
cx: width
cy: aPositionEvent height.
extent y - SystemMetrics current scrollbarHeight > aPositionEvent
height
ifTrue: [width := width - SystemMetrics current scrollbarWidth]].
self autoResizeColumns: width].
^super onPositionChanged: aPositionEvent! !
!ListView categoriesFor: #onPositionChanged:!event handling!public! !

ListView removeSelector: #layout: ifAbsent: []!
 
 
 

ListView scrollbar flicker

Post by Steve Alan » Mon, 24 Apr 2006 08:42:25

Hi Blair,


I have just tried the patch and it looks great ... thanks!

At first I missed the removal of #layout:... the scrollbar was jumping
all over the place ... but once I removed #layout: it was as smooth as
silk.

I will put the fix in my main development image, and if I notice any
problems I will let you know.

FWIW: I needed to add:

!SystemMetrics methodsFor!

scrollbarHeight
^self nonClientMetrics iScrollHeight! !
!SystemMetrics categoriesFor: #scrollbarHeight!constants!public! !

Thanks,
Steve