From 3a843d9202d7d3a1aa9e82b3bbbc1ddfbb5fb686 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Fri, 20 Aug 2021 14:07:03 +0200 Subject: [PATCH] Added ToggleBoolAction --- CMakeLists.txt | 1 + src/actions/toggleboolaction.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/actions/toggleboolaction.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 414d274..53864b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ set(headers src/actions/dummyaction.h src/actions/setvalueaction.h src/actions/switchscreenaction.h + src/actions/toggleboolaction.h src/icons/back.h src/icons/checked.h src/icons/unchecked.h diff --git a/src/actions/toggleboolaction.h b/src/actions/toggleboolaction.h new file mode 100644 index 0000000..1dc5f88 --- /dev/null +++ b/src/actions/toggleboolaction.h @@ -0,0 +1,18 @@ +#pragma once + +// local includes +#include "actioninterface.h" +#include "accessorinterface.h" + +namespace espgui { +class ToggleBoolAction : + public virtual ActionInterface, + public virtual AccessorInterface +{ +public: + void triggered() override + { + setValue(!getValue()); + } +}; +} // namespace espgui