Dealing with the annoying scrolling bug in the chat plasmoid

Lasath Fernando kde at lasath.org
Wed Jul 4 02:08:36 UTC 2012


Hey,

Instead of working on my GSoC (which I'll probably regret), I spent the
morning investigating the issue with the chat plasmoid not scrolling
properly. (BUG:293522)

First thing I tried was removing the scrollbar entirely. Surprisingly, that
did not magically fix everything ;-). So it's not (just) the ScrollBar that's
giving us issues.

By messing around further, I *THINK* I've determined the actual cause of this
issue. Since delegates are only instantiated on demand, the flickable can't 
know the actual height of the total messages.
This is a bit of speculation on my part, but I think the ListView takes the 
height of one delegate and multiplies it by the number of items for its 
'height' property. That would explain why it works for the contactlist 
plasmoid but not this, since this has delegates of different heights.

To test this out (and possible hacky fix), I tried
	cacheBuffer: 9001
That actually fixed it marvelously, but it may be a little inefficient because if 
a conversation actually has 9001 messages, it'll keep all of their delegates 
in memory.

The other option was disabling the ScrollBar (who uses them these days 
anyway). Then simply setting
	currentIndex: count - 1
	highlightFollowsCurrentItem: true
made it auto-scroll on incoming messages while still allowing the user to 
scroll manually.

So, while you guys are at Akademy, if you happen to speak to the Plasma 
guys and come up with a _magic_ solution, I'll be impressed at your 
witchcraft. Otherwise, we're going to have to do one of these.

PS: I think this is the last showstopper bug with this plasmoid, so I want to 
get it fixed/out of the way.

---
Cheers,
Lasath


More information about the KDE-Telepathy mailing list