nheko/src/ui/Theme.h

78 lines
1.4 KiB
C
Raw Normal View History

2021-03-05 00:35:15 +01:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
2017-04-06 01:06:42 +02:00
#include <QColor>
2021-05-14 23:35:34 +02:00
#include <QPalette>
2017-04-06 01:06:42 +02:00
2017-10-15 21:08:51 +02:00
namespace ui {
2017-04-06 01:06:42 +02:00
// Default font size.
const int FontSize = 16;
// Default avatar size. Width and height.
const int AvatarSize = 40;
2017-10-15 21:08:51 +02:00
enum class ButtonPreset
{
2021-09-18 00:22:33 +02:00
FlatPreset,
CheckablePreset
2017-10-15 21:08:51 +02:00
};
2017-04-06 01:06:42 +02:00
2017-10-15 21:08:51 +02:00
enum class RippleStyle
{
2021-09-18 00:22:33 +02:00
CenteredRipple,
PositionedRipple,
NoRipple
2017-10-15 21:08:51 +02:00
};
2017-04-06 01:06:42 +02:00
2017-10-15 21:08:51 +02:00
enum class OverlayStyle
{
2021-09-18 00:22:33 +02:00
NoOverlay,
TintedOverlay,
GrayOverlay
2017-10-15 21:08:51 +02:00
};
2017-04-06 01:06:42 +02:00
2017-10-15 21:08:51 +02:00
enum class Role
{
2021-09-18 00:22:33 +02:00
Default,
Primary,
Secondary
2017-10-15 21:08:51 +02:00
};
2017-04-06 01:06:42 +02:00
2017-10-15 21:08:51 +02:00
enum class ButtonIconPlacement
{
2021-09-18 00:22:33 +02:00
LeftIcon,
RightIcon
2017-10-15 21:08:51 +02:00
};
2017-04-06 01:06:42 +02:00
2017-10-15 21:08:51 +02:00
enum class ProgressType
{
2021-09-18 00:22:33 +02:00
DeterminateProgress,
IndeterminateProgress
2017-10-15 21:08:51 +02:00
};
2017-04-06 01:06:42 +02:00
2017-08-20 12:47:22 +02:00
} // namespace ui
2017-04-06 01:06:42 +02:00
2021-05-14 23:35:34 +02:00
class Theme : public QPalette
2017-04-06 01:06:42 +02:00
{
2021-09-18 00:22:33 +02:00
Q_GADGET
Q_PROPERTY(QColor sidebarBackground READ sidebarBackground CONSTANT)
Q_PROPERTY(QColor alternateButton READ alternateButton CONSTANT)
Q_PROPERTY(QColor separator READ separator CONSTANT)
Q_PROPERTY(QColor red READ red CONSTANT)
2017-04-06 01:06:42 +02:00
public:
2021-09-18 00:22:33 +02:00
Theme() {}
explicit Theme(std::string_view theme);
static QPalette paletteFromTheme(std::string_view theme);
2017-04-06 01:06:42 +02:00
2021-09-18 00:22:33 +02:00
QColor sidebarBackground() const { return sidebarBackground_; }
QColor alternateButton() const { return alternateButton_; }
QColor separator() const { return separator_; }
QColor red() const { return red_; }
2017-04-06 01:06:42 +02:00
private:
2021-09-18 00:22:33 +02:00
QColor sidebarBackground_, separator_, red_, alternateButton_;
2017-04-06 01:06:42 +02:00
};