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.
nheko/include/ui/Theme.h

98 lines
1.5 KiB

#pragma once
8 years ago
#include <QColor>
#include <QHash>
#include <QObject>
namespace ui {
enum class AvatarType
8 years ago
{
Icon,
Image,
Letter
};
8 years ago
namespace sidebar {
static const int SmallSize = 60;
static const int NormalSize = 300;
static const int CommunitiesSidebarSize = 64;
8 years ago
}
8 years ago
// Default font size.
const int FontSize = 16;
// Default avatar size. Width and height.
const int AvatarSize = 40;
enum class ButtonPreset
{
FlatPreset,
CheckablePreset
};
8 years ago
enum class RippleStyle
{
CenteredRipple,
PositionedRipple,
NoRipple
};
8 years ago
enum class OverlayStyle
{
NoOverlay,
TintedOverlay,
GrayOverlay
};
8 years ago
enum class Role
{
Default,
Primary,
Secondary
};
8 years ago
enum class ButtonIconPlacement
{
LeftIcon,
RightIcon
};
8 years ago
enum class ProgressType
{
DeterminateProgress,
IndeterminateProgress
};
8 years ago
enum class Color
{
Black,
BrightWhite,
FadedWhite,
MediumWhite,
DarkGreen,
LightGreen,
BrightGreen,
Gray,
Red,
Blue,
Transparent
8 years ago
};
} // namespace ui
8 years ago
class Theme : public QObject
{
Q_OBJECT
8 years ago
public:
explicit Theme(QObject *parent = 0);
8 years ago
QColor getColor(const QString &key) const;
8 years ago
void setColor(const QString &key, const QColor &color);
void setColor(const QString &key, ui::Color color);
8 years ago
private:
QColor rgba(int r, int g, int b, qreal a) const;
8 years ago
QHash<QString, QColor> colors_;
8 years ago
};