mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13: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:
parent
739793a215
commit
1564cd7a34
@ -27,7 +27,7 @@ namespace Zint {
|
|||||||
|
|
||||||
QZint::QZint() {
|
QZint::QZint() {
|
||||||
m_symbol = BARCODE_CODE128;
|
m_symbol = BARCODE_CODE128;
|
||||||
m_height = 50;
|
m_height = 0;
|
||||||
m_border = NO_BORDER;
|
m_border = NO_BORDER;
|
||||||
m_borderWidth = 0;
|
m_borderWidth = 0;
|
||||||
m_securityLevel = -1;
|
m_securityLevel = -1;
|
||||||
|
@ -308,8 +308,8 @@ Remember to place [square brackets] around AI data</string>
|
|||||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'Noto Sans [monotype]'; font-size:9pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif';">Your Data Here!</span></p></body></html></string>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Your Data Here!</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="acceptRichText">
|
<property name="acceptRichText">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@ -331,7 +331,10 @@ p, li { white-space: pre-wrap; }
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="lblHeight">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Height:</string>
|
<string>&Height:</string>
|
||||||
</property>
|
</property>
|
||||||
@ -384,6 +387,9 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QSpinBox" name="heightb">
|
<widget class="QSpinBox" name="heightb">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Overall symbol height</string>
|
<string>Overall symbol height</string>
|
||||||
</property>
|
</property>
|
||||||
@ -522,6 +528,19 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="chkAutoHeight">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Automatic Height</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="chkHRTHide">
|
<widget class="QCheckBox" name="chkHRTHide">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
@ -160,6 +160,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
|
|||||||
connect(btnMoreData, SIGNAL(clicked( bool )), SLOT(open_data_dialog()));
|
connect(btnMoreData, SIGNAL(clicked( bool )), SLOT(open_data_dialog()));
|
||||||
connect(btnSequence, SIGNAL(clicked( bool )), SLOT(open_sequence_dialog()));
|
connect(btnSequence, SIGNAL(clicked( bool )), SLOT(open_sequence_dialog()));
|
||||||
connect(chkHRTHide, SIGNAL(stateChanged( int )), SLOT(update_preview()));
|
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(btnCopySVG, SIGNAL(clicked( bool )), SLOT(copy_to_clipboard_svg()));
|
||||||
connect(btnCopyBMP, SIGNAL(clicked( bool )), SLOT(copy_to_clipboard_bmp()));
|
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()
|
void MainWindow::change_print_scale()
|
||||||
{
|
{
|
||||||
/* This value is only used when printing (saving) to file */
|
/* 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.setBorderType((Zint::QZint::BorderType)(btype->currentIndex()*2));
|
||||||
m_bc.bc.setBorderWidth(bwidth->value());
|
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.setWhitespace(spnWhitespace->value());
|
||||||
m_bc.bc.setFgColor(m_fgcolor);
|
m_bc.bc.setFgColor(m_fgcolor);
|
||||||
m_bc.bc.setBgColor(m_bgcolor);
|
m_bc.bc.setBgColor(m_bgcolor);
|
||||||
|
@ -121,6 +121,7 @@ public slots:
|
|||||||
void composite_ean_check();
|
void composite_ean_check();
|
||||||
void maxi_primary();
|
void maxi_primary();
|
||||||
void change_print_scale();
|
void change_print_scale();
|
||||||
|
void autoheight_clicked();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resizeEvent(QResizeEvent *event);
|
void resizeEvent(QResizeEvent *event);
|
||||||
|
Loading…
Reference in New Issue
Block a user