2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Pass modifiers inside InputField submitted signal.

Also use non-MOC connections for all InputFields.
Also use Ctrl/Cmd + Enter to submit fast share box.
Fixes #4769.
This commit is contained in:
John Preston
2018-05-31 15:20:28 +03:00
parent b3059248d4
commit bfc748cd31
36 changed files with 272 additions and 332 deletions

View File

@@ -125,7 +125,7 @@ void ChangePhoneBox::EnterPhone::prepare() {
_phone->resize(st::boxWidth - 2 * st::boxPadding.left(), _phone->height());
_phone->moveToLeft(st::boxPadding.left(), st::boxLittleSkip);
connect(_phone, &Ui::PhoneInput::submitted, this, [this] { submit(); });
connect(_phone, &Ui::PhoneInput::submitted, [=] { submit(); });
auto description = object_ptr<Ui::FlatLabel>(this, lang(lng_change_phone_new_description), Ui::FlatLabel::InitType::Simple, st::changePhoneLabel);
auto errorSkip = st::boxLittleSkip + st::changePhoneError.style.font->height;
@@ -225,12 +225,12 @@ void ChangePhoneBox::EnterCode::prepare() {
auto phoneValue = QString();
_code.create(this, st::defaultInputField, langFactory(lng_change_phone_code_title), phoneValue);
_code->setAutoSubmit(_codeLength, [this] { submit(); });
_code->setChangedCallback([this] { hideError(); });
_code->setAutoSubmit(_codeLength, [=] { submit(); });
_code->setChangedCallback([=] { hideError(); });
_code->resize(st::boxWidth - 2 * st::boxPadding.left(), _code->height());
_code->moveToLeft(st::boxPadding.left(), description->bottomNoMargins());
connect(_code, &Ui::InputField::submitted, this, [this] { submit(); });
connect(_code, &Ui::InputField::submitted, [=] { submit(); });
setDimensions(st::boxWidth, countHeight());
@@ -239,8 +239,8 @@ void ChangePhoneBox::EnterCode::prepare() {
updateCall();
}
addButton(langFactory(lng_change_phone_new_submit), [this] { submit(); });
addButton(langFactory(lng_cancel), [this] { closeBox(); });
addButton(langFactory(lng_change_phone_new_submit), [=] { submit(); });
addButton(langFactory(lng_cancel), [=] { closeBox(); });
}
int ChangePhoneBox::EnterCode::countHeight() {