Let CycleControl pass commands to its child; let screenlayout respond to unqualified command

master
Lars Vierbergen 8 years ago
parent d5b0e25ce2
commit c39ec71959
  1. 1
      modules/core.py
  2. 2
      modules/cycle.py
  3. 7
      modules/screenlayout.py

@ -327,6 +327,7 @@ class WrappingControl(AbstractControl):
self.child.load_state(state)
def respond_to(self, command):
logging.debug('%s.respond_to: Passing command "%s" to child', self.__class__.__name__, command)
return self.child.respond_to_ex(command)
@property

@ -120,6 +120,8 @@ class CycleControl(WrappingControl):
elif command == ':prev':
self.child.prev()
return True
else:
return super().respond_to(command)
def __str__(self):
next_button = Button.LEFT

@ -41,6 +41,13 @@ class ScreenLayoutCycleAction(OrderedDictCycleAction):
return True
return False
def respond_to(self, command: str):
if command == 'screenlayout':
self.next()
return True
else:
return super().respond_to(command)
def __str__(self):
return self.__naming_func(super().__str__())

Loading…
Cancel
Save