Unbreak scrolling again.
This commit is contained in:
parent
f4c904b022
commit
7436ae5e45
2 changed files with 3 additions and 4 deletions
|
|
@ -15,8 +15,6 @@ PlaylistScrollButton::PlaylistScrollButton (PlaylistScroller *parent, uint norma
|
||||||
void
|
void
|
||||||
PlaylistScrollButton::mouseMoveEvent (QMouseEvent *event)
|
PlaylistScrollButton::mouseMoveEvent (QMouseEvent *event)
|
||||||
{
|
{
|
||||||
PlaylistWindow *pw = dynamic_cast<PlaylistWindow *>(window ());
|
|
||||||
|
|
||||||
QPoint p (event->pos ());
|
QPoint p (event->pos ());
|
||||||
|
|
||||||
int npos = pos().y()+p.y()-m_diffy;
|
int npos = pos().y()+p.y()-m_diffy;
|
||||||
|
|
@ -112,6 +110,7 @@ void
|
||||||
PlaylistWindow::doScroll (int pos)
|
PlaylistWindow::doScroll (int pos)
|
||||||
{
|
{
|
||||||
int npos = ((float)pos) / (float)(m_scroller->getMax()) * float(m_list->height() - m_view->height());
|
int npos = ((float)pos) / (float)(m_scroller->getMax()) * float(m_list->height() - m_view->height());
|
||||||
|
|
||||||
m_list->setOffset (npos);
|
m_list->setOffset (npos);
|
||||||
if (npos == 0) {
|
if (npos == 0) {
|
||||||
m_list->update ();
|
m_list->update ();
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ PlaylistList::playlistChanged (QHash<QString,QString> h)
|
||||||
{
|
{
|
||||||
uint id = h.value("id").toUInt();
|
uint id = h.value("id").toUInt();
|
||||||
if (m_itemmap->contains (id)) {
|
if (m_itemmap->contains (id)) {
|
||||||
m_items->append (m_itemmap->value (id));
|
addItem (m_itemmap->value (id));
|
||||||
} else {
|
} else {
|
||||||
new PlaylistItem (this, id);
|
new PlaylistItem (this, id);
|
||||||
}
|
}
|
||||||
|
|
@ -182,7 +182,7 @@ PlaylistList::playlistList (QList<uint> l)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < l.count(); i++) {
|
for (int i = 0; i < l.count(); i++) {
|
||||||
if (m_itemmap->contains (l.value(i))) {
|
if (m_itemmap->contains (l.value(i))) {
|
||||||
m_items->append (m_itemmap->value (l.value(i)));
|
addItem (m_itemmap->value (l.value (i)));
|
||||||
} else {
|
} else {
|
||||||
new PlaylistItem (this, l.value(i));
|
new PlaylistItem (this, l.value(i));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue