2024-03-09 23:44:43 +01:00
|
|
|
//
|
|
|
|
// Created by grimmauld on 09.03.24.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef SWAYMUX_PREVOUTPUTKEYLISTENER_H
|
|
|
|
#define SWAYMUX_PREVOUTPUTKEYLISTENER_H
|
|
|
|
|
|
|
|
#include <QTreeView>
|
|
|
|
#include <iostream>
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include "AbstractKeyListener.h"
|
|
|
|
#include "../tree/SwayTreeModel.h"
|
|
|
|
#include "../sway_bindings/swayoutputs.h"
|
|
|
|
#include "JumpOutputKeyListener.h"
|
|
|
|
|
|
|
|
class PrevOutputKeyListener : public JumpOutputKeyListener {
|
|
|
|
public:
|
|
|
|
explicit PrevOutputKeyListener(SwayTreeModel *swayTreeModel, QTreeView *treeView) : JumpOutputKeyListener(
|
|
|
|
swayTreeModel, treeView) {};
|
|
|
|
|
2024-03-13 21:43:57 +01:00
|
|
|
const std::string getDescription() override {
|
2024-03-09 23:44:43 +01:00
|
|
|
return "Jump focus to output above";
|
|
|
|
}
|
|
|
|
|
2024-03-13 21:43:57 +01:00
|
|
|
const std::string getKeyText() override {
|
2024-03-09 23:44:43 +01:00
|
|
|
return "Page Up";
|
|
|
|
}
|
|
|
|
|
|
|
|
[[nodiscard]] bool canAcceptKey(int key) const override {
|
|
|
|
return key == Qt::Key_PageUp;
|
|
|
|
}
|
|
|
|
|
|
|
|
int getOffset(const SwayTreeNode *selected) const override {
|
|
|
|
return selected != nullptr && selected->node.type != NodeType::output ? 0 : -1;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //SWAYMUX_PREVOUTPUTKEYLISTENER_H
|