settings_main.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 "settings/settings_common_session.h"
  9. namespace Window {
  10. class Controller;
  11. class SessionController;
  12. } // namespace Window
  13. namespace Ui {
  14. class VerticalLayout;
  15. } // namespace Ui
  16. namespace Settings {
  17. void SetupLanguageButton(
  18. not_null<Window::Controller*> window,
  19. not_null<Ui::VerticalLayout*> container);
  20. bool HasInterfaceScale();
  21. void SetupInterfaceScale(
  22. not_null<Window::Controller*> window,
  23. not_null<Ui::VerticalLayout*> container,
  24. bool icon = true);
  25. void OpenFaq(base::weak_ptr<Window::SessionController> weak);
  26. class Main : public Section<Main> {
  27. public:
  28. Main(QWidget *parent, not_null<Window::SessionController*> controller);
  29. [[nodiscard]] rpl::producer<QString> title() override;
  30. void fillTopBarMenu(
  31. const Ui::Menu::MenuCallback &addAction) override;
  32. protected:
  33. void keyPressEvent(QKeyEvent *e) override;
  34. private:
  35. void setupContent(not_null<Window::SessionController*> controller);
  36. const not_null<Window::SessionController*> _controller;
  37. };
  38. } // namespace Settings