From 0f89c59f136ed9fbdc61250c9c5a9fe5fba922a6 Mon Sep 17 00:00:00 2001 From: Jeremy Bullock Date: Mar 15 2017 11:48:06 +0000 Subject: Move level palette lines to qss (#1035) --- diff --git a/stuff/config/qss/gray_048/gray_048.less b/stuff/config/qss/gray_048/gray_048.less index e96e5e7..c8014ae 100644 --- a/stuff/config/qss/gray_048/gray_048.less +++ b/stuff/config/qss/gray_048/gray_048.less @@ -411,6 +411,8 @@ PaletteViewer #ToolBarContainer } } #TabBarContainer{ + qproperty-BottomAboveLineColor: rgb(120, 120, 120); + qproperty-BottomBelowLineColor: rgb(255, 255, 255); .baseBG(15%); & #ScrollLeftButton, & #ScrollRightButton{ diff --git a/stuff/config/qss/gray_048/gray_048.qss b/stuff/config/qss/gray_048/gray_048.qss index d268b93..4feae90 100644 --- a/stuff/config/qss/gray_048/gray_048.qss +++ b/stuff/config/qss/gray_048/gray_048.qss @@ -409,6 +409,8 @@ PaletteViewer #ToolBarContainer #keyFrameNavigator { border: 0px; } #TabBarContainer { + qproperty-BottomAboveLineColor: #787878; + qproperty-BottomBelowLineColor: #ffffff; background-color: #0a0a0a; } #TabBarContainer #ScrollLeftButton, diff --git a/stuff/config/qss/gray_048/gray_048_mac.qss b/stuff/config/qss/gray_048/gray_048_mac.qss index d268b93..4feae90 100644 --- a/stuff/config/qss/gray_048/gray_048_mac.qss +++ b/stuff/config/qss/gray_048/gray_048_mac.qss @@ -409,6 +409,8 @@ PaletteViewer #ToolBarContainer #keyFrameNavigator { border: 0px; } #TabBarContainer { + qproperty-BottomAboveLineColor: #787878; + qproperty-BottomBelowLineColor: #ffffff; background-color: #0a0a0a; } #TabBarContainer #ScrollLeftButton, diff --git a/stuff/config/qss/gray_072/gray_072.less b/stuff/config/qss/gray_072/gray_072.less index dd78c0a..4e2dbf0 100644 --- a/stuff/config/qss/gray_072/gray_072.less +++ b/stuff/config/qss/gray_072/gray_072.less @@ -408,6 +408,8 @@ PaletteViewer #ToolBarContainer } } #TabBarContainer{ + qproperty-BottomAboveLineColor: rgb(120, 120, 120); + qproperty-BottomBelowLineColor: rgb(255, 255, 255); .baseBG(15%); & #ScrollLeftButton, & #ScrollRightButton{ diff --git a/stuff/config/qss/gray_072/gray_072.qss b/stuff/config/qss/gray_072/gray_072.qss index 413c15a..20c7ad3 100644 --- a/stuff/config/qss/gray_072/gray_072.qss +++ b/stuff/config/qss/gray_072/gray_072.qss @@ -409,6 +409,8 @@ PaletteViewer #ToolBarContainer #keyFrameNavigator { border: 0px; } #TabBarContainer { + qproperty-BottomAboveLineColor: #787878; + qproperty-BottomBelowLineColor: #ffffff; background-color: #222222; } #TabBarContainer #ScrollLeftButton, diff --git a/stuff/config/qss/gray_072/gray_072_mac.qss b/stuff/config/qss/gray_072/gray_072_mac.qss index 413c15a..20c7ad3 100644 --- a/stuff/config/qss/gray_072/gray_072_mac.qss +++ b/stuff/config/qss/gray_072/gray_072_mac.qss @@ -409,6 +409,8 @@ PaletteViewer #ToolBarContainer #keyFrameNavigator { border: 0px; } #TabBarContainer { + qproperty-BottomAboveLineColor: #787878; + qproperty-BottomBelowLineColor: #ffffff; background-color: #222222; } #TabBarContainer #ScrollLeftButton, diff --git a/stuff/config/qss/gray_128/gray_128.less b/stuff/config/qss/gray_128/gray_128.less index 54efef5..5a46da1 100644 --- a/stuff/config/qss/gray_128/gray_128.less +++ b/stuff/config/qss/gray_128/gray_128.less @@ -248,6 +248,8 @@ PaletteViewer #ToolBarContainer } } #TabBarContainer{ + qproperty-BottomAboveLineColor: rgb(120, 120, 120); + qproperty-BottomBelowLineColor: rgb(255, 255, 255); .baseBG(15%); & #ScrollLeftButton, & #ScrollRightButton{ diff --git a/stuff/config/qss/gray_128/gray_128.qss b/stuff/config/qss/gray_128/gray_128.qss index ee3fe1e..1b3a454 100644 --- a/stuff/config/qss/gray_128/gray_128.qss +++ b/stuff/config/qss/gray_128/gray_128.qss @@ -167,6 +167,8 @@ PaletteViewer #ToolBarContainer #keyFrameNavigator { border: 0px; } #TabBarContainer { + qproperty-BottomAboveLineColor: #787878; + qproperty-BottomBelowLineColor: #ffffff; background-color: #5a5a5a; } #TabBarContainer #ScrollLeftButton, diff --git a/stuff/config/qss/gray_128/gray_128_mac.qss b/stuff/config/qss/gray_128/gray_128_mac.qss index ee3fe1e..1b3a454 100644 --- a/stuff/config/qss/gray_128/gray_128_mac.qss +++ b/stuff/config/qss/gray_128/gray_128_mac.qss @@ -167,6 +167,8 @@ PaletteViewer #ToolBarContainer #keyFrameNavigator { border: 0px; } #TabBarContainer { + qproperty-BottomAboveLineColor: #787878; + qproperty-BottomBelowLineColor: #ffffff; background-color: #5a5a5a; } #TabBarContainer #ScrollLeftButton, diff --git a/toonz/sources/include/toonzqt/gutil.h b/toonz/sources/include/toonzqt/gutil.h index a7236fd..85004b3 100644 --- a/toonz/sources/include/toonzqt/gutil.h +++ b/toonz/sources/include/toonzqt/gutil.h @@ -155,11 +155,25 @@ QPainterPath DVAPI strokeToPainterPath(TStroke *stroke); // It is also used to take 6px on the left before the tabBar class DVAPI TabBarContainter final : public QFrame { + Q_OBJECT public: TabBarContainter(QWidget *parent = 0); protected: + QColor m_bottomBelowLineColor, m_bottomAboveLineColor; + Q_PROPERTY(QColor BottomBelowLineColor READ getBottomBelowLineColor WRITE + setBottomBelowLineColor); + Q_PROPERTY(QColor BottomAboveLineColor READ getBottomAboveLineColor WRITE + setBottomAboveLineColor); void paintEvent(QPaintEvent *event) override; + void setBottomBelowLineColor(const QColor &color) { + m_bottomBelowLineColor = color; + } + QColor getBottomBelowLineColor() const { return m_bottomBelowLineColor; } + void setBottomAboveLineColor(const QColor &color) { + m_bottomAboveLineColor = color; + } + QColor getBottomAboveLineColor() const { return m_bottomAboveLineColor; } }; //----------------------------------------------------------------------------- diff --git a/toonz/sources/toonzqt/gutil.cpp b/toonz/sources/toonzqt/gutil.cpp index b996a20..5d2ff7b 100644 --- a/toonz/sources/toonzqt/gutil.cpp +++ b/toonz/sources/toonzqt/gutil.cpp @@ -374,9 +374,9 @@ TabBarContainter::TabBarContainter(QWidget *parent) : QFrame(parent) { void TabBarContainter::paintEvent(QPaintEvent *event) { QPainter p(this); - p.setPen(QColor(120, 120, 120)); + p.setPen(getBottomAboveLineColor()); p.drawLine(0, height() - 2, width(), height() - 2); - p.setPen(Qt::white); + p.setPen(getBottomBelowLineColor()); p.drawLine(0, height() - 1, width(), height() - 1); }