]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
don't draw scale when not mapped
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 20 Mar 2013 16:37:07 +0000 (17:37 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 20 Mar 2013 16:49:04 +0000 (17:49 +0100)
scale.c

diff --git a/scale.c b/scale.c
index 3dbfca96e20e46f774b4723e38d444e0350ae4b8..35dcdde87802c27d152d44cedf2a5667447bf887 100644 (file)
--- a/scale.c
+++ b/scale.c
@@ -39,6 +39,7 @@ newtComponent newtScale(int left, int top, int width, long long fullValue) {
     co->top = top;
     co->left = left;
     co->takesFocus = 0;
+    co->isMapped = 0;
 
     sc->fullValue = fullValue;
     sc->charsSet = 0;
@@ -85,7 +86,7 @@ static void scaleDraw(newtComponent co) {
     int xlabel = (co->width-4) /2;
     char percent[10];
     
-    if (co->top == -1) return;
+    if (!co->isMapped) return;
 
     newtGotorc(co->top, co->left);