2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-10-19 14:46:58 +00:00

Added ability to paste login code from clipboard to new code input.

This commit is contained in:
23rd
2023-11-28 06:57:55 +03:00
committed by John Preston
parent ac8117a6d8
commit 9f0b4bc799
2 changed files with 36 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
namespace Ui {
class CodeDigit;
class PopupMenu;
class CodeInput final : public Ui::RpWidget {
public:
@@ -31,10 +32,12 @@ protected:
void focusOutEvent(QFocusEvent *e) override;
void paintEvent(QPaintEvent *e) override;
void keyPressEvent(QKeyEvent *e) override;
void contextMenuEvent(QContextMenuEvent *e) override;
private:
[[nodiscard]] QString collectDigits() const;
void insertCodeAndSubmit(const QString &code);
void unfocusAll(int except);
void findEmptyAndPerform(const Fn<void(int)> &callback);
@@ -42,6 +45,8 @@ private:
std::vector<not_null<CodeDigit*>> _digits;
int _currentIndex = 0;
base::unique_qptr<Ui::PopupMenu> _menu;
rpl::event_stream<QString> _codeCollected;
};