On Mon, Jul 2, 2012 at 11:36 PM, Kai Sterker <kai.ster...@gmail.com> wrote:
> I would say this is a problem with gui::layout itself, not just > gui::conversation. If you look at the implementation, you'll see that > conversation is a scrollview is as layout. The scrollviews only child > is a list_layout that in turn contains all the answers. As long as > everything is fine, focus is with the first answer and up/down moves > it to the previous/next. But when pressing left/right, something odd > happens with the focus. Given the involved widgets, I would have > assumed that nothing but the answers can end up with the focus anyway > (layouts should always pass the focus down to a child that isn't a > layout). And the hierarchy we have is basically > > scrollview > list_layout > button 1 > button 2 > ... > button n > > So we need to figure out where the focus goes and make sure that it > stays where it is instead. gui::conversation should not have to change > for that. I think I know what the problem is. list_layout does not consume left/right when its items are arranged from top to bottom. So it propagates up to scrollview, which is not very picky. And here's the bug: scrollview only has one widget, but if you look at layout::moveleft (and its siblings), it will basically do if (focus(next_child)) unfocus(current); Unfortunately, if there is only one child, then current and next_child are the same. Surrounding the whole logic with if (Children.size() > 1) should fix it. There's nobody else to take focus in that case, so why even try? I'll see if this works ... Kai _______________________________________________ Adonthell-devel mailing list Adonthell-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/adonthell-devel