From 0fa5c6f14759412694759893c3c33d747f75ff0f Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 27 Mar 2010 10:08:47 +0000 Subject: fixed playlist again git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1651 90c681e8-e032-0410-971d-27865f9a5e38 --- src/ui/listwidget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ui/listwidget.cpp') 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); } } -- cgit v1.2.3-13-gbd6f