aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui/textscroller.cpp10
-rw-r--r--src/ui/textscroller.h3
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;