From 07772094d5694db97ac6d271051af085800fd16f Mon Sep 17 00:00:00 2001 From: gitlost Date: Sat, 18 Jun 2022 23:41:27 +0100 Subject: [PATCH] GUI: restore tabMain minimizeSize (preview wasn't updating correctly) - manually adjust Windows min/max sizes; use grpC39 for LOGMARS --- frontend_qt/CMakeLists.txt | 10 ++--- frontend_qt/frontend_qt.pro | 3 +- frontend_qt/frontend_qt_zintdll.pro | 3 +- frontend_qt/grpC128.ui | 11 ----- frontend_qt/grpLOGMARS.ui | 69 ----------------------------- frontend_qt/mainWindow.ui | 19 ++++---- frontend_qt/mainwindow.cpp | 40 ++++++++--------- frontend_qt/resources.qrc | 1 - 8 files changed, 38 insertions(+), 118 deletions(-) delete mode 100644 frontend_qt/grpLOGMARS.ui diff --git a/frontend_qt/CMakeLists.txt b/frontend_qt/CMakeLists.txt index 7ad0b52c..04988e76 100644 --- a/frontend_qt/CMakeLists.txt +++ b/frontend_qt/CMakeLists.txt @@ -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 diff --git a/frontend_qt/frontend_qt.pro b/frontend_qt/frontend_qt.pro index 6ec1bfa4..394ca338 100644 --- a/frontend_qt/frontend_qt.pro +++ b/frontend_qt/frontend_qt.pro @@ -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 \ diff --git a/frontend_qt/frontend_qt_zintdll.pro b/frontend_qt/frontend_qt_zintdll.pro index 7bf022d6..457bb56a 100644 --- a/frontend_qt/frontend_qt_zintdll.pro +++ b/frontend_qt/frontend_qt_zintdll.pro @@ -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 \ diff --git a/frontend_qt/grpC128.ui b/frontend_qt/grpC128.ui index 13cfa8c7..896d8f4e 100644 --- a/frontend_qt/grpC128.ui +++ b/frontend_qt/grpC128.ui @@ -2,14 +2,6 @@ grpC128 - - - 0 - 0 - 317 - 156 - - 600 @@ -29,9 +21,6 @@ How to process data - - QLayout::SetMinimumSize - diff --git a/frontend_qt/grpLOGMARS.ui b/frontend_qt/grpLOGMARS.ui deleted file mode 100644 index 72618208..00000000 --- a/frontend_qt/grpLOGMARS.ui +++ /dev/null @@ -1,69 +0,0 @@ - - - grpLOGMARS - - - - 0 - 0 - 400 - 131 - - - - - 600 - 16777215 - - - - Form - - - - - - Check Digits - - - - - - &No Check Digit - - - true - - - - - - - &One (Mod-43) - - - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 40 - - - - - - - - - diff --git a/frontend_qt/mainWindow.ui b/frontend_qt/mainWindow.ui index 09a41de6..a642e585 100644 --- a/frontend_qt/mainWindow.ui +++ b/frontend_qt/mainWindow.ui @@ -5,12 +5,6 @@ Qt::NonModal - - - 0 - 0 - - 360 @@ -31,12 +25,15 @@ + + QLayout::SetMinimumSize + 0 - 5 + 35 @@ -129,10 +126,16 @@ + + + 0 + 346 + + 16777215 - 360 + 346 diff --git a/frontend_qt/mainwindow.cpp b/frontend_qt/mainwindow.cpp index 0d8f858b..bbd75c7b 100644 --- a/frontend_qt/mainwindow.cpp +++ b/frontend_qt/mainwindow.cpp @@ -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(QSL("radC39HIBC")); - if (symbology == BARCODE_EXCODE39) { - tabMain->insertTab(1, m_optionWidget, tr("Cod&e 39 Extended")); + 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(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: diff --git a/frontend_qt/resources.qrc b/frontend_qt/resources.qrc index 42a5c3de..1b47f85d 100644 --- a/frontend_qt/resources.qrc +++ b/frontend_qt/resources.qrc @@ -19,7 +19,6 @@ grpGrid.ui grpHX.ui grpITF14.ui - grpLOGMARS.ui grpMaxicode.ui grpMicroPDF.ui grpMQR.ui