Skip to content

Commit 7e9d407

Browse files
committed
Changed colors to m_temp_colors
1 parent 398ff76 commit 7e9d407

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

foucaultview.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ void foucaultView::showGrid() {
124124
QPushButton *btnGridCol = new QPushButton("Grid Color");
125125
QPushButton *btnTextCol = new QPushButton("Text Color");
126126

127-
colors = { m_gridColor, m_textColor }; // store current values
127+
m_temp_colors = { m_gridColor, m_textColor }; // store current values
128128

129129
connect(btnGridCol, &QPushButton::clicked, this,[this]() {
130-
QColor c = QColorDialog::getColor(colors.grid, this);
131-
if (c.isValid()) colors.grid = c;
130+
QColor c = QColorDialog::getColor(m_temp_colors.grid, this);
131+
if (c.isValid()) m_temp_colors.grid = c;
132132
});
133133
connect(btnTextCol, &QPushButton::clicked, this, [this]() {
134-
QColor c = QColorDialog::getColor(colors.text, this);
135-
if (c.isValid()) colors.text = c;
134+
QColor c = QColorDialog::getColor(m_temp_colors.text, this);
135+
if (c.isValid()) m_temp_colors.text = c;
136136
});
137137

138138
form.addRow("Grid Units:", unitCombo);
@@ -153,8 +153,8 @@ void foucaultView::showGrid() {
153153
spacingSpin->setValue(10.0);
154154
widthSpin->setValue(1);
155155
textToggle->setChecked(true);
156-
colors.grid = Qt::cyan;
157-
colors.text = Qt::white;
156+
m_temp_colors.grid = Qt::cyan;
157+
m_temp_colors.text = Qt::white;
158158
});
159159

160160
connect(&buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept);
@@ -165,8 +165,8 @@ void foucaultView::showGrid() {
165165
m_gridSpacing = spacingSpin->value();
166166
m_gridLineWidth = widthSpin->value();
167167
m_showUnitLabels = textToggle->isChecked();
168-
m_gridColor = colors.grid;
169-
m_textColor = colors.text;
168+
m_gridColor = m_temp_colors.grid;
169+
m_textColor = m_temp_colors.text;
170170

171171
// Save to QSettings with "ronchiGrid" prefix
172172
QSettings set;

foucaultview.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private slots:
109109
bool m_showUnitLabels = true;
110110
QColor m_gridColor = Qt::cyan;
111111
QColor m_textColor = Qt::white;
112-
struct State { QColor grid; QColor text; } colors;
112+
struct State { QColor grid; QColor text; } m_temp_colors;
113113

114114

115115
void drawGridOverlay(QImage &img);

0 commit comments

Comments
 (0)