colorpickerbutton.h (527B)
1 // SPDX-FileCopyrightText: 2023 Connor McLaughlin <stenzek@gmail.com> 2 // SPDX-License-Identifier: (GPL-3.0 OR 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 Q_SIGNALS: 16 void colorChanged(quint32 new_color); 17 18 public Q_SLOTS: 19 quint32 color(); 20 void setColor(quint32 rgb); 21 22 private Q_SLOTS: 23 void onClicked(); 24 25 private: 26 void updateBackgroundColor(); 27 28 u32 m_color = 0; 29 };