Import Upstream version 3.0.2.0509hw1

This commit is contained in:
谢炜 2022-05-20 16:38:28 +08:00
parent 421495ce0a
commit e956f5f064
188 changed files with 2540 additions and 2703 deletions

0
.github/workflows/build.yml vendored Normal file → Executable file
View File

0
COPYING Normal file → Executable file
View File

0
NEWS Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
data/img/mainviewwidget/Development-Checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 745 B

After

Width:  |  Height:  |  Size: 745 B

0
data/img/mainviewwidget/Development-Disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 833 B

After

Width:  |  Height:  |  Size: 833 B

0
data/img/mainviewwidget/Development-Enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 880 B

After

Width:  |  Height:  |  Size: 880 B

0
data/img/mainviewwidget/Development-Normal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 832 B

After

Width:  |  Height:  |  Size: 832 B

0
data/img/mainviewwidget/Education-Checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 621 B

After

Width:  |  Height:  |  Size: 621 B

0
data/img/mainviewwidget/Education-Disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 734 B

After

Width:  |  Height:  |  Size: 734 B

0
data/img/mainviewwidget/Education-Enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 784 B

After

Width:  |  Height:  |  Size: 784 B

0
data/img/mainviewwidget/Education-Normal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 707 B

0
data/img/mainviewwidget/Game-Checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 788 B

After

Width:  |  Height:  |  Size: 788 B

0
data/img/mainviewwidget/Game-Disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
data/img/mainviewwidget/Game-Enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

0
data/img/mainviewwidget/Game-Normal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
data/img/mainviewwidget/Image-Checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 644 B

0
data/img/mainviewwidget/Image-Disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 636 B

After

Width:  |  Height:  |  Size: 636 B

0
data/img/mainviewwidget/Image-Enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 799 B

After

Width:  |  Height:  |  Size: 799 B

0
data/img/mainviewwidget/Image-Normal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 878 B

After

Width:  |  Height:  |  Size: 878 B

0
data/img/mainviewwidget/Internet-Checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 847 B

After

Width:  |  Height:  |  Size: 847 B

0
data/img/mainviewwidget/Internet-Disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 999 B

After

Width:  |  Height:  |  Size: 999 B

0
data/img/mainviewwidget/Internet-Enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 922 B

After

Width:  |  Height:  |  Size: 922 B

0
data/img/mainviewwidget/Internet-Normal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 998 B

After

Width:  |  Height:  |  Size: 998 B

0
data/img/mainviewwidget/Mobile-Checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 979 B

After

Width:  |  Height:  |  Size: 979 B

0
data/img/mainviewwidget/Mobile-Disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 730 B

0
data/img/mainviewwidget/Mobile-Enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 692 B

After

Width:  |  Height:  |  Size: 692 B

0
data/img/mainviewwidget/Mobile-Normal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 729 B

0
data/img/mainviewwidget/Office-Checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 713 B

After

Width:  |  Height:  |  Size: 713 B

0
data/img/mainviewwidget/Office-Disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 872 B

After

Width:  |  Height:  |  Size: 872 B

0
data/img/mainviewwidget/Office-Enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 924 B

After

Width:  |  Height:  |  Size: 924 B

0
data/img/mainviewwidget/Office-Normal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 871 B

After

Width:  |  Height:  |  Size: 871 B

0
data/img/mainviewwidget/Others-Checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 742 B

After

Width:  |  Height:  |  Size: 742 B

0
data/img/mainviewwidget/Others-Disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 852 B

0
data/img/mainviewwidget/Others-Enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 782 B

After

Width:  |  Height:  |  Size: 782 B

0
data/img/mainviewwidget/Others-Normal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 851 B

After

Width:  |  Height:  |  Size: 851 B

0
data/img/mainviewwidget/Social-Checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 792 B

0
data/img/mainviewwidget/Social-Disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 991 B

After

Width:  |  Height:  |  Size: 991 B

0
data/img/mainviewwidget/Social-Enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 927 B

After

Width:  |  Height:  |  Size: 927 B

0
data/img/mainviewwidget/Social-Normal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 990 B

After

Width:  |  Height:  |  Size: 990 B

0
data/img/mainviewwidget/System-Checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 726 B

After

Width:  |  Height:  |  Size: 726 B

0
data/img/mainviewwidget/System-Disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1003 B

After

Width:  |  Height:  |  Size: 1003 B

0
data/img/mainviewwidget/System-Enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 723 B

After

Width:  |  Height:  |  Size: 723 B

0
data/img/mainviewwidget/System-Normal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1005 B

After

Width:  |  Height:  |  Size: 1005 B

0
data/img/mainviewwidget/Video-Checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 957 B

After

Width:  |  Height:  |  Size: 957 B

0
data/img/mainviewwidget/Video-Disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1022 B

After

Width:  |  Height:  |  Size: 1022 B

0
data/img/mainviewwidget/Video-Enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
data/img/mainviewwidget/Video-Normal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1021 B

After

Width:  |  Height:  |  Size: 1021 B

0
data/img/mainviewwidget/attributeaction.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 765 B

After

Width:  |  Height:  |  Size: 765 B

0
data/img/mainviewwidget/downarrow-pressed.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 541 B

0
data/img/mainviewwidget/downarrow.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 541 B

0
data/img/mainviewwidget/fixed.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 678 B

After

Width:  |  Height:  |  Size: 678 B

0
data/img/mainviewwidget/leftarrow-hover.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 539 B

After

Width:  |  Height:  |  Size: 539 B

0
data/img/mainviewwidget/leftarrow.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 539 B

After

Width:  |  Height:  |  Size: 539 B

0
data/img/mainviewwidget/lock-fs.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

0
data/img/mainviewwidget/lock.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 510 B

After

Width:  |  Height:  |  Size: 510 B

0
data/img/mainviewwidget/recent-disabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 842 B

After

Width:  |  Height:  |  Size: 842 B

0
data/img/mainviewwidget/recent-enabled.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 831 B

After

Width:  |  Height:  |  Size: 831 B

0
data/img/mainviewwidget/recent-gray.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 841 B

After

Width:  |  Height:  |  Size: 841 B

0
data/img/mainviewwidget/recent.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 828 B

After

Width:  |  Height:  |  Size: 828 B

0
data/img/mainviewwidget/rightarrow-hover.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 535 B

After

Width:  |  Height:  |  Size: 535 B

0
data/img/mainviewwidget/rightarrow.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 535 B

After

Width:  |  Height:  |  Size: 535 B

0
data/img/mainviewwidget/search.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 738 B

After

Width:  |  Height:  |  Size: 738 B

0
data/img/mainviewwidget/unfixed.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 929 B

After

Width:  |  Height:  |  Size: 929 B

0
data/img/mainviewwidget/uninstall.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 816 B

After

Width:  |  Height:  |  Size: 816 B

0
data/img/mainviewwidget/uparrow-pressed.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 525 B

0
data/img/mainviewwidget/uparrow.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 525 B

0
data/img/sidebarwidget/commonuse.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
data/img/sidebarwidget/computer.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 681 B

After

Width:  |  Height:  |  Size: 681 B

0
data/img/sidebarwidget/control.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

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

0
data/img/sidebarwidget/fixed.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 678 B

After

Width:  |  Height:  |  Size: 678 B

0
data/img/sidebarwidget/fullusericon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 794 B

After

Width:  |  Height:  |  Size: 794 B

0
data/img/sidebarwidget/function.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 839 B

After

Width:  |  Height:  |  Size: 839 B

0
data/img/sidebarwidget/letter.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 576 B

After

Width:  |  Height:  |  Size: 576 B

0
data/img/sidebarwidget/lock.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 784 B

After

Width:  |  Height:  |  Size: 784 B

0
data/img/sidebarwidget/max.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 946 B

After

Width:  |  Height:  |  Size: 946 B

0
data/img/sidebarwidget/min.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 951 B

After

Width:  |  Height:  |  Size: 951 B

0
data/img/sidebarwidget/personal.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 403 B

0
data/img/sidebarwidget/rightarrow.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 535 B

After

Width:  |  Height:  |  Size: 535 B

0
data/img/sidebarwidget/setting.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

0
data/img/sidebarwidget/shutdown.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
data/img/sidebarwidget/trash.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 967 B

After

Width:  |  Height:  |  Size: 967 B

0
data/img/sidebarwidget/unfixed.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 929 B

After

Width:  |  Height:  |  Size: 929 B

0
data/img/sidebarwidget/usericon-darkcolor.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 693 B

After

Width:  |  Height:  |  Size: 693 B

0
data/img/sidebarwidget/usericon-lightcolor.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 691 B

After

Width:  |  Height:  |  Size: 691 B

20
main.cpp Normal file → Executable file
View File

@ -29,16 +29,12 @@
#include <KWindowEffects>
#include "src/UtilityFunction/utility.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>
int main(int argc, char *argv[])
{
initUkuiLog4qt("ukui-menu");
projectCodeName = KDKGetPrjCodeName().c_str();
qRegisterMetaType<QVector<QStringList>>("QVector<QStringList>");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
@ -55,17 +51,31 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}
// auto Style=new ProxyStyle;
// app.setStyle(Style);
QTranslator translator;
if (translator.load(QLocale(), "ukui-menu", "_", QM_FILES_INSTALL_PATH)) {
app.installTranslator(&translator);
} else {
myDebug() << "Load translations file" << QLocale() << "failed!";
qDebug() << "Load translations file" << QLocale() << "failed!";
}
Zeeker::FileUtils::loadHanziTable(":/src/SearchResultWidget/pinyinWithoutTone.txt");
MainWindow 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.raise();
w.update();

0
man/ukui-menu.1 Normal file → Executable file
View File

1
res.qrc Normal file → Executable file
View File

@ -83,5 +83,6 @@
<file>data/img/mainviewwidget/Mobile-Normal.svg</file>
<file>src/SearchResultWidget/pinyinWithTone.txt</file>
<file>src/SearchResultWidget/pinyinWithoutTone.txt</file>
<file>data/img/sidebarwidget/default.svg</file>
</qresource>
</RCC>

5
src/CommonUseWidget/commonusewidget.cpp Normal file → Executable file
View File

@ -54,7 +54,8 @@ void CommonUseWidget::initUi()
void CommonUseWidget::initAppListWidget()
{
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();
connect(m_listView, &ListView::sendItemClickedSignal, this, &CommonUseWidget::execApplication);
connect(m_listView, &ListView::sendUpdateAppListSignal, this, &CommonUseWidget::updateListViewSlot);
@ -69,7 +70,7 @@ void CommonUseWidget::fillAppList()
{
m_data.clear();
Q_FOREACH (QString desktopfp, UkuiMenuInterface::m_allAppVector) {
Q_FOREACH (QString desktopfp, UkuiMenuInterface::allAppVector) {
m_data.append(QStringList() << desktopfp << "1");
}

0
src/CommonUseWidget/commonusewidget.h Normal file → Executable file
View File

22
src/CommonUseWidget/fullcommonusewidget.cpp Normal file → Executable file
View File

@ -43,18 +43,16 @@ void FullCommonUseWidget::initUi()
this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
this->setFixedSize(Style::MainViewWidWidth,
Style::AppListWidHeight);
myDebug() << "width" << this->width() << "height" << this->height();
this->setFocusPolicy(Qt::NoFocus);
mainLayout = new QHBoxLayout;
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->setContentsMargins(0, 0, 0, 0);
this->setLayout(mainLayout);
m_spaceItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Fixed);
mainLayout->addItem(m_spaceItem);
m_scrollArea = new ScrollArea(this);
m_scrollAreaWid = new ScrollAreaWid(m_scrollArea);
m_scrollArea = new ScrollArea;
m_scrollAreaWid = new ScrollAreaWid;
m_scrollAreaWid->setAttribute(Qt::WA_TranslucentBackground);
m_scrollArea->setFixedSize(Style::AppListWidWidth, this->height());
m_scrollAreaWid->setFixedWidth(m_scrollArea->width() - Style::SliderSize);
m_scrollArea->setWidget(m_scrollAreaWid);
m_scrollArea->setWidgetResizable(true);
m_scrollAreaWidLayout = new QVBoxLayout;
@ -70,7 +68,16 @@ void FullCommonUseWidget::initUi()
void FullCommonUseWidget::initAppListWidget()
{
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);
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::sendUpdateAppListSignal, this, &FullCommonUseWidget::updateListViewSlot);
connect(m_listView, &FullListView::sendHideMainWindowSignal, this, &FullCommonUseWidget::sendHideMainWindowSignal);
@ -100,7 +107,7 @@ void FullCommonUseWidget::fillAppList()
{
m_data.clear();
Q_FOREACH (QString desktopfp, UkuiMenuInterface::m_allAppVector) {
Q_FOREACH (QString desktopfp, UkuiMenuInterface::allAppVector) {
m_data.append(desktopfp);
}
@ -119,6 +126,8 @@ void FullCommonUseWidget::execApplication(QString desktopfp)
void FullCommonUseWidget::selectFirstItem()
{
// this->focusNextChild();
qDebug() << "void FullCommonUseWidget::selectFirstItem()";
m_listView->setCurrentIndex(m_listView->model()->index(0, 0));
}
@ -164,7 +173,6 @@ void FullCommonUseWidget::repaintWidget()
this->setFixedSize(Style::MainViewWidWidth,
Style::AppListWidHeight);
m_scrollArea->setFixedSize(Style::AppListWidWidth, this->height());
m_scrollAreaWid->setFixedWidth(m_scrollArea->width() - Style::SliderSize);
m_scrollAreaWidLayout->removeWidget(m_listView);
m_listView->setParent(nullptr);
delete m_listView;

8
src/CommonUseWidget/fullcommonusewidget.h Normal file → Executable file
View File

@ -65,16 +65,16 @@ public:
*/
void moveScrollBar(int type);
private:
FullListView* m_listView=nullptr;
QStringList m_data;
private:
UkuiMenuInterface* m_ukuiMenuInterface=nullptr;
QStringList m_data;
QSpacerItem *m_spaceItem=nullptr;
ScrollArea* m_scrollArea=nullptr;
ScrollAreaWid* m_scrollAreaWid=nullptr;
QHBoxLayout *mainLayout = nullptr;
QVBoxLayout* m_scrollAreaWidLayout=nullptr;
FullListView *m_listView = nullptr;
protected:
/**
* @brief Initializes UI

13
src/DBus/dbus-adaptor.cpp Normal file → Executable file
View File

@ -37,26 +37,19 @@ QString MenuAdaptor::GetSecurityConfigPath()
{
// handle method call org.ukui.menu.GetSecurityConfigPath
QString out0;
QMetaObject::invokeMethod(parent(), "getSecurityConfigPath", Q_RETURN_ARG(QString, out0));
QMetaObject::invokeMethod(parent(), "GetSecurityConfigPath", Q_RETURN_ARG(QString, out0));
return out0;
}
void MenuAdaptor::ReloadSecurityConfig()
{
// handle method call org.ukui.menu.ReloadSecurityConfig
QMetaObject::invokeMethod(parent(), "reloadSecurityConfig");
QMetaObject::invokeMethod(parent(), "ReloadSecurityConfig");
}
void MenuAdaptor::WinKeyResponse()
{
// handle method call org.ukui.menu.WinKeyResponse
QMetaObject::invokeMethod(parent(), "winKeyResponse");
}
QStringList MenuAdaptor::GetPkgNameWhiteList()
{
QStringList pkgList;
QMetaObject::invokeMethod(parent(), "getPkgNameWhiteList", Q_RETURN_ARG(QStringList, pkgList));
return pkgList;
QMetaObject::invokeMethod(parent(), "WinKeyResponse");
}

4
src/DBus/dbus-adaptor.h Normal file → Executable file
View File

@ -38,9 +38,6 @@ class MenuAdaptor: public QDBusAbstractAdaptor
" </method>\n"
" <method name=\"ReloadSecurityConfig\"/>\n"
" <method name=\"WinKeyResponse\"/>\n"
" <method name=\"GetPkgNameWhiteList\">\n"
" <arg direction=\"out\" type=\"s\"/>\n"
" </method>\n"
" </interface>\n"
"")
public:
@ -52,7 +49,6 @@ public Q_SLOTS: // METHODS
QString GetSecurityConfigPath();
void ReloadSecurityConfig();
void WinKeyResponse();
QStringList GetPkgNameWhiteList();
Q_SIGNALS: // SIGNALS
};

13
src/DBus/dbus.cpp Normal file → Executable file
View File

@ -18,29 +18,24 @@
#include "dbus.h"
#include <QFileInfo>
#include <QDir>
#include "src/RightClickMenu/uninstallwhitelist.h"
DBus::DBus(QObject *parent) : QObject(parent)
{
}
void DBus::reloadSecurityConfig()
void DBus::ReloadSecurityConfig()
{
Q_EMIT sendReloadSignal();
}
QString DBus::getSecurityConfigPath()
QString DBus::GetSecurityConfigPath()
{
QString path=QDir::homePath()+"/.config/ukui-menu-security-config.json";
return path;
}
void DBus::winKeyResponse()
void DBus::WinKeyResponse()
{
Q_EMIT winKeyResponseSignal();
}
QStringList DBus::getPkgNameWhiteList()
{
return UninstallWhitelist::getInstance()->getPkgNameWhiteList();
}

7
src/DBus/dbus.h Normal file → Executable file
View File

@ -32,10 +32,9 @@ Q_SIGNALS:
void winKeyResponseSignal();
public Q_SLOTS:
QString getSecurityConfigPath();
void reloadSecurityConfig();
void winKeyResponse();
QStringList getPkgNameWhiteList();
QString GetSecurityConfigPath();
void ReloadSecurityConfig();
void WinKeyResponse();
};
#endif // DBUS_H

0
src/DBus/org.ukui.menu.xml Normal file → Executable file
View File

156
src/FunctionWidget/fullfunctionwidget.cpp Normal file → Executable file
View File

@ -58,13 +58,13 @@ void FullFunctionWidget::initUi()
m_ukuiMenuInterface = new UkuiMenuInterface;
initAppListWidget();
initIconListWidget();
m_flag = true;
flag = true;
//翻页灵敏度时间调节
m_time = new QTimer(this);
connect(m_time, &QTimer::timeout, [ = ]() {
if (m_flag == false) {
m_flag = true;
m_time->stop();
time = new QTimer(this);
connect(time, &QTimer::timeout, [ = ]() {
if (flag == false) {
flag = true;
time->stop();
}
});
}
@ -74,14 +74,13 @@ void FullFunctionWidget::initUi()
*/
void FullFunctionWidget::initAppListWidget()
{
layout = new QHBoxLayout(m_applistWid);
QHBoxLayout *layout = new QHBoxLayout(m_applistWid);
layout->setContentsMargins(0, 0, 0, 0);
m_applistWid->setLayout(layout);
m_scrollArea = new ScrollArea(this);
m_scrollAreaWid = new ScrollAreaWid(m_scrollArea);
m_scrollArea = new ScrollArea;
m_scrollAreaWid = new ScrollAreaWid;
m_scrollAreaWid->setAttribute(Qt::WA_TranslucentBackground);
m_scrollArea->setFixedSize(m_applistWid->width(), m_applistWid->height());
m_scrollAreaWid->setFixedWidth(m_scrollArea->width() - Style::SliderSize);
m_scrollArea->setWidget(m_scrollAreaWid);
m_scrollArea->setWidgetResizable(true);
m_scrollAreaWidLayout = new QVBoxLayout;
@ -92,25 +91,94 @@ void FullFunctionWidget::initAppListWidget()
connect(m_scrollArea->verticalScrollBar(), &QScrollBar::valueChanged,
this, &FullFunctionWidget::valueChangedSlot);
m_appListBottomSpacer = new QSpacerItem(20, 40, QSizePolicy::Fixed, QSizePolicy::Expanding);
fillSoftwareAppList();
fillAppList();
}
/**
*
*/
void FullFunctionWidget::fillSoftwareAppList()
void FullFunctionWidget::fillAppList()
{
m_classificationList.clear();
QVector<QStringList> vector = UkuiMenuInterface::m_functionalVector;
QStringList functionList = m_ukuiMenuInterface->getFunctionClassName();
QVector<QStringList> vector = UkuiMenuInterface::functionalVector;
QStringList androidlist = vector.at(0);
for (int i = 0; i < vector.size(); i++) {
if (!(vector.at(i).isEmpty())) {
insertClassificationBtn(functionList.at(i));
insertAppList(vector.at(i));
}
if (!androidlist.isEmpty()) {
insertClassificationBtn("Mobile");
insertAppList(androidlist);
}
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();
}
@ -124,6 +192,13 @@ void FullFunctionWidget::insertClassificationBtn(QString category)
void FullFunctionWidget::insertAppList(QStringList desktopfplist)
{
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(this, &FullFunctionWidget::selectFirstItem, listview, &FullListView::selectFirstItem);
listview->installEventFilter(this);
@ -165,7 +240,7 @@ void FullFunctionWidget::updateAppListView()
delete child;
}
fillSoftwareAppList();
fillAppList();
//刷新图标列表界面
Q_FOREACH (QAbstractButton *button, m_buttonList) {
@ -222,7 +297,9 @@ void FullFunctionWidget::resizeScrollAreaControls()
void FullFunctionWidget::initIconListWidget()
{
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_iconListWid->height());
m_iconListScrollAreaWidLayout = new QVBoxLayout;
@ -255,7 +332,7 @@ void FullFunctionWidget::initIconListScrollArea()
Style::LeftIconSize,
m_classificationList.at(i),
true,
true, this);
true);
iconbtn->setChecked(false);
m_buttonList.append(iconbtn);
m_iconListScrollAreaWidLayout->addWidget(iconbtn);
@ -390,7 +467,6 @@ void FullFunctionWidget::repaintWidget()
Style::AppListWidHeight);
m_applistWid->setFixedSize(Style::AppListWidWidth, this->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_iconListScrollAreaWid->setFixedSize(Style::LeftBtnWidth,
m_iconListWid->height());
@ -419,8 +495,14 @@ void FullFunctionWidget::moveScrollBar(int type)
void FullFunctionWidget::onSetSlider(int value)
{
// if(flag)
// {
// flag = false;
// time->start(100);
int curvalue = m_scrollArea->verticalScrollBar()->value();
m_scrollArea->verticalScrollBar()->setValue(curvalue + value);
// qDebug() << "FullFunctionWidget::onSetSlider" << curvalue;
// }
}
bool FullFunctionWidget::eventFilter(QObject *watched, QEvent *event)
@ -438,6 +520,34 @@ bool FullFunctionWidget::eventFilter(QObject *watched, QEvent *event)
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 (!m_listviewTop->hasFocus()) {
QAbstractButton *buttonTop = getCurLetterButton((--m_index) % m_buttonList.size());

7
src/FunctionWidget/fullfunctionwidget.h Normal file → Executable file
View File

@ -87,14 +87,13 @@ private:
QVBoxLayout* m_scrollAreaWidLayout=nullptr;
QStringList m_classificationList;//Store the list of category buttons
QStringList m_data;
QTimer *m_time = nullptr;
bool m_flag;
QTimer *time = nullptr;
bool flag;
/*Function classification list interface*/
QWidget* m_iconListWid=nullptr;
ClassifyBtnScrollArea* m_iconListScrollArea=nullptr;
ClassifyBtnScrollAreaWid* m_iconListScrollAreaWid=nullptr;
QVBoxLayout* m_iconListScrollAreaWidLayout=nullptr;
QHBoxLayout *layout = nullptr;
QList<QAbstractButton*> m_buttonList;
QButtonGroup* m_btnGroup=nullptr;
QSpacerItem* m_topSpacerItem=nullptr;
@ -125,7 +124,7 @@ protected:
/**
* @brief fill application list
*/
void fillSoftwareAppList();
void fillAppList();
/**
* @brief Insert category button
* @param category: Functional classification name

Some files were not shown because too many files have changed in this diff Show More