!4 增加wayland定位接口调用

This commit is contained in:
lixueman 2022-06-20 01:49:56 +00:00 committed by handsome_feng
parent 26869a3bbf
commit d1136ea880
56 changed files with 1237 additions and 543 deletions

View File

@ -1,86 +0,0 @@
name: Check build
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * *'
jobs:
archlinux:
name: on Archlinux
runs-on: ubuntu-20.04
container: docker.io/library/archlinux:latest
steps:
- name: Checkout ukui-menu source code
uses: actions/checkout@v2
- name: Refresh pacman repository
run: pacman -Sy
- name: Install build dependencies
run: pacman -S --noconfirm base-devel qt5-base bamf gsettings-qt qt5-svg qt5-x11extras qt5-tools kwindowsystem
- name: QMake configure & Make
run: |
mkdir build;
cd build;
qmake-qt5 ..;
make -j$(nproc);
debian:
name: on Debian Sid
runs-on: ubuntu-20.04
container: docker.io/library/debian:sid
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout ukui-menu source code
uses: actions/checkout@v2
- name: Update apt repository
run: apt-get update -y
- name: Install build dependcies
run: apt-get install -y build-essential qt5-default qttools5-dev-tools debhelper-compat qtbase5-dev libqt5svg5-dev libglib2.0-dev libgsettings-qt-dev libbamf3-dev libxrandr-dev libxtst-dev libx11-dev libqt5x11extras5-dev libkf5windowsystem-dev
- name: QMake configure & Make
run: |
mkdir build;
cd build;
qmake ..;
make -j$(nproc);
fedora:
name: on Fedora 32
runs-on: ubuntu-20.04
container: docker.io/library/fedora:32
steps:
- name: Checkout ukui-menu source code
uses: actions/checkout@v2
- name: Install build dependencies
run: dnf install -y which gcc gcc-c++ make cmake cmake-rpm-macros autoconf automake intltool rpm-build qt5-rpm-macros qt5-qtbase-devel qt5-qtsvg-devel qt5-qtx11extras-devel qt5-linguist glib2-devel gsettings-qt-devel bamf-devel libXrandr-devel libXtst-devel libX11-devel kf5-kwindowsystem-devel
- name: QMake configure & Make
run: |
mkdir build;
cd build;
qmake-qt5 ..;
make -j$(nproc);
ubuntu:
name: on Ubuntu 20.04
runs-on: ubuntu-20.04
container: docker.io/library/ubuntu:focal
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout ukui-menu source code
uses: actions/checkout@v2
- name: Update apt repository
run: apt-get update -y
- name: Install build dependcies
run: apt-get install -y build-essential qt5-default qttools5-dev-tools debhelper-compat qtbase5-dev libqt5svg5-dev libglib2.0-dev libgsettings-qt-dev libbamf3-dev libxrandr-dev libxtst-dev libx11-dev libqt5x11extras5-dev libkf5windowsystem-dev
- name: QMake configure & Make
run: |
mkdir build;
cd build;
qmake ..;
make -j$(nproc);

View File

@ -2,7 +2,34 @@
![build](https://github.com/ukui/ukui-menu/workflows/Check%20build/badge.svg?branch=master)
An advanced menu for UKUI, providing common and all software mixed sort module, alphabet classification module, functional classification module and search module.
An advanced menu for UKUI, providing common and all software mixed sort module, alphabet classification module, functional classification module and search module. Provides favorites and recent file functions, You can fix it to your favorites area by right-clicking the application. Provides two display modes: default window and full-screen window.
# The project structure
## data/img
Provide icon files for the projec.
## src/BackProcess
Background data processing function realization, Includes DBUS, path listening, data acquisition, and search functions.
## src/QtSingleApplication
Singleton pattern processing.
## src/UserInterface
The UI implementation.
## src/UtilityFunction
Implementation of common functions, including database operations.
## translations
Translation files
# How to report bugs
Bugs should be reported to the UKUI bug tracking system:
@ -15,6 +42,7 @@ Please read the HACKING file for information on where to send changes or
bugfixes for this package.
# How to build
## Preparation
You can build pre-depends with such command:
@ -34,7 +62,7 @@ Note: build-depends references the paragraph in debian/control.
Note: If you want to run ukui-menu, You just need to execute the ukui-menu command at the terminal.
## DBUS interface
# DBUS interface
BUS Nameorg.ukui.menu
@ -50,7 +78,7 @@ WinKeyResponse () <---> ukui-menu display hidden state change interface
GetSecurityConfigPath () <---> Get security control profile path
## Configuration file
# Configuration file
.config/ukui/Ukuimenu.db

View File

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 305 B

12
debian/changelog vendored
View File

@ -1,5 +1,11 @@
ukui-menu (3.1.1-ok1) yangtze; urgency=medium
ukui-menu (3.20.0.3-0k1) yangtze; urgency=medium
* Initial for openKylin.
* 3.20版本提交
-- Xie Wei <xiewei@kylinos.cn> Fri, 06 May 2022 17:54:45 +0800
-- lixueman <lixueman@kylinos.cn> Sat, 18 Jun 2022 21:42:59 +0800
ukui-menu (3.1.1-0k0) yangtze; urgency=medium
* 版本号规范化
-- Xie Wei <xiewei@kylinos.cn> Fri, 06 May 2022 17:54:45 +0800

6
debian/control vendored
View File

@ -19,7 +19,8 @@ Build-Depends: debhelper-compat (=12),
libx11-dev,
libukui-common0,
libukui-common-dev,
libpeony-dev
libpeony-dev,
libkysdk-waylandhelper-dev
Standards-Version: 4.5.0
Rules-Requires-Root: no
Homepage: https://github.com/ukui/ukui-menu
@ -33,7 +34,8 @@ Depends: ${shlibs:Depends},
accountsservice,
libgsettings-qt1,
libqt5x11extras5,
bamfdaemon
bamfdaemon,
libkysdk-waylandhelper
Suggests:kylin-status-manager,
kylin-daq
Description: Advanced ukui menu

View File

@ -30,6 +30,9 @@
#include "file-utils.h"
#include <ukuisdk/kylin-com4c.h>
#include <ukuisdk/kylin-com4cxx.h>
#include "ukuistylehelper/ukuistylehelper.h"
#include "windowmanager/windowmanager.h"
#define UKUI_SERVICE "org.gnome.SessionManager"
#define UKUI_PATH "/org/gnome/SessionManager"
#define UKUI_INTERFACE "org.gnome.SessionManager"
@ -40,6 +43,9 @@ int main(int argc, char *argv[])
{
initUkuiLog4qt("ukui-menu");
g_projectCodeName = KDKGetPrjCodeName().c_str();
g_subProjectCodeName = KDKGetOSRelease("SUB_PROJECT_CODENAME").c_str();
g_platform = QGuiApplication::platformName();
qRegisterMetaType<QVector<QStringList>>("QVector<QStringList>");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
@ -69,20 +75,44 @@ int main(int argc, char *argv[])
MainWindow w;
app.setActivationWindow(&w);
if (Style::m_panelPosition == 0) {
w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + Style::m_availableScreenHeight - Style::minh - 3,
Style::minw, Style::minh));
} else if (Style::m_panelPosition == 1) {
w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + 4, Style::minw, Style::minh));
} else if (Style::m_panelPosition == 2) {
w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + 4, Style::minw, Style::minh));
} else {
w.setGeometry(QRect(Style::m_primaryScreenX + Style::m_availableScreenWidth - Style::minw - 4, Style::m_primaryScreenY + 4,
Style::minw, Style::minh));
}
w.show();
w.raise();
if (Style::m_panelPosition == 0) {
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(w.windowHandle(),QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY +
Style::m_availableScreenHeight - Style::minh - 3, Style::minw, Style::minh));
} else {
w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + Style::m_availableScreenHeight - Style::minh - 3,
Style::minw, Style::minh));
}
} else if (Style::m_panelPosition == 1) {
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(w.windowHandle(),QRect(Style::m_primaryScreenX + 4,
Style::m_primaryScreenY + 4, Style::minw, Style::minh));
} else {
w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + 4, Style::minw, Style::minh));
}
} else if (Style::m_panelPosition == 2) {
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(w.windowHandle(), QRect(Style::m_primaryScreenX + 4,
Style::m_primaryScreenY + 4, Style::minw, Style::minh));
} else {
w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + 4, Style::minw, Style::minh));
}
} else {
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(w.windowHandle(), QRect(Style::m_primaryScreenX + Style::m_availableScreenWidth -
Style::minw - 4, Style::m_primaryScreenY + 4, Style::minw, Style::minh));
} else {
w.setGeometry(QRect(Style::m_primaryScreenX + Style::m_availableScreenWidth - Style::minw - 4, Style::m_primaryScreenY + 4,
Style::minw, Style::minh));
}
}
w.update();
w.activateWindow();
w.hide();

View File

@ -27,7 +27,6 @@
<file>data/img/mainviewwidget/DM-icon-返回.svg</file>
<file>data/img/mainviewwidget/DM-icon-返回@2x.png</file>
<file>data/img/mainviewwidget/DM-icon-选项.png</file>
<file>data/img/mainviewwidget/DM-icon-选项.svg</file>
<file>data/img/mainviewwidget/DM-icon-选项@2x.png</file>
<file>data/img/mainviewwidget/DM-icon-check.png</file>
<file>data/img/mainviewwidget/DM-icon-check.svg</file>
@ -171,5 +170,6 @@
<file>data/img/sidebarwidget/usericon-lightcolor.svg</file>
<file>src/BackProcess/Search/pinyinWithoutTone.txt</file>
<file>src/BackProcess/Search/pinyinWithTone.txt</file>
<file>data/img/mainviewwidget/DM-icon-option.svg</file>
</qresource>
</RCC>

View File

@ -0,0 +1,78 @@
#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

@ -0,0 +1,29 @@
#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

@ -76,14 +76,24 @@ void TabletDirectoryChangedThread::run()
QStringList applist = setting->allKeys();
int appnum = setting->allKeys().count();
int maxindex = 0;
int minindex = 0;
for (int i = 0; i < appnum; i++) {
if (setting->value(applist.at(i)).toInt() > maxindex) {
maxindex = setting->value(applist.at(i)).toInt();
}
if(setting->value(applist.at(i)).toInt() <= minindex) {
minindex = setting->value(applist.at(i)).toInt();
}
}
if (desktopfn.contains("small-plugin-manage")){
setting->setValue(desktopfn,minindex-1);
} else {
setting->setValue(desktopfn,maxindex+1);
}
setting->setValue(desktopfn, maxindex + 1); //setting->allKeys().count()
setting->sync();
setting->endGroup();
//

View File

@ -6244,7 +6244,7 @@ QString UkuiChineseLetter::getPinyin(int code)//此方法可以获取所有汉
}
if (pinyin.isEmpty()) {
pinyin = "";
pinyin = " ";
}
return pinyin;

View File

@ -576,8 +576,6 @@ QVector<QStringList> UkuiMenuInterface::createAppInfoVector()
sql.exec(QString("select name_zh from appCategory where app_name=\"%1\" ").arg(desktopfpExecName));
if (sql.next()) {
myDebug() << "数据库执行成功";
for (int j = 0; j < vector.size(); j++) {
if (vector.at(j).contains(sql.value(0).toString())) {
appInfoList.append(QString::number(j));
@ -861,9 +859,11 @@ bool UkuiMenuInterface::initAppIni()
QVector<QStringList> tencentInitVector;
QVector<QStringList> customizedVector;
QVector<QStringList> thirdPartyVector;
QVector<QStringList> preorderAppVector;
QString tencent_math = "/usr/share/applications/tencent-math-precise-practice.desktop";
QString tencent_chinese = "/usr/share/applications/tencent-chinese-precise-practice.desktop";
QString tencent_english = "/usr/share/applications/tencent-english-precise-practice.desktop";
QString smallPluginManage = "/usr/share/applications/small-plugin-manage.desktop";
QVector<QStringList> precise_practiceVector;
QStringList math;
QStringList english;
@ -903,6 +903,8 @@ bool UkuiMenuInterface::initAppIni()
customizedVector.append(appInfoVector.at(i));
} else if (tmp.indexOf("mdm") != -1) {
customizedVector.append(appInfoVector.at(i));
} else if (tmp.contains(smallPluginManage)) {
preorderAppVector.append(appInfoVector.at(i));
} else {
appInitVector.append(appInfoVector.at(i));
}
@ -928,12 +930,22 @@ bool UkuiMenuInterface::initAppIni()
qSort(thirdPartyVector.begin(), thirdPartyVector.end(), cmpApp); //按中英文字母排序
setting->beginGroup("application");
for (int i = 0; i < preorderAppVector.count(); i++) {
QString str = preorderAppVector.at(i).at(0).section(' ', 0, 0);
QStringList list = str.split('/');
str = list[list.size() - 1];
//qDebug()<<str;
setting->setValue(str, i);
}
int firstVectorCount = preorderAppVector.count();
for (int i = 0; i < tencentInitVector.count(); i++) {
QString str = tencentInitVector.at(i).at(0).section(' ', 0, 0);
QStringList list = str.split('/');
str = list[list.size() - 1];
//qDebug()<<str;
setting->setValue(str, i);
setting->setValue(str, i + firstVectorCount);
}
int a = tencentInitVector.count();

View File

@ -7,7 +7,8 @@ INCLUDEPATH += \
$$PWD/Interface \
$$PWD/Search \
$$PWD/tablet \
$$PWD/XEventMonitor
$$PWD/XEventMonitor \
$$PWD/BuriedPoint
HEADERS += \
$$PWD/DBus/dbus-adaptor.h \
@ -24,7 +25,8 @@ HEADERS += \
$$PWD/Search/searchappthread.h \
$$PWD/XEventMonitor/xeventmonitor.h \
$$PWD/tablet/getmodeldata.h \
$$PWD/tablet/pagemanager.h
$$PWD/tablet/pagemanager.h \
$$PWD/BuriedPoint/buriedpointdatasend.h
SOURCES += \
$$PWD/DBus/dbus-adaptor.cpp \
@ -41,4 +43,9 @@ SOURCES += \
$$PWD/Search/searchappthread.cpp \
$$PWD/XEventMonitor/xeventmonitor.cpp \
$$PWD/tablet/getmodeldata.cpp \
$$PWD/tablet/pagemanager.cpp
$$PWD/tablet/pagemanager.cpp \
$$PWD/BuriedPoint/buriedpointdatasend.cpp
INCLUDEPATH += $$PWD/../
DEPENDPATH += $$PWD/../

View File

@ -1,7 +1,7 @@
#include "getmodeldata.h"
#include <QTranslator>
#include <QDir>
#include "src/UtilityFunction/utility.h"
#include "utility.h"
GetModelData::GetModelData()
{
@ -34,6 +34,28 @@ QVector<QStringList> GetModelData::getMinAllData()
return m_minAllData;
}
QStringList GetModelData::getPreCollectionApp()
{
//收藏区预置应用:设置、天气、软件商店、截图、文件管理器
QStringList preAppList = QStringList();
QStringList preAppListExist = QStringList();
preAppList << QString("/usr/share/applications/ukui-control-center.desktop")
<<QString("/usr/share/applications/kylin-weather.desktop")
<<QString("/usr/share/applications/kylin-software-center.desktop")
<<QString("/usr/share/applications/kylin-screenshot.desktop")
<<QString("/usr/share/applications/peony.desktop");
Q_FOREACH (QString appDesktop,preAppList) {
if (UkuiMenuInterface::allAppVector.contains(appDesktop)) {
preAppListExist.append(appDesktop);
QFileInfo fileInfo(appDesktop);
QString desktopfn = fileInfo.fileName();
updateDataBaseCollect(desktopfn,1);
}
}
return preAppListExist;
}
QStringList GetModelData::getcollectData()
{
m_collectData.clear();

View File

@ -59,6 +59,11 @@ public:
* @brief
*/
void loadDesktopVercor();
/**
* @brief
* @return
*/
QStringList getPreCollectionApp();
protected:
/**

View File

@ -9,34 +9,50 @@ PageManager::PageManager()
m_ukuiMenuInterface->initAppIni();
}
int PageManager::getPageNum(int appnum)
int PageManager::getPageNum(const int &appNum)
{
int pageNum = 0;
Style::appColumn = 6;
Style::appLine = 4;
if (appnum % (Style::appColumn * Style::appLine) == 0) {
pageNum = appnum / (Style::appColumn * Style::appLine);
if (appNum / (Style::appColumnFirst * Style::appLineFirst) == 0) {
pageNum = 1;
} else {
pageNum = appnum / (Style::appColumn * Style::appLine) + 1;
int appNumOtherPage = appNum - (Style::appColumnFirst * Style::appLineFirst);
if (appNumOtherPage % (Style::appColumn * Style::appLine) == 0) {
pageNum = appNumOtherPage / (Style::appColumn * Style::appLine) + 1;
} else {
pageNum = appNumOtherPage / (Style::appColumn * Style::appLine) + 2;
}
}
return pageNum;
}
QVector<QStringList> PageManager::sortAppInPage(QVector<QString> appvector)
QVector<QStringList> PageManager::sortAppInPage(const QVector<QString> &appVector)
{
QVector<QString> m_data;
QVector<QStringList> pageData;
QStringList onePageData;
Q_FOREACH (QString desktopfp, appvector) {
Q_FOREACH (QString desktopfp, appVector) {
m_data.append(desktopfp);
}
int pageSize = getPageNum(m_data.size());
onePageData.clear();
for (int i = 0; i < pageSize; i++) {
for (int j = 0; j < Style::appColumnFirst * Style::appLineFirst; j++) {
if (m_data.size() > 0) {
onePageData.append(m_data.at(0));
m_data.pop_front();
} else {
break;
}
}
pageData.append(onePageData);
for (int i = 0; i < pageSize - 1; i++) {
onePageData.clear();
for (int j = 0; j < Style::appColumn * Style::appLine; j++) {
@ -44,7 +60,6 @@ QVector<QStringList> PageManager::sortAppInPage(QVector<QString> appvector)
onePageData.append(m_data.at(0));
m_data.pop_front();
} else {
// pageData.append(onePageData);
break;
}
}

View File

@ -10,8 +10,8 @@ class PageManager : public QObject
public:
PageManager();
int getPageNum(int appnum);
QVector<QStringList> sortAppInPage(QVector<QString> appvector);
int getPageNum(const int &appNum);
QVector<QStringList> sortAppInPage(const QVector<QString> &appVector);
QVector<QStringList> getAppPageVector();
private:
UkuiMenuInterface *m_ukuiMenuInterface = nullptr;

View File

@ -89,8 +89,22 @@ void FunctionClassifyButton::paintEvent(QPaintEvent *e)
painter.setPen(Qt::NoPen);
if (!m_fullscreen) {
QColor color = option.palette.color(QPalette::Text);
color.setAlphaF(0.15);
QColor color;
if (option.state & QStyle::State_Selected) {
if (g_curStyle == "ukui-dark") {
color.setNamedColor("#33FFFFFF");
} else {
color.setNamedColor("#D1FFFFFF");
}
} else {
if (g_curStyle == "ukui-dark") {
color.setNamedColor("#1AFFFFFF");
} else {
color.setNamedColor("#8CFFFFFF");
}
}
painter.setBrush(color);
} else {
painter.setOpacity(0.15);

View File

@ -19,6 +19,7 @@
#include "letter_classify_button.h"
#include <QStylePainter>
#include <QStyleOptionButton>
#include "utility.h"
LetterClassifyButton::LetterClassifyButton(QWidget *parent,
bool fullscreen,
@ -55,8 +56,22 @@ void LetterClassifyButton::paintEvent(QPaintEvent *e)
painter.setPen(Qt::NoPen);
if (!m_fullscreen) {
QColor color = option.palette.color(QPalette::Text);
color.setAlphaF(0.15);
QColor color;
if (option.state & QStyle::State_Selected) {
if (g_curStyle == "ukui-dark") {
color.setNamedColor("#33FFFFFF");
} else {
color.setNamedColor("#D1FFFFFF");
}
} else {
if (g_curStyle == "ukui-dark") {
color.setNamedColor("#1AFFFFFF");
} else {
color.setNamedColor("#8CFFFFFF");
}
}
painter.setBrush(color);
} else {
painter.setOpacity(0.15);
@ -81,10 +96,13 @@ void LetterClassifyButton::paintEvent(QPaintEvent *e)
QStyleOptionButton subopt = option;
subopt.rect = painter.style()->subElementRect(QStyle::SE_PushButtonContents, &option, this);
// if(m_fullscreen)
// subopt.palette.setBrush(QPalette::ButtonText, QColor(Qt::white));
// else
// subopt.palette.setBrush(QPalette::HighlightedText, subopt.palette.text());
if (m_fullscreen) {
subopt.palette.setBrush(QPalette::ButtonText, QColor(Qt::white));
} else {
subopt.palette.setBrush(QPalette::HighlightedText, subopt.palette.text());
}
painter.style()->drawControl(QStyle::CE_PushButtonLabel, &subopt, &painter, this);
return;
}

View File

@ -21,6 +21,7 @@
#include "utility.h"
#include <QDebug>
#include <QDesktopServices>
#include "buriedpointdatasend.h"
ListView::ListView(QWidget *parent/*, int width, int height, int module*/):
KListView(parent)
@ -108,6 +109,12 @@ 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);
}
}
}
@ -129,8 +136,14 @@ void ListView::paintEvent(QPaintEvent *e)
{
//滚动条
QPalette p = this->verticalScrollBar()->palette();
QColor color(255, 255, 255);
color.setAlphaF(0.25);
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);

View File

@ -39,7 +39,9 @@ RightListView::~RightListView()
void RightListView::initWidget()
{
setAttribute(Qt::WA_TranslucentBackground);
viewport()->setAttribute(Qt::WA_TranslucentBackground);
viewport()->setAutoFillBackground(false);
this->setSelectionMode(QAbstractItemView::SingleSelection);
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@ -62,10 +64,10 @@ void RightListView::dropEvent(QDropEvent *event)
RightListView *source = qobject_cast<RightListView *>(event->source());
if (source && source == this) {
dropPos = event->pos();
m_dropPos = event->pos();
if (this->indexAt(dropPos).isValid()) {
QVariant var = listmodel->data(indexAt(dropPos), Qt::DisplayRole);
if (this->indexAt(m_dropPos).isValid()) {
QVariant var = listmodel->data(indexAt(m_dropPos), Qt::DisplayRole);
QString desktopfp = var.value<QString>();
QFileInfo fileInfo(desktopfp);
QString desktopfn = fileInfo.fileName();
@ -88,6 +90,11 @@ void RightListView::selectFirstItem()
}
}
void RightListView::paintEvent(QPaintEvent *e)
{
QListView::paintEvent(e);
}
void RightListView::keyPressEvent(QKeyEvent *e)
{
if (e->type() == QEvent::KeyPress) {
@ -106,6 +113,11 @@ void RightListView::keyPressEvent(QKeyEvent *e)
}
}
void RightListView::changeStyleColor(const QColor &color)
{
m_styleColor = color;
}
void RightListView::enterEvent(QEvent *e)
{
Q_UNUSED(e);

View File

@ -26,12 +26,14 @@ protected:
void keyPressEvent(QKeyEvent *e);
void dropEvent(QDropEvent *event);
void enterEvent(QEvent *e);
void paintEvent(QPaintEvent *e);
private:
RightClickMenu *menu = nullptr; //右键菜单
QStringList data;
QGSettings *gsetting;
QPoint dropPos;
QPoint m_dropPos;
QColor m_styleColor;
// bool inCurView;
@ -39,6 +41,7 @@ public Q_SLOTS:
// void rightClickedSlot(const QPoint &pos);//右键菜单
void selectFirstItem();
void changeStyleColor(const QColor &color);
Q_SIGNALS:

View File

@ -0,0 +1,38 @@
#include "rotationlabel.h"
#include <QPainter>
#include <QDebug>
RotationLabel::RotationLabel(QWidget *parent)
: QLabel(parent)
{
this->setFrameShape(QFrame::NoFrame);
this->setContentsMargins(0, 0, 0, 0);
}
void RotationLabel::setRotation(int rot)
{
m_rotation = rot;
this->update();
qDebug() << m_rotation;
}
int RotationLabel::rotation()
{
return m_rotation;
}
void RotationLabel::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
painter.setRenderHints(QPainter::SmoothPixmapTransform, true);
painter.translate(rect().width() / 2, rect().height() / 2);
painter.rotate(m_rotation);
painter.translate(-rect().width() / 2, -rect().height() / 2);
painter.drawPixmap(rect().adjusted(0, 9, 0, -9), m_pixmap);
return QLabel::paintEvent(event);
}
void RotationLabel::setIcon(const QPixmap &pixmap)
{
m_pixmap = pixmap;
}

View File

@ -0,0 +1,21 @@
#ifndef ROTATIONLABEL_H
#define ROTATIONLABEL_H
#include <QLabel>
class RotationLabel : public QLabel
{
Q_OBJECT
Q_PROPERTY(int rotation READ rotation WRITE setRotation) //旋转
public:
RotationLabel(QWidget *parent = nullptr);
void setIcon(const QPixmap &pixmap);
protected:
int rotation();
void setRotation(int rot);
void paintEvent(QPaintEvent *event);
private:
int m_rotation = 0;
QPixmap m_pixmap;
};
#endif // ROTATIONLABEL_H

View File

@ -19,3 +19,9 @@ void MenuBox::mousePressEvent(QMouseEvent *event)
return QMenu::mousePressEvent(event);
}
void MenuBox::hideEvent(QHideEvent *e)
{
Q_EMIT sendMainWinActiveSignal(true);
return QMenu::hideEvent(e);
}

View File

@ -12,6 +12,7 @@ public:
protected:
void mousePressEvent(QMouseEvent *event);
void hideEvent(QHideEvent *e) override;
public:
Q_SIGNALS:

View File

@ -25,8 +25,7 @@ TabletRightClickMenu::TabletRightClickMenu(QWidget *parent):
{
QString path = QDir::homePath() + "/.config/ukui/ukui-menu.ini";
m_setting = new QSettings(path, QSettings::IniFormat);
m_cmdProc = new QProcess;
connect(m_cmdProc, &QProcess::readyReadStandardOutput, this, &TabletRightClickMenu::onReadOutput);
sprintf(m_style, "QMenu{padding-left:2px;padding-top:6px;padding-right:2px;padding-bottom:6px;border:1px solid %s;border-radius:6px;background-color:%s;}\
QMenu::item:selected{background-color:%s;border-radius:6px;}\
QMenu::separator{height:1px;background-color:%s;margin-top:2px;margin-bottom:2px;}",
@ -35,15 +34,10 @@ TabletRightClickMenu::TabletRightClickMenu(QWidget *parent):
TabletRightClickMenu::~TabletRightClickMenu()
{
if (m_cmdProc) {
delete m_cmdProc;
}
if (m_setting) {
delete m_setting;
}
m_cmdProc = nullptr;
m_setting = nullptr;
}
@ -185,28 +179,13 @@ void TabletRightClickMenu::addToDesktopActionTriggerSlot()
void TabletRightClickMenu::uninstallActionTriggerSlot()
{
// QString cmd = QString("dpkg -S " + m_desktopfp);
// myDebug() << "void TabletRightClickMenu::uninstallActionTriggerSlot()" << m_desktopfp;
// m_cmdProc->setReadChannel(QProcess::StandardOutput);
// m_cmdProc->start("sh", QStringList() << "-c" << cmd);
// m_cmdProc->waitForFinished();
// m_cmdProc->waitForReadyRead();
// m_cmdProc->close();
onReadOutput();
QString cmd = QString("kylin-uninstaller %1")
.arg(m_desktopfp.toLocal8Bit().data());
bool ret = QProcess::startDetached(cmd);
myDebug() << "卸载:" << cmd << ret;
m_actionNumber = 6;
}
void TabletRightClickMenu::onReadOutput()
{
// QString packagestr = QString::fromLocal8Bit(m_cmdProc->readAllStandardOutput().data());
// QString packageName = packagestr.split(":").at(0);
//目前仅调用起软件商店,不传递参数
char command[100];
// sprintf(command, "kylin-software-center -remove %s", packageName.toLocal8Bit().data());
sprintf(command, "kylin-software-center");
QProcess::startDetached(command);
}
void TabletRightClickMenu::attributeActionTriggerSlot()
{
char command[100];

View File

@ -76,8 +76,6 @@ private:
char m_style[400];
QProcess *m_cmdProc = nullptr;
protected:
/**
* @brief Get icon pixmap
@ -150,10 +148,6 @@ private Q_SLOTS:
* @brief Personalize this list
*/
//void otherListActionTriggerSlot();
/**
* @brief Read command output
*/
void onReadOutput();
};
#endif // RIGHTCLICKMENU_H

View File

@ -20,7 +20,7 @@
#include <QPushButton>
#include <syslog.h>
#include <QToolTip>
#include "src/UtilityFunction/utility.h"
#include "utility.h"
ItemDelegate::ItemDelegate(QObject *parent, int module):
KItemDelegate(parent)
@ -58,8 +58,22 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
painter->setRenderHint(QPainter::Antialiasing);
if ((option.state & QStyle::State_MouseOver) || (option.state & QStyle::State_HasFocus)) {
QColor color = option.palette.text().color();
color.setAlphaF(0.15);
QColor color;
if (option.state & QStyle::State_Selected) {
if (g_curStyle == "ukui-dark") {
color.setNamedColor("#33FFFFFF");
} else {
color.setNamedColor("#D1FFFFFF");
}
} else {
if (g_curStyle == "ukui-dark") {
color.setNamedColor("#1AFFFFFF");
} else {
color.setNamedColor("#8CFFFFFF");
}
}
painter->save();
painter->setPen(QPen(Qt::NoPen));
painter->setBrush(color);
@ -153,10 +167,13 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
// QRect textRect=QRect(rect.x()+11,rect.y()+12,rect.width(),rect.height());
QRect textRect = QRect(rect.x() + 11, rect.y(), rect.width(), rect.height());
painter->drawText(textRect, Qt::AlignVCenter, strlist.at(0));
painter->setRenderHint(QPainter::Antialiasing, true);
painter->setPen(QPen(QColor(option.palette.text().color()), 1));
painter->setOpacity(0.1);
painter->drawLine(QPoint(5, rect.bottom()), QPoint(rect.right(), rect.bottom()));
painter->setRenderHints(QPainter::SmoothPixmapTransform, true);
QPixmap pixmap = getCurIcon(":/data/img/mainviewwidget/DM-icon-option.svg", true).pixmap(QSize(16, 16));
if ((option.state & QStyle::State_MouseOver) || (option.state & QStyle::State_HasFocus)) {
painter->drawPixmap(rect.width() - 25, rect.y() + 15, pixmap);
}
painter->restore();
}
} else if (module == -1) {
@ -279,7 +296,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
QString desktopfn = fileInfo.fileName();
if (checkIfLocked(desktopfn)) {
QIcon icon(QString(":/data/img/mainviewwidget/lock.svg"));
QIcon icon = getCurIcon(":/data/img/mainviewwidget/lock.svg", true);
icon.paint(painter, QRect(rect.topRight().x() - 22, rect.y() + (rect.height() - 16) / 2, 16, 16));
}

View File

@ -1,5 +1,5 @@
#include "right_item_delegate.h"
#include "src/UtilityFunction/utility.h"
#include "utility.h"
#include <QDebug>
RightItemDelegate::RightItemDelegate(QObject *parent):
@ -37,16 +37,27 @@ void RightItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt
painter->setRenderHint(QPainter::Antialiasing);
painter->save();
painter->setPen(QPen(Qt::NoPen));
painter->setBrush(option.palette.base().color());
if ((option.state & QStyle::State_MouseOver) || (option.state & QStyle::State_HasFocus)) {
if (option.state & QStyle::State_Selected) {
painter->setOpacity(0.8);
if (g_curStyle == "ukui-dark") {
painter->setBrush(QColor("#7A000000"));
} else {
painter->setBrush(QColor("#BFFFFFFF"));
}
} else {
painter->setOpacity(0.6);
if (g_curStyle == "ukui-dark") {
painter->setBrush(QColor("#66000000"));
} else {
painter->setBrush(QColor("#99FFFFFF"));
}
}
} else {
painter->setOpacity(0.4);
if (g_curStyle == "ukui-dark") {
painter->setBrush(QColor("#40000000"));
} else {
painter->setBrush(QColor("#66FFFFFF"));
}
}
painter->drawPath(path);

View File

@ -33,7 +33,6 @@ TabletFullItemDelegate::TabletFullItemDelegate(QObject *parent, int module):
settt = new QSettings(pathini, QSettings::IniFormat);
QString path = QDir::homePath() + "/.config/ukui/ukui-menu.ini";
setting = new QSettings(path, QSettings::IniFormat);
// qDebug() << "---------------------gengxinleziti---------------------";
}
TabletFullItemDelegate::~TabletFullItemDelegate()
@ -73,11 +72,6 @@ void TabletFullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
QString appname = pUkuiMenuInterface->getAppName(desktopfp);
QRect iconRect;
QRect textRect;
// QString desktopfn=desktopfp.split('/').last();
// setting->beginGroup("groupname");
// bool iscontain=setting->contains(desktopfn);
// setting->sync();
// setting->endGroup();
if (iconFileInfo.isFile() && (iconstr.endsWith(".png") || iconstr.endsWith(".svg"))) {
icon = QIcon(iconstr);
@ -118,28 +112,27 @@ void TabletFullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
}
bool bigIcon = index.data(Qt::UserRole + 2).toBool();
int iconTopSpace = (rect.height() - Style::AppListIconSize) / 2;
int iconLeftSpace = (rect.width() - Style::AppListIconSize) / 2;
if (bigIcon) {
iconRect = QRect(rect.x() + Style::AppLeftSpace - 6, //94
rect.y() + Style::AppTopSpace - 6, //60
Style::AppListIconSize + 12,//96
iconRect = QRect(rect.x() + iconLeftSpace - 6,
rect.y() + iconTopSpace - 6,
Style::AppListIconSize + 12,
Style::AppListIconSize + 12);
textRect = QRect(rect.x(),
iconRect.bottom() /*- 3*/,
rect.bottom() - iconTopSpace,
rect.width(),
rect.height() - iconRect.height() - Style::AppTopSpace - 30);
// QPixmap pixmap;
// pixmap = icon.pixmap((Style::AppListIconSize+20,Style::AppListIconSize+20));//wgx
// icon=QIcon(pixmap);
iconTopSpace);
} else {
iconRect = QRect(rect.x() + Style::AppLeftSpace,
rect.y() + Style::AppTopSpace,
iconRect = QRect(rect.x() + iconLeftSpace,
rect.y() + iconTopSpace,
Style::AppListIconSize,
Style::AppListIconSize);
textRect = QRect(rect.x(),
iconRect.bottom(),
rect.bottom() - iconTopSpace,
rect.width(),
rect.height() - iconRect.height() - Style::AppTopSpace - 30);
iconTopSpace);
}
QString str;

View File

@ -20,6 +20,7 @@
#include <QDesktopWidget>
#include "style.h"
#include "utility.h"
#include "buriedpointdatasend.h"
#include <QDebug>
FullCommonUseWidget::FullCommonUseWidget(QWidget *parent) :
@ -131,6 +132,11 @@ 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)
@ -138,6 +144,11 @@ void FullCommonUseWidget::on_powerOffButton_customContextMenuRequested(const QPo
RightClickMenu m_otherMenu(this);
m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos));
myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始";
pointDataStruct pointData;
pointData.module = "fullWindow/commonUseWidget/powerOffButton";
pointData.function = "RightClicked";
pointData.functionNum = "";
BuriedPointDataSend::getInstance()->setPoint(pointData);
}
void FullCommonUseWidget::initAppListWidget()
@ -190,6 +201,12 @@ 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,6 +23,7 @@
#include <QDebug>
#include <QSvgRenderer>
#include <QPainter>
#include "buriedpointdatasend.h"
FullFunctionWidget::FullFunctionWidget(QWidget *parent) :
QWidget(parent)
@ -151,6 +152,11 @@ 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)
@ -158,6 +164,11 @@ void FullFunctionWidget::on_powerOffButton_customContextMenuRequested(const QPoi
RightClickMenu m_otherMenu(this);
m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos));
myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始";
pointDataStruct pointData;
pointData.module = "fullWindow/FullFunctionWidget/powerOffButton";
pointData.function = "RightClicked";
pointData.functionNum = "";
BuriedPointDataSend::getInstance()->setPoint(pointData);
}
@ -218,6 +229,12 @@ 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)

View File

@ -19,6 +19,7 @@
#include "full_letter_widget.h"
#include <QDebug>
#include <syslog.h>
#include "buriedpointdatasend.h"
FullLetterWidget::FullLetterWidget(QWidget *parent) :
QWidget(parent)
@ -145,6 +146,11 @@ 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)
@ -152,6 +158,11 @@ void FullLetterWidget::on_powerOffButton_customContextMenuRequested(const QPoint
RightClickMenu m_otherMenu(this);
m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos));
qDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始";
pointDataStruct pointData;
pointData.module = "fullWindow/FullLetterWidget/powerOffButton";
pointData.function = "RightClicked";
pointData.functionNum = "";
BuriedPointDataSend::getInstance()->setPoint(pointData);
}
void FullLetterWidget::setFocusToThis()
@ -222,6 +233,12 @@ 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)

View File

@ -20,6 +20,7 @@
#include "style.h"
#include "utility.h"
#include <QDebug>
#include "buriedpointdatasend.h"
FullSearchResultWidget::FullSearchResultWidget(QWidget *parent) :
QWidget(parent)
@ -120,6 +121,11 @@ 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)
@ -127,6 +133,11 @@ void FullSearchResultWidget::on_powerOffButton_customContextMenuRequested(const
RightClickMenu m_otherMenu(this);
m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos));
myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始";
pointDataStruct pointData;
pointData.module = "fullWindow/FullSearchResultWidget/powerOffButton";
pointData.function = "RightClicked";
pointData.functionNum = "";
BuriedPointDataSend::getInstance()->setPoint(pointData);
}
void FullSearchResultWidget::initAppListWidget()
@ -153,6 +164,12 @@ 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)

View File

@ -10,6 +10,7 @@
#include <QPluginLoader>
#include "currenttime_interface.h"
#include "style.h"
#include "utility.h"
#include <QtSvg/QSvgRenderer>
#define TIME_FORMAT "org.ukui.control-center.panel.plugins"
#define TIME_FORMAT_KEY "hoursystem"
@ -153,11 +154,12 @@ void FunctionWidget::initUi()
this->setStyleSheet("border:0px solid #ff0000;background:transparent;");
this->setFocusPolicy(Qt::NoFocus);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setSpacing(0);
mainLayout->setSpacing(10);
mainLayout->setContentsMargins(5, 0, 0, 0);
this->setLayout(mainLayout);
//时间+搜索框
//时间
upWidget = new QWidget();
upWidget->setFixedSize(400, 232);
upWidget->setFixedSize(400, 96);
upLayout = new QVBoxLayout();
upWidget->setLayout(upLayout);
upLayout->setContentsMargins(0, 0, 0, 32);
@ -184,13 +186,6 @@ void FunctionWidget::initUi()
upRightLayout->setContentsMargins(0, 0, 0, 0);
upRightLayout->setSpacing(0);
// upRightWidget->setStyleSheet("border-width:1px;border-style:solid;border-color:red");
//左下
downWidget = new QWidget;
downLayout = new QVBoxLayout();
downWidget->setLayout(downLayout);
downWidget->setFixedSize(400, 104);
downLayout->setSpacing(0);
downLayout->setContentsMargins(0, 24, 0, 0);
//左侧控件
timeLabel = new QLabel();
weekLabel = new QLabel();
@ -205,17 +200,19 @@ void FunctionWidget::initUi()
QDBusReply<QString> styleName = usrInterface->call(QString("get_current_stylename"));
changeSearchBoxBackground(styleName);
connect(searchEditBtn, &QPushButton::clicked, this, &FunctionWidget::obtainSearchResult);
downLayout->addWidget(searchEditBtn);
upLayout->addWidget(leftUpWidget);
upLayout->addWidget(downWidget);
mainLayout->addWidget(upWidget);
mainLayout->addStretch();
if (g_subProjectCodeName.contains("mavis")) {
upWidget->setFixedSize(0, 0);
} else {
mainLayout->addWidget(upWidget);
}
mainLayout->addWidget(searchEditBtn);
focusPlug = new pluginwidget(this);
//加入专注模式
// if(plugin)
// {
mainLayout->addWidget(focusPlug);
focusPlug->setFixedSize(400, 638);
// }
mainLayout->addStretch();
leftUpLayout->addWidget(upLeftWidget);
leftUpLayout->addWidget(upRightWidget);

View File

@ -35,7 +35,6 @@ private:
QGSettings *timeSetting = nullptr;
QString themeName;
QObject *plugin = nullptr;
AbstractInterface *app;
QGraphicsDropShadowEffect *effect;
QPalette palette;
QTimer *myTimer = nullptr;

View File

@ -48,9 +48,8 @@ void FunctionButtonWidget::initUi()
{
this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
this->setAttribute(Qt::WA_StyledBackground, true);
this->resize(Style::LeftBtnWidth * 2 + 5, Style::LeftBtnHeight * 6 + 25);
QGridLayout *gridLayout = new QGridLayout;
gridLayout->setContentsMargins(0, 0, 0, 0);
gridLayout->setContentsMargins(40, 80, 40, 80);
gridLayout->setSpacing(5);
this->setLayout(gridLayout);

View File

@ -35,9 +35,8 @@ void LetterButtonWidget::initUi()
this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
this->setAttribute(Qt::WA_StyledBackground, true);
this->setFocusPolicy(Qt::NoFocus);
this->resize(235, 366);
QGridLayout *gridLayout = new QGridLayout;
gridLayout->setContentsMargins(0, 0, 0, 0);
gridLayout->setContentsMargins(35, 80, 35, 80);
gridLayout->setSpacing(5);
this->setLayout(gridLayout);
QStringList letterlist;
@ -51,13 +50,13 @@ void LetterButtonWidget::initUi()
letterlist.append("&&");
letterlist.append("#");
for (int row = 0; row < 7; row++) {
for (int col = 0; col < 4; col++) {
if (row * 4 + col < letterlist.size()) {
LetterClassifyButton *btn = new LetterClassifyButton(this, false, letterlist.at(row * 4 + col));
for (int row = 0; row < 6; row++) {
for (int col = 0; col < 5; col++) {
if (row * 5 + col < letterlist.size()) {
LetterClassifyButton *btn = new LetterClassifyButton(this, false, letterlist.at(row * 5 + col));
btn->setFlat(true);
btn->setCheckable(false);
btn->setFixedSize(55, 48);
btn->setFixedSize(38, 38);
gridLayout->addWidget(btn, row, col);
connect(btn, &LetterClassifyButton::buttonClicked, this, &LetterButtonWidget::letterBtnClickedSlot);
} else {

View File

@ -42,9 +42,20 @@ MainViewWidget::~MainViewWidget()
{
}
void MainViewWidget::styleChangeSlot(const QString &style)
{
m_curStyle = style;
if (style == "ukui-dark") {
m_backColor.setNamedColor("#800D0D0D");
} else {
m_backColor.setNamedColor("#94FFFFFF");
}
}
void MainViewWidget::paintEvent(QPaintEvent *event)
{
double transparency = getTransparency();
// double transparency = getTransparency();
QRect rect = this->rect();
QPainterPath path;
QPainter painter(this);
@ -60,11 +71,8 @@ void MainViewWidget::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(this->palette().base());
painter.setPen(Qt::transparent);
painter.setOpacity(transparency + 0.1);
painter.fillPath(path, this->palette().base());
// setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon()));
// KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
painter.setOpacity(0.58);
painter.fillPath(path, m_backColor);
QWidget::paintEvent(event);
}

View File

@ -55,12 +55,16 @@ protected:
void paintEvent(QPaintEvent *event);
public Q_SLOTS:
void styleChangeSlot(const QString &style);
Q_SIGNALS:
void directoryChangedSignal();
void sendDirectoryPath();
private:
QString m_curStyle;
QColor m_backColor;
};
#endif // MAINVIEWWIDGET_H

View File

@ -2,7 +2,8 @@
#include <KWindowEffects>
#include <QAction>
#include <QTranslator>
#include "src/UtilityFunction/utility.h"
#include "utility.h"
#include "buriedpointdatasend.h"
FullMainWindow::FullMainWindow(QWidget *parent) :
QMainWindow(parent)
@ -41,7 +42,7 @@ FullMainWindow::FullMainWindow(QWidget *parent) :
queryWidLayout->setSpacing(5);
m_queryWid->setLayout(queryWidLayout);
char style[200];
QPixmap pixmap = loadSvg(QString(":/data/img/mainviewwidget/search.svg"), 16);
QPixmap pixmap = loadSvg(QString(":/data/img/mainviewwidget/full-search.svg"), 16);
if (QGSettings::isSchemaInstalled(QString("org.ukui.style").toLocal8Bit())) {
QGSettings *gsetting = new QGSettings("org.ukui.style", QByteArray(), this);
@ -225,6 +226,11 @@ void FullMainWindow::changeStyle()
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)
@ -250,6 +256,11 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)
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);
@ -425,6 +436,8 @@ void FullMainWindow::on_fullSelectMenuButton_clicked()
void FullMainWindow::on_fullSelectMenuButton_triggered(QAction *arg1)
{
pointDataStruct pointData;
if (arg1 == m_allAction) {
m_fullStackedWidget->setCurrentIndex(0);
m_fullCommonPage->repaintWidget();
@ -434,6 +447,10 @@ void FullMainWindow::on_fullSelectMenuButton_triggered(QAction *arg1)
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();
@ -442,6 +459,10 @@ void FullMainWindow::on_fullSelectMenuButton_triggered(QAction *arg1)
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();
@ -450,6 +471,10 @@ void FullMainWindow::on_fullSelectMenuButton_triggered(QAction *arg1)
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

@ -33,6 +33,7 @@
#include <QGroupBox>
#include <QEventLoop>
#include <QLabel>
#include "buriedpointdatasend.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
@ -49,19 +50,19 @@ MainWindow::MainWindow(QWidget *parent) :
//左侧
m_viewWidget = new MainViewWidget(m_centralwidget);
m_mainLeftVerticalLayout = new QVBoxLayout(m_viewWidget);
m_mainLeftVerticalLayout->setSpacing(0);
m_mainLeftVerticalLayout->setContentsMargins(8, 8, 0, 0);
m_mainLeftVerticalLayout->setSpacing(9);
m_mainLeftVerticalLayout->setContentsMargins(8, 15, 4, 0);
//搜索框部分
m_topStackedWidget = new QStackedWidget(m_viewWidget);
m_topStackedWidget->setFixedHeight(48);
m_topStackedWidget->setFixedHeight(34);
//搜索框收起页
m_minMenuPage = new QWidget();
m_minMenuPage->setMinimumSize(QSize(0, 48));
m_minMenuPage->setMinimumSize(QSize(0, 34));
m_letfTopSelectHorizontalLayout = new QHBoxLayout(m_minMenuPage);
m_letfTopSelectHorizontalLayout->setSpacing(8);
m_letfTopSelectHorizontalLayout->setContentsMargins(8, 0, 8, 12);
m_letfTopSelectHorizontalLayout->setSpacing(2);
m_letfTopSelectHorizontalLayout->setContentsMargins(8, 0, 4, 0);
m_minSelectTextLabel = new QLabel(m_minMenuPage);
m_horizontalSpacer = new QSpacerItem(68, 10, QSizePolicy::Expanding, QSizePolicy::Minimum);
m_horizontalSpacer = new QSpacerItem(58, 10, QSizePolicy::Expanding, QSizePolicy::Minimum);
m_searchPushButton = new QPushButton(m_minMenuPage);
// m_searchPushButton->setStyleSheet(m_buttonStyle.arg("QPushButton"));
m_searchPushButton->setFixedSize(QSize(26, 26));
@ -71,20 +72,21 @@ MainWindow::MainWindow(QWidget *parent) :
m_minSelectButton->setFixedSize(QSize(26, 26));
m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-all.svg", true));
m_minSelectButton->installEventFilter(this);
m_selectMenuButton = new QToolButton(m_minMenuPage);
m_selectMenuButton = new RotationLabel(m_minMenuPage);
m_selectMenuButton->installEventFilter(this);
m_selectMenuButton->setStyleSheet("background: transparent;");
m_selectMenuButton->setFixedSize(QSize(16, 26));
m_selectMenuButton->setFixedSize(QSize(8, 26));
m_selectMenuButton->setAcceptDrops(true);
m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-arrow.svg", true));
m_selectMenuButton->setPopupMode(QToolButton::InstantPopup);
// m_selectMenuButton->setStyleSheet(QString::fromUtf8("QToolButton::menu-indicator { image: None; }"));
m_selectMenuButton->setFocusPolicy(Qt::StrongFocus);
m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/downarrow.svg", true)
.pixmap(QSize(Style::miniIconSize, Style::miniIconSize)));
//搜索框展开页
m_minSearchPage = new QWidget();
m_leftTopSearchHorizontalLayout = new QHBoxLayout(m_minSearchPage);
m_leftTopSearchHorizontalLayout->setContentsMargins(8, 0, 8, 12);
m_leftTopSearchHorizontalLayout->setContentsMargins(8, 0, 8, 0);
m_lineEdit = new QLineEdit(m_minSearchPage);
m_lineEdit->setMinimumSize(QSize(30, 26));
m_lineEdit->setStyleSheet(QString::fromUtf8("border-radius: 13px; border:2px solid rgba(5, 151, 255, 1); background: transparent;"));
m_lineEdit->setStyleSheet(QString::fromUtf8("border-radius: 13px; border:1px solid rgba(5, 151, 255, 1); background: transparent;"));
m_lineEdit->setFrame(false);
m_lineEdit->setPlaceholderText(tr("Search"));
m_cancelSearchPushButton = new QPushButton(m_minSearchPage);
@ -127,19 +129,21 @@ MainWindow::MainWindow(QWidget *parent) :
//右侧窗口
m_mainRightVerticalLayout = new QVBoxLayout();
m_mainRightVerticalLayout->setSpacing(0);
m_mainRightVerticalLayout->setContentsMargins(8, 8, 8, 8);
m_mainRightVerticalLayout->setContentsMargins(8, 6, 8, 8);
m_mainRightVerticalLayout_1 = new QVBoxLayout();
m_rightTopHorizontalLayout = new QHBoxLayout();
m_rightTopHorizontalLayout->setSpacing(30);
m_rightTopHorizontalLayout->setContentsMargins(8, 0, 10, 0);
//收藏按键
m_collectPushButton = new QLabel(m_centralwidget);
m_collectPushButton->setFocusPolicy(Qt::StrongFocus);
m_collectPushButton->setFixedHeight(34);
// m_collectPushButton->setFlat(true);
m_collectPushButton->installEventFilter(this);
//最近按键
m_recentPushButton = new QLabel(m_centralwidget);
m_recentPushButton->setFixedHeight(34);
m_recentPushButton->setFocusPolicy(Qt::StrongFocus);
// m_recentPushButton->setFlat(true);
m_recentPushButton->installEventFilter(this);
m_horizontalSpacer_3 = new QSpacerItem(332, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
@ -160,7 +164,7 @@ MainWindow::MainWindow(QWidget *parent) :
m_collectPage = new QWidget();
m_collectPage->setFixedSize(QSize(324, 480));
m_rightCollectLayout = new QVBoxLayout(m_collectPage);
m_rightCollectLayout->setContentsMargins(0, 0, 0, 0);
m_rightCollectLayout->setContentsMargins(0, 18, 0, 0);
//收藏视图
m_collectListView = new RightListView(m_collectPage);
m_collectListView->setFixedSize(QSize(324, 428));
@ -182,7 +186,12 @@ MainWindow::MainWindow(QWidget *parent) :
//最近视图
m_recentListView = new ListView(m_recentPage);
m_recentListView->installEventFilter(this);
m_recentListView->setFixedSize(QSize(324, 470));
m_recentListView->setFixedSize(QSize(Style::rightViewWidth, Style::rightViewHeight));
m_recentTextlabel = new QLabel(m_recentPage);
m_recentTextlabel->setFixedSize(QSize(Style::rightViewWidth, Style::rightViewHeight));
m_recentTextlabel->setAlignment(Qt::AlignCenter);
m_recentTextlabel->setText(QApplication::translate("MainWindow", "No recent files"));
m_rightStackedWidget->addWidget(m_collectPage);
m_rightStackedWidget->addWidget(m_recentPage);
m_verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
@ -190,26 +199,30 @@ MainWindow::MainWindow(QWidget *parent) :
m_rightBottomHorizontalLayout->setSizeConstraint(QLayout::SetDefaultConstraint);
m_rightBottomHorizontalLayout->setContentsMargins(0, 0, 8, 0);
m_horizontalSpacer_2 = new QSpacerItem(332, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
m_horizontalSpacer_4 = new QSpacerItem(10, 10, QSizePolicy::Minimum, QSizePolicy::Minimum);
m_powerOffButton = new QPushButton(m_centralwidget);
m_powerOffButton->setFixedSize(QSize(24, 24));
m_powerOffButton->setFixedSize(QSize(32, 32));
m_powerOffButton->setContextMenuPolicy(Qt::CustomContextMenu);
m_powerOffButton->setIcon(QIcon(":/data/img/mainviewwidget/power.svg"));
m_powerOffButton->setIconSize(QSize(24, 24));
m_powerOffButton->setFlat(true);
m_powerOffButton->installEventFilter(this);
m_letfTopSelectHorizontalLayout->addWidget(m_minSelectTextLabel);
m_letfTopSelectHorizontalLayout->addItem(m_horizontalSpacer);
m_letfTopSelectHorizontalLayout->addWidget(m_searchPushButton);
m_letfTopSelectHorizontalLayout->addItem(m_horizontalSpacer_4);
m_letfTopSelectHorizontalLayout->addWidget(m_minSelectButton);
m_letfTopSelectHorizontalLayout->addWidget(m_selectMenuButton);
m_leftTopSearchHorizontalLayout->addWidget(m_lineEdit);
m_leftTopSearchHorizontalLayout->addWidget(m_cancelSearchPushButton);
m_mainLeftVerticalLayout->addWidget(m_topStackedWidget);
m_mainLeftVerticalLayout->addWidget(m_leftStackedWidget);
m_mainLeftVerticalLayout->addStretch();
m_mainRightVerticalLayout_1->addLayout(m_rightTopHorizontalLayout);
m_rightCollectLayout->addItem(m_verticalSpacer);
m_rightCollectLayout->addWidget(m_collectListView);
m_rightCollectLayout->addItem(m_verticalSpacer_2);
m_rightRecentLayout->addWidget(m_recentListView);
m_rightRecentLayout->addWidget(m_recentTextlabel);
m_mainRightVerticalLayout_1->addWidget(m_rightStackedWidget);
m_rightBottomHorizontalLayout->addItem(m_horizontalSpacer_2);
m_rightBottomHorizontalLayout->addWidget(m_powerOffButton);
@ -223,6 +236,8 @@ MainWindow::MainWindow(QWidget *parent) :
m_minSelectButton->setText(QString());
m_selectMenuButton->setText(QString());
m_cancelSearchPushButton->setText(QString());
QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2);
m_collectPushButton->setFont(collectFont);
m_collectPushButton->setText(QApplication::translate("MainWindow", "collection", nullptr));
m_recentPushButton->setText(QApplication::translate("MainWindow", "recent", nullptr));
m_minMaxChangeButton->setToolTip(QApplication::translate("MainWindow", "Max", nullptr));
@ -309,29 +324,50 @@ MainWindow::MainWindow(QWidget *parent) :
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();
// m_collectPushButton->clicked(true);
pointDataStruct pointData;
pointData.module = "mainWindow";
pointData.function = "winShow";
pointData.functionNum = "";
BuriedPointDataSend::getInstance()->setPoint(pointData);
on_collectPushButton_clicked();
m_viewWidget->setFocus();
} else {
m_fullWindow->show();
// fullWindow->raise();
// fullWindow->raise();
m_fullWindow->activateWindow();
pointDataStruct pointData;
pointData.module = "fullWindow";
pointData.function = "winShow";
pointData.functionNum = "";
BuriedPointDataSend::getInstance()->setPoint(pointData);
}
}
});
m_maxAnimation = new QPropertyAnimation(&m_animationPage, "geometry");
m_minAnimation = new QPropertyAnimation(&m_animationPage, "geometry");
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);
@ -340,11 +376,14 @@ MainWindow::MainWindow(QWidget *parent) :
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_selectMenuButton, &QToolButton::triggered, this, &MainWindow::on_selectMenuButton_triggered);
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_collectPushButton, &QPushButton::clicked, this, &MainWindow::on_collectPushButton_clicked);
// connect(m_recentPushButton, &QPushButton::clicked, this, &MainWindow::on_recentPushButton_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);
@ -375,7 +414,7 @@ MainWindow::MainWindow(QWidget *parent) :
m_lineEdit->setParent(nullptr);
m_leftTopSearchHorizontalLayout->addWidget(m_lineEdit);
m_leftTopSearchHorizontalLayout->addWidget(m_cancelSearchPushButton);
m_lineEdit->setPlaceholderText("搜索应用");
m_lineEdit->setPlaceholderText(QApplication::translate("MainWindow", "Search application"));
m_fullWindow->updateView();
}
@ -399,6 +438,11 @@ MainWindow::MainWindow(QWidget *parent) :
MainWindow::~MainWindow()
{
closeDataBase("MainThread");
if (m_animationPage != nullptr) {
delete m_animationPage;
m_animationPage = nullptr;
}
}
void MainWindow::initUi()
@ -412,25 +456,38 @@ void MainWindow::initUi()
m_minAllListView->addData(m_modaldata->getMinAllData(), 0);
m_minFuncListView->addData(m_modaldata->getMinFuncData(), 1);
m_minLetterListView->addData(m_modaldata->getMinLetterData(), 2);
m_collectListView->addData(m_modaldata->getcollectData());
m_recentListView->addData(m_modaldata->getRecentData(), -1);
QMenu *m_menu = new QMenu;
m_allAction = new QAction(m_menu);
m_letterAction = new QAction(m_menu);
m_funcAction = new QAction(m_menu);
if (dataBaseIsEmpty()) {
m_collectListView->addData(m_modaldata->getPreCollectionApp());
} else {
m_collectListView->addData(m_modaldata->getcollectData());
}
QVector<QStringList> recentFile = m_modaldata->getRecentData();
m_recentListView->addData(recentFile , -1);
if (recentFile.isEmpty()) {
m_recentListView->hide();
} else {
m_recentTextlabel->hide();
}
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);
m_selectMenuButton->setMenu(m_menu);
m_collectPushButton->setStyleSheet("color:#3790FA;");
// m_collectPushButton->setStyleSheet("border: 1px solid red;");
QColor textColor = this->palette().color(QPalette::Text);
QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue());
QString textColorDefault = "#" + QString::number(rgbDefault, 16);
@ -450,6 +507,7 @@ void MainWindow::initUi()
connect(m_collectListView, &RightListView::sendCollectViewUpdate, this, &MainWindow::updateCollectView);
connect(m_desktopWatcher, &DesktopWatcher::directoryChangedSignal, this, &MainWindow::updateView);
connect(m_desktopWatcher, &DesktopWatcher::updateRecentList, this, &MainWindow::updateRecentView);
connect(this, &MainWindow::sendStyleChangeSignal, m_viewWidget, &MainViewWidget::styleChangeSlot);
changeStyle();
}
@ -467,10 +525,17 @@ void MainWindow::changeStyle()
if (gsetting.keys().contains(QString("styleName"))) {
if (gsetting.get("style-name").toString() == "ukui-light"
|| gsetting.get("style-name").toString() == "ukui-default") {
g_curStyle = "ukui-light";
buttonColorDefault = "rgba(16, 23, 29, 0.06)";
buttonColorHover = "rgba(16, 23, 29, 0.12)";
buttonColorPress = "rgba(16, 23, 29, 0.17)";
m_windowColor.setNamedColor("#C7E9EEF2");
Q_EMIT sendStyleChangeSignal("ukui-light");
m_powerOffButton->setStyleSheet("QPushButton {padding: 0px;}"
"QPushButton:hover {border-radius:16px; background: rgba(255, 255, 255, 0.4);}"
"QPushButton:pressed {border-radius:16px; background: rgba(255, 255, 255, 0.65);}");
} else {
g_curStyle = "ukui-dark";
buttonColor = linePe.color(QPalette::Light);
QRgb rgbDefault = qRgba(buttonColor.red(), buttonColor.green(), buttonColor.blue(), 25);
buttonColorDefault = "#" + QString::number(rgbDefault, 16);
@ -478,6 +543,11 @@ void MainWindow::changeStyle()
buttonColorHover = "#" + QString::number(rgbHover, 16);
QRgb rgbPress = qRgba(buttonColor.red(), buttonColor.green(), buttonColor.blue(), 75);
buttonColorPress = "#" + QString::number(rgbPress, 16);
m_windowColor.setNamedColor("#FF383838");
Q_EMIT sendStyleChangeSignal("ukui-dark");
m_powerOffButton->setStyleSheet("QPushButton {padding: 0px;}"
"QPushButton:hover {border-radius:16px; background: rgba(255, 255, 255, 0.12);}"
"QPushButton:pressed {border-radius:16px; background: rgba(255, 255, 255, 0.25);}");
}
}
}
@ -488,10 +558,7 @@ void MainWindow::changeStyle()
m_searchPushButton->setStyleSheet(m_buttonStyle.arg("QPushButton"));
m_minSelectButton->setStyleSheet(m_buttonStyle.arg("QPushButton"));
m_cancelSearchPushButton->setStyleSheet(m_buttonStyle.arg("QPushButton"));
m_powerOffButton->setStyleSheet("QPushButton {padding: 0px;}"
"QPushButton:hover {border-radius:12px; background: rgba(255, 255, 255, 0.2);}"
"QPushButton:pressed {border-radius:12px; background: rgba(255, 255, 255, 0.3);}");
m_searchPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/search.svg", true));
m_searchPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/full-search.svg", true));
QAction *lineAction = m_lineEdit->actions().at(0);
if (lineAction != nullptr) {
@ -501,7 +568,7 @@ void MainWindow::changeStyle()
}
QAction *action = new QAction();
action->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-icon-search.svg", true));
action->setIcon(getCurIcon(":/data/img/mainviewwidget/full-search.svg", true));
m_lineEdit->addAction(action, QLineEdit::LeadingPosition);
m_cancelSearchPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-close-2x.png", true));
@ -533,7 +600,7 @@ 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(this->palette().base());
painter.setBrush(m_windowColor);
painter.setPen(Qt::transparent);
painter.setOpacity(transparency);
painter.drawPath(path);
@ -581,7 +648,7 @@ bool MainWindow::event(QEvent *event)
if (m_minSelectButton->hasFocus()) {
m_minSelectButton->click();
} else if (m_selectMenuButton->hasFocus()) {
m_selectMenuButton->click();
QApplication::postEvent(m_selectMenuButton, new QEvent(QEvent::MouseButtonPress));
}
if (m_lineEdit->hasFocus()) {
@ -603,6 +670,7 @@ bool MainWindow::event(QEvent *event)
void MainWindow::minAnimationFinished()
{
this->show();
setMinWindowPos();
this->raise();
this->activateWindow();
m_viewWidget->setFocus();
@ -611,8 +679,16 @@ void MainWindow::minAnimationFinished()
QEventLoop loop;
QTimer::singleShot(100, &loop, SLOT(quit()));
loop.exec();
m_animationPage.hide();
m_animationPage->hide();
}
void MainWindow::iconAnimationFinished()
{
m_dropDownMenu->raise();
m_dropDownMenu->exec(m_selectMenuButton->mapToGlobal(QPoint(m_selectMenuButton->width()
-Style::DropMenuWidth + 5, 29)));
}
void MainWindow::maxAnimationFinished()
{
m_fullWindow->raise();
@ -621,7 +697,7 @@ void MainWindow::maxAnimationFinished()
QEventLoop loop;
QTimer::singleShot(100, &loop, SLOT(quit()));
loop.exec();
m_animationPage.hide();
m_animationPage->hide();
}
void MainWindow::resetLetterPage()
{
@ -725,6 +801,9 @@ void MainWindow::animationFinishedSLot()
}
void MainWindow::on_minSelectButton_clicked()
{
// selectIconAnimation(true);
selectIconAnimation(false);
if (m_leftStackedWidget->currentIndex() == 0) {
on_selectMenuButton_triggered(m_letterAction);
} else if (m_leftStackedWidget->currentIndex() == 1) {
@ -733,6 +812,30 @@ void MainWindow::on_minSelectButton_clicked()
on_selectMenuButton_triggered(m_allAction);
}
}
void MainWindow::selectIconAnimation(const bool &flag)
{
iconAnimation = new QPropertyAnimation(m_selectMenuButton, "rotation", this);
if (flag) {
connect(iconAnimation, &QPropertyAnimation::finished, this, &MainWindow::iconAnimationFinished);
if (m_selectMenuButton->property("rotation") == 0) {
iconAnimation->setStartValue(0);
iconAnimation->setEndValue(-180);
}
} else {
if (m_selectMenuButton->property("rotation") == -180) {
iconAnimation->setStartValue(-180);
iconAnimation->setEndValue(0);
}
}
iconAnimation->setEasingCurve(QEasingCurve::Linear);
iconAnimation->setDuration(300);
iconAnimation->start(QPropertyAnimation::DeleteWhenStopped);
}
bool MainWindow::eventFilter(QObject *target, QEvent *event)
{
if (event->type() == QEvent::MouseButtonPress) {
@ -745,6 +848,12 @@ bool MainWindow::eventFilter(QObject *target, QEvent *event)
on_collectPushButton_clicked();
return false;
}
if (target == m_selectMenuButton) {
m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/downarrow.svg", true)
.pixmap(QSize(Style::miniIconSize, Style::miniIconSize)));
selectIconAnimation(true);
}
}
if (event->type() == QEvent::KeyPress) {
@ -929,17 +1038,22 @@ void MainWindow::searchAppSlot(QString arg)
}
void MainWindow::on_selectMenuButton_triggered(QAction *arg1)
{
qDebug() << "void MainWindow::on_selectMenuButton_triggered(QAction *arg1)" << m_allAction << arg1;
pointDataStruct pointData;
m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/downarrow.svg", true).pixmap(QSize(Style::miniIconSize, Style::miniIconSize)));
selectIconAnimation(false);
if (arg1 == m_allAction) {
m_leftStackedWidget->setCurrentIndex(0);
m_state = 0;
m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-all.svg", true));
// m_minSelectButton->setIcon(QIcon(":/data/img/mainviewwidget/DM-all.svg"));
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;
@ -948,6 +1062,10 @@ void MainWindow::on_selectMenuButton_triggered(QAction *arg1)
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;
@ -956,6 +1074,10 @@ void MainWindow::on_selectMenuButton_triggered(QAction *arg1)
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()
@ -971,7 +1093,15 @@ void MainWindow::updateMinAllView()
void MainWindow::updateRecentView()
{
m_modaldata->loadDesktopVercor();
m_recentListView->updateData(m_modaldata->getRecentData());
QVector<QStringList> recentFile = m_modaldata->getRecentData();
if (recentFile.isEmpty()) {
m_recentListView->hide();
m_recentTextlabel->show();
} else {
m_recentTextlabel->hide();
m_recentListView->show();
m_recentListView->updateData(recentFile);
}
}
void MainWindow::updateView()
{
@ -993,15 +1123,26 @@ void MainWindow::databaseThreadCloseSlot()
m_softwareDbThread->quit();
updateView();
}
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);
m_collectPushButton->setFont(collectFont);
QColor textColor = this->palette().color(QPalette::Text);
QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue());
QString textColorDefault = "#" + QString::number(rgbDefault, 16);
m_recentPushButton->setStyleSheet(QString("color:%1;").arg(textColorDefault));
QFont recentFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize());
m_recentPushButton->setFont(recentFont);
}
void MainWindow::on_recentPushButton_clicked()
{
m_rightStackedWidget->setCurrentIndex(1);
@ -1009,27 +1150,52 @@ void MainWindow::on_recentPushButton_clicked()
QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue());
QString textColorDefault = "#" + QString::number(rgbDefault, 16);
m_collectPushButton->setStyleSheet(QString("color:%1").arg(textColorDefault));
// m_collectPushButton->setStyleSheet("color:white");
QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize());
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();
}
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()
{
m_canHide = true;
m_isFullScreen = true;
m_animationPage.setGeometry(this->x(), this->y(), Style::minw, Style::minh);
m_animationPage.show();
m_animationPage.raise();
m_animationPage.repaint();
m_animationPage->show();
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(this->x(), this->y(), Style::minw, Style::minh));
} else {
m_animationPage->setGeometry(this->x(), this->y(), Style::minw, Style::minh);
}
m_animationPage->raise();
m_animationPage->repaint();
QEventLoop loop;
QTimer::singleShot(100, &loop, SLOT(quit()));
loop.exec();
@ -1040,6 +1206,11 @@ 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()
{
@ -1047,13 +1218,24 @@ void MainWindow::showWindow()
m_fullWindow->raise();
m_fullWindow->showNormal();
m_fullWindow->activateWindow();
pointDataStruct pointData;
pointData.module = "fullWindow";
pointData.function = "Show";
pointData.functionNum = "";
BuriedPointDataSend::getInstance()->setPoint(pointData);
} else {
this->raise();
this->showNormal();
setMinWindowPos();
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()
@ -1062,16 +1244,25 @@ void MainWindow::hideWindow()
m_fullWindow->hide();
this->clearFocus();
m_isFullScreen = true;
pointDataStruct pointData;
pointData.module = "fullWindow";
pointData.function = "Hide";
pointData.functionNum = "";
BuriedPointDataSend::getInstance()->setPoint(pointData);
} else {
this->hide();
this->clearFocus();
m_isFullScreen = false;
pointDataStruct pointData;
pointData.module = "mainWindow";
pointData.function = "Hide";
pointData.functionNum = "";
BuriedPointDataSend::getInstance()->setPoint(pointData);
}
}
void MainWindow::repaintWidget()
void MainWindow::setMinWindowPos()
{
Style::initWidStyle();
this->setMinimumSize(Style::minw, Style::minh);
int position = Style::m_panelPosition;
int x = Style::m_primaryScreenX;
int y = Style::m_primaryScreenY;
@ -1079,15 +1270,41 @@ void MainWindow::repaintWidget()
int height = Style::m_availableScreenHeight;
if (position == 0) {
this->setGeometry(QRect(x + 4, y + height - Style::minh - 3, Style::minw, Style::minh));
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + 4, y + height - Style::minh - 3, Style::minw, Style::minh));
} else {
this->setGeometry(QRect(x + 4, y + height - Style::minh - 3, Style::minw, Style::minh));
}
} else if (position == 1) {
this->setGeometry(QRect(x + 4, y + 4, Style::minw, Style::minh));
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + 4, y + 4, Style::minw, Style::minh));
} else {
this->setGeometry(QRect(x + 4, y + 4, Style::minw, Style::minh));
}
} else if (position == 2) {
this->setGeometry(QRect(x + 4, y + 4, Style::minw, Style::minh));
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + 4, y + 4, Style::minw, Style::minh));
} else {
this->setGeometry(QRect(x + 4, y + 4, Style::minw, Style::minh));
}
} else {
this->setGeometry(QRect(x + width - Style::minw - 4, y + 4, Style::minw, Style::minh));
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + width - Style::minw - 4, y + 4, Style::minw, Style::minh));
} else {
this->setGeometry(QRect(x + width - Style::minw - 4, y + 4, Style::minw, Style::minh));
}
}
}
void MainWindow::repaintWidget()
{
Style::initWidStyle();
this->setMinimumSize(Style::minw, Style::minh);
int x = Style::m_primaryScreenX;
int y = Style::m_primaryScreenY;
int width = Style::m_availableScreenWidth;
int height = Style::m_availableScreenHeight;
setMinWindowPos();
m_fullWindow->move(x, y);
m_fullWindow->setFixedSize(width, height);
m_fullWindow->repaintWidget();
@ -1095,10 +1312,14 @@ void MainWindow::repaintWidget()
void MainWindow::showNormalWindowSlot()
{
myDebug() << "Style::m_availableScreenWidth" << Style::m_availableScreenWidth << "Style::m_availableScreenHeight" << Style::m_availableScreenHeight;
m_animationPage.setGeometry(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight);
m_animationPage.show();
m_animationPage.raise();
myDebug() << m_animationPage.rect();
m_animationPage->show();
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
} else {
m_animationPage->setGeometry(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight);
}
m_animationPage->raise();
myDebug() << m_animationPage->rect();
QEventLoop loop;
QTimer::singleShot(100, &loop, SLOT(quit()));
loop.exec();
@ -1113,10 +1334,20 @@ 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)
{
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);
qDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始";
}

View File

@ -53,6 +53,9 @@
#include "function_button_widget.h"
#include "letter_button_widget.h"
#include "animationpage.h"
#include "rotationlabel.h"
#include "ukuistylehelper/ukuistylehelper.h"
#include "windowmanager/windowmanager.h"
class MainWindow : public QMainWindow
{
@ -100,12 +103,17 @@ protected:
// void mouseReleaseEvent(QMouseEvent *event);
void selectIconAnimation(const bool &flag);
void setMinWindowPos();
public:
Q_SIGNALS:
void sendSearchKeyword(QString arg);
void sendClassificationbtnList();
void sendLetterClassificationList(QStringList list);
void sendSetFullWindowItemHide(bool flag);
void sendStyleChangeSignal(QString style);
public Q_SLOTS:
void updateCollectView();
@ -122,6 +130,7 @@ public Q_SLOTS:
void resetFunctionPage();
void minAnimationFinished();
void maxAnimationFinished();
void iconAnimationFinished();
void changeStyle();
private Q_SLOTS:
void on_selectMenuButton_triggered(QAction *arg1);
@ -160,7 +169,7 @@ private:
QSpacerItem *m_horizontalSpacer = nullptr;
QPushButton *m_searchPushButton = nullptr;
QPushButton *m_minSelectButton = nullptr;
QToolButton *m_selectMenuButton = nullptr;
RotationLabel *m_selectMenuButton = nullptr;
QWidget *m_minSearchPage = nullptr;
QHBoxLayout *m_leftTopSearchHorizontalLayout = nullptr;
QLineEdit *m_lineEdit = nullptr;
@ -189,11 +198,14 @@ private:
RightListView *m_collectListView = nullptr;
QWidget *m_recentPage = nullptr;
ListView *m_recentListView = nullptr;
QLabel *m_recentTextlabel = nullptr;
QSpacerItem *m_verticalSpacer_2 = nullptr;
QHBoxLayout *m_rightBottomHorizontalLayout = nullptr;
QSpacerItem *m_horizontalSpacer_2 = nullptr;
QSpacerItem *m_horizontalSpacer_4 = nullptr;
QPushButton *m_powerOffButton = nullptr;
AnimationPage m_animationPage;
AnimationPage *m_animationPage = nullptr;
MenuBox *m_dropDownMenu = nullptr;
bool m_canHide = true;
bool m_isFullScreen = false;
@ -214,10 +226,12 @@ private:
QPropertyAnimation *m_leaveAnimation = nullptr;
QPropertyAnimation *m_minAnimation = nullptr;
QPropertyAnimation *m_maxAnimation = nullptr;
QPropertyAnimation *iconAnimation = nullptr;
int m_widgetState = -1;
FunctionButtonWidget *m_functionBtnWid = nullptr;
LetterButtonWidget *m_letterBtnWid = nullptr;
SoftwareDatabaseUpdateThread *m_softwareDbThread = nullptr;
QColor m_windowColor;
};
#endif // MAINWINDOW_H

View File

@ -98,28 +98,6 @@ void TabletWindow::initUi()
initStatusManager();
initTransparency();
registDbusService();
/*//备用待窗管修改后启用
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(QString("winKeyRelease")).toBool()) {
return;
}
}
}
if (QApplication::activeWindow() == this)
{
myDebug() << "win键触发窗口隐藏事件";
this->hide();
} else
{
myDebug() << "win键触发窗口显示事件";
this->showPCMenu();
}
});
*/
ways();
buttonWidgetShow();
connect(m_leftWidget, &FunctionWidget::hideTabletWindow, this, &TabletWindow::recvHideMainWindowSlot);
@ -232,15 +210,13 @@ void TabletWindow::setBackground()
void TabletWindow::registDbusService()
{
m_dbus = new DBus;
new MenuAdaptor(m_dbus);
QDBusConnection con = QDBusConnection::sessionBus();
if (!con.registerService("org.ukui.menu") ||
!con.registerObject("/org/ukui/menu", m_dbus)) {
qDebug() << "error:" << con.lastError().message();
}
// m_dbus = new DBus;
// new MenuAdaptor(m_dbus);
// 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::winKeyResponseSignal, this, [ = ] {
// if (QGSettings::isSchemaInstalled(QString("org.ukui.session").toLocal8Bit()))
// {
@ -261,21 +237,6 @@ void TabletWindow::registDbusService()
// this->showPCMenu();
// }
// });
ways();
buttonWidgetShow();
// connect(this,&TabletWindow::pagenumchanged,this,&TabletWindow::pageNumberChanged);
connect(m_leftWidget, &FunctionWidget::hideTabletWindow, this, &TabletWindow::recvHideMainWindowSlot);
if (checkapplist()) {
directoryChangedSlot();//更新应用列表
}
//pc下鼠标功能
XEventMonitor::instance()->start();
connect(XEventMonitor::instance(), SIGNAL(keyRelease(QString)),
this, SLOT(XkbEventsRelease(QString)));
connect(XEventMonitor::instance(), SIGNAL(keyPress(QString)),
this, SLOT(XkbEventsPress(QString)));
}
bool TabletWindow::checkapplist()
@ -413,6 +374,8 @@ void TabletWindow::showPCMenu()
this->raise();
this->activateWindow();
g_menuStatus = true;
menuStatusChange();
myDebug() << "showMenu显示开始菜单";
}
//改变搜索框及工具栏透明度
@ -560,9 +523,10 @@ bool TabletWindow::event(QEvent *event)
//if(QEvent::WindowDeactivate == event->type())//窗口停用
{
if (QApplication::activeWindow() != this) {
qDebug() << " * 鼠标点击窗口外部事件";
myDebug() << " * 鼠标点击窗口外部事件";
this->hide();
g_menuStatus = false;
menuStatusChange();
}
}
@ -576,6 +540,7 @@ bool TabletWindow::event(QEvent *event)
if (!(m_scrollAnimation->state() == QPropertyAnimation::Running)) {
this->hide();
g_menuStatus = false;
myDebug() << "鼠标点击事件触发隐藏";
}
}
@ -642,65 +607,71 @@ void TabletWindow::insertAppList(QStringList desktopfplist)
*/
void TabletWindow::execApplication(QString desktopfp)
{
// Q_EMIT sendHideMainWindowSignal();
// execApp(desktopfp);
QString str;
//打开文件.desktop
GError **error = nullptr;
GKeyFileFlags flags = G_KEY_FILE_NONE;
GKeyFile *keyfile = g_key_file_new();
QByteArray fpbyte = desktopfp.toLocal8Bit();
char *filepath = fpbyte.data();
g_key_file_load_from_file(keyfile, filepath, flags, error);
char *name = g_key_file_get_locale_string(keyfile, "Desktop Entry", "Exec", nullptr, nullptr);
//取出value值
QString execnamestr = QString::fromLocal8Bit(name);
str = execnamestr;
//qDebug()<<"2 exec"<<str;
//关闭文件
g_key_file_free(keyfile);
//打开ini文件
QString pathini = QDir::homePath() + "/.cache/ukui-menu/ukui-menu.ini";
m_disableAppSet = new QSettings(pathini, QSettings::IniFormat);
m_disableAppSet->beginGroup("application");
QString desktopfp1 = str;
//判断
bool bo = m_disableAppSet->contains(desktopfp1.toLocal8Bit().data()); // iskey
bool bo1 = m_disableAppSet->QSettings::value(desktopfp1.toLocal8Bit().data()).toBool(); //isvalue
m_disableAppSet->endGroup();
Q_EMIT sendHideMainWindowSignal();
QDBusInterface iface("com.kylin.AppManager",
"/com/kylin/AppManager",
"com.kylin.AppManager",
QDBusConnection::sessionBus());
if (bo && bo1 == false) { //都存在//存在并且为false从filepathlist中去掉
//qDebug()<<"bool"<<bo<<bo1;
return;
}
if (!g_subProjectCodeName.contains("mavis")
|| (g_subProjectCodeName.contains("mavis") && !QDBusReply<bool>(iface.call("LaunchApp", desktopfp)))) {
execApp(desktopfp);
QString str;
//打开文件.desktop
GError **error = nullptr;
GKeyFileFlags flags = G_KEY_FILE_NONE;
GKeyFile *keyfile = g_key_file_new();
QByteArray fpbyte = desktopfp.toLocal8Bit();
char *filepath = fpbyte.data();
g_key_file_load_from_file(keyfile, filepath, flags, error);
char *name = g_key_file_get_locale_string(keyfile, "Desktop Entry", "Exec", nullptr, nullptr);
//取出value值
QString execnamestr = QString::fromLocal8Bit(name);
str = execnamestr;
//qDebug()<<"2 exec"<<str;
//关闭文件
g_key_file_free(keyfile);
//打开ini文件
QString pathini = QDir::homePath() + "/.cache/ukui-menu/ukui-menu.ini";
m_disableAppSet = new QSettings(pathini, QSettings::IniFormat);
m_disableAppSet->beginGroup("application");
QString desktopfp1 = str;
//判断
bool bo = m_disableAppSet->contains(desktopfp1.toLocal8Bit().data()); // iskey
bool bo1 = m_disableAppSet->QSettings::value(desktopfp1.toLocal8Bit().data()).toBool(); //isvalue
m_disableAppSet->endGroup();
QString exe = execnamestr;
QStringList parameters;
if (bo && bo1 == false) { //都存在//存在并且为false从filepathlist中去掉
//qDebug()<<"bool"<<bo<<bo1;
return;
}
if (exe.indexOf("%") != -1) {
exe = exe.left(exe.indexOf("%") - 1);
//qDebug()<<"=====dd====="<<exe;
}
QString exe = execnamestr.simplified();
QStringList parameters;
if (exe.indexOf("-") != -1) {
parameters = exe.split(" ");
exe = parameters[0];
parameters.removeAt(0);
//qDebug()<<"===qqq==="<<exe;
}
if (exe.indexOf("%") != -1) {
exe = exe.left(exe.indexOf("%") - 1);
}
if (exe == "/usr/bin/indicator-china-weather") {
parameters.removeAt(0);
parameters.append("showmainwindow");
}
if (exe.indexOf(" ") != -1) {
parameters = exe.split(" ");
exe = parameters[0];
parameters.removeAt(0);
}
qDebug() << "5 exe" << exe << parameters;
QDBusInterface session("org.gnome.SessionManager", "/com/ukui/app", "com.ukui.app");
if (exe == "/usr/bin/indicator-china-weather") {
parameters.removeAt(0);
parameters.append("showmainwindow");
}
if (parameters.isEmpty()) {
session.call("app_open", exe, parameters);
} else {
session.call("app_open", exe, parameters);
qDebug() << "5 exe" << exe << parameters;
QDBusInterface session("org.gnome.SessionManager", "/com/ukui/app", "com.ukui.app");
if (parameters.isEmpty()) {
session.call("app_open", exe, parameters);
} else {
session.call("app_open", exe, parameters);
}
}
//Q_EMIT sendHideMainWindowSignal();
@ -889,6 +860,7 @@ void TabletWindow::recvHideMainWindowSlot()
// this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
this->hide();
g_menuStatus = false;
myDebug() << "信号触发隐藏窗口";
}
void TabletWindow::btnGroupClickedSlot(int prePageNum, int pageNum)
@ -1080,7 +1052,7 @@ void TabletWindow::winKeyReleaseSlot(const QString &key)
if (QGSettings::isSchemaInstalled(QString("org.ukui.session").toLocal8Bit())) {
QGSettings gsetting(QString("org.ukui.session").toLocal8Bit());
if (gsetting.keys().contains("winKeyRelease"))
if (gsetting.keys().contains("winKeyRelease")) {
if (gsetting.get(QString("winKeyRelease")).toBool()) {
disconnect(XEventMonitor::instance(), SIGNAL(keyRelease(QString)),
this, SLOT(xkbEventsRelease(QString)));
@ -1092,7 +1064,16 @@ void TabletWindow::winKeyReleaseSlot(const QString &key)
connect(XEventMonitor::instance(), SIGNAL(keyPress(QString)),
this, SLOT(xkbEventsPress(QString)));
}
}
}
}
}
void TabletWindow::menuStatusChange()
{
QDBusMessage message = QDBusMessage::createSignal("/com/ukui/menu", "com.ukui.menu", "statusChangeSignal");
//给信号赋值
message << g_menuStatus;
//发射
QDBusConnection::sessionBus().send(message);
}

View File

@ -46,8 +46,6 @@
#include "tabletlistview.h"
#include "pagemanager.h"
#include "tablet_directorychanged_thread.h"
#include "dbus.h"
#include "dbus-adaptor.h"
class TabletWindow : public QWidget
{
@ -123,8 +121,9 @@ private:
QFileSystemWatcher *m_configFileWatcher = nullptr;
TabletDirectoryChangedThread *m_directoryChangedThread = nullptr;
QSettings *m_disableAppSet = nullptr;
DBus *m_dbus = nullptr;
QLabel m_animationPage;
// DBus *m_dbus = nullptr;
protected:
/**
@ -183,6 +182,8 @@ protected:
bool checkapplist();
void menuStatusChange();
public Q_SLOTS:
/**
* @brief Open the application

View File

@ -18,6 +18,7 @@ HEADERS += \
$$PWD/ListView/tabletlistview.h \
$$PWD/Other/classify_btn_scrollarea.h \
$$PWD/Other/lettertooltip.h \
$$PWD/Other/rotationlabel.h \
$$PWD/Other/scrollarea.h \
$$PWD/RightClickMenu/menubox.h \
$$PWD/RightClickMenu/rightclickmenu.h \
@ -55,6 +56,7 @@ SOURCES += \
$$PWD/ListView/tabletlistview.cpp \
$$PWD/Other/classify_btn_scrollarea.cpp \
$$PWD/Other/lettertooltip.cpp \
$$PWD/Other/rotationlabel.cpp \
$$PWD/Other/scrollarea.cpp \
$$PWD/RightClickMenu/menubox.cpp \
$$PWD/RightClickMenu/rightclickmenu.cpp \

View File

@ -76,6 +76,8 @@ int Style::SideBarWidWidth = 0;
int Style::appLine = 0;
int Style::appColumn = 0;
int Style::appLineFirst = 0;
int Style::appColumnFirst = 0;
int Style::appPage = 1;
int Style::appNum = 0;
int Style::nowpagenum = 1;
@ -100,6 +102,13 @@ int Style::ButtonWidgetWidth = 56;
int Style::ToolWidgetLeft = 24;
bool Style::IsWideScreen = false;
int Style::DropMenuWidth = 0;
int Style::DropMenuHeight = 0;
int Style::miniIconSize = 0;
int Style::rightViewWidth = 0;
int Style::rightViewHeight = 0;
void Style::initWidStyle()
{
if (!g_projectCodeName.contains("V10SP1-edu")) {
@ -121,10 +130,12 @@ void Style::initWidStyle()
if (m_availableScreenWidth == 800 && m_availableScreenHeight == 600) {
minw = 320;
minh = 500;
leftPageWidth = 300;
leftPageHeight = 517;
} else {
minw = 652;
minh = 590;
leftPageWidth = 292;
leftPageWidth = 300;
leftPageHeight = 517;
}
@ -194,11 +205,16 @@ void Style::initWidStyle()
AppSpaceBetweenIconText = 14;
}
LeftBtnWidth = 100 + 5 * len;
LeftBtnHeight = 43;
LeftBtnWidth = 68 + 5 * len;
LeftBtnHeight = 34;
QueryLineEditHeight = 30;
LeftLetterBtnHeight = 25;
LeftIconSize = 19;
DropMenuWidth = 140;
DropMenuHeight = 112;
miniIconSize = 8;
rightViewWidth = 324;
rightViewHeight = 470;
LeftSpaceIconText = 14;
m_applistWidWidth = m_availableScreenWidth / 1.25;
m_applistWidWidth = m_applistWidWidth - (m_applistWidWidth % m_applistGridSizeWidth) + 1;
@ -208,23 +224,25 @@ void Style::initWidStyle()
} else {
ScreenWidth = QApplication::primaryScreen()->geometry().width();
ScreenHeight = QApplication::primaryScreen()->geometry().height();
if (ScreenHeight != 1080) {
AppListViewTopMargin = 30;
} else {
AppListViewTopMargin = 70;
}
myDebug() << "Winches" << qApp->desktop()->widthMM();
myDebug() << "Hinches" << qApp->desktop()->heightMM();
myDebug() << "ScreenWidth" << ScreenWidth;
myDebug() << "ScreenHeight" << ScreenHeight;
appColumn = 6;
appLine = 4;
appLineFirst = 4;
AppListViewTopMargin = 70;
AppListViewLeftMargin = 52;
AppListViewBottomMargin = AppListViewTopMargin - 30;
AppListViewRightMargin = 0;
m_leftWidWidth = ScreenWidth * 0.3;
FirsPageViewWidth = ScreenWidth - m_leftWidWidth - 5;
appColumnFirst = FirsPageViewWidth / 220;
OtherPageViewWidth = ScreenWidth;
TabletItemSizeWidthFirst = FirsPageViewWidth / 6;
TabletItemSizeWidthOther = (ScreenWidth - 5) / 6;
TabletItemSizeWidthFirst = FirsPageViewWidth / appColumnFirst;
TabletItemSizeWidthOther = (ScreenWidth - 5) / appColumn;
CenterWindHeight = ScreenHeight - AppListViewBottomMargin - AppListViewTopMargin;
AppListItemSizeHeight = CenterWindHeight / 4;
AppListItemSizeHeight = CenterWindHeight / appLine;
AppListIconSize = 96;
AppListBigIconSize = 108;
AppTopSpace = (AppListItemSizeHeight - AppListIconSize) / 2;

View File

@ -133,6 +133,8 @@ public:
static int appLine;
static int appColumn;
static int appLineFirst;
static int appColumnFirst;
static int appNum;
static int appPage;
static int nowpagenum;
@ -169,7 +171,12 @@ public:
static int WideAppListItemSizeHeight;
static int WideAppViewLeftMargin;
static bool IsWideScreen;
static int DropMenuWidth;
static int DropMenuHeight;
static int miniIconSize;
static int rightViewWidth;
static int rightViewHeight;
};

View File

@ -17,4 +17,4 @@ public:
virtual QWidget *createWidget(QWidget *parent) = 0;
};
Q_DECLARE_INTERFACE(kyMenuPluginInterface, "org.kyMenuPlugin.AbstractInterface")
#endif
#endif

View File

@ -28,10 +28,14 @@
#include <QApplication>
#include <QDBusInterface>
#include <QScreen>
#include "ukuimenuinterface.h"
#define DATABASENAME QDir::homePath()+"/.config/ukui/"+"UkuiMenu.db"
QString g_projectCodeName = "V10SP1";
QString g_subProjectCodeName = "";
QString g_platform = "";
bool g_menuStatus = false;
QString g_curStyle = "";
const QPixmap loadSvg(const QString &fileName, const int size)
{
@ -370,6 +374,27 @@ bool updateDataBaseTableTimes(QString desktopfn)
return ret;
}
bool dataBaseIsEmpty()
{
QSqlDatabase db = QSqlDatabase::database("MainThreadDataBase");
QSqlQuery sql(db);
QString cmd;
cmd = QString("select * from appInfo");
if (sql.exec(cmd)) {
if (!sql.next()) {
return true;
} else {
if (sql.value(0).toString() == "") {
return true;
} else {
return false;
}
}
return false;
}
return false;
}
bool updateDataBaseCollect(QString desktopfn, int type)
{
bool ret = false;

View File

@ -25,7 +25,6 @@
#include <QSqlError>
#include <QIcon>
#include <gio/gdesktopappinfo.h>
#include "ukuimenuinterface.h"
#define DBUS_NAME "org.ukui.panel"
#define DBUS_PATH "/panel/position"
@ -33,6 +32,26 @@
#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);
@ -60,6 +79,7 @@ bool checkIfRecent(QString desktopfn);//检查是否最近安装
bool checkIfCollected(QString desktopfn);
QStringList getCollectAppList();
void changeCollectSort(QString dragDesktopfn, QString dropDesktopfn);
bool dataBaseIsEmpty();//判断数据库是否为空
bool updateDataBaseCollect(QString desktopfn, int type);
QStringList getLockAppList();//获取被锁定应用
QStringList getUnlockAllList();//获取未被锁定应用
@ -86,7 +106,10 @@ enum PanelPositon {
};
extern QString g_projectCodeName;
extern QString g_subProjectCodeName;
extern QString g_platform;
extern bool g_menuStatus;
extern QString g_curStyle;
#endif // UTILITY_H

View File

@ -4,22 +4,22 @@
<context>
<name>FullMainWindow</name>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="79"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="86"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="138"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="144"/>
<source>All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="140"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="146"/>
<source>Letter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="142"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="148"/>
<source>Function</source>
<translation type="unfinished"></translation>
</message>
@ -27,7 +27,7 @@
<context>
<name>FunctionWidget</name>
<message>
<location filename="../src/UserInterface/Widget/function_Widget.cpp" line="205"/>
<location filename="../src/UserInterface/Widget/function_Widget.cpp" line="204"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
@ -35,51 +35,56 @@
<context>
<name>MainWindow</name>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="239"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="242"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="240"/>
<source>collection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="237"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="426"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="844"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="233"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="452"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="985"/>
<source>All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="97"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="90"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="243"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="192"/>
<source>No recent files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="241"/>
<source>recent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="244"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="242"/>
<source>Max</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="246"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="244"/>
<source>PowerOff</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="428"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="852"/>
<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"/>
<source>Letter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="430"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="860"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="456"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="1001"/>
<source>Function</source>
<translation type="unfinished"></translation>
</message>
@ -156,82 +161,82 @@
<context>
<name>RightClickMenu</name>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="228"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="213"/>
<source>Pin to all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="231"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="216"/>
<source>Unpin from all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="241"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="226"/>
<source>Pin to taskbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="244"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="229"/>
<source>Unpin from taskbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="247"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="232"/>
<source>Add to desktop shortcuts</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="251"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="236"/>
<source>Pin to collection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="254"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="239"/>
<source>Remove from collection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="269"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="254"/>
<source>Uninstall</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="290"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="274"/>
<source>Switch user</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="296"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="281"/>
<source>Hibernate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="302"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="288"/>
<source>Sleep</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="306"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="292"/>
<source>Lock Screen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="311"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="297"/>
<source>Log Out</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="317"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="304"/>
<source>Restart</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="323"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="311"/>
<source>Power Off</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="354"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="342"/>
<source>Personalize this list</source>
<translation type="unfinished"></translation>
</message>

View File

@ -4,22 +4,22 @@
<context>
<name>FullMainWindow</name>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="79"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="86"/>
<source>Search</source>
<translation type="unfinished">Ara</translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="138"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="144"/>
<source>All</source>
<translation type="unfinished">Tümü</translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="140"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="146"/>
<source>Letter</source>
<translation type="unfinished">Alfabetik</translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="142"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="148"/>
<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="205"/>
<location filename="../src/UserInterface/Widget/function_Widget.cpp" line="204"/>
<source>Search</source>
<translation type="unfinished">Ara</translation>
</message>
@ -192,51 +192,56 @@
<context>
<name>MainWindow</name>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="239"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="242"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="240"/>
<source>collection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="237"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="426"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="844"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="233"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="452"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="985"/>
<source>All</source>
<translation type="unfinished">Tümü</translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="97"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="90"/>
<source>Search</source>
<translation type="unfinished">Ara</translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="243"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="192"/>
<source>No recent files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="241"/>
<source>recent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="244"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="242"/>
<source>Max</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="246"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="244"/>
<source>PowerOff</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="428"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="852"/>
<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"/>
<source>Letter</source>
<translation type="unfinished">Alfabetik</translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="430"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="860"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="456"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="1001"/>
<source>Function</source>
<translation type="unfinished">Kategori</translation>
</message>
@ -360,62 +365,62 @@
<context>
<name>RightClickMenu</name>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="228"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="213"/>
<source>Pin to all</source>
<translation>Tümünü sabitle</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="231"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="216"/>
<source>Unpin from all</source>
<translation>Tüm sabitlemeleri kaldır</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="241"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="226"/>
<source>Pin to taskbar</source>
<translation>Görev çubuğuna sabitle</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="244"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="229"/>
<source>Unpin from taskbar</source>
<translation>Görev çubuğundan sabitlemeyi kaldır</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="247"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="232"/>
<source>Add to desktop shortcuts</source>
<translation>Masaüstü kısayollarına ekle</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="251"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="236"/>
<source>Pin to collection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="254"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="239"/>
<source>Remove from collection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="269"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="254"/>
<source>Uninstall</source>
<translation>Kaldır</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="290"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="274"/>
<source>Switch user</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="296"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="281"/>
<source>Hibernate</source>
<translation>Beklemeye Al</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="302"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="288"/>
<source>Sleep</source>
<translation>Uyku Modu</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="306"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="292"/>
<source>Lock Screen</source>
<translation>Ekranı Kilitle</translation>
</message>
@ -424,22 +429,22 @@
<translation type="vanished">Kullanıcı Değiştir</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="311"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="297"/>
<source>Log Out</source>
<translation>Çıkış</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="317"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="304"/>
<source>Restart</source>
<translation>Yeniden Başlat</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="323"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="311"/>
<source>Power Off</source>
<translation>Kapat</translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="354"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="342"/>
<source>Personalize this list</source>
<translation>Bu listeyi özelleştirin</translation>
</message>

View File

@ -4,22 +4,22 @@
<context>
<name>FullMainWindow</name>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="79"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="86"/>
<source>Search</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="138"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="144"/>
<source>All</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="140"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="146"/>
<source>Letter</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="142"/>
<location filename="../src/UserInterface/full_mainwindow.cpp" line="148"/>
<source>Function</source>
<translation></translation>
</message>
@ -27,7 +27,7 @@
<context>
<name>FunctionWidget</name>
<message>
<location filename="../src/UserInterface/Widget/function_Widget.cpp" line="205"/>
<location filename="../src/UserInterface/Widget/function_Widget.cpp" line="204"/>
<source>Search</source>
<translation></translation>
</message>
@ -35,51 +35,56 @@
<context>
<name>MainWindow</name>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="97"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="90"/>
<source>Search</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="237"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="426"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="844"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="192"/>
<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"/>
<source>All</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="239"/>
<source>...</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="242"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="240"/>
<source>collection</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="243"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="241"/>
<source>recent</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="244"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="242"/>
<source>Max</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="246"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="244"/>
<source>PowerOff</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="428"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="852"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="395"/>
<source>Search application</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="454"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="993"/>
<source>Letter</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/mainwindow.cpp" line="430"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="860"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="456"/>
<location filename="../src/UserInterface/mainwindow.cpp" line="1001"/>
<source>Function</source>
<translation></translation>
</message>
@ -156,82 +161,82 @@
<context>
<name>RightClickMenu</name>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="228"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="213"/>
<source>Pin to all</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="231"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="216"/>
<source>Unpin from all</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="241"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="226"/>
<source>Pin to taskbar</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="244"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="229"/>
<source>Unpin from taskbar</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="247"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="232"/>
<source>Add to desktop shortcuts</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="251"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="236"/>
<source>Pin to collection</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="254"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="239"/>
<source>Remove from collection</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="269"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="254"/>
<source>Uninstall</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="290"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="274"/>
<source>Switch user</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="296"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="281"/>
<source>Hibernate</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="302"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="288"/>
<source>Sleep</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="306"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="292"/>
<source>Lock Screen</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="311"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="297"/>
<source>Log Out</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="317"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="304"/>
<source>Restart</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="323"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="311"/>
<source>Power Off</source>
<translation></translation>
</message>
<message>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="354"/>
<location filename="../src/UserInterface/RightClickMenu/rightclickmenu.cpp" line="342"/>
<source>Personalize this list</source>
<translation type="unfinished"></translation>
</message>

View File

@ -48,11 +48,11 @@ INSTALLS += qm_files
# So we can access it from main.cpp
DEFINES += QM_FILES_INSTALL_PATH='\\"$${QM_FILES_INSTALL_PATH}\\"'
PKGCONFIG+=glib-2.0 gio-unix-2.0 gsettings-qt libbamf3 x11 xtst
PKGCONFIG+=glib-2.0 gio-unix-2.0 gsettings-qt libbamf3 x11 xtst kysdk-waylandhelper
CONFIG += no_keywords link_pkgconfig
LIBS+=-pthread -luchardet -lukui-log4qt -lukui-com4c -lukui-com4cxx -lpeony
LIBS+=-pthread -luchardet -lukui-log4qt -lukui-com4c -lukui-com4cxx -lpeony -ldl -lcrypto
desktop_file.files = ukui-menu.desktop
desktop_file.path = /etc/xdg/autostart
@ -63,7 +63,7 @@ INSTALLS += \
FORMS +=
SOURCES += \
main.cpp
main.cpp \
RESOURCES += \
res.qrc