From dd189e057abf085bd544fc09f8ccf68b88b0cfa9 Mon Sep 17 00:00:00 2001
From: yangxianzhao <yangxianzhao@uniontech.com>
Date: Fri, 7 Apr 2023 10:20:45 +0800
Subject: [PATCH] Fix abnormal display during terminal screen splitting

---
 src/views/termwidget.cpp     | 12 ------------
 src/views/termwidget.h       |  6 +++---
 src/views/termwidgetpage.cpp |  7 +++++++
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/src/views/termwidget.cpp b/src/views/termwidget.cpp
index e8b4112..15ea98f 100644
--- a/src/views/termwidget.cpp
+++ b/src/views/termwidget.cpp
@@ -565,15 +565,11 @@ inline void TermWidget::onVerticalSplit()
 inline void TermWidget::splitHorizontal()
 {
     parentPage()->split(Qt::Horizontal);
-    //分屏时切换到当前选中主题方案
-    switchThemeOnSplitScreen();
 }
 
 inline void TermWidget::splitVertical()
 {
     parentPage()->split(Qt::Vertical);
-    //分屏时切换到当前选中主题方案
-    switchThemeOnSplitScreen();
 }
 
 inline void TermWidget::onCloseCurrWorkSpace()
@@ -834,14 +830,6 @@ QString TermWidget::getTabTitle(QMap<QString, QString> format, QString TabFormat
     return TabFormat;
 }
 
-void TermWidget::switchThemeOnSplitScreen()
-{
-    QString  expandThemeStr = "";
-    expandThemeStr = Settings::instance()->extendColorScheme();
-    if (!expandThemeStr.isEmpty())
-        emit DApplicationHelper::instance()->themeTypeChanged(DGuiApplicationHelper::instance()->themeType());
-}
-
 void TermWidget::initTabTitle()
 {
     static ushort sessionNumber = 0;
diff --git a/src/views/termwidget.h b/src/views/termwidget.h
index 27b5fb6..3c995c1 100644
--- a/src/views/termwidget.h
+++ b/src/views/termwidget.h
@@ -425,11 +425,11 @@ private:
      * @return
      */
     QString getTabTitle(QMap<QString, QString> format, QString TabFormat);
+
     /**
-     * @brief 分屏时切换到当前选中主题方案
-     * @author ut000125 sunchengxi
+     * @brief 浏览器打开对应的链接
+     * @param strUrl 相关链接
      */
-    void switchThemeOnSplitScreen();
     void openUrl(QString strUrl);
 
     /**
diff --git a/src/views/termwidgetpage.cpp b/src/views/termwidgetpage.cpp
index 4169a79..00d8748 100644
--- a/src/views/termwidgetpage.cpp
+++ b/src/views/termwidgetpage.cpp
@@ -155,6 +155,13 @@ void TermWidgetPage::split(Qt::Orientation orientation)
 
     /******** Add by ut001000 renfeixiang 2020-08-07:新增分屏时改变大小，bug#41436***************/
     parentMainWindow()->updateMinHeight();
+
+    //分屏时切换到当前选中主题方案
+    QString  expandThemeStr = "";
+    expandThemeStr = Settings::instance()->extendColorScheme();
+    if (!expandThemeStr.isEmpty())
+        emit DApplicationHelper::instance()->themeTypeChanged(DGuiApplicationHelper::instance()->themeType());
+
     return ;
 }
 
-- 
2.18.4

