From bb1f13c41a332301581c7edbb51a106786fdd8d7 Mon Sep 17 00:00:00 2001 From: youdiansaodongxi Date: Mon, 29 May 2023 16:22:40 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=8C=89=E9=94=AE=E5=AF=BC=E8=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recent-file/qml/RecentFileExtension.qml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/extension/recent-file/qml/RecentFileExtension.qml b/extension/recent-file/qml/RecentFileExtension.qml index 023cbd3..32a0251 100644 --- a/extension/recent-file/qml/RecentFileExtension.qml +++ b/extension/recent-file/qml/RecentFileExtension.qml @@ -35,7 +35,6 @@ UkuiMenuExtension { anchors.fill: parent hoverEnabled: true onContainsMouseChanged: { - if (containsMouse) { scrollBar.visible = true } @@ -59,6 +58,11 @@ UkuiMenuExtension { anchors.fill: parent anchors.leftMargin: 12 spacing: 4 + focus: true + highlightMoveDuration: 0 + onActiveFocusChanged: currentIndex = 0 + onCountChanged: currentIndex = 0 + keyNavigationWraps: true ScrollBar.vertical: AppControls2.ScrollBar { id: scrollBar @@ -68,11 +72,21 @@ UkuiMenuExtension { } delegate: AppControls2.StyleBackground { + id: delegateItem width: ListView.view.width - 18 height: 40 useStyleTransparent: false alpha: itemArea.pressed ? 1 : itemArea.hovered ? 0.65 : 0 radius: 8 + focus: true + + states: State { + when: delegateItem.activeFocus + PropertyChanges { + target: delegateItem + alpha: 0.65 + } + } Row { anchors.fill: parent From b22b504ea6ae7f764a8f05c808ea8033d1cafb9b Mon Sep 17 00:00:00 2001 From: hewenfei Date: Wed, 31 May 2023 14:55:13 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E7=A6=81=E7=94=A8qml=5Fdebug,=E6=9B=B4?= =?UTF-8?q?=E6=96=B0CmakeList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 10 ++-------- src/main.cpp | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f99538c..bf713b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,14 +169,8 @@ add_executable( ${SOURCE_FILES} ) -if (CMAKE_BUILD_TYPE) - string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE) - if (${BUILD_TYPE} STREQUAL "debug") - target_compile_definitions(${PROJECT_NAME} PRIVATE UKUI_MENU_LOG_FILE_DISABLE) - endif () -endif () - -target_compile_definitions(${PROJECT_NAME} PRIVATE $<$,$>:QT_QML_DEBUG>) +target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:UKUI_MENU_LOG_FILE_DISABLE>) +target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:QT_QML_DEBUG>) target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core diff --git a/src/main.cpp b/src/main.cpp index 45e2a0f..5ef597c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -119,8 +119,8 @@ void messageOutput(QtMsgType type, const QMessageLogContext &context, const QStr int main(int argc, char *argv[]) { startupTime = QDateTime::currentDateTime().toMSecsSinceEpoch(); - initLogFile(); #ifndef UKUI_MENU_LOG_FILE_DISABLE + initLogFile(); qInstallMessageHandler(messageOutput); #endif From fb2f286d3920e3551068c8df013aabfb56318bd3 Mon Sep 17 00:00:00 2001 From: hewenfei Date: Wed, 31 May 2023 17:30:01 +0800 Subject: [PATCH 03/11] =?UTF-8?q?x=E5=92=8Cwayland=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=BD=BF=E7=94=A8sdk=E6=8E=A5=E5=8F=A3=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=B7=B3=E8=BF=87=E4=BB=BB=E5=8A=A1=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows/menu-main-window.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/windows/menu-main-window.cpp b/src/windows/menu-main-window.cpp index e1901ee..e440b03 100644 --- a/src/windows/menu-main-window.cpp +++ b/src/windows/menu-main-window.cpp @@ -102,12 +102,9 @@ void WindowHelper::setWindowAttribute(QWindow *window) // kwin KWindowSystem::setType(window->winId(), NET::Normal); - KWindowSystem::setState(window->winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); - if (!QX11Info::isPlatformX11()) { - // wayland环境 设置跳过多任务视图,设置跳过任务栏s - kdk::WindowManager::setSkipTaskBar(window, true); - kdk::WindowManager::setSkipSwitcher(window, true); - } + // 设置跳过多任务视图,设置跳过任务栏 + kdk::WindowManager::setSkipTaskBar(window, true); + kdk::WindowManager::setSkipSwitcher(window, true); } void WindowHelper::removeHeaderBar(QWindow *window) From 9290c712144ffc9cc37181f8957a1b0bfe62d900 Mon Sep 17 00:00:00 2001 From: hewenfei Date: Wed, 31 May 2023 15:47:11 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E6=8E=92=E9=99=A4dbus=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=80=9F=E5=BA=A6=E5=8F=98=E6=85=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recent-file/recent-file-extension.cpp | 213 ++++++++++-------- extension/recent-file/recent-file-extension.h | 58 +---- src/utils/app-manager.cpp | 22 +- src/utils/app-manager.h | 3 - 4 files changed, 128 insertions(+), 168 deletions(-) diff --git a/extension/recent-file/recent-file-extension.cpp b/extension/recent-file/recent-file-extension.cpp index 280a60d..7f6bd89 100644 --- a/extension/recent-file/recent-file-extension.cpp +++ b/extension/recent-file/recent-file-extension.cpp @@ -27,6 +27,10 @@ #include #include #include +#include +#include +#include +#include #include "recent-file-extension.h" @@ -39,6 +43,50 @@ namespace UkuiMenu { +class RecentFileProvider : public QObject +{ +Q_OBJECT +public: + explicit RecentFileProvider(QObject *parent = nullptr); + void dataProcess(QVector &recentFiles); + +public Q_SLOT: + void getRecentData(); + void openFileByGFile(const QString &fileUrl); + +Q_SIGNALS: + void dataLoadCompleted(QVector recentFiles); +}; + +class RecentFilesModel : public QAbstractListModel +{ +Q_OBJECT +public: + enum RoleMessage + { + UriRole = Qt::UserRole, + NameRole = Qt::UserRole + 1, + IconRole = Qt::UserRole + 2, + }; + + explicit RecentFilesModel(QObject *parent = nullptr); + int rowCount(const QModelIndex &parent) const override; + QVariant data(const QModelIndex &index, int role) const override; + QHash roleNames() const override; + QString getInfoId(const int &index); + QStringList getAllInfoId(); + Q_INVOKABLE void updateData(); + +public Q_SLOT: + void updateRecentFiles(QVector recentFiles); + +private: + QVector m_recentFileData; + +Q_SIGNALS: + void updateRecentData(); +}; + // GVFS 最近文件获取工具 class GVFSRecentFileData { @@ -68,9 +116,9 @@ void GVFSRecentFileData::fileMonitor(RecentFileProvider *p_recentFileProvider) { GError *error = nullptr; s_recentFileMonitor = g_file_monitor_directory(GVFSRecentFileData::s_recentFileRootDir, - G_FILE_MONITOR_NONE, - nullptr, - &error); + G_FILE_MONITOR_NONE, + nullptr, + &error); if (error) { qWarning() << "recentFile monitor creat error"; @@ -149,7 +197,8 @@ GVFSRecentFileData::enumerateFinish(GFile *file, GAsyncResult *res, RecentFilePr } GAsyncReadyCallback -GVFSRecentFileData::parseRecentFiles(GFileEnumerator *enumerator, GAsyncResult *res, RecentFileProvider *p_recentFileProvider) +GVFSRecentFileData::parseRecentFiles(GFileEnumerator *enumerator, GAsyncResult *res, + RecentFileProvider *p_recentFileProvider) { GError *error = nullptr; GList *fileList = g_file_enumerator_next_files_finish(enumerator, res, &error); @@ -189,11 +238,11 @@ GVFSRecentFileData::parseRecentFiles(GFileEnumerator *enumerator, GAsyncResult * GIcon *icon = g_file_info_get_icon(info); if (icon) { - const gchar* const *iconNames = g_themed_icon_get_names(G_THEMED_ICON(icon)); + const gchar *const *iconNames = g_themed_icon_get_names(G_THEMED_ICON(icon)); if (iconNames) { auto iconNameIterator = iconNames; - while(*iconNameIterator) { - if(QIcon::hasThemeIcon(*iconNameIterator)) { + while (*iconNameIterator) { + if (QIcon::hasThemeIcon(*iconNameIterator)) { recentFile.icon = "image://appicon/" + QString(*iconNameIterator); break; } else { @@ -229,15 +278,15 @@ RecentFileExtension::RecentFileExtension(QObject *parent) : MenuExtensionIFace(p QCoreApplication::installTranslator(translator); } - qRegisterMetaType("RecentFilesModel*"); + qRegisterMetaType("RecentFilesModel*"); qRegisterMetaType >("QVector"); m_recentFilesProviderThread = new QThread(this); m_recentFilesModel = new RecentFilesModel(this); m_recentFileProvider = new RecentFileProvider(); - if ((m_recentFilesProviderThread == nullptr) || (m_recentFilesModel == nullptr) || (m_recentFileProvider == nullptr)) { - qWarning() << "recentfile construction error" ; + if (!m_recentFilesProviderThread || !m_recentFilesModel || !m_recentFileProvider) { + qWarning() << "recentfile construction error"; return; } @@ -245,12 +294,13 @@ RecentFileExtension::RecentFileExtension(QObject *parent) : MenuExtensionIFace(p m_recentFileProvider->moveToThread(m_recentFilesProviderThread); connect(this, &RecentFileExtension::loadRecentFiles, m_recentFileProvider, &RecentFileProvider::getRecentData); - connect(m_recentFilesModel, &RecentFilesModel::updateRecentData, m_recentFileProvider, &RecentFileProvider::getRecentData); - connect(m_recentFileProvider, &RecentFileProvider::dataLoadCompleted, m_recentFilesModel, &RecentFilesModel::updateRecentFiles); + connect(m_recentFilesModel, &RecentFilesModel::updateRecentData, m_recentFileProvider, + &RecentFileProvider::getRecentData); + connect(m_recentFileProvider, &RecentFileProvider::dataLoadCompleted, m_recentFilesModel, + &RecentFilesModel::updateRecentFiles); connect(this, &RecentFileExtension::openFileASync, m_recentFileProvider, &RecentFileProvider::openFileByGFile); m_data.insert("recentFilesModel", QVariant::fromValue(m_recentFilesModel)); - initFileDbus(); GVFSRecentFileData::fileMonitor(m_recentFileProvider); Q_EMIT loadRecentFiles(); @@ -305,40 +355,24 @@ void RecentFileExtension::receive(QVariantMap data) creatMenu(path, index); return; } - if (!openFile(path)) { - Q_EMIT openFileASync(path); - } + + openFile(path); } -void RecentFileExtension::initFileDbus() +void RecentFileExtension::openFile(const QString &fileUrl) { - m_appManagerDbusInterface = new QDBusInterface(KYLIN_APP_MANAGER_NAME, - KYLIN_APP_MANAGER_PATH, - KYLIN_APP_MANAGER_INTERFACE, - QDBusConnection::sessionBus()); + QDBusMessage message = QDBusMessage::createMethodCall(KYLIN_APP_MANAGER_NAME, KYLIN_APP_MANAGER_PATH, KYLIN_APP_MANAGER_INTERFACE, "LaunchDefaultAppWithUrl"); + message << fileUrl; - m_fileManagerDbusInterface = new QDBusInterface(FREEDESKTOP_FILEMANAGER_NAME, - FREEDESKTOP_FILEMANAGER_PATH, - FREEDESKTOP_FILEMANAGER_INTERFACE, - QDBusConnection::sessionBus()); + auto watcher = new QDBusPendingCallWatcher(QDBusConnection::sessionBus().asyncCall(message), this); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [fileUrl, this] (QDBusPendingCallWatcher *self) { + QDBusPendingReply reply = *self; + if (reply.isError() || !reply.value()) { + Q_EMIT openFileASync(fileUrl); + } - if (!m_appManagerDbusInterface) { - qWarning() << "recentfile open failed: appmanager dbus does not exists."; - } - if (!m_fileManagerDbusInterface) { - qWarning() << "recentfile directory open failed: filemanager dbus does not exists."; - } -} - -bool RecentFileExtension::openFile(const QString &desktopFile) -{ - if (m_appManagerDbusInterface != nullptr) { - QDBusReply status = m_appManagerDbusInterface->call("LaunchApp", desktopFile); - return status; - } else { - qWarning()<<"LaunchApp is failed,return false"; - return false; - } + self->deleteLater(); + }); } void RecentFileExtension::creatMenu(const QString &path, const int &index) @@ -351,28 +385,27 @@ void RecentFileExtension::creatMenu(const QString &path, const int &index) QAction directory(tr("Open the directory where the file is located")); connect(&open, &QAction::triggered, this, [this, path]() { - if (!openFile(path)) { - Q_EMIT openFileASync(path); - } - }); + openFile(path); + }); connect(&remove, &QAction::triggered, this, [this, index]() { GVFSRecentFileData::removeRecentFileByInfoId(m_recentFilesModel->getInfoId(index)); - }); + }); connect(&clear, &QAction::triggered, this, [this]() { QStringList infoIdList = m_recentFilesModel->getAllInfoId(); for (const QString &infoId : infoIdList) { GVFSRecentFileData::removeRecentFileByInfoId(infoId); } - }); + }); connect(&directory, &QAction::triggered, this, [this, path]() { - if (!m_fileManagerDbusInterface) { return; } - QStringList pathList; - pathList.append(path); - m_fileManagerDbusInterface->call("ShowFolders", pathList, "arg"); - }); + QDBusMessage message = QDBusMessage::createMethodCall(FREEDESKTOP_FILEMANAGER_NAME, + FREEDESKTOP_FILEMANAGER_PATH, + FREEDESKTOP_FILEMANAGER_INTERFACE, "ShowFolders"); + message << QStringList(path); + QDBusConnection::sessionBus().asyncCall(message); + }); menu.addAction(&open); menu.addSeparator(); @@ -468,19 +501,16 @@ void RecentFileProvider::getRecentData() GVFSRecentFileData::loadRecentFileASync(this); } -void RecentFileProvider::openFileByGFile(const QString &path) +void RecentFileProvider::openFileByGFile(const QString &fileUrl) { - GFile *file = g_file_new_for_uri(path.toUtf8().constData()); + GFile *file = g_file_new_for_uri(fileUrl.toUtf8().constData()); if (!file) { return; } - GFileInfo *fileInfo = g_file_query_info(file, - "standard::*," "time::*," "access::*," "mountable::*," "metadata::*," "trash::*," G_FILE_ATTRIBUTE_ID_FILE, - G_FILE_QUERY_INFO_NONE, - nullptr, - nullptr); + GFileInfo *fileInfo = g_file_query_info(file, "standard::*," G_FILE_ATTRIBUTE_ID_FILE, G_FILE_QUERY_INFO_NONE, nullptr, nullptr); if (!fileInfo) { + g_object_unref(file); return; } @@ -492,62 +522,49 @@ void RecentFileProvider::openFileByGFile(const QString &path) } GError *error = NULL; - GAppInfo *info = NULL; + GAppInfo *info = NULL; QString mimeAppsListPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.config/mimeapps.list"; GKeyFile *keyfile = g_key_file_new(); gboolean ret = g_key_file_load_from_file(keyfile, mimeAppsListPath.toUtf8(), G_KEY_FILE_NONE, &error); if (!ret) { - qWarning()<< "load mimeapps list error msg" << error->message; + qWarning() << "load mimeapps list error msg" << error->message; info = g_app_info_get_default_for_type(mimeType.toUtf8().constData(), false); g_error_free(error); - } - else { + + } else { gchar *desktopApp = g_key_file_get_string(keyfile, "Default Applications", mimeType.toUtf8(), &error); - if (NULL != desktopApp) { - info = (GAppInfo*)g_desktop_app_info_new(desktopApp); - g_free (desktopApp); - } - else { + if (NULL == desktopApp) { info = g_app_info_get_default_for_type(mimeType.toUtf8().constData(), false); + + } else { + info = (GAppInfo *) g_desktop_app_info_new(desktopApp); + g_free(desktopApp); } } - g_key_file_free (keyfile); + g_key_file_free(keyfile); - if(G_IS_APP_INFO(info)) { - bool isSuccess(false); - QDBusInterface * appLaunchInterface = new QDBusInterface(KYLIN_APP_MANAGER_NAME, - KYLIN_APP_MANAGER_PATH, - KYLIN_APP_MANAGER_INTERFACE, - QDBusConnection::sessionBus()); - if(!appLaunchInterface->isValid()) { - qWarning() << qPrintable(QDBusConnection::sessionBus().lastError().message()); - isSuccess = false; - } - else { - appLaunchInterface->setTimeout(10000); - QDBusReply reply = appLaunchInterface->call("LaunchDefaultAppWithUrl", path); - if(reply.isValid()) { - isSuccess = reply; - } - else { - qWarning() << "recentfile used appmanager dbus called failed!"; - isSuccess = false; - } - } - if(appLaunchInterface) { - delete appLaunchInterface; - } - appLaunchInterface = NULL; - if (!isSuccess){ - QDesktopServices::openUrl(path); - } + bool success = false; + if (G_IS_APP_INFO(info)) { + GList *files = g_list_alloc(); + g_list_append(files, file); + + success = g_app_info_launch(info, files, nullptr, nullptr); + + g_list_free(files); } + if (!success) { + QDesktopServices::openUrl(fileUrl); + } + + g_object_unref(file); g_object_unref(info); } } // UkuiMenu + +#include "recent-file-extension.moc" diff --git a/extension/recent-file/recent-file-extension.h b/extension/recent-file/recent-file-extension.h index e3d4eba..633c4f8 100644 --- a/extension/recent-file/recent-file-extension.h +++ b/extension/recent-file/recent-file-extension.h @@ -19,14 +19,15 @@ #ifndef UKUI_MENU_RECENT_FILE_EXTENSION_H #define UKUI_MENU_RECENT_FILE_EXTENSION_H -#include -#include -#include +class QThread; #include "menu-extension-iface.h" namespace UkuiMenu { +class RecentFilesModel; +class RecentFileProvider; + class RecentFile { public: @@ -37,52 +38,6 @@ public: QString infoId; }; -class RecentFileProvider : public QObject -{ - Q_OBJECT -public: - explicit RecentFileProvider(QObject *parent = nullptr); - void dataProcess(QVector &recentFiles); - -public Q_SLOT: - void getRecentData(); - void openFileByGFile(const QString &path); - -Q_SIGNALS: - void dataLoadCompleted(QVector recentFiles); -}; - - -class RecentFilesModel : public QAbstractListModel -{ - Q_OBJECT -public: - enum RoleMessage { - UriRole = Qt::UserRole, - NameRole = Qt::UserRole + 1, - IconRole = Qt::UserRole + 2, - }; - - explicit RecentFilesModel(QObject *parent = nullptr); - int rowCount(const QModelIndex &parent) const override; - QVariant data(const QModelIndex &index, int role) const override; - QHash roleNames() const override; - - QString getInfoId(const int &index); - QStringList getAllInfoId(); - Q_INVOKABLE void updateData(); - -public Q_SLOT: - void updateRecentFiles(QVector recentFiles); - -private: - QVector m_recentFileData; - -Q_SIGNALS: - void updateRecentData(); -}; - - class RecentFileExtension : public MenuExtensionIFace { Q_OBJECT @@ -100,14 +55,11 @@ public: private: QVector m_recentFile; QVariantMap m_data; - QDBusInterface *m_appManagerDbusInterface = nullptr; RecentFilesModel *m_recentFilesModel = nullptr; QThread *m_recentFilesProviderThread = nullptr; RecentFileProvider *m_recentFileProvider = nullptr; - QDBusInterface *m_fileManagerDbusInterface = nullptr; - void initFileDbus(); - bool openFile(const QString& desktopFile); + void openFile(const QString& fileUrl); void creatMenu(const QString &path, const int &index); Q_SIGNALS: diff --git a/src/utils/app-manager.cpp b/src/utils/app-manager.cpp index abef7ff..5b51b6a 100644 --- a/src/utils/app-manager.cpp +++ b/src/utils/app-manager.cpp @@ -22,7 +22,8 @@ #include #include -#include +#include +#include #include #define KYLIN_APP_MANAGER_NAME "com.kylin.AppManager" @@ -38,13 +39,7 @@ AppManager *AppManager::instance() AppManager::AppManager(QObject *parent) : QObject(parent) { - m_appManagerDbusInterface = new QDBusInterface(KYLIN_APP_MANAGER_NAME, - KYLIN_APP_MANAGER_PATH, - KYLIN_APP_MANAGER_INTERFACE, - QDBusConnection::sessionBus()); - if (!m_appManagerDbusInterface) { - qWarning() << "appManager dbus does not exists."; - } + } bool AppManager::launchApp(const QString &desktopFilePath) @@ -62,7 +57,7 @@ bool AppManager::launchApp(const QString &desktopFilePath) return false; } - return QProcess::startDetached(cmd); + return QProcess::startDetached(cmd, QStringList()); } bool AppManager::launchBinaryApp(const QString &app, const QString &args) @@ -77,16 +72,15 @@ bool AppManager::launchBinaryApp(const QString &app, const QString &args) return true; } - return QProcess::startDetached(cmd); + return QProcess::startDetached(app, {args}); } bool AppManager::launchAppWithDBus(const QString &app) { - if (!m_appManagerDbusInterface) { - return false; - } + QDBusMessage message = QDBusMessage::createMethodCall(KYLIN_APP_MANAGER_NAME, KYLIN_APP_MANAGER_PATH, KYLIN_APP_MANAGER_INTERFACE, "LaunchApp"); + message << app; - QDBusReply status = m_appManagerDbusInterface->call("LaunchApp", app); + QDBusReply status(QDBusConnection::sessionBus().call(message)); return status.value(); } diff --git a/src/utils/app-manager.h b/src/utils/app-manager.h index 028ff55..7efb181 100644 --- a/src/utils/app-manager.h +++ b/src/utils/app-manager.h @@ -41,9 +41,6 @@ private: bool launchAppWithDBus(const QString &app); static QString parseDesktopFile(const QString &desktopFilePath); -private: - QDBusInterface *m_appManagerDbusInterface = nullptr; - Q_SIGNALS: void request(UkuiMenuApplication::Command command); }; From ce4f761a3c4f80d32d3856146fc8b75b91407665 Mon Sep 17 00:00:00 2001 From: qiqi Date: Fri, 2 Jun 2023 15:44:16 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=95=8C=E9=9D=A2ToolT?= =?UTF-8?q?ip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/AppControls2/LabelItem.qml | 2 +- qml/AppUI/AppList.qml | 1 + qml/AppUI/AppPageHeader.qml | 5 ++++- qml/AppUI/FullScreenContent.qml | 14 ++++++++++---- qml/AppUI/FullScreenHeader.qml | 2 ++ qml/AppUI/PluginSelectMenu.qml | 5 +++++ qml/AppUI/Sidebar.qml | 3 +++ qml/extensions/FavoriteExtension.qml | 2 ++ src/appdata/plugin/app-category-plugin.cpp | 1 + src/appdata/plugin/app-letter-sort-plugin.cpp | 2 +- 10 files changed, 30 insertions(+), 7 deletions(-) diff --git a/qml/AppControls2/LabelItem.qml b/qml/AppControls2/LabelItem.qml index 436bddb..0bd7d5c 100644 --- a/qml/AppControls2/LabelItem.qml +++ b/qml/AppControls2/LabelItem.qml @@ -5,7 +5,7 @@ import QtQuick.Controls 2.5 MouseArea { id: control hoverEnabled: true - ToolTip.text: qsTr("Open the label selection interface") + ToolTip.text: comment ToolTip.visible: control.containsMouse states: State { when: control.activeFocus diff --git a/qml/AppUI/AppList.qml b/qml/AppUI/AppList.qml index eac31e0..2007194 100644 --- a/qml/AppUI/AppList.qml +++ b/qml/AppUI/AppList.qml @@ -64,6 +64,7 @@ Item { property string id: model.id property string name: model.name property string icon: model.icon + property string comment: model.comment // label tooltip property int toTop: model.top property bool recentInstall: model.recentInstall sourceComponent: { diff --git a/qml/AppUI/AppPageHeader.qml b/qml/AppUI/AppPageHeader.qml index 16567f1..ad2dda4 100644 --- a/qml/AppUI/AppPageHeader.qml +++ b/qml/AppUI/AppPageHeader.qml @@ -196,8 +196,11 @@ Item { model: appPageHeaderUtils.model(PluginGroup.Button) delegate: AppControls2.RoundButton { - width: height; height: ListView.view ? ListView.view.height : 0 + width: height + height: ListView.view ? ListView.view.height : 0 buttonIcon: model.icon + ToolTip.text: qsTr("Search App") + ToolTip.visible: containsMouse onClicked: { root.state = "search"; // 后续添加需求,可以用model数据设置 diff --git a/qml/AppUI/FullScreenContent.qml b/qml/AppUI/FullScreenContent.qml index 1942c33..980a4c4 100644 --- a/qml/AppUI/FullScreenContent.qml +++ b/qml/AppUI/FullScreenContent.qml @@ -224,7 +224,8 @@ RowLayout { hoverEnabled: true width: 170; height: width acceptedButtons: Qt.LeftButton | Qt.RightButton - + ToolTip.text: name + ToolTip.visible: iconText.truncated && containsMouse AppControls2.StyleBackground { anchors.fill: parent useStyleTransparent: false @@ -323,7 +324,8 @@ RowLayout { hoverEnabled: true width: 170; height: width acceptedButtons: Qt.LeftButton | Qt.RightButton - + ToolTip.text: name + ToolTip.visible: folderText.truncated && containsMouse AppControls2.StyleBackground { anchors.fill: parent useStyleTransparent: false @@ -350,8 +352,8 @@ RowLayout { AppControls2.FolderIcon { id: folderIcon - width: 96 - height: 96 + width: 86 + height: 86 rows: 4; columns: 4 spacing: 2; padding: 8 icons: icon @@ -361,6 +363,7 @@ RowLayout { } AppControls2.StyleText { + id: folderText anchors.bottom: parent.bottom anchors.bottomMargin: 20 width: parent.width @@ -465,6 +468,7 @@ RowLayout { height: GridView.view.cellHeight MouseArea { + id: labelAppsMouseArea anchors.centerIn: parent hoverEnabled: true width: 170; height: width @@ -483,6 +487,8 @@ RowLayout { appIcon: modelData.icon spacing: 8 textHighLight: true + ToolTip.text: modelData.name + ToolTip.visible: textTruncated && labelAppsMouseArea.containsMouse } } diff --git a/qml/AppUI/FullScreenHeader.qml b/qml/AppUI/FullScreenHeader.qml index ed2b769..9cd82e2 100644 --- a/qml/AppUI/FullScreenHeader.qml +++ b/qml/AppUI/FullScreenHeader.qml @@ -59,6 +59,8 @@ Item { id: buttonMouseArea hoverEnabled: true anchors.fill: parent + ToolTip.text: qsTr("Contract") + ToolTip.visible: containsMouse onClicked: mainWindow.exitFullScreen() activeFocusOnTab: true Keys.onPressed: { diff --git a/qml/AppUI/PluginSelectMenu.qml b/qml/AppUI/PluginSelectMenu.qml index 01cdfec..cd3628d 100644 --- a/qml/AppUI/PluginSelectMenu.qml +++ b/qml/AppUI/PluginSelectMenu.qml @@ -40,6 +40,8 @@ RowLayout { Layout.fillWidth: true Layout.maximumWidth: height activeFocusOnTab: true + ToolTip.text: qsTr("Switch Sort Type") + ToolTip.visible: containsMouse highlight: mainWindow.isFullScreen autoHighLight: !mainWindow.isFullScreen @@ -62,6 +64,9 @@ RowLayout { Layout.fillHeight: true Layout.maximumWidth: 16 Layout.maximumHeight: 16 + ToolTip.text: qsTr("Sort Type Options") + ToolTip.visible: containsMouse + hoverEnabled: true activeFocusOnTab: true Keys.onPressed: { diff --git a/qml/AppUI/Sidebar.qml b/qml/AppUI/Sidebar.qml index b017a68..54ea1f0 100644 --- a/qml/AppUI/Sidebar.qml +++ b/qml/AppUI/Sidebar.qml @@ -76,6 +76,9 @@ Item { id: buttonMouseArea hoverEnabled: true anchors.fill: parent + ToolTip.text: qsTr("Expand") + ToolTip.visible: containsMouse + onClicked: mainWindow.isFullScreen = true activeFocusOnTab: true Keys.onPressed: { diff --git a/qml/extensions/FavoriteExtension.qml b/qml/extensions/FavoriteExtension.qml index d1a0669..59dc316 100644 --- a/qml/extensions/FavoriteExtension.qml +++ b/qml/extensions/FavoriteExtension.qml @@ -141,6 +141,8 @@ UkuiMenuExtension { appIcon: model.icon display: Display.TextUnderIcon scale: (control.containsPress && !icon.hold) ? 1.1 : 1.0 + ToolTip.visible: textTruncated && control.containsMouse + ToolTip.text: model.name Behavior on scale { NumberAnimation { duration: 300; easing.type: Easing.InOutCubic } diff --git a/src/appdata/plugin/app-category-plugin.cpp b/src/appdata/plugin/app-category-plugin.cpp index 62c4183..24adee3 100644 --- a/src/appdata/plugin/app-category-plugin.cpp +++ b/src/appdata/plugin/app-category-plugin.cpp @@ -201,6 +201,7 @@ void AppCategoryPlugin::generateData(QVector &data) } DataEntity label; + label.setComment(tr("Open Function Sort Menu")); label.setType(DataType::Label); label.setId(item.label.id()); label.setName(item.label.displayName()); diff --git a/src/appdata/plugin/app-letter-sort-plugin.cpp b/src/appdata/plugin/app-letter-sort-plugin.cpp index 167b751..c158a25 100644 --- a/src/appdata/plugin/app-letter-sort-plugin.cpp +++ b/src/appdata/plugin/app-letter-sort-plugin.cpp @@ -162,7 +162,7 @@ void AppLetterSortPlugin::addAppToLabel(const QString &labelName, QVector Date: Fri, 2 Jun 2023 17:40:52 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0tooltip=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translations/ukui-menu_zh_CN.ts | 44 +++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/translations/ukui-menu_zh_CN.ts b/translations/ukui-menu_zh_CN.ts index e13df9c..30e548a 100644 --- a/translations/ukui-menu_zh_CN.ts +++ b/translations/ukui-menu_zh_CN.ts @@ -1,11 +1,36 @@ + + AppPageHeader + + Search App + 搜索应用 + + + + FullScreenHeader + + Contract + 收缩 + + LabelItem Open the label selection interface - 打开标签选择界面 + 打开标签选择界面 + + + + PluginSelectMenu + + Switch Sort Type + 切换排序类型 + + + Sort Type Options + 排序类型选项 @@ -90,6 +115,13 @@ 搜索应用 + + Sidebar + + Expand + 展开 + + UkuiMenu::AllAppDataProvider @@ -165,6 +197,10 @@ Other 其他 + + Open Function Sort Menu + 打开功能排序菜单 + UkuiMenu::AppFolderHelper @@ -181,7 +217,11 @@ Letter sort button - 字母排序按钮 + 字母排序按钮 + + + Open Letter Sort Menu + 打开字母排序菜单 From aa52550d2952840580fd0cf5e1b6b32982dfcf96 Mon Sep 17 00:00:00 2001 From: youdiansaodongxi Date: Mon, 5 Jun 2023 10:23:13 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=BA=94=E7=94=A8=E8=93=9D=E7=82=B9=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E5=88=B7=E6=96=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/appdata/data-provider-manager.cpp | 4 ++++ src/appdata/data-provider-manager.h | 1 + src/appdata/data-provider-plugin-iface.h | 3 +++ src/appdata/plugin/all-app-data-provider.cpp | 18 ++++++++++++++++++ src/appdata/plugin/all-app-data-provider.h | 3 +++ src/ukui-menu-application.cpp | 5 +++++ 6 files changed, 34 insertions(+) diff --git a/src/appdata/data-provider-manager.cpp b/src/appdata/data-provider-manager.cpp index 3a9ea2b..3e8bff4 100644 --- a/src/appdata/data-provider-manager.cpp +++ b/src/appdata/data-provider-manager.cpp @@ -44,15 +44,19 @@ DataProviderManager::DataProviderManager() void DataProviderManager::initProviders() { auto *allProvider = new AllAppDataProvider; + connect(this, &DataProviderManager::toUpdate, allProvider, &AllAppDataProvider::update); registerProvider(allProvider); auto *search = new AppSearchPlugin; + connect(this, &DataProviderManager::toUpdate, search, &AppSearchPlugin::update); registerProvider(search); auto *category = new AppCategoryPlugin; + connect(this, &DataProviderManager::toUpdate, category, &AppCategoryPlugin::update); registerProvider(category); auto *sort = new AppLetterSortPlugin; + connect(this, &DataProviderManager::toUpdate, sort, &AppLetterSortPlugin::update); registerProvider(sort); activateProvider(allProvider->id()); diff --git a/src/appdata/data-provider-manager.h b/src/appdata/data-provider-manager.h index 10afb18..2a22665 100644 --- a/src/appdata/data-provider-manager.h +++ b/src/appdata/data-provider-manager.h @@ -59,6 +59,7 @@ Q_SIGNALS: void pluginChanged(const QString &id, PluginGroup::Group group); void dataChanged(QVector data, DataUpdateMode::Mode mode, quint32 index); void labelChanged(); + void toUpdate(); private: DataProviderManager(); diff --git a/src/appdata/data-provider-plugin-iface.h b/src/appdata/data-provider-plugin-iface.h index f075b9a..3b28c1e 100644 --- a/src/appdata/data-provider-plugin-iface.h +++ b/src/appdata/data-provider-plugin-iface.h @@ -79,6 +79,9 @@ public: virtual void forceUpdate() = 0; virtual void forceUpdate(QString &key) {}; +public Q_SLOTS: + virtual void update() {}; + Q_SIGNALS: /** * 数据变化 diff --git a/src/appdata/plugin/all-app-data-provider.cpp b/src/appdata/plugin/all-app-data-provider.cpp index 1dab92e..a9e2ead 100644 --- a/src/appdata/plugin/all-app-data-provider.cpp +++ b/src/appdata/plugin/all-app-data-provider.cpp @@ -83,6 +83,24 @@ void AllAppDataProvider::forceUpdate() sendData(); } +void AllAppDataProvider::update() +{ + bool isRecentDataChanged = false; + { + QMutexLocker locker(&m_mutex); + for (DataEntity & appdata : m_appData) { + bool info = appdata.isRecentInstall(); + setRecentState(appdata); + if (appdata.isRecentInstall() != info) { + isRecentDataChanged = true; + } + } + } + if (isRecentDataChanged) { + sendData(); + } +} + void AllAppDataProvider::reloadAppData() { QMutexLocker locker(&m_mutex); diff --git a/src/appdata/plugin/all-app-data-provider.h b/src/appdata/plugin/all-app-data-provider.h index 083d174..f6b3ccd 100644 --- a/src/appdata/plugin/all-app-data-provider.h +++ b/src/appdata/plugin/all-app-data-provider.h @@ -39,6 +39,9 @@ public: QVector data() override; void forceUpdate() override; +public Q_SLOTS: + void update() override; + private Q_SLOTS: void onAppAdded(const QList& apps); void onAppDeleted(QStringList idList); diff --git a/src/ukui-menu-application.cpp b/src/ukui-menu-application.cpp index 1284136..1195efc 100644 --- a/src/ukui-menu-application.cpp +++ b/src/ukui-menu-application.cpp @@ -30,6 +30,7 @@ #include "items/theme-icon.h" #include "app-manager.h" #include "menu-manager.h" +#include "data-provider-manager.h" #include #include @@ -135,12 +136,16 @@ void UkuiMenuApplication::execCommand(Command command) case Active: { if (m_mainWindow) { m_mainWindow->setVisible(!m_mainWindow->isVisible()); + if (m_mainWindow->isVisible()) { + DataProviderManager::instance()->toUpdate(); + } } break; } case Show: { if (m_mainWindow) { m_mainWindow->setVisible(true); + DataProviderManager::instance()->toUpdate(); } break; } From 28b782624a992dd0e9839dcfd613e1a7a28eddb8 Mon Sep 17 00:00:00 2001 From: hewenfei Date: Mon, 5 Jun 2023 16:33:16 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translations/ukui-menu_zh_CN.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translations/ukui-menu_zh_CN.ts b/translations/ukui-menu_zh_CN.ts index 30e548a..871def1 100644 --- a/translations/ukui-menu_zh_CN.ts +++ b/translations/ukui-menu_zh_CN.ts @@ -250,11 +250,11 @@ Hibernate - 睡眠 + 休眠 Suspend - 休眠 + 睡眠 Lock Screen From 373cd3ce44f3bcf0bfed2aa1e992730aebddc5d1 Mon Sep 17 00:00:00 2001 From: hewenfei Date: Tue, 6 Jun 2023 10:26:22 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=94=B6=E8=97=8F=E5=BA=94=E7=94=A8=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/settings/settings.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/settings/settings.cpp b/src/settings/settings.cpp index 9d08987..e463651 100644 --- a/src/settings/settings.cpp +++ b/src/settings/settings.cpp @@ -157,8 +157,13 @@ void GlobalSetting::initGlobalSettings() //= settings.beginGroup("Default Favorite Apps"); + QMap apps; for (const auto &key : settings.allKeys()) { - m_defaultFavoriteApps.append(settings.value(key).toString()); + apps.insert(key.toInt(), settings.value(key).toString()); + } + + for (const auto &app : apps) { + m_defaultFavoriteApps.append(app); } settings.endGroup(); } From e05af2b1f316201885c5c46ca11dcea9ebe7739f Mon Sep 17 00:00:00 2001 From: qiqi Date: Tue, 6 Jun 2023 09:22:29 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E5=8C=BA=E5=9F=9Ftooltip=E6=98=BE=E7=A4=BA=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=92=8C=E7=9C=81=E7=95=A5=E6=97=B6=E7=9A=84=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recent-file/qml/RecentFileExtension.qml | 30 +++++++++++++++++++ .../recent-file/recent-file-extension.cpp | 6 ++++ qml/AppControls2/AppItem.qml | 1 + qml/AppControls2/FolderItem.qml | 1 + qml/AppControls2/LabelItem.qml | 1 + qml/AppUI/AppPageHeader.qml | 1 + qml/AppUI/FullScreenContent.qml | 3 ++ qml/AppUI/FullScreenFooter.qml | 1 + qml/AppUI/FullScreenHeader.qml | 1 + qml/AppUI/PluginSelectMenu.qml | 2 ++ qml/AppUI/SearchInputBar.qml | 2 +- qml/AppUI/Sidebar.qml | 2 ++ qml/extensions/FavoriteExtension.qml | 1 + 13 files changed, 51 insertions(+), 1 deletion(-) diff --git a/extension/recent-file/qml/RecentFileExtension.qml b/extension/recent-file/qml/RecentFileExtension.qml index 32a0251..786aa89 100644 --- a/extension/recent-file/qml/RecentFileExtension.qml +++ b/extension/recent-file/qml/RecentFileExtension.qml @@ -101,6 +101,7 @@ UkuiMenuExtension { } AppControls2.StyleText { + id: fileText width: parent.width - x height: 20 anchors.verticalCenter: parent.verticalCenter @@ -109,6 +110,35 @@ UkuiMenuExtension { elide: Text.ElideRight } } + ToolTip { + visible: itemArea.containsMouse + delay: 500 + contentItem: Column { + width: childrenRect.width + height: childrenRect.height + Text { + verticalAlignment: Text.AlignVCenter + visible: fileText.truncated + wrapMode: Text.WrapAnywhere + text: model.name + Component.onCompleted: { + if (contentWidth > recentFileView.width) { + width = recentFileView.width; + } + } + } + Text { + verticalAlignment: Text.AlignVCenter + wrapMode: Text.WordWrap + text: qsTr("Path: ") + model.path + Component.onCompleted: { + if (contentWidth > recentFileView.width) { + width = recentFileView.width; + } + } + } + } + } MouseArea { id: itemArea diff --git a/extension/recent-file/recent-file-extension.cpp b/extension/recent-file/recent-file-extension.cpp index 7f6bd89..f319da7 100644 --- a/extension/recent-file/recent-file-extension.cpp +++ b/extension/recent-file/recent-file-extension.cpp @@ -67,6 +67,7 @@ public: UriRole = Qt::UserRole, NameRole = Qt::UserRole + 1, IconRole = Qt::UserRole + 2, + PathRole = Qt::UserRole + 3 }; explicit RecentFilesModel(QObject *parent = nullptr); @@ -440,6 +441,10 @@ QVariant RecentFilesModel::data(const QModelIndex &index, int role) const return m_recentFileData.at(row).name; case IconRole: return m_recentFileData.at(row).icon; + case PathRole: { + QUrl baseUrl(m_recentFileData.at(row).uri); + return baseUrl.adjusted(QUrl::RemoveFilename).path(); + } default: break; } @@ -453,6 +458,7 @@ QHash RecentFilesModel::roleNames() const names.insert(UriRole, "uri"); names.insert(NameRole, "name"); names.insert(IconRole, "icon"); + names.insert(PathRole, "path"); return names; } diff --git a/qml/AppControls2/AppItem.qml b/qml/AppControls2/AppItem.qml index 7eadc34..2d7207c 100644 --- a/qml/AppControls2/AppItem.qml +++ b/qml/AppControls2/AppItem.qml @@ -22,6 +22,7 @@ MouseArea { alpha: isSelect ? 1.00 : control.containsPress ? 0.82 : control.containsMouse ? 0.55 : 0.00 ToolTip.visible: content.textTruncated && control.containsMouse ToolTip.text: name + ToolTip.delay: 500 RowLayout { anchors.fill: parent diff --git a/qml/AppControls2/FolderItem.qml b/qml/AppControls2/FolderItem.qml index 01523a5..45b2d34 100644 --- a/qml/AppControls2/FolderItem.qml +++ b/qml/AppControls2/FolderItem.qml @@ -12,6 +12,7 @@ MouseArea { hoverEnabled: true ToolTip.visible: !editStatus && truncate && control.containsMouse ToolTip.text: name + ToolTip.delay: 500 states: State { when: control.activeFocus PropertyChanges { diff --git a/qml/AppControls2/LabelItem.qml b/qml/AppControls2/LabelItem.qml index 0bd7d5c..227f4d6 100644 --- a/qml/AppControls2/LabelItem.qml +++ b/qml/AppControls2/LabelItem.qml @@ -7,6 +7,7 @@ MouseArea { hoverEnabled: true ToolTip.text: comment ToolTip.visible: control.containsMouse + ToolTip.delay: 500 states: State { when: control.activeFocus PropertyChanges { diff --git a/qml/AppUI/AppPageHeader.qml b/qml/AppUI/AppPageHeader.qml index ad2dda4..f47bc41 100644 --- a/qml/AppUI/AppPageHeader.qml +++ b/qml/AppUI/AppPageHeader.qml @@ -200,6 +200,7 @@ Item { height: ListView.view ? ListView.view.height : 0 buttonIcon: model.icon ToolTip.text: qsTr("Search App") + ToolTip.delay: 500 ToolTip.visible: containsMouse onClicked: { root.state = "search"; diff --git a/qml/AppUI/FullScreenContent.qml b/qml/AppUI/FullScreenContent.qml index 980a4c4..3edaa72 100644 --- a/qml/AppUI/FullScreenContent.qml +++ b/qml/AppUI/FullScreenContent.qml @@ -224,6 +224,7 @@ RowLayout { hoverEnabled: true width: 170; height: width acceptedButtons: Qt.LeftButton | Qt.RightButton + ToolTip.delay: 500 ToolTip.text: name ToolTip.visible: iconText.truncated && containsMouse AppControls2.StyleBackground { @@ -324,6 +325,7 @@ RowLayout { hoverEnabled: true width: 170; height: width acceptedButtons: Qt.LeftButton | Qt.RightButton + ToolTip.delay: 500 ToolTip.text: name ToolTip.visible: folderText.truncated && containsMouse AppControls2.StyleBackground { @@ -487,6 +489,7 @@ RowLayout { appIcon: modelData.icon spacing: 8 textHighLight: true + ToolTip.delay: 500 ToolTip.text: modelData.name ToolTip.visible: textTruncated && labelAppsMouseArea.containsMouse } diff --git a/qml/AppUI/FullScreenFooter.qml b/qml/AppUI/FullScreenFooter.qml index 0e91eee..6cc039c 100644 --- a/qml/AppUI/FullScreenFooter.qml +++ b/qml/AppUI/FullScreenFooter.qml @@ -53,6 +53,7 @@ Row { id: powerButtonArea anchors.fill: parent hoverEnabled: true + ToolTip.delay: 500 ToolTip.visible: containsMouse ToolTip.text: powerButtonBase.toolTip acceptedButtons: Qt.LeftButton | Qt.RightButton diff --git a/qml/AppUI/FullScreenHeader.qml b/qml/AppUI/FullScreenHeader.qml index 9cd82e2..242cf82 100644 --- a/qml/AppUI/FullScreenHeader.qml +++ b/qml/AppUI/FullScreenHeader.qml @@ -59,6 +59,7 @@ Item { id: buttonMouseArea hoverEnabled: true anchors.fill: parent + ToolTip.delay: 500 ToolTip.text: qsTr("Contract") ToolTip.visible: containsMouse onClicked: mainWindow.exitFullScreen() diff --git a/qml/AppUI/PluginSelectMenu.qml b/qml/AppUI/PluginSelectMenu.qml index cd3628d..37abe1e 100644 --- a/qml/AppUI/PluginSelectMenu.qml +++ b/qml/AppUI/PluginSelectMenu.qml @@ -40,6 +40,7 @@ RowLayout { Layout.fillWidth: true Layout.maximumWidth: height activeFocusOnTab: true + ToolTip.delay: 500 ToolTip.text: qsTr("Switch Sort Type") ToolTip.visible: containsMouse @@ -64,6 +65,7 @@ RowLayout { Layout.fillHeight: true Layout.maximumWidth: 16 Layout.maximumHeight: 16 + ToolTip.delay: 500 ToolTip.text: qsTr("Sort Type Options") ToolTip.visible: containsMouse hoverEnabled: true diff --git a/qml/AppUI/SearchInputBar.qml b/qml/AppUI/SearchInputBar.qml index 9415cef..28ccb1e 100644 --- a/qml/AppUI/SearchInputBar.qml +++ b/qml/AppUI/SearchInputBar.qml @@ -106,8 +106,8 @@ AppControls2.StyleBackground { appPage.content.resetFocus(); } } - onEditingFinished: changeFocusToListView() Keys.onDownPressed: changeFocusToListView() + Keys.onReturnPressed: changeFocusToListView() //字体选中跟随主题高亮 property int textColor: mainWindow.isFullScreen ? Palette.HighlightedText : Palette.Text diff --git a/qml/AppUI/Sidebar.qml b/qml/AppUI/Sidebar.qml index 54ea1f0..cd9212e 100644 --- a/qml/AppUI/Sidebar.qml +++ b/qml/AppUI/Sidebar.qml @@ -76,6 +76,7 @@ Item { id: buttonMouseArea hoverEnabled: true anchors.fill: parent + ToolTip.delay: 500 ToolTip.text: qsTr("Expand") ToolTip.visible: containsMouse @@ -138,6 +139,7 @@ Item { id: powerButtonArea anchors.fill: parent hoverEnabled: true + ToolTip.delay: 500 ToolTip.visible: containsMouse ToolTip.text: powerButtonBase.toolTip acceptedButtons: Qt.LeftButton | Qt.RightButton diff --git a/qml/extensions/FavoriteExtension.qml b/qml/extensions/FavoriteExtension.qml index 59dc316..0b56e5d 100644 --- a/qml/extensions/FavoriteExtension.qml +++ b/qml/extensions/FavoriteExtension.qml @@ -143,6 +143,7 @@ UkuiMenuExtension { scale: (control.containsPress && !icon.hold) ? 1.1 : 1.0 ToolTip.visible: textTruncated && control.containsMouse ToolTip.text: model.name + ToolTip.delay: 500 Behavior on scale { NumberAnimation { duration: 300; easing.type: Easing.InOutCubic } From 42958efa36c0c49bdfa7c8a9e43212b513d23628 Mon Sep 17 00:00:00 2001 From: qiqi Date: Tue, 6 Jun 2023 09:37:53 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../translations/recent-file-extension_zh_CN.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/extension/recent-file/translations/recent-file-extension_zh_CN.ts b/extension/recent-file/translations/recent-file-extension_zh_CN.ts index c075f44..15c8ea2 100644 --- a/extension/recent-file/translations/recent-file-extension_zh_CN.ts +++ b/extension/recent-file/translations/recent-file-extension_zh_CN.ts @@ -1,6 +1,13 @@ + + RecentFileExtension + + Path: + 路径: + + UkuiMenu::RecentFileExtension @@ -9,19 +16,19 @@ Open - + 打开 Remove from list - + 从列表删除 Clear list - + 清空全部 Open the directory where the file is located - + 打开文件所在目录