File indexing completed on 2022-09-27 13:15:56

0001 /*
0002     SPDX-FileCopyrightText: 2013 Denis Kuplyakov <dener.kup@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "colorscheme.h"
0008 #include <kconfigwidgets_version.h>
0009 #if KCONFIGWIDGETS_VERSION >= QT_VERSION_CHECK(5, 93, 0)
0010 #include <KStatefulBrush> // was moved to own header in 5.93.0
0011 #endif
0012 
0013 ColorScheme::ColorScheme(QQuickItem *parent) :
0014 QQuickItem(parent)
0015 {
0016 }
0017 
0018 QColor ColorScheme::background() const
0019 {
0020     return KStatefulBrush(KColorScheme::Tooltip,
0021                           KColorScheme::NormalBackground)
0022     .brush(QPalette::Active).color();
0023 }
0024 
0025 QColor ColorScheme::foreground() const
0026 {
0027     return KStatefulBrush(KColorScheme::Tooltip,
0028                           KColorScheme::NormalText)
0029     .brush(QPalette::Active).color();
0030 }
0031 
0032 QColor ColorScheme::border() const
0033 {
0034     return KStatefulBrush(KColorScheme::View,
0035                           KColorScheme::NormalText)
0036     .brush(QPalette::Active).color();
0037 }