39 ui->colorMain->setAlphaChannelEnabled(
true);
40 ui->colorSubdivision->setAlphaChannelEnabled(
true);
41 ui->colorVertical->setAlphaChannelEnabled(
true);
42 ui->colorGuides->setAlphaChannelEnabled(
true);
45 ui->angleLeftAngleSelector->setRange(0, 89);
46 ui->angleRightAngleSelector->setRange(0, 89);
47 ui->angleLeftAngleSelector->setDecimals(4);
48 ui->angleRightAngleSelector->setDecimals(4);
51 ui->cellSpacingSpinbox->setSuffix(i18n(
" px"));
52 ui->cellSizeSpinbox->setSuffix(i18n(
" px"));
54 ui->deleteAllGuidesButton->setIconSize(QSize(16, 16));
56 ui->chkLeftAngleActive->setChecked(
true);
57 ui->chkRightAngleActive->setChecked(
true);
58 ui->chkXSpacingActive->setChecked(
true);
59 ui->chkYSpacingActive->setChecked(
true);
63 ui->gridTypeCombobox->addItem(i18n(
"Rectangle"));
64 ui->gridTypeCombobox->addItem(i18n(
"Isometric (Legacy)"));
65 ui->gridTypeCombobox->addItem(i18n(
"Isometric"));
67 ui->gridTypeCombobox->setCurrentIndex(0);
77 connect(
ui->chkOffset, SIGNAL(toggled(
bool)),
ui->lblXOffset, SLOT(setVisible(
bool)));
78 connect(
ui->chkOffset, SIGNAL(toggled(
bool)),
ui->lblYOffset, SLOT(setVisible(
bool)));
79 connect(
ui->chkOffset, SIGNAL(toggled(
bool)),
ui->intXOffset, SLOT(setVisible(
bool)));
80 connect(
ui->chkOffset, SIGNAL(toggled(
bool)),
ui->intYOffset, SLOT(setVisible(
bool)));
81 connect(
ui->chkOffset, SIGNAL(toggled(
bool)),
ui->offsetAspectButton, SLOT(setVisible(
bool)));
84 ui->lblXOffset->setVisible(
false);
85 ui->lblYOffset->setVisible(
false);
86 ui->intXOffset->setVisible(
false);
87 ui->intYOffset->setVisible(
false);
88 ui->offsetAspectButton->setVisible(
false);
116 ui->chkOffset->setChecked(
false);
127 angleLocker->
connectAngleBoxes(
ui->angleLeftAngleSelector,
ui->angleRightAngleSelector,
ui->angleAspectButton);
167 m_d->guiSignalsBlocked =
true;
169 ui->chkShowGrid->setChecked(
m_d->gridConfig.showGrid());
171 ui->spacingAspectButton->setKeepAspectRatio(
false);
172 ui->intHSpacing->setMaximum(std::numeric_limits<int>::max());
173 ui->intVSpacing->setMaximum(std::numeric_limits<int>::max());
174 ui->intHSpacing->setValue(
m_d->gridConfig.spacing().x());
175 ui->intVSpacing->setValue(
m_d->gridConfig.spacing().y());
176 ui->intHSpacing->setEnabled(
m_d->gridConfig.xSpacingActive());
177 ui->intVSpacing->setEnabled(
m_d->gridConfig.ySpacingActive());
179 ui->chkXSpacingActive->setChecked(
m_d->gridConfig.xSpacingActive());
180 ui->chkYSpacingActive->setChecked(
m_d->gridConfig.ySpacingActive());
183 ui->chkXSpacingActive->setEnabled(
m_d->gridConfig.ySpacingActive());
184 ui->chkYSpacingActive->setEnabled(
m_d->gridConfig.xSpacingActive());
186 ui->spacingAspectButton->setKeepAspectRatio(
m_d->gridConfig.spacingAspectLocked());
188 ui->chkOffset->setChecked(
m_d->gridConfig.offsetActive());
189 ui->offsetAspectButton->setKeepAspectRatio(
false);
190 ui->intXOffset->setValue(
m_d->gridConfig.offset().x());
191 ui->intYOffset->setValue(
m_d->gridConfig.offset().y());
192 ui->offsetAspectButton->setKeepAspectRatio(
m_d->gridConfig.offsetAspectLocked());
194 ui->chkLeftAngleActive->setChecked(
m_d->gridConfig.angleLeftActive());
195 ui->chkRightAngleActive->setChecked(
m_d->gridConfig.angleRightActive());
198 ui->chkLeftAngleActive->setEnabled(
m_d->gridConfig.angleRightActive());
199 ui->chkRightAngleActive->setEnabled(
m_d->gridConfig.angleLeftActive());
201 ui->intSubdivision->setValue(
m_d->gridConfig.subdivision());
202 ui->chkSnapToGrid->setChecked(
m_d->gridConfig.snapToGrid());
203 ui->angleAspectButton->setKeepAspectRatio(
false);
204 ui->angleLeftAngleSelector->setAngle(
m_d->gridConfig.angleLeft());
205 ui->angleRightAngleSelector->setAngle(
m_d->gridConfig.angleRight());
206 ui->angleLeftAngleSelector->setEnabled(
m_d->gridConfig.angleLeftActive());
207 ui->angleRightAngleSelector->setEnabled(
m_d->gridConfig.angleRightActive());
208 ui->angleAspectButton->setKeepAspectRatio(
m_d->gridConfig.angleAspectLocked());
209 ui->cellSpacingSpinbox->setValue(
m_d->gridConfig.cellSpacing());
210 ui->cellSizeSpinbox->setValue(
m_d->gridConfig.cellSize());
212 ui->selectMainStyle->setCurrentIndex(
int(
m_d->gridConfig.lineTypeMain()));
213 ui->selectSubdivisionStyle->setCurrentIndex(
int(
m_d->gridConfig.lineTypeSubdivision()));
214 ui->selectVerticalStyle->setCurrentIndex(
int(
m_d->gridConfig.lineTypeVertical()));
215 ui->gridTypeCombobox->setCurrentIndex(
int(
m_d->gridConfig.gridType()));
217 ui->colorMain->setColor(
m_d->gridConfig.colorMain());
218 ui->colorSubdivision->setColor(
m_d->gridConfig.colorSubdivision());
219 ui->colorVertical->setColor(
m_d->gridConfig.colorVertical());
221 m_d->guiSignalsBlocked =
false;
268 pt.rx() =
ui->intHSpacing->value();
269 pt.ry() =
ui->intVSpacing->value();
275 pt.rx() =
ui->intXOffset->value();
276 pt.ry() =
ui->intYOffset->value();
346 bool showRectangleControls =
ui->gridTypeCombobox->currentIndex() == 0;
347 bool showIsometricLegacyControls = (
ui->gridTypeCombobox->currentIndex() == 1) && !showRectangleControls;
348 bool showIsometricControls = (
ui->gridTypeCombobox->currentIndex() == 2) && !showRectangleControls;
351 ui->lblXSpacing->setVisible(showRectangleControls);
352 ui->lblYSpacing->setVisible(showRectangleControls);
353 ui->chkXSpacingActive->setVisible(showRectangleControls);
354 ui->chkYSpacingActive->setVisible(showRectangleControls);
355 ui->intHSpacing->setVisible(showRectangleControls);
356 ui->intVSpacing->setVisible(showRectangleControls);
357 ui->spacingAspectButton->setVisible(showRectangleControls);
359 ui->lblSubdivision->setVisible(showRectangleControls || showIsometricControls);
360 ui->intSubdivision->setVisible(showRectangleControls || showIsometricControls);
361 ui->lblSubdivisionStyle->setVisible(showRectangleControls || showIsometricControls);
362 ui->selectSubdivisionStyle->setVisible(showRectangleControls || showIsometricControls);
363 ui->colorSubdivision->setVisible(showRectangleControls || showIsometricControls);
366 ui->angleAspectButton->setVisible(showIsometricLegacyControls || showIsometricControls);
367 ui->leftAngleLabel->setVisible(showIsometricLegacyControls || showIsometricControls);
368 ui->chkLeftAngleActive->setVisible(showIsometricLegacyControls || showIsometricControls);
369 ui->rightAngleLabel->setVisible(showIsometricLegacyControls || showIsometricControls);
370 ui->chkRightAngleActive->setVisible(showIsometricLegacyControls || showIsometricControls);
371 ui->angleLeftAngleSelector->setVisible(showIsometricLegacyControls || showIsometricControls);
372 ui->angleRightAngleSelector->setVisible(showIsometricLegacyControls || showIsometricControls);
373 ui->cellSpacingLabel->setVisible(showIsometricLegacyControls);
374 ui->cellSpacingSpinbox->setVisible(showIsometricLegacyControls);
375 ui->cellSizeLabel->setVisible(showIsometricControls);
376 ui->cellSizeSpinbox->setVisible(showIsometricControls);
378 ui->lblVerticalStyle->setVisible(showIsometricControls);
379 ui->selectVerticalStyle->setVisible(showIsometricControls);
380 ui->colorVertical->setVisible(showIsometricControls);
384 if (!showRectangleControls) {
386 ui->chkSnapToGrid->setEnabled(
false);
387 ui->chkSnapToGrid->setChecked(
false);
389 ui->chkSnapToGrid->setEnabled(
true);