2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Show some payment errors, focus fields.

This commit is contained in:
John Preston
2021-03-24 15:30:01 +04:00
parent 0d44736575
commit 212497413c
20 changed files with 244 additions and 130 deletions

View File

@@ -87,19 +87,24 @@ private:
};
CountrySelectBox::CountrySelectBox(QWidget*)
: _select(this, st::defaultMultiSelect, tr::lng_country_ph()) {
: CountrySelectBox(nullptr, QString(), Type::Phones) {
}
CountrySelectBox::CountrySelectBox(QWidget*, const QString &iso, Type type)
: _type(type)
, _select(this, st::defaultMultiSelect, tr::lng_country_ph()) {
, _select(this, st::defaultMultiSelect, tr::lng_country_ph())
, _ownedInner(this, type) {
if (Data::CountriesByISO2().contains(iso)) {
LastValidISO = iso;
}
}
rpl::producer<QString> CountrySelectBox::countryChosen() const {
return _inner->countryChosen();
Expects(_ownedInner != nullptr || _inner != nullptr);
return (_ownedInner
? _ownedInner.data()
: _inner.data())->countryChosen();
}
void CountrySelectBox::prepare() {
@@ -114,7 +119,7 @@ void CountrySelectBox::prepare() {
});
_inner = setInnerWidget(
object_ptr<Inner>(this, _type),
std::move(_ownedInner),
st::countriesScroll,
_select->height());