Wed, 25 May 2022 20:36:34 +0300
Fix pick() picking from weird places on the screen with high DPI scaling
glReadPixels reads data from the frame buffer, which contains data after
high DPI scaling, so any reads to that need to take this scaling into account
95 | 1 | #pragma once |
2 | #include "../main.h" | |
3 | #include "../colors.h" | |
4 | #include <QPushButton> | |
5 | #include <QAbstractTableModel> | |
6 | #include <QDialog> | |
7 | #include <QGridLayout> | |
8 | ||
9 | class ColorSelectDialog : public QDialog | |
10 | { | |
11 | Q_OBJECT | |
12 | public: | |
13 | explicit ColorSelectDialog(const ldraw::ColorTable& colorTable, QWidget* parent = nullptr); | |
14 | ~ColorSelectDialog(); | |
15 | void setCurrentColor(ldraw::Color color); | |
16 | ldraw::Color currentColor() const; | |
112 | 17 | private Q_SLOTS: |
95 | 18 | void populateColors(); |
19 | void updateSelectedColorTexts(); | |
20 | void handleButtonClick(); | |
21 | void spinboxEdited(); | |
22 | void chooseDirectColor(); | |
23 | private: | |
24 | void makeColorButtons(); | |
25 | bool filterColor(ldraw::Color color) const; | |
26 | class Ui_ColorSelectDialog& ui; | |
27 | const ldraw::ColorTable& colorTable; | |
28 | std::vector<QPushButton*> buttons; | |
139
72098474d362
Document and refactor colors.cpp and colors.h
Teemu Piippo <teemu@hecknology.net>
parents:
112
diff
changeset
|
29 | ldraw::Color selectedColor = ldraw::MAIN_COLOR; |
95 | 30 | }; |