comparison style/ThornStyle.h @ 668:dac3781826da thorn-cpp

Experimental branch based on Thorn C++ code from RG
author Chris Cannam
date Tue, 30 Apr 2019 11:36:38 +0100
parents
children
comparison
equal deleted inserted replaced
667:31ea416fea3c 668:dac3781826da
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Vect
5 An experimental audio player for plural recordings of a work
6 Centre for Digital Music, Queen Mary, University of London.
7
8 This file is taken from Rosegarden, a MIDI and audio sequencer and
9 musical notation editor. Copyright 2000-2018 the Rosegarden
10 development team. Thorn style developed in stylesheet form by
11 D. Michael McIntyre and reimplemented as a class by David Faure.
12
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version. See the file
17 COPYING included with this distribution for more information.
18 */
19
20 #ifndef SV_THORN_STYLE_H
21 #define SV_THORN_STYLE_H
22
23 #include <QProxyStyle>
24 #include <QIcon>
25
26 class ThornStyle : public QProxyStyle
27 {
28 Q_OBJECT
29
30 public:
31 ThornStyle();
32 ~ThornStyle() override;
33
34 static void setEnabled(bool b);
35 static bool isEnabled();
36
37 QPalette standardPalette() const override;
38
39 int styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override;
40 int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget = nullptr) const override;
41
42 void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = nullptr) const override;
43 void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = nullptr) const override;
44 void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = nullptr) const override;
45
46 QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget = nullptr) const override;
47
48 QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget = nullptr) const override;
49 QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget = nullptr) const override;
50
51 QIcon standardIcon(StandardPixmap standardIcon,
52 const QStyleOption * option = nullptr,
53 const QWidget * widget = nullptr) const override;
54
55 private:
56 QSize pixmapSize(const QPixmap &pixmap) const;
57
58 QPalette m_standardPalette;
59
60 QPixmap m_horizontalToolbarSeparatorPixmap;
61 QPixmap m_verticalToolbarSeparatorPixmap;
62 QPixmap m_checkboxUncheckedPixmap;
63 QPixmap m_checkboxUncheckedHoverPixmap;
64 QPixmap m_checkboxUncheckedDisabledPixmap;
65 QPixmap m_checkboxUncheckedPressedPixmap;
66 QPixmap m_checkboxCheckedPixmap;
67 QPixmap m_checkboxCheckedHoverPixmap;
68 QPixmap m_checkboxCheckedDisabledPixmap;
69 QPixmap m_checkboxCheckedPressedPixmap;
70 QPixmap m_checkboxIndeterminatePixmap;
71 QPixmap m_checkboxIndeterminateHoverPixmap;
72 //QPixmap m_checkboxIndeterminateDisabledPixmap;
73 QPixmap m_checkboxIndeterminatePressedPixmap;
74 QPixmap m_radiobuttonUncheckedPixmap;
75 QPixmap m_radiobuttonUncheckedHoverPixmap;
76 QPixmap m_radiobuttonUncheckedDisabledPixmap;
77 QPixmap m_radiobuttonUncheckedPressedPixmap;
78 QPixmap m_radiobuttonCheckedPixmap;
79 QPixmap m_radiobuttonCheckedHoverPixmap;
80 QPixmap m_radiobuttonCheckedDisabledPixmap;
81 QPixmap m_radiobuttonCheckedPressedPixmap;
82 QPixmap m_arrowDownSmallPixmap;
83 QPixmap m_arrowDownSmallInvertedPixmap;
84 QPixmap m_arrowUpSmallPixmap;
85 QPixmap m_arrowUpSmallInvertedPixmap;
86 QPixmap m_arrowLeftPixmap;
87 QPixmap m_arrowRightPixmap;
88 QPixmap m_arrowUpPixmap;
89 QPixmap m_arrowDownPixmap;
90 QPixmap m_spinupPixmap;
91 QPixmap m_spinupHoverPixmap;
92 QPixmap m_spinupOffPixmap;
93 QPixmap m_spinupPressedPixmap;
94 QPixmap m_spindownPixmap;
95 QPixmap m_spindownHoverPixmap;
96 QPixmap m_spindownOffPixmap;
97 QPixmap m_spindownPressedPixmap;
98 QPixmap m_titleClosePixmap;
99 QPixmap m_titleUndockPixmap;
100 };
101
102 #endif