From c0639b8845e5dfa7e8994c66223f8193d8b2b0c7 Mon Sep 17 00:00:00 2001 From: youdiansaodongxi Date: Thu, 16 May 2024 19:49:37 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix(libappdata):=20=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E5=90=AF=E5=8A=A8=E6=97=B6=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E5=AE=89=E8=A3=85=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libappdata/basic-app-model.cpp | 2 ++ src/libappdata/recently-installed-model.cpp | 5 +++++ src/settings/user-config.cpp | 7 +++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libappdata/basic-app-model.cpp b/src/libappdata/basic-app-model.cpp index 0c4662e..16da5ed 100644 --- a/src/libappdata/basic-app-model.cpp +++ b/src/libappdata/basic-app-model.cpp @@ -19,6 +19,7 @@ */ #include "basic-app-model.h" +#include "user-config.h" #include @@ -149,6 +150,7 @@ void BasicAppModel::onAppUpdated(const QVector > void BasicAppModel::onAppDeleted(const QStringList &apps) { for (const auto &appid : apps) { + UserConfig::instance()->removePreInstalledApp(appid); int index = indexOfApp(appid); if (index < 0) { continue; diff --git a/src/libappdata/recently-installed-model.cpp b/src/libappdata/recently-installed-model.cpp index 006fbb8..981a500 100644 --- a/src/libappdata/recently-installed-model.cpp +++ b/src/libappdata/recently-installed-model.cpp @@ -20,6 +20,7 @@ #include "recently-installed-model.h" #include "basic-app-model.h" +#include "user-config.h" #include #include @@ -44,6 +45,10 @@ RecentlyInstalledModel::RecentlyInstalledModel(QObject *parent) : QSortFilterPro bool RecentlyInstalledModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const { QModelIndex sourceIndex = sourceModel()->index(source_row, 0, source_parent); + // 是否为预装应用 + if (UserConfig::instance()->isPreInstalledApps(sourceIndex.data(DataEntity::Id).toString())) { + return false; + } // 是否打开过 if (sourceIndex.data(DataEntity::IsLaunched).toInt() != 0) { return false; diff --git a/src/settings/user-config.cpp b/src/settings/user-config.cpp index de211a9..9bc8a52 100644 --- a/src/settings/user-config.cpp +++ b/src/settings/user-config.cpp @@ -111,8 +111,11 @@ bool UserConfig::isPreInstalledApps(const QString &appid) const void UserConfig::removePreInstalledApp(const QString &appid) { - QMutexLocker mutexLocker(&m_mutex); - m_preInstalledApps.remove(appid); + { + QMutexLocker mutexLocker(&m_mutex); + m_preInstalledApps.remove(appid); + } + sync(); } void UserConfig::readConfigFile() From 1522068a2851070414425ac015ca89cd097053a9 Mon Sep 17 00:00:00 2001 From: youdiansaodongxi Date: Fri, 17 May 2024 14:20:51 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix(libappdata):=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=90=AF=E5=8A=A8=E6=97=B6=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E9=87=8D=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libappdata/app-database-interface.cpp | 8 ++++---- src/libappdata/basic-app-model.cpp | 11 +++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/libappdata/app-database-interface.cpp b/src/libappdata/app-database-interface.cpp index 11c0315..fda7331 100644 --- a/src/libappdata/app-database-interface.cpp +++ b/src/libappdata/app-database-interface.cpp @@ -56,7 +56,7 @@ private Q_SLOTS: private: static void addInfoToApp(const QMap &info, DataEntity &app); - bool isFiltered(const UkuiSearch::ApplicationPropertyMap &appInfo) const; + bool isFilterAccepted(const UkuiSearch::ApplicationPropertyMap &appInfo) const; private: AppDatabaseInterface *q {nullptr}; @@ -126,12 +126,12 @@ void AppDatabaseWorkerPrivate::addInfoToApp(const UkuiSearch::ApplicationPropert app.setLaunched(info.value(UkuiSearch::ApplicationProperty::Property::Launched).toInt()); } -bool AppDatabaseWorkerPrivate::isFiltered(const UkuiSearch::ApplicationPropertyMap &appInfo) const +bool AppDatabaseWorkerPrivate::isFilterAccepted(const UkuiSearch::ApplicationPropertyMap &appInfo) const { QMapIterator iterator(filter); while (iterator.hasNext()) { iterator.next(); - if (appInfo.value(iterator.key()) == iterator.value()) { + if (appInfo.value(iterator.key()) != iterator.value()) { return false; } @@ -170,7 +170,7 @@ void AppDatabaseWorkerPrivate::onAppDatabaseAdded(const QStringList &infos) DataEntityVector apps; for (const QString &appid : infos) { const UkuiSearch::ApplicationPropertyMap appInfo = appDatabase->getInfo(appid, properties); - if (isFiltered(appInfo)) { + if (!isFilterAccepted(appInfo)) { continue; } diff --git a/src/libappdata/basic-app-model.cpp b/src/libappdata/basic-app-model.cpp index 16da5ed..9f6b00e 100644 --- a/src/libappdata/basic-app-model.cpp +++ b/src/libappdata/basic-app-model.cpp @@ -120,8 +120,15 @@ const AppDatabaseInterface *BasicAppModel::databaseInterface() const void BasicAppModel::onAppAdded(const DataEntityVector &apps) { - beginInsertRows(QModelIndex(), m_apps.size(), m_apps.size() + apps.size() - 1); - m_apps.append(apps); + DataEntityVector appItems; + for (auto const & app : apps) { + if (indexOfApp(app.id()) < 0) { + appItems.append(app); + } + } + if (appItems.isEmpty()) return; + beginInsertRows(QModelIndex(), m_apps.size(), m_apps.size() + appItems.size() - 1); + m_apps.append(appItems); endInsertRows(); } From 1ad043aa6a370117328ef54c9c58a85fc01aba13 Mon Sep 17 00:00:00 2001 From: chairui Date: Tue, 21 May 2024 14:35:49 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix=20#I9Q6DB=20=E3=80=90=E9=9C=80=E6=B1=82?= =?UTF-8?q?29308=E3=80=91=E3=80=90AI=E5=8A=A9=E6=89=8B=E3=80=91=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E8=8F=9C=E5=8D=95=E5=8F=B3=E9=94=AE=E8=AF=A5=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=AD=98=E5=9C=A8=E2=80=9C=E5=8D=B8=E8=BD=BD=E2=80=9D?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ukui-menu-global-config.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/data/ukui-menu-global-config.conf b/data/ukui-menu-global-config.conf index 7b3eea3..b6dbf95 100644 --- a/data/ukui-menu-global-config.conf +++ b/data/ukui-menu-global-config.conf @@ -18,6 +18,7 @@ kylin-user-guide.desktop=0 ukui-control-center.desktop=0 peony.desktop=0 engrampa.desktop=0 +kylin-aiassistant=0 [Default Favorite Apps] 0=/usr/share/applications/peony.desktop From e3a0d8abc59d964ad862d47ff162a87da23dfcc4 Mon Sep 17 00:00:00 2001 From: youdiansaodongxi Date: Thu, 23 May 2024 19:13:02 +0800 Subject: [PATCH 4/6] =?UTF-8?q?fix(AppControls2):=20=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=A0=87=E8=AE=B0=E9=A2=9C=E8=89=B2=E8=B7=9F?= =?UTF-8?q?=E9=9A=8F=E4=B8=BB=E9=A2=98=E8=89=B2=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/AppControls2/AppItem.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qml/AppControls2/AppItem.qml b/qml/AppControls2/AppItem.qml index 2e14b09..15245fe 100644 --- a/qml/AppControls2/AppItem.qml +++ b/qml/AppControls2/AppItem.qml @@ -69,13 +69,14 @@ MouseArea { } } - Rectangle { + UkuiItems.StyleBackground { id: tagPoint visible: tagLabel.sourceComponent != null ? false : isRecentInstalled anchors.centerIn: parent width: 8; height: width radius: width / 2 - color: Platform.Theme.highlight() + useStyleTransparency: false + paletteRole: Platform.Theme.Highlight } } } From 62f2e6faae188287b97cbda265ae78b913037f96 Mon Sep 17 00:00:00 2001 From: hewenfei Date: Fri, 24 May 2024 16:10:07 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8WindowProxy2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows/menu-main-window.cpp | 5 +++-- src/windows/menu-main-window.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/windows/menu-main-window.cpp b/src/windows/menu-main-window.cpp index 3f2fdcb..68d6f55 100644 --- a/src/windows/menu-main-window.cpp +++ b/src/windows/menu-main-window.cpp @@ -239,7 +239,7 @@ void MenuWindow::init() //setWindowState(Qt::WindowMaximized); setFlags(flags() | Qt::Window | Qt::FramelessWindowHint); - m_windowProxy = new UkuiQuick::WindowProxy(this); + m_windowProxy = new UkuiQuick::WindowProxy2(this); m_windowProxy->setWindowType(UkuiQuick::WindowType::SystemWindow); // 访问窗口api @@ -297,7 +297,8 @@ void MenuWindow::updateGeometry() updateCurrentScreenGeometry(); setMinimumSize(m_fullScreenGeometry.size()); setMaximumSize(m_fullScreenGeometry.size()); - m_windowProxy->setGeometry(m_fullScreenGeometry); + setGeometry(m_fullScreenGeometry); + m_windowProxy->setPosition(m_fullScreenGeometry.topLeft()); updateGeometryOfMask(); WindowHelper::setRegion(this, m_maskGeometry.x(), m_maskGeometry.y(), m_maskGeometry.width(), m_maskGeometry.height(), 16); diff --git a/src/windows/menu-main-window.h b/src/windows/menu-main-window.h index 5722687..fb78152 100644 --- a/src/windows/menu-main-window.h +++ b/src/windows/menu-main-window.h @@ -136,7 +136,7 @@ private: QRect m_normalGeometry = QRect(0,0,0,0); QRect m_fullScreenGeometry = QRect(0,0,0,0); QGSettings *m_setting {nullptr}; - UkuiQuick::WindowProxy *m_windowProxy {nullptr}; + UkuiQuick::WindowProxy2 *m_windowProxy {nullptr}; }; } // UkuiMenu From 5670dcb39178988782938e4d1e543bd9c1b3319e Mon Sep 17 00:00:00 2001 From: youdiansaodongxi Date: Fri, 24 May 2024 16:43:51 +0800 Subject: [PATCH 6/6] =?UTF-8?q?fix(AppUi):=20=E7=BB=99=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95=E6=9C=80=E8=BF=91=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=BA=94=E7=94=A8=E6=B7=BB=E5=8A=A0=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/AppUI/FullScreenAppItem.qml | 34 ++++++++++++++++++++++++++------- qml/AppUI/FullScreenAppList.qml | 1 + 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/qml/AppUI/FullScreenAppItem.qml b/qml/AppUI/FullScreenAppItem.qml index 92403be..4aa1b71 100644 --- a/qml/AppUI/FullScreenAppItem.qml +++ b/qml/AppUI/FullScreenAppItem.qml @@ -29,6 +29,7 @@ MouseArea { property alias icon: appIcon property alias text: appName property alias background: styleBackground + property bool isRecentInstalled: false hoverEnabled: true @@ -53,15 +54,34 @@ MouseArea { Layout.alignment: Qt.AlignHCenter } - UkuiItems.StyleText { - id: appName + RowLayout { Layout.fillWidth: true - Layout.preferredHeight: contentHeight - Layout.maximumHeight: contentHeight + Layout.preferredHeight: appName.contentHeight + Layout.maximumHeight: appName.contentHeight + Layout.alignment: Qt.AlignHCenter - elide: Text.ElideRight - paletteRole: Platform.Theme.Text - horizontalAlignment: Text.AlignHCenter + UkuiItems.StyleBackground { + id: tagPoint + property int tagSize: isRecentInstalled ? 8 : 0 + Layout.alignment: Qt.AlignVCenter + visible: isRecentInstalled + Layout.preferredHeight: tagSize + Layout.preferredWidth: tagSize + radius: width / 2 + useStyleTransparency: false + paletteRole: Platform.Theme.Highlight + } + + UkuiItems.StyleText { + id: appName + Layout.maximumWidth: styleBackground.width - tagPoint.width + Layout.preferredHeight: contentHeight + Layout.maximumHeight: contentHeight + + elide: Text.ElideRight + paletteRole: Platform.Theme.Text + horizontalAlignment: Text.AlignHCenter + } } } } diff --git a/qml/AppUI/FullScreenAppList.qml b/qml/AppUI/FullScreenAppList.qml index 144763e..266f43f 100644 --- a/qml/AppUI/FullScreenAppList.qml +++ b/qml/AppUI/FullScreenAppList.qml @@ -90,6 +90,7 @@ ListView { text.text: model.name icon.source: model.icon + isRecentInstalled: model.recentInstall onClicked: (event) => { if (event.button === Qt.LeftButton) {