Q3270
A Qt-based 3270 Terminal Emulator
Loading...
Searching...
No Matches
ColourSwatchWidget.h
1/*
2 * Q3270 Terminal Emulator
3 *
4 * Copyright (c) 2020–2025 Andy Styles
5 * SPDX-License-Identifier: BSD-3-Clause
6 *
7 * This file is part of Q3270.
8 * See the LICENSE file in the project root for full license information.
9 */
10
11#ifndef COLOURSWATCHWIDGET_H
12#define COLOURSWATCHWIDGET_H
13
14#include <QToolButton>
15
16#include "Models/Colours.h"
17
18namespace Ui
19{
21}
22
23class ColourSwatchWidget : public QWidget
24{
25 Q_OBJECT
26
27 public:
28 explicit ColourSwatchWidget(QWidget *parent = nullptr);
29
30 void setTheme(const Colours &theme);
31 void setReadOnly(bool ro);
32 Colours currentTheme() const;
33
34 signals:
35 void colourChanged(Q3270::Colour role, const QColor &newColour);
36
37 private slots:
38 void setColour(); // slot for swatch clicks
39
40 private:
41 QColor colourDialog(QColor c, QToolButton *b);
42
43 Ui::ColourSwatchWidget *ui;
44
45 QMap<Q3270::Colour, QToolButton*> colourButtons;
46 Colours theme;
47};
48
49#endif // COLOURSWATCHWIDGET_H
Definition ColourSwatchWidget.h:24
Definition Colours.h:19