diff --git a/0001-fix-translation-problem-of-ukui-panel.patch b/0001-fix-translation-problem-of-ukui-panel.patch new file mode 100644 index 0000000..8177e4f --- /dev/null +++ b/0001-fix-translation-problem-of-ukui-panel.patch @@ -0,0 +1,38 @@ +From c597f6c0b035ff6d0f6e4b1b129691ecc01d0896 Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Mon, 9 Jan 2023 16:12:14 +0800 +Subject: [PATCH] fix translation problem of ukui-panel + +--- + cmake/UkuiPluginTranslationTs.cmake | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/cmake/UkuiPluginTranslationTs.cmake b/cmake/UkuiPluginTranslationTs.cmake +index 6409d30..3faa70e 100644 +--- a/cmake/UkuiPluginTranslationTs.cmake ++++ b/cmake/UkuiPluginTranslationTs.cmake +@@ -12,17 +12,17 @@ endif() + if(EXISTS ${TS_FILES}) + message(STATUS "${TS_FILES} is EXISTS") + execute_process( +- COMMAND lupdate -recursive ${CMAKE_CURRENT_SOURCE_DIR} -target-language zh_CN -ts ${TS_FILES} ++ COMMAND lupdate-qt5 -recursive ${CMAKE_CURRENT_SOURCE_DIR} -target-language zh_CN -ts ${TS_FILES} + ) + execute_process( +- COMMAND lrelease ${TS_FILES} ++ COMMAND lrelease-qt5 ${TS_FILES} + ) + else() + execute_process( +- COMMAND lupdate -recursive ${CMAKE_CURRENT_SOURCE_DIR} -target-language zh_CN -ts ${TS_FILES} ++ COMMAND lupdate-qt5 -recursive ${CMAKE_CURRENT_SOURCE_DIR} -target-language zh_CN -ts ${TS_FILES} + ) + execute_process( +- COMMAND lrelease ${TS_FILES} ++ COMMAND lrelease-qt5 ${TS_FILES} + ) + endif() + +-- +2.33.0 + diff --git a/0001-modify-show-taskview-not-translation.patch b/0001-modify-show-taskview-not-translation.patch deleted file mode 100644 index fd13f58..0000000 --- a/0001-modify-show-taskview-not-translation.patch +++ /dev/null @@ -1,53 +0,0 @@ -From f99aba2d59c3a095be8e0555026198482c6e09c0 Mon Sep 17 00:00:00 2001 -From: pei-jiankang -Date: Fri, 4 Mar 2022 11:09:50 +0800 -Subject: [PATCH] modify-show-taskview-not-translation - ---- - panel/resources/ukui-panel_zh_CN.ts | 2 +- - plugin-startbar/taskview_button.cpp | 2 +- - plugin-startbar/taskview_button.h | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/panel/resources/ukui-panel_zh_CN.ts b/panel/resources/ukui-panel_zh_CN.ts -index 12c1c15..c285273 100644 ---- a/panel/resources/ukui-panel_zh_CN.ts -+++ b/panel/resources/ukui-panel_zh_CN.ts -@@ -730,7 +730,7 @@ - - - Show Taskview -- -+ 显示任务视图按钮 - - - -diff --git a/plugin-startbar/taskview_button.cpp b/plugin-startbar/taskview_button.cpp -index 2924509..9da8a7e 100644 ---- a/plugin-startbar/taskview_button.cpp -+++ b/plugin-startbar/taskview_button.cpp -@@ -7,7 +7,7 @@ TaskViewButton::TaskViewButton(IUKUIPanelPlugin *plugin,QWidget *parent): - this->setParent(parent); - setFocusPolicy(Qt::NoFocus); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); -- this->setToolTip(tr("Show Taskview")); -+ QTimer::singleShot(5000,[this] {this->setToolTip(tr("Show Taskview")); }); - this->setStyle(new CustomStyle()); - this->setIcon(QIcon::fromTheme("taskview",QIcon("/usr/share/ukui-panel/panel/img/taskview.svg"))); - this->setIconSize(QSize(mPlugin->panel()->iconSize(),mPlugin->panel()->iconSize())); -diff --git a/plugin-startbar/taskview_button.h b/plugin-startbar/taskview_button.h -index df6c617..400bc21 100644 ---- a/plugin-startbar/taskview_button.h -+++ b/plugin-startbar/taskview_button.h -@@ -3,7 +3,7 @@ - - #include - #include -- -+#include - #include "../panel/customstyle.h" - #include "../panel/iukuipanelplugin.h" - class TaskViewButton :public QToolButton --- -2.33.0 - diff --git a/0002-fix-translation-of-calendar.patch b/0002-fix-translation-of-calendar.patch new file mode 100644 index 0000000..4679f69 --- /dev/null +++ b/0002-fix-translation-of-calendar.patch @@ -0,0 +1,36 @@ +From 1727c034ae8f43ba607d75503e0d9840bdf497cd Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Tue, 17 Jan 2023 10:12:33 +0800 +Subject: [PATCH] fix translation of calendar + +--- + plugin-calendar/lunarcalendarwidget/lunarcalendarwidget.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/plugin-calendar/lunarcalendarwidget/lunarcalendarwidget.cpp b/plugin-calendar/lunarcalendarwidget/lunarcalendarwidget.cpp +index 4c5e743..40686e8 100644 +--- a/plugin-calendar/lunarcalendarwidget/lunarcalendarwidget.cpp ++++ b/plugin-calendar/lunarcalendarwidget/lunarcalendarwidget.cpp +@@ -606,8 +606,8 @@ void LunarCalendarWidget::setLocaleCalendar() + { + + QStringList res = getLocale(); +- qDebug()<<"设置区域:"<setText("周日"); +@@ -671,6 +671,8 @@ QStringList LunarCalendarWidget::getLocale() + } + if(language.isEmpty() && propertyMap.keys().contains("Language")) { + language = propertyMap.find("Language").value().toString(); ++ if(language.isEmpty()) ++ language = QLocale::system().name(); + } + } else { + qDebug() << "reply failed"; +-- +2.33.0 + diff --git a/0002-tran-to-zh_cn.patch b/0002-tran-to-zh_cn.patch deleted file mode 100644 index 0d88177..0000000 --- a/0002-tran-to-zh_cn.patch +++ /dev/null @@ -1,156 +0,0 @@ -From 713b2841c87cd4908872a679cb5f7dfa8dbd46c2 Mon Sep 17 00:00:00 2001 -From: pei-jiankang -Date: Wed, 16 Mar 2022 15:00:08 +0800 -Subject: [PATCH] tran to zh_cn - ---- - panel/resources/ukui-panel_zh_CN.ts | 38 ++++++++++++++--------------- - 1 file changed, 19 insertions(+), 19 deletions(-) - -diff --git a/panel/resources/ukui-panel_zh_CN.ts b/panel/resources/ukui-panel_zh_CN.ts -index c285273..726e77b 100644 ---- a/panel/resources/ukui-panel_zh_CN.ts -+++ b/panel/resources/ukui-panel_zh_CN.ts -@@ -181,21 +181,21 @@ - - - Year -- -+ - - - - - - Month -- -+ - - - - - - Today -- -+ 今天 - - - -@@ -209,85 +209,85 @@ - - - Sun -- -+ 星期日 - - - - - Mon -- -+ 星期一 - - - - - Tue -- -+ 星期二 - - - - - Wed -- -+ 星期三 - - - - - Thur -- -+ 星期四 - - - - - Fri -- -+ 星期五 - - - - - Sat -- -+ 星期六 - - - - - Sunday -- -+ 星期日 - - - - - Monday -- -+ 星期一 - - - - - Tuesday -- -+ 星期二 - - - - - Wednesday -- -+ 星期三 - - - - - Thursday -- -+ 星期四 - - - - - Friday -- -+ 星期五 - - - - - Saturday -- -+ 星期六 - - - -@@ -1033,12 +1033,12 @@ Do you want to remove this panel? - - - delete from taskbar -- -+ 从任务栏取消固定 - - - - add to taskbar -- -+ 添加到任务栏 - - - --- -2.33.0 - diff --git a/0003-fix-nightnode-button-nodisplay.patch b/0003-fix-nightnode-button-nodisplay.patch new file mode 100644 index 0000000..b1843c4 --- /dev/null +++ b/0003-fix-nightnode-button-nodisplay.patch @@ -0,0 +1,31 @@ +From 70d2c46fb369b4905be2d71c9f3cb581d83f2ddd Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Tue, 31 Jan 2023 17:30:13 +0800 +Subject: [PATCH] fix nightnode button nodisplay + +--- + plugin-nightmode/nightmode.cpp | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/plugin-nightmode/nightmode.cpp b/plugin-nightmode/nightmode.cpp +index 827bb02..a833b50 100644 +--- a/plugin-nightmode/nightmode.cpp ++++ b/plugin-nightmode/nightmode.cpp +@@ -115,14 +115,6 @@ NightModeButton::NightModeButton( IUKUIPanelPlugin *plugin, QWidget* parent): + m_gtkstyleGsettings = new QGSettings(gtkstyleid); + } + +- QDBusInterface iproperty("org.ukui.KWin", +- "/ColorCorrect", +- "org.ukui.kwin.ColorCorrect", +- QDBusConnection::sessionBus()); +- +- if (!iproperty.isValid()) { +- this->setVisible(false); +- } + QDBusConnection::sessionBus().connect(QString(), + QString("/ColorCorrect"), + "org.ukui.kwin.ColorCorrect", +-- +2.33.0 + diff --git a/0003-modify-close-ShowTaskview-no-replay.patch b/0003-modify-close-ShowTaskview-no-replay.patch deleted file mode 100644 index 427b602..0000000 --- a/0003-modify-close-ShowTaskview-no-replay.patch +++ /dev/null @@ -1,110 +0,0 @@ -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/0004-fix-the-backlight-of-nightmode-button.patch b/0004-fix-the-backlight-of-nightmode-button.patch new file mode 100644 index 0000000..4cfd782 --- /dev/null +++ b/0004-fix-the-backlight-of-nightmode-button.patch @@ -0,0 +1,25 @@ +From f55995216f816ab8b8e61e82b83f81485348f6b7 Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Thu, 16 Mar 2023 17:24:20 +0800 +Subject: [PATCH] fix the backlight of nightmode button + +--- + panel/img/nightmode-light.svg | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/panel/img/nightmode-light.svg b/panel/img/nightmode-light.svg +index b1cc251..ffd17f3 100644 +--- a/panel/img/nightmode-light.svg ++++ b/panel/img/nightmode-light.svg +@@ -3,7 +3,7 @@ + + + + +-- +2.39.1 + diff --git a/0004-modify-lunarcalendar-display-error.patch b/0004-modify-lunarcalendar-display-error.patch deleted file mode 100644 index fa8f485..0000000 --- a/0004-modify-lunarcalendar-display-error.patch +++ /dev/null @@ -1,350 +0,0 @@ -From 1b4f782534346e5360e05e78d9e3a1885b36a18f Mon Sep 17 00:00:00 2001 -From: pei-jiankang -Date: Mon, 28 Mar 2022 15:58:21 +0800 -Subject: [PATCH] modify lunarcalendar display error - ---- - plugin-calendar/CMakeLists.txt | 3 + - plugin-calendar/html/hlnew/hl2021.js | 4 +- - plugin-calendar/html/hlnew/hl2022.js | 2 +- - plugin-calendar/html/jiejiari.js | 13 ++- - .../lunarcalendarwidget/lunarcalendaritem.cpp | 95 +++++++++++-------- - .../lunarcalendarmonthitem.cpp | 2 +- - .../lunarcalendarwidget.cpp | 55 +++++++---- - .../lunarcalendaryearitem.cpp | 4 +- - 8 files changed, 109 insertions(+), 69 deletions(-) - -diff --git a/plugin-calendar/CMakeLists.txt b/plugin-calendar/CMakeLists.txt -index f6cb668..bfe257a 100644 ---- a/plugin-calendar/CMakeLists.txt -+++ b/plugin-calendar/CMakeLists.txt -@@ -48,4 +48,7 @@ link_libraries(glib-2.0.so) - include(../cmake/UkuiPluginTranslationTs.cmake) - ukui_plugin_translate_ts(${PLUGIN}) - -+install(DIRECTORY html/ -+ DESTINATION ${PACKAGE_DATA_DIR}/plugin-calendar/html) -+ - BUILD_UKUI_PLUGIN(${PLUGIN}) -diff --git a/plugin-calendar/html/hlnew/hl2021.js b/plugin-calendar/html/hlnew/hl2021.js -index 3dc5a2e..86c62f3 100644 ---- a/plugin-calendar/html/hlnew/hl2021.js -+++ b/plugin-calendar/html/hlnew/hl2021.js -@@ -1742,7 +1742,7 @@ - }, - "d1020": { - "y": "搬家.装修.开业.结婚.领证.开工.动土.出行.", -- "j": "入宅.安床.订婚.安葬.上梁.破土.祈福.祭祀.kylin@UK:~入宅.安床.订婚.安葬.上梁.破土.祈福.祭祀..", -+ "j": "入宅.安床.订婚.安葬.上梁.破土.祈福.祭祀.", - "c": "生肖冲虎", - "s": "煞南", - "ch": "开", -@@ -2021,7 +2021,7 @@ - }, - "d1120": { - "y": "搬家.装修.结婚.领证.动土.订婚.入学.求嗣.", -- "j": "开业.开工.安床.出行.安葬.上梁.开张.旅游.kylin@UK:~.", -+ "j": "开业.开工.安床.出行.安葬.上梁.开张.旅游.", - "c": "生肖冲鸡", - "s": "煞西", - "ch": "定", -diff --git a/plugin-calendar/html/hlnew/hl2022.js b/plugin-calendar/html/hlnew/hl2022.js -index 69d1f36..3d08118 100644 ---- a/plugin-calendar/html/hlnew/hl2022.js -+++ b/plugin-calendar/html/hlnew/hl2022.js -@@ -76,7 +76,7 @@ - "j": "伐木." - }, - "d0120": { --"y": "搬家.装修.结婚.入宅.", -+"y": "搬家.装修.结婚.", - "j": "入宅." - }, - "d0121": { -diff --git a/plugin-calendar/html/jiejiari.js b/plugin-calendar/html/jiejiari.js -index 79a4b59..ca2569b 100644 ---- a/plugin-calendar/html/jiejiari.js -+++ b/plugin-calendar/html/jiejiari.js -@@ -25,7 +25,16 @@ - "d1001":"2","d1002":"2","d1003":"2","d1004":"2","d1005":"2","d1006":"2","d1007":"2","d1009":"1" - }, - "worktime.y2022":{ -- "d0101":"2","d0102":"2", -- "d0131":"2","d0201":"2","d0202":"2","d0203":"2","d0204":"2","d0205":"2" -+ "d0101":"2","d0102":"2","d0103":"2","d0129":"1","d0130":"1","d0131":"2", -+ "d0201":"2","d0202":"2","d0203":"2","d0204":"2","d0205":"2","d0206":"2", -+ "d0402":"1","d0403":"2","d0404":"2","d0405":"2","d0424":"1","d0430":"2", -+ "d0501":"2","d0502":"2","d0503":"2","d0504":"2","d0507":"1", -+ "d0603":"2","d0604":"2","d0605":"2", -+ "d0910":"2","d0911":"2","d0912":"2", -+ "d1001":"2","d1002":"2","d1003":"2","d1004":"2","d1005":"2","d1006":"2","d1007":"2","d1008":"1","d1009":"1" -+ -+ }, -+"worktime.y2023":{ -+ "d0101":"2","d0102":"2","d0103":"2" - } - } -diff --git a/plugin-calendar/lunarcalendarwidget/lunarcalendaritem.cpp b/plugin-calendar/lunarcalendarwidget/lunarcalendaritem.cpp -index 6df1d1f..ea34cd8 100644 ---- a/plugin-calendar/lunarcalendarwidget/lunarcalendaritem.cpp -+++ b/plugin-calendar/lunarcalendarwidget/lunarcalendaritem.cpp -@@ -78,7 +78,7 @@ LunarCalendarItem::LunarCalendarItem(QWidget *parent) : QWidget(parent) - - currentBgColor = QColor(255, 255, 255); - otherBgColor = QColor(240, 240, 240); -- selectBgColor = QColor(55,143,250); -+ selectBgColor = QColor(55,144,250); - hoverBgColor = QColor(204, 183, 180); - } - -@@ -239,28 +239,37 @@ void LunarCalendarItem::drawDay(QPainter *painter) - font.setBold(true); - painter->setFont(font); - -+ QLocale locale = (QLocale::system().name() == "zh_CN" ? (QLocale::Chinese) : (QLocale::English)); - //代码复用率待优化 - if (showLunar) { - QRect dayRect = QRect(0, 0, width, height / 1.7); - painter->drawText(dayRect, Qt::AlignHCenter | Qt::AlignBottom, QString::number(date.day())); - if (handleJsMap(date.toString("yyyy"),date.toString("MMdd")) == "2") { - painter->setPen(Qt::NoPen); -- painter->setBrush(QColor(244,78,80)); -+ if(locale == QLocale::Chinese){ -+ painter->setBrush(QColor(244,78,80)); -+ } - QRect dayRect1 = QRect(0, 0, width/3.5,height/3.5); - painter->drawRoundedRect(dayRect1,1,1); - font.setPixelSize(side / 5); - painter->setFont(font); - painter->setPen(Qt::white); -- painter->drawText(dayRect1, Qt::AlignHCenter | Qt::AlignBottom,"休"); -+ if(locale == QLocale::Chinese){ -+ painter->drawText(dayRect1, Qt::AlignHCenter | Qt::AlignBottom,"休"); -+ } - } else if (handleJsMap(date.toString("yyyy"),date.toString("MMdd")) == "1") { - painter->setPen(Qt::NoPen); -- painter->setBrush(QColor(251,170,42)); -+ if(locale == QLocale::Chinese){ -+ painter->setBrush(QColor(251,170,42)); -+ } - QRect dayRect1 = QRect(0, 0, width/3.5,height/3.5); - painter->drawRoundedRect(dayRect1,1,1); - font.setPixelSize(side / 5); - painter->setFont(font); - painter->setPen(Qt::white); -- painter->drawText(dayRect1, Qt::AlignHCenter | Qt::AlignBottom,"班"); -+ if(locale == QLocale::Chinese){ -+ painter->drawText(dayRect1, Qt::AlignHCenter | Qt::AlignBottom,"班"); -+ } - } - } - else { -@@ -300,6 +309,8 @@ void LunarCalendarItem::drawLunar(QPainter *painter) - int day; - QString strHoliday; - -+ QLocale locale = (QLocale::system().name() == "zh_CN" ? (QLocale::Chinese) : (QLocale::English)); -+ qDebug()<<"LunarCalendarItem语言模式:"<save(); - - if (!showLunar) { -@@ -324,44 +335,44 @@ void LunarCalendarItem::drawLunar(QPainter *painter) - // painter->drawText(lunarRect, Qt::AlignCenter, strHoliday); - } - else { -- -- QStringList listDayName; -- listDayName << "*" << "初一" << "初二" << "初三" << "初四" << "初五" << "初六" << "初七" << "初八" << "初九" << "初十" -- << "十一" << "十二" << "十三" << "十四" << "十五" << "十六" << "十七" << "十八" << "十九" << "二十" -- << "廿一" << "廿二" << "廿三" << "廿四" << "廿五" << "廿六" << "廿七" << "廿八" << "廿九" << "三十"; -- -- //判断当前农历文字是否节日,是节日且是当月则用农历节日颜色显示 -- bool exist = (!listDayName.contains(lunar) && dayType != DayType_MonthPre && dayType != DayType_MonthNext); -- -- //根据当前类型选择对应的颜色 -- QColor color = currentLunarColor; -- if (dayType == DayType_MonthPre || dayType == DayType_MonthNext) { -- color = otherLunarColor; -- } -- --// if (select) { --// color = selectTextColor; --// } /*else if (hover) { --// color = hoverTextColor; --// }*/ else if (exist) { --// color = lunarColor; --// } -- -- if (exist) { -- color = lunarColor; -- } -- -- painter->setPen(color); -- -- QFont font; -- font.setPixelSize(side * 0.27); -- painter->setFont(font); -- -- QRect lunarRect(0, height / 2, width, height / 2); -- painter->drawText(lunarRect, Qt::AlignCenter, lunar); -+ if(locale == QLocale::Chinese){ -+ QStringList listDayName; -+ listDayName << "*" << "初一" << "初二" << "初三" << "初四" << "初五" << "初六" << "初七" << "初八" << "初九" << "初十" -+ << "十一" << "十二" << "十三" << "十四" << "十五" << "十六" << "十七" << "十八" << "十九" << "二十" -+ << "廿一" << "廿二" << "廿三" << "廿四" << "廿五" << "廿六" << "廿七" << "廿八" << "廿九" << "三十"; -+ -+ //判断当前农历文字是否节日,是节日且是当月则用农历节日颜色显示 -+ bool exist = (!listDayName.contains(lunar) && dayType != DayType_MonthPre && dayType != DayType_MonthNext); -+ -+ //根据当前类型选择对应的颜色 -+ QColor color = currentLunarColor; -+ if (dayType == DayType_MonthPre || dayType == DayType_MonthNext) { -+ color = otherLunarColor; -+ } -+ -+ // if (select) { -+ // color = selectTextColor; -+ // } /*else if (hover) { -+ // color = hoverTextColor; -+ // }*/ else if (exist) { -+ // color = lunarColor; -+ // } -+ -+ if (exist) { -+ color = lunarColor; -+ } -+ -+ painter->setPen(color); -+ -+ QFont font; -+ font.setPixelSize(side * 0.27); -+ painter->setFont(font); -+ -+ QRect lunarRect(0, height / 2, width, height / 2); -+ painter->drawText(lunarRect, Qt::AlignCenter, lunar); -+ } -+ painter->restore(); - } -- painter->restore(); -- - } - - -diff --git a/plugin-calendar/lunarcalendarwidget/lunarcalendarmonthitem.cpp b/plugin-calendar/lunarcalendarwidget/lunarcalendarmonthitem.cpp -index 6cfe449..e7a046b 100644 ---- a/plugin-calendar/lunarcalendarwidget/lunarcalendarmonthitem.cpp -+++ b/plugin-calendar/lunarcalendarwidget/lunarcalendarmonthitem.cpp -@@ -200,7 +200,7 @@ void LunarCalendarMonthItem::drawMonth(QPainter *painter) - painter->setFont(font); - - QRect dayRect = QRect(0, 0, width, height / 1.7); -- QString arg = QString::number(date.month()) +"月"; -+ QString arg = QString::number(date.month()) /*+"月"*/; - painter->drawText(dayRect, Qt::AlignHCenter | Qt::AlignBottom, arg); - painter->restore(); - } -diff --git a/plugin-calendar/lunarcalendarwidget/lunarcalendarwidget.cpp b/plugin-calendar/lunarcalendarwidget/lunarcalendarwidget.cpp -index ddfd1db..ca6cb02 100644 ---- a/plugin-calendar/lunarcalendarwidget/lunarcalendarwidget.cpp -+++ b/plugin-calendar/lunarcalendarwidget/lunarcalendarwidget.cpp -@@ -32,10 +32,18 @@ LunarCalendarWidget::LunarCalendarWidget(QWidget *parent) : QWidget(parent) - connect(calendar_gsettings, &QGSettings::changed, this, [=] (const QString &key){ - if(key == LUNAR_KEY){ - if(calendar_gsettings->get("calendar").toString() == "lunar") { -- //农历 -- lunarstate = true; -- labWidget->setVisible(true); -- yijiWidget->setVisible(true); -+ QLocale locale = (QLocale::system().name() == "zh_CN" ? (QLocale::Chinese) : (QLocale::English)); -+ if(locale == QLocale::Chinese){ -+ //农历模式且是中文模式 -+ lunarstate = true; -+ labWidget->setVisible(true); -+ yijiWidget->setVisible(true); -+ }else{ -+ qDebug()<<"农历模式但非中文模式则不能显示农历相关"; -+ lunarstate = false; -+ labWidget->setVisible(false); -+ yijiWidget->setVisible(false); -+ } - } else { - //公历 - lunarstate = false; -@@ -43,7 +51,7 @@ LunarCalendarWidget::LunarCalendarWidget(QWidget *parent) : QWidget(parent) - yijiWidget->setVisible(false); - } - _timeUpdate(); -- } -+ } - if(key == "date") { - if(calendar_gsettings->get("date").toString() == "cn"){ - dateShowMode = "yyyy/MM/dd dddd"; -@@ -110,20 +118,29 @@ LunarCalendarWidget::LunarCalendarWidget(QWidget *parent) : QWidget(parent) - timeShow->setContentsMargins(0, 0, 0, 0); - initWidget(); - -- if(QGSettings::isSchemaInstalled(calendar_id)){ -- //初始化农历/公历显示方式 -- if(calendar_gsettings->get("calendar").toString() == "lunar") { -- //农历 -- lunarstate = true; -- labWidget->setVisible(true); -- yijiWidget->setVisible(true); -- } else { -- //公历 -- lunarstate = false; -- labWidget->setVisible(false); -- yijiWidget->setVisible(false); -- } -- } -+ if(QGSettings::isSchemaInstalled(calendar_id)){ -+ //初始化农历/公历显示方式 -+ if(calendar_gsettings->get("calendar").toString() == "lunar") { -+ QLocale locale = (QLocale::system().name() == "zh_CN" ? (QLocale::Chinese) : (QLocale::English)); -+ qDebug()<<"语言模式2:"<setVisible(true); -+ yijiWidget->setVisible(true); -+ }else{ -+ qDebug()<<"农历模式但非中文模式则不能显示农历相关"; -+ lunarstate = false; -+ labWidget->setVisible(false); -+ yijiWidget->setVisible(false); -+ } -+ } else { -+ //公历 -+ lunarstate = false; -+ labWidget->setVisible(false); -+ yijiWidget->setVisible(false); -+ } -+ } - - - //切换主题 -diff --git a/plugin-calendar/lunarcalendarwidget/lunarcalendaryearitem.cpp b/plugin-calendar/lunarcalendarwidget/lunarcalendaryearitem.cpp -index ca3d6a2..150f27e 100644 ---- a/plugin-calendar/lunarcalendarwidget/lunarcalendaryearitem.cpp -+++ b/plugin-calendar/lunarcalendarwidget/lunarcalendaryearitem.cpp -@@ -76,7 +76,7 @@ LunarCalendarYearItem::LunarCalendarYearItem(QWidget *parent) : QWidget(parent) - - currentBgColor = QColor(255, 255, 255); - otherBgColor = QColor(240, 240, 240); -- selectBgColor = QColor(55,143,250); -+ selectBgColor = QColor(55,144,250); - hoverBgColor = QColor(204, 183, 180); - } - -@@ -199,7 +199,7 @@ void LunarCalendarYearItem::drawYear(QPainter *painter) - painter->setFont(font); - - QRect dayRect = QRect(0, 0, width, height / 1.7); -- QString arg = QString::number(date.year()) + "年"; -+ QString arg = QString::number(date.year()) /*+ "年"*/; - painter->drawText(dayRect, Qt::AlignHCenter | Qt::AlignBottom, arg); - painter->restore(); - } --- -2.33.0 - diff --git a/0005-modify-the-button-problem-of-ukui-panel.patch b/0005-modify-the-button-problem-of-ukui-panel.patch deleted file mode 100644 index 8ede3b4..0000000 --- a/0005-modify-the-button-problem-of-ukui-panel.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 34e86cb6e9ec5fd0a30b1ce4fa985bd785b927e6 Mon Sep 17 00:00:00 2001 -From: pei-jiankang -Date: Thu, 31 Mar 2022 15:40:49 +0800 -Subject: [PATCH] modify the button problem of ukui-panel - ---- - plugin-statusnotifier/statusnotifierbutton.cpp | 6 ++++++ - plugin-statusnotifier/statusnotifierbutton.h | 1 + - 2 files changed, 7 insertions(+) - -diff --git a/plugin-statusnotifier/statusnotifierbutton.cpp b/plugin-statusnotifier/statusnotifierbutton.cpp -index 473ee0c..7fd5968 100644 ---- a/plugin-statusnotifier/statusnotifierbutton.cpp -+++ b/plugin-statusnotifier/statusnotifierbutton.cpp -@@ -359,6 +359,12 @@ void StatusNotifierButton::dragMoveEvent(QDragMoveEvent * e) - - } - -+void StatusNotifierButton::dragLeaveEvent(QDragLeaveEvent *e) -+{ -+ update(); //拖拽离开wigget时,需要updata -+ e->accept(); -+} -+ - void StatusNotifierButton::dragEnterEvent(QDragEnterEvent *e) - { - e->acceptProposedAction(); -diff --git a/plugin-statusnotifier/statusnotifierbutton.h b/plugin-statusnotifier/statusnotifierbutton.h -index b4d5b33..ee8433c 100644 ---- a/plugin-statusnotifier/statusnotifierbutton.h -+++ b/plugin-statusnotifier/statusnotifierbutton.h -@@ -105,6 +105,7 @@ protected: - void mouseReleaseEvent(QMouseEvent *event); - void wheelEvent(QWheelEvent *event); - void dragEnterEvent(QDragEnterEvent *e); -+ void dragLeaveEvent(QDragLeaveEvent *e); - void dragMoveEvent(QDragMoveEvent * e); - void mouseMoveEvent(QMouseEvent *e); - void mousePressEvent(QMouseEvent *e); --- -2.33.0 - diff --git a/fix-panel-translation.patch b/fix-panel-translation.patch deleted file mode 100644 index f00f883..0000000 --- a/fix-panel-translation.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Naur ukui-panel-3.0.6/panel/common/ukuitranslator.cpp ukui-panel-3.0.6~/panel/common/ukuitranslator.cpp ---- ukui-panel-3.0.6/panel/common/ukuitranslator.cpp 2021-11-04 16:31:03.000000000 +0800 -+++ ukui-panel-3.0.6~/panel/common/ukuitranslator.cpp 2022-02-24 17:55:45.588512011 +0800 -@@ -52,7 +52,9 @@ - searchPath = new QStringList(); - *searchPath << XdgDirs::dataDirs(QL1C('/') + QL1S(UKUI_RELATIVE_SHARE_TRANSLATIONS_DIR)); - *searchPath << QL1S(UKUI_SHARE_TRANSLATIONS_DIR); -- searchPath->removeDuplicates(); -+ *searchPath << "/usr/share/ukui/ukui-panel/"; -+ *searchPath << "/usr/share/ukui-panel/panel/resources/"; -+ searchPath->removeDuplicates(); - } - - return searchPath; diff --git a/ukui-panel-3.0.6.tar.gz b/ukui-panel-3.0.6.tar.gz deleted file mode 100644 index 794d8aa..0000000 Binary files a/ukui-panel-3.0.6.tar.gz and /dev/null differ diff --git a/ukui-panel-3.1.0.tar.gz b/ukui-panel-3.1.0.tar.gz new file mode 100644 index 0000000..6deaf65 Binary files /dev/null and b/ukui-panel-3.1.0.tar.gz differ diff --git a/ukui-panel.spec b/ukui-panel.spec index 6f1c70d..45e7e81 100644 --- a/ukui-panel.spec +++ b/ukui-panel.spec @@ -1,19 +1,14 @@ -%define debug_package %{nil} - Name: ukui-panel -Version: 3.0.6 +Version: 3.1.0 Release: 8 Summary: ukui desktop panel -License: LGPL-2.1+ GPL-2+ LGPL-3 +License: LGPL-2.0-or-later and GPL-2.0-or-later and BSD URL: http://www.ukui.org Source0: %{name}-%{version}.tar.gz -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 -Patch4: 0004-modify-lunarcalendar-display-error.patch -Patch5: 0005-modify-the-button-problem-of-ukui-panel.patch +Patch01: 0001-fix-translation-problem-of-ukui-panel.patch +Patch02: 0002-fix-translation-of-calendar.patch +Patch03: 0003-fix-nightnode-button-nodisplay.patch +Patch04: 0004-fix-the-backlight-of-nightmode-button.patch BuildRequires: cmake BuildRequires: alsa-lib-devel @@ -25,11 +20,8 @@ BuildRequires: kf5-kwindowsystem-devel BuildRequires: pulseaudio-libs-devel BuildRequires: qt5-qtsvg-devel BuildRequires: qt5-qtx11extras-devel -BuildRequires: lm_sensors-devel -BuildRequires: libstatgrab-devel BuildRequires: libsysstat-devel >= 0.4.2 BuildRequires: libX11-devel -#BuildRequires: libxcb-damage0-dev BuildRequires: xcb-util-devel BuildRequires: libxcb-devel BuildRequires: libXcomposite-devel @@ -46,14 +38,16 @@ BuildRequires: libpeony-dev BuildRequires: dconf-devel BuildRequires: libpeony-dev BuildRequires: libXtst-devel -BuildRequires: libX11-devel BuildRequires: libudisks2-devel BuildRequires: xcb-util-renderutil-devel BuildRequires: xcb-util-image-devel BuildRequires: libxcb-devel +BuildRequires: ukui-interface Provides: ukui-indicators +Recommends: ukui-window-switch +Recommends: time-shutdown %description The ukui desktop panel is used on ukui desktop and has some plugins like @@ -62,13 +56,10 @@ Provides: ukui-indicators %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -cp -rf %{SOURCE1} %{_builddir}/%{name}-%{version}/panel/resources +%patch01 -p1 +%patch02 -p1 +%patch03 -p1 +%patch04 -p1 %build mkdir build && cd build @@ -91,29 +82,41 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/* %changelog -* Thu Mar 31 2022 pei-jiankang - 3.0.6-8 -- modify the button problem of ukui-panel +* Thu Mar 16 2023 peijiankang - 3.1.0-8 +- fix the backlight of nightmode button -* Mon Mar 28 2022 pei-jiankang - 3.0.6-7 -- modify lunarcalendar display error +* Tue Feb 07 2023 tanyulong - 3.1.0-7 +- Enable debuginfo for fix strip -* Mon Mar 28 2022 pei-jiankang - 3.0.6-6 -- modify close ShowTaskview no replay +* Tue Jan 31 2023 peijiankang - 3.1.0-6 +- fix nightnode button nodisplay -* Wed Mar 16 2022 pei-jiankang - 3.0.6-5 -- trans to zh_cn +* Tue Jan 17 2023 peijiankang - 3.1.0-5 +- fix translation of calendar -* Fri Mar 4 2022 pei-jiankang - 3.0.6-4 -- change ukui-panel_zh_CN.qm +* Mon Jan 9 2023 peijiankang - 3.1.0-4 +- fix translation problem of ukui-panel -* Fri Mar 4 2022 pei-jiankang - 3.0.6-3 -- modify show-taskview not translation +* Thu Dec 08 2022 huayadong - 3.1.0-3 +- delete Recommends: libkysdk-system -* Fri Feb 25 2022 douyan - 3.0.6-2 -- fix panel translation issue +* Thu Dec 8 2022 douyan - 3.1.0-2 +- update translation -* Wed Jan 26 2022 huayadong - 3.0.6-1 -- update to upstream version 3.0.6-1 +* Wed Nov 9 2022 douyan - 3.1.0-1 +- update to upstream version 3.1.0-29 + +* Wed Apr 06 2022 huayadong - 3.0.2-12 +- 优化预览窗口缩放机制和显示机制,为美观和显示比例考虑,减少最大窗口数从13减少为10个,解决单个小窗口缩放不协调的问题,解决窗口数过多时的图片缩放比例显示问题 + +* Fri May 20 2022 tanyulong - 3.0.2-11 +- Improve the project according to the requirements of compliance improvement + +* Sat Apr 02 2022 tanyulong - 3.0.2-10 +- add yaml file + +* Fri Mar 25 2022 huayadong - 3.0.2-9 +- change BuildRequires: pulseaudio-devel to pulseaudio-libs-devel * Fri Nov 05 2021 tanyulong - 3.0.2-8 - Added changelog file for easy viewing diff --git a/ukui-panel.yaml b/ukui-panel.yaml new file mode 100644 index 0000000..e4c5875 --- /dev/null +++ b/ukui-panel.yaml @@ -0,0 +1,5 @@ +version_control: github +src_repo: UKUI/ukui-panel +tag_prefix: "^v" +separator: "." + diff --git a/ukui-panel_zh_CN.qm b/ukui-panel_zh_CN.qm deleted file mode 100644 index 4cadb93..0000000 Binary files a/ukui-panel_zh_CN.qm and /dev/null differ