added filtering to general page and greying out some items to the other

pages
This commit is contained in:
fourtf
2019-09-01 23:23:20 +02:00
parent 37dd66f7ad
commit 0b49f696ce
7 changed files with 175 additions and 45 deletions
@@ -8,8 +8,35 @@
#include "singletons/Settings.hpp"
#define SETTINGS_PAGE_WIDGET_BOILERPLATE(type, parent) \
class type : public parent \
{ \
using parent::parent; \
\
public: \
bool greyedOut{}; \
\
protected: \
void paintEvent(QPaintEvent *e) override \
{ \
parent::paintEvent(e); \
\
if (this->greyedOut) \
{ \
QPainter painter(this); \
QColor color = QColor("#222222"); \
color.setAlphaF(0.7); \
painter.fillRect(this->rect(), color); \
} \
} \
};
namespace chatterino {
SETTINGS_PAGE_WIDGET_BOILERPLATE(SCheckBox, QCheckBox)
SETTINGS_PAGE_WIDGET_BOILERPLATE(SLabel, QLabel)
SETTINGS_PAGE_WIDGET_BOILERPLATE(SComboBox, QComboBox)
class SettingsDialogTab;
class SettingsPage : public QFrame
@@ -22,6 +49,8 @@ public:
const QString &getName();
const QString &getIconResource();
virtual void filterElements(const QString &query);
SettingsDialogTab *tab() const;
void setTab(SettingsDialogTab *tab);