void eListbox::setContent(iListboxContent *content)
{
- int oldsel = m_selected;
m_content = content;
if (content)
m_content->setListbox(this);
entryReset();
- /* if oldsel != m_selected, selectionChanged was already
- emitted in entryReset. we want it in any case, so otherwise,
- emit it now. */
- if (oldsel == m_selected)
- /* emit */ selectionChanged();
}
bool eListbox::atBegin()
m_content->paint(painter, *style, ePoint(0, y), m_selected == m_content->cursorGet() && m_content->size() && m_selection_enabled);
/* (we could clip with entry_clip_rect, but
- this shouldn't change the behaviour of any
+ this shouldn't change the behavior of any
well behaving content, so it would just
degrade performance without any gain.) */
{
m_content_changed = true;
m_prev_scrollbar_page = -1;
+ int oldsel;
if (selectionHome)
{
else
m_selected = 0;
m_content->cursorSet(m_selected);
- selectionChanged();
}
+ oldsel = m_selected;
moveSelection(justCheck);
+ /* if oldsel != m_selected, selectionChanged was already
+ emitted in moveSelection. we want it in any case, so otherwise,
+ emit it now. */
+ if (oldsel == m_selected)
+ /* emit */ selectionChanged();
invalidate();
}