passport_panel_password.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "ui/rp_widget.h"
  9. #include "base/object_ptr.h"
  10. namespace Ui {
  11. class PasswordInput;
  12. class FlatLabel;
  13. class LinkButton;
  14. class RoundButton;
  15. class UserpicButton;
  16. class VerticalLayout;
  17. } // namespace Ui
  18. namespace Passport {
  19. class PanelController;
  20. class PanelAskPassword : public Ui::RpWidget {
  21. public:
  22. PanelAskPassword(
  23. QWidget *parent,
  24. not_null<PanelController*> controller);
  25. void submit();
  26. protected:
  27. void resizeEvent(QResizeEvent *e) override;
  28. void focusInEvent(QFocusEvent *e) override;
  29. private:
  30. void updateControlsGeometry();
  31. void showError(const QString &error);
  32. void hideError();
  33. void recover();
  34. not_null<PanelController*> _controller;
  35. object_ptr<Ui::UserpicButton> _userpic;
  36. object_ptr<Ui::FlatLabel> _about1;
  37. object_ptr<Ui::FlatLabel> _about2;
  38. object_ptr<Ui::PasswordInput> _password;
  39. object_ptr<Ui::FlatLabel> _hint = { nullptr };
  40. object_ptr<Ui::FlatLabel> _error = { nullptr };
  41. object_ptr<Ui::RoundButton> _submit;
  42. object_ptr<Ui::LinkButton> _forgot;
  43. };
  44. class PanelNoPassword : public Ui::RpWidget {
  45. public:
  46. PanelNoPassword(
  47. QWidget *parent,
  48. not_null<PanelController*> controller);
  49. private:
  50. void setupContent();
  51. void refreshBottom();
  52. not_null<PanelController*> _controller;
  53. not_null<Ui::VerticalLayout*> _inner;
  54. base::unique_qptr<Ui::RpWidget> _about;
  55. };
  56. } // namespace Passport