From 2739e0d08ce0b54755d143bda5a243fda38cb949 Mon Sep 17 00:00:00 2001 From: Jeremy Bullock Date: Mar 15 2017 11:47:32 +0000 Subject: Pair field style #881 (#1034) * Moved Pair Fields to qss --- diff --git a/stuff/config/qss/gray_048/gray_048.less b/stuff/config/qss/gray_048/gray_048.less index 2772ec8..e96e5e7 100644 --- a/stuff/config/qss/gray_048/gray_048.less +++ b/stuff/config/qss/gray_048/gray_048.less @@ -1353,7 +1353,9 @@ QDialog #dialogButtonFrame { #IntPairField, #DoublePairField { qproperty-LightLineColor: rgb(155,155,155); + qproperty-LightLineEdgeColor: @m_baseBG; qproperty-DarkLineColor: rgb(47,47,47); + qproperty-MiddleLineColor: rgb(0,0,0); qproperty-HandleLeftPixmap: url("@{image_url}/h_slider_left.png"); qproperty-HandleRightPixmap: url("@{image_url}/h_slider_right.png"); qproperty-HandleLeftGrayPixmap: url("@{image_url}/h_slider_left_disabled.png"); diff --git a/stuff/config/qss/gray_048/gray_048.qss b/stuff/config/qss/gray_048/gray_048.qss index f2d76cf..d268b93 100644 --- a/stuff/config/qss/gray_048/gray_048.qss +++ b/stuff/config/qss/gray_048/gray_048.qss @@ -1350,7 +1350,9 @@ QDialog #dialogButtonFrame { #IntPairField, #DoublePairField { qproperty-LightLineColor: #9b9b9b; + qproperty-LightLineEdgeColor: #303030; qproperty-DarkLineColor: #2f2f2f; + qproperty-MiddleLineColor: #000000; qproperty-HandleLeftPixmap: url("../gray_072/imgs/h_slider_left.png"); qproperty-HandleRightPixmap: url("../gray_072/imgs/h_slider_right.png"); qproperty-HandleLeftGrayPixmap: url("../gray_072/imgs/h_slider_left_disabled.png"); diff --git a/stuff/config/qss/gray_048/gray_048_mac.qss b/stuff/config/qss/gray_048/gray_048_mac.qss index f2d76cf..d268b93 100644 --- a/stuff/config/qss/gray_048/gray_048_mac.qss +++ b/stuff/config/qss/gray_048/gray_048_mac.qss @@ -1350,7 +1350,9 @@ QDialog #dialogButtonFrame { #IntPairField, #DoublePairField { qproperty-LightLineColor: #9b9b9b; + qproperty-LightLineEdgeColor: #303030; qproperty-DarkLineColor: #2f2f2f; + qproperty-MiddleLineColor: #000000; qproperty-HandleLeftPixmap: url("../gray_072/imgs/h_slider_left.png"); qproperty-HandleRightPixmap: url("../gray_072/imgs/h_slider_right.png"); qproperty-HandleLeftGrayPixmap: url("../gray_072/imgs/h_slider_left_disabled.png"); diff --git a/stuff/config/qss/gray_072/gray_072.less b/stuff/config/qss/gray_072/gray_072.less index 20a0e95..dd78c0a 100644 --- a/stuff/config/qss/gray_072/gray_072.less +++ b/stuff/config/qss/gray_072/gray_072.less @@ -1352,7 +1352,9 @@ QDialog #dialogButtonFrame { #IntPairField, #DoublePairField { qproperty-LightLineColor: rgb(155,155,155); + qproperty-LightLineEdgeColor: @m_baseBG; qproperty-DarkLineColor: rgb(47,47,47); + qproperty-MiddleLineColor: rgb(0,0,0); qproperty-HandleLeftPixmap: url("@{image_url}/h_slider_left.png"); qproperty-HandleRightPixmap: url("@{image_url}/h_slider_right.png"); qproperty-HandleLeftGrayPixmap: url("@{image_url}/h_slider_left_disabled.png"); diff --git a/stuff/config/qss/gray_072/gray_072.qss b/stuff/config/qss/gray_072/gray_072.qss index 7ed7c34..413c15a 100644 --- a/stuff/config/qss/gray_072/gray_072.qss +++ b/stuff/config/qss/gray_072/gray_072.qss @@ -1350,7 +1350,9 @@ QDialog #dialogButtonFrame { #IntPairField, #DoublePairField { qproperty-LightLineColor: #9b9b9b; + qproperty-LightLineEdgeColor: #484848; qproperty-DarkLineColor: #2f2f2f; + qproperty-MiddleLineColor: #000000; qproperty-HandleLeftPixmap: url("imgs/h_slider_left.png"); qproperty-HandleRightPixmap: url("imgs/h_slider_right.png"); qproperty-HandleLeftGrayPixmap: url("imgs/h_slider_left_disabled.png"); diff --git a/stuff/config/qss/gray_072/gray_072_mac.qss b/stuff/config/qss/gray_072/gray_072_mac.qss index 7ed7c34..413c15a 100644 --- a/stuff/config/qss/gray_072/gray_072_mac.qss +++ b/stuff/config/qss/gray_072/gray_072_mac.qss @@ -1350,7 +1350,9 @@ QDialog #dialogButtonFrame { #IntPairField, #DoublePairField { qproperty-LightLineColor: #9b9b9b; + qproperty-LightLineEdgeColor: #484848; qproperty-DarkLineColor: #2f2f2f; + qproperty-MiddleLineColor: #000000; qproperty-HandleLeftPixmap: url("imgs/h_slider_left.png"); qproperty-HandleRightPixmap: url("imgs/h_slider_right.png"); qproperty-HandleLeftGrayPixmap: url("imgs/h_slider_left_disabled.png"); diff --git a/stuff/config/qss/gray_128/gray_128.less b/stuff/config/qss/gray_128/gray_128.less index 2254f17..54efef5 100644 --- a/stuff/config/qss/gray_128/gray_128.less +++ b/stuff/config/qss/gray_128/gray_128.less @@ -1171,7 +1171,9 @@ QDialog #dialogButtonFrame { #IntPairField, #DoublePairField { qproperty-LightLineColor: white; - qproperty-DarkLineColor: rgb(128,128,128); + qproperty-LightLineEdgeColor: white; + qproperty-DarkLineColor: rgb(198,198,198); + qproperty-MiddleLineColor: @m_baseBG; qproperty-HandleLeftPixmap: url("@{image_url}/h_slider_left.png"); qproperty-HandleRightPixmap: url("@{image_url}/h_slider_right.png"); qproperty-HandleLeftGrayPixmap: url("@{image_url}/h_slider_left_disabled.png"); diff --git a/stuff/config/qss/gray_128/gray_128.qss b/stuff/config/qss/gray_128/gray_128.qss index 2d04549..ee3fe1e 100644 --- a/stuff/config/qss/gray_128/gray_128.qss +++ b/stuff/config/qss/gray_128/gray_128.qss @@ -1080,7 +1080,9 @@ QDialog #dialogButtonFrame { #IntPairField, #DoublePairField { qproperty-LightLineColor: white; - qproperty-DarkLineColor: #808080; + qproperty-LightLineEdgeColor: white; + qproperty-DarkLineColor: #c6c6c6; + qproperty-MiddleLineColor: #808080; qproperty-HandleLeftPixmap: url("imgs/h_slider_left.png"); qproperty-HandleRightPixmap: url("imgs/h_slider_right.png"); qproperty-HandleLeftGrayPixmap: url("imgs/h_slider_left_disabled.png"); diff --git a/stuff/config/qss/gray_128/gray_128_mac.qss b/stuff/config/qss/gray_128/gray_128_mac.qss index 2d04549..ee3fe1e 100644 --- a/stuff/config/qss/gray_128/gray_128_mac.qss +++ b/stuff/config/qss/gray_128/gray_128_mac.qss @@ -1080,7 +1080,9 @@ QDialog #dialogButtonFrame { #IntPairField, #DoublePairField { qproperty-LightLineColor: white; - qproperty-DarkLineColor: #808080; + qproperty-LightLineEdgeColor: white; + qproperty-DarkLineColor: #c6c6c6; + qproperty-MiddleLineColor: #808080; qproperty-HandleLeftPixmap: url("imgs/h_slider_left.png"); qproperty-HandleRightPixmap: url("imgs/h_slider_right.png"); qproperty-HandleLeftGrayPixmap: url("imgs/h_slider_left_disabled.png"); diff --git a/toonz/sources/include/toonzqt/doublepairfield.h b/toonz/sources/include/toonzqt/doublepairfield.h index 9fcaf7f..7220cb0 100644 --- a/toonz/sources/include/toonzqt/doublepairfield.h +++ b/toonz/sources/include/toonzqt/doublepairfield.h @@ -80,9 +80,15 @@ protected: QColor m_lightLineColor; /*-- スライダ溝の明るい色(白) --*/ QColor m_darkLineColor; /*-- スライダ溝の暗い色(128,128,128) --*/ + QColor m_middleLineColor; + QColor m_lightLineEdgeColor; Q_PROPERTY( QColor LightLineColor READ getLightLineColor WRITE setLightLineColor); Q_PROPERTY(QColor DarkLineColor READ getDarkLineColor WRITE setDarkLineColor); + Q_PROPERTY( + QColor MiddleLineColor READ getMiddleLineColor WRITE setMiddleLineColor); + Q_PROPERTY(QColor LightLineEdgeColor READ getLightLineEdgeColor WRITE + setLightLineEdgeColor); DoubleValueLineEdit *m_leftLineEdit; DoubleValueLineEdit *m_rightLineEdit; @@ -143,6 +149,12 @@ public: QColor getLightLineColor() const { return m_lightLineColor; } void setDarkLineColor(const QColor &color) { m_darkLineColor = color; } QColor getDarkLineColor() const { return m_darkLineColor; } + void setMiddleLineColor(const QColor &color) { m_middleLineColor = color; } + QColor getMiddleLineColor() const { return m_middleLineColor; } + void setLightLineEdgeColor(const QColor &color) { + m_lightLineEdgeColor = color; + } + QColor getLightLineEdgeColor() const { return m_lightLineEdgeColor; } protected: /*! Return value corresponding \b x position. */ diff --git a/toonz/sources/include/toonzqt/intpairfield.h b/toonz/sources/include/toonzqt/intpairfield.h index 1d62613..c2fffa4 100644 --- a/toonz/sources/include/toonzqt/intpairfield.h +++ b/toonz/sources/include/toonzqt/intpairfield.h @@ -93,9 +93,15 @@ class DVAPI IntPairField : public QWidget { QColor m_lightLineColor; /*-- スライダ溝の明るい色(白) --*/ QColor m_darkLineColor; /*-- スライダ溝の暗い色(128,128,128) --*/ + QColor m_middleLineColor; + QColor m_lightLineEdgeColor; Q_PROPERTY( QColor LightLineColor READ getLightLineColor WRITE setLightLineColor); Q_PROPERTY(QColor DarkLineColor READ getDarkLineColor WRITE setDarkLineColor); + Q_PROPERTY( + QColor MiddleLineColor READ getMiddleLineColor WRITE setMiddleLineColor); + Q_PROPERTY(QColor LightLineEdgeColor READ getLightLineEdgeColor WRITE + setLightLineEdgeColor); QLabel *m_leftLabel, *m_rightLabel; @@ -151,6 +157,12 @@ public: QColor getLightLineColor() const { return m_lightLineColor; } void setDarkLineColor(const QColor &color) { m_darkLineColor = color; } QColor getDarkLineColor() const { return m_darkLineColor; } + void setMiddleLineColor(const QColor &color) { m_middleLineColor = color; } + QColor getMiddleLineColor() const { return m_middleLineColor; } + void setLightLineEdgeColor(const QColor &color) { + m_lightLineEdgeColor = color; + } + QColor getLightLineEdgeColor() const { return m_lightLineEdgeColor; } protected: /*! Return value corresponding \b x position. */ diff --git a/toonz/sources/toonzqt/doublepairfield.cpp b/toonz/sources/toonzqt/doublepairfield.cpp index 7a7839a..afdc2d6 100644 --- a/toonz/sources/toonzqt/doublepairfield.cpp +++ b/toonz/sources/toonzqt/doublepairfield.cpp @@ -99,16 +99,19 @@ void DoubleValuePairField::paintEvent(QPaintEvent *) { int y = height() / 2; p.setPen(getLightLineColor()); - p.drawLine(x0 - 1, y, x1 + 1, y); + p.drawLine(x0 - 1, y, x1, y); + p.setPen(getLightLineEdgeColor()); + p.drawPoint(x1 + 1, y); p.drawPoint(x1 + 1, y - 1); p.drawPoint(x1 + 1, y - 2); p.drawPoint(x1 + 1, y - 3); - p.setPen(QColor(0, 0, 0)); + p.setPen(getMiddleLineColor()); p.drawLine(x0, y - 2, x1 - 1, y - 2); p.setPen(getDarkLineColor()); p.drawLine(x0 - 1, y - 3, x1, y - 3); p.drawPoint(x0 - 1, y - 1); p.drawPoint(x0 - 1, y - 2); + p.setPen(Qt::black); int y1 = height() - 1; diff --git a/toonz/sources/toonzqt/intpairfield.cpp b/toonz/sources/toonzqt/intpairfield.cpp index 21f1d11..3d2cfe8 100644 --- a/toonz/sources/toonzqt/intpairfield.cpp +++ b/toonz/sources/toonzqt/intpairfield.cpp @@ -95,11 +95,13 @@ void IntPairField::paintEvent(QPaintEvent *) { int y = height() / 2; p.setPen(getLightLineColor()); - p.drawLine(x0 - 1, y, x1 + 1, y); + p.drawLine(x0 - 1, y, x1, y); + p.setPen(getLightLineEdgeColor()); + p.drawPoint(x1 + 1, y); p.drawPoint(x1 + 1, y - 1); p.drawPoint(x1 + 1, y - 2); p.drawPoint(x1 + 1, y - 3); - p.setPen(QColor(0, 0, 0)); + p.setPen(getMiddleLineColor()); p.drawLine(x0, y - 2, x1 - 1, y - 2); p.setPen(getDarkLineColor()); p.drawLine(x0 - 1, y - 3, x1, y - 3);