fixed notebook button colors

This commit is contained in:
fourtf 2017-08-05 17:01:02 +02:00
parent 64211268ba
commit 2dea2265ef
3 changed files with 13 additions and 13 deletions

View file

@ -29,6 +29,10 @@ public:
void setMouseEffectColor(QColor color); void setMouseEffectColor(QColor color);
protected: protected:
bool selected = false;
bool mouseOver = false;
bool mouseDown = false;
virtual void paintEvent(QPaintEvent *) override; virtual void paintEvent(QPaintEvent *) override;
virtual void enterEvent(QEvent *) override; virtual void enterEvent(QEvent *) override;
virtual void leaveEvent(QEvent *) override; virtual void leaveEvent(QEvent *) override;
@ -39,9 +43,6 @@ protected:
void fancyPaint(QPainter &painter); void fancyPaint(QPainter &painter);
private: private:
bool selected = false;
bool mouseOver = false;
bool mouseDown = false;
QPoint mousePos; QPoint mousePos;
double hoverMultiplier = 0.0; double hoverMultiplier = 0.0;
QTimer effectTimer; QTimer effectTimer;

View file

@ -23,16 +23,17 @@ void NotebookButton::paintEvent(QPaintEvent *)
QColor background; QColor background;
QColor foreground; QColor foreground;
if (mouseDown) { background = this->colorScheme.TabPanelBackground;
background = this->colorScheme.TabSelectedBackground;
foreground = this->colorScheme.TabSelectedText; if (mouseDown) {
//background = this->colorScheme.TabSelectedBackground;
foreground = this->colorScheme.TabHoverText;
} else if (mouseOver) { } else if (mouseOver) {
background = this->colorScheme.TabHoverBackground; //background = this->colorScheme.TabHoverText;
foreground = this->colorScheme.TabSelectedBackground; foreground = this->colorScheme.TabHoverText;
} else { } else {
background = this->colorScheme.TabPanelBackground; //background = this->colorScheme.TabPanelBackground;
// foreground = this->colorScheme.TabSelectedBackground; foreground = QColor(70, 80, 80);
foreground = QColor(230, 230, 230);
} }
painter.setPen(Qt::NoPen); painter.setPen(Qt::NoPen);

View file

@ -28,8 +28,6 @@ signals:
void clicked(); void clicked();
private: private:
bool mouseOver = false;
bool mouseDown = false;
QPoint mousePos; QPoint mousePos;
}; };