src/widgets/colorselectdialog.h

Tue, 28 Jun 2022 19:25:08 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Tue, 28 Jun 2022 19:25:08 +0300
changeset 294
70b69a15c736
parent 264
76a025db4948
permissions
-rw-r--r--

Reformat about.ui a bit

95
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 #pragma once
264
76a025db4948 Convert all includes to be relative to project root directory. Files that cannot be found in this manner use angle brackets.
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 206
diff changeset
2 #include "src/basics.h"
76a025db4948 Convert all includes to be relative to project root directory. Files that cannot be found in this manner use angle brackets.
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 206
diff changeset
3 #include "src/colors.h"
95
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4 #include <QPushButton>
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 #include <QAbstractTableModel>
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 #include <QDialog>
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7 #include <QGridLayout>
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 class ColorSelectDialog : public QDialog
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 {
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11 Q_OBJECT
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12 public:
205
1a4342d80de7 Refactor colors.cpp/.h
Teemu Piippo <teemu@hecknology.net>
parents: 139
diff changeset
13 explicit ColorSelectDialog(const ColorTable& colorTable, QWidget* parent = nullptr);
95
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 ~ColorSelectDialog();
205
1a4342d80de7 Refactor colors.cpp/.h
Teemu Piippo <teemu@hecknology.net>
parents: 139
diff changeset
15 void setCurrentColor(ColorIndex color);
95
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 ldraw::Color currentColor() const;
112
5760cbb32bc0 use QT_NO_KEYWORDS
Teemu Piippo <teemu@hecknology.net>
parents: 95
diff changeset
17 private Q_SLOTS:
95
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18 void populateColors();
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 void updateSelectedColorTexts();
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20 void handleButtonClick();
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 void spinboxEdited();
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22 void chooseDirectColor();
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
23 private:
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
24 void makeColorButtons();
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25 bool filterColor(ldraw::Color color) const;
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26 class Ui_ColorSelectDialog& ui;
205
1a4342d80de7 Refactor colors.cpp/.h
Teemu Piippo <teemu@hecknology.net>
parents: 139
diff changeset
27 const ColorTable& colorTable;
95
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
28 std::vector<QPushButton*> buttons;
205
1a4342d80de7 Refactor colors.cpp/.h
Teemu Piippo <teemu@hecknology.net>
parents: 139
diff changeset
29 ColorIndex selectedColor = MAIN_COLOR;
95
06a1aef170aa asioita
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
30 };

mercurial