Showing 2 changed files with 26 additions and 3 deletions
+22 -2
Nasal/display.nas
... ...
@@ -90,8 +90,10 @@ var displayClass = {
90 90
                 clip: [ ],
91 91
             };
92 92
 
93
-            for (var k = 0; k < 12; k += 1)
93
+            for (var k = 0; k < 12; k += 1) {
94 94
                 append(groups.text, sprintf("SoftKey%02i-text", k));
95
+                append(groups.show, sprintf("SoftKey%02i-bg", k));
96
+            }
95 97
 
96 98
             if (me.role == 'PFD') {
97 99
                 append(groups.show,
... ...
@@ -380,9 +382,27 @@ var displayClass = {
380 382
     },
381 383
 #}}}
382 384
 
385
+    setSoftKeyColor : func (n, active, alert = 0) {
386
+# set colors for active softkeys {{{
387
+        var sftk = sprintf('SoftKey%02i-', n);
388
+        if (active) {
389
+            var bg = alert ? 1 : 0.5;
390
+            me.screenElements[sftk ~ 'bg']
391
+                .setColorFill(bg,bg,bg);
392
+            me.screenElements[sftk ~ 'text']
393
+                .setColor(0,0,0);
394
+        }
395
+        else {
396
+            me.screenElements[sftk ~ 'bg']
397
+                .setColorFill(0,0,0);
398
+            me.screenElements[sftk ~ 'text']
399
+                .setColor(1,1,1);
400
+        }
401
+    },
402
+#}}}
403
+
383 404
     updateSoftKeys : func {
384 405
 # update SoftKeys boxes {{{
385
-        # grey background code = #353939
386 406
         # on PFD the last boxes are always BACK and ALERTS
387 407
         if (me.role == 'PFD') {
388 408
             me.screenElements[sprintf("SoftKey%02i-text", 11)]
+4 -1
README.md
... ...
@@ -63,7 +63,10 @@ Please report bug at <seb.marque@free.fr>.
63 63
   * XPDR from SoftKeys
64 64
   * Selected altitude bug (widget off if IA within 100ft)
65 65
   * baro settings
66
-  * SoftKeys menus navigation for PFD and MFD, not yet implemented function are logged in console
66
+  * SoftKeys menus navigation for PFD and MFD
67
+    * not yet implemented function are logged in console
68
+    * softkeys colorized when active
69
+    * alerts with white backgroud and black text available
67 70
 * ![][90%]
68 71
   * Radio stack, including ID for NAV (bug: NAV1 ID isn't displayed ![][pause])
69 72
   * Bearing needs some checks to be sure it shows the correct information