From 7aa4d55cfa6574654e01e1f820492971bf8a6f0f Mon Sep 17 00:00:00 2001 From: Xie Wei Date: Fri, 6 May 2022 17:54:45 +0800 Subject: [PATCH 01/30] Import Debian changes 3.1.1-0k0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ukui-menu (3.1.1-0k0) yangtze; urgency=medium * 版本号规范化 ukui-menu (3.1.1-0420) jammy; urgency=medium * bug号:无 * 任务号:无 * 其他改动说明:修改ukui-default主题为浅色主题,修改全屏缩小按钮反色 * 其他改动说明影响域:影响开始菜单默认主题色 ukui-menu (3.1.1-0419) jammy; urgency=medium * bug号:115348,112503开始菜单浅色主题适配 ukui-menu (3.0.1-1) unstable; urgency=medium * New upstream bugfix release. ukui-menu (3.0.0-1) unstable; urgency=medium * New upstream release. ukui-menu (2.0.8-1) unstable; urgency=medium * New upstream release. ukui-menu (2.0.7-1) unstable; urgency=medium * New upstream release. ukui-menu (2.0.6-1) unstable; urgency=medium * New upstream bugfix release. - Fix that the 'recent' page is empty. (LP: #1870954) - Fix the focus issue. - Fix the issues when change primary screen. * debian/control: - Add bamfdaemon to depends and libbamf3-dev to build-depends. ukui-menu (2.0.5-1) unstable; urgency=medium * New upstream bugfix release. - Fix startup failure when panel profile does not exist. - Fix the icon dragging problem. - Fix that right-click menu popup abnormally. - Fix the wrong position when switch from fullscreen to normal mode. * debian/watch: - Update to monitor upstream org.tar.gz file. ukui-menu (2.0.4-1) unstable; urgency=medium * New upstream bugfix release. - Fix the icon problem with newly installed software. - Fix the crash during software installation and uninstallation. - Not hardcode the font name. ukui-menu (2.0.3-1) unstable; urgency=medium * New upstream bugfix release. - Get the panel position to avoid popup at wrong place. - Fix the stuck when scroll the area. - Fix the focus issue. - Fix the display problem of 'recent app" bar. - Adjust the style of right-click menu. ukui-menu (2.0.1-1) unstable; urgency=medium * New upstream release. - Migrate from python to qt. * debian/control: - Bump Standards-Versions to 4.5.0. * debian/{control,compat}: - Use debhelper-compat notation. ukui-menu (1.1.12-1) unstable; urgency=medium * Remove the duplicated timed-shutdown.py file. ukui-menu (1.1.11-1) unstable; urgency=medium * Upload to unstable. * Add network detection for feedback. * Update some labels. * Update tr.po. * debian/control: - Bump standards-version to 4.4.0. ukui-menu (1.1.10-1) experimental; urgency=medium * Update the default icon of user face. * Fix the error when show popup menu. * Change the timing of update recent files. ukui-menu (1.1.9-1) unstable; urgency=medium * Add transparency effect. * Add a shutdown timer. * Deal with the situation when get_desktop_file_path is None. * Update the code of keybinding. * Update the icon of start menu. * Bump standards-version to 4.3.0. ukui-menu (1.1.7-2) unstable; urgency=medium * Debian/control: - Remove gvfs-open. (Closes: 906326) ukui-menu (1.1.7-1) unstable; urgency=medium * Skip 'Education' for 'Normal Menu'. * Add fr.po, pt.po, ru.po, es.po. * Update start.svg. * Deal with filename which contain '&'. ukui-menu (1.1.5-1) UNRELEASED; urgency=medium * Use mate-terminal instead of gnome-terminal. * Port to python3. * Update for ukui-panel. * Add support for resize the menu icon. * Add right-click menu for recent files. * Add feedback window. ukui-menu (1.0.2-2) unstable; urgency=medium * Use tracker.d.o team address (Closes: #899863) ukui-menu (1.0.2-1) unstable; urgency=medium * Initial release (Closes: #872967) --- debian/changelog | 173 +++++++++++++++++++++++++++++++++++++++++++ debian/control | 43 +++++++++++ debian/copyright | 29 ++++++++ debian/rules | 7 ++ debian/source/format | 1 + debian/watch | 2 + 6 files changed, 255 insertions(+) create mode 100755 debian/changelog create mode 100755 debian/control create mode 100755 debian/copyright create mode 100755 debian/rules create mode 100755 debian/source/format create mode 100755 debian/watch diff --git a/debian/changelog b/debian/changelog new file mode 100755 index 0000000..4d7ef5c --- /dev/null +++ b/debian/changelog @@ -0,0 +1,173 @@ +ukui-menu (3.1.1-0k0) yangtze; urgency=medium + + * 版本号规范化 + + -- Xie Wei Fri, 06 May 2022 17:54:45 +0800 + +ukui-menu (3.1.1-0420) jammy; urgency=medium + + * bug号:无 + * 任务号:无 + * 其他改动说明:修改ukui-default主题为浅色主题,修改全屏缩小按钮反色 + * 其他改动说明影响域:影响开始菜单默认主题色 + + -- lixueman Wed, 20 Apr 2022 17:03:09 +0800 + +ukui-menu (3.1.1-0419) jammy; urgency=medium + + * bug号:115348,112503开始菜单浅色主题适配 + + -- lixueman Tue, 19 Apr 2022 15:00:27 +0800 + +ukui-menu (3.0.1-1) unstable; urgency=medium + + * New upstream bugfix release. + + -- handsome_feng Thu, 24 Sep 2020 14:48:18 +0800 + +ukui-menu (3.0.0-1) unstable; urgency=medium + + * New upstream release. + + -- handsome_feng Wed, 26 Aug 2020 20:18:25 +0800 + +ukui-menu (2.0.8-1) unstable; urgency=medium + + * New upstream release. + + -- handsome_feng Wed, 15 Jul 2020 20:16:14 +0800 + +ukui-menu (2.0.7-1) unstable; urgency=medium + + * New upstream release. + + -- handsome_feng Mon, 06 Jul 2020 14:57:00 +0800 + +ukui-menu (2.0.6-1) unstable; urgency=medium + + * New upstream bugfix release. + - Fix that the 'recent' page is empty. (LP: #1870954) + - Fix the focus issue. + - Fix the issues when change primary screen. + * debian/control: + - Add bamfdaemon to depends and libbamf3-dev to build-depends. + + -- handsome_feng Mon, 13 Apr 2020 15:47:37 +0800 + +ukui-menu (2.0.5-1) unstable; urgency=medium + + * New upstream bugfix release. + - Fix startup failure when panel profile does not exist. + - Fix the icon dragging problem. + - Fix that right-click menu popup abnormally. + - Fix the wrong position when switch from fullscreen to normal mode. + * debian/watch: + - Update to monitor upstream org.tar.gz file. + + -- handsome_feng Tue, 07 Apr 2020 10:54:28 +0800 + +ukui-menu (2.0.4-1) unstable; urgency=medium + + * New upstream bugfix release. + - Fix the icon problem with newly installed software. + - Fix the crash during software installation and uninstallation. + - Not hardcode the font name. + + -- handsome_feng Mon, 30 Mar 2020 11:21:48 +0800 + +ukui-menu (2.0.3-1) unstable; urgency=medium + + * New upstream bugfix release. + - Get the panel position to avoid popup at wrong place. + - Fix the stuck when scroll the area. + - Fix the focus issue. + - Fix the display problem of 'recent app" bar. + - Adjust the style of right-click menu. + + -- handsome_feng Sat, 14 Mar 2020 14:33:14 +0800 + +ukui-menu (2.0.1-1) unstable; urgency=medium + + * New upstream release. + - Migrate from python to qt. + * debian/control: + - Bump Standards-Versions to 4.5.0. + * debian/{control,compat}: + - Use debhelper-compat notation. + + -- handsome_feng Sat, 08 Feb 2020 15:51:47 +0800 + +ukui-menu (1.1.12-1) unstable; urgency=medium + + * Remove the duplicated timed-shutdown.py file. + + -- handsome_feng Mon, 19 Aug 2019 14:57:14 +0800 + +ukui-menu (1.1.11-1) unstable; urgency=medium + + * Upload to unstable. + * Add network detection for feedback. + * Update some labels. + * Update tr.po. + * debian/control: + - Bump standards-version to 4.4.0. + + -- handsome_feng Wed, 07 Aug 2019 09:52:56 +0800 + +ukui-menu (1.1.10-1) experimental; urgency=medium + + * Update the default icon of user face. + * Fix the error when show popup menu. + * Change the timing of update recent files. + + -- handsome_feng Thu, 21 Mar 2019 17:29:11 +0800 + +ukui-menu (1.1.9-1) unstable; urgency=medium + + * Add transparency effect. + * Add a shutdown timer. + * Deal with the situation when get_desktop_file_path is None. + * Update the code of keybinding. + * Update the icon of start menu. + * Bump standards-version to 4.3.0. + + -- handsome_feng Fri, 04 Jan 2019 14:27:45 +0800 + +ukui-menu (1.1.7-2) unstable; urgency=medium + + * Debian/control: + - Remove gvfs-open. (Closes: 906326) + + -- handsome_feng Fri, 16 Nov 2018 17:04:47 +0800 + +ukui-menu (1.1.7-1) unstable; urgency=medium + + * Skip 'Education' for 'Normal Menu'. + * Add fr.po, pt.po, ru.po, es.po. + * Update start.svg. + * Deal with filename which contain '&'. + + -- handsome_feng Wed, 07 Nov 2018 12:55:21 +0800 + +ukui-menu (1.1.5-1) UNRELEASED; urgency=medium + + * Use mate-terminal instead of gnome-terminal. + * Port to python3. + * Update for ukui-panel. + * Add support for resize the menu icon. + * Add right-click menu for recent files. + * Add feedback window. + + -- handsome_feng Mon, 17 Sep 2018 16:11:00 +0800 + +ukui-menu (1.0.2-2) unstable; urgency=medium + + * Use tracker.d.o team address (Closes: #899863) + + -- Aron Xu Mon, 09 Jul 2018 14:47:31 +0800 + +ukui-menu (1.0.2-1) unstable; urgency=medium + + * Initial release (Closes: #872967) + + -- Aron Xu Sat, 26 Aug 2017 14:57:14 +0800 diff --git a/debian/control b/debian/control new file mode 100755 index 0000000..2e3fd51 --- /dev/null +++ b/debian/control @@ -0,0 +1,43 @@ +Source: ukui-menu +Section: x11 +Priority: optional +Maintainer: Kylin Team +Uploaders: Aron Xu , + handsome_feng +Build-Depends: debhelper-compat (=12), + qtbase5-dev, + libqt5svg5-dev, + libqt5x11extras5-dev, + libglib2.0-dev (>= 2.36), + libgsettings-qt-dev, + qttools5-dev-tools, + libbamf3-dev, + libkf5windowsystem-dev, + libuchardet-dev, + libukui-log4qt-dev, + libxtst-dev, + libx11-dev, + libukui-common0, + libukui-common-dev, + libpeony-dev +Standards-Version: 4.5.0 +Rules-Requires-Root: no +Homepage: https://github.com/ukui/ukui-menu +Vcs-Git: https://github.com/ukui/ukui-menu +Vcs-Browser: https://github.com/ukui/ukui-menu + +Package: ukui-menu +Architecture: any +Depends: ${shlibs:Depends}, + ${misc:Depends}, + accountsservice, + libgsettings-qt1, + libqt5x11extras5, + bamfdaemon +Suggests:kylin-status-manager, + kylin-daq +Description: Advanced ukui menu + UKUI menu provides start menu development library and advanced + graphical user interface. + . + The package contains executable file. diff --git a/debian/copyright b/debian/copyright new file mode 100755 index 0000000..3a0edea --- /dev/null +++ b/debian/copyright @@ -0,0 +1,29 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ukui-menu +Upstream-Contact: liuhao +Source: https://github.com/ukui/ukui-menu + +Files: * +Copyright: 2019 Tianjin KYLIN Information Technology Co., Ltd. +License: GPL-3.0+ + +Files: debian/* +Copyright: 2019 liuhao +License: GPL-3.0+ + +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..95cf77f --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export QT_SELECT := qt5 + +%: + dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100755 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100755 index 0000000..e685515 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=4 +https://github.com/ukui/ukui-menu/releases .*/ukui-menu_(\d\S+)\.orig\.tar\.gz From 9a1c0cb5643ebf0eb688d60a663e6a3b14f1724c Mon Sep 17 00:00:00 2001 From: Xie Wei Date: Fri, 6 May 2022 18:29:35 +0800 Subject: [PATCH 02/30] change format --- debian/source/format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/source/format b/debian/source/format index 163aaf8..89ae9db 100755 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) From 26869a3bbf29805e8c81ea839b1a18a07d55faaa Mon Sep 17 00:00:00 2001 From: handsome_feng Date: Sat, 18 Jun 2022 14:08:28 +0000 Subject: [PATCH 03/30] update debian/changelog. --- debian/changelog | 174 +---------------------------------------------- 1 file changed, 3 insertions(+), 171 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4d7ef5c..5eae127 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,173 +1,5 @@ -ukui-menu (3.1.1-0k0) yangtze; urgency=medium +ukui-menu (3.1.1-ok1) yangtze; urgency=medium - * 版本号规范化 + * Initial for openKylin. - -- Xie Wei Fri, 06 May 2022 17:54:45 +0800 - -ukui-menu (3.1.1-0420) jammy; urgency=medium - - * bug号:无 - * 任务号:无 - * 其他改动说明:修改ukui-default主题为浅色主题,修改全屏缩小按钮反色 - * 其他改动说明影响域:影响开始菜单默认主题色 - - -- lixueman Wed, 20 Apr 2022 17:03:09 +0800 - -ukui-menu (3.1.1-0419) jammy; urgency=medium - - * bug号:115348,112503开始菜单浅色主题适配 - - -- lixueman Tue, 19 Apr 2022 15:00:27 +0800 - -ukui-menu (3.0.1-1) unstable; urgency=medium - - * New upstream bugfix release. - - -- handsome_feng Thu, 24 Sep 2020 14:48:18 +0800 - -ukui-menu (3.0.0-1) unstable; urgency=medium - - * New upstream release. - - -- handsome_feng Wed, 26 Aug 2020 20:18:25 +0800 - -ukui-menu (2.0.8-1) unstable; urgency=medium - - * New upstream release. - - -- handsome_feng Wed, 15 Jul 2020 20:16:14 +0800 - -ukui-menu (2.0.7-1) unstable; urgency=medium - - * New upstream release. - - -- handsome_feng Mon, 06 Jul 2020 14:57:00 +0800 - -ukui-menu (2.0.6-1) unstable; urgency=medium - - * New upstream bugfix release. - - Fix that the 'recent' page is empty. (LP: #1870954) - - Fix the focus issue. - - Fix the issues when change primary screen. - * debian/control: - - Add bamfdaemon to depends and libbamf3-dev to build-depends. - - -- handsome_feng Mon, 13 Apr 2020 15:47:37 +0800 - -ukui-menu (2.0.5-1) unstable; urgency=medium - - * New upstream bugfix release. - - Fix startup failure when panel profile does not exist. - - Fix the icon dragging problem. - - Fix that right-click menu popup abnormally. - - Fix the wrong position when switch from fullscreen to normal mode. - * debian/watch: - - Update to monitor upstream org.tar.gz file. - - -- handsome_feng Tue, 07 Apr 2020 10:54:28 +0800 - -ukui-menu (2.0.4-1) unstable; urgency=medium - - * New upstream bugfix release. - - Fix the icon problem with newly installed software. - - Fix the crash during software installation and uninstallation. - - Not hardcode the font name. - - -- handsome_feng Mon, 30 Mar 2020 11:21:48 +0800 - -ukui-menu (2.0.3-1) unstable; urgency=medium - - * New upstream bugfix release. - - Get the panel position to avoid popup at wrong place. - - Fix the stuck when scroll the area. - - Fix the focus issue. - - Fix the display problem of 'recent app" bar. - - Adjust the style of right-click menu. - - -- handsome_feng Sat, 14 Mar 2020 14:33:14 +0800 - -ukui-menu (2.0.1-1) unstable; urgency=medium - - * New upstream release. - - Migrate from python to qt. - * debian/control: - - Bump Standards-Versions to 4.5.0. - * debian/{control,compat}: - - Use debhelper-compat notation. - - -- handsome_feng Sat, 08 Feb 2020 15:51:47 +0800 - -ukui-menu (1.1.12-1) unstable; urgency=medium - - * Remove the duplicated timed-shutdown.py file. - - -- handsome_feng Mon, 19 Aug 2019 14:57:14 +0800 - -ukui-menu (1.1.11-1) unstable; urgency=medium - - * Upload to unstable. - * Add network detection for feedback. - * Update some labels. - * Update tr.po. - * debian/control: - - Bump standards-version to 4.4.0. - - -- handsome_feng Wed, 07 Aug 2019 09:52:56 +0800 - -ukui-menu (1.1.10-1) experimental; urgency=medium - - * Update the default icon of user face. - * Fix the error when show popup menu. - * Change the timing of update recent files. - - -- handsome_feng Thu, 21 Mar 2019 17:29:11 +0800 - -ukui-menu (1.1.9-1) unstable; urgency=medium - - * Add transparency effect. - * Add a shutdown timer. - * Deal with the situation when get_desktop_file_path is None. - * Update the code of keybinding. - * Update the icon of start menu. - * Bump standards-version to 4.3.0. - - -- handsome_feng Fri, 04 Jan 2019 14:27:45 +0800 - -ukui-menu (1.1.7-2) unstable; urgency=medium - - * Debian/control: - - Remove gvfs-open. (Closes: 906326) - - -- handsome_feng Fri, 16 Nov 2018 17:04:47 +0800 - -ukui-menu (1.1.7-1) unstable; urgency=medium - - * Skip 'Education' for 'Normal Menu'. - * Add fr.po, pt.po, ru.po, es.po. - * Update start.svg. - * Deal with filename which contain '&'. - - -- handsome_feng Wed, 07 Nov 2018 12:55:21 +0800 - -ukui-menu (1.1.5-1) UNRELEASED; urgency=medium - - * Use mate-terminal instead of gnome-terminal. - * Port to python3. - * Update for ukui-panel. - * Add support for resize the menu icon. - * Add right-click menu for recent files. - * Add feedback window. - - -- handsome_feng Mon, 17 Sep 2018 16:11:00 +0800 - -ukui-menu (1.0.2-2) unstable; urgency=medium - - * Use tracker.d.o team address (Closes: #899863) - - -- Aron Xu Mon, 09 Jul 2018 14:47:31 +0800 - -ukui-menu (1.0.2-1) unstable; urgency=medium - - * Initial release (Closes: #872967) - - -- Aron Xu Sat, 26 Aug 2017 14:57:14 +0800 + -- Xie Wei Fri, 06 May 2022 17:54:45 +0800 \ No newline at end of file From d1136ea880fcfe86a9612804e0588960ce898163 Mon Sep 17 00:00:00 2001 From: lixueman <11020448+lixueman0110@user.noreply.gitee.com> Date: Mon, 20 Jun 2022 01:49:56 +0000 Subject: [PATCH 04/30] =?UTF-8?q?!4=20=E5=A2=9E=E5=8A=A0wayland=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 86 ----- README.md | 34 +- .../{DM-icon-选项.svg => DM-icon-option.svg} | 0 debian/changelog | 12 +- debian/control | 6 +- main.cpp | 54 ++- res.qrc | 2 +- .../BuriedPoint/buriedpointdatasend.cpp | 78 ++++ .../BuriedPoint/buriedpointdatasend.h | 29 ++ .../tablet_directorychanged_thread.cpp | 12 +- .../Interface/ukui_chineseletter.cpp | 2 +- .../Interface/ukuimenuinterface.cpp | 18 +- src/BackProcess/backprocess.pri | 13 +- src/BackProcess/tablet/getmodeldata.cpp | 24 +- src/BackProcess/tablet/getmodeldata.h | 5 + src/BackProcess/tablet/pagemanager.cpp | 35 +- src/BackProcess/tablet/pagemanager.h | 4 +- .../Button/function_classify_button.cpp | 18 +- .../Button/letter_classify_button.cpp | 30 +- src/UserInterface/ListView/listview.cpp | 17 +- src/UserInterface/ListView/rightlistview.cpp | 18 +- src/UserInterface/ListView/rightlistview.h | 5 +- src/UserInterface/Other/rotationlabel.cpp | 38 ++ src/UserInterface/Other/rotationlabel.h | 21 + src/UserInterface/RightClickMenu/menubox.cpp | 6 + src/UserInterface/RightClickMenu/menubox.h | 1 + .../RightClickMenu/tabletrightclickmenu.cpp | 31 +- .../RightClickMenu/tabletrightclickmenu.h | 6 - src/UserInterface/ViewItem/itemdelegate.cpp | 33 +- .../ViewItem/right_item_delegate.cpp | 21 +- .../ViewItem/tablet_full_itemdelegate.cpp | 29 +- .../Widget/full_commonuse_widget.cpp | 17 + .../Widget/full_function_widget.cpp | 17 + .../Widget/full_letter_widget.cpp | 17 + .../Widget/full_searchresult_widget.cpp | 17 + src/UserInterface/Widget/function_Widget.cpp | 31 +- src/UserInterface/Widget/function_Widget.h | 1 - .../Widget/function_button_widget.cpp | 3 +- .../Widget/letter_button_widget.cpp | 13 +- src/UserInterface/Widget/main_view_widget.cpp | 20 +- src/UserInterface/Widget/main_view_widget.h | 4 + src/UserInterface/full_mainwindow.cpp | 29 +- src/UserInterface/mainwindow.cpp | 363 ++++++++++++++---- src/UserInterface/mainwindow.h | 18 +- src/UserInterface/tabletwindow.cpp | 181 ++++----- src/UserInterface/tabletwindow.h | 7 +- src/UserInterface/userinterface.pri | 2 + src/UtilityFunction/Style/style.cpp | 44 ++- src/UtilityFunction/Style/style.h | 7 + src/UtilityFunction/abstractInterface.h | 2 +- src/UtilityFunction/utility.cpp | 25 ++ src/UtilityFunction/utility.h | 25 +- translations/ukui-menu_bo.ts | 81 ++-- translations/ukui-menu_tr.ts | 81 ++-- translations/ukui-menu_zh_CN.ts | 81 ++-- ukui-menu.pro | 6 +- 56 files changed, 1237 insertions(+), 543 deletions(-) delete mode 100755 .github/workflows/build.yml rename data/img/mainviewwidget/{DM-icon-选项.svg => DM-icon-option.svg} (100%) create mode 100644 src/BackProcess/BuriedPoint/buriedpointdatasend.cpp create mode 100644 src/BackProcess/BuriedPoint/buriedpointdatasend.h create mode 100644 src/UserInterface/Other/rotationlabel.cpp create mode 100644 src/UserInterface/Other/rotationlabel.h diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100755 index d63f007..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Check build - -on: - push: - branches: - - master - - pull_request: - branches: - - master - - schedule: - - cron: '0 0 * * *' - -jobs: - archlinux: - name: on Archlinux - runs-on: ubuntu-20.04 - container: docker.io/library/archlinux:latest - steps: - - name: Checkout ukui-menu source code - uses: actions/checkout@v2 - - name: Refresh pacman repository - run: pacman -Sy - - name: Install build dependencies - run: pacman -S --noconfirm base-devel qt5-base bamf gsettings-qt qt5-svg qt5-x11extras qt5-tools kwindowsystem - - name: QMake configure & Make - run: | - mkdir build; - cd build; - qmake-qt5 ..; - make -j$(nproc); - debian: - name: on Debian Sid - runs-on: ubuntu-20.04 - container: docker.io/library/debian:sid - env: - DEBIAN_FRONTEND: noninteractive - steps: - - name: Checkout ukui-menu source code - uses: actions/checkout@v2 - - name: Update apt repository - run: apt-get update -y - - name: Install build dependcies - run: apt-get install -y build-essential qt5-default qttools5-dev-tools debhelper-compat qtbase5-dev libqt5svg5-dev libglib2.0-dev libgsettings-qt-dev libbamf3-dev libxrandr-dev libxtst-dev libx11-dev libqt5x11extras5-dev libkf5windowsystem-dev - - name: QMake configure & Make - run: | - mkdir build; - cd build; - qmake ..; - make -j$(nproc); - - fedora: - name: on Fedora 32 - runs-on: ubuntu-20.04 - container: docker.io/library/fedora:32 - steps: - - name: Checkout ukui-menu source code - uses: actions/checkout@v2 - - name: Install build dependencies - run: dnf install -y which gcc gcc-c++ make cmake cmake-rpm-macros autoconf automake intltool rpm-build qt5-rpm-macros qt5-qtbase-devel qt5-qtsvg-devel qt5-qtx11extras-devel qt5-linguist glib2-devel gsettings-qt-devel bamf-devel libXrandr-devel libXtst-devel libX11-devel kf5-kwindowsystem-devel - - name: QMake configure & Make - run: | - mkdir build; - cd build; - qmake-qt5 ..; - make -j$(nproc); - ubuntu: - name: on Ubuntu 20.04 - runs-on: ubuntu-20.04 - container: docker.io/library/ubuntu:focal - env: - DEBIAN_FRONTEND: noninteractive - steps: - - name: Checkout ukui-menu source code - uses: actions/checkout@v2 - - name: Update apt repository - run: apt-get update -y - - name: Install build dependcies - run: apt-get install -y build-essential qt5-default qttools5-dev-tools debhelper-compat qtbase5-dev libqt5svg5-dev libglib2.0-dev libgsettings-qt-dev libbamf3-dev libxrandr-dev libxtst-dev libx11-dev libqt5x11extras5-dev libkf5windowsystem-dev - - name: QMake configure & Make - run: | - mkdir build; - cd build; - qmake ..; - make -j$(nproc); diff --git a/README.md b/README.md index 3a66c1d..ff12dc9 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,34 @@ ![build](https://github.com/ukui/ukui-menu/workflows/Check%20build/badge.svg?branch=master) -An advanced menu for UKUI, providing common and all software mixed sort module, alphabet classification module, functional classification module and search module. +An advanced menu for UKUI, providing common and all software mixed sort module, alphabet classification module, functional classification module and search module. Provides favorites and recent file functions, You can fix it to your favorites area by right-clicking the application. Provides two display modes: default window and full-screen window. + +# The project structure + +## data/img + +Provide icon files for the projec. + +## src/BackProcess + +Background data processing function realization, Includes DBUS, path listening, data acquisition, and search functions. + +## src/QtSingleApplication + +Singleton pattern processing. + +## src/UserInterface + +The UI implementation. + +## src/UtilityFunction + +Implementation of common functions, including database operations. + +## translations + +Translation files + # How to report bugs Bugs should be reported to the UKUI bug tracking system: @@ -15,6 +42,7 @@ Please read the HACKING file for information on where to send changes or bugfixes for this package. # How to build + ## Preparation You can build pre-depends with such command: @@ -34,7 +62,7 @@ Note: build-depends references the paragraph in debian/control. Note: If you want to run ukui-menu, You just need to execute the ukui-menu command at the terminal. -## DBUS interface +# DBUS interface BUS Name:org.ukui.menu @@ -50,7 +78,7 @@ WinKeyResponse () <---> ukui-menu display hidden state change interface GetSecurityConfigPath () <---> Get security control profile path -## Configuration file +# Configuration file .config/ukui/Ukuimenu.db diff --git a/data/img/mainviewwidget/DM-icon-选项.svg b/data/img/mainviewwidget/DM-icon-option.svg similarity index 100% rename from data/img/mainviewwidget/DM-icon-选项.svg rename to data/img/mainviewwidget/DM-icon-option.svg diff --git a/debian/changelog b/debian/changelog index 5eae127..a1a551e 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,11 @@ -ukui-menu (3.1.1-ok1) yangtze; urgency=medium +ukui-menu (3.20.0.3-0k1) yangtze; urgency=medium - * Initial for openKylin. + * 3.20版本提交 - -- Xie Wei Fri, 06 May 2022 17:54:45 +0800 \ No newline at end of file + -- lixueman Sat, 18 Jun 2022 21:42:59 +0800 + +ukui-menu (3.1.1-0k0) yangtze; urgency=medium + + * 版本号规范化 + + -- Xie Wei Fri, 06 May 2022 17:54:45 +0800 diff --git a/debian/control b/debian/control index 2e3fd51..4cb6cda 100755 --- a/debian/control +++ b/debian/control @@ -19,7 +19,8 @@ Build-Depends: debhelper-compat (=12), libx11-dev, libukui-common0, libukui-common-dev, - libpeony-dev + libpeony-dev, + libkysdk-waylandhelper-dev Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: https://github.com/ukui/ukui-menu @@ -33,7 +34,8 @@ Depends: ${shlibs:Depends}, accountsservice, libgsettings-qt1, libqt5x11extras5, - bamfdaemon + bamfdaemon, + libkysdk-waylandhelper Suggests:kylin-status-manager, kylin-daq Description: Advanced ukui menu diff --git a/main.cpp b/main.cpp index f30ac71..68bb94d 100755 --- a/main.cpp +++ b/main.cpp @@ -30,6 +30,9 @@ #include "file-utils.h" #include #include +#include "ukuistylehelper/ukuistylehelper.h" +#include "windowmanager/windowmanager.h" + #define UKUI_SERVICE "org.gnome.SessionManager" #define UKUI_PATH "/org/gnome/SessionManager" #define UKUI_INTERFACE "org.gnome.SessionManager" @@ -40,6 +43,9 @@ int main(int argc, char *argv[]) { initUkuiLog4qt("ukui-menu"); g_projectCodeName = KDKGetPrjCodeName().c_str(); + g_subProjectCodeName = KDKGetOSRelease("SUB_PROJECT_CODENAME").c_str(); + g_platform = QGuiApplication::platformName(); + qRegisterMetaType>("QVector"); #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); @@ -69,20 +75,44 @@ int main(int argc, char *argv[]) MainWindow w; app.setActivationWindow(&w); - if (Style::m_panelPosition == 0) { - w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + Style::m_availableScreenHeight - Style::minh - 3, - Style::minw, Style::minh)); - } else if (Style::m_panelPosition == 1) { - w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + 4, Style::minw, Style::minh)); - } else if (Style::m_panelPosition == 2) { - w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + 4, Style::minw, Style::minh)); - } else { - w.setGeometry(QRect(Style::m_primaryScreenX + Style::m_availableScreenWidth - Style::minw - 4, Style::m_primaryScreenY + 4, - Style::minw, Style::minh)); - } - w.show(); w.raise(); + + if (Style::m_panelPosition == 0) { + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + kdk::WindowManager::setGeometry(w.windowHandle(),QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + + Style::m_availableScreenHeight - Style::minh - 3, Style::minw, Style::minh)); + } else { + w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + Style::m_availableScreenHeight - Style::minh - 3, + Style::minw, Style::minh)); + } + } else if (Style::m_panelPosition == 1) { + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + kdk::WindowManager::setGeometry(w.windowHandle(),QRect(Style::m_primaryScreenX + 4, + Style::m_primaryScreenY + 4, Style::minw, Style::minh)); + } else { + w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + 4, Style::minw, Style::minh)); + } + + } else if (Style::m_panelPosition == 2) { + + + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + kdk::WindowManager::setGeometry(w.windowHandle(), QRect(Style::m_primaryScreenX + 4, + Style::m_primaryScreenY + 4, Style::minw, Style::minh)); + } else { + w.setGeometry(QRect(Style::m_primaryScreenX + 4, Style::m_primaryScreenY + 4, Style::minw, Style::minh)); + } + } else { + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + kdk::WindowManager::setGeometry(w.windowHandle(), QRect(Style::m_primaryScreenX + Style::m_availableScreenWidth - + Style::minw - 4, Style::m_primaryScreenY + 4, Style::minw, Style::minh)); + } else { + w.setGeometry(QRect(Style::m_primaryScreenX + Style::m_availableScreenWidth - Style::minw - 4, Style::m_primaryScreenY + 4, + Style::minw, Style::minh)); + } + } + w.update(); w.activateWindow(); w.hide(); diff --git a/res.qrc b/res.qrc index 3a10c26..47d0ea3 100755 --- a/res.qrc +++ b/res.qrc @@ -27,7 +27,6 @@ data/img/mainviewwidget/DM-icon-返回.svg data/img/mainviewwidget/DM-icon-返回@2x.png data/img/mainviewwidget/DM-icon-选项.png - data/img/mainviewwidget/DM-icon-选项.svg data/img/mainviewwidget/DM-icon-选项@2x.png data/img/mainviewwidget/DM-icon-check.png data/img/mainviewwidget/DM-icon-check.svg @@ -171,5 +170,6 @@ data/img/sidebarwidget/usericon-lightcolor.svg src/BackProcess/Search/pinyinWithoutTone.txt src/BackProcess/Search/pinyinWithTone.txt + data/img/mainviewwidget/DM-icon-option.svg diff --git a/src/BackProcess/BuriedPoint/buriedpointdatasend.cpp b/src/BackProcess/BuriedPoint/buriedpointdatasend.cpp new file mode 100644 index 0000000..a35411f --- /dev/null +++ b/src/BackProcess/BuriedPoint/buriedpointdatasend.cpp @@ -0,0 +1,78 @@ +#include "buriedpointdatasend.h" +#include +#include +#include +#include +#include +#include +#include + +Q_GLOBAL_STATIC(BuriedPointDataSend, buriedPointDataSend) + +BuriedPointDataSend::BuriedPointDataSend() +{ + QString path = QDir::homePath() + "/.config/ukui/menuUploadMessage/"; +// m_sendDataInterface = new KUploadMessage(getpid()); +// m_sendDataInterface->initUploadInterface("ukui-menu", "menuData", path); +} + +BuriedPointDataSend::~BuriedPointDataSend() +{ +// if (m_sendDataInterface != nullptr) { +// delete m_sendDataInterface; +// m_sendDataInterface = nullptr; +// } +} + +BuriedPointDataSend *BuriedPointDataSend::getInstance() +{ + return buriedPointDataSend(); +} + +QString BuriedPointDataSend::getCurrentTime() +{ + QString tempDateTimeStr; + QDateTime tempDateTime = QDateTime::currentDateTime().toTimeZone(QTimeZone(8 * 3600)); + tempDateTimeStr = tempDateTime.toString("yyyy-MM-dd HH:mm:ss.zzz"); + return tempDateTimeStr; +} + +void BuriedPointDataSend::setPoint(const pointDataStruct &data) +{ +// int curNum = 1; +// QStringList applist = QStringList(); +// QString keyValue = data.module + data.function; + +// if (m_functionCount.keys().contains(keyValue)) { +// curNum = m_functionCount.value(keyValue); +// curNum ++; +// } + +// m_functionCount.insert(keyValue, curNum); + +// if (!data.otherFunction.isEmpty()) { +// if (m_applist.keys().contains(keyValue)) { +// applist = m_applist.value(keyValue); +// } + +// applist.append(data.otherFunction.at(0)); +// m_applist.insert(keyValue, applist); +// } + +// QString time = getCurrentTime(); +// QJsonObject jsonObj; +// QJsonArray otherFunction = QJsonArray::fromStringList(data.otherFunction); +// jsonObj.insert("module", QJsonValue(data.module)); +// jsonObj.insert("function", QJsonValue(data.function)); +// jsonObj.insert("functionNum", QJsonValue(QString::number(curNum))); +// jsonObj.insert("otherFunction", otherFunction); +// jsonObj.insert("errorLevel", QJsonValue(data.errorLevel)); +// jsonObj.insert("errorOutput", QJsonValue(data.errorOutput)); +// jsonObj.insert("createTimeStamp", QJsonValue(time));//注意该字段名称不能修改,否则会报invalid +// // 将数据转化为QString +// QString informationData(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact)); +// qDebug() << "jsonObj:" << jsonObj; +// m_sendDataInterface->uploadMessage(informationData); +} + + diff --git a/src/BackProcess/BuriedPoint/buriedpointdatasend.h b/src/BackProcess/BuriedPoint/buriedpointdatasend.h new file mode 100644 index 0000000..55aa510 --- /dev/null +++ b/src/BackProcess/BuriedPoint/buriedpointdatasend.h @@ -0,0 +1,29 @@ +#ifndef BURIEDPOINTDATASEND_H +#define BURIEDPOINTDATASEND_H + +#include +#include +#include +#include "src/UtilityFunction/utility.h" +#include "unistd.h" +//#include "kuploadmessage.h" + +class BuriedPointDataSend : public QObject +{ + Q_OBJECT +public: + BuriedPointDataSend(); + ~BuriedPointDataSend(); + + static BuriedPointDataSend *getInstance(); + + void setPoint(const pointDataStruct &data); + +private: + QString getCurrentTime(); + QHash m_functionCount; + QHash m_applist; +// KUploadMessage *m_sendDataInterface = nullptr; +}; + +#endif // BURIEDPOINTDATASEND_H diff --git a/src/BackProcess/FileWatcher/tablet_directorychanged_thread.cpp b/src/BackProcess/FileWatcher/tablet_directorychanged_thread.cpp index 1d01699..0cbbf6b 100755 --- a/src/BackProcess/FileWatcher/tablet_directorychanged_thread.cpp +++ b/src/BackProcess/FileWatcher/tablet_directorychanged_thread.cpp @@ -76,14 +76,24 @@ void TabletDirectoryChangedThread::run() QStringList applist = setting->allKeys(); int appnum = setting->allKeys().count(); int maxindex = 0; + int minindex = 0; for (int i = 0; i < appnum; i++) { if (setting->value(applist.at(i)).toInt() > maxindex) { maxindex = setting->value(applist.at(i)).toInt(); } + + if(setting->value(applist.at(i)).toInt() <= minindex) { + minindex = setting->value(applist.at(i)).toInt(); + } + } + + if (desktopfn.contains("small-plugin-manage")){ + setting->setValue(desktopfn,minindex-1); + } else { + setting->setValue(desktopfn,maxindex+1); } - setting->setValue(desktopfn, maxindex + 1); //setting->allKeys().count() setting->sync(); setting->endGroup(); // diff --git a/src/BackProcess/Interface/ukui_chineseletter.cpp b/src/BackProcess/Interface/ukui_chineseletter.cpp index 882be2f..ff73a2d 100755 --- a/src/BackProcess/Interface/ukui_chineseletter.cpp +++ b/src/BackProcess/Interface/ukui_chineseletter.cpp @@ -6244,7 +6244,7 @@ QString UkuiChineseLetter::getPinyin(int code)//此方法可以获取所有汉 } if (pinyin.isEmpty()) { - pinyin = ""; + pinyin = " "; } return pinyin; diff --git a/src/BackProcess/Interface/ukuimenuinterface.cpp b/src/BackProcess/Interface/ukuimenuinterface.cpp index 50e4f9a..ed6718b 100755 --- a/src/BackProcess/Interface/ukuimenuinterface.cpp +++ b/src/BackProcess/Interface/ukuimenuinterface.cpp @@ -576,8 +576,6 @@ QVector UkuiMenuInterface::createAppInfoVector() sql.exec(QString("select name_zh from appCategory where app_name=\"%1\" ").arg(desktopfpExecName)); if (sql.next()) { - myDebug() << "数据库执行成功"; - for (int j = 0; j < vector.size(); j++) { if (vector.at(j).contains(sql.value(0).toString())) { appInfoList.append(QString::number(j)); @@ -861,9 +859,11 @@ bool UkuiMenuInterface::initAppIni() QVector tencentInitVector; QVector customizedVector; QVector thirdPartyVector; + QVector preorderAppVector; QString tencent_math = "/usr/share/applications/tencent-math-precise-practice.desktop"; QString tencent_chinese = "/usr/share/applications/tencent-chinese-precise-practice.desktop"; QString tencent_english = "/usr/share/applications/tencent-english-precise-practice.desktop"; + QString smallPluginManage = "/usr/share/applications/small-plugin-manage.desktop"; QVector precise_practiceVector; QStringList math; QStringList english; @@ -903,6 +903,8 @@ bool UkuiMenuInterface::initAppIni() customizedVector.append(appInfoVector.at(i)); } else if (tmp.indexOf("mdm") != -1) { customizedVector.append(appInfoVector.at(i)); + } else if (tmp.contains(smallPluginManage)) { + preorderAppVector.append(appInfoVector.at(i)); } else { appInitVector.append(appInfoVector.at(i)); } @@ -928,12 +930,22 @@ bool UkuiMenuInterface::initAppIni() qSort(thirdPartyVector.begin(), thirdPartyVector.end(), cmpApp); //按中英文字母排序 setting->beginGroup("application"); + for (int i = 0; i < preorderAppVector.count(); i++) { + QString str = preorderAppVector.at(i).at(0).section(' ', 0, 0); + QStringList list = str.split('/'); + str = list[list.size() - 1]; + //qDebug()<setValue(str, i); + } + + int firstVectorCount = preorderAppVector.count(); + for (int i = 0; i < tencentInitVector.count(); i++) { QString str = tencentInitVector.at(i).at(0).section(' ', 0, 0); QStringList list = str.split('/'); str = list[list.size() - 1]; //qDebug()<setValue(str, i); + setting->setValue(str, i + firstVectorCount); } int a = tencentInitVector.count(); diff --git a/src/BackProcess/backprocess.pri b/src/BackProcess/backprocess.pri index aa6805a..929a1a9 100755 --- a/src/BackProcess/backprocess.pri +++ b/src/BackProcess/backprocess.pri @@ -7,7 +7,8 @@ INCLUDEPATH += \ $$PWD/Interface \ $$PWD/Search \ $$PWD/tablet \ - $$PWD/XEventMonitor + $$PWD/XEventMonitor \ + $$PWD/BuriedPoint HEADERS += \ $$PWD/DBus/dbus-adaptor.h \ @@ -24,7 +25,8 @@ HEADERS += \ $$PWD/Search/searchappthread.h \ $$PWD/XEventMonitor/xeventmonitor.h \ $$PWD/tablet/getmodeldata.h \ - $$PWD/tablet/pagemanager.h + $$PWD/tablet/pagemanager.h \ + $$PWD/BuriedPoint/buriedpointdatasend.h SOURCES += \ $$PWD/DBus/dbus-adaptor.cpp \ @@ -41,4 +43,9 @@ SOURCES += \ $$PWD/Search/searchappthread.cpp \ $$PWD/XEventMonitor/xeventmonitor.cpp \ $$PWD/tablet/getmodeldata.cpp \ - $$PWD/tablet/pagemanager.cpp + $$PWD/tablet/pagemanager.cpp \ + $$PWD/BuriedPoint/buriedpointdatasend.cpp + + +INCLUDEPATH += $$PWD/../ +DEPENDPATH += $$PWD/../ diff --git a/src/BackProcess/tablet/getmodeldata.cpp b/src/BackProcess/tablet/getmodeldata.cpp index 7854aa0..11d0693 100755 --- a/src/BackProcess/tablet/getmodeldata.cpp +++ b/src/BackProcess/tablet/getmodeldata.cpp @@ -1,7 +1,7 @@ #include "getmodeldata.h" #include #include -#include "src/UtilityFunction/utility.h" +#include "utility.h" GetModelData::GetModelData() { @@ -34,6 +34,28 @@ QVector GetModelData::getMinAllData() return m_minAllData; } +QStringList GetModelData::getPreCollectionApp() +{ + //收藏区预置应用:设置、天气、软件商店、截图、文件管理器 + QStringList preAppList = QStringList(); + QStringList preAppListExist = QStringList(); + preAppList << QString("/usr/share/applications/ukui-control-center.desktop") + <initAppIni(); } -int PageManager::getPageNum(int appnum) +int PageManager::getPageNum(const int &appNum) { int pageNum = 0; - Style::appColumn = 6; - Style::appLine = 4; - if (appnum % (Style::appColumn * Style::appLine) == 0) { - pageNum = appnum / (Style::appColumn * Style::appLine); + if (appNum / (Style::appColumnFirst * Style::appLineFirst) == 0) { + pageNum = 1; } else { - pageNum = appnum / (Style::appColumn * Style::appLine) + 1; + int appNumOtherPage = appNum - (Style::appColumnFirst * Style::appLineFirst); + + if (appNumOtherPage % (Style::appColumn * Style::appLine) == 0) { + pageNum = appNumOtherPage / (Style::appColumn * Style::appLine) + 1; + } else { + pageNum = appNumOtherPage / (Style::appColumn * Style::appLine) + 2; + } } return pageNum; } -QVector PageManager::sortAppInPage(QVector appvector) +QVector PageManager::sortAppInPage(const QVector &appVector) { QVector m_data; QVector pageData; QStringList onePageData; - Q_FOREACH (QString desktopfp, appvector) { + Q_FOREACH (QString desktopfp, appVector) { m_data.append(desktopfp); } int pageSize = getPageNum(m_data.size()); + onePageData.clear(); - for (int i = 0; i < pageSize; i++) { + for (int j = 0; j < Style::appColumnFirst * Style::appLineFirst; j++) { + if (m_data.size() > 0) { + onePageData.append(m_data.at(0)); + m_data.pop_front(); + } else { + break; + } + } + + pageData.append(onePageData); + + for (int i = 0; i < pageSize - 1; i++) { onePageData.clear(); for (int j = 0; j < Style::appColumn * Style::appLine; j++) { @@ -44,7 +60,6 @@ QVector PageManager::sortAppInPage(QVector appvector) onePageData.append(m_data.at(0)); m_data.pop_front(); } else { - // pageData.append(onePageData); break; } } diff --git a/src/BackProcess/tablet/pagemanager.h b/src/BackProcess/tablet/pagemanager.h index bc0b878..8c3f2ca 100755 --- a/src/BackProcess/tablet/pagemanager.h +++ b/src/BackProcess/tablet/pagemanager.h @@ -10,8 +10,8 @@ class PageManager : public QObject public: PageManager(); - int getPageNum(int appnum); - QVector sortAppInPage(QVector appvector); + int getPageNum(const int &appNum); + QVector sortAppInPage(const QVector &appVector); QVector getAppPageVector(); private: UkuiMenuInterface *m_ukuiMenuInterface = nullptr; diff --git a/src/UserInterface/Button/function_classify_button.cpp b/src/UserInterface/Button/function_classify_button.cpp index f9b58ef..2494be4 100755 --- a/src/UserInterface/Button/function_classify_button.cpp +++ b/src/UserInterface/Button/function_classify_button.cpp @@ -89,8 +89,22 @@ void FunctionClassifyButton::paintEvent(QPaintEvent *e) painter.setPen(Qt::NoPen); if (!m_fullscreen) { - QColor color = option.palette.color(QPalette::Text); - color.setAlphaF(0.15); + QColor color; + + if (option.state & QStyle::State_Selected) { + if (g_curStyle == "ukui-dark") { + color.setNamedColor("#33FFFFFF"); + } else { + color.setNamedColor("#D1FFFFFF"); + } + } else { + if (g_curStyle == "ukui-dark") { + color.setNamedColor("#1AFFFFFF"); + } else { + color.setNamedColor("#8CFFFFFF"); + } + } + painter.setBrush(color); } else { painter.setOpacity(0.15); diff --git a/src/UserInterface/Button/letter_classify_button.cpp b/src/UserInterface/Button/letter_classify_button.cpp index 8fb9340..5bc882f 100755 --- a/src/UserInterface/Button/letter_classify_button.cpp +++ b/src/UserInterface/Button/letter_classify_button.cpp @@ -19,6 +19,7 @@ #include "letter_classify_button.h" #include #include +#include "utility.h" LetterClassifyButton::LetterClassifyButton(QWidget *parent, bool fullscreen, @@ -55,8 +56,22 @@ void LetterClassifyButton::paintEvent(QPaintEvent *e) painter.setPen(Qt::NoPen); if (!m_fullscreen) { - QColor color = option.palette.color(QPalette::Text); - color.setAlphaF(0.15); + QColor color; + + if (option.state & QStyle::State_Selected) { + if (g_curStyle == "ukui-dark") { + color.setNamedColor("#33FFFFFF"); + } else { + color.setNamedColor("#D1FFFFFF"); + } + } else { + if (g_curStyle == "ukui-dark") { + color.setNamedColor("#1AFFFFFF"); + } else { + color.setNamedColor("#8CFFFFFF"); + } + } + painter.setBrush(color); } else { painter.setOpacity(0.15); @@ -81,10 +96,13 @@ void LetterClassifyButton::paintEvent(QPaintEvent *e) QStyleOptionButton subopt = option; subopt.rect = painter.style()->subElementRect(QStyle::SE_PushButtonContents, &option, this); - // if(m_fullscreen) - // subopt.palette.setBrush(QPalette::ButtonText, QColor(Qt::white)); - // else - // subopt.palette.setBrush(QPalette::HighlightedText, subopt.palette.text()); + + if (m_fullscreen) { + subopt.palette.setBrush(QPalette::ButtonText, QColor(Qt::white)); + } else { + subopt.palette.setBrush(QPalette::HighlightedText, subopt.palette.text()); + } + painter.style()->drawControl(QStyle::CE_PushButtonLabel, &subopt, &painter, this); return; } diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp index 9bd82c4..ff6b421 100755 --- a/src/UserInterface/ListView/listview.cpp +++ b/src/UserInterface/ListView/listview.cpp @@ -21,6 +21,7 @@ #include "utility.h" #include #include +#include "buriedpointdatasend.h" ListView::ListView(QWidget *parent/*, int width, int height, int module*/): KListView(parent) @@ -108,6 +109,12 @@ void ListView::onClicked(QModelIndex index) Q_EMIT sendAppClassificationBtnClicked(); } else { execApp(desktopfp); + pointDataStruct pointData; + pointData.module = "mainWindow/execApplication"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + pointData.otherFunction.append(desktopfp); + BuriedPointDataSend::getInstance()->setPoint(pointData); } } } @@ -129,8 +136,14 @@ void ListView::paintEvent(QPaintEvent *e) { //滚动条 QPalette p = this->verticalScrollBar()->palette(); - QColor color(255, 255, 255); - color.setAlphaF(0.25); + QColor color; + + if (g_curStyle == "ukui-dark") { + color = QColor("#26FFFFFF"); + } else { + color = QColor("#1A000000"); + } + p.setColor(QPalette::Active, QPalette::Button, color); this->verticalScrollBar()->setPalette(p); QListView::paintEvent(e); diff --git a/src/UserInterface/ListView/rightlistview.cpp b/src/UserInterface/ListView/rightlistview.cpp index a70a58f..e8dec33 100755 --- a/src/UserInterface/ListView/rightlistview.cpp +++ b/src/UserInterface/ListView/rightlistview.cpp @@ -39,7 +39,9 @@ RightListView::~RightListView() void RightListView::initWidget() { + setAttribute(Qt::WA_TranslucentBackground); viewport()->setAttribute(Qt::WA_TranslucentBackground); + viewport()->setAutoFillBackground(false); this->setSelectionMode(QAbstractItemView::SingleSelection); this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -62,10 +64,10 @@ void RightListView::dropEvent(QDropEvent *event) RightListView *source = qobject_cast(event->source()); if (source && source == this) { - dropPos = event->pos(); + m_dropPos = event->pos(); - if (this->indexAt(dropPos).isValid()) { - QVariant var = listmodel->data(indexAt(dropPos), Qt::DisplayRole); + if (this->indexAt(m_dropPos).isValid()) { + QVariant var = listmodel->data(indexAt(m_dropPos), Qt::DisplayRole); QString desktopfp = var.value(); QFileInfo fileInfo(desktopfp); QString desktopfn = fileInfo.fileName(); @@ -88,6 +90,11 @@ void RightListView::selectFirstItem() } } +void RightListView::paintEvent(QPaintEvent *e) +{ + QListView::paintEvent(e); +} + void RightListView::keyPressEvent(QKeyEvent *e) { if (e->type() == QEvent::KeyPress) { @@ -106,6 +113,11 @@ void RightListView::keyPressEvent(QKeyEvent *e) } } +void RightListView::changeStyleColor(const QColor &color) +{ + m_styleColor = color; +} + void RightListView::enterEvent(QEvent *e) { Q_UNUSED(e); diff --git a/src/UserInterface/ListView/rightlistview.h b/src/UserInterface/ListView/rightlistview.h index e85e07c..c75e0cc 100755 --- a/src/UserInterface/ListView/rightlistview.h +++ b/src/UserInterface/ListView/rightlistview.h @@ -26,12 +26,14 @@ protected: void keyPressEvent(QKeyEvent *e); void dropEvent(QDropEvent *event); void enterEvent(QEvent *e); + void paintEvent(QPaintEvent *e); private: RightClickMenu *menu = nullptr; //右键菜单 QStringList data; QGSettings *gsetting; - QPoint dropPos; + QPoint m_dropPos; + QColor m_styleColor; // bool inCurView; @@ -39,6 +41,7 @@ public Q_SLOTS: // void rightClickedSlot(const QPoint &pos);//右键菜单 void selectFirstItem(); + void changeStyleColor(const QColor &color); Q_SIGNALS: diff --git a/src/UserInterface/Other/rotationlabel.cpp b/src/UserInterface/Other/rotationlabel.cpp new file mode 100644 index 0000000..0c08e2e --- /dev/null +++ b/src/UserInterface/Other/rotationlabel.cpp @@ -0,0 +1,38 @@ +#include "rotationlabel.h" +#include +#include + +RotationLabel::RotationLabel(QWidget *parent) + : QLabel(parent) +{ + this->setFrameShape(QFrame::NoFrame); + this->setContentsMargins(0, 0, 0, 0); +} + +void RotationLabel::setRotation(int rot) +{ + m_rotation = rot; + this->update(); + qDebug() << m_rotation; +} + +int RotationLabel::rotation() +{ + return m_rotation; +} + +void RotationLabel::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + painter.setRenderHints(QPainter::SmoothPixmapTransform, true); + painter.translate(rect().width() / 2, rect().height() / 2); + painter.rotate(m_rotation); + painter.translate(-rect().width() / 2, -rect().height() / 2); + painter.drawPixmap(rect().adjusted(0, 9, 0, -9), m_pixmap); + return QLabel::paintEvent(event); +} + +void RotationLabel::setIcon(const QPixmap &pixmap) +{ + m_pixmap = pixmap; +} diff --git a/src/UserInterface/Other/rotationlabel.h b/src/UserInterface/Other/rotationlabel.h new file mode 100644 index 0000000..f99cdbb --- /dev/null +++ b/src/UserInterface/Other/rotationlabel.h @@ -0,0 +1,21 @@ +#ifndef ROTATIONLABEL_H +#define ROTATIONLABEL_H +#include + +class RotationLabel : public QLabel +{ + Q_OBJECT + Q_PROPERTY(int rotation READ rotation WRITE setRotation) //旋转 +public: + RotationLabel(QWidget *parent = nullptr); + void setIcon(const QPixmap &pixmap); +protected: + int rotation(); + void setRotation(int rot); + void paintEvent(QPaintEvent *event); +private: + int m_rotation = 0; + QPixmap m_pixmap; +}; + +#endif // ROTATIONLABEL_H diff --git a/src/UserInterface/RightClickMenu/menubox.cpp b/src/UserInterface/RightClickMenu/menubox.cpp index b6a8932..c6f9729 100755 --- a/src/UserInterface/RightClickMenu/menubox.cpp +++ b/src/UserInterface/RightClickMenu/menubox.cpp @@ -19,3 +19,9 @@ void MenuBox::mousePressEvent(QMouseEvent *event) return QMenu::mousePressEvent(event); } +void MenuBox::hideEvent(QHideEvent *e) +{ + Q_EMIT sendMainWinActiveSignal(true); + return QMenu::hideEvent(e); +} + diff --git a/src/UserInterface/RightClickMenu/menubox.h b/src/UserInterface/RightClickMenu/menubox.h index 8502af3..ea48961 100755 --- a/src/UserInterface/RightClickMenu/menubox.h +++ b/src/UserInterface/RightClickMenu/menubox.h @@ -12,6 +12,7 @@ public: protected: void mousePressEvent(QMouseEvent *event); + void hideEvent(QHideEvent *e) override; public: Q_SIGNALS: diff --git a/src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp b/src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp index 3dfdc5d..0143c32 100755 --- a/src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp +++ b/src/UserInterface/RightClickMenu/tabletrightclickmenu.cpp @@ -25,8 +25,7 @@ TabletRightClickMenu::TabletRightClickMenu(QWidget *parent): { QString path = QDir::homePath() + "/.config/ukui/ukui-menu.ini"; m_setting = new QSettings(path, QSettings::IniFormat); - m_cmdProc = new QProcess; - connect(m_cmdProc, &QProcess::readyReadStandardOutput, this, &TabletRightClickMenu::onReadOutput); + sprintf(m_style, "QMenu{padding-left:2px;padding-top:6px;padding-right:2px;padding-bottom:6px;border:1px solid %s;border-radius:6px;background-color:%s;}\ QMenu::item:selected{background-color:%s;border-radius:6px;}\ QMenu::separator{height:1px;background-color:%s;margin-top:2px;margin-bottom:2px;}", @@ -35,15 +34,10 @@ TabletRightClickMenu::TabletRightClickMenu(QWidget *parent): TabletRightClickMenu::~TabletRightClickMenu() { - if (m_cmdProc) { - delete m_cmdProc; - } - if (m_setting) { delete m_setting; } - m_cmdProc = nullptr; m_setting = nullptr; } @@ -185,28 +179,13 @@ void TabletRightClickMenu::addToDesktopActionTriggerSlot() void TabletRightClickMenu::uninstallActionTriggerSlot() { -// QString cmd = QString("dpkg -S " + m_desktopfp); -// myDebug() << "void TabletRightClickMenu::uninstallActionTriggerSlot()" << m_desktopfp; -// m_cmdProc->setReadChannel(QProcess::StandardOutput); -// m_cmdProc->start("sh", QStringList() << "-c" << cmd); -// m_cmdProc->waitForFinished(); -// m_cmdProc->waitForReadyRead(); -// m_cmdProc->close(); - onReadOutput(); + QString cmd = QString("kylin-uninstaller %1") + .arg(m_desktopfp.toLocal8Bit().data()); + bool ret = QProcess::startDetached(cmd); + myDebug() << "卸载:" << cmd << ret; m_actionNumber = 6; } -void TabletRightClickMenu::onReadOutput() -{ -// QString packagestr = QString::fromLocal8Bit(m_cmdProc->readAllStandardOutput().data()); -// QString packageName = packagestr.split(":").at(0); -//目前仅调用起软件商店,不传递参数 - char command[100]; -// sprintf(command, "kylin-software-center -remove %s", packageName.toLocal8Bit().data()); - sprintf(command, "kylin-software-center"); - QProcess::startDetached(command); -} - void TabletRightClickMenu::attributeActionTriggerSlot() { char command[100]; diff --git a/src/UserInterface/RightClickMenu/tabletrightclickmenu.h b/src/UserInterface/RightClickMenu/tabletrightclickmenu.h index 6fbd906..a91451c 100755 --- a/src/UserInterface/RightClickMenu/tabletrightclickmenu.h +++ b/src/UserInterface/RightClickMenu/tabletrightclickmenu.h @@ -76,8 +76,6 @@ private: char m_style[400]; - QProcess *m_cmdProc = nullptr; - protected: /** * @brief Get icon pixmap @@ -150,10 +148,6 @@ private Q_SLOTS: * @brief Personalize this list */ //void otherListActionTriggerSlot(); - /** - * @brief Read command output - */ - void onReadOutput(); }; #endif // RIGHTCLICKMENU_H diff --git a/src/UserInterface/ViewItem/itemdelegate.cpp b/src/UserInterface/ViewItem/itemdelegate.cpp index 69f6631..aa7f169 100755 --- a/src/UserInterface/ViewItem/itemdelegate.cpp +++ b/src/UserInterface/ViewItem/itemdelegate.cpp @@ -20,7 +20,7 @@ #include #include #include -#include "src/UtilityFunction/utility.h" +#include "utility.h" ItemDelegate::ItemDelegate(QObject *parent, int module): KItemDelegate(parent) @@ -58,8 +58,22 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, painter->setRenderHint(QPainter::Antialiasing); if ((option.state & QStyle::State_MouseOver) || (option.state & QStyle::State_HasFocus)) { - QColor color = option.palette.text().color(); - color.setAlphaF(0.15); + QColor color; + + if (option.state & QStyle::State_Selected) { + if (g_curStyle == "ukui-dark") { + color.setNamedColor("#33FFFFFF"); + } else { + color.setNamedColor("#D1FFFFFF"); + } + } else { + if (g_curStyle == "ukui-dark") { + color.setNamedColor("#1AFFFFFF"); + } else { + color.setNamedColor("#8CFFFFFF"); + } + } + painter->save(); painter->setPen(QPen(Qt::NoPen)); painter->setBrush(color); @@ -153,10 +167,13 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, // QRect textRect=QRect(rect.x()+11,rect.y()+12,rect.width(),rect.height()); QRect textRect = QRect(rect.x() + 11, rect.y(), rect.width(), rect.height()); painter->drawText(textRect, Qt::AlignVCenter, strlist.at(0)); - painter->setRenderHint(QPainter::Antialiasing, true); - painter->setPen(QPen(QColor(option.palette.text().color()), 1)); - painter->setOpacity(0.1); - painter->drawLine(QPoint(5, rect.bottom()), QPoint(rect.right(), rect.bottom())); + painter->setRenderHints(QPainter::SmoothPixmapTransform, true); + QPixmap pixmap = getCurIcon(":/data/img/mainviewwidget/DM-icon-option.svg", true).pixmap(QSize(16, 16)); + + if ((option.state & QStyle::State_MouseOver) || (option.state & QStyle::State_HasFocus)) { + painter->drawPixmap(rect.width() - 25, rect.y() + 15, pixmap); + } + painter->restore(); } } else if (module == -1) { @@ -279,7 +296,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, QString desktopfn = fileInfo.fileName(); if (checkIfLocked(desktopfn)) { - QIcon icon(QString(":/data/img/mainviewwidget/lock.svg")); + QIcon icon = getCurIcon(":/data/img/mainviewwidget/lock.svg", true); icon.paint(painter, QRect(rect.topRight().x() - 22, rect.y() + (rect.height() - 16) / 2, 16, 16)); } diff --git a/src/UserInterface/ViewItem/right_item_delegate.cpp b/src/UserInterface/ViewItem/right_item_delegate.cpp index c463c4a..a67a6ca 100755 --- a/src/UserInterface/ViewItem/right_item_delegate.cpp +++ b/src/UserInterface/ViewItem/right_item_delegate.cpp @@ -1,5 +1,5 @@ #include "right_item_delegate.h" -#include "src/UtilityFunction/utility.h" +#include "utility.h" #include RightItemDelegate::RightItemDelegate(QObject *parent): @@ -37,16 +37,27 @@ void RightItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt painter->setRenderHint(QPainter::Antialiasing); painter->save(); painter->setPen(QPen(Qt::NoPen)); - painter->setBrush(option.palette.base().color()); if ((option.state & QStyle::State_MouseOver) || (option.state & QStyle::State_HasFocus)) { if (option.state & QStyle::State_Selected) { - painter->setOpacity(0.8); + if (g_curStyle == "ukui-dark") { + painter->setBrush(QColor("#7A000000")); + } else { + painter->setBrush(QColor("#BFFFFFFF")); + } } else { - painter->setOpacity(0.6); + if (g_curStyle == "ukui-dark") { + painter->setBrush(QColor("#66000000")); + } else { + painter->setBrush(QColor("#99FFFFFF")); + } } } else { - painter->setOpacity(0.4); + if (g_curStyle == "ukui-dark") { + painter->setBrush(QColor("#40000000")); + } else { + painter->setBrush(QColor("#66FFFFFF")); + } } painter->drawPath(path); diff --git a/src/UserInterface/ViewItem/tablet_full_itemdelegate.cpp b/src/UserInterface/ViewItem/tablet_full_itemdelegate.cpp index 1bb5b74..58e487a 100755 --- a/src/UserInterface/ViewItem/tablet_full_itemdelegate.cpp +++ b/src/UserInterface/ViewItem/tablet_full_itemdelegate.cpp @@ -33,7 +33,6 @@ TabletFullItemDelegate::TabletFullItemDelegate(QObject *parent, int module): settt = new QSettings(pathini, QSettings::IniFormat); QString path = QDir::homePath() + "/.config/ukui/ukui-menu.ini"; setting = new QSettings(path, QSettings::IniFormat); - // qDebug() << "---------------------gengxinleziti---------------------"; } TabletFullItemDelegate::~TabletFullItemDelegate() @@ -73,11 +72,6 @@ void TabletFullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem QString appname = pUkuiMenuInterface->getAppName(desktopfp); QRect iconRect; QRect textRect; - // QString desktopfn=desktopfp.split('/').last(); - // setting->beginGroup("groupname"); - // bool iscontain=setting->contains(desktopfn); - // setting->sync(); - // setting->endGroup(); if (iconFileInfo.isFile() && (iconstr.endsWith(".png") || iconstr.endsWith(".svg"))) { icon = QIcon(iconstr); @@ -118,28 +112,27 @@ void TabletFullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem } bool bigIcon = index.data(Qt::UserRole + 2).toBool(); + int iconTopSpace = (rect.height() - Style::AppListIconSize) / 2; + int iconLeftSpace = (rect.width() - Style::AppListIconSize) / 2; if (bigIcon) { - iconRect = QRect(rect.x() + Style::AppLeftSpace - 6, //94 - rect.y() + Style::AppTopSpace - 6, //60 - Style::AppListIconSize + 12,//96 + iconRect = QRect(rect.x() + iconLeftSpace - 6, + rect.y() + iconTopSpace - 6, + Style::AppListIconSize + 12, Style::AppListIconSize + 12); textRect = QRect(rect.x(), - iconRect.bottom() /*- 3*/, + rect.bottom() - iconTopSpace, rect.width(), - rect.height() - iconRect.height() - Style::AppTopSpace - 30); - // QPixmap pixmap; - // pixmap = icon.pixmap((Style::AppListIconSize+20,Style::AppListIconSize+20));//wgx - // icon=QIcon(pixmap); + iconTopSpace); } else { - iconRect = QRect(rect.x() + Style::AppLeftSpace, - rect.y() + Style::AppTopSpace, + iconRect = QRect(rect.x() + iconLeftSpace, + rect.y() + iconTopSpace, Style::AppListIconSize, Style::AppListIconSize); textRect = QRect(rect.x(), - iconRect.bottom(), + rect.bottom() - iconTopSpace, rect.width(), - rect.height() - iconRect.height() - Style::AppTopSpace - 30); + iconTopSpace); } QString str; diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp index 04691ab..5dd8db5 100755 --- a/src/UserInterface/Widget/full_commonuse_widget.cpp +++ b/src/UserInterface/Widget/full_commonuse_widget.cpp @@ -20,6 +20,7 @@ #include #include "style.h" #include "utility.h" +#include "buriedpointdatasend.h" #include FullCommonUseWidget::FullCommonUseWidget(QWidget *parent) : @@ -131,6 +132,11 @@ void FullCommonUseWidget::initVerticalScrollBar() void FullCommonUseWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); + pointDataStruct pointData; + pointData.module = "fullWindow/commonUseWidget/powerOffButton"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullCommonUseWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) @@ -138,6 +144,11 @@ void FullCommonUseWidget::on_powerOffButton_customContextMenuRequested(const QPo RightClickMenu m_otherMenu(this); m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; + pointDataStruct pointData; + pointData.module = "fullWindow/commonUseWidget/powerOffButton"; + pointData.function = "RightClicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullCommonUseWidget::initAppListWidget() @@ -190,6 +201,12 @@ void FullCommonUseWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); + pointDataStruct pointData; + pointData.module = "fullWindow/commonUseWidget/execApplication"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + pointData.otherFunction[0] = desktopfp; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullCommonUseWidget::selectFirstItem() diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp index c3e2520..55ed6c0 100755 --- a/src/UserInterface/Widget/full_function_widget.cpp +++ b/src/UserInterface/Widget/full_function_widget.cpp @@ -23,6 +23,7 @@ #include #include #include +#include "buriedpointdatasend.h" FullFunctionWidget::FullFunctionWidget(QWidget *parent) : QWidget(parent) @@ -151,6 +152,11 @@ void FullFunctionWidget::initVerticalScrollBar() void FullFunctionWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); + pointDataStruct pointData; + pointData.module = "fullWindow/FullFunctionWidget/powerOffButton"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullFunctionWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) @@ -158,6 +164,11 @@ void FullFunctionWidget::on_powerOffButton_customContextMenuRequested(const QPoi RightClickMenu m_otherMenu(this); m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; + pointDataStruct pointData; + pointData.module = "fullWindow/FullFunctionWidget/powerOffButton"; + pointData.function = "RightClicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } @@ -218,6 +229,12 @@ void FullFunctionWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); + pointDataStruct pointData; + pointData.module = "fullWindow/FullFunctionWidget/execApplication"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + pointData.otherFunction[0] = desktopfp; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullFunctionWidget::on_setAreaScrollBarValue(int value) diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp index 5b7d21b..353cbef 100755 --- a/src/UserInterface/Widget/full_letter_widget.cpp +++ b/src/UserInterface/Widget/full_letter_widget.cpp @@ -19,6 +19,7 @@ #include "full_letter_widget.h" #include #include +#include "buriedpointdatasend.h" FullLetterWidget::FullLetterWidget(QWidget *parent) : QWidget(parent) @@ -145,6 +146,11 @@ void FullLetterWidget::initVerticalScrollBar() void FullLetterWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); + pointDataStruct pointData; + pointData.module = "fullWindow/FullLetterWidget/powerOffButton"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullLetterWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) @@ -152,6 +158,11 @@ void FullLetterWidget::on_powerOffButton_customContextMenuRequested(const QPoint RightClickMenu m_otherMenu(this); m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); qDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; + pointDataStruct pointData; + pointData.module = "fullWindow/FullLetterWidget/powerOffButton"; + pointData.function = "RightClicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullLetterWidget::setFocusToThis() @@ -222,6 +233,12 @@ void FullLetterWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); + pointDataStruct pointData; + pointData.module = "fullWindow/FullLetterWidget/execApplication"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + pointData.otherFunction[0] = desktopfp; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullLetterWidget::on_setAreaScrollBarValue(int value) diff --git a/src/UserInterface/Widget/full_searchresult_widget.cpp b/src/UserInterface/Widget/full_searchresult_widget.cpp index 3f4eff6..259986b 100755 --- a/src/UserInterface/Widget/full_searchresult_widget.cpp +++ b/src/UserInterface/Widget/full_searchresult_widget.cpp @@ -20,6 +20,7 @@ #include "style.h" #include "utility.h" #include +#include "buriedpointdatasend.h" FullSearchResultWidget::FullSearchResultWidget(QWidget *parent) : QWidget(parent) @@ -120,6 +121,11 @@ void FullSearchResultWidget::initVerticalScrollBar() void FullSearchResultWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); + pointDataStruct pointData; + pointData.module = "fullWindow/FullSearchResultWidget/powerOffButton"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullSearchResultWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) @@ -127,6 +133,11 @@ void FullSearchResultWidget::on_powerOffButton_customContextMenuRequested(const RightClickMenu m_otherMenu(this); m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; + pointDataStruct pointData; + pointData.module = "fullWindow/FullSearchResultWidget/powerOffButton"; + pointData.function = "RightClicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullSearchResultWidget::initAppListWidget() @@ -153,6 +164,12 @@ void FullSearchResultWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); + pointDataStruct pointData; + pointData.module = "fullWindow/FullLetterWidget/execApplication"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + pointData.otherFunction[0] = desktopfp; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullSearchResultWidget::updateAppListView(QVector arg) diff --git a/src/UserInterface/Widget/function_Widget.cpp b/src/UserInterface/Widget/function_Widget.cpp index efadea4..5cf1f5e 100755 --- a/src/UserInterface/Widget/function_Widget.cpp +++ b/src/UserInterface/Widget/function_Widget.cpp @@ -10,6 +10,7 @@ #include #include "currenttime_interface.h" #include "style.h" +#include "utility.h" #include #define TIME_FORMAT "org.ukui.control-center.panel.plugins" #define TIME_FORMAT_KEY "hoursystem" @@ -153,11 +154,12 @@ void FunctionWidget::initUi() this->setStyleSheet("border:0px solid #ff0000;background:transparent;"); this->setFocusPolicy(Qt::NoFocus); QVBoxLayout *mainLayout = new QVBoxLayout(this); - mainLayout->setSpacing(0); + mainLayout->setSpacing(10); + mainLayout->setContentsMargins(5, 0, 0, 0); this->setLayout(mainLayout); - //时间+搜索框 + //时间 upWidget = new QWidget(); - upWidget->setFixedSize(400, 232); + upWidget->setFixedSize(400, 96); upLayout = new QVBoxLayout(); upWidget->setLayout(upLayout); upLayout->setContentsMargins(0, 0, 0, 32); @@ -184,13 +186,6 @@ void FunctionWidget::initUi() upRightLayout->setContentsMargins(0, 0, 0, 0); upRightLayout->setSpacing(0); // upRightWidget->setStyleSheet("border-width:1px;border-style:solid;border-color:red"); - //左下 - downWidget = new QWidget; - downLayout = new QVBoxLayout(); - downWidget->setLayout(downLayout); - downWidget->setFixedSize(400, 104); - downLayout->setSpacing(0); - downLayout->setContentsMargins(0, 24, 0, 0); //左侧控件 timeLabel = new QLabel(); weekLabel = new QLabel(); @@ -205,17 +200,19 @@ void FunctionWidget::initUi() QDBusReply styleName = usrInterface->call(QString("get_current_stylename")); changeSearchBoxBackground(styleName); connect(searchEditBtn, &QPushButton::clicked, this, &FunctionWidget::obtainSearchResult); - downLayout->addWidget(searchEditBtn); upLayout->addWidget(leftUpWidget); - upLayout->addWidget(downWidget); - mainLayout->addWidget(upWidget); + mainLayout->addStretch(); + + if (g_subProjectCodeName.contains("mavis")) { + upWidget->setFixedSize(0, 0); + } else { + mainLayout->addWidget(upWidget); + } + + mainLayout->addWidget(searchEditBtn); focusPlug = new pluginwidget(this); - //加入专注模式 - // if(plugin) - // { mainLayout->addWidget(focusPlug); focusPlug->setFixedSize(400, 638); - // } mainLayout->addStretch(); leftUpLayout->addWidget(upLeftWidget); leftUpLayout->addWidget(upRightWidget); diff --git a/src/UserInterface/Widget/function_Widget.h b/src/UserInterface/Widget/function_Widget.h index 0298a62..3681c78 100755 --- a/src/UserInterface/Widget/function_Widget.h +++ b/src/UserInterface/Widget/function_Widget.h @@ -35,7 +35,6 @@ private: QGSettings *timeSetting = nullptr; QString themeName; QObject *plugin = nullptr; - AbstractInterface *app; QGraphicsDropShadowEffect *effect; QPalette palette; QTimer *myTimer = nullptr; diff --git a/src/UserInterface/Widget/function_button_widget.cpp b/src/UserInterface/Widget/function_button_widget.cpp index f23f976..cd7b8f8 100755 --- a/src/UserInterface/Widget/function_button_widget.cpp +++ b/src/UserInterface/Widget/function_button_widget.cpp @@ -48,9 +48,8 @@ void FunctionButtonWidget::initUi() { this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint); this->setAttribute(Qt::WA_StyledBackground, true); - this->resize(Style::LeftBtnWidth * 2 + 5, Style::LeftBtnHeight * 6 + 25); QGridLayout *gridLayout = new QGridLayout; - gridLayout->setContentsMargins(0, 0, 0, 0); + gridLayout->setContentsMargins(40, 80, 40, 80); gridLayout->setSpacing(5); this->setLayout(gridLayout); diff --git a/src/UserInterface/Widget/letter_button_widget.cpp b/src/UserInterface/Widget/letter_button_widget.cpp index f68a685..68e3a74 100755 --- a/src/UserInterface/Widget/letter_button_widget.cpp +++ b/src/UserInterface/Widget/letter_button_widget.cpp @@ -35,9 +35,8 @@ void LetterButtonWidget::initUi() this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint); this->setAttribute(Qt::WA_StyledBackground, true); this->setFocusPolicy(Qt::NoFocus); - this->resize(235, 366); QGridLayout *gridLayout = new QGridLayout; - gridLayout->setContentsMargins(0, 0, 0, 0); + gridLayout->setContentsMargins(35, 80, 35, 80); gridLayout->setSpacing(5); this->setLayout(gridLayout); QStringList letterlist; @@ -51,13 +50,13 @@ void LetterButtonWidget::initUi() letterlist.append("&&"); letterlist.append("#"); - for (int row = 0; row < 7; row++) { - for (int col = 0; col < 4; col++) { - if (row * 4 + col < letterlist.size()) { - LetterClassifyButton *btn = new LetterClassifyButton(this, false, letterlist.at(row * 4 + col)); + for (int row = 0; row < 6; row++) { + for (int col = 0; col < 5; col++) { + if (row * 5 + col < letterlist.size()) { + LetterClassifyButton *btn = new LetterClassifyButton(this, false, letterlist.at(row * 5 + col)); btn->setFlat(true); btn->setCheckable(false); - btn->setFixedSize(55, 48); + btn->setFixedSize(38, 38); gridLayout->addWidget(btn, row, col); connect(btn, &LetterClassifyButton::buttonClicked, this, &LetterButtonWidget::letterBtnClickedSlot); } else { diff --git a/src/UserInterface/Widget/main_view_widget.cpp b/src/UserInterface/Widget/main_view_widget.cpp index 4cf9778..8a883d8 100755 --- a/src/UserInterface/Widget/main_view_widget.cpp +++ b/src/UserInterface/Widget/main_view_widget.cpp @@ -42,9 +42,20 @@ MainViewWidget::~MainViewWidget() { } +void MainViewWidget::styleChangeSlot(const QString &style) +{ + m_curStyle = style; + + if (style == "ukui-dark") { + m_backColor.setNamedColor("#800D0D0D"); + } else { + m_backColor.setNamedColor("#94FFFFFF"); + } +} + void MainViewWidget::paintEvent(QPaintEvent *event) { - double transparency = getTransparency(); +// double transparency = getTransparency(); QRect rect = this->rect(); QPainterPath path; QPainter painter(this); @@ -60,11 +71,8 @@ void MainViewWidget::paintEvent(QPaintEvent *event) path.quadTo(rect.bottomRight(), rect.bottomRight() + QPointF(0, -radius)); path.lineTo(rect.topRight() + QPointF(0, radius)); path.quadTo(rect.topRight(), rect.topRight() + QPointF(-radius, -0)); - painter.setBrush(this->palette().base()); painter.setPen(Qt::transparent); - painter.setOpacity(transparency + 0.1); - painter.fillPath(path, this->palette().base()); - // setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon())); - // KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon())); + painter.setOpacity(0.58); + painter.fillPath(path, m_backColor); QWidget::paintEvent(event); } diff --git a/src/UserInterface/Widget/main_view_widget.h b/src/UserInterface/Widget/main_view_widget.h index 6926777..ebebf5a 100755 --- a/src/UserInterface/Widget/main_view_widget.h +++ b/src/UserInterface/Widget/main_view_widget.h @@ -55,12 +55,16 @@ protected: void paintEvent(QPaintEvent *event); public Q_SLOTS: + void styleChangeSlot(const QString &style); Q_SIGNALS: void directoryChangedSignal(); void sendDirectoryPath(); +private: + QString m_curStyle; + QColor m_backColor; }; #endif // MAINVIEWWIDGET_H diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp index 9b37d38..5e63110 100755 --- a/src/UserInterface/full_mainwindow.cpp +++ b/src/UserInterface/full_mainwindow.cpp @@ -2,7 +2,8 @@ #include #include #include -#include "src/UtilityFunction/utility.h" +#include "utility.h" +#include "buriedpointdatasend.h" FullMainWindow::FullMainWindow(QWidget *parent) : QMainWindow(parent) @@ -41,7 +42,7 @@ FullMainWindow::FullMainWindow(QWidget *parent) : queryWidLayout->setSpacing(5); m_queryWid->setLayout(queryWidLayout); char style[200]; - QPixmap pixmap = loadSvg(QString(":/data/img/mainviewwidget/search.svg"), 16); + QPixmap pixmap = loadSvg(QString(":/data/img/mainviewwidget/full-search.svg"), 16); if (QGSettings::isSchemaInstalled(QString("org.ukui.style").toLocal8Bit())) { QGSettings *gsetting = new QGSettings("org.ukui.style", QByteArray(), this); @@ -225,6 +226,11 @@ void FullMainWindow::changeStyle() void FullMainWindow::on_minPushButton_clicked() { Q_EMIT showNormalWindow(); + pointDataStruct pointData; + pointData.module = "fullWindow/minPushButton"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullMainWindow::paintEvent(QPaintEvent *event) @@ -250,6 +256,11 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) char style[200]; if (event->type() == QEvent::FocusIn) { + pointDataStruct pointData; + pointData.module = "fullWindow/Search"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); sprintf(style, "QLineEdit{border:2px solid %s;background-color:%s;border-radius:17px;color:#ffffff;}", QueryLineEditClickedBorder, QueryLineEditClickedBackground); m_lineEdit->setStyleSheet(style); @@ -425,6 +436,8 @@ void FullMainWindow::on_fullSelectMenuButton_clicked() void FullMainWindow::on_fullSelectMenuButton_triggered(QAction *arg1) { + pointDataStruct pointData; + if (arg1 == m_allAction) { m_fullStackedWidget->setCurrentIndex(0); m_fullCommonPage->repaintWidget(); @@ -434,6 +447,10 @@ void FullMainWindow::on_fullSelectMenuButton_triggered(QAction *arg1) m_allAction->setChecked(true); m_letterAction->setChecked(false); m_funcAction->setChecked(false); + pointData.module = "fullWindow/fullSelectMenuButton"; + pointData.function = "AllSelect"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_letterAction) { m_fullStackedWidget->setCurrentIndex(1); m_fullLetterPage->repaintWidget(); @@ -442,6 +459,10 @@ void FullMainWindow::on_fullSelectMenuButton_triggered(QAction *arg1) m_allAction->setChecked(false); m_letterAction->setChecked(true); m_funcAction->setChecked(false); + pointData.module = "fullWindow/fullSelectMenuButton"; + pointData.function = "letterSelect"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_funcAction) { m_fullStackedWidget->setCurrentIndex(2); m_fullFunctionPage->repaintWidget(); @@ -450,6 +471,10 @@ void FullMainWindow::on_fullSelectMenuButton_triggered(QAction *arg1) m_allAction->setChecked(false); m_letterAction->setChecked(false); m_funcAction->setChecked(true); + pointData.module = "fullWindow/fullSelectMenuButton"; + pointData.function = "FunctionSelect"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } } diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 8d7f369..ccc8fe1 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -33,6 +33,7 @@ #include #include #include +#include "buriedpointdatasend.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) @@ -49,19 +50,19 @@ MainWindow::MainWindow(QWidget *parent) : //左侧 m_viewWidget = new MainViewWidget(m_centralwidget); m_mainLeftVerticalLayout = new QVBoxLayout(m_viewWidget); - m_mainLeftVerticalLayout->setSpacing(0); - m_mainLeftVerticalLayout->setContentsMargins(8, 8, 0, 0); + m_mainLeftVerticalLayout->setSpacing(9); + m_mainLeftVerticalLayout->setContentsMargins(8, 15, 4, 0); //搜索框部分 m_topStackedWidget = new QStackedWidget(m_viewWidget); - m_topStackedWidget->setFixedHeight(48); + m_topStackedWidget->setFixedHeight(34); //搜索框收起页 m_minMenuPage = new QWidget(); - m_minMenuPage->setMinimumSize(QSize(0, 48)); + m_minMenuPage->setMinimumSize(QSize(0, 34)); m_letfTopSelectHorizontalLayout = new QHBoxLayout(m_minMenuPage); - m_letfTopSelectHorizontalLayout->setSpacing(8); - m_letfTopSelectHorizontalLayout->setContentsMargins(8, 0, 8, 12); + m_letfTopSelectHorizontalLayout->setSpacing(2); + m_letfTopSelectHorizontalLayout->setContentsMargins(8, 0, 4, 0); m_minSelectTextLabel = new QLabel(m_minMenuPage); - m_horizontalSpacer = new QSpacerItem(68, 10, QSizePolicy::Expanding, QSizePolicy::Minimum); + m_horizontalSpacer = new QSpacerItem(58, 10, QSizePolicy::Expanding, QSizePolicy::Minimum); m_searchPushButton = new QPushButton(m_minMenuPage); // m_searchPushButton->setStyleSheet(m_buttonStyle.arg("QPushButton")); m_searchPushButton->setFixedSize(QSize(26, 26)); @@ -71,20 +72,21 @@ MainWindow::MainWindow(QWidget *parent) : m_minSelectButton->setFixedSize(QSize(26, 26)); m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-all.svg", true)); m_minSelectButton->installEventFilter(this); - m_selectMenuButton = new QToolButton(m_minMenuPage); + m_selectMenuButton = new RotationLabel(m_minMenuPage); + m_selectMenuButton->installEventFilter(this); m_selectMenuButton->setStyleSheet("background: transparent;"); - m_selectMenuButton->setFixedSize(QSize(16, 26)); + m_selectMenuButton->setFixedSize(QSize(8, 26)); m_selectMenuButton->setAcceptDrops(true); - m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-arrow.svg", true)); - m_selectMenuButton->setPopupMode(QToolButton::InstantPopup); -// m_selectMenuButton->setStyleSheet(QString::fromUtf8("QToolButton::menu-indicator { image: None; }")); + m_selectMenuButton->setFocusPolicy(Qt::StrongFocus); + m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/downarrow.svg", true) + .pixmap(QSize(Style::miniIconSize, Style::miniIconSize))); //搜索框展开页 m_minSearchPage = new QWidget(); m_leftTopSearchHorizontalLayout = new QHBoxLayout(m_minSearchPage); - m_leftTopSearchHorizontalLayout->setContentsMargins(8, 0, 8, 12); + m_leftTopSearchHorizontalLayout->setContentsMargins(8, 0, 8, 0); m_lineEdit = new QLineEdit(m_minSearchPage); m_lineEdit->setMinimumSize(QSize(30, 26)); - m_lineEdit->setStyleSheet(QString::fromUtf8("border-radius: 13px; border:2px solid rgba(5, 151, 255, 1); background: transparent;")); + m_lineEdit->setStyleSheet(QString::fromUtf8("border-radius: 13px; border:1px solid rgba(5, 151, 255, 1); background: transparent;")); m_lineEdit->setFrame(false); m_lineEdit->setPlaceholderText(tr("Search")); m_cancelSearchPushButton = new QPushButton(m_minSearchPage); @@ -127,19 +129,21 @@ MainWindow::MainWindow(QWidget *parent) : //右侧窗口 m_mainRightVerticalLayout = new QVBoxLayout(); m_mainRightVerticalLayout->setSpacing(0); - m_mainRightVerticalLayout->setContentsMargins(8, 8, 8, 8); + m_mainRightVerticalLayout->setContentsMargins(8, 6, 8, 8); m_mainRightVerticalLayout_1 = new QVBoxLayout(); m_rightTopHorizontalLayout = new QHBoxLayout(); m_rightTopHorizontalLayout->setSpacing(30); m_rightTopHorizontalLayout->setContentsMargins(8, 0, 10, 0); //收藏按键 m_collectPushButton = new QLabel(m_centralwidget); + m_collectPushButton->setFocusPolicy(Qt::StrongFocus); m_collectPushButton->setFixedHeight(34); // m_collectPushButton->setFlat(true); m_collectPushButton->installEventFilter(this); //最近按键 m_recentPushButton = new QLabel(m_centralwidget); m_recentPushButton->setFixedHeight(34); + m_recentPushButton->setFocusPolicy(Qt::StrongFocus); // m_recentPushButton->setFlat(true); m_recentPushButton->installEventFilter(this); m_horizontalSpacer_3 = new QSpacerItem(332, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); @@ -160,7 +164,7 @@ MainWindow::MainWindow(QWidget *parent) : m_collectPage = new QWidget(); m_collectPage->setFixedSize(QSize(324, 480)); m_rightCollectLayout = new QVBoxLayout(m_collectPage); - m_rightCollectLayout->setContentsMargins(0, 0, 0, 0); + m_rightCollectLayout->setContentsMargins(0, 18, 0, 0); //收藏视图 m_collectListView = new RightListView(m_collectPage); m_collectListView->setFixedSize(QSize(324, 428)); @@ -182,7 +186,12 @@ MainWindow::MainWindow(QWidget *parent) : //最近视图 m_recentListView = new ListView(m_recentPage); m_recentListView->installEventFilter(this); - m_recentListView->setFixedSize(QSize(324, 470)); + m_recentListView->setFixedSize(QSize(Style::rightViewWidth, Style::rightViewHeight)); + m_recentTextlabel = new QLabel(m_recentPage); + m_recentTextlabel->setFixedSize(QSize(Style::rightViewWidth, Style::rightViewHeight)); + m_recentTextlabel->setAlignment(Qt::AlignCenter); + m_recentTextlabel->setText(QApplication::translate("MainWindow", "No recent files")); + m_rightStackedWidget->addWidget(m_collectPage); m_rightStackedWidget->addWidget(m_recentPage); m_verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); @@ -190,26 +199,30 @@ MainWindow::MainWindow(QWidget *parent) : m_rightBottomHorizontalLayout->setSizeConstraint(QLayout::SetDefaultConstraint); m_rightBottomHorizontalLayout->setContentsMargins(0, 0, 8, 0); m_horizontalSpacer_2 = new QSpacerItem(332, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + m_horizontalSpacer_4 = new QSpacerItem(10, 10, QSizePolicy::Minimum, QSizePolicy::Minimum); m_powerOffButton = new QPushButton(m_centralwidget); - m_powerOffButton->setFixedSize(QSize(24, 24)); + m_powerOffButton->setFixedSize(QSize(32, 32)); m_powerOffButton->setContextMenuPolicy(Qt::CustomContextMenu); m_powerOffButton->setIcon(QIcon(":/data/img/mainviewwidget/power.svg")); + m_powerOffButton->setIconSize(QSize(24, 24)); m_powerOffButton->setFlat(true); m_powerOffButton->installEventFilter(this); m_letfTopSelectHorizontalLayout->addWidget(m_minSelectTextLabel); m_letfTopSelectHorizontalLayout->addItem(m_horizontalSpacer); m_letfTopSelectHorizontalLayout->addWidget(m_searchPushButton); + m_letfTopSelectHorizontalLayout->addItem(m_horizontalSpacer_4); m_letfTopSelectHorizontalLayout->addWidget(m_minSelectButton); m_letfTopSelectHorizontalLayout->addWidget(m_selectMenuButton); m_leftTopSearchHorizontalLayout->addWidget(m_lineEdit); m_leftTopSearchHorizontalLayout->addWidget(m_cancelSearchPushButton); m_mainLeftVerticalLayout->addWidget(m_topStackedWidget); m_mainLeftVerticalLayout->addWidget(m_leftStackedWidget); + m_mainLeftVerticalLayout->addStretch(); m_mainRightVerticalLayout_1->addLayout(m_rightTopHorizontalLayout); - m_rightCollectLayout->addItem(m_verticalSpacer); m_rightCollectLayout->addWidget(m_collectListView); m_rightCollectLayout->addItem(m_verticalSpacer_2); m_rightRecentLayout->addWidget(m_recentListView); + m_rightRecentLayout->addWidget(m_recentTextlabel); m_mainRightVerticalLayout_1->addWidget(m_rightStackedWidget); m_rightBottomHorizontalLayout->addItem(m_horizontalSpacer_2); m_rightBottomHorizontalLayout->addWidget(m_powerOffButton); @@ -223,6 +236,8 @@ MainWindow::MainWindow(QWidget *parent) : m_minSelectButton->setText(QString()); m_selectMenuButton->setText(QString()); m_cancelSearchPushButton->setText(QString()); + QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2); + m_collectPushButton->setFont(collectFont); m_collectPushButton->setText(QApplication::translate("MainWindow", "collection", nullptr)); m_recentPushButton->setText(QApplication::translate("MainWindow", "recent", nullptr)); m_minMaxChangeButton->setToolTip(QApplication::translate("MainWindow", "Max", nullptr)); @@ -309,29 +324,50 @@ MainWindow::MainWindow(QWidget *parent) : this->hide(); this->clearFocus(); m_isFullScreen = false; + pointDataStruct pointData; + pointData.module = "mainWindow"; + pointData.function = "winHide"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (m_fullWindow->isVisible()) { m_fullWindow->hide(); m_fullWindow->clearFocus(); + pointDataStruct pointData; + pointData.module = "fullWindow"; + pointData.function = "winHide"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); m_isFullScreen = true; } else { if (!m_isFullScreen) { this->show(); + setMinWindowPos(); this->raise(); this->activateWindow(); -// m_collectPushButton->clicked(true); + pointDataStruct pointData; + pointData.module = "mainWindow"; + pointData.function = "winShow"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); on_collectPushButton_clicked(); m_viewWidget->setFocus(); } else { m_fullWindow->show(); - // fullWindow->raise(); +// fullWindow->raise(); m_fullWindow->activateWindow(); + pointDataStruct pointData; + pointData.module = "fullWindow"; + pointData.function = "winShow"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } } }); - m_maxAnimation = new QPropertyAnimation(&m_animationPage, "geometry"); - m_minAnimation = new QPropertyAnimation(&m_animationPage, "geometry"); + m_animationPage = new AnimationPage(); + m_maxAnimation = new QPropertyAnimation(m_animationPage, "geometry", this); + m_minAnimation = new QPropertyAnimation(m_animationPage, "geometry", this); connect(m_maxAnimation, &QPropertyAnimation::finished, this, &MainWindow::maxAnimationFinished); connect(m_minAnimation, &QPropertyAnimation::finished, this, &MainWindow::minAnimationFinished); connect(m_lineEdit, &QLineEdit::textChanged, this, &MainWindow::searchAppSlot); @@ -340,11 +376,14 @@ MainWindow::MainWindow(QWidget *parent) : connect(m_fullWindow, &FullMainWindow::showNormalWindow, this, &MainWindow::showNormalWindowSlot); connect(m_fullWindow, &FullMainWindow::sendUpdateOtherView, this, &MainWindow::updateMinAllView); connect(m_minSelectButton, &QToolButton::clicked, this, &MainWindow::on_minSelectButton_clicked); - connect(m_selectMenuButton, &QToolButton::triggered, this, &MainWindow::on_selectMenuButton_triggered); + connect(m_dropDownMenu, &MenuBox::triggered, this, &MainWindow::on_selectMenuButton_triggered); + connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() { + m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/downarrow.svg", true) + .pixmap(QSize(Style::miniIconSize, Style::miniIconSize))); + selectIconAnimation(false); + }); connect(m_powerOffButton, &QPushButton::customContextMenuRequested, this, &MainWindow::on_powerOffButton_customContextMenuRequested); connect(m_powerOffButton, &QPushButton::clicked, this, &MainWindow::on_powerOffButton_clicked); -// connect(m_collectPushButton, &QPushButton::clicked, this, &MainWindow::on_collectPushButton_clicked); -// connect(m_recentPushButton, &QPushButton::clicked, this, &MainWindow::on_recentPushButton_clicked); connect(m_cancelSearchPushButton, &QPushButton::clicked, this, &MainWindow::on_cancelSearchPushButton_clicked); connect(m_searchPushButton, &QPushButton::clicked, this, &MainWindow::on_searchPushButton_clicked); connect(m_minMaxChangeButton, &QPushButton::clicked, this, &MainWindow::on_minMaxChangeButton_clicked); @@ -375,7 +414,7 @@ MainWindow::MainWindow(QWidget *parent) : m_lineEdit->setParent(nullptr); m_leftTopSearchHorizontalLayout->addWidget(m_lineEdit); m_leftTopSearchHorizontalLayout->addWidget(m_cancelSearchPushButton); - m_lineEdit->setPlaceholderText("搜索应用"); + m_lineEdit->setPlaceholderText(QApplication::translate("MainWindow", "Search application")); m_fullWindow->updateView(); } @@ -399,6 +438,11 @@ MainWindow::MainWindow(QWidget *parent) : MainWindow::~MainWindow() { closeDataBase("MainThread"); + + if (m_animationPage != nullptr) { + delete m_animationPage; + m_animationPage = nullptr; + } } void MainWindow::initUi() @@ -412,25 +456,38 @@ void MainWindow::initUi() m_minAllListView->addData(m_modaldata->getMinAllData(), 0); m_minFuncListView->addData(m_modaldata->getMinFuncData(), 1); m_minLetterListView->addData(m_modaldata->getMinLetterData(), 2); - m_collectListView->addData(m_modaldata->getcollectData()); - m_recentListView->addData(m_modaldata->getRecentData(), -1); - QMenu *m_menu = new QMenu; - m_allAction = new QAction(m_menu); - m_letterAction = new QAction(m_menu); - m_funcAction = new QAction(m_menu); + + if (dataBaseIsEmpty()) { + m_collectListView->addData(m_modaldata->getPreCollectionApp()); + } else { + m_collectListView->addData(m_modaldata->getcollectData()); + } + + QVector recentFile = m_modaldata->getRecentData(); + m_recentListView->addData(recentFile , -1); + + if (recentFile.isEmpty()) { + m_recentListView->hide(); + } else { + m_recentTextlabel->hide(); + } + + m_dropDownMenu = new MenuBox(this); + m_dropDownMenu->setFixedWidth(Style::DropMenuWidth); + m_allAction = new QAction(m_dropDownMenu); + m_letterAction = new QAction(m_dropDownMenu); + m_funcAction = new QAction(m_dropDownMenu); m_allAction->setText(tr("All")); m_allAction->setCheckable(true); m_letterAction->setText(tr("Letter")); m_letterAction->setCheckable(true); m_funcAction->setText(tr("Function")); m_funcAction->setCheckable(true); - m_menu->addAction(m_allAction); - m_menu->addAction(m_letterAction); - m_menu->addAction(m_funcAction); + m_dropDownMenu->addAction(m_allAction); + m_dropDownMenu->addAction(m_letterAction); + m_dropDownMenu->addAction(m_funcAction); m_allAction->setChecked(true); - m_selectMenuButton->setMenu(m_menu); m_collectPushButton->setStyleSheet("color:#3790FA;"); -// m_collectPushButton->setStyleSheet("border: 1px solid red;"); QColor textColor = this->palette().color(QPalette::Text); QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue()); QString textColorDefault = "#" + QString::number(rgbDefault, 16); @@ -450,6 +507,7 @@ void MainWindow::initUi() connect(m_collectListView, &RightListView::sendCollectViewUpdate, this, &MainWindow::updateCollectView); connect(m_desktopWatcher, &DesktopWatcher::directoryChangedSignal, this, &MainWindow::updateView); connect(m_desktopWatcher, &DesktopWatcher::updateRecentList, this, &MainWindow::updateRecentView); + connect(this, &MainWindow::sendStyleChangeSignal, m_viewWidget, &MainViewWidget::styleChangeSlot); changeStyle(); } @@ -467,10 +525,17 @@ void MainWindow::changeStyle() if (gsetting.keys().contains(QString("styleName"))) { if (gsetting.get("style-name").toString() == "ukui-light" || gsetting.get("style-name").toString() == "ukui-default") { + g_curStyle = "ukui-light"; buttonColorDefault = "rgba(16, 23, 29, 0.06)"; buttonColorHover = "rgba(16, 23, 29, 0.12)"; buttonColorPress = "rgba(16, 23, 29, 0.17)"; + m_windowColor.setNamedColor("#C7E9EEF2"); + Q_EMIT sendStyleChangeSignal("ukui-light"); + m_powerOffButton->setStyleSheet("QPushButton {padding: 0px;}" + "QPushButton:hover {border-radius:16px; background: rgba(255, 255, 255, 0.4);}" + "QPushButton:pressed {border-radius:16px; background: rgba(255, 255, 255, 0.65);}"); } else { + g_curStyle = "ukui-dark"; buttonColor = linePe.color(QPalette::Light); QRgb rgbDefault = qRgba(buttonColor.red(), buttonColor.green(), buttonColor.blue(), 25); buttonColorDefault = "#" + QString::number(rgbDefault, 16); @@ -478,6 +543,11 @@ void MainWindow::changeStyle() buttonColorHover = "#" + QString::number(rgbHover, 16); QRgb rgbPress = qRgba(buttonColor.red(), buttonColor.green(), buttonColor.blue(), 75); buttonColorPress = "#" + QString::number(rgbPress, 16); + m_windowColor.setNamedColor("#FF383838"); + Q_EMIT sendStyleChangeSignal("ukui-dark"); + m_powerOffButton->setStyleSheet("QPushButton {padding: 0px;}" + "QPushButton:hover {border-radius:16px; background: rgba(255, 255, 255, 0.12);}" + "QPushButton:pressed {border-radius:16px; background: rgba(255, 255, 255, 0.25);}"); } } } @@ -488,10 +558,7 @@ void MainWindow::changeStyle() m_searchPushButton->setStyleSheet(m_buttonStyle.arg("QPushButton")); m_minSelectButton->setStyleSheet(m_buttonStyle.arg("QPushButton")); m_cancelSearchPushButton->setStyleSheet(m_buttonStyle.arg("QPushButton")); - m_powerOffButton->setStyleSheet("QPushButton {padding: 0px;}" - "QPushButton:hover {border-radius:12px; background: rgba(255, 255, 255, 0.2);}" - "QPushButton:pressed {border-radius:12px; background: rgba(255, 255, 255, 0.3);}"); - m_searchPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/search.svg", true)); + m_searchPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/full-search.svg", true)); QAction *lineAction = m_lineEdit->actions().at(0); if (lineAction != nullptr) { @@ -501,7 +568,7 @@ void MainWindow::changeStyle() } QAction *action = new QAction(); - action->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-icon-search.svg", true)); + action->setIcon(getCurIcon(":/data/img/mainviewwidget/full-search.svg", true)); m_lineEdit->addAction(action, QLineEdit::LeadingPosition); m_cancelSearchPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-close-2x.png", true)); @@ -533,7 +600,7 @@ void MainWindow::paintEvent(QPaintEvent *event) path.quadTo(rect.bottomRight(), rect.bottomRight() + QPointF(0, -radius)); path.lineTo(rect.topRight() + QPointF(0, radius)); path.quadTo(rect.topRight(), rect.topRight() + QPointF(-radius, -0)); - painter.setBrush(this->palette().base()); + painter.setBrush(m_windowColor); painter.setPen(Qt::transparent); painter.setOpacity(transparency); painter.drawPath(path); @@ -581,7 +648,7 @@ bool MainWindow::event(QEvent *event) if (m_minSelectButton->hasFocus()) { m_minSelectButton->click(); } else if (m_selectMenuButton->hasFocus()) { - m_selectMenuButton->click(); + QApplication::postEvent(m_selectMenuButton, new QEvent(QEvent::MouseButtonPress)); } if (m_lineEdit->hasFocus()) { @@ -603,6 +670,7 @@ bool MainWindow::event(QEvent *event) void MainWindow::minAnimationFinished() { this->show(); + setMinWindowPos(); this->raise(); this->activateWindow(); m_viewWidget->setFocus(); @@ -611,8 +679,16 @@ void MainWindow::minAnimationFinished() QEventLoop loop; QTimer::singleShot(100, &loop, SLOT(quit())); loop.exec(); - m_animationPage.hide(); + m_animationPage->hide(); } + +void MainWindow::iconAnimationFinished() +{ + m_dropDownMenu->raise(); + m_dropDownMenu->exec(m_selectMenuButton->mapToGlobal(QPoint(m_selectMenuButton->width() + -Style::DropMenuWidth + 5, 29))); +} + void MainWindow::maxAnimationFinished() { m_fullWindow->raise(); @@ -621,7 +697,7 @@ void MainWindow::maxAnimationFinished() QEventLoop loop; QTimer::singleShot(100, &loop, SLOT(quit())); loop.exec(); - m_animationPage.hide(); + m_animationPage->hide(); } void MainWindow::resetLetterPage() { @@ -725,6 +801,9 @@ void MainWindow::animationFinishedSLot() } void MainWindow::on_minSelectButton_clicked() { +// selectIconAnimation(true); + selectIconAnimation(false); + if (m_leftStackedWidget->currentIndex() == 0) { on_selectMenuButton_triggered(m_letterAction); } else if (m_leftStackedWidget->currentIndex() == 1) { @@ -733,6 +812,30 @@ void MainWindow::on_minSelectButton_clicked() on_selectMenuButton_triggered(m_allAction); } } + +void MainWindow::selectIconAnimation(const bool &flag) +{ + iconAnimation = new QPropertyAnimation(m_selectMenuButton, "rotation", this); + + if (flag) { + connect(iconAnimation, &QPropertyAnimation::finished, this, &MainWindow::iconAnimationFinished); + + if (m_selectMenuButton->property("rotation") == 0) { + iconAnimation->setStartValue(0); + iconAnimation->setEndValue(-180); + } + } else { + if (m_selectMenuButton->property("rotation") == -180) { + iconAnimation->setStartValue(-180); + iconAnimation->setEndValue(0); + } + } + + iconAnimation->setEasingCurve(QEasingCurve::Linear); + iconAnimation->setDuration(300); + iconAnimation->start(QPropertyAnimation::DeleteWhenStopped); +} + bool MainWindow::eventFilter(QObject *target, QEvent *event) { if (event->type() == QEvent::MouseButtonPress) { @@ -745,6 +848,12 @@ bool MainWindow::eventFilter(QObject *target, QEvent *event) on_collectPushButton_clicked(); return false; } + + if (target == m_selectMenuButton) { + m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/downarrow.svg", true) + .pixmap(QSize(Style::miniIconSize, Style::miniIconSize))); + selectIconAnimation(true); + } } if (event->type() == QEvent::KeyPress) { @@ -929,17 +1038,22 @@ void MainWindow::searchAppSlot(QString arg) } void MainWindow::on_selectMenuButton_triggered(QAction *arg1) { - qDebug() << "void MainWindow::on_selectMenuButton_triggered(QAction *arg1)" << m_allAction << arg1; + pointDataStruct pointData; + m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/downarrow.svg", true).pixmap(QSize(Style::miniIconSize, Style::miniIconSize))); + selectIconAnimation(false); if (arg1 == m_allAction) { m_leftStackedWidget->setCurrentIndex(0); m_state = 0; m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-all.svg", true)); -// m_minSelectButton->setIcon(QIcon(":/data/img/mainviewwidget/DM-all.svg")); m_minSelectTextLabel->setText(tr("All")); m_allAction->setChecked(true); m_letterAction->setChecked(false); m_funcAction->setChecked(false); + pointData.module = "mainWindow/selectMenuButton"; + pointData.function = "AllSelect"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_letterAction) { m_leftStackedWidget->setCurrentIndex(1); m_state = 1; @@ -948,6 +1062,10 @@ void MainWindow::on_selectMenuButton_triggered(QAction *arg1) m_allAction->setChecked(false); m_letterAction->setChecked(true); m_funcAction->setChecked(false); + pointData.module = "mainWindow/selectMenuButton"; + pointData.function = "LetterSelect"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_funcAction) { m_leftStackedWidget->setCurrentIndex(2); m_state = 2; @@ -956,6 +1074,10 @@ void MainWindow::on_selectMenuButton_triggered(QAction *arg1) m_allAction->setChecked(false); m_letterAction->setChecked(false); m_funcAction->setChecked(true); + pointData.module = "mainWindow/selectMenuButton"; + pointData.function = "FunctionSelect"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } } void MainWindow::updateCollectView() @@ -971,7 +1093,15 @@ void MainWindow::updateMinAllView() void MainWindow::updateRecentView() { m_modaldata->loadDesktopVercor(); - m_recentListView->updateData(m_modaldata->getRecentData()); + QVector recentFile = m_modaldata->getRecentData(); + if (recentFile.isEmpty()) { + m_recentListView->hide(); + m_recentTextlabel->show(); + } else { + m_recentTextlabel->hide(); + m_recentListView->show(); + m_recentListView->updateData(recentFile); + } } void MainWindow::updateView() { @@ -993,15 +1123,26 @@ void MainWindow::databaseThreadCloseSlot() m_softwareDbThread->quit(); updateView(); } + void MainWindow::on_collectPushButton_clicked() { m_rightStackedWidget->setCurrentIndex(0); + pointDataStruct pointData; + pointData.module = "mainWindow/collectPushButton"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + m_collectPushButton->setStyleSheet("color:#3790FA;"); + QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2); + m_collectPushButton->setFont(collectFont); QColor textColor = this->palette().color(QPalette::Text); QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue()); QString textColorDefault = "#" + QString::number(rgbDefault, 16); m_recentPushButton->setStyleSheet(QString("color:%1;").arg(textColorDefault)); + QFont recentFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize()); + m_recentPushButton->setFont(recentFont); } + void MainWindow::on_recentPushButton_clicked() { m_rightStackedWidget->setCurrentIndex(1); @@ -1009,27 +1150,52 @@ void MainWindow::on_recentPushButton_clicked() QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue()); QString textColorDefault = "#" + QString::number(rgbDefault, 16); m_collectPushButton->setStyleSheet(QString("color:%1").arg(textColorDefault)); -// m_collectPushButton->setStyleSheet("color:white"); + QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize()); + m_collectPushButton->setFont(collectFont); m_recentPushButton->setStyleSheet("color:#3790FA"); + + pointDataStruct pointData; + pointData.module = "mainWindow/recentPushButton"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + + QFont recentFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2); + m_recentPushButton->setFont(recentFont); + updateRecentView(); } void MainWindow::on_cancelSearchPushButton_clicked() { m_topStackedWidget->setCurrentIndex(0); m_lineEdit->clear(); + pointDataStruct pointData; + pointData.module = "mainWindow/cancelSearchPushButton"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::on_searchPushButton_clicked() { m_topStackedWidget->setCurrentIndex(1); m_lineEdit->setFocus(); + pointDataStruct pointData; + pointData.module = "mainWindow/searchPushButton"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::on_minMaxChangeButton_clicked() { m_canHide = true; m_isFullScreen = true; - m_animationPage.setGeometry(this->x(), this->y(), Style::minw, Style::minh); - m_animationPage.show(); - m_animationPage.raise(); - m_animationPage.repaint(); + + m_animationPage->show(); + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(this->x(), this->y(), Style::minw, Style::minh)); + } else { + m_animationPage->setGeometry(this->x(), this->y(), Style::minw, Style::minh); + } + m_animationPage->raise(); + m_animationPage->repaint(); QEventLoop loop; QTimer::singleShot(100, &loop, SLOT(quit())); loop.exec(); @@ -1040,6 +1206,11 @@ void MainWindow::on_minMaxChangeButton_clicked() m_maxAnimation->setDuration(260); m_maxAnimation->start(); this->hide(); + pointDataStruct pointData; + pointData.module = "mainWindow/minMaxChangeButton"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::showWindow() { @@ -1047,13 +1218,24 @@ void MainWindow::showWindow() m_fullWindow->raise(); m_fullWindow->showNormal(); m_fullWindow->activateWindow(); + pointDataStruct pointData; + pointData.module = "fullWindow"; + pointData.function = "Show"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } else { this->raise(); this->showNormal(); + setMinWindowPos(); this->activateWindow(); // m_collectPushButton->clicked(true); on_collectPushButton_clicked(); m_viewWidget->setFocus(); + pointDataStruct pointData; + pointData.module = "mainWindow"; + pointData.function = "Show"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } } void MainWindow::hideWindow() @@ -1062,16 +1244,25 @@ void MainWindow::hideWindow() m_fullWindow->hide(); this->clearFocus(); m_isFullScreen = true; + pointDataStruct pointData; + pointData.module = "fullWindow"; + pointData.function = "Hide"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } else { this->hide(); this->clearFocus(); m_isFullScreen = false; + pointDataStruct pointData; + pointData.module = "mainWindow"; + pointData.function = "Hide"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } } -void MainWindow::repaintWidget() + +void MainWindow::setMinWindowPos() { - Style::initWidStyle(); - this->setMinimumSize(Style::minw, Style::minh); int position = Style::m_panelPosition; int x = Style::m_primaryScreenX; int y = Style::m_primaryScreenY; @@ -1079,15 +1270,41 @@ void MainWindow::repaintWidget() int height = Style::m_availableScreenHeight; if (position == 0) { - this->setGeometry(QRect(x + 4, y + height - Style::minh - 3, Style::minw, Style::minh)); + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + 4, y + height - Style::minh - 3, Style::minw, Style::minh)); + } else { + this->setGeometry(QRect(x + 4, y + height - Style::minh - 3, Style::minw, Style::minh)); + } } else if (position == 1) { - this->setGeometry(QRect(x + 4, y + 4, Style::minw, Style::minh)); + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + 4, y + 4, Style::minw, Style::minh)); + } else { + this->setGeometry(QRect(x + 4, y + 4, Style::minw, Style::minh)); + } } else if (position == 2) { - this->setGeometry(QRect(x + 4, y + 4, Style::minw, Style::minh)); + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + 4, y + 4, Style::minw, Style::minh)); + } else { + this->setGeometry(QRect(x + 4, y + 4, Style::minw, Style::minh)); + } } else { - this->setGeometry(QRect(x + width - Style::minw - 4, y + 4, Style::minw, Style::minh)); + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + width - Style::minw - 4, y + 4, Style::minw, Style::minh)); + } else { + this->setGeometry(QRect(x + width - Style::minw - 4, y + 4, Style::minw, Style::minh)); + } } +} +void MainWindow::repaintWidget() +{ + Style::initWidStyle(); + this->setMinimumSize(Style::minw, Style::minh); + int x = Style::m_primaryScreenX; + int y = Style::m_primaryScreenY; + int width = Style::m_availableScreenWidth; + int height = Style::m_availableScreenHeight; + setMinWindowPos(); m_fullWindow->move(x, y); m_fullWindow->setFixedSize(width, height); m_fullWindow->repaintWidget(); @@ -1095,10 +1312,14 @@ void MainWindow::repaintWidget() void MainWindow::showNormalWindowSlot() { myDebug() << "Style::m_availableScreenWidth" << Style::m_availableScreenWidth << "Style::m_availableScreenHeight" << Style::m_availableScreenHeight; - m_animationPage.setGeometry(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight); - m_animationPage.show(); - m_animationPage.raise(); - myDebug() << m_animationPage.rect(); + m_animationPage->show(); + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight)); + } else { + m_animationPage->setGeometry(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight); + } + m_animationPage->raise(); + myDebug() << m_animationPage->rect(); QEventLoop loop; QTimer::singleShot(100, &loop, SLOT(quit())); loop.exec(); @@ -1113,10 +1334,20 @@ void MainWindow::showNormalWindowSlot() void MainWindow::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); + pointDataStruct pointData; + pointData.module = "mainWindow/powerOffButton"; + pointData.function = "Clicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::on_powerOffButton_customContextMenuRequested(const QPoint &pos) { RightClickMenu m_otherMenu(this); m_otherMenu.showShutdownMenu(this->mapToGlobal(m_centralwidget->rect().bottomRight())); + pointDataStruct pointData; + pointData.module = "mainWindow/powerOffButton"; + pointData.function = "RightClicked"; + pointData.functionNum = ""; + BuriedPointDataSend::getInstance()->setPoint(pointData); qDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; } diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h index b551565..9c1bcad 100755 --- a/src/UserInterface/mainwindow.h +++ b/src/UserInterface/mainwindow.h @@ -53,6 +53,9 @@ #include "function_button_widget.h" #include "letter_button_widget.h" #include "animationpage.h" +#include "rotationlabel.h" +#include "ukuistylehelper/ukuistylehelper.h" +#include "windowmanager/windowmanager.h" class MainWindow : public QMainWindow { @@ -100,12 +103,17 @@ protected: // void mouseReleaseEvent(QMouseEvent *event); + void selectIconAnimation(const bool &flag); + + void setMinWindowPos(); + public: Q_SIGNALS: void sendSearchKeyword(QString arg); void sendClassificationbtnList(); void sendLetterClassificationList(QStringList list); void sendSetFullWindowItemHide(bool flag); + void sendStyleChangeSignal(QString style); public Q_SLOTS: void updateCollectView(); @@ -122,6 +130,7 @@ public Q_SLOTS: void resetFunctionPage(); void minAnimationFinished(); void maxAnimationFinished(); + void iconAnimationFinished(); void changeStyle(); private Q_SLOTS: void on_selectMenuButton_triggered(QAction *arg1); @@ -160,7 +169,7 @@ private: QSpacerItem *m_horizontalSpacer = nullptr; QPushButton *m_searchPushButton = nullptr; QPushButton *m_minSelectButton = nullptr; - QToolButton *m_selectMenuButton = nullptr; + RotationLabel *m_selectMenuButton = nullptr; QWidget *m_minSearchPage = nullptr; QHBoxLayout *m_leftTopSearchHorizontalLayout = nullptr; QLineEdit *m_lineEdit = nullptr; @@ -189,11 +198,14 @@ private: RightListView *m_collectListView = nullptr; QWidget *m_recentPage = nullptr; ListView *m_recentListView = nullptr; + QLabel *m_recentTextlabel = nullptr; QSpacerItem *m_verticalSpacer_2 = nullptr; QHBoxLayout *m_rightBottomHorizontalLayout = nullptr; QSpacerItem *m_horizontalSpacer_2 = nullptr; + QSpacerItem *m_horizontalSpacer_4 = nullptr; QPushButton *m_powerOffButton = nullptr; - AnimationPage m_animationPage; + AnimationPage *m_animationPage = nullptr; + MenuBox *m_dropDownMenu = nullptr; bool m_canHide = true; bool m_isFullScreen = false; @@ -214,10 +226,12 @@ private: QPropertyAnimation *m_leaveAnimation = nullptr; QPropertyAnimation *m_minAnimation = nullptr; QPropertyAnimation *m_maxAnimation = nullptr; + QPropertyAnimation *iconAnimation = nullptr; int m_widgetState = -1; FunctionButtonWidget *m_functionBtnWid = nullptr; LetterButtonWidget *m_letterBtnWid = nullptr; SoftwareDatabaseUpdateThread *m_softwareDbThread = nullptr; + QColor m_windowColor; }; #endif // MAINWINDOW_H diff --git a/src/UserInterface/tabletwindow.cpp b/src/UserInterface/tabletwindow.cpp index 45f3152..4f26924 100755 --- a/src/UserInterface/tabletwindow.cpp +++ b/src/UserInterface/tabletwindow.cpp @@ -98,28 +98,6 @@ void TabletWindow::initUi() initStatusManager(); initTransparency(); registDbusService(); - /*//备用待窗管修改后启用 - connect(m_dbus, &DBus::winKeyResponseSignal, this, [ = ] { - if (QGSettings::isSchemaInstalled(QString("org.ukui.session").toLocal8Bit())) - { - QGSettings gsetting(QString("org.ukui.session").toLocal8Bit()); - if (gsetting.keys().contains("winKeyRelease")) { - if (gsetting.get(QString("winKeyRelease")).toBool()) { - return; - } - } - } - if (QApplication::activeWindow() == this) - { - myDebug() << "win键触发窗口隐藏事件"; - this->hide(); - } else - { - myDebug() << "win键触发窗口显示事件"; - this->showPCMenu(); - } - }); - */ ways(); buttonWidgetShow(); connect(m_leftWidget, &FunctionWidget::hideTabletWindow, this, &TabletWindow::recvHideMainWindowSlot); @@ -232,15 +210,13 @@ void TabletWindow::setBackground() void TabletWindow::registDbusService() { - m_dbus = new DBus; - new MenuAdaptor(m_dbus); - QDBusConnection con = QDBusConnection::sessionBus(); - - if (!con.registerService("org.ukui.menu") || - !con.registerObject("/org/ukui/menu", m_dbus)) { - qDebug() << "error:" << con.lastError().message(); - } - +// m_dbus = new DBus; +// new MenuAdaptor(m_dbus); +// QDBusConnection con = QDBusConnection::sessionBus(); +// if (!con.registerService("org.ukui.menu") || +// !con.registerObject("/org/ukui/menu", m_dbus)) { +// qDebug() << "error:" << con.lastError().message(); +// } // connect(m_dbus, &DBus::winKeyResponseSignal, this, [ = ] { // if (QGSettings::isSchemaInstalled(QString("org.ukui.session").toLocal8Bit())) // { @@ -261,21 +237,6 @@ void TabletWindow::registDbusService() // this->showPCMenu(); // } // }); - ways(); - buttonWidgetShow(); -// connect(this,&TabletWindow::pagenumchanged,this,&TabletWindow::pageNumberChanged); - connect(m_leftWidget, &FunctionWidget::hideTabletWindow, this, &TabletWindow::recvHideMainWindowSlot); - - if (checkapplist()) { - directoryChangedSlot();//更新应用列表 - } - - //pc下鼠标功能 - XEventMonitor::instance()->start(); - connect(XEventMonitor::instance(), SIGNAL(keyRelease(QString)), - this, SLOT(XkbEventsRelease(QString))); - connect(XEventMonitor::instance(), SIGNAL(keyPress(QString)), - this, SLOT(XkbEventsPress(QString))); } bool TabletWindow::checkapplist() @@ -413,6 +374,8 @@ void TabletWindow::showPCMenu() this->raise(); this->activateWindow(); g_menuStatus = true; + menuStatusChange(); + myDebug() << "showMenu显示开始菜单"; } //改变搜索框及工具栏透明度 @@ -560,9 +523,10 @@ bool TabletWindow::event(QEvent *event) //if(QEvent::WindowDeactivate == event->type())//窗口停用 { if (QApplication::activeWindow() != this) { - qDebug() << " * 鼠标点击窗口外部事件"; + myDebug() << " * 鼠标点击窗口外部事件"; this->hide(); g_menuStatus = false; + menuStatusChange(); } } @@ -576,6 +540,7 @@ bool TabletWindow::event(QEvent *event) if (!(m_scrollAnimation->state() == QPropertyAnimation::Running)) { this->hide(); g_menuStatus = false; + myDebug() << "鼠标点击事件触发隐藏"; } } @@ -642,65 +607,71 @@ void TabletWindow::insertAppList(QStringList desktopfplist) */ void TabletWindow::execApplication(QString desktopfp) { -// Q_EMIT sendHideMainWindowSignal(); -// execApp(desktopfp); - QString str; - //打开文件.desktop - GError **error = nullptr; - GKeyFileFlags flags = G_KEY_FILE_NONE; - GKeyFile *keyfile = g_key_file_new(); - QByteArray fpbyte = desktopfp.toLocal8Bit(); - char *filepath = fpbyte.data(); - g_key_file_load_from_file(keyfile, filepath, flags, error); - char *name = g_key_file_get_locale_string(keyfile, "Desktop Entry", "Exec", nullptr, nullptr); - //取出value值 - QString execnamestr = QString::fromLocal8Bit(name); - str = execnamestr; - //qDebug()<<"2 exec"<beginGroup("application"); - QString desktopfp1 = str; - //判断 - bool bo = m_disableAppSet->contains(desktopfp1.toLocal8Bit().data()); // iskey - bool bo1 = m_disableAppSet->QSettings::value(desktopfp1.toLocal8Bit().data()).toBool(); //isvalue - m_disableAppSet->endGroup(); + Q_EMIT sendHideMainWindowSignal(); + QDBusInterface iface("com.kylin.AppManager", + "/com/kylin/AppManager", + "com.kylin.AppManager", + QDBusConnection::sessionBus()); - if (bo && bo1 == false) { //都存在//存在并且为false,从filepathlist中去掉 - //qDebug()<<"bool"<(iface.call("LaunchApp", desktopfp)))) { + execApp(desktopfp); + QString str; + //打开文件.desktop + GError **error = nullptr; + GKeyFileFlags flags = G_KEY_FILE_NONE; + GKeyFile *keyfile = g_key_file_new(); + QByteArray fpbyte = desktopfp.toLocal8Bit(); + char *filepath = fpbyte.data(); + g_key_file_load_from_file(keyfile, filepath, flags, error); + char *name = g_key_file_get_locale_string(keyfile, "Desktop Entry", "Exec", nullptr, nullptr); + //取出value值 + QString execnamestr = QString::fromLocal8Bit(name); + str = execnamestr; + //qDebug()<<"2 exec"<beginGroup("application"); + QString desktopfp1 = str; + //判断 + bool bo = m_disableAppSet->contains(desktopfp1.toLocal8Bit().data()); // iskey + bool bo1 = m_disableAppSet->QSettings::value(desktopfp1.toLocal8Bit().data()).toBool(); //isvalue + m_disableAppSet->endGroup(); - QString exe = execnamestr; - QStringList parameters; + if (bo && bo1 == false) { //都存在//存在并且为false,从filepathlist中去掉 + //qDebug()<<"bool"<setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); this->hide(); g_menuStatus = false; + myDebug() << "信号触发隐藏窗口"; } void TabletWindow::btnGroupClickedSlot(int prePageNum, int pageNum) @@ -1080,7 +1052,7 @@ void TabletWindow::winKeyReleaseSlot(const QString &key) if (QGSettings::isSchemaInstalled(QString("org.ukui.session").toLocal8Bit())) { QGSettings gsetting(QString("org.ukui.session").toLocal8Bit()); - if (gsetting.keys().contains("winKeyRelease")) + if (gsetting.keys().contains("winKeyRelease")) { if (gsetting.get(QString("winKeyRelease")).toBool()) { disconnect(XEventMonitor::instance(), SIGNAL(keyRelease(QString)), this, SLOT(xkbEventsRelease(QString))); @@ -1092,7 +1064,16 @@ void TabletWindow::winKeyReleaseSlot(const QString &key) connect(XEventMonitor::instance(), SIGNAL(keyPress(QString)), this, SLOT(xkbEventsPress(QString))); } + } } } } +void TabletWindow::menuStatusChange() +{ + QDBusMessage message = QDBusMessage::createSignal("/com/ukui/menu", "com.ukui.menu", "statusChangeSignal"); + //给信号赋值 + message << g_menuStatus; + //发射 + QDBusConnection::sessionBus().send(message); +} diff --git a/src/UserInterface/tabletwindow.h b/src/UserInterface/tabletwindow.h index efb1a2d..7b6a03d 100755 --- a/src/UserInterface/tabletwindow.h +++ b/src/UserInterface/tabletwindow.h @@ -46,8 +46,6 @@ #include "tabletlistview.h" #include "pagemanager.h" #include "tablet_directorychanged_thread.h" -#include "dbus.h" -#include "dbus-adaptor.h" class TabletWindow : public QWidget { @@ -123,8 +121,9 @@ private: QFileSystemWatcher *m_configFileWatcher = nullptr; TabletDirectoryChangedThread *m_directoryChangedThread = nullptr; QSettings *m_disableAppSet = nullptr; - DBus *m_dbus = nullptr; + QLabel m_animationPage; +// DBus *m_dbus = nullptr; protected: /** @@ -183,6 +182,8 @@ protected: bool checkapplist(); + void menuStatusChange(); + public Q_SLOTS: /** * @brief Open the application diff --git a/src/UserInterface/userinterface.pri b/src/UserInterface/userinterface.pri index 1bc7ffe..56b58f8 100755 --- a/src/UserInterface/userinterface.pri +++ b/src/UserInterface/userinterface.pri @@ -18,6 +18,7 @@ HEADERS += \ $$PWD/ListView/tabletlistview.h \ $$PWD/Other/classify_btn_scrollarea.h \ $$PWD/Other/lettertooltip.h \ + $$PWD/Other/rotationlabel.h \ $$PWD/Other/scrollarea.h \ $$PWD/RightClickMenu/menubox.h \ $$PWD/RightClickMenu/rightclickmenu.h \ @@ -55,6 +56,7 @@ SOURCES += \ $$PWD/ListView/tabletlistview.cpp \ $$PWD/Other/classify_btn_scrollarea.cpp \ $$PWD/Other/lettertooltip.cpp \ + $$PWD/Other/rotationlabel.cpp \ $$PWD/Other/scrollarea.cpp \ $$PWD/RightClickMenu/menubox.cpp \ $$PWD/RightClickMenu/rightclickmenu.cpp \ diff --git a/src/UtilityFunction/Style/style.cpp b/src/UtilityFunction/Style/style.cpp index dcc3831..a7ea91a 100755 --- a/src/UtilityFunction/Style/style.cpp +++ b/src/UtilityFunction/Style/style.cpp @@ -76,6 +76,8 @@ int Style::SideBarWidWidth = 0; int Style::appLine = 0; int Style::appColumn = 0; +int Style::appLineFirst = 0; +int Style::appColumnFirst = 0; int Style::appPage = 1; int Style::appNum = 0; int Style::nowpagenum = 1; @@ -100,6 +102,13 @@ int Style::ButtonWidgetWidth = 56; int Style::ToolWidgetLeft = 24; bool Style::IsWideScreen = false; +int Style::DropMenuWidth = 0; +int Style::DropMenuHeight = 0; +int Style::miniIconSize = 0; + +int Style::rightViewWidth = 0; +int Style::rightViewHeight = 0; + void Style::initWidStyle() { if (!g_projectCodeName.contains("V10SP1-edu")) { @@ -121,10 +130,12 @@ void Style::initWidStyle() if (m_availableScreenWidth == 800 && m_availableScreenHeight == 600) { minw = 320; minh = 500; + leftPageWidth = 300; + leftPageHeight = 517; } else { minw = 652; minh = 590; - leftPageWidth = 292; + leftPageWidth = 300; leftPageHeight = 517; } @@ -194,11 +205,16 @@ void Style::initWidStyle() AppSpaceBetweenIconText = 14; } - LeftBtnWidth = 100 + 5 * len; - LeftBtnHeight = 43; + LeftBtnWidth = 68 + 5 * len; + LeftBtnHeight = 34; QueryLineEditHeight = 30; LeftLetterBtnHeight = 25; LeftIconSize = 19; + DropMenuWidth = 140; + DropMenuHeight = 112; + miniIconSize = 8; + rightViewWidth = 324; + rightViewHeight = 470; LeftSpaceIconText = 14; m_applistWidWidth = m_availableScreenWidth / 1.25; m_applistWidWidth = m_applistWidWidth - (m_applistWidWidth % m_applistGridSizeWidth) + 1; @@ -208,23 +224,25 @@ void Style::initWidStyle() } else { ScreenWidth = QApplication::primaryScreen()->geometry().width(); ScreenHeight = QApplication::primaryScreen()->geometry().height(); - - if (ScreenHeight != 1080) { - AppListViewTopMargin = 30; - } else { - AppListViewTopMargin = 70; - } - + myDebug() << "Winches" << qApp->desktop()->widthMM(); + myDebug() << "Hinches" << qApp->desktop()->heightMM(); + myDebug() << "ScreenWidth" << ScreenWidth; + myDebug() << "ScreenHeight" << ScreenHeight; + appColumn = 6; + appLine = 4; + appLineFirst = 4; + AppListViewTopMargin = 70; AppListViewLeftMargin = 52; AppListViewBottomMargin = AppListViewTopMargin - 30; AppListViewRightMargin = 0; m_leftWidWidth = ScreenWidth * 0.3; FirsPageViewWidth = ScreenWidth - m_leftWidWidth - 5; + appColumnFirst = FirsPageViewWidth / 220; OtherPageViewWidth = ScreenWidth; - TabletItemSizeWidthFirst = FirsPageViewWidth / 6; - TabletItemSizeWidthOther = (ScreenWidth - 5) / 6; + TabletItemSizeWidthFirst = FirsPageViewWidth / appColumnFirst; + TabletItemSizeWidthOther = (ScreenWidth - 5) / appColumn; CenterWindHeight = ScreenHeight - AppListViewBottomMargin - AppListViewTopMargin; - AppListItemSizeHeight = CenterWindHeight / 4; + AppListItemSizeHeight = CenterWindHeight / appLine; AppListIconSize = 96; AppListBigIconSize = 108; AppTopSpace = (AppListItemSizeHeight - AppListIconSize) / 2; diff --git a/src/UtilityFunction/Style/style.h b/src/UtilityFunction/Style/style.h index 09ab7dd..a74e0da 100755 --- a/src/UtilityFunction/Style/style.h +++ b/src/UtilityFunction/Style/style.h @@ -133,6 +133,8 @@ public: static int appLine; static int appColumn; + static int appLineFirst; + static int appColumnFirst; static int appNum; static int appPage; static int nowpagenum; @@ -169,7 +171,12 @@ public: static int WideAppListItemSizeHeight; static int WideAppViewLeftMargin; static bool IsWideScreen; + static int DropMenuWidth; + static int DropMenuHeight; + static int miniIconSize; + static int rightViewWidth; + static int rightViewHeight; }; diff --git a/src/UtilityFunction/abstractInterface.h b/src/UtilityFunction/abstractInterface.h index 255507a..f484d73 100755 --- a/src/UtilityFunction/abstractInterface.h +++ b/src/UtilityFunction/abstractInterface.h @@ -17,4 +17,4 @@ public: virtual QWidget *createWidget(QWidget *parent) = 0; }; Q_DECLARE_INTERFACE(kyMenuPluginInterface, "org.kyMenuPlugin.AbstractInterface") -#endif +#endif \ No newline at end of file diff --git a/src/UtilityFunction/utility.cpp b/src/UtilityFunction/utility.cpp index c7e4521..3eee325 100755 --- a/src/UtilityFunction/utility.cpp +++ b/src/UtilityFunction/utility.cpp @@ -28,10 +28,14 @@ #include #include #include +#include "ukuimenuinterface.h" #define DATABASENAME QDir::homePath()+"/.config/ukui/"+"UkuiMenu.db" QString g_projectCodeName = "V10SP1"; +QString g_subProjectCodeName = ""; +QString g_platform = ""; bool g_menuStatus = false; +QString g_curStyle = ""; const QPixmap loadSvg(const QString &fileName, const int size) { @@ -370,6 +374,27 @@ bool updateDataBaseTableTimes(QString desktopfn) return ret; } +bool dataBaseIsEmpty() +{ + QSqlDatabase db = QSqlDatabase::database("MainThreadDataBase"); + QSqlQuery sql(db); + QString cmd; + cmd = QString("select * from appInfo"); + if (sql.exec(cmd)) { + if (!sql.next()) { + return true; + } else { + if (sql.value(0).toString() == "") { + return true; + } else { + return false; + } + } + return false; + } + return false; +} + bool updateDataBaseCollect(QString desktopfn, int type) { bool ret = false; diff --git a/src/UtilityFunction/utility.h b/src/UtilityFunction/utility.h index 75c43e7..9d5f7a9 100755 --- a/src/UtilityFunction/utility.h +++ b/src/UtilityFunction/utility.h @@ -25,7 +25,6 @@ #include #include #include -#include "ukuimenuinterface.h" #define DBUS_NAME "org.ukui.panel" #define DBUS_PATH "/panel/position" @@ -33,6 +32,26 @@ #define myDebug() qDebug() << QString("%1 %2 行 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__) +typedef struct pointDataStruct { + QString module; + QString function; + QString functionNum; + QStringList otherFunction; + QString errorLevel; + QString errorOutput; + QString timeStamp; + pointDataStruct() + { + module = QString(); + function = QString(); + functionNum = QString(); + otherFunction = QStringList(); + errorLevel = QString(); + errorOutput = QString(); + timeStamp = QString(); + } +} pointDataStruct; + static int collectCount = 0; const QPixmap loadSvg(const QString &fileName, const int size); @@ -60,6 +79,7 @@ bool checkIfRecent(QString desktopfn);//检查是否最近安装 bool checkIfCollected(QString desktopfn); QStringList getCollectAppList(); void changeCollectSort(QString dragDesktopfn, QString dropDesktopfn); +bool dataBaseIsEmpty();//判断数据库是否为空 bool updateDataBaseCollect(QString desktopfn, int type); QStringList getLockAppList();//获取被锁定应用 QStringList getUnlockAllList();//获取未被锁定应用 @@ -86,7 +106,10 @@ enum PanelPositon { }; extern QString g_projectCodeName; +extern QString g_subProjectCodeName; +extern QString g_platform; extern bool g_menuStatus; +extern QString g_curStyle; #endif // UTILITY_H diff --git a/translations/ukui-menu_bo.ts b/translations/ukui-menu_bo.ts index 1b61e67..85e856d 100755 --- a/translations/ukui-menu_bo.ts +++ b/translations/ukui-menu_bo.ts @@ -4,22 +4,22 @@ FullMainWindow - + Search - + All - + Letter - + Function @@ -27,7 +27,7 @@ FunctionWidget - + Search @@ -35,51 +35,56 @@ MainWindow - - ... - - - - + collection - - - + + + All - + Search - + + No recent files + + + + recent - + Max - + PowerOff - - + + Search application + + + + + Letter - - + + Function @@ -156,82 +161,82 @@ RightClickMenu - + Pin to all - + Unpin from all - + Pin to taskbar - + Unpin from taskbar - + Add to desktop shortcuts - + Pin to collection - + Remove from collection - + Uninstall - + Switch user - + Hibernate - + Sleep - + Lock Screen - + Log Out - + Restart - + Power Off - + Personalize this list diff --git a/translations/ukui-menu_tr.ts b/translations/ukui-menu_tr.ts index 6dc6e3e..3e5245e 100755 --- a/translations/ukui-menu_tr.ts +++ b/translations/ukui-menu_tr.ts @@ -4,22 +4,22 @@ FullMainWindow - + Search Ara - + All Tümü - + Letter Alfabetik - + Function Kategori @@ -118,7 +118,7 @@ Diğer - + Search Ara @@ -192,51 +192,56 @@ MainWindow - - ... - - - - + collection - - - + + + All Tümü - + Search Ara - + + No recent files + + + + recent - + Max - + PowerOff - - + + Search application + + + + + Letter Alfabetik - - + + Function Kategori @@ -360,62 +365,62 @@ RightClickMenu - + Pin to all Tümünü sabitle - + Unpin from all Tüm sabitlemeleri kaldır - + Pin to taskbar Görev çubuğuna sabitle - + Unpin from taskbar Görev çubuğundan sabitlemeyi kaldır - + Add to desktop shortcuts Masaüstü kısayollarına ekle - + Pin to collection - + Remove from collection - + Uninstall Kaldır - + Switch user - + Hibernate Beklemeye Al - + Sleep Uyku Modu - + Lock Screen Ekranı Kilitle @@ -424,22 +429,22 @@ Kullanıcı Değiştir - + Log Out Çıkış - + Restart Yeniden Başlat - + Power Off Kapat - + Personalize this list Bu listeyi özelleştirin diff --git a/translations/ukui-menu_zh_CN.ts b/translations/ukui-menu_zh_CN.ts index d4abdca..9ed9981 100755 --- a/translations/ukui-menu_zh_CN.ts +++ b/translations/ukui-menu_zh_CN.ts @@ -4,22 +4,22 @@ FullMainWindow - + Search 搜索应用 - + All 全部 - + Letter 字母排序 - + Function 功能分类 @@ -27,7 +27,7 @@ FunctionWidget - + Search 全局搜索 @@ -35,51 +35,56 @@ MainWindow - + Search 搜索应用 - - - + + No recent files + 暂无最近文件 + + + + + All 全部 - - ... - - - - + collection 收藏 - + recent 最近 - + Max 放大 - + PowerOff 关机 - - + + Search application + 搜索应用 + + + + Letter 字母排序 - - + + Function 功能分类 @@ -156,82 +161,82 @@ RightClickMenu - + Pin to all 固定到“所有软件” - + Unpin from all 从“所有软件”取消固定 - + Pin to taskbar 固定到任务栏 - + Unpin from taskbar 从任务栏取消固定 - + Add to desktop shortcuts 添加到桌面快捷方式 - + Pin to collection 固定到收藏 - + Remove from collection 从收藏移除 - + Uninstall 卸载 - + Switch user 切换用户 - + Hibernate 休眠 - + Sleep 睡眠 - + Lock Screen 锁屏 - + Log Out 注销 - + Restart 重启 - + Power Off 关机 - + Personalize this list diff --git a/ukui-menu.pro b/ukui-menu.pro index 9cf7362..bb62748 100755 --- a/ukui-menu.pro +++ b/ukui-menu.pro @@ -48,11 +48,11 @@ INSTALLS += qm_files # So we can access it from main.cpp DEFINES += QM_FILES_INSTALL_PATH='\\"$${QM_FILES_INSTALL_PATH}\\"' -PKGCONFIG+=glib-2.0 gio-unix-2.0 gsettings-qt libbamf3 x11 xtst +PKGCONFIG+=glib-2.0 gio-unix-2.0 gsettings-qt libbamf3 x11 xtst kysdk-waylandhelper CONFIG += no_keywords link_pkgconfig -LIBS+=-pthread -luchardet -lukui-log4qt -lukui-com4c -lukui-com4cxx -lpeony +LIBS+=-pthread -luchardet -lukui-log4qt -lukui-com4c -lukui-com4cxx -lpeony -ldl -lcrypto desktop_file.files = ukui-menu.desktop desktop_file.path = /etc/xdg/autostart @@ -63,7 +63,7 @@ INSTALLS += \ FORMS += SOURCES += \ - main.cpp + main.cpp \ RESOURCES += \ res.qrc From 97b6801127a34a5947814fb395c195b7f44c57dd Mon Sep 17 00:00:00 2001 From: handsome_feng Date: Mon, 20 Jun 2022 01:51:40 +0000 Subject: [PATCH 05/30] update debian/changelog. --- debian/changelog | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index a1a551e..411b1d3 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,5 @@ -ukui-menu (3.20.0.3-0k1) yangtze; urgency=medium +ukui-menu (3.1.1-0k2) yangtze; urgency=medium - * 3.20版本提交 + * Initial for openKylin. - -- lixueman Sat, 18 Jun 2022 21:42:59 +0800 - -ukui-menu (3.1.1-0k0) yangtze; urgency=medium - - * 版本号规范化 - - -- Xie Wei Fri, 06 May 2022 17:54:45 +0800 + -- lixueman Sat, 18 Jun 2022 21:42:59 +0800 \ No newline at end of file From 3404fc54f064e0b948c7e422f60bf66bc3ea4d9d Mon Sep 17 00:00:00 2001 From: handsome_feng Date: Mon, 20 Jun 2022 02:16:55 +0000 Subject: [PATCH 06/30] update debian/changelog. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 411b1d3..ead510d 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ukui-menu (3.1.1-0k2) yangtze; urgency=medium +ukui-menu (3.1.1-ok2) yangtze; urgency=medium * Initial for openKylin. From ca76e9f47bbe6d6e083cbb82bef06014ac0bb096 Mon Sep 17 00:00:00 2001 From: lixueman <11020448+lixueman0110@user.noreply.gitee.com> Date: Wed, 22 Jun 2022 07:02:44 +0000 Subject: [PATCH 07/30] =?UTF-8?q?!5=20=E4=BF=AE=E6=94=B9=E4=BA=86platformN?= =?UTF-8?q?ame=E8=8E=B7=E5=8F=96=E6=97=B6=E6=9C=BA=EF=BC=8C=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E8=8E=B7=E5=8F=96=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E6=98=BE=E7=A4=BA=E6=97=B6=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20*=20update=20debian/changelog.=20*=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81=20*=20=E8=B0=83=E6=95=B4pl?= =?UTF-8?q?atformName=E8=8E=B7=E5=8F=96=E4=BD=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A8=E5=B1=8F=E7=AA=97=E5=8F=A3=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E8=AE=BE=E7=BD=AE=20*=20=E6=B7=BB=E5=8A=A0control?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BE=9D=E8=B5=96=20*=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=BC=BA=E5=A4=B1=E7=BC=96=E8=AF=91=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E9=97=AE=E9=A2=98=20*=20update=20src/UtilityFunction/?= =?UTF-8?q?abstractInterface.h.=20*=203.20wayland=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 13 ++++++++++--- main.cpp | 2 +- src/UserInterface/mainwindow.cpp | 11 +++++++++++ src/UserInterface/mainwindow.h | 1 + 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index ead510d..962814a 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,12 @@ -ukui-menu (3.1.1-ok2) yangtze; urgency=medium +ukui-menu (3.1.1-ok3) yangtze; urgency=medium - * Initial for openKylin. + * 调整QGuiApplication::platformName()调用时机 + * 增加全屏窗口显示时位置设定 - -- lixueman Sat, 18 Jun 2022 21:42:59 +0800 \ No newline at end of file + -- lixueman Wed, 22 Jun 2022 11:22:58 +0800 + +ukui-menu (3.1.1-0k0) yangtze; urgency=medium + + * 版本号规范化 + + -- Xie Wei Fri, 06 May 2022 17:54:45 +0800: diff --git a/main.cpp b/main.cpp index 68bb94d..4d4c558 100755 --- a/main.cpp +++ b/main.cpp @@ -44,7 +44,6 @@ int main(int argc, char *argv[]) initUkuiLog4qt("ukui-menu"); g_projectCodeName = KDKGetPrjCodeName().c_str(); g_subProjectCodeName = KDKGetOSRelease("SUB_PROJECT_CODENAME").c_str(); - g_platform = QGuiApplication::platformName(); qRegisterMetaType>("QVector"); #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) @@ -56,6 +55,7 @@ int main(int argc, char *argv[]) #endif QtSingleApplication app("ukui-menu", argc, argv); app.setQuitOnLastWindowClosed(false); + g_platform = QGuiApplication::platformName(); if (app.isRunning()) { app.sendMessage("raise_window_noop"); diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index ccc8fe1..984d9f0 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -355,6 +355,7 @@ MainWindow::MainWindow(QWidget *parent) : m_viewWidget->setFocus(); } else { m_fullWindow->show(); + setMaxWindowPos(); // fullWindow->raise(); m_fullWindow->activateWindow(); pointDataStruct pointData; @@ -693,6 +694,7 @@ void MainWindow::maxAnimationFinished() { m_fullWindow->raise(); m_fullWindow->showNormal(); + setMaxWindowPos(); m_fullWindow->activateWindow(); QEventLoop loop; QTimer::singleShot(100, &loop, SLOT(quit())); @@ -1217,6 +1219,7 @@ void MainWindow::showWindow() if (m_isFullScreen) { m_fullWindow->raise(); m_fullWindow->showNormal(); + setMaxWindowPos(); m_fullWindow->activateWindow(); pointDataStruct pointData; pointData.module = "fullWindow"; @@ -1238,6 +1241,7 @@ void MainWindow::showWindow() BuriedPointDataSend::getInstance()->setPoint(pointData); } } + void MainWindow::hideWindow() { if (m_fullWindow->isVisible()) { @@ -1296,6 +1300,13 @@ void MainWindow::setMinWindowPos() } } +void MainWindow::setMaxWindowPos() +{ + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + kdk::WindowManager::setGeometry(m_fullWindow->windowHandle(), QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight)); + } +} + void MainWindow::repaintWidget() { Style::initWidStyle(); diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h index 9c1bcad..7dede39 100755 --- a/src/UserInterface/mainwindow.h +++ b/src/UserInterface/mainwindow.h @@ -107,6 +107,7 @@ protected: void setMinWindowPos(); + void setMaxWindowPos(); public: Q_SIGNALS: void sendSearchKeyword(QString arg); From 3685550f69efdd1ca73040e415ec8e51315ce6b1 Mon Sep 17 00:00:00 2001 From: lixueman <11020448+lixueman0110@user.noreply.gitee.com> Date: Wed, 22 Jun 2022 07:43:33 +0000 Subject: [PATCH 08/30] update debian/control. --- debian/control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 4cb6cda..f856670 100755 --- a/debian/control +++ b/debian/control @@ -20,7 +20,8 @@ Build-Depends: debhelper-compat (=12), libukui-common0, libukui-common-dev, libpeony-dev, - libkysdk-waylandhelper-dev + libkysdk-waylandhelper-dev, + libssl-dev Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: https://github.com/ukui/ukui-menu From 4ab17b5d0c54613845cc8f38464d1c7f8c1b6024 Mon Sep 17 00:00:00 2001 From: handsome_feng Date: Wed, 22 Jun 2022 08:19:49 +0000 Subject: [PATCH 09/30] update debian/changelog. --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 962814a..199f2ed 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -ukui-menu (3.1.1-ok3) yangtze; urgency=medium +ukui-menu (3.1.1-ok4~0622) yangtze; urgency=medium * 调整QGuiApplication::platformName()调用时机 * 增加全屏窗口显示时位置设定 -- lixueman Wed, 22 Jun 2022 11:22:58 +0800 -ukui-menu (3.1.1-0k0) yangtze; urgency=medium +ukui-menu (3.1.1-ok1) yangtze; urgency=medium * 版本号规范化 From 3f8c573edba709b9552604da853b76259d10f8e3 Mon Sep 17 00:00:00 2001 From: lixueman Date: Thu, 23 Jun 2022 16:23:49 +0800 Subject: [PATCH 10/30] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=99=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/tabletwindow.cpp | 2 +- src/UtilityFunction/utility.cpp | 36 +++++++++++++++++++----------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/UserInterface/tabletwindow.cpp b/src/UserInterface/tabletwindow.cpp index 4f26924..378ad1f 100755 --- a/src/UserInterface/tabletwindow.cpp +++ b/src/UserInterface/tabletwindow.cpp @@ -615,7 +615,7 @@ void TabletWindow::execApplication(QString desktopfp) if (!g_subProjectCodeName.contains("mavis") || (g_subProjectCodeName.contains("mavis") && !QDBusReply(iface.call("LaunchApp", desktopfp)))) { - execApp(desktopfp); +// execApp(desktopfp); QString str; //打开文件.desktop GError **error = nullptr; diff --git a/src/UtilityFunction/utility.cpp b/src/UtilityFunction/utility.cpp index 3eee325..40c6f08 100755 --- a/src/UtilityFunction/utility.cpp +++ b/src/UtilityFunction/utility.cpp @@ -710,22 +710,32 @@ bool deleteAppRecord(QString desktopfn) void execApp(QString desktopfp) { - UkuiMenuInterface interface; - if (interface.checkKreApp(desktopfp)) { - QProcess::startDetached(interface.getAppExec(desktopfp)); - } else { - QString appName = interface.getAppExec(desktopfp); - QStringList strList = (appName.replace("\"", "")).split(" "); + QDBusInterface iface("com.kylin.AppManager", + "/com/kylin/AppManager", + "com.kylin.AppManager", + QDBusConnection::sessionBus()); + QDBusReply res = iface.call("LaunchApp", desktopfp); - if (QString(strList.at(0)) == "kmplayer") { - QProcess::startDetached(strList.at(0)); - return; + if (!res.isValid() || !res) { + + UkuiMenuInterface interface; + + if (interface.checkKreApp(desktopfp)) { + QProcess::startDetached(interface.getAppExec(desktopfp)); + } else { + QString appName = interface.getAppExec(desktopfp); + QStringList strList = (appName.replace("\"", "")).split(" "); + + if (QString(strList.at(0)) == "kmplayer") { + QProcess::startDetached(strList.at(0)); + return; + } + + GDesktopAppInfo *desktopAppInfo = g_desktop_app_info_new_from_filename(desktopfp.toLocal8Bit().data()); + g_app_info_launch(G_APP_INFO(desktopAppInfo), nullptr, nullptr, nullptr); + g_object_unref(desktopAppInfo); } - - GDesktopAppInfo *desktopAppInfo = g_desktop_app_info_new_from_filename(desktopfp.toLocal8Bit().data()); - g_app_info_launch(G_APP_INFO(desktopAppInfo), nullptr, nullptr, nullptr); - g_object_unref(desktopAppInfo); } QFileInfo fileInfo(desktopfp); From 4a84479ba6f616911917787f0fbe430dc8a127dd Mon Sep 17 00:00:00 2001 From: handsome_feng Date: Thu, 23 Jun 2022 09:25:43 +0000 Subject: [PATCH 11/30] update debian/changelog 3.1.1-ok4~0623 --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 199f2ed..d4eb1ea 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,8 @@ -ukui-menu (3.1.1-ok4~0622) yangtze; urgency=medium +ukui-menu (3.1.1-ok4~0623) yangtze; urgency=medium * 调整QGuiApplication::platformName()调用时机 * 增加全屏窗口显示时位置设定 + * 合入app-manager接口 -- lixueman Wed, 22 Jun 2022 11:22:58 +0800 From fd51a285e07bc59a283126ccda912f30aa479869 Mon Sep 17 00:00:00 2001 From: lixueman Date: Tue, 12 Jul 2022 06:56:21 +0000 Subject: [PATCH 12/30] =?UTF-8?q?!7=20=E8=B0=83=E6=95=B4=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84=20*=20close-cd=20128489=20?= =?UTF-8?q?=E5=85=A8=E5=B1=8F=E5=B0=86=E6=9F=90=E4=B8=AA=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BA=E2=80=9C=E5=9B=BA=E5=AE=9A=E5=88=B0?= =?UTF-8?q?=E6=89=80=E6=9C=89=E8=BD=AF=E4=BB=B6=E2=80=9D=EF=BC=8C=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=8C=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E9=97=AA=E9=80=80=20*=20=E5=9B=BA=E5=AE=9A=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E7=94=B5=E6=BA=90=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=20*=20=E5=A2=9E=E5=8A=A0=E5=85=A8=E5=B1=8F=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E8=8F=9C=E5=8D=95=E4=B8=8B=E6=8B=89=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=97=8B=E8=BD=AC=E6=95=88=E6=9E=9C=EF=BC=9B=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=85=A8=E5=B1=8F=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=A9=BA=E7=99=BD=E5=8C=BA=E5=9F=9F=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 9 + debian/control | 6 +- .../BuriedPoint/buriedpointdatasend.cpp | 78 --- .../BuriedPoint/buriedpointdatasend.h | 29 - src/BackProcess/backprocess.pri | 6 +- .../qtsingleapplication.cpp | 3 + src/UserInterface/ListView/fulllistview.cpp | 1 + src/UserInterface/ListView/klistview.cpp | 16 +- src/UserInterface/ListView/klistview.h | 1 + src/UserInterface/ListView/listview.cpp | 8 +- src/UserInterface/ListView/rightlistview.cpp | 35 +- src/UserInterface/ListView/rightlistview.h | 2 + .../RightClickMenu/rightclickmenu.cpp | 9 +- .../RightClickMenu/rightclickmenu.h | 2 +- .../ViewItem/full_item_delegate.cpp | 8 +- src/UserInterface/ViewItem/itemdelegate.cpp | 5 + .../ViewItem/right_item_delegate.cpp | 8 +- .../Widget/full_commonuse_widget.cpp | 20 +- .../Widget/full_function_widget.cpp | 22 +- .../Widget/full_letter_widget.cpp | 22 +- .../Widget/full_searchresult_widget.cpp | 26 +- src/UserInterface/full_mainwindow.cpp | 258 +++++--- src/UserInterface/full_mainwindow.h | 21 +- src/UserInterface/mainwindow.cpp | 551 +++++++++--------- src/UserInterface/mainwindow.h | 12 + src/UtilityFunction/Style/style.cpp | 4 +- src/UtilityFunction/utility.h | 20 - translations/ukui-menu_bo.qm | 1 - translations/ukui-menu_bo.ts | 67 ++- translations/ukui-menu_tr.qm | Bin 2709 -> 0 bytes translations/ukui-menu_tr.ts | 67 ++- translations/ukui-menu_zh_CN.qm | Bin 2320 -> 0 bytes translations/ukui-menu_zh_CN.ts | 75 ++- ukui-menu.pro | 2 +- 34 files changed, 705 insertions(+), 689 deletions(-) delete mode 100644 src/BackProcess/BuriedPoint/buriedpointdatasend.cpp delete mode 100644 src/BackProcess/BuriedPoint/buriedpointdatasend.h delete mode 100755 translations/ukui-menu_bo.qm delete mode 100755 translations/ukui-menu_tr.qm delete mode 100755 translations/ukui-menu_zh_CN.qm diff --git a/debian/changelog b/debian/changelog index d4eb1ea..7351f55 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +ukui-menu (3.1.1-ok4~0708) yangtze; urgency=medium + + * 调整全屏窗口初始化代码结构 + * 增加全屏开始菜单分类选择下拉按钮动画效果 + * 增加全屏开始菜单点击空白区域退出功能 + * 固定全屏电源右键菜单位置 + + -- lixueman Fri, 08 Jul 2022 11:25:23 +0800 + ukui-menu (3.1.1-ok4~0623) yangtze; urgency=medium * 调整QGuiApplication::platformName()调用时机 diff --git a/debian/control b/debian/control index f856670..b845cb7 100755 --- a/debian/control +++ b/debian/control @@ -20,8 +20,7 @@ Build-Depends: debhelper-compat (=12), libukui-common0, libukui-common-dev, libpeony-dev, - libkysdk-waylandhelper-dev, - libssl-dev + libkysdk-waylandhelper-dev Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: https://github.com/ukui/ukui-menu @@ -37,8 +36,7 @@ Depends: ${shlibs:Depends}, libqt5x11extras5, bamfdaemon, libkysdk-waylandhelper -Suggests:kylin-status-manager, - kylin-daq +Suggests:kylin-status-manager Description: Advanced ukui menu UKUI menu provides start menu development library and advanced graphical user interface. diff --git a/src/BackProcess/BuriedPoint/buriedpointdatasend.cpp b/src/BackProcess/BuriedPoint/buriedpointdatasend.cpp deleted file mode 100644 index a35411f..0000000 --- a/src/BackProcess/BuriedPoint/buriedpointdatasend.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include "buriedpointdatasend.h" -#include -#include -#include -#include -#include -#include -#include - -Q_GLOBAL_STATIC(BuriedPointDataSend, buriedPointDataSend) - -BuriedPointDataSend::BuriedPointDataSend() -{ - QString path = QDir::homePath() + "/.config/ukui/menuUploadMessage/"; -// m_sendDataInterface = new KUploadMessage(getpid()); -// m_sendDataInterface->initUploadInterface("ukui-menu", "menuData", path); -} - -BuriedPointDataSend::~BuriedPointDataSend() -{ -// if (m_sendDataInterface != nullptr) { -// delete m_sendDataInterface; -// m_sendDataInterface = nullptr; -// } -} - -BuriedPointDataSend *BuriedPointDataSend::getInstance() -{ - return buriedPointDataSend(); -} - -QString BuriedPointDataSend::getCurrentTime() -{ - QString tempDateTimeStr; - QDateTime tempDateTime = QDateTime::currentDateTime().toTimeZone(QTimeZone(8 * 3600)); - tempDateTimeStr = tempDateTime.toString("yyyy-MM-dd HH:mm:ss.zzz"); - return tempDateTimeStr; -} - -void BuriedPointDataSend::setPoint(const pointDataStruct &data) -{ -// int curNum = 1; -// QStringList applist = QStringList(); -// QString keyValue = data.module + data.function; - -// if (m_functionCount.keys().contains(keyValue)) { -// curNum = m_functionCount.value(keyValue); -// curNum ++; -// } - -// m_functionCount.insert(keyValue, curNum); - -// if (!data.otherFunction.isEmpty()) { -// if (m_applist.keys().contains(keyValue)) { -// applist = m_applist.value(keyValue); -// } - -// applist.append(data.otherFunction.at(0)); -// m_applist.insert(keyValue, applist); -// } - -// QString time = getCurrentTime(); -// QJsonObject jsonObj; -// QJsonArray otherFunction = QJsonArray::fromStringList(data.otherFunction); -// jsonObj.insert("module", QJsonValue(data.module)); -// jsonObj.insert("function", QJsonValue(data.function)); -// jsonObj.insert("functionNum", QJsonValue(QString::number(curNum))); -// jsonObj.insert("otherFunction", otherFunction); -// jsonObj.insert("errorLevel", QJsonValue(data.errorLevel)); -// jsonObj.insert("errorOutput", QJsonValue(data.errorOutput)); -// jsonObj.insert("createTimeStamp", QJsonValue(time));//注意该字段名称不能修改,否则会报invalid -// // 将数据转化为QString -// QString informationData(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact)); -// qDebug() << "jsonObj:" << jsonObj; -// m_sendDataInterface->uploadMessage(informationData); -} - - diff --git a/src/BackProcess/BuriedPoint/buriedpointdatasend.h b/src/BackProcess/BuriedPoint/buriedpointdatasend.h deleted file mode 100644 index 55aa510..0000000 --- a/src/BackProcess/BuriedPoint/buriedpointdatasend.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef BURIEDPOINTDATASEND_H -#define BURIEDPOINTDATASEND_H - -#include -#include -#include -#include "src/UtilityFunction/utility.h" -#include "unistd.h" -//#include "kuploadmessage.h" - -class BuriedPointDataSend : public QObject -{ - Q_OBJECT -public: - BuriedPointDataSend(); - ~BuriedPointDataSend(); - - static BuriedPointDataSend *getInstance(); - - void setPoint(const pointDataStruct &data); - -private: - QString getCurrentTime(); - QHash m_functionCount; - QHash m_applist; -// KUploadMessage *m_sendDataInterface = nullptr; -}; - -#endif // BURIEDPOINTDATASEND_H diff --git a/src/BackProcess/backprocess.pri b/src/BackProcess/backprocess.pri index 929a1a9..060c9d4 100755 --- a/src/BackProcess/backprocess.pri +++ b/src/BackProcess/backprocess.pri @@ -25,8 +25,7 @@ HEADERS += \ $$PWD/Search/searchappthread.h \ $$PWD/XEventMonitor/xeventmonitor.h \ $$PWD/tablet/getmodeldata.h \ - $$PWD/tablet/pagemanager.h \ - $$PWD/BuriedPoint/buriedpointdatasend.h + $$PWD/tablet/pagemanager.h SOURCES += \ $$PWD/DBus/dbus-adaptor.cpp \ @@ -43,8 +42,7 @@ SOURCES += \ $$PWD/Search/searchappthread.cpp \ $$PWD/XEventMonitor/xeventmonitor.cpp \ $$PWD/tablet/getmodeldata.cpp \ - $$PWD/tablet/pagemanager.cpp \ - $$PWD/BuriedPoint/buriedpointdatasend.cpp + $$PWD/tablet/pagemanager.cpp INCLUDEPATH += $$PWD/../ diff --git a/src/QtSingleApplication/qtsingleapplication.cpp b/src/QtSingleApplication/qtsingleapplication.cpp index 961677e..e3ba444 100755 --- a/src/QtSingleApplication/qtsingleapplication.cpp +++ b/src/QtSingleApplication/qtsingleapplication.cpp @@ -347,16 +347,19 @@ QWidget *QtSingleApplication::activationWindow() const void QtSingleApplication::activateWindow() { if (actWin) { + myDebug() << "单例触发activateWindow"; if (!g_projectCodeName.contains("V10SP1-edu")) { MainWindow *w = qobject_cast(actWin); if (this->applicationState() & Qt::ApplicationInactive) { + myDebug() << "单例内触发开始菜单显示"; actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized); // actWin->raise(); // actWin->showNormal(); // actWin->activateWindow(); w->showWindow(); } else { + myDebug() << "单例内触发开始菜单隐藏"; actWin->setWindowState(actWin->windowState() & Qt::WindowMinimized); w->hideWindow(); } diff --git a/src/UserInterface/ListView/fulllistview.cpp b/src/UserInterface/ListView/fulllistview.cpp index 3206c8a..17124b8 100755 --- a/src/UserInterface/ListView/fulllistview.cpp +++ b/src/UserInterface/ListView/fulllistview.cpp @@ -52,6 +52,7 @@ void FullListView::initWidget() this->setMouseTracking(true); this->setMovement(QListView::Static); this->setEditTriggers(QAbstractItemView::NoEditTriggers); + setItemAlignment(Qt::AlignCenter); this->setGridSize(QSize(Style::m_applistGridSizeWidth, Style::m_applistGridSizeWidth)); this->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu); this->setFrameShape(QFrame::NoFrame);//移除边框 diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp index 012b52a..b927ba2 100755 --- a/src/UserInterface/ListView/klistview.cpp +++ b/src/UserInterface/ListView/klistview.cpp @@ -60,22 +60,30 @@ void KListView::paintEvent(QPaintEvent *e) QListView::paintEvent(e); } +void KListView::mouseMoveEvent(QMouseEvent *e) +{ + this->clearFocus(); +} + void KListView::mousePressEvent(QMouseEvent *event) { if (!(this->indexAt(event->pos()).isValid()) && event->button() == Qt::LeftButton) { Q_EMIT sendHideMainWindowSignal(); } else { pressApp = listmodel->data(this->indexAt(event->pos()), Qt::DisplayRole); - return QListView::mousePressEvent(event); } + return QListView::mousePressEvent(event); } void KListView::rightClickedSlot(const QPoint &pos) { - Q_UNUSED(pos) - if (!(this->selectionModel()->selectedIndexes().isEmpty())) { - QModelIndex index = this->currentIndex(); + + QModelIndex index = indexAt(pos); + if(!index.isValid()) { + return; + } + QVariant var = listmodel->data(index, Qt::DisplayRole); QStringList strlist = var.value(); diff --git a/src/UserInterface/ListView/klistview.h b/src/UserInterface/ListView/klistview.h index 1d86cce..e932fd2 100755 --- a/src/UserInterface/ListView/klistview.h +++ b/src/UserInterface/ListView/klistview.h @@ -23,6 +23,7 @@ public: protected: void paintEvent(QPaintEvent *e); void mousePressEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *e); public: void addData(QStringList data); void updateData(QStringList data); diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp index ff6b421..78ed0a3 100755 --- a/src/UserInterface/ListView/listview.cpp +++ b/src/UserInterface/ListView/listview.cpp @@ -21,7 +21,6 @@ #include "utility.h" #include #include -#include "buriedpointdatasend.h" ListView::ListView(QWidget *parent/*, int width, int height, int module*/): KListView(parent) @@ -109,12 +108,7 @@ void ListView::onClicked(QModelIndex index) Q_EMIT sendAppClassificationBtnClicked(); } else { execApp(desktopfp); - pointDataStruct pointData; - pointData.module = "mainWindow/execApplication"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - pointData.otherFunction.append(desktopfp); - BuriedPointDataSend::getInstance()->setPoint(pointData); + Q_EMIT sendHideMainWindowSignal(); } } } diff --git a/src/UserInterface/ListView/rightlistview.cpp b/src/UserInterface/ListView/rightlistview.cpp index e8dec33..7725222 100755 --- a/src/UserInterface/ListView/rightlistview.cpp +++ b/src/UserInterface/ListView/rightlistview.cpp @@ -44,7 +44,7 @@ void RightListView::initWidget() viewport()->setAutoFillBackground(false); this->setSelectionMode(QAbstractItemView::SingleSelection); this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + this->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); this->setViewMode(QListView::IconMode); this->setContextMenuPolicy(Qt::CustomContextMenu); this->setResizeMode(QListView::Adjust); @@ -52,8 +52,9 @@ void RightListView::initWidget() this->setMouseTracking(true); this->setMovement(QListView::Static); this->setEditTriggers(QAbstractItemView::NoEditTriggers); - this->setGridSize(QSize(107, 107)); + this->setGridSize(QSize(105, 105)); this->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu); + this->verticalScrollBar()->setProperty("drawScrollBarGroove", false); this->setFrameShape(QFrame::NoFrame);//移除边框 connect(this, &RightListView::customContextMenuRequested, this, &RightListView::rightClickedSlot); connect(this, &RightListView::clicked, this, &RightListView::onClicked); @@ -92,6 +93,18 @@ void RightListView::selectFirstItem() void RightListView::paintEvent(QPaintEvent *e) { + //滚动条 + QPalette p = this->verticalScrollBar()->palette(); + QColor color; + + if (g_curStyle == "ukui-dark") { + color = QColor("#26FFFFFF"); + } else { + color = QColor("#1A000000"); + } + + p.setColor(QPalette::Active, QPalette::Button, color); + this->verticalScrollBar()->setPalette(p); QListView::paintEvent(e); } @@ -113,6 +126,17 @@ void RightListView::keyPressEvent(QKeyEvent *e) } } +void RightListView::onClicked(QModelIndex index) +{ + Q_EMIT sendHideMainWindowSignal(); + QVariant var = listmodel->data(index, Qt::DisplayRole); + QString desktopfp = var.value().at(0); + if (var.isValid()) { + QString desktopfp = var.value(); + execApp(desktopfp); + } +} + void RightListView::changeStyleColor(const QColor &color) { m_styleColor = color; @@ -122,4 +146,11 @@ void RightListView::enterEvent(QEvent *e) { Q_UNUSED(e); this->selectionModel()->clear(); + this->verticalScrollBar()->setVisible(true); +} + +void RightListView::leaveEvent(QEvent *e) +{ + Q_UNUSED(e); + this->verticalScrollBar()->setVisible(false); } diff --git a/src/UserInterface/ListView/rightlistview.h b/src/UserInterface/ListView/rightlistview.h index c75e0cc..b09c361 100755 --- a/src/UserInterface/ListView/rightlistview.h +++ b/src/UserInterface/ListView/rightlistview.h @@ -27,6 +27,7 @@ protected: void dropEvent(QDropEvent *event); void enterEvent(QEvent *e); void paintEvent(QPaintEvent *e); + void leaveEvent(QEvent *e); private: RightClickMenu *menu = nullptr; //右键菜单 @@ -42,6 +43,7 @@ public Q_SLOTS: // void rightClickedSlot(const QPoint &pos);//右键菜单 void selectFirstItem(); void changeStyleColor(const QColor &color); + void onClicked(QModelIndex index); Q_SIGNALS: diff --git a/src/UserInterface/RightClickMenu/rightclickmenu.cpp b/src/UserInterface/RightClickMenu/rightclickmenu.cpp index 45f7b46..f274607 100755 --- a/src/UserInterface/RightClickMenu/rightclickmenu.cpp +++ b/src/UserInterface/RightClickMenu/rightclickmenu.cpp @@ -261,7 +261,7 @@ int RightClickMenu::showAppBtnMenu(const QPoint &pos, QString desktopfp) return m_actionNumber; } -int RightClickMenu::showShutdownMenu(const QPoint &pos) +int RightClickMenu::showShutdownMenu(const QPoint &pos, const bool &isFullWind) { m_actionNumber = 0; MenuBox m_showShutMenu; @@ -315,7 +315,12 @@ int RightClickMenu::showShutdownMenu(const QPoint &pos) m_showShutMenu.setAttribute(Qt::WA_TranslucentBackground); m_showShutMenu.setAttribute(Qt::WA_DeleteOnClose); m_showShutMenu.raise(); - m_showShutMenu.exec(pos); + if (isFullWind) { + m_showShutMenu.exec(QPoint(pos.x() - m_showShutMenu.sizeHint().width(), pos.y() - m_showShutMenu.sizeHint().height())); + } else { + m_showShutMenu.exec(pos); + } + myDebug() << "RightClickMenu::showShutdownMenu()"; return m_actionNumber; } diff --git a/src/UserInterface/RightClickMenu/rightclickmenu.h b/src/UserInterface/RightClickMenu/rightclickmenu.h index a96c65d..4075294 100755 --- a/src/UserInterface/RightClickMenu/rightclickmenu.h +++ b/src/UserInterface/RightClickMenu/rightclickmenu.h @@ -65,7 +65,7 @@ public: * @brief Displays the power right-click menu * @return return action number */ - int showShutdownMenu(const QPoint &pos); + int showShutdownMenu(const QPoint &pos, const bool &isFullWind); /** * @brief Displays other application right-click menus * @param desktopfp: Application desktop file diff --git a/src/UserInterface/ViewItem/full_item_delegate.cpp b/src/UserInterface/ViewItem/full_item_delegate.cpp index 9dc4076..5e5c358 100755 --- a/src/UserInterface/ViewItem/full_item_delegate.cpp +++ b/src/UserInterface/ViewItem/full_item_delegate.cpp @@ -42,7 +42,7 @@ void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti rect.setWidth(option.rect.width()); rect.setHeight(option.rect.height()); //QPainterPath画圆角矩形 - const qreal radius = 4; + const qreal radius = 26; QPainterPath path; path.moveTo(rect.topRight() - QPointF(radius, 0)); path.lineTo(rect.topLeft() + QPointF(radius, 0)); @@ -118,8 +118,8 @@ void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti QString appname = pUkuiMenuInterface->getAppName(desktopfp); QRect iconRect; QRect textRect; - iconRect = QRect(/*rect.x()+66*/rect.x() + (rect.width() - Style::AppListIconSize) / 2, - /*rect.y()+40*/rect.y() + 40, + iconRect = QRect(rect.x() + (rect.width() - Style::AppListIconSize) / 2, + rect.y() + 20, Style::AppListIconSize, Style::AppListIconSize); icon.paint(painter, iconRect); @@ -217,5 +217,5 @@ void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti QSize FullItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { - return QSize(/*Style::AppListItemSizeWidth*/220, /*Style::AppListItemSizeWidth*/220); + return QSize(Style::AppListItemSizeWidth, Style::AppListItemSizeWidth); } diff --git a/src/UserInterface/ViewItem/itemdelegate.cpp b/src/UserInterface/ViewItem/itemdelegate.cpp index aa7f169..7effecd 100755 --- a/src/UserInterface/ViewItem/itemdelegate.cpp +++ b/src/UserInterface/ViewItem/itemdelegate.cpp @@ -172,6 +172,11 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, if ((option.state & QStyle::State_MouseOver) || (option.state & QStyle::State_HasFocus)) { painter->drawPixmap(rect.width() - 25, rect.y() + 15, pixmap); + if (module == 1) { + QToolTip::showText(QCursor::pos(), tr("Open the function sort menu")); + } else if (module == 2) { + QToolTip::showText(QCursor::pos(), tr("Open the alphabetical menu")); + } } painter->restore(); diff --git a/src/UserInterface/ViewItem/right_item_delegate.cpp b/src/UserInterface/ViewItem/right_item_delegate.cpp index a67a6ca..b50de3d 100755 --- a/src/UserInterface/ViewItem/right_item_delegate.cpp +++ b/src/UserInterface/ViewItem/right_item_delegate.cpp @@ -18,10 +18,10 @@ void RightItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt if (index.isValid()) { QStyleOptionViewItem viewOption(option);//用来在视图中画一个item QRectF rect; - rect.setX(option.rect.x()); - rect.setY(option.rect.y()); - rect.setWidth(option.rect.width()); - rect.setHeight(option.rect.height()); + rect.setX(option.rect.x() + 1); + rect.setY(option.rect.y() + 1); + rect.setWidth(option.rect.width() - 2); + rect.setHeight(option.rect.height() - 2); //QPainterPath画圆角矩形 const qreal radius = 10; QPainterPath path; diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp index 5dd8db5..c02f317 100755 --- a/src/UserInterface/Widget/full_commonuse_widget.cpp +++ b/src/UserInterface/Widget/full_commonuse_widget.cpp @@ -20,7 +20,6 @@ #include #include "style.h" #include "utility.h" -#include "buriedpointdatasend.h" #include FullCommonUseWidget::FullCommonUseWidget(QWidget *parent) : @@ -132,23 +131,14 @@ void FullCommonUseWidget::initVerticalScrollBar() void FullCommonUseWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); - pointDataStruct pointData; - pointData.module = "fullWindow/commonUseWidget/powerOffButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullCommonUseWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) { + Q_UNUSED(pos); RightClickMenu m_otherMenu(this); - m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); + m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(QPoint(0, 45)), true); myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; - pointDataStruct pointData; - pointData.module = "fullWindow/commonUseWidget/powerOffButton"; - pointData.function = "RightClicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullCommonUseWidget::initAppListWidget() @@ -201,12 +191,6 @@ void FullCommonUseWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); - pointDataStruct pointData; - pointData.module = "fullWindow/commonUseWidget/execApplication"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - pointData.otherFunction[0] = desktopfp; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullCommonUseWidget::selectFirstItem() diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp index 55ed6c0..253f210 100755 --- a/src/UserInterface/Widget/full_function_widget.cpp +++ b/src/UserInterface/Widget/full_function_widget.cpp @@ -23,7 +23,6 @@ #include #include #include -#include "buriedpointdatasend.h" FullFunctionWidget::FullFunctionWidget(QWidget *parent) : QWidget(parent) @@ -152,23 +151,14 @@ void FullFunctionWidget::initVerticalScrollBar() void FullFunctionWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); - pointDataStruct pointData; - pointData.module = "fullWindow/FullFunctionWidget/powerOffButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullFunctionWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) { + Q_UNUSED(pos); RightClickMenu m_otherMenu(this); - m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); + m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(QPoint(0, 45)), true); myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; - pointDataStruct pointData; - pointData.module = "fullWindow/FullFunctionWidget/powerOffButton"; - pointData.function = "RightClicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } @@ -229,12 +219,6 @@ void FullFunctionWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); - pointDataStruct pointData; - pointData.module = "fullWindow/FullFunctionWidget/execApplication"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - pointData.otherFunction[0] = desktopfp; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullFunctionWidget::on_setAreaScrollBarValue(int value) @@ -248,6 +232,8 @@ void FullFunctionWidget::on_setAreaScrollBarValue(int value) */ void FullFunctionWidget::updateAppListView() { + disconnect(m_scrollArea->verticalScrollBar(), &QScrollBar::valueChanged, + this, &FullFunctionWidget::valueChangedSlot); //刷新应用列表界面 QLayoutItem *child; diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp index 353cbef..96daac2 100755 --- a/src/UserInterface/Widget/full_letter_widget.cpp +++ b/src/UserInterface/Widget/full_letter_widget.cpp @@ -19,7 +19,6 @@ #include "full_letter_widget.h" #include #include -#include "buriedpointdatasend.h" FullLetterWidget::FullLetterWidget(QWidget *parent) : QWidget(parent) @@ -146,23 +145,14 @@ void FullLetterWidget::initVerticalScrollBar() void FullLetterWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); - pointDataStruct pointData; - pointData.module = "fullWindow/FullLetterWidget/powerOffButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullLetterWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) { + Q_UNUSED(pos); RightClickMenu m_otherMenu(this); - m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); + m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(QPoint(0, 45)), true); qDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; - pointDataStruct pointData; - pointData.module = "fullWindow/FullLetterWidget/powerOffButton"; - pointData.function = "RightClicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullLetterWidget::setFocusToThis() @@ -233,12 +223,6 @@ void FullLetterWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); - pointDataStruct pointData; - pointData.module = "fullWindow/FullLetterWidget/execApplication"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - pointData.otherFunction[0] = desktopfp; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullLetterWidget::on_setAreaScrollBarValue(int value) @@ -252,6 +236,8 @@ void FullLetterWidget::on_setAreaScrollBarValue(int value) */ void FullLetterWidget::updateAppListView() { + disconnect(m_scrollArea->verticalScrollBar(), &QScrollBar::valueChanged, + this, &FullLetterWidget::valueChangedSlot); //刷新应用列表界面 QLayoutItem *child; diff --git a/src/UserInterface/Widget/full_searchresult_widget.cpp b/src/UserInterface/Widget/full_searchresult_widget.cpp index 259986b..be5dd6b 100755 --- a/src/UserInterface/Widget/full_searchresult_widget.cpp +++ b/src/UserInterface/Widget/full_searchresult_widget.cpp @@ -20,7 +20,6 @@ #include "style.h" #include "utility.h" #include -#include "buriedpointdatasend.h" FullSearchResultWidget::FullSearchResultWidget(QWidget *parent) : QWidget(parent) @@ -121,23 +120,14 @@ void FullSearchResultWidget::initVerticalScrollBar() void FullSearchResultWidget::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); - pointDataStruct pointData; - pointData.module = "fullWindow/FullSearchResultWidget/powerOffButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullSearchResultWidget::on_powerOffButton_customContextMenuRequested(const QPoint &pos) { + Q_UNUSED(pos); RightClickMenu m_otherMenu(this); - m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(pos)); + m_otherMenu.showShutdownMenu(m_powerOffButton->mapToGlobal(QPoint(0, 45)), true); myDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; - pointDataStruct pointData; - pointData.module = "fullWindow/FullSearchResultWidget/powerOffButton"; - pointData.function = "RightClicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullSearchResultWidget::initAppListWidget() @@ -164,12 +154,6 @@ void FullSearchResultWidget::execApplication(QString desktopfp) { Q_EMIT sendHideMainWindowSignal(); execApp(desktopfp); - pointDataStruct pointData; - pointData.module = "fullWindow/FullLetterWidget/execApplication"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - pointData.otherFunction[0] = desktopfp; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullSearchResultWidget::updateAppListView(QVector arg) @@ -241,11 +225,7 @@ void FullSearchResultWidget::selectFirstItemTab() void FullSearchResultWidget::repaintWidget() { m_scrollArea->setFixedSize(Style::m_applistWidWidth, Style::m_applistWidHeight); - m_scrollAreaWidLayout->removeWidget(m_listView); - m_listView->setParent(nullptr); - delete m_listView; - initAppListWidget(); - fillAppList(); + resizeScrollAreaControls(); m_scrollAreaWidHeight = m_scrollAreaWid->height() + 1; initVerticalScrollBar(); } diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp index 5e63110..4e6ea9a 100755 --- a/src/UserInterface/full_mainwindow.cpp +++ b/src/UserInterface/full_mainwindow.cpp @@ -3,7 +3,6 @@ #include #include #include "utility.h" -#include "buriedpointdatasend.h" FullMainWindow::FullMainWindow(QWidget *parent) : QMainWindow(parent) @@ -11,12 +10,24 @@ FullMainWindow::FullMainWindow(QWidget *parent) : this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint); this->setAttribute(Qt::WA_TranslucentBackground, true); this->setAutoFillBackground(false); - m_searchAppThread = new SearchAppThread; Style::initWidStyle(); - m_buttonStyle = QString("%1{border-radius:24px; background: rgba(255, 255, 255, 0.1);}" - "%1:hover {border-radius:24px; background: rgba(255, 255, 255, 0.2);}" - "%1:pressed {border-radius:24px; background: rgba(255, 255, 255, 0.3);}"); this->setFixedSize(Style::m_availableScreenWidth, Style::m_availableScreenHeight); + initLayout(); + initSearchUI(); + initButtonUI(); + initAppListUI(); + initMenu(); + initTabOrder(); + changeStyle(); + initConnect(); +} + +FullMainWindow::~FullMainWindow() +{ +} + +void FullMainWindow::initLayout() +{ centralwidget = new QWidget(this); verticalLayout = new QVBoxLayout(centralwidget); verticalLayout->setSpacing(0); @@ -28,6 +39,45 @@ FullMainWindow::FullMainWindow(QWidget *parent) : bottomHorizonLayout = new QHBoxLayout(); bottomHorizonLayout->setSpacing(0); bottomHorizonLayout->setContentsMargins(0, 0, 0, 0); +} + +void FullMainWindow::initButtonUI() +{ + m_buttonStyle = QString("%1{border-radius:24px; background: rgba(255, 255, 255, 0.1);}" + "%1:hover {border-radius:24px; background: rgba(255, 255, 255, 0.2);}" + "%1:pressed {border-radius:24px; background: rgba(255, 255, 255, 0.3);}"); + m_lineEdit->setFocusPolicy(Qt::StrongFocus); + horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + m_fullSelectToolButton = new QPushButton(centralwidget); +// fullSelectToolButton->setStyleSheet(m_buttonStyle.arg("QToolButton")); + m_fullSelectToolButton->setObjectName(QString::fromUtf8("fullSelectToolButton")); + m_fullSelectToolButton->setMinimumSize(QSize(48, 48)); + m_fullSelectToolButton->installEventFilter(this); + m_fullSelectToolButton->setFocus(); + QIcon selectIcon; + selectIcon.addFile(QString::fromUtf8(":/data/img/mainviewwidget/full-function.svg"), QSize(), QIcon::Normal, QIcon::Off); + m_fullSelectToolButton->setIcon(selectIcon); + + m_fullSelectMenuButton = new RotationLabel(this); + m_fullSelectMenuButton->installEventFilter(this); + m_fullSelectMenuButton->setStyleSheet("background: transparent;"); + m_fullSelectMenuButton->setFixedSize(QSize(16, 34)); + m_fullSelectMenuButton->setAcceptDrops(true); + m_fullSelectMenuButton->setFocusPolicy(Qt::StrongFocus); + m_fullSelectMenuButton->setIcon(QPixmap(":/data/img/mainviewwidget/DM-arrow-2x.png")); + QPalette palete; + palete.setColor(QPalette::NoRole, Qt::white); + m_fullSelectMenuButton->setPalette(palete); + m_minPushButton = new QPushButton(centralwidget); + m_minPushButton->setObjectName(QString::fromUtf8("minPushButton")); + m_minPushButton->setFixedSize(QSize(48, 48)); + m_minPushButton->setFlat(true); + m_minPushButton->installEventFilter(this); +} + +void FullMainWindow::initSearchUI() +{ + m_searchAppThread = new SearchAppThread; m_lineEdit = new QLineEdit(centralwidget); m_lineEdit->setFixedSize(QSize(372, 36)); m_lineEdit->setLayoutDirection(Qt::LeftToRight); @@ -89,34 +139,10 @@ FullMainWindow::FullMainWindow(QWidget *parent) : queryWidLayout->addWidget(m_queryIcon); queryWidLayout->addWidget(m_queryText); queryWidLayout->setAlignment(Qt::AlignCenter); - m_lineEdit->setFocusPolicy(Qt::StrongFocus); - horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - fullSelectToolButton = new QPushButton(centralwidget); -// fullSelectToolButton->setStyleSheet(m_buttonStyle.arg("QToolButton")); - fullSelectToolButton->setObjectName(QString::fromUtf8("fullSelectToolButton")); - fullSelectToolButton->setMinimumSize(QSize(48, 48)); - fullSelectToolButton->installEventFilter(this); - fullSelectToolButton->setFocus(); - QIcon selectIcon; - selectIcon.addFile(QString::fromUtf8(":/data/img/mainviewwidget/full-function.svg"), QSize(), QIcon::Normal, QIcon::Off); - fullSelectToolButton->setIcon(selectIcon); - fullSelectMenuButton = new QToolButton(centralwidget); - QIcon menuBottonIcon; - fullSelectMenuButton->setStyleSheet("QToolButton{background:transparent;}"); - fullSelectMenuButton->setProperty("useIconHighlightEffect", 0x0); - fullSelectMenuButton->setFixedSize(20, 20); - fullSelectMenuButton->setObjectName(QString::fromUtf8("fullSelectMenuButton")); - fullSelectMenuButton->setPopupMode(QToolButton::InstantPopup); - fullSelectMenuButton->setToolButtonStyle(Qt::ToolButtonIconOnly); - fullSelectMenuButton->installEventFilter(this); - QPalette palete; - palete.setColor(QPalette::NoRole, Qt::white); - fullSelectMenuButton->setPalette(palete); - minPushButton = new QPushButton(centralwidget); - minPushButton->setObjectName(QString::fromUtf8("minPushButton")); - minPushButton->setFixedSize(QSize(48, 48)); - minPushButton->setFlat(true); - minPushButton->installEventFilter(this); +} + +void FullMainWindow::initAppListUI() +{ m_fullStackedWidget = new QStackedWidget(centralwidget); m_fullCommonPage = new FullCommonUseWidget(m_fullStackedWidget); m_fullStackedWidget->addWidget(m_fullCommonPage); @@ -131,38 +157,48 @@ FullMainWindow::FullMainWindow(QWidget *parent) : topHorizontalLayout->addItem(horizontalSpacer); topHorizontalLayout->addWidget(m_lineEdit); topHorizontalLayout->addItem(horizontalSpacer_2); - topHorizontalLayout->addWidget(fullSelectToolButton); - topHorizontalLayout->addWidget(fullSelectMenuButton); - topHorizontalLayout->addWidget(minPushButton); + topHorizontalLayout->addWidget(m_fullSelectToolButton); + topHorizontalLayout->addWidget(m_fullSelectMenuButton); + topHorizontalLayout->addWidget(m_minPushButton); verticalLayout->addLayout(topHorizontalLayout); verticalLayout->addLayout(bottomHorizonLayout); this->setCentralWidget(centralwidget); m_fullStackedWidget->setCurrentIndex(0); - m_menu = new QMenu; - m_allAction = new QAction(m_menu); - m_letterAction = new QAction(m_menu); - m_funcAction = new QAction(m_menu); +} + +void FullMainWindow::initMenu() +{ + m_dropDownMenu = new MenuBox(this); + m_dropDownMenu->setFixedWidth(Style::DropMenuWidth); + m_allAction = new QAction(m_dropDownMenu); + m_letterAction = new QAction(m_dropDownMenu); + m_funcAction = new QAction(m_dropDownMenu); m_allAction->setText(tr("All")); m_allAction->setCheckable(true); m_letterAction->setText(tr("Letter")); m_letterAction->setCheckable(true); m_funcAction->setText(tr("Function")); m_funcAction->setCheckable(true); - m_menu->addAction(m_allAction); - m_menu->addAction(m_letterAction); - m_menu->addAction(m_funcAction); + m_dropDownMenu->addAction(m_allAction); + m_dropDownMenu->addAction(m_letterAction); + m_dropDownMenu->addAction(m_funcAction); m_allAction->setChecked(true); - fullSelectMenuButton->setMenu(m_menu); - setTabOrder(m_lineEdit, fullSelectToolButton); - setTabOrder(fullSelectToolButton, fullSelectMenuButton); - setTabOrder(fullSelectMenuButton, minPushButton); - changeStyle(); +} + +void FullMainWindow::initTabOrder() +{ + setTabOrder(m_lineEdit, m_fullSelectToolButton); + setTabOrder(m_fullSelectToolButton, m_fullSelectMenuButton); + setTabOrder(m_fullSelectMenuButton, m_minPushButton); +} + +void FullMainWindow::initConnect() +{ connect(m_lineEdit, &QLineEdit::textChanged, this, &FullMainWindow::searchAppSlot); connect(this, &FullMainWindow::sendSearchKeyword, m_searchAppThread, &SearchAppThread::recvSearchKeyword); connect(m_searchAppThread, &SearchAppThread::sendSearchResult, this, &FullMainWindow::recvSearchResult); - connect(minPushButton, &QPushButton::clicked, this, &FullMainWindow::on_minPushButton_clicked); - connect(fullSelectToolButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectToolButton_clicked); - connect(fullSelectMenuButton, &QToolButton::triggered, this, &FullMainWindow::on_fullSelectMenuButton_triggered); + connect(m_minPushButton, &QPushButton::clicked, this, &FullMainWindow::on_minPushButton_clicked); + connect(m_fullSelectToolButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectToolButton_clicked); connect(m_fullFunctionPage, &FullFunctionWidget::setFocusToSideWin, this, &FullMainWindow::setFocusToButton); connect(m_fullLetterPage, &FullLetterWidget::setFocusToSideWin, this, &FullMainWindow::setFocusToButton); connect(m_fullCommonPage, &FullCommonUseWidget::setFocusToSideWin, this, &FullMainWindow::setFocusToButton); @@ -171,12 +207,15 @@ FullMainWindow::FullMainWindow(QWidget *parent) : connect(this, &FullMainWindow::sendSetFocusToLet, m_fullLetterPage, &FullLetterWidget::setFocusToThis); connect(this, &FullMainWindow::sendSetFocusToFun, m_fullFunctionPage, &FullFunctionWidget::setFocusToThis); connect(this, &FullMainWindow::sendSetFocusToResult, m_fullResultPage, &FullSearchResultWidget::selectFirstItemTab); - connect(fullSelectMenuButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectMenuButton_clicked); +// connect(m_fullSelectMenuButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectMenuButton_clicked); connect(m_fullCommonPage, &FullCommonUseWidget::sendUpdateOtherView, this, &FullMainWindow::sendUpdateOtherView); -} - -FullMainWindow::~FullMainWindow() -{ + connect(m_fullCommonPage, &FullCommonUseWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide); + connect(m_fullFunctionPage, &FullFunctionWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide); + connect(m_fullLetterPage, &FullLetterWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide); + connect(m_dropDownMenu, &MenuBox::triggered, this, &FullMainWindow::on_fullSelectMenuButton_triggered); + connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() { + selectIconAnimation(false); + }); } void FullMainWindow::updateView() @@ -217,20 +256,15 @@ void FullMainWindow::changeStyle() m_buttonStyle = QString("%1{border-radius:24px; background:" + buttonColorDefault + ";}" "%1:hover {border-radius:24px; background:" + buttonColorHover + ";}" "%1:pressed {border-radius:24px; background:" + buttonColorPress + ";}"); - fullSelectToolButton->setStyleSheet(m_buttonStyle.arg("QPushButton")); - fullSelectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/full-drop-down.svg", false)); - minPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/full-min.svg", false)); - minPushButton->setProperty("useIconHighlightEffect", 0x0); + m_fullSelectToolButton->setStyleSheet(m_buttonStyle.arg("QPushButton")); + m_fullSelectMenuButton->setIcon(QPixmap(":/data/img/mainviewwidget/DM-arrow-2x.png")); + m_minPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/full-min.svg", false)); + m_minPushButton->setProperty("useIconHighlightEffect", 0x0); } void FullMainWindow::on_minPushButton_clicked() { Q_EMIT showNormalWindow(); - pointDataStruct pointData; - pointData.module = "fullWindow/minPushButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void FullMainWindow::paintEvent(QPaintEvent *event) @@ -252,15 +286,10 @@ void FullMainWindow::paintEvent(QPaintEvent *event) bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) { if (watched == m_lineEdit) { - isSearching = true; + m_isSearching = true; char style[200]; if (event->type() == QEvent::FocusIn) { - pointDataStruct pointData; - pointData.module = "fullWindow/Search"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); sprintf(style, "QLineEdit{border:2px solid %s;background-color:%s;border-radius:17px;color:#ffffff;}", QueryLineEditClickedBorder, QueryLineEditClickedBackground); m_lineEdit->setStyleSheet(style); @@ -293,7 +322,7 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) } } - if (watched == minPushButton) { + if (watched == m_minPushButton) { if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = (QKeyEvent *)event; @@ -313,7 +342,7 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) } } - if (watched == minPushButton || watched == fullSelectToolButton || watched == fullSelectMenuButton) { + if (watched == m_minPushButton || watched == m_fullSelectToolButton || watched == m_fullSelectMenuButton) { if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = (QKeyEvent *)event; @@ -324,15 +353,60 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) } } + if (watched == m_fullSelectMenuButton) { + if (event->type() == QEvent::MouseButtonPress) { + selectIconAnimation(true); + return true; + } + } + return QWidget::eventFilter(watched, event); } +void FullMainWindow::iconAnimationFinished() +{ + m_dropDownMenu->raise(); + m_dropDownMenu->exec(m_fullSelectMenuButton->mapToGlobal(QPoint(m_fullSelectMenuButton->width() + -Style::DropMenuWidth, 45))); +} + +void FullMainWindow::selectIconAnimation(const bool &flag) +{ + iconAnimation = new QPropertyAnimation(m_fullSelectMenuButton, "rotation", this); + + if (flag) { + connect(iconAnimation, &QPropertyAnimation::finished, this, &FullMainWindow::iconAnimationFinished); + + if (m_fullSelectMenuButton->property("rotation") == 0) { + iconAnimation->setStartValue(0); + iconAnimation->setEndValue(-180); + } + } else { + if (m_fullSelectMenuButton->property("rotation") == -180) { + iconAnimation->setStartValue(-180); + iconAnimation->setEndValue(0); + } + } + + iconAnimation->setEasingCurve(QEasingCurve::Linear); + iconAnimation->setDuration(300); + iconAnimation->start(QPropertyAnimation::DeleteWhenStopped); +} + +void FullMainWindow::fullWindowHide() +{ + this->hide(); +} + void FullMainWindow::resetEditline() { m_lineEdit->clear(); m_lineEdit->clearFocus(); - m_queryWid->layout()->addWidget(m_queryIcon); - m_queryWid->layout()->addWidget(m_queryText); + m_fullSelectToolButton->setFocus(); + if (m_queryWid->layout()->children().isEmpty()) { + m_queryWid->layout()->addWidget(m_queryIcon); + m_queryWid->layout()->addWidget(m_queryText); + } m_queryIcon->adjustSize(); m_queryText->adjustSize(); m_queryWid->layout()->setAlignment(Qt::AlignCenter); @@ -357,10 +431,10 @@ bool FullMainWindow::event(QEvent *event) QKeyEvent *keyEvent = (QKeyEvent *) event; if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) { - if (fullSelectToolButton->hasFocus()) { - fullSelectToolButton->click(); - } else if (fullSelectMenuButton->hasFocus()) { - fullSelectMenuButton->click(); + if (m_fullSelectToolButton->hasFocus()) { + m_fullSelectToolButton->click(); + } else if (m_fullSelectMenuButton->hasFocus()) { + QApplication::postEvent(m_fullSelectMenuButton, new QEvent(QEvent::MouseButtonPress)); } if (m_lineEdit->hasFocus()) { @@ -406,6 +480,9 @@ void FullMainWindow::searchAppSlot(QString arg) void FullMainWindow::mousePressEvent(QMouseEvent *event) { resetEditline(); + if (event->button() == Qt::LeftButton) { + this->hide(); + } return QMainWindow::mousePressEvent(event); } @@ -418,7 +495,8 @@ void FullMainWindow::recvSearchResult(QVector arg) void FullMainWindow::on_fullSelectToolButton_clicked() { resetEditline(); - fullSelectToolButton->setFocus(); + m_fullSelectToolButton->setFocus(); + selectIconAnimation(false); if (m_fullStackedWidget->currentIndex() == 0) { on_fullSelectMenuButton_triggered(m_letterAction); @@ -436,45 +514,33 @@ void FullMainWindow::on_fullSelectMenuButton_clicked() void FullMainWindow::on_fullSelectMenuButton_triggered(QAction *arg1) { - pointDataStruct pointData; + selectIconAnimation(false); if (arg1 == m_allAction) { m_fullStackedWidget->setCurrentIndex(0); m_fullCommonPage->repaintWidget(); //fullCommonPage->updateListView(); m_state = 0; - fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-all-2x.png")); + m_fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-all-2x.png")); m_allAction->setChecked(true); m_letterAction->setChecked(false); m_funcAction->setChecked(false); - pointData.module = "fullWindow/fullSelectMenuButton"; - pointData.function = "AllSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_letterAction) { m_fullStackedWidget->setCurrentIndex(1); m_fullLetterPage->repaintWidget(); m_state = 1; - fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-letter.svg")); + m_fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-letter.svg")); m_allAction->setChecked(false); m_letterAction->setChecked(true); m_funcAction->setChecked(false); - pointData.module = "fullWindow/fullSelectMenuButton"; - pointData.function = "letterSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_funcAction) { m_fullStackedWidget->setCurrentIndex(2); m_fullFunctionPage->repaintWidget(); m_state = 2; - fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-function.svg")); + m_fullSelectToolButton->setIcon(QIcon(":/data/img/mainviewwidget/full-function.svg")); m_allAction->setChecked(false); m_letterAction->setChecked(false); m_funcAction->setChecked(true); - pointData.module = "fullWindow/fullSelectMenuButton"; - pointData.function = "FunctionSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } } diff --git a/src/UserInterface/full_mainwindow.h b/src/UserInterface/full_mainwindow.h index 3e41bb9..34a91ca 100755 --- a/src/UserInterface/full_mainwindow.h +++ b/src/UserInterface/full_mainwindow.h @@ -12,6 +12,7 @@ #include "full_letter_widget.h" #include "searchappthread.h" #include "full_searchresult_widget.h" +#include "rotationlabel.h" class FullMainWindow : public QMainWindow { @@ -44,6 +45,7 @@ private Q_SLOTS: void recvSearchResult(QVector arg); void setFocusToButton(); void on_fullSelectMenuButton_clicked(); + void fullWindowHide(); protected: @@ -52,6 +54,15 @@ protected: bool eventFilter(QObject *watched, QEvent *event); void mousePressEvent(QMouseEvent *event); void changeStyle(); + void initConnect(); + void initTabOrder(); + void initMenu(); + void initAppListUI(); + void initSearchUI(); + void initButtonUI(); + void initLayout(); + void selectIconAnimation(const bool &flag); + void iconAnimationFinished(); private: QAction *m_allAction = nullptr; @@ -66,9 +77,9 @@ private: QSpacerItem *horizontalSpacer; QLineEdit *m_lineEdit; QSpacerItem *horizontalSpacer_2; - QPushButton *fullSelectToolButton; - QToolButton *fullSelectMenuButton; - QPushButton *minPushButton; + QPushButton *m_fullSelectToolButton; + RotationLabel *m_fullSelectMenuButton; + QPushButton *m_minPushButton; QStackedWidget *m_fullStackedWidget; FullCommonUseWidget *m_fullCommonPage; @@ -81,8 +92,10 @@ private: QWidget *m_queryWid = nullptr; QLabel *m_queryIcon = nullptr; QLabel *m_queryText = nullptr; - bool isSearching = false; + bool m_isSearching = false; QString m_buttonStyle; + QPropertyAnimation *iconAnimation = nullptr; + MenuBox *m_dropDownMenu = nullptr; }; #endif // FULLMAINWINDOW_H diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 984d9f0..d65d221 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -33,7 +33,6 @@ #include #include #include -#include "buriedpointdatasend.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) @@ -52,6 +51,235 @@ MainWindow::MainWindow(QWidget *parent) : m_mainLeftVerticalLayout = new QVBoxLayout(m_viewWidget); m_mainLeftVerticalLayout->setSpacing(9); m_mainLeftVerticalLayout->setContentsMargins(8, 15, 4, 0); + + initSearchUi(); + initLeftWidget(); + initRightWidgetButton(); + initCollectWidget(); + initRecentWidget(); + initTabOrder(); + + m_softwareDbThread = new SoftwareDatabaseUpdateThread; + m_animationPage = new AnimationPage(); + m_maxAnimation = new QPropertyAnimation(m_animationPage, "geometry", this); + m_minAnimation = new QPropertyAnimation(m_animationPage, "geometry", this); + m_searchAppThread = new SearchAppThread; + m_functionBtnWid = new FunctionButtonWidget(m_minFuncPage); + m_functionBtnWid->hide(); + m_letterBtnWid = new LetterButtonWidget(m_minLetterPage); + m_letterBtnWid->hide(); + m_enterAnimation = new QPropertyAnimation; + m_enterAnimation->setPropertyName(QString("geometry").toLocal8Bit()); + m_leaveAnimation = new QPropertyAnimation; + m_leaveAnimation->setPropertyName(QString("geometry").toLocal8Bit()); + + //获取软件商店类别信号 + QDBusConnection::sessionBus().connect("com.kylin.softwarecenter.getsearchresults", + "/com/kylin/softwarecenter/getsearchresults", + "com.kylin.getsearchresults", + "get_app_category_list_signal", + this, + SLOT(updateAppCategorySlot(QString)) + ); + setTabletModeFlag(); + initUi(); + registDbusServer(); + initSignalConnect(); + initGsettings(); +} + +MainWindow::~MainWindow() +{ + closeDataBase("MainThread"); + + if (m_animationPage != nullptr) { + delete m_animationPage; + m_animationPage = nullptr; + } +} + +void MainWindow::setTabletModeFlag() +{ + QDBusConnection::sessionBus().connect("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + "mode_change_signal", + this, + SLOT(tabletModeChangeSlot(bool))); + m_usrInterface = new QDBusInterface("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + QDBusConnection::sessionBus(), this); + QDBusReply res = m_usrInterface->call("get_current_tabletmode"); + if (res.isValid()) { + m_isTabletMode = res; + } +} + +void MainWindow::registDbusServer() +{ + m_dbus = new DBus; + new MenuAdaptor(m_dbus); + m_fullWindow = new FullMainWindow; + QDBusConnection con = QDBusConnection::sessionBus(); + + if (!con.registerService("org.ukui.menu") || + !con.registerObject("/org/ukui/menu", m_dbus)) { + qDebug() << "error:" << con.lastError().message(); + } + + connect(m_dbus, &DBus::sendReloadSignal, this, [ = ] { + updateView(); + }); + connect(m_dbus, &DBus::winKeyResponseSignal, this, [ = ] { + + if (m_isTabletMode) { + return; + } + + if (QGSettings::isSchemaInstalled(QString("org.ukui.session").toLocal8Bit())) + { + QGSettings gsetting(QString("org.ukui.session").toLocal8Bit()); + + if (gsetting.keys().contains("winKeyRelease")) + if (gsetting.get("winKeyRelease").toBool()) { + return; + } + } + if (QGSettings::isSchemaInstalled(QString("org.ukui.screenshot").toLocal8Bit())) + { + QGSettings gsetting(QString("org.ukui.screenshot").toLocal8Bit()); + + if (gsetting.keys().contains("isrunning")) + if (gsetting.get("isrunning").toBool()) { + return; + } + } + + if (this->isVisible()) + { + this->hide(); + m_topStackedWidget->setCurrentIndex(0); + m_lineEdit->clear(); + this->clearFocus(); + m_isFullScreen = false; + } else if (m_fullWindow->isVisible()) + { + m_fullWindow->hide(); + m_fullWindow->clearFocus(); + m_fullWindow->resetEditline(); + m_isFullScreen = true; + } else + { + if (!m_isFullScreen) { + this->show(); + setMinWindowPos(); + this->raise(); + this->activateWindow(); + on_collectPushButton_clicked(); + m_viewWidget->setFocus(); + } else { + m_fullWindow->show(); + setMaxWindowPos(); + // fullWindow->raise(); + m_fullWindow->activateWindow(); + } + } + }); + + repaintWidget(); +} + +void MainWindow::initSignalConnect() +{ + connect(this, &MainWindow::sendClassificationbtnList, m_functionBtnWid, &FunctionButtonWidget::recvClassificationBtnList); + connect(this, &MainWindow::sendLetterClassificationList, m_letterBtnWid, &LetterButtonWidget::recvLetterBtnList); + // connect(m_functionBtnWid, &FunctionButtonWidget::sendFunctionBtnSignal,this,&FunctionWidget::recvFunctionBtnSignal); + connect(m_minFuncListView, &ListView::sendAppClassificationBtnClicked, this, &MainWindow::appClassificationBtnClickedSlot); + connect(m_minLetterListView, &ListView::sendAppClassificationBtnClicked, this, &MainWindow::appClassificationBtnClickedSlot); + connect(m_leaveAnimation, &QPropertyAnimation::finished, this, &MainWindow::animationFinishedSLot); + connect(m_enterAnimation, &QPropertyAnimation::finished, this, &MainWindow::animationFinishedSLot); + connect(m_functionBtnWid, &FunctionButtonWidget::sendFunctionBtnSignal, this, &MainWindow::recvFunctionBtnSignal); + connect(m_letterBtnWid, &LetterButtonWidget::sendLetterBtnSignal, this, &MainWindow::recvFunctionBtnSignal); + connect(m_functionBtnWid, &FunctionButtonWidget::sendResetFunctionPage, this, &MainWindow::resetFunctionPage); + connect(m_letterBtnWid, &LetterButtonWidget::sendResetLetterPage, this, &MainWindow::resetLetterPage); + connect(m_maxAnimation, &QPropertyAnimation::finished, this, &MainWindow::maxAnimationFinished); + connect(m_minAnimation, &QPropertyAnimation::finished, this, &MainWindow::minAnimationFinished); + connect(m_lineEdit, &QLineEdit::textChanged, this, &MainWindow::searchAppSlot); + connect(this, &MainWindow::sendSearchKeyword, m_searchAppThread, &SearchAppThread::recvSearchKeyword); + connect(m_searchAppThread, &SearchAppThread::sendSearchResult, this, &MainWindow::recvSearchResult); + connect(m_fullWindow, &FullMainWindow::showNormalWindow, this, &MainWindow::showNormalWindowSlot); + connect(m_fullWindow, &FullMainWindow::sendUpdateOtherView, this, &MainWindow::updateMinAllView); + connect(m_minSelectButton, &QToolButton::clicked, this, &MainWindow::on_minSelectButton_clicked); + connect(m_dropDownMenu, &MenuBox::triggered, this, &MainWindow::on_selectMenuButton_triggered); + connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() { + selectIconAnimation(false); + }); + connect(m_powerOffButton, &QPushButton::customContextMenuRequested, this, &MainWindow::on_powerOffButton_customContextMenuRequested); + connect(m_powerOffButton, &QPushButton::clicked, this, &MainWindow::on_powerOffButton_clicked); + connect(m_cancelSearchPushButton, &QPushButton::clicked, this, &MainWindow::on_cancelSearchPushButton_clicked); + connect(m_searchPushButton, &QPushButton::clicked, this, &MainWindow::on_searchPushButton_clicked); + connect(m_minMaxChangeButton, &QPushButton::clicked, this, &MainWindow::on_minMaxChangeButton_clicked); + connect(m_minAllListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_minFuncListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_minLetterListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_collectListView, &RightListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); +// QDBusConnection::sessionBus().connect(DBUS_NAME, DBUS_PATH, DBUS_INTERFACE, QString("PanelGeometryRefresh"), this, SLOT(primaryScreenChangeSlot())); + connect(QApplication::desktop(), &QDesktopWidget::resized, this, &MainWindow::primaryScreenChangeSlot); + connect(QApplication::desktop(), &QDesktopWidget::primaryScreenChanged, this, &MainWindow::primaryScreenChangeSlot); + connect(QApplication::desktop(), &QDesktopWidget::screenCountChanged, this, &MainWindow::primaryScreenChangeSlot); + + //监控应用进程开启 + connect(KWindowSystem::self(), &KWindowSystem::windowAdded, [ = ](WId id) { + ConvertWinidToDesktop reply; + QString desktopfp = reply.tranIdToDesktop(id); + + if (!desktopfp.isEmpty()) { + ViewOpenedSlot(desktopfp); + } + }); +} + +void MainWindow::initGsettings() +{ + //监听屏幕缩放 + if (QGSettings::isSchemaInstalled(QString("org.ukui.SettingsDaemon.plugins.xsettings").toLocal8Bit())) { + QGSettings *m_gsetting = new QGSettings(QString("org.ukui.SettingsDaemon.plugins.xsettings").toLocal8Bit()); + connect(m_gsetting, &QGSettings::changed, this, [ = ](const QString & key) { + if (key == "scalingFactor") { + repaintWidget(); + } + }); + } + + if (QGSettings::isSchemaInstalled(QString("org.ukui.panel.settings").toLocal8Bit())) { + QGSettings *gsetting = new QGSettings(QString("org.ukui.panel.settings").toLocal8Bit()); + connect(gsetting, &QGSettings::changed, + this, &MainWindow::repaintWidget); + } + + if (QGSettings::isSchemaInstalled(QString("org.ukui.style").toLocal8Bit())) { + QGSettings *gsetting = new QGSettings("org.ukui.style", QByteArray(), this); + connect(gsetting, &QGSettings::changed, [ = ](QString key) { + if ("systemFont" == key || "systemFontSize" == key) { + m_leftTopSearchHorizontalLayout->removeWidget(m_lineEdit); + m_leftTopSearchHorizontalLayout->removeWidget(m_cancelSearchPushButton); + m_lineEdit->setParent(nullptr); + m_leftTopSearchHorizontalLayout->addWidget(m_lineEdit); + m_leftTopSearchHorizontalLayout->addWidget(m_cancelSearchPushButton); + m_lineEdit->setPlaceholderText("搜索应用"); + m_fullWindow->updateView(); + } + + if (key.contains(QString("styleName"))) { + changeStyle(); + } + }); + } +} + +void MainWindow::initSearchUi() +{ //搜索框部分 m_topStackedWidget = new QStackedWidget(m_viewWidget); m_topStackedWidget->setFixedHeight(34); @@ -68,9 +296,11 @@ MainWindow::MainWindow(QWidget *parent) : m_searchPushButton->setFixedSize(QSize(26, 26)); m_searchPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/search.svg", true)); m_searchPushButton->installEventFilter(this); + m_searchPushButton->setToolTip(tr("Search")); m_minSelectButton = new QPushButton(m_minMenuPage); m_minSelectButton->setFixedSize(QSize(26, 26)); m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-all.svg", true)); + m_minSelectButton->setToolTip(tr("All")); m_minSelectButton->installEventFilter(this); m_selectMenuButton = new RotationLabel(m_minMenuPage); m_selectMenuButton->installEventFilter(this); @@ -96,6 +326,10 @@ MainWindow::MainWindow(QWidget *parent) : m_cancelSearchPushButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-close-2x.png", true)); m_topStackedWidget->addWidget(m_minMenuPage); m_topStackedWidget->addWidget(m_minSearchPage); +} + +void MainWindow::initLeftWidget() +{ //左侧列表区 m_leftStackedWidget = new QStackedWidget(m_viewWidget); m_leftStackedWidget->setFixedSize(QSize(300, Style::leftPageHeight)); @@ -126,6 +360,10 @@ MainWindow::MainWindow(QWidget *parent) : m_minSearchResultListView->setFixedSize(QSize(Style::leftPageWidth, Style::leftPageHeight)); m_minSearchResultListView->installEventFilter(this); m_leftStackedWidget->addWidget(m_minSearchResultPage); +} + +void MainWindow::initRightWidgetButton() +{ //右侧窗口 m_mainRightVerticalLayout = new QVBoxLayout(); m_mainRightVerticalLayout->setSpacing(0); @@ -157,17 +395,21 @@ MainWindow::MainWindow(QWidget *parent) : m_rightTopHorizontalLayout->addItem(m_horizontalSpacer_3); m_rightTopHorizontalLayout->addWidget(m_minMaxChangeButton); m_verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); +} + +void MainWindow::initCollectWidget() +{ //右侧列表区 m_rightStackedWidget = new QStackedWidget(m_centralwidget); - m_rightStackedWidget->setFixedSize(QSize(324, 490)); + m_rightStackedWidget->setFixedSize(QSize(352, 490)); m_rightStackedWidget->setFocusPolicy(Qt::StrongFocus); m_collectPage = new QWidget(); - m_collectPage->setFixedSize(QSize(324, 480)); + m_collectPage->setFixedSize(QSize(332, 480)); m_rightCollectLayout = new QVBoxLayout(m_collectPage); m_rightCollectLayout->setContentsMargins(0, 18, 0, 0); //收藏视图 m_collectListView = new RightListView(m_collectPage); - m_collectListView->setFixedSize(QSize(324, 428)); + m_collectListView->setFixedSize(QSize(332, 420)); m_collectListView->setAcceptDrops(true); m_collectListView->setAutoFillBackground(false); m_collectListView->setProperty("showDropIndicator", QVariant(true)); @@ -180,9 +422,13 @@ MainWindow::MainWindow(QWidget *parent) : m_collectListView->setSelectionRectVisible(true); m_collectListView->installEventFilter(this); m_recentPage = new QWidget(); - m_recentPage->setFixedSize(QSize(324, 490)); + m_recentPage->setFixedSize(QSize(352, 490)); m_rightRecentLayout = new QVBoxLayout(m_recentPage); m_rightRecentLayout->setContentsMargins(0, 20, 0, 0); +} + +void MainWindow::initRecentWidget() +{ //最近视图 m_recentListView = new ListView(m_recentPage); m_recentListView->installEventFilter(this); @@ -248,202 +494,16 @@ MainWindow::MainWindow(QWidget *parent) : m_leftStackedWidget->setCurrentIndex(0); m_minMaxChangeButton->setDefault(false); m_rightStackedWidget->setCurrentIndex(0); - //设置tab切换顺序 - // setTabOrder(widget, searchPushButton); +} + +void MainWindow::initTabOrder() +{ setTabOrder(m_searchPushButton, m_minSelectButton); setTabOrder(m_minSelectButton, m_selectMenuButton); setTabOrder(m_selectMenuButton, m_collectPushButton); setTabOrder(m_collectPushButton, m_recentPushButton); setTabOrder(m_recentPushButton, m_minMaxChangeButton); setTabOrder(m_minMaxChangeButton, m_powerOffButton); - m_softwareDbThread = new SoftwareDatabaseUpdateThread; - //获取软件商店类别信号 - QDBusConnection::sessionBus().connect("com.kylin.softwarecenter.getsearchresults", - "/com/kylin/softwarecenter/getsearchresults", - "com.kylin.getsearchresults", - "get_app_category_list_signal", - this, - SLOT(updateAppCategorySlot(QString)) - ); - initUi(); - m_functionBtnWid = new FunctionButtonWidget(m_minFuncPage); - m_functionBtnWid->hide(); - m_letterBtnWid = new LetterButtonWidget(m_minLetterPage); - m_letterBtnWid->hide(); - m_enterAnimation = new QPropertyAnimation; - m_enterAnimation->setPropertyName(QString("geometry").toLocal8Bit()); - m_leaveAnimation = new QPropertyAnimation; - m_leaveAnimation->setPropertyName(QString("geometry").toLocal8Bit()); - connect(this, &MainWindow::sendClassificationbtnList, m_functionBtnWid, &FunctionButtonWidget::recvClassificationBtnList); - connect(this, &MainWindow::sendLetterClassificationList, m_letterBtnWid, &LetterButtonWidget::recvLetterBtnList); - // connect(m_functionBtnWid, &FunctionButtonWidget::sendFunctionBtnSignal,this,&FunctionWidget::recvFunctionBtnSignal); - connect(m_minFuncListView, &ListView::sendAppClassificationBtnClicked, this, &MainWindow::appClassificationBtnClickedSlot); - connect(m_minLetterListView, &ListView::sendAppClassificationBtnClicked, this, &MainWindow::appClassificationBtnClickedSlot); - connect(m_leaveAnimation, &QPropertyAnimation::finished, this, &MainWindow::animationFinishedSLot); - connect(m_enterAnimation, &QPropertyAnimation::finished, this, &MainWindow::animationFinishedSLot); - connect(m_functionBtnWid, &FunctionButtonWidget::sendFunctionBtnSignal, this, &MainWindow::recvFunctionBtnSignal); - connect(m_letterBtnWid, &LetterButtonWidget::sendLetterBtnSignal, this, &MainWindow::recvFunctionBtnSignal); - connect(m_functionBtnWid, &FunctionButtonWidget::sendResetFunctionPage, this, &MainWindow::resetFunctionPage); - connect(m_letterBtnWid, &LetterButtonWidget::sendResetLetterPage, this, &MainWindow::resetLetterPage); - m_searchAppThread = new SearchAppThread; - m_dbus = new DBus; - new MenuAdaptor(m_dbus); - m_fullWindow = new FullMainWindow; - QDBusConnection con = QDBusConnection::sessionBus(); - - if (!con.registerService("org.ukui.menu") || - !con.registerObject("/org/ukui/menu", m_dbus)) { - qDebug() << "error:" << con.lastError().message(); - } - - connect(m_dbus, &DBus::sendReloadSignal, this, [ = ] { - updateView(); - }); - connect(m_dbus, &DBus::winKeyResponseSignal, this, [ = ] { - if (QGSettings::isSchemaInstalled(QString("org.ukui.session").toLocal8Bit())) - { - QGSettings gsetting(QString("org.ukui.session").toLocal8Bit()); - - if (gsetting.keys().contains("winKeyRelease")) - if (gsetting.get("winKeyRelease").toBool()) { - return; - } - } - if (QGSettings::isSchemaInstalled(QString("org.ukui.screenshot").toLocal8Bit())) - { - QGSettings gsetting(QString("org.ukui.screenshot").toLocal8Bit()); - - if (gsetting.keys().contains("isrunning")) - if (gsetting.get("isrunning").toBool()) { - return; - } - } - - if (this->isVisible()) - { - this->hide(); - this->clearFocus(); - m_isFullScreen = false; - pointDataStruct pointData; - pointData.module = "mainWindow"; - pointData.function = "winHide"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); - } else if (m_fullWindow->isVisible()) - { - m_fullWindow->hide(); - m_fullWindow->clearFocus(); - pointDataStruct pointData; - pointData.module = "fullWindow"; - pointData.function = "winHide"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); - m_isFullScreen = true; - } else - { - if (!m_isFullScreen) { - this->show(); - setMinWindowPos(); - this->raise(); - this->activateWindow(); - pointDataStruct pointData; - pointData.module = "mainWindow"; - pointData.function = "winShow"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); - on_collectPushButton_clicked(); - m_viewWidget->setFocus(); - } else { - m_fullWindow->show(); - setMaxWindowPos(); -// fullWindow->raise(); - m_fullWindow->activateWindow(); - pointDataStruct pointData; - pointData.module = "fullWindow"; - pointData.function = "winShow"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); - } - } - }); - m_animationPage = new AnimationPage(); - m_maxAnimation = new QPropertyAnimation(m_animationPage, "geometry", this); - m_minAnimation = new QPropertyAnimation(m_animationPage, "geometry", this); - connect(m_maxAnimation, &QPropertyAnimation::finished, this, &MainWindow::maxAnimationFinished); - connect(m_minAnimation, &QPropertyAnimation::finished, this, &MainWindow::minAnimationFinished); - connect(m_lineEdit, &QLineEdit::textChanged, this, &MainWindow::searchAppSlot); - connect(this, &MainWindow::sendSearchKeyword, m_searchAppThread, &SearchAppThread::recvSearchKeyword); - connect(m_searchAppThread, &SearchAppThread::sendSearchResult, this, &MainWindow::recvSearchResult); - connect(m_fullWindow, &FullMainWindow::showNormalWindow, this, &MainWindow::showNormalWindowSlot); - connect(m_fullWindow, &FullMainWindow::sendUpdateOtherView, this, &MainWindow::updateMinAllView); - connect(m_minSelectButton, &QToolButton::clicked, this, &MainWindow::on_minSelectButton_clicked); - connect(m_dropDownMenu, &MenuBox::triggered, this, &MainWindow::on_selectMenuButton_triggered); - connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() { - m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/downarrow.svg", true) - .pixmap(QSize(Style::miniIconSize, Style::miniIconSize))); - selectIconAnimation(false); - }); - connect(m_powerOffButton, &QPushButton::customContextMenuRequested, this, &MainWindow::on_powerOffButton_customContextMenuRequested); - connect(m_powerOffButton, &QPushButton::clicked, this, &MainWindow::on_powerOffButton_clicked); - connect(m_cancelSearchPushButton, &QPushButton::clicked, this, &MainWindow::on_cancelSearchPushButton_clicked); - connect(m_searchPushButton, &QPushButton::clicked, this, &MainWindow::on_searchPushButton_clicked); - connect(m_minMaxChangeButton, &QPushButton::clicked, this, &MainWindow::on_minMaxChangeButton_clicked); - QDBusConnection::sessionBus().connect(DBUS_NAME, DBUS_PATH, DBUS_INTERFACE, QString("PanelGeometryRefresh"), this, SLOT(primaryScreenChangeSlot())); - - //监听屏幕缩放 - if (QGSettings::isSchemaInstalled(QString("org.ukui.SettingsDaemon.plugins.xsettings").toLocal8Bit())) { - QGSettings *m_gsetting = new QGSettings(QString("org.ukui.SettingsDaemon.plugins.xsettings").toLocal8Bit()); - connect(m_gsetting, &QGSettings::changed, this, [ = ](const QString & key) { - if (key == "scalingFactor") { - repaintWidget(); - } - }); - } - - if (QGSettings::isSchemaInstalled(QString("org.ukui.panel.settings").toLocal8Bit())) { - QGSettings *gsetting = new QGSettings(QString("org.ukui.panel.settings").toLocal8Bit()); - connect(gsetting, &QGSettings::changed, - this, &MainWindow::repaintWidget); - } - - if (QGSettings::isSchemaInstalled(QString("org.ukui.style").toLocal8Bit())) { - QGSettings *gsetting = new QGSettings("org.ukui.style", QByteArray(), this); - connect(gsetting, &QGSettings::changed, [ = ](QString key) { - if ("systemFont" == key || "systemFontSize" == key) { - m_leftTopSearchHorizontalLayout->removeWidget(m_lineEdit); - m_leftTopSearchHorizontalLayout->removeWidget(m_cancelSearchPushButton); - m_lineEdit->setParent(nullptr); - m_leftTopSearchHorizontalLayout->addWidget(m_lineEdit); - m_leftTopSearchHorizontalLayout->addWidget(m_cancelSearchPushButton); - m_lineEdit->setPlaceholderText(QApplication::translate("MainWindow", "Search application")); - m_fullWindow->updateView(); - } - - if (key.contains(QString("styleName"))) { - changeStyle(); - } - }); - } - - //监控应用进程开启 - connect(KWindowSystem::self(), &KWindowSystem::windowAdded, [ = ](WId id) { - ConvertWinidToDesktop reply; - QString desktopfp = reply.tranIdToDesktop(id); - - if (!desktopfp.isEmpty()) { - ViewOpenedSlot(desktopfp); - } - }); -} - -MainWindow::~MainWindow() -{ - closeDataBase("MainThread"); - - if (m_animationPage != nullptr) { - delete m_animationPage; - m_animationPage = nullptr; - } } void MainWindow::initUi() @@ -509,6 +569,10 @@ void MainWindow::initUi() connect(m_desktopWatcher, &DesktopWatcher::directoryChangedSignal, this, &MainWindow::updateView); connect(m_desktopWatcher, &DesktopWatcher::updateRecentList, this, &MainWindow::updateRecentView); connect(this, &MainWindow::sendStyleChangeSignal, m_viewWidget, &MainViewWidget::styleChangeSlot); + connect(m_minAllListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_minFuncListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_minLetterListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); + connect(m_minSearchResultListView, &ListView::sendHideMainWindowSignal, this, &MainWindow::hideWindow); changeStyle(); } @@ -585,6 +649,10 @@ void MainWindow::changeStyle() void MainWindow::paintEvent(QPaintEvent *event) { double transparency = getTransparency(); + QColor curColor = m_windowColor; + if ( transparency == 1) { + curColor.setAlpha(255); + } QRect rect = this->rect(); QPainterPath path; // rect.setTopLeft(QPoint(rect.x()+320,rect.y())); @@ -601,11 +669,10 @@ void MainWindow::paintEvent(QPaintEvent *event) path.quadTo(rect.bottomRight(), rect.bottomRight() + QPointF(0, -radius)); path.lineTo(rect.topRight() + QPointF(0, radius)); path.quadTo(rect.topRight(), rect.topRight() + QPointF(-radius, -0)); - painter.setBrush(m_windowColor); + painter.setBrush(curColor); painter.setPen(Qt::transparent); painter.setOpacity(transparency); painter.drawPath(path); - // setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon())); KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon())); QMainWindow::paintEvent(event); } @@ -618,6 +685,8 @@ bool MainWindow::event(QEvent *event) if (QApplication::activeWindow() != this) { qDebug() << " * 鼠标点击窗口外部事件"; this->hide(); + m_topStackedWidget->setCurrentIndex(0); + m_lineEdit->clear(); } } @@ -1040,7 +1109,6 @@ void MainWindow::searchAppSlot(QString arg) } void MainWindow::on_selectMenuButton_triggered(QAction *arg1) { - pointDataStruct pointData; m_selectMenuButton->setIcon(getCurIcon(":/data/img/mainviewwidget/downarrow.svg", true).pixmap(QSize(Style::miniIconSize, Style::miniIconSize))); selectIconAnimation(false); @@ -1048,38 +1116,29 @@ void MainWindow::on_selectMenuButton_triggered(QAction *arg1) m_leftStackedWidget->setCurrentIndex(0); m_state = 0; m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-all.svg", true)); + m_minSelectButton->setToolTip(tr("All")); m_minSelectTextLabel->setText(tr("All")); m_allAction->setChecked(true); m_letterAction->setChecked(false); m_funcAction->setChecked(false); - pointData.module = "mainWindow/selectMenuButton"; - pointData.function = "AllSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_letterAction) { m_leftStackedWidget->setCurrentIndex(1); m_state = 1; m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-letter.svg", true)); + m_minSelectButton->setToolTip(tr("Letter")); m_minSelectTextLabel->setText(tr("Letter")); m_allAction->setChecked(false); m_letterAction->setChecked(true); m_funcAction->setChecked(false); - pointData.module = "mainWindow/selectMenuButton"; - pointData.function = "LetterSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else if (arg1 == m_funcAction) { m_leftStackedWidget->setCurrentIndex(2); m_state = 2; m_minSelectButton->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-function.svg", true)); + m_minSelectButton->setToolTip(tr("Function")); m_minSelectTextLabel->setText(tr("Function")); m_allAction->setChecked(false); m_letterAction->setChecked(false); m_funcAction->setChecked(true); - pointData.module = "mainWindow/selectMenuButton"; - pointData.function = "FunctionSelect"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } } void MainWindow::updateCollectView() @@ -1129,10 +1188,6 @@ void MainWindow::databaseThreadCloseSlot() void MainWindow::on_collectPushButton_clicked() { m_rightStackedWidget->setCurrentIndex(0); - pointDataStruct pointData; - pointData.module = "mainWindow/collectPushButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; m_collectPushButton->setStyleSheet("color:#3790FA;"); QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2); @@ -1156,11 +1211,6 @@ void MainWindow::on_recentPushButton_clicked() m_collectPushButton->setFont(collectFont); m_recentPushButton->setStyleSheet("color:#3790FA"); - pointDataStruct pointData; - pointData.module = "mainWindow/recentPushButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - QFont recentFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2); m_recentPushButton->setFont(recentFont); updateRecentView(); @@ -1169,21 +1219,11 @@ void MainWindow::on_cancelSearchPushButton_clicked() { m_topStackedWidget->setCurrentIndex(0); m_lineEdit->clear(); - pointDataStruct pointData; - pointData.module = "mainWindow/cancelSearchPushButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::on_searchPushButton_clicked() { m_topStackedWidget->setCurrentIndex(1); m_lineEdit->setFocus(); - pointDataStruct pointData; - pointData.module = "mainWindow/searchPushButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::on_minMaxChangeButton_clicked() { @@ -1208,60 +1248,40 @@ void MainWindow::on_minMaxChangeButton_clicked() m_maxAnimation->setDuration(260); m_maxAnimation->start(); this->hide(); - pointDataStruct pointData; - pointData.module = "mainWindow/minMaxChangeButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::showWindow() { + Style::initWidStyle(); + myDebug() << "调用开始菜单显示"; if (m_isFullScreen) { - m_fullWindow->raise(); - m_fullWindow->showNormal(); + m_fullWindow->show(); setMaxWindowPos(); + m_fullWindow->raise(); m_fullWindow->activateWindow(); - pointDataStruct pointData; - pointData.module = "fullWindow"; - pointData.function = "Show"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else { - this->raise(); - this->showNormal(); + this->show(); setMinWindowPos(); + this->raise(); this->activateWindow(); -// m_collectPushButton->clicked(true); on_collectPushButton_clicked(); m_viewWidget->setFocus(); - pointDataStruct pointData; - pointData.module = "mainWindow"; - pointData.function = "Show"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } } void MainWindow::hideWindow() { + myDebug() << "调用开始菜单隐藏"; if (m_fullWindow->isVisible()) { m_fullWindow->hide(); + m_fullWindow->resetEditline(); this->clearFocus(); m_isFullScreen = true; - pointDataStruct pointData; - pointData.module = "fullWindow"; - pointData.function = "Hide"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } else { this->hide(); + m_topStackedWidget->setCurrentIndex(0); + m_lineEdit->clear(); this->clearFocus(); m_isFullScreen = false; - pointDataStruct pointData; - pointData.module = "mainWindow"; - pointData.function = "Hide"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } } @@ -1345,20 +1365,11 @@ void MainWindow::showNormalWindowSlot() void MainWindow::on_powerOffButton_clicked() { QProcess::startDetached(QString("ukui-session-tools")); - pointDataStruct pointData; - pointData.module = "mainWindow/powerOffButton"; - pointData.function = "Clicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); } void MainWindow::on_powerOffButton_customContextMenuRequested(const QPoint &pos) { + Q_UNUSED(pos); RightClickMenu m_otherMenu(this); - m_otherMenu.showShutdownMenu(this->mapToGlobal(m_centralwidget->rect().bottomRight())); - pointDataStruct pointData; - pointData.module = "mainWindow/powerOffButton"; - pointData.function = "RightClicked"; - pointData.functionNum = ""; - BuriedPointDataSend::getInstance()->setPoint(pointData); + m_otherMenu.showShutdownMenu(this->mapToGlobal(m_centralwidget->rect().bottomRight()), false); qDebug() << "SideBarWidget::shutdownBtnRightClickSlot() 开始"; } diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h index 7dede39..4f0baf3 100755 --- a/src/UserInterface/mainwindow.h +++ b/src/UserInterface/mainwindow.h @@ -70,6 +70,16 @@ public: void hideWindow(); protected: + void initSearchUi(); + void initLeftWidget(); + void initRightWidgetButton(); + void initCollectWidget(); + void initRecentWidget(); + void initTabOrder(); + void initGsettings(); + void initSignalConnect(); + void registDbusServer(); + void setTabletModeFlag(); void initUi(); /** * @brief 处理外部点击事件和主窗口键盘控制 @@ -233,6 +243,8 @@ private: LetterButtonWidget *m_letterBtnWid = nullptr; SoftwareDatabaseUpdateThread *m_softwareDbThread = nullptr; QColor m_windowColor; + bool m_isTabletMode = false; + QDBusInterface *m_usrInterface = nullptr; }; #endif // MAINWINDOW_H diff --git a/src/UtilityFunction/Style/style.cpp b/src/UtilityFunction/Style/style.cpp index a7ea91a..53378bd 100755 --- a/src/UtilityFunction/Style/style.cpp +++ b/src/UtilityFunction/Style/style.cpp @@ -152,7 +152,7 @@ void Style::initWidStyle() LeftLetterFontSize = 14; LeftSpaceBetweenItem = 15; AppListIconSize = 86; - AppListItemSizeWidth = 150; + AppListItemSizeWidth = 168; m_applistGridSizeWidth = 220; AppSpaceBetweenIconText = 18; } else if (m_availableScreenWidth >= 1600 && m_availableScreenWidth < 1920) { @@ -210,7 +210,7 @@ void Style::initWidStyle() QueryLineEditHeight = 30; LeftLetterBtnHeight = 25; LeftIconSize = 19; - DropMenuWidth = 140; + DropMenuWidth = 170; DropMenuHeight = 112; miniIconSize = 8; rightViewWidth = 324; diff --git a/src/UtilityFunction/utility.h b/src/UtilityFunction/utility.h index 9d5f7a9..4491673 100755 --- a/src/UtilityFunction/utility.h +++ b/src/UtilityFunction/utility.h @@ -32,26 +32,6 @@ #define myDebug() qDebug() << QString("%1 %2 行 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__) -typedef struct pointDataStruct { - QString module; - QString function; - QString functionNum; - QStringList otherFunction; - QString errorLevel; - QString errorOutput; - QString timeStamp; - pointDataStruct() - { - module = QString(); - function = QString(); - functionNum = QString(); - otherFunction = QStringList(); - errorLevel = QString(); - errorOutput = QString(); - timeStamp = QString(); - } -} pointDataStruct; - static int collectCount = 0; const QPixmap loadSvg(const QString &fileName, const int size); diff --git a/translations/ukui-menu_bo.qm b/translations/ukui-menu_bo.qm deleted file mode 100755 index be651ee..0000000 --- a/translations/ukui-menu_bo.qm +++ /dev/null @@ -1 +0,0 @@ - FullMainWindow - + Search - + All - + Letter - + Function @@ -27,64 +27,77 @@ FunctionWidget - + Search + + ItemDelegate + + + Open the function sort menu + + + + + Open the alphabetical menu + + + MainWindow - + collection - - - + + + + + All - + + Search - + No recent files - + recent - + Max - + PowerOff - - Search application - - - - - + + + Letter - - + + + Function @@ -244,22 +257,22 @@ TabletRightClickMenu - + Pin to taskbar - + Unpin from taskbar - + Add to desktop shortcuts - + Uninstall diff --git a/translations/ukui-menu_tr.qm b/translations/ukui-menu_tr.qm deleted file mode 100755 index 927e24f891f983acc5806a2019044d7970e5bc5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2709 zcmcgsU1%It6h4#9%>E=UC8*>f;Mhlvu~oDPeMxMRRui&jo7C1qJ3DiC_jYIREHigo z5_}RLe2Rz`f-Q)kA`-+0AF5C)p&~7a&?1Q7llb#c6nu~%dGNb4o7wE{Y%E0$?4Hcd zIp6ut_nmtWUvWln{(kx5*AI_fJNxd{AEt;jlj!I;g?}n)12p*EQ$zz#QsL0Ih!&lC z^a~l#sNE%n&eTd4aob#fVT@QObE`6l3a6g68v{mn(-Z0hIk zyor26zx3KV-oMw1x1*@Nt-t>c@KaCd8*f}k{+j;DM_2KDR=;se09P2luKtMU&!U*# zOn*8GzWQS3hOvbAk7RCsh&p2;yME{oqV#MOGvDW4-*^Rim!g9>~BaHR-x(#QaRt zb>}TEPH^FP7c`ZsC6r6zREvv^IVL6Z z`;{6f^~q|d7n$YT)q6{iSf1ccg~@QH{tD#oZTjxAyPUkcY>%nCQy-)P1oB`CWP+J) z_}vz4=ml-{A|do+~K%>tZr3$llN%{0IT-PN5q=M;F)6r8zNXQ|NWq&zymUA3B)R( z))F8hs2z+^jD>QU+r52rbc8rmK;K=tvda7*VW1+U4$#RWx1C+|Y;J`Ir$ek^Du&$D zOl@_I;z}S{y$3r-%gA<+>&3|WGIyBQllnBxgFt}KHohgkO{!@J!(UcF(A^mxLRxso zsD@uy3_CjMIHvSWhXpn1HO!#u`O!Wg4z&`?V%K-I);!a+*y-fn6`bDmu@i?+{Lbe$xy$ zxPN-itC$PTa7B{3Phf&3x~h&!GBpFo^PjYe|CL}&JA>aj7;+LZ?gItvfhR1NuQF3s zd0@Ic=-Xv%=SGF_$`oZ$33#0|<_cUW`K{Jvn=s-y&4QW_YUcs-3#gZLFmMwS}m~Y~YsBKG9aEwlZj=(f(M+Hbskp<1vd28dO z7g-=Jzpp|g;W@2^Ud&@v9cso}>qVEbM!){UA#0Z$c;7y$*(JdRI`)_HK+BUZ(ZW53 z>!IH`KA55#JHI3vaH{Nk^}W2B*~2Rbuu7^9zgkB~tzS~xkzH;7!O8#hBDnv!RdSh3 WSfGDxJNvh|8@Kyc|4)`A6ZjiS|3C}? diff --git a/translations/ukui-menu_tr.ts b/translations/ukui-menu_tr.ts index 3e5245e..756c8b1 100755 --- a/translations/ukui-menu_tr.ts +++ b/translations/ukui-menu_tr.ts @@ -4,22 +4,22 @@ FullMainWindow - + Search Ara - + All Tümü - + Letter Alfabetik - + Function Kategori @@ -118,7 +118,7 @@ Diğer - + Search Ara @@ -170,6 +170,19 @@ Diğer + + ItemDelegate + + + Open the function sort menu + + + + + Open the alphabetical menu + + + MainViewWidget @@ -192,56 +205,56 @@ MainWindow - + collection - - - + + + + + All Tümü - + + Search Ara - + No recent files - + recent - + Max - + PowerOff - - Search application - - - - - + + + Letter Alfabetik - - + + + Function Kategori @@ -538,22 +551,22 @@ TabletRightClickMenu - + Pin to taskbar Görev çubuğuna sabitle - + Unpin from taskbar Görev çubuğundan sabitlemeyi kaldır - + Add to desktop shortcuts Masaüstü kısayollarına ekle - + Uninstall Kaldır diff --git a/translations/ukui-menu_zh_CN.qm b/translations/ukui-menu_zh_CN.qm deleted file mode 100755 index e8865871b3920806150ebcecabebfd9694b0317c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2320 zcmb7EZDo9}ctv&&QsuhI*)O*X1LiqxZPS);&gu z>9mlIy0e}-c)#D1nfMOyriIMog=2RgfIhtF%ZVY#V}*r|^>18Sei(eJysPm>@Oe`~ zh&|;51{IKhoN>VoV&Lc8q^c~Sw;`pfO@gAeE1IOI9VXMokMDlLGXvicwyPnfiH4$U z6(wEm(JAq#o(z#Njo2`7qM|^m*}1%DIQ3pZ5X3@4lq(7Xa(BHcsvxlPYgeQQHXP1> z;UYw5ZEdY->zP%jeMe@q=IKTmeXdT-CR4bsT!_4%<@k zhu>czRF9~uDkg&~iylFltAxxXu!uFo*0mP}3&e$=;y$eE@mQYC2AV_LAWCj`DBQ98 zIPr9UCZ$B-)#8*Awe_LJgh+iZ#IPB7-2)QFyn$o-o9ekt@y1D-qfFL{-FS6V_7J9Mzc-L?W_{dW36E<(g{8_O(6l`h{P^)r9IJ z?u_n#%DqLjo)$$jLksy2j!iI+B`?|CrFmKD3fl!=WU2jG{*YX#*qhfILNXc>tnZLb zXev;Aw%ob1#pMr|T`-S-+Dx-QyH6q&R`EEd_hBxa&|}>E`BHnQT2~V>%j2XWBr3L+ zN(*U@u<4+RaoileU2;@#M`kDCy0>VG2HutXUge)I9$D~uY|!i_aqw=@;xN2iU31th t@lRXLFEj8J8O$??{0hDP_AYA`LMk?FX8XSvqq4 FullMainWindow - + Search 搜索应用 - + All 全部 - + Letter 字母排序 - + Function 功能分类 @@ -27,64 +27,89 @@ FunctionWidget - + Search 全局搜索 + + ItemDelegate + + Open feature sort list + 打开功能排序菜单 + + + Open alphabetical list + 打开字母排序菜单 + + + + Open the function sort menu + 打开功能排序菜单 + + + + Open the alphabetical menu + 打开字母排序菜单 + + MainWindow - + + Search 搜索应用 - + No recent files 暂无最近文件 - - - + + + + + All 全部 - + collection 收藏 - + recent 最近 - + Max 放大 - + PowerOff - 关机 + 电源 - Search application - 搜索应用 + 搜索应用 - - + + + Letter 字母排序 - - + + + Function 功能分类 @@ -244,22 +269,22 @@ TabletRightClickMenu - + Pin to taskbar 固定到任务栏 - + Unpin from taskbar 从任务栏取消固定 - + Add to desktop shortcuts 固定到桌面快捷方式 - + Uninstall 卸载 diff --git a/ukui-menu.pro b/ukui-menu.pro index bb62748..c249692 100755 --- a/ukui-menu.pro +++ b/ukui-menu.pro @@ -52,7 +52,7 @@ PKGCONFIG+=glib-2.0 gio-unix-2.0 gsettings-qt libbamf3 x11 xtst kysdk-waylandhel CONFIG += no_keywords link_pkgconfig -LIBS+=-pthread -luchardet -lukui-log4qt -lukui-com4c -lukui-com4cxx -lpeony -ldl -lcrypto +LIBS+=-pthread -luchardet -lukui-log4qt -lukui-com4c -lukui-com4cxx -lpeony desktop_file.files = ukui-menu.desktop desktop_file.path = /etc/xdg/autostart From fc64d521068658189fac85ce984334249d3604dc Mon Sep 17 00:00:00 2001 From: lixueman Date: Tue, 12 Jul 2022 08:54:54 +0000 Subject: [PATCH 13/30] =?UTF-8?q?!8=20=E8=A7=A3=E5=86=B3wayland=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E7=8A=B6=E6=80=81=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95=E5=8D=95=E4=BE=8B=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=9A=90=E8=97=8F=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 7 ++++++ .../qtsingleapplication.cpp | 22 +++++++++---------- src/UserInterface/ListView/klistview.cpp | 1 + src/UserInterface/mainwindow.cpp | 13 ++++++++++- src/UserInterface/mainwindow.h | 6 ++--- 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7351f55..14d1fa8 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ukui-menu (3.1.1-ok4~0712) yangtze; urgency=medium + + * close-cd #128498 + 修复【wayland】【开始菜单】多次点击tab键和回车键后,开始菜单点不开问题 + + -- lixueman Tue, 12 Jul 2022 16:11:49 +0800 + ukui-menu (3.1.1-ok4~0708) yangtze; urgency=medium * 调整全屏窗口初始化代码结构 diff --git a/src/QtSingleApplication/qtsingleapplication.cpp b/src/QtSingleApplication/qtsingleapplication.cpp index e3ba444..d957182 100755 --- a/src/QtSingleApplication/qtsingleapplication.cpp +++ b/src/QtSingleApplication/qtsingleapplication.cpp @@ -350,19 +350,17 @@ void QtSingleApplication::activateWindow() myDebug() << "单例触发activateWindow"; if (!g_projectCodeName.contains("V10SP1-edu")) { MainWindow *w = qobject_cast(actWin); + w->windowOption(); - if (this->applicationState() & Qt::ApplicationInactive) { - myDebug() << "单例内触发开始菜单显示"; - actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized); - // actWin->raise(); - // actWin->showNormal(); - // actWin->activateWindow(); - w->showWindow(); - } else { - myDebug() << "单例内触发开始菜单隐藏"; - actWin->setWindowState(actWin->windowState() & Qt::WindowMinimized); - w->hideWindow(); - } +// if (this->applicationState() & Qt::ApplicationInactive) { +// myDebug() << "单例内触发开始菜单显示"; +// actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized); +// w->showWindow(); +// } else { +// myDebug() << "单例内触发开始菜单隐藏"; +// actWin->setWindowState(actWin->windowState() & Qt::WindowMinimized); +// w->hideWindow(); +// } } else { TabletWindow *w = qobject_cast(actWin); w->showPCMenu(); diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp index b927ba2..96a03e6 100755 --- a/src/UserInterface/ListView/klistview.cpp +++ b/src/UserInterface/ListView/klistview.cpp @@ -63,6 +63,7 @@ void KListView::paintEvent(QPaintEvent *e) void KListView::mouseMoveEvent(QMouseEvent *e) { this->clearFocus(); + return QListView::mouseMoveEvent(e); } void KListView::mousePressEvent(QMouseEvent *event) diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index d65d221..4a3f7d9 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -181,7 +181,7 @@ void MainWindow::registDbusServer() } else { m_fullWindow->show(); setMaxWindowPos(); - // fullWindow->raise(); + m_fullWindow->raise(); m_fullWindow->activateWindow(); } } @@ -506,6 +506,15 @@ void MainWindow::initTabOrder() setTabOrder(m_minMaxChangeButton, m_powerOffButton); } +void MainWindow::windowOption() +{ + if (this->isVisible() || m_fullWindow->isVisible()) { + hideWindow(); + } else { + showWindow(); + } +} + void MainWindow::initUi() { qDebug() << "init UI"; @@ -684,6 +693,7 @@ bool MainWindow::event(QEvent *event) if (QEvent::WindowDeactivate == event->type()) { //窗口停用 if (QApplication::activeWindow() != this) { qDebug() << " * 鼠标点击窗口外部事件"; + this->setWindowState(this->windowState() & Qt::WindowMinimized); this->hide(); m_topStackedWidget->setCurrentIndex(0); m_lineEdit->clear(); @@ -1340,6 +1350,7 @@ void MainWindow::repaintWidget() m_fullWindow->setFixedSize(width, height); m_fullWindow->repaintWidget(); } + void MainWindow::showNormalWindowSlot() { myDebug() << "Style::m_availableScreenWidth" << Style::m_availableScreenWidth << "Style::m_availableScreenHeight" << Style::m_availableScreenHeight; diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h index 4f0baf3..30aa46b 100755 --- a/src/UserInterface/mainwindow.h +++ b/src/UserInterface/mainwindow.h @@ -65,9 +65,7 @@ public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); - void showWindow(); - - void hideWindow(); + void windowOption(); protected: void initSearchUi(); @@ -81,6 +79,8 @@ protected: void registDbusServer(); void setTabletModeFlag(); void initUi(); + void showWindow(); + void hideWindow(); /** * @brief 处理外部点击事件和主窗口键盘控制 * @param event From dd032cfdb9466bd5d3a940f4311fd9bdf4fa4b11 Mon Sep 17 00:00:00 2001 From: lixueman Date: Fri, 15 Jul 2022 08:32:52 +0800 Subject: [PATCH 14/30] =?UTF-8?q?#127740=20wayland=E4=B8=8B=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=85=A8=E5=B1=8F=E5=88=87=E6=8D=A2=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E5=BC=82=E5=B8=B8=EF=BC=8C=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/mainwindow.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 4a3f7d9..05f2f05 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -1240,14 +1240,16 @@ void MainWindow::on_minMaxChangeButton_clicked() m_canHide = true; m_isFullScreen = true; - m_animationPage->show(); if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { - kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(this->x(), this->y(), Style::minw, Style::minh)); + m_maxAnimation->setDuration(1); } else { + m_animationPage->show(); m_animationPage->setGeometry(this->x(), this->y(), Style::minw, Style::minh); + m_animationPage->raise(); + m_animationPage->repaint(); + m_maxAnimation->setDuration(260); } - m_animationPage->raise(); - m_animationPage->repaint(); + QEventLoop loop; QTimer::singleShot(100, &loop, SLOT(quit())); loop.exec(); @@ -1255,7 +1257,7 @@ void MainWindow::on_minMaxChangeButton_clicked() // m_maxAnimation->setStartValue(QRect(Style::m_primaryScreenX, Style::m_primaryScreenY + Style::m_availableScreenHeight - Style::minh, Style::minw, Style::minh)); m_maxAnimation->setStartValue(QRect(this->x(), this->y(), Style::minw, Style::minh)); m_maxAnimation->setEndValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight)); - m_maxAnimation->setDuration(260); + m_maxAnimation->start(); this->hide(); } @@ -1354,13 +1356,17 @@ void MainWindow::repaintWidget() void MainWindow::showNormalWindowSlot() { myDebug() << "Style::m_availableScreenWidth" << Style::m_availableScreenWidth << "Style::m_availableScreenHeight" << Style::m_availableScreenHeight; - m_animationPage->show(); + if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { - kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight)); + m_minAnimation->setDuration(1); } else { + m_animationPage->show(); m_animationPage->setGeometry(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight); + m_animationPage->raise(); + m_animationPage->repaint(); + m_minAnimation->setDuration(260); } - m_animationPage->raise(); + myDebug() << m_animationPage->rect(); QEventLoop loop; QTimer::singleShot(100, &loop, SLOT(quit())); @@ -1369,7 +1375,7 @@ void MainWindow::showNormalWindowSlot() m_minAnimation->setEasingCurve(QEasingCurve::OutExpo); m_minAnimation->setStartValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight)); m_minAnimation->setEndValue(QRect(this->x(), this->y(), Style::minw, Style::minh)); - m_minAnimation->setDuration(260); + m_minAnimation->start(); m_fullWindow->hide(); } From d1c570ba579e77b1b1c4dd1da5c5320fb4195226 Mon Sep 17 00:00:00 2001 From: lixueman Date: Fri, 15 Jul 2022 08:47:43 +0800 Subject: [PATCH 15/30] =?UTF-8?q?#129213=20=E8=A7=A3=E5=86=B3=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E8=8F=9C=E5=8D=95=E7=82=B9=E5=87=BB=E5=B1=8F=E5=B9=95?= =?UTF-8?q?=E9=94=AE=E7=9B=98=E5=90=8E=E5=BB=B6=E8=BF=9F=E9=80=80=E5=87=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/ListView/klistview.cpp | 1 + src/UserInterface/full_mainwindow.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp index 96a03e6..8151d04 100755 --- a/src/UserInterface/ListView/klistview.cpp +++ b/src/UserInterface/ListView/klistview.cpp @@ -46,6 +46,7 @@ void KListView::onClicked(QModelIndex index) if (var.isValid()) { QString desktopfp = var.value(); execApp(desktopfp); + Q_EMIT sendHideMainWindowSignal(); } } diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp index 4e6ea9a..826dc1d 100755 --- a/src/UserInterface/full_mainwindow.cpp +++ b/src/UserInterface/full_mainwindow.cpp @@ -212,6 +212,7 @@ void FullMainWindow::initConnect() connect(m_fullCommonPage, &FullCommonUseWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide); connect(m_fullFunctionPage, &FullFunctionWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide); connect(m_fullLetterPage, &FullLetterWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide); + connect(m_fullResultPage, &FullSearchResultWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide); connect(m_dropDownMenu, &MenuBox::triggered, this, &FullMainWindow::on_fullSelectMenuButton_triggered); connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() { selectIconAnimation(false); From 4f319a7d7cedaf98de7a591981cd49da674bbc36 Mon Sep 17 00:00:00 2001 From: lixueman Date: Mon, 18 Jul 2022 10:29:15 +0800 Subject: [PATCH 16/30] =?UTF-8?q?#128764=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=8C=89=E4=B8=8B=E9=94=AE=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E7=84=A6=E7=82=B9=E8=87=B3=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E9=A1=B5=EF=BC=9B=E5=85=A8=E5=B1=8F=E5=A2=9E=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E8=BE=93=E5=85=A5=E7=9B=B4=E6=8E=A5=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/full_mainwindow.cpp | 20 +++++++++++++++++++- src/UserInterface/full_mainwindow.h | 1 + src/UserInterface/mainwindow.cpp | 9 +++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp index 826dc1d..d58f714 100755 --- a/src/UserInterface/full_mainwindow.cpp +++ b/src/UserInterface/full_mainwindow.cpp @@ -317,7 +317,7 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = (QKeyEvent *)event; - if (ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return) { + if (ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Down) { Q_EMIT sendSetFocusToResult(); } } @@ -371,6 +371,23 @@ void FullMainWindow::iconAnimationFinished() -Style::DropMenuWidth, 45))); } +void FullMainWindow::keyPressEvent(QKeyEvent *e) +{ + if (e->type() == QEvent::KeyPress) { + if ((e->key() >= Qt::Key_0 && e->key() <= Qt::Key_9) || (e->key() >= Qt::Key_A && e->key() <= Qt::Key_Z)) { + qDebug() << "void MainWindow::keyPressEvent(QKeyEvent *e)" << e->text(); + m_lineEdit->setFocus(); + m_lineEdit->setText(e->text()); + } + + if (e->key() == Qt::Key_Backspace) { + if (!m_lineEdit->text().isEmpty()) { + m_lineEdit->setText(""); + } + } + } +} + void FullMainWindow::selectIconAnimation(const bool &flag) { iconAnimation = new QPropertyAnimation(m_fullSelectMenuButton, "rotation", this); @@ -452,6 +469,7 @@ bool FullMainWindow::event(QEvent *event) } if (keyEvent->key() == Qt::Key_Escape) { + m_lineEdit->clear(); this->hide(); } } diff --git a/src/UserInterface/full_mainwindow.h b/src/UserInterface/full_mainwindow.h index 34a91ca..9592169 100755 --- a/src/UserInterface/full_mainwindow.h +++ b/src/UserInterface/full_mainwindow.h @@ -63,6 +63,7 @@ protected: void initLayout(); void selectIconAnimation(const bool &flag); void iconAnimationFinished(); + void keyPressEvent(QKeyEvent *e); private: QAction *m_allAction = nullptr; diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 05f2f05..8614bc5 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -319,6 +319,7 @@ void MainWindow::initSearchUi() m_lineEdit->setStyleSheet(QString::fromUtf8("border-radius: 13px; border:1px solid rgba(5, 151, 255, 1); background: transparent;")); m_lineEdit->setFrame(false); m_lineEdit->setPlaceholderText(tr("Search")); + m_lineEdit->installEventFilter(this); m_cancelSearchPushButton = new QPushButton(m_minSearchPage); m_cancelSearchPushButton->setFixedSize(QSize(26, 26)); // m_cancelSearchPushButton->setStyleSheet(m_buttonStyle.arg("QPushButton")); @@ -1012,6 +1013,13 @@ bool MainWindow::eventFilter(QObject *target, QEvent *event) } } + if (target == m_lineEdit) { + if (ke->key() == Qt::Key_Down) { + m_minSearchResultListView->setFocus(); + return true; + } + } + if (target == m_minSelectButton) { if (ke->key() == Qt::Key_Down) { if (m_state == 0) { @@ -1099,6 +1107,7 @@ void MainWindow::recvSearchResult(QVector arg) m_searchAppThread->quit(); QVector m_data; m_data.clear(); + m_minSearchResultListView->verticalScrollBar()->setSliderPosition(0); m_minSearchResultListView->addData(m_data, 3); Q_FOREACH (QStringList appinfo, arg) { From effe8637bce45a073bb1c4fefc8441e1e4691bcf Mon Sep 17 00:00:00 2001 From: lixueman Date: Mon, 18 Jul 2022 13:38:36 +0800 Subject: [PATCH 17/30] =?UTF-8?q?#128492=EF=BC=8C=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=AD=97=E6=AF=8D=E5=92=8C=E5=8A=9F=E8=83=BD=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E5=88=B0=E6=89=80=E6=9C=89=E8=BD=AF=E4=BB=B6?= =?UTF-8?q?=E6=9C=AA=E7=BD=AE=E9=A1=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/Widget/full_function_widget.cpp | 1 + src/UserInterface/Widget/full_function_widget.h | 2 ++ src/UserInterface/Widget/full_letter_widget.cpp | 1 + src/UserInterface/Widget/full_letter_widget.h | 2 ++ src/UserInterface/full_mainwindow.cpp | 2 ++ src/UserInterface/mainwindow.cpp | 1 + 6 files changed, 9 insertions(+) diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp index 253f210..fd124e4 100755 --- a/src/UserInterface/Widget/full_function_widget.cpp +++ b/src/UserInterface/Widget/full_function_widget.cpp @@ -210,6 +210,7 @@ void FullFunctionWidget::insertAppList(QStringList desktopfplist) listview->addData(m_data); connect(listview, &FullListView::sendItemClickedSignal, this, &FullFunctionWidget::execApplication); connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullFunctionWidget::sendHideMainWindowSignal); + connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullFunctionWidget::sendUpdateCommonView); } /** diff --git a/src/UserInterface/Widget/full_function_widget.h b/src/UserInterface/Widget/full_function_widget.h index ead61ff..931104c 100755 --- a/src/UserInterface/Widget/full_function_widget.h +++ b/src/UserInterface/Widget/full_function_widget.h @@ -195,6 +195,8 @@ Q_SIGNALS: void changeScrollValue(int value, int maximumValue); + void sendUpdateCommonView(); + }; #endif // FULLFUNCTIONWIDGET_H diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp index 96daac2..45fb165 100755 --- a/src/UserInterface/Widget/full_letter_widget.cpp +++ b/src/UserInterface/Widget/full_letter_widget.cpp @@ -210,6 +210,7 @@ void FullLetterWidget::fillAppList() listview->addData(m_data); connect(listview, &FullListView::sendItemClickedSignal, this, &FullLetterWidget::execApplication); connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullLetterWidget::sendHideMainWindowSignal); + connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullLetterWidget::sendUpdateCommonView); } } diff --git a/src/UserInterface/Widget/full_letter_widget.h b/src/UserInterface/Widget/full_letter_widget.h index 5f94658..662408b 100755 --- a/src/UserInterface/Widget/full_letter_widget.h +++ b/src/UserInterface/Widget/full_letter_widget.h @@ -197,6 +197,8 @@ Q_SIGNALS: void selectFirstItem(); void changeScrollValue(int value, int maximumValue); + + void sendUpdateCommonView(); }; #endif // FULLLETTERWIDGET_H diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp index d58f714..3c77fd5 100755 --- a/src/UserInterface/full_mainwindow.cpp +++ b/src/UserInterface/full_mainwindow.cpp @@ -209,6 +209,8 @@ void FullMainWindow::initConnect() connect(this, &FullMainWindow::sendSetFocusToResult, m_fullResultPage, &FullSearchResultWidget::selectFirstItemTab); // connect(m_fullSelectMenuButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectMenuButton_clicked); connect(m_fullCommonPage, &FullCommonUseWidget::sendUpdateOtherView, this, &FullMainWindow::sendUpdateOtherView); + connect(m_fullFunctionPage, &FullFunctionWidget::sendUpdateCommonView, m_fullCommonPage, &FullCommonUseWidget::updateListViewSlot); + connect(m_fullLetterPage, &FullLetterWidget::sendUpdateCommonView, m_fullCommonPage, &FullCommonUseWidget::updateListViewSlot); connect(m_fullCommonPage, &FullCommonUseWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide); connect(m_fullFunctionPage, &FullFunctionWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide); connect(m_fullLetterPage, &FullLetterWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide); diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 8614bc5..1f09418 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -571,6 +571,7 @@ void MainWindow::initUi() connect(m_minFuncListView, &ListView::sendUpdateAppListSignal, this, &MainWindow::updateView); connect(m_minLetterListView, &ListView::sendUpdateAppListSignal, this, &MainWindow::updateView); connect(m_minSearchResultListView, &ListView::sendUpdateAppListSignal, this, &MainWindow::updateView); + connect(m_collectListView, &RightListView::sendUpdateAppListSignal, this, &MainWindow::updateView); connect(m_minAllListView, &ListView::sendCollectViewUpdate, this, &MainWindow::updateCollectView); connect(m_minFuncListView, &ListView::sendCollectViewUpdate, this, &MainWindow::updateCollectView); connect(m_minSearchResultListView, &ListView::sendCollectViewUpdate, this, &MainWindow::updateCollectView); From 3fa8df07e1197e9d55956c506e9d713332f19917 Mon Sep 17 00:00:00 2001 From: lixueman Date: Mon, 18 Jul 2022 15:21:40 +0800 Subject: [PATCH 18/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0changelog=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 14d1fa8..ac0c955 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +ukui-menu (3.1.1-ok4~0718) yangtze; urgency=medium + + * close-cd #127740 修复wayland下默认全屏切换动画位置异常,不显示动画 + * close-cd #129213 解决开始菜单点击屏幕键盘后延迟退出问题 + * close-cd #128764 增加搜索按下键切换焦点至搜索结果页;全屏增加字符输入直接切换搜索框 + * close-cd #128492,解决字母和功能分类固定到所有软件未置顶问题 + + -- lixueman Mon, 18 Jul 2022 15:09:23 +0800 + ukui-menu (3.1.1-ok4~0712) yangtze; urgency=medium * close-cd #128498 From bd90c1b701480eaae397cb56b9fef0db9fcfa3de Mon Sep 17 00:00:00 2001 From: lixueman Date: Wed, 20 Jul 2022 13:41:26 +0800 Subject: [PATCH 19/30] =?UTF-8?q?#130526,=E4=BF=AE=E6=94=B9=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A1=86=E5=92=8C=E6=94=B6=E8=97=8F=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E9=AB=98=E4=BA=AE=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/full_mainwindow.cpp | 14 +++++++---- src/UserInterface/mainwindow.cpp | 35 ++++++++++++++------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp index 3c77fd5..3ccb33f 100755 --- a/src/UserInterface/full_mainwindow.cpp +++ b/src/UserInterface/full_mainwindow.cpp @@ -3,6 +3,7 @@ #include #include #include "utility.h" +#include FullMainWindow::FullMainWindow(QWidget *parent) : QMainWindow(parent) @@ -290,12 +291,15 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) { if (watched == m_lineEdit) { m_isSearching = true; - char style[200]; + QString style; if (event->type() == QEvent::FocusIn) { - sprintf(style, "QLineEdit{border:2px solid %s;background-color:%s;border-radius:17px;color:#ffffff;}", - QueryLineEditClickedBorder, QueryLineEditClickedBackground); + QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16); + QString color = highLightColor.mid(2, 6); + style = QString("QLineEdit{border:2px solid #%1;background-color:%2;border-radius:17px;color:#ffffff;}") + .arg(color).arg(QueryLineEditClickedBackground); m_lineEdit->setStyleSheet(style); + myDebug() <text().isEmpty()) { qDebug() << "bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)" << m_queryWid->layout()->count(); @@ -310,8 +314,8 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) m_lineEdit->setTextMargins(26, 0, 0, 0); } } else if (event->type() == QEvent::FocusOut && m_lineEdit->text().isEmpty()) { - sprintf(style, "QLineEdit{border:1px solid %s;background-color:%s;border-radius:17px;color:#ffffff;}", - QueryLineEditClickedBorderDefault, QueryLineEditClickedBackground); + style = QString("QLineEdit{border:1px solid %1;background-color:%2;border-radius:17px;color:#ffffff;}") + .arg(QueryLineEditClickedBorderDefault).arg(QueryLineEditClickedBackground); m_lineEdit->setStyleSheet(style); resetEditline(); } diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 1f09418..cc67dcb 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -33,6 +33,7 @@ #include #include #include +#include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) @@ -316,7 +317,10 @@ void MainWindow::initSearchUi() m_leftTopSearchHorizontalLayout->setContentsMargins(8, 0, 8, 0); m_lineEdit = new QLineEdit(m_minSearchPage); m_lineEdit->setMinimumSize(QSize(30, 26)); - m_lineEdit->setStyleSheet(QString::fromUtf8("border-radius: 13px; border:1px solid rgba(5, 151, 255, 1); background: transparent;")); + QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16); + QString color = highLightColor.mid(2, 6); + QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color); + m_lineEdit->setStyleSheet(searchStyle); m_lineEdit->setFrame(false); m_lineEdit->setPlaceholderText(tr("Search")); m_lineEdit->installEventFilter(this); @@ -519,7 +523,7 @@ void MainWindow::windowOption() void MainWindow::initUi() { qDebug() << "init UI"; - this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint); + this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::BypassWindowManagerHint); this->setAttribute(Qt::WA_TranslucentBackground, true); this->setAutoFillBackground(false); this->setFocusPolicy(Qt::NoFocus); @@ -558,11 +562,10 @@ void MainWindow::initUi() m_dropDownMenu->addAction(m_letterAction); m_dropDownMenu->addAction(m_funcAction); m_allAction->setChecked(true); - m_collectPushButton->setStyleSheet("color:#3790FA;"); - QColor textColor = this->palette().color(QPalette::Text); - QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue()); - QString textColorDefault = "#" + QString::number(rgbDefault, 16); - m_recentPushButton->setStyleSheet(QString("color:%1;").arg(textColorDefault)); + QString textColorHightLight = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16).mid(2, 6); + m_collectPushButton->setStyleSheet(QString("color: #%1;").arg(textColorHightLight)); + QString textColorDefault = QString::number(this->palette().color(QPalette::Text).rgba(), 16).mid(2, 6); + m_recentPushButton->setStyleSheet(QString("color: #%1;").arg(textColorDefault)); QAction *action = new QAction(); action->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-icon-search.svg", true)); m_lineEdit->addAction(action, QLineEdit::LeadingPosition); @@ -1209,13 +1212,12 @@ void MainWindow::on_collectPushButton_clicked() { m_rightStackedWidget->setCurrentIndex(0); - m_collectPushButton->setStyleSheet("color:#3790FA;"); + QString textColorHightLight = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16).mid(2, 6); + m_collectPushButton->setStyleSheet(QString("color:#%1;").arg(textColorHightLight)); QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2); m_collectPushButton->setFont(collectFont); - QColor textColor = this->palette().color(QPalette::Text); - QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue()); - QString textColorDefault = "#" + QString::number(rgbDefault, 16); - m_recentPushButton->setStyleSheet(QString("color:%1;").arg(textColorDefault)); + QString textColorDefault = QString::number(this->palette().color(QPalette::Text).rgba(), 16).mid(2, 6); + m_recentPushButton->setStyleSheet(QString("color:#%1;").arg(textColorDefault)); QFont recentFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize()); m_recentPushButton->setFont(recentFont); } @@ -1223,13 +1225,12 @@ void MainWindow::on_collectPushButton_clicked() void MainWindow::on_recentPushButton_clicked() { m_rightStackedWidget->setCurrentIndex(1); - QColor textColor = this->palette().color(QPalette::Text); - QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue()); - QString textColorDefault = "#" + QString::number(rgbDefault, 16); - m_collectPushButton->setStyleSheet(QString("color:%1").arg(textColorDefault)); + QString textColorDefault = QString::number(this->palette().color(QPalette::Text).rgba(), 16).mid(2, 6); + m_collectPushButton->setStyleSheet(QString("color:#%1").arg(textColorDefault)); QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize()); m_collectPushButton->setFont(collectFont); - m_recentPushButton->setStyleSheet("color:#3790FA"); + QString textColorHightLight = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16).mid(2, 6); + m_recentPushButton->setStyleSheet(QString("color:#%1").arg(textColorHightLight)); QFont recentFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2); m_recentPushButton->setFont(recentFont); From 89ad4de047f2a30862f5f79c5b184b5566486f2c Mon Sep 17 00:00:00 2001 From: lixueman Date: Wed, 20 Jul 2022 16:45:32 +0800 Subject: [PATCH 20/30] =?UTF-8?q?#130514,=E5=85=A8=E5=B1=8F=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E7=9A=84=E6=BB=91=E5=9D=97=E9=80=8F=E6=98=8E=E5=BA=A6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/Widget/full_commonuse_widget.cpp | 14 +++++++++----- src/UserInterface/Widget/full_function_widget.cpp | 14 +++++++++----- src/UserInterface/Widget/full_letter_widget.cpp | 14 +++++++++----- .../Widget/full_searchresult_widget.cpp | 14 +++++++++----- 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp index c02f317..26d86b5 100755 --- a/src/UserInterface/Widget/full_commonuse_widget.cpp +++ b/src/UserInterface/Widget/full_commonuse_widget.cpp @@ -119,13 +119,13 @@ void FullCommonUseWidget::initVerticalScrollBar() m_verticalScrollBar->show(); } - m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); " + m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); " "margin: 0px,0px,0px,0px; border-radius: %3px;}" - "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);" + "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);" "border-radius: %3px; min-height: %1;}" "QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}" "QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize); - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6)); } void FullCommonUseWidget::on_powerOffButton_clicked() @@ -219,11 +219,15 @@ bool FullCommonUseWidget::eventFilter(QObject *watched, QEvent *event) if (watched == m_verticalScrollBar) { if (event->type() == QEvent::Enter) { - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78)); } if (event->type() == QEvent::Leave) { - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6)); + } + + if(event->type() == QEvent::MouseButtonPress) { + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9)); } } diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp index fd124e4..7cc8464 100755 --- a/src/UserInterface/Widget/full_function_widget.cpp +++ b/src/UserInterface/Widget/full_function_widget.cpp @@ -139,13 +139,13 @@ void FullFunctionWidget::initVerticalScrollBar() m_verticalScrollBar->show(); } - m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); " + m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); " "margin: 0px,0px,0px,0px; border-radius: %3px;}" - "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);" + "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);" "border-radius: %3px; min-height: %1;}" "QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}" "QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize); - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6)); } void FullFunctionWidget::on_powerOffButton_clicked() @@ -505,11 +505,15 @@ bool FullFunctionWidget::eventFilter(QObject *watched, QEvent *event) if (watched == m_verticalScrollBar) { if (watched == m_verticalScrollBar) { if (event->type() == QEvent::Enter) { - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78)); } if (event->type() == QEvent::Leave) { - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6)); + } + + if(event->type() == QEvent::MouseButtonPress) { + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9)); } } } else { diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp index 45fb165..4b31a32 100755 --- a/src/UserInterface/Widget/full_letter_widget.cpp +++ b/src/UserInterface/Widget/full_letter_widget.cpp @@ -133,13 +133,13 @@ void FullLetterWidget::initVerticalScrollBar() m_verticalScrollBar->show(); } - m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); " + m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); " "margin: 0px,0px,0px,0px; border-radius: %3px;}" - "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);" + "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);" "border-radius: %3px; min-height: %1;}" "QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}" "QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize); - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6)); } void FullLetterWidget::on_powerOffButton_clicked() @@ -531,11 +531,15 @@ bool FullLetterWidget::eventFilter(QObject *watched, QEvent *event) { if (watched == m_verticalScrollBar) { if (event->type() == QEvent::Enter) { - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78)); } if (event->type() == QEvent::Leave) { - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6)); + } + + if(event->type() == QEvent::MouseButtonPress) { + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9)); } } else { if (event->type() == QEvent::KeyPress) { diff --git a/src/UserInterface/Widget/full_searchresult_widget.cpp b/src/UserInterface/Widget/full_searchresult_widget.cpp index be5dd6b..efdee49 100755 --- a/src/UserInterface/Widget/full_searchresult_widget.cpp +++ b/src/UserInterface/Widget/full_searchresult_widget.cpp @@ -108,13 +108,13 @@ void FullSearchResultWidget::initVerticalScrollBar() m_verticalScrollBar->show(); } - m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); " + m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); " "margin: 0px,0px,0px,0px; border-radius: %3px;}" - "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);" + "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);" "border-radius: %3px; min-height: %1;}" "QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}" "QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize); - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6)); } void FullSearchResultWidget::on_powerOffButton_clicked() @@ -204,11 +204,15 @@ bool FullSearchResultWidget::eventFilter(QObject *watched, QEvent *event) if (watched == m_verticalScrollBar) { if (event->type() == QEvent::Enter) { - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78)); } if (event->type() == QEvent::Leave) { - m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6)); + } + + if(event->type() == QEvent::MouseButtonPress) { + m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9)); } } From e9d7c5ac2daa5a7499475c989bc9f61606533981 Mon Sep 17 00:00:00 2001 From: lixueman Date: Thu, 21 Jul 2022 11:31:06 +0800 Subject: [PATCH 21/30] =?UTF-8?q?#130485=20#130477,=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AD=97=E6=AF=8D/=E5=8A=9F=E8=83=BD=E9=9B=86=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E9=A1=B5=EF=BC=8C=E7=A6=81=E7=94=A8=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Button/function_classify_button.cpp | 83 ++++++++----------- .../Button/function_classify_button.h | 3 - .../Button/letter_classify_button.cpp | 53 +++++++++--- .../Button/letter_classify_button.h | 2 +- .../Widget/full_letter_widget.cpp | 2 +- .../Widget/function_button_widget.cpp | 6 +- .../Widget/letter_button_widget.cpp | 6 +- 7 files changed, 82 insertions(+), 73 deletions(-) diff --git a/src/UserInterface/Button/function_classify_button.cpp b/src/UserInterface/Button/function_classify_button.cpp index 2494be4..8ddabe1 100755 --- a/src/UserInterface/Button/function_classify_button.cpp +++ b/src/UserInterface/Button/function_classify_button.cpp @@ -36,23 +36,11 @@ FunctionClassifyButton::FunctionClassifyButton(int width, m_iconSize(iconSize), m_category(category), m_fullscreen(fullscreen), - m_enabled(enabled), - m_iconLabel(new QLabel), - m_textLabel(new QLabel) + m_enabled(enabled) { this->setFlat(true); this->setFixedSize(m_width, m_height); this->setFocusPolicy(Qt::NoFocus); - m_iconLabel->setFixedSize(m_iconSize, m_iconSize); - m_textLabel->adjustSize(); - m_textLabel->setText(m_category); - m_textLabel->setAlignment(Qt::AlignCenter); - - if (m_fullscreen) { - QPalette pe = m_textLabel->palette(); - pe.setColor(QPalette::ButtonText, Qt::white); - m_textLabel->setPalette(pe); - } if (m_fullscreen) { updateIconState(Normal); @@ -67,12 +55,6 @@ FunctionClassifyButton::FunctionClassifyButton(int width, this->setCheckable(false); } - QHBoxLayout *mainlayout = new QHBoxLayout; - mainlayout->setContentsMargins(0, 0, 0, 0); - mainlayout->setSpacing(Style::LeftSpaceIconText); - this->setLayout(mainlayout); -// mainlayout->addWidget(m_iconLabel); - mainlayout->addWidget(m_textLabel); connect(this, &FunctionClassifyButton::toggled, this, &FunctionClassifyButton::reactToToggle); connect(this, &FunctionClassifyButton::clicked, this, &FunctionClassifyButton::buttonClickedSlot); } @@ -115,6 +97,37 @@ void FunctionClassifyButton::paintEvent(QPaintEvent *e) painter.restore(); } + if (!(option.state & QStyle::State_Enabled)) { + painter.save(); + QColor color; + if (!m_fullscreen) { + if ( g_curStyle == "ukui-light") { + color = Qt::black; + } else { + color = Qt::white; + } + color.setAlphaF(0.2); + } + painter.setPen(color); + painter.drawText(option.rect, Qt::AlignCenter, m_category); + painter.restore(); + } + + if (option.state & QStyle::State_Enabled) { + painter.save(); + QColor color; + + if ( g_curStyle == "ukui-light") { + color = Qt::black; + } else { + color = Qt::white; + } + color.setAlphaF(0.9); + painter.setPen(color); + painter.drawText(option.rect, Qt::AlignCenter, m_category); + painter.restore(); + } + if (m_fullscreen && (option.state & QStyle::State_On)) { painter.save(); painter.setPen(Qt::NoPen); @@ -265,37 +278,7 @@ void FunctionClassifyButton::updateIconState(const FunctionClassifyButton::State // } // pixmap.setDevicePixelRatio(qApp->devicePixelRatio()); // m_iconLabel->setPixmap(pixmap); - updateTextState(state); +// updateTextState(state); } -void FunctionClassifyButton::updateTextState(const FunctionClassifyButton::State state) -{ - // QPalette p= m_textLabel->palette(); - switch (state) { - case Enabled: - // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1)); - // m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255);"); - break; - case Disabled: - // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1, 0.25)); - // m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255, 25%);"); - break; - - case Normal: - // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1, 0.50)); - // m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255, 50%);"); - break; - - case Checked: - // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1)); - // m_textLabel->setStyleSheet("background:transparent;color:rgba(255, 255, 255);"); - break; - - default: - break; - } - - // p.setColor(QPalette::Window,Qt::transparent); - // m_textLabel->setPalette(p); -} diff --git a/src/UserInterface/Button/function_classify_button.h b/src/UserInterface/Button/function_classify_button.h index e99f2c3..6160fb9 100755 --- a/src/UserInterface/Button/function_classify_button.h +++ b/src/UserInterface/Button/function_classify_button.h @@ -58,8 +58,6 @@ public: QString m_category; bool m_fullscreen; bool m_enabled; - QLabel *m_iconLabel = nullptr; - QLabel *m_textLabel = nullptr; State m_state = Checked; void updateBtnState(); @@ -70,7 +68,6 @@ protected: void leaveEvent(QEvent *e); void paintEvent(QPaintEvent *e); void updateIconState(const State state); - void updateTextState(const State state); Q_SIGNALS: void buttonClicked(); diff --git a/src/UserInterface/Button/letter_classify_button.cpp b/src/UserInterface/Button/letter_classify_button.cpp index 5bc882f..624c38e 100755 --- a/src/UserInterface/Button/letter_classify_button.cpp +++ b/src/UserInterface/Button/letter_classify_button.cpp @@ -28,17 +28,17 @@ LetterClassifyButton::LetterClassifyButton(QWidget *parent, m_fullscreen(fullscreen) { this->setFlat(true); + m_letter = letter; +// if (m_fullscreen) { +// QFont font; +// font.setPixelSize(Style::LeftLetterFontSize); +// this->setFont(font); +// QPalette pe = this->palette(); +// pe.setColor(QPalette::ButtonText, Qt::white); +// this->setPalette(pe); +// } - if (m_fullscreen) { - QFont font; - font.setPixelSize(Style::LeftLetterFontSize); - this->setFont(font); - QPalette pe = this->palette(); - pe.setColor(QPalette::ButtonText, Qt::white); - this->setPalette(pe); - } - - this->setText(letter); +// this->setText(letter); this->setFocusPolicy(Qt::NoFocus); this->setCheckable(true); this->setStyleSheet("padding: 0px;"); @@ -82,6 +82,37 @@ void LetterClassifyButton::paintEvent(QPaintEvent *e) painter.restore(); } + if (!(option.state & QStyle::State_Enabled)) { + painter.save(); + QColor color; + if (!m_fullscreen) { + if ( g_curStyle == "ukui-light") { + color = Qt::black; + } else { + color = Qt::white; + } + color.setAlphaF(0.2); + } + painter.setPen(color); + painter.drawText(option.rect, Qt::AlignCenter, m_letter); + painter.restore(); + } + + if (option.state & QStyle::State_Enabled) { + painter.save(); + QColor color; + + if ( g_curStyle == "ukui-light") { + color = Qt::black; + } else { + color = Qt::white; + } + color.setAlphaF(0.9); + painter.setPen(color); + painter.drawText(option.rect, Qt::AlignCenter, m_letter); + painter.restore(); + } + if (m_fullscreen && (option.state & QStyle::State_On)) { painter.save(); painter.setPen(Qt::NoPen); @@ -118,7 +149,7 @@ void LetterClassifyButton::enterEvent(QEvent *e) // this->setFixedSize(Style::LeftLetterBtnHeight*2,Style::LeftLetterBtnHeight*2); tooltip = new LetterToolTip(); QPoint oPoint = this->mapToGlobal(QPoint(this->rect().x() + 35, this->rect().y() - 10)); - tooltip->setText(this->text()); + tooltip->setText(m_letter); tooltip->raise(); tooltip->move(oPoint); tooltip->show(); diff --git a/src/UserInterface/Button/letter_classify_button.h b/src/UserInterface/Button/letter_classify_button.h index b6b2a3d..7235987 100755 --- a/src/UserInterface/Button/letter_classify_button.h +++ b/src/UserInterface/Button/letter_classify_button.h @@ -35,7 +35,7 @@ public: ); bool is_pressed = false; - + QString m_letter = QString(); private: bool m_fullscreen = false; LetterToolTip *tooltip = nullptr; diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp index 4b31a32..1ebc2c5 100755 --- a/src/UserInterface/Widget/full_letter_widget.cpp +++ b/src/UserInterface/Widget/full_letter_widget.cpp @@ -379,7 +379,7 @@ void FullLetterWidget::btnGroupClickedSlot(QAbstractButton *btn) if (m_btnGroup->id(btn) == m_buttonList.indexOf(button)) { letterbtn->setChecked(true); //此处需实现将被选定的字母包含的应用列表移动到applistWid界面最顶端 - QString letterstr = letterbtn->text(); + QString letterstr = letterbtn->m_letter; int num = m_letterList.indexOf(letterstr); if (num != -1) { diff --git a/src/UserInterface/Widget/function_button_widget.cpp b/src/UserInterface/Widget/function_button_widget.cpp index cd7b8f8..dbb116c 100755 --- a/src/UserInterface/Widget/function_button_widget.cpp +++ b/src/UserInterface/Widget/function_button_widget.cpp @@ -76,7 +76,7 @@ void FunctionButtonWidget::initUi() Q_FOREACH (QAbstractButton *btn, m_buttonList) { FunctionClassifyButton *fbtn = qobject_cast(btn); - fbtn->updateIconState(); + fbtn->updateBtnState(); } }); } @@ -88,9 +88,7 @@ void FunctionButtonWidget::initUi() void FunctionButtonWidget::functionBtnClickedSlot() { FunctionClassifyButton *btn = dynamic_cast(sender()); - QWidget *wid = btn->layout()->itemAt(0)->widget(); - QLabel *label = qobject_cast(wid); - Q_EMIT sendFunctionBtnSignal(label->text()); + Q_EMIT sendFunctionBtnSignal(btn->m_category); } void FunctionButtonWidget::hideEvent(QHideEvent *event) diff --git a/src/UserInterface/Widget/letter_button_widget.cpp b/src/UserInterface/Widget/letter_button_widget.cpp index 68e3a74..f110340 100755 --- a/src/UserInterface/Widget/letter_button_widget.cpp +++ b/src/UserInterface/Widget/letter_button_widget.cpp @@ -47,7 +47,7 @@ void LetterButtonWidget::initUi() letterlist.append(QString(QChar(letter))); } - letterlist.append("&&"); + letterlist.append("&"); letterlist.append("#"); for (int row = 0; row < 6; row++) { @@ -78,7 +78,7 @@ void LetterButtonWidget::hideEvent(QHideEvent *event) void LetterButtonWidget::letterBtnClickedSlot() { LetterClassifyButton *btn = dynamic_cast(QObject::sender()); - QString btnname = btn->text(); + QString btnname = btn->m_letter; Q_EMIT sendLetterBtnSignal(btnname); } @@ -93,7 +93,7 @@ void LetterButtonWidget::recvLetterBtnList(QStringList list) for (int col = 0; col < 4; col++) { QLayoutItem *item = gridLayout->itemAt(row * 4 + col); LetterClassifyButton *btn = static_cast(item->widget()); - QString letterstr = btn->text(); + QString letterstr = btn->m_letter; if (list.indexOf(letterstr.at(0)) == -1) { btn->setEnabled(false); From 681e05b0ae6d9aa3d968c733c88bdb636776c7fe Mon Sep 17 00:00:00 2001 From: lixueman Date: Thu, 21 Jul 2022 14:00:38 +0800 Subject: [PATCH 22/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9changelog=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index ac0c955..d417da0 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +ukui-menu (3.1.1-ok4~0721) yangtze; urgency=medium + + * close-cd #130526 修改搜索框和收藏最近按钮高亮色 + * close-cd #130514 全屏菜单的滑块透明度修改 + * close-cd #130485 修改字母集导航页禁用按钮样式 + * close-cd #130477 修改功能集导航页禁用按钮样式 + + -- kylin Thu, 21 Jul 2022 13:51:42 +0800 + ukui-menu (3.1.1-ok4~0718) yangtze; urgency=medium * close-cd #127740 修复wayland下默认全屏切换动画位置异常,不显示动画 From ec4329bd6fb5c003a0b4389d39ef02801b6d99a4 Mon Sep 17 00:00:00 2001 From: lixueman Date: Thu, 21 Jul 2022 15:33:43 +0800 Subject: [PATCH 23/30] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=BC=BA=E8=B0=83?= =?UTF-8?q?=E8=89=B2=E4=BF=AE=E6=94=B9=E5=90=8E=E6=90=9C=E7=B4=A2=E6=A1=86?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E4=B8=8D=E5=8F=8A=E6=97=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Button/function_classify_button.cpp | 11 ++++++++--- .../Button/letter_classify_button.cpp | 11 ++++++++--- src/UserInterface/full_mainwindow.cpp | 9 ++++++++- src/UserInterface/mainwindow.cpp | 18 +++++++++++++++++- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/src/UserInterface/Button/function_classify_button.cpp b/src/UserInterface/Button/function_classify_button.cpp index 8ddabe1..ffed89c 100755 --- a/src/UserInterface/Button/function_classify_button.cpp +++ b/src/UserInterface/Button/function_classify_button.cpp @@ -117,11 +117,16 @@ void FunctionClassifyButton::paintEvent(QPaintEvent *e) painter.save(); QColor color; - if ( g_curStyle == "ukui-light") { - color = Qt::black; + if (m_fullscreen) { + color = Qt::white; } else { - color = Qt::white; + if ( g_curStyle == "ukui-light") { + color = Qt::black; + } else { + color = Qt::white; + } } + color.setAlphaF(0.9); painter.setPen(color); painter.drawText(option.rect, Qt::AlignCenter, m_category); diff --git a/src/UserInterface/Button/letter_classify_button.cpp b/src/UserInterface/Button/letter_classify_button.cpp index 624c38e..11073a8 100755 --- a/src/UserInterface/Button/letter_classify_button.cpp +++ b/src/UserInterface/Button/letter_classify_button.cpp @@ -102,11 +102,16 @@ void LetterClassifyButton::paintEvent(QPaintEvent *e) painter.save(); QColor color; - if ( g_curStyle == "ukui-light") { - color = Qt::black; + if (m_fullscreen) { + color = Qt::white; } else { - color = Qt::white; + if ( g_curStyle == "ukui-light") { + color = Qt::black; + } else { + color = Qt::white; + } } + color.setAlphaF(0.9); painter.setPen(color); painter.drawText(option.rect, Qt::AlignCenter, m_letter); diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp index 3ccb33f..555c6a6 100755 --- a/src/UserInterface/full_mainwindow.cpp +++ b/src/UserInterface/full_mainwindow.cpp @@ -123,6 +123,13 @@ void FullMainWindow::initSearchUI() if (key.contains(QString("styleName"))) { changeStyle(); } + + if (key.contains(QString("theme-color"))) { + QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16); + QString color = highLightColor.mid(2, 6); + QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color); + m_lineEdit->setStyleSheet(searchStyle); + } }); } @@ -294,7 +301,7 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) QString style; if (event->type() == QEvent::FocusIn) { - QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16); + QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16); QString color = highLightColor.mid(2, 6); style = QString("QLineEdit{border:2px solid #%1;background-color:%2;border-radius:17px;color:#ffffff;}") .arg(color).arg(QueryLineEditClickedBackground); diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index cc67dcb..355a8bd 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -275,6 +275,13 @@ void MainWindow::initGsettings() if (key.contains(QString("styleName"))) { changeStyle(); } + + if (key.contains(QString("theme-color"))) { + QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16); + QString color = highLightColor.mid(2, 6); + QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color); + m_lineEdit->setStyleSheet(searchStyle); + } }); } } @@ -317,7 +324,7 @@ void MainWindow::initSearchUi() m_leftTopSearchHorizontalLayout->setContentsMargins(8, 0, 8, 0); m_lineEdit = new QLineEdit(m_minSearchPage); m_lineEdit->setMinimumSize(QSize(30, 26)); - QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16); + QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16); QString color = highLightColor.mid(2, 6); QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color); m_lineEdit->setStyleSheet(searchStyle); @@ -942,6 +949,15 @@ bool MainWindow::eventFilter(QObject *target, QEvent *event) } } + if (target == m_lineEdit) { + if (event->type() == QEvent::FocusIn) { + QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16); + QString color = highLightColor.mid(2, 6); + QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color); + m_lineEdit->setStyleSheet(searchStyle); + } + } + if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = (QKeyEvent *)event; From afb6b2f5367da4870ad95017757309fb479c980c Mon Sep 17 00:00:00 2001 From: lixueman Date: Thu, 21 Jul 2022 15:36:44 +0800 Subject: [PATCH 24/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0changelog=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index d417da0..d656adb 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ukui-menu (3.1.1-ok4~0721.1) yangtze; urgency=medium + + * 解决了强调色修改后,搜索框未及时刷新问题 + + -- lixueman Thu, 21 Jul 2022 15:34:09 +0800 + ukui-menu (3.1.1-ok4~0721) yangtze; urgency=medium * close-cd #130526 修改搜索框和收藏最近按钮高亮色 From 48c749e4c11708ca480019aac334470acb427a64 Mon Sep 17 00:00:00 2001 From: lixueman Date: Mon, 25 Jul 2022 09:22:34 +0800 Subject: [PATCH 25/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B9=B3=E6=9D=BF?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8Bwin=E9=94=AE=E8=83=BD=E5=A4=9F?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 6 ++++++ src/UserInterface/mainwindow.cpp | 5 +++++ src/UserInterface/mainwindow.h | 1 + 3 files changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index d656adb..e1a9ef3 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ukui-menu (3.1.1-ok4~0725) yangtze; urgency=medium + + * 解决平板模式下win键可以打开开始菜单问题 + + -- lixueman Mon, 25 Jul 2022 09:15:22 +0800 + ukui-menu (3.1.1-ok4~0721.1) yangtze; urgency=medium * 解决了强调色修改后,搜索框未及时刷新问题 diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 355a8bd..147ddae 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -117,6 +117,11 @@ void MainWindow::setTabletModeFlag() } } +void MainWindow::tabletModeChangeSlot(bool flag) +{ + m_isTabletMode = flag; +} + void MainWindow::registDbusServer() { m_dbus = new DBus; diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h index 30aa46b..1b5363d 100755 --- a/src/UserInterface/mainwindow.h +++ b/src/UserInterface/mainwindow.h @@ -143,6 +143,7 @@ public Q_SLOTS: void maxAnimationFinished(); void iconAnimationFinished(); void changeStyle(); + void tabletModeChangeSlot(bool flag); private Q_SLOTS: void on_selectMenuButton_triggered(QAction *arg1); From f63911c0194d74d29a2ebb6239363d48e967e3ad Mon Sep 17 00:00:00 2001 From: lixueman Date: Tue, 26 Jul 2022 16:38:41 +0800 Subject: [PATCH 26/30] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=97=B6=E9=9A=90=E8=97=8F=E4=BF=A1=E5=8F=B7?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/ListView/klistview.cpp | 2 +- src/UserInterface/ListView/listview.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp index 8151d04..3954bc9 100755 --- a/src/UserInterface/ListView/klistview.cpp +++ b/src/UserInterface/ListView/klistview.cpp @@ -45,8 +45,8 @@ void KListView::onClicked(QModelIndex index) if (var.isValid()) { QString desktopfp = var.value(); - execApp(desktopfp); Q_EMIT sendHideMainWindowSignal(); + execApp(desktopfp); } } diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp index 78ed0a3..368f25a 100755 --- a/src/UserInterface/ListView/listview.cpp +++ b/src/UserInterface/ListView/listview.cpp @@ -107,8 +107,8 @@ void ListView::onClicked(QModelIndex index) if (var.value().at(1).toInt() == 0) { Q_EMIT sendAppClassificationBtnClicked(); } else { - execApp(desktopfp); Q_EMIT sendHideMainWindowSignal(); + execApp(desktopfp); } } } From 68f86f50213827ce9a53296e7733122308056c4f Mon Sep 17 00:00:00 2001 From: lixueman Date: Wed, 27 Jul 2022 19:08:04 +0800 Subject: [PATCH 27/30] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=97=8F=E6=96=87?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ukui-menu_bo.ts => ukui-menu_bo_CN.ts} | 126 ++++++++++-------- 1 file changed, 69 insertions(+), 57 deletions(-) rename translations/{ukui-menu_bo.ts => ukui-menu_bo_CN.ts} (67%) mode change 100755 => 100644 diff --git a/translations/ukui-menu_bo.ts b/translations/ukui-menu_bo_CN.ts old mode 100755 new mode 100644 similarity index 67% rename from translations/ukui-menu_bo.ts rename to translations/ukui-menu_bo_CN.ts index 370c9d8..d92f153 --- a/translations/ukui-menu_bo.ts +++ b/translations/ukui-menu_bo_CN.ts @@ -1,27 +1,27 @@ - + FullMainWindow Search - + འཚོལ་ཞིབ། All - + ཚང་མ། Letter - + འཕྲིན་ཡིག Function - + བྱེད་ནུས། @@ -29,28 +29,42 @@ Search - + འཚོལ་ཞིབ། ItemDelegate + + Open feature sort list + 打开功能排序菜单 + + + Open alphabetical list + 打开字母排序菜单 + Open the function sort menu - + བྱེད་ལས་རིགས་ཀྱི་ཟས་ཐོའི་ཁ་ཕྱེ་བ། Open the alphabetical menu - + དབྱངས་གསལ་ཡི་གེའི་ཟས་ཐོའི་ཁ་ཕྱེ་བ། MainWindow - - collection - + + + Search + འཚོལ་ཞིབ། + + + + No recent files + ཉེ་དུས་ཀྱི་ཡིག་ཆ་མེད། @@ -59,47 +73,45 @@ All - + ཚང་མ། - - - Search - - - - - No recent files - + + collection + བསྡུ་ཉར། recent - + ཉེ་ཆར། Max - + མའེ་ཁེ་སི། PowerOff - + སྒུལ་ཤུགས་ཀྱི་ནུས་པ། + + + Search application + 搜索应用 Letter - + འཕྲིན་ཡིག Function - + བྱེད་ནུས། @@ -108,67 +120,67 @@ Office - + གཞུང་ལས་ཁང་། Development - + འཕེལ་རྒྱས་ Image - + པར་རིས། Video - + བརྙན་ཕབ། Internet - + དྲ་སྦྲེལ། Game - + རོལ་རྩེད། Education - + སློབ་གསོ། Social - + སྤྱི་ཚོགས། System - + ལམ་ལུགས། Safe - + བདེ་འཇགས། Others - + དེ་མིན་ད་དུང་ @@ -176,82 +188,82 @@ Pin to all - + མི་ཚང་མར་ཁབ་རྒྱག་པ། Unpin from all - + མི་ཚང་མའི་ཁྲོད་ནས་བཀག་འགོག་བྱེད་ Pin to taskbar - + ལས་འགན་སྒྲུབ་པར་ཁབ་རྒྱག་པ། Unpin from taskbar - + ལས་འགན་སྒྲུབ་ས་ནས་ཁ་པར་གཏོང་བ། Add to desktop shortcuts - + ཅོག་ཙེའི་སྟེང་གི་མགྱོགས་ལམ་ཁ་སྣོན་བྱས་ཡོད། Pin to collection - + འཚོལ་སྡུད་བྱེད་པའི་ཁབ་སྐུད། Remove from collection - + བསྡུ་ཉར་དངོས་རྫས་ཁྲོད་ནས་ཕྱིར་ Uninstall - + སྒྲིག་སྦྱོར་བྱས་མེད་པ། Switch user - + གློག་སྒོ་འབྱེད་པའི་སྤྱོད་མཁན Hibernate - + ཧིན་རྡུ་ཉི་ཞི་ཡ། Sleep - + གཉིད་ཁུག་པ། Lock Screen - + སྒོ་ལྕགས་ཀྱི་བརྙན་ཤེལ། Log Out - + ཕྱིར་འཐེན་བྱ་དགོས། Restart - + ཡང་བསྐྱར་འགོ་འཛུགས་ Power Off - + གློག་ཆད་པ། Personalize this list - + མིང་ཐོ་འདི་རང་གཤིས་ཅན་དུ་བསྒྱུར @@ -259,22 +271,22 @@ Pin to taskbar - + ལས་འགན་སྒྲུབ་པར་ཁབ་རྒྱག་པ། Unpin from taskbar - + ལས་འགན་སྒྲུབ་ས་ནས་ཁ་པར་གཏོང་བ། Add to desktop shortcuts - + ཅོག་ཙེའི་སྟེང་གི་མགྱོགས་ལམ་ཁ་སྣོན་བྱས་ཡོད། Uninstall - + སྒྲིག་སྦྱོར་བྱས་མེད་པ། From d1f306f9038d66daf2f118659278819e5c4771cc Mon Sep 17 00:00:00 2001 From: lixueman Date: Wed, 27 Jul 2022 12:16:51 +0000 Subject: [PATCH 28/30] update ukui-menu.pro. --- ukui-menu.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ukui-menu.pro b/ukui-menu.pro index c249692..1ca9797 100755 --- a/ukui-menu.pro +++ b/ukui-menu.pro @@ -20,7 +20,7 @@ TEMPLATE = app target.path = /usr/bin TRANSLATIONS+=\ - translations/ukui-menu_bo.ts \ + translations/ukui-menu_bo_CN.ts \ translations/ukui-menu_zh_CN.ts \ translations/ukui-menu_tr.ts From a2a6a90b73a38447c1282b8446617cb6d24377c0 Mon Sep 17 00:00:00 2001 From: lixueman Date: Wed, 27 Jul 2022 20:34:33 +0800 Subject: [PATCH 29/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0changelog=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index e1a9ef3..be7474a 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ukui-menu (3.1.1-ok4~0727) yangtze; urgency=medium + + * 增加开始菜单藏文翻译 + * 调整点击应用时窗口隐藏时机 + + -- lixueman Wed, 27 Jul 2022 20:32:11 +0800 + ukui-menu (3.1.1-ok4~0725) yangtze; urgency=medium * 解决平板模式下win键可以打开开始菜单问题 From 9a38098d9a18f413b89f84ce4c444c70f4b0b530 Mon Sep 17 00:00:00 2001 From: lixueman Date: Thu, 28 Jul 2022 08:54:03 +0800 Subject: [PATCH 30/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E9=80=89=E6=8B=A9=E6=A1=86=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=E6=9C=80=E5=A4=A7=E5=8F=B7=E5=AD=97?= =?UTF-8?q?=E4=BD=93hover=E8=B6=85=E5=87=BA=E8=BE=B9=E7=95=8C=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 1 + src/UserInterface/full_mainwindow.cpp | 3 +-- src/UserInterface/mainwindow.cpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index be7474a..c28265f 100755 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ukui-menu (3.1.1-ok4~0727) yangtze; urgency=medium * 增加开始菜单藏文翻译 * 调整点击应用时窗口隐藏时机 + * 修改分类下拉选择框宽度 -- lixueman Wed, 27 Jul 2022 20:32:11 +0800 diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp index 555c6a6..dfd692f 100755 --- a/src/UserInterface/full_mainwindow.cpp +++ b/src/UserInterface/full_mainwindow.cpp @@ -177,7 +177,6 @@ void FullMainWindow::initAppListUI() void FullMainWindow::initMenu() { m_dropDownMenu = new MenuBox(this); - m_dropDownMenu->setFixedWidth(Style::DropMenuWidth); m_allAction = new QAction(m_dropDownMenu); m_letterAction = new QAction(m_dropDownMenu); m_funcAction = new QAction(m_dropDownMenu); @@ -381,7 +380,7 @@ void FullMainWindow::iconAnimationFinished() { m_dropDownMenu->raise(); m_dropDownMenu->exec(m_fullSelectMenuButton->mapToGlobal(QPoint(m_fullSelectMenuButton->width() - -Style::DropMenuWidth, 45))); + - m_dropDownMenu->sizeHint().width(), 45))); } void FullMainWindow::keyPressEvent(QKeyEvent *e) diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 147ddae..8427b34 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -560,7 +560,6 @@ void MainWindow::initUi() } m_dropDownMenu = new MenuBox(this); - m_dropDownMenu->setFixedWidth(Style::DropMenuWidth); m_allAction = new QAction(m_dropDownMenu); m_letterAction = new QAction(m_dropDownMenu); m_funcAction = new QAction(m_dropDownMenu); @@ -783,7 +782,7 @@ void MainWindow::iconAnimationFinished() { m_dropDownMenu->raise(); m_dropDownMenu->exec(m_selectMenuButton->mapToGlobal(QPoint(m_selectMenuButton->width() - -Style::DropMenuWidth + 5, 29))); + - m_dropDownMenu->sizeHint().width() + 5, 29))); } void MainWindow::maxAnimationFinished()