// // Created by grimmauld on 12.03.24. // #ifndef SWAYMUX_TOGGLEDETAILSKEYLISTENER_H #define SWAYMUX_TOGGLEDETAILSKEYLISTENER_H #include "MainWindowAwareKeyListener.h" class ToggleDetailsKeyListener : public MainWindowAwareKeyListener { public: explicit ToggleDetailsKeyListener(MainWindow *pWindow) : MainWindowAwareKeyListener(pWindow) {} void handleKeyEvent(const QKeyEvent *keyEvent) const override { if (window->ui->windowDetails->isHidden()) window->ui->windowDetails->show(); else window->ui->windowDetails->hide(); } const std::string getDescription() override { return "toggle window detail view"; } const std::string getKeyText() override { return "Tab"; } [[nodiscard]] bool canAcceptKey(int key) const override { return key == Qt::Key_Tab; } }; #endif //SWAYMUX_TOGGLEDETAILSKEYLISTENER_H