1 /* ColorEdit widget for KDE Display color scheme setup module
2     SPDX-FileCopyrightText: 2016 Olivier Churlaud <olivier@churlaud.com>
3 
4     SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <KColorScheme>
10 #include <KSharedConfig>
11 
12 #include <QFrame>
13 #include <QPalette>
14 #include <QWidget>
15 
16 #include "ui_scmeditoroptions.h"
17 
18 class SchemeEditorOptions : public QWidget, public Ui::ScmEditorOptions
19 {
20     Q_OBJECT
21 
22 public:
23     SchemeEditorOptions(KSharedConfigPtr config, QWidget *parent = nullptr);
24     void updateValues();
25 
26 Q_SIGNALS:
27     void changed(bool);
28 
29 private Q_SLOTS:
30 
31     // options slots
32     void on_contrastSlider_valueChanged(int value);
33     void on_shadeSortedColumn_stateChanged(int state);
34     void on_inactiveSelectionEffect_stateChanged(int state);
35     void on_useInactiveEffects_stateChanged(int state);
36 
37 private:
38     /** load options from global */
39     void loadOptions();
40     void setCommonForeground(KColorScheme::ForegroundRole role, int stackIndex, int buttonIndex);
41     void setCommonDecoration(KColorScheme::DecorationRole role, int stackIndex, int buttonIndex);
42 
43     KSharedConfigPtr m_config;
44     bool m_disableUpdates;
45 };
46