[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdeplasma-addons/KDE/4.10] applets/nowplaying/package/contents/ui: Now Playing: do not fade text if
From:       Alex Merry <kde () randomguy3 ! me ! uk>
Date:       2013-01-18 23:21:39
Message-ID: 20130118232139.567DBA6091 () git ! kde ! org
[Download RAW message or body]

Git commit cbeb6e03a8bfe35bd2e81d85440f6c0de0ebd651 by Alex Merry.
Committed on 19/01/2013 at 00:19.
Pushed by alexmerry into branch 'KDE/4.10'.

Now Playing: do not fade text if it does not change

We avoid setting the text attribute if it does not change; this prevents
us fading the title in and out every few seconds if the user has opted
not to show the artist or album.

BUG: 313367
FIXED-IN: 4.10

M  +6    -4    applets/nowplaying/package/contents/ui/MetadataLine.qml

http://commits.kde.org/kdeplasma-addons/cbeb6e03a8bfe35bd2e81d85440f6c0de0ebd651

diff --git a/applets/nowplaying/package/contents/ui/MetadataLine.qml \
b/applets/nowplaying/package/contents/ui/MetadataLine.qml index 6496a51..31d303d \
                100644
--- a/applets/nowplaying/package/contents/ui/MetadataLine.qml
+++ b/applets/nowplaying/package/contents/ui/MetadataLine.qml
@@ -78,22 +78,24 @@ Item {
             }
         }
         function updateText() {
+            var newText = source.title;
             if (metadataLine.step == 1) {
                 if (showArtist && source.artist != '') {
-                    text = i18nc("What artist is this track by", "by %1", \
source.artist); +                    newText = i18nc("What artist is this track by", \
"by %1", source.artist);  } else {
                     metadataLine.step = 2;
                 }
             }
             if (metadataLine.step == 2) {
                 if (showAlbum && source.album != '') {
-                    text = i18nc("What album is this track on", "on %1", \
source.album); +                    newText = i18nc("What album is this track on", \
"on %1", source.album);  } else {
                     metadataLine.step = 0;
                 }
             }
-            if (metadataLine.step == 0) {
-                text = source.title;
+            // prevent fading the text if it hasn't changed
+            if (text != newText) {
+                text = newText;
             }
         }
         Timer {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic