menu_separator.h 924 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // This file is part of Desktop App Toolkit,
  2. // a set of libraries for developing nice desktop applications.
  3. //
  4. // For license and copyright information please follow this link:
  5. // https://github.com/desktop-app/legal/blob/master/LEGAL
  6. //
  7. #pragma once
  8. #include "ui/widgets/menu/menu_item_base.h"
  9. class Painter;
  10. namespace style {
  11. struct Menu;
  12. struct MenuSeparator;
  13. } // namespace style
  14. namespace Ui::Menu {
  15. class Separator : public ItemBase {
  16. public:
  17. Separator(
  18. not_null<RpWidget*> parent,
  19. const style::Menu &st,
  20. const style::MenuSeparator &separator,
  21. not_null<QAction*> action);
  22. not_null<QAction*> action() const override;
  23. bool isEnabled() const override;
  24. protected:
  25. int contentHeight() const override;
  26. private:
  27. const int _lineWidth;
  28. const style::margins &_padding;
  29. const style::color &_fg;
  30. const style::color &_bg;
  31. const int _height;
  32. const not_null<QAction*> _action;
  33. };
  34. } // namespace Ui::Menu