slider_natural_width.h 595 B

1234567891011121314151617181920212223242526272829
  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/widgets/discrete_sliders.h"
  9. namespace Ui {
  10. class CustomWidthSlider final : public SettingsSlider {
  11. public:
  12. using Ui::SettingsSlider::SettingsSlider;
  13. void setNaturalWidth(int w) {
  14. _naturalWidth = w;
  15. }
  16. int naturalWidth() const override {
  17. return _naturalWidth;
  18. }
  19. private:
  20. int _naturalWidth = 0;
  21. };
  22. } // namespace Ui