Compare commits

..

No commits in common. "88911d4df50bad6438b924b7ef7c8ec10bb10617" and "0c1dcd8b943618f8efe89bf4f70086b3f59a0a03" have entirely different histories.

28 changed files with 14 additions and 18543 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,685 +0,0 @@
From c4cdc73946990ddfb9aa24e8a394ab77a49baf3e Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Wed, 24 May 2023 12:45:45 +0800
Subject: [PATCH] fix-uninstall-failed-issue
---
.../RightClickMenu/rightclickmenu.cpp | 62 +++-
.../RightClickMenu/rightclickmenu.h | 4 +
translations/ukui-menu_zh_CN.ts | 97 ++++--
translations/ukui-menu_zh_CN.ts_back | 322 ++++++++++++++++++
4 files changed, 442 insertions(+), 43 deletions(-)
create mode 100755 translations/ukui-menu_zh_CN.ts_back
diff --git a/src/UserInterface/RightClickMenu/rightclickmenu.cpp b/src/UserInterface/RightClickMenu/rightclickmenu.cpp
index de3cc85..3db1762 100755
--- a/src/UserInterface/RightClickMenu/rightclickmenu.cpp
+++ b/src/UserInterface/RightClickMenu/rightclickmenu.cpp
@@ -18,11 +18,15 @@
#include "rightclickmenu.h"
#include "src/UtilityFunction/utility.h"
#include <QDebug>
+#include <QMessageBox>
+#include <QKeyEvent>
RightClickMenu::RightClickMenu(QWidget *parent):
QWidget(parent)
{
m_cmdProc = new QProcess;
+ connect(m_cmdProc , &QProcess::readyReadStandardOutput, this , &RightClickMenu::onReadOutput);
+
m_whiteList.append("kylin-screenshot.desktop");
m_whiteList.append("ukui-notebook.desktop");
m_whiteList.append("ukui-clock.desktop");
@@ -177,14 +181,56 @@ void RightClickMenu::addToDesktopActionTriggerSlot()
void RightClickMenu::uninstallActionTriggerSlot()
{
- QString cmd = QString("kylin-uninstaller %1")
- .arg(m_desktopfp.toLocal8Bit().data());
- bool ret = QProcess::startDetached(cmd);
- myDebug() << "卸载:" << cmd << ret;
+ QString cmd=QString("rpm -qf "+m_desktopfp);
+ m_cmdProc->setReadChannel(QProcess::StandardOutput);
+ m_cmdProc->start("sh",QStringList()<<"-c"<<cmd);
+ m_cmdProc->waitForFinished();
+ m_cmdProc->waitForReadyRead();
+ m_cmdProc->close();
+ myDebug() << "卸载:" << cmd;
myDebug() << "kylin-uninstaller";
m_actionNumber = 6;
}
+void RightClickMenu::onReadOutput()
+{
+ QString packagestr=QString::fromLocal8Bit(m_cmdProc->readAllStandardOutput().data());
+ QString packageName=packagestr.split(":").at(0);
+
+ packageName = packageName.trimmed();
+ QProcess tempProcess;
+ QString cmd = QString("pkexec rpm -e %1").arg(packageName);
+ tempProcess.start(cmd);
+ tempProcess.waitForFinished();
+
+ QString errorInfo1 = tempProcess.readAllStandardError().data();
+ QString result1 = tempProcess.readAllStandardOutput().data();
+ //check uninstall
+ cmd = QString("rpm -qa");
+ tempProcess.start(cmd);
+ tempProcess.waitForFinished();
+
+ QString errorInfo2 = tempProcess.readAllStandardError().data();
+ QString result2 = tempProcess.readAllStandardOutput().data();
+ bool bFail = false;
+ bFail= result2.contains(packageName);
+
+ if(!result2.isEmpty() && !bFail)
+ {
+ QMessageBox::information(this,tr("infomation"),tr("Uninstall finished!"));
+ }
+ else if(result2.isEmpty()) {
+ QMessageBox::information(this,tr("error"), tr("timeout!"));
+ }
+ else {
+ QMessageBox::information(this,tr("error"), errorInfo1);
+ }
+
+ QKeyEvent event(QEvent::KeyPress, Qt::Key_Menu,Qt::NoModifier);
+ QCoreApplication::sendEvent(this->parent(),&event);
+ tempProcess.close();
+}
+
void RightClickMenu::attributeActionTriggerSlot()
{
char command[100];
@@ -286,9 +332,11 @@ int RightClickMenu::showAppBtnMenu(const QPoint &pos, QString desktopfp)
m_showAppMenu.addSeparator();
- if (!m_whiteList.contains(desktopfn))
- m_showAppMenu.addAction(QIcon(getIconPixmap(":/data/img/mainviewwidget/uninstall.svg", 0)), tr("Uninstall"),
- this, SLOT(uninstallActionTriggerSlot()));
+ if(!g_isFullScreen){
+ if (!m_whiteList.contains(desktopfn))
+ m_showAppMenu.addAction(QIcon(getIconPixmap(":/data/img/mainviewwidget/uninstall.svg", 0)), tr("Uninstall"),
+ this, SLOT(uninstallActionTriggerSlot()));
+ }
m_showAppMenu.setAttribute(Qt::WA_TranslucentBackground);
m_showAppMenu.setAttribute(Qt::WA_DeleteOnClose);
diff --git a/src/UserInterface/RightClickMenu/rightclickmenu.h b/src/UserInterface/RightClickMenu/rightclickmenu.h
index 573b08e..c4d5968 100755
--- a/src/UserInterface/RightClickMenu/rightclickmenu.h
+++ b/src/UserInterface/RightClickMenu/rightclickmenu.h
@@ -119,6 +119,10 @@ private Q_SLOTS:
* @brief Uninstall
*/
void uninstallActionTriggerSlot();
+ /**
+ * @brief Read command output
+ */
+ void onReadOutput();
/**
* @brief Attribute
*/
diff --git a/translations/ukui-menu_zh_CN.ts b/translations/ukui-menu_zh_CN.ts
index 59aa5fd..e35f008 100755
--- a/translations/ukui-menu_zh_CN.ts
+++ b/translations/ukui-menu_zh_CN.ts
@@ -43,18 +43,18 @@
<translation type="vanished">打开字母排序菜单</translation>
</message>
<message>
- <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="179"/>
+ <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="178"/>
<source>Open the function sort menu</source>
<translation>打开功能排序菜单</translation>
</message>
<message>
- <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="181"/>
+ <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="180"/>
<source>Open the alphabetical menu</source>
<translation>打开字母排序菜单</translation>
</message>
<message>
- <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="251"/>
- <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="253"/>
+ <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="250"/>
+ <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="252"/>
<source>path:</source>
<translation>路径:</translation>
</message>
@@ -72,36 +72,36 @@
<translation>搜索应用</translation>
</message>
<message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="452"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="453"/>
<source>No recent files</source>
<translation>暂无最近文件</translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="312"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="493"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="562"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1161"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1162"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="494"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="563"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1175"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1176"/>
<source>All</source>
<translation>全部</translation>
</message>
<message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="500"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="501"/>
<source>collection</source>
<translation>收藏</translation>
</message>
<message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="501"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="502"/>
<source>recent</source>
<translation>最近</translation>
</message>
<message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="502"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="503"/>
<source>Max</source>
<translation>放大</translation>
</message>
<message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="504"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="505"/>
<source>PowerOff</source>
<translation>电源</translation>
</message>
@@ -110,16 +110,16 @@
<translation type="vanished">搜索应用</translation>
</message>
<message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="564"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1170"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1171"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="565"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1184"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1185"/>
<source>Letter</source>
<translation>字母排序</translation>
</message>
<message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="566"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1179"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1180"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="567"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1193"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1194"/>
<source>Function</source>
<translation>功能分类</translation>
</message>
@@ -196,82 +196,103 @@
<context>
<name>RightClickMenu</name>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="249"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="221"/>
+ <source>infomation</source>
+ <translation>提示</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="221"/>
+ <source>Uninstall finished!</source>
+ <translation>卸载成功!</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="224"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="227"/>
+ <source>error</source>
+ <translation>错误</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="224"/>
+ <source>timeout!</source>
+ <translation>超时!</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="296"/>
<source>Pin to all</source>
<translation>固定到“所有软件”</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="252"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="299"/>
<source>Unpin from all</source>
<translation>从“所有软件”取消固定</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="262"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="309"/>
<source>Pin to taskbar</source>
<translation>固定到任务栏</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="265"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="312"/>
<source>Unpin from taskbar</source>
<translation>从任务栏取消固定</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="268"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="315"/>
<source>Add to desktop shortcuts</source>
<translation>添加到桌面快捷方式</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="272"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="319"/>
<source>Pin to collection</source>
<translation>固定到收藏</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="275"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="322"/>
<source>Remove from collection</source>
<translation>从收藏移除</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="290"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="338"/>
<source>Uninstall</source>
<translation>卸载</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="310"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="359"/>
<source>Switch user</source>
<translation>切换用户</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="317"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="366"/>
<source>Hibernate</source>
<translation>休眠</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="324"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="373"/>
<source>Sleep</source>
<translation>睡眠</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="328"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="377"/>
<source>Lock Screen</source>
<translation>锁屏</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="333"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="382"/>
<source>Log Out</source>
<translation>注销</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="340"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="389"/>
<source>Restart</source>
<translation>重启</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="347"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="396"/>
<source>Power Off</source>
<translation>关机</translation>
</message>
<message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="383"/>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="432"/>
<source>Personalize this list</source>
<translation type="unfinished"></translation>
</message>
@@ -295,8 +316,12 @@
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="247"/>
+ <source>Uninstall2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Uninstall</source>
- <translation>卸载</translation>
+ <translation type="vanished">卸载</translation>
</message>
</context>
</TS>
diff --git a/translations/ukui-menu_zh_CN.ts_back b/translations/ukui-menu_zh_CN.ts_back
new file mode 100755
index 0000000..8ce304a
--- /dev/null
+++ b/translations/ukui-menu_zh_CN.ts_back
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="zh_CN">
+<context>
+ <name>FullMainWindow</name>
+ <message>
+ <location filename="../src/UserInterface/full_mainwindow.cpp" line="162"/>
+ <source>Search</source>
+ <translation>搜索应用</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/full_mainwindow.cpp" line="200"/>
+ <source>All</source>
+ <translation>全部</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/full_mainwindow.cpp" line="202"/>
+ <source>Letter</source>
+ <translation>字母排序</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/full_mainwindow.cpp" line="204"/>
+ <source>Function</source>
+ <translation>功能分类</translation>
+ </message>
+</context>
+<context>
+ <name>FunctionWidget</name>
+ <message>
+ <location filename="../src/UserInterface/Widget/function_Widget.cpp" line="215"/>
+ <source>Search</source>
+ <translation>全局搜索</translation>
+ </message>
+</context>
+<context>
+ <name>ItemDelegate</name>
+ <message>
+ <source>Open feature sort list</source>
+ <translation type="vanished">打开功能排序菜单</translation>
+ </message>
+ <message>
+ <source>Open alphabetical list</source>
+ <translation type="vanished">打开字母排序菜单</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="178"/>
+ <source>Open the function sort menu</source>
+ <translation>打开功能排序菜单</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="180"/>
+ <source>Open the alphabetical menu</source>
+ <translation>打开字母排序菜单</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="250"/>
+ <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="252"/>
+ <source>path:</source>
+ <translation>路径:</translation>
+ </message>
+ <message>
+ <source>path</source>
+ <translation type="obsolete">路径</translation>
+ </message>
+</context>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="308"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="333"/>
+ <source>Search</source>
+ <translation>搜索应用</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="453"/>
+ <source>No recent files</source>
+ <translation>暂无最近文件</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="312"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="494"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="563"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1175"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1176"/>
+ <source>All</source>
+ <translation>全部</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="501"/>
+ <source>collection</source>
+ <translation>收藏</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="502"/>
+ <source>recent</source>
+ <translation>最近</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="503"/>
+ <source>Max</source>
+ <translation>放大</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="505"/>
+ <source>PowerOff</source>
+ <translation>电源</translation>
+ </message>
+ <message>
+ <source>Search application</source>
+ <translation type="vanished">搜索应用</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="565"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1184"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1185"/>
+ <source>Letter</source>
+ <translation>字母排序</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="567"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1193"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1194"/>
+ <source>Function</source>
+ <translation>功能分类</translation>
+ </message>
+</context>
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="72"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="28"/>
+ <source>Office</source>
+ <translation>办公</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="73"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="29"/>
+ <source>Development</source>
+ <translation>开发</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="74"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="30"/>
+ <source>Image</source>
+ <translation>图像</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="75"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="31"/>
+ <source>Video</source>
+ <translation>影音</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="76"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="32"/>
+ <source>Internet</source>
+ <translation>网络</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="77"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="33"/>
+ <source>Game</source>
+ <translation>游戏</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="78"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="34"/>
+ <source>Education</source>
+ <translation>教育</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="79"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="35"/>
+ <source>Social</source>
+ <translation>社交</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="80"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="36"/>
+ <source>System</source>
+ <translation>系统</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="81"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="37"/>
+ <source>Safe</source>
+ <translation>安全</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="82"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="38"/>
+ <source>Others</source>
+ <translation>其他</translation>
+ </message>
+</context>
+<context>
+ <name>RightClickMenu</name>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="220"/>
+ <source>infomation</source>
+ <translation>提示</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="220"/>
+ <source>Uninstall finished!</source>
+ <translation>卸载成功!</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="223"/>
+ <source>error</source>
+ <translation>错误</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="223"/>
+ <source>timeout!</source>
+ <translation>超时!</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="290"/>
+ <source>Pin to all</source>
+ <translation>固定到“所有软件”</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="293"/>
+ <source>Unpin from all</source>
+ <translation>从“所有软件”取消固定</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="303"/>
+ <source>Pin to taskbar</source>
+ <translation>固定到任务栏</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="306"/>
+ <source>Unpin from taskbar</source>
+ <translation>从任务栏取消固定</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="309"/>
+ <source>Add to desktop shortcuts</source>
+ <translation>添加到桌面快捷方式</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="313"/>
+ <source>Pin to collection</source>
+ <translation>固定到收藏</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="316"/>
+ <source>Remove from collection</source>
+ <translation>从收藏移除</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="331"/>
+ <source>Uninstall</source>
+ <translation>卸载</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="351"/>
+ <source>Switch user</source>
+ <translation>切换用户</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="358"/>
+ <source>Hibernate</source>
+ <translation>休眠</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="365"/>
+ <source>Sleep</source>
+ <translation>睡眠</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="369"/>
+ <source>Lock Screen</source>
+ <translation>锁屏</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="374"/>
+ <source>Log Out</source>
+ <translation>注销</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="381"/>
+ <source>Restart</source>
+ <translation>重启</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="388"/>
+ <source>Power Off</source>
+ <translation>关机</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="424"/>
+ <source>Personalize this list</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TabletRightClickMenu</name>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="219"/>
+ <source>Pin to taskbar</source>
+ <translation>固定到任务栏</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="222"/>
+ <source>Unpin from taskbar</source>
+ <translation>从任务栏取消固定</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="228"/>
+ <source>Add to desktop shortcuts</source>
+ <translation>固定到桌面快捷方式</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="247"/>
+ <source>Uninstall</source>
+ <translation>卸载</translation>
+ </message>
+</context>
+</TS>
--
2.39.1

View File

@ -1,99 +0,0 @@
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
Date: Wed, 22 Jun 2022 07:02:54 +0000
Subject: =?utf-8?b?ITUg5L+u5pS55LqGcGxhdGZvcm1OYW1l6I635Y+W5pe25py677yM6Kej?=
=?utf-8?b?5Yaz6I635Y+W5Li656m655qE6Zeu6aKY77yb5aKe5Yqg5LqG5YWo5bGP56qX5Y+j?=
=?utf-8?b?5pi+56S65pe25L2N572u6K6+572uICogdXBkYXRlIGRlYmlhbi9jaGFuZ2Vsb2cu?=
=?utf-8?b?ICog6Kej5Yaz5Yay56qBICog6LCD5pW0cGxhdGZvcm1OYW1l6I635Y+W5L2N572u?=
=?utf-8?b?77yM5L+u5pS55YWo5bGP56qX5Y+j5L2N572u6K6+572uICog5re75YqgY29udHJv?=
=?utf-8?b?bOaWh+S7tuS+nei1liAqIOS/ruaUueWbvuagh+e8uuWksee8luivkeWksei0pQ==?=
=?utf-8?b?6Zeu6aKYICogdXBkYXRlIHNyYy9VdGlsaXR5RnVuY3Rpb24vYWJzdHJhY3RJbnRl?=
=?utf-8?b?cmZhY2UuaC4gKiAzLjIwd2F5bGFuZOS9jee9rumXrumimOino+WGsw==?=
---
main.cpp | 2 +-
src/UserInterface/mainwindow.cpp | 11 +++++++++++
src/UserInterface/mainwindow.h | 1 +
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/main.cpp b/main.cpp
index 68bb94d..4d4c558 100755
--- a/main.cpp
+++ b/main.cpp
@@ -44,7 +44,6 @@ int main(int argc, char *argv[])
initUkuiLog4qt("ukui-menu");
g_projectCodeName = KDKGetPrjCodeName().c_str();
g_subProjectCodeName = KDKGetOSRelease("SUB_PROJECT_CODENAME").c_str();
- g_platform = QGuiApplication::platformName();
qRegisterMetaType<QVector<QStringList>>("QVector<QStringList>");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
@@ -56,6 +55,7 @@ int main(int argc, char *argv[])
#endif
QtSingleApplication app("ukui-menu", argc, argv);
app.setQuitOnLastWindowClosed(false);
+ g_platform = QGuiApplication::platformName();
if (app.isRunning()) {
app.sendMessage("raise_window_noop");
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index ccc8fe1..984d9f0 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -355,6 +355,7 @@ MainWindow::MainWindow(QWidget *parent) :
m_viewWidget->setFocus();
} else {
m_fullWindow->show();
+ setMaxWindowPos();
// fullWindow->raise();
m_fullWindow->activateWindow();
pointDataStruct pointData;
@@ -693,6 +694,7 @@ void MainWindow::maxAnimationFinished()
{
m_fullWindow->raise();
m_fullWindow->showNormal();
+ setMaxWindowPos();
m_fullWindow->activateWindow();
QEventLoop loop;
QTimer::singleShot(100, &loop, SLOT(quit()));
@@ -1217,6 +1219,7 @@ void MainWindow::showWindow()
if (m_isFullScreen) {
m_fullWindow->raise();
m_fullWindow->showNormal();
+ setMaxWindowPos();
m_fullWindow->activateWindow();
pointDataStruct pointData;
pointData.module = "fullWindow";
@@ -1238,6 +1241,7 @@ void MainWindow::showWindow()
BuriedPointDataSend::getInstance()->setPoint(pointData);
}
}
+
void MainWindow::hideWindow()
{
if (m_fullWindow->isVisible()) {
@@ -1296,6 +1300,13 @@ void MainWindow::setMinWindowPos()
}
}
+void MainWindow::setMaxWindowPos()
+{
+ if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
+ kdk::WindowManager::setGeometry(m_fullWindow->windowHandle(), QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
+ }
+}
+
void MainWindow::repaintWidget()
{
Style::initWidStyle();
diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h
index 9c1bcad..7dede39 100755
--- a/src/UserInterface/mainwindow.h
+++ b/src/UserInterface/mainwindow.h
@@ -107,6 +107,7 @@ protected:
void setMinWindowPos();
+ void setMaxWindowPos();
public:
Q_SIGNALS:
void sendSearchKeyword(QString arg);

View File

@ -1,72 +0,0 @@
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
Date: Thu, 23 Jun 2022 09:23:21 +0000
Subject: =?utf-8?b?5re75Yqg5bqU55So566h55CG5Zmo5o6l5Y+j?=
---
src/UserInterface/tabletwindow.cpp | 2 +-
src/UtilityFunction/utility.cpp | 36 +++++++++++++++++++++++-------------
2 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/src/UserInterface/tabletwindow.cpp b/src/UserInterface/tabletwindow.cpp
index 4f26924..378ad1f 100755
--- a/src/UserInterface/tabletwindow.cpp
+++ b/src/UserInterface/tabletwindow.cpp
@@ -615,7 +615,7 @@ void TabletWindow::execApplication(QString desktopfp)
if (!g_subProjectCodeName.contains("mavis")
|| (g_subProjectCodeName.contains("mavis") && !QDBusReply<bool>(iface.call("LaunchApp", desktopfp)))) {
- execApp(desktopfp);
+// execApp(desktopfp);
QString str;
//打开文件.desktop
GError **error = nullptr;
diff --git a/src/UtilityFunction/utility.cpp b/src/UtilityFunction/utility.cpp
index 3eee325..40c6f08 100755
--- a/src/UtilityFunction/utility.cpp
+++ b/src/UtilityFunction/utility.cpp
@@ -710,22 +710,32 @@ bool deleteAppRecord(QString desktopfn)
void execApp(QString desktopfp)
{
- UkuiMenuInterface interface;
- if (interface.checkKreApp(desktopfp)) {
- QProcess::startDetached(interface.getAppExec(desktopfp));
- } else {
- QString appName = interface.getAppExec(desktopfp);
- QStringList strList = (appName.replace("\"", "")).split(" ");
+ QDBusInterface iface("com.kylin.AppManager",
+ "/com/kylin/AppManager",
+ "com.kylin.AppManager",
+ QDBusConnection::sessionBus());
+ QDBusReply<bool> res = iface.call("LaunchApp", desktopfp);
- if (QString(strList.at(0)) == "kmplayer") {
- QProcess::startDetached(strList.at(0));
- return;
- }
+ if (!res.isValid() || !res) {
- GDesktopAppInfo *desktopAppInfo = g_desktop_app_info_new_from_filename(desktopfp.toLocal8Bit().data());
- g_app_info_launch(G_APP_INFO(desktopAppInfo), nullptr, nullptr, nullptr);
- g_object_unref(desktopAppInfo);
+ UkuiMenuInterface interface;
+
+ if (interface.checkKreApp(desktopfp)) {
+ QProcess::startDetached(interface.getAppExec(desktopfp));
+ } else {
+ QString appName = interface.getAppExec(desktopfp);
+ QStringList strList = (appName.replace("\"", "")).split(" ");
+
+ if (QString(strList.at(0)) == "kmplayer") {
+ QProcess::startDetached(strList.at(0));
+ return;
+ }
+
+ GDesktopAppInfo *desktopAppInfo = g_desktop_app_info_new_from_filename(desktopfp.toLocal8Bit().data());
+ g_app_info_launch(G_APP_INFO(desktopAppInfo), nullptr, nullptr, nullptr);
+ g_object_unref(desktopAppInfo);
+ }
}
QFileInfo fileInfo(desktopfp);

View File

@ -1,69 +0,0 @@
From 235bc6b01ac146485aff84d2db7fe9a81d8e7ff4 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Wed, 15 Feb 2023 17:45:51 +0800
Subject: [PATCH] add ukui-log4qt
---
debian/control | 7 ++++---
main.cpp | 2 ++
ukui-menu.pro | 2 +-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/debian/control b/debian/control
index 2e3fd51..00568da 100755
--- a/debian/control
+++ b/debian/control
@@ -19,7 +19,8 @@ Build-Depends: debhelper-compat (=12),
libx11-dev,
libukui-common0,
libukui-common-dev,
- libpeony-dev
+ libpeony-dev,
+ libkysdk-waylandhelper-dev
Standards-Version: 4.5.0
Rules-Requires-Root: no
Homepage: https://github.com/ukui/ukui-menu
@@ -33,9 +34,9 @@ Depends: ${shlibs:Depends},
accountsservice,
libgsettings-qt1,
libqt5x11extras5,
- bamfdaemon
+ bamfdaemon,
+ libkysdk-waylandhelper
Suggests:kylin-status-manager,
- kylin-daq
Description: Advanced ukui menu
UKUI menu provides start menu development library and advanced
graphical user interface.
diff --git a/main.cpp b/main.cpp
index ed52069..f30ac71 100755
--- a/main.cpp
+++ b/main.cpp
@@ -34,9 +34,11 @@
#define UKUI_PATH "/org/gnome/SessionManager"
#define UKUI_INTERFACE "org.gnome.SessionManager"
+#include <ukui-log4qt.h>
int main(int argc, char *argv[])
{
+ initUkuiLog4qt("ukui-menu");
g_projectCodeName = KDKGetPrjCodeName().c_str();
qRegisterMetaType<QVector<QStringList>>("QVector<QStringList>");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
diff --git a/ukui-menu.pro b/ukui-menu.pro
index 5fc48ba..9cf7362 100755
--- a/ukui-menu.pro
+++ b/ukui-menu.pro
@@ -52,7 +52,7 @@ PKGCONFIG+=glib-2.0 gio-unix-2.0 gsettings-qt libbamf3 x11 xtst
CONFIG += no_keywords link_pkgconfig
-LIBS+=-pthread -luchardet -lukui-com4c -lukui-com4cxx -lpeony
+LIBS+=-pthread -luchardet -lukui-log4qt -lukui-com4c -lukui-com4cxx -lpeony
desktop_file.files = ukui-menu.desktop
desktop_file.path = /etc/xdg/autostart
--
2.33.0

File diff suppressed because it is too large Load Diff

View File

@ -1,128 +0,0 @@
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
Date: Tue, 12 Jul 2022 08:55:07 +0000
Subject: =?utf-8?b?ITgg6Kej5Yazd2F5bGFuZOeql+WPo+eKtuaAgemUmeivr+WvvOiHtA==?=
=?utf-8?b?5byA5aeL6I+c5Y2V5Y2V5L6L5pi+56S66ZqQ6JeP5aSx6LSl6Zeu6aKY?=
---
src/QtSingleApplication/qtsingleapplication.cpp | 24 +++++++++++-------------
src/UserInterface/ListView/klistview.cpp | 1 +
src/UserInterface/mainwindow.cpp | 13 ++++++++++++-
src/UserInterface/mainwindow.h | 6 +++---
4 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/src/QtSingleApplication/qtsingleapplication.cpp b/src/QtSingleApplication/qtsingleapplication.cpp
index e3ba444..d957182 100755
--- a/src/QtSingleApplication/qtsingleapplication.cpp
+++ b/src/QtSingleApplication/qtsingleapplication.cpp
@@ -350,19 +350,17 @@ void QtSingleApplication::activateWindow()
myDebug() << "单例触发activateWindow";
if (!g_projectCodeName.contains("V10SP1-edu")) {
MainWindow *w = qobject_cast<MainWindow *>(actWin);
-
- if (this->applicationState() & Qt::ApplicationInactive) {
- myDebug() << "单例内触发开始菜单显示";
- actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized);
- // actWin->raise();
- // actWin->showNormal();
- // actWin->activateWindow();
- w->showWindow();
- } else {
- myDebug() << "单例内触发开始菜单隐藏";
- actWin->setWindowState(actWin->windowState() & Qt::WindowMinimized);
- w->hideWindow();
- }
+ w->windowOption();
+
+// if (this->applicationState() & Qt::ApplicationInactive) {
+// myDebug() << "单例内触发开始菜单显示";
+// actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized);
+// w->showWindow();
+// } else {
+// myDebug() << "单例内触发开始菜单隐藏";
+// actWin->setWindowState(actWin->windowState() & Qt::WindowMinimized);
+// w->hideWindow();
+// }
} else {
TabletWindow *w = qobject_cast<TabletWindow *>(actWin);
w->showPCMenu();
diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp
index b927ba2..96a03e6 100755
--- a/src/UserInterface/ListView/klistview.cpp
+++ b/src/UserInterface/ListView/klistview.cpp
@@ -63,6 +63,7 @@ void KListView::paintEvent(QPaintEvent *e)
void KListView::mouseMoveEvent(QMouseEvent *e)
{
this->clearFocus();
+ return QListView::mouseMoveEvent(e);
}
void KListView::mousePressEvent(QMouseEvent *event)
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index d65d221..4a3f7d9 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -181,7 +181,7 @@ void MainWindow::registDbusServer()
} else {
m_fullWindow->show();
setMaxWindowPos();
- // fullWindow->raise();
+ m_fullWindow->raise();
m_fullWindow->activateWindow();
}
}
@@ -506,6 +506,15 @@ void MainWindow::initTabOrder()
setTabOrder(m_minMaxChangeButton, m_powerOffButton);
}
+void MainWindow::windowOption()
+{
+ if (this->isVisible() || m_fullWindow->isVisible()) {
+ hideWindow();
+ } else {
+ showWindow();
+ }
+}
+
void MainWindow::initUi()
{
qDebug() << "init UI";
@@ -684,6 +693,7 @@ bool MainWindow::event(QEvent *event)
if (QEvent::WindowDeactivate == event->type()) { //窗口停用
if (QApplication::activeWindow() != this) {
qDebug() << " * 鼠标点击窗口外部事件";
+ this->setWindowState(this->windowState() & Qt::WindowMinimized);
this->hide();
m_topStackedWidget->setCurrentIndex(0);
m_lineEdit->clear();
@@ -1340,6 +1350,7 @@ void MainWindow::repaintWidget()
m_fullWindow->setFixedSize(width, height);
m_fullWindow->repaintWidget();
}
+
void MainWindow::showNormalWindowSlot()
{
myDebug() << "Style::m_availableScreenWidth" << Style::m_availableScreenWidth << "Style::m_availableScreenHeight" << Style::m_availableScreenHeight;
diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h
index 4f0baf3..30aa46b 100755
--- a/src/UserInterface/mainwindow.h
+++ b/src/UserInterface/mainwindow.h
@@ -65,9 +65,7 @@ public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
- void showWindow();
-
- void hideWindow();
+ void windowOption();
protected:
void initSearchUi();
@@ -81,6 +79,8 @@ protected:
void registDbusServer();
void setTabletModeFlag();
void initUi();
+ void showWindow();
+ void hideWindow();
/**
* @brief 处理外部点击事件和主窗口键盘控制
* @param event

View File

@ -1,249 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Mon, 18 Jul 2022 15:21:40 +0800
Subject: =?utf-8?b?5pu05pawY2hhbmdlbG9n5L+h5oGv?=
---
src/UserInterface/ListView/klistview.cpp | 1 +
src/UserInterface/Widget/full_function_widget.cpp | 1 +
src/UserInterface/Widget/full_function_widget.h | 2 ++
src/UserInterface/Widget/full_letter_widget.cpp | 1 +
src/UserInterface/Widget/full_letter_widget.h | 2 ++
src/UserInterface/full_mainwindow.cpp | 23 ++++++++++++++-
src/UserInterface/full_mainwindow.h | 1 +
src/UserInterface/mainwindow.cpp | 34 +++++++++++++++++------
8 files changed, 55 insertions(+), 10 deletions(-)
diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp
index 96a03e6..8151d04 100755
--- a/src/UserInterface/ListView/klistview.cpp
+++ b/src/UserInterface/ListView/klistview.cpp
@@ -46,6 +46,7 @@ void KListView::onClicked(QModelIndex index)
if (var.isValid()) {
QString desktopfp = var.value<QString>();
execApp(desktopfp);
+ Q_EMIT sendHideMainWindowSignal();
}
}
diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp
index 253f210..fd124e4 100755
--- a/src/UserInterface/Widget/full_function_widget.cpp
+++ b/src/UserInterface/Widget/full_function_widget.cpp
@@ -210,6 +210,7 @@ void FullFunctionWidget::insertAppList(QStringList desktopfplist)
listview->addData(m_data);
connect(listview, &FullListView::sendItemClickedSignal, this, &FullFunctionWidget::execApplication);
connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullFunctionWidget::sendHideMainWindowSignal);
+ connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullFunctionWidget::sendUpdateCommonView);
}
/**
diff --git a/src/UserInterface/Widget/full_function_widget.h b/src/UserInterface/Widget/full_function_widget.h
index ead61ff..931104c 100755
--- a/src/UserInterface/Widget/full_function_widget.h
+++ b/src/UserInterface/Widget/full_function_widget.h
@@ -195,6 +195,8 @@ Q_SIGNALS:
void changeScrollValue(int value, int maximumValue);
+ void sendUpdateCommonView();
+
};
#endif // FULLFUNCTIONWIDGET_H
diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp
index 96daac2..45fb165 100755
--- a/src/UserInterface/Widget/full_letter_widget.cpp
+++ b/src/UserInterface/Widget/full_letter_widget.cpp
@@ -210,6 +210,7 @@ void FullLetterWidget::fillAppList()
listview->addData(m_data);
connect(listview, &FullListView::sendItemClickedSignal, this, &FullLetterWidget::execApplication);
connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullLetterWidget::sendHideMainWindowSignal);
+ connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullLetterWidget::sendUpdateCommonView);
}
}
diff --git a/src/UserInterface/Widget/full_letter_widget.h b/src/UserInterface/Widget/full_letter_widget.h
index 5f94658..662408b 100755
--- a/src/UserInterface/Widget/full_letter_widget.h
+++ b/src/UserInterface/Widget/full_letter_widget.h
@@ -197,6 +197,8 @@ Q_SIGNALS:
void selectFirstItem();
void changeScrollValue(int value, int maximumValue);
+
+ void sendUpdateCommonView();
};
#endif // FULLLETTERWIDGET_H
diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp
index 4e6ea9a..3c77fd5 100755
--- a/src/UserInterface/full_mainwindow.cpp
+++ b/src/UserInterface/full_mainwindow.cpp
@@ -209,9 +209,12 @@ void FullMainWindow::initConnect()
connect(this, &FullMainWindow::sendSetFocusToResult, m_fullResultPage, &FullSearchResultWidget::selectFirstItemTab);
// connect(m_fullSelectMenuButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectMenuButton_clicked);
connect(m_fullCommonPage, &FullCommonUseWidget::sendUpdateOtherView, this, &FullMainWindow::sendUpdateOtherView);
+ connect(m_fullFunctionPage, &FullFunctionWidget::sendUpdateCommonView, m_fullCommonPage, &FullCommonUseWidget::updateListViewSlot);
+ connect(m_fullLetterPage, &FullLetterWidget::sendUpdateCommonView, m_fullCommonPage, &FullCommonUseWidget::updateListViewSlot);
connect(m_fullCommonPage, &FullCommonUseWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
connect(m_fullFunctionPage, &FullFunctionWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
connect(m_fullLetterPage, &FullLetterWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
+ connect(m_fullResultPage, &FullSearchResultWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
connect(m_dropDownMenu, &MenuBox::triggered, this, &FullMainWindow::on_fullSelectMenuButton_triggered);
connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() {
selectIconAnimation(false);
@@ -316,7 +319,7 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)
if (event->type() == QEvent::KeyPress) {
QKeyEvent *ke = (QKeyEvent *)event;
- if (ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return) {
+ if (ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Down) {
Q_EMIT sendSetFocusToResult();
}
}
@@ -370,6 +373,23 @@ void FullMainWindow::iconAnimationFinished()
-Style::DropMenuWidth, 45)));
}
+void FullMainWindow::keyPressEvent(QKeyEvent *e)
+{
+ if (e->type() == QEvent::KeyPress) {
+ if ((e->key() >= Qt::Key_0 && e->key() <= Qt::Key_9) || (e->key() >= Qt::Key_A && e->key() <= Qt::Key_Z)) {
+ qDebug() << "void MainWindow::keyPressEvent(QKeyEvent *e)" << e->text();
+ m_lineEdit->setFocus();
+ m_lineEdit->setText(e->text());
+ }
+
+ if (e->key() == Qt::Key_Backspace) {
+ if (!m_lineEdit->text().isEmpty()) {
+ m_lineEdit->setText("");
+ }
+ }
+ }
+}
+
void FullMainWindow::selectIconAnimation(const bool &flag)
{
iconAnimation = new QPropertyAnimation(m_fullSelectMenuButton, "rotation", this);
@@ -451,6 +471,7 @@ bool FullMainWindow::event(QEvent *event)
}
if (keyEvent->key() == Qt::Key_Escape) {
+ m_lineEdit->clear();
this->hide();
}
}
diff --git a/src/UserInterface/full_mainwindow.h b/src/UserInterface/full_mainwindow.h
index 34a91ca..9592169 100755
--- a/src/UserInterface/full_mainwindow.h
+++ b/src/UserInterface/full_mainwindow.h
@@ -63,6 +63,7 @@ protected:
void initLayout();
void selectIconAnimation(const bool &flag);
void iconAnimationFinished();
+ void keyPressEvent(QKeyEvent *e);
private:
QAction *m_allAction = nullptr;
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index 4a3f7d9..1f09418 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -319,6 +319,7 @@ void MainWindow::initSearchUi()
m_lineEdit->setStyleSheet(QString::fromUtf8("border-radius: 13px; border:1px solid rgba(5, 151, 255, 1); background: transparent;"));
m_lineEdit->setFrame(false);
m_lineEdit->setPlaceholderText(tr("Search"));
+ m_lineEdit->installEventFilter(this);
m_cancelSearchPushButton = new QPushButton(m_minSearchPage);
m_cancelSearchPushButton->setFixedSize(QSize(26, 26));
// m_cancelSearchPushButton->setStyleSheet(m_buttonStyle.arg("QPushButton"));
@@ -570,6 +571,7 @@ void MainWindow::initUi()
connect(m_minFuncListView, &ListView::sendUpdateAppListSignal, this, &MainWindow::updateView);
connect(m_minLetterListView, &ListView::sendUpdateAppListSignal, this, &MainWindow::updateView);
connect(m_minSearchResultListView, &ListView::sendUpdateAppListSignal, this, &MainWindow::updateView);
+ connect(m_collectListView, &RightListView::sendUpdateAppListSignal, this, &MainWindow::updateView);
connect(m_minAllListView, &ListView::sendCollectViewUpdate, this, &MainWindow::updateCollectView);
connect(m_minFuncListView, &ListView::sendCollectViewUpdate, this, &MainWindow::updateCollectView);
connect(m_minSearchResultListView, &ListView::sendCollectViewUpdate, this, &MainWindow::updateCollectView);
@@ -1012,6 +1014,13 @@ bool MainWindow::eventFilter(QObject *target, QEvent *event)
}
}
+ if (target == m_lineEdit) {
+ if (ke->key() == Qt::Key_Down) {
+ m_minSearchResultListView->setFocus();
+ return true;
+ }
+ }
+
if (target == m_minSelectButton) {
if (ke->key() == Qt::Key_Down) {
if (m_state == 0) {
@@ -1099,6 +1108,7 @@ void MainWindow::recvSearchResult(QVector<QStringList> arg)
m_searchAppThread->quit();
QVector<QStringList> m_data;
m_data.clear();
+ m_minSearchResultListView->verticalScrollBar()->setSliderPosition(0);
m_minSearchResultListView->addData(m_data, 3);
Q_FOREACH (QStringList appinfo, arg) {
@@ -1240,14 +1250,16 @@ void MainWindow::on_minMaxChangeButton_clicked()
m_canHide = true;
m_isFullScreen = true;
- m_animationPage->show();
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
- kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(this->x(), this->y(), Style::minw, Style::minh));
+ m_maxAnimation->setDuration(1);
} else {
+ m_animationPage->show();
m_animationPage->setGeometry(this->x(), this->y(), Style::minw, Style::minh);
+ m_animationPage->raise();
+ m_animationPage->repaint();
+ m_maxAnimation->setDuration(260);
}
- m_animationPage->raise();
- m_animationPage->repaint();
+
QEventLoop loop;
QTimer::singleShot(100, &loop, SLOT(quit()));
loop.exec();
@@ -1255,7 +1267,7 @@ void MainWindow::on_minMaxChangeButton_clicked()
// m_maxAnimation->setStartValue(QRect(Style::m_primaryScreenX, Style::m_primaryScreenY + Style::m_availableScreenHeight - Style::minh, Style::minw, Style::minh));
m_maxAnimation->setStartValue(QRect(this->x(), this->y(), Style::minw, Style::minh));
m_maxAnimation->setEndValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
- m_maxAnimation->setDuration(260);
+
m_maxAnimation->start();
this->hide();
}
@@ -1354,13 +1366,17 @@ void MainWindow::repaintWidget()
void MainWindow::showNormalWindowSlot()
{
myDebug() << "Style::m_availableScreenWidth" << Style::m_availableScreenWidth << "Style::m_availableScreenHeight" << Style::m_availableScreenHeight;
- m_animationPage->show();
+
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
- kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
+ m_minAnimation->setDuration(1);
} else {
+ m_animationPage->show();
m_animationPage->setGeometry(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight);
+ m_animationPage->raise();
+ m_animationPage->repaint();
+ m_minAnimation->setDuration(260);
}
- m_animationPage->raise();
+
myDebug() << m_animationPage->rect();
QEventLoop loop;
QTimer::singleShot(100, &loop, SLOT(quit()));
@@ -1369,7 +1385,7 @@ void MainWindow::showNormalWindowSlot()
m_minAnimation->setEasingCurve(QEasingCurve::OutExpo);
m_minAnimation->setStartValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
m_minAnimation->setEndValue(QRect(this->x(), this->y(), Style::minw, Style::minh));
- m_minAnimation->setDuration(260);
+
m_minAnimation->start();
m_fullWindow->hide();
}

View File

@ -1,599 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Thu, 21 Jul 2022 14:00:38 +0800
Subject: =?utf-8?b?5L+u5pS5Y2hhbmdlbG9n5L+h5oGv?=
---
.../Button/function_classify_button.cpp | 83 +++++++++-------------
.../Button/function_classify_button.h | 3 -
.../Button/letter_classify_button.cpp | 55 ++++++++++----
src/UserInterface/Button/letter_classify_button.h | 2 +-
src/UserInterface/Widget/full_commonuse_widget.cpp | 14 ++--
src/UserInterface/Widget/full_function_widget.cpp | 14 ++--
src/UserInterface/Widget/full_letter_widget.cpp | 16 +++--
.../Widget/full_searchresult_widget.cpp | 14 ++--
.../Widget/function_button_widget.cpp | 6 +-
src/UserInterface/Widget/letter_button_widget.cpp | 6 +-
src/UserInterface/full_mainwindow.cpp | 14 ++--
src/UserInterface/mainwindow.cpp | 35 ++++-----
12 files changed, 146 insertions(+), 116 deletions(-)
diff --git a/src/UserInterface/Button/function_classify_button.cpp b/src/UserInterface/Button/function_classify_button.cpp
index 2494be4..8ddabe1 100755
--- a/src/UserInterface/Button/function_classify_button.cpp
+++ b/src/UserInterface/Button/function_classify_button.cpp
@@ -36,23 +36,11 @@ FunctionClassifyButton::FunctionClassifyButton(int width,
m_iconSize(iconSize),
m_category(category),
m_fullscreen(fullscreen),
- m_enabled(enabled),
- m_iconLabel(new QLabel),
- m_textLabel(new QLabel)
+ m_enabled(enabled)
{
this->setFlat(true);
this->setFixedSize(m_width, m_height);
this->setFocusPolicy(Qt::NoFocus);
- m_iconLabel->setFixedSize(m_iconSize, m_iconSize);
- m_textLabel->adjustSize();
- m_textLabel->setText(m_category);
- m_textLabel->setAlignment(Qt::AlignCenter);
-
- if (m_fullscreen) {
- QPalette pe = m_textLabel->palette();
- pe.setColor(QPalette::ButtonText, Qt::white);
- m_textLabel->setPalette(pe);
- }
if (m_fullscreen) {
updateIconState(Normal);
@@ -67,12 +55,6 @@ FunctionClassifyButton::FunctionClassifyButton(int width,
this->setCheckable(false);
}
- QHBoxLayout *mainlayout = new QHBoxLayout;
- mainlayout->setContentsMargins(0, 0, 0, 0);
- mainlayout->setSpacing(Style::LeftSpaceIconText);
- this->setLayout(mainlayout);
-// mainlayout->addWidget(m_iconLabel);
- mainlayout->addWidget(m_textLabel);
connect(this, &FunctionClassifyButton::toggled, this, &FunctionClassifyButton::reactToToggle);
connect(this, &FunctionClassifyButton::clicked, this, &FunctionClassifyButton::buttonClickedSlot);
}
@@ -115,6 +97,37 @@ void FunctionClassifyButton::paintEvent(QPaintEvent *e)
painter.restore();
}
+ if (!(option.state & QStyle::State_Enabled)) {
+ painter.save();
+ QColor color;
+ if (!m_fullscreen) {
+ if ( g_curStyle == "ukui-light") {
+ color = Qt::black;
+ } else {
+ color = Qt::white;
+ }
+ color.setAlphaF(0.2);
+ }
+ painter.setPen(color);
+ painter.drawText(option.rect, Qt::AlignCenter, m_category);
+ painter.restore();
+ }
+
+ if (option.state & QStyle::State_Enabled) {
+ painter.save();
+ QColor color;
+
+ if ( g_curStyle == "ukui-light") {
+ color = Qt::black;
+ } else {
+ color = Qt::white;
+ }
+ color.setAlphaF(0.9);
+ painter.setPen(color);
+ painter.drawText(option.rect, Qt::AlignCenter, m_category);
+ painter.restore();
+ }
+
if (m_fullscreen && (option.state & QStyle::State_On)) {
painter.save();
painter.setPen(Qt::NoPen);
@@ -265,37 +278,7 @@ void FunctionClassifyButton::updateIconState(const FunctionClassifyButton::State
// }
// pixmap.setDevicePixelRatio(qApp->devicePixelRatio());
// m_iconLabel->setPixmap(pixmap);
- updateTextState(state);
+// updateTextState(state);
}
-void FunctionClassifyButton::updateTextState(const FunctionClassifyButton::State state)
-{
- // QPalette p= m_textLabel->palette();
- switch (state) {
- case Enabled:
- // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1));
- // m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255);");
- break;
-
- case Disabled:
- // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1, 0.25));
- // m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255, 25%);");
- break;
-
- case Normal:
- // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1, 0.50));
- // m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255, 50%);");
- break;
- case Checked:
- // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1));
- // m_textLabel->setStyleSheet("background:transparent;color:rgba(255, 255, 255);");
- break;
-
- default:
- break;
- }
-
- // p.setColor(QPalette::Window,Qt::transparent);
- // m_textLabel->setPalette(p);
-}
diff --git a/src/UserInterface/Button/function_classify_button.h b/src/UserInterface/Button/function_classify_button.h
index e99f2c3..6160fb9 100755
--- a/src/UserInterface/Button/function_classify_button.h
+++ b/src/UserInterface/Button/function_classify_button.h
@@ -58,8 +58,6 @@ public:
QString m_category;
bool m_fullscreen;
bool m_enabled;
- QLabel *m_iconLabel = nullptr;
- QLabel *m_textLabel = nullptr;
State m_state = Checked;
void updateBtnState();
@@ -70,7 +68,6 @@ protected:
void leaveEvent(QEvent *e);
void paintEvent(QPaintEvent *e);
void updateIconState(const State state);
- void updateTextState(const State state);
Q_SIGNALS:
void buttonClicked();
diff --git a/src/UserInterface/Button/letter_classify_button.cpp b/src/UserInterface/Button/letter_classify_button.cpp
index 5bc882f..624c38e 100755
--- a/src/UserInterface/Button/letter_classify_button.cpp
+++ b/src/UserInterface/Button/letter_classify_button.cpp
@@ -28,17 +28,17 @@ LetterClassifyButton::LetterClassifyButton(QWidget *parent,
m_fullscreen(fullscreen)
{
this->setFlat(true);
-
- if (m_fullscreen) {
- QFont font;
- font.setPixelSize(Style::LeftLetterFontSize);
- this->setFont(font);
- QPalette pe = this->palette();
- pe.setColor(QPalette::ButtonText, Qt::white);
- this->setPalette(pe);
- }
-
- this->setText(letter);
+ m_letter = letter;
+// if (m_fullscreen) {
+// QFont font;
+// font.setPixelSize(Style::LeftLetterFontSize);
+// this->setFont(font);
+// QPalette pe = this->palette();
+// pe.setColor(QPalette::ButtonText, Qt::white);
+// this->setPalette(pe);
+// }
+
+// this->setText(letter);
this->setFocusPolicy(Qt::NoFocus);
this->setCheckable(true);
this->setStyleSheet("padding: 0px;");
@@ -82,6 +82,37 @@ void LetterClassifyButton::paintEvent(QPaintEvent *e)
painter.restore();
}
+ if (!(option.state & QStyle::State_Enabled)) {
+ painter.save();
+ QColor color;
+ if (!m_fullscreen) {
+ if ( g_curStyle == "ukui-light") {
+ color = Qt::black;
+ } else {
+ color = Qt::white;
+ }
+ color.setAlphaF(0.2);
+ }
+ painter.setPen(color);
+ painter.drawText(option.rect, Qt::AlignCenter, m_letter);
+ painter.restore();
+ }
+
+ if (option.state & QStyle::State_Enabled) {
+ painter.save();
+ QColor color;
+
+ if ( g_curStyle == "ukui-light") {
+ color = Qt::black;
+ } else {
+ color = Qt::white;
+ }
+ color.setAlphaF(0.9);
+ painter.setPen(color);
+ painter.drawText(option.rect, Qt::AlignCenter, m_letter);
+ painter.restore();
+ }
+
if (m_fullscreen && (option.state & QStyle::State_On)) {
painter.save();
painter.setPen(Qt::NoPen);
@@ -118,7 +149,7 @@ void LetterClassifyButton::enterEvent(QEvent *e)
// this->setFixedSize(Style::LeftLetterBtnHeight*2,Style::LeftLetterBtnHeight*2);
tooltip = new LetterToolTip();
QPoint oPoint = this->mapToGlobal(QPoint(this->rect().x() + 35, this->rect().y() - 10));
- tooltip->setText(this->text());
+ tooltip->setText(m_letter);
tooltip->raise();
tooltip->move(oPoint);
tooltip->show();
diff --git a/src/UserInterface/Button/letter_classify_button.h b/src/UserInterface/Button/letter_classify_button.h
index b6b2a3d..7235987 100755
--- a/src/UserInterface/Button/letter_classify_button.h
+++ b/src/UserInterface/Button/letter_classify_button.h
@@ -35,7 +35,7 @@ public:
);
bool is_pressed = false;
-
+ QString m_letter = QString();
private:
bool m_fullscreen = false;
LetterToolTip *tooltip = nullptr;
diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp
index c02f317..26d86b5 100755
--- a/src/UserInterface/Widget/full_commonuse_widget.cpp
+++ b/src/UserInterface/Widget/full_commonuse_widget.cpp
@@ -119,13 +119,13 @@ void FullCommonUseWidget::initVerticalScrollBar()
m_verticalScrollBar->show();
}
- m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); "
+ m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
"margin: 0px,0px,0px,0px; border-radius: %3px;}"
- "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);"
+ "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
"border-radius: %3px; min-height: %1;}"
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
}
void FullCommonUseWidget::on_powerOffButton_clicked()
@@ -219,11 +219,15 @@ bool FullCommonUseWidget::eventFilter(QObject *watched, QEvent *event)
if (watched == m_verticalScrollBar) {
if (event->type() == QEvent::Enter) {
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
}
if (event->type() == QEvent::Leave) {
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
+ }
+
+ if(event->type() == QEvent::MouseButtonPress) {
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
}
}
diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp
index fd124e4..7cc8464 100755
--- a/src/UserInterface/Widget/full_function_widget.cpp
+++ b/src/UserInterface/Widget/full_function_widget.cpp
@@ -139,13 +139,13 @@ void FullFunctionWidget::initVerticalScrollBar()
m_verticalScrollBar->show();
}
- m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); "
+ m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
"margin: 0px,0px,0px,0px; border-radius: %3px;}"
- "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);"
+ "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
"border-radius: %3px; min-height: %1;}"
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
}
void FullFunctionWidget::on_powerOffButton_clicked()
@@ -505,11 +505,15 @@ bool FullFunctionWidget::eventFilter(QObject *watched, QEvent *event)
if (watched == m_verticalScrollBar) {
if (watched == m_verticalScrollBar) {
if (event->type() == QEvent::Enter) {
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
}
if (event->type() == QEvent::Leave) {
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
+ }
+
+ if(event->type() == QEvent::MouseButtonPress) {
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
}
}
} else {
diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp
index 45fb165..1ebc2c5 100755
--- a/src/UserInterface/Widget/full_letter_widget.cpp
+++ b/src/UserInterface/Widget/full_letter_widget.cpp
@@ -133,13 +133,13 @@ void FullLetterWidget::initVerticalScrollBar()
m_verticalScrollBar->show();
}
- m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); "
+ m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
"margin: 0px,0px,0px,0px; border-radius: %3px;}"
- "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);"
+ "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
"border-radius: %3px; min-height: %1;}"
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
}
void FullLetterWidget::on_powerOffButton_clicked()
@@ -379,7 +379,7 @@ void FullLetterWidget::btnGroupClickedSlot(QAbstractButton *btn)
if (m_btnGroup->id(btn) == m_buttonList.indexOf(button)) {
letterbtn->setChecked(true);
//此处需实现将被选定的字母包含的应用列表移动到applistWid界面最顶端
- QString letterstr = letterbtn->text();
+ QString letterstr = letterbtn->m_letter;
int num = m_letterList.indexOf(letterstr);
if (num != -1) {
@@ -531,11 +531,15 @@ bool FullLetterWidget::eventFilter(QObject *watched, QEvent *event)
{
if (watched == m_verticalScrollBar) {
if (event->type() == QEvent::Enter) {
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
}
if (event->type() == QEvent::Leave) {
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
+ }
+
+ if(event->type() == QEvent::MouseButtonPress) {
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
}
} else {
if (event->type() == QEvent::KeyPress) {
diff --git a/src/UserInterface/Widget/full_searchresult_widget.cpp b/src/UserInterface/Widget/full_searchresult_widget.cpp
index be5dd6b..efdee49 100755
--- a/src/UserInterface/Widget/full_searchresult_widget.cpp
+++ b/src/UserInterface/Widget/full_searchresult_widget.cpp
@@ -108,13 +108,13 @@ void FullSearchResultWidget::initVerticalScrollBar()
m_verticalScrollBar->show();
}
- m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); "
+ m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
"margin: 0px,0px,0px,0px; border-radius: %3px;}"
- "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);"
+ "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
"border-radius: %3px; min-height: %1;}"
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
}
void FullSearchResultWidget::on_powerOffButton_clicked()
@@ -204,11 +204,15 @@ bool FullSearchResultWidget::eventFilter(QObject *watched, QEvent *event)
if (watched == m_verticalScrollBar) {
if (event->type() == QEvent::Enter) {
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
}
if (event->type() == QEvent::Leave) {
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
+ }
+
+ if(event->type() == QEvent::MouseButtonPress) {
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
}
}
diff --git a/src/UserInterface/Widget/function_button_widget.cpp b/src/UserInterface/Widget/function_button_widget.cpp
index cd7b8f8..dbb116c 100755
--- a/src/UserInterface/Widget/function_button_widget.cpp
+++ b/src/UserInterface/Widget/function_button_widget.cpp
@@ -76,7 +76,7 @@ void FunctionButtonWidget::initUi()
Q_FOREACH (QAbstractButton *btn, m_buttonList)
{
FunctionClassifyButton *fbtn = qobject_cast<FunctionClassifyButton *>(btn);
- fbtn->updateIconState();
+ fbtn->updateBtnState();
}
});
}
@@ -88,9 +88,7 @@ void FunctionButtonWidget::initUi()
void FunctionButtonWidget::functionBtnClickedSlot()
{
FunctionClassifyButton *btn = dynamic_cast<FunctionClassifyButton *>(sender());
- QWidget *wid = btn->layout()->itemAt(0)->widget();
- QLabel *label = qobject_cast<QLabel *>(wid);
- Q_EMIT sendFunctionBtnSignal(label->text());
+ Q_EMIT sendFunctionBtnSignal(btn->m_category);
}
void FunctionButtonWidget::hideEvent(QHideEvent *event)
diff --git a/src/UserInterface/Widget/letter_button_widget.cpp b/src/UserInterface/Widget/letter_button_widget.cpp
index 68e3a74..f110340 100755
--- a/src/UserInterface/Widget/letter_button_widget.cpp
+++ b/src/UserInterface/Widget/letter_button_widget.cpp
@@ -47,7 +47,7 @@ void LetterButtonWidget::initUi()
letterlist.append(QString(QChar(letter)));
}
- letterlist.append("&&");
+ letterlist.append("&");
letterlist.append("#");
for (int row = 0; row < 6; row++) {
@@ -78,7 +78,7 @@ void LetterButtonWidget::hideEvent(QHideEvent *event)
void LetterButtonWidget::letterBtnClickedSlot()
{
LetterClassifyButton *btn = dynamic_cast<LetterClassifyButton *>(QObject::sender());
- QString btnname = btn->text();
+ QString btnname = btn->m_letter;
Q_EMIT sendLetterBtnSignal(btnname);
}
@@ -93,7 +93,7 @@ void LetterButtonWidget::recvLetterBtnList(QStringList list)
for (int col = 0; col < 4; col++) {
QLayoutItem *item = gridLayout->itemAt(row * 4 + col);
LetterClassifyButton *btn = static_cast<LetterClassifyButton *>(item->widget());
- QString letterstr = btn->text();
+ QString letterstr = btn->m_letter;
if (list.indexOf(letterstr.at(0)) == -1) {
btn->setEnabled(false);
diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp
index 3c77fd5..3ccb33f 100755
--- a/src/UserInterface/full_mainwindow.cpp
+++ b/src/UserInterface/full_mainwindow.cpp
@@ -3,6 +3,7 @@
#include <QAction>
#include <QTranslator>
#include "utility.h"
+#include <QPalette>
FullMainWindow::FullMainWindow(QWidget *parent) :
QMainWindow(parent)
@@ -290,12 +291,15 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)
{
if (watched == m_lineEdit) {
m_isSearching = true;
- char style[200];
+ QString style;
if (event->type() == QEvent::FocusIn) {
- sprintf(style, "QLineEdit{border:2px solid %s;background-color:%s;border-radius:17px;color:#ffffff;}",
- QueryLineEditClickedBorder, QueryLineEditClickedBackground);
+ QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16);
+ QString color = highLightColor.mid(2, 6);
+ style = QString("QLineEdit{border:2px solid #%1;background-color:%2;border-radius:17px;color:#ffffff;}")
+ .arg(color).arg(QueryLineEditClickedBackground);
m_lineEdit->setStyleSheet(style);
+ myDebug() <<color << style;
if (m_lineEdit->text().isEmpty()) {
qDebug() << "bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)" << m_queryWid->layout()->count();
@@ -310,8 +314,8 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)
m_lineEdit->setTextMargins(26, 0, 0, 0);
}
} else if (event->type() == QEvent::FocusOut && m_lineEdit->text().isEmpty()) {
- sprintf(style, "QLineEdit{border:1px solid %s;background-color:%s;border-radius:17px;color:#ffffff;}",
- QueryLineEditClickedBorderDefault, QueryLineEditClickedBackground);
+ style = QString("QLineEdit{border:1px solid %1;background-color:%2;border-radius:17px;color:#ffffff;}")
+ .arg(QueryLineEditClickedBorderDefault).arg(QueryLineEditClickedBackground);
m_lineEdit->setStyleSheet(style);
resetEditline();
}
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index 1f09418..cc67dcb 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -33,6 +33,7 @@
#include <QGroupBox>
#include <QEventLoop>
#include <QLabel>
+#include <QPalette>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
@@ -316,7 +317,10 @@ void MainWindow::initSearchUi()
m_leftTopSearchHorizontalLayout->setContentsMargins(8, 0, 8, 0);
m_lineEdit = new QLineEdit(m_minSearchPage);
m_lineEdit->setMinimumSize(QSize(30, 26));
- m_lineEdit->setStyleSheet(QString::fromUtf8("border-radius: 13px; border:1px solid rgba(5, 151, 255, 1); background: transparent;"));
+ QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16);
+ QString color = highLightColor.mid(2, 6);
+ QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color);
+ m_lineEdit->setStyleSheet(searchStyle);
m_lineEdit->setFrame(false);
m_lineEdit->setPlaceholderText(tr("Search"));
m_lineEdit->installEventFilter(this);
@@ -519,7 +523,7 @@ void MainWindow::windowOption()
void MainWindow::initUi()
{
qDebug() << "init UI";
- this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);
+ this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::BypassWindowManagerHint);
this->setAttribute(Qt::WA_TranslucentBackground, true);
this->setAutoFillBackground(false);
this->setFocusPolicy(Qt::NoFocus);
@@ -558,11 +562,10 @@ void MainWindow::initUi()
m_dropDownMenu->addAction(m_letterAction);
m_dropDownMenu->addAction(m_funcAction);
m_allAction->setChecked(true);
- m_collectPushButton->setStyleSheet("color:#3790FA;");
- QColor textColor = this->palette().color(QPalette::Text);
- QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue());
- QString textColorDefault = "#" + QString::number(rgbDefault, 16);
- m_recentPushButton->setStyleSheet(QString("color:%1;").arg(textColorDefault));
+ QString textColorHightLight = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16).mid(2, 6);
+ m_collectPushButton->setStyleSheet(QString("color: #%1;").arg(textColorHightLight));
+ QString textColorDefault = QString::number(this->palette().color(QPalette::Text).rgba(), 16).mid(2, 6);
+ m_recentPushButton->setStyleSheet(QString("color: #%1;").arg(textColorDefault));
QAction *action = new QAction();
action->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-icon-search.svg", true));
m_lineEdit->addAction(action, QLineEdit::LeadingPosition);
@@ -1209,13 +1212,12 @@ void MainWindow::on_collectPushButton_clicked()
{
m_rightStackedWidget->setCurrentIndex(0);
- m_collectPushButton->setStyleSheet("color:#3790FA;");
+ QString textColorHightLight = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16).mid(2, 6);
+ m_collectPushButton->setStyleSheet(QString("color:#%1;").arg(textColorHightLight));
QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2);
m_collectPushButton->setFont(collectFont);
- QColor textColor = this->palette().color(QPalette::Text);
- QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue());
- QString textColorDefault = "#" + QString::number(rgbDefault, 16);
- m_recentPushButton->setStyleSheet(QString("color:%1;").arg(textColorDefault));
+ QString textColorDefault = QString::number(this->palette().color(QPalette::Text).rgba(), 16).mid(2, 6);
+ m_recentPushButton->setStyleSheet(QString("color:#%1;").arg(textColorDefault));
QFont recentFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize());
m_recentPushButton->setFont(recentFont);
}
@@ -1223,13 +1225,12 @@ void MainWindow::on_collectPushButton_clicked()
void MainWindow::on_recentPushButton_clicked()
{
m_rightStackedWidget->setCurrentIndex(1);
- QColor textColor = this->palette().color(QPalette::Text);
- QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue());
- QString textColorDefault = "#" + QString::number(rgbDefault, 16);
- m_collectPushButton->setStyleSheet(QString("color:%1").arg(textColorDefault));
+ QString textColorDefault = QString::number(this->palette().color(QPalette::Text).rgba(), 16).mid(2, 6);
+ m_collectPushButton->setStyleSheet(QString("color:#%1").arg(textColorDefault));
QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize());
m_collectPushButton->setFont(collectFont);
- m_recentPushButton->setStyleSheet("color:#3790FA");
+ QString textColorHightLight = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16).mid(2, 6);
+ m_recentPushButton->setStyleSheet(QString("color:#%1").arg(textColorHightLight));
QFont recentFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2);
m_recentPushButton->setFont(recentFont);

View File

@ -1,129 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Thu, 21 Jul 2022 15:36:44 +0800
Subject: =?utf-8?b?5pu05pawY2hhbmdlbG9n5L+h5oGv?=
---
src/UserInterface/Button/function_classify_button.cpp | 11 ++++++++---
src/UserInterface/Button/letter_classify_button.cpp | 11 ++++++++---
src/UserInterface/full_mainwindow.cpp | 9 ++++++++-
src/UserInterface/mainwindow.cpp | 18 +++++++++++++++++-
4 files changed, 41 insertions(+), 8 deletions(-)
diff --git a/src/UserInterface/Button/function_classify_button.cpp b/src/UserInterface/Button/function_classify_button.cpp
index 8ddabe1..ffed89c 100755
--- a/src/UserInterface/Button/function_classify_button.cpp
+++ b/src/UserInterface/Button/function_classify_button.cpp
@@ -117,11 +117,16 @@ void FunctionClassifyButton::paintEvent(QPaintEvent *e)
painter.save();
QColor color;
- if ( g_curStyle == "ukui-light") {
- color = Qt::black;
+ if (m_fullscreen) {
+ color = Qt::white;
} else {
- color = Qt::white;
+ if ( g_curStyle == "ukui-light") {
+ color = Qt::black;
+ } else {
+ color = Qt::white;
+ }
}
+
color.setAlphaF(0.9);
painter.setPen(color);
painter.drawText(option.rect, Qt::AlignCenter, m_category);
diff --git a/src/UserInterface/Button/letter_classify_button.cpp b/src/UserInterface/Button/letter_classify_button.cpp
index 624c38e..11073a8 100755
--- a/src/UserInterface/Button/letter_classify_button.cpp
+++ b/src/UserInterface/Button/letter_classify_button.cpp
@@ -102,11 +102,16 @@ void LetterClassifyButton::paintEvent(QPaintEvent *e)
painter.save();
QColor color;
- if ( g_curStyle == "ukui-light") {
- color = Qt::black;
+ if (m_fullscreen) {
+ color = Qt::white;
} else {
- color = Qt::white;
+ if ( g_curStyle == "ukui-light") {
+ color = Qt::black;
+ } else {
+ color = Qt::white;
+ }
}
+
color.setAlphaF(0.9);
painter.setPen(color);
painter.drawText(option.rect, Qt::AlignCenter, m_letter);
diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp
index 3ccb33f..555c6a6 100755
--- a/src/UserInterface/full_mainwindow.cpp
+++ b/src/UserInterface/full_mainwindow.cpp
@@ -123,6 +123,13 @@ void FullMainWindow::initSearchUI()
if (key.contains(QString("styleName"))) {
changeStyle();
}
+
+ if (key.contains(QString("theme-color"))) {
+ QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16);
+ QString color = highLightColor.mid(2, 6);
+ QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color);
+ m_lineEdit->setStyleSheet(searchStyle);
+ }
});
}
@@ -294,7 +301,7 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)
QString style;
if (event->type() == QEvent::FocusIn) {
- QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16);
+ QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16);
QString color = highLightColor.mid(2, 6);
style = QString("QLineEdit{border:2px solid #%1;background-color:%2;border-radius:17px;color:#ffffff;}")
.arg(color).arg(QueryLineEditClickedBackground);
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index cc67dcb..355a8bd 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -275,6 +275,13 @@ void MainWindow::initGsettings()
if (key.contains(QString("styleName"))) {
changeStyle();
}
+
+ if (key.contains(QString("theme-color"))) {
+ QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16);
+ QString color = highLightColor.mid(2, 6);
+ QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color);
+ m_lineEdit->setStyleSheet(searchStyle);
+ }
});
}
}
@@ -317,7 +324,7 @@ void MainWindow::initSearchUi()
m_leftTopSearchHorizontalLayout->setContentsMargins(8, 0, 8, 0);
m_lineEdit = new QLineEdit(m_minSearchPage);
m_lineEdit->setMinimumSize(QSize(30, 26));
- QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16);
+ QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16);
QString color = highLightColor.mid(2, 6);
QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color);
m_lineEdit->setStyleSheet(searchStyle);
@@ -942,6 +949,15 @@ bool MainWindow::eventFilter(QObject *target, QEvent *event)
}
}
+ if (target == m_lineEdit) {
+ if (event->type() == QEvent::FocusIn) {
+ QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16);
+ QString color = highLightColor.mid(2, 6);
+ QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color);
+ m_lineEdit->setStyleSheet(searchStyle);
+ }
+ }
+
if (event->type() == QEvent::KeyPress) {
QKeyEvent *ke = (QKeyEvent *)event;

View File

@ -1,38 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Mon, 25 Jul 2022 09:22:34 +0800
Subject: =?utf-8?b?5L+u5pS55bmz5p2/5qih5byP5LiLd2lu6ZSu6IO95aSf5omT5byA5byA?=
=?utf-8?b?5aeL6I+c5Y2V6Zeu6aKY?=
---
src/UserInterface/mainwindow.cpp | 5 +++++
src/UserInterface/mainwindow.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index 355a8bd..147ddae 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -117,6 +117,11 @@ void MainWindow::setTabletModeFlag()
}
}
+void MainWindow::tabletModeChangeSlot(bool flag)
+{
+ m_isTabletMode = flag;
+}
+
void MainWindow::registDbusServer()
{
m_dbus = new DBus;
diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h
index 30aa46b..1b5363d 100755
--- a/src/UserInterface/mainwindow.h
+++ b/src/UserInterface/mainwindow.h
@@ -143,6 +143,7 @@ public Q_SLOTS:
void maxAnimationFinished();
void iconAnimationFinished();
void changeStyle();
+ void tabletModeChangeSlot(bool flag);
private Q_SLOTS:
void on_selectMenuButton_triggered(QAction *arg1);

View File

@ -1,684 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Thu, 28 Jul 2022 08:54:03 +0800
Subject: =?utf-8?b?5L+u5pS55YiG57G75LiL5ouJ6YCJ5oup5qGG5a695bqm77yM6Kej5Yaz?=
=?utf-8?b?5pyA5aSn5Y+35a2X5L2TaG92ZXLotoXlh7rovrnnlYzpl67popg=?=
---
src/UserInterface/ListView/klistview.cpp | 2 +-
src/UserInterface/ListView/listview.cpp | 2 +-
src/UserInterface/full_mainwindow.cpp | 3 +-
src/UserInterface/mainwindow.cpp | 3 +-
translations/ukui-menu_bo.ts | 280 -----------------------------
translations/ukui-menu_bo_CN.ts | 292 +++++++++++++++++++++++++++++++
ukui-menu.pro | 2 +-
7 files changed, 297 insertions(+), 287 deletions(-)
delete mode 100755 translations/ukui-menu_bo.ts
create mode 100644 translations/ukui-menu_bo_CN.ts
diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp
index 8151d04..3954bc9 100755
--- a/src/UserInterface/ListView/klistview.cpp
+++ b/src/UserInterface/ListView/klistview.cpp
@@ -45,8 +45,8 @@ void KListView::onClicked(QModelIndex index)
if (var.isValid()) {
QString desktopfp = var.value<QString>();
- execApp(desktopfp);
Q_EMIT sendHideMainWindowSignal();
+ execApp(desktopfp);
}
}
diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp
index 78ed0a3..368f25a 100755
--- a/src/UserInterface/ListView/listview.cpp
+++ b/src/UserInterface/ListView/listview.cpp
@@ -107,8 +107,8 @@ void ListView::onClicked(QModelIndex index)
if (var.value<QStringList>().at(1).toInt() == 0) {
Q_EMIT sendAppClassificationBtnClicked();
} else {
- execApp(desktopfp);
Q_EMIT sendHideMainWindowSignal();
+ execApp(desktopfp);
}
}
}
diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp
index 555c6a6..dfd692f 100755
--- a/src/UserInterface/full_mainwindow.cpp
+++ b/src/UserInterface/full_mainwindow.cpp
@@ -177,7 +177,6 @@ void FullMainWindow::initAppListUI()
void FullMainWindow::initMenu()
{
m_dropDownMenu = new MenuBox(this);
- m_dropDownMenu->setFixedWidth(Style::DropMenuWidth);
m_allAction = new QAction(m_dropDownMenu);
m_letterAction = new QAction(m_dropDownMenu);
m_funcAction = new QAction(m_dropDownMenu);
@@ -381,7 +380,7 @@ void FullMainWindow::iconAnimationFinished()
{
m_dropDownMenu->raise();
m_dropDownMenu->exec(m_fullSelectMenuButton->mapToGlobal(QPoint(m_fullSelectMenuButton->width()
- -Style::DropMenuWidth, 45)));
+ - m_dropDownMenu->sizeHint().width(), 45)));
}
void FullMainWindow::keyPressEvent(QKeyEvent *e)
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index 147ddae..8427b34 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -560,7 +560,6 @@ void MainWindow::initUi()
}
m_dropDownMenu = new MenuBox(this);
- m_dropDownMenu->setFixedWidth(Style::DropMenuWidth);
m_allAction = new QAction(m_dropDownMenu);
m_letterAction = new QAction(m_dropDownMenu);
m_funcAction = new QAction(m_dropDownMenu);
@@ -783,7 +782,7 @@ void MainWindow::iconAnimationFinished()
{
m_dropDownMenu->raise();
m_dropDownMenu->exec(m_selectMenuButton->mapToGlobal(QPoint(m_selectMenuButton->width()
- -Style::DropMenuWidth + 5, 29)));
+ - m_dropDownMenu->sizeHint().width() + 5, 29)));
}
void MainWindow::maxAnimationFinished()
diff --git a/translations/ukui-menu_bo.ts b/translations/ukui-menu_bo.ts
deleted file mode 100755
index 370c9d8..0000000
--- a/translations/ukui-menu_bo.ts
+++ /dev/null
@@ -1,280 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1">
-<context>
- <name>FullMainWindow</name>
- <message>
- <location filename="../src/UserInterface/full_mainwindow.cpp" line="87"/>
- <source>Search</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/full_mainwindow.cpp" line="145"/>
- <source>All</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/full_mainwindow.cpp" line="147"/>
- <source>Letter</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/full_mainwindow.cpp" line="149"/>
- <source>Function</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>FunctionWidget</name>
- <message>
- <location filename="../src/UserInterface/Widget/function_Widget.cpp" line="199"/>
- <source>Search</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>ItemDelegate</name>
- <message>
- <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="176"/>
- <source>Open the function sort menu</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="178"/>
- <source>Open the alphabetical menu</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>MainWindow</name>
- <message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="497"/>
- <source>collection</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="313"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="490"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="551"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1119"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1120"/>
- <source>All</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="309"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="331"/>
- <source>Search</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="449"/>
- <source>No recent files</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="498"/>
- <source>recent</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="499"/>
- <source>Max</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="501"/>
- <source>PowerOff</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="553"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1132"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1133"/>
- <source>Letter</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/mainwindow.cpp" line="555"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1145"/>
- <location filename="../src/UserInterface/mainwindow.cpp" line="1146"/>
- <source>Function</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>QObject</name>
- <message>
- <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="73"/>
- <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="29"/>
- <source>Office</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="74"/>
- <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="30"/>
- <source>Development</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="75"/>
- <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="31"/>
- <source>Image</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="76"/>
- <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="32"/>
- <source>Video</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="77"/>
- <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="33"/>
- <source>Internet</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="78"/>
- <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="34"/>
- <source>Game</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="79"/>
- <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="35"/>
- <source>Education</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="80"/>
- <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="36"/>
- <source>Social</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="81"/>
- <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="37"/>
- <source>System</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="82"/>
- <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="38"/>
- <source>Safe</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="83"/>
- <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="39"/>
- <source>Others</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>RightClickMenu</name>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="213"/>
- <source>Pin to all</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="216"/>
- <source>Unpin from all</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="226"/>
- <source>Pin to taskbar</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="229"/>
- <source>Unpin from taskbar</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="232"/>
- <source>Add to desktop shortcuts</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="236"/>
- <source>Pin to collection</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="239"/>
- <source>Remove from collection</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="254"/>
- <source>Uninstall</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="274"/>
- <source>Switch user</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="281"/>
- <source>Hibernate</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="288"/>
- <source>Sleep</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="292"/>
- <source>Lock Screen</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="297"/>
- <source>Log Out</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="304"/>
- <source>Restart</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="311"/>
- <source>Power Off</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="342"/>
- <source>Personalize this list</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>TabletRightClickMenu</name>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="220"/>
- <source>Pin to taskbar</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="223"/>
- <source>Unpin from taskbar</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="229"/>
- <source>Add to desktop shortcuts</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="248"/>
- <source>Uninstall</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-</TS>
diff --git a/translations/ukui-menu_bo_CN.ts b/translations/ukui-menu_bo_CN.ts
new file mode 100644
index 0000000..d92f153
--- /dev/null
+++ b/translations/ukui-menu_bo_CN.ts
@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="bo_CN">
+<context>
+ <name>FullMainWindow</name>
+ <message>
+ <location filename="../src/UserInterface/full_mainwindow.cpp" line="87"/>
+ <source>Search</source>
+ <translation>འཚོལ་ཞིབ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/full_mainwindow.cpp" line="145"/>
+ <source>All</source>
+ <translation>ཚང་མ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/full_mainwindow.cpp" line="147"/>
+ <source>Letter</source>
+ <translation>འཕྲིན་ཡིག</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/full_mainwindow.cpp" line="149"/>
+ <source>Function</source>
+ <translation>བྱེད་ནུས།</translation>
+ </message>
+</context>
+<context>
+ <name>FunctionWidget</name>
+ <message>
+ <location filename="../src/UserInterface/Widget/function_Widget.cpp" line="199"/>
+ <source>Search</source>
+ <translation>འཚོལ་ཞིབ།</translation>
+ </message>
+</context>
+<context>
+ <name>ItemDelegate</name>
+ <message>
+ <source>Open feature sort list</source>
+ <translation type="vanished">打开功能排序菜单</translation>
+ </message>
+ <message>
+ <source>Open alphabetical list</source>
+ <translation type="vanished">打开字母排序菜单</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="176"/>
+ <source>Open the function sort menu</source>
+ <translation>བྱེད་ལས་རིགས་ཀྱི་ཟས་ཐོའི་ཁ་ཕྱེ་བ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/ViewItem/itemdelegate.cpp" line="178"/>
+ <source>Open the alphabetical menu</source>
+ <translation>དབྱངས་གསལ་ཡི་གེའི་ཟས་ཐོའི་ཁ་ཕྱེ་བ།</translation>
+ </message>
+</context>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="309"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="331"/>
+ <source>Search</source>
+ <translation>འཚོལ་ཞིབ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="449"/>
+ <source>No recent files</source>
+ <translation>ཉེ་དུས་ཀྱི་ཡིག་ཆ་མེད།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="313"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="490"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="551"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1119"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1120"/>
+ <source>All</source>
+ <translation>ཚང་མ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="497"/>
+ <source>collection</source>
+ <translation>བསྡུ་ཉར།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="498"/>
+ <source>recent</source>
+ <translation>ཉེ་ཆར།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="499"/>
+ <source>Max</source>
+ <translation>མའེ་ཁེ་སི།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="501"/>
+ <source>PowerOff</source>
+ <translation>སྒུལ་ཤུགས་ཀྱི་ནུས་པ།</translation>
+ </message>
+ <message>
+ <source>Search application</source>
+ <translation type="vanished">搜索应用</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="553"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1132"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1133"/>
+ <source>Letter</source>
+ <translation>འཕྲིན་ཡིག</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="555"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1145"/>
+ <location filename="../src/UserInterface/mainwindow.cpp" line="1146"/>
+ <source>Function</source>
+ <translation>བྱེད་ནུས།</translation>
+ </message>
+</context>
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="73"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="29"/>
+ <source>Office</source>
+ <translation>གཞུང་ལས་ཁང་།</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="74"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="30"/>
+ <source>Development</source>
+ <translation>འཕེལ་རྒྱས་</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="75"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="31"/>
+ <source>Image</source>
+ <translation>པར་རིས།</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="76"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="32"/>
+ <source>Video</source>
+ <translation>བརྙན་ཕབ།</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="77"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="33"/>
+ <source>Internet</source>
+ <translation>དྲ་སྦྲེལ།</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="78"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="34"/>
+ <source>Game</source>
+ <translation>རོལ་རྩེད།</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="79"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="35"/>
+ <source>Education</source>
+ <translation>སློབ་གསོ།</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="80"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="36"/>
+ <source>Social</source>
+ <translation>སྤྱི་ཚོགས།</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="81"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="37"/>
+ <source>System</source>
+ <translation>ལམ་ལུགས།</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="82"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="38"/>
+ <source>Safe</source>
+ <translation>བདེ་འཇགས།</translation>
+ </message>
+ <message>
+ <location filename="../src/BackProcess/Interface/ukuimenuinterface.cpp" line="83"/>
+ <location filename="../src/UserInterface/Widget/function_button_widget.cpp" line="39"/>
+ <source>Others</source>
+ <translation>དེ་མིན་ད་དུང་</translation>
+ </message>
+</context>
+<context>
+ <name>RightClickMenu</name>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="213"/>
+ <source>Pin to all</source>
+ <translation>མི་ཚང་མར་ཁབ་རྒྱག་པ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="216"/>
+ <source>Unpin from all</source>
+ <translation>མི་ཚང་མའི་ཁྲོད་ནས་བཀག་འགོག་བྱེད་</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="226"/>
+ <source>Pin to taskbar</source>
+ <translation>ལས་འགན་སྒྲུབ་པར་ཁབ་རྒྱག་པ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="229"/>
+ <source>Unpin from taskbar</source>
+ <translation>ལས་འགན་སྒྲུབ་ས་ནས་ཁ་པར་གཏོང་བ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="232"/>
+ <source>Add to desktop shortcuts</source>
+ <translation>ཅོག་ཙེའི་སྟེང་གི་མགྱོགས་ལམ་ཁ་སྣོན་བྱས་ཡོད།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="236"/>
+ <source>Pin to collection</source>
+ <translation>འཚོལ་སྡུད་བྱེད་པའི་ཁབ་སྐུད།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="239"/>
+ <source>Remove from collection</source>
+ <translation>བསྡུ་ཉར་དངོས་རྫས་ཁྲོད་ནས་ཕྱིར་</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="254"/>
+ <source>Uninstall</source>
+ <translation>སྒྲིག་སྦྱོར་བྱས་མེད་པ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="274"/>
+ <source>Switch user</source>
+ <translation>གློག་སྒོ་འབྱེད་པའི་སྤྱོད་མཁན</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="281"/>
+ <source>Hibernate</source>
+ <translation>ཧིན་རྡུ་ཉི་ཞི་ཡ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="288"/>
+ <source>Sleep</source>
+ <translation>གཉིད་ཁུག་པ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="292"/>
+ <source>Lock Screen</source>
+ <translation>སྒོ་ལྕགས་ཀྱི་བརྙན་ཤེལ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="297"/>
+ <source>Log Out</source>
+ <translation>ཕྱིར་འཐེན་བྱ་དགོས།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="304"/>
+ <source>Restart</source>
+ <translation>ཡང་བསྐྱར་འགོ་འཛུགས་</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="311"/>
+ <source>Power Off</source>
+ <translation>གློག་ཆད་པ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="342"/>
+ <source>Personalize this list</source>
+ <translation>མིང་ཐོ་འདི་རང་གཤིས་ཅན་དུ་བསྒྱུར</translation>
+ </message>
+</context>
+<context>
+ <name>TabletRightClickMenu</name>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="220"/>
+ <source>Pin to taskbar</source>
+ <translation>ལས་འགན་སྒྲུབ་པར་ཁབ་རྒྱག་པ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="223"/>
+ <source>Unpin from taskbar</source>
+ <translation>ལས་འགན་སྒྲུབ་ས་ནས་ཁ་པར་གཏོང་བ།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="229"/>
+ <source>Add to desktop shortcuts</source>
+ <translation>ཅོག་ཙེའི་སྟེང་གི་མགྱོགས་ལམ་ཁ་སྣོན་བྱས་ཡོད།</translation>
+ </message>
+ <message>
+ <location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="248"/>
+ <source>Uninstall</source>
+ <translation>སྒྲིག་སྦྱོར་བྱས་མེད་པ།</translation>
+ </message>
+</context>
+</TS>
diff --git a/ukui-menu.pro b/ukui-menu.pro
index c249692..1ca9797 100755
--- a/ukui-menu.pro
+++ b/ukui-menu.pro
@@ -20,7 +20,7 @@ TEMPLATE = app
target.path = /usr/bin
TRANSLATIONS+=\
- translations/ukui-menu_bo.ts \
+ translations/ukui-menu_bo_CN.ts \
translations/ukui-menu_zh_CN.ts \
translations/ukui-menu_tr.ts

View File

@ -1,430 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Thu, 18 Aug 2022 11:40:49 +0800
Subject: =?utf-8?b?5L+u5pS55YWo5bGP5byA5aeL6I+c5Y2V5Zu65a6a5Yiw5pS26JeP5LiN?=
=?utf-8?b?55Sf5pWI6Zeu6aKY?=
---
.../FileWatcher/convert_winid_to_desktop.cpp | 1 -
src/UserInterface/ListView/klistview.cpp | 13 ++++++++++---
src/UserInterface/ListView/klistview.h | 1 +
src/UserInterface/Other/scrollarea.cpp | 20 +++++---------------
src/UserInterface/Widget/full_commonuse_widget.cpp | 9 +++++----
src/UserInterface/Widget/full_commonuse_widget.h | 1 +
src/UserInterface/Widget/full_function_widget.cpp | 7 ++++---
src/UserInterface/Widget/full_function_widget.h | 1 +
src/UserInterface/Widget/full_letter_widget.cpp | 14 +++++++-------
src/UserInterface/Widget/full_letter_widget.h | 2 ++
.../Widget/full_searchresult_widget.cpp | 5 +++--
src/UserInterface/Widget/full_searchresult_widget.h | 1 +
src/UserInterface/full_mainwindow.cpp | 11 ++++++++++-
src/UserInterface/full_mainwindow.h | 2 ++
src/UserInterface/mainwindow.cpp | 1 +
src/UtilityFunction/Style/style.cpp | 6 ++++--
src/UtilityFunction/Style/style.h | 1 +
17 files changed, 58 insertions(+), 38 deletions(-)
diff --git a/src/BackProcess/FileWatcher/convert_winid_to_desktop.cpp b/src/BackProcess/FileWatcher/convert_winid_to_desktop.cpp
index cf17b36..f7bc939 100755
--- a/src/BackProcess/FileWatcher/convert_winid_to_desktop.cpp
+++ b/src/BackProcess/FileWatcher/convert_winid_to_desktop.cpp
@@ -18,7 +18,6 @@
#include "convert_winid_to_desktop.h"
#include "utility.h"
-#include <KWindowSystem>
#include <QFile>
#include <QDebug>
#include <QDir>
diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp
index 3954bc9..fcf4480 100755
--- a/src/UserInterface/ListView/klistview.cpp
+++ b/src/UserInterface/ListView/klistview.cpp
@@ -69,14 +69,21 @@ void KListView::mouseMoveEvent(QMouseEvent *e)
void KListView::mousePressEvent(QMouseEvent *event)
{
- if (!(this->indexAt(event->pos()).isValid()) && event->button() == Qt::LeftButton) {
- Q_EMIT sendHideMainWindowSignal();
- } else {
+ if ((this->indexAt(event->pos()).isValid()) && event->button() == Qt::LeftButton) {
pressApp = listmodel->data(this->indexAt(event->pos()), Qt::DisplayRole);
}
return QListView::mousePressEvent(event);
}
+void KListView::mouseReleaseEvent(QMouseEvent *e)
+{
+ if (!(this->indexAt(e->pos()).isValid()) && e->button() == Qt::LeftButton) {
+ Q_EMIT sendHideMainWindowSignal();
+ } else {
+ return QListView::mouseReleaseEvent(e);
+ }
+}
+
void KListView::rightClickedSlot(const QPoint &pos)
{
if (!(this->selectionModel()->selectedIndexes().isEmpty())) {
diff --git a/src/UserInterface/ListView/klistview.h b/src/UserInterface/ListView/klistview.h
index e932fd2..37359b7 100755
--- a/src/UserInterface/ListView/klistview.h
+++ b/src/UserInterface/ListView/klistview.h
@@ -24,6 +24,7 @@ protected:
void paintEvent(QPaintEvent *e);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *e);
+ void mouseReleaseEvent(QMouseEvent *e);
public:
void addData(QStringList data);
void updateData(QStringList data);
diff --git a/src/UserInterface/Other/scrollarea.cpp b/src/UserInterface/Other/scrollarea.cpp
index 65c26e5..2bb4d2d 100755
--- a/src/UserInterface/Other/scrollarea.cpp
+++ b/src/UserInterface/Other/scrollarea.cpp
@@ -74,23 +74,13 @@ void ScrollAreaWid::paintEvent(QPaintEvent *event)
ScrollArea::ScrollArea()
{
- // this->verticalScrollBar()->setVisible(false);
- // this->setFocusPolicy(Qt::NoFocus);
- //// this->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
- this->setFixedWidth(1330);
- // this->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu);
+ this->setFocusPolicy(Qt::NoFocus);
+ this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
+ this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
this->setFrameShape(QFrame::NoFrame);
- // this->verticalScrollBar()->setProperty("drawScrollBarGroove",false);
- // this->verticalScrollBar()->setAttribute(Qt::WA_TranslucentBackground, false);
- this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
this->verticalScrollBar()->setVisible(false);
- //滚动条设置
- QPalette p = this->verticalScrollBar()->palette();
- QColor color(255, 255, 255);
- color.setAlphaF(0.25);
- p.setColor(QPalette::Active, QPalette::Button, color);
- this->verticalScrollBar()->setPalette(p);
+ this->horizontalScrollBar()->setVisible(false);
+ this->setStyleSheet("QWidget{background:transparent;}");
}
void ScrollArea::setFocusToNextChild()
diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp
index 26d86b5..6f138f1 100755
--- a/src/UserInterface/Widget/full_commonuse_widget.cpp
+++ b/src/UserInterface/Widget/full_commonuse_widget.cpp
@@ -48,11 +48,11 @@ void FullCommonUseWidget::initUi()
m_scrollArea = new ScrollArea();
m_scrollAreaWid = new ScrollAreaWid(this);
m_scrollAreaWid->setAttribute(Qt::WA_TranslucentBackground);
- m_scrollArea->setFixedSize(Style::m_applistWidWidth, Style::m_applistWidHeight);
+ m_scrollArea->setFixedSize(Style::m_applistAreaWidth, Style::m_applistWidHeight);
m_scrollArea->setWidget(m_scrollAreaWid);
+ m_scrollArea->setAlignment(Qt::AlignCenter);
m_scrollArea->setStyleSheet("QWidget{background:transparent;}");
m_scrollArea->setWidgetResizable(true);
- m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_scrollAreaWidLayout = new QVBoxLayout(m_scrollAreaWid);
m_scrollAreaWidLayout->setContentsMargins(0, 0, 0, 0);
m_scrollAreaWidLayout->setSpacing(10);
@@ -146,9 +146,10 @@ void FullCommonUseWidget::initAppListWidget()
m_listView = new FullListView(this, 0);
m_listView->installEventFilter(this);
m_scrollAreaWidLayout->addWidget(m_listView);
- m_listView->setFixedWidth(m_scrollArea->width());
+ m_listView->setFixedWidth(m_scrollAreaWid->width());
connect(m_listView, &FullListView::sendItemClickedSignal, this, &FullCommonUseWidget::execApplication);
connect(m_listView, &FullListView::sendUpdateAppListSignal, this, &FullCommonUseWidget::updateListViewSlot);
+ connect(m_listView, &FullListView::sendCollectViewUpdate, this, &FullCommonUseWidget::sendCollectViewUpdate);
connect(m_listView, &FullListView::sendHideMainWindowSignal, this, &FullCommonUseWidget::sendHideMainWindowSignal);
connect(m_listView, &FullListView::sendSetslidebar, this, &FullCommonUseWidget::onSetSlider);
}
@@ -281,7 +282,7 @@ void FullCommonUseWidget::updateListView()
void FullCommonUseWidget::repaintWidget()
{
- m_scrollArea->setFixedSize(Style::m_applistWidWidth, Style::m_applistWidHeight);
+ m_scrollArea->setFixedSize(Style::m_applistAreaWidth, Style::m_applistWidHeight);
m_scrollAreaWidLayout->removeWidget(m_listView);
m_listView->setParent(nullptr);
delete m_listView;
diff --git a/src/UserInterface/Widget/full_commonuse_widget.h b/src/UserInterface/Widget/full_commonuse_widget.h
index 9f60538..d13ad45 100755
--- a/src/UserInterface/Widget/full_commonuse_widget.h
+++ b/src/UserInterface/Widget/full_commonuse_widget.h
@@ -134,6 +134,7 @@ Q_SIGNALS:
void changeScrollValue(int value, int maximumValue);
void setFocusToSideWin();
void sendUpdateOtherView();
+ void sendCollectViewUpdate();
};
#endif // FULLCOMMONUSEWIDGET_H
diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp
index 7cc8464..b07133f 100755
--- a/src/UserInterface/Widget/full_function_widget.cpp
+++ b/src/UserInterface/Widget/full_function_widget.cpp
@@ -45,7 +45,7 @@ void FullFunctionWidget::initUi()
m_iconListWid = new QWidget(this);
m_iconListWid->setAttribute(Qt::WA_TranslucentBackground);
m_iconListWid->setAutoFillBackground(false);
- m_applistWid->setFixedSize(Style::m_applistWidWidth, Style::m_applistWidHeight);
+ m_applistWid->setFixedSize(Style::m_applistAreaWidth, Style::m_applistWidHeight);
m_iconListWid->setFixedSize(Style::m_leftWidWidth, Style::m_applistWidHeight);
m_verticalScrollBar = new QScrollBar(m_scrollArea);
m_verticalScrollBar->installEventFilter(this);
@@ -111,10 +111,10 @@ void FullFunctionWidget::initAppListWidget()
layout->setContentsMargins(0, 0, 0, 0);
m_applistWid->setLayout(layout);
m_scrollArea = new ScrollArea;
- m_scrollArea->setStyleSheet("background:transparent");
m_scrollAreaWid = new ScrollAreaWid(this);
m_scrollAreaWid->setAttribute(Qt::WA_TranslucentBackground);
m_scrollArea->setFixedSize(m_applistWid->width(), m_applistWid->height());
+ m_scrollAreaWid->adjustSize();
m_scrollArea->setWidget(m_scrollAreaWid);
m_scrollArea->setWidgetResizable(true);
m_scrollAreaWidLayout = new QVBoxLayout(m_scrollAreaWid);
@@ -211,6 +211,7 @@ void FullFunctionWidget::insertAppList(QStringList desktopfplist)
connect(listview, &FullListView::sendItemClickedSignal, this, &FullFunctionWidget::execApplication);
connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullFunctionWidget::sendHideMainWindowSignal);
connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullFunctionWidget::sendUpdateCommonView);
+ connect(listview, &FullListView::sendCollectViewUpdate, this, &FullFunctionWidget::sendCollectViewUpdate);
}
/**
@@ -473,7 +474,7 @@ void FullFunctionWidget::setFunctionBtnGeometry()
void FullFunctionWidget::repaintWidget()
{
- m_applistWid->setFixedSize(Style::m_applistWidWidth, Style::m_applistWidHeight);
+ m_applistWid->setFixedSize(Style::m_applistAreaWidth, Style::m_applistWidHeight);
m_iconListWid->setFixedSize(Style::m_leftWidWidth, Style::m_applistWidHeight);
m_scrollArea->setFixedSize(m_applistWid->width(), m_applistWid->height());
updateAppListView();
diff --git a/src/UserInterface/Widget/full_function_widget.h b/src/UserInterface/Widget/full_function_widget.h
index 931104c..22e2a99 100755
--- a/src/UserInterface/Widget/full_function_widget.h
+++ b/src/UserInterface/Widget/full_function_widget.h
@@ -197,6 +197,7 @@ Q_SIGNALS:
void sendUpdateCommonView();
+ void sendCollectViewUpdate();
};
#endif // FULLFUNCTIONWIDGET_H
diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp
index 1ebc2c5..64e7537 100755
--- a/src/UserInterface/Widget/full_letter_widget.cpp
+++ b/src/UserInterface/Widget/full_letter_widget.cpp
@@ -77,12 +77,10 @@ void FullLetterWidget::initAppListWidget()
// layout->setContentsMargins(0,0,0,0);
// m_applistWid->setLayout(layout);
m_scrollArea = new ScrollArea();
- m_scrollArea->setStyleSheet("background:transparent");
m_scrollAreaWid = new ScrollAreaWid(this);
m_scrollArea->setWidget(m_scrollAreaWid);
- m_scrollArea->setFixedSize(Style::m_applistWidWidth, Style::m_applistWidHeight);
- m_scrollArea->setWidgetResizable(true);
- // m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ m_scrollAreaWid->setFixedWidth(Style::m_applistWidWidth);
+ m_scrollArea->setFixedSize(Style::m_applistAreaWidth, Style::m_applistWidHeight);
m_scrollAreaWidLayout = new QVBoxLayout;
m_scrollAreaWidLayout->setContentsMargins(0, 0, 0, 0);
m_scrollAreaWidLayout->setSpacing(10);
@@ -211,6 +209,7 @@ void FullLetterWidget::fillAppList()
connect(listview, &FullListView::sendItemClickedSignal, this, &FullLetterWidget::execApplication);
connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullLetterWidget::sendHideMainWindowSignal);
connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullLetterWidget::sendUpdateCommonView);
+ connect(listview, &FullListView::sendCollectViewUpdate, this, &FullLetterWidget::sendCollectViewUpdate);
}
}
@@ -304,12 +303,12 @@ void FullLetterWidget::resizeScrollAreaControls()
rowcount = listview->model()->rowCount() / dividend;
}
- listview->setFixedSize(m_scrollArea->width(), listview->gridSize().height()*rowcount);
+ listview->setFixedHeight(listview->gridSize().height()*rowcount);
areaHeight += listview->height() + 50;
row++;
}
- m_scrollArea->widget()->setFixedSize(m_scrollArea->width(), areaHeight - 10);
+ m_scrollArea->widget()->setFixedHeight(areaHeight - 10);
}
/**
@@ -480,7 +479,8 @@ void FullLetterWidget::setLetterBtnGeometry()
void FullLetterWidget::repaintWidget()
{
m_letterListWid->setFixedSize(Style::m_leftWidWidth, Style::m_applistWidHeight);
- m_scrollArea->setFixedSize(Style::m_applistWidWidth, Style::m_applistWidHeight);
+ m_scrollArea->setFixedSize(Style::m_applistAreaWidth, Style::m_applistWidHeight);
+ m_scrollAreaWid->setFixedWidth(Style::m_applistWidWidth);
updateAppListView();
}
diff --git a/src/UserInterface/Widget/full_letter_widget.h b/src/UserInterface/Widget/full_letter_widget.h
index 662408b..9799ee4 100755
--- a/src/UserInterface/Widget/full_letter_widget.h
+++ b/src/UserInterface/Widget/full_letter_widget.h
@@ -199,6 +199,8 @@ Q_SIGNALS:
void changeScrollValue(int value, int maximumValue);
void sendUpdateCommonView();
+
+ void sendCollectViewUpdate();
};
#endif // FULLLETTERWIDGET_H
diff --git a/src/UserInterface/Widget/full_searchresult_widget.cpp b/src/UserInterface/Widget/full_searchresult_widget.cpp
index efdee49..e42d151 100755
--- a/src/UserInterface/Widget/full_searchresult_widget.cpp
+++ b/src/UserInterface/Widget/full_searchresult_widget.cpp
@@ -47,7 +47,7 @@ void FullSearchResultWidget::initUi()
m_scrollArea->setStyleSheet("background:transparent");
m_scrollAreaWid = new ScrollAreaWid(this);
m_scrollAreaWid->setAttribute(Qt::WA_TranslucentBackground);
- m_scrollArea->setFixedSize(Style::m_applistWidWidth, Style::m_applistWidHeight);
+ m_scrollArea->setFixedSize(Style::m_applistAreaWidth, Style::m_applistWidHeight);
m_scrollArea->setWidget(m_scrollAreaWid);
m_scrollArea->setWidgetResizable(true);
m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@@ -139,6 +139,7 @@ void FullSearchResultWidget::initAppListWidget()
connect(m_listView, &FullListView::sendItemClickedSignal, this, &FullSearchResultWidget::execApplication);
connect(m_listView, &FullListView::sendHideMainWindowSignal, this, &FullSearchResultWidget::sendHideMainWindowSignal);
connect(m_listView, &FullListView::sendSetslidebar, this, &FullSearchResultWidget::onSetSlider);
+ connect(m_listView, &FullListView::sendCollectViewUpdate, this, &FullSearchResultWidget::sendCollectViewUpdate);
}
void FullSearchResultWidget::fillAppList()
@@ -228,7 +229,7 @@ void FullSearchResultWidget::selectFirstItemTab()
void FullSearchResultWidget::repaintWidget()
{
- m_scrollArea->setFixedSize(Style::m_applistWidWidth, Style::m_applistWidHeight);
+ m_scrollArea->setFixedSize(Style::m_applistAreaWidth, Style::m_applistWidHeight);
resizeScrollAreaControls();
m_scrollAreaWidHeight = m_scrollAreaWid->height() + 1;
initVerticalScrollBar();
diff --git a/src/UserInterface/Widget/full_searchresult_widget.h b/src/UserInterface/Widget/full_searchresult_widget.h
index 43c1955..e557b7d 100755
--- a/src/UserInterface/Widget/full_searchresult_widget.h
+++ b/src/UserInterface/Widget/full_searchresult_widget.h
@@ -114,6 +114,7 @@ Q_SIGNALS:
*/
void sendHideMainWindowSignal();
void setFocusToSideWin();
+ void sendCollectViewUpdate();
};
#endif // FULLSEARCHRESULTWIDGET_H
diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp
index dfd692f..3a3e2cd 100755
--- a/src/UserInterface/full_mainwindow.cpp
+++ b/src/UserInterface/full_mainwindow.cpp
@@ -216,11 +216,15 @@ void FullMainWindow::initConnect()
connect(this, &FullMainWindow::sendSetFocusToResult, m_fullResultPage, &FullSearchResultWidget::selectFirstItemTab);
// connect(m_fullSelectMenuButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectMenuButton_clicked);
connect(m_fullCommonPage, &FullCommonUseWidget::sendUpdateOtherView, this, &FullMainWindow::sendUpdateOtherView);
+ connect(m_fullCommonPage, &FullCommonUseWidget::sendCollectViewUpdate, this, &FullMainWindow::sendCollectViewUpdate);
connect(m_fullFunctionPage, &FullFunctionWidget::sendUpdateCommonView, m_fullCommonPage, &FullCommonUseWidget::updateListViewSlot);
+ connect(m_fullFunctionPage, &FullFunctionWidget::sendCollectViewUpdate, this, &FullMainWindow::sendCollectViewUpdate);
connect(m_fullLetterPage, &FullLetterWidget::sendUpdateCommonView, m_fullCommonPage, &FullCommonUseWidget::updateListViewSlot);
+ connect(m_fullLetterPage, &FullLetterWidget::sendCollectViewUpdate, this, &FullMainWindow::sendCollectViewUpdate);
connect(m_fullCommonPage, &FullCommonUseWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
connect(m_fullFunctionPage, &FullFunctionWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
connect(m_fullLetterPage, &FullLetterWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
+ connect(m_fullResultPage, &FullSearchResultWidget::sendCollectViewUpdate, this, &FullMainWindow::sendCollectViewUpdate);
connect(m_fullResultPage, &FullSearchResultWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
connect(m_dropDownMenu, &MenuBox::triggered, this, &FullMainWindow::on_fullSelectMenuButton_triggered);
connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() {
@@ -511,10 +515,15 @@ void FullMainWindow::searchAppSlot(QString arg)
void FullMainWindow::mousePressEvent(QMouseEvent *event)
{
resetEditline();
+ return QMainWindow::mousePressEvent(event);
+}
+
+void FullMainWindow::mouseReleaseEvent(QMouseEvent *event)
+{
if (event->button() == Qt::LeftButton) {
this->hide();
}
- return QMainWindow::mousePressEvent(event);
+ return QMainWindow::mouseReleaseEvent(event);
}
void FullMainWindow::recvSearchResult(QVector<QStringList> arg)
diff --git a/src/UserInterface/full_mainwindow.h b/src/UserInterface/full_mainwindow.h
index 9592169..1f7bc24 100755
--- a/src/UserInterface/full_mainwindow.h
+++ b/src/UserInterface/full_mainwindow.h
@@ -35,6 +35,7 @@ Q_SIGNALS:
void sendSetFocusToLet();
void sendSetFocusToResult();
void sendUpdateOtherView();
+ void sendCollectViewUpdate();
private Q_SLOTS:
@@ -53,6 +54,7 @@ protected:
bool event(QEvent *event);
bool eventFilter(QObject *watched, QEvent *event);
void mousePressEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
void changeStyle();
void initConnect();
void initTabOrder();
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index 8427b34..c45be17 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -216,6 +216,7 @@ void MainWindow::initSignalConnect()
connect(m_searchAppThread, &SearchAppThread::sendSearchResult, this, &MainWindow::recvSearchResult);
connect(m_fullWindow, &FullMainWindow::showNormalWindow, this, &MainWindow::showNormalWindowSlot);
connect(m_fullWindow, &FullMainWindow::sendUpdateOtherView, this, &MainWindow::updateMinAllView);
+ connect(m_fullWindow, &FullMainWindow::sendCollectViewUpdate, this, &MainWindow::updateCollectView);
connect(m_minSelectButton, &QToolButton::clicked, this, &MainWindow::on_minSelectButton_clicked);
connect(m_dropDownMenu, &MenuBox::triggered, this, &MainWindow::on_selectMenuButton_triggered);
connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() {
diff --git a/src/UtilityFunction/Style/style.cpp b/src/UtilityFunction/Style/style.cpp
index 53378bd..70198af 100755
--- a/src/UtilityFunction/Style/style.cpp
+++ b/src/UtilityFunction/Style/style.cpp
@@ -56,6 +56,7 @@ int Style::LeftSpaceIconText = 0;
int Style::LeftSpaceBetweenItem = 0;
//应用列表栏
int Style::m_applistWidWidth = 0;
+int Style::m_applistAreaWidth = 0;
int Style::m_applistWidHeight = 0;
int Style::AppListIconSize = 0;
int Style::AppListBigIconSize = 0;
@@ -217,10 +218,11 @@ void Style::initWidStyle()
rightViewHeight = 470;
LeftSpaceIconText = 14;
m_applistWidWidth = m_availableScreenWidth / 1.25;
- m_applistWidWidth = m_applistWidWidth - (m_applistWidWidth % m_applistGridSizeWidth) + 1;
+ m_applistWidWidth = m_applistWidWidth - (m_applistWidWidth % m_applistGridSizeWidth) + 2;
m_applistWidHeight = m_availableScreenHeight - 120;
- m_applistWidHeight = m_applistWidHeight - (m_applistWidHeight % m_applistGridSizeWidth) + 1;
+ m_applistWidHeight = m_applistWidHeight - (m_applistWidHeight % m_applistGridSizeWidth);
m_leftWidWidth = (m_availableScreenWidth - m_applistWidWidth) / 2 + 1;
+ m_applistAreaWidth = m_applistWidWidth + 20;
} else {
ScreenWidth = QApplication::primaryScreen()->geometry().width();
ScreenHeight = QApplication::primaryScreen()->geometry().height();
diff --git a/src/UtilityFunction/Style/style.h b/src/UtilityFunction/Style/style.h
index a74e0da..547a072 100755
--- a/src/UtilityFunction/Style/style.h
+++ b/src/UtilityFunction/Style/style.h
@@ -111,6 +111,7 @@ public:
static int LeftSpaceBetweenItem; //item间距
//应用列表栏
static int m_applistWidWidth; //宽度
+ static int m_applistAreaWidth;
static int m_applistWidHeight; //高度
static int AppListIconSize; //图标大小
static int AppListBigIconSize;

View File

@ -1,303 +0,0 @@
From: zhaikangning <857458455@qq.com>
Date: Fri, 2 Sep 2022 08:20:29 +0000
Subject: =?utf-8?b?ITE2IOino+WGs3dheWxhbmTkuIvlupTnlKjmiZPlvIDov4fnqIvkuK0=?=
=?utf-8?b?6Zi75aGe5byA5aeL6I+c5Y2V6Zeu6aKYIE1lcmdlIHB1bGwgcmVxdWVzdCAhMTYg?=
=?utf-8?b?ZnJvbSBsaXh1ZW1hbi9vcGVua3lsaW4veWFuZ3R6ZQ==?=
---
src/UserInterface/ListView/klistview.cpp | 4 ++--
src/UserInterface/ListView/listview.cpp | 3 ++-
src/UserInterface/ListView/rightlistview.cpp | 5 +++--
src/UserInterface/Widget/full_commonuse_widget.cpp | 10 ----------
src/UserInterface/Widget/full_commonuse_widget.h | 5 -----
src/UserInterface/Widget/full_function_widget.cpp | 10 ----------
src/UserInterface/Widget/full_function_widget.h | 5 -----
src/UserInterface/Widget/full_letter_widget.cpp | 10 ----------
src/UserInterface/Widget/full_letter_widget.h | 5 -----
src/UserInterface/Widget/full_searchresult_widget.cpp | 9 ---------
src/UserInterface/Widget/full_searchresult_widget.h | 5 -----
src/UtilityFunction/utility.cpp | 17 ++++++++++-------
12 files changed, 17 insertions(+), 71 deletions(-)
diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp
index fcf4480..1588014 100755
--- a/src/UserInterface/ListView/klistview.cpp
+++ b/src/UserInterface/ListView/klistview.cpp
@@ -2,6 +2,7 @@
#include "klistview.h"
#include "utility.h"
#include <QScrollBar>
+#include <QtConcurrent/QtConcurrent>
#include "rightclickmenu.h"
KListView::KListView(QWidget *parent):
@@ -42,11 +43,10 @@ void KListView::updateData(QStringList data)
void KListView::onClicked(QModelIndex index)
{
QVariant var = listmodel->data(index, Qt::DisplayRole);
-
if (var.isValid()) {
QString desktopfp = var.value<QString>();
Q_EMIT sendHideMainWindowSignal();
- execApp(desktopfp);
+ QtConcurrent::run(execApp, QString(desktopfp));
}
}
diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp
index 368f25a..ea511c2 100755
--- a/src/UserInterface/ListView/listview.cpp
+++ b/src/UserInterface/ListView/listview.cpp
@@ -21,6 +21,7 @@
#include "utility.h"
#include <QDebug>
#include <QDesktopServices>
+#include <QtConcurrent/QtConcurrent>
ListView::ListView(QWidget *parent/*, int width, int height, int module*/):
KListView(parent)
@@ -108,7 +109,7 @@ void ListView::onClicked(QModelIndex index)
Q_EMIT sendAppClassificationBtnClicked();
} else {
Q_EMIT sendHideMainWindowSignal();
- execApp(desktopfp);
+ QtConcurrent::run(execApp, QString(desktopfp));
}
}
}
diff --git a/src/UserInterface/ListView/rightlistview.cpp b/src/UserInterface/ListView/rightlistview.cpp
index 7725222..5a456bb 100755
--- a/src/UserInterface/ListView/rightlistview.cpp
+++ b/src/UserInterface/ListView/rightlistview.cpp
@@ -22,6 +22,7 @@
#include <syslog.h>
#include <QPushButton>
#include <QGSettings>
+#include <QtConcurrent/QtConcurrent>
RightListView::RightListView(QWidget *parent):
KListView(parent)
@@ -128,12 +129,12 @@ void RightListView::keyPressEvent(QKeyEvent *e)
void RightListView::onClicked(QModelIndex index)
{
- Q_EMIT sendHideMainWindowSignal();
QVariant var = listmodel->data(index, Qt::DisplayRole);
QString desktopfp = var.value<QStringList>().at(0);
if (var.isValid()) {
QString desktopfp = var.value<QString>();
- execApp(desktopfp);
+ Q_EMIT sendHideMainWindowSignal();
+ QtConcurrent::run(execApp, QString(desktopfp));
}
}
diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp
index 6f138f1..05d9d14 100755
--- a/src/UserInterface/Widget/full_commonuse_widget.cpp
+++ b/src/UserInterface/Widget/full_commonuse_widget.cpp
@@ -147,7 +147,6 @@ void FullCommonUseWidget::initAppListWidget()
m_listView->installEventFilter(this);
m_scrollAreaWidLayout->addWidget(m_listView);
m_listView->setFixedWidth(m_scrollAreaWid->width());
- connect(m_listView, &FullListView::sendItemClickedSignal, this, &FullCommonUseWidget::execApplication);
connect(m_listView, &FullListView::sendUpdateAppListSignal, this, &FullCommonUseWidget::updateListViewSlot);
connect(m_listView, &FullListView::sendCollectViewUpdate, this, &FullCommonUseWidget::sendCollectViewUpdate);
connect(m_listView, &FullListView::sendHideMainWindowSignal, this, &FullCommonUseWidget::sendHideMainWindowSignal);
@@ -185,15 +184,6 @@ void FullCommonUseWidget::fillAppList()
resizeScrollAreaControls();
}
-/**
- * 执行应用程序
- */
-void FullCommonUseWidget::execApplication(QString desktopfp)
-{
- Q_EMIT sendHideMainWindowSignal();
- execApp(desktopfp);
-}
-
void FullCommonUseWidget::selectFirstItem()
{
m_listView->setCurrentIndex(m_listView->model()->index(0, 0));
diff --git a/src/UserInterface/Widget/full_commonuse_widget.h b/src/UserInterface/Widget/full_commonuse_widget.h
index d13ad45..cfce3da 100755
--- a/src/UserInterface/Widget/full_commonuse_widget.h
+++ b/src/UserInterface/Widget/full_commonuse_widget.h
@@ -102,11 +102,6 @@ protected:
bool eventFilter(QObject *watched, QEvent *event);
public Q_SLOTS:
- /**
- * @brief Open the application
- * @param arg: Desktop file path
- */
- void execApplication(QString desktopfp);
/**
* @brief Update the application list slot function
*/
diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp
index b07133f..09cc615 100755
--- a/src/UserInterface/Widget/full_function_widget.cpp
+++ b/src/UserInterface/Widget/full_function_widget.cpp
@@ -208,21 +208,11 @@ void FullFunctionWidget::insertAppList(QStringList desktopfplist)
}
listview->addData(m_data);
- connect(listview, &FullListView::sendItemClickedSignal, this, &FullFunctionWidget::execApplication);
connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullFunctionWidget::sendHideMainWindowSignal);
connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullFunctionWidget::sendUpdateCommonView);
connect(listview, &FullListView::sendCollectViewUpdate, this, &FullFunctionWidget::sendCollectViewUpdate);
}
-/**
- * 执行应用程序
- */
-void FullFunctionWidget::execApplication(QString desktopfp)
-{
- Q_EMIT sendHideMainWindowSignal();
- execApp(desktopfp);
-}
-
void FullFunctionWidget::on_setAreaScrollBarValue(int value)
{
// m_scrollArea->verticalScrollBar()->setMaximum(maxmumValue);
diff --git a/src/UserInterface/Widget/full_function_widget.h b/src/UserInterface/Widget/full_function_widget.h
index 22e2a99..88493a0 100755
--- a/src/UserInterface/Widget/full_function_widget.h
+++ b/src/UserInterface/Widget/full_function_widget.h
@@ -142,11 +142,6 @@ protected:
bool eventFilter(QObject *watched, QEvent *event);
public Q_SLOTS:
- /**
- * @brief Open the application
- * @param arg: Desktop file path
- */
- void execApplication(QString desktopfp);
/**
* @brief Respond to button click
* @param btn: QButtonGroup button
diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp
index 64e7537..bd51f38 100755
--- a/src/UserInterface/Widget/full_letter_widget.cpp
+++ b/src/UserInterface/Widget/full_letter_widget.cpp
@@ -206,7 +206,6 @@ void FullLetterWidget::fillAppList()
}
listview->addData(m_data);
- connect(listview, &FullListView::sendItemClickedSignal, this, &FullLetterWidget::execApplication);
connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullLetterWidget::sendHideMainWindowSignal);
connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullLetterWidget::sendUpdateCommonView);
connect(listview, &FullListView::sendCollectViewUpdate, this, &FullLetterWidget::sendCollectViewUpdate);
@@ -216,15 +215,6 @@ void FullLetterWidget::fillAppList()
resizeScrollAreaControls();
}
-/**
- * 执行应用程序
- */
-void FullLetterWidget::execApplication(QString desktopfp)
-{
- Q_EMIT sendHideMainWindowSignal();
- execApp(desktopfp);
-}
-
void FullLetterWidget::on_setAreaScrollBarValue(int value)
{
// m_scrollArea->verticalScrollBar()->setMaximum(maxmumValue);
diff --git a/src/UserInterface/Widget/full_letter_widget.h b/src/UserInterface/Widget/full_letter_widget.h
index 9799ee4..72c25a0 100755
--- a/src/UserInterface/Widget/full_letter_widget.h
+++ b/src/UserInterface/Widget/full_letter_widget.h
@@ -147,11 +147,6 @@ public Q_SLOTS:
* @param btn: QButtonGroup button
*/
void btnGroupClickedSlot(QAbstractButton *btn);
- /**
- * @brief Open the application
- * @param arg: Desktop file path
- */
- void execApplication(QString desktopfp);
/**
* @brief Update application list slot function
*/
diff --git a/src/UserInterface/Widget/full_searchresult_widget.cpp b/src/UserInterface/Widget/full_searchresult_widget.cpp
index e42d151..a37fc83 100755
--- a/src/UserInterface/Widget/full_searchresult_widget.cpp
+++ b/src/UserInterface/Widget/full_searchresult_widget.cpp
@@ -136,7 +136,6 @@ void FullSearchResultWidget::initAppListWidget()
m_listView->installEventFilter(this);
m_scrollAreaWidLayout->addWidget(m_listView);
m_listView->setFixedWidth(m_scrollArea->width());
- connect(m_listView, &FullListView::sendItemClickedSignal, this, &FullSearchResultWidget::execApplication);
connect(m_listView, &FullListView::sendHideMainWindowSignal, this, &FullSearchResultWidget::sendHideMainWindowSignal);
connect(m_listView, &FullListView::sendSetslidebar, this, &FullSearchResultWidget::onSetSlider);
connect(m_listView, &FullListView::sendCollectViewUpdate, this, &FullSearchResultWidget::sendCollectViewUpdate);
@@ -148,14 +147,6 @@ void FullSearchResultWidget::fillAppList()
m_listView->addData(m_data);
resizeScrollAreaControls();
}
-/**
- * 执行应用程序
- */
-void FullSearchResultWidget::execApplication(QString desktopfp)
-{
- Q_EMIT sendHideMainWindowSignal();
- execApp(desktopfp);
-}
void FullSearchResultWidget::updateAppListView(QVector<QStringList> arg)
{
diff --git a/src/UserInterface/Widget/full_searchresult_widget.h b/src/UserInterface/Widget/full_searchresult_widget.h
index e557b7d..73a42df 100755
--- a/src/UserInterface/Widget/full_searchresult_widget.h
+++ b/src/UserInterface/Widget/full_searchresult_widget.h
@@ -90,11 +90,6 @@ protected:
bool eventFilter(QObject *watched, QEvent *event);
public Q_SLOTS:
- /**
- * @brief Open the application
- * @param arg: Desktop file path
- */
- void execApplication(QString desktopfp);
void selectFirstItemTab();
diff --git a/src/UtilityFunction/utility.cpp b/src/UtilityFunction/utility.cpp
index 40c6f08..1e320a3 100755
--- a/src/UtilityFunction/utility.cpp
+++ b/src/UtilityFunction/utility.cpp
@@ -28,6 +28,7 @@
#include <QApplication>
#include <QDBusInterface>
#include <QScreen>
+#include <QtConcurrent/QtConcurrent>
#include "ukuimenuinterface.h"
#define DATABASENAME QDir::homePath()+"/.config/ukui/"+"UkuiMenu.db"
@@ -710,14 +711,16 @@ bool deleteAppRecord(QString desktopfn)
void execApp(QString desktopfp)
{
+ QDBusReply<bool> result;
+ if (QDBusConnection::connectToBus(QDBusConnection::SessionBus, QString("com.kylin.AppManager")).isConnected()) {
+ QDBusInterface iface("com.kylin.AppManager", "/com/kylin/AppManager", "com.kylin.AppManager");
+ if (iface.isValid()) {
+ result = iface.call("LaunchApp", desktopfp);
+ myDebug() << "LaunchApp desktopFile:" << desktopfp;
+ }
+ }
- QDBusInterface iface("com.kylin.AppManager",
- "/com/kylin/AppManager",
- "com.kylin.AppManager",
- QDBusConnection::sessionBus());
- QDBusReply<bool> res = iface.call("LaunchApp", desktopfp);
-
- if (!res.isValid() || !res) {
+ if (!result.isValid() || !result) {
UkuiMenuInterface interface;

View File

@ -1,48 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Mon, 10 Oct 2022 03:15:52 +0000
Subject: =?utf-8?b?ITIxIOS/ruaUueaehOW7uuaWh+aho+WSjC5wcm/lt6XnqIvmlofku7Y=?=
=?utf-8?b?77yM6Kej5Yaz5ZyoIG9wZW5LeWxpbiAwLjcuNSDkuIrnvJbor5HlpLHotKXnmoQ=?=
=?utf-8?b?6Zeu6aKYIE1lcmdlIHB1bGwgcmVxdWVzdCAhMjEgZnJvbSDogIHomY7kvJrmuLg=?=
=?utf-8?b?5rOzL29wZW5reWxpbi95YW5ndHpl?=
---
README.md | 2 +-
ukui-menu.desktop | 0
ukui-menu.pro | 4 ++--
3 files changed, 3 insertions(+), 3 deletions(-)
mode change 100755 => 100644 ukui-menu.desktop
diff --git a/README.md b/README.md
index ff12dc9..f6ddfbd 100755
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@ bugfixes for this package.
## Preparation
You can build pre-depends with such command:
-`sudo apt install libglib2.0-dev qtbase5-dev libqt5svg5-dev libqt5x11extras5-dev libgsettings-qt-dev libbamf3-dev libxrandr-dev libxtst-dev libx11-dev`
+`sudo apt install g++ qtbase5-dev qttools5-dev-tools libglib2.0-dev libqt5svg5-dev libqt5x11extras5-dev libgsettings-qt-dev libbamf3-dev libxrandr-dev libxtst-dev libx11-dev libkf5windowsystem-dev libuchardet-dev libpeony-dev libkysdk-waylandhelper-dev libukui-common-dev`
Note: build-depends references the paragraph in debian/control.
diff --git a/ukui-menu.desktop b/ukui-menu.desktop
old mode 100755
new mode 100644
diff --git a/ukui-menu.pro b/ukui-menu.pro
index 1ca9797..e7e5283 100755
--- a/ukui-menu.pro
+++ b/ukui-menu.pro
@@ -48,11 +48,11 @@ INSTALLS += qm_files
# So we can access it from main.cpp
DEFINES += QM_FILES_INSTALL_PATH='\\"$${QM_FILES_INSTALL_PATH}\\"'
-PKGCONFIG+=glib-2.0 gio-unix-2.0 gsettings-qt libbamf3 x11 xtst kysdk-waylandhelper
+PKGCONFIG+=glib-2.0 gio-unix-2.0 gsettings-qt libbamf3 x11 kysdk-waylandhelper
CONFIG += no_keywords link_pkgconfig
-LIBS+=-pthread -luchardet -lukui-log4qt -lukui-com4c -lukui-com4cxx -lpeony
+LIBS+=-pthread -luchardet -lukui-log4qt -lukui-com4c -lukui-com4cxx -lpeony -lXtst
desktop_file.files = ukui-menu.desktop
desktop_file.path = /etc/xdg/autostart

File diff suppressed because it is too large Load Diff

View File

@ -1,189 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Thu, 20 Oct 2022 01:21:06 +0000
Subject: =?utf-8?b?ITIyIOm7mOiupOeql+WPo+WinuWKoOmYtOW9sSBNZXJnZSBwdWxsIHJl?=
=?utf-8?b?cXVlc3QgITIyIGZyb20gbGl4dWVtYW4vb3Blbmt5bGluL3lhbmd0emU=?=
---
src/UserInterface/ListView/listview.cpp | 26 +++++++++++++++++++---
src/UserInterface/ListView/listview.h | 3 ++-
src/UserInterface/Widget/main_view_widget.cpp | 15 ++-----------
src/UserInterface/mainwindow.cpp | 32 ++++++++++++++-------------
4 files changed, 44 insertions(+), 32 deletions(-)
diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp
index f781921..89be87b 100755
--- a/src/UserInterface/ListView/listview.cpp
+++ b/src/UserInterface/ListView/listview.cpp
@@ -29,6 +29,7 @@ ListView::ListView(QWidget *parent/*, int width, int height, int module*/):
this->h = 540;
this->module = 1;
initWidget();
+ setAttribute(Qt::WA_AcceptTouchEvents);
m_listmodel = new QStandardItemModel(this);
this->setModel(m_listmodel);
m_ukuiMenuInterface = new UkuiMenuInterface;
@@ -95,6 +96,21 @@ void ListView::updateData(QVector<QStringList> data)
}
}
+bool ListView::event(QEvent *e)
+{
+ switch (e->type()) {
+ case QEvent::TouchBegin:
+ m_scrollbarState = false;
+ break;
+ case QEvent::ChildRemoved:
+ m_scrollbarState = true;
+ break;
+ default:
+ break;
+ }
+ return QListView::event(e);
+}
+
void ListView::onClicked(QModelIndex index)
{
QVariant var = m_listmodel->data(index, Qt::DisplayRole);
@@ -119,14 +135,18 @@ void ListView::onClicked(QModelIndex index)
void ListView::enterEvent(QEvent *e)
{
Q_UNUSED(e);
- this->selectionModel()->clear();
- this->verticalScrollBar()->setVisible(true);
+ if (m_scrollbarState) {
+ this->selectionModel()->clear();
+ verticalScrollBar()->setVisible(true);
+ }
}
void ListView::leaveEvent(QEvent *e)
{
Q_UNUSED(e);
- this->verticalScrollBar()->setVisible(false);
+ if (m_scrollbarState) {
+ verticalScrollBar()->setVisible(false);
+ }
}
void ListView::paintEvent(QPaintEvent *e)
diff --git a/src/UserInterface/ListView/listview.h b/src/UserInterface/ListView/listview.h
index ff39d9b..f9125e8 100755
--- a/src/UserInterface/ListView/listview.h
+++ b/src/UserInterface/ListView/listview.h
@@ -49,11 +49,12 @@ protected:
void leaveEvent(QEvent *e) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent *e) override;
void keyPressEvent(QKeyEvent *e);
-
+ bool event(QEvent *e);
private:
int w = 0;
int h = 0;
int m_preRowCount;
+ bool m_scrollbarState = true;
private Q_SLOTS:
diff --git a/src/UserInterface/Widget/main_view_widget.cpp b/src/UserInterface/Widget/main_view_widget.cpp
index c459745..c53fc53 100755
--- a/src/UserInterface/Widget/main_view_widget.cpp
+++ b/src/UserInterface/Widget/main_view_widget.cpp
@@ -54,23 +54,12 @@ void MainViewWidget::styleChangeSlot(const QString &style)
void MainViewWidget::paintEvent(QPaintEvent *event)
{
-// double transparency = getTransparency();
- QRect rect = this->rect();
+ QRect rect = this->rect().adjusted(5, 5, 0, -5);
QPainterPath path;
QPainter painter(this);
+ path.addRoundedRect(rect, 10, 10);
painter.setRenderHint(QPainter::Antialiasing); // 反锯齿;
painter.setPen(Qt::transparent);
- qreal radius = 10;
- path.moveTo(rect.topRight() - QPointF(radius, 0));
- path.lineTo(rect.topLeft() + QPointF(radius, 0));
- path.quadTo(rect.topLeft(), rect.topLeft() + QPointF(0, radius));
- path.lineTo(rect.bottomLeft() + QPointF(0, -radius));
- path.quadTo(rect.bottomLeft(), rect.bottomLeft() + QPointF(radius, 0));
- path.lineTo(rect.bottomRight() - QPointF(radius, 0));
- path.quadTo(rect.bottomRight(), rect.bottomRight() + QPointF(0, -radius));
- path.lineTo(rect.topRight() + QPointF(0, radius));
- path.quadTo(rect.topRight(), rect.topRight() + QPointF(-radius, -0));
- painter.setPen(Qt::transparent);
painter.setOpacity(0.58);
painter.fillPath(path, m_backColor);
QWidget::paintEvent(event);
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index 53451fd..0c07b15 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -674,27 +674,29 @@ void MainWindow::paintEvent(QPaintEvent *event)
if ( transparency == 1) {
curColor.setAlpha(255);
}
- QRect rect = this->rect();
+ QRect rect = this->rect().adjusted(5, 5, -5, -5);
QPainterPath path;
- // rect.setTopLeft(QPoint(rect.x()+320,rect.y()));
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing); // 反锯齿;
+ painter.save();
painter.setPen(Qt::transparent);
- qreal radius = 10;
- path.moveTo(rect.topRight() - QPointF(radius, 0));
- path.lineTo(rect.topLeft() + QPointF(radius, 0));
- path.quadTo(rect.topLeft(), rect.topLeft() + QPointF(0, radius));
- path.lineTo(rect.bottomLeft() + QPointF(0, -radius));
- path.quadTo(rect.bottomLeft(), rect.bottomLeft() + QPointF(radius, 0));
- path.lineTo(rect.bottomRight() - QPointF(radius, 0));
- path.quadTo(rect.bottomRight(), rect.bottomRight() + QPointF(0, -radius));
- path.lineTo(rect.topRight() + QPointF(0, radius));
- path.quadTo(rect.topRight(), rect.topRight() + QPointF(-radius, -0));
+ path.addRoundedRect(rect, 10, 10);
painter.setBrush(curColor);
painter.setPen(Qt::transparent);
painter.setOpacity(transparency);
painter.drawPath(path);
+ painter.restore();
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
+ QColor color = Qt::black;
+ painter.save();
+ for (int i = 0; i < 7; i++) {
+ rect = this->rect().adjusted(i, i, - i, - i);
+ color.setAlpha(i * 6);
+ painter.setBrush(Qt::NoBrush);
+ painter.setPen(QPen(color, 1));
+ painter.drawRoundedRect(rect, 10, 10);
+ }
+ painter.restore();
QMainWindow::paintEvent(event);
}
/**
@@ -1276,7 +1278,7 @@ void MainWindow::on_minMaxChangeButton_clicked()
m_maxAnimation->setDuration(1);
} else {
m_animationPage->show();
- m_animationPage->setGeometry(this->x(), this->y(), Style::m_minw, Style::m_minh);
+ m_animationPage->setGeometry(this->x() + 5, this->y() + 5, Style::m_minw - 10, Style::m_minh - 10);
m_animationPage->raise();
m_animationPage->repaint();
m_maxAnimation->setDuration(260);
@@ -1287,7 +1289,7 @@ void MainWindow::on_minMaxChangeButton_clicked()
loop.exec();
m_maxAnimation->setEasingCurve(QEasingCurve::OutExpo);
// m_maxAnimation->setStartValue(QRect(Style::m_primaryScreenX, Style::m_primaryScreenY + Style::m_availableScreenHeight - Style::minh, Style::minw, Style::minh));
- m_maxAnimation->setStartValue(QRect(this->x(), this->y(), Style::m_minw, Style::m_minh));
+ m_maxAnimation->setStartValue(QRect(this->x() + 5, this->y() + 5, Style::m_minw - 10, Style::m_minh - 10));
m_maxAnimation->setEndValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
m_maxAnimation->start(QAbstractAnimation::DeleteWhenStopped);
@@ -1410,7 +1412,7 @@ void MainWindow::showNormalWindowSlot()
m_isFullScreen = false;
m_minAnimation->setEasingCurve(QEasingCurve::OutExpo);
m_minAnimation->setStartValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
- m_minAnimation->setEndValue(QRect(this->x(), this->y(), Style::m_minw, Style::m_minh));
+ m_minAnimation->setEndValue(QRect(this->x() + 5, this->y() + 5, Style::m_minw - 10, Style::m_minh - 10));
m_minAnimation->start(QAbstractAnimation::DeleteWhenStopped);
m_fullWindow->hide();

View File

@ -1,121 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Mon, 24 Oct 2022 09:31:59 +0000
Subject: =?utf-8?b?ITI1IOWQjOatpXVwc3RyZWFt5Luj56CB77yM5L+u5pS55YWo5bGP5byA?=
=?utf-8?b?5aeL6I+c5Y2V5L2N572u6Zeu6aKYIE1lcmdlIHB1bGwgcmVxdWVzdCAhMjUgZnJv?=
=?utf-8?b?bSBsaXh1ZW1hbi9vcGVua3lsaW4veWFuZ3R6ZQ==?=
---
src/BackProcess/Interface/ukuimenuinterface.cpp | 2 +-
src/UserInterface/Widget/full_commonuse_widget.cpp | 4 +++-
src/UserInterface/mainwindow.cpp | 8 +++++++-
src/UtilityFunction/utility.cpp | 23 +++++++++++-----------
4 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/src/BackProcess/Interface/ukuimenuinterface.cpp b/src/BackProcess/Interface/ukuimenuinterface.cpp
index 7879cc0..d7438fb 100755
--- a/src/BackProcess/Interface/ukuimenuinterface.cpp
+++ b/src/BackProcess/Interface/ukuimenuinterface.cpp
@@ -375,7 +375,7 @@ QStringList UkuiMenuInterface::getDesktopFilePath()
m_filePathList.removeAll("/usr/share/applications/kylin-io-monitor.desktop");
m_filePathList.removeAll("/usr/share/applications/wps-office-uninstall.desktop");
m_filePathList.removeAll("/usr/share/applications/wps-office-misc.desktop");
- m_filePathList.removeAll("/usr/share/applications/kylin-installer.desktop");
+// m_filePathList.removeAll("/usr/share/applications/kylin-installer.desktop");
QStringList desktopList;
for (int i = 0; i < m_filePathList.count(); ++i) {
diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp
index 6adab1a..adbce44 100755
--- a/src/UserInterface/Widget/full_commonuse_widget.cpp
+++ b/src/UserInterface/Widget/full_commonuse_widget.cpp
@@ -170,7 +170,7 @@ void FullCommonUseWidget::resizeScrollAreaControls()
rowcount = listview->model()->rowCount() / dividend;
}
- listview->setFixedSize(m_listView->width(), listview->gridSize().height() * rowcount);
+ listview->setFixedSize(Style::m_applistAreaWidth, listview->gridSize().height() * rowcount);
m_scrollArea->widget()->setFixedSize(listview->size());
}
@@ -275,11 +275,13 @@ void FullCommonUseWidget::updateListView()
void FullCommonUseWidget::repaintWidget()
{
m_scrollArea->setFixedSize(Style::m_applistAreaWidth, Style::m_applistWidHeight);
+ m_scrollArea->setWidgetResizable(true);
m_scrollAreaWidLayout->removeWidget(m_listView);
m_listView->setParent(nullptr);
delete m_listView;
initAppListWidget();
fillAppList();
+ m_scrollAreaWid->adjustSize();
m_scrollAreaWidHeight = m_scrollAreaWid->height();
initVerticalScrollBar();
on_setAreaScrollBarValue(0);
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index 0c07b15..42a5e78 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -1382,8 +1382,14 @@ void MainWindow::repaintWidget()
int y = Style::m_primaryScreenY;
int width = Style::m_availableScreenWidth;
int height = Style::m_availableScreenHeight;
+
setMinWindowPos();
- m_fullWindow->move(x, y);
+
+ if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
+ kdk::WindowManager::setGeometry(m_fullWindow->windowHandle(), QRect(x, y, width, height));
+ } else {
+ m_fullWindow->move(x, y);
+ }
m_fullWindow->setFixedSize(width, height);
m_fullWindow->repaintWidget();
}
diff --git a/src/UtilityFunction/utility.cpp b/src/UtilityFunction/utility.cpp
index c7b63e7..1873136 100755
--- a/src/UtilityFunction/utility.cpp
+++ b/src/UtilityFunction/utility.cpp
@@ -138,23 +138,24 @@ QVariantList getScreenGeometryList()
QRect rect;
rect = qApp->primaryScreen()->geometry();
int panelSize = 0;
- int position = 0;
+ int panelPosition = 0;
QVariantList list;
list.clear();
- QDBusInterface iface(DBUS_NAME,
- DBUS_PATH,
- DBUS_INTERFACE,
- QDBusConnection::sessionBus());
- QDBusReply<QVariantList> reply = iface.call("GetPrimaryScreenPhysicalGeometry");
- if (reply.isValid()) {
- panelSize = reply.value().at(4).toInt();
- position = reply.value().at(5).toInt();
+ if (QGSettings::isSchemaInstalled(QString("org.ukui.panel.settings").toLocal8Bit())) {
+ QGSettings gsetting(QString("org.ukui.panel.settings").toLocal8Bit());
+ if (gsetting.keys().contains("panelposition")) {
+ panelPosition = gsetting.get("panelposition").toInt();
+ }
+
+ if (gsetting.keys().contains("panelsize")) {
+ panelSize = gsetting.get("panelsize").toInt();
+ }
}
QList<int> posIndex;
- switch (position) {
+ switch (panelPosition) {
case BOTTOM:
posIndex = {0, 0, 0, -1};
break;
@@ -173,7 +174,7 @@ QVariantList getScreenGeometryList()
list.append(rect.width() + posIndex[2] * panelSize);
list.append(rect.height() + posIndex[3] * panelSize);
list.append(panelSize);
- list.append(position);
+ list.append(panelPosition);
return list;
}

View File

@ -1,22 +0,0 @@
From: =?utf-8?b?5byg5aSp5rO9?=
<11297911+zhang_tian_ze@user.noreply.gitee.com>
Date: Wed, 2 Nov 2022 12:51:54 +0000
Subject: =?utf-8?b?ITI3IOi/mOaYr+S/ruaUueWbvuagh+aooeeziumXrumimA==?=
---
src/UtilityFunction/utility.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/UtilityFunction/utility.cpp b/src/UtilityFunction/utility.cpp
index 1873136..8af6b3f 100755
--- a/src/UtilityFunction/utility.cpp
+++ b/src/UtilityFunction/utility.cpp
@@ -109,7 +109,7 @@ QIcon getCurIcon(const QString &iconPath, bool autoSet)
if (iconPath.endsWith("png")) {
pixmap = QPixmap(iconPath);
} else {
- pixmap = loadSvg(iconPath, 16);
+ pixmap = loadSvg(iconPath, 26);
}
if (!autoSet) {

View File

@ -1,95 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Fri, 4 Nov 2022 16:49:06 +0800
Subject: update changelog
---
src/UserInterface/ViewItem/itemdelegate.cpp | 4 ++--
src/UserInterface/Widget/full_commonuse_widget.cpp | 1 +
src/UserInterface/Widget/full_function_widget.cpp | 1 +
src/UserInterface/Widget/full_letter_widget.cpp | 1 +
src/UserInterface/Widget/full_searchresult_widget.cpp | 1 +
src/UserInterface/mainwindow.cpp | 1 +
6 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/UserInterface/ViewItem/itemdelegate.cpp b/src/UserInterface/ViewItem/itemdelegate.cpp
index ba41cc7..1615b37 100755
--- a/src/UserInterface/ViewItem/itemdelegate.cpp
+++ b/src/UserInterface/ViewItem/itemdelegate.cpp
@@ -242,7 +242,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
painter->restore();
if ((option.state & QStyle::State_MouseOver) || (option.state & QStyle::State_HasFocus)) {
- QToolTip::showText(QCursor::pos(), "为了刷新");
+ QToolTip::hideText();
int len = fm.boundingRect(appname).width();
//富文本,tooltip可自动换行
QString tipString = QString("<font>");
@@ -252,7 +252,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
tipString += tr("path:") + url;
}
tipString += QString("</font>");
- QToolTip::showText(option.widget->mapToGlobal(QPoint(rect.right() + 20, rect.center().y())), tipString);
+ QToolTip::showText(option.widget->mapToGlobal(QPoint(rect.right(), rect.center().y())), tipString);
}
} else {
QRect iconRect = QRect(rect.left() + 11, rect.y() + (rect.height() - 32) / 2, 32, 32);
diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp
index adbce44..61c8da2 100755
--- a/src/UserInterface/Widget/full_commonuse_widget.cpp
+++ b/src/UserInterface/Widget/full_commonuse_widget.cpp
@@ -133,6 +133,7 @@ void FullCommonUseWidget::initVerticalScrollBar()
void FullCommonUseWidget::on_powerOffButton_clicked()
{
QProcess::startDetached(QString("ukui-session-tools"));
+ Q_EMIT sendHideMainWindowSignal();
}
void FullCommonUseWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos)
diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp
index 6e95e13..d1a9f69 100755
--- a/src/UserInterface/Widget/full_function_widget.cpp
+++ b/src/UserInterface/Widget/full_function_widget.cpp
@@ -153,6 +153,7 @@ void FullFunctionWidget::initVerticalScrollBar()
void FullFunctionWidget::on_powerOffButton_clicked()
{
QProcess::startDetached(QString("ukui-session-tools"));
+ Q_EMIT sendHideMainWindowSignal();
}
void FullFunctionWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos)
diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp
index 6bf48bb..7ffc770 100755
--- a/src/UserInterface/Widget/full_letter_widget.cpp
+++ b/src/UserInterface/Widget/full_letter_widget.cpp
@@ -148,6 +148,7 @@ void FullLetterWidget::initVerticalScrollBar()
void FullLetterWidget::on_powerOffButton_clicked()
{
QProcess::startDetached(QString("ukui-session-tools"));
+ Q_EMIT sendHideMainWindowSignal();
}
void FullLetterWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos)
diff --git a/src/UserInterface/Widget/full_searchresult_widget.cpp b/src/UserInterface/Widget/full_searchresult_widget.cpp
index 344add3..5b54614 100755
--- a/src/UserInterface/Widget/full_searchresult_widget.cpp
+++ b/src/UserInterface/Widget/full_searchresult_widget.cpp
@@ -122,6 +122,7 @@ void FullSearchResultWidget::initVerticalScrollBar()
void FullSearchResultWidget::on_powerOffButton_clicked()
{
QProcess::startDetached(QString("ukui-session-tools"));
+ Q_EMIT sendHideMainWindowSignal();
}
void FullSearchResultWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos)
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index 42a5e78..feb225a 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -1426,6 +1426,7 @@ void MainWindow::showNormalWindowSlot()
void MainWindow::on_powerOffButton_clicked()
{
QProcess::startDetached(QString("ukui-session-tools"));
+ hideWindow();
}
void MainWindow::on_powerOffButton_customContextMenuRequested(const QPoint &pos)
{

View File

@ -1,150 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Thu, 24 Nov 2022 01:44:13 +0000
Subject: =?utf-8?b?ITMyIOS/ruWkjeWFqOWxj+S9jee9rumXrumimO+8jOWinuWKoOaLlg==?=
=?utf-8?b?5ou95Zu65a6a5Yiw5Lu75Yqh5qCP5Yqf6IO9IE1lcmdlIHB1bGwgcmVxdWVzdCAh?=
=?utf-8?b?MzIgZnJvbSBsaXh1ZW1hbi9vcGVua3lsaW4veWFuZ3R6ZQ==?=
---
src/UserInterface/ListView/klistview.cpp | 5 +++--
src/UserInterface/ListView/klistview.h | 1 +
src/UserInterface/ListView/listview.cpp | 31 +++++++++++++++++++++++++++++++
src/UserInterface/ListView/listview.h | 3 ++-
src/UserInterface/mainwindow.cpp | 4 ++--
5 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp
index 91fbe08..28c83c2 100755
--- a/src/UserInterface/ListView/klistview.cpp
+++ b/src/UserInterface/ListView/klistview.cpp
@@ -92,8 +92,9 @@ void KListView::mouseMoveEvent(QMouseEvent *e)
void KListView::mousePressEvent(QMouseEvent *event)
{
- if ((this->indexAt(event->pos()).isValid()) && event->button() == Qt::LeftButton) {
- m_pressApp = m_listmodel->data(this->indexAt(event->pos()), Qt::DisplayRole);
+ m_pressPos = event->pos();
+ if ((this->indexAt(m_pressPos).isValid()) && event->button() == Qt::LeftButton) {
+ m_pressApp = m_listmodel->data(this->indexAt(m_pressPos), Qt::DisplayRole);
}
return QListView::mousePressEvent(event);
}
diff --git a/src/UserInterface/ListView/klistview.h b/src/UserInterface/ListView/klistview.h
index 503997b..2ac6f3d 100755
--- a/src/UserInterface/ListView/klistview.h
+++ b/src/UserInterface/ListView/klistview.h
@@ -36,6 +36,7 @@ public:
int module = 0;
double m_transparency;
QVariant m_pressApp;
+ QPoint m_pressPos;
UkuiMenuInterface *m_ukuiMenuInterface = nullptr;
protected:
void paintEvent(QPaintEvent *e);
diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp
index 89be87b..a9a9ed2 100755
--- a/src/UserInterface/ListView/listview.cpp
+++ b/src/UserInterface/ListView/listview.cpp
@@ -18,9 +18,11 @@
#include "listview.h"
#include "function_button_widget.h"
#include "utility.h"
+#include "thumbnail.h"
#include <QDebug>
#include <QDesktopServices>
#include <QtConcurrent/QtConcurrent>
+#include <QDrag>
ListView::ListView(QWidget *parent/*, int width, int height, int module*/):
KListView(parent)
@@ -29,6 +31,7 @@ ListView::ListView(QWidget *parent/*, int width, int height, int module*/):
this->h = 540;
this->module = 1;
initWidget();
+ setDragEnabled(true);
setAttribute(Qt::WA_AcceptTouchEvents);
m_listmodel = new QStandardItemModel(this);
this->setModel(m_listmodel);
@@ -70,6 +73,34 @@ void ListView::initWidget()
connect(this, &ListView::clicked, this, &ListView::onClicked);
}
+void ListView::mouseMoveEvent(QMouseEvent *e)
+{
+ if (e->buttons() & Qt::LeftButton) {
+ if ((e->pos() - m_pressPos).manhattanLength() >= QApplication::startDragDistance()) {
+ myDebug() << "进入拖拽事件";
+ QString desktopfp = m_pressApp.value<QStringList>().at(0);
+ QMimeData *mimeData = new QMimeData;
+ ThumbNail *dragImage = new ThumbNail;
+ QDrag *drag = new QDrag(this);
+ QList<QUrl> desktopUrlList;
+ desktopUrlList.append(QUrl(desktopfp));
+ myDebug() << desktopUrlList;
+ mimeData->setUrls(desktopUrlList);
+ //设置拖拽时的缩略图
+ dragImage->setupthumbnail(desktopfp);
+ QPixmap pixmap = dragImage->grab();
+ pixmap = pixmap.scaled(QSize(32, 32), Qt::KeepAspectRatio);
+ myDebug() << mimeData;
+ drag->setMimeData(mimeData);
+ drag->setPixmap(pixmap);
+ drag->setHotSpot(QPoint(pixmap.width(), pixmap.height()));
+ drag->exec(Qt::MoveAction);
+ delete dragImage;
+ dragImage = nullptr;
+ }
+ }
+}
+
void ListView::addData(QVector<QStringList> data, int module)
{
this->module = module;
diff --git a/src/UserInterface/ListView/listview.h b/src/UserInterface/ListView/listview.h
index f9125e8..cfcfbf8 100755
--- a/src/UserInterface/ListView/listview.h
+++ b/src/UserInterface/ListView/listview.h
@@ -50,13 +50,14 @@ protected:
void paintEvent(QPaintEvent *e) override;
void keyPressEvent(QKeyEvent *e);
bool event(QEvent *e);
+ void mouseMoveEvent(QMouseEvent *e);
+
private:
int w = 0;
int h = 0;
int m_preRowCount;
bool m_scrollbarState = true;
-
private Q_SLOTS:
void onClicked(QModelIndex index);//点击item
// void rightClickedSlot(const QPoint &pos);//右键菜单
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index feb225a..18f538b 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -770,7 +770,6 @@ void MainWindow::minAnimationFinished()
m_viewWidget->setFocus();
// m_collectPushButton->clicked(true);
on_collectPushButton_clicked();
-
QTimer::singleShot(200, [ = ]() {
m_animationPage->hide();
});
@@ -791,6 +790,7 @@ void MainWindow::maxAnimationFinished()
setMaxWindowPos();
m_fullWindow->activateWindow();
+
QTimer::singleShot(200, [ = ]() {
m_animationPage->hide();
});
@@ -1370,7 +1370,7 @@ void MainWindow::setMinWindowPos()
void MainWindow::setMaxWindowPos()
{
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
- kdk::WindowManager::setGeometry(m_fullWindow->windowHandle(), QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
+ kdk::WindowManager::setGeometry(m_fullWindow->windowHandle(), QRect(Style::m_primaryScreenX, Style::m_primaryScreenY, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
}
}

View File

@ -1,675 +0,0 @@
From: =?utf-8?b?5byg5aSp5rO9?=
<11297911+zhang_tian_ze@user.noreply.gitee.com>
Date: Thu, 15 Dec 2022 06:03:50 +0000
Subject: =?utf-8?b?ITQzIOWinuWKoOaUtuiXj+acgOi/keeEpueCueaJk+W8gO+8jOWQjA==?=
=?utf-8?b?5q2ldXBzdHJlYW3vvIzlop7liqBEZWJpYW4gTWVyZ2UgcHVsbCByZXF1ZXN0ICE0?=
=?utf-8?b?MyBmcm9tIOW8oOWkqeazvS9vcGVua3lsaW4veWFuZ3R6ZQ==?=
---
src/UserInterface/Button/push_button.cpp | 104 +++++++++++++++++++++++++++
src/UserInterface/Button/push_button.h | 44 ++++++++++++
src/UserInterface/Button/textlabel.cpp | 34 +++++++++
src/UserInterface/Button/textlabel.h | 27 +++++++
src/UserInterface/Widget/function_Widget.cpp | 8 +--
src/UserInterface/Widget/function_Widget.h | 2 +-
src/UserInterface/Widget/splitbar_frame.h | 6 +-
src/UserInterface/full_mainwindow.cpp | 11 +--
src/UserInterface/full_mainwindow.h | 3 +-
src/UserInterface/mainwindow.cpp | 44 ++++++++----
src/UserInterface/mainwindow.h | 9 +--
src/UserInterface/userinterface.pri | 4 ++
src/UtilityFunction/Style/style.h | 12 ++--
src/UtilityFunction/utility.cpp | 32 ++++++++-
src/UtilityFunction/utility.h | 4 +-
15 files changed, 304 insertions(+), 40 deletions(-)
create mode 100644 src/UserInterface/Button/push_button.cpp
create mode 100644 src/UserInterface/Button/push_button.h
create mode 100644 src/UserInterface/Button/textlabel.cpp
create mode 100644 src/UserInterface/Button/textlabel.h
diff --git a/src/UserInterface/Button/push_button.cpp b/src/UserInterface/Button/push_button.cpp
new file mode 100644
index 0000000..cff465a
--- /dev/null
+++ b/src/UserInterface/Button/push_button.cpp
@@ -0,0 +1,104 @@
+#include "push_button.h"
+
+PushButton::PushButton(QWidget *parent) : QPushButton(parent)
+{
+ m_btnLayout = new QHBoxLayout(this);
+ this->setLayout(m_btnLayout);
+ m_label = new IconLabel(this);
+ m_btnLayout->addWidget(m_label);
+
+ m_label->setAlignment(Qt::AlignCenter);
+ m_btnLayout->setAlignment(Qt::AlignCenter);
+}
+
+void PushButton::setLabel(QPixmap pixmap, int size)
+{
+ m_label->setFixedSize(size, size);
+ m_label->setIcon(pixmap);
+}
+
+PushButton::~PushButton()
+{
+
+}
+
+void PushButton::paintEvent(QPaintEvent *e)
+{
+ Q_UNUSED(e);
+ QStylePainter painter(this);
+ painter.setRenderHint(QPainter::Antialiasing);
+ QStyleOptionButton option;
+ initStyleOption(&option);
+
+ if (option.state & QStyle::State_Sunken) {
+ painter.save();
+ painter.setPen(Qt::NoPen);
+ painter.setBrush(Qt::white);
+ if (g_curStyle == "ukui-dark" || g_isFullScreen) {
+ painter.setOpacity(0.25);
+ } else {
+ painter.setOpacity(0.65);
+ }
+
+ painter.drawRoundedRect(option.rect.adjusted(1, 1, -1, -1), 6, 6);
+ painter.restore();
+ }
+
+ if (option.state & QStyle::State_MouseOver) {
+ painter.save();
+ painter.setPen(Qt::NoPen);
+ painter.setBrush(Qt::white);
+ if (g_curStyle == "ukui-dark" || g_isFullScreen) {
+ painter.setOpacity(0.1);
+ } else {
+ painter.setOpacity(0.35);
+ }
+
+ painter.drawRoundedRect(option.rect.adjusted(1, 1, -1, -1), 6, 6);
+ painter.restore();
+ }
+
+ if (option.state & QStyle::State_On) {
+ painter.save();
+ painter.setPen(Qt::NoPen);
+ painter.setBrush(Qt::white);
+ if (g_curStyle == "ukui-dark" || g_isFullScreen) {
+ painter.setOpacity(0.2);
+ } else {
+ painter.setOpacity(0.5);
+ }
+
+ painter.drawRoundedRect(option.rect.adjusted(1, 1, -1, -1), 6, 6);
+ painter.restore();
+ }
+
+ if (option.state & QStyle::State_HasFocus) {
+ painter.save();
+ QStyleOption opt;
+ QColor color = opt.palette.color(QPalette::Highlight);
+ painter.setPen(QPen(color, 2));
+ painter.drawRoundedRect(option.rect.adjusted(1, 1, -1, -1), 6, 6);
+ painter.restore();
+ }
+}
+
+IconLabel::IconLabel(QWidget *parent)
+ : QLabel(parent)
+{
+ this->setContentsMargins(0, 0, 0, 0);
+}
+
+void IconLabel::paintEvent(QPaintEvent *event)
+{
+ QPainter painter(this);
+ painter.setRenderHints(QPainter::SmoothPixmapTransform, true);
+ painter.drawPixmap(0, 0, m_pixmap);
+ return QLabel::paintEvent(event);
+}
+
+void IconLabel::setIcon(const QPixmap &pixmap)
+{
+ m_pixmap = pixmap;
+}
+
+
diff --git a/src/UserInterface/Button/push_button.h b/src/UserInterface/Button/push_button.h
new file mode 100644
index 0000000..5c044ba
--- /dev/null
+++ b/src/UserInterface/Button/push_button.h
@@ -0,0 +1,44 @@
+#ifndef PUSHBUTTON_H
+#define PUSHBUTTON_H
+
+#include <QObject>
+#include <QLabel>
+#include <QPushButton>
+#include <QStylePainter>
+#include <QStyleOption>
+#include <QHBoxLayout>
+#include "utility.h"
+
+class IconLabel : public QLabel
+{
+ Q_OBJECT
+public:
+ IconLabel(QWidget *parent = nullptr);
+ void setIcon(const QPixmap &pixmap);
+protected:
+ void paintEvent(QPaintEvent *event) override;
+
+private:
+ QPixmap m_pixmap;
+};
+
+class PushButton : public QPushButton
+{
+ Q_OBJECT
+public:
+ explicit PushButton(QWidget *parent = nullptr);
+ ~PushButton();
+
+ void setLabel(QPixmap pixmap, int size);
+
+protected:
+ void paintEvent(QPaintEvent *e) override;
+
+private:
+ QHBoxLayout *m_btnLayout = nullptr;
+ IconLabel *m_label = nullptr;
+
+Q_SIGNALS:
+
+};
+#endif // PUSHBUTTON_H
diff --git a/src/UserInterface/Button/textlabel.cpp b/src/UserInterface/Button/textlabel.cpp
new file mode 100644
index 0000000..90e4722
--- /dev/null
+++ b/src/UserInterface/Button/textlabel.cpp
@@ -0,0 +1,34 @@
+#include "textlabel.h"
+#include <QDebug>
+
+TextLabel::TextLabel(QWidget *parent) : QLabel(parent)
+{
+
+}
+
+void TextLabel::checkState(bool isChecked)
+{
+ m_isChecked = isChecked;
+}
+
+void TextLabel::paintEvent(QPaintEvent *event)
+{
+ if (m_isChecked) {
+ return QLabel::paintEvent(event);
+ }
+
+ QStylePainter painter(this);
+ painter.setRenderHint(QPainter::Antialiasing);
+ QStyleOptionFrame option;
+ initStyleOption(&option);
+
+ if (option.state & QStyle::State_HasFocus) {
+ painter.save();
+ QStyleOption opt;
+ QColor color = opt.palette.color(QPalette::Highlight);
+ painter.setPen(QPen(color, 2));
+ painter.drawRoundedRect(option.rect.adjusted(1, 1, -1, -1), 6, 6);
+ painter.restore();
+ }
+ QLabel::paintEvent(event);
+}
diff --git a/src/UserInterface/Button/textlabel.h b/src/UserInterface/Button/textlabel.h
new file mode 100644
index 0000000..18eb961
--- /dev/null
+++ b/src/UserInterface/Button/textlabel.h
@@ -0,0 +1,27 @@
+#ifndef TEXTLABEL_H
+#define TEXTLABEL_H
+
+#include <QObject>
+#include <QLabel>
+#include <QPaintEvent>
+#include <QStylePainter>
+#include <QStyleOption>
+
+class TextLabel : public QLabel
+{
+ Q_OBJECT
+public:
+ explicit TextLabel(QWidget *parent = nullptr);
+
+ void checkState(bool isChecked);
+
+private:
+ void paintEvent(QPaintEvent *event) override;
+
+ bool m_isChecked = false;
+
+Q_SIGNALS:
+
+};
+
+#endif // TEXTLABEL_H
diff --git a/src/UserInterface/Widget/function_Widget.cpp b/src/UserInterface/Widget/function_Widget.cpp
index cc0eee7..8cd4967 100755
--- a/src/UserInterface/Widget/function_Widget.cpp
+++ b/src/UserInterface/Widget/function_Widget.cpp
@@ -74,9 +74,9 @@ FunctionWidget::FunctionWidget(QWidget *parent): QWidget(parent)
FunctionWidget::~FunctionWidget()
{
- if (themeSetting) {
- delete themeSetting;
- }
+// if (themeSetting) {
+// delete themeSetting;
+// }
if (myTimer) {
delete myTimer;
@@ -146,7 +146,7 @@ FunctionWidget::~FunctionWidget()
delete effect;
}
- themeSetting = nullptr;
+// themeSetting = nullptr;
myTimer = nullptr;
upWidget = nullptr;
upLayout = nullptr;
diff --git a/src/UserInterface/Widget/function_Widget.h b/src/UserInterface/Widget/function_Widget.h
index 9fe81d9..0f6f28a 100755
--- a/src/UserInterface/Widget/function_Widget.h
+++ b/src/UserInterface/Widget/function_Widget.h
@@ -47,7 +47,7 @@ protected:
private:
CurrentTimeInterface *Time = nullptr;
- QGSettings *themeSetting = nullptr;
+// QGSettings *themeSetting = nullptr;
QGSettings *timeSetting = nullptr;
QString themeName;
QObject *plugin = nullptr;
diff --git a/src/UserInterface/Widget/splitbar_frame.h b/src/UserInterface/Widget/splitbar_frame.h
index 079d757..bb5195e 100755
--- a/src/UserInterface/Widget/splitbar_frame.h
+++ b/src/UserInterface/Widget/splitbar_frame.h
@@ -15,8 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-#ifndef PUSHBUTTON_H
-#define PUSHBUTTON_H
+#ifndef SPLITBARFRAME_H
+#define SPLITBARFRAME_H
#include <QPushButton>
#include <QHBoxLayout>
#include <QLabel>
@@ -51,4 +51,4 @@ protected:
void paintEvent(QPaintEvent *event);
};
-#endif // PUSHBUTTON_H
+#endif // SPLITBARFRAME
diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp
index d614bb9..499e76d 100755
--- a/src/UserInterface/full_mainwindow.cpp
+++ b/src/UserInterface/full_mainwindow.cpp
@@ -82,11 +82,11 @@ void FullMainWindow::initButtonUI()
m_fullSelectMenuButton->setFixedSize(QSize(16, 34));
m_fullSelectMenuButton->setAcceptDrops(true);
m_fullSelectMenuButton->setFocusPolicy(Qt::StrongFocus);
- m_fullSelectMenuButton->setIcon(QPixmap(":/data/img/mainviewwidget/DM-arrow-2x.png"));
+ m_fullSelectMenuButton->setIcon(getCurPixmap(":/data/img/mainviewwidget/DM-arrow-2x.png", false, 16));
QPalette palete;
palete.setColor(QPalette::NoRole, Qt::white);
m_fullSelectMenuButton->setPalette(palete);
- m_minPushButton = new QPushButton(centralwidget);
+ m_minPushButton = new PushButton(centralwidget);
m_minPushButton->setObjectName(QString::fromUtf8("minPushButton"));
m_minPushButton->setFixedSize(QSize(48, 48));
m_minPushButton->setFlat(true);
@@ -288,9 +288,10 @@ void FullMainWindow::changeStyle()
"%1:hover {border-radius:24px; background:" + buttonColorHover + ";}"
"%1:pressed {border-radius:24px; background:" + buttonColorPress + ";}");
m_fullSelectToolButton->setStyleSheet(m_buttonStyle.arg("QPushButton"));
- m_fullSelectMenuButton->setIcon(QPixmap(":/data/img/mainviewwidget/DM-arrow-2x.png"));
- m_minPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/full-min.svg", false));
- m_minPushButton->setProperty("useIconHighlightEffect", 0x0);
+
+ QPixmap pixmap = loadSvg(QString(":/data/img/mainviewwidget/full-min.svg"), 25);
+ m_minPushButton->setLabel(pixmap, 25);
+// m_minPushButton->setProperty("useIconHighlightEffect", 0x0);
}
void FullMainWindow::on_minPushButton_clicked()
diff --git a/src/UserInterface/full_mainwindow.h b/src/UserInterface/full_mainwindow.h
index 09a7c01..c793607 100755
--- a/src/UserInterface/full_mainwindow.h
+++ b/src/UserInterface/full_mainwindow.h
@@ -30,6 +30,7 @@
#include "searchappthread.h"
#include "full_searchresult_widget.h"
#include "rotationlabel.h"
+#include "push_button.h"
class FullMainWindow : public QMainWindow
{
@@ -99,7 +100,7 @@ private:
QSpacerItem *horizontalSpacer_2;
QPushButton *m_fullSelectToolButton;
RotationLabel *m_fullSelectMenuButton;
- QPushButton *m_minPushButton;
+ PushButton *m_minPushButton;
QStackedWidget *m_fullStackedWidget;
FullCommonUseWidget *m_fullCommonPage;
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
index 18f538b..ad46566 100755
--- a/src/UserInterface/mainwindow.cpp
+++ b/src/UserInterface/mainwindow.cpp
@@ -165,16 +165,16 @@ void MainWindow::registDbusServer()
m_topStackedWidget->setCurrentIndex(0);
m_lineEdit->clear();
this->clearFocus();
- m_isFullScreen = false;
+ g_isFullScreen = false;
} else if (m_fullWindow->isVisible())
{
m_fullWindow->hide();
m_fullWindow->clearFocus();
m_fullWindow->resetEditline();
- m_isFullScreen = true;
+ g_isFullScreen = true;
} else
{
- if (!m_isFullScreen) {
+ if (!g_isFullScreen) {
this->show();
setMinWindowPos();
this->raise();
@@ -384,24 +384,25 @@ void MainWindow::initRightWidgetButton()
m_mainRightVerticalLayout_1 = new QVBoxLayout();
m_rightTopHorizontalLayout = new QHBoxLayout();
m_rightTopHorizontalLayout->setSpacing(30);
- m_rightTopHorizontalLayout->setContentsMargins(8, 0, 10, 0);
+ m_rightTopHorizontalLayout->setContentsMargins(8, 0, 6, 0);
//收藏按键
- m_collectPushButton = new QLabel(m_centralwidget);
+ m_collectPushButton = new TextLabel(m_centralwidget);
m_collectPushButton->setFocusPolicy(Qt::StrongFocus);
m_collectPushButton->setFixedHeight(34);
// m_collectPushButton->setFlat(true);
m_collectPushButton->installEventFilter(this);
//最近按键
- m_recentPushButton = new QLabel(m_centralwidget);
+ m_recentPushButton = new TextLabel(m_centralwidget);
m_recentPushButton->setFixedHeight(34);
m_recentPushButton->setFocusPolicy(Qt::StrongFocus);
// m_recentPushButton->setFlat(true);
m_recentPushButton->installEventFilter(this);
m_horizontalSpacer_3 = new QSpacerItem(332, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
//放大缩小按键
- m_minMaxChangeButton = new QPushButton(m_centralwidget);
- m_minMaxChangeButton->setFixedSize(QSize(24, 24));
- m_minMaxChangeButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-max.svg", true));
+ m_minMaxChangeButton = new PushButton(m_centralwidget);
+ m_minMaxChangeButton->setFixedSize(QSize(34, 34));
+ QPixmap pixmap = getCurPixmap(":/data/img/mainviewwidget/DM-max.svg",true, 16);
+ m_minMaxChangeButton->setLabel(pixmap, 16);
m_minMaxChangeButton->setFlat(true);
m_rightTopHorizontalLayout->addWidget(m_collectPushButton);
m_rightTopHorizontalLayout->addWidget(m_recentPushButton);
@@ -638,6 +639,9 @@ void MainWindow::changeStyle()
}
}
+ QPixmap pixmap = getCurPixmap(":/data/img/mainviewwidget/DM-max.svg",true, 16);
+ m_minMaxChangeButton->setLabel(pixmap, 16);
+
m_buttonStyle = QString("%1{border-radius:13px; background:" + buttonColorDefault + ";}"
"%1:hover {border-radius:13px; background:" + buttonColorHover + ";}"
"%1:pressed {border-radius:13px; background:" + buttonColorPress + ";}");
@@ -745,6 +749,14 @@ bool MainWindow::event(QEvent *event)
QApplication::postEvent(m_selectMenuButton, new QEvent(QEvent::MouseButtonPress));
}
+ if (m_collectPushButton->hasFocus()) {
+ on_collectPushButton_clicked();
+ }
+
+ if (m_recentPushButton->hasFocus()) {
+ on_recentPushButton_clicked();
+ }
+
if (m_lineEdit->hasFocus()) {
m_minSearchResultListView->setFocus();
} else {
@@ -1231,6 +1243,8 @@ void MainWindow::databaseThreadCloseSlot()
void MainWindow::on_collectPushButton_clicked()
{
+ m_recentPushButton->checkState(false);
+ m_collectPushButton->checkState(true);
m_rightStackedWidget->setCurrentIndex(0);
QString textColorHightLight = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16).mid(2, 6);
@@ -1245,6 +1259,8 @@ void MainWindow::on_collectPushButton_clicked()
void MainWindow::on_recentPushButton_clicked()
{
+ m_collectPushButton->checkState(false);
+ m_recentPushButton->checkState(true);
m_rightStackedWidget->setCurrentIndex(1);
QString textColorDefault = QString::number(this->palette().color(QPalette::Text).rgba(), 16).mid(2, 6);
m_collectPushButton->setStyleSheet(QString("color:#%1").arg(textColorDefault));
@@ -1270,7 +1286,7 @@ void MainWindow::on_searchPushButton_clicked()
void MainWindow::on_minMaxChangeButton_clicked()
{
m_canHide = true;
- m_isFullScreen = true;
+ g_isFullScreen = true;
QPropertyAnimation *m_maxAnimation = new QPropertyAnimation(m_animationPage, "geometry", this);
connect(m_maxAnimation, &QPropertyAnimation::finished, this, &MainWindow::maxAnimationFinished);
@@ -1300,7 +1316,7 @@ void MainWindow::showWindow()
{
Style::initWidStyle();
myDebug() << "调用开始菜单显示";
- if (m_isFullScreen) {
+ if (g_isFullScreen) {
m_fullWindow->show();
setMaxWindowPos();
m_fullWindow->raise();
@@ -1322,13 +1338,13 @@ void MainWindow::hideWindow()
m_fullWindow->hide();
m_fullWindow->resetEditline();
this->clearFocus();
- m_isFullScreen = true;
+ g_isFullScreen = true;
} else {
this->hide();
m_topStackedWidget->setCurrentIndex(0);
m_lineEdit->clear();
this->clearFocus();
- m_isFullScreen = false;
+ g_isFullScreen = false;
}
}
@@ -1415,7 +1431,7 @@ void MainWindow::showNormalWindowSlot()
QEventLoop loop;
QTimer::singleShot(100, &loop, SLOT(quit()));
loop.exec();
- m_isFullScreen = false;
+ g_isFullScreen = false;
m_minAnimation->setEasingCurve(QEasingCurve::OutExpo);
m_minAnimation->setStartValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
m_minAnimation->setEndValue(QRect(this->x() + 5, this->y() + 5, Style::m_minw - 10, Style::m_minh - 10));
diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h
index 2afcb93..75fee17 100755
--- a/src/UserInterface/mainwindow.h
+++ b/src/UserInterface/mainwindow.h
@@ -53,6 +53,8 @@
#include "animationpage.h"
#include "rotationlabel.h"
#include "rightlistview.h"
+#include "push_button.h"
+#include "textlabel.h"
#include "ukuistylehelper/ukuistylehelper.h"
#include "windowmanager/windowmanager.h"
@@ -200,10 +202,10 @@ private:
QHBoxLayout *m_rightTopHorizontalLayout = nullptr;
QVBoxLayout *m_rightCollectLayout = nullptr;
QVBoxLayout *m_rightRecentLayout = nullptr;
- QLabel *m_collectPushButton = nullptr;
- QLabel *m_recentPushButton = nullptr;
+ TextLabel *m_collectPushButton = nullptr;
+ TextLabel *m_recentPushButton = nullptr;
QSpacerItem *m_horizontalSpacer_3 = nullptr;
- QPushButton *m_minMaxChangeButton = nullptr;
+ PushButton *m_minMaxChangeButton = nullptr;
QSpacerItem *m_verticalSpacer = nullptr;
QStackedWidget *m_rightStackedWidget = nullptr;
QWidget *m_collectPage = nullptr;
@@ -220,7 +222,6 @@ private:
MenuBox *m_dropDownMenu = nullptr;
bool m_canHide = true;
- bool m_isFullScreen = false;
QString m_buttonStyle;
UkuiMenuInterface *m_ukuiMenuInterface = nullptr;
QPropertyAnimation *m_animation = nullptr;
diff --git a/src/UserInterface/userinterface.pri b/src/UserInterface/userinterface.pri
index 00b893b..f635b07 100755
--- a/src/UserInterface/userinterface.pri
+++ b/src/UserInterface/userinterface.pri
@@ -11,6 +11,8 @@ HEADERS += \
$$PWD/Button/function_classify_button.h \
$$PWD/Button/letter_classify_button.h \
$$PWD/Button/tool_button.h \
+ $$PWD/Button/push_button.h \
+ $$PWD/Button/textlabel.h\
$$PWD/ListView/fulllistview.h \
$$PWD/ListView/klistview.h \
$$PWD/ListView/listview.h \
@@ -48,6 +50,8 @@ SOURCES += \
$$PWD/Button/function_classify_button.cpp \
$$PWD/Button/letter_classify_button.cpp \
$$PWD/Button/tool_button.cpp \
+ $$PWD/Button/push_button.cpp \
+ $$PWD/Button/textlabel.cpp\
$$PWD/ListView/fulllistview.cpp \
$$PWD/ListView/klistview.cpp \
$$PWD/ListView/listview.cpp \
diff --git a/src/UtilityFunction/Style/style.h b/src/UtilityFunction/Style/style.h
index 6ca2f80..4fe232e 100755
--- a/src/UtilityFunction/Style/style.h
+++ b/src/UtilityFunction/Style/style.h
@@ -40,16 +40,16 @@
#define RightClickMenuOpacity 0.95
#define ToolTipBackground "rgba(26, 26, 26, 0.7)"
#define DefaultBackground "rgba(19, 19, 20, 0.7)" //默认态背景色
-#define LineBackground "rgba(255,255,255)" //分割线背景色
+#define LineBackground "rgba(255, 255, 255)" //分割线背景色
#define SBClassifyBtnSelectedBackground "#3D6BE5" //侧边栏上部分类按钮选择背景
#define SBFunBtnHoverBackground "rgba(255, 255, 255, 0.14)" //侧边栏目下部功能按钮悬浮背景
#define ClassifyBtnHoverBackground "rgba(255, 255, 255, 0.14)" //分类按钮悬浮背景
#define MMBtnHoverBackground "rgba(255, 255, 255, 0.14)" //最大化最小化按钮悬浮背景
-#define QueryLineEditDefaultBackground "rgba(0, 0, 0,0.04)" //搜索框默认态背景
-#define QueryLineEditBackground "rgba(255, 255, 255,0.06)" //搜索框背景
-#define QueryLineEditClickedDefaultBackground "rgba(0, 0, 0,0.04)" //搜索框默认态背景选中
-#define QueryLineEditClickedBackground "rgba(255, 255, 255,0.06)" //搜索框背景选中
-#define QueryLineEditClickedBorderDefault "rgba(0, 0, 0,0.1)" //搜索框默认态背景选中边框
+#define QueryLineEditDefaultBackground "rgba(0, 0, 0, 0.04)" //搜索框默认态背景
+#define QueryLineEditBackground "rgba(255, 255, 255, 0.06)" //搜索框背景
+#define QueryLineEditClickedDefaultBackground "rgba(0, 0, 0, 0.04)" //搜索框默认态背景选中
+#define QueryLineEditClickedBackground "rgba(255, 255, 255, 0.06)" //搜索框背景选中
+#define QueryLineEditClickedBorderDefault "rgba(255, 255, 255, 0.25)" //搜索框默认态背景选中边框
#define QueryLineEditClickedBorder "rgba(5, 151, 255, 1)" //搜索框背景选中边框
#define AppBtnHover "#ffffff" //按钮悬浮
diff --git a/src/UtilityFunction/utility.cpp b/src/UtilityFunction/utility.cpp
index 8af6b3f..5b66523 100755
--- a/src/UtilityFunction/utility.cpp
+++ b/src/UtilityFunction/utility.cpp
@@ -34,8 +34,9 @@
QString g_projectCodeName = "V10SP1";
QString g_subProjectCodeName = "";
QString g_platform = "";
-bool g_menuStatus = false;
QString g_curStyle = "";
+bool g_menuStatus = false;
+bool g_isFullScreen = false;
const QPixmap loadSvg(const QString &fileName, const int size)
{
@@ -132,6 +133,35 @@ QIcon getCurIcon(const QString &iconPath, bool autoSet)
return QIcon(pixmap);
}
+QPixmap getCurPixmap(const QString &iconPath, bool autoSet, int size)
+{
+ QPixmap pixmap;
+
+ if (iconPath.endsWith("png")) {
+ pixmap = QPixmap(iconPath);
+ } else {
+ pixmap = loadSvg(iconPath, size);
+ }
+
+ if (!autoSet) {
+ return drawSymbolicColoredPixmap(pixmap);
+ }
+
+ if (QGSettings::isSchemaInstalled(QString("org.ukui.style").toLocal8Bit())) {
+ QGSettings gsetting(QString("org.ukui.style").toLocal8Bit());
+
+ if (gsetting.keys().contains(QString("styleName"))) {
+ if (gsetting.get("style-name").toString() == "ukui-light"
+ || gsetting.get("style-name").toString() == "ukui-default") {
+ pixmap = drawSymbolicBlackColoredPixmap(pixmap);
+ } else {
+ pixmap = drawSymbolicColoredPixmap(pixmap);
+ }
+ }
+ }
+ return pixmap;
+}
+
//不通过任务栏获取屏幕可用区域数据
QVariantList getScreenGeometryList()
{
diff --git a/src/UtilityFunction/utility.h b/src/UtilityFunction/utility.h
index 66a047c..7adee3e 100755
--- a/src/UtilityFunction/utility.h
+++ b/src/UtilityFunction/utility.h
@@ -71,6 +71,7 @@ bool checkOsRelease();//区分社区办与商业版
void centerToScreen(QWidget *widget);
QIcon getCurIcon(const QString &iconPath, bool autoSet);
+QPixmap getCurPixmap(const QString &iconPath, bool autoSet, int size);
//获取用户图像
QString getUserIcon();
@@ -87,8 +88,9 @@ enum PanelPositon {
extern QString g_projectCodeName;
extern QString g_subProjectCodeName;
extern QString g_platform;
-extern bool g_menuStatus;
extern QString g_curStyle;
+extern bool g_menuStatus;
+extern bool g_isFullScreen;
#endif // UTILITY_H

View File

@ -1,112 +0,0 @@
From: lixueman <lixueman@kylinos.cn>
Date: Thu, 22 Dec 2022 01:57:57 +0000
Subject: =?utf-8?b?ITQ4IOS/ruaUuXdheWxhbmTkuIvorr7nva7nqpfnrqHlsZ7mgKflpLE=?=
=?utf-8?b?5pWI5a+86Ie05a2X5q+N5o+Q56S656qX5byC5bi46Zeu6aKYIE1lcmdlIHB1bGwg?=
=?utf-8?b?cmVxdWVzdCAhNDggZnJvbSBsaXh1ZW1hbi9vcGVua3lsaW4veWFuZ3R6ZQ==?=
---
.../Button/letter_classify_button.cpp | 27 ++++------------------
src/UserInterface/Button/letter_classify_button.h | 2 +-
src/UserInterface/Other/lettertooltip.cpp | 4 ++--
src/UserInterface/Other/lettertooltip.h | 4 ++--
4 files changed, 10 insertions(+), 27 deletions(-)
diff --git a/src/UserInterface/Button/letter_classify_button.cpp b/src/UserInterface/Button/letter_classify_button.cpp
index 6577384..47cd21f 100755
--- a/src/UserInterface/Button/letter_classify_button.cpp
+++ b/src/UserInterface/Button/letter_classify_button.cpp
@@ -28,16 +28,7 @@ LetterClassifyButton::LetterClassifyButton(QWidget *parent,
{
this->setFlat(true);
m_letter = letter;
-// if (m_fullscreen) {
-// QFont font;
-// font.setPixelSize(Style::LeftLetterFontSize);
-// this->setFont(font);
-// QPalette pe = this->palette();
-// pe.setColor(QPalette::ButtonText, Qt::white);
-// this->setPalette(pe);
-// }
-
-// this->setText(letter);
+ m_tooltip = new LetterToolTip(this);
this->setFocusPolicy(Qt::NoFocus);
this->setCheckable(true);
this->setStyleSheet("padding: 0px;");
@@ -147,16 +138,10 @@ void LetterClassifyButton::enterEvent(QEvent *e)
Q_UNUSED(e);
if (m_fullscreen) {
- // QFont font;
- // font.setPixelSize(Style::LeftLetterFontSize*3);
- // this->setFont(font);
- // this->setFixedSize(Style::LeftLetterBtnHeight*2,Style::LeftLetterBtnHeight*2);
- tooltip = new LetterToolTip();
QPoint oPoint = this->mapToGlobal(QPoint(this->rect().x() + 35, this->rect().y() - 10));
- tooltip->setText(m_letter);
- tooltip->raise();
- tooltip->move(oPoint);
- tooltip->show();
+ m_tooltip->setText(m_letter);
+ m_tooltip->move(oPoint);
+ m_tooltip->show();
}
}
@@ -169,9 +154,7 @@ void LetterClassifyButton::leaveEvent(QEvent *e)
font.setPixelSize(Style::m_leftLetterFontSize);
this->setFont(font);
this->setFixedSize(Style::m_leftLetterBtnHeight, Style::m_leftLetterBtnHeight);
- tooltip->close();
- delete tooltip;
- tooltip = nullptr;
+ m_tooltip->hide();
}
}
diff --git a/src/UserInterface/Button/letter_classify_button.h b/src/UserInterface/Button/letter_classify_button.h
index fded3eb..277fab8 100755
--- a/src/UserInterface/Button/letter_classify_button.h
+++ b/src/UserInterface/Button/letter_classify_button.h
@@ -37,7 +37,7 @@ public:
QString m_letter = QString();
private:
bool m_fullscreen = false;
- LetterToolTip *tooltip = nullptr;
+ LetterToolTip *m_tooltip = nullptr;
protected:
void enterEvent(QEvent *e);
diff --git a/src/UserInterface/Other/lettertooltip.cpp b/src/UserInterface/Other/lettertooltip.cpp
index 030e544..00a28db 100755
--- a/src/UserInterface/Other/lettertooltip.cpp
+++ b/src/UserInterface/Other/lettertooltip.cpp
@@ -21,9 +21,9 @@
#include <QHBoxLayout>
LetterToolTip::LetterToolTip(QWidget *parent):
- QDialog(parent)
+ QWidget(parent)
{
- this->setWindowFlags(/*Qt::FramelessWindowHint *//*| */Qt::X11BypassWindowManagerHint);
+ this->setWindowFlag(Qt::ToolTip);
this->setAttribute(Qt::WA_TranslucentBackground, true);
this->setContentsMargins(0, 0, 0, 0);
this->setAutoFillBackground(false);
diff --git a/src/UserInterface/Other/lettertooltip.h b/src/UserInterface/Other/lettertooltip.h
index 81c0411..854e69f 100755
--- a/src/UserInterface/Other/lettertooltip.h
+++ b/src/UserInterface/Other/lettertooltip.h
@@ -17,10 +17,10 @@
#ifndef LETTERTOOLTIP_H
#define LETTERTOOLTIP_H
-#include <QDialog>
#include <QLabel>
+#include <QWidget>
-class LetterToolTip : public QDialog
+class LetterToolTip : public QWidget
{
Q_OBJECT
public:

View File

@ -1,49 +0,0 @@
From e678d299bbeed0333dbb6fa20f293dbb0a0189ae Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Wed, 14 Jun 2023 14:43:07 +0800
Subject: [PATCH] disable Suspend and Sleep of ukui-menu
---
.../RightClickMenu/rightclickmenu.cpp | 26 +++++++++----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/UserInterface/RightClickMenu/rightclickmenu.cpp b/src/UserInterface/RightClickMenu/rightclickmenu.cpp
index 3db1762..fc06767 100755
--- a/src/UserInterface/RightClickMenu/rightclickmenu.cpp
+++ b/src/UserInterface/RightClickMenu/rightclickmenu.cpp
@@ -359,19 +359,19 @@ int RightClickMenu::showShutdownMenu(const QPoint &pos, const bool &isFullWind)
this, SLOT(switchUserActionTriggerSlot()));
}
- reply = iface.call("canHibernate");
-
- if (reply.isValid() && reply.value()) {
- m_showShutMenu.addAction(QIcon(getIconPixmap("kylin-sleep-symbolic", 1)), tr("Hibernate"),
- this, SLOT(hibernateActionTriggerSlot()));
- }
-
- reply = iface.call("canSuspend");
-
- if (reply.isValid() && reply.value()) {
- m_showShutMenu.addAction(QIcon(getIconPixmap("kylin-hebernate-symbolic", 1)), tr("Sleep"),
- this, SLOT(sleepActionTriggerSlot()));
- }
+// reply = iface.call("canHibernate");
+//
+// if (reply.isValid() && reply.value()) {
+// m_showShutMenu.addAction(QIcon(getIconPixmap("kylin-sleep-symbolic", 1)), tr("Hibernate"),
+// this, SLOT(hibernateActionTriggerSlot()));
+// }
+//
+// reply = iface.call("canSuspend");
+//
+// if (reply.isValid() && reply.value()) {
+// m_showShutMenu.addAction(QIcon(getIconPixmap("kylin-hebernate-symbolic", 1)), tr("Sleep"),
+// this, SLOT(sleepActionTriggerSlot()));
+// }
m_showShutMenu.addAction(QIcon(getIconPixmap("system-lock-screen-symbolic", 1)), tr("Lock Screen"),
this, SLOT(lockScreenActionTriggerSlot()));
--
2.33.0

BIN
ukui-menu-3.0.3.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,39 +1,12 @@
%define debug_package %{nil}
Name: ukui-menu
Version: 3.1.1
Release: 12
Version: 3.0.3
Release: 1
Summary: Advanced ukui menu
License: GPL-3.0-or-later
License: GPL-3.0
URL: http://www.ukui.org
Source0: %{name}-%{version}.tar.gz
patch03: 0003-add-ukui-log4qt.patch
#patch from openkylin ukui-menu-build-3.1.1-ok4_1222
patch04: 0001-4-wayland.patch
patch05: 0002-5-platformName-update-debian-changelog.-platformName.patch
patch06: 0003-.patch
patch07: 0004-7-close-cd-128489.patch
patch08: 0005-8-wayland.patch
patch09: 0006-changelog.patch
patch10: 0007-changelog.patch
patch11: 0008-changelog.patch
patch12: 0009-win.patch
patch13: 0010-hover.patch
patch14: 0011-.patch
patch15: 0012-16-wayland.patch
patch16: 0013-21-.pro-openKylin-0.7.5.patch
patch17: 0014-19.patch
patch18: 0015-22.patch
patch19: 0016-25-upstream.patch
patch20: 0017-27.patch
patch21: 0018-update-changelog.patch
patch22: 0019-32.patch
patch23: 0020-43-upstream-Debian.patch
patch24: 0021-48-wayland.patch
#fix error
Patch25: 0001-fix-uninstall-failed-issue.patch
%if 0%{?kylin}
Patch26: disable-Suspend-and-Sleep-of-ukui-menu.patch
%endif
BuildRequires: qt5-qtbase-devel
BuildRequires: libqtxdg-devel
@ -46,14 +19,12 @@ BuildRequires: libXtst-devel
BuildRequires: libX11-devel
BuildRequires: qt5-qttools-devel
BuildRequires: kf5-kwindowsystem-devel
BuildRequires: uchardet-devel ukui-interface peony libpeony-dev
BuildRequires: libkysdk-waylandhelper-devel
BuildRequires: uchardet-devel
Requires: gsettings-qt
Requires: qt5-qtx11extras
Requires: bamf-daemon
Requires: accountsservice
Requires: libkysdk-waylandhelper
#BuildArch: noarch
@ -65,17 +36,18 @@ Requires: libkysdk-waylandhelper
The package contains executable file.
%prep
%autosetup -n %{name}-%{version} -p1
%setup -q
%build
mkdir build && cd build
%{qmake_qt5} ..
%{make_build}
qmake-qt5 ..
make
%install
rm -rf $RPM_BUILD_ROOT
cd %{_builddir}/%{name}-%{version}/build
make INSTALL_ROOT=%{buildroot} install
#make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
@ -86,71 +58,8 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/ukui-menu/translations/
%changelog
* Wed Jun 14 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-12
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: disable Suspend and Sleep of ukui-menu
* Wed May 24 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-11
- add patch from upstream
* Fri May 12 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-10
- add 0006-changelog.patch 0007-changelog.patch 0008-changelog.patch
* Tue Feb 21 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-9
- add 0005-8-wayland.patch
* Mon Feb 20 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-8
- add 0004-7-close-cd-128489.patch
* Fri Feb 17 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-7
- add execapp
* Thu Feb 16 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-6
- update platformName
* Wed Feb 15 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-5
- add 0003-add-ukui-log4qt.patch
* Fri Feb 10 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-4
- fix coredump of ukui-menu
* Wed Feb 1 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-3
- fix uninstall failed issue
* Tue Jan 17 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-2
- add build debuginfo and debugsource
* Thu Dec 01 2022 tanyulong <tanyulong@kylinos.cn> - 3.1.1-1
- update upstream version 3.1.1
* Mon Aug 8 2022 huayadong <huayadong@kylinos.cn> - 3.0.2-11
- Fixed application icon dragging problem
* Mon Aug 8 2022 huayadong <huayadong@kylinos.cn> - 3.0.2-10
- Fixed right click exception popover problem
* Mon Aug 8 2022 huayadong <huayadong@kylinos.cn> - 3.0.2-9
- add optimize the interaction strategy with the taskbar
* Wed Jun 29 2022 huayadong <huayadong@kylinos.cn> - 3.0.2-8
- Fixed size problem with multiple screens
* Fri May 20 2022 tanyulong <tanyulong@kylinos.cn> - 3.0.2-7
- Improve the project according to the requirements of compliance improvement
* Sat Apr 02 2022 tanyulong <tanyulong@kylinos.cn> - 3.0.2-6
- modify yaml file error
* Mon Mar 28 2022 huayadong <huayadong@kylinos.cn> - 3.0.2-5
- Fix crashes when installing or uninstalling software
* Fri Dec 10 2021 huayadong <huayadong@kylinos.cn> - 3.0.2-4
- add patch:0262-Adapt-the-light-color-theme.patch
* Tue Dec 07 2021 huayadong <huayadong@kylinos.cn> - 3.0.2-3
- add patch: 0001-Optimize-Chinese-search.patch
* Mon Oct 26 2020 huayadong <huayadong@kylinos.cn> - 3.0.3-1
- update to upstream version 3.0.3-1
* Mon Oct 26 2020 douyan <douyan@kylinos.cn> - 3.0.2-2
- fix uninstalled failed issue

View File

@ -1,4 +1,4 @@
version_control: github
src_repo: UKUI/ukui-menu
src_repo: https://github.com/ukui/ukui-menu.git
tag_prefix: "v"
separator: "."
seperator: "."