Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
stenzek
GitHub Repository: stenzek/duckstation
Path: blob/master/src/duckstation-qt/colorpickerbutton.h
4802 views
1
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <[email protected]>
2
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
3
4
#pragma once
5
#include "common/types.h"
6
#include <QtWidgets/QPushButton>
7
8
class ColorPickerButton : public QPushButton
9
{
10
Q_OBJECT
11
12
public:
13
ColorPickerButton(QWidget* parent);
14
15
quint32 color();
16
void setColor(quint32 rgb);
17
18
Q_SIGNALS:
19
void colorChanged(quint32 new_color);
20
21
protected:
22
void paintEvent(QPaintEvent* event) override;
23
24
private:
25
void onClicked();
26
27
u32 m_color = 0;
28
};
29
30