diff --git a/.gitignore b/.gitignore index 56d32f292..59380624a 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,6 @@ Session.vim *~ # Vim Auto-generated tag files tags + +# rapidjson directory +rapidjson/* diff --git a/src/colorscheme.cpp b/src/colorscheme.cpp index 108a986eb..36f1d3970 100644 --- a/src/colorscheme.cpp +++ b/src/colorscheme.cpp @@ -62,7 +62,7 @@ void ColorScheme::setColors(double hue, double multiplier) SystemMessageColor = QColor(140, 127, 127); auto getColor = [multiplier](double h, double s, double l, double a = 1.0) { - return QColor::fromHslF(h, s, (((l - 0.5) * multiplier) + 0.5), a); + return QColor::fromHslF(h, s, ((l - 0.5) * multiplier) + 0.5, a); }; DropPreviewBackground = getColor(hue, 0.5, 0.5, 0.6); @@ -71,26 +71,29 @@ void ColorScheme::setColors(double hue, double multiplier) TextLink = lightTheme ? QColor(66, 134, 244) : QColor(66, 134, 244); // tab - if (hasDarkBorder) { - // TabPanelBackground = getColor(hue, 0, 0.8); - // TabBackground = getColor(hue, 0, 0.8); - // TabHoverBackground = getColor(hue, 0, 0.8); - } else { - TabPanelBackground = QColor(255, 255, 255); - TabBackground = QColor(255, 255, 255); - TabHoverBackground = getColor(hue, 0, 0.05); - } - TabSelectedBackground = getColor(hue, 0.5, 0.5); - TabHighlightedBackground = getColor(hue, 0.5, 0.2); - TabNewMessageBackground = QBrush(getColor(hue, 0.5, 0.2), Qt::DiagCrossPattern); - if (hasDarkBorder) { - // TabText = QColor(210, 210, 210); - // TabHoverText = QColor(210, 210, 210); + if (true) { TabText = QColor(0, 0, 0); + TabBackground = QColor(255, 255, 255); + + TabHoverText = QColor(0, 0, 0); + TabHoverBackground = getColor(hue, 0, 0.05); + } else { + // Ubuntu style + // TODO: add setting for this + TabText = QColor(210, 210, 210); + TabBackground = QColor(61, 60, 56); + + TabHoverText = QColor(210, 210, 210); + TabHoverBackground = QColor(73, 72, 68); } - TabHoverText = QColor(0, 0, 0); + TabSelectedText = QColor(255, 255, 255); + TabSelectedBackground = getColor(hue, 0.5, 0.5); + TabHighlightedText = QColor(0, 0, 0); + TabHighlightedBackground = getColor(hue, 0.5, 0.2); + + TabNewMessageBackground = QBrush(getColor(hue, 0.5, 0.2), Qt::DiagCrossPattern); // Chat ChatBackground = getColor(0, 0.1, 1); @@ -98,7 +101,9 @@ void ColorScheme::setColors(double hue, double multiplier) ChatHeaderBorder = getColor(0, 0.1, 0.85); ChatInputBackground = getColor(0, 0.1, 0.95); ChatInputBorder = getColor(0, 0.1, 0.9); + ChatSeperator = lightTheme ? QColor(127, 127, 127) : QColor(80, 80, 80); + // Scrollbar ScrollbarBG = ChatBackground; ScrollbarThumb = getColor(0, 0.1, 0.85); ScrollbarThumbSelected = getColor(0, 0.1, 0.7); @@ -115,16 +120,17 @@ void ColorScheme::setColors(double hue, double multiplier) void ColorScheme::normalizeColor(QColor &color) { if (this->lightTheme) { + // TODO: write some codes } else { if (color.lightnessF() < 0.5f) { color.setHslF(color.hueF(), color.saturationF(), 0.5f); } if (color.lightnessF() < 0.6f && color.hueF() > 0.54444 && color.hueF() < 0.83333) { - color.setHslF( - color.hueF(), color.saturationF(), - color.lightnessF() + sin((color.hueF() - 0.54444) / (0.8333 - 0.54444) * 3.14159) * - color.saturationF() * 0.2); + color.setHslF(color.hueF(), color.saturationF(), + color.lightnessF() + + sin((color.hueF() - 0.54444) / (0.8333 - 0.54444) * 3.14159) * + color.saturationF() * 0.2); } } } diff --git a/src/colorscheme.hpp b/src/colorscheme.hpp index 13e59c045..2a49f9643 100644 --- a/src/colorscheme.hpp +++ b/src/colorscheme.hpp @@ -27,6 +27,7 @@ public: QColor TooltipBackground; QColor TooltipText; + QColor ChatSeperator; QColor ChatBackground; QColor ChatBackgroundHighlighted; @@ -55,16 +56,19 @@ public: QColor ScrollbarThumbSelected; QColor ScrollbarArrow; - QColor TabPanelBackground; - QColor TabBackground; - QColor TabHoverBackground; - QColor TabSelectedBackground; - QColor TabHighlightedBackground; - QBrush TabNewMessageBackground; QColor TabText; + QColor TabBackground; + QColor TabHoverText; + QColor TabHoverBackground; + QColor TabSelectedText; + QColor TabSelectedBackground; + QColor TabHighlightedText; + QColor TabHighlightedBackground; + + QBrush TabNewMessageBackground; const int HighlightColorCount = 3; QColor HighlightColors[3]; diff --git a/src/widgets/mainwindow.cpp b/src/widgets/mainwindow.cpp index b3f2371dd..a35e07239 100644 --- a/src/widgets/mainwindow.cpp +++ b/src/widgets/mainwindow.cpp @@ -169,7 +169,7 @@ void MainWindow::closeEvent(QCloseEvent *) void MainWindow::refreshTheme() { QPalette palette; - palette.setColor(QPalette::Background, this->colorScheme.TabPanelBackground); + palette.setColor(QPalette::Background, this->colorScheme.TabBackground); this->setPalette(palette); } diff --git a/src/widgets/notebookbutton.cpp b/src/widgets/notebookbutton.cpp index 65fbab1b0..7058be91e 100644 --- a/src/widgets/notebookbutton.cpp +++ b/src/widgets/notebookbutton.cpp @@ -23,7 +23,7 @@ void NotebookButton::paintEvent(QPaintEvent *) QColor background; QColor foreground; - background = this->colorScheme.TabPanelBackground; + background = this->colorScheme.TabBackground; if (mouseDown) { // background = this->colorScheme.TabSelectedBackground; diff --git a/src/widgets/notebookpage.cpp b/src/widgets/notebookpage.cpp index edc73eb90..e5121f625 100644 --- a/src/widgets/notebookpage.cpp +++ b/src/widgets/notebookpage.cpp @@ -369,8 +369,7 @@ void NotebookPage::paintEvent(QPaintEvent *) painter.setPen(this->colorScheme.Text); painter.drawText(rect(), "Add Chat", QTextOption(Qt::AlignCenter)); } else { - // painter.fillRect(rect(), this->colorScheme.TabSelectedBackground); - painter.fillRect(rect(), QColor(127, 127, 127)); + painter.fillRect(rect(), this->colorScheme.ChatSeperator); painter.fillRect(0, 0, width(), 2, this->colorScheme.TabSelectedBackground); }