!7 调整全屏开始菜单初始化代码结构

* close-cd 128489 全屏将某个应用设置为“固定到所有软件”,更换开始菜单排序模式,开始菜单闪退
* 固定全屏电源右键菜单位置
* 增加全屏开始菜单下拉按钮旋转效果;增加全屏开始菜单点击空白区域退出
This commit is contained in:
lixueman 2022-07-12 06:56:21 +00:00 committed by handsome_feng
parent 4a84479ba6
commit fd51a285e0
34 changed files with 705 additions and 689 deletions

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
ukui-menu (3.1.1-ok4~0708) yangtze; urgency=medium
* 调整全屏窗口初始化代码结构
* 增加全屏开始菜单分类选择下拉按钮动画效果
* 增加全屏开始菜单点击空白区域退出功能
* 固定全屏电源右键菜单位置
-- lixueman <lixueman@kylinos.cn> Fri, 08 Jul 2022 11:25:23 +0800
ukui-menu (3.1.1-ok4~0623) yangtze; urgency=medium
* 调整QGuiApplication::platformName()调用时机

6
debian/control vendored
View File

@ -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.

View File

@ -1,78 +0,0 @@
#include "buriedpointdatasend.h"
#include <QHostInfo>
#include <QString>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
#include <QDateTime>
#include <QTimeZone>
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);
}

View File

@ -1,29 +0,0 @@
#ifndef BURIEDPOINTDATASEND_H
#define BURIEDPOINTDATASEND_H
#include <QObject>
#include <QDateTime>
#include <QDir>
#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<QString, int> m_functionCount;
QHash<QString, QStringList> m_applist;
// KUploadMessage *m_sendDataInterface = nullptr;
};
#endif // BURIEDPOINTDATASEND_H

View File

@ -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/../

View File

@ -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<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();
}

View File

@ -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);//移除边框

View File

@ -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<QStringList>();

View File

@ -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);

View File

@ -21,7 +21,6 @@
#include "utility.h"
#include <QDebug>
#include <QDesktopServices>
#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();
}
}
}

View File

@ -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<QStringList>().at(0);
if (var.isValid()) {
QString desktopfp = var.value<QString>();
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);
}

View File

@ -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:

View File

@ -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;
}

View File

@ -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

View File

@ -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);
}

View File

@ -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();

View File

@ -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;

View File

@ -20,7 +20,6 @@
#include <QDesktopWidget>
#include "style.h"
#include "utility.h"
#include "buriedpointdatasend.h"
#include <QDebug>
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()

View File

@ -23,7 +23,6 @@
#include <QDebug>
#include <QSvgRenderer>
#include <QPainter>
#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;

View File

@ -19,7 +19,6 @@
#include "full_letter_widget.h"
#include <QDebug>
#include <syslog.h>
#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;

View File

@ -20,7 +20,6 @@
#include "style.h"
#include "utility.h"
#include <QDebug>
#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<QStringList> 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();
}

View File

@ -3,7 +3,6 @@
#include <QAction>
#include <QTranslator>
#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<QStringList> 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);
}
}

View File

@ -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<QStringList> 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

View File

@ -33,7 +33,6 @@
#include <QGroupBox>
#include <QEventLoop>
#include <QLabel>
#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<bool> 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() 开始";
}

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -1 +0,0 @@
<クd<>箆!ソ`。スン

View File

@ -4,22 +4,22 @@
<context>
<name>FullMainWindow</name>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="86"/>
<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="144"/>
<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="146"/>
<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="148"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="149"/>
<source>Function</source>
<translation type="unfinished"></translation>
</message>
@ -27,64 +27,77 @@
<context>
<name>FunctionWidget</name>
<message>
<location filename="../src/UserInterface/Widget/function_Widget.cpp" line="204"/>
<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="240"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="497"/>
<source>collection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="233"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="452"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="985"/>
<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="90"/>
<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="192"/>
<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="241"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="498"/>
<source>recent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="242"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="499"/>
<source>Max</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="244"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="501"/>
<source>PowerOff</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="395"/>
<source>Search application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="454"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="993"/>
<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="456"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="1001"/>
<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>
@ -244,22 +257,22 @@
<context>
<name>TabletRightClickMenu</name>
<message>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="241"/>
<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="244"/>
<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="250"/>
<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="269"/>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="248"/>
<source>Uninstall</source>
<translation type="unfinished"></translation>
</message>

Binary file not shown.

View File

@ -4,22 +4,22 @@
<context>
<name>FullMainWindow</name>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="86"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="87"/>
<source>Search</source>
<translation type="unfinished">Ara</translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="144"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="145"/>
<source>All</source>
<translation type="unfinished">Tümü</translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="146"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="147"/>
<source>Letter</source>
<translation type="unfinished">Alfabetik</translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="148"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="149"/>
<source>Function</source>
<translation type="unfinished">Kategori</translation>
</message>
@ -118,7 +118,7 @@
<translation type="vanished">Diğer</translation>
</message>
<message>
<location filename="../src/UserInterface/Widget/function_Widget.cpp" line="204"/>
<location filename="../src/UserInterface/Widget/function_Widget.cpp" line="199"/>
<source>Search</source>
<translation type="unfinished">Ara</translation>
</message>
@ -170,6 +170,19 @@
<translation type="obsolete">Diğer</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>MainViewWidget</name>
<message>
@ -192,56 +205,56 @@
<context>
<name>MainWindow</name>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="240"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="497"/>
<source>collection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="233"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="452"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="985"/>
<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">Tümü</translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="90"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="309"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="331"/>
<source>Search</source>
<translation type="unfinished">Ara</translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="192"/>
<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="241"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="498"/>
<source>recent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="242"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="499"/>
<source>Max</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="244"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="501"/>
<source>PowerOff</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="395"/>
<source>Search application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="454"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="993"/>
<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">Alfabetik</translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="456"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="1001"/>
<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">Kategori</translation>
</message>
@ -538,22 +551,22 @@
<context>
<name>TabletRightClickMenu</name>
<message>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="241"/>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="220"/>
<source>Pin to taskbar</source>
<translation type="unfinished">Görev çubuğuna sabitle</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="244"/>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="223"/>
<source>Unpin from taskbar</source>
<translation type="unfinished">Görev çubuğundan sabitlemeyi kaldır</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="250"/>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="229"/>
<source>Add to desktop shortcuts</source>
<translation type="unfinished">Masaüstü kısayollarına ekle</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="269"/>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="248"/>
<source>Uninstall</source>
<translation type="unfinished">Kaldır</translation>
</message>

Binary file not shown.

View File

@ -4,22 +4,22 @@
<context>
<name>FullMainWindow</name>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="86"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="87"/>
<source>Search</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="144"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="145"/>
<source>All</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="146"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="147"/>
<source>Letter</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="148"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="149"/>
<source>Function</source>
<translation></translation>
</message>
@ -27,64 +27,89 @@
<context>
<name>FunctionWidget</name>
<message>
<location filename="../src/UserInterface/Widget/function_Widget.cpp" line="204"/>
<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="90"/>
<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="192"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="449"/>
<source>No recent files</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="233"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="452"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="985"/>
<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="240"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="497"/>
<source>collection</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="241"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="498"/>
<source>recent</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="242"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="499"/>
<source>Max</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="244"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="501"/>
<source>PowerOff</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="395"/>
<source>Search application</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="454"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="993"/>
<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="456"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="1001"/>
<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>
@ -244,22 +269,22 @@
<context>
<name>TabletRightClickMenu</name>
<message>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="241"/>
<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="244"/>
<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="250"/>
<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="269"/>
<location filename="../src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp" line="248"/>
<source>Uninstall</source>
<translation></translation>
</message>

View File

@ -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