diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-02-22 18:39:53 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-02-22 18:39:53 +0000 |
| commit | c6802d917ad4c0de10dd768a3dfb95975518c1b3 (patch) | |
| tree | 0cbb523b614a7216c008a8a55f2da36cbb69eb6e | |
| parent | 3be1b2d983fdf5f124174416a3a73bf22f12609a (diff) | |
| download | qmmp-c6802d917ad4c0de10dd768a3dfb95975518c1b3.tar.gz qmmp-c6802d917ad4c0de10dd768a3dfb95975518c1b3.tar.bz2 qmmp-c6802d917ad4c0de10dd768a3dfb95975518c1b3.zip | |
fixed text scroller regression
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2068 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/ui/textscroller.cpp | 10 | ||||
| -rw-r--r-- | src/ui/textscroller.h | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/ui/textscroller.cpp b/src/ui/textscroller.cpp index ace9c7518..d541231ad 100644 --- a/src/ui/textscroller.cpp +++ b/src/ui/textscroller.cpp @@ -42,6 +42,7 @@ TextScroller::TextScroller (QWidget *parent) m_defautText = QString("Qmmp ") + Qmmp::strVersion(); m_core = SoundCore::instance(); m_skin = Skin::instance(); + m_ratio = m_skin->ratio(); m_timer = new QTimer (this); m_timer->setInterval(50); @@ -99,6 +100,7 @@ void TextScroller::updateSkin() setCursor(m_skin->getCursor(Skin::CUR_SONGNAME)); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_bitmap = settings.value("MainWindow/bitmap_font", false).toBool(); + m_ratio = m_skin->ratio(); updateText(); } @@ -251,14 +253,14 @@ void TextScroller::preparePixmap(const QString &text, bool scrollable) { int textWidth = m_bitmap ? QString(text + SCROLL_SEP).size() * 5 : m_metrics->width(text + SCROLL_SEP); - int count = 150 / textWidth + 1; + int count = 150*m_ratio / textWidth + 1; int width = count * textWidth; QString fullText; for(int i = 0; i < count; ++i) { fullText.append(text + SCROLL_SEP); } - m_pixmap = QPixmap(width,15); + m_pixmap = QPixmap(width,15*m_ratio); m_pixmap.fill(Qt::transparent); QPainter painter(&m_pixmap); painter.setPen(m_color); @@ -272,7 +274,7 @@ void TextScroller::preparePixmap(const QString &text, bool scrollable) } else { - m_pixmap = QPixmap(150,15); + m_pixmap = QPixmap(150*m_ratio,15*m_ratio); m_pixmap.fill(Qt::transparent); QPainter painter(&m_pixmap); painter.setPen(m_color); @@ -309,7 +311,7 @@ void TextScroller::updateText() //draw text according priority else { m_timer->stop(); - m_pixmap = QPixmap (150,15); + m_pixmap = QPixmap (150*m_ratio,15*m_ratio); m_pixmap.fill(Qt::transparent); m_scroll = false; } diff --git a/src/ui/textscroller.h b/src/ui/textscroller.h index b4c5909db..7367ad2b1 100644 --- a/src/ui/textscroller.h +++ b/src/ui/textscroller.h @@ -65,9 +65,8 @@ private: QString m_bufferText; QString m_sliderText; QString m_titleText; - QPixmap m_pixmap; - int m_x1, m_x2; + int m_x1, m_x2, m_ratio; bool m_scroll, m_bitmap, m_pressed; int m_press_pos; QFont m_font; |
