hydrogen 1.2.3
Skin.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2024 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY, without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22#ifndef H2_SKIN_H
23#define H2_SKIN_H
24
25#include <QString>
26#include <QtGui>
28
32
33class Skin
34{
35public:
36 static QString getImagePath()
37 {
38 return H2Core::Filesystem::img_dir().append( "/gray" );
39 }
40 static QString getSvgImagePath()
41 {
42 return H2Core::Filesystem::img_dir().append( "/scalable" );
43 }
51 static QString getGlobalStyleSheet();
56 static void setPalette( QApplication *pQApp );
57
68 static void drawListBackground( QPainter* p, QRect rect, QColor background,
69 bool bHovered );
72 static QColor makeWidgetColorInactive( QColor color );
75 static QColor makeTextColorInactive( QColor color );
76
77 static constexpr int nPlayheadWidth = 11;
78 static constexpr int nPlayheadHeight = 8;
80 return std::floor( Skin::nPlayheadWidth / 2 ); }
81 static void setPlayheadPen( QPainter* p, bool bHovered = false );
82 static void drawPlayhead( QPainter* p, int x, int y, bool bHovered = false );
83
84 enum class Stacked {
85 None,
86 Off,
87 OffNext,
88 On,
89 OnNext
90 };
91
92 static void drawStackedIndicator( QPainter* p, int x, int y, Skin::Stacked stacked );
93};
94
95
96#endif
static QString img_dir()
returns gui image path
Skin support.
Definition Skin.h:34
static QString getSvgImagePath()
Definition Skin.h:40
static void setPalette(QApplication *pQApp)
Function used to update the global palette of the QApplication.
Definition Skin.cpp:106
static constexpr int nPlayheadHeight
Definition Skin.h:78
static QString getGlobalStyleSheet()
Top-level stylesheet for Hydrogen.
Definition Skin.cpp:28
static QColor makeTextColorInactive(QColor color)
If a widget is marked inactive the value of its text color are reduced by this factor.
Definition Skin.cpp:176
Stacked
Definition Skin.h:84
static void drawPlayhead(QPainter *p, int x, int y, bool bHovered=false)
Definition Skin.cpp:203
static constexpr int nPlayheadWidth
Definition Skin.h:77
static void drawListBackground(QPainter *p, QRect rect, QColor background, bool bHovered)
Draws the background of a row in both the pattern list of the SongEditor and the instrument list in t...
Definition Skin.cpp:144
static void drawStackedIndicator(QPainter *p, int x, int y, Skin::Stacked stacked)
Definition Skin.cpp:223
static void setPlayheadPen(QPainter *p, bool bHovered=false)
Definition Skin.cpp:190
static QString getImagePath()
Definition Skin.h:36
static QColor makeWidgetColorInactive(QColor color)
If a widget is marked inactive the value of its background color are reduced by this factor.
Definition Skin.cpp:167
static int getPlayheadShaftOffset()
Definition Skin.h:79