diff -Nru /tmp/LqK5KwZMxU/usplash-0.1/debian/changelog /tmp/26m17ILpPd/usplash-0.1/debian/changelog --- /tmp/LqK5KwZMxU/usplash-0.1/debian/changelog 2006-02-23 03:53:07.000000000 +0000 +++ /tmp/26m17ILpPd/usplash-0.1/debian/changelog 2006-03-09 17:29:50.000000000 +0000 @@ -1,3 +1,10 @@ +usplash (0.1-31usplashdown1) dapper; urgency=low + + * Allow PROGRESS to accept negative progress counts and paint these + with the foreground and background swapped. + + -- Paul Sladen Thu, 09 Mar 2006 17:29:44 +0000 + usplash (0.1-31) dapper; urgency=low * Include a new command, /usr/sbin/usplash_down that can be called by diff -Nru /tmp/LqK5KwZMxU/usplash-0.1/usplash.c /tmp/26m17ILpPd/usplash-0.1/usplash.c --- /tmp/LqK5KwZMxU/usplash-0.1/usplash.c 2006-01-09 10:22:00.000000000 +0000 +++ /tmp/26m17ILpPd/usplash-0.1/usplash.c 2006-03-09 17:59:15.000000000 +0000 @@ -174,12 +174,20 @@ } void draw_progress(int percentage) { - // Blank out the previous contents - if (percentage < 0 || percentage > 100) { + int fore = PROGRESSBAR_COLOUR, back = PROGRESSBAR_BACKGROUND; + + if (percentage < -100 || percentage > 100) return; + + // Paint bar in reverse-video if percentage passed is negative. + if (percentage < 0) { + fore = PROGRESSBAR_BACKGROUND; + back = PROGRESSBAR_COLOUR; + percentage = -percentage; } - bogl_clear(left_edge+220,PROGRESS_BAR,left_edge+420,PROGRESS_BAR+10,PROGRESSBAR_BACKGROUND); - bogl_clear(left_edge+220,PROGRESS_BAR,(left_edge+220+2*percentage),PROGRESS_BAR+10,PROGRESSBAR_COLOUR); + // Overwrite the whole area to blank out any previous contents + bogl_clear(left_edge+220,PROGRESS_BAR,left_edge+420,PROGRESS_BAR+10, back); + bogl_clear(left_edge+220,PROGRESS_BAR,(left_edge+220+2*percentage),PROGRESS_BAR+10, fore); return; }