From 182a3ff2b75268c15d3f6ad69815971a3f02abe7 Mon Sep 17 00:00:00 2001 From: pei-jiankang Date: Mon, 28 Mar 2022 16:17:11 +0800 Subject: [PATCH] modify close ShowTaskview no replay --- ...-modify-close-ShowTaskview-no-replay.patch | 110 ++++++++++++++++++ ukui-panel.spec | 7 +- 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 0003-modify-close-ShowTaskview-no-replay.patch diff --git a/0003-modify-close-ShowTaskview-no-replay.patch b/0003-modify-close-ShowTaskview-no-replay.patch new file mode 100644 index 0000000..427b602 --- /dev/null +++ b/0003-modify-close-ShowTaskview-no-replay.patch @@ -0,0 +1,110 @@ +From fc05b2c7a20bdcd12fd64e84dbbc8911045e531e Mon Sep 17 00:00:00 2001 +From: pei-jiankang +Date: Mon, 28 Mar 2022 15:31:38 +0800 +Subject: [PATCH] modify close ShowTaskview no replay + +--- + plugin-startbar/startbar.cpp | 40 +++++++++++++++++++++++++++++++----- + plugin-startbar/startbar.h | 1 + + 2 files changed, 36 insertions(+), 5 deletions(-) + +diff --git a/plugin-startbar/startbar.cpp b/plugin-startbar/startbar.cpp +index 47e1ac8..62078d7 100644 +--- a/plugin-startbar/startbar.cpp ++++ b/plugin-startbar/startbar.cpp +@@ -27,13 +27,16 @@ + #include "../panel/customstyle.h" + #define THEME_QT_SCHEMA "org.ukui.style" + #define THEME_Style_Name "styleName" ++#define UKUI_PANEL_SETTINGS "org.ukui.panel.settings" ++#define SHOW_TASKVIEW "showtaskview" + + UKUIStartbarPlugin::UKUIStartbarPlugin(const IUKUIPanelPluginStartupInfo &startupInfo): + QObject(), + IUKUIPanelPlugin(startupInfo), + mWidget(new UKUIStartBarWidget(this)) + { +- ++ ++ mWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + } + +@@ -57,11 +60,18 @@ UKUIStartBarWidget::UKUIStartBarWidget( IUKUIPanelPlugin *plugin, QWidget* paren + { + translator(); + mStartMenuButton=new StartMenuButton(plugin,this); +- mTaskViewButton=new TaskViewButton(plugin,this); + mLayout=new UKUi::GridLayout(this); + mLayout->addWidget(mStartMenuButton); +- mLayout->addWidget(mTaskViewButton); ++ const QByteArray id(UKUI_PANEL_SETTINGS); ++ if(QGSettings::isSchemaInstalled(id)) { ++ m_gsettings = new QGSettings(id); ++ } ++ connect(m_gsettings, &QGSettings::changed, this, [=] (const QString &key){ ++ if(key==SHOW_TASKVIEW) ++ realign(); ++ }); + ++ realign(); + } + + void UKUIStartBarWidget::translator(){ +@@ -77,19 +87,39 @@ void UKUIStartBarWidget::translator(){ + + UKUIStartBarWidget::~UKUIStartBarWidget() + { ++ mStartMenuButton->deleteLater(); ++ mTaskViewButton->deleteLater(); + } + + /*plugin-startmenu refresh function*/ + void UKUIStartBarWidget::realign() + { ++ if(m_gsettings->get(SHOW_TASKVIEW).toBool()){ ++ if (!this->findChild("TaskViewButton")) { ++ mTaskViewButton=new TaskViewButton(mPlugin,this); ++ mTaskViewButton->setObjectName("TaskViewButton"); ++ mLayout->addWidget(mTaskViewButton); ++ } ++ } else { ++ if (this->findChild("TaskViewButton")) { ++ if (mTaskViewButton != nullptr) { ++ mLayout->removeWidget(mTaskViewButton); ++ mTaskViewButton->deleteLater(); ++ } ++ } else { ++ mStartMenuButton->realign(); ++ return; ++ } ++ } ++ + if (mPlugin->panel()->isHorizontal()){ + mLayout->setColumnCount(mLayout->count()); + mLayout->setRowCount(0); +- this->setFixedSize(mPlugin->panel()->panelSize()*2.3,mPlugin->panel()->panelSize()); ++ // this->setFixedSize(mPlugin->panel()->panelSize()*2.3,mPlugin->panel()->panelSize()); + }else{ + mLayout->setRowCount(mLayout->count()); + mLayout->setColumnCount(0); +- this->setFixedSize(mPlugin->panel()->panelSize(),mPlugin->panel()->panelSize()*2.3); ++ // this->setFixedSize(mPlugin->panel()->panelSize(),mPlugin->panel()->panelSize()*2.3); + } + mStartMenuButton->realign(); + mTaskViewButton->realign(); +diff --git a/plugin-startbar/startbar.h b/plugin-startbar/startbar.h +index e4c4292..368ff9a 100644 +--- a/plugin-startbar/startbar.h ++++ b/plugin-startbar/startbar.h +@@ -92,6 +92,7 @@ private: + TaskViewButton *mTaskViewButton; + UKUi::GridLayout *mLayout; + QTranslator *m_translator; ++ QGSettings *m_gsettings; + private: + void translator(); + +-- +2.33.0 + diff --git a/ukui-panel.spec b/ukui-panel.spec index a1532b9..34c35fb 100644 --- a/ukui-panel.spec +++ b/ukui-panel.spec @@ -2,7 +2,7 @@ Name: ukui-panel Version: 3.0.6 -Release: 5 +Release: 6 Summary: ukui desktop panel License: LGPL-2.1+ GPL-2+ LGPL-3 URL: http://www.ukui.org @@ -11,6 +11,7 @@ Source1: ukui-panel_zh_CN.qm Patch0: fix-panel-translation.patch Patch1: 0001-modify-show-taskview-not-translation.patch Patch2: 0002-tran-to-zh_cn.patch +Patch3: 0003-modify-close-ShowTaskview-no-replay.patch BuildRequires: cmake BuildRequires: alsa-lib-devel @@ -62,6 +63,7 @@ Provides: ukui-indicators %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 cp -rf %{SOURCE1} %{_builddir}/%{name}-%{version}/panel/resources %build @@ -85,6 +87,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/* %changelog +* Mon Mar 28 2022 pei-jiankang - 3.0.6-6 +- modify close ShowTaskview no replay + * Wed Mar 16 2022 pei-jiankang - 3.0.6-5 - trans to zh_cn