summaryrefslogtreecommitdiffstats
path: root/src/ui/Theme.h
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-17 16:37:25 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-17 16:37:25 +0300
commit0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a (patch)
tree21f655d30630fe77ba48d07e4b357e2b6c6a5730 /src/ui/Theme.h
parent96a2c614bfb60d99bc9629f73fe1707df505ce2d (diff)
Move all files under src/
Diffstat (limited to 'src/ui/Theme.h')
-rw-r--r--src/ui/Theme.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/src/ui/Theme.h b/src/ui/Theme.h
new file mode 100644
index 00000000..7a0bdcb7
--- /dev/null
+++ b/src/ui/Theme.h
@@ -0,0 +1,97 @@
+#pragma once
+
+#include <QColor>
+#include <QHash>
+#include <QObject>
+
+namespace ui {
+enum class AvatarType
+{
+ Icon,
+ Image,
+ Letter
+};
+
+namespace sidebar {
+static const int SmallSize = 60;
+static const int NormalSize = 260;
+static const int CommunitiesSidebarSize = 48;
+}
+// Default font size.
+const int FontSize = 16;
+
+// Default avatar size. Width and height.
+const int AvatarSize = 40;
+
+enum class ButtonPreset
+{
+ FlatPreset,
+ CheckablePreset
+};
+
+enum class RippleStyle
+{
+ CenteredRipple,
+ PositionedRipple,
+ NoRipple
+};
+
+enum class OverlayStyle
+{
+ NoOverlay,
+ TintedOverlay,
+ GrayOverlay
+};
+
+enum class Role
+{
+ Default,
+ Primary,
+ Secondary
+};
+
+enum class ButtonIconPlacement
+{
+ LeftIcon,
+ RightIcon
+};
+
+enum class ProgressType
+{
+ DeterminateProgress,
+ IndeterminateProgress
+};
+
+enum class Color
+{
+ Black,
+ BrightWhite,
+ FadedWhite,
+ MediumWhite,
+ DarkGreen,
+ LightGreen,
+ BrightGreen,
+ Gray,
+ Red,
+ Blue,
+ Transparent
+};
+
+} // namespace ui
+
+class Theme : public QObject
+{
+ Q_OBJECT
+public:
+ explicit Theme(QObject *parent = 0);
+
+ QColor getColor(const QString &key) const;
+
+ void setColor(const QString &key, const QColor &color);
+ void setColor(const QString &key, ui::Color color);
+
+private:
+ QColor rgba(int r, int g, int b, qreal a) const;
+
+ QHash<QString, QColor> colors_;
+};