1
0
Fork 0
mirror of https://git.code.sf.net/p/zint/code synced 2025-05-30 14:55:20 -04:00

Add Automatic Height option to UI and enable by default

Brings UI default settings in line with CLI default settings
This commit is contained in:
Robin Stuart 2019-10-21 08:29:21 +01:00
parent 739793a215
commit 1564cd7a34
4 changed files with 42 additions and 5 deletions
frontend_qt

View file

@ -160,6 +160,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
connect(btnMoreData, SIGNAL(clicked( bool )), SLOT(open_data_dialog()));
connect(btnSequence, SIGNAL(clicked( bool )), SLOT(open_sequence_dialog()));
connect(chkHRTHide, SIGNAL(stateChanged( int )), SLOT(update_preview()));
connect(chkAutoHeight, SIGNAL(stateChanged( int )), SLOT(autoheight_clicked()));
connect(btnCopySVG, SIGNAL(clicked( bool )), SLOT(copy_to_clipboard_svg()));
connect(btnCopyBMP, SIGNAL(clicked( bool )), SLOT(copy_to_clipboard_bmp()));
}
@ -329,6 +330,18 @@ void MainWindow::on_bgcolor_clicked()
}
}
void MainWindow::autoheight_clicked()
{
if (chkAutoHeight->isChecked()) {
lblHeight->setEnabled(false);
heightb->setEnabled(false);
} else {
lblHeight->setEnabled(true);
heightb->setEnabled(true);
}
update_preview();
}
void MainWindow::change_print_scale()
{
/* This value is only used when printing (saving) to file */
@ -1032,7 +1045,11 @@ void MainWindow::update_preview()
m_bc.bc.setBorderType((Zint::QZint::BorderType)(btype->currentIndex()*2));
m_bc.bc.setBorderWidth(bwidth->value());
m_bc.bc.setHeight(heightb->value());
if(chkAutoHeight->isChecked()) {
m_bc.bc.setHeight(0);
} else {
m_bc.bc.setHeight(heightb->value());
}
m_bc.bc.setWhitespace(spnWhitespace->value());
m_bc.bc.setFgColor(m_fgcolor);
m_bc.bc.setBgColor(m_bgcolor);