Clear up Highlight sound settings (#4194)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com> Closes https://github.com/Chatterino/chatterino2/issues/1540
This commit is contained in:
@@ -66,6 +66,20 @@ public:
|
||||
QLineEdit *createLineEdit(pajlada::Settings::Setting<QString> &setting);
|
||||
QSpinBox *createSpinBox(pajlada::Settings::Setting<int> &setting,
|
||||
int min = 0, int max = 2500);
|
||||
template <typename T>
|
||||
SLabel *createLabel(const std::function<QString(const T &)> &makeText,
|
||||
pajlada::Settings::Setting<T> &setting)
|
||||
{
|
||||
auto *label = new SLabel();
|
||||
|
||||
setting.connect(
|
||||
[label, makeText](const T &value, auto) {
|
||||
label->setText(makeText(value));
|
||||
},
|
||||
this->managedConnections_);
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
virtual void onShow()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user