From 866833ebec2de9def88772ea4bae4623c9c36350 Mon Sep 17 00:00:00 2001 From: Thomas Frauendorfer Date: Tue, 28 Oct 2008 03:36:52 +0100 Subject: [PATCH] OTHER: on text change stop draging if new text completely fits into textbar --- src/mainwindow/textbar.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mainwindow/textbar.cpp b/src/mainwindow/textbar.cpp index d2a4198..bd67537 100644 --- a/src/mainwindow/textbar.cpp +++ b/src/mainwindow/textbar.cpp @@ -127,6 +127,11 @@ TextScroller::drawText () } else { drawBitmapFont (m_text); } + updateScrolling (); + + if (m_pixmap.width () <= width ()) + m_dragtext = false; + // take care that the text doesn't jump after resetting it's offset // if we were still dragging it on a song change if (m_dragtext) @@ -150,7 +155,6 @@ TextScroller::drawBitmapFont (QString text) } else { m_pixmap = QPixmap (width (), 6); } - updateScrolling (); QByteArray temp2 = temp.toLatin1(); const char *t = temp2.data(); @@ -193,7 +197,6 @@ TextScroller::drawQtFont (QString text) } else { m_pixmap = QPixmap (size ()); } - updateScrolling (); QPainter paint; paint.begin (&m_pixmap);