From 5f6ed202a57c64c9dcd614006aa0e16d49449c76 Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Wed, 14 Feb 2018 02:06:23 +0100 Subject: [PATCH 30/30] Hide LED modes that are not supported If a LED does not support e.g. 'Cycle' mode then we should not show that page in the LED stack. --- piper/leddialog.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/piper/leddialog.py b/piper/leddialog.py index 50a58d1..44f4bea 100644 --- a/piper/leddialog.py +++ b/piper/leddialog.py @@ -55,6 +55,8 @@ class LedDialog(Gtk.Dialog): for k, v in self._modes.items(): if mode == v: self.stack.set_visible_child_name(k) + if v not in self._led.modes: + self.stack.get_child_by_name(k).set_visible(False) rgba = self._get_led_color_as_rgba() self.colorchooser.set_rgba(rgba) self.colorbutton.set_rgba(rgba) -- 2.16.1