]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsamixer: fix display of inactive volume bar
authorClemens Ladisch <clemens@ladisch.de>
Fri, 19 Jun 2009 06:40:00 +0000 (08:40 +0200)
committerClemens Ladisch <clemens@ladisch.de>
Fri, 19 Jun 2009 06:40:00 +0000 (08:40 +0200)
Fix the volume bar color selection logic so that the current attribute
is used for inactive controls.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
alsamixer/mixer_display.c

index 79ed9d68264bbf2bc70992f36e9bec87092b3a84..9eadcc9a4b92aab43e8b49a5d3dfceaf0a8489d6 100644 (file)
@@ -475,13 +475,15 @@ static void display_control(unsigned int control_index)
                                                    attr_ctl_frame : 0);
                                else {
                                        ch = ACS_CKBOARD;
+                                       if (!(control->flags & IS_ACTIVE))
+                                               ;
 #ifdef TRICOLOR_VOLUME_BAR
-                                       if (i > volume_height * 8 / 10)
+                                       else if (i > volume_height * 8 / 10)
                                                ch |= attr_ctl_bar_hi;
                                        else if (i > volume_height * 4 / 10)
                                                ch |= attr_ctl_bar_mi;
-                                       else
 #endif
+                                       else
                                                ch |= attr_ctl_bar_lo;
                                }
                                mvwaddch(mixer_widget.window, base_y - i - 1,