2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-03 16:05:57 +00:00

Generalize Checkbox layout.

Now any Checkbox can have Check, Radio or Toggle layout.
Radiobutton is now a subclass of Checkbox with default Radio layout.
This commit is contained in:
John Preston
2017-07-07 14:16:37 +03:00
parent 0ecef54e2b
commit 21d2f6a44f
18 changed files with 408 additions and 350 deletions

View File

@@ -85,9 +85,9 @@ void BlockWidget::rowHeightUpdated() {
}
}
void BlockWidget::createChildRow(object_ptr<Ui::Checkbox> &child, style::margins &margin, const QString &text, const char *slot, bool checked) {
void BlockWidget::createChildRow(object_ptr<Ui::Checkbox> &child, style::margins &margin, const QString &text, base::lambda<void(bool checked)> callback, bool checked) {
child.create(this, text, checked, st::defaultBoxCheckbox);
connect(child, SIGNAL(changed()), this, slot);
subscribe(child->checkedChanged, std::move(callback));
}
void BlockWidget::createChildRow(object_ptr<Ui::LinkButton> &child, style::margins &margin, const QString &text, const char *slot, const style::LinkButton &st) {