From ba79698e3b3382910832607d93aa1d5ca60dfe23 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Fri, 16 Jun 2023 15:04:39 +0800 Subject: [PATCH] Font size range, and apply font before build options dialog --- DSView/pv/dialogs/applicationpardlg.cpp | 2 +- DSView/pv/dialogs/deviceoptions.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/DSView/pv/dialogs/applicationpardlg.cpp b/DSView/pv/dialogs/applicationpardlg.cpp index 1aefb212..abd3621e 100644 --- a/DSView/pv/dialogs/applicationpardlg.cpp +++ b/DSView/pv/dialogs/applicationpardlg.cpp @@ -87,7 +87,7 @@ void ApplicationParamDlg::bind_font_size_list(QComboBox *box, float size) { int selDex = -1; - for(int i=7; i<=13; i++) + for(int i=7; i<=12; i++) { box->addItem(QString::number(i)); if (i == size){ diff --git a/DSView/pv/dialogs/deviceoptions.cpp b/DSView/pv/dialogs/deviceoptions.cpp index da943be0..e88948e5 100644 --- a/DSView/pv/dialogs/deviceoptions.cpp +++ b/DSView/pv/dialogs/deviceoptions.cpp @@ -134,7 +134,7 @@ DeviceOptions::DeviceOptions(QWidget *parent) : QWidget *minWid = new QWidget(); minWid->setFixedHeight(1); - minWid->setMinimumWidth(250); + minWid->setMinimumWidth(230); _container_lay->addWidget(minWid); // chnnels group box @@ -256,6 +256,7 @@ QLayout * DeviceOptions::get_property_form(QWidget * parent) i++; } + this->update_font(); _groupHeight1 = parent->sizeHint().height(); parent->setFixedHeight(_groupHeight1); @@ -364,6 +365,7 @@ void DeviceOptions::logic_probes(QVBoxLayout &layout) enable_all_probes->setMaximumHeight(30); disable_all_probes->setMaximumHeight(30); + this->update_font(); contentHeight += enable_all_probes->sizeHint().height(); contentHeight += row2 * 40; @@ -692,6 +694,7 @@ void DeviceOptions::analog_probes(QGridLayout &layout) layout.addWidget(tabWidget, 0, 0, 1, 1); + this->update_font(); _groupHeight2 = tabWidget->sizeHint().height() + 10; _dynamic_panel->setFixedHeight(_groupHeight2); @@ -783,8 +786,10 @@ void DeviceOptions::build_dynamic_panel() int bb = 0; void DeviceOptions::try_resize_scroll() { + this->update_font(); + // content area height - int contentHeight = _groupHeight1 + _groupHeight2 + 15; // +space + int contentHeight = _groupHeight1 + _groupHeight2 + 20; // +space //dialog height int dlgHeight = contentHeight + 100; // +bottom buttton