Import Upstream version 3.0.2.0509hw1
Before Width: | Height: | Size: 745 B After Width: | Height: | Size: 745 B |
Before Width: | Height: | Size: 833 B After Width: | Height: | Size: 833 B |
Before Width: | Height: | Size: 880 B After Width: | Height: | Size: 880 B |
Before Width: | Height: | Size: 832 B After Width: | Height: | Size: 832 B |
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 621 B |
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 734 B |
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 784 B |
Before Width: | Height: | Size: 707 B After Width: | Height: | Size: 707 B |
Before Width: | Height: | Size: 788 B After Width: | Height: | Size: 788 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 644 B After Width: | Height: | Size: 644 B |
Before Width: | Height: | Size: 636 B After Width: | Height: | Size: 636 B |
Before Width: | Height: | Size: 799 B After Width: | Height: | Size: 799 B |
Before Width: | Height: | Size: 878 B After Width: | Height: | Size: 878 B |
Before Width: | Height: | Size: 847 B After Width: | Height: | Size: 847 B |
Before Width: | Height: | Size: 999 B After Width: | Height: | Size: 999 B |
Before Width: | Height: | Size: 922 B After Width: | Height: | Size: 922 B |
Before Width: | Height: | Size: 998 B After Width: | Height: | Size: 998 B |
Before Width: | Height: | Size: 979 B After Width: | Height: | Size: 979 B |
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 730 B |
Before Width: | Height: | Size: 692 B After Width: | Height: | Size: 692 B |
Before Width: | Height: | Size: 729 B After Width: | Height: | Size: 729 B |
Before Width: | Height: | Size: 713 B After Width: | Height: | Size: 713 B |
Before Width: | Height: | Size: 872 B After Width: | Height: | Size: 872 B |
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 924 B |
Before Width: | Height: | Size: 871 B After Width: | Height: | Size: 871 B |
Before Width: | Height: | Size: 742 B After Width: | Height: | Size: 742 B |
Before Width: | Height: | Size: 852 B After Width: | Height: | Size: 852 B |
Before Width: | Height: | Size: 782 B After Width: | Height: | Size: 782 B |
Before Width: | Height: | Size: 851 B After Width: | Height: | Size: 851 B |
Before Width: | Height: | Size: 792 B After Width: | Height: | Size: 792 B |
Before Width: | Height: | Size: 991 B After Width: | Height: | Size: 991 B |
Before Width: | Height: | Size: 927 B After Width: | Height: | Size: 927 B |
Before Width: | Height: | Size: 990 B After Width: | Height: | Size: 990 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
Before Width: | Height: | Size: 1003 B After Width: | Height: | Size: 1003 B |
Before Width: | Height: | Size: 723 B After Width: | Height: | Size: 723 B |
Before Width: | Height: | Size: 1005 B After Width: | Height: | Size: 1005 B |
Before Width: | Height: | Size: 957 B After Width: | Height: | Size: 957 B |
Before Width: | Height: | Size: 1022 B After Width: | Height: | Size: 1022 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1021 B After Width: | Height: | Size: 1021 B |
Before Width: | Height: | Size: 765 B After Width: | Height: | Size: 765 B |
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
Before Width: | Height: | Size: 678 B After Width: | Height: | Size: 678 B |
Before Width: | Height: | Size: 539 B After Width: | Height: | Size: 539 B |
Before Width: | Height: | Size: 539 B After Width: | Height: | Size: 539 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 510 B |
Before Width: | Height: | Size: 842 B After Width: | Height: | Size: 842 B |
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 831 B |
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 841 B |
Before Width: | Height: | Size: 828 B After Width: | Height: | Size: 828 B |
Before Width: | Height: | Size: 535 B After Width: | Height: | Size: 535 B |
Before Width: | Height: | Size: 535 B After Width: | Height: | Size: 535 B |
Before Width: | Height: | Size: 738 B After Width: | Height: | Size: 738 B |
Before Width: | Height: | Size: 929 B After Width: | Height: | Size: 929 B |
Before Width: | Height: | Size: 816 B After Width: | Height: | Size: 816 B |
Before Width: | Height: | Size: 525 B After Width: | Height: | Size: 525 B |
Before Width: | Height: | Size: 525 B After Width: | Height: | Size: 525 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 681 B After Width: | Height: | Size: 681 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
@ -0,0 +1 @@
|
||||||
|
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 256 256"><defs><style>.cls-1{fill:none;}.cls-2{clip-path:url(#clip-path);}.cls-3{opacity:0.15;}.cls-4{fill:#fff;}</style><clipPath id="clip-path"><rect class="cls-1" width="256" height="256"/></clipPath></defs><title>avatar</title><g class="cls-2"><g class="cls-2"><g class="cls-3"><g class="cls-2"><path d="M256,128A128,128,0,1,1,128,0,128,128,0,0,1,256,128"/></g></g><path class="cls-4" d="M164,143H92a30,30,0,0,0-30,30v12a18,18,0,0,0,18,18h96a18,18,0,0,0,18-18V173a30,30,0,0,0-30-30"/><path class="cls-4" d="M128,123A35,35,0,1,0,93,88a35,35,0,0,0,35,35"/></g></g></svg>
|
After Width: | Height: | Size: 703 B |
Before Width: | Height: | Size: 678 B After Width: | Height: | Size: 678 B |
Before Width: | Height: | Size: 794 B After Width: | Height: | Size: 794 B |
Before Width: | Height: | Size: 839 B After Width: | Height: | Size: 839 B |
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 784 B |
Before Width: | Height: | Size: 946 B After Width: | Height: | Size: 946 B |
Before Width: | Height: | Size: 951 B After Width: | Height: | Size: 951 B |
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 403 B |
Before Width: | Height: | Size: 535 B After Width: | Height: | Size: 535 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 967 B After Width: | Height: | Size: 967 B |
Before Width: | Height: | Size: 929 B After Width: | Height: | Size: 929 B |
Before Width: | Height: | Size: 693 B After Width: | Height: | Size: 693 B |
Before Width: | Height: | Size: 691 B After Width: | Height: | Size: 691 B |
|
@ -29,16 +29,12 @@
|
||||||
#include <KWindowEffects>
|
#include <KWindowEffects>
|
||||||
#include "src/UtilityFunction/utility.h"
|
#include "src/UtilityFunction/utility.h"
|
||||||
#include "src/SearchResultWidget/file-utils.h"
|
#include "src/SearchResultWidget/file-utils.h"
|
||||||
#include <ukuisdk/kylin-com4c.h>
|
|
||||||
#include <ukuisdk/kylin-com4cxx.h>
|
|
||||||
#include "src/UtilityFunction/utility.h"
|
|
||||||
|
|
||||||
#include <ukui-log4qt.h>
|
#include <ukui-log4qt.h>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
initUkuiLog4qt("ukui-menu");
|
initUkuiLog4qt("ukui-menu");
|
||||||
projectCodeName = KDKGetPrjCodeName().c_str();
|
|
||||||
qRegisterMetaType<QVector<QStringList>>("QVector<QStringList>");
|
qRegisterMetaType<QVector<QStringList>>("QVector<QStringList>");
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
|
||||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
@ -55,17 +51,31 @@ int main(int argc, char *argv[])
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// auto Style=new ProxyStyle;
|
||||||
|
// app.setStyle(Style);
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
|
|
||||||
if (translator.load(QLocale(), "ukui-menu", "_", QM_FILES_INSTALL_PATH)) {
|
if (translator.load(QLocale(), "ukui-menu", "_", QM_FILES_INSTALL_PATH)) {
|
||||||
app.installTranslator(&translator);
|
app.installTranslator(&translator);
|
||||||
} else {
|
} else {
|
||||||
myDebug() << "Load translations file" << QLocale() << "failed!";
|
qDebug() << "Load translations file" << QLocale() << "failed!";
|
||||||
}
|
}
|
||||||
|
|
||||||
Zeeker::FileUtils::loadHanziTable(":/src/SearchResultWidget/pinyinWithoutTone.txt");
|
Zeeker::FileUtils::loadHanziTable(":/src/SearchResultWidget/pinyinWithoutTone.txt");
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
app.setActivationWindow(&w);
|
app.setActivationWindow(&w);
|
||||||
|
// w.setProperty("useSystemStyleBlur", true);
|
||||||
|
//测试
|
||||||
|
// if(Style::panelPosition==0)
|
||||||
|
// w.setGeometry(QRect(Style::primaryScreenX+4,Style::primaryScreenY+Style::primaryScreenHeight-Style::panelSize-Style::minh-3,
|
||||||
|
// Style::minw,Style::minh));
|
||||||
|
// else if(Style::panelPosition==1)
|
||||||
|
// w.setGeometry(QRect(Style::primaryScreenX+4,Style::primaryScreenY+Style::panelSize+4,Style::minw,Style::minh));
|
||||||
|
// else if(Style::panelPosition==2)
|
||||||
|
// w.setGeometry(QRect(Style::primaryScreenX+Style::panelSize+4,Style::primaryScreenY+4,Style::minw,Style::minh));
|
||||||
|
// else
|
||||||
|
// w.setGeometry(QRect(Style::primaryScreenX+Style::primaryScreenWidth-Style::panelSize-Style::minw-4,Style::primaryScreenY+4,
|
||||||
|
// Style::minw,Style::minh));
|
||||||
w.show();
|
w.show();
|
||||||
w.raise();
|
w.raise();
|
||||||
w.update();
|
w.update();
|
||||||
|
|
|
@ -83,5 +83,6 @@
|
||||||
<file>data/img/mainviewwidget/Mobile-Normal.svg</file>
|
<file>data/img/mainviewwidget/Mobile-Normal.svg</file>
|
||||||
<file>src/SearchResultWidget/pinyinWithTone.txt</file>
|
<file>src/SearchResultWidget/pinyinWithTone.txt</file>
|
||||||
<file>src/SearchResultWidget/pinyinWithoutTone.txt</file>
|
<file>src/SearchResultWidget/pinyinWithoutTone.txt</file>
|
||||||
|
<file>data/img/sidebarwidget/default.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -54,7 +54,8 @@ void CommonUseWidget::initUi()
|
||||||
void CommonUseWidget::initAppListWidget()
|
void CommonUseWidget::initAppListWidget()
|
||||||
{
|
{
|
||||||
m_listView = new ListView(this, this->width(), this->height() - 6, 0);
|
m_listView = new ListView(this, this->width(), this->height() - 6, 0);
|
||||||
m_listView->setGeometry(QRect(6, 0, this->width() - 6, this->height() - 6));
|
m_listView->setFixedSize(this->width(), this->height() - 6);
|
||||||
|
//m_listView->setGeometry(QRect(6,0,this->width()-6,this->height()-6));
|
||||||
m_listView->show();
|
m_listView->show();
|
||||||
connect(m_listView, &ListView::sendItemClickedSignal, this, &CommonUseWidget::execApplication);
|
connect(m_listView, &ListView::sendItemClickedSignal, this, &CommonUseWidget::execApplication);
|
||||||
connect(m_listView, &ListView::sendUpdateAppListSignal, this, &CommonUseWidget::updateListViewSlot);
|
connect(m_listView, &ListView::sendUpdateAppListSignal, this, &CommonUseWidget::updateListViewSlot);
|
||||||
|
@ -69,7 +70,7 @@ void CommonUseWidget::fillAppList()
|
||||||
{
|
{
|
||||||
m_data.clear();
|
m_data.clear();
|
||||||
|
|
||||||
Q_FOREACH (QString desktopfp, UkuiMenuInterface::m_allAppVector) {
|
Q_FOREACH (QString desktopfp, UkuiMenuInterface::allAppVector) {
|
||||||
m_data.append(QStringList() << desktopfp << "1");
|
m_data.append(QStringList() << desktopfp << "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,18 +43,16 @@ void FullCommonUseWidget::initUi()
|
||||||
this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||||
this->setFixedSize(Style::MainViewWidWidth,
|
this->setFixedSize(Style::MainViewWidWidth,
|
||||||
Style::AppListWidHeight);
|
Style::AppListWidHeight);
|
||||||
myDebug() << "width" << this->width() << "height" << this->height();
|
|
||||||
this->setFocusPolicy(Qt::NoFocus);
|
this->setFocusPolicy(Qt::NoFocus);
|
||||||
mainLayout = new QHBoxLayout;
|
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
this->setLayout(mainLayout);
|
this->setLayout(mainLayout);
|
||||||
m_spaceItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Fixed);
|
m_spaceItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||||
mainLayout->addItem(m_spaceItem);
|
mainLayout->addItem(m_spaceItem);
|
||||||
m_scrollArea = new ScrollArea(this);
|
m_scrollArea = new ScrollArea;
|
||||||
m_scrollAreaWid = new ScrollAreaWid(m_scrollArea);
|
m_scrollAreaWid = new ScrollAreaWid;
|
||||||
m_scrollAreaWid->setAttribute(Qt::WA_TranslucentBackground);
|
m_scrollAreaWid->setAttribute(Qt::WA_TranslucentBackground);
|
||||||
m_scrollArea->setFixedSize(Style::AppListWidWidth, this->height());
|
m_scrollArea->setFixedSize(Style::AppListWidWidth, this->height());
|
||||||
m_scrollAreaWid->setFixedWidth(m_scrollArea->width() - Style::SliderSize);
|
|
||||||
m_scrollArea->setWidget(m_scrollAreaWid);
|
m_scrollArea->setWidget(m_scrollAreaWid);
|
||||||
m_scrollArea->setWidgetResizable(true);
|
m_scrollArea->setWidgetResizable(true);
|
||||||
m_scrollAreaWidLayout = new QVBoxLayout;
|
m_scrollAreaWidLayout = new QVBoxLayout;
|
||||||
|
@ -70,7 +68,16 @@ void FullCommonUseWidget::initUi()
|
||||||
void FullCommonUseWidget::initAppListWidget()
|
void FullCommonUseWidget::initAppListWidget()
|
||||||
{
|
{
|
||||||
m_listView = new FullListView(this, 0);
|
m_listView = new FullListView(this, 0);
|
||||||
|
// m_listView->setFixedSize(this->width()-Style::LeftWidWidth+3,this->height());
|
||||||
|
// QHBoxLayout *mainLayout=qobject_cast<QHBoxLayout*>(this->layout());
|
||||||
|
// mainLayout->insertWidget(1,m_listView);
|
||||||
m_scrollAreaWidLayout->addWidget(m_listView);
|
m_scrollAreaWidLayout->addWidget(m_listView);
|
||||||
|
connect(m_scrollArea, &ScrollArea::requestUpdate, m_listView->viewport(), [ = ]() {
|
||||||
|
QEventLoop loop;
|
||||||
|
QTimer::singleShot(1, &loop, SLOT(quit()));
|
||||||
|
loop.exec();
|
||||||
|
m_listView->repaint();
|
||||||
|
});
|
||||||
connect(m_listView, &FullListView::sendItemClickedSignal, this, &FullCommonUseWidget::execApplication);
|
connect(m_listView, &FullListView::sendItemClickedSignal, this, &FullCommonUseWidget::execApplication);
|
||||||
connect(m_listView, &FullListView::sendUpdateAppListSignal, this, &FullCommonUseWidget::updateListViewSlot);
|
connect(m_listView, &FullListView::sendUpdateAppListSignal, this, &FullCommonUseWidget::updateListViewSlot);
|
||||||
connect(m_listView, &FullListView::sendHideMainWindowSignal, this, &FullCommonUseWidget::sendHideMainWindowSignal);
|
connect(m_listView, &FullListView::sendHideMainWindowSignal, this, &FullCommonUseWidget::sendHideMainWindowSignal);
|
||||||
|
@ -100,7 +107,7 @@ void FullCommonUseWidget::fillAppList()
|
||||||
{
|
{
|
||||||
m_data.clear();
|
m_data.clear();
|
||||||
|
|
||||||
Q_FOREACH (QString desktopfp, UkuiMenuInterface::m_allAppVector) {
|
Q_FOREACH (QString desktopfp, UkuiMenuInterface::allAppVector) {
|
||||||
m_data.append(desktopfp);
|
m_data.append(desktopfp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,6 +126,8 @@ void FullCommonUseWidget::execApplication(QString desktopfp)
|
||||||
|
|
||||||
void FullCommonUseWidget::selectFirstItem()
|
void FullCommonUseWidget::selectFirstItem()
|
||||||
{
|
{
|
||||||
|
// this->focusNextChild();
|
||||||
|
qDebug() << "void FullCommonUseWidget::selectFirstItem()";
|
||||||
m_listView->setCurrentIndex(m_listView->model()->index(0, 0));
|
m_listView->setCurrentIndex(m_listView->model()->index(0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +173,6 @@ void FullCommonUseWidget::repaintWidget()
|
||||||
this->setFixedSize(Style::MainViewWidWidth,
|
this->setFixedSize(Style::MainViewWidWidth,
|
||||||
Style::AppListWidHeight);
|
Style::AppListWidHeight);
|
||||||
m_scrollArea->setFixedSize(Style::AppListWidWidth, this->height());
|
m_scrollArea->setFixedSize(Style::AppListWidWidth, this->height());
|
||||||
m_scrollAreaWid->setFixedWidth(m_scrollArea->width() - Style::SliderSize);
|
|
||||||
m_scrollAreaWidLayout->removeWidget(m_listView);
|
m_scrollAreaWidLayout->removeWidget(m_listView);
|
||||||
m_listView->setParent(nullptr);
|
m_listView->setParent(nullptr);
|
||||||
delete m_listView;
|
delete m_listView;
|
||||||
|
|
|
@ -65,16 +65,16 @@ public:
|
||||||
*/
|
*/
|
||||||
void moveScrollBar(int type);
|
void moveScrollBar(int type);
|
||||||
|
|
||||||
private:
|
FullListView* m_listView=nullptr;
|
||||||
|
|
||||||
QStringList m_data;
|
private:
|
||||||
UkuiMenuInterface* m_ukuiMenuInterface=nullptr;
|
UkuiMenuInterface* m_ukuiMenuInterface=nullptr;
|
||||||
|
QStringList m_data;
|
||||||
QSpacerItem *m_spaceItem=nullptr;
|
QSpacerItem *m_spaceItem=nullptr;
|
||||||
ScrollArea* m_scrollArea=nullptr;
|
ScrollArea* m_scrollArea=nullptr;
|
||||||
ScrollAreaWid* m_scrollAreaWid=nullptr;
|
ScrollAreaWid* m_scrollAreaWid=nullptr;
|
||||||
QHBoxLayout *mainLayout = nullptr;
|
|
||||||
QVBoxLayout* m_scrollAreaWidLayout=nullptr;
|
QVBoxLayout* m_scrollAreaWidLayout=nullptr;
|
||||||
FullListView *m_listView = nullptr;
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* @brief Initializes UI
|
* @brief Initializes UI
|
||||||
|
|
|
@ -37,26 +37,19 @@ QString MenuAdaptor::GetSecurityConfigPath()
|
||||||
{
|
{
|
||||||
// handle method call org.ukui.menu.GetSecurityConfigPath
|
// handle method call org.ukui.menu.GetSecurityConfigPath
|
||||||
QString out0;
|
QString out0;
|
||||||
QMetaObject::invokeMethod(parent(), "getSecurityConfigPath", Q_RETURN_ARG(QString, out0));
|
QMetaObject::invokeMethod(parent(), "GetSecurityConfigPath", Q_RETURN_ARG(QString, out0));
|
||||||
return out0;
|
return out0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuAdaptor::ReloadSecurityConfig()
|
void MenuAdaptor::ReloadSecurityConfig()
|
||||||
{
|
{
|
||||||
// handle method call org.ukui.menu.ReloadSecurityConfig
|
// handle method call org.ukui.menu.ReloadSecurityConfig
|
||||||
QMetaObject::invokeMethod(parent(), "reloadSecurityConfig");
|
QMetaObject::invokeMethod(parent(), "ReloadSecurityConfig");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuAdaptor::WinKeyResponse()
|
void MenuAdaptor::WinKeyResponse()
|
||||||
{
|
{
|
||||||
// handle method call org.ukui.menu.WinKeyResponse
|
// handle method call org.ukui.menu.WinKeyResponse
|
||||||
QMetaObject::invokeMethod(parent(), "winKeyResponse");
|
QMetaObject::invokeMethod(parent(), "WinKeyResponse");
|
||||||
}
|
|
||||||
|
|
||||||
QStringList MenuAdaptor::GetPkgNameWhiteList()
|
|
||||||
{
|
|
||||||
QStringList pkgList;
|
|
||||||
QMetaObject::invokeMethod(parent(), "getPkgNameWhiteList", Q_RETURN_ARG(QStringList, pkgList));
|
|
||||||
return pkgList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,6 @@ class MenuAdaptor: public QDBusAbstractAdaptor
|
||||||
" </method>\n"
|
" </method>\n"
|
||||||
" <method name=\"ReloadSecurityConfig\"/>\n"
|
" <method name=\"ReloadSecurityConfig\"/>\n"
|
||||||
" <method name=\"WinKeyResponse\"/>\n"
|
" <method name=\"WinKeyResponse\"/>\n"
|
||||||
" <method name=\"GetPkgNameWhiteList\">\n"
|
|
||||||
" <arg direction=\"out\" type=\"s\"/>\n"
|
|
||||||
" </method>\n"
|
|
||||||
" </interface>\n"
|
" </interface>\n"
|
||||||
"")
|
"")
|
||||||
public:
|
public:
|
||||||
|
@ -52,7 +49,6 @@ public Q_SLOTS: // METHODS
|
||||||
QString GetSecurityConfigPath();
|
QString GetSecurityConfigPath();
|
||||||
void ReloadSecurityConfig();
|
void ReloadSecurityConfig();
|
||||||
void WinKeyResponse();
|
void WinKeyResponse();
|
||||||
QStringList GetPkgNameWhiteList();
|
|
||||||
Q_SIGNALS: // SIGNALS
|
Q_SIGNALS: // SIGNALS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,29 +18,24 @@
|
||||||
#include "dbus.h"
|
#include "dbus.h"
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include "src/RightClickMenu/uninstallwhitelist.h"
|
|
||||||
|
|
||||||
DBus::DBus(QObject *parent) : QObject(parent)
|
DBus::DBus(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBus::reloadSecurityConfig()
|
void DBus::ReloadSecurityConfig()
|
||||||
{
|
{
|
||||||
Q_EMIT sendReloadSignal();
|
Q_EMIT sendReloadSignal();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DBus::getSecurityConfigPath()
|
QString DBus::GetSecurityConfigPath()
|
||||||
{
|
{
|
||||||
QString path=QDir::homePath()+"/.config/ukui-menu-security-config.json";
|
QString path=QDir::homePath()+"/.config/ukui-menu-security-config.json";
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBus::winKeyResponse()
|
void DBus::WinKeyResponse()
|
||||||
{
|
{
|
||||||
Q_EMIT winKeyResponseSignal();
|
Q_EMIT winKeyResponseSignal();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList DBus::getPkgNameWhiteList()
|
|
||||||
{
|
|
||||||
return UninstallWhitelist::getInstance()->getPkgNameWhiteList();
|
|
||||||
}
|
|
||||||
|
|
|
@ -32,10 +32,9 @@ Q_SIGNALS:
|
||||||
void winKeyResponseSignal();
|
void winKeyResponseSignal();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
QString getSecurityConfigPath();
|
QString GetSecurityConfigPath();
|
||||||
void reloadSecurityConfig();
|
void ReloadSecurityConfig();
|
||||||
void winKeyResponse();
|
void WinKeyResponse();
|
||||||
QStringList getPkgNameWhiteList();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DBUS_H
|
#endif // DBUS_H
|
||||||
|
|
|
@ -58,13 +58,13 @@ void FullFunctionWidget::initUi()
|
||||||
m_ukuiMenuInterface = new UkuiMenuInterface;
|
m_ukuiMenuInterface = new UkuiMenuInterface;
|
||||||
initAppListWidget();
|
initAppListWidget();
|
||||||
initIconListWidget();
|
initIconListWidget();
|
||||||
m_flag = true;
|
flag = true;
|
||||||
//翻页灵敏度时间调节
|
//翻页灵敏度时间调节
|
||||||
m_time = new QTimer(this);
|
time = new QTimer(this);
|
||||||
connect(m_time, &QTimer::timeout, [ = ]() {
|
connect(time, &QTimer::timeout, [ = ]() {
|
||||||
if (m_flag == false) {
|
if (flag == false) {
|
||||||
m_flag = true;
|
flag = true;
|
||||||
m_time->stop();
|
time->stop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -74,14 +74,13 @@ void FullFunctionWidget::initUi()
|
||||||
*/
|
*/
|
||||||
void FullFunctionWidget::initAppListWidget()
|
void FullFunctionWidget::initAppListWidget()
|
||||||
{
|
{
|
||||||
layout = new QHBoxLayout(m_applistWid);
|
QHBoxLayout *layout = new QHBoxLayout(m_applistWid);
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
m_applistWid->setLayout(layout);
|
m_applistWid->setLayout(layout);
|
||||||
m_scrollArea = new ScrollArea(this);
|
m_scrollArea = new ScrollArea;
|
||||||
m_scrollAreaWid = new ScrollAreaWid(m_scrollArea);
|
m_scrollAreaWid = new ScrollAreaWid;
|
||||||
m_scrollAreaWid->setAttribute(Qt::WA_TranslucentBackground);
|
m_scrollAreaWid->setAttribute(Qt::WA_TranslucentBackground);
|
||||||
m_scrollArea->setFixedSize(m_applistWid->width(), m_applistWid->height());
|
m_scrollArea->setFixedSize(m_applistWid->width(), m_applistWid->height());
|
||||||
m_scrollAreaWid->setFixedWidth(m_scrollArea->width() - Style::SliderSize);
|
|
||||||
m_scrollArea->setWidget(m_scrollAreaWid);
|
m_scrollArea->setWidget(m_scrollAreaWid);
|
||||||
m_scrollArea->setWidgetResizable(true);
|
m_scrollArea->setWidgetResizable(true);
|
||||||
m_scrollAreaWidLayout = new QVBoxLayout;
|
m_scrollAreaWidLayout = new QVBoxLayout;
|
||||||
|
@ -92,25 +91,94 @@ void FullFunctionWidget::initAppListWidget()
|
||||||
connect(m_scrollArea->verticalScrollBar(), &QScrollBar::valueChanged,
|
connect(m_scrollArea->verticalScrollBar(), &QScrollBar::valueChanged,
|
||||||
this, &FullFunctionWidget::valueChangedSlot);
|
this, &FullFunctionWidget::valueChangedSlot);
|
||||||
m_appListBottomSpacer = new QSpacerItem(20, 40, QSizePolicy::Fixed, QSizePolicy::Expanding);
|
m_appListBottomSpacer = new QSpacerItem(20, 40, QSizePolicy::Fixed, QSizePolicy::Expanding);
|
||||||
fillSoftwareAppList();
|
fillAppList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 填充应用列表
|
* 填充应用列表
|
||||||
*/
|
*/
|
||||||
void FullFunctionWidget::fillSoftwareAppList()
|
void FullFunctionWidget::fillAppList()
|
||||||
{
|
{
|
||||||
m_classificationList.clear();
|
m_classificationList.clear();
|
||||||
QVector<QStringList> vector = UkuiMenuInterface::m_functionalVector;
|
QVector<QStringList> vector = UkuiMenuInterface::functionalVector;
|
||||||
QStringList functionList = m_ukuiMenuInterface->getFunctionClassName();
|
QStringList androidlist = vector.at(0);
|
||||||
|
|
||||||
for (int i = 0; i < vector.size(); i++) {
|
if (!androidlist.isEmpty()) {
|
||||||
if (!(vector.at(i).isEmpty())) {
|
insertClassificationBtn("Mobile");
|
||||||
insertClassificationBtn(functionList.at(i));
|
insertAppList(androidlist);
|
||||||
insertAppList(vector.at(i));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList netlist = vector.at(1);
|
||||||
|
|
||||||
|
if (!netlist.isEmpty()) {
|
||||||
|
insertClassificationBtn("Internet");
|
||||||
|
insertAppList(netlist);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList sociallist = vector.at(2);
|
||||||
|
|
||||||
|
if (!sociallist.isEmpty()) {
|
||||||
|
insertClassificationBtn("Social");
|
||||||
|
insertAppList(sociallist);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList avlist = vector.at(3);
|
||||||
|
|
||||||
|
if (!avlist.isEmpty()) {
|
||||||
|
insertClassificationBtn("Video");
|
||||||
|
insertAppList(avlist);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList developlist = vector.at(4);
|
||||||
|
|
||||||
|
if (!developlist.isEmpty()) {
|
||||||
|
insertClassificationBtn("Development");
|
||||||
|
insertAppList(developlist);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList graphicslist = vector.at(5);
|
||||||
|
|
||||||
|
if (!graphicslist.isEmpty()) {
|
||||||
|
insertClassificationBtn("Image");
|
||||||
|
insertAppList(graphicslist);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList gamelist = vector.at(6);
|
||||||
|
|
||||||
|
if (!gamelist.isEmpty()) {
|
||||||
|
insertClassificationBtn("Game");
|
||||||
|
insertAppList(gamelist);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList officelist = vector.at(7);
|
||||||
|
|
||||||
|
if (!officelist.isEmpty()) {
|
||||||
|
insertClassificationBtn("Office");
|
||||||
|
insertAppList(officelist);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList educationlist = vector.at(8);
|
||||||
|
|
||||||
|
if (!educationlist.isEmpty()) {
|
||||||
|
insertClassificationBtn("Education");
|
||||||
|
insertAppList(educationlist);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList systemadminlist = vector.at(9);
|
||||||
|
|
||||||
|
if (!systemadminlist.isEmpty()) {
|
||||||
|
insertClassificationBtn("System");
|
||||||
|
insertAppList(systemadminlist);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList otherlist = vector.at(10);
|
||||||
|
|
||||||
|
if (!otherlist.isEmpty()) {
|
||||||
|
insertClassificationBtn("Others");
|
||||||
|
insertAppList(otherlist);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_scrollAreaWidLayout->addItem(m_appListBottomSpacer);
|
||||||
resizeScrollAreaControls();
|
resizeScrollAreaControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,6 +192,13 @@ void FullFunctionWidget::insertClassificationBtn(QString category)
|
||||||
void FullFunctionWidget::insertAppList(QStringList desktopfplist)
|
void FullFunctionWidget::insertAppList(QStringList desktopfplist)
|
||||||
{
|
{
|
||||||
FullListView *listview = new FullListView(this, 2);
|
FullListView *listview = new FullListView(this, 2);
|
||||||
|
//修复异常黑框问题
|
||||||
|
connect(m_scrollArea, &ScrollArea::requestUpdate, listview->viewport(), [ = ]() {
|
||||||
|
QEventLoop loop;
|
||||||
|
QTimer::singleShot(1, &loop, SLOT(quit()));
|
||||||
|
loop.exec();
|
||||||
|
listview->repaint(listview->rect());
|
||||||
|
});
|
||||||
connect(listview, &FullListView::sendSetslidebar, this, &FullFunctionWidget::onSetSlider);
|
connect(listview, &FullListView::sendSetslidebar, this, &FullFunctionWidget::onSetSlider);
|
||||||
connect(this, &FullFunctionWidget::selectFirstItem, listview, &FullListView::selectFirstItem);
|
connect(this, &FullFunctionWidget::selectFirstItem, listview, &FullListView::selectFirstItem);
|
||||||
listview->installEventFilter(this);
|
listview->installEventFilter(this);
|
||||||
|
@ -165,7 +240,7 @@ void FullFunctionWidget::updateAppListView()
|
||||||
delete child;
|
delete child;
|
||||||
}
|
}
|
||||||
|
|
||||||
fillSoftwareAppList();
|
fillAppList();
|
||||||
|
|
||||||
//刷新图标列表界面
|
//刷新图标列表界面
|
||||||
Q_FOREACH (QAbstractButton *button, m_buttonList) {
|
Q_FOREACH (QAbstractButton *button, m_buttonList) {
|
||||||
|
@ -222,7 +297,9 @@ void FullFunctionWidget::resizeScrollAreaControls()
|
||||||
void FullFunctionWidget::initIconListWidget()
|
void FullFunctionWidget::initIconListWidget()
|
||||||
{
|
{
|
||||||
m_iconListScrollArea = new ClassifyBtnScrollArea(m_iconListWid);
|
m_iconListScrollArea = new ClassifyBtnScrollArea(m_iconListWid);
|
||||||
m_iconListScrollAreaWid = new ClassifyBtnScrollAreaWid(m_iconListScrollArea);
|
// m_iconListScrollArea->resize(Style::LeftBtnWidth,
|
||||||
|
// m_iconListWid->height());
|
||||||
|
m_iconListScrollAreaWid = new ClassifyBtnScrollAreaWid;
|
||||||
m_iconListScrollAreaWid->setFixedSize(Style::LeftBtnWidth,
|
m_iconListScrollAreaWid->setFixedSize(Style::LeftBtnWidth,
|
||||||
m_iconListWid->height());
|
m_iconListWid->height());
|
||||||
m_iconListScrollAreaWidLayout = new QVBoxLayout;
|
m_iconListScrollAreaWidLayout = new QVBoxLayout;
|
||||||
|
@ -255,7 +332,7 @@ void FullFunctionWidget::initIconListScrollArea()
|
||||||
Style::LeftIconSize,
|
Style::LeftIconSize,
|
||||||
m_classificationList.at(i),
|
m_classificationList.at(i),
|
||||||
true,
|
true,
|
||||||
true, this);
|
true);
|
||||||
iconbtn->setChecked(false);
|
iconbtn->setChecked(false);
|
||||||
m_buttonList.append(iconbtn);
|
m_buttonList.append(iconbtn);
|
||||||
m_iconListScrollAreaWidLayout->addWidget(iconbtn);
|
m_iconListScrollAreaWidLayout->addWidget(iconbtn);
|
||||||
|
@ -390,7 +467,6 @@ void FullFunctionWidget::repaintWidget()
|
||||||
Style::AppListWidHeight);
|
Style::AppListWidHeight);
|
||||||
m_applistWid->setFixedSize(Style::AppListWidWidth, this->height());
|
m_applistWid->setFixedSize(Style::AppListWidWidth, this->height());
|
||||||
m_scrollArea->setFixedSize(m_applistWid->width(), m_applistWid->height());
|
m_scrollArea->setFixedSize(m_applistWid->width(), m_applistWid->height());
|
||||||
m_scrollAreaWid->setFixedWidth(m_scrollArea->width() - Style::SliderSize);
|
|
||||||
m_iconListWid->setFixedSize(Style::LeftWidWidth, this->height());
|
m_iconListWid->setFixedSize(Style::LeftWidWidth, this->height());
|
||||||
m_iconListScrollAreaWid->setFixedSize(Style::LeftBtnWidth,
|
m_iconListScrollAreaWid->setFixedSize(Style::LeftBtnWidth,
|
||||||
m_iconListWid->height());
|
m_iconListWid->height());
|
||||||
|
@ -419,8 +495,14 @@ void FullFunctionWidget::moveScrollBar(int type)
|
||||||
|
|
||||||
void FullFunctionWidget::onSetSlider(int value)
|
void FullFunctionWidget::onSetSlider(int value)
|
||||||
{
|
{
|
||||||
|
// if(flag)
|
||||||
|
// {
|
||||||
|
// flag = false;
|
||||||
|
// time->start(100);
|
||||||
int curvalue = m_scrollArea->verticalScrollBar()->value();
|
int curvalue = m_scrollArea->verticalScrollBar()->value();
|
||||||
m_scrollArea->verticalScrollBar()->setValue(curvalue + value);
|
m_scrollArea->verticalScrollBar()->setValue(curvalue + value);
|
||||||
|
// qDebug() << "FullFunctionWidget::onSetSlider" << curvalue;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FullFunctionWidget::eventFilter(QObject *watched, QEvent *event)
|
bool FullFunctionWidget::eventFilter(QObject *watched, QEvent *event)
|
||||||
|
@ -438,6 +520,34 @@ bool FullFunctionWidget::eventFilter(QObject *watched, QEvent *event)
|
||||||
Q_EMIT setFocusToSideWin();
|
Q_EMIT setFocusToSideWin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if(ke->key() == Qt::Key_Up)
|
||||||
|
// {
|
||||||
|
// QLayoutItem* widItemTop = m_scrollAreaWidLayout->itemAt(1);
|
||||||
|
// QWidget* widTop = widItemTop->widget();
|
||||||
|
// FullListView* m_listviewTop = qobject_cast<FullListView*>(widTop);
|
||||||
|
// if(!m_listviewTop->hasFocus())
|
||||||
|
// {
|
||||||
|
// QAbstractButton* buttonTop = getCurLetterButton(( --m_index) % m_buttonList.size());
|
||||||
|
// btnGroupClickedSlot(buttonTop);
|
||||||
|
// this->m_scrollArea->setFocusToPreChild();
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if(ke->key() == Qt::Key_Down)
|
||||||
|
// {
|
||||||
|
// QLayoutItem* widItem = m_scrollAreaWidLayout->itemAt(2 * m_buttonList.size() - 1);
|
||||||
|
// QWidget* wid = widItem->widget();
|
||||||
|
// FullListView* m_listview = qobject_cast<FullListView*>(wid);
|
||||||
|
|
||||||
|
// if(!m_listview->hasFocus())
|
||||||
|
// {
|
||||||
|
// QAbstractButton* button = getCurLetterButton(( ++m_index) % m_buttonList.size());
|
||||||
|
// btnGroupClickedSlot(button);
|
||||||
|
// this->m_scrollArea->setFocusToNextChild();
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if (ke->key() == Qt::Key_Up) {
|
if (ke->key() == Qt::Key_Up) {
|
||||||
if (!m_listviewTop->hasFocus()) {
|
if (!m_listviewTop->hasFocus()) {
|
||||||
QAbstractButton *buttonTop = getCurLetterButton((--m_index) % m_buttonList.size());
|
QAbstractButton *buttonTop = getCurLetterButton((--m_index) % m_buttonList.size());
|
||||||
|
|
|
@ -87,14 +87,13 @@ private:
|
||||||
QVBoxLayout* m_scrollAreaWidLayout=nullptr;
|
QVBoxLayout* m_scrollAreaWidLayout=nullptr;
|
||||||
QStringList m_classificationList;//Store the list of category buttons
|
QStringList m_classificationList;//Store the list of category buttons
|
||||||
QStringList m_data;
|
QStringList m_data;
|
||||||
QTimer *m_time = nullptr;
|
QTimer *time = nullptr;
|
||||||
bool m_flag;
|
bool flag;
|
||||||
/*Function classification list interface*/
|
/*Function classification list interface*/
|
||||||
QWidget* m_iconListWid=nullptr;
|
QWidget* m_iconListWid=nullptr;
|
||||||
ClassifyBtnScrollArea* m_iconListScrollArea=nullptr;
|
ClassifyBtnScrollArea* m_iconListScrollArea=nullptr;
|
||||||
ClassifyBtnScrollAreaWid* m_iconListScrollAreaWid=nullptr;
|
ClassifyBtnScrollAreaWid* m_iconListScrollAreaWid=nullptr;
|
||||||
QVBoxLayout* m_iconListScrollAreaWidLayout=nullptr;
|
QVBoxLayout* m_iconListScrollAreaWidLayout=nullptr;
|
||||||
QHBoxLayout *layout = nullptr;
|
|
||||||
QList<QAbstractButton*> m_buttonList;
|
QList<QAbstractButton*> m_buttonList;
|
||||||
QButtonGroup* m_btnGroup=nullptr;
|
QButtonGroup* m_btnGroup=nullptr;
|
||||||
QSpacerItem* m_topSpacerItem=nullptr;
|
QSpacerItem* m_topSpacerItem=nullptr;
|
||||||
|
@ -125,7 +124,7 @@ protected:
|
||||||
/**
|
/**
|
||||||
* @brief fill application list
|
* @brief fill application list
|
||||||
*/
|
*/
|
||||||
void fillSoftwareAppList();
|
void fillAppList();
|
||||||
/**
|
/**
|
||||||
* @brief Insert category button
|
* @brief Insert category button
|
||||||
* @param category: Functional classification name
|
* @param category: Functional classification name
|
||||||
|
|