LmmsPalette.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * LmmsPalette.h - dummy class for fetching palette qproperties from CSS
  3. *
  4. *
  5. * Copyright (c) 2007-2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
  6. *
  7. * This file is part of LMMS - https://lmms.io
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2 of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public
  20. * License along with this program (see COPYING); if not, write to the
  21. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  22. * Boston, MA 02110-1301 USA.
  23. *
  24. */
  25. #include <QWidget>
  26. #include "export.h"
  27. #ifndef LMMSPALETTE_H
  28. #define LMMSPALETTE_H
  29. class EXPORT LmmsPalette : public QWidget
  30. {
  31. Q_OBJECT
  32. Q_PROPERTY( QColor background READ background WRITE setBackground )
  33. Q_PROPERTY( QColor windowText READ windowText WRITE setWindowText )
  34. Q_PROPERTY( QColor base READ base WRITE setBase )
  35. Q_PROPERTY( QColor text READ text WRITE setText )
  36. Q_PROPERTY( QColor button READ button WRITE setButton )
  37. Q_PROPERTY( QColor shadow READ shadow WRITE setShadow )
  38. Q_PROPERTY( QColor buttonText READ buttonText WRITE setButtonText )
  39. Q_PROPERTY( QColor brightText READ brightText WRITE setBrightText )
  40. Q_PROPERTY( QColor highlight READ highlight WRITE setHighlight )
  41. Q_PROPERTY( QColor highlightedText READ highlightedText WRITE setHighlightedText )
  42. Q_PROPERTY( QColor toolTipText READ toolTipText WRITE setToolTipText )
  43. Q_PROPERTY( QColor toolTipBase READ toolTipBase WRITE setToolTipBase )
  44. public:
  45. LmmsPalette( QWidget * parent, QStyle * stylearg );
  46. virtual ~LmmsPalette();
  47. #define ACCESSMET( read, write ) \
  48. QColor read () const; \
  49. void write ( const QColor & c ); \
  50. ACCESSMET( background, setBackground )
  51. ACCESSMET( windowText, setWindowText )
  52. ACCESSMET( base, setBase )
  53. ACCESSMET( text, setText )
  54. ACCESSMET( button, setButton )
  55. ACCESSMET( shadow, setShadow )
  56. ACCESSMET( buttonText, setButtonText )
  57. ACCESSMET( brightText, setBrightText )
  58. ACCESSMET( highlight, setHighlight )
  59. ACCESSMET( highlightedText, setHighlightedText )
  60. ACCESSMET( toolTipText, setToolTipText )
  61. ACCESSMET( toolTipBase, setToolTipBase )
  62. #undef ACCESSMET
  63. QPalette palette() const;
  64. private:
  65. QColor m_background;
  66. QColor m_windowText;
  67. QColor m_base;
  68. QColor m_text;
  69. QColor m_button;
  70. QColor m_shadow;
  71. QColor m_buttonText;
  72. QColor m_brightText;
  73. QColor m_highlight;
  74. QColor m_highlightedText;
  75. QColor m_toolTipText;
  76. QColor m_toolTipBase;
  77. };
  78. #endif