Create ui checkbox for enabling straight paths

This commit is contained in:
BigBahss 2020-08-21 12:23:33 -04:00 committed by garak
parent 713ded1754
commit 5e09d7b965
3 changed files with 23 additions and 0 deletions

View file

@ -626,6 +626,22 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_straightPaths">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">margin-left: 10px</string>
</property>
<property name="text">
<string>Straight Paths</string>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_ToggleGrid">
<property name="toolTip">

View file

@ -201,6 +201,7 @@ private slots:
void on_comboBox_SecondaryTileset_currentTextChanged(const QString &arg1);
void on_pushButton_ChangeDimensions_clicked();
void on_checkBox_smartPaths_stateChanged(int selected);
void on_checkBox_straightPaths_stateChanged(int selected);
void on_checkBox_Visibility_clicked(bool checked);
void on_checkBox_ToggleBorder_stateChanged(int arg1);

View file

@ -2498,6 +2498,12 @@ void MainWindow::on_checkBox_smartPaths_stateChanged(int selected)
}
}
void MainWindow::on_checkBox_straightPaths_stateChanged(int selected)
{
bool enabled = selected == Qt::Checked;
editor->settings->straightPathsEnabled = enabled;
}
void MainWindow::on_checkBox_ToggleBorder_stateChanged(int selected)
{
bool visible = selected != 0;