Disable explicit sheet's grainline orientation if option Follow grainline is not active.

This commit is contained in:
Roman Telezhynskyi 2024-04-06 11:51:26 +03:00
parent 5186e80adb
commit b25df043bf

View File

@ -1256,6 +1256,9 @@ void VPMainWindow::InitPropertyTabLayout()
connect(ui->checkBoxFollowGainline, &QCheckBox::toggled, this, connect(ui->checkBoxFollowGainline, &QCheckBox::toggled, this,
[this](bool checked) [this](bool checked)
{ {
ui->toolButtonGrainlineHorizontalOrientation->setEnabled(ui->checkBoxFollowGainline->isChecked());
ui->toolButtonGrainlineVerticalOrientation->setEnabled(ui->checkBoxFollowGainline->isChecked());
if (not m_layout.isNull()) if (not m_layout.isNull())
{ {
m_layout->LayoutSettings().SetFollowGrainline(checked); m_layout->LayoutSettings().SetFollowGrainline(checked);
@ -1454,7 +1457,9 @@ void VPMainWindow::SetPropertyTabSheetData()
GrainlineType const type = sheet->GetGrainlineType(); GrainlineType const type = sheet->GetGrainlineType();
ui->toolButtonGrainlineHorizontalOrientation->setChecked(type == GrainlineType::Horizontal); ui->toolButtonGrainlineHorizontalOrientation->setChecked(type == GrainlineType::Horizontal);
ui->toolButtonGrainlineHorizontalOrientation->setEnabled(ui->checkBoxFollowGainline->isChecked());
ui->toolButtonGrainlineVerticalOrientation->setChecked(type == GrainlineType::Vertical); ui->toolButtonGrainlineVerticalOrientation->setChecked(type == GrainlineType::Vertical);
ui->toolButtonGrainlineVerticalOrientation->setEnabled(ui->checkBoxFollowGainline->isChecked());
// set placement grid // set placement grid
ui->groupBoxSheetGrid->setDisabled(false); ui->groupBoxSheetGrid->setDisabled(false);