diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-03-27 10:08:47 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-03-27 10:08:47 +0000 |
| commit | 0fa5c6f14759412694759893c3c33d747f75ff0f (patch) | |
| tree | 98db62ac82915e887bc2584bb9b4c68d570e194f /src | |
| parent | 76d8e822d8ba2021958317c53ecd3569612b9518 (diff) | |
| download | qmmp-0fa5c6f14759412694759893c3c33d747f75ff0f.tar.gz qmmp-0fa5c6f14759412694759893c3c33d747f75ff0f.tar.bz2 qmmp-0fa5c6f14759412694759893c3c33d747f75ff0f.zip | |
fixed playlist again
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1651 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/listwidget.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/listwidget.cpp b/src/ui/listwidget.cpp index b621ab495..8aabce956 100644 --- a/src/ui/listwidget.cpp +++ b/src/ui/listwidget.cpp @@ -223,7 +223,7 @@ void ListWidget::mousePressEvent(QMouseEvent *e) void ListWidget::resizeEvent(QResizeEvent *e) { - m_rows = (e->size().height() - 10) / m_metrics->height (); + m_rows = e->size().height() / m_metrics->height (); m_scroll = true; updateList(); QWidget::resizeEvent(e); @@ -506,12 +506,12 @@ void ListWidget::contextMenuEvent(QContextMenuEvent * event) void ListWidget::recenterCurrent() { - if (!m_scroll) + if (!m_scroll && m_rows) { if (m_first + m_rows < m_model->currentRow() + 1) m_first = qMin(m_model->count() - m_rows, - m_model->currentRow() - m_rows/2 + 1); + m_model->currentRow() - m_rows/2); else if (m_first > m_model->currentRow()) - m_first = qMax (m_model->currentRow() - m_rows/2 + 1, 0); + m_first = qMax (m_model->currentRow() - m_rows/2, 0); } } |
