From fd51a285e07bc59a283126ccda912f30aa479869 Mon Sep 17 00:00:00 2001 From: lixueman Date: Tue, 12 Jul 2022 06:56:21 +0000 Subject: [PATCH] =?UTF-8?q?!7=20=E8=B0=83=E6=95=B4=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84=20*=20close-cd=20128489=20?= =?UTF-8?q?=E5=85=A8=E5=B1=8F=E5=B0=86=E6=9F=90=E4=B8=AA=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BA=E2=80=9C=E5=9B=BA=E5=AE=9A=E5=88=B0?= =?UTF-8?q?=E6=89=80=E6=9C=89=E8=BD=AF=E4=BB=B6=E2=80=9D=EF=BC=8C=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=8C=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E9=97=AA=E9=80=80=20*=20=E5=9B=BA=E5=AE=9A=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E7=94=B5=E6=BA=90=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=20*=20=E5=A2=9E=E5=8A=A0=E5=85=A8=E5=B1=8F=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E8=8F=9C=E5=8D=95=E4=B8=8B=E6=8B=89=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=97=8B=E8=BD=AC=E6=95=88=E6=9E=9C=EF=BC=9B=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=85=A8=E5=B1=8F=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=A9=BA=E7=99=BD=E5=8C=BA=E5=9F=9F=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 9 + debian/control | 6 +- .../BuriedPoint/buriedpointdatasend.cpp | 78 --- .../BuriedPoint/buriedpointdatasend.h | 29 - src/BackProcess/backprocess.pri | 6 +- .../qtsingleapplication.cpp | 3 + src/UserInterface/ListView/fulllistview.cpp | 1 + src/UserInterface/ListView/klistview.cpp | 16 +- src/UserInterface/ListView/klistview.h | 1 + src/UserInterface/ListView/listview.cpp | 8 +- src/UserInterface/ListView/rightlistview.cpp | 35 +- src/UserInterface/ListView/rightlistview.h | 2 + .../RightClickMenu/rightclickmenu.cpp | 9 +- .../RightClickMenu/rightclickmenu.h | 2 +- .../ViewItem/full_item_delegate.cpp | 8 +- src/UserInterface/ViewItem/itemdelegate.cpp | 5 + .../ViewItem/right_item_delegate.cpp | 8 +- .../Widget/full_commonuse_widget.cpp | 20 +- .../Widget/full_function_widget.cpp | 22 +- .../Widget/full_letter_widget.cpp | 22 +- .../Widget/full_searchresult_widget.cpp | 26 +- src/UserInterface/full_mainwindow.cpp | 258 +++++--- src/UserInterface/full_mainwindow.h | 21 +- src/UserInterface/mainwindow.cpp | 551 +++++++++--------- src/UserInterface/mainwindow.h | 12 + src/UtilityFunction/Style/style.cpp | 4 +- src/UtilityFunction/utility.h | 20 - translations/ukui-menu_bo.qm | 1 - translations/ukui-menu_bo.ts | 67 ++- translations/ukui-menu_tr.qm | Bin 2709 -> 0 bytes translations/ukui-menu_tr.ts | 67 ++- translations/ukui-menu_zh_CN.qm | Bin 2320 -> 0 bytes translations/ukui-menu_zh_CN.ts | 75 ++- ukui-menu.pro | 2 +- 34 files changed, 705 insertions(+), 689 deletions(-) delete mode 100644 src/BackProcess/BuriedPoint/buriedpointdatasend.cpp delete mode 100644 src/BackProcess/BuriedPoint/buriedpointdatasend.h delete mode 100755 translations/ukui-menu_bo.qm delete mode 100755 translations/ukui-menu_tr.qm delete mode 100755 translations/ukui-menu_zh_CN.qm diff --git a/debian/changelog b/debian/changelog index d4eb1ea..7351f55 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +ukui-menu (3.1.1-ok4~0708) yangtze; urgency=medium + + * 调整全屏窗口初始化代码结构 + * 增加全屏开始菜单分类选择下拉按钮动画效果 + * 增加全屏开始菜单点击空白区域退出功能 + * 固定全屏电源右键菜单位置 + + -- lixueman Fri, 08 Jul 2022 11:25:23 +0800 + ukui-menu (3.1.1-ok4~0623) yangtze; urgency=medium * 调整QGuiApplication::platformName()调用时机 diff --git a/debian/control b/debian/control index f856670..b845cb7 100755 --- a/debian/control +++ b/debian/control @@ -20,8 +20,7 @@ Build-Depends: debhelper-compat (=12), libukui-common0, libukui-common-dev, libpeony-dev, - libkysdk-waylandhelper-dev, - libssl-dev + libkysdk-waylandhelper-dev Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: https://github.com/ukui/ukui-menu @@ -37,8 +36,7 @@ Depends: ${shlibs:Depends}, libqt5x11extras5, bamfdaemon, libkysdk-waylandhelper -Suggests:kylin-status-manager, - kylin-daq +Suggests:kylin-status-manager Description: Advanced ukui menu UKUI menu provides start menu development library and advanced graphical user interface. diff --git a/src/BackProcess/BuriedPoint/buriedpointdatasend.cpp b/src/BackProcess/BuriedPoint/buriedpointdatasend.cpp deleted file mode 100644 index a35411f..0000000 --- a/src/BackProcess/BuriedPoint/buriedpointdatasend.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include "buriedpointdatasend.h" -#include -#include -#include -#include -#include -#include -#include - -Q_GLOBAL_STATIC(BuriedPointDataSend, buriedPointDataSend) - -BuriedPointDataSend::BuriedPointDataSend() -{ - QString path = QDir::homePath() + "/.config/ukui/menuUploadMessage/"; -// m_sendDataInterface = new KUploadMessage(getpid()); -// m_sendDataInterface->initUploadInterface("ukui-menu", "menuData", path); -} - -BuriedPointDataSend::~BuriedPointDataSend() -{ -// if (m_sendDataInterface != nullptr) { -// delete m_sendDataInterface; -// m_sendDataInterface = nullptr; -// } -} - -BuriedPointDataSend *BuriedPointDataSend::getInstance() -{ - return buriedPointDataSend(); -} - -QString BuriedPointDataSend::getCurrentTime() -{ - QString tempDateTimeStr; - QDateTime tempDateTime = QDateTime::currentDateTime().toTimeZone(QTimeZone(8 * 3600)); - tempDateTimeStr = tempDateTime.toString("yyyy-MM-dd HH:mm:ss.zzz"); - return tempDateTimeStr; -} - -void BuriedPointDataSend::setPoint(const pointDataStruct &data) -{ -// int curNum = 1; -// QStringList applist = QStringList(); -// QString keyValue = data.module + data.function; - -// if (m_functionCount.keys().contains(keyValue)) { -// curNum = m_functionCount.value(keyValue); -// curNum ++; -// } - -// m_functionCount.insert(keyValue, curNum); - -// if (!data.otherFunction.isEmpty()) { -// if (m_applist.keys().contains(keyValue)) { -// applist = m_applist.value(keyValue); -// } - -// applist.append(data.otherFunction.at(0)); -// m_applist.insert(keyValue, applist); -// } - -// QString time = getCurrentTime(); -// QJsonObject jsonObj; -// QJsonArray otherFunction = QJsonArray::fromStringList(data.otherFunction); -// jsonObj.insert("module", QJsonValue(data.module)); -// jsonObj.insert("function", QJsonValue(data.function)); -// jsonObj.insert("functionNum", QJsonValue(QString::number(curNum))); -// jsonObj.insert("otherFunction", otherFunction); -// jsonObj.insert("errorLevel", QJsonValue(data.errorLevel)); -// jsonObj.insert("errorOutput", QJsonValue(data.errorOutput)); -// jsonObj.insert("createTimeStamp", QJsonValue(time));//注意该字段名称不能修改,否则会报invalid -// // 将数据转化为QString -// QString informationData(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact)); -// qDebug() << "jsonObj:" << jsonObj; -// m_sendDataInterface->uploadMessage(informationData); -} - - diff --git a/src/BackProcess/BuriedPoint/buriedpointdatasend.h b/src/BackProcess/BuriedPoint/buriedpointdatasend.h deleted file mode 100644 index 55aa510..0000000 --- a/src/BackProcess/BuriedPoint/buriedpointdatasend.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef BURIEDPOINTDATASEND_H -#define BURIEDPOINTDATASEND_H - -#include -#include -#include -#include "src/UtilityFunction/utility.h" -#include "unistd.h" -//#include "kuploadmessage.h" - -class BuriedPointDataSend : public QObject -{ - Q_OBJECT -public: - BuriedPointDataSend(); - ~BuriedPointDataSend(); - - static BuriedPointDataSend *getInstance(); - - void setPoint(const pointDataStruct &data); - -private: - QString getCurrentTime(); - QHash m_functionCount; - QHash m_applist; -// KUploadMessage *m_sendDataInterface = nullptr; -}; - -#endif // BURIEDPOINTDATASEND_H diff --git a/src/BackProcess/backprocess.pri b/src/BackProcess/backprocess.pri index 929a1a9..060c9d4 100755 --- a/src/BackProcess/backprocess.pri +++ b/src/BackProcess/backprocess.pri @@ -25,8 +25,7 @@ HEADERS += \ $$PWD/Search/searchappthread.h \ $$PWD/XEventMonitor/xeventmonitor.h \ $$PWD/tablet/getmodeldata.h \ - $$PWD/tablet/pagemanager.h \ - $$PWD/BuriedPoint/buriedpointdatasend.h + $$PWD/tablet/pagemanager.h SOURCES += \ $$PWD/DBus/dbus-adaptor.cpp \ @@ -43,8 +42,7 @@ SOURCES += \ $$PWD/Search/searchappthread.cpp \ $$PWD/XEventMonitor/xeventmonitor.cpp \ $$PWD/tablet/getmodeldata.cpp \ - $$PWD/tablet/pagemanager.cpp \ - $$PWD/BuriedPoint/buriedpointdatasend.cpp + $$PWD/tablet/pagemanager.cpp INCLUDEPATH += $$PWD/../ diff --git a/src/QtSingleApplication/qtsingleapplication.cpp b/src/QtSingleApplication/qtsingleapplication.cpp index 961677e..e3ba444 100755 --- a/src/QtSingleApplication/qtsingleapplication.cpp +++ b/src/QtSingleApplication/qtsingleapplication.cpp @@ -347,16 +347,19 @@ QWidget *QtSingleApplication::activationWindow() const void QtSingleApplication::activateWindow() { if (actWin) { + myDebug() << "单例触发activateWindow"; if (!g_projectCodeName.contains("V10SP1-edu")) { MainWindow *w = qobject_cast(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(); } diff --git a/src/UserInterface/ListView/fulllistview.cpp b/src/UserInterface/ListView/fulllistview.cpp index 3206c8a..17124b8 100755 --- a/src/UserInterface/ListView/fulllistview.cpp +++ b/src/UserInterface/ListView/fulllistview.cpp @@ -52,6 +52,7 @@ void FullListView::initWidget() this->setMouseTracking(true); this->setMovement(QListView::Static); this->setEditTriggers(QAbstractItemView::NoEditTriggers); + setItemAlignment(Qt::AlignCenter); this->setGridSize(QSize(Style::m_applistGridSizeWidth, Style::m_applistGridSizeWidth)); this->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu); this->setFrameShape(QFrame::NoFrame);//移除边框 diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp index 012b52a..b927ba2 100755 --- a/src/UserInterface/ListView/klistview.cpp +++ b/src/UserInterface/ListView/klistview.cpp @@ -60,22 +60,30 @@ void KListView::paintEvent(QPaintEvent *e) QListView::paintEvent(e); } +void KListView::mouseMoveEvent(QMouseEvent *e) +{ + this->clearFocus(); +} + void KListView::mousePressEvent(QMouseEvent *event) { if (!(this->indexAt(event->pos()).isValid()) && event->button() == Qt::LeftButton) { Q_EMIT sendHideMainWindowSignal(); } else { pressApp = listmodel->data(this->indexAt(event->pos()), Qt::DisplayRole); - return QListView::mousePressEvent(event); } + return QListView::mousePressEvent(event); } void KListView::rightClickedSlot(const QPoint &pos) { - Q_UNUSED(pos) - if (!(this->selectionModel()->selectedIndexes().isEmpty())) { - QModelIndex index = this->currentIndex(); + + QModelIndex index = indexAt(pos); + if(!index.isValid()) { + return; + } + QVariant var = listmodel->data(index, Qt::DisplayRole); QStringList strlist = var.value(); diff --git a/src/UserInterface/ListView/klistview.h b/src/UserInterface/ListView/klistview.h index 1d86cce..e932fd2 100755 --- a/src/UserInterface/ListView/klistview.h +++ b/src/UserInterface/ListView/klistview.h @@ -23,6 +23,7 @@ public: protected: void paintEvent(QPaintEvent *e); void mousePressEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *e); public: void addData(QStringList data); void updateData(QStringList data); diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp index ff6b421..78ed0a3 100755 --- a/src/UserInterface/ListView/listview.cpp +++ b/src/UserInterface/ListView/listview.cpp @@ -21,7 +21,6 @@ #include "utility.h" #include #include -#include "buriedpointdatasend.h" ListView::ListView(QWidget *parent/*, int width, int height, int module*/): KListView(parent) @@ -109,12 +108,7 @@ void ListView::onClicked(QModelIndex index) Q_EMIT sendAppClassificationBtnClicked(); } else { execApp(desktopfp); - pointDataStruct pointData; - pointData.module = "mainWindow/execApplication"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - pointData.otherFunction.append(desktopfp); - BuriedPointDataSend::getInstance()->setPoint(pointData); + Q_EMIT sendHideMainWindowSignal(); } } } diff --git a/src/UserInterface/ListView/rightlistview.cpp b/src/UserInterface/ListView/rightlistview.cpp index e8dec33..7725222 100755 --- a/src/UserInterface/ListView/rightlistview.cpp +++ b/src/UserInterface/ListView/rightlistview.cpp @@ -44,7 +44,7 @@ void RightListView::initWidget() viewport()->setAutoFillBackground(false); this->setSelectionMode(QAbstractItemView::SingleSelection); this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + this->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); this->setViewMode(QListView::IconMode); this->setContextMenuPolicy(Qt::CustomContextMenu); this->setResizeMode(QListView::Adjust); @@ -52,8 +52,9 @@ void RightListView::initWidget() this->setMouseTracking(true); this->setMovement(QListView::Static); this->setEditTriggers(QAbstractItemView::NoEditTriggers); - this->setGridSize(QSize(107, 107)); + this->setGridSize(QSize(105, 105)); this->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu); + this->verticalScrollBar()->setProperty("drawScrollBarGroove", false); this->setFrameShape(QFrame::NoFrame);//移除边框 connect(this, &RightListView::customContextMenuRequested, this, &RightListView::rightClickedSlot); connect(this, &RightListView::clicked, this, &RightListView::onClicked); @@ -92,6 +93,18 @@ void RightListView::selectFirstItem() void RightListView::paintEvent(QPaintEvent *e) { + //滚动条 + QPalette p = this->verticalScrollBar()->palette(); + QColor color; + + if (g_curStyle == "ukui-dark") { + color = QColor("#26FFFFFF"); + } else { + color = QColor("#1A000000"); + } + + p.setColor(QPalette::Active, QPalette::Button, color); + this->verticalScrollBar()->setPalette(p); QListView::paintEvent(e); } @@ -113,6 +126,17 @@ void RightListView::keyPressEvent(QKeyEvent *e) } } +void RightListView::onClicked(QModelIndex index) +{ + Q_EMIT sendHideMainWindowSignal(); + QVariant var = listmodel->data(index, Qt::DisplayRole); + QString desktopfp = var.value().at(0); + if (var.isValid()) { + QString desktopfp = var.value(); + execApp(desktopfp); + } +} + void RightListView::changeStyleColor(const QColor &color) { m_styleColor = color; @@ -122,4 +146,11 @@ void RightListView::enterEvent(QEvent *e) { Q_UNUSED(e); this->selectionModel()->clear(); + this->verticalScrollBar()->setVisible(true); +} + +void RightListView::leaveEvent(QEvent *e) +{ + Q_UNUSED(e); + this->verticalScrollBar()->setVisible(false); } diff --git a/src/UserInterface/ListView/rightlistview.h b/src/UserInterface/ListView/rightlistview.h index c75e0cc..b09c361 100755 --- a/src/UserInterface/ListView/rightlistview.h +++ b/src/UserInterface/ListView/rightlistview.h @@ -27,6 +27,7 @@ protected: void dropEvent(QDropEvent *event); void enterEvent(QEvent *e); void paintEvent(QPaintEvent *e); + void leaveEvent(QEvent *e); private: RightClickMenu *menu = nullptr; //右键菜单 @@ -42,6 +43,7 @@ public Q_SLOTS: // void rightClickedSlot(const QPoint &pos);//右键菜单 void selectFirstItem(); void changeStyleColor(const QColor &color); + void onClicked(QModelIndex index); Q_SIGNALS: diff --git a/src/UserInterface/RightClickMenu/rightclickmenu.cpp b/src/UserInterface/RightClickMenu/rightclickmenu.cpp index 45f7b46..f274607 100755 --- a/src/UserInterface/RightClickMenu/rightclickmenu.cpp +++ b/src/UserInterface/RightClickMenu/rightclickmenu.cpp @@ -261,7 +261,7 @@ int RightClickMenu::showAppBtnMenu(const QPoint &pos, QString desktopfp) return m_actionNumber; } -int RightClickMenu::showShutdownMenu(const QPoint &pos) +int RightClickMenu::showShutdownMenu(const QPoint &pos, const bool &isFullWind) { m_actionNumber = 0; MenuBox m_showShutMenu; @@ -315,7 +315,12 @@ int RightClickMenu::showShutdownMenu(const QPoint &pos) m_showShutMenu.setAttribute(Qt::WA_TranslucentBackground); m_showShutMenu.setAttribute(Qt::WA_DeleteOnClose); m_showShutMenu.raise(); - m_showShutMenu.exec(pos); + if (isFullWind) { + m_showShutMenu.exec(QPoint(pos.x() - m_showShutMenu.sizeHint().width(), pos.y() - m_showShutMenu.sizeHint().height())); + } else { + m_showShutMenu.exec(pos); + } + myDebug() << "RightClickMenu::showShutdownMenu()"; return m_actionNumber; } diff --git a/src/UserInterface/RightClickMenu/rightclickmenu.h b/src/UserInterface/RightClickMenu/rightclickmenu.h index a96c65d..4075294 100755 --- a/src/UserInterface/RightClickMenu/rightclickmenu.h +++ b/src/UserInterface/RightClickMenu/rightclickmenu.h @@ -65,7 +65,7 @@ public: * @brief Displays the power right-click menu * @return return action number */ - int showShutdownMenu(const QPoint &pos); + int showShutdownMenu(const QPoint &pos, const bool &isFullWind); /** * @brief Displays other application right-click menus * @param desktopfp: Application desktop file diff --git a/src/UserInterface/ViewItem/full_item_delegate.cpp b/src/UserInterface/ViewItem/full_item_delegate.cpp index 9dc4076..5e5c358 100755 --- a/src/UserInterface/ViewItem/full_item_delegate.cpp +++ b/src/UserInterface/ViewItem/full_item_delegate.cpp @@ -42,7 +42,7 @@ void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti rect.setWidth(option.rect.width()); rect.setHeight(option.rect.height()); //QPainterPath画圆角矩形 - const qreal radius = 4; + const qreal radius = 26; QPainterPath path; path.moveTo(rect.topRight() - QPointF(radius, 0)); path.lineTo(rect.topLeft() + QPointF(radius, 0)); @@ -118,8 +118,8 @@ void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti QString appname = pUkuiMenuInterface->getAppName(desktopfp); QRect iconRect; QRect textRect; - iconRect = QRect(/*rect.x()+66*/rect.x() + (rect.width() - Style::AppListIconSize) / 2, - /*rect.y()+40*/rect.y() + 40, + iconRect = QRect(rect.x() + (rect.width() - Style::AppListIconSize) / 2, + rect.y() + 20, Style::AppListIconSize, Style::AppListIconSize); icon.paint(painter, iconRect); @@ -217,5 +217,5 @@ void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti QSize FullItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { - return QSize(/*Style::AppListItemSizeWidth*/220, /*Style::AppListItemSizeWidth*/220); + return QSize(Style::AppListItemSizeWidth, Style::AppListItemSizeWidth); } diff --git a/src/UserInterface/ViewItem/itemdelegate.cpp b/src/UserInterface/ViewItem/itemdelegate.cpp index aa7f169..7effecd 100755 --- a/src/UserInterface/ViewItem/itemdelegate.cpp +++ b/src/UserInterface/ViewItem/itemdelegate.cpp @@ -172,6 +172,11 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, if ((option.state & QStyle::State_MouseOver) || (option.state & QStyle::State_HasFocus)) { painter->drawPixmap(rect.width() - 25, rect.y() + 15, pixmap); + if (module == 1) { + QToolTip::showText(QCursor::pos(), tr("Open the function sort menu")); + } else if (module == 2) { + QToolTip::showText(QCursor::pos(), tr("Open the alphabetical menu")); + } } painter->restore(); diff --git a/src/UserInterface/ViewItem/right_item_delegate.cpp b/src/UserInterface/ViewItem/right_item_delegate.cpp index a67a6ca..b50de3d 100755 --- a/src/UserInterface/ViewItem/right_item_delegate.cpp +++ b/src/UserInterface/ViewItem/right_item_delegate.cpp @@ -18,10 +18,10 @@ void RightItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt if (index.isValid()) { QStyleOptionViewItem viewOption(option);//用来在视图中画一个item QRectF rect; - rect.setX(option.rect.x()); - rect.setY(option.rect.y()); - rect.setWidth(option.rect.width()); - rect.setHeight(option.rect.height()); + rect.setX(option.rect.x() + 1); + rect.setY(option.rect.y() + 1); + rect.setWidth(option.rect.width() - 2); + rect.setHeight(option.rect.height() - 2); //QPainterPath画圆角矩形 const qreal radius = 10; QPainterPath path; diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp index 5dd8db5..c02f317 100755 --- a/src/UserInterface/Widget/full_commonuse_widget.cpp +++ b/src/UserInterface/Widget/full_commonuse_widget.cpp @@ -20,7 +20,6 @@ #include #include "style.h" #include "utility.h" -#include "buriedpointdatasend.h" #include FullCommonUseWidget::FullCommonUseWidget(QWidget *parent) : @@ -132,23 +131,14 @@ void FullCommonUseWidget::initVerticalScrollBar() void FullCommonUseWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); - pointDataStruct pointData; - pointData.module = "fullWindow/commonUseWidget/powerOffButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullCommonUseWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) { + Q_UNUSED(pos); RightClickMenu m_otherMenu(this); - m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); + m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(QPoint(0, 45)), true); myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; - pointDataStruct pointData; - pointData.module = "fullWindow/commonUseWidget/powerOffButton"; - pointData.function = "RightClicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullCommonUseWidget::initAppListWidget() @@ -201,12 +191,6 @@ void FullCommonUseWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); - pointDataStruct pointData; - pointData.module = "fullWindow/commonUseWidget/execApplication"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - pointData.otherFunction[0] = desktopfp; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullCommonUseWidget::selectFirstItem() diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp index 55ed6c0..253f210 100755 --- a/src/UserInterface/Widget/full_function_widget.cpp +++ b/src/UserInterface/Widget/full_function_widget.cpp @@ -23,7 +23,6 @@ #include #include #include -#include "buriedpointdatasend.h" FullFunctionWidget::FullFunctionWidget(QWidget *parent) : QWidget(parent) @@ -152,23 +151,14 @@ void FullFunctionWidget::initVerticalScrollBar() void FullFunctionWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); - pointDataStruct pointData; - pointData.module = "fullWindow/FullFunctionWidget/powerOffButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullFunctionWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) { + Q_UNUSED(pos); RightClickMenu m_otherMenu(this); - m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); + m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(QPoint(0, 45)), true); myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; - pointDataStruct pointData; - pointData.module = "fullWindow/FullFunctionWidget/powerOffButton"; - pointData.function = "RightClicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } @@ -229,12 +219,6 @@ void FullFunctionWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); - pointDataStruct pointData; - pointData.module = "fullWindow/FullFunctionWidget/execApplication"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - pointData.otherFunction[0] = desktopfp; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullFunctionWidget::on_setAreaScrollBarValue(int value) @@ -248,6 +232,8 @@ void FullFunctionWidget::on_setAreaScrollBarValue(int value) */ void FullFunctionWidget::updateAppListView() { + disconnect(m_scrollArea->verticalScrollBar(), &QScrollBar::valueChanged, + this, &FullFunctionWidget::valueChangedSlot); //刷新应用列表界面 QLayoutItem *child; diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp index 353cbef..96daac2 100755 --- a/src/UserInterface/Widget/full_letter_widget.cpp +++ b/src/UserInterface/Widget/full_letter_widget.cpp @@ -19,7 +19,6 @@ #include "full_letter_widget.h" #include #include -#include "buriedpointdatasend.h" FullLetterWidget::FullLetterWidget(QWidget *parent) : QWidget(parent) @@ -146,23 +145,14 @@ void FullLetterWidget::initVerticalScrollBar() void FullLetterWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); - pointDataStruct pointData; - pointData.module = "fullWindow/FullLetterWidget/powerOffButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullLetterWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) { + Q_UNUSED(pos); RightClickMenu m_otherMenu(this); - m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); + m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(QPoint(0, 45)), true); qDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; - pointDataStruct pointData; - pointData.module = "fullWindow/FullLetterWidget/powerOffButton"; - pointData.function = "RightClicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullLetterWidget::setFocusToThis() @@ -233,12 +223,6 @@ void FullLetterWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); - pointDataStruct pointData; - pointData.module = "fullWindow/FullLetterWidget/execApplication"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - pointData.otherFunction[0] = desktopfp; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullLetterWidget::on_setAreaScrollBarValue(int value) @@ -252,6 +236,8 @@ void FullLetterWidget::on_setAreaScrollBarValue(int value) */ void FullLetterWidget::updateAppListView() { + disconnect(m_scrollArea->verticalScrollBar(), &QScrollBar::valueChanged, + this, &FullLetterWidget::valueChangedSlot); //刷新应用列表界面 QLayoutItem *child; diff --git a/src/UserInterface/Widget/full_searchresult_widget.cpp b/src/UserInterface/Widget/full_searchresult_widget.cpp index 259986b..be5dd6b 100755 --- a/src/UserInterface/Widget/full_searchresult_widget.cpp +++ b/src/UserInterface/Widget/full_searchresult_widget.cpp @@ -20,7 +20,6 @@ #include "style.h" #include "utility.h" #include -#include "buriedpointdatasend.h" FullSearchResultWidget::FullSearchResultWidget(QWidget *parent) : QWidget(parent) @@ -121,23 +120,14 @@ void FullSearchResultWidget::initVerticalScrollBar() void FullSearchResultWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); - pointDataStruct pointData; - pointData.module = "fullWindow/FullSearchResultWidget/powerOffButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullSearchResultWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) { + Q_UNUSED(pos); RightClickMenu m_otherMenu(this); - m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); + m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(QPoint(0, 45)), true); myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; - pointDataStruct pointData; - pointData.module = "fullWindow/FullSearchResultWidget/powerOffButton"; - pointData.function = "RightClicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullSearchResultWidget::initAppListWidget() @@ -164,12 +154,6 @@ void FullSearchResultWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); - pointDataStruct pointData; - pointData.module = "fullWindow/FullLetterWidget/execApplication"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - pointData.otherFunction[0] = desktopfp; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullSearchResultWidget::updateAppListView(QVector arg) @@ -241,11 +225,7 @@ void FullSearchResultWidget::selectFirstItemTab() void FullSearchResultWidget::repaintWidget() { m_scrollArea->setFixedSize(Style::m_applistWidWidth, Style::m_applistWidHeight); - m_scrollAreaWidLayout->removeWidget(m_listView); - m_listView->setParent(nullptr); - delete m_listView; - initAppListWidget(); - fillAppList(); + resizeScrollAreaControls(); m_scrollAreaWidHeight = m_scrollAreaWid->height() + 1; initVerticalScrollBar(); } diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp index 5e63110..4e6ea9a 100755 --- a/src/UserInterface/full_mainwindow.cpp +++ b/src/UserInterface/full_mainwindow.cpp @@ -3,7 +3,6 @@ #include #include #include "utility.h" -#include "buriedpointdatasend.h" FullMainWindow::FullMainWindow(QWidget *parent) : QMainWindow(parent) @@ -11,12 +10,24 @@ FullMainWindow::FullMainWindow(QWidget *parent) : this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint); this->setAttribute(Qt::WA_TranslucentBackground, true); this->setAutoFillBackground(false); - m_searchAppThread = new SearchAppThread; Style::initWidStyle(); - m_buttonStyle = QString("%1{border-radius:24px; background: rgba(255, 255, 255, 0.1);}" - "%1:hover {border-radius:24px; background: rgba(255, 255, 255, 0.2);}" - "%1:pressed {border-radius:24px; background: rgba(255, 255, 255, 0.3);}"); this->setFixedSize(Style::m_availableScreenWidth, Style::m_availableScreenHeight); + initLayout(); + initSearchUI(); + initButtonUI(); + initAppListUI(); + initMenu(); + initTabOrder(); + changeStyle(); + initConnect(); +} + +FullMainWindow::~FullMainWindow() +{ +} + +void FullMainWindow::initLayout() +{ centralwidget = new QWidget(this); verticalLayout = new QVBoxLayout(centralwidget); verticalLayout->setSpacing(0); @@ -28,6 +39,45 @@ FullMainWindow::FullMainWindow(QWidget *parent) : bottomHorizonLayout = new QHBoxLayout(); bottomHorizonLayout->setSpacing(0); bottomHorizonLayout->setContentsMargins(0, 0, 0, 0); +} + +void FullMainWindow::initButtonUI() +{ + m_buttonStyle = QString("%1{border-radius:24px; background: rgba(255, 255, 255, 0.1);}" + "%1:hover {border-radius:24px; background: rgba(255, 255, 255, 0.2);}" + "%1:pressed {border-radius:24px; background: rgba(255, 255, 255, 0.3);}"); + m_lineEdit->setFocusPolicy(Qt::StrongFocus); + horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + m_fullSelectToolButton = new QPushButton(centralwidget); +// fullSelectToolButton->setStyleSheet(m_buttonStyle.arg("QToolButton")); + m_fullSelectToolButton->setObjectName(QString::fromUtf8("fullSelectToolButton")); + m_fullSelectToolButton->setMinimumSize(QSize(48, 48)); + m_fullSelectToolButton->installEventFilter(this); + m_fullSelectToolButton->setFocus(); + QIcon selectIcon; + selectIcon.addFile(QString::fromUtf8(":/data/img/mainviewwidget/full-function.svg"), QSize(), QIcon::Normal, QIcon::Off); + m_fullSelectToolButton->setIcon(selectIcon); + + m_fullSelectMenuButton = new RotationLabel(this); + m_fullSelectMenuButton->installEventFilter(this); + m_fullSelectMenuButton->setStyleSheet("background: transparent;"); + 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")); + QPalette palete; + palete.setColor(QPalette::NoRole, Qt::white); + m_fullSelectMenuButton->setPalette(palete); + m_minPushButton = new QPushButton(centralwidget); + m_minPushButton->setObjectName(QString::fromUtf8("minPushButton")); + m_minPushButton->setFixedSize(QSize(48, 48)); + m_minPushButton->setFlat(true); + m_minPushButton->installEventFilter(this); +} + +void FullMainWindow::initSearchUI() +{ + m_searchAppThread = new SearchAppThread; m_lineEdit = new QLineEdit(centralwidget); m_lineEdit->setFixedSize(QSize(372, 36)); m_lineEdit->setLayoutDirection(Qt::LeftToRight); @@ -89,34 +139,10 @@ FullMainWindow::FullMainWindow(QWidget *parent) : queryWidLayout->addWidget(m_queryIcon); queryWidLayout->addWidget(m_queryText); queryWidLayout->setAlignment(Qt::AlignCenter); - m_lineEdit->setFocusPolicy(Qt::StrongFocus); - horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - fullSelectToolButton = new QPushButton(centralwidget); -// fullSelectToolButton->setStyleSheet(m_buttonStyle.arg("QToolButton")); - fullSelectToolButton->setObjectName(QString::fromUtf8("fullSelectToolButton")); - fullSelectToolButton->setMinimumSize(QSize(48, 48)); - fullSelectToolButton->installEventFilter(this); - fullSelectToolButton->setFocus(); - QIcon selectIcon; - selectIcon.addFile(QString::fromUtf8(":/data/img/mainviewwidget/full-function.svg"), QSize(), QIcon::Normal, QIcon::Off); - fullSelectToolButton->setIcon(selectIcon); - fullSelectMenuButton = new QToolButton(centralwidget); - QIcon menuBottonIcon; - fullSelectMenuButton->setStyleSheet("QToolButton{background:transparent;}"); - fullSelectMenuButton->setProperty("useIconHighlightEffect", 0x0); - fullSelectMenuButton->setFixedSize(20, 20); - fullSelectMenuButton->setObjectName(QString::fromUtf8("fullSelectMenuButton")); - fullSelectMenuButton->setPopupMode(QToolButton::InstantPopup); - fullSelectMenuButton->setToolButtonStyle(Qt::ToolButtonIconOnly); - fullSelectMenuButton->installEventFilter(this); - QPalette palete; - palete.setColor(QPalette::NoRole, Qt::white); - fullSelectMenuButton->setPalette(palete); - minPushButton = new QPushButton(centralwidget); - minPushButton->setObjectName(QString::fromUtf8("minPushButton")); - minPushButton->setFixedSize(QSize(48, 48)); - minPushButton->setFlat(true); - minPushButton->installEventFilter(this); +} + +void FullMainWindow::initAppListUI() +{ m_fullStackedWidget = new QStackedWidget(centralwidget); m_fullCommonPage = new FullCommonUseWidget(m_fullStackedWidget); m_fullStackedWidget->addWidget(m_fullCommonPage); @@ -131,38 +157,48 @@ FullMainWindow::FullMainWindow(QWidget *parent) : topHorizontalLayout->addItem(horizontalSpacer); topHorizontalLayout->addWidget(m_lineEdit); topHorizontalLayout->addItem(horizontalSpacer_2); - topHorizontalLayout->addWidget(fullSelectToolButton); - topHorizontalLayout->addWidget(fullSelectMenuButton); - topHorizontalLayout->addWidget(minPushButton); + topHorizontalLayout->addWidget(m_fullSelectToolButton); + topHorizontalLayout->addWidget(m_fullSelectMenuButton); + topHorizontalLayout->addWidget(m_minPushButton); verticalLayout->addLayout(topHorizontalLayout); verticalLayout->addLayout(bottomHorizonLayout); this->setCentralWidget(centralwidget); m_fullStackedWidget->setCurrentIndex(0); - m_menu = new QMenu; - m_allAction = new QAction(m_menu); - m_letterAction = new QAction(m_menu); - m_funcAction = new QAction(m_menu); +} + +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); m_allAction->setText(tr("All")); m_allAction->setCheckable(true); m_letterAction->setText(tr("Letter")); m_letterAction->setCheckable(true); m_funcAction->setText(tr("Function")); m_funcAction->setCheckable(true); - m_menu->addAction(m_allAction); - m_menu->addAction(m_letterAction); - m_menu->addAction(m_funcAction); + m_dropDownMenu->addAction(m_allAction); + m_dropDownMenu->addAction(m_letterAction); + m_dropDownMenu->addAction(m_funcAction); m_allAction->setChecked(true); - fullSelectMenuButton->setMenu(m_menu); - setTabOrder(m_lineEdit, fullSelectToolButton); - setTabOrder(fullSelectToolButton, fullSelectMenuButton); - setTabOrder(fullSelectMenuButton, minPushButton); - changeStyle(); +} + +void FullMainWindow::initTabOrder() +{ + setTabOrder(m_lineEdit, m_fullSelectToolButton); + setTabOrder(m_fullSelectToolButton, m_fullSelectMenuButton); + setTabOrder(m_fullSelectMenuButton, m_minPushButton); +} + +void FullMainWindow::initConnect() +{ connect(m_lineEdit, &QLineEdit::textChanged, this, &FullMainWindow::searchAppSlot); connect(this, &FullMainWindow::sendSearchKeyword, m_searchAppThread, &SearchAppThread::recvSearchKeyword); connect(m_searchAppThread, &SearchAppThread::sendSearchResult, this, &FullMainWindow::recvSearchResult); - connect(minPushButton, &QPushButton::clicked, this, &FullMainWindow::on_minPushButton_clicked); - connect(fullSelectToolButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectToolButton_clicked); - connect(fullSelectMenuButton, &QToolButton::triggered, this, &FullMainWindow::on_fullSelectMenuButton_triggered); + connect(m_minPushButton, &QPushButton::clicked, this, &FullMainWindow::on_minPushButton_clicked); + connect(m_fullSelectToolButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectToolButton_clicked); connect(m_fullFunctionPage, &FullFunctionWidget::setFocusToSideWin, this, &FullMainWindow::setFocusToButton); connect(m_fullLetterPage, &FullLetterWidget::setFocusToSideWin, this, &FullMainWindow::setFocusToButton); connect(m_fullCommonPage, &FullCommonUseWidget::setFocusToSideWin, this, &FullMainWindow::setFocusToButton); @@ -171,12 +207,15 @@ FullMainWindow::FullMainWindow(QWidget *parent) : connect(this, &FullMainWindow::sendSetFocusToLet, m_fullLetterPage, &FullLetterWidget::setFocusToThis); connect(this, &FullMainWindow::sendSetFocusToFun, m_fullFunctionPage, &FullFunctionWidget::setFocusToThis); connect(this, &FullMainWindow::sendSetFocusToResult, m_fullResultPage, &FullSearchResultWidget::selectFirstItemTab); - connect(fullSelectMenuButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectMenuButton_clicked); +// connect(m_fullSelectMenuButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectMenuButton_clicked); connect(m_fullCommonPage, &FullCommonUseWidget::sendUpdateOtherView, this, &FullMainWindow::sendUpdateOtherView); -} - -FullMainWindow::~FullMainWindow() -{ + 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_dropDownMenu, &MenuBox::triggered, this, &FullMainWindow::on_fullSelectMenuButton_triggered); + connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() { + selectIconAnimation(false); + }); } void FullMainWindow::updateView() @@ -217,20 +256,15 @@ void FullMainWindow::changeStyle() m_buttonStyle = QString("%1{border-radius:24px; background:" + buttonColorDefault + ";}" "%1:hover {border-radius:24px; background:" + buttonColorHover + ";}" "%1:pressed {border-radius:24px; background:" + buttonColorPress + ";}"); - fullSelectToolButton->setStyleSheet(m_buttonStyle.arg("QPushButton")); - fullSelectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/full-drop-down.svg", false)); - minPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/full-min.svg", false)); - minPushButton->setProperty("useIconHighlightEffect", 0x0); + 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); } void FullMainWindow::on_minPushButton_clicked() { Q_EMIT showNormalWindow(); - pointDataStruct pointData; - pointData.module = "fullWindow/minPushButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullMainWindow::paintEvent(QPaintEvent *event) @@ -252,15 +286,10 @@ void FullMainWindow::paintEvent(QPaintEvent *event) bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) { if (watched == m_lineEdit) { - isSearching = true; + m_isSearching = true; char style[200]; if (event->type() == QEvent::FocusIn) { - pointDataStruct pointData; - pointData.module = "fullWindow/Search"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); sprintf(style, "QLineEdit{border:2px solid %s;background-color:%s;border-radius:17px;color:#ffffff;}", QueryLineEditClickedBorder, QueryLineEditClickedBackground); m_lineEdit->setStyleSheet(style); @@ -293,7 +322,7 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) } } - if (watched == minPushButton) { + if (watched == m_minPushButton) { if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = (QKeyEvent *)event; @@ -313,7 +342,7 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) } } - if (watched == minPushButton || watched == fullSelectToolButton || watched == fullSelectMenuButton) { + if (watched == m_minPushButton || watched == m_fullSelectToolButton || watched == m_fullSelectMenuButton) { if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = (QKeyEvent *)event; @@ -324,15 +353,60 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) } } + if (watched == m_fullSelectMenuButton) { + if (event->type() == QEvent::MouseButtonPress) { + selectIconAnimation(true); + return true; + } + } + return QWidget::eventFilter(watched, event); } +void FullMainWindow::iconAnimationFinished() +{ + m_dropDownMenu->raise(); + m_dropDownMenu->exec(m_fullSelectMenuButton->mapToGlobal(QPoint(m_fullSelectMenuButton->width() + -Style::DropMenuWidth, 45))); +} + +void FullMainWindow::selectIconAnimation(const bool &flag) +{ + iconAnimation = new QPropertyAnimation(m_fullSelectMenuButton, "rotation", this); + + if (flag) { + connect(iconAnimation, &QPropertyAnimation::finished, this, &FullMainWindow::iconAnimationFinished); + + if (m_fullSelectMenuButton->property("rotation") == 0) { + iconAnimation->setStartValue(0); + iconAnimation->setEndValue(-180); + } + } else { + if (m_fullSelectMenuButton->property("rotation") == -180) { + iconAnimation->setStartValue(-180); + iconAnimation->setEndValue(0); + } + } + + iconAnimation->setEasingCurve(QEasingCurve::Linear); + iconAnimation->setDuration(300); + iconAnimation->start(QPropertyAnimation::DeleteWhenStopped); +} + +void FullMainWindow::fullWindowHide() +{ + this->hide(); +} + void FullMainWindow::resetEditline() { m_lineEdit->clear(); m_lineEdit->clearFocus(); - m_queryWid->layout()->addWidget(m_queryIcon); - m_queryWid->layout()->addWidget(m_queryText); + m_fullSelectToolButton->setFocus(); + if (m_queryWid->layout()->children().isEmpty()) { + m_queryWid->layout()->addWidget(m_queryIcon); + m_queryWid->layout()->addWidget(m_queryText); + } m_queryIcon->adjustSize(); m_queryText->adjustSize(); m_queryWid->layout()->setAlignment(Qt::AlignCenter); @@ -357,10 +431,10 @@ bool FullMainWindow::event(QEvent *event) QKeyEvent *keyEvent = (QKeyEvent *) event; if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) { - if (fullSelectToolButton->hasFocus()) { - fullSelectToolButton->click(); - } else if (fullSelectMenuButton->hasFocus()) { - fullSelectMenuButton->click(); + if (m_fullSelectToolButton->hasFocus()) { + m_fullSelectToolButton->click(); + } else if (m_fullSelectMenuButton->hasFocus()) { + QApplication::postEvent(m_fullSelectMenuButton, new QEvent(QEvent::MouseButtonPress)); } if (m_lineEdit->hasFocus()) { @@ -406,6 +480,9 @@ void FullMainWindow::searchAppSlot(QString arg) void FullMainWindow::mousePressEvent(QMouseEvent *event) { resetEditline(); + if (event->button() == Qt::LeftButton) { + this->hide(); + } return QMainWindow::mousePressEvent(event); } @@ -418,7 +495,8 @@ void FullMainWindow::recvSearchResult(QVector arg) void FullMainWindow::on_fullSelectToolButton_clicked() { resetEditline(); - fullSelectToolButton->setFocus(); + m_fullSelectToolButton->setFocus(); + selectIconAnimation(false); if (m_fullStackedWidget->currentIndex() == 0) { on_fullSelectMenuButton_triggered(m_letterAction); @@ -436,45 +514,33 @@ void FullMainWindow::on_fullSelectMenuButton_clicked() void FullMainWindow::on_fullSelectMenuButton_triggered(QAction *arg1) { - pointDataStruct pointData; + selectIconAnimation(false); if (arg1 == m_allAction) { m_fullStackedWidget->setCurrentIndex(0); m_fullCommonPage->repaintWidget(); //fullCommonPage->updateListView(); m_state = 0; - fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-all-2x.png")); + m_fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-all-2x.png")); m_allAction->setChecked(true); m_letterAction->setChecked(false); m_funcAction->setChecked(false); - pointData.module = "fullWindow/fullSelectMenuButton"; - pointData.function = "AllSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_letterAction) { m_fullStackedWidget->setCurrentIndex(1); m_fullLetterPage->repaintWidget(); m_state = 1; - fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-letter.svg")); + m_fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-letter.svg")); m_allAction->setChecked(false); m_letterAction->setChecked(true); m_funcAction->setChecked(false); - pointData.module = "fullWindow/fullSelectMenuButton"; - pointData.function = "letterSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_funcAction) { m_fullStackedWidget->setCurrentIndex(2); m_fullFunctionPage->repaintWidget(); m_state = 2; - fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-function.svg")); + m_fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-function.svg")); m_allAction->setChecked(false); m_letterAction->setChecked(false); m_funcAction->setChecked(true); - pointData.module = "fullWindow/fullSelectMenuButton"; - pointData.function = "FunctionSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } } diff --git a/src/UserInterface/full_mainwindow.h b/src/UserInterface/full_mainwindow.h index 3e41bb9..34a91ca 100755 --- a/src/UserInterface/full_mainwindow.h +++ b/src/UserInterface/full_mainwindow.h @@ -12,6 +12,7 @@ #include "full_letter_widget.h" #include "searchappthread.h" #include "full_searchresult_widget.h" +#include "rotationlabel.h" class FullMainWindow : public QMainWindow { @@ -44,6 +45,7 @@ private Q_SLOTS: void recvSearchResult(QVector arg); void setFocusToButton(); void on_fullSelectMenuButton_clicked(); + void fullWindowHide(); protected: @@ -52,6 +54,15 @@ protected: bool eventFilter(QObject *watched, QEvent *event); void mousePressEvent(QMouseEvent *event); void changeStyle(); + void initConnect(); + void initTabOrder(); + void initMenu(); + void initAppListUI(); + void initSearchUI(); + void initButtonUI(); + void initLayout(); + void selectIconAnimation(const bool &flag); + void iconAnimationFinished(); private: QAction *m_allAction = nullptr; @@ -66,9 +77,9 @@ private: QSpacerItem *horizontalSpacer; QLineEdit *m_lineEdit; QSpacerItem *horizontalSpacer_2; - QPushButton *fullSelectToolButton; - QToolButton *fullSelectMenuButton; - QPushButton *minPushButton; + QPushButton *m_fullSelectToolButton; + RotationLabel *m_fullSelectMenuButton; + QPushButton *m_minPushButton; QStackedWidget *m_fullStackedWidget; FullCommonUseWidget *m_fullCommonPage; @@ -81,8 +92,10 @@ private: QWidget *m_queryWid = nullptr; QLabel *m_queryIcon = nullptr; QLabel *m_queryText = nullptr; - bool isSearching = false; + bool m_isSearching = false; QString m_buttonStyle; + QPropertyAnimation *iconAnimation = nullptr; + MenuBox *m_dropDownMenu = nullptr; }; #endif // FULLMAINWINDOW_H diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 984d9f0..d65d221 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -33,7 +33,6 @@ #include #include #include -#include "buriedpointdatasend.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) @@ -52,6 +51,235 @@ MainWindow::MainWindow(QWidget *parent) : m_mainLeftVerticalLayout = new QVBoxLayout(m_viewWidget); m_mainLeftVerticalLayout->setSpacing(9); m_mainLeftVerticalLayout->setContentsMargins(8, 15, 4, 0); + + initSearchUi(); + initLeftWidget(); + initRightWidgetButton(); + initCollectWidget(); + initRecentWidget(); + initTabOrder(); + + m_softwareDbThread = new SoftwareDatabaseUpdateThread; + m_animationPage = new AnimationPage(); + m_maxAnimation = new QPropertyAnimation(m_animationPage, "geometry", this); + m_minAnimation = new QPropertyAnimation(m_animationPage, "geometry", this); + m_searchAppThread = new SearchAppThread; + m_functionBtnWid = new FunctionButtonWidget(m_minFuncPage); + m_functionBtnWid->hide(); + m_letterBtnWid = new LetterButtonWidget(m_minLetterPage); + m_letterBtnWid->hide(); + m_enterAnimation = new QPropertyAnimation; + m_enterAnimation->setPropertyName(QString("geometry").toLocal8Bit()); + m_leaveAnimation = new QPropertyAnimation; + m_leaveAnimation->setPropertyName(QString("geometry").toLocal8Bit()); + + //获取软件商店类别信号 + QDBusConnection::sessionBus().connect("com.kylin.softwarecenter.getsearchresults", + "/com/kylin/softwarecenter/getsearchresults", + "com.kylin.getsearchresults", + "get_app_category_list_signal", + this, + SLOT(updateAppCategorySlot(QString)) + ); + setTabletModeFlag(); + initUi(); + registDbusServer(); + initSignalConnect(); + initGsettings(); +} + +MainWindow::~MainWindow() +{ + closeDataBase("MainThread"); + + if (m_animationPage != nullptr) { + delete m_animationPage; + m_animationPage = nullptr; + } +} + +void MainWindow::setTabletModeFlag() +{ + QDBusConnection::sessionBus().connect("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + "mode_change_signal", + this, + SLOT(tabletModeChangeSlot(bool))); + m_usrInterface = new QDBusInterface("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + QDBusConnection::sessionBus(), this); + QDBusReply res = m_usrInterface->call("get_current_tabletmode"); + if (res.isValid()) { + m_isTabletMode = res; + } +} + +void MainWindow::registDbusServer() +{ + m_dbus = new DBus; + new MenuAdaptor(m_dbus); + m_fullWindow = new FullMainWindow; + QDBusConnection con = QDBusConnection::sessionBus(); + + if (!con.registerService("org.ukui.menu") || + !con.registerObject("/org/ukui/menu", m_dbus)) { + qDebug() << "error:" << con.lastError().message(); + } + + connect(m_dbus, &DBus::sendReloadSignal, this, [ = ] { + updateView(); + }); + connect(m_dbus, &DBus::winKeyResponseSignal, this, [ = ] { + + if (m_isTabletMode) { + return; + } + + if (QGSettings::isSchemaInstalled(QString("org.ukui.session").toLocal8Bit())) + { + QGSettings gsetting(QString("org.ukui.session").toLocal8Bit()); + + if (gsetting.keys().contains("winKeyRelease")) + if (gsetting.get("winKeyRelease").toBool()) { + return; + } + } + if (QGSettings::isSchemaInstalled(QString("org.ukui.screenshot").toLocal8Bit())) + { + QGSettings gsetting(QString("org.ukui.screenshot").toLocal8Bit()); + + if (gsetting.keys().contains("isrunning")) + if (gsetting.get("isrunning").toBool()) { + return; + } + } + + if (this->isVisible()) + { + this->hide(); + m_topStackedWidget->setCurrentIndex(0); + m_lineEdit->clear(); + this->clearFocus(); + m_isFullScreen = false; + } else if (m_fullWindow->isVisible()) + { + m_fullWindow->hide(); + m_fullWindow->clearFocus(); + m_fullWindow->resetEditline(); + m_isFullScreen = true; + } else + { + if (!m_isFullScreen) { + this->show(); + setMinWindowPos(); + this->raise(); + this->activateWindow(); + on_collectPushButton_clicked(); + m_viewWidget->setFocus(); + } else { + m_fullWindow->show(); + setMaxWindowPos(); + // fullWindow->raise(); + m_fullWindow->activateWindow(); + } + } + }); + + repaintWidget(); +} + +void MainWindow::initSignalConnect() +{ + connect(this, &MainWindow::sendClassificationbtnList, m_functionBtnWid, &FunctionButtonWidget::recvClassificationBtnList); + connect(this, &MainWindow::sendLetterClassificationList, m_letterBtnWid, &LetterButtonWidget::recvLetterBtnList); + // connect(m_functionBtnWid, &FunctionButtonWidget::sendFunctionBtnSignal,this,&FunctionWidget::recvFunctionBtnSignal); + connect(m_minFuncListView, &ListView::sendAppClassificationBtnClicked, this, &MainWindow::appClassificationBtnClickedSlot); + connect(m_minLetterListView, &ListView::sendAppClassificationBtnClicked, this, &MainWindow::appClassificationBtnClickedSlot); + connect(m_leaveAnimation, &QPropertyAnimation::finished, this, &MainWindow::animationFinishedSLot); + connect(m_enterAnimation, &QPropertyAnimation::finished, this, &MainWindow::animationFinishedSLot); + connect(m_functionBtnWid, &FunctionButtonWidget::sendFunctionBtnSignal, this, &MainWindow::recvFunctionBtnSignal); + connect(m_letterBtnWid, &LetterButtonWidget::sendLetterBtnSignal, this, &MainWindow::recvFunctionBtnSignal); + connect(m_functionBtnWid, &FunctionButtonWidget::sendResetFunctionPage, this, &MainWindow::resetFunctionPage); + connect(m_letterBtnWid, &LetterButtonWidget::sendResetLetterPage, this, &MainWindow::resetLetterPage); + connect(m_maxAnimation, &QPropertyAnimation::finished, this, &MainWindow::maxAnimationFinished); + connect(m_minAnimation, &QPropertyAnimation::finished, this, &MainWindow::minAnimationFinished); + connect(m_lineEdit, &QLineEdit::textChanged, this, &MainWindow::searchAppSlot); + connect(this, &MainWindow::sendSearchKeyword, m_searchAppThread, &SearchAppThread::recvSearchKeyword); + 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_minSelectButton, &QToolButton::clicked, this, &MainWindow::on_minSelectButton_clicked); + connect(m_dropDownMenu, &MenuBox::triggered, this, &MainWindow::on_selectMenuButton_triggered); + connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() { + selectIconAnimation(false); + }); + connect(m_powerOffButton, &QPushButton::customContextMenuRequested, this, &MainWindow::on_powerOffButton_customContextMenuRequested); + connect(m_powerOffButton, &QPushButton::clicked, this, &MainWindow::on_powerOffButton_clicked); + connect(m_cancelSearchPushButton, &QPushButton::clicked, this, &MainWindow::on_cancelSearchPushButton_clicked); + connect(m_searchPushButton, &QPushButton::clicked, this, &MainWindow::on_searchPushButton_clicked); + connect(m_minMaxChangeButton, &QPushButton::clicked, this, &MainWindow::on_minMaxChangeButton_clicked); + connect(m_minAllListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_minFuncListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_minLetterListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_collectListView, &RightListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); +// QDBusConnection::sessionBus().connect(DBUS_NAME, DBUS_PATH, DBUS_INTERFACE, QString("PanelGeometryRefresh"), this, SLOT(primaryScreenChangeSlot())); + connect(QApplication::desktop(), &QDesktopWidget::resized, this, &MainWindow::primaryScreenChangeSlot); + connect(QApplication::desktop(), &QDesktopWidget::primaryScreenChanged, this, &MainWindow::primaryScreenChangeSlot); + connect(QApplication::desktop(), &QDesktopWidget::screenCountChanged, this, &MainWindow::primaryScreenChangeSlot); + + //监控应用进程开启 + connect(KWindowSystem::self(), &KWindowSystem::windowAdded, [ = ](WId id) { + ConvertWinidToDesktop reply; + QString desktopfp = reply.tranIdToDesktop(id); + + if (!desktopfp.isEmpty()) { + ViewOpenedSlot(desktopfp); + } + }); +} + +void MainWindow::initGsettings() +{ + //监听屏幕缩放 + if (QGSettings::isSchemaInstalled(QString("org.ukui.SettingsDaemon.plugins.xsettings").toLocal8Bit())) { + QGSettings *m_gsetting = new QGSettings(QString("org.ukui.SettingsDaemon.plugins.xsettings").toLocal8Bit()); + connect(m_gsetting, &QGSettings::changed, this, [ = ](const QString & key) { + if (key == "scalingFactor") { + repaintWidget(); + } + }); + } + + if (QGSettings::isSchemaInstalled(QString("org.ukui.panel.settings").toLocal8Bit())) { + QGSettings *gsetting = new QGSettings(QString("org.ukui.panel.settings").toLocal8Bit()); + connect(gsetting, &QGSettings::changed, + this, &MainWindow::repaintWidget); + } + + if (QGSettings::isSchemaInstalled(QString("org.ukui.style").toLocal8Bit())) { + QGSettings *gsetting = new QGSettings("org.ukui.style", QByteArray(), this); + connect(gsetting, &QGSettings::changed, [ = ](QString key) { + if ("systemFont" == key || "systemFontSize" == key) { + m_leftTopSearchHorizontalLayout->removeWidget(m_lineEdit); + m_leftTopSearchHorizontalLayout->removeWidget(m_cancelSearchPushButton); + m_lineEdit->setParent(nullptr); + m_leftTopSearchHorizontalLayout->addWidget(m_lineEdit); + m_leftTopSearchHorizontalLayout->addWidget(m_cancelSearchPushButton); + m_lineEdit->setPlaceholderText("搜索应用"); + m_fullWindow->updateView(); + } + + if (key.contains(QString("styleName"))) { + changeStyle(); + } + }); + } +} + +void MainWindow::initSearchUi() +{ //搜索框部分 m_topStackedWidget = new QStackedWidget(m_viewWidget); m_topStackedWidget->setFixedHeight(34); @@ -68,9 +296,11 @@ MainWindow::MainWindow(QWidget *parent) : m_searchPushButton->setFixedSize(QSize(26, 26)); m_searchPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/search.svg", true)); m_searchPushButton->installEventFilter(this); + m_searchPushButton->setToolTip(tr("Search")); m_minSelectButton = new QPushButton(m_minMenuPage); m_minSelectButton->setFixedSize(QSize(26, 26)); m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-all.svg", true)); + m_minSelectButton->setToolTip(tr("All")); m_minSelectButton->installEventFilter(this); m_selectMenuButton = new RotationLabel(m_minMenuPage); m_selectMenuButton->installEventFilter(this); @@ -96,6 +326,10 @@ MainWindow::MainWindow(QWidget *parent) : m_cancelSearchPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-close-2x.png", true)); m_topStackedWidget->addWidget(m_minMenuPage); m_topStackedWidget->addWidget(m_minSearchPage); +} + +void MainWindow::initLeftWidget() +{ //左侧列表区 m_leftStackedWidget = new QStackedWidget(m_viewWidget); m_leftStackedWidget->setFixedSize(QSize(300, Style::leftPageHeight)); @@ -126,6 +360,10 @@ MainWindow::MainWindow(QWidget *parent) : m_minSearchResultListView->setFixedSize(QSize(Style::leftPageWidth, Style::leftPageHeight)); m_minSearchResultListView->installEventFilter(this); m_leftStackedWidget->addWidget(m_minSearchResultPage); +} + +void MainWindow::initRightWidgetButton() +{ //右侧窗口 m_mainRightVerticalLayout = new QVBoxLayout(); m_mainRightVerticalLayout->setSpacing(0); @@ -157,17 +395,21 @@ MainWindow::MainWindow(QWidget *parent) : m_rightTopHorizontalLayout->addItem(m_horizontalSpacer_3); m_rightTopHorizontalLayout->addWidget(m_minMaxChangeButton); m_verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); +} + +void MainWindow::initCollectWidget() +{ //右侧列表区 m_rightStackedWidget = new QStackedWidget(m_centralwidget); - m_rightStackedWidget->setFixedSize(QSize(324, 490)); + m_rightStackedWidget->setFixedSize(QSize(352, 490)); m_rightStackedWidget->setFocusPolicy(Qt::StrongFocus); m_collectPage = new QWidget(); - m_collectPage->setFixedSize(QSize(324, 480)); + m_collectPage->setFixedSize(QSize(332, 480)); m_rightCollectLayout = new QVBoxLayout(m_collectPage); m_rightCollectLayout->setContentsMargins(0, 18, 0, 0); //收藏视图 m_collectListView = new RightListView(m_collectPage); - m_collectListView->setFixedSize(QSize(324, 428)); + m_collectListView->setFixedSize(QSize(332, 420)); m_collectListView->setAcceptDrops(true); m_collectListView->setAutoFillBackground(false); m_collectListView->setProperty("showDropIndicator", QVariant(true)); @@ -180,9 +422,13 @@ MainWindow::MainWindow(QWidget *parent) : m_collectListView->setSelectionRectVisible(true); m_collectListView->installEventFilter(this); m_recentPage = new QWidget(); - m_recentPage->setFixedSize(QSize(324, 490)); + m_recentPage->setFixedSize(QSize(352, 490)); m_rightRecentLayout = new QVBoxLayout(m_recentPage); m_rightRecentLayout->setContentsMargins(0, 20, 0, 0); +} + +void MainWindow::initRecentWidget() +{ //最近视图 m_recentListView = new ListView(m_recentPage); m_recentListView->installEventFilter(this); @@ -248,202 +494,16 @@ MainWindow::MainWindow(QWidget *parent) : m_leftStackedWidget->setCurrentIndex(0); m_minMaxChangeButton->setDefault(false); m_rightStackedWidget->setCurrentIndex(0); - //设置tab切换顺序 - // setTabOrder(widget, searchPushButton); +} + +void MainWindow::initTabOrder() +{ setTabOrder(m_searchPushButton, m_minSelectButton); setTabOrder(m_minSelectButton, m_selectMenuButton); setTabOrder(m_selectMenuButton, m_collectPushButton); setTabOrder(m_collectPushButton, m_recentPushButton); setTabOrder(m_recentPushButton, m_minMaxChangeButton); setTabOrder(m_minMaxChangeButton, m_powerOffButton); - m_softwareDbThread = new SoftwareDatabaseUpdateThread; - //获取软件商店类别信号 - QDBusConnection::sessionBus().connect("com.kylin.softwarecenter.getsearchresults", - "/com/kylin/softwarecenter/getsearchresults", - "com.kylin.getsearchresults", - "get_app_category_list_signal", - this, - SLOT(updateAppCategorySlot(QString)) - ); - initUi(); - m_functionBtnWid = new FunctionButtonWidget(m_minFuncPage); - m_functionBtnWid->hide(); - m_letterBtnWid = new LetterButtonWidget(m_minLetterPage); - m_letterBtnWid->hide(); - m_enterAnimation = new QPropertyAnimation; - m_enterAnimation->setPropertyName(QString("geometry").toLocal8Bit()); - m_leaveAnimation = new QPropertyAnimation; - m_leaveAnimation->setPropertyName(QString("geometry").toLocal8Bit()); - connect(this, &MainWindow::sendClassificationbtnList, m_functionBtnWid, &FunctionButtonWidget::recvClassificationBtnList); - connect(this, &MainWindow::sendLetterClassificationList, m_letterBtnWid, &LetterButtonWidget::recvLetterBtnList); - // connect(m_functionBtnWid, &FunctionButtonWidget::sendFunctionBtnSignal,this,&FunctionWidget::recvFunctionBtnSignal); - connect(m_minFuncListView, &ListView::sendAppClassificationBtnClicked, this, &MainWindow::appClassificationBtnClickedSlot); - connect(m_minLetterListView, &ListView::sendAppClassificationBtnClicked, this, &MainWindow::appClassificationBtnClickedSlot); - connect(m_leaveAnimation, &QPropertyAnimation::finished, this, &MainWindow::animationFinishedSLot); - connect(m_enterAnimation, &QPropertyAnimation::finished, this, &MainWindow::animationFinishedSLot); - connect(m_functionBtnWid, &FunctionButtonWidget::sendFunctionBtnSignal, this, &MainWindow::recvFunctionBtnSignal); - connect(m_letterBtnWid, &LetterButtonWidget::sendLetterBtnSignal, this, &MainWindow::recvFunctionBtnSignal); - connect(m_functionBtnWid, &FunctionButtonWidget::sendResetFunctionPage, this, &MainWindow::resetFunctionPage); - connect(m_letterBtnWid, &LetterButtonWidget::sendResetLetterPage, this, &MainWindow::resetLetterPage); - m_searchAppThread = new SearchAppThread; - m_dbus = new DBus; - new MenuAdaptor(m_dbus); - m_fullWindow = new FullMainWindow; - QDBusConnection con = QDBusConnection::sessionBus(); - - if (!con.registerService("org.ukui.menu") || - !con.registerObject("/org/ukui/menu", m_dbus)) { - qDebug() << "error:" << con.lastError().message(); - } - - connect(m_dbus, &DBus::sendReloadSignal, this, [ = ] { - updateView(); - }); - connect(m_dbus, &DBus::winKeyResponseSignal, this, [ = ] { - if (QGSettings::isSchemaInstalled(QString("org.ukui.session").toLocal8Bit())) - { - QGSettings gsetting(QString("org.ukui.session").toLocal8Bit()); - - if (gsetting.keys().contains("winKeyRelease")) - if (gsetting.get("winKeyRelease").toBool()) { - return; - } - } - if (QGSettings::isSchemaInstalled(QString("org.ukui.screenshot").toLocal8Bit())) - { - QGSettings gsetting(QString("org.ukui.screenshot").toLocal8Bit()); - - if (gsetting.keys().contains("isrunning")) - if (gsetting.get("isrunning").toBool()) { - return; - } - } - - if (this->isVisible()) - { - this->hide(); - this->clearFocus(); - m_isFullScreen = false; - pointDataStruct pointData; - pointData.module = "mainWindow"; - pointData.function = "winHide"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); - } else if (m_fullWindow->isVisible()) - { - m_fullWindow->hide(); - m_fullWindow->clearFocus(); - pointDataStruct pointData; - pointData.module = "fullWindow"; - pointData.function = "winHide"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); - m_isFullScreen = true; - } else - { - if (!m_isFullScreen) { - this->show(); - setMinWindowPos(); - this->raise(); - this->activateWindow(); - pointDataStruct pointData; - pointData.module = "mainWindow"; - pointData.function = "winShow"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); - on_collectPushButton_clicked(); - m_viewWidget->setFocus(); - } else { - m_fullWindow->show(); - setMaxWindowPos(); -// fullWindow->raise(); - m_fullWindow->activateWindow(); - pointDataStruct pointData; - pointData.module = "fullWindow"; - pointData.function = "winShow"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); - } - } - }); - m_animationPage = new AnimationPage(); - m_maxAnimation = new QPropertyAnimation(m_animationPage, "geometry", this); - m_minAnimation = new QPropertyAnimation(m_animationPage, "geometry", this); - connect(m_maxAnimation, &QPropertyAnimation::finished, this, &MainWindow::maxAnimationFinished); - connect(m_minAnimation, &QPropertyAnimation::finished, this, &MainWindow::minAnimationFinished); - connect(m_lineEdit, &QLineEdit::textChanged, this, &MainWindow::searchAppSlot); - connect(this, &MainWindow::sendSearchKeyword, m_searchAppThread, &SearchAppThread::recvSearchKeyword); - 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_minSelectButton, &QToolButton::clicked, this, &MainWindow::on_minSelectButton_clicked); - connect(m_dropDownMenu, &MenuBox::triggered, this, &MainWindow::on_selectMenuButton_triggered); - connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() { - m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/downarrow.svg", true) - .pixmap(QSize(Style::miniIconSize, Style::miniIconSize))); - selectIconAnimation(false); - }); - connect(m_powerOffButton, &QPushButton::customContextMenuRequested, this, &MainWindow::on_powerOffButton_customContextMenuRequested); - connect(m_powerOffButton, &QPushButton::clicked, this, &MainWindow::on_powerOffButton_clicked); - connect(m_cancelSearchPushButton, &QPushButton::clicked, this, &MainWindow::on_cancelSearchPushButton_clicked); - connect(m_searchPushButton, &QPushButton::clicked, this, &MainWindow::on_searchPushButton_clicked); - connect(m_minMaxChangeButton, &QPushButton::clicked, this, &MainWindow::on_minMaxChangeButton_clicked); - QDBusConnection::sessionBus().connect(DBUS_NAME, DBUS_PATH, DBUS_INTERFACE, QString("PanelGeometryRefresh"), this, SLOT(primaryScreenChangeSlot())); - - //监听屏幕缩放 - if (QGSettings::isSchemaInstalled(QString("org.ukui.SettingsDaemon.plugins.xsettings").toLocal8Bit())) { - QGSettings *m_gsetting = new QGSettings(QString("org.ukui.SettingsDaemon.plugins.xsettings").toLocal8Bit()); - connect(m_gsetting, &QGSettings::changed, this, [ = ](const QString & key) { - if (key == "scalingFactor") { - repaintWidget(); - } - }); - } - - if (QGSettings::isSchemaInstalled(QString("org.ukui.panel.settings").toLocal8Bit())) { - QGSettings *gsetting = new QGSettings(QString("org.ukui.panel.settings").toLocal8Bit()); - connect(gsetting, &QGSettings::changed, - this, &MainWindow::repaintWidget); - } - - if (QGSettings::isSchemaInstalled(QString("org.ukui.style").toLocal8Bit())) { - QGSettings *gsetting = new QGSettings("org.ukui.style", QByteArray(), this); - connect(gsetting, &QGSettings::changed, [ = ](QString key) { - if ("systemFont" == key || "systemFontSize" == key) { - m_leftTopSearchHorizontalLayout->removeWidget(m_lineEdit); - m_leftTopSearchHorizontalLayout->removeWidget(m_cancelSearchPushButton); - m_lineEdit->setParent(nullptr); - m_leftTopSearchHorizontalLayout->addWidget(m_lineEdit); - m_leftTopSearchHorizontalLayout->addWidget(m_cancelSearchPushButton); - m_lineEdit->setPlaceholderText(QApplication::translate("MainWindow", "Search application")); - m_fullWindow->updateView(); - } - - if (key.contains(QString("styleName"))) { - changeStyle(); - } - }); - } - - //监控应用进程开启 - connect(KWindowSystem::self(), &KWindowSystem::windowAdded, [ = ](WId id) { - ConvertWinidToDesktop reply; - QString desktopfp = reply.tranIdToDesktop(id); - - if (!desktopfp.isEmpty()) { - ViewOpenedSlot(desktopfp); - } - }); -} - -MainWindow::~MainWindow() -{ - closeDataBase("MainThread"); - - if (m_animationPage != nullptr) { - delete m_animationPage; - m_animationPage = nullptr; - } } void MainWindow::initUi() @@ -509,6 +569,10 @@ void MainWindow::initUi() connect(m_desktopWatcher, &DesktopWatcher::directoryChangedSignal, this, &MainWindow::updateView); connect(m_desktopWatcher, &DesktopWatcher::updateRecentList, this, &MainWindow::updateRecentView); connect(this, &MainWindow::sendStyleChangeSignal, m_viewWidget, &MainViewWidget::styleChangeSlot); + connect(m_minAllListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_minFuncListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_minLetterListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_minSearchResultListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); changeStyle(); } @@ -585,6 +649,10 @@ void MainWindow::changeStyle() void MainWindow::paintEvent(QPaintEvent *event) { double transparency = getTransparency(); + QColor curColor = m_windowColor; + if ( transparency == 1) { + curColor.setAlpha(255); + } QRect rect = this->rect(); QPainterPath path; // rect.setTopLeft(QPoint(rect.x()+320,rect.y())); @@ -601,11 +669,10 @@ void MainWindow::paintEvent(QPaintEvent *event) 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.setBrush(m_windowColor); + painter.setBrush(curColor); painter.setPen(Qt::transparent); painter.setOpacity(transparency); painter.drawPath(path); - // setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon())); KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon())); QMainWindow::paintEvent(event); } @@ -618,6 +685,8 @@ bool MainWindow::event(QEvent *event) if (QApplication::activeWindow() != this) { qDebug() << " * 鼠标点击窗口外部事件"; this->hide(); + m_topStackedWidget->setCurrentIndex(0); + m_lineEdit->clear(); } } @@ -1040,7 +1109,6 @@ void MainWindow::searchAppSlot(QString arg) } void MainWindow::on_selectMenuButton_triggered(QAction *arg1) { - pointDataStruct pointData; m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/downarrow.svg", true).pixmap(QSize(Style::miniIconSize, Style::miniIconSize))); selectIconAnimation(false); @@ -1048,38 +1116,29 @@ void MainWindow::on_selectMenuButton_triggered(QAction *arg1) m_leftStackedWidget->setCurrentIndex(0); m_state = 0; m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-all.svg", true)); + m_minSelectButton->setToolTip(tr("All")); m_minSelectTextLabel->setText(tr("All")); m_allAction->setChecked(true); m_letterAction->setChecked(false); m_funcAction->setChecked(false); - pointData.module = "mainWindow/selectMenuButton"; - pointData.function = "AllSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_letterAction) { m_leftStackedWidget->setCurrentIndex(1); m_state = 1; m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-letter.svg", true)); + m_minSelectButton->setToolTip(tr("Letter")); m_minSelectTextLabel->setText(tr("Letter")); m_allAction->setChecked(false); m_letterAction->setChecked(true); m_funcAction->setChecked(false); - pointData.module = "mainWindow/selectMenuButton"; - pointData.function = "LetterSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_funcAction) { m_leftStackedWidget->setCurrentIndex(2); m_state = 2; m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-function.svg", true)); + m_minSelectButton->setToolTip(tr("Function")); m_minSelectTextLabel->setText(tr("Function")); m_allAction->setChecked(false); m_letterAction->setChecked(false); m_funcAction->setChecked(true); - pointData.module = "mainWindow/selectMenuButton"; - pointData.function = "FunctionSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } } void MainWindow::updateCollectView() @@ -1129,10 +1188,6 @@ void MainWindow::databaseThreadCloseSlot() void MainWindow::on_collectPushButton_clicked() { m_rightStackedWidget->setCurrentIndex(0); - pointDataStruct pointData; - pointData.module = "mainWindow/collectPushButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; m_collectPushButton->setStyleSheet("color:#3790FA;"); QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2); @@ -1156,11 +1211,6 @@ void MainWindow::on_recentPushButton_clicked() m_collectPushButton->setFont(collectFont); m_recentPushButton->setStyleSheet("color:#3790FA"); - pointDataStruct pointData; - pointData.module = "mainWindow/recentPushButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - QFont recentFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2); m_recentPushButton->setFont(recentFont); updateRecentView(); @@ -1169,21 +1219,11 @@ void MainWindow::on_cancelSearchPushButton_clicked() { m_topStackedWidget->setCurrentIndex(0); m_lineEdit->clear(); - pointDataStruct pointData; - pointData.module = "mainWindow/cancelSearchPushButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::on_searchPushButton_clicked() { m_topStackedWidget->setCurrentIndex(1); m_lineEdit->setFocus(); - pointDataStruct pointData; - pointData.module = "mainWindow/searchPushButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::on_minMaxChangeButton_clicked() { @@ -1208,60 +1248,40 @@ void MainWindow::on_minMaxChangeButton_clicked() m_maxAnimation->setDuration(260); m_maxAnimation->start(); this->hide(); - pointDataStruct pointData; - pointData.module = "mainWindow/minMaxChangeButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::showWindow() { + Style::initWidStyle(); + myDebug() << "调用开始菜单显示"; if (m_isFullScreen) { - m_fullWindow->raise(); - m_fullWindow->showNormal(); + m_fullWindow->show(); setMaxWindowPos(); + m_fullWindow->raise(); m_fullWindow->activateWindow(); - pointDataStruct pointData; - pointData.module = "fullWindow"; - pointData.function = "Show"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else { - this->raise(); - this->showNormal(); + this->show(); setMinWindowPos(); + this->raise(); this->activateWindow(); -// m_collectPushButton->clicked(true); on_collectPushButton_clicked(); m_viewWidget->setFocus(); - pointDataStruct pointData; - pointData.module = "mainWindow"; - pointData.function = "Show"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } } void MainWindow::hideWindow() { + myDebug() << "调用开始菜单隐藏"; if (m_fullWindow->isVisible()) { m_fullWindow->hide(); + m_fullWindow->resetEditline(); this->clearFocus(); m_isFullScreen = true; - pointDataStruct pointData; - pointData.module = "fullWindow"; - pointData.function = "Hide"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else { this->hide(); + m_topStackedWidget->setCurrentIndex(0); + m_lineEdit->clear(); this->clearFocus(); m_isFullScreen = false; - pointDataStruct pointData; - pointData.module = "mainWindow"; - pointData.function = "Hide"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } } @@ -1345,20 +1365,11 @@ void MainWindow::showNormalWindowSlot() void MainWindow::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); - pointDataStruct pointData; - pointData.module = "mainWindow/powerOffButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::on_powerOffButton_customContextMenuRequested(const QPoint &pos) { + Q_UNUSED(pos); RightClickMenu m_otherMenu(this); - m_otherMenu.showShutdownMenu(this->mapToGlobal(m_centralwidget->rect().bottomRight())); - pointDataStruct pointData; - pointData.module = "mainWindow/powerOffButton"; - pointData.function = "RightClicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); + m_otherMenu.showShutdownMenu(this->mapToGlobal(m_centralwidget->rect().bottomRight()), false); qDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; } diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h index 7dede39..4f0baf3 100755 --- a/src/UserInterface/mainwindow.h +++ b/src/UserInterface/mainwindow.h @@ -70,6 +70,16 @@ public: void hideWindow(); protected: + void initSearchUi(); + void initLeftWidget(); + void initRightWidgetButton(); + void initCollectWidget(); + void initRecentWidget(); + void initTabOrder(); + void initGsettings(); + void initSignalConnect(); + void registDbusServer(); + void setTabletModeFlag(); void initUi(); /** * @brief 处理外部点击事件和主窗口键盘控制 @@ -233,6 +243,8 @@ private: LetterButtonWidget *m_letterBtnWid = nullptr; SoftwareDatabaseUpdateThread *m_softwareDbThread = nullptr; QColor m_windowColor; + bool m_isTabletMode = false; + QDBusInterface *m_usrInterface = nullptr; }; #endif // MAINWINDOW_H diff --git a/src/UtilityFunction/Style/style.cpp b/src/UtilityFunction/Style/style.cpp index a7ea91a..53378bd 100755 --- a/src/UtilityFunction/Style/style.cpp +++ b/src/UtilityFunction/Style/style.cpp @@ -152,7 +152,7 @@ void Style::initWidStyle() LeftLetterFontSize = 14; LeftSpaceBetweenItem = 15; AppListIconSize = 86; - AppListItemSizeWidth = 150; + AppListItemSizeWidth = 168; m_applistGridSizeWidth = 220; AppSpaceBetweenIconText = 18; } else if (m_availableScreenWidth >= 1600 && m_availableScreenWidth < 1920) { @@ -210,7 +210,7 @@ void Style::initWidStyle() QueryLineEditHeight = 30; LeftLetterBtnHeight = 25; LeftIconSize = 19; - DropMenuWidth = 140; + DropMenuWidth = 170; DropMenuHeight = 112; miniIconSize = 8; rightViewWidth = 324; diff --git a/src/UtilityFunction/utility.h b/src/UtilityFunction/utility.h index 9d5f7a9..4491673 100755 --- a/src/UtilityFunction/utility.h +++ b/src/UtilityFunction/utility.h @@ -32,26 +32,6 @@ #define myDebug() qDebug() << QString("%1 %2 行 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__) -typedef struct pointDataStruct { - QString module; - QString function; - QString functionNum; - QStringList otherFunction; - QString errorLevel; - QString errorOutput; - QString timeStamp; - pointDataStruct() - { - module = QString(); - function = QString(); - functionNum = QString(); - otherFunction = QStringList(); - errorLevel = QString(); - errorOutput = QString(); - timeStamp = QString(); - } -} pointDataStruct; - static int collectCount = 0; const QPixmap loadSvg(const QString &fileName, const int size); diff --git a/translations/ukui-menu_bo.qm b/translations/ukui-menu_bo.qm deleted file mode 100755 index be651ee..0000000 --- a/translations/ukui-menu_bo.qm +++ /dev/null @@ -1 +0,0 @@ - FullMainWindow - + Search - + All - + Letter - + Function @@ -27,64 +27,77 @@ FunctionWidget - + Search + + ItemDelegate + + + Open the function sort menu + + + + + Open the alphabetical menu + + + MainWindow - + collection - - - + + + + + All - + + Search - + No recent files - + recent - + Max - + PowerOff - - Search application - - - - - + + + Letter - - + + + Function @@ -244,22 +257,22 @@ TabletRightClickMenu - + Pin to taskbar - + Unpin from taskbar - + Add to desktop shortcuts - + Uninstall diff --git a/translations/ukui-menu_tr.qm b/translations/ukui-menu_tr.qm deleted file mode 100755 index 927e24f891f983acc5806a2019044d7970e5bc5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2709 zcmcgsU1%It6h4#9%>E=UC8*>f;Mhlvu~oDPeMxMRRui&jo7C1qJ3DiC_jYIREHigo z5_}RLe2Rz`f-Q)kA`-+0AF5C)p&~7a&?1Q7llb#c6nu~%dGNb4o7wE{Y%E0$?4Hcd zIp6ut_nmtWUvWln{(kx5*AI_fJNxd{AEt;jlj!I;g?}n)12p*EQ$zz#QsL0Ih!&lC z^a~l#sNE%n&eTd4aob#fVT@QObE`6l3a6g68v{mn(-Z0hIk zyor26zx3KV-oMw1x1*@Nt-t>c@KaCd8*f}k{+j;DM_2KDR=;se09P2luKtMU&!U*# zOn*8GzWQS3hOvbAk7RCsh&p2;yME{oqV#MOGvDW4-*^Rim!g9>~BaHR-x(#QaRt zb>}TEPH^FP7c`ZsC6r6zREvv^IVL6Z z`;{6f^~q|d7n$YT)q6{iSf1ccg~@QH{tD#oZTjxAyPUkcY>%nCQy-)P1oB`CWP+J) z_}vz4=ml-{A|do+~K%>tZr3$llN%{0IT-PN5q=M;F)6r8zNXQ|NWq&zymUA3B)R( z))F8hs2z+^jD>QU+r52rbc8rmK;K=tvda7*VW1+U4$#RWx1C+|Y;J`Ir$ek^Du&$D zOl@_I;z}S{y$3r-%gA<+>&3|WGIyBQllnBxgFt}KHohgkO{!@J!(UcF(A^mxLRxso zsD@uy3_CjMIHvSWhXpn1HO!#u`O!Wg4z&`?V%K-I);!a+*y-fn6`bDmu@i?+{Lbe$xy$ zxPN-itC$PTa7B{3Phf&3x~h&!GBpFo^PjYe|CL}&JA>aj7;+LZ?gItvfhR1NuQF3s zd0@Ic=-Xv%=SGF_$`oZ$33#0|<_cUW`K{Jvn=s-y&4QW_YUcs-3#gZLFmMwS}m~Y~YsBKG9aEwlZj=(f(M+Hbskp<1vd28dO z7g-=Jzpp|g;W@2^Ud&@v9cso}>qVEbM!){UA#0Z$c;7y$*(JdRI`)_HK+BUZ(ZW53 z>!IH`KA55#JHI3vaH{Nk^}W2B*~2Rbuu7^9zgkB~tzS~xkzH;7!O8#hBDnv!RdSh3 WSfGDxJNvh|8@Kyc|4)`A6ZjiS|3C}? diff --git a/translations/ukui-menu_tr.ts b/translations/ukui-menu_tr.ts index 3e5245e..756c8b1 100755 --- a/translations/ukui-menu_tr.ts +++ b/translations/ukui-menu_tr.ts @@ -4,22 +4,22 @@ FullMainWindow - + Search Ara - + All Tümü - + Letter Alfabetik - + Function Kategori @@ -118,7 +118,7 @@ Diğer - + Search Ara @@ -170,6 +170,19 @@ Diğer + + ItemDelegate + + + Open the function sort menu + + + + + Open the alphabetical menu + + + MainViewWidget @@ -192,56 +205,56 @@ MainWindow - + collection - - - + + + + + All Tümü - + + Search Ara - + No recent files - + recent - + Max - + PowerOff - - Search application - - - - - + + + Letter Alfabetik - - + + + Function Kategori @@ -538,22 +551,22 @@ TabletRightClickMenu - + Pin to taskbar Görev çubuğuna sabitle - + Unpin from taskbar Görev çubuğundan sabitlemeyi kaldır - + Add to desktop shortcuts Masaüstü kısayollarına ekle - + Uninstall Kaldır diff --git a/translations/ukui-menu_zh_CN.qm b/translations/ukui-menu_zh_CN.qm deleted file mode 100755 index e8865871b3920806150ebcecabebfd9694b0317c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2320 zcmb7EZDo9}ctv&&QsuhI*)O*X1LiqxZPS);&gu z>9mlIy0e}-c)#D1nfMOyriIMog=2RgfIhtF%ZVY#V}*r|^>18Sei(eJysPm>@Oe`~ zh&|;51{IKhoN>VoV&Lc8q^c~Sw;`pfO@gAeE1IOI9VXMokMDlLGXvicwyPnfiH4$U z6(wEm(JAq#o(z#Njo2`7qM|^m*}1%DIQ3pZ5X3@4lq(7Xa(BHcsvxlPYgeQQHXP1> z;UYw5ZEdY->zP%jeMe@q=IKTmeXdT-CR4bsT!_4%<@k zhu>czRF9~uDkg&~iylFltAxxXu!uFo*0mP}3&e$=;y$eE@mQYC2AV_LAWCj`DBQ98 zIPr9UCZ$B-)#8*Awe_LJgh+iZ#IPB7-2)QFyn$o-o9ekt@y1D-qfFL{-FS6V_7J9Mzc-L?W_{dW36E<(g{8_O(6l`h{P^)r9IJ z?u_n#%DqLjo)$$jLksy2j!iI+B`?|CrFmKD3fl!=WU2jG{*YX#*qhfILNXc>tnZLb zXev;Aw%ob1#pMr|T`-S-+Dx-QyH6q&R`EEd_hBxa&|}>E`BHnQT2~V>%j2XWBr3L+ zN(*U@u<4+RaoileU2;@#M`kDCy0>VG2HutXUge)I9$D~uY|!i_aqw=@;xN2iU31th t@lRXLFEj8J8O$??{0hDP_AYA`LMk?FX8XSvqq4 FullMainWindow - + Search 搜索应用 - + All 全部 - + Letter 字母排序 - + Function 功能分类 @@ -27,64 +27,89 @@ FunctionWidget - + Search 全局搜索 + + ItemDelegate + + Open feature sort list + 打开功能排序菜单 + + + Open alphabetical list + 打开字母排序菜单 + + + + Open the function sort menu + 打开功能排序菜单 + + + + Open the alphabetical menu + 打开字母排序菜单 + + MainWindow - + + Search 搜索应用 - + No recent files 暂无最近文件 - - - + + + + + All 全部 - + collection 收藏 - + recent 最近 - + Max 放大 - + PowerOff - 关机 + 电源 - Search application - 搜索应用 + 搜索应用 - - + + + Letter 字母排序 - - + + + Function 功能分类 @@ -244,22 +269,22 @@ TabletRightClickMenu - + Pin to taskbar 固定到任务栏 - + Unpin from taskbar 从任务栏取消固定 - + Add to desktop shortcuts 固定到桌面快捷方式 - + Uninstall 卸载 diff --git a/ukui-menu.pro b/ukui-menu.pro index bb62748..c249692 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 kysdk-waylandhel CONFIG += no_keywords link_pkgconfig -LIBS+=-pthread -luchardet -lukui-log4qt -lukui-com4c -lukui-com4cxx -lpeony -ldl -lcrypto +LIBS+=-pthread -luchardet -lukui-log4qt -lukui-com4c -lukui-com4cxx -lpeony desktop_file.files = ukui-menu.desktop desktop_file.path = /etc/xdg/autostart