made appbase compile standalone
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
// http://en.cppreference.com/w/cpp/algorithm/clamp
|
||||
|
||||
template <class T>
|
||||
constexpr const T &clamp(const T &v, const T &lo, const T &hi)
|
||||
{
|
||||
return assert(!(hi < lo)), (v < lo) ? lo : (hi < v) ? hi : v;
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
@@ -1,17 +0,0 @@
|
||||
#include "FunctionEventFilter.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
FunctionEventFilter::FunctionEventFilter(
|
||||
QObject *parent, std::function<bool(QObject *, QEvent *)> function)
|
||||
: QObject(parent)
|
||||
, function_(std::move(function))
|
||||
{
|
||||
}
|
||||
|
||||
bool FunctionEventFilter::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
return this->function_(watched, event);
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
@@ -1,24 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <QEvent>
|
||||
#include <QObject>
|
||||
#include <functional>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class FunctionEventFilter : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FunctionEventFilter(QObject *parent,
|
||||
std::function<bool(QObject *, QEvent *)> function);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
|
||||
private:
|
||||
std::function<bool(QObject *, QEvent *)> function_;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
Reference in New Issue
Block a user