diff --git a/plugins/dockers/animation/timeline_color_scheme.cpp b/plugins/dockers/animation/timeline_color_scheme.cpp index 404cdd6e0b..2c5423a15d 100644 --- a/plugins/dockers/animation/timeline_color_scheme.cpp +++ b/plugins/dockers/animation/timeline_color_scheme.cpp @@ -1,126 +1,118 @@ /* * Copyright (c) 2015 Dmitry Kazakov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "timeline_color_scheme.h" #include #include #include #include #include #include #include "kis_debug.h" #include "krita_utils.h" #include Q_GLOBAL_STATIC(TimelineColorScheme, s_instance) -struct TimelineColorScheme::Private -{ - QColor baseColor; -}; - - TimelineColorScheme::TimelineColorScheme() - : m_d(new Private) { - m_d->baseColor = QColor(137, 192, 221); } TimelineColorScheme::~TimelineColorScheme() { } TimelineColorScheme* TimelineColorScheme::instance() { return s_instance; } QColor TimelineColorScheme::selectorColor() const { return QColor(223, 148, 51); } QColor TimelineColorScheme::selectionColor() const { //return qApp->palette().color(QPalette::Highlight); return selectorColor(); } QColor TimelineColorScheme::activeLayerBackground() const { QColor color = qApp->palette().color(QPalette::Highlight); return color; } QBrush TimelineColorScheme::headerEmpty() const { return qApp->palette().brush(QPalette::Button); } QBrush TimelineColorScheme::headerCachedFrame() const { QColor bgColor = qApp->palette().color(QPalette::Base); int darkenCoeff = bgColor.value() > 128 ? 150 : 50; return headerEmpty().color().darker(darkenCoeff); } QBrush TimelineColorScheme::headerActive() const { return selectorColor(); } QColor TimelineColorScheme::onionSkinsSliderEnabledColor() const { - return m_d->baseColor; + return qApp->palette().color(QPalette::Highlight); } QColor TimelineColorScheme::onionSkinsSliderDisabledColor() const { return qApp->palette().color(QPalette::Disabled, QPalette::HighlightedText); } QColor TimelineColorScheme::onionSkinsButtonColor() const { QColor bgColor = qApp->palette().color(QPalette::Base); const int lighterCoeff = bgColor.value() > 128 ? 120 : 80; - return m_d->baseColor.lighter(lighterCoeff); + return qApp->palette().color(QPalette::Highlight).lighter(lighterCoeff); } QFont TimelineColorScheme::getOnionSkinsFont(const QString &maxString, const QSize &availableSize) const { QFont font = qApp->font(); while(font.pointSize() > 8) { QFontMetrics fm(font); QRect rc = fm.boundingRect(maxString); if (rc.width() > availableSize.width() || rc.height() > availableSize.height()) { font.setPointSize(font.pointSize() - 1); } else { break; } } return font; } diff --git a/plugins/dockers/animation/timeline_color_scheme.h b/plugins/dockers/animation/timeline_color_scheme.h index be96729a46..19f9961014 100644 --- a/plugins/dockers/animation/timeline_color_scheme.h +++ b/plugins/dockers/animation/timeline_color_scheme.h @@ -1,57 +1,53 @@ /* * Copyright (c) 2015 Dmitry Kazakov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __TIMELINE_COLOR_SCHEME_H #define __TIMELINE_COLOR_SCHEME_H #include class QColor; class QBrush; class QFont; class QSize; class TimelineColorScheme { public: TimelineColorScheme(); ~TimelineColorScheme(); static TimelineColorScheme* instance(); QColor selectorColor() const; QColor selectionColor() const; QColor activeLayerBackground() const; QBrush headerEmpty() const; QBrush headerCachedFrame() const; QBrush headerActive() const; QColor onionSkinsSliderEnabledColor() const; QColor onionSkinsSliderDisabledColor() const; QColor onionSkinsButtonColor() const; QFont getOnionSkinsFont(const QString &maxString, const QSize &availableSize) const; - -private: - struct Private; - const QScopedPointer m_d; }; #endif /* __TIMELINE_COLOR_SCHEME_H */