From 4320c57d8f09c407f308fc0e08d8057e3515f493 Mon Sep 17 00:00:00 2001
From: taynpg <taynpg@163.com>
Date: Wed, 29 May 2024 10:31:48 +0800
Subject: [PATCH] =?UTF-8?q?opti=EF=BC=9A=E4=BF=AE=E6=AD=A3=E5=88=9D?=
 =?UTF-8?q?=E5=A7=8B=E5=B0=BA=E5=AF=B8=E6=98=BE=E7=A4=BA=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 MainWidget.cpp | 38 +++++++++++++++++---------------------
 MainWidget.ui  |  4 ++--
 2 files changed, 19 insertions(+), 23 deletions(-)

diff --git a/MainWidget.cpp b/MainWidget.cpp
index 667377f..894a886 100644
--- a/MainWidget.cpp
+++ b/MainWidget.cpp
@@ -21,8 +21,9 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget
 
     QScreen* primaryScreen = QGuiApplication::primaryScreen();
     QRect    screenGeometry = primaryScreen->geometry();
-    setMinimumWidth(screenGeometry.width() * 0.5);
-    setMinimumHeight(screenGeometry.height() * 0.9);
+
+    setBaseSize(screenGeometry.width() * 0.6, screenGeometry.height() * 0.9);
+
     // setMinimumWidth(900);
     // setMinimumHeight(800);
 
@@ -47,7 +48,7 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget
             return;
         }
         read(file);
-        //ui->edStatus->setText(file);
+        // ui->edStatus->setText(file);
     });
     connect(ui->btnSearch, &QPushButton::clicked, this, [&]() { search(ui->edSearchKey->text()); });
     connect(ui->btnBackup, &QPushButton::clicked, this, [&]() { backup_file(); });
@@ -102,11 +103,11 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget
     restoreGeometry(settings.value("geometry").toByteArray());
     settings.endGroup();
 
-    //QFile qss_file("://qss/lightblue.css");
-    // QFile qss_file("://qss/flatgray.css");
-    // if (qss_file.open(QFile::ReadOnly)) {
-    //     qApp->setStyleSheet(qss_file.readAll());
-    // }
+    // QFile qss_file("://qss/lightblue.css");
+    //  QFile qss_file("://qss/flatgray.css");
+    //  if (qss_file.open(QFile::ReadOnly)) {
+    //      qApp->setStyleSheet(qss_file.readAll());
+    //  }
 
     init_menu();
 
@@ -173,8 +174,7 @@ void MainWidget::show_custom_menu()
 
     if (indexList.size() == 1) {
         menu_simple_->exec(QCursor::pos());
-    }
-    else {
+    } else {
         menu_multi_->exec(QCursor::pos());
     }
 }
@@ -302,8 +302,7 @@ void MainWidget::read(const QString& file_path)
 
     if (base_.allow_max_width < 0 || base_.allow_max_width > 1000) {
         allow_max_with_ = 100;
-    }
-    else {
+    } else {
         allow_max_with_ = base_.allow_max_width;
     }
 
@@ -516,8 +515,8 @@ void MainWidget::insert_one_line(Element_t* ele, int row)
             // wgItem->setCheckState(Qt::Checked);
         }
         QString sda(data);
-        int dwidth = metrics_->horizontalAdvance(sda) + blank_with_;
-        int need_set_width = dwidth > allow_max_with_ ? allow_max_with_ : dwidth;
+        int     dwidth = metrics_->horizontalAdvance(sda) + blank_with_;
+        int     need_set_width = dwidth > allow_max_with_ ? allow_max_with_ : dwidth;
         col_with_[i] = col_with_[i] < need_set_width ? need_set_width : col_with_[i];
         wgItem->setText(sda);
         tab_widget_->setItem(row, i, wgItem);
@@ -650,17 +649,14 @@ void MainWidget::copy_multi_data()
         return;
     }
     std::vector<OperElement*> vec;
-    
+
     if (ui->rbAllPage->isChecked()) {
         get_related_elements(vec, AREA_ALL_PAGE);
-    }
-    else if (ui->rbReplaceSelect->isChecked()) {
+    } else if (ui->rbReplaceSelect->isChecked()) {
         get_related_elements(vec, AREA_SELECT);
-    }
-    else if (ui->rbRepCurPage->isChecked()) {
+    } else if (ui->rbRepCurPage->isChecked()) {
         get_related_elements(vec, AREA_CUR_PAGE);
-    }
-    else {
+    } else {
         get_related_elements(vec, AREA_ALL);
     }
 
diff --git a/MainWidget.ui b/MainWidget.ui
index 554e782..f293774 100644
--- a/MainWidget.ui
+++ b/MainWidget.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>1279</width>
-    <height>805</height>
+    <width>1048</width>
+    <height>682</height>
    </rect>
   </property>
   <property name="windowTitle">