Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.6KB

  1. /*
  2. * Carla Style, based on Qt5 fusion style
  3. * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
  4. * Copyright (C) 2013 Filipe Coelho <falktx@falktx.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU Lesser General Public License for more details.
  14. *
  15. * For a full copy of the license see the doc/LGPL.txt file
  16. */
  17. #ifndef CARLA_STYLE_HPP_INCLUDED
  18. #define CARLA_STYLE_HPP_INCLUDED
  19. #include "CarlaDefines.h"
  20. #include <QtCore/Qt>
  21. #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
  22. # include <QtWidgets/QCommonStyle>
  23. #else
  24. # include <QtGui/QCommonStyle>
  25. #endif
  26. class CarlaStylePrivate;
  27. class CarlaStyle : public QCommonStyle
  28. {
  29. Q_OBJECT
  30. public:
  31. CarlaStyle();
  32. ~CarlaStyle() override;
  33. QPalette standardPalette() const override;
  34. void drawPrimitive(PrimitiveElement elem, const QStyleOption* option, QPainter* painter,
  35. const QWidget* widget = nullptr) const override;
  36. void drawControl(ControlElement ce, const QStyleOption* option, QPainter* painter, const QWidget* widget) const override;
  37. int pixelMetric(PixelMetric metric, const QStyleOption* option = nullptr, const QWidget* widget = nullptr) const override;
  38. void drawComplexControl(ComplexControl control, const QStyleOptionComplex* option, QPainter* painter,
  39. const QWidget* widget) const override;
  40. QRect subElementRect(SubElement r, const QStyleOption* opt, const QWidget* widget = nullptr) const override;
  41. QSize sizeFromContents(ContentsType type, const QStyleOption* option, const QSize& size, const QWidget* widget) const override;
  42. QRect subControlRect(ComplexControl cc, const QStyleOptionComplex* opt, SubControl sc, const QWidget* widget) const override;
  43. int styleHint(StyleHint hint, const QStyleOption* option = nullptr, const QWidget* widget = nullptr,
  44. QStyleHintReturn* returnData = nullptr) const override;
  45. void drawItemText(QPainter *painter, const QRect& rect, int flags, const QPalette& pal, bool enabled, const QString& text,
  46. QPalette::ColorRole textRole = QPalette::NoRole) const override;
  47. void polish(QWidget* widget) override;
  48. void unpolish(QWidget* widget) override;
  49. private:
  50. CarlaStylePrivate* const d;
  51. friend class CarlaStylePrivate;
  52. };
  53. #endif // CARLA_STYLE_HPP_INCLUDED