GUI: restore tabMain minimizeSize (preview wasn't updating correctly)

- manually adjust Windows min/max sizes; use grpC39 for LOGMARS
This commit is contained in:
gitlost 2022-06-18 23:41:27 +01:00
parent 18ede09761
commit 07772094d5
8 changed files with 38 additions and 118 deletions

View File

@ -18,11 +18,11 @@ else()
qt5_wrap_ui(zint-qt_SRCS mainWindow.ui extCLI.ui extData.ui extSequence.ui extExport.ui)
endif()
# grpAztec.ui grpC39.ui grpCodablockF.ui grpDotCode.ui grpMaxicode.ui grpQR.ui grpUPNQR.ui
# grpC11.ui grpC49.ui grpCodeOne.ui grpGrid.ui grpMicroPDF.ui grpRMQR.ui grpVIN.ui
# grpC128.ui grpC93.ui grpDAFT.ui grpHX.ui grpMQR.ui grpUltra.ui
# grpC16k.ui grpChannel.ui grpDBExtend.ui grpITF14.ui grpMSICheck.ui grpUPCA.ui
# grpC25.ui grpCodabar.ui grpDM.ui grpLOGMARS.ui grpPDF417.ui grpUPCEAN.ui
# grpAztec.ui grpC39.ui grpCodablockF.ui grpDotCode.ui grpMicroPDF.ui grpRMQR.ui grpVIN.ui
# grpC11.ui grpC49.ui grpCodeOne.ui grpGrid.ui grpMQR.ui grpUltra.ui
# grpC128.ui grpC93.ui grpDAFT.ui grpHX.ui grpMSICheck.ui grpUPCA.ui
# grpC16k.ui grpChannel.ui grpDBExtend.ui grpITF14.ui grpPDF417.ui grpUPCEAN.ui
# grpC25.ui grpCodabar.ui grpDM.ui grpMaxicode.ui grpQR.ui grpUPNQR.ui
if(APPLE)
# https://doc.qt.io/qt-5/appicon.html

View File

@ -32,6 +32,7 @@ FORMS += extCLI.ui \
grpC25.ui \
grpC39.ui \
grpC49.ui \
grpC93.ui \
grpChannel.ui \
grpCodabar.ui \
grpCodablockF.ui \
@ -42,7 +43,7 @@ FORMS += extCLI.ui \
grpDotCode.ui \
grpGrid.ui \
grpHX.ui \
grpLOGMARS.ui \
grpITF14.ui \
grpMaxicode.ui \
grpMicroPDF.ui \
grpMQR.ui \

View File

@ -22,6 +22,7 @@ FORMS += extCLI.ui \
grpC25.ui \
grpC39.ui \
grpC49.ui \
grpC93.ui \
grpChannel.ui \
grpCodabar.ui \
grpCodablockF.ui \
@ -32,7 +33,7 @@ FORMS += extCLI.ui \
grpDotCode.ui \
grpGrid.ui \
grpHX.ui \
grpLOGMARS.ui \
grpITF14.ui \
grpMaxicode.ui \
grpMicroPDF.ui \
grpMQR.ui \

View File

@ -2,14 +2,6 @@
<ui version="4.0">
<class>grpC128</class>
<widget class="QWidget" name="grpC128">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>317</width>
<height>156</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>600</width>
@ -29,9 +21,6 @@
<string>How to process data</string>
</property>
<layout class="QGridLayout" name="gridLayoutC128EncodingMode">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item row="0" column="0">
<widget class="QRadioButton" name="radC128Stand">
<property name="text">

View File

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>grpLOGMARS</class>
<widget class="QWidget" name="grpLOGMARS">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>131</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>600</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="grpLOGMARSCheckDigits">
<property name="title">
<string>Check Digits</string>
</property>
<layout class="QGridLayout" name="gridLayoutLOGMARSCheckDigits">
<item row="0" column="0">
<widget class="QRadioButton" name="radLOGMARSStand">
<property name="text">
<string>&amp;No Check Digit</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="radLOGMARSCheck">
<property name="text">
<string>&amp;One (Mod-43)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -5,12 +5,6 @@
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>360</width>
@ -31,12 +25,15 @@
<locale language="English" country="UnitedStates"/>
</property>
<layout class="QVBoxLayout" name="vLayoutMain">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<widget class="QGraphicsView" name="view">
<property name="minimumSize">
<size>
<width>0</width>
<height>5</height>
<height>35</height>
</size>
</property>
<property name="contextMenuPolicy">
@ -129,10 +126,16 @@
</item>
<item>
<widget class="QTabWidget" name="tabMain">
<property name="minimumSize">
<size>
<width>0</width>
<height>346</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>360</height>
<height>346</height>
</size>
</property>
<property name="autoFillBackground">

View File

@ -223,6 +223,11 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags fl)
mac_hack(this);
mac_hack_vLayouts(this);
mac_hack_statusBars(this, "statusBar");
vLayoutTabData->setContentsMargins(QMargins(20, 0, 20, 0));
#endif
#ifdef _WIN32
tabMain->setMinimumSize(QSize(0, 316));
tabMain->setMaximumSize(QSize(16777215, 316));
#endif
restoreGeometry(saved_geometry.toByteArray());
@ -1149,7 +1154,6 @@ void MainWindow::on_encoded()
if (QApplication::activeModalWidget() != nullptr) { // Protect against encode in popup dialog
return;
}
this->setMinimumHeight(m_bc.bc.getError() ? 455 : 435);
enableActions(true);
errtxtBar_set(false /*isError*/);
@ -1165,7 +1169,6 @@ void MainWindow::on_errored()
if (QApplication::activeModalWidget() != nullptr) { // Protect against error in popup dialog (Sequence Export)
return;
}
this->setMinimumHeight(455);
enableActions(false);
errtxtBar_set(true /*isError*/);
}
@ -1585,7 +1588,7 @@ void MainWindow::change_options()
connect(get_widget(QSL("radC25CheckHide")), SIGNAL(toggled( bool )), SLOT(update_preview()));
}
} else if (symbology == BARCODE_CODE39 || symbology == BARCODE_EXCODE39) {
} else if (symbology == BARCODE_CODE39 || symbology == BARCODE_EXCODE39 || symbology == BARCODE_LOGMARS) {
QFile file(QSL(":/grpC39.ui"));
if (!file.open(QIODevice::ReadOnly))
return;
@ -1594,10 +1597,13 @@ void MainWindow::change_options()
load_sub_settings(settings, symbology);
connect(get_widget(QSL("radC39Stand")), SIGNAL(toggled( bool )), SLOT(update_preview()));
connect(get_widget(QSL("radC39Check")), SIGNAL(toggled( bool )), SLOT(update_preview()));
connect(get_widget(QSL("radC39HIBC")), SIGNAL(toggled( bool )), SLOT(update_preview()));
QRadioButton *radC39HIBC = m_optionWidget->findChild<QRadioButton*>(QSL("radC39HIBC"));
if (symbology == BARCODE_EXCODE39 || symbology == BARCODE_LOGMARS) {
if (symbology == BARCODE_EXCODE39) {
tabMain->insertTab(1, m_optionWidget, tr("Cod&e 39 Extended"));
} else {
tabMain->insertTab(1, m_optionWidget, tr("LOGM&ARS"));
}
if (radC39HIBC->isChecked()) {
radC39HIBC->setChecked(false);
m_optionWidget->findChild<QRadioButton*>(QSL("radC39Stand"))->setChecked(true);
@ -1605,22 +1611,12 @@ void MainWindow::change_options()
radC39HIBC->setEnabled(false);
radC39HIBC->hide();
} else {
connect(get_widget(QSL("radC39HIBC")), SIGNAL(toggled( bool )), SLOT(update_preview()));
tabMain->insertTab(1, m_optionWidget, tr("Cod&e 39"));
radC39HIBC->setEnabled(true);
radC39HIBC->show();
}
} else if (symbology == BARCODE_LOGMARS) {
QFile file(QSL(":/grpLOGMARS.ui"));
if (!file.open(QIODevice::ReadOnly))
return;
m_optionWidget = uiload.load(&file);
file.close();
load_sub_settings(settings, symbology);
tabMain->insertTab(1, m_optionWidget, tr("LOGM&ARS"));
connect(get_widget(QSL("radLOGMARSStand")), SIGNAL(toggled( bool )), SLOT(update_preview()));
connect(get_widget(QSL("radLOGMARSCheck")), SIGNAL(toggled( bool )), SLOT(update_preview()));
} else if (symbology == BARCODE_CODE16K) {
QFile file(QSL(":/grpC16k.ui"));
if (!file.open(QIODevice::ReadOnly))
@ -2530,7 +2526,7 @@ void MainWindow::update_preview()
break;
case BARCODE_LOGMARS:
m_bc.bc.setSymbol(BARCODE_LOGMARS);
if (get_rad_val(QSL("radLOGMARSCheck"))) {
if (get_rad_val(QSL("radC39Check"))) {
m_bc.bc.setOption2(1);
}
break;
@ -3106,7 +3102,9 @@ void MainWindow::errtxtBar_set(bool isError)
{
if (!m_bc.bc.hasErrors()) {
errtxtBar_clear();
view->setMinimumSize(QSize(0, 35));
} else {
view->setMinimumSize(QSize(0, 5));
errtxtBar->showMessage(m_bc.bc.lastError());
errtxtBar->setStyleSheet(isError
? QSL("QStatusBar {background:white; color:#dd0000;}")
@ -3486,10 +3484,9 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology)
settings.setValue(QSL("studio/bc/excode39/check_digit"), get_rad_grp_index(
QStringList() << QSL("radC39Stand") << QSL("radC39Check")));
break;
case BARCODE_LOGMARS:
settings.setValue(QSL("studio/bc/logmars/check_digit"), get_rad_grp_index(
QStringList() << QSL("radLOGMARSStand") << QSL("radLOGMARSCheck")));
QStringList() << QSL("radC39Stand") << QSL("radC39Check")));
break;
case BARCODE_CODE16K:
@ -3872,10 +3869,9 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology)
set_rad_from_setting(settings, QSL("studio/bc/excode39/check_digit"),
QStringList() << QSL("radC39Stand") << QSL("radC39Check"));
break;
case BARCODE_LOGMARS:
set_rad_from_setting(settings, QSL("studio/bc/logmars/check_digit"),
QStringList() << QSL("radLOGMARSStand") << QSL("radLOGMARSCheck"));
QStringList() << QSL("radC39Stand") << QSL("radC39Check"));
break;
case BARCODE_CODE16K:

View File

@ -19,7 +19,6 @@
<file>grpGrid.ui</file>
<file>grpHX.ui</file>
<file>grpITF14.ui</file>
<file>grpLOGMARS.ui</file>
<file>grpMaxicode.ui</file>
<file>grpMicroPDF.ui</file>
<file>grpMQR.ui</file>