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