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.

68 lines
2.6KB

  1. /*
  2. * Carla Qt4 Style, based on Qt5 fusion style
  3. * Copyright (C) 2013 Filipe Coelho <falktx@falktx.com>
  4. * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 3 of
  9. * the License, or any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * For a full copy of the GNU General Public License see the GPL3.txt file
  17. */
  18. #ifndef __CARLA_STYLE_HPP__
  19. #define __CARLA_STYLE_HPP__
  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();
  33. QPalette standardPalette() const;
  34. void drawPrimitive(PrimitiveElement elem,
  35. const QStyleOption *option,
  36. QPainter *painter, const QWidget *widget = 0) const;
  37. void drawControl(ControlElement ce, const QStyleOption *option, QPainter *painter,
  38. const QWidget *widget) const;
  39. int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const;
  40. void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
  41. QPainter *painter, const QWidget *widget) const;
  42. QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const;
  43. QSize sizeFromContents(ContentsType type, const QStyleOption *option,
  44. const QSize &size, const QWidget *widget) const;
  45. QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
  46. SubControl sc, const QWidget *widget) const;
  47. int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0,
  48. QStyleHintReturn *returnData = 0) const;
  49. void drawItemText(QPainter *painter, const QRect &rect,
  50. int flags, const QPalette &pal, bool enabled,
  51. const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const;
  52. void polish(QWidget *widget);
  53. void unpolish(QWidget *widget);
  54. private:
  55. CarlaStylePrivate* const d;
  56. friend class CarlaStylePrivate;
  57. };
  58. #endif // __CARLA_STYLE_HPP__