mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const auto hasCodeButWaitingPhone = _code->hasFocus()
|
||||||
|
&& (_code->getLastText().size() > 1)
|
||||||
|
&& _phone->getLastText().isEmpty();
|
||||||
|
if (hasCodeButWaitingPhone) {
|
||||||
|
_phone->hideError();
|
||||||
|
_phone->setFocus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
const auto phone = fullNumber();
|
const auto phone = fullNumber();
|
||||||
if (!AllowPhoneAttempt(phone)) {
|
if (!AllowPhoneAttempt(phone)) {
|
||||||
showPhoneError(tr::lng_bad_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_layers.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
#include "styles/style_intro.h"
|
#include "styles/style_intro.h"
|
||||||
|
#include "styles/style_widgets.h"
|
||||||
|
|
||||||
CountryInput::CountryInput(
|
CountryInput::CountryInput(
|
||||||
QWidget *parent,
|
QWidget *parent,
|
||||||
|
|
|
@ -8,11 +8,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ui/rp_widget.h"
|
#include "ui/rp_widget.h"
|
||||||
#include "styles/style_widgets.h"
|
|
||||||
|
|
||||||
namespace Data {
|
namespace style {
|
||||||
struct Info;
|
struct InputField;
|
||||||
} // namespace Data
|
} // namespace style
|
||||||
|
|
||||||
namespace Countries {
|
namespace Countries {
|
||||||
struct Info;
|
struct Info;
|
||||||
|
@ -22,11 +21,6 @@ namespace Window {
|
||||||
class Show;
|
class Show;
|
||||||
} // namespace Window
|
} // namespace Window
|
||||||
|
|
||||||
namespace Ui {
|
|
||||||
class MultiSelect;
|
|
||||||
class RippleAnimation;
|
|
||||||
} // namespace Ui
|
|
||||||
|
|
||||||
class CountryInput : public Ui::RpWidget {
|
class CountryInput : public Ui::RpWidget {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Reference in a new issue