hemirt BabyRage

This commit is contained in:
fourtf
2016-12-30 19:20:04 +01:00
parent 6408bd249c
commit 4d1a0dd343
4 changed files with 70 additions and 7 deletions
+4 -2
View File
@@ -29,13 +29,15 @@ SOURCES += main.cpp\
notebook.cpp \ notebook.cpp \
notebooktab.cpp \ notebooktab.cpp \
notebookpage.cpp \ notebookpage.cpp \
notebookbutton.cpp notebookbutton.cpp \
colorscheme.cpp
HEADERS += mainwindow.h \ HEADERS += mainwindow.h \
chatwidget.h \ chatwidget.h \
notebook.h \ notebook.h \
notebooktab.h \ notebooktab.h \
notebookpage.h \ notebookpage.h \
notebookbutton.h notebookbutton.h \
colorscheme.h
FORMS += FORMS +=
+13 -1
View File
@@ -1,6 +1,18 @@
#include "QColor"
#include "colorscheme.h" #include "colorscheme.h"
ColorScheme::ColorScheme() // hue: theme color (0 - 1)
// multiplyer: 1 = white, 0.8 = light, -0.8 dark, -1 black
void ColorScheme::makeScheme(float hue, float multiplyer)
{ {
IsLightTheme = multiplyer > 0;
auto getColor = [IsLightTheme, multiplyer] (qreal h, qreal s, qreal l) -> QColor
{
return QColor::fromHslF(h, s, (((l - 0.5) * multiplyer) + 0.5));
};
TextCaret = IsLightTheme ? QColor(0, 0, 0) : QColor(255, 255, 255);
//ChatBorder = IsLightTheme ? QColor()
} }
+48 -3
View File
@@ -1,11 +1,56 @@
#ifndef COLORSCHEME_H #ifndef COLORSCHEME_H
#define COLORSCHEME_H #define COLORSCHEME_H
#include <QColor>
class ColorScheme class ColorScheme
{ {
public: static bool IsLightTheme;
ColorScheme();
static QColor TooltipBackground;
static QColor TooltipText;
static QColor ChatSeperator;
static QColor ChatBackground;
static QColor ChatBackgroundHighlighted;
static QColor ChatBackgroundResub;
static QColor ChatBackgroundWhisper;
static QColor ChatInputOuter;
static QColor ChatInputInner;
static QColor ChatInputBorder;
static QColor ChatMessageSeperatorBorder;
static QColor ChatMessageSeperatorBorderInner;
static QColor ChatBorder;
static QColor ChatBorderFocused;
static QColor Text;
static QColor TextCaret;
static QColor TextLink;
static QColor TextFocused;
static QColor Menu;
static QColor MenuBorder;
static QColor ScrollbarBG;
static QColor ScrollbarThumb;
static QColor ScrollbarThumbSelected;
static QColor ScrollbarArrow;
static QColor TabPanelBG;
static QColor TabBG;
static QColor TabHoverBG;
static QColor TabSelectedBG;
static QColor TabHighlightedBG;
static QColor TabNewMessageBG;
static QColor TabText;
static QColor TabHoverText;
static QColor TabSelectedText;
static QColor TabHighlightedText;
static void makeScheme(float hue, float multiplyer);
private:
Colorscheme() {}
}; };
#endif // COLORSCHEME_H #endif // COLORSCHEME_H
+5 -1
View File
@@ -1,9 +1,13 @@
#include "mainwindow.h"
#include <QApplication> #include <QApplication>
#include "mainwindow.h"
#include "colorscheme.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication a(argc, argv); QApplication a(argc, argv);
//ColorScheme::makeScheme(0, -0.8);
MainWindow w; MainWindow w;
w.show(); w.show();