mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 23:27:09 +02:00
Slightly improved input of phone code in PhoneWidget.
This commit is contained in:
parent
e0cba40410
commit
1d21c2ca8f
3 changed files with 14 additions and 9 deletions
|
@ -146,6 +146,16 @@ void PhoneWidget::submit() {
|
|||
return;
|
||||
}
|
||||
|
||||
{
|
||||
const auto hasCodeButWaitingPhone = _code->hasFocus()
|
||||
&& (_code->getLastText().size() > 1)
|
||||
&& _phone->getLastText().isEmpty();
|
||||
if (hasCodeButWaitingPhone) {
|
||||
_phone->hideError();
|
||||
_phone->setFocus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
const auto phone = fullNumber();
|
||||
if (!AllowPhoneAttempt(phone)) {
|
||||
showPhoneError(tr::lng_bad_phone());
|
||||
|
|
|
@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "styles/style_layers.h"
|
||||
#include "styles/style_boxes.h"
|
||||
#include "styles/style_intro.h"
|
||||
#include "styles/style_widgets.h"
|
||||
|
||||
CountryInput::CountryInput(
|
||||
QWidget *parent,
|
||||
|
|
|
@ -8,11 +8,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#pragma once
|
||||
|
||||
#include "ui/rp_widget.h"
|
||||
#include "styles/style_widgets.h"
|
||||
|
||||
namespace Data {
|
||||
struct Info;
|
||||
} // namespace Data
|
||||
namespace style {
|
||||
struct InputField;
|
||||
} // namespace style
|
||||
|
||||
namespace Countries {
|
||||
struct Info;
|
||||
|
@ -22,11 +21,6 @@ namespace Window {
|
|||
class Show;
|
||||
} // namespace Window
|
||||
|
||||
namespace Ui {
|
||||
class MultiSelect;
|
||||
class RippleAnimation;
|
||||
} // namespace Ui
|
||||
|
||||
class CountryInput : public Ui::RpWidget {
|
||||
|
||||
public:
|
||||
|
|
Loading…
Add table
Reference in a new issue