tabs now grey out when the window loses focus
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "widgets/notebook.hpp"
|
||||
#include "widgets/notebooktab.hpp"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QHBoxLayout>
|
||||
#include <QMimeData>
|
||||
@@ -364,15 +365,17 @@ void NotebookPage::paintEvent(QPaintEvent *)
|
||||
if (this->ui.hbox.count() == 0) {
|
||||
painter.fillRect(rect(), this->colorScheme.ChatBackground);
|
||||
|
||||
painter.fillRect(0, 0, width(), 2, this->colorScheme.TabSelectedBackground);
|
||||
|
||||
painter.setPen(this->colorScheme.Text);
|
||||
painter.drawText(rect(), "Add Chat", QTextOption(Qt::AlignCenter));
|
||||
} else {
|
||||
painter.fillRect(rect(), this->colorScheme.ChatSeperator);
|
||||
|
||||
painter.fillRect(0, 0, width(), 2, this->colorScheme.TabSelectedBackground);
|
||||
}
|
||||
|
||||
QColor accentColor = (QApplication::activeWindow() == this->window()
|
||||
? this->colorScheme.TabSelectedBackground
|
||||
: this->colorScheme.TabSelectedUnfocusedBackground);
|
||||
|
||||
painter.fillRect(0, 0, width(), 2, accentColor);
|
||||
}
|
||||
|
||||
void NotebookPage::showEvent(QShowEvent *event)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QPainter>
|
||||
#include <QApplication>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
@@ -154,8 +155,13 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
||||
QColor fg = QColor(0, 0, 0);
|
||||
|
||||
if (this->selected) {
|
||||
painter.fillRect(rect(), this->colorScheme.TabSelectedBackground);
|
||||
fg = this->colorScheme.TabSelectedText;
|
||||
if (this->window() == QApplication::activeWindow()) {
|
||||
painter.fillRect(rect(), this->colorScheme.TabSelectedBackground);
|
||||
fg = this->colorScheme.TabSelectedText;
|
||||
} else {
|
||||
painter.fillRect(rect(), this->colorScheme.TabSelectedUnfocusedBackground);
|
||||
fg = this->colorScheme.TabSelectedUnfocusedText;
|
||||
}
|
||||
} else if (this->mouseOver) {
|
||||
painter.fillRect(rect(), this->colorScheme.TabHoverBackground);
|
||||
fg = this->colorScheme.TabHoverText;
|
||||
|
||||
Reference in New Issue
Block a user