-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColorPicker.h
More file actions
48 lines (40 loc) · 1.49 KB
/
ColorPicker.h
File metadata and controls
48 lines (40 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: GPL-3.0-only
/* colorpicker.h - Handle background and foreground color selection for UltradiumTimer
*
* Copyright (C) 2025 feeRnt; <81442162+feeRnt@users.noreply.github.com>
* 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, version 3.
* 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, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef COLORPICKER_H
#define COLORPICKER_H
#include <QObject>
//#include <QQuickItem>
//#include <QDialog>
#include <QColor>
#include <QColorDialog>
class ColorPicker : public QColorDialog
{
Q_OBJECT
Q_PROPERTY(QColor pickedBgColor READ pickedBgColor NOTIFY updatePickedBgColor)
Q_PROPERTY(QColor pickedFgColor READ pickedFgColor NOTIFY updatePickedFgColor)
public:
explicit ColorPicker(QWidget *parent = nullptr);
QColor pickedBgColor() const { return m_pickedBgColor; }
QColor pickedFgColor() const { return m_pickedFgColor; }
signals:
void updatePickedBgColor();
void updatePickedFgColor();
private:
QColor m_pickedBgColor;
QColor m_pickedFgColor;
};
#endif // COLORPICKER_H