diff -Nru dtkwidget-5.5.48/archlinux/PKGBUILD dtkwidget-5.6.12/archlinux/PKGBUILD --- dtkwidget-5.5.48/archlinux/PKGBUILD 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/archlinux/PKGBUILD 2023-05-15 03:42:41.000000000 +0000 @@ -2,30 +2,37 @@ pkgname=dtkwidget-git pkgver=5.5.45.r1.gbc050fca pkgrel=1 +sourcename=dtkwidget +sourcetars=("$sourcename"_"$pkgver".tar.xz) +sourcedir="$sourcename" pkgdesc='Deepin graphical user interface library' arch=('x86_64' 'aarch64') url="https://github.com/linuxdeepin/dtkwidget" license=('LGPL3') -depends=('deepin-qt-dbus-factory-git' 'dtkcore-git' 'dtkgui-git' 'librsvg' 'qt5-multimedia' 'qt5-svg' - 'qt5-x11extras' 'startup-notification') -makedepends=('git' 'qt5-tools' 'gtest' 'dtkcommon-git' 'dtkcore-git' 'dtkgui-git') +depends=('dtkcore-git' 'dtkgui-git' 'qt5-svg' + 'qt5-x11extras' 'dtkcommon-git' 'startup-notification') +makedepends=('git' 'qt5-tools' 'gtest' 'ninja' 'cmake' 'doxygen') provides=('dtkwidget') conflicts=('dtkwidget') groups=('deepin-git') -source=('source.tar.gz') +source=("${sourcetars[@]}") sha512sums=('SKIP') -prepare() { - cd $deepin_source_name -} build() { - cd $deepin_source_name - qmake-qt5 PREFIX=/usr - make + cd $sourcedir + cmake . -GNinja \ + -DMKSPECS_INSTALL_DIR=lib/qt/mkspecs/modules/\ + -DBUILD_PLUGINS=OFF \ + -DBUILD_DOCS=ON \ + -DQCH_INSTALL_DESTINATION=share/doc/qt \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release + ninja } package() { - cd $deepin_source_name - make INSTALL_ROOT="$pkgdir" install + cd $sourcedir + DESTDIR="$pkgdir" ninja install } diff -Nru dtkwidget-5.5.48/CMakeLists.txt dtkwidget-5.6.12/CMakeLists.txt --- dtkwidget-5.5.48/CMakeLists.txt 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -1,16 +1,155 @@ -cmake_minimum_required (VERSION 3.10) +cmake_minimum_required(VERSION 3.10) -project (DtkWidget - VERSION "${DTK_REPO_MODULE_VERSION}" - DESCRIPTION "DTK Widget module" - HOMEPAGE_URL "" - LANGUAGES CXX C +set(VERSION + "5.6.8" + CACHE STRING "define project version" ) -find_package (Qt5 CONFIG REQUIRED COMPONENTS DBus Xml) +project(DtkWidget + VERSION ${VERSION} + DESCRIPTION "DTK Widget module" + HOMEPAGE_URL "https://github.com/linuxdeepin/dtkwidget" + LANGUAGES CXX C +) + +set(LIB_NAME dtkwidget) + +# Set install path +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX /usr) +endif() + +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +if(UNIX AND NOT APPLE) + set(LINUX TRUE) +endif() + +# Set build option +set(BUILD_PLUGINS + ON + CACHE BOOL "Build plugin and plugin example" +) + +set(INCLUDE_INSTALL_DIR + "${CMAKE_INSTALL_INCLUDEDIR}/dtk${PROJECT_VERSION_MAJOR}/DWidget" +) +set(TOOL_INSTALL_DIR + "${CMAKE_INSTALL_LIBDIR}/dtk${PROJECT_VERSION_MAJOR}/DWidget/bin" +) +set(LIBRARY_INSTALL_DIR + "${CMAKE_INSTALL_LIBDIR}" +) +set(MKSPECS_INSTALL_DIR + "${CMAKE_INSTALL_LIBDIR}/qt5/mkspecs/modules" + CACHE STRING "Install dir for qt pri files" +) +set(CONFIG_INSTALL_DIR + "${CMAKE_INSTALL_LIBDIR}/cmake/DtkWidget" + CACHE STRING "Install directory for cmake files" +) +set(PKGCONFIG_INSTALL_DIR + "${CMAKE_INSTALL_LIBDIR}/pkgconfig" + CACHE STRING "Install directory for pkgconfig files" +) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wextra") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed") +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(BUILD_TESTING ON) +else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast") +endif() +# find_package +find_package(Dtk REQUIRED COMPONENTS Core Gui) +find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core) +find_package(Qt5 REQUIRED COMPONENTS + Core + Network + Concurrent + Widgets + PrintSupport + LinguistTools + X11Extras + DBus +) +find_package(PkgConfig REQUIRED) + +file(GLOB D_HEADERS "${PROJECT_SOURCE_DIR}/include/DWidget/*") + +set(AUTOCONFIG ${CMAKE_CURRENT_BINARY_DIR}/dtkwidget_config.h) +get_filename_component(CONFIG_INCLUDE ${AUTOCONFIG} DIRECTORY) +set(CONFIG_CONTENT) +string(APPEND CONFIG_CONTENT "// This is an auto-generated config\n") + +foreach(header ${D_HEADERS}) + get_filename_component(thename ${header} NAME) + string(APPEND CONFIG_CONTENT "#define DTKWIDGET_CLASS_${thename}\n") +endforeach() + +file(WRITE ${AUTOCONFIG} ${CONFIG_CONTENT}) + +file(GLOB_RECURSE PUBLIC_HEADERS "${PROJECT_SOURCE_DIR}/include/*.h") +list(APPEND PUBLIC_HEADERS ${D_HEADERS} ${AUTOCONFIG}) + +add_subdirectory(src) +add_subdirectory(examples) +add_subdirectory(tools) + +if(BUILD_TESTING) + message("==================================") + message(" Now Testing is enabled ") + message("==================================") + enable_testing() + add_subdirectory(tests) +endif() + +if(BUILD_PLUGINS) + message("===================================") + message(" You can build and run plugins now ") + message("===================================") + add_subdirectory(plugin) +endif() + +set(BUILD_DOCS + OFF + CACHE BOOL "Generate doxygen-based documentation" +) + +if(BUILD_DOCS) + message("===================================") + message(" You can build docs now ") + message("===================================") + add_subdirectory(docs) +endif() + +configure_package_config_file( + misc/DtkWidgetConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/DtkWidgetConfig.cmake + INSTALL_DESTINATION ${CONFIG_INSTALL_DIR} + PATH_VARS TOOL_INSTALL_DIR +) + +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/DtkWidgetConfigVersion.cmake + VERSION ${VERSION} + COMPATIBILITY SameMajorVersion +) +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/DtkWidgetConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/DtkWidgetConfigVersion.cmake + DESTINATION ${CONFIG_INSTALL_DIR} +) -set (BUILD_DOCS ON CACHE BOOL "Generate doxygen-based documentation") +configure_file(misc/dtkwidget.pc.in dtkwidget.pc @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dtkwidget.pc DESTINATION ${PKGCONFIG_INSTALL_DIR}) -if (BUILD_DOCS) - add_subdirectory(doc) -endif () +configure_file(misc/qt_lib_dtkwidget.pri.in qt_lib_dtkwidget.pri @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qt_lib_dtkwidget.pri DESTINATION ${MKSPECS_INSTALL_DIR}) diff -Nru dtkwidget-5.5.48/conanfile.py dtkwidget-5.6.12/conanfile.py --- dtkwidget-5.5.48/conanfile.py 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/conanfile.py 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +# +# SPDX-License-Identifier: LGPL-3.0-or-later + from conans import ConanFile, tools import os diff -Nru dtkwidget-5.5.48/debian/changelog dtkwidget-5.6.12/debian/changelog --- dtkwidget-5.5.48/debian/changelog 2023-01-14 07:18:27.000000000 +0000 +++ dtkwidget-5.6.12/debian/changelog 2023-05-18 12:26:54.000000000 +0000 @@ -1,144 +1,62 @@ -dtkwidget (5.5.48-1build3) lunar; urgency=medium - - * No-change rebuild against Qt 5.15.8. - - -- Dmitry Shachnev Sat, 14 Jan 2023 10:18:27 +0300 - -dtkwidget (5.5.48-1build2) lunar; urgency=medium - - * No-change rebuild against Qt 5.15.7. - - -- Dmitry Shachnev Sat, 10 Dec 2022 15:58:33 +0300 - -dtkwidget (5.5.48-1build1) kinetic; urgency=medium - - * No-change rebuild against Qt 5.15.6. - - -- Dmitry Shachnev Sat, 17 Sep 2022 20:52:42 +0300 - -dtkwidget (5.5.48-1) unstable; urgency=medium - - * New upstream release 5.5.48. - * debian/rules: Add buildsystem=qmake. - * debian/libdtkwidget5.shlibs: update to version 5.5.48. - - -- Clay Stan Tue, 02 Aug 2022 13:36:53 +0800 - -dtkwidget (5.5.46-1) unstable; urgency=medium +dtkwidget (5.6.12-1) lunar; urgency=medium * New upstream release. - -- Boyuan Yang Wed, 13 Jul 2022 22:53:23 -0400 + -- Arun Kumar Pariyar Thu, 18 May 2023 18:11:54 +0545 -dtkwidget (5.5.45-1) unstable; urgency=medium +dtkwidget (5.6.8-1) lunar; urgency=medium * New upstream release. - -- Boyuan Yang Wed, 25 May 2022 12:25:12 -0400 + -- Arun Kumar Pariyar Wed, 26 Apr 2023 23:55:35 +0545 -dtkwidget (5.5.44-1) unstable; urgency=medium +dtkwidget (5.5.17.1-1) impish; urgency=medium * New upstream release. - * debian/libdtkwidget5.shlibs: update to version 5.5.44. - * debian/libdtkwidget5.install{amd64,i386}: Dropped, useless. - * debian/control: Drop useless hard dependency libqt5widgets5, - use dh_shlibdeps to automatically infer this dependency. - - -- Boyuan Yang Wed, 13 Apr 2022 19:12:47 -0400 -dtkwidget (5.5.37-1) unstable; urgency=medium + -- Arun Kumar Pariyar Sat, 18 Sep 2021 15:34:15 +0545 - * New upstream version 5.5.37. - * debian/control: Add a dependency(libqt5widgets5) - of the libdtkwidget5 package. - * debian/copyright: updated. - * debian/libdtkwidget5.shlibs: update to version 5.5.37. +dtkwidget (5.4.36-1) impish; urgency=medium - -- Clay Stan Thu, 24 Feb 2022 14:14:04 +0800 - -dtkwidget (5.5.17.1-1) unstable; urgency=medium - - * Upload to unstable. + * New upstream release. - -- Boyuan Yang Tue, 09 Nov 2021 16:02:53 -0500 + -- Arun Kumar Pariyar Fri, 17 Sep 2021 21:33:26 +0545 -dtkwidget (5.5.17.1-1~exp2) experimental; urgency=medium +dtkwidget (5.4.1-1ubuntu2) hirsute; urgency=medium - * Bump Standards-Version to 4.6.0. - * debian/control: Correctly build-depends on libdframeworkdbus-dev. - * debian/control: Apply "wrap-and-sort -abst". + * Rebuild - -- Boyuan Yang Mon, 08 Nov 2021 23:39:14 -0500 + -- Arun Kumar Pariyar Thu, 15 Apr 2021 19:08:16 +0545 -dtkwidget (5.5.17.1-1~exp1) experimental; urgency=medium +dtkwidget (5.4.1-1ubuntu1) hirsute; urgency=medium - * New upstream version 5.5.17.1. - * remove symbols file. - * build a new binary package:dtkwidget5-examples + * Rebuild for hirsute. - -- Clay Stan Sat, 28 Aug 2021 19:05:24 +0800 + -- Arun Kumar Pariyar Mon, 08 Feb 2021 13:57:12 +0545 -dtkwidget (5.4.16-1) unstable; urgency=medium +dtkwidget (5.4.1-1) groovy; urgency=medium - * New upstream version 5.4.16. + * New upstream release 5.4.1. - -- Clay Stan Tue, 27 Apr 2021 13:35:02 +0800 + -- Arun Kumar Pariyar Tue, 05 Jan 2021 22:28:01 +0545 -dtkwidget (5.4.1-1~exp1) experimental; urgency=medium +dtkwidget (5.3.0-1) groovy; urgency=medium - [ Clay Stan ] - * New upstream release 5.4.1. - * debian/rules: - + Delete empty Dir - * debian/contol: - + Add Clay Stan to the Uploaders list - [ Hu Feng ] - * debian/control: - + Tighten version of libdtkgui-dev to (>= 5.4~). - + Delete libpulse-dev in Build-Depends. - + Delete pkg-kde-tools in Build-Depends. - + Delete qtbase5-dev in Build-Depends. - + Delete qtmultimedia5-dev in Build-Depends. - + Add libqt5svg5-dev to Depends in libdtkwidget-dev package. - + Delete qtmultimedia5-dev to Depends in libdtkwidget-dev package. - + Tighten version of libdtkgui-dev to (>= 5.4~) - in libdtkwidget-dev packages. - + Delete qtmultimedia5-dev to Depends in libdtkwidget5-bin package. - * debian/patches: - Add 0001-fix-enbale-style-for-non-dde.patch + * New upstream release 5.3.0. - -- Hu Feng Thu, 25 Feb 2021 15:42:11 +0800 + -- Arun Kumar Pariyar Wed, 16 Dec 2020 00:38:02 +0545 -dtkwidget (5.2.2.10-1) unstable; urgency=medium +dtkwidget (5.2.2.10-2) groovy; urgency=medium - * Upload to unstable. - * debian/control: - + Bump Standards-Version to 4.5.1. - + Tighten version of libdtkcore-dev to (>= 5.2~). - + Replace libxcb-util0-dev with libxcb-util-dev. - * debian/patches: - + Drop 0001-Fix-build-failures-under-Qt-5.15.patch. - * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, - Repository-Browse. + * Rebuild with libcups2-dev. - -- Arun Kumar Pariyar Sun, 20 Dec 2020 23:52:21 +0545 + -- Arun Kumar Pariyar Sat, 05 Sep 2020 02:02:10 +0545 -dtkwidget (5.2.2.10-1~exp1) experimental; urgency=medium +dtkwidget (5.2.2.10-1) groovy; urgency=medium - [ Hu Feng ] * New upstream release 5.2.2.10. - * debian/control - + Add Hu Feng to the uploaders list. - + Add libcups2-dev to Build-Depends. - + Add libcups2-dev to Depends in libdtkwidget-dev package. - + Add libdframeworkdbus2 to Depends in libdtkwidget5 package. - + Delete libdframeworkdbus-dev (>= 1.0~) in Build-Depends. - + Delete librsvg2-dev in Build-Depends - - [ Arun Kumar Pariyar ] - * debian/copyright: Update license information. - -- Arun Kumar Pariyar Tue, 03 Nov 2020 21:06:35 +0545 + -- Arun Kumar Pariyar Sat, 05 Sep 2020 00:13:45 +0545 dtkwidget (5.2.2.2-1~exp1) experimental; urgency=medium @@ -162,13 +80,6 @@ -- Arun Kumar Pariyar Sun, 12 Jul 2020 16:00:32 +0545 -dtkwidget (2.1.1-1.1) unstable; urgency=medium - - * Non-maintainer upload. - * Backport upstream patch to fix build with Qt 5.15 (closes: #972155). - - -- Dmitry Shachnev Thu, 22 Oct 2020 14:08:37 +0300 - dtkwidget (2.1.1-1) unstable; urgency=medium * Upload to unstable. diff -Nru dtkwidget-5.5.48/debian/control dtkwidget-5.6.12/debian/control --- dtkwidget-5.5.48/debian/control 2022-08-02 05:35:39.000000000 +0000 +++ dtkwidget-5.6.12/debian/control 2023-05-18 10:34:34.000000000 +0000 @@ -1,29 +1,32 @@ Source: dtkwidget Section: libs Priority: optional -Maintainer: Debian Deepin Packaging Team +Maintainer: Arun Kumar Pariyar +XSBC-Original-Maintainer: Debian Deepin Packaging Team Uploaders: Boyuan Yang , Yanhao Mo , SZ Lin (林上智) , Arun Kumar Pariyar , - Hu Feng , - Clay Stan , Build-Depends: + cmake, debhelper-compat (= 13), + doxygen, libcups2-dev, - libdframeworkdbus-dev (>= 5.4.20~), - libdtkcore-dev (>= 5.5.17), - libdtkgui-dev (>= 5.5.17), + libdtkcore-dev (>= 5.6.8~), + libdtkcore5-bin (>= 5.6.8~), + libdtkgui-dev (>= 5.6.8~), libegl1-mesa-dev, - libfontconfig1-dev, - libfreetype6-dev, + libfontconfig-dev, + libfreetype-dev, libglib2.0-dev, libgsettings-qt-dev, libgtest-dev, libmtdev-dev, + libpulse-dev, libqt5svg5-dev, libqt5x11extras5-dev, + librsvg2-dev, libstartup-notification0-dev, libudev-dev, libxcb-util-dev, @@ -31,12 +34,14 @@ libxi-dev, libxrender-dev, pkg-config, + pkg-kde-tools, + qtbase5-dev, qtbase5-private-dev, qttools5-dev, qttools5-dev-tools, x11proto-xext-dev, Rules-Requires-Root: no -Standards-Version: 4.6.1 +Standards-Version: 4.5.0 Homepage: https://github.com/linuxdeepin/dtkwidget Vcs-Git: https://salsa.debian.org/pkg-deepin-team/dtkwidget.git Vcs-Browser: https://salsa.debian.org/pkg-deepin-team/dtkwidget @@ -44,10 +49,10 @@ Package: dtkwidget5-examples Architecture: any Depends: - libdtkwidget5 (= ${binary:Version}), + libdtkwidget5( =${binary:Version}), ${misc:Depends}, ${shlibs:Depends}, -Description: dtkwidget-examples is generated by dtkwidget +Description: dtkwidget-examples is generated by dtkwidget. DtkWidget is Deepin graphical user interface for deepin desktop development. . This package contains example application which are @@ -58,8 +63,8 @@ Section: libdevel Depends: libcups2-dev, - libdtkcore-dev (>= 5.5.17), - libdtkgui-dev (>= 5.5.17), + libdtkcore-dev, + libdtkgui-dev, libdtkwidget5 (= ${binary:Version}), libqt5svg5-dev, libqt5x11extras5-dev, @@ -80,8 +85,6 @@ libdtkcommon, ${misc:Depends}, ${shlibs:Depends}, -Recommends: - dde-qt5integration, Multi-Arch: same Description: Deepin Tool Kit Widget library DtkWidget is the Deepin graphical user interface library for deepin @@ -94,8 +97,8 @@ Package: libdtkwidget5-bin Architecture: any Depends: - libdtkcore-dev (>= 5.5.17), - libdtkwidget5 (= ${binary:Version}), + libdtkcore-dev, + libdtkwidget5( =${binary:Version}), libqt5svg5-dev, libqt5x11extras5-dev, ${misc:Depends}, diff -Nru dtkwidget-5.5.48/debian/copyright dtkwidget-5.6.12/debian/copyright --- dtkwidget-5.5.48/debian/copyright 2022-08-02 05:35:39.000000000 +0000 +++ dtkwidget-5.6.12/debian/copyright 2023-05-18 10:34:34.000000000 +0000 @@ -5,15 +5,12 @@ Files: * Copyright: 2010-2021, Deepin Technology Co., Ltd. - 2021, Uniontech Technology Co., Ltd. - 2021, Uniontech Software Technology Co.,Ltd. License: LGPL-3+ Files: debian/* Copyright: 2010-2018, Deepin Technology Co., Ltd. 2017-2020, Boyuan Yang <073plan@gmail.com> 2020, Arun Kumar Pariyar - 2022, Clay Stan License: LGPL-3+ Files: tools/translate_generation.sh @@ -25,24 +22,6 @@ Copyright: Iceyer License: GPL-2+ -Files: src/widgets/dprintpreviewdialog.h - src/widgets/dprintpreviewwidget.h - src/widgets/dsearchcombobox.* - src/widgets/dtoolbutton.* - src/widgets/dwindowquitfullbutton.* - src/widgets/private/dprintpreviewdialog_p.h - src/widgets/private/dprintpreviewwidget_p.h - src/widgets/private/dsearchcombobox_p.h - src/widgets/dprintpickcolorwidget.cpp - src/widgets/dprintpickcolorwidget.h - plugin/dtkuidemo/*.cpp - plugin/dtkuidemo/*.h - plugin/dtkuiplugin/*.h - plugin/dtkuiplugin/*.cpp -Copyright: 2019-2021, Uniontech Software Technology Co.,Ltd. - 2020, Deepin Technology Co., Ltd. -License: GPL-3+ - License: LGPL-3+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -77,21 +56,3 @@ . On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. - -License: GPL-3+ - This package 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 package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - . - On Debian systems, the complete text of the GNU General - Public License can be found in `/usr/share/common-licenses/GPL-3'. diff -Nru dtkwidget-5.5.48/debian/dtkwidget5-examples.install dtkwidget-5.6.12/debian/dtkwidget5-examples.install --- dtkwidget-5.5.48/debian/dtkwidget5-examples.install 2022-08-02 05:35:39.000000000 +0000 +++ dtkwidget-5.6.12/debian/dtkwidget5-examples.install 2023-05-18 10:34:34.000000000 +0000 @@ -1 +1,2 @@ -usr/lib/*/examples/* +usr/lib/*/*/*/examples/* +usr/share/dsg/configs/overrides/dtk-example/* diff -Nru dtkwidget-5.5.48/debian/libdtkwidget5.install dtkwidget-5.6.12/debian/libdtkwidget5.install --- dtkwidget-5.5.48/debian/libdtkwidget5.install 2022-08-02 05:35:39.000000000 +0000 +++ dtkwidget-5.6.12/debian/libdtkwidget5.install 2023-05-18 10:34:34.000000000 +0000 @@ -1,2 +1,3 @@ usr/lib/*/lib*.so.* usr/share/*/DWidget/translations/* +usr/share/dsg/configs/org.deepin.dtkwidget.feature-display.json diff -Nru dtkwidget-5.5.48/debian/libdtkwidget5.lintian-overrides dtkwidget-5.6.12/debian/libdtkwidget5.lintian-overrides --- dtkwidget-5.5.48/debian/libdtkwidget5.lintian-overrides 2022-08-02 05:35:39.000000000 +0000 +++ dtkwidget-5.6.12/debian/libdtkwidget5.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -#If we work with other packages / teams, symbol can stabilize ABI -#But all deepin packages are maintained by our team (pkg-deepin) -#so symbols are meaningless and will fail for gcc-11, so removed -no-symbols-control-file diff -Nru dtkwidget-5.5.48/debian/libdtkwidget5.shlibs dtkwidget-5.6.12/debian/libdtkwidget5.shlibs --- dtkwidget-5.5.48/debian/libdtkwidget5.shlibs 2022-08-02 05:36:53.000000000 +0000 +++ dtkwidget-5.6.12/debian/libdtkwidget5.shlibs 2023-05-18 10:34:34.000000000 +0000 @@ -1 +1 @@ -libdtkwidget 5 libdtkwidget5 (>= 5.5.48) +libdtkwidget 5 libdtkwidget5 (>= 5.2.1) diff -Nru dtkwidget-5.5.48/debian/libdtkwidget-dev.install dtkwidget-5.6.12/debian/libdtkwidget-dev.install --- dtkwidget-5.5.48/debian/libdtkwidget-dev.install 2022-08-02 05:35:39.000000000 +0000 +++ dtkwidget-5.6.12/debian/libdtkwidget-dev.install 2023-05-18 10:34:34.000000000 +0000 @@ -1,5 +1,5 @@ usr/include usr/lib/*/cmake/*/*.cmake usr/lib/*/libdtkwidget.so -usr/lib/*/pkgconfig/*.pc +usr/lib/*/pkgconfig usr/lib/*/qt5/* diff -Nru dtkwidget-5.5.48/debian/rules dtkwidget-5.6.12/debian/rules --- dtkwidget-5.5.48/debian/rules 2022-08-02 05:36:53.000000000 +0000 +++ dtkwidget-5.6.12/debian/rules 2023-05-18 10:34:34.000000000 +0000 @@ -8,17 +8,18 @@ export QT_SELECT := 5 +# Retrieve version info +include /usr/share/dpkg/default.mk + # Explicitly enable hardening DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk -# Retrieve version info -include /usr/share/dpkg/default.mk - +include /usr/share/dpkg/architecture.mk %: - dh $@ --buildsystem=qmake + dh $@ override_dh_auto_configure: - dh_auto_configure -- LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) + dh_auto_configure -- -DBUILD_DOCS=OFF diff -Nru dtkwidget-5.5.48/debian/upstream/metadata dtkwidget-5.6.12/debian/upstream/metadata --- dtkwidget-5.5.48/debian/upstream/metadata 2022-08-02 05:35:39.000000000 +0000 +++ dtkwidget-5.6.12/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ ---- -Bug-Database: https://github.com/linuxdeepin/dtkwidget/issues -Bug-Submit: https://github.com/linuxdeepin/dtkwidget/issues/new -Repository: https://github.com/linuxdeepin/dtkwidget.git -Repository-Browse: https://github.com/linuxdeepin/dtkwidget diff -Nru dtkwidget-5.5.48/doc/CMakeLists.txt dtkwidget-5.6.12/doc/CMakeLists.txt --- dtkwidget-5.5.48/doc/CMakeLists.txt 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/doc/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -cmake_minimum_required (VERSION 3.10) - -find_package (Doxygen REQUIRED) - -set (QCH_INSTALL_DESTINATION ${CMAKE_INSTALLL_PREFIX}/share/DDE/dtk CACHE STRING "QCH install location") - -set (DOXYGEN_GENERATE_HTML "NO" CACHE STRING "Doxygen HTML output") -set (DOXYGEN_GENERATE_XML "NO" CACHE STRING "Doxygen XML output") -set (DOXYGEN_GENERATE_QHP "YES" CACHE STRING "Doxygen QHP output") -set (DOXYGEN_FILE_PATTERNS *.cpp *.h *.zh_CN.md *.zh_CN.dox CACHE STRING "Doxygen File Patterns") -set (DOXYGEN_PROJECT_NUMBER ${CMAKE_PROJECT_VERSION} CACHE STRING "") # Should be the same as this project is using. -set (DOXYGEN_EXTRACT_STATIC YES) -set (DOXYGEN_OUTPUT_LANGUAGE "Chinese" CACHE STRING "Doxygen Output Language") -set (DOXYGEN_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/docs/) -set (DOXYGEN_IMAGE_PATH ${CMAKE_CURRENT_LIST_DIR}/images/) -set (DOXYGEN_QHG_LOCATION "qhelpgenerator") -set (DOXYGEN_QHP_NAMESPACE "org.deepin.dtk.widget") -set (DOXYGEN_QCH_FILE "dtkwidget.qch") -set (DOXYGEN_QHP_VIRTUAL_FOLDER "dtkwidget") -set (DOXYGEN_HTML_EXTRA_STYLESHEET "" CACHE STRING "Doxygen custom stylesheet for HTML output") -set (DOXYGEN_TAGFILES "qtcore.tags=qthelp://org.qt-project.qtcore/qtcore/" CACHE STRING "Doxygen tag files") - -set (DOXYGEN_PREDEFINED - "D_DECL_DEPRECATED_X(x)=" - "\"DCORE_BEGIN_NAMESPACE=namespace Dtk { namespace Core {\"" - "\"DCORE_END_NAMESPACE=}}\"" - "\"DCORE_USE_NAMESPACE=using namespace Dtk::Core\;\"" - "\"DWIDGET_BEGIN_NAMESPACE=namespace Dtk { namespace Widget {\"" - "\"DWIDGET_END_NAMESPACE=}}\"" - "\"DWIDGET_USE_NAMESPACE=using namespace Dtk::Widget\;\"" -) -set (DOXYGEN_MACRO_EXPANSION "YES") -set (DOXYGEN_EXPAND_ONLY_PREDEF "YES") - -doxygen_add_docs (doxygen - ${PROJECT_SOURCE_DIR}/src - ${PROJECT_SOURCE_DIR}/doc - ALL - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - COMMENT "Generate documentation via Doxygen" -) - -install (FILES ${PROJECT_BINARY_DIR}/docs/html/dtkwidget.qch DESTINATION ${QCH_INSTALL_DESTINATION}) Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/blur-effect.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/blur-effect.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/blur_widget_demo1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/blur_widget_demo1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/blur_widget_demo2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/blur_widget_demo2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/blur_window_demo1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/blur_window_demo1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/blur_window_demo2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/blur_window_demo2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/clip_window_demo.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/clip_window_demo.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/clip_window_demo.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/clip_window_demo.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DArrowButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DArrowButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DBackgroundGroup.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DBackgroundGroup.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DBaseExpand.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DBaseExpand.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DButtonBoxButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DButtonBoxButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DButtonBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DButtonBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DCrumbEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DCrumbEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/dfiledialog.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/dfiledialog.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/dflowlayout.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/dflowlayout.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DHeaderLine.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DHeaderLine.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/disable_close_function.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/disable_close_function.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/disable_composite.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/disable_composite.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/disable_maximize_function.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/disable_maximize_function.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/disable_minimize_function.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/disable_minimize_function.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/disable_move_function.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/disable_move_function.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/disable_resize_function.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/disable_resize_function.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DPrintPreviewExample.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DPrintPreviewExample.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DSpinBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DSpinBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DSpinner.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DSpinner.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DStackWidget.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DStackWidget.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DStandardItem.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DStandardItem.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/dtk_and_system_window.jpeg and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/dtk_and_system_window.jpeg differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/dtk_window_cursor_effect.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/dtk_window_cursor_effect.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DToast.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DToast.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DViewItemAction2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DViewItemAction2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/DViewItemAction.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/DViewItemAction.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/dwaterprogress.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/dwaterprogress.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/edge1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/edge1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/edge2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/edge2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/edge3.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/edge3.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/edges_anchors.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/edges_anchors.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/enable_composite.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/enable_composite.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/font.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/font.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/frame_margins.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/frame_margins.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/frame_mask_demo.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/frame_mask_demo.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/margins_anchors.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/margins_anchors.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/pageindicator.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/pageindicator.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/searchedit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/searchedit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/segmentedcontrol.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/segmentedcontrol.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/switchlineexpand.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/switchlineexpand.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/wa_wb_topWindow.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/wa_wb_topWindow.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/doc/images/window_system_menu.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/doc/images/window_system_menu.gif differ diff -Nru dtkwidget-5.5.48/doc/src/dtkwidget-index.zh_CN.dox dtkwidget-5.6.12/doc/src/dtkwidget-index.zh_CN.dox --- dtkwidget-5.5.48/doc/src/dtkwidget-index.zh_CN.dox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/doc/src/dtkwidget-index.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Chen Bin - * - * Maintainer: Chen Bin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -/*! -\page dtkwidget-index DTK Widget Docs - -\keyword DTK Widget Reference Documentation - -DtkWidget is Deepin graphical user interface for deepin desktop development. - -\li \l {DTK Gui Docs} -\li \l {DTK Gui 模块} -\li \l {DTK Core Docs} -\li \l {DTK Core 模块} -\li \l {DTK Widget 模块} - -*/ diff -Nru dtkwidget-5.5.48/doc/src/dtkwidget.zh_CN.dox dtkwidget-5.6.12/doc/src/dtkwidget.zh_CN.dox --- dtkwidget-5.5.48/doc/src/dtkwidget.zh_CN.dox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/doc/src/dtkwidget.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Chen Bin - * - * Maintainer: Chen Bin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -/*! - \module dtkwidget - \mainpage DTK Widget 模块 - - \brief DtkWidget is Deepin graphical user interface for deepin desktop development. -*/ diff -Nru dtkwidget-5.5.48/docs/CMakeLists.txt dtkwidget-5.6.12/docs/CMakeLists.txt --- dtkwidget-5.5.48/docs/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,81 @@ +cmake_minimum_required (VERSION 3.10) + +find_package (Doxygen REQUIRED) + +set (QCH_INSTALL_DESTINATION ${CMAKE_INSTALLL_PREFIX}/share/qt5/doc CACHE STRING "QCH install location") + +set (DOXYGEN_GENERATE_HTML "YES" CACHE STRING "Doxygen HTML output") +set (DOXYGEN_GENERATE_XML "YES" CACHE STRING "Doxygen XML output") +set (DOXYGEN_GENERATE_QHP "YES" CACHE STRING "Doxygen QHP output") +set (DOXYGEN_FILE_PATTERNS *.cpp *.h *.zh_CN.md *.zh_CN.dox CACHE STRING "Doxygen File Patterns") +set (DOXYGEN_PROJECT_NUMBER ${CMAKE_PROJECT_VERSION} CACHE STRING "") # Should be the same as this project is using. +set (DOXYGEN_EXTRACT_STATIC YES) +set (DOXYGEN_OUTPUT_LANGUAGE "Chinese" CACHE STRING "Doxygen Output Language") +set (DOXYGEN_IMAGE_PATH ${CMAKE_CURRENT_LIST_DIR}/images/) +set (DOXYGEN_QHG_LOCATION "qhelpgenerator") +set (DOXYGEN_QHP_NAMESPACE "org.deepin.dtk.widget") +set (DOXYGEN_QCH_FILE "dtkwidget.qch") +set (DOXYGEN_QHP_VIRTUAL_FOLDER "dtkwidget") +set (DOXYGEN_HTML_EXTRA_STYLESHEET "" CACHE STRING "Doxygen custom stylesheet for HTML output") +set (DOXYGEN_TAGFILES "qtcore.tags=qthelp://org.qt-project.qtcore/qtcore/" CACHE STRING "Doxygen tag files") + +set (DOXYGEN_PREDEFINED + "D_DECL_DEPRECATED_X(x)=" + "DCORE_BEGIN_NAMESPACE=namespace Dtk { namespace Core {" + "DCORE_END_NAMESPACE=}}" + "DCORE_USE_NAMESPACE=using namespace Dtk::Core;" + "DWIDGET_BEGIN_NAMESPACE=namespace Dtk { namespace Widget {" + "DWIDGET_END_NAMESPACE=}}" + "DWIDGET_USE_NAMESPACE=using namespace Dtk::Widget;" +) + +set (BUILD_THEME OFF CACHE BOOL "Build doxgen theme") +if(BUILD_THEME) +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/doxygen-theme") +message(STATUS "doxygen-theme exist") +else() +execute_process(COMMAND git clone https://github.com/linuxdeepin/doxygen-theme.git --depth=1 + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + TIMEOUT 60 + ) +execute_process(COMMAND bash themesetting.sh + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/doxygen-theme/ +) +endif() +set (DOXYGEN_HTML_EXTRA_STYLESHEET "docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome.css" + "docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-sidebar-only.css" + "docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-sidebar-only-darkmode-toggle.css" + ) +set (DOXYGEN_HTML_EXTRA_FILES "docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js" + "docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js" + "docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-paragraph-link.js" + "docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-interactive-toc.js" + ) +set (DOXYGEN_GENERATE_TREEVIEW "YES") +set (DOXYGEN_DISABLE_INDEX "NO") +set (DOXYGEN_FULL_SIDEBAR "NO") +set (DOXYGEN_HTML_HEADER "docs/doxygen-theme/doxygen-awesome-css/header.html") +set (DOXYGEN_HTML_FOOTER "docs/doxygen-theme/doxygen-awesome-css/footer.html") +endif() + +set (DOXYGEN_MACRO_EXPANSION "YES") +set (DOXYGEN_EXPAND_ONLY_PREDEF "YES") + +# Exclude private classes. +set(DOXYGEN_EXCLUDE_PATTERNS + ${PROJECT_SOURCE_DIR}/src/widgets/private/dimageviewer_p.h + ${PROJECT_SOURCE_DIR}/src/widgets/private/dimagevieweritems_p.h + ${PROJECT_SOURCE_DIR}/src/widgets/private/dsplitscreen_p.h + ${PROJECT_SOURCE_DIR}/src/widgets/dimagevieweritems.cpp +) + +doxygen_add_docs (doxygen + ${PROJECT_SOURCE_DIR}/src + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_SOURCE_DIR}/docs + ALL + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + COMMENT "Generate documentation via Doxygen" +) + +install (FILES ${PROJECT_BINARY_DIR}/docs/html/dtkwidget.qch DESTINATION ${QCH_INSTALL_DESTINATION}) Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/blur-effect.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/blur-effect.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/blur_widget_demo1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/blur_widget_demo1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/blur_widget_demo2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/blur_widget_demo2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/blur_window_demo1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/blur_window_demo1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/blur_window_demo2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/blur_window_demo2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/chooseredit-example.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/chooseredit-example.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/clip_window_demo.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/clip_window_demo.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/clip_window_demo.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/clip_window_demo.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/daboutdialog_example2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/daboutdialog_example2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/daboutdialog_example.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/daboutdialog_example.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DArrowButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DArrowButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/darrowrectangle_example1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/darrowrectangle_example1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/darrowrectangle_example2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/darrowrectangle_example2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dbackgroundgroup_example.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dbackgroundgroup_example.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DBackgroundGroup.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DBackgroundGroup.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DBaseExpand.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DBaseExpand.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dboxwidget-example.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dboxwidget-example.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DButtonBoxButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DButtonBoxButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DButtonBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DButtonBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DCrumbEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DCrumbEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/ddialog_example.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/ddialog_example.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dfeaturedisplaydialog.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dfeaturedisplaydialog.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dfiledialog.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dfiledialog.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dflowlayout.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dflowlayout.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DHeaderLine.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DHeaderLine.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/disable_close_function.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/disable_close_function.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/disable_composite.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/disable_composite.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/disable_maximize_function.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/disable_maximize_function.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/disable_minimize_function.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/disable_minimize_function.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/disable_move_function.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/disable_move_function.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/disable_resize_function.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/disable_resize_function.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dlineedit_example1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dlineedit_example1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dlineedit_example2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dlineedit_example2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dlistview_example.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dlistview_example.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dmainwindow_example2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dmainwindow_example2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dmainwindow_example.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dmainwindow_example.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dmessagemanager_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dmessagemanager_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dmessagemanager_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dmessagemanager_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dmessagemanager_mw.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dmessagemanager_mw.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DPrintPreviewExample.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DPrintPreviewExample.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dsettingsdialog_example.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dsettingsdialog_example.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dslider_example.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dslider_example.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DSpinBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DSpinBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dspinner_example.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dspinner_example.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DSpinner.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DSpinner.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DStackWidget.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DStackWidget.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DStandardItem.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DStandardItem.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dstyle_example1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dstyle_example1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dstyle_example2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dstyle_example2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dtitlebar_example1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dtitlebar_example1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dtitlebar_example2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dtitlebar_example2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dtitlebar_example3.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dtitlebar_example3.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dtk_and_system_window.jpeg and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dtk_and_system_window.jpeg differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dtk_window_cursor_effect.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dtk_window_cursor_effect.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DToast.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DToast.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DViewItemAction2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DViewItemAction2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/DViewItemAction.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/DViewItemAction.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/dwaterprogress.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/dwaterprogress.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/edge1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/edge1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/edge2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/edge2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/edge3.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/edge3.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/edges_anchors.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/edges_anchors.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/enable_composite.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/enable_composite.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/font.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/font.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/frame_margins.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/frame_margins.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/frame_mask_demo.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/frame_mask_demo.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/margins_anchors.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/margins_anchors.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/pageindicator.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/pageindicator.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/searchedit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/searchedit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/segmentedcontrol.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/segmentedcontrol.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/switchlineexpand.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/switchlineexpand.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/wa_wb_topWindow.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/wa_wb_topWindow.gif differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/docs/images/window_system_menu.gif and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/docs/images/window_system_menu.gif differ diff -Nru dtkwidget-5.5.48/docs/index.zh_CN.md dtkwidget-5.6.12/docs/index.zh_CN.md --- dtkwidget-5.5.48/docs/index.zh_CN.md 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/index.zh_CN.md 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,29 @@ +@mainpage + +# dtkwidget + +dtkwidget是dtk对于qtwidget的封装与扩充,方便用户快速开发符合dtk视觉风格的应用。其中重写了部分qtwidget的控件,以及提供了一些新的控件,提供给开发者一个更轻松美观的选择。 + +## 文档结构 + +因为dtkwidget文档较为庞大,可能存在文档过多无法找到自己想要的内容,特意在此进行说明:
+如果你需要找对应widget的文档,请选择模块选项,然后选择dtkwidget,最后选择对应的widget即可。
+如果你想寻找widget对应的教程,我们将简单教程放在文档中,如果你要使用的widget有简单示例,你可以在接口文档中找到它。
+ +## 示例 + +dtkwidget和别的项目不同,其有一个令人惊叹的示例,你可以在源码仓库的example中找到它。
+如果你使用的是deepin/uos系统的话 那更为简单 +```bash +sudo apt install dtkwidget5-examples +``` +```bash +/usr/lib/x86_64-linux-gnu/libdtk-5.6.2.2/DWidget/examples/collections +``` +即可运行,在其中可以看到相关模块的示例 + +## 关于此文档 + +本文档由deepin doc doc go sig维护,部分例子是由第三方开发者参与撰写,可能存在错误或者其他问题,在您阅读时,如果发现文档中存在问题,请与我们进行联系或者直接在仓库下开issus提问
+联系方式:[Matrix上的deepin doc doc go sig](https://matrix.to/#/#deepin_doc_doc_go:matrix.org)
+如果你也想加入我们,为开源社区添砖加瓦,也欢迎通过此方式联系我们,我们将不胜感激 diff -Nru dtkwidget-5.5.48/docs/widgets/daboutdialog.zh_CN.dox dtkwidget-5.6.12/docs/widgets/daboutdialog.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/daboutdialog.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/daboutdialog.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,326 @@ +/*! +@~chinese +@file daboutdialog.h +@ingroup dtkwidget +@class Dtk::Widget::DAboutDialog +@brief DAboutDialog 类提供了应用程序的关于对话框, 规范所有 deepin 应用关于窗口设计规范, 符合 deepin 风格 +@details + +## 概述 + +DAboutDialog 类提供了应用程序的关于对话框 + +项目目录结构在同一目录下 + +## CMakeLists.txt + +```cmake +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # support clangd 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui) # 寻找Dtk组件Gui + +add_executable(example1 # 添加可执行文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE + Qt5::Widgets + Qt5::Gui + dtkgui + dtkcore + dtkwidget +) # 链接库 + +``` + +## main.cpp + +```cpp +#include +#include +DWIDGET_USE_NAMESPACE // 使用Dtk widget命名空间 +int main(int argc, char *argv[]) { + DApplication app(argc, argv); + app.setProductName("Dtk example"); // 设置产品名称 + app.setOrganizationName("deepin"); + DAboutDialog about; // 创建DAboutDialog对象 + about.setWindowTitle("这是一个最简单的例子"); // 设置窗口标题 + about.show(); // 显示DAboutDialog + return app.exec(); // 运行程序 +} +``` + +这是一个最简单的例子,运行结果如下 + +![example](/docs/images/daboutdialog_example.png) + +但是这个例子并不是我们实际上使用的样子,在我们实际上的使用过程中,我们需要添加一些信息,比如我们的logo,我们的版本号,我们的版权信息等等,这些信息都应该在app中设置,如下 + +### CMakeLists.txt + +```cmake +cmake_minimum_required(VERSION 3.1.0) + +project(example VERSION 1.0.0 LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(target example) + +set(CMAKE_AUTOMOC ON) # support qt moc +set(CMAKE_AUTORCC ON) # support qt resource file +set(CMAKE_AUTOUIC ON) # support qt ui file + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # suppot clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") + set(CMAKE_INCLUDE_CURRENT_DIR ON) +endif() + +find_package(Qt5 COMPONENTS Widgets REQUIRED) +find_package(Qt5 COMPONENTS Gui REQUIRED) +find_package(Dtk COMPONENTS Widget REQUIRED) +find_package(Dtk COMPONENTS Core REQUIRED) +find_package(Dtk COMPONENTS Gui) + +add_executable(example + widget.hpp + widget.cpp + main.cpp +) + +target_link_libraries(example PRIVATE + Qt5::Widgets + Qt5::Gui + dtkgui + dtkcore + dtkwidget +) +``` + +### main.cpp + +```cpp +#include +#include +#include "widget.hpp" + +DWIDGET_USE_NAMESPACE +int main(int argc, char *argv[]) +{ + DApplication a(argc, argv); + example example1; + example1.show(); + a.setApplicationName("dtk example"); //直接设置app的名称 + DAboutDialog dialog; + return a.exec(); +} +``` + +### widget.hpp + +```cpp +#ifndef EXAMPLE_H +#define EXAMPLE_H +#include +#include +#include +#include +#include +DWIDGET_USE_NAMESPACE +class example : public DMainWindow +{ + Q_OBJECT +public: + example(); + ~example(); +private: + QVBoxLayout *mainlayout; + DLabel *label; + DLineEdit *text; + DPushButton *button; + +private slots: +void printlog(); +}; +#endif + +``` + +### widget.cpp + +```cpp +#include "widget.hpp" +#include +#include +example::example() +{ + mainlayout= new QVBoxLayout; + button = new DPushButton; + label = new DLabel("test"); + text = new DLineEdit(); + mainlayout->addWidget(label); + mainlayout->addWidget(text); + mainlayout->addWidget(button); + setLayout(mainlayout); + connect(button,SIGNAL(clicked()),this,SLOT(printlog())); +} +example::~example(){} + +void example::printlog() +{ + printf("%s\n","clicked"); + qDebug() << "button clicked!"; // 如果没设置相应环境变量则此Debug无法输出 +} +``` + +效果如下图 + +![example](/docs/images/daboutdialog_example2.png) + + +@property QString Dtk::Widget::DAboutDialog::windowTitle +@brief 话标题栏内容属性 +@sa read方法 [windowTitle](@ref Dtk::Widget::DAboutDialog::windowTitle() const) +@sa write方法 [setWindowTitle](@ref Dtk::Widget::DAboutDialog::setWindowTitle(const QString &windowTitle)) + +@fn QString Dtk::Widget::DAboutDialog::windowTitle() const +@brief 返回对话标题栏内容 +@sa 属性 [windowTitle](@ref Dtk::Widget::DAboutDialog::windowTitle) + +@fn void Dtk::Widget::DAboutDialog::setWindowTitle(const QString &windowTitle) +@brief 设置对话标题栏内容 +@sa 属性 [windowTitle](@ref Dtk::Widget::DAboutDialog::windowTitle) + +@property QString Dtk::Widget::DAboutDialog::productName +@brief 对话框显示的应用名称属性 +@sa read方法 [productName](@ref Dtk::Widget::DAboutDialog::productName() const) +@sa write方法 [setProductName](@ref Dtk::Widget::DAboutDialog::setProductName(const QString &productName)) + +@fn QString Dtk::Widget::DAboutDialog::productName() const +@brief 返回对话框显示的应用名称 +@sa 属性 [productName](@ref Dtk::Widget::DAboutDialog::productName) + +@fn void Dtk::Widget::DAboutDialog::setProductName(const QString &productName) +@brief 设置对话框显示的应用名称 +@sa 属性 [productName](@ref Dtk::Widget::DAboutDialog::productName) + +@property QString Dtk::Widget::DAboutDialog::version +@brief 指定的 version 版本信息属性 +@sa read方法 [version](@ref Dtk::Widget::DAboutDialog::version() const) +@sa write方法 [setVersion](@ref Dtk::Widget::DAboutDialog::setVersion(const QString &version)) + +@fn QString Dtk::Widget::DAboutDialog::version() const +@brief 返回指定的 version 版本信息 +@sa 属性 [version](@ref Dtk::Widget::DAboutDialog::version) + +@fn void Dtk::Widget::DAboutDialog::setVersion(const QString &version) +@brief 设置指定的 version 版本信息 +@sa 属性 [version](@ref Dtk::Widget::DAboutDialog::version) + +@property QString Dtk::Widget::DAboutDialog::description +@brief 指定的 description 描述信息属性 +@sa read方法 [description](@ref Dtk::Widget::DAboutDialog::description() const) +@sa write方法 [setDescription](@ref Dtk::Widget::DAboutDialog::setDescription()) + +@fn QString Dtk::Widget::DAboutDialog::description() const +@brief 返回指定的 description 描述信息 +@sa 属性 [description](@ref Dtk::Widget::DAboutDialog::description) + +@fn void Dtk::Widget::DAboutDialog::setDescription() +@brief 此函数用于设置指定的 description 描述信息. +@sa 属性 [description](@ref Dtk::Widget::DAboutDialog::description) + +@property QString Dtk::Widget::DAboutDialog::license +@brief 指定的license许可证属性 +@sa read方法 [license](@ref Dtk::Widget::DAboutDialog::license() const) +@sa write方法 [setLicense](@ref Dtk::Widget::DAboutDialog::setLicense(const QString &license)) + +@fn QString Dtk::Widget::DAboutDialog::license() const +@brief 返回指定的license许可证 +@sa 属性 [license](@ref Dtk::Widget::DAboutDialog::license) + +@fn void Dtk::Widget::DAboutDialog::setLicense(const QString &license) +@brief 设置指定的license许可证 +@sa 属性 [license](@ref Dtk::Widget::DAboutDialog::license) + +@property QString Dtk::Widget::DAboutDialog::websiteName +@brief 指向的网站名属性 +@sa read方法 [websiteName](@ref Dtk::Widget::DAboutDialog::websiteName() const) +@sa write方法 [setWebsiteName](@ref Dtk::Widget::DAboutDialog::setWebsiteName(const QString &websiteName)) + + +@fn QString Dtk::Widget::DAboutDialog::websiteName() const +@brief 返回指向的网站名 +@sa 属性 [websiteName](@ref Dtk::Widget::DAboutDialog::websiteName) + +@fn void Dtk::Widget::DAboutDialog::setWebsiteName(const QString &websiteName) +@brief 设置指向的网站名 +@details通常采用 www.deepin.org 等形式 +@sa 属性 [websiteName](@ref Dtk::Widget::DAboutDialog::websiteName) + +@property QString Dtk::Widget::DAboutDialog::websiteLink +@brief 指定的网站连接属性 +@details如果用户点击对话框中显示的网址, 则会打开相应的链接 +@sa read方法 [websiteLink](@ref Dtk::Widget::DAboutDialog::websiteLink() const) +@sa write方法 [setWebsiteLink](@ref Dtk::Widget::DAboutDialog::setWebsiteLink(const QString &websiteLink)) + +@fn QString Dtk::Widget::DAboutDialog::websiteLink() const +@brief 返回指定的网站连接 +@sa 属性 [websiteLink](@ref Dtk::Widget::DAboutDialog::websiteLink) + +@fn void Dtk::Widget::DAboutDialog::setWebsiteLink(const QString &websiteLink) +@brief 设置指定的网站连接 +@sa 属性 [websiteLink](@ref Dtk::Widget::DAboutDialog::websiteLink) + +@property QString Dtk::Widget::DAboutDialog::acknowledgementLink +@brief 指定acknowledgementLink鸣谢连接属性 +@sa read方法 [acknowledgementLink](@ref Dtk::Widget::DAboutDialog::acknowledgementLink() const) +@sa write方法 [setAcknowledgementLink](@ref Dtk::Widget::DAboutDialog::setAcknowledgementLink(const QString &acknowledgementLink)) + +@fn QString Dtk::Widget::DAboutDialog::acknowledgementLink() const +@brief 返回指定acknowledgementLink鸣谢连接 +@sa 属性 [acknowledgementLink](@ref Dtk::Widget::DAboutDialog::acknowledgementLink) + +@fn void Dtk::Widget::DAboutDialog::setAcknowledgementLink(const QString &acknowledgementLink) +@brief 设置指定acknowledgementLink鸣谢连接 +@sa 属性 [acknowledgementLink](@ref Dtk::Widget::DAboutDialog::acknowledgementLink) + +@fn void Dtk::Widget::DAboutDialog::setAcknowledgementVisible(const QString &acknowledgementLink) +@brief 设置鸣谢是否可见 + +@fn void Dtk::Widget::DAboutDialog::setAcknowledgementLink(bool visible) +@brief 此函数用于设置指定的 visible 设置鸣谢链接是否显示 +@sa 属性 [acknowledgementLink](@ref Dtk::Widget::DAboutDialog::acknowledgementLink) + +@fn void Dtk::Widget::DAboutDialog::setProductIcon(const QIcon &icon) +@brief 设置展示的 icon 图标. +@details在关于对话框展示的图标. + +@fn void Dtk::Widget::DAboutDialog::setCompanyLogo(const QPixmap &companyLogo) +@brief 此函数用于设置指定的 companyLogo 组织标志 + +@fn const QPixmap* Dtk::Widget::DAboutDialog::companyLogo() const +@brief 返回指定的 companyLogo 组织标志 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dabstractdialog.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dabstractdialog.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dabstractdialog.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dabstractdialog.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,119 @@ +/*! +@~chinese +@file dabstractdialog.h +@ingroup dtkwidget +@class Dtk::Widget::DAbstractDialog +@brief 可以使用 DAbstractDialog 类创建符合 DDE 风格的对话框窗口. +@details 对话框是一个用于供用户进行短暂周期的任务交互的顶层窗体。 DDialogs 对话框可以是模态的或非模态的。 对话框可以提供一个 return "返回值", 并且对话框可以拥有 default "默认按钮"。 +@note 请注意 DAbstractDialog (以及其他继承自 QDialog 的对话框)对构造时传入的 parent 父组件的行为和其他 Qt 组件或 DTK 组件不同。一个对话框总是一个顶层控件(top-level widget),但如果它有一个父组件 则对话框的默认位置将会位于其父组件的正中央,并共用其父控件的任务栏入口。 +@section 模态与非模态相关介绍 +@subsection modal 模态对话框 + 一个 {模态} (modal)对话框可以阻止对模态对话框之外的原可见窗体的操作,如请求用户输入文件名的对话框或是对应用程序本身进行设置的对话框就常是模态对话框。 + 模态对话框可以是`Qt::ApplicationModal` "应用模态" 的(默认),也可以是 `Qt::WindowModal` "窗体模态" 的。 + 当应用模态对话框出现后,用户必须完成与对话框的交互并关闭对话框才能继续与应用的其他窗体进行交互。
+ 窗体模态对话框则仅仅阻止用户与这个对话框的父窗体进行交互而不影响这个父窗体之外的其他窗体。
+ 显示模态对话框的常见做法是调用`exec()` 。当对话框被用户关闭时,`exec()` 会提供一个有用的return "返回值" 。 + 通常,需要关闭一个对话框并使其返回期望的值时,我们可以把默认按钮,如 `OK` 确认按钮连接到 `accept()` 槽,并把 `Cancel` 取消按钮连接到`reject()` 槽。当然,也可以调用 `done()` 槽并传递 `Accepted` 或是 `Rejected `达到相同目的。
+ 另一个可行方案是调用`setModal(true)`或 `setWindowModality()`, 然后调用 `show()`。而区别于`exec()`的是, `show()` 将立即交回控制权给调用者。 + 对于类似显示进度条的应用场景,如需限定用户只能与对话框交互(比如,允许取消一个执行时间过长的操作),此时 setModal(true) 就很有用处。
+@subsection modeless 非模态对话框 + 一个 {非模态}(modeless)对话框表示其对话框本身的操作和该应用的其他窗口互相独立互不影响。 + 例如文字处理程序中的“查找文字”功能通常是非模态的,以便用户同时操作对话框和应用程序窗口 + 非模态对话框通过调用 show() 使其显示, 其会将控制权立即返回给调用者
+ 如果在隐藏对话框后调用 `QWidget::show()` `show()` ,对话框将显示在其原本所在的位置。若要记住用户调整对话框位置后的位置, + 需要在`QWidget::closeEvent()` `closeEvent()`中保存窗体位置并在显示对话框前移动对话框到所保存的位置。 +@subsection default 默认按钮 + 对话框的 **默认** 按钮是指当用户直接按下回车(Enter / Return)键时所会被按下的按钮。用以表明用户接受了对话框的某些操作并想要关闭对话框。对于 QDialog 可以使用`QPushButton::setDefault()`, `QPushButton::isDefault()`和 `QPushButton::autoDefault()` + 来设置或调整一个对话框的默认按钮。 +@subsection escapekey 退出(Escape)键 + 如果用户在对话框出现后按下了 Esc 键, 将会触发 `QDialog::reject()`并导致窗体被关闭。 QCloseEvent "关闭事件" + 不可以是`QEvent::ignore()`"忽略事件" . +@subsection return 返回值 (模态对话框) + 模态对话框通常伴随返回值一同使用。例如用来标识判断用户是按下了 OK 确认按钮 还是 Cancel 取消按钮。 + 对话框可以通过调用`accept()`或 `reject()` 槽来关闭, `exec()` 则会根据实际情况返回 `Accepted` 或 `Rejected` 。 + 如果对话框没有被销毁,也可以通过`result()`得到对话框的返回值。 + + 若要修改对话框的关闭行为,你可以重新实现`accept()`, `reject()` 或 `done()` 。而`QWidget::closeEvent()``closeEvent()`仅当你需要记住对话框位置或是重载标准的关闭行为时才应使用 +@sa DDialog, QDialog + +@enum Dtk::Widget::DAbstractDialog::DisplayPosition +@brief 对话框显示位置 +@var Dtk::Widget::DAbstractDialog::DisplayPosition Dtk::Widget::DAbstractDialog::Center +@brief 在屏幕中央显示此对话框 +@var Dtk::Widget::DAbstractDialog::DisplayPosition Dtk::Widget::DAbstractDialog::TopRight +@brief 在屏幕的右上方显示此对话框 + +@fn Dtk::Widget::DAbstractDialog::DAbstractDialog(QWidget *parent = nullptr) +@brief 构造一个DAbstractDialog实例 +@param[in] parent 父对象 + +@fn Dtk::Widget::DAbstractDialog::DAbstractDialog(bool blurIfPossible, QWidget *parent = nullptr) +@brief 构造一个 DAbstractDialog 实例 +@sa DAbstractDialog(QWidget *parent = nullptr) +@param[in] parent 父对象 +@param[in] blurIfPossible 决定要不要开启窗口背景模糊 + +@property DisplayPosition Dtk::Widget::DAbstractDialog::displayPosition() +@brief 获取对话框显示位置 +@return 返回坐标 + +@fn void Dtk::Widget::DAbstractDialog::setDisplayPosition(DisplayPosition displayPosition) +@brief 设置对话框显示位置 +@sa DAbstractDialog::displayPosition() + +@fn void Dtk::Widget::DAbstractDialog::move(const QPoint &pos) +@brief 将窗口移动到指定坐标 + +@fn void Dtk::Widget::DAbstractDialog::move(int x, int y) +@brief 将窗口移动到指定坐标 +@sa DAbstractDialog::move(const QPoint &pos) + +@fn void Dtk::Widget::DAbstractDialog::setGeometry(const QRect &rect) +@brief 构造一个矩形 + +@fn void Dtk::Widget::DAbstractDialog::moveToCenter() +@brief 将对话框移动至屏幕中央或其父控件的中央 + +@fn void Dtk::Widget::DAbstractDialog::moveToTopRight() +@brief 将对话框移动至屏幕右上角或其父控件的右上角 + +@fn void Dtk::Widget::DAbstractDialog::moveToTopRightByRect(const QRect &rect) +@brief 移动对话框到给定`rect`区域的右上角。`rect`是移动所需要参照的`QRect`位置。 + +@fn void Dtk::Widget::DAbstractDialog::setDisplayPosition(DAbstractDialog::DisplayPosition displayPosition) +@brief 设置对话框的显示位置 displayPosition 要显示到的位置 + +@fn void Dtk::Widget::DAbstractDialog::moveToCenterByRect(const QRect &rect) +@brief 移动对话框到给定`rect`区域的中央。`rect`是移动对话框要参照的`QRect`区域 + +@fn void Dtk::Widget::DAbstractDialog::mousePressEvent(QMouseEvent *event) +@brief 对话框的鼠标点击事件 +@sa QMouseEvent + +@fn void Dtk::Widget::DAbstractDialog::mouseReleaseEvent(QMouseEvent *event) +@brief 对话框的鼠标释放事件 +@sa QMouseEvent + +@fn void Dtk::Widget::DAbstractDialog::mouseMoveEvent(QMouseEvent *event) +@brief 对话框的鼠标移动事件 +@sa QMouseEvent + +@fn void Dtk::Widget::DAbstractDialog::resizeEvent(QResizeEvent *event) +@brief 窗口大小改变事件 +@sa QResizeEvent +@warning 不要在resizeEvent中改变窗口geometry,可能会导致以下问题.在双屏开启不同缩放比时:
+ 屏幕A缩放为1,屏幕B缩放为2。窗口初始在屏幕B上,此时大小为 100x100,则其缩放 + 后的真实大小为200x200,由于窗口管理器会对未设置过位置的窗口自动布局,接下来 + 窗口可能会因为位置改变而被移动到屏幕A上,则此对话框的大小将变化为 200x200, + 触发了resize事件,紧接着又会尝试将窗口位置更新到鼠标所在屏幕的中心,如果鼠标 + 所在屏幕为B,则在移动窗口位置时又会根据B的缩放比重新设置窗口大小,窗口将变为: + 400x400,将形成一个循环。。。 + +@fn void Dtk::Widget::DAbstractDialog::showEvent(QShowEvent *event) +@brief 窗口显示事件,如果收到过鼠标移动事件不再使用自动布局 +@sa QShowEvent + +@fn void Dtk::Widget::DAbstractDialog::sizeChanged(QSize size) +@brief 窗口大小发生改变 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dalertcontrol.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dalertcontrol.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dalertcontrol.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dalertcontrol.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,63 @@ +/*! +@~chinese +@file dalertcontrol.h +@ingroup dtkwidget +@class Dtk::Widget::DAlertControl +@brief 此类是提供了应用程序的警告对话框, 符合Deepin风格 + +@fn Dtk::Widget::DAlertControl::DAlertControl(QWidget *target, QObject *parent = nullptr) +@brief 构造函数, 禁止拷贝构造 + +@fn Dtk::Widget::DAlertControl::~DAlertControl() +@brief 析构函数 + +@property bool Dtk::Widget::DAlertControl::alert +@brief 警告模式属性 +@note 这是一个属性而非函数 +@sa read方法 [isAlert](@ref Dtk::Widget::DAlertControl::isAlert()) +@sa write方法 [setAlert](@ref Dtk::Widget::DAlertControl::setAlert(bool isAlert)) + +@property bool Dtk::Widget::DAlertControl::isAlert() +@brief 返回是否开启警告模式, 若开启警告模式, target将显示警告色 + +@fn void Dtk::Widget::DAlertControl::setAlert(bool isAlert) +@brief 设置是否开启警告模式, 若开启警告模式, target将显示警告色 +@sa DAboutDialog::isAlert() + +@property QColor Dtk::Widget::DAlertControl::alertColor() +@brief 返回警告颜色 + +@fn void Dtk::Widget::DAlertControl::setAlertColor(QColor c) +@brief 设置警告颜色 +@sa DAboutDialog::alertColor() + +@fn QColor Dtk::Widget::DAlertControl::defaultAlertColor() +@brief 返回默认警告颜色 +@note 默认颜色和原 DLineEdit 一致 + +@fn void Dtk::Widget::DAlertControl::setMessageAlignment(Qt::Alignment alignment) +@brief 指定对齐方式, 现只支持左, 右, 居中, 默认左对齐. +@note 参数为其他时, 默认左对齐 alignment 消息对齐方式 + +@fn Qt::Alignment Dtk::Widget::DAlertControl::messageAlignment() +@brief 返回当前告警tooltips对齐方式 + +@fn void Dtk::Widget::DAlertControl::showAlertMessage(const QString &text, int duration = 3000) +@brief 显示警告消息 +@details 显示指定的文本消息, 超过指定时间后警告消息消失 +@note 时间参数为-1时, 警告消息将一直存在 +@param[in] text 警告的文本 +@param[in] duration 显示的时间长度, 单位毫秒 + +@fn void Dtk::Widget::DAlertControl::showAlertMessage(const QString &text, QWidget *follower, int duration = 3000) +@brief 显示警告消息 +@param[in] follow 指定文本消息跟随的对象 +@sa DAlertControl::showAlertMessage(const QString &text, int duration = 3000) + +@fn void Dtk::Widget::DAlertControl::hideAlertMessage() +@brief 隐藏警告消息框 + +@fn void Dtk::Widget::DAlertControl::alertChanged(bool alert) +@brief 警告信息发生改变 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/danchors.zh_CN.dox dtkwidget-5.6.12/docs/widgets/danchors.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/danchors.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/danchors.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,516 @@ +/*! +@~chinese +@file danchors.h +@ingroup dtkwidget + +@class Dtk::Widget::DAnchorsBase +@brief DAnchorsBase 提供了一种指定 QWidget 与其它 QWidget 之间的关系来确定其位置的方法. +@details 除了比较传统的布局方式之外,DtkWidget 还提供了一种使用锚定概念布局控件的方法( +类似于 QQuickItem 中的 anchors 属性),可以认为每个控件具有一组6个不可见的“锚 +线”:left,horizontalCenter,right,top,verticalCenter和bottom,如图所示: +@image html edges_anchors.png +使用 DAnchors 可以让 QWidget 基于这些“锚线”来确定相互间的关系,如: +@code +DAnchors rect1(new QLabel("rect1")); +DAnchors rect2(new QLabel("rect2")); + +rect2.setLeft(rect1.right()); +@endcode +这样 rect2 的左边界就会和 rect1 的右边界对齐: +@image html edge1.png +另外还可以同时设置多个“锚线”: +@code +DAnchors rect1(new QLabel("rect1")); +DAnchors rect2(new QLabel("rect2")); + +rect2.setTop(rect1.bottom()); +rect2.setLeft(rect1.right()); +@endcode +@image html edge3.png +锚定布局同时在多个控件中使用,控件之间只需要满足以下条件:
+`控件之间为兄弟关系,或被锚定控件为父控件`
+`锚定关系不能循环绑定` +@subsection 锚定的间隔和偏移 +锚定系统允许设置“锚线”之间的间距,和“锚线”一一对应,每个控件都有一组4个 margin: +leftMargin, rightMargin, topMargin 和 bottomMargin 以及两个 offset: +horizontalCenterOffset 和 verticalCenterOffset。 +@image html margins_anchors.png +下面是左margin的例子: +@code +DAnchors rect1(new QLabel("rect1")); +DAnchors rect2(new QLabel("rect2")); + +rect2.setLeftMargin(5); +rect2.setLeft(rect1.right()); +@endcode +rect2 的左边界相距 rect1 的右边界5个像素: +@image html edge2.png +@note margin 仅仅是对设置的锚点生效,并不是让控件本身增加了边距,如果设置了 +margin,但并没有设置相应的锚点,对控件本身而已是没有任何影响的。margin 的值可以 +为负数,通过值的正负来决定margin的方向(内 margin 还是外 margin) + +除了基于“锚线”来设置锚定外,另外还有 setCenterIn 和 setFill 这两个比较特殊的 +的实现。 +@subsection 判断循环锚定的方式 +假设 DAnchorsBase a1, a2; a1.setRight(a2.left()); 则判断 a1 和 a2 之间 +会不会存在循环绑定的逻辑为: +尝试更改 a1 右边界的值,更新后如果 a2 左边界的值产出了变化,则认为会导致循环绑 +定,否则认为不存在 + +@property QWidget Dtk::Widget::DAnchorsBase::target +@brief 绑定了锚定功能的控件对象 +@note 只读 +@sa read方法 [target](@ref Dtk::Widget::DAnchorsBase::target() const) + +@property bool Dtk::Widget::DAnchorsBase::enabled +@brief 控制锚定功能是否开启,为 false 时仅仅表示不会根据控件各种属性的变化来 +来更新它的位置,但锚定关系并没有被解除 +@note 可读可写 +@sa read方法 [enabled](@ref Dtk::Widget::DAnchorsBase::enabled() const) +@sa write方法 [setEnabled](@ref Dtk::Widget::DAnchorsBase::setEnabled(bool enabled)) + +@property DAnchorsBase* Dtk::Widget::DAnchorsBase::anchors +@brief 一个指向自己的指针 +@note 只读 +@sa read方法 [anchors](@ref Dtk::Widget::DAnchorsBase::anchors() const) + +@property DAnchorInfo* Dtk::Widget::DAnchorsBase::top +@brief target 控件上边界锚线的信息 +@note 只能和 top verticalCenter bottom 绑定 +@note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 +@note 可读可写 +@sa read方法 [top](@ref Dtk::Widget::DAnchorsBase::top() const) +@sa write方法 [setTop](@ref Dtk::Widget::DAnchorsBase::setTop(const DAnchorInfo *top)) + +@property DAnchorInfo* Dtk::Widget::DAnchorsBase::bottom +@note 只能和 top verticalCenter bottom 绑定 +@brief target 控件下边界锚线的信息 +@note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 +@note 可读可写 +@sa read方法 [bottom](@ref Dtk::Widget::DAnchorsBase::bottom() const) +@sa write方法 [setBottom](@ref Dtk::Widget::DAnchorsBase::setBottom(const DAnchorInfo *bottom)) + +@property DAnchorInfo* Dtk::Widget::DAnchorsBase::left +@note 只能和 left horizontalCenter right 绑定 +@brief target 控件左边界锚线的信息 +@note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 +@note 可读可写 +@sa read方法 [left](@ref Dtk::Widget::DAnchorsBase::left() const) +@sa write方法 [setLeft](@ref Dtk::Widget::DAnchorsBase::setLeft(int arg, Qt::AnchorPoint point)) + +@property DAnchorInfo* Dtk::Widget::DAnchorsBase::right +@note 只能和 left horizontalCenter right 绑定 +@brief target 控件右边界锚线的信息 +@note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 +@note 可读可写 +@sa read方法 [right](@ref Dtk::Widget::DAnchorsBase::right() const) +@sa write方法 [setRight](@ref Dtk::Widget::DAnchorsBase::setRight(const DAnchorInfo *right)) + +@property DAnchorInfo* Dtk::Widget::DAnchorsBase::horizontalCenter +@note 只能和 left horizontalCenter right 绑定 +@brief target 控件水平锚线的信息 +@note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 +@note 可读可写 +@sa read方法 [horizontalCenter](@ref Dtk::Widget::DAnchorsBase::horizontalCenter() const) +@sa write方法 [setHorizontalCenter](@ref Dtk::Widget::DAnchorsBase::setHorizontalCenter(const DAnchorInfo *horizontalCenter)) + +@property DAnchorInfo* Dtk::Widget::DAnchorsBase::verticalCenter +@note 只能和 top verticalCenter bottom 绑定 +@brief target 控件竖直锚线的信息 +@note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 +@note 可读可写 +@sa read方法 [verticalCenter](@ref Dtk::Widget::DAnchorsBase::verticalCenter() const) +@sa write方法 [setVerticalCenter](@ref Dtk::Widget::DAnchorsBase::setVerticalCenter(const DAnchorInfo *verticalCenter)) + +@property QWidget* Dtk::Widget::DAnchorsBase::fill +@brief target 控件的填充目标对象 +@note 可读可写 +@sa read方法 [fill](@ref Dtk::Widget::DAnchorsBase::fill() const) +@sa write方法 [setFill](@ref Dtk::Widget::DAnchorsBase::setFill(QWidget *fill)) + +@property QWidget* Dtk::Widget::DAnchorsBase::centerIn +@brief target 控件的居中目标对象 +@note 可读可写 +@sa read方法 [centerIn](@ref Dtk::Widget::DAnchorsBase::centerIn() const) +@sa write方法 [setCenterIn](@ref Dtk::Widget::DAnchorsBase::setCenterIn(QWidget *centerIn)) + +@property int Dtk::Widget::DAnchorsBase::margins +@brief 上下左右四条“锚线”的边距,此值的优先级低于每条“锚线”特定的 margin 值 +@note 可读可写 +@sa read方法 [margins](@ref Dtk::Widget::DAnchorsBase::margins() const) +@sa write方法 [setMargins](@ref Dtk::Widget::DAnchorsBase::setMargins(int margins)) + +@property int Dtk::Widget::DAnchorsBase::topMargin +@brief 上“锚线”的边距,优先级高于 margins +@note 可读可写 +@sa read方法 [topMargin](@ref Dtk::Widget::DAnchorsBase::topMargin() const) +@sa write方法 [setTopMargin](@ref Dtk::Widget::DAnchorsBase::setTopMargin(int topMargin)) + +@property int Dtk::Widget::DAnchorsBase::bottomMargin +@brief 下“锚线”的边距,优先级高于 margins +@note 可读可写 +@sa read方法 [bottomMargin](@ref Dtk::Widget::DAnchorsBase::bottomMargin() const) +@sa write方法 [setBottomMargin](@ref Dtk::Widget::DAnchorsBase::setBottomMargin(int bottomMargin)) + +@property int Dtk::Widget::DAnchorsBase::leftMargin +@brief 左“锚线”的边距,优先级高于 margins +@note 可读可写 +@sa read方法 [leftMargin](@ref Dtk::Widget::DAnchorsBase::leftMargin() const) +@sa write方法 [setLeftMargin](@ref Dtk::Widget::DAnchorsBase::setLeftMargin(int leftMargin)) + +@property int Dtk::Widget::DAnchorsBase::rightMargin +@brief 右“锚线”的边距,优先级高于 margins +@note 可读可写 +@sa read方法 [rightMargin](@ref Dtk::Widget::DAnchorsBase::rightMargin() const) +@sa write方法 [setRightMargin](@ref Dtk::Widget::DAnchorsBase::setRightMargin(int rightMargin)) + +@property int Dtk::Widget::DAnchorsBase::horizontalCenterOffset +@brief 水平“锚线”的偏移量 +@note 可读可写 +@sa read方法 [horizontalCenterOffset](@ref Dtk::Widget::DAnchorsBase::horizontalCenterOffset() const) +@sa write方法 [setHorizontalCenterOffset](@ref Dtk::Widget::DAnchorsBase::setHorizontalCenterOffset(int horizontalCenterOffset)) + +@property int Dtk::Widget::DAnchorsBase::verticalCenterOffset +@brief 竖直“锚线”的偏移量 +@note 可读可写 +@sa read方法 [verticalCenterOffset](@ref Dtk::Widget::DAnchorsBase::verticalCenterOffset() const) +@sa write方法 [setHorizontalCenterOffset](@ref Dtk::Widget::DAnchorsBase::setHorizontalCenterOffset(int verticalCenterOffset)) + +@property bool Dtk::Widget::DAnchorsBase::alignWhenCentered +@brief 设置控件创建时是否对齐 +@note 可读可写 +@sa read方法 [alignWhenCentered](@ref Dtk::Widget::DAnchorsBase::alignWhenCentered() const) +@sa write方法 [setAlignWhenCentered](@ref Dtk::Widget::DAnchorsBase::setAlignWhenCentered(bool alignWhenCentered)) + + +@enum Dtk::Widget::DAnchorsBase::AnchorError +@brief 设置锚定信息的过程中可能出现的错误类型 +@var Dtk::Widget::DAnchorsBase::AnchorError Dtk::Widget::DAnchorsBase::NoError +@brief 设置锚定的过程中没有任何错误发生 +@var Dtk::Widget::DAnchorsBase::AnchorError Dtk::Widget::DAnchorsBase::Conflict +@brief 表示设置的锚定关系跟已有关系存在冲突,如 fill 和 centerIn 不能同时设置 +@var Dtk::Widget::DAnchorsBase::AnchorError Dtk::Widget::DAnchorsBase::TargetInvalid +@brief 表示设置锚定关系时的目标控件无效 +@var Dtk::Widget::DAnchorsBase::AnchorError Dtk::Widget::DAnchorsBase::PointInvalid +@brief 表示设置锚定关系时的“锚线”信息错误,如把 Qt::AnchorLeft 设置到了 Qt::AnchorTop 上 +@var Dtk::Widget::DAnchorsBase::AnchorError Dtk::Widget::DAnchorsBase::LoopBind +@brief 表示设置的锚定关系和已有关系形成了循环绑定 + +@fn void Dtk::Widget::DAnchorsBase::enabledChanged(bool enabled) +@brief 信号会在 `enabled` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::topChanged(const DAnchorInfo *top) +@brief 信号会在 `top` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::bottomChanged(const DAnchorInfo *bottom) +@brief 信号会在 `bottom` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::leftChanged(const DAnchorInfo *left) +@brief 信号会在 `left` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::rightChanged(const DAnchorInfo *right) +@brief 信号会在 `right` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::horizontalCenterChanged(const DAnchorInfo *horizontalCenter) +@brief 信号会在 `horizontalCenter` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::verticalCenterChanged(const DAnchorInfo *verticalCenter) +@brief 信号会在 `verticalCenter` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::fillChanged(QWidget *fill) +@brief 信号会在 `fill` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::centerInChanged(QWidget *centerIn) +@brief 信号会在 `centerIn` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::marginsChanged(int margins) +@brief 信号会在 `margins` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::topMarginChanged(int topMargin) +@brief 信号会在 `topMargin` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::bottomMarginChanged(int bottomMargin) +@brief 信号会在 `bottomMargin` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::leftMarginChanged(int leftMargin) +@brief 信号会在 `leftMargin` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::rightMarginChanged(int rightMargin) +@brief 信号会在 `rightMargin` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::horizontalCenterOffsetChanged(int horizontalCenterOffset) +@brief 信号会在 `horizontalCenterOffset` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::verticalCenterOffsetChanged(int verticalCenterOffset) +@brief 信号会在 `verticalCenterOffset` 属性的值改变时被发送 + +@fn void Dtk::Widget::DAnchorsBase::alignWhenCenteredChanged(bool alignWhenCentered) +@brief 信号会在 `alignWhenCentered` 属性的值改变时被发送 + +@fn Dtk::Widget::DAnchorsBase::DAnchorsBase(QWidget *w) +@brief 构造 DAnchorsBase 对象,传入的 w 对象会和一个新的 DAnchorsBase 对象绑定到一起 +@param w 需要使用锚定关系的控件 +@note 对 w 设置的锚定关系不会随着本次构造的 DAnchorsBase 对象的销毁而消失。 +此构造函数可能会隐式的构造一个新 DAnchorsBase 对象用于真正的功能实现,函数执行 +时会先检查当前是否已经有和 w 对象绑定的 DAnchorsBase 对象,如果没有则会创建一 +个新的 DAnchorsBase 对象与之绑定,否则使用已有的对象。隐式创建的 DAnchorsBase +对象会在对应的 QWidget 对象被销毁时自动销毁。 +@sa target() clearAnchors() getAnchorBaseByWidget() + +@fn Dtk::Widget::DAnchorsBase::~DAnchorsBase() +@brief 在析构时会判断此 DAnchorsBase 对象是否和 target 存在绑定关系,如果是则从映射表中移除绑定 +@warning DAnchorsBasePrivate 对象可能是在多个 DAnchorsBase 对象之间显式共享的, +所以在销毁 DAnchorsBase 后,对应的 DAnchorsBasePrivate 对象不一定会被销毁 +@sa QExplicitlySharedDataPointer + +@fn QWidget* Dtk::Widget::DAnchorsBase::target() const +@brief 返回 target 控件指针 + +@fn DEnhancedWidget* Dtk::Widget::DAnchorsBase::enhancedWidget() const +@brief 返回 target 控件的扩展对象。此对象为 QWidget 对象额外提供了和控件大小、位置相关的变化信号 +@return +@sa Dtk::Widget::DEnhancedWidget + +@fn bool Dtk::Widget::DAnchorsBase::enabled() const +@brief 返回 enabled 属性 + +@fn DAnchorsBase* Dtk::Widget::DAnchorsBase::anchors() const +@brief 返回 anchors 属性 + +@fn DAnchorInfo* Dtk::Widget::DAnchorsBase::top() const +@brief 返回 top 属性 + +@fn DAnchorInfo* Dtk::Widget::DAnchorsBase::bottom() const +@brief 返回 bottom 属性 + +@fn DAnchorInfo* Dtk::Widget::DAnchorsBase::left() const +@brief 返回 left 属性 + +@fn DAnchorInfo* Dtk::Widget::DAnchorsBase::right() const +@brief 返回 right 属性 + +@fn DAnchorInfo* Dtk::Widget::DAnchorsBase::horizontalCenter() const +@brief 返回 horizontalCenter 属性 + +@fn DAnchorInfo* Dtk::Widget::DAnchorsBase::verticalCenter() const +@brief 返回 verticalCenter 属性 + +@fn QWidget* Dtk::Widget::DAnchorsBase::fill() const +@brief 返回 fill 属性 + +@fn QWidget* Dtk::Widget::DAnchorsBase::centerIn() const +@brief 返回 centerIn 属性 + +@fn int Dtk::Widget::DAnchorsBase::margins() const +@brief 返回 margins 属性 + +@fn int Dtk::Widget::DAnchorsBase::topMargin() const +@brief 返回 topMargin 属性 + +@fn int Dtk::Widget::DAnchorsBase::bottomMargin() const +@brief 返回 bottomMargin 属性 + +@fn int Dtk::Widget::DAnchorsBase::leftMargin() const +@brief 返回 leftMargin 属性 + +@fn int Dtk::Widget::DAnchorsBase::rightMargin() const +@brief 返回 rightMargin 属性 + +@fn int Dtk::Widget::DAnchorsBase::horizontalCenterOffset() const +@brief 返回 horizontalCenterOffset 属性 + +@fn int Dtk::Widget::DAnchorsBase::verticalCenterOffset() const +@brief 返回 verticalCenterOffset 属性 + +@fn int Dtk::Widget::DAnchorsBase::alignWhenCentered() const +@brief 返回 alignWhenCentered 属性 + +@fn AnchorError Dtk::Widget::DAnchorsBase::errorCode() const +@brief 锚定过程中产生的错误,在一个新的锚定函数被调用之前会清空此错误状态,每次调用锚定函数后,可以通过此函数的返回值来判断锚定设置是否成功。 +@return +@sa errorString() + +@fn QString Dtk::Widget::DAnchorsBase::errorString() const +@brief 对 errorCode 的文本描述信息 +@return +@sa errorCode + +@fn bool Dtk::Widget::DAnchorsBase::isBinding(const DAnchorInfo *info) const +@brief 如果此 info 设置了锚定对象,则返回 true ,否则返回 false +@code +DAnchors w1; +DAnchors w2; + +w1.setLeft(w2.right()); + +qDebug() << w1.isBinding(w1.left()) << w2.isBinding(w2.right()); +@endcode +打印内容为:ture false +@param info +@return + +@fn static bool Dtk::Widget::DAnchorsBase::setAnchor(QWidget *w, const Qt::AnchorPoint &p, QWidget *target, const Qt::AnchorPoint &point) +@brief 方便用户直接设置两个对象之间锚定关系的静态函数,调用此函数可能会隐式创建DAnchorsBase 对象。 +@param w 要锚定的控件对象 +@param p 要锚定的锚线/锚点 +@param target 锚定的目标对象 +@param point 锚定的目标锚线/锚点 +@return 如果锚定成功,则返回 true,否则返回 false。 + +@fn static void Dtk::Widget::DAnchorsBase::clearAnchors(const QWidget *w) +@brief 清除和控件 w 相关的所有锚定关系,包括锚定w或者被w锚定的任何关联。会直接 +销毁 w 对应的 DAnchorsBase 对象 +@param w 锚定的控件对象 + +@fn static DAnchorsBase* Dtk::Widget::DAnchorsBase::getAnchorBaseByWidget(const QWidget *w) +@brief 返回与 w 绑定的 DAnchorsBase 对象 +@param w 锚定的控件对象 +@return 如果 w 没有对应的锚定对象,则返回空 + +@fn void Dtk::Widget::DAnchorsBase::setEnabled(bool enabled) +@brief 设置 enabled 属性 + +@fn bool Dtk::Widget::DAnchorsBase::setAnchor(const Qt::AnchorPoint &p, QWidget *target, const Qt::AnchorPoint &point) +@brief 为 DAnchorsBase::target 对象设置锚定规则 +@note 可能会为目标控件隐式创建其对应的 DAnchorsBase 对象 +@param p 为当前控件的哪个锚线/锚点设置锚定规则 +@param target 锚定的目标控件 +@param point 锚定的目标锚线/锚点 +@return 如果设置成功,则返回 true,否则返回 false。 + +@fn bool Dtk::Widget::DAnchorsBase::setTop(const DAnchorInfo *top) +@brief 设置 top 属性 + +@fn bool Dtk::Widget::DAnchorsBase::setBottom(const DAnchorInfo *bottom) +@brief 设置 bottom 属性 + +@fn bool Dtk::Widget::DAnchorsBase::setLeft(const DAnchorInfo *left) +@brief 设置 left 属性 + +@fn bool Dtk::Widget::DAnchorsBase::setRight(const DAnchorInfo *right) +@brief 设置 right 属性 + +@fn bool Dtk::Widget::DAnchorsBase::setHorizontalCenter(const DAnchorInfo *horizontalCenter) +@brief 设置 horizontalCenter 属性 + +@fn bool Dtk::Widget::DAnchorsBase::setVerticalCenter(const DAnchorInfo *verticalCenter) +@brief 设置 verticalCenter 属性 + +@fn bool Dtk::Widget::DAnchorsBase::setFill(QWidget *fill) +@brief 设置 fill 属性 + +@fn bool Dtk::Widget::DAnchorsBase::setCenterIn(QWidget *centerIn) +@brief 设置 centerIn 属性 + +@fn bool Dtk::Widget::DAnchorsBase::setFill(DAnchorsBase *fill) +@brief 将 fill 中的target()作为参数调用其它重载函数 +@param fill +@return + +@fn bool Dtk::Widget::DAnchorsBase::setCenterIn(DAnchorsBase *centerIn) +@brief 将 centerIn 中的target()作为参数调用其它重载函数 +@param centerIn +@return + +@fn void Dtk::Widget::DAnchorsBase::setMargins(int margins) +@brief 设置 margins 属性 + +@fn void Dtk::Widget::DAnchorsBase::setTopMargin(int topMargin) +@brief 设置 topMargin 属性 + +@fn void Dtk::Widget::DAnchorsBase::setBottomMargin(int bottomMargin) +@brief 设置 bottomMargin 属性 + +@fn void Dtk::Widget::DAnchorsBase::setLeftMargin(int leftMargin) +@brief 设置 leftMargin 属性 + +@fn void Dtk::Widget::DAnchorsBase::setRightMargin(int rightMargin) +@brief 设置 rightMargin 属性 + +@fn void Dtk::Widget::DAnchorsBase::setHorizontalCenterOffset(int horizontalCenterOffset) +@brief 设置 horizontalCenterOffset 属性 + +@fn void Dtk::Widget::DAnchorsBase::setVerticalCenterOffset(int verticalCenterOffset) +@brief 设置 verticalCenterOffset 属性 + +@fn void Dtk::Widget::DAnchorsBase::setAlignWhenCentered(bool alignWhenCentered) +@brief 设置 alignWhenCentered 属性 + +@fn void Dtk::Widget::DAnchorsBase::setTop(int arg, Qt::AnchorPoint point) +@brief 设置 target 控件到上 + +@fn void Dtk::Widget::DAnchorsBase::setBottom(int arg, Qt::AnchorPoint point) +@brief 设置 target 控件到下 + +@fn void Dtk::Widget::DAnchorsBase::setLeft(int arg, Qt::AnchorPoint point) +@brief 设置 target 控件到左 + +@fn void Dtk::Widget::DAnchorsBase::setRight(int arg, Qt::AnchorPoint point) +@brief 设置 target 控件到右 + +@fn void Dtk::Widget::DAnchorsBase::setHorizontalCenter(int arg, Qt::AnchorPoint point) +@brief 设置 target 控件水平 + +@fn void Dtk::Widget::DAnchorsBase::setVerticalCenter(int arg, Qt::AnchorPoint point) +@brief 设置 target 控件竖直 + +@fn void Dtk::Widget::DAnchorsBase::moveTop(int arg) +@brief 移动 target 控件的上边界到 arg 这个位置 +@param arg 要移动到的位置 + +@fn void Dtk::Widget::DAnchorsBase::moveBottom(int arg) +@brief 移动 target 控件的下边界到 arg 这个位置 +@param arg 要移动到的位置 + +@fn void Dtk::Widget::DAnchorsBase::moveLeft(int arg) +@brief 移动 target 控件的左边界到 arg 这个位置 +@param arg 要移动到的位置 + +@fn void Dtk::Widget::DAnchorsBase::moveRight(int arg) +@brief 移动 target 控件的右边界到 arg 这个位置 +@param arg 要移动到的位置 + +@fn void Dtk::Widget::DAnchorsBase::moveHorizontalCenter(int arg) +@brief 移动 target 控件的水平中线到 arg 这个位置 +@param arg 要移动到的位置 + +@fn void Dtk::Widget::DAnchorsBase::moveVerticalCenter(int arg) +@brief 移动 target 控件的竖直中线到 arg 这个位置 +@param arg 要移动到的位置 + +@fn void Dtk::Widget::DAnchorsBase::moveCenter(const QPoint &arg) +@brief 移动 target 控件的上边界到 arg 这个位置 +@param arg 要移动到的位置 + +@fn void Dtk::Widget::DAnchorsBase::init(QWidget *w) +@brief 初始化函数 + +*/ + +/*! +@~chinese +@file danchors.h +@ingroup dtkwidget + +@class Dtk::Widget::DAnchors +@brief DAnchors 是一个模板类,在 DAnchorsBase 的基础上保存了一个控件指针, +将控件和锚定绑定在一起使用,相当于把“锚线”属性附加到了控件本身. +@details +重载了 “->”、“*”、“&” 等运算符,用于把 DAnchors 这层封装透明化,
+尽量减少使用DAnchors 和直接使用 QWidget* 对象的区别。 + +*/ + +/*! +@~chinese +@file danchors.h +@ingroup dtkwidget + +@class Dtk::Widget::DAnchorInfo +@brief DAnchorInfo 用于记录“锚线”的锚定信息:被锚定的 DAnchorsBase 对象、 +锚定的类型、目标“锚线”的信息. +@details +每条锚线都和一个 DAnchorInfo 对象相对应。一般来说,在使用锚定布局时,
+只需要关心“锚线”的绑定关系,不用关心 DAnchorInfo 中存储的数据。 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dapplicationhelper.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dapplicationhelper.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dapplicationhelper.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dapplicationhelper.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,27 @@ +/*! +@~chinese +@file dapplicationhelper.h +@ingroup dtkwidget +@class Dtk::Widget::DApplicationHelper +@brief `DApplicationHelper` 提供了一个修改的 `DGuiApplicationHelper` 类. + +@fn DApplicationHelper *DApplicationHelper::instance() +@brief `DApplicationHelper::instance` 返回 `DApplicationHelper` 对象 + +@fn DPalette DApplicationHelper::palette( + const QWidget *widget, const QPalette &base) const +@brief DApplicationHelper::palette返回调色板 +@param[in] widget 控件 +@param[in] base 调色板 +@return 调色板 + +@fn void DApplicationHelper::setPalette(QWidget *widget, const DPalette &palette) +@brief `DApplicationHelper::setPalette` 将调色板设置到控件 +@param[in] widget 控件 +@param[in] palette 调色板 + +@fn void DApplicationHelper::resetPalette(QWidget *widget) +@brief `DApplicationHelper::resetPalette`重置控件的调色板属性 +@param[in] widget 控件 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/darrowbutton.zh_CN.dox dtkwidget-5.6.12/docs/widgets/darrowbutton.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/darrowbutton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/darrowbutton.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,86 @@ +/*! +@~chinese +@file darrowbutton.h +@ingroup dtkwidget +@class Dtk::Widget::DArrowButton +@brief 可以使用 DArrowButton 类快速创建箭头形状的按钮。 +@details DArrowButton 提供了快速的方式创建包含箭头标识的按钮,并允许通过 setArrowDirection() 设置箭头方向来直接改按钮的箭头图标的方向。 +此外,还可以通过 arrowButtonDirection 和 arrowButtonState 属性获取和修改箭头按钮的状态。 +@sa QLabel + +@enum Dtk::Widget::DArrowButton::ArrowDirection +@brief 表示箭头图标的方向 +@var Dtk::Widget::DArrowButton::ArrowDirection Dtk::Widget::DArrowButton::ArrowUp +@brief 箭头朝上 +@var Dtk::Widget::DArrowButton::ArrowDirection Dtk::Widget::DArrowButton::ArrowDown +@brief 箭头朝下 +@var Dtk::Widget::DArrowButton::ArrowDirection Dtk::Widget::DArrowButton::ArrowLeft +@brief 箭头朝左 +@var Dtk::Widget::DArrowButton::ArrowDirection Dtk::Widget::DArrowButton::ArrowRight +@brief 箭头朝右 + +@enum Dtk::Widget::DArrowButton::ArrowButtonState +@brief 表示箭头图标的方向 +@var Dtk::Widget::DArrowButton::ArrowButtonState Dtk::Widget::DArrowButton::ArrowStateNormal +@brief 普通状态 +@var Dtk::Widget::DArrowButton::ArrowButtonState Dtk::Widget::DArrowButton::ArrowStateHover +@brief 鼠标在按钮上方悬停状态 +@var Dtk::Widget::DArrowButton::ArrowButtonState Dtk::Widget::DArrowButton::ArrowStatePress +@brief 按钮被按下状态 + +@fn DArrowButton::DArrowButton(QWidget *parent) : QLabel(parent) +@brief 构造一个 DArrowButton 箭头按钮,默认箭头方向向下 +@param parent 父控件指针. + +@fn void DArrowButton::setArrowDirection(ArrowDirection direction) +@brief 设置按钮的箭头方向. +@param direction 箭头的方向. +@sa DArrowButton::ArrowDirection DArrowButton::arrowDirection() + +@fn int DArrowButton::arrowDirection() const +@brief 获取箭头方向. +@return 返回箭头方向. + +@fn int DArrowButton::buttonState() const +@brief 获得按钮状态 +@return 返回按钮的状态. + +@fn void DArrowButton::setButtonState(ArrowButtonState state) +@brief 设置按钮状态 +@param state 箭头按钮的状态. + +@fn void DArrowButton::updateIconDirection(ArrowDirection direction) +@brief 更新箭头按钮中箭头的方向 + +@fn void DArrowButton::updateIconState(ArrowButtonState state) +@brief 更新箭头按钮中图标的状态 +*/ +/*! +@~chinese +@file darrowbutton.h +@ingroup dtkwidget +@class Dtk::Widget::ArrowButtonIcon + +@fn ArrowButtonIcon::ArrowButtonIcon(QWidget *parent) +@brief 构造一个 ArrowButtonIcon 箭头按钮,默认箭头方向向下 +@details ArrowButtonIcon默认设置了`Qt::WA_TransparentForMouseEvents`属性 +当该属性被激活启用时,将会使所有发送到窗体和窗体内部子控件的鼠标事件无效。 +鼠标事件被分发到其它的窗体部件,就像本窗体部件及本窗体内的子控件没有出现在窗体层次体系中。 +鼠标单击和鼠标其它事件穿过(即绕开)本窗体部件及其内的子控件,这个属性默认是开启的。 +(说人话就是透明点击) + +@fn void ArrowButtonIcon::setArrowDirection(int direction) +@brief 设置按钮的箭头方向. +@param[in] direction 箭头的方向. + +@fn int ArrowButtonIcon::arrowDirection() const +@brief 获取箭头方向. + +@fn int ArrowButtonIcon::buttonState() const +@brief 获得按钮状态 + +@fn void ArrowButtonIcon::setButtonState(int state) +@brief 设置按钮状态 +@param[in] state 箭头按钮的状态. + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/darrowlinedrawer.zh_CN.dox dtkwidget-5.6.12/docs/widgets/darrowlinedrawer.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/darrowlinedrawer.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/darrowlinedrawer.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,28 @@ +/*! +@~chinese +@file darrowlinedrawer.h +@ingroup dtkwidget +@class Dtk::Widget::DArrowLineDrawer +@brief 一个美观的可展开的控件 +@details DArrowLineDrawer 继承自 DDrawer 并提供了了 ArrowHeaderLine (一个带有箭头标示的按钮)作为其固定的标题控件, +也就是说跟 DDrawer 相比省去了提供标题控件的步骤,只需要提供内容控件即可,如果需要自定义标题控件应该使用 DDrawer 类。 +@sa DDrawer + +@fn explicit DArrowLineDrawer::DArrowLineDrawer(QWidget *parent = nullptr) +@brief 构造一个 DArrowLineDrawer 实例 +@param[in] parent 为实例的父控件 + +@fn void DArrowLineDrawer::setTitle(const QString &title) +@brief 设置标题要显示的文字 +@param[in] title 标题内容 + +@fn void DArrowLineDrawer::setExpand(bool value) +@brief 设置是否展开以显示内容控件 +@param[in] value 为 true 即为显示,反之则反 + +@fn D_DECL_DEPRECATED DBaseLine *DArrowLineDrawer::headerLine() +@brief 获取标题控件 +@return 标题控件 +@sa DHeaderLine DBaseLine + +*/ \ No newline at end of file diff -Nru dtkwidget-5.5.48/docs/widgets/darrowlineexpand.zh_CN.dox dtkwidget-5.6.12/docs/widgets/darrowlineexpand.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/darrowlineexpand.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/darrowlineexpand.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,35 @@ +/*! +@~chinese +@file darrowlineexpand.h +@ingroup dtkwidget +@class Dtk::Widget::DArrowLineExpand +@brief 一个美观的可展开的控件 +@details DArrowLineExpand 继承自 DBaseExpand 并提供了了 ArrowHeaderLine (一个带有箭头标示的按钮)作为其固定的标题控件, +也就是说跟 DBaseExpand 相比省去了提供标题控件的步骤,只需要提供内容控件即可,如果需要自定义标题控件应该使用 DBaseExpand 类。 +@sa DBaseExpand + +@fn explicit DArrowLineExpand::DArrowLineExpand(QWidget *parent = nullptr) +@brief 构造一个 DArrowLineExpand 实例 +@param[in] parent 为实例的父控件 + +@fn void DArrowLineExpand::setTitle(const QString &title) +@brief 设置标题要显示的文字 +@param[in] title 标题内容 + +@fn void DArrowLineExpand::setExpand(bool value) +@brief 设置是否展开以显示内容控件 +@param[in] value 为 true 即为显示,反之则反 + +@fn DBaseLine *DArrowLineExpand::headerLine() +@brief 获取标题控件 +@return 标题控件 +@sa DHeaderLine DBaseLine +*/ +/*! +@~chinese +@file darrowlineexpand.h +@ingroup dtkwidget +@class Dtk::Widget::ArrowHeaderLine +//TODO:待添加注释 + +*/ \ No newline at end of file diff -Nru dtkwidget-5.5.48/docs/widgets/darrowrectangle.zh_CN.dox dtkwidget-5.6.12/docs/widgets/darrowrectangle.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/darrowrectangle.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/darrowrectangle.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,314 @@ +/*! +@~chinese +@file darrowrectangle.h +@ingroup tooltip +@class Dtk::Widget::DArrowRectangle +@brief DArrowRectangle 提供了可以在四个边中的任意一个边显示箭头的矩形控件. +@details 通常用于作为其他控件的容器,将其显示在矩形内作为内容控件 +@sa DArrowRectangle::setContent() + +## DArrowRectangle 用法示例 +通过简单的程序来了解 DArrowRectangle的用法。 +项目目录结构在同一目录下。 + +### CMakeLists.txt +```cmake +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # support clangd 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui) # 寻找Dtk组件Gui + +add_executable(example1 # 添加可执行文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE + Qt5::Widgets + Qt5::Gui + dtkgui + dtkcore + dtkwidget +) # 链接库 +``` + +### main.cpp (浮动方式为 FloatWidget) + +```cpp + +#include //导入DArrowRectangle依赖包 +#include +#include +#include +#include +DWIDGET_USE_NAMESPACE //使用DTK widget命名空间 + +int main(int argc, char *argv[]){ + DApplication app(argc, argv); + DMainWindow win; //实例化一个 mainwindow 作为主窗口 + win.resize(400,250); //设置窗口大小 + + //实例化一个 DArrowRectangle 控件, 第一个参数指定方向,第二个参数指定浮动方式,第三个参数指定父控件地址 + DArrowRectangle *arrRec = new DArrowRectangle(DArrowRectangle::ArrowTop, DArrowRectangle::FloatWidget, &win); + DWidget widget; //新建一个 widget 作为DArrowRectangle中的显示内容 + DPushButton *btn = new DPushButton("按钮", &widget); //新建一个按钮放到上面新建的widget中 + btn->move(20,25); + + widget.resize(100,70); //设置 widget 大小,注意 DArrowRectangle 会根据其内容 widget 的大小改变其本身大小 + arrRec->setContent(&widget); //将 widget 放置到 DArrowRectangle 里 + arrRec->setArrowX(50); //设置 DArrowRectangle 的箭头位置 + arrRec->setRadiusArrowStyleEnable(true); //可通过此函数设置 DArrowRectangle 箭头是否为圆角风格 + arrRec->setRadius(8); //设置 DArrowRectangle 圆角值 + arrRec->move(200, 50); //移动 DArrowRectangle 的位置 + + win.show(); //展示主窗口 + return app.exec(); //运行程序并等待响应 +} + +``` + +运行程序效果如下:
+ +![darrowrectangle_example1](/docs/images/darrowrectangle_example1.png) + +### main.cpp (浮动方式为 FloatWindow) + +```cpp + +#include //导入DArrowRectangle依赖包 +#include +#include +#include +#include +DWIDGET_USE_NAMESPACE //使用DTK widget命名空间 + +int main(int argc, char *argv[]){ + DApplication app(argc, argv); + + //实例化一个 DArrowRectangle 控件, 第一个参数指定方向,第二个参数指定浮动方式,第三个参数指定父控件地址 + DArrowRectangle *arrRec = new DArrowRectangle(DArrowRectangle::ArrowTop, DArrowRectangle::FloatWindow); + DWidget widget; //新建一个 widget 作为DArrowRectangle中的显示内容 + DPushButton *btn = new DPushButton("按钮", &widget); //新建一个按钮放到上面新建的widget中 + btn->move(20,25); + + widget.resize(100,60); //设置 widget 大小,注意 DArrowRectangle 会根据其内容 widget 的大小改变其本身大小 + arrRec->setContent(&widget); //将 widget 放置到 DArrowRectangle 里 + arrRec->setArrowX(50); //设置 DArrowRectangle 的箭头位置 + arrRec->setRadiusArrowStyleEnable(true); //可通过此函数设置 DArrowRectangle 的箭头是否为圆角风格 + arrRec->setRadius(8); //设置 DArrowRectangle 圆角值 + arrRec->show(200, 500); //显示 DArrowRectangle + + return app.exec(); //运行程序并等待响应 +} + +``` + +运行程序效果如下:
+ +![darrowrectangle_example2](/docs/images/darrowrectangle_example2.png) + +@enum Dtk::Widget::DArrowRectangle::ArrowDirection +@brief 箭头方向枚举包含 DArrowRectangle 的箭头可能指向的可能方向. +@var Dtk::Widget::DArrowRectangle::ArrowDirection Dtk::Widget::DArrowRectangle::ArrowLeft +@brief 指示此矩形的箭头将指向左侧 +@var Dtk::Widget::DArrowRectangle::ArrowDirection Dtk::Widget::DArrowRectangle::ArrowRight +@brief 指示此矩形的箭头将指向右侧 +@var Dtk::Widget::DArrowRectangle::ArrowDirection Dtk::Widget::DArrowRectangle::ArrowTop +@brief 指示此矩形的箭头将指向上方 +@var Dtk::Widget::DArrowRectangle::ArrowDirection Dtk::Widget::DArrowRectangle::ArrowBottom +@brief 指示此矩形的箭头将向下指向 + +@enum Dtk::Widget::DArrowRectangle::FloatMode +@brief FloatMode 表示不同的控件的浮动模式 +@details 控件的浮动模式表示控件如何显示在布局中,DArrowRectangle::FloatWindow 表示控件将会以一个单独的窗口显示,而 DArrowRectangle::FloatWidget 则表示控件只能显示在其父控件的布局中,不能超出父控件大小 +@var Dtk::Widget::DArrowRectangle::FloatMode Dtk::Widget::DArrowRectangle::FloatWindow +@brief 控件将会以一个单独的窗口显示 +@var Dtk::Widget::DArrowRectangle::FloatMode Dtk::Widget::DArrowRectangle::FloatWidget +@brief 控件只能显示在其父控件的布局中,不能超出父控件大小 + +@fn explicit DArrowRectangle::DArrowRectangle(ArrowDirection direction, QWidget *parent = nullptr) +@brief 获取 DArrowRectangle 实例 +@param[in] direction 用于初始化箭头的方向 +@param[in] parent 作为其父控件 + +@fn explicit DArrowRectangle::DArrowRectangle(ArrowDirection direction, FloatMode floatMode, QWidget *parent = nullptr) +@brief 获取 DArrowRectangle 实例,并指定浮动模式. +@param[in] direction 用于初始化箭头的方向 +@param[in] floatMode 浮动模式 +@param[in] parent 作为其父控件 +@sa DArrowRectangle::FloatMode + +@fn virtual void DArrowRectangle::show(int x, int y) +@brief 在指定的坐标位置显示本控件 +@note 坐标被计算为箭头的位置,所以你不需要自己计算箭头位置 +@param[in] x 控件箭头的x轴坐标 +@param[in] y 控件箭头的y轴坐标 + +@fn void DArrowRectangle::setContent(QWidget *content) +@brief 设置要显示在矩形内的内容控件 +@param[in] content 要显示内容控件 + +@fn QWidget *DArrowRectangle::getContent() const +@brief 获取内容控件 +@return 正在显示的内容控件 + +@fn void DArrowRectangle::resizeWithContent() +@brief 根据内容控件的大小自动设置矩形控件的大小 + +@fn QSize DArrowRectangle::getFixedSize() +@brief 获取整个矩形控件的大小 +@return 矩形控件的大小 + +@fn void DArrowRectangle::move(int x, int y) +@brief 移动到指定的坐标位置 +@param[in] x 控件箭头的x轴坐标 +@param[in] y 控件箭头的y轴坐标 +@sa DArrowRectangle::show(int x, int y) +@sa DArrowRectangle::show + +@property qreal DArrowRectangle::shadowYOffset +@brief 这属性表示小部件及其阴影在y轴上的偏移量 +@details Getter: DArrowRectangle::shadowYOffset Setter: DArrowRectangle::setShadowYOffset +@sa DArrowRectangle::shadowXOffset + +@fn void DArrowRectangle::setLeftRightRadius(bool enable) +@brief 设置左右箭头时的圆角 +@param[in] enable 是否开启 + +@fn void DArrowRectangle::setRadiusArrowStyleEnable(bool enable) +@brief 设置圆角箭头样式 +@param[in] enable 是否开启 + +@fn void DArrowRectangle::setRadiusForceEnable(bool enable) +@brief 设置圆角样式 +@details 默认窗管支持特效混成时有圆角,没有特效时没有圆角,如果启用一直都有圆角 +@param[in] enable 是否开启 + +@property qreal DArrowRectangle::shadowXOffset +@brief 这属性表示小部件及其阴影在x轴上的偏移量 +@details Getter: DArrowRectangle::shadowXOffset Setter: DArrowRectangle::setShadowXOffset +@sa DArrowRectangle::shadowYOffset + +@property qreal DArrowRectangle::shadowBlurRadius +@brief 这个属性保存小部件阴影的模糊半径 +@details Getter: DArrowRectangle::shadowBlurRadius Setter: DArrowRectangle::setShadowBlurRadius + +@property QColor DArrowRectangle::borderColor +@brief 这个属性表示控件边框的颜色 +@details Getter: DArrowRectangle::borderColor , Setter: DArrowRectangle::setBorderColor + +@property int DArrowRectangle::borderWidth +@brief 这个属性表示控件边框的宽度 +@details Getter: DArrowRectangle::borderWidth , Setter: DArrowRectangle::setBorderWidth + +@property QColor DArrowRectangle::backgroundColor +@brief 这个属性表示矩形控件的背景颜色 +@details Getter: DArrowRectangle::backgroundColor , Setter: DArrowRectangle::setBackgroundColor + +@property DArrowRectangle::ArrowDirection DArrowRectangle::arrowDirection +@brief 这个属性表示箭头的方向 +@details Getter: DArrowRectangle::arrowDirection , Setter: DArrowRectangle::setArrowDirection + +@fn void DArrowRectangle::setBackgroundColor(DBlurEffectWidget::MaskColorType type) +@brief 是一个重载方法 +@details 通过改变 DBlurEffectWidget::MaskColorType 来修改控件矩形的背景 +@param[in] type 要设置的蒙版颜色 +@sa DArrowRectangle::backgroundColor +@sa DBlurEffectWidget::MaskColorType + +@property int DArrowRectangle::radius +@brief 这个属性表示矩形的圆角 +@details Getter: DArrowRectangle::radius , Setter: DArrowRectangle::setRadius + +@property bool DArrowRectangle::radiusForceEnabled +@brief 是否强制(忽略特效)开启圆角 +@details Getter: DArrowRectangle::radiusForceEnabled , Setter: DArrowRectangle::setRadiusForceEnable + +@property int DArrowRectangle::arrowHeight +@brief 这个属性表示箭头的高度 +@details Getter: DArrowRectangle::arrowHeight , Setter: DArrowRectangle::setArrowHeight +@sa DArrowRectangle::arrowWidth + +@property int DArrowRectangle::arrowWidth +@brief 这个属性表示箭头的宽度 +@details Getter: DArrowRectangle::arrowWidth , Setter: DArrowRectangle::setArrowWidth +@sa DArrowRectangle::arrowHeight + +@property int DArrowRectangle::arrowX +@brief 这个属性表示箭头的x轴坐标 +@details Getter: DArrowRectangle::arrowX , Setter: DArrowRectangle::setArrowX +@sa DArrowRectangle::arrowY + +@property int DArrowRectangle::arrowY +@brief 这个属性表示箭头的y轴坐标 +@details Getter: DArrowRectangle::arrowY , Setter: DArrowRectangle::setArrowY +@sa DArrowRectangle::arrowX + +@property int DArrowRectangle::margin +@brief 这个属性表示边距大小 +@details 边距是指矩形最里面的像素与其内容最外面的像素之间的距离 +@details Getter: DArrowRectangle::margin , Setter: DArrowRectangle::setMargin +@sa DArrowRectangle::setMargin + +@fn void DArrowRectangle::setArrowDirection(ArrowDirection value) +@brief 设置箭头方向 +@param[in] value 箭头方向 +@sa DArrowRectangle::arrowDirection + +@fn void DArrowRectangle::setWidth(int value) +@brief 设置整个控件固定的宽度 +@param[in] value 宽度大小 + +@fn void DArrowRectangle::setHeight(int value) +@brief 设置整个控件固定的高度 +@param[in] value 高度大小 + +@fn void DArrowRectangle::setRadius(int value) +@brief 设置圆角大小 +@param[in] value 圆角大小 +@sa DArrowRectangle::radius + +@fn void DArrowRectangle::setArrowHeight(int value) +@brief 设置箭头高度 +@param[in] value 箭头高度 +@sa DArrowRectangle::arrowHeight + +@fn void DArrowRectangle::setArrowWidth(int value) +@brief 设置箭头宽度 +@param[in] value 箭头宽度 +@sa DArrowRectangle::arrowWidth + +@fn void DArrowRectangle::setArrowX(int value) +@brief 设置箭头 x 坐标的值 +@param[in] value x 坐标的值 +@sa DArrowRectangle::arrowX + +@fn void DArrowRectangle::setArrowY(int value) +@brief 设置箭头 y 坐标的值 +@param[in] y 坐标的值 +@sa DArrowRectangle::arrowY + +@fn void DArrowRectangle::setMargin(int value) +@brief 设置边距大小 +@param[in] value 边距大小 +@sa DArrowRectangle::margin + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dbackgroundgroup.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dbackgroundgroup.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dbackgroundgroup.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dbackgroundgroup.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,138 @@ +/*! +@~chinese +@file dbackgroundgroup.h +@ingroup listview +@class Dtk::Widget::DBackgroundGroup +@brief DBackgroundGroup提供了将布局控件改成圆角边框(将布局看成一个整体) +@details + +## 示例程序 +通过一个简单的示例来了解如何使用 DBackgroundGroup 设置一个布局, 将页面分成两块,其中一块设置一个按钮,另一块使用 DBackgroundGroup 并在 DBackgroundGroup 中添加 控件。 + +### CMakeLists.txt + +```cmake + +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # support clangd 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui) # 寻找Dtk组件Gui + +add_executable(example1 # 添加可执行文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE + Qt5::Widgets + Qt5::Gui + dtkgui + dtkcore + dtkwidget +) # 链接库 + + +``` + +### main.cpp + +```cpp + +#include +#include +#include +#include +#include +#include + +DWIDGET_USE_NAMESPACE + +int main(int argc, char *argv[]){ + DApplication app(argc, argv); + DWidget win; + + //新建一个水平的主布局 + QHBoxLayout* mainlayout = new QHBoxLayout(&win); + //在新建的主布局上添加一个按钮 + mainlayout->addWidget(new QPushButton("按钮")); + + //再新建一个水平布局 + QHBoxLayout *hlayout = new QHBoxLayout; + + //新建一个 DBackgroundGroup 组, 将布局 hlayout 放入组中 + DBackgroundGroup *group = new DBackgroundGroup(hlayout,&win); + //将新建组添加到主布局中, 由于主布局上已有一个按钮,且为水平布局,这个 DBackgroundGroup 组会紧靠按钮右方 + mainlayout->addWidget(group); + //给布局 hlayout 添加内容控件,此处为两个空QFrame + hlayout->addWidget(new QFrame); + hlayout->addWidget(new QFrame); + + win.resize(800,500); + win.show(); + return app.exec(); +} + +``` + +依次使用以下命令编译并运行程序 + +```linux + +cmake -B build +cmake --build build +./build/example1 + +``` + +程序运行效果如下 + +![dbackgroundgroup_example](/docs/images/dbackgroundgroup_example.png) + +@fn explicit DBackgroundGroup::DBackgroundGroup(QLayout *layout = nullptr, QWidget *parent = nullptr) +@brief DBackgroundGroup构造函数 +@param[in] layout 布局对象 +@param[in] parent 参数被发送到 QWidget 构造函数 + +@fn QMargins DBackgroundGroup::itemMargins() const +@brief 返回控件在布局内的边距 +@return 控件在布局内的边距 + +@fn bool DBackgroundGroup::useWidgetBackground() const +@brief 是否使用 QWidget 背景颜色 +@return 是否使用 QWidget 背景颜色 + +@fn void DBackgroundGroup::setLayout(QLayout *layout) +@brief 设置布局 +@param[in] layout 布局 + +@fn void DBackgroundGroup::setItemMargins(QMargins itemMargins) +@brief 设置控件在布局内的边距 +@param[in] itemMargins 控件在布局内的边距 + +@fn void DBackgroundGroup::setItemSpacing(int spacing) +@brief 设置布局内控件间的距离 +@param[in] spacing 距离 + +@fn void DBackgroundGroup::setUseWidgetBackground(bool useWidgetBackground) +@brief 设置是否使用 QWidget 背景颜色,并发送 useWidgetBackgroundChanged 信号 +@param[in] useWidgetBackground 是否使用 QWidget 背景颜色 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dboxwidget.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dboxwidget.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dboxwidget.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dboxwidget.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,165 @@ +/*! +@~chinese +@file dboxwidget.h +@ingroup dtkwidget +@class Dtk::Widget::DBoxWidget +@brief DBoxWidget提供了一个自适应子控件大小的Widget +@details +在Qt编程中,使用QBoxLayout设置控件是很常见的,DBoxWidget提供了方便的封装,会根据需要的大小自动 +设置DBoxWidget的宽高。 + +下面提供DBoxWidget的例子: + +项目目录结构在同一目录下 + +## CMakeLists.txt + +```cmake +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 REQUIRED COMPONENTS Widgets) # 寻找Qt5组件Widgets +find_package(Dtk REQUIRED COMPONENTS Widget) # 寻找Dtk组件Widget + +add_executable(${PROJECT_NAME} # 生成可执行文件 + main.cpp +) + +target_link_libraries(${PROJECT_NAME} PRIVATE # 添加需要链接的共享库 + Qt5::Widgets + ${DtkWidget_LIBRARIES} +) +``` + +## main.cpp + +```cpp +#include +#include +#include +#include +#include +#include +#include + +DWIDGET_USE_NAMESPACE + +int main(int argc, char *argv[]) +{ + DApplication a(argc, argv); + DMainWindow win; + + // 设置水平方向 从左到右排列 + QBoxLayout::Direction direction = QBoxLayout::LeftToRight; + + // 创建DBoxWidget对象 + DBoxWidget box(direction, &win); + + // 添加一个DLineEdit控件,和一个按钮,可以看到控件水平放置 + box.addWidget(new DLineEdit()); + box.addWidget(new DPushButton("按钮")); + + // 设置外边距为30px + box.layout()->setMargin(30); + + // widget放入主窗口 + win.setCentralWidget(&box); + + win.resize(300,200); + win.show(); + // 移动窗口到屏幕中心 + Dtk::Widget::moveToCenter(&win); + return a.exec(); +} +``` + +编译运行 +``` +cmake -Bbuild +cmake --build build +./build/example +``` + +结果如下图 +![example](/docs/images/dboxwidget-example.png) + +@sa DHBoxWidget +@sa DVBoxWidget + +@property QBoxLayout::Direction Dtk::Widget::DBoxWidget::direction +@brief 当前QBoxLayout使用的方向的属性 +@sa read方法 [direction](@ref Dtk::Widget::DBoxWidget::direction() const) +@sa write方法 [setDirection](@ref Dtk::Widget::DBoxWidget::setDirection(QBoxLayout::Direction direction)) + +@fn QBoxLayout::Direction DBoxWidget::direction() const +@brief 这个属性返回当前 QBoxLayout 使用的方向 +@return QBoxLayout::Direction 当前的方向 +@sa 属性 [direction](@ref Dtk::Widget::DBoxWidget::direction) + +@fn void Dtk::Widget::DBoxWidget::setDirection(QBoxLayout::Direction direction) +@brief 设置 QBoxLayout 当前的方向 +@param direction 方向 +@sa 属性 [direction](@ref Dtk::Widget::DBoxWidget::direction) + +@fn Dtk::Widget::DBoxWidget::DBoxWidget(QBoxLayout::Direction direction, QWidget *parent = 0) +@brief DBoxWidget的构造函数 +@param direction 是设置内部QBoxLayout使用的方向 +@param parent 传递给QFrame的构造函数 + +@fn QBoxLayout* Dtk::Widget::DBoxWidget::layout() const +@brief 这个属性会返回当前使用的布局对象 +@details 这个属性可以用来获取内部布局,所以你可以设置布局上的一些额外属性来匹配自定义需求。 +@return 返回 QBoxLayout 类型的指针 + +@fn void Dtk::Widget::DBoxWidget::addWidget(QWidget *widget) +@brief 调用QBoxLayout的addWidget方法将QWidget添加到布局中 +@param widget 要添加的QWidget对象 + +@fn void Dtk::Widget::DBoxWidget::updateSize(const QSize &size) +@brief 当方向是 QBoxLayout::TopToBottom 或者 QBoxLayout::BottomToTop 时设置大小 +@details 固定高度将使用传入的高度,并设置最小宽度为传入的宽度。否则将使用传入的宽度当做固定宽度,高度为最小高度。 +@param size 传入的大小 + +@fn QSize Dtk::Widget::DBoxWidget::sizeHint() const Q_DECL_OVERRIDE +@brief DBoxWidget::sizeHint 重写 QWidget::sizeHint(). +@return 该控件的推荐大小. + +@fn void Dtk::Widget::DBoxWidget::sizeChanged(QSize size) +@brief DBoxWidget 大小发生变化时的信号 + +@fn void Dtk::Widget::DBoxWidget::directionChanged(QBoxLayout::Direction direction) +@brief DBoxWidget 方向发生变化时的信号 + +*/ + +/*! +@~chinese +@class Dtk::Widget::DHBoxWidget +@brief 设置成水平方向的DBoxWidget + +@fn Dtk::Widget::DHBoxWidget::DHBoxWidget(QWidget *parent = 0) +@brief DHBoxWidget的构造函数 +@param parent 被传递给DBoxWidget构造函数 + +*/ + +/*! +@~chinese +@class Dtk::Widget::DVBoxWidget +@brief 设置成垂直方向的DBoxWidget + +@fn Dtk::Widget::DVBoxWidget::DVBoxWidget(QWidget *parent = 0) +@brief DVBoxWidget的构造函数 +@param parent 被传递给DBoxWidget构造函数 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dbuttonbox.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dbuttonbox.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dbuttonbox.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dbuttonbox.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dbuttonbox.h +@ingroup button +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dcoloredprogressbar.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dcoloredprogressbar.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dcoloredprogressbar.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dcoloredprogressbar.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,22 @@ +/*! +@~chinese +@file dcoloredprogressbar.h +@ingroup progressbar + +@class Dtk::Widget::DColoredProgressBar +@brief `DColoredProgressBar`和`QProgressBar`功能差不多一样,只是它可以根据显示的值更改其外观 + +@fn void DColoredProgressBar::addThreshold(int threshold, QBrush brush) +@brief `DColoredProgressBar::addThreshold `添加一个新的阈值,并指定达到该值后要使用的画笔。如果一个相同值的阈值已经存在,它将被覆盖。 +@param[in] brush 当前显示的值不小于 threshold且小于下一个阈值时使用的画笔 +@param[in] threshold 使用此画笔的最小值 + +@fn void DColoredProgressBar::removeThreshold(int threshold) +@brief `DColoredProgressBar::removeThreshold` 移除一个threshold +@param[in] threshold 被移除的threshold值 + +@fn QList DColoredProgressBar::thresholds() const +@brief `DColoredProgressBar::thresholds` 获取所有的thresholds值 +@return 返回一个 threshold值的列表 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dcombobox.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dcombobox.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dcombobox.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dcombobox.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dcombobox.h +@ingroup button +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dcommandlinkbutton.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dcommandlinkbutton.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dcommandlinkbutton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dcommandlinkbutton.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,28 @@ +/*! +@~chinese +@file dcommandlinkbutton.h +@ingroup dtkwidget + +@class Dtk::Widget::DCommandLinkButton +@inmodule dtkwidget +@brief DCommandLinkButton 一个继承于 QAbstractButton 的按钮,外形和链接很像; +@brief 也可以是带有箭头的链接。常用于点击之后,跳转到另外一个窗口或者页面,比如浏览器的前进后退按钮 + +@fn DCommandLinkButton::DCommandLinkButton(const QString text, QWidget *parent) +@brief 构造函数 +@param[in] text 控件显示的文字 +@param[in] parent 控件的父对象 + +@fn QSize DCommandLinkButton::sizeHint() const +@brief 获取控件的矩形大小 +@return 返回本的控件矩形大小 + +@fn void DCommandLinkButton::initStyleOption(DStyleOptionButton *option) const +@brief 初始化的一个 option 的风格,和一些基本的属性 +@param[in] option 实参是一个用来初始化的(按钮控件的)风格属性 + +@fn void DCommandLinkButton::paintEvent(QPaintEvent *e) +@brief 绘画事件 +@param[in] e 此处不使用 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dcrumbedit.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dcrumbedit.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dcrumbedit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dcrumbedit.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dcrumbedit.h +@ingroup edit +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/ddialog.zh_CN.dox dtkwidget-5.6.12/docs/widgets/ddialog.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/ddialog.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/ddialog.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,503 @@ +/*! +@~chinese +@file ddialog.h +@ingroup dialog +@class Dtk::Widget::DDialog +@brief DDialog 旨在提供简要的讯问式对话框的快速实现。提供了包含标题,对话框内容,默认图标,用以添加按钮的布局和一个可以自由添加内容的内容布局。 +@details + +## DDialog概述 + +DDialog 旨在提供简要的讯问式对话框的快速实现。提供了包含标题,对话框内容,默认图标,用以添加按钮的布局和一个可以自由添加内容的内容布局。 +可以使用 addButton() , insertButton(), setDefaultButton() 等函数方便的给对话框插入按钮并进行管理,可以使用 addContent(), insertContent() +等函数操作内容布局。 +此外, DDialog 还提供了一些额外的函数以供实现一些常见的需求。如,可以通过设置 setOnButtonClickedClose() 为 true 来使得用户在点击任何对话框上的按钮后关闭对话框。 +当你需要快速构建较为简单结构的对话框,你应当使用 DDialog ,对于较为复杂的需求,请参阅 DAbstractDialog 或 QDialog 相关文档。 + +通过简单的示例来快速了解DDialog: + +## CMakeLists.txt + +首先配置CMakeLists.txt文件: + +```cmake + +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +# set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # suppot clangd 支持clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets Core REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui REQUIRED) # 寻找Dtk组件Gui + + +add_executable(example1 # 添加可执行文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE Qt5::Widgets Qt5::Gui Qt5::Core dtkgui dtkcore dtkwidget) # 链接库 + +``` + +## main.cpp + +在main.cpp中实现示例代码: + +### 1.导包、设置命名空间 + +```cpp + +#include //导入DApplication应用依赖包 +#include //导入DMainWindow主窗口依赖包 +#include //导入DPushButton按钮依赖包 +#include //导入DDialog对话框依赖包 +DWIDGET_USE_NAMESPACE //使用DWidget命名空间 + +``` + +### 2.主函数和应用 + +如下我们写一个主函数,设置一个应用 + +```cpp + +int main(int argc, char *argv[]){ + DApplication app(argc, argv); //设置一个应用 + //功能实现部分 + return app.exec(); //运行应用 +} +``` + +### 3.实现对话框 + +对话框分为模态对话框和非模态对话框:
+模态对话框是在对话框关闭之前,不能再与同一个应用程序的其他窗口进行交互。
+非模态对话框是可以与同一程序中的窗口交互的。
+ +设置一个主窗口,在主窗口上设置一个按钮,实现通过点击按钮弹出对话框的功能 + +3.1 模态对话框实现 + +显示一个对话框一般有两种方式,一种是使用exec()方法,它总是以模态来显示对话框;另一种是使用show()方法,它使得对话框既可以模态显示,也可以非模态显示,决定它是模态还是非模态的是对话框的modal属性。 + +```cpp +int main(int argc, char *argv[]){ + DApplication app(argc, argv); //设置一个应用 + DMainWindow dmw; //设置一个主窗口 + DPushButton *btn = new DPushButton("按钮",&dmw); //设置一个按钮,将按钮的父亲设置为主窗口 + QObject::connect(btn, &DPushButton::clicked, [](){ //建立按钮点击的连接,按钮被按下时执行lambda函数, + DDialog *dialog = new DDialog; //新建一个指向对话框的指针 + dialog->setAttribute(Qt::WidgetAttribute::WA_DeleteOnClose); //将指针设置为窗口关闭即释放 + dialog->exec(); //显示对话框 + }); + dmw.show(); //显示主窗口 + return app.exec(); //运行应用 +} +``` + +```cpp +int main(int argc, char *argv[]){ + DApplication app(argc, argv); //设置一个应用 + DMainWindow dmw; //设置一个主窗口 + DPushButton *btn = new DPushButton("按钮",&dmw); //设置一个按钮,将按钮的父亲设置为主窗口 + QObject::connect(btn, &DPushButton::clicked, [](){ //建立按钮点击的连接,按钮被按下时执行lambda函数, + DDialog *dialog = new DDialog; //新建一个指向对话框的指针 + dialog->setAttribute(Qt::WidgetAttribute::WA_DeleteOnClose); //将指针设置为窗口关闭即释放 + dialog->setModal(true); //设置为模态对话框 + dialog->show(); //显示对话框 + }); + dmw.show(); //显示主窗口 + return app.exec(); //运行应用 +} +``` + +3.2 非模态对话框实现 + +```cpp +int main(int argc, char *argv[]){ + DApplication app(argc, argv); //设置一个应用 + DMainWindow dmw; //设置一个主窗口 + DPushButton *btn = new DPushButton("按钮",&dmw); //设置一个按钮,将按钮的父亲设置为主窗口 + QObject::connect(btn, &DPushButton::clicked, [](){ //建立按钮点击的连接,按钮被按下时执行lambda函数, + DDialog *dialog = new DDialog; //新建一个指向对话框的指针 + dialog->setAttribute(Qt::WidgetAttribute::WA_DeleteOnClose); //将指针设置为窗口关闭即释放 + dialog->show(); //显示对话框 + }); + dmw.show(); //显示主窗口 + return app.exec(); //运行应用 +} +``` + +### 4. 对话框样式和设置 + +通过addContent()添加对话框内容,通过addButton()给对话框添加按钮: + +```cpp +dialog->addContent(new DPasswordEdit); //给对话框添加内容,此处添加一个密码框的匿名对象 +dialog->addButton("取消"); //添加一个取消按钮 +dialog->addButton("授权", false, DDialog::ButtonRecommend); //添加一个授权按钮并设置样式为 “推荐按钮” 的样式 +``` + +对话框效果如下:
+![ddialog_example](/docs/images/ddialog_example.png) + +## DFileDialog + +```cpp +#include +#include +#include +#include //导入文件对话框依赖包 +DWIDGET_USE_NAMESPACE //使用DWidget命名空间 + +int main(int argc, char *argv[]){ + DApplication app(argc, argv); //设置一个应用 + DMainWindow dmw; //设置一个主窗口 + DPushButton *btn = new DPushButton("按钮",&dmw); //设置一个按钮,将按钮的父亲设置为主窗口 + QObject::connect(btn, &DPushButton::clicked, [](){ //建立按钮点击的连接,按钮被按下时执行lambda函数, + DFileDialog *dialog = new DFileDialog; //新建一个指向对话框的指针 + dialog->setAttribute(Qt::WidgetAttribute::WA_DeleteOnClose); //将指针设置为窗口关闭即释放 + dialog->exec(); //显示对话框 + }); + dmw.show(); //显示主窗口 + return app.exec(); //运行应用 +} +``` + +运行后点击按钮显示文件对话框,如下图所示:
+![dfiledialog_example](/docs/images/dfiledialog.png) + +## DMessageManager + +DTK提供了更为丰富和美观的消息提示,包含可自动消失的信息和点击后消失的信息,下面通过一个示例来了解。 + +设置一个主窗口,在主窗口上设置两个按钮,一个按钮点击以后会弹出可自动消失的提示消息,另一个按钮点击以后会弹出点击消失的提示信息。示例代码如下: + +```cpp +#include +#include +#include +#include +DWIDGET_USE_NAMESPACE //使用DWidget命名空间 + +int main(int argc, char *argv[]){ + DApplication app(argc, argv); //设置一个应用 + DMainWindow dmw; //设置一个主窗口 + dmw.resize(400,300); //重新设置主窗口大小 + DPushButton *btn1 = new DPushButton("自动消失信息",&dmw); //新建一个按钮 + btn1->move(0,50); //移动按钮 + DPushButton *btn2 = new DPushButton("点击消失信息",&dmw); + btn2->move(0,100); + QObject::connect(btn1, &DPushButton::clicked, &dmw, [&dmw](){ //建立第一个按钮的连接 + //点击按钮后发出消息,消息的父亲设为主窗口,使用standardIcon()设置样式并添加提示信息 + DMessageManager::instance()->sendMessage(&dmw, QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning), "这是自动消失的信息"); + }); + QObject::connect(btn2, &DPushButton::clicked, [&dmw](){ //建立第二个按钮的连接 + DFloatingMessage *message = new DFloatingMessage(DFloatingMessage::ResidentType); //新建一个指向新消息的指针,指定消息类型为ResidentType + message->setIcon(QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning)); //使用standardIcon()设置样式 + message->setMessage("这是不会自动消失的提示消息"); //设置提示信息 + message->setWidget(new DPushButton("确认")); //在消息对话框上添加一个新按钮,并设置按钮信息 + DMessageManager::instance()->sendMessage(&dmw, message); //发送信息,父亲设为主窗口 + }); + dmw.show(); //显示主窗口 + return app.exec(); //运行应用 +} + +``` + +运行后效果如下图所示,主窗口效果图:
+![dmessagemanager_mw](/docs/images/dmessagemanager_mw.png) + +点击第一个按钮(自动消失信息)以后效果图:
+![dmessagemanager_mw](/docs/images/dmessagemanager_1.png) + +点击第二个按钮(点击消失按钮)以后效果图:
+![dmessagemanager_mw](/docs/images/dmessagemanager_2.png) + +@property QString Dtk::Widget::DDialog::title +@brief 对话框标题属性 +@sa read方法 [title](@ref Dtk::Widget::DDialog::title() const) +@sa write方法 [setTitle](@ref Dtk::Widget::DDialog::setTitle(const QString &title)) + +@property QString Dtk::Widget::DDialog::message +@brief 对话框消息属性 +@sa read方法 [message](@ref Dtk::Widget::DDialog::message() const) +@sa write方法 [setMessage](@ref Dtk::Widget::DDialog::setMessage(const QString& message)) + +@property QIcon Dtk::Widget::DDialog::icon +@brief 对话框图标属性 +@sa read方法 [icon](@ref Dtk::Widget::DDialog::icon() const) +@sa write方法 [setIcon](@ref Dtk::Widget::DDialog::setIcon(const QIcon &icon)) + +@property Qt::TextFormat Dtk::Widget::DDialog::textFormat +@brief 对话框的文本格式属性 +@sa read方法 [textFormat](@ref Dtk::Widget::DDialog::textFormat() const) +@sa write方法 [setTextFormat](@ref Dtk::Widget::DDialog::setTextFormat(Qt::TextFormat textFormat)) + +@property bool Dtk::Widget::DDialog::onButtonClickedClose +@brief 标志是否在点击按钮后关闭对话框的属性 +@sa read方法 [onButtonClickedClose](@ref Dtk::Widget::DDialog::onButtonClickedClose() const) +@sa write方法 [setOnButtonClickedClose](@ref Dtk::Widget::DDialog::setOnButtonClickedClose(bool onButtonClickedClose)) + +@property bool Dtk::Widget::DDialog::closeButtonVisible +@brief 关闭按钮的可见属性 +@sa read方法 [onButtonClickedClose](@ref Dtk::Widget::DDialog::onButtonClickedClose() const) +@sa write方法 [setCloseButtonVisible](@ref Dtk::Widget::DDialog::setCloseButtonVisible(bool closeButtonVisible)) + +@enum Dtk::Widget::DDialog::ButtonType +@brief 表示按钮类型 +@var Dtk::Widget::DDialog::ButtonType Dtk::Widget::DDialog::ButtonType::ButtonNormal +@brief 标准按钮 +@var Dtk::Widget::DDialog::ButtonType Dtk::Widget::DDialog::ButtonType::ButtonWarning +@brief 警告按钮 +@var Dtk::Widget::DDialog::ButtonType Dtk::Widget::DDialog::ButtonType::ButtonRecommend +@brief 推荐按钮 + +@fn Dtk::Widget::DDialog::DDialog(QWidget *parent = nullptr) +@brief 构造一个 DDialog 对话框 +@param parent 父控件指针 + +@fn Dtk::Widget::DDialog::DDialog(const QString &title, const QString &message, QWidget *parent) +@brief 构造一个 DDialog 对话框 +@param title 标题 +@param message 对话框消息 +@param parent 父控件指针 + +@fn int Dtk::Widget::DDialog::getButtonIndexByText(const QString &text) const +@brief 通过按钮文字获取按钮下标 +@param text 按钮文字 +@return 按钮下标 + +@fn int Dtk::Widget::DDialog::buttonCount() const +@brief 获得对话框包含的按钮数量 + +@fn int Dtk::Widget::DDialog::contentCount() const +@brief 获得对话框包含的所有内容控件的数量 + +@fn QList Dtk::Widget::DDialog::getButtons() const +@brief 获得对话框的按钮列表 + +@fn QList Dtk::Widget::DDialog::getContents() const +@brief 获得对话框包含的所有内容控件列表 + +@fn QAbstractButton* Dtk::Widget::DDialog::getButton(int index) const +@brief 获得指定下标所对应的按钮 +@param index 按钮下标 +@return 返回指定下标所对应的按钮 + +@fn QWidget* Dtk::Widget::DDialog::getContent(int index) const +@brief 获取指定下标对应的内容控件 +@param index 控件下标 +@return 返回对应的内容控件 + +@fn QString Dtk::Widget::DDialog::title() const +@brief 返回对话框标题 +@return 返回对话框的标题内容 + +@fn QString Dtk::Widget::DDialog::message() const +@brief 返回对话框消息文本 +@return 返回对话框的显示信息 + +@fn QIcon Dtk::Widget::DDialog::icon() const +@brief 返回对话框图标 +@return 返回对话框的icon + +@fn D_DECL_DEPRECATED QPixmap Dtk::Widget::DDialog::iconPixmap() const +@brief 返回对话框图标的 QPixmap 对象 +@return 返回ICON的pixmap + +@fn Qt::TextFormat Dtk::Widget::DDialog::textFormat() const +@brief 返回对话框的文本格式 +@return 返回设定的文本格式 + +@fn bool Dtk::Widget::DDialog::onButtonClickedClose() const +@brief 检查在点击任何按钮后是否都会关闭对话框 +@return 关闭对话框返回 true , 否则返回 false + +@fn void Dtk::Widget::DDialog::setContentLayoutContentsMargins(const QMargins &margins) +@brief 设定内容布局的内容 margin +@param margins 具体的 margins + +@fn QMargins Dtk::Widget::DDialog::contentLayoutContentsMargins() const +@brief 返回内容布局的边距. +@return 返回内容布局的内容margin + +@fn bool Dtk::Widget::DDialog::closeButtonVisible() const +@brief 关闭按钮的可见属性. +@return 返回关闭按钮是否可见的bool值 + +@fn int Dtk::Widget::DDialog::addButton(const QString &text, bool isDefault = false, ButtonType type = ButtonNormal) +@brief 向对话框添加按钮 +@param text 按钮文字 +@param isDefault 是否默认按钮 +@param type 按钮类型 +@return 所添加的按钮的下标 + +@fn int Dtk::Widget::DDialog::addButtons(const QStringList &text) +@brief 向对话框添加按钮 +@param text 按钮文字 +@return 所添加的按钮的下标 + +@fn void Dtk::Widget::DDialog::insertButton(int index, const QString &text, bool isDefault = false, ButtonType type = ButtonNormal) +@brief 向对话框插入按钮 +@param index 下标 +@param text 按钮文字 +@param isDefault 是否是默认按钮 +@param type 按钮类型 + +@fn void Dtk::Widget::DDialog::insertButton(int index, QAbstractButton* button, bool isDefault = false) +@brief 向对话框插入按钮 +@param index 下标 +@param button 待插入的按钮 +@param isDefault 是否是默认按钮 + +@fn void Dtk::Widget::DDialog::insertButtons(int index, const QStringList &text) +@brief 向对话框插入按钮 +@param index 下标 +@param text 按钮文字 + +@fn void Dtk::Widget::DDialog::removeButton(int index) +@brief 从对话框移除按钮 +@param index 待移除按钮的下标 + +@fn void Dtk::Widget::DDialog::removeButton(QAbstractButton *button) +@brief 从对话框移除按钮 +@param button 待移除的按钮 + +@fn void Dtk::Widget::DDialog::removeButtonByText(const QString &text) +@brief 从对话框移除按钮 +@param text 待移除按钮的文本内容 + +@fn void Dtk::Widget::DDialog::clearButtons() +@brief 清除所有按钮 + +@fn bool Dtk::Widget::DDialog::setDefaultButton(int index) +@brief 设置默认按钮 +@param index 要设置的默认按钮的下标 +@return 设置成功返回 true,否则返回false + +@fn bool Dtk::Widget::DDialog::setDefaultButton(const QString &str) +@brief 设置默认按钮 +@param str 要设置的默认按钮的文本内容 +@sa default + +@fn void Dtk::Widget::DDialog::setDefaultButton(QAbstractButton *button) +@brief 设置默认按钮 +@param button 要设置的默认按钮 +@sa default + +@fn void Dtk::Widget::DDialog::addContent(QWidget *widget, Qt::Alignment alignment = {}) +@brief 添加控件到对话框内容布局. +@param widget 待添加的控件 +@param alignment 对齐方式 + +@fn void Dtk::Widget::DDialog::insertContent(int index, QWidget *widget, Qt::Alignment alignment = {}) +@brief 在对话框内容布局指定位置插入控件. +@param index 待插入的位置下标 +@param widget 待插入的控件 +@param alignment 对齐方式 + +@fn void Dtk::Widget::DDialog::removeContent(QWidget *widget, bool isDelete = true) +@brief 从对话框内容布局中移除指定控件 +@param widget 待移除的控件 +@param isDelete 是否执行删除 + +@fn void Dtk::Widget::DDialog::clearContents(bool isDelete = true) +@brief 清空对话框内容布局中的所有内容. +@param isDelete 是否删除 + +@fn void Dtk::Widget::DDialog::setSpacing(int spacing) +@brief 设置对话框内容间隔 +@param spacing 对话框的内容布局的间隔大小 +@sa QBoxLayout::setSpacing + +@fn void Dtk::Widget::DDialog::addSpacing(int spacing) +@brief 追加对话框内容间隔. +@details 在对话框的内容布局后追加一个非弹性,大小为 `spacing` 的间隔(一个 QSpacerItem ) +@sa QBoxLayout::addSpacing + +@fn void Dtk::Widget::DDialog::insertSpacing(int index, int spacing) +@brief 插入对话框内容间隔 +@details 在对话框的内容布局的指定位置插入一个非弹性,大小为 `spacing` 的间隔(一个 QSpacerItem )。 +@param index 插入间隔的索引位置 +@param spacing 插入间隔的大小 + +@fn void Dtk::Widget::DDialog::clearSpacing() +@brief 清除内容间隔 +@details 清除对话框内容布局中包含的所有 QSpacerItem + +@fn void Dtk::Widget::DDialog::setButtonText(int index, const QString &text) +@brief 设置按钮文字 +@param index 需要设置文字的按钮的下标 +@param text 所需要设置的文字 + +@fn void Dtk::Widget::DDialog::setButtonIcon(int index, const QIcon &icon) +@brief 设置按钮图标 +@param index 需要设置图标的按钮的下标 +@param icon 所需要设置的图标 + +@fn void Dtk::Widget::DDialog::setTitle(const QString &title) +@brief 设置对话框标题 +@param title 对话框标题 + +@fn void Dtk::Widget::DDialog::setWordWrapTitle(bool wordWrap) +@brief 设定标题Label内容是否可截断换行 +@param wordWrap true可换行,false不可以换行 + +@fn void Dtk::Widget::DDialog::setMessage(const QString& message) +@brief 设置对话框消息内容 +@param message 对话框消息 + +@fn void Dtk::Widget::DDialog::setWordWrapMessage(bool wordWrap) +@brief 设置对话框消息内容 + +@fn void Dtk::Widget::DDialog::setIcon(const QIcon &icon) +@brief 设置对话框图标 +@param icon 对话框图标 + +@fn D_DECL_DEPRECATED void Dtk::Widget::DDialog::setIcon(const QIcon &icon, const QSize &expectedSize) +@brief 设置对话框图标 +@details 为对话框设置图标,同时可以指定一个期望的图标大小。 +@param icon 对话框图标 +@param expectedSize 期望大小 + +@fn D_DECL_DEPRECATED void Dtk::Widget::DDialog::setIconPixmap(const QPixmap &iconPixmap) +@brief 设置对话框位图图标 +@param iconPixmap pixmap类型图标 + +@fn void Dtk::Widget::DDialog::setTextFormat(Qt::TextFormat textFormat) +@brief 设置文字格式 +@param textFormat 文字格式 + +@fn void Dtk::Widget::DDialog::setOnButtonClickedClose(bool onButtonClickedClose) +@brief 设置是否在点击按钮后关闭对话框 +@param onButtonClickedClose 设置为 true 后,无论点击什么按钮,都会在点击后关闭对话框。 + +@fn void Dtk::Widget::DDialog::setCloseButtonVisible(bool closeButtonVisible) +@brief 设置关闭按钮的可见性 + +@fn int Dtk::Widget::DDialog::exec() Q_DECL_OVERRIDE +@brief 以模态框形式显示当前对话框 +@details +以 {QDialog#Modal Dialogs}{模态框} 形式显示当前对话框,将会阻塞直到用户关闭对话框。 +onButtonClickedClose()为 true 时返回当前点击按钮的Index,否则返回 结果。 +@return 返回模态对话框处理的结果 +@sa QDialog::exec() + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/ddrawer.zh_CN.dox dtkwidget-5.6.12/docs/widgets/ddrawer.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/ddrawer.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/ddrawer.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,61 @@ +/*! +@~chinese +@file ddrawer.h +@ingroup dtkwidget + +@class Dtk::Widget::DDrawer +@brief 一个美观的可展开的控件。使用 DDrawer 类可以创建一个可展开的带有展开动画效果的控件,这个控件包含上下两部分, +上面的控件为标题控件,这个控件会始终显示,下面的控件为内容控件,默认为不会显示,调用 `DDrawer::setExpand`设置内容 +控件的可见性。使用 `DDrawer::setHeader `和 `DDrawer::setContent` 设置分别设置标题控件和内容控件。 +@sa DHeaderLine + +@fn void DDrawer::expandChange(bool e) +@brief 内容控件可见性发生改变的信号 +@param[in] e 为 true 表示内容控件变为了可见,反之则反 + +@fn DDrawer::DDrawer(QWidget *parent) +@brief 获取 `DDrawer::DDrawer `实例 +@aparam[in] parent 作为实例的父控件 + +@fn void DDrawer::setHeader(QWidget *header) +@brief 设置标题控件,标题控件会始终显示在布局里 +@param[in] header 标题控件 + +@fn void DDrawer::setContent(QWidget *content, Qt::Alignment alignment) +@brief 设置内容控件,内容控件默认是隐藏的,调用 `DDrawer::setExpand` 设置其可见性 +@param[in] content 内容控件 +@param[in] alignment 内容控件在布局中的对齐方式 + +@fn QWidget *DDrawer::getContent() const +@brief 获取内容控件对象 +@return 内容控件对象 + +@fn void DDrawer::setHeaderHeight(int height) +@brief 设置标题控件的高度 +@param[in] height 指定的高度 + +@fn void DDrawer::setExpand(bool value) +@brief 设置内容控件的可见性 +@param[in] value 为 true 则内容控件可见,反之则不显示 + +@fn bool DDrawer::expand() const +@brief 获取当前内容控件的可见性 +@return 当前内容控件的可见性 + +@fn void DDrawer::setAnimationDuration(int duration) +@brief 设置内容控件的可见性改变时动画的时间 +@param[in] duration 指定动画时间 + +@fn void DDrawer::setAnimationEasingCurve(QEasingCurve curve) +@brief 设置内容控件的可见性改变时动画的样式 +@param[in] curve 指定动画样式 + +@fn void DDrawer::setSeparatorVisible(bool arg) +@brief 设置是否允许标题控件与内容控件之间的分割线 +@param[in] arg 为 ture 则显示分割线,反之则不显示 + +@fn void DDrawer::setExpandedSeparatorVisible(bool arg) +@brief 设置是否允许内容控件下的分割线 +@param[in] arg 为 ture 则显示分割线,反之则不显示 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dfeaturedisplaydialog.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dfeaturedisplaydialog.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dfeaturedisplaydialog.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dfeaturedisplaydialog.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,89 @@ +/*! +@~chinese +@file dfeaturedisplaydialog.h +@ingroup dtkwidget + +@class Dtk::Widget::DFeatureItem +@brief 特性介绍中的每项特性 + +@fn explicit Dtk::Widget::DFeatureItem::DFeatureItem(const QIcon &icon, const QString &name, const QString &description, QObject *parent) +@brief 特性项的构造函数 +@param[in] icon 特性项的图标 +@param[in] name 特性项的名称 +@param[in] description 特性项的内容描述 +@param[in] parent 特性项的父对象 + +@fn explicit Dtk::Widget::DFeatureItem::~DFeatureItem() +@brief 特性项的析构函数 + +@fn QIcon Dtk::Widget::DFeatureItem::icon() const +@brief 获取特性项的图标 +@return 特性项的图标 + +@fn void Dtk::Widget::DFeatureItem::setIcon(const QIcon &icon) +@brief 设置特性项的图标 +@param[in] icon 特性项的图标 + +@fn QIcon Dtk::Widget::DFeatureItem::name() const +@brief 获取特性项的名称 +@return 特性项的名称 + +@fn QIcon Dtk::Widget::DFeatureItem::setName(const QString &name) const +@brief 设置特性项的名称 +@param[in] name 特性项的名称 + +@fn QIcon Dtk::Widget::DFeatureItem::description() const +@brief 获取特性项的内容描述 +@return 特性项的内容描述 + +@fn QIcon Dtk::Widget::DFeatureItem::setDescription(const QString &description) const +@brief 设置特性项的内容描述 +@param[in] description 特性项的内容描述 + +@class Dtk::Widget::DFeatureDisplayDialog +@brief 特性介绍对话框,展示应用更新的新特性 + +结果如下图 +![example](/docs/images/dfeaturedisplaydialog.png) + +@fn Dtk::Widget::DFeatureDisplayDialog::DFeatureDisplayDialog(QWidget *parent) +@brief 特性介绍对话框的构造函数 +@param[in] parent 特性介绍对话框的父对象 + +@fn explicit Dtk::Widget::DFeatureDisplayDialog::~DFeatureDisplayDialog() +@brief 特性介绍对话框的析构函数 + +@fn void Dtk::Widget::DFeatureDisplayDialog::setTitle(const QString &title) +@brief 设置特性介绍对话框的主题 +@param[in] title 特性介绍对话框的主题 + +@fn void Dtk::Widget::DFeatureDisplayDialog::addItem(DFeatureItem *item) +@brief 增加特性介绍对话框的特性项 +@param[in] item 特性介绍对话框的特性项 + +@fn void Dtk::Widget::DFeatureDisplayDialog::removeItem(DFeatureItem *item) +@brief 移除特性介绍对话框的特性项 +@param[in] item 特性介绍对话框的特性项 + +@fn void Dtk::Widget::DFeatureDisplayDialog::addItems(QList items) +@brief 增加多个特性介绍对话框的特性项 +@param[in] items 特性介绍对话框的特性项列表 + +@fn void Dtk::Widget::DFeatureDisplayDialog::clearItems() +@brief 清除特性介绍对话框的所有特性项 + +@fn void Dtk::Widget::DFeatureDisplayDialog::setLinkButtonVisible(bool isVisible) +@brief 设置链接按钮是否可见 +@param[in] isVisible 链接按钮是否可见 + +@fn void Dtk::Widget::DFeatureDisplayDialog::setLinkUrl(const QString &url) +@brief 设置链接按钮链接地址 +@param[in] url 链接按钮的链接地址 + +@fn void Dtk::Widget::DFeatureDisplayDialog::show() +@brief 显示特性介绍对话框 + +@fn bool Dtk::Widget::DFeatureDisplayDialog::isEmpty() const +@brief 假如特性介绍对话框没有特性项返回true, 否则返回false +@return 特性介绍对话框的内容是否为空 +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dfilechooseredit.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dfilechooseredit.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dfilechooseredit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dfilechooseredit.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,173 @@ +/*! +@~chinese +@file dfilechooseredit.h +@ingroup edit +@class Dtk::Widget::DFileChooserEdit +@brief 带有选择文件按钮的文本编辑框 +@details +本控件基本与 DLineEdit 相同,但同时在编辑框的右侧提供了一个按钮,点击按钮将会出现一个选择文件的对话框,当在对话框中选择完毕点击确定之后,选择的结果将会出现在文本编辑框中。 +另外还提供了设置对话框出现的位置,选择文件的类型,或设置文件名过滤器的方法以定制控件的功能。 + +下面提供DFileChooserEdit的例子: + +项目目录结构在同一目录下 + +## CMakeLists.txt +```cmake +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 REQUIRED COMPONENTS Widgets) # 寻找Qt5组件Widgets +find_package(Dtk REQUIRED COMPONENTS Widget) # 寻找Dtk组件Widget + +add_executable(${PROJECT_NAME} # 生成可执行文件 + main.cpp +) + +target_link_libraries(${PROJECT_NAME} PRIVATE # 添加需要链接的共享库 + Qt5::Widgets + ${DtkWidget_LIBRARIES} +) +``` + +## main.cpp +```cpp +#include +#include +#include +#include +#include +#include + +DWIDGET_USE_NAMESPACE + +int main(int argc, char *argv[]) +{ + DApplication a(argc, argv); + DMainWindow win; + + // 创建一个widget容器 + QWidget widget; + // 创建DFileChooserEdit对象 + DFileChooserEdit dialog; + + // 给widget设置水平布局 + QHBoxLayout hLayout(&widget); + + dialog.setFileMode(QFileDialog::Directory); // 指定选择的模式,选择目录。 + dialog.setDirectoryUrl(QUrl("file:///home")); // 设置文件选择器打开路径为home目录 + + // 将dialogn放入到widget中 + hLayout.addWidget(&dialog); + // widget放入主窗口 + win.setCentralWidget(&widget); + + win.resize(300,200); + win.show(); + // 移动窗口到屏幕中心 + Dtk::Widget::moveToCenter(&win); + return a.exec(); +} +``` + +编译运行 +``` +cmake -Bbuild +cmake --build build +./build/example +``` + +结果如下图 +![example](/docs/images/chooseredit-example.png) + +@sa DLineEdit QFileDialog + +@enum Dtk::Widget::DFileChooserEdit::DialogDisplayPosition +@brief 这个枚举保存了对话框可以出现的位置 +@var Dtk::Widget::DFileChooserEdit::DialogDisplayPosition Dtk::Widget::DFileChooserEdit::FollowParentWindow +@brief 跟随父窗口 +@var Dtk::Widget::DFileChooserEdit::DialogDisplayPosition Dtk::Widget::DFileChooserEdit::CurrentMonitorCenter +@brief 鼠标所在的显示器的中心 + +@fn void Dtk::Widget::DFileChooserEdit::fileChoosed(const QString &fileName) +@brief 这个信号在文件被选择且点击了对话框的确认按钮之后被调用 +@param fileName 被选中的文件名,包含其绝对路径。 + +@fn void Dtk::Widget::DFileChooserEdit::dialogOpened() +@brief 这个信号在对话框即将显示时被调用 +@note 注意,此时对话框并没有显示 + +@fn void Dtk::Widget::DFileChooserEdit::dialogClosed(int code) +@brief 这信号在对话框关闭时被调用,无论对话框是被点击了确认还是取消,都会调用本信号 +@param code 对话框的返回码,返回码表示了对话框是因为点击了取消还是确认而关闭的 +@sa QDialog::DialogCode + +@fn Dtk::Widget::DFileChooserEdit::DFileChooserEdit(QWidget *parent = nullptr) +@brief 获取 DFileChooserEdit 的一个实例 +@param parent 作为实例的父控件 + +@fn DFileChooserEdit::DialogDisplayPosition Dtk::Widget::DFileChooserEdit::dialogDisplayPosition() const +@brief 这个属性保存文件选择对话框将会出现的位置 +@details +可选值为枚举 DFileChooserEdit::DialogDisplayPosition 中的值 +Getter: DFileChooserEdit::dialogDisplayPosition , Setter: DFileChooserEdit::setDialogDisplayPosition +@sa DFileChooserEdit::DialogDisplayPosition + +@fn void Dtk::Widget::DFileChooserEdit::setDialogDisplayPosition(DialogDisplayPosition dialogDisplayPosition) +@brief 设置对话框显示位置 +@param dialogDisplayPosition 对话框的显示位置 +@sa DFileChooserEdit::dialogDisplayPosition + +@fn void Dtk::Widget::DFileChooserEdit::setFileDialog(QFileDialog *fileDialog) +@brief 设置 fileDialog + +@fn QFileDialog* Dtk::Widget::DFileChooserEdit::fileDialog() const +@brief 返回 fileDialog + +@fn void Dtk::Widget::DFileChooserEdit::initDialog() +@brief 初始化对话框 + +@fn void Dtk::Widget::DFileChooserEdit::setFileMode(QFileDialog::FileMode mode) +@brief 设置文件选择模式 +@param mode 要使用的模式 +@sa DFileChooserEdit::fileMode + +@fn QFileDialog::FileMode Dtk::Widget::DFileChooserEdit::fileMode() const +@brief 获取对话框选择文件模式 +@details 有多种类型的选择模式,也就是说对话框可以有多种显示或行为,例如选择单个文件,选择多个文件亦或选择一个目录等,详细可以查阅:QFileDialog::FileMode +@return 返回当前的选择模式 +@sa QFileDialog::FileMode +@note 目前本控件只支持选择单个文件,即便调用 DFileChooserEdit::setFileMode 设置了选择模式,当有多个文件在对话框中被选中时,取其第一个作为选择结果 + +@fn void Dtk::Widget::DFileChooserEdit::setNameFilters(const QStringList &filters) +@brief 设置文件名过滤器 +@param filters 要使用的文件名过滤器组成的列表 +@sa DFileChooserEdit::nameFilters + +@fn QStringList Dtk::Widget::DFileChooserEdit::nameFilters() const +@brief 文件名过滤器 +@details +默认此选项为空,即所有文件都可以被选择,当文件名过滤器被设置后,则只有文件名与过滤器匹配的文件可以被选择, +例如:设置了"*.txt",则表示只有后缀名为"txt"的文件可以被选择, +或者同时设置了多个过滤器:QStringList() << "text file (*.txt)" << "picture file (*.png); +则会在文件选择对话框的下方出现设置的多个过滤选项,只是需要注意,一次只能使用一个过滤选项,也就是说不能同时即允许选择txt文件又允许选择png文件 +@return 返回当前的文件名过滤器组成的列表 +@sa DFileChooserEdit::setNameFilters + +@fn void Dtk::Widget::DFileChooserEdit::setDirectoryUrl(const QUrl &directory) +@brief 设置文件对话框打开时的路径 + +@fn QUrl Dtk::Widget::DFileChooserEdit::directoryUrl() +@brief 返回文件对话框打开时的路径 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dfiledialog.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dfiledialog.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dfiledialog.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dfiledialog.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,58 @@ +/*! +@~chinese +@file dfiledialog.h +@ingroup dialog +@class Dtk::Widget::DFileDialog +@brief DFileDialog 类提供了一个可供用户选择文件或目录的对话框 +@details 你也可以通过`addComboBox()`和`addLineEdit()`来为文件选择框增加额外的输入内容控件,并通过`getComboBoxValue()` +和`getLineEditValue()`来得到用户所输入的值。 + +@fn Dtk::Widget::DFileDialog::DFileDialog(QWidget *parent, Qt::WindowFlags f) +@brief 构造函数 +@param[in] parent 父窗口 +@param[in] f 窗口标志 + +@fn Dtk::Widget::DFileDialog::DFileDialog(QWidget *parent, const QString &caption, const QString &directory, const QString &filter) +@brief 构造函数 +@param[in] parent 父窗口 +@param[in] caption 标题 +@param[in] directory 目录 +@param[in] filter 过滤器 + +@fn Dtk::Widget::DFileDialog::addComboBox(const QString &text, const QStringList &data) +@brief 为文件选择框增加一个下拉框 +@param[in] text 追加选项的描述文字(作为键) +@param[in] data 多选框的选项列表 + +@fn Dtk::Widget::DFileDialog::addComboBox(const QString &text, const QStringList &data, const DFileDialog::DComboBoxOptions &options) +@brief 为文件选择框增加一个下拉框 +@param[in] text 追加选项的描述文字(作为键) +@param[in] data 多选框的属性信息 + +@fn Dtk::Widget::DFileDialog::addLineEdit(const QString &text) +@brief 为文件选择框增加一个输入框 +@param[in] text 追加选项的描述文字(作为键) + +@fn Dtk::Widget::DFileDialog::addLineEdit(const QString &text, const DFileDialog::DLineEditOptions &options) +@brief 为文件选择框增加一个输入框 +@param[in] text 追加选项的描述文字(作为键) +@param[in] options 输入框的属性信息 + +@fn Dtk::Widget::DFileDialog::setAllowMixedSelection(bool on) +@brief 设置是否允许混合选择 + +@fn Dtk::Widget::DFileDialog::getComboBoxValue(const QString &text) +@brief 获取下拉框的值 +@param[in] text 下拉框的描述文字(作为键) +@sa addComboBox() + +@fn Dtk::Widget::DFileDialog::getLineEditValue(const QString &text) +@brief 获取输入框的值 +@param[in] text 输入框的描述文字(作为键) +@sa addLineEdit() + +@fn Dtk::Widget::DFileDialog::setVisible(bool visible) +@brief 设置文件选择框是否可见 +@param[in] visible 是否可见 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dfloatingbutton.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dfloatingbutton.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dfloatingbutton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dfloatingbutton.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,41 @@ +/*! +@~chinese +@file dfloatingbutton.h +@ingroup button +@class DFloatingButton +@brief 悬浮按钮,呈现浮动效果 +@details 定制化的浮动按钮,能展示一种悬浮的效果,可以根据传入的图标参数具体调整 + +@fn DFloatingButton::DFloatingButton(QWidget *parent) +@brief 构造函数 +@param[in] parent 父控件 + +@fn DFloatingButton::DFloatingButton(QStyle::StandardPixmap iconType, QWidget *parent) +@brief 构造函数 +@param[in] iconType 图标类型 + +@fn DFloatingButton::DFloatingButton(DStyle::StandardPixmap iconType, QWidget *parent) +@brief 构造函数 +@param[in] iconType 图标类型 + +@fn DFloatingButton::DFloatingButton(const QString &text, QWidget *parent) +@brief 构造函数 +@param[in] text 按钮文本 + +@fn DFloatingButton::DFloatingButton(const QIcon &icon, const QString &text, QWidget *parent) +@brief 构造函数 +@param[in] icon 按钮图标 + +@fn DFloatingButton::DFloatingButton(const DDciIcon &icon, const QString &text, QWidget *parent) +@brief 构造函数 +@param[in] icon DCI按钮图标 + +@fn DStyleOptionButton DFloatingButton::baseStyleOption() const +@brief 获取基础的样式选项 +@return 基础的样式选项 + +@fn void DFloatingButton::initBaseStyleOption(const DStyleOptionButton &option) const +@brief 初始化基础的样式选项 +@param[in] option 基础的样式选项 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dfontcombobox.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dfontcombobox.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dfontcombobox.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dfontcombobox.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dfontcombobox.h +@ingroup button +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dframe.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dframe.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dframe.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dframe.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dframe.h +@ingroup layout +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/diconbutton.zh_CN.dox dtkwidget-5.6.12/docs/widgets/diconbutton.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/diconbutton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/diconbutton.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file diconbutton.h +@ingroup button +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dimageviewer.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dimageviewer.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dimageviewer.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dimageviewer.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,152 @@ +/*! +@~chinese +@file dimageviewer.h +@ingroup imageviewer +@brief dimageviewer.h 提供基础的图片浏览控件 DImageViewer + +@class Dtk::Widget::DImageViewer +@brief DImageViewer 提供基础的图片浏览功能。 +@details 提供图片浏览的控件,通过传入QImage或文件路径加载展示图片,通过键鼠或触摸屏进行拖拽、缩放等交互。 + +@fn Dtk::Widget::DImageViewer::DImageViewer(QWidget *parent) +@brief 构造 DImageViewer 实例,并指定父控件 +@param[in] parent 作为实例的父控件 + +@fn Dtk::Widget::DImageViewer::DImageViewer(const QImage &image, QWidget *parent) +@brief 构造 DImageViewer 实例,并指定默认展示图片及父控件 +@param[in] image 展示的图片 +@param[in] parent 作为实例的父控件 + +@fn Dtk::Widget::DImageViewer::DImageViewer(const QString &fileName, QWidget *parent) +@brief 构造 DImageViewer 实例,并指定默认展示图片文件及父控件 +@param[in] fileName 展示的图片文件路径 +@param[in] parent 作为实例的父控件 + +@fn Dtk::Widget::DImageViewer::~DImageViewer() +@brief 析构 DImageViewer 实例 + +@fn void Dtk::Widget::DImageViewer::imageChanged(const QImage &image) +@brief 图片变更信号,展示图片实例变更后触发 +@param image 图片实例 + +@fn QImage Dtk::Widget::DImageViewer::image() const +@brief 返回当前展示图片实例,当未设置图片时,返回空值 +@details 通过 setFileName() 加载时,根据不同图片类型,返回的图片实例不同。动态图返回首帧图片实例,SVG图片根据默认大小构造图片实例返回。 +@return 图片实例 + +@fn void Dtk::Widget::DImageViewer::setImage(const QImage &image) +@brief 设置当前展示图片实例,若为有效图片,将在内部调用 autoFitImage() +@param[in] image 图片实例 + +@fn void Dtk::Widget::DImageViewer::fileNameChanged(const QString &fileName) +@brief 图片文件路径变更信号,通过 setFileName 设置文件路径后触发 +@param fileName 图片文件路径 + +@fn QString Dtk::Widget::DImageViewer::fileName() const +@brief 获取当前展示的图片文件路径,若图片并未通过文件路径加载时,返回空值 +@return 图片文件路径 + +@fn void Dtk::Widget::DImageViewer::setFileName(const QString &fileName) +@brief 设置当前展示的图片文件路径,若为有效图片,将在内部调用 autoFitImage() +@param[in] fileName 图片文件路径 + +@fn void Dtk::Widget::DImageViewer::scaleFactorChanged(qreal scaleFactor) +@brief 图片缩放比例系数变更信号,通过界面交互或 setScaleFactor 设置缩放比例系数后触发 +@param scaleFactor 图片缩放比例系数 + +@fn qreal Dtk::Widget::DImageViewer::scaleFactor() const +@brief 获取当前图片缩放比例系数 +@return 图片缩放比例系数 + +@fn void Dtk::Widget::DImageViewer::setScaleFactor(qreal factor) +@brief 设置当前图片缩放比例系数 +@param[in] factor 图片缩放比例系数 +@note 根据此系数调整图片展示效果,使用键鼠操作时,缩放比例系数范围为 0.02 ~ 20 + +@fn void Dtk::Widget::DImageViewer::scaleImage(qreal factor) +@brief 按缩放比例系数缩放当前图片,在已有缩放比例上累加 +@param[in] factor 图片缩放比例系数 +@note 根据此系数调整图片展示效果,使用键鼠操作时,缩放比例系数范围为 0.02 ~ 20 + +@fn void Dtk::Widget::DImageViewer::autoFitImage() +@brief 自动切换图片缩放比例,当图片大小小于控件大小时,保持原始大小;当前图片大于控件大小时,使图片适配控件大小展示 +@sa DImageViewer::fitToWidget +@sa DImageViewer::fitOriginalImageSize + +@fn void Dtk::Widget::DImageViewer::fitToWidget() +@brief 使图片调整缩放比例,适配控件大小展示 + +@fn void Dtk::Widget::DImageViewer::fitNormalSize() +@brief 使图片保持原始大小展示,图片超过控件大小的区域将不会被绘制 + +@fn void Dtk::Widget::DImageViewer::rotateAngleChanged(qreal angle) +@brief 当展示图片旋转时触发,旋转角度为90°的倍数,范围在 -360° ~ 360° +@param angle 图片旋转角度 +@sa DImageViewer::rotateClockwise +@sa DImageViewer::rotateCounterclockwise +@sa DImageViewer::resetRotateAngle + +@fn void Dtk::Widget::DImageViewer::rotateClockwise() +@brief 顺时针旋转图片90° + +@fn void Dtk::Widget::DImageViewer::rotateCounterclockwise() +@brief 逆时针旋转图片90° + +@fn int Dtk::Widget::DImageViewer::rotateAngle() const +@brief 返回当前图片的旋转角度,旋转角度为90°的倍数,范围在 -360° ~ 360° + +@fn void Dtk::Widget::DImageViewer::resetRotateAngle() const +@brief 重置当前图片的旋转角度,图片恢复为初始角度展示 + +@fn void Dtk::Widget::DImageViewer::clear() +@brief 清除当前展示的图片,包括存储的图片实例及文件路径 + +@fn void Dtk::Widget::DImageViewer::centerOn(qreal x, qreal y) +@brief 以传入坐标为中心展示图片 +@param[in] x x轴坐标 +@param[in] y y轴坐标 + +@fn QRect Dtk::Widget::DImageViewer::visibleImageRect() const +@brief 返回当前展示图片的几何信息,包含在图片上的坐标,显示大小,可用于图片裁剪、定位等 +@return 展示图片的集合信息 + +@fn void Dtk::Widget::DImageViewer::transformChanged(); +@brief 坐标变换信号,当图片通过界面交互或属性变更导致图片显示坐标、大小等变更时触发 + +@fn void Dtk::Widget::DImageViewer::requestPreviousImage() +@brief 请求切换上一张图片,触摸屏滑动切换时触发 + +@fn void Dtk::Widget::DImageViewer::requestNextImage() +@brief 请求切换下一张图片,触摸屏滑动切换时触发 + +@fn void Dtk::Widget::DImageViewer::scaleAtPoint(QPoint pos, qreal factor) +@brief 在设置坐标位置缩放图片,将在当前缩放比例基础上持续缩放 +@param[in] pos 坐标 +@param[in] factor 图片缩放比例 +@sa DImageViewer::scaleImage + +@fn void Dtk::Widget::DImageViewer::beginCropImage() +@brief 设置开始裁剪图片,在界面显示裁剪工具,允许拖拽锚点调整裁剪区域 +@sa DImageViewer::endCropImage + +@fn void Dtk::Widget::DImageViewer::endCropImage() +@brief 设置结束裁剪图片,隐藏裁剪工具,根据裁剪区域调整显示图片 +@sa DImageViewer::beginCropImage + +@fn void Dtk::Widget::DImageViewer::resetCropImage() +@brief 复位裁剪图片,恢复图片大小 + +@fn void Dtk::Widget::DImageViewer::setCropAspectRatio(qreal w, qreal h) +@brief 设置裁剪工具宽高比,例如16:9/4:3等,设置后,裁剪工具会按比例调整大小,尽可能包含当前展示图片内容 +@param[in] w 相对宽度比例 +@param[in] h 相对高度比例 + +@fn QRect Dtk::Widget::DImageViewer::cropImageRect() const +@brief 获取当前图片裁剪矩形,此矩形对应图片的像素坐标 +@return 图片裁剪矩形 + +@fn void Dtk::Widget::DImageViewer::cropImageChanged(const QRect &rect) +@brief 图片裁剪矩形变更信号,图片裁剪完成后触发 +@param rect 图片裁剪矩形 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dipv4lineedit.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dipv4lineedit.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dipv4lineedit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dipv4lineedit.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dipv4lineedit.h +@ingroup edit +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dkeysequenceedit.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dkeysequenceedit.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dkeysequenceedit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dkeysequenceedit.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dkeysequenceedit.h +@ingroup edit +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dlabel.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dlabel.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dlabel.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dlabel.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,51 @@ +/*! +@~chinese +@file dlabel.h +@ingroup dtkwidget +@class Dtk::Widget::DLabel +@brief DLabel一个重新实现的 QLabel。 +@details DLabel提供了将 DLabel 显示在指定位置的函数 +DLabel提供了改变字体颜色的函数。 + +@fn DLabel::DLabel(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()) +@brief DLabel的构造函数. +@param[in] parent 参数被发送到 QLabel 构造函数. + +@fn DLabel::DLabel(const QString &text, QWidget *parent = nullptr) +@brief DLabel的构造函数. +@param[in] text 文本信息 +@param[in] parent 指定父对象. + +@fn DLabel::~DLabel() +@brief DLabel的析构函数 + +@fn void DLabel::setForegroundRole(QPalette::ColorRole role) +@brief 显示的字体颜色 +@param[in] role 字体颜色(QPalette::ColorRole) + +@fn void DLabel::setForegroundRole(DPalette::ColorType color) +@brief 显示的字体颜色 +@param[in] color 字体颜色 + +@fn void DLabel::setElideMode(Qt::TextElideMode elideMode) +@brief 设置省略号显示的模式 +@param[in] elideMode 省略模式枚举 + +@fn Qt::TextElideMode DLabel::elideMode() const +@brief 获取省略号的模式 +@return 返回省略号的模式 + +@fn DLabel::DLabel(DLabelPrivate &dd, QWidget *parent = nullptr) +@brief DLabel的构造函数. +@param[in] dd 私有成员变量 +@param[in] parent 父控件 + +@fn void DLabel::initPainter(QPainter *painter) const override +@brief 初始化 painter +@param[in] painter 形参 + +@fn void DLabel::paintEvent(QPaintEvent *event) override +@brief DLabel::paintEvent +@param[in] event 消息事件 +@sa QLabel::paintEvent() +*/ \ No newline at end of file diff -Nru dtkwidget-5.5.48/docs/widgets/dlicensedialog.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dlicensedialog.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dlicensedialog.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dlicensedialog.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,35 @@ +/*! +@~chinese +@file dlicensedialog.h +@ingroup dtkwidget + +@class Dtk::Widget::DLicenseDialog +@brief 开源许可协议对话框,展示应用及组件所用的开源许可协议 + +@fn Dtk::Widget::DLicenseDialog::DLicenseDialog(QWidget *parent) +@brief 开源许可协议对话框的构造函数 +@param[in] parent 开源许可协议对话框的父对象 + +@fn explicit Dtk::Widget::DLicenseDialog::~DLicenseDialog() +@brief 开源许可协议对话框的析构函数 + +@fn void Dtk::Widget::DLicenseDialog::setContent(const QByteArray &content) +@brief 设置协议相关的内容 +@param[in] content 协议相关的内容 + +@fn void Dtk::Widget::DLicenseDialog::setFile(const QString &file) +@brief 设置协议文件 +@param[in] file 协议文件 + +@fn void Dtk::Widget::DLicenseDialog::setLicenseSearchPath(const QString &path) +@brief 自定义协议内容路径 +@param[in] path 协议内容路径 + +@fn bool Dtk::Widget::DLicenseDialog::load() +@brief 加载开源许可协议 +@return 开源许可协议是否加载成功 + +@fn bool Dtk::Widget::DLicenseDialog::isValid() const; +@brief 开源许可协议是否有效 +@return 开源许可协议是否有效 +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dlineedit.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dlineedit.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dlineedit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dlineedit.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,328 @@ +/*! +@~chinese +@file dlineedit.h +@ingroup edit +@class Dtk::Widget::DLineEdit +@brief DLineEdit一个聚合 QLineEdit 的输入框. +@details + +## 概述 + +- DLineEdit提供了向输入框左右两端插入控件的函数 +- DLineEdit提供了带警告颜色的输入框 +- DLineEdit提供了带文本警告消息的输入框 + +LineEdit 是一个单行输入文本框,为用户提供了比较多的编辑功能,除了QLineEdit默认的功能,DLineEdit还提供警告提示, +还可以通过 setLeftWidgets() 或者 setRightWidgets() 向编辑框左右侧添加额外控件 + +下面通过一个简单登录界面的程序来演示DLineEdit + +## CMakeLists.txt + +配置 CMakeLists.txt 文件 + +```cmake +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # support clangd 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui) # 寻找Dtk组件Gui + +add_executable(example1 # 添加可执行文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE + Qt5::Widgets + Qt5::Gui + ${DtkGui_LIBRARIES} + ${DtkCore_LIBRARIES} + ${DtkWidget_LIBRARIES} +) # 链接库 +``` + +## main.cpp + +```cpp +#include +#include +#include +#include +#include +#include +#include +#include + +DWIDGET_USE_NAMESPACE //使用DWidget命名空间 + +int main(int argc, char *argv[]) { + DApplication app(argc,argv); + + DMainWindow w; + //限制主程序窗口最小尺寸 + w.setMinimumSize(300,200); + //新建一个窗体,容纳所有控件 + DWidget *cw = new DWidget(&w); + //新建一个可以输入手机号的DLineEdit控件 + DLineEdit *phoneEdit = new DLineEdit(); + //设置占位符文本,用于提示输入信息 + phoneEdit->setPlaceholderText("输入手机号"); + //在右侧添加一个获取验证码的按钮,这里演示使用匿名对象 + phoneEdit->setRightWidgets({new DPushButton("获取验证码")}); + + //新建一个可以输入密码的 DPasswordEdit 控件,它从 DLineEdit 继承而来,一个方便键入密码的控件 + DPasswordEdit *pwdEdit = new DPasswordEdit(); + //设置占位符文本,用于提示输入信息 + pwdEdit->setPlaceholderText("输入密码"); + + //设置窗体的为垂直布局 + QVBoxLayout *mainLayout = new QVBoxLayout(cw); + + //将两个编辑框添加到布局 + mainLayout->addWidget(phoneEdit); + mainLayout->addWidget(pwdEdit); + + //新建两个按钮控件,用于取消和登录 + DPushButton *cancelBtn = new DPushButton("取消"); + DPushButton *loginBtn = new DPushButton("登录"); + + //将两个按钮放入一个水平布局中 + QHBoxLayout *btnLayout = new QHBoxLayout(); + btnLayout->addWidget(cancelBtn); + btnLayout->addWidget(loginBtn); + + //将水平布局添加到外层窗体的垂直布局中 + mainLayout->addLayout(btnLayout); + + //运用connect,实现登录按钮被按下后的一系列操作 + QObject::connect(loginBtn, &DPushButton::clicked, [&phoneEdit, &pwdEdit, &w](){ + //简单判断手机号是否输入,若为空,则输入手机号的编辑框发出警示信息 + if(phoneEdit->text().isEmpty()) { + //发出警示信息,显示五秒 + phoneEdit->showAlertMessage("手机号不能为空",5000); + return; + } + //判断输入的密码位数是否大于等于6位,若不满足,则发出警示信息 + if(pwdEdit->text().size() < 6) { + //发出警示信息,显示五秒 + pwdEdit->showAlertMessage("请输入至少6位密码",5000); + return; + } + //满足所有条件后,主窗口发出登录成功提示信息 + w.sendMessage(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation), "登录成功!"); + }); + + //将cw加入到主窗口中 + w.setCentralWidget(cw); + w.show(); + return app.exec(); +} +``` +## 程序运行效果 + +![不输入信息效果图](/docs/images/dlineedit_example1.png)
+![发出警示信息效果图](/docs/images/dlineedit_example2.png) + +@property DLineEdit::alert +@brief 警告模式属性. +@details用于开启或者判断是否处于警告模式. + +@fn Dtk::Widget::DLineEdit::DLineEdit(QWidget *parent = nullptr) +@brief DLineEdit的构造函数 +@param parent 参数被发送到 QWidget 构造函数 + +@fn QLineEdit *Dtk::Widget::DLineEdit::lineEdit() const +@brief 返回 QLineEdit 对象 +@note 若 DLineEdit 不满足输入框的使用需求,请用此函数抛出的对象 +@return 返回 QLineEdit 对象 + +@fn void Dtk::Widget::DLineEdit::setAlert(bool isAlert) +@brief 设置警告状态,橙黄色提示 +@param isAlert true为设置为警告状态,反之不是 + +@fn bool Dtk::Widget::DLineEdit::isAlert() const +@brief 返回当前是否是警告状态 +@return 返当前的警告状态 + +@fn void Dtk::Widget::DLineEdit::showAlertMessage(const QString &text, int duration = 3000) +@brief 显示警告消息 +显示指定的文本消息,超过指定时间后警告消息消失 +@param text 警告的文本 +@param duration 显示的时间长度,单位毫秒 +@note 时间参数为-1时,警告消息将一直存在 + +@fn void Dtk::Widget::DLineEdit::showAlertMessage(const QString &text, QWidget *follower, int duration = 3000) +@brief 显示警告消息 +显示指定的文本消息,超过指定时间后警告消息消失 +@param text 警告的文本 +@param follower tooltip 跟随 +@param duration 显示的时间长度,单位毫秒 +@note 时间参数为-1时,警告消息将一直存在 + +@fn void Dtk::Widget::DLineEdit::setAlertMessageAlignment(Qt::Alignment alignment) +@brief 指定对齐方式 +现只支持(下)左,(下)右,(下水平)居中, 默认左对齐 +@note 参数为其他时,默认左对齐 +@param alignment 消息对齐方式 + +@fn Qt::Alignment Dtk::Widget::DLineEdit::alertMessageAlignment() const +@brief 获取警告消息的对齐方式 +@return 返回警告消息的对齐方式 + +@fn void Dtk::Widget::DLineEdit::hideAlertMessage() +@brief 隐藏警告消息框 + +@fn void Dtk::Widget::DLineEdit::setLeftWidgets(const QList &list) +@brief 向输入框左侧添加控件 +将 QList 里的控件插入到输入框的左侧 +@note 多次调用,只有最后一次调用生效 +@param list 存储控件的列表 + +@fn void Dtk::Widget::DLineEdit::setRightWidgets(const QList &list) +@brief 向输入框右侧添加控件 +将 QList 里的控件插入到输入框的右侧 +@note 多次调用,只有最后一次调用生效 +@param list 存储控件的列表 + +@fn void Dtk::Widget::DLineEdit::setLeftWidgetsVisible(bool visible) +@brief 是否隐藏输入框左侧控件. +@param visible 是否隐藏 + +@fn void Dtk::Widget::DLineEdit::setRightWidgetsVisible(bool visible) +@brief 是否隐藏输入框右侧控件. +@param visible 是否隐藏 + +@fn void Dtk::Widget::DLineEdit::setClearButtonEnabled(bool enable) +@brief 设置清除按钮是否可见. +@param enable true 按钮可见 false 按钮不可见 + +@fn bool Dtk::Widget::DLineEdit::isClearButtonEnabled() const +@brief 返回清除按钮是否可见. +@return true 清除按钮可见 false 清除按钮不可见 + +@fn void Dtk::Widget::DLineEdit::setText(const QString &text) +@brief 设置显示的文本. +@param text 显示的文本 + +@fn QString Dtk::Widget::DLineEdit::text() +@brief 返回当前显示的文本. +@return 返回显示的文本 + +@fn void Dtk::Widget::DLineEdit::clear(); +@brief 清空编辑的内容 + +@fn QLineEdit::EchoMode Dtk::Widget::DLineEdit::echoMode() const +@brief 返回输入框的回显模式 +@return 返回回显的模式 + +@fn void Dtk::Widget::DLineEdit::setEchoMode(QLineEdit::EchoMode mode) +@brief 设置回显的模式 +@param mode 回显的模式 + +@fn void Dtk::Widget::DLineEdit::setContextMenuPolicy(Qt::ContextMenuPolicy policy) +@brief 设置行编辑控件的文本菜单策略 +@param policy 显示右键菜单的方式 +转发实际变量 QLineEdit 的 ContextMenuEvent 消息 +@sa QLineEdit::setContextMenuPolicy + +@fn bool Dtk::Widget::DLineEdit::speechToTextIsEnabled() const +@brief 返回是否显示语音听写菜单项 +@return true 显示语音听写菜单项 false不显示 + +@fn void Dtk::Widget::DLineEdit::setSpeechToTextEnabled(bool enable) +@brief 设置是否显示语音听写菜单项 +@param enable true显示 flase不显示 + +@fn void Dtk::Widget::DLineEdit::setPlaceholderText(const QString &) +@brief 设置占位文本 +@param 参数1 占位文本 + +@fn bool Dtk::Widget::DLineEdit::textToSpeechIsEnabled() const +@brief 返回是否显示语音朗读菜单项 +@return true 显示语音朗读菜单项 false不显示 + +@fn void Dtk::Widget::DLineEdit::setTextToSpeechEnabled(bool enable) +@brief 设置是否显示语音朗读菜单项 +@param enable true显示 flase不显示 + +@fn bool Dtk::Widget::DLineEdit::textToTranslateIsEnabled() const +@brief 返回是否显示文本翻译菜单项 +@return true 显示文本翻译菜单项 false 不显示 + +@fn void Dtk::Widget::DLineEdit::setTextToTranslateEnabled(bool enable) +@brief 设置是否显示文本翻译菜单项 +@param enable true显示 flase不显示 + +@fn bool Dtk::Widget::DLineEdit::copyEnabled() const +@brief 返回文本是否可拷贝 +@return true文本可拷贝 false不可拷贝 + +@fn void Dtk::Widget::DLineEdit::setCopyEnabled(bool enable) +@brief 设置文本是否可拷贝 +@param enable true文本可拷贝 false不可拷贝 + +@fn bool Dtk::Widget::DLineEdit::cutEnabled() const +@brief 返回文本是否可裁切 +@return true文本可剪切 false不可剪切 + +@fn void Dtk::Widget::DLineEdit::setCutEnabled(bool enable) +@brief 设置输入文本是否可裁切 +@param enabled true输入文本可剪切 false不可剪切 + +@fn bool Dtk::Widget::DLineEdit::eventFilter(QObject *watched, QEvent *event) override +@brief 事件过滤器 +该过滤器不做任何过滤动作,但会监控输入框的焦点状态,并发送信号 focusChanged()。 +@param watched 被监听的子控件指针 +@param event 待过滤的事件 +@param event 实例 +@return 成功过滤返回 true,否则返回 false + +@fn void Dtk::Widget::DLineEdit::alertChanged(bool alert) const +@brief 警告状态改变发出此信号 +@param alert 是否在警告状态 + +@fn void Dtk::Widget::DLineEdit::focusChanged(bool onFocus) const +@brief 焦点状态改变发出此信号 +@param onFocus 是否获取到焦点 + +@fn void Dtk::Widget::DLineEdit::textChanged(const QString &) +@brief 文本发生改变发出此信号 +@param 参数1 当前文本 + +@fn void Dtk::Widget::DLineEdit::textEdited(const QString &) +@brief 每当编辑文本时会发出此信号 +@param 参数1 当前文本 + +@fn void Dtk::Widget::DLineEdit::cursorPositionChanged(int, int) +@brief 光标位置改变发出此信号 +@param 参数1 旧位置 +@param 参数2 新位置 + +@fn void Dtk::Widget::DLineEdit::returnPressed() +@brief 按下Return键或Enter键会发出此信号 + +@fn void Dtk::Widget::DLineEdit::editingFinished() +@brief 当按下Return或Enter键或文本字段失去焦点时会发出此信号 + +@fn void Dtk::Widget::DLineEdit::selectionChanged() +@brief 每当选择更改时会发出此信号 + +*/ \ No newline at end of file diff -Nru dtkwidget-5.5.48/docs/widgets/dlistview.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dlistview.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dlistview.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dlistview.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,332 @@ +/*! +@~chinese +@file dlistview.h +@ingroup listview +@class Dtk::Widget::DListView +@brief DListView 一个用于展示一列数据的控件. +@details DListView 类似与 QListView 属于 Qt's model/view framework 的一个类,常被用来展示一列数据,当数据较多时可以滚动控件以显示跟多内容。 +但与 QListView 也有不同之处,DListView 提供了顶部控件和底部控件,它们始终显示在listview中,不会因为滚动而不可见,另外还提供了方便编辑 +数据的方法,如:addItem , addItems , insertItem , takeItem , removeItem , 以及一些开发中常用的信号。 + +## DListView 示例 +通过简单的示例来学习如何使用 DListView + +项目目录结构在同一目录下 + +### CMakeLists.txt + +```cmake +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # support clangd 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui) # 寻找Dtk组件Gui + +add_executable(example1 # 添加可执行文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE + Qt5::Widgets + Qt5::Gui + ${DtkGui_LIBRARIES} + ${DtkCore_LIBRARIES} + ${DtkWidget_LIBRARIES} +) # 链接库 + +``` + +### main.cpp + +```cpp + +#include +#include +#include +#include +#include +#include +#include +#include + +DWIDGET_USE_NAMESPACE + +int main(int argc, char *argv[]){ + DApplication app(argc, argv); + DMainWindow win; + + //新建一个标准模型 + QStandardItemModel *model = new QStandardItemModel(); + + //写一个函数,函数的功能是新建显示在窗口中的条目,条目内容,设置不可编辑以及将条目添加到model中 + auto AddItems = [&win, &model](QIcon icon, QString name){ + DStandardItem *item = new DStandardItem(icon, name); //条目包含图标和名称 + item->setEditable(false); //设置条目不可被编辑 + model->appendRow(item); //将条目添加到model中 + return item; + }; + + //调用函数新建四个条目 + auto item0 = AddItems(win.style()->standardIcon(DStyle::SP_ComputerIcon), "电脑"); + auto item1 = AddItems(win.style()->standardIcon(DStyle::SP_DirIcon), "文件"); + auto item2 = AddItems(win.style()->standardIcon(DStyle::SP_DriveCDIcon), "媒体"); + auto item3 = AddItems(win.style()->standardIcon(DStyle::SP_TrashIcon), "回收站"); + + //增加一个条目中的action, 可用作标识、与其他条目区别开,设置位置、大小、是否可点击 + DViewItemAction *action = new DViewItemAction(Qt::AlignCenter, QSize(), QSize(), true); + //将QStyle转为DStyle + DStyle *style = qobject_cast(win.style()); + //给action设置图标 + action->setIcon(style->standardIcon(DStyle::SP_IndicatorChecked)); + //设置显示到哪个条目上,这里设置到item1 + item1->setActionList(Qt::Edge::RightEdge, {action}); + + //新建一个 dlistview + DListView *listview = new DListView(); + //将上面设置好的模型加载到listview中 + listview->setModel(model); + //设置 listview 背景颜色的样式 + listview->setBackgroundType(DStyledItemDelegate::BackgroundType::RoundedBackground); + + //新建一个header模型 + QStandardItemModel *hmodel = new QStandardItemModel(); + //设置header内容 + hmodel->setHorizontalHeaderLabels({"功能", "最后打开时间"}); + //新建一个headerview + DHeaderView *headerview = new DHeaderView(Qt::Horizontal); + //将模型加载到headerview + headerview->setModel(hmodel); + //设置headerview高度最大值 + headerview->setMaximumHeight(36); + //设置 headerview 调整尺寸方式,此处设为随窗口尺寸变化 + headerview->setSectionResizeMode(DHeaderView::Stretch); + //将headerview添加到listview + listview->addHeaderWidget(headerview); + + //为footer设置一个标签 + QLabel *label = new QLabel("共四项内容"); + //设置标签居中显示 + label->setAlignment(Qt::AlignCenter); + //将标签添加到footer + listview->addFooterWidget(label); + + //将 listview 放入主窗口 + win.setCentralWidget(listview); + + win.resize(500,350); + win.show(); + return app.exec(); +} + +``` + +上述代码中 setBackgroundType 中的参数为枚举类型,其他的枚举值为 BackgroundType_Mask, ClipCornerBackground, +NoBackground, NoNormalState, 可以更改代码中枚举值查看效果 + +依次使用 如下命令 编译和运行程序 + +```bash + +cmake -B build +cmake --build build +./build/example1 + +``` + +程序运行效果如下: + +![dlistview_example](dlistview_example.png) + +@fn void DListView::currentChanged(const QModelIndex &previous) +@brief 这个信号当当前item发生改变时被调用 +@details listview会有一个始终表示当前item索引的 QModelIndex 对象, +当这个 QModelIndex 对象表示的位置发生改变时这个信号才会被调用,而不是当前item的内容发生改变时。 +当鼠标单机某一个item或者使用键盘切换item时, +@param[in] previous 为之前的item的索引对象 +@sa QModelIndex QListView::currentChanged + +@fn void DListView::triggerEdit(const QModelIndex &index) +@brief 这个信号当有新的item被编辑时被调用 +@param[in] index 为正在编辑的item的索引对象 +@sa QModelIndex QAbstractItemView::EditTrigger + +@fn DListView::DListView(QWidget *parent) +@brief 获取一个 DListView 实例 +@param[in] parent 被用来作为 DListView 实例的父控件 + +@fn QAbstractItemView::State DListView::state() const +@brief 获取控件当前的状态 +控件可以有正在被拖拽,正在被编辑,正在播放动画等状态,详细可以查阅:QAbstractItemView::State +@return 控件当前的状态 +@sa QAbstractItemView::State + +@fn QWidget *DListView::getHeaderWidget(int index) const +@brief 获取一个顶部控件 +@details 顶部控件与item一样都会在listview中被显示出来,而且顶部控件会始终在所有item之上, +也就是说顶部控件与item不同的地方在于顶部控件始终显示在布局中,而不会因为鼠标滚动不可见。 +另外顶部控件可以有多个,它们的布局方式(方向)与item的布局方向相同 +@param[in] index 指定要获取的顶部控件的索引 +@return 返回在指定索引处的顶部控件对象 +@note 注意顶部控件并不是像 GridLayout 的表头,表头是始终在水平方向上布局的 +@sa DListView::getFooterWidget DListView::addHeaderWidget DListView::removeHeaderWidget DListView::takeHeaderWidget + +@fn QWidget *DListView::getFooterWidget(int index) const +@brief 获取一个底部控件 +@param[in] index 指定要获取的底部控件的索引 +@return 返回在指定索引处的底部控件对象 +@sa DListView::getHeaderWidget + +@fn bool DListView::isActiveRect(const QRect &rect) const +@brief 判断给定的 QRect 是否与 listview 的item可显示区域有重叠 +@details listview 的item可显示区域即为 listview 的 viewport , items只能在 viewport 显示,超出这一区域的 item 将不可见。 +@param[in] rect 要对比的 QRect +@return 返回两个矩形是否有重叠区域 +@sa DListView::isVisualRect + +@fn bool DListView::isVisualRect(const QRect &rect) const +@brief 与 DListView::isVisualRect 相同 +@param[in] rect 用于判断的位置矩形. +@return 成功包含矩形返回 true,否则返回 false. +@sa DListView::isVisualRect + +@fn void DListView::rowCountChanged() +@sa DListView::count + +@property DListView::count +@brief 这个属性保存共有多少行数据 +@details Getter: DListView::count , Signal: DListView::rowCountChanged + +@fn void DListView::orientationChanged(Qt::Orientation orientation) +@param[in] orientation 改变的方向值. +@sa DListView::orientation + +@property DListView::orientation +@brief 这个属性保存listview中item的布局方式 +@details Getter: DListView::orientation , Setter: DListView::setOrientation , Signal: DListView::orientationChanged +@sa Qt::Orientation + +@fn void DListView::setModel(QAbstractItemModel *model) +@brief 设置 DListView 要使用的模型 +@details 模型用来为 listview 提供数据,以实现数据层与界面层分离的结构, 详细请查阅 Qt's model/view framework +@param[in] model 模型对象 +@sa QListView::setModel + +@fn bool DListView::addItem(const QVariant &data) +@brief 在列表底部新增一个item +@param[in] data 要新增的数据 +@return 返回是否新增成功 + +@fn bool DListView::addItems(const QVariantList &datas) +@brief 一次性在列表底部新增多个item +@param[in] datas 要新增的数据组成的列表 +@return 是否新增成功 + +@fn bool DListView::insertItem(int index, const QVariant &data) +@brief 在指定行处新增一个item +@param[in] index 要增加item的行号 +@param[in] data 要增加的item的数据 +@return 是否新增成功 + +@fn bool DListView::insertItems(int index, const QVariantList &datas) +@brief 在指定行处新增多个item +@param[in] index 要增加item的行号 +@param[in] datas 要增加的items的数据组成的列表 +@return 是否新增成功 + +@fn bool DListView::removeItem(int index) +@brief 移除指定位置的item +@param[in] index 要移除的item的行号 +@return 是否移除成功 + +@fn bool DListView::removeItems(int index, int count) +@brief 一次移除多个item +@param[in] index 开始移除item的行号 +@param[in] count 移除从 index 指定的行号开始,移除 count 个item +@return 返回是否移除成功 + +@fn int DListView::addHeaderWidget(QWidget *widget) +@brief 此函数用于添加顶部小控件. +与 DListView::getHeaderWidget 类似,但返回要移除的顶部控件的对象. +@param[in] widget 头部控件实例. +@return 成功添加返回添加进 DListView 的索引值,已存在返回对应控件 +的索引值. +@sa DListView::getHeaderWidget + +@fn void DListView::removeHeaderWidget(int index) +@brief 此函数用于移除头部控件小控件. +@param[in] index 添加进 DListView 中头部小控件 +的索引值,是 DListView::addHeaderWidget 的返回值. +@sa DListView::addFooterWidget + +@fn QWidget *DListView::takeHeaderWidget(int index) +@brief 此函数用于移除头部小控件并返回该控件. +@details 与 DListView::getHeaderWidget 类似,但返回要移除的顶部控件的对象 +@param[in] index 添加进 DListView 中头部小控件的索引值,是 DListView::addHeaderWidget 的返回值. +@return 成功移除返回获取到的头部小控件,否则返回 nullptr . +@sa DListView::getHeaderWidget + +@fn int DListView::addFooterWidget(QWidget *widget) +@brief 此函数用于添加底层页脚小控件. +@param[in] widget 底层页脚控件实例. +@return 成功添加返回对应的索引值,如果已存在,则返回对应的索引值。 +@sa DListView::getFooterWidget + +@fn void DListView::removeFooterWidget(int index) +@brief 此函数用于移除底层页脚控件. +@param[in] index 添加进 DListView 中底层页脚控件的索引值,是 DListView::addFooterWidget 的返回值. +@sa DListView::addFooterWidget + +@fn QWidget *DListView::takeFooterWidget(int index) +@brief 移除底层页脚控件并返回该控件. +@param[in] index 添加进 DListView 中底层页脚控件的索引值,是 DListView::addFooterWidget 的返回值. +@sa DListView::getFooterWidget DListView::takeHeaderWidget + +@fn void DListView::setOrientation(QListView::Flow flow, bool wrapping) +@brief 此函数用于设置 DListView 的方向. +@param[in] flow 为 DListView 的方向,有 QListView::Flow::LeftToRight 和 QListView::Flow::TopToBottom 两个值。 +@param[in] wrapping 用于控制项布局是否自动换行,true 表示自动换行,false 表示非自动换行。 +@sa DListView::orientation + +@fn void DListView::edit(const QModelIndex &index) +@brief 开始编辑一个item. +@param[in] index 指定要编辑的item的位置 + +@fn void DListView::setBackgroundType(DStyledItemDelegate::BackgroundType backgroundType) +@brief 设定item的背景色类型. +@param[in] backgroundType 背景色类型 + +@fn void DListView::setItemMargins(const QMargins &itemMargins) +@brief 设定item的内容margin. +@param[in] itemMargins margin值 + +@fn void DListView::setItemSize(QSize itemSize) +@brief 设定item的尺寸. +@param[in] itemSize 尺寸的大小 + +@fn void DListView::setItemSpacing(int spacing) +@brief 设定item的间距大小. +@param[in] spacing 间距大小值 + +@fn void DListView::setItemRadius(int radius) +@brief 设定item的圆角大小. +@param[in] radius 圆角大小值 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dmainwindow.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dmainwindow.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dmainwindow.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dmainwindow.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,199 @@ +/*! +@~chinese +@file dmainwindow.h +@ingroup window +@class Dtk::Widget::DMainWindow +@brief DMainWindow类提供了一个主应用程序窗口,主窗口为构建应用程序的用户提供了一个框架 +界面。与Qmainwindow相比,DmainWindow具有自己的布局它只有标题栏和内容区域,更简单。 +开发人员可以提供自定义的标题栏和内容,以使应用功能丰富。 +@details + +## 概述 +DMainWindow类提供了一个主应用程序窗口,主窗口为构建应用程序的用户提供了一个框架 +界面。与Qmainwindow相比,DmainWindow具有自己的布局它只有标题栏和内容区域,更简单。 +开发人员可以提供自定义的标题栏和内容,以使应用功能丰富。 + +使用如下代码显示一个最简单的DMainWindow窗口:
+ +## CMakeLists.txt + +```cmake +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +# set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # suppot clangd 支持clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets Core REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui REQUIRED) # 寻找Dtk组件Gui + + +add_executable(example1 # 添加可执行文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE Qt5::Widgets Qt5::Gui Qt5::Core dtkgui dtkcore dtkwidget) # 链接库 +``` + +## main.cpp + +```cpp +#include //应用程序依赖 +#include //主窗口依赖 +#include //进行应用设置的依赖 +DWIDGET_USE_NAMESPACE; //使用DTK widget命名空间 + +int main(int argc, char *argv[]){ + DApplication app(argc, argv); //设置一个应用 + + app.setApplicationName("这是应用名称"); //设置应用名称 + app.setOrganizationName("deepin"); //设置关于信息中的系统信息 + app.setApplicationVersion("2.0"); //设置关于信息中的版本号 + + DApplicationSettings as; + Q_UNUSED(as) //设置记住应用主题 + + DMainWindow dwm; //使用DMainWindow类实例化一个窗口 + dwm.resize(400,250); //可使用resize()对窗口大小进行调整 + dwm.show(); //显示这个窗口 + + return app.exec(); //运行应用 +} + +``` + +以上例子运行结果如下:
+ +![example](/docs/images/dmainwindow_example.png) + +点击菜单栏About弹出关于对话框,关于对话框具体参见[daboutdialog](classDtk_1_1Widget_1_1DAboutDialog.html),效果如下
+ +![example2](/docs/images/dmainwindow_example2.png) + +@property DMainWindow::titlebar +@brief 为主窗口设置`titlebar` +@return 主窗口使用的`dtitlebar`实例 + +@property DMainWindow::isDXcbWindow +@brief 支持许多功能,例如背景模糊和窗口剪裁,仅当窗口使用DXCB QT平台插件时。 +@return 该窗口是否为dxcb backended + +@property DMainWindow::windowRadius +@brief 该属性保持主窗口的半径 + +@property DMainWindow::borderWidth +@brief 该属性拥有主窗边框的宽度 + +@property DMainWindow::borderColor +@brief 此属性具有主窗口边框的颜色 + +@property DMainWindow::shadowRadius +@brief 该属性拥有主窗口的阴影半径 + +@property DMainWindow::shadowOffset +@brief 此属性保存在窗户阴影上应用的偏移量 + +@property DMainWindow::shadowColor +@brief 此属性拥有窗户阴影的颜色 + +@property DMainWindow::clipPath +@brief 此属性保留了自定义QPainterPath来夹住窗口。默认DMAINWINDOW被剪辑为一个 +转角矩形,但是您可以提供自定义的`QPainterPath`来执行自定义形状的窗口 +@sa DMainWindow::frameMask + +@property DMainWindow::frameMask +@brief 此属性将蒙版贴在窗口上。对于更好的剪辑质量,例如抗质量,请改用属性`dmainwindow :: clippath` + +@property DMainWindow::translucentBackground +@brief 该属性属于窗口是否具有半透明背景 + +@property DMainWindow::enableSystemResize +@brief 此属性保留是否可以由用户调整窗口大小。此属性的默认值是正确的。您可以将此属性设置为false并实现此属性的调整窗口大小 + +@property DMainWindow::enableSystemMove +@brief 此属性保留用户是否可以移动窗口。此属性的默认值为true。您可以将此属性设置为false,并选择有效的区域拖动和移动 + +@property DMainWindow::autoInputMaskByClipPath +@brief 此属性是否将用户输入是否被剪辑路径掩盖,此属性的默认值是true + +@property DMainWindow::enableBlurWindow +@brief 该属性是否有窗口背景是否模糊 + +@property DMainWindow::titlebarShadowEnabled +@brief titleBar阴影属性,用于设置或者判断是否设置titleBar阴影属性 + +@brief DMainWindow::setWindowRadius 设定窗口的圆角 +@sa windowRadius 窗口的圆角值 + +@fn void DMainWindow::setBorderWidth +@brief 设定边框的宽度 +@sa borderWidth 边框的宽度 + +@fn void DMainWindow::setBorderColor +@brief 设定边框的颜色 +@sa borderColor 边框的颜色 + +@fn void DMainWindow::setShadowRadius +@brief 设定阴影区域的圆角 +@sa shadowRadius 阴影区域圆角大小 + +@fn void DMainWindow::setShadowOffset +@brief 设定阴影区域的偏移距离 +@sa shadowOffset 阴影区域的偏移距离 + +@fn Dvoid MainWindow::setShadowColor +@brief 设定阴影的颜色 +@sa shadowColor 阴影的颜色 + +@fn void DMainWindow::setClipPath +@brief 设定裁剪路径 +@sa clipPath 裁剪的路径 + +@fn void DMainWindow::setFrameMask +@brief 设定边框的mask区域 +@sa frameMask mask区域 + +@fn void DMainWindow::setTranslucentBackground +@brief 设定时候擦除背景 +@sa translucentBackground true擦除背景 false不擦除背景 + +@fn void DMainWindow::setEnableSystemResize  +@brief 设定是否允许系统调整窗口大小 +@sa enableSystemResize true允许系统调整 false不允许系统调整 + +@fn void DMainWindow::setEnableSystemMove +@brief 设定时候允许系统移动窗口 +@sa enableSystemMove true允许移动 false不允许移动 + +@fn void DMainWindow::setEnableBlurWindow  +@brief 设置窗口模糊效果, shinese 开启此功能请设置`setAttribute(Qt::WA_TranslucentBackground)` +@sa `enableBlurWindow` true开启模糊效果 false关闭模糊效果 + +@fn void DMainWindow::setAutoInputMaskByClipPath +@brief 通过裁剪区域自动设定mask. +@sa autoInputMaskByClipPath true自动设定 false不自动设定 + +@fn void DMainWindow::sendMessage +@brief 发送浮动消息 +@sa icon 消息展示图标, message 消息内容 + +@fn void DMainWindow::sendMessage +@brief 发送浮动消息 +@sa message DFloatingMessage消息 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dmessagemanager.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dmessagemanager.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dmessagemanager.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dmessagemanager.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dmessagemanager.h +@ingroup dialog +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dpasswordedit.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dpasswordedit.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dpasswordedit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dpasswordedit.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dpasswordedit.h +@ingroup edit +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dprintpreviewdialog.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dprintpreviewdialog.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dprintpreviewdialog.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dprintpreviewdialog.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,34 @@ +/*! +@~chinese +@file dprintpreviewdialog.h +@ingroup dialog +@class Dtk::Widget::DPrintPreviewDialog +@brief Dtk 风格的打印预览页面. +@details 一个用于创建 Dtk 风格的打印预览页面,通常情况下,只需要构建一个 DPrintPreivewDialog 对象, +并将原始数据绘制到连接 `DPrintPreview::paintRequested` 信号的槽函数中,最后以模态的形式显示就可以正常使用。 + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + +@fn DPrintPreviewSettingInfo *Dtk::Widget::DPrintPreviewDialog::createDialogSettingInfo(DPrintPreviewSettingInfo::SettingType type) +@brief 根据打印类型 `type` 创建打印界面设置对象,包含当前界面设置信息。 +@details 若不支持 `type` 类型的设置,将返回 nullptr ;打印插件可能过滤部分类型的设置,同样返回 nullptr 。 +使用示例 +```c++ +DPrintPreviewDialog dialog; +auto info = dialog.createDialogSettingInfo(DPrintPreviewSettingInfo::PS_Watermark); +if (info) { + // 设置打印参数 + ... + dialog.updateDialogSettingInfo(info); + delete info; +} +``` +@param[in] type 打印界面配置类型 +@return 打印设置对象指针 +@warning 创建的打印设置对象生命周期由调用方管理,需手动释放对象 + +@fn void Dtk::Widget::DPrintPreviewDialog::updateDialogSettingInfo(DPrintPreviewSettingInfo *info) +@brief 通过 `info` 配置信息更新打印界面配置,配置将更新界面控件,可调整的选项包括基础设置、打印方向、页面设置、水印等。 +@param[in] info 提供打印界面设置信息 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dprogressbar.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dprogressbar.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dprogressbar.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dprogressbar.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dprogressbar.h +@ingroup dprogressbar +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dsearchcombobox.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dsearchcombobox.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dsearchcombobox.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dsearchcombobox.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dsearchcombobox.h +@ingroup button +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dsearchedit.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dsearchedit.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dsearchedit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dsearchedit.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dsearchedit.h +@ingroup edit +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dsettingsdialog.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dsettingsdialog.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dsettingsdialog.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dsettingsdialog.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,273 @@ +/*! +@~chinese +@file dsettingsdialog.h +@ingroup dsettings +@class Dtk::Widget::DSettingsDialog +@brief DSettingsDialog 为使用DSettings的Dtk程序提供一个通用的设置对话框,这个对话框可以通过json配置文件来自动生成 +@details + +## 示例程序 +通过一个简单的示例来学会使用 DSettingsDialog ,这个示例要实现这样一个类似浏览器设置的需求 +当打开新项目时的设置和打开新窗口/新标签时的设置 + +通过json文件来写设置的需求,如下: + +### settings.json + +json设置了一个基础设置,分为 open_action 和 New Tab & Window 两块,两块又分别有其具体的两个设置, +open_action 有一个是否总是在新窗口打开页面的设置和打开文件的设置,实现方式分别是 checkbox 和 combobox ; +New Tab & Window 有一个新窗口打开的方式和新标签打开的方式两个设置,都是 combobox 实现。 + +其中实现控件除了checkbox、combobox还提供了lineedit, shortcut, spinbutton, buttongroup,radiogroup, slider, switchbutton,title1, title2,下文会在示例中一一展示 + +```json + +{ + "groups": [{ + "key": "base", + "name": "基础设置", + "groups": [{ + "key": "setting1", + "name": "设置一", + "options": [{ + "key": "checkbox_ex", + "type": "checkbox", + "text": "是否打开此选项", + "default": "true" + }, + { + "key": "combobox_ex", + "type": "combobox", + "name": "请选择" + }] + }, + { + "key": "setting2", + "name": "设置二", + "options": [{ + "key": "lineedit_ex", + "type": "lineedit" + }, + { + "key": "shortcut_ex", + "type": "shortcut" + }] + }, + { + "key": "setting3", + "name": "设置三", + "options": [{ + "key": "spinbutton_ex", + "type": "spinbutton" + }, + { + "key": "buttongroup_ex", + "type": "buttongroup", + "items": ["yes","no"], + "default": 1 + }] + }, + { + "key": "setting4", + "name": "设置四", + "options": [{ + "key": "slider_ex", + "type": "slider", + "max": 100, + "min": 0, + "default": 50 + }, + { + "key": "radiogroup_ex", + "type": "radiogroup", + "items": ["选项一","选项二"], + "default": 1 + }] + }, + { + "key": "setting5", + "name": "设置五", + "options": [{ + "key": "switchbutton_ex", + "type": "switchbutton", + "name": "switchbutton" + }, + { + "key": "title1_ex", + "type": "title1", + "text": "title1", + "default": "这是title1" + }, + { + "key": "title2_ex", + "type": "title2", + "text": "title2", + "default": "这是title2" + }, + { + "key": "icon-button", + "type": "icon-button" + }] + }] + + }] +} + +``` + +### resources.qrc + +json文件配置完后需要将其添加到资源文件 resources.qrc + +``` + + + + settingsData/settings.json + + + + +``` + +### CMakeLists.txt + +配置CMake + +```cmake + +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # support clangd 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui) # 寻找Dtk组件Gui + + +set(RESCOUCES resources.qrc) #设置资源文件变量名 +add_executable(example1 # 添加可执行文件 + ${RESCOUCES} #添加资源文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE + Qt5::Widgets + Qt5::Gui + dtkgui + dtkcore + dtkwidget +) # 链接库 + +``` + +### main.cpp +代码部分 + +```cpp + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "dtkcore_global.h" +#include +DWIDGET_USE_NAMESPACE +DCORE_USE_NAMESPACE + +int main(int argc, char *argv[]){ + DApplication app(argc, argv); + DMainWindow win; + DPushButton *btn = new DPushButton("设置", &win); //初始化一个设置按钮 + win.resize(800,600); + btn->move(0, 50); + + //建立设置按钮的连接,点击按钮弹出设置页面 + QObject::connect(btn, &QPushButton::clicked, &win, [&win](){ + //初始化一个存储后端 + QTemporaryFile tmpFile; + tmpFile.open(); + QSettingBackend backend(tmpFile.fileName()); + + //从json中初始化配置 + auto settings = DSettings::fromJsonFile(":/settingsData/settings.json"); + settings->setBackend(&backend); + + //初始化一个设置显示窗口 + DSettingsDialog dsd(&win); + //如果自带控件不能满足需求,可自行注册控件,此处以一个Icon button为例 + dsd.widgetFactory()->registerWidget("icon-button", [&win](QObject *obj){ + DSettingsOption *option = qobject_cast(obj); + DIconButton *iconBtn = new DIconButton(DStyle::SP_DriveCDIcon);//新建一个icon button + return iconBtn; + }); + dsd.updateSettings(settings); //将设置加载到设置窗口 + dsd.exec(); //设置窗口显示并等待响应 + }); + + win.show(); + return app.exec(); +} + +``` + +运行程序,效果如下: + +![dsettingsdialog_example](/docs/images/dsettingsdialog_example.png) + + +@fn DSettingsWidgetFactory *DSettingsDialog::widgetFactory() const +@brief 获取当前对话框使用的控件构造工厂 +@details 每一个设置对话框都有自己的构造工厂实例,这些实例并不会共享数据。 +@return 返回当前对话框使用的控件构造工厂 + +@fn void DSettingsDialog::setResetVisible(bool visible) +@brief DSettingsDialog::setResetV配置文件实例。isible 设置恢复默认设置按钮是否显示 +@param[in] visible true显示 false隐藏 +@note 请在 updateSettings() 后调用 + +@fn void DSettingsDialog::scrollToGroup(const QString &groupKey) +@brief DSettingsDialog::scrollToGroup 使对话框跳转到指定的 group 项目 +@param[in] groupKey DSettings 中 groupKeys 以及其子项 childGroups +@note 请在对话框 show() 以后调用 + +@fn void DSettingsDialog::setIcon(const QIcon &icon) +@brief DSettingsDialog::setIcon 设置标题栏的图标 QIcon +@param[in] icon 设置的 Icon + +@fn void DSettingsDialog::updateSettings(Dtk::Core::DSettings *settings) +@brief 根据settings数据来创建控件,该方法只能调用一次。 +@param[in] settings 配置文件实例。 + +@fn void DSettingsDialog::updateSettings(Dtk::Core::DSettings *settings) +@brief 根据settings数据来创建控件,并使用translateContext来进行国际化,该方法只能调用一次. + +@fn void DSettingsDialog::updateSettings(const QByteArray &translateContext, Core::DSettings *settings) +@brief 根据settings数据来创建控件,并使用translateContext来进行国际化,该方法只能调用一次. +@param[in] translateContext 国际化使用的上下文。 +@param[in] settings 配置文件实例。 +@sa DSettingsDialog::updateSettings(Dtk::Core::DSettings *settings) + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dsizemode.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dsizemode.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dsizemode.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dsizemode.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,16 @@ +/*! +@~chinese +@file dsizemode.h +@ingroup dtkwidget + +@class Dtk::Widget::DSizeModeHelper +@brief 控件大小模式对应的帮助类,提供一些公共方法,方便区分不同SizeMode类型下对应的元素值 + +@fn static inline template T DSizeModeHelper::element(const T &t1, const T &t2) +@breif 根据当前的控件大小模式是否为紧凑模式返回对应的值 +@param[in] t1 紧凑模式对应的元素值 +@param[in] t2 非紧凑模式下对应的元素值 +@return 返回当前控件大小模式下对应模式下的元素值 +@sa Dtk::Gui::DGuiApplicationHelper::sizeMode() + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dslider.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dslider.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dslider.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dslider.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,278 @@ +/*! +@~chinese +@file dslider.h +@ingroup slider +@class Dtk::Widget::DSlider +@brief DSlider一个聚合 QSlider 的滑块,DSlider提供了在滑块两侧设置图标函数,且设置的滑块更加美观 +@details + +## DSlider 简单示例 +通过使用 DSlider 实现一个简单需求,有一个按钮,需要通过一个DSlider滑块改变按钮的位置,滑块左滑按钮左移,滑块右滑按钮右移 + +### CMakeLists.txt + +```cmake + +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # support clangd 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui) # 寻找Dtk组件Gui + +add_executable(example1 # 添加可执行文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE + Qt5::Widgets + Qt5::Gui + dtkgui + dtkcore + dtkwidget +) # 链接库 + +``` + +### main.cpp + +```cpp + +#include +#include +#include +#include +DWIDGET_USE_NAMESPACE //使用Dtk widget的命名空间 + +int main(int argc, char *argv[]){ + DApplication app(argc, argv); + DMainWindow win; + win.resize(800,500); + + DSlider *dslider = new DSlider(Qt::Horizontal, &win); //新建一个水平方向的DSlider,父亲设置为主窗口 + dslider->move(0,50); + dslider->setLeftIcon(win.style()->standardIcon(DStyle::SP_ArrowLeft)); //给滑块设置一个左图标,这里使用一个自带的左箭头 + dslider->setRightIcon(win.style()->standardIcon(DStyle::SP_ArrowRight)); //给滑块设置一个右图标,这里使用自带的右箭头 + dslider->setFixedWidth(400); //设置滑块的宽度 + + DPushButton *btn = new DPushButton("按钮", &win); //设置一个按钮 + btn->move(0,100); //移动按钮的位置 + + //建立一个滑块与按钮的连接,滑块滑动发出信号,按钮接收,lambda函数中设置按钮的移动,并且打印出滑块的当前数值 + QObject::connect(dslider, &DSlider::valueChanged, btn, [dslider, btn](){ + int sliderValue = dslider->value(); + qDebug() << sliderValue; + btn->move(sliderValue * 5, 100); + }); + + win.show(); + return app.exec(); +} + +``` +程序运行效果如下: + +![dslider_example](/docs/images/dslider_example.png) + +@class Dtk::Widget::DSlider +@brief DSlider一个聚合 QSlider 的滑块 +@details DSlider提供了在滑块两侧设置图标函数, DSlider提供了滑块的刻度及刻度标识 + +@fn void DSlider::valueChanged(int value) +@brief 信号会在 slider 的 value 值改变时被发送 +@param[in] value slider 的当前值 + +@fn void DSlider::sliderMoved(int position) +@brief 信号会在 slider 拖动时被发送 +@param[in] position 为 slider 被拖动的指针的位置 + +@fn void DSlider::sliderReleased() +@brief 信号会在 slider 被松开时被发送 + +@fn void DSlider::rangeChanged(int min, int max) +@brief 信号会在 range 属性的值改变时被发送 +@param[in] min 为 range 的最小值 +@param[in] max 为 range 的最大值 + +@fn void DSlider::actionTriggered(int action) +@brief 信号会在 action 被触发时被发送 + +@fn void DSlider::iconClicked(SliderIcons icon, bool checked) +@brief 信号会在左右 iconbutton 被点击时被发送 +@param[in] icon 表示按钮被点击的位置 +@param[in] checked 表示按钮是否被选中 + +@brief DSlider的构造函数 +@param[in] orientation 滑块方向 +@param[in] parent 参数被发送到 QWidget 构造函数 +@sa Qt::Orientation + +@fn bool DSlider::eventFilter(QObject *watched, QEvent *e) +@brief 事件过滤器函数 +@reimp 此函数目前仅处理了鼠标滚轮事件 +@param[in] watched 被监听的子控件 +@param[in] e 对应的事件指针 + +@fn Qt::Orientation DSlider::orientation() const +@brief 滑块方向 +@return 返回当前滑块的方向。 +@sa QSlider::orientation() + +@fn QSlider *DSlider::slider() +@brief 返回 QSlider 对象,若 DSlider 不满足输入框的使用需求,请用此函数抛出的对象。 +@return QSlider 对象。 + +@fn void DSlider::setLeftIcon(const QIcon &left) +@brief 设置滑块左侧图标. +@param[in] left 左图标 + +@fn void DSlider::setRightIcon(const QIcon &right) +@brief 设置滑块右图标. +@param[in] right 右图标 + +@fn void DSlider::setIconSize(const QSize &size) +@brief 设置滑块图标大小. +@param[in] size 图标大小 + +@fn void DSlider::setMinimum(int min) +@brief 设置滑动范围的最小值. +@param[in] min 滑动最小值。 +@sa QSlider::setMinimum() DSlider::minimum() + +@fn int DSlider::minimum() const +@brief 滑动范围的最小值. +@return 返回滑动范围的最小值。 +@sa QSlider::minimum() DSlider::setMinimum() + +@fn void DSlider::setValue(int value) +@brief 设置滑块当前值 +@param[in] value 滑块的当前值。 +@sa QSlider::setValue() + +@fn int DSlider::value() const +@brief DSlider::value +@sa QSlider::value() + +@fn void DSlider::setPageStep(int pageStep) +@brief 设置页面单步的大小, 使用按键 PageUp 或者 PageDown 时,滑块滑动的单步大小。 +@param[in] pageStep 单步大小. +@sa QSlider::setPageStep() + +@fn int DSlider::pageStep() const +@brief 返回页面单步大小 +@return 页面单步大小的值。 +@sa QSlider::pageStep() DSlider::setPageStep() + +@fn void DSlider::setMaximum(int max) +@brief 设置滑动范围的最大值 +@param[in] max 滑动范围的最大值。 +@sa QSlider::setMaximum() DSlider::maximum() + +@fn int DSlider::maximum() const +@brief 返回滑动范围的最大值 +@return 滑动范围的最大值 +@sa QSlider::maximum + +@fn void DSlider::setLeftTicks(const QStringList &info) +@brief 设置滑块左侧的刻度值. +@details 根据 QStringList 数量,绘制刻度的个数,绘制刻度标识:滑块为水平,刻度在滑块上方;滑块为垂直,刻度在滑块左侧。 +@param[in] info 刻度标识 + +@fn void DSlider::setRightTicks(const QStringList &info) +@brief 设置滑块右侧的刻度值. +@details 根据 QStringList 数量,绘制刻度的个数,绘制刻度标识:滑块为水平,刻度在滑块下方;滑块为垂直,刻度在滑块右侧。 +@param[in] info 刻度标识 + +@brief 设置滑块上方的刻度值 +@param[in] info 刻度标识. +@sa DSlider::setLeftTicks() + +@fn void DSlider::setBelowTicks(const QStringList &info) +@brief 设置滑块下方的刻度值 +@param[in] info 刻度标识. +@sa DSlider::setRightTicks() + +@fn void DSlider::setMarkPositions(QList list) +@brief 设置显示双边的刻度线(不显示刻度值). +@details 举例用途:比如调节音量的 DSlider ,需要在 value = 100 的地方标记一个刻度,而不需要显示其他的刻度值(并且实际音量值是可以超过 100 的) +其他:设置指定数值的刻度线(setMarkPositions)和设置刻度线+刻度值(setBelowTicks)是两个相互独立的,且互不干扰,若是同时使用,也会同时绘画各自的线; +另外两个的先后顺序也并没有关系. +@param[in] list 双边刻度线的值. + +@fn void DSlider::setMouseWheelEnabled(bool enabled) +@brief 设置鼠标滚轮是否开启. +@details 开启鼠标滚轮后,用户可以通过鼠标滚轮来控制滑块的滑动。 +@param[in] enabled 是否开启鼠标滚轮 + +@fn void DSlider::setTipValue(const QString &value) +@brief 用于创建气泡,气泡将跟随滑块移动. +@param[in] value 非空开启气泡,空关闭气泡(销毁) + +@fn QSlider::TickPosition DSlider::tickPosition() const +@brief 返回滑块的记号位置. 获取滑块刻度当前朝向。 +@return 滑块刻度的朝向 +@sa QSlider::TickPosition + +@fn QSize DSlider::sizeHint() const +@brief 滑动条的大小策略. +@details 这个函数会返回该滑动条推荐的大小,如果滑动条没有布局,这个大小将会是一个无效值,如果存在布局,将返回该布局下的推荐大小。 +@sa QSlider::sizeHint + +@fn void DSlider::setHandleVisible(bool b) +@brief 设置滑块是否显示. +@param[in] b 为 true 时滑块显示,否则滑块隐藏, 默认地, 滑块为显示状态 + +@fn bool DSlider::handleVisible() const +@brief 获取滑块是否显示的状态. +@return 返回滑块是否显示的状态 + +@fn void DSlider::setEnabledAcrossStyle(bool enabled) +@brief 该函数用于设置滑槽是否禁用活动色填充已经滑过的滑槽. +@details 默认普通 DSlider 滑过的滑槽是活动色填充, 调用过 setXXXTicks 的 DSlider 则默认禁用活动色填充 +@param[in] enabled true 无活动色,可用于音量平衡等不需要显示滑过的,false 滑过的位置(如左侧) + 是高亮色显示,如调节亮度等(默认)默认地,改属性为 false 。 + +@fn void SliderStrip::setScaleInfo(QStringList scaleInfo, QSlider::TickPosition tickPosition) +@brief SliderStrip::setScaleInfo 设置显示刻度线和刻度值 +@param[in] scaleInfo 显示的刻度值 +@param[in] tickPosition 显示的方向枚举值 + +@fn void SliderStrip::setMarkList(QList list, QSlider::TickPosition tickPosition) +@brief SliderStrip::setMarkList 设置显示刻度线(不显示刻度值) +@param[in] list 显示的刻度线的list +@param[in] tickPosition 显示的方向枚举值 + +@fn QList SliderStrip::getList() +@brief SliderStrip::getList 返回刻度线的 list +@return 刻度线的 list + +@fn QStringList SliderStrip::getScaleInfo() +@brief SliderStrip::getScaleInfo 返回刻度值的 list +@return 度值的 list + +@fn void SliderStrip::paintEvent(QPaintEvent *event) +@brief SliderStrip::paintEvent +@sa QWidget::paintEvent() + +@fn bool SliderStrip::event(QEvent *e) +@brief SliderStrip::event +@sa QWidget::event() + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dspinbox.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dspinbox.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dspinbox.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dspinbox.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dspinbox.h +@ingroup edit +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dspinner.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dspinner.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dspinner.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dspinner.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,135 @@ +/*! +@~chinese +@file dspinner.h +@ingroup spinner +@class Dtk::Widget::DSpinner +@brief 可以使用 DSpinner 类快速创建用于指示加载中状态的旋转等待图标动画控件. +@details DSpinner 提供了一个用于指示加载中状态的旋转等待图标动画控件。在创建图标后,使用 start() 即可开始图标旋转的动画。 +@image html DSpinner.gif + +下面通过一个简单的实例来演示DSpinner + +## CMakeLists.txt + +配置 CMakeLists.txt 文件 + +```cmake +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # support clangd 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui) # 寻找Dtk组件Gui + +add_executable(example1 # 添加可执行文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE + Qt5::Widgets + Qt5::Gui + ${DtkGui_LIBRARIES} + ${DtkCore_LIBRARIES} + ${DtkWidget_LIBRARIES} +) # 链接库 +``` + +## main.cpp + +```cpp +#include +#include +#include +#include +#include + +DWIDGET_USE_NAMESPACE //使用DWidget命名空间 + +int main(int argc, char *argv[]) { + DApplication app(argc,argv); + + DMainWindow w; + //限制主程序窗口最小尺寸 + w.setMinimumSize(300,200); + //新建一个窗体,容纳所有控件 + DWidget *cw = new DWidget(&w); + //窗体使用水平布局 + QHBoxLayout *layout = new QHBoxLayout(cw); + //设置对齐方式,向右对齐,防止spinner被隐藏后按钮乱跳 + layout->setAlignment(Qt::AlignRight); + + //添加一个DSpinner + DSpinner *spinner = new DSpinner(); + spinner->setFixedSize(36,36); + //添加一个button,控制DSpinner + DPushButton *btn = new DPushButton("开始加载"); + btn->setFixedWidth(100); + //将DSpinner和DPushButton添加到布局中 + layout->addWidget(spinner); + layout->addWidget(btn); + //刚开始没有加载,隐藏spinner + spinner->hide(); + + //实现按钮被按下后的操作 + QObject::connect(btn, &DPushButton::clicked, [&btn, &spinner](){ + //如果spinner正在播放动画,按下按钮后切换到非加载模式,停止动画并隐藏spinner,反之开始动画并显示spinner + if(spinner->isPlaying()){ + spinner->stop(); + spinner->hide(); + btn->setText("开始加载"); + } + else { + spinner->show(); + spinner->start(); + btn->setText("取消加载"); + } + }); + //将cw放置在主窗口中 + w.setCentralWidget(cw); + w.show(); + return app.exec(); +} +``` + +## 程序运行效果 + +![运行效果图](/docs/images/dspinner_example.gif) + +@fn Dtk::Widget::DSpinner::DSpinner(QWidget *parent = 0) +@brief 创建一个 DSpinner 控件 +@param parent 父控件 + +@fn Dtk::Widget::DSpinner::~DSpinner(); +@brief 析构函数 + +@fn bool Dtk::Widget::DSpinner::isPlaying() const; +@brief DSpinner 是否正在播放旋转动画. +@return 正在播放返回 true,否则返回 false. + +@fn void Dtk::Widget::DSpinner::start(); +@brief DSpinner 开始旋转动画 + +@fn void Dtk::Widget::DSpinner::stop(); +@brief DSpinner 停止旋转动画 + +@fn void Dtk::Widget::DSpinner::setBackgroundColor(QColor color); +@brief 设置控件的背景颜色 +@param color 需要设置的背景颜色 +*/ \ No newline at end of file diff -Nru dtkwidget-5.5.48/docs/widgets/dstyle.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dstyle.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dstyle.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dstyle.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,161 @@ +/*! +@~chinese +@file dstyle.h +@ingroup dtkwidget +@class Dtk::Widget::DStyle +@brief DStyle 提供了一个 Dtk 控件的基础类 +@details + +## 概述 + +类似于 QCommonStyle 中的实现, DStyle 中只实现了 一些基础控件的绘制和一个通用接口的实现,如果想要实现 一个自定义的风格主题, +可以通过尝试继承该类以实现自己的 功能。不过,仅使用 DStyle 并不会将控件的风格保持和 Dtk 控件一致,这是由于 Dtk 的实际控件风格 +在 Chameleon 风格 插件中实现。因此如果需要在 Dtk 中继承 Chameleon 风格,并 添加自定义风格的绘制,可以尝试使用 QProxyStyle 类。 + +下面通过一个例子认识所有的 DStyle 图标。
+项目目录结构在同一目录下 + +## CMakeLists.txt + +```cmake + +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # support clangd 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui) # 寻找Dtk组件Gui + +add_executable(example1 # 添加可执行文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE + Qt5::Widgets + Qt5::Gui + dtkgui + dtkcore + dtkwidget +) # 链接库 + +``` + +## main.cpp + +```cpp + +#include +#include +#include +#include +#include +#include +DWIDGET_USE_NAMESPACE // 使用Dtk widget命名空间 + +int main(int argc, char *argv[]){ + + DApplication app(argc, argv); //设置应用 + DWidget *widget = new DWidget; //新建一个widget窗口 + widget->setWindowTitle("标准图标"); //设置窗口名称 + widget->resize(800,600); + + //新建一个标准item模型 + QStandardItemModel *model = new QStandardItemModel(widget); + //新建一个DListView + DListView *listview = new DListView; + //新建一个风格 + DStyle *style = new DStyle(); + //写一个插入新item的函数,函数可以设置每一个item的图标、名称、高度、不可被编辑 + auto insertItem = [&](const QString &name, const QIcon &icon) + -> DStandardItem * { + DStandardItem *item = new DStandardItem(icon, name); //新建一个item并设置图标、item名称 + item->setSizeHint(QSize(item->sizeHint().width(), 50)); //设置item的图标 + item->setEditable(false); //设置item不可被编辑 + model->appendRow(item); //将新建item添加到模型中 + return item; + }; + + //通过 QMetaEnum::fromType 实现枚举值和字符串的转化 + QMetaEnum meta = QMetaEnum::fromType(); + //循环写入listview的名称和图标,此处为DTK重绘QT图标 + for(int i = DStyle::SP_TitleBarMenuButton; i <= DStyle::SP_RestoreDefaultsButton; i++) { + insertItem(meta.valueToKey(i), style->standardIcon(DStyle::StandardPixmap(i))); + } + + //此处添加DTK自设计和定义的图标,先用数组记录图标名称 + QStringList IconNameList ({ + "SP_ForkElement", //关闭 + "SP_DecreaseElement", //减少(-) + "SP_IncreaseElement", //增加(+) + "SP_MarkElement", //对勾 + "SP_SelectElement", //选择(...) + "SP_EditElement", //编辑 + "SP_ExpandElement", //展开 + "SP_ReduceElement", //收缩 + "SP_LockElement", //锁定 + "SP_UnlockElement", //解锁 + "SP_MediaVolumeLowElement", //音量 + "SP_MediaVolumeHighElement", //满音量 + "SP_MediaVolumeMutedElement", //静音 + "SP_MediaVolumeLeftElement", //左声道 + "SP_MediaVolumeRightElement", //右声道 + "SP_ArrowEnter", //进入 + "SP_ArrowLeave", //离开 + "SP_ArrowNext", //下一页 + "SP_ArrowPrev", //上一页 + "SP_ShowPassword", //显示密码 + "SP_HidePassword", //因此密码 + "SP_CloseButton", //关闭按钮(X) + "SP_IndicatorMajuscule", //大写标识 + "SP_IndicatorSearch", //搜索标识(放大镜) + "SP_IndicatorUnchecked", //搜索标识(对应对勾的选中状态) + "SP_IndicatorChecked", //搜索标识(对勾) + "SP_DeleteButton", //删除按钮 + "SP_AddButton", //新增按钮 + "SP_TitleQuitFullButton", //标题栏(「」) + "SP_TitleMoreButton", //标题栏 "更多" 按钮 + "SP_Title_SS_LeftButton", //标题栏左分屏按钮 + "SP_Title_SS_RightButton", //标题栏右分屏按钮 + "SP_Title_SS_ShowMaximizeButton", //标题栏最大化分屏按钮 + "SP_Title_SS_ShowNormalButton", //标题栏还原分屏按钮 + }); + //通过循环遍历上述名称数组同时添加图标 + for(int i = DStyle::SP_ForkElement; i <= DStyle::SP_Title_SS_ShowNormalButton; i++){ + insertItem(IconNameList[i - DStyle::SP_ForkElement], style->standardIcon(DStyle::StandardPixmap(i))); + } + + listview->setModel(model); //将模型加载到listview + QVBoxLayout *layout = new QVBoxLayout(widget); //新建一个垂直布局 + layout->addWidget(listview); //将listview所在widget添加到布局 + + widget->show(); //展示主窗口 + return app.exec(); //运行程序并等待关闭 + +} + +``` + +运行程序效果如下图所示:
+ +![dstyle_example1](/docs/images/dstyle_example1.png)
+ +![dstyle_example2](/docs/images/dstyle_example2.png)
+ +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dsuggestbutton.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dsuggestbutton.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dsuggestbutton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dsuggestbutton.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dsuggestbutton.h +@ingroup button +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dswitchbutton.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dswitchbutton.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dswitchbutton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dswitchbutton.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,29 @@ +/*! +@~chinese +@file dswitchbutton.h +@ingroup button + +@class Dtk::Widget::DSwitchButton +@brief DSwitchButton 实现一个开关按钮 + +@fn Dtk::Widget::DSwitchButton::DSwitchButton(QWidget *parent) +@brief 构造 DSwitchButton 对象,传入父控件指针。 +@param parent 父控件指针 + +@fn QSize Dtk::Widget::DSwitchButton::sizeHint() const +@brief DSwitchButton::sizeHint 初始化控件矩形大小(在绘画之前) +@return 控件矩形大小 + +@fn void Dtk::Widget::DSwitchButton::paintEvent(QPaintEvent *e) +@brief DSwitchButton::paintEvent 绘画处理 +@param e 绘画事件 +@sa QWidget::paintEvent() + +@fn void Dtk::Widget::DSwitchButton::initStyleOption(DStyleOptionButton *option) const +@brief DSwitchButton::initStyleOption 初始化(用于继承的)抽象按钮对象,后面用于 DStylePainter 绘画 DStyle::CE_SwitchButton 枚举 +@param option 初始化了的的抽象风格按钮对象 + +@fn void Dtk::Widget::DSwitchButton::checkedChanged(bool arg) +@brief 选择状态的信号 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dtabbar.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dtabbar.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dtabbar.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dtabbar.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dtabbar.h +@ingroup window +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dtextedit.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dtextedit.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dtextedit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dtextedit.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dtextedit.h +@ingroup edit +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dtitlebar.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dtitlebar.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dtitlebar.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dtitlebar.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,218 @@ +/*! +@~chinese +@file dtitlebar.h +@ingroup window +@class Dtk::Widget::DTitlebar +@brief Dtitlebar是Dtk程序通用的标题栏组件,用于实现标题栏的高度定制化 +@details + +## DTitlebar 概述 +Dtitlebar是Dtk程序通用的标题栏组件,用于实现标题栏的高度定制化。 + +当我们新建一个DMainWindow窗口,窗口则会自带一个 DTitlebar ,其包含默认的菜单,包括 主题切换、关于、退出等功能,如下图: + +![dtitlebar_example1](/docs/images/dtitlebar_example1.png) + +有时候我们开发一个应用,具有很多自己的功能,这些功能需要添加到标题栏中分门别类供用户选择,这是就需要自定义自己的DTitlebar。 +下面通过一个简单的例子来创建自己的titlebar,添加自己的菜单 + +项目目录结构在同一目录下 + +## CMakeLists.txt + +```cmake + +cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本 + +project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++ + +set(CMAKE_CXX_STANDARD 11) # 指定c++标准 +set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上 +set(target example1) # 指定目标名称 + +set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc +set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件 +set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # support clangd 支持 clangd + +if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0 + set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录 +endif() + +find_package(Qt5 COMPONENTS Widgets REQUIRED) # 寻找Qt5组件Widgets +find_package(Qt5 COMPONENTS Gui REQUIRED) # 寻找Qt5组件Gui +find_package(Dtk COMPONENTS Widget REQUIRED) # 寻找Dtk组件Widget +find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core +find_package(Dtk COMPONENTS Gui) # 寻找Dtk组件Gui + +add_executable(example1 # 添加可执行文件 + main.cpp +) + +target_link_libraries(example1 PRIVATE + Qt5::Widgets + Qt5::Gui + dtkgui + dtkcore + dtkwidget +) # 链接库 + +``` + +## main.cpp + +```cpp + +#include +#include +#include +#include +#include +DWIDGET_USE_NAMESPACE //使用DTK widget命名空间 + + +int main(int argc, char *argv[]){ + DApplication app(argc, argv); + DMainWindow win; + win.resize(400,250); + + DTitlebar *bar = win.titlebar(); //窗口会自带一个titlebar,直接调用 + DMenu *menu = bar->menu()->addMenu("文件"); //新建一个文件菜单,并用一个 menu 指针来接收这个菜单并管理 + bar->menu()->addSeparator(); //添加一个分隔符 + menu->addAction("新建"); //menu菜单下添加可选项 “新建” + menu->addAction("打开"); + menu->addAction("关闭"); + menu->setIcon(menu->style()->standardIcon(DStyle::SP_DirIcon)); //给文件菜单添加一个自带图标 + + bar->setQuitMenuDisabled(true); //设置退出菜单为不可用 + bar->setSwitchThemeMenuVisible(false); //设置主题更换菜单为不可见 + + win.show(); + return app.exec(); +} + +``` + +以上代码运行效果如下图所示: + +![dtitlebar_example2](/docs/images/dtitlebar_example2.png) + +从代码中我们可以看出,对不需要的功能项进行了 setQuitMenuDisabled 和 setSwitchThemeMenuVisible 操作,对比图dtitlebar_example1和dtitlebar_example2 +我们发现图dtitlebar_example2中主题切换菜单不见了,而退出选项还有,只是不能点击,它们适用于不同的场景,可以根据具体场景进行选择 + +有些情况下,例如安装重要组件时,中途退出可能导致很多麻烦,为了放置用户误操作,我们可能连关闭按钮都不希望用户点击,这时可以对窗口进行设置,使用如下代码: + +```cpp + +win.setWindowFlags(Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); + +``` + +以上代码是设置窗口titlebar上哪些按钮会显示,添加进去的会显示,不添加则不显示。上述代码添加了最小化最大化窗口按钮,没有添加窗口关闭按钮,所以窗口关闭按钮不显示,效果如下: + +![dtitlebar_example3](/docs/images/dtitlebar_example3.png) + +对菜单中的选项添加对应的连接和代码实现就能实现不同的功能响应了。 + +@fn Dtk::Widget::DTitlebar::DTitlebar(QWidget *parent) +@brief 构造函数,创建一个DTitlebar对象,包含默认的窗口按钮. +@param[in] parent 父控件指针 + +@fn QMenu Dtk::Widget::DTitlebar::menu() +@brief 获取和标题栏关联的应用查询菜单 +@return 如该标题栏没有设置菜单,这里会返回空,但是如该使用 Dtk::Widget::DApplication , +那么这里一般会自动创建一个程序菜单 + +@fn void Dtk::Widget::DTitlebar::setMenu(QMenu *menu) +@brief 设置自定义的程序菜单 +@param[in] menu 需要被设置的菜单 + +@fn QWidget *Dtk::Widget::DTitlebar::customWidget() const +@brief 标题栏绑定的自定义控件,可以通过自定义控件来在标题栏上显示复杂的组合控件 +@return 自定义控件 +@param[in] Dtk::Widget::DTitlebar::setCustomWidget() + +@fn void Dtk::Widget::DTitlebar::showMenu() +@brief 弹出应用程序菜单,设置标题栏上的自定义控件. +@param[in] w 需要显示的控件。 +@param[in] fixCenterPos 是否需要自动修正控件位置,用于保持控件居中显示。 + +@fn void Dtk::Widget::DTitlebar::setFixedHeight(int h) +@brief 设置标题栏的高度,默认高度为 50。 +@param[in] h 需要设置的高度 + +@fn void Dtk::Widget::DTitlebar::setBackgroundTransparent(bool transparent) +@brief 设置标题栏背景是否透明,当为透明时标题栏直接叠加在下层控件上. +@param[in] transparent 是否透明 + +@fn void Dtk::Widget::DTitlebar::setSeparatorVisible(bool visible) +@brief 设置菜单下面的分隔线是否可见,默认是可见的 +@param[in] visible 是否可见 + +@fn void Dtk::Widget::DTitlebar::setTitle(const QString &title) +@brief 设置标题栏文本。 +@param[in] title 待设置内容 + +@fn void Dtk::Widget::DTitlebar::setIcon(const QIcon &icon) +@brief 设置标题栏图标 +@param[in] icon 待设置的图标 + +@fn int Dtk::Widget::DTitlebar::buttonAreaWidth() const +@brief 按钮区域大小,用于手动定位自定义控件时使用 + +@fn bool Dtk::Widget::DTitlebar::separatorVisible() const +@brief 分隔线是否可见 + +@fn bool Dtk::Widget::DTitlebar::autoHideOnFullscreen() const +@brief 全屏模式下标题栏是否自动隐藏 + +@fn void Dtk::Widget::DTitlebar::setAutoHideOnFullscreen(bool autohide) +@brief 设置全屏模式下是否需要自动隐藏标题栏 +@param[in] autohide 是否自动隐藏 + +@fn void Dtk::Widget::DTitlebar::setEmbedMode(bool visible) +@brief 设置为嵌入模式,而不是替换系统标题栏,用于不支持dxcb的平台 +@param[in] visible 为 true 时,替换系统标题栏,否则隐藏系统标题栏 + +@fn bool Dtk::Widget::DTitlebar::menuIsVisible() const +@brief 菜单按钮的可视化 +@return true 菜单可见 false菜单不可见 + +@fn void Dtk::Widget::DTitlebar::setMenuVisible(bool visible) +@brief 设置菜单是否可见 +@param[in] visible true 菜单可见 false菜单不可见 + +@fn void Dtk::Widget::DTitlebar::setMenuDisabled(bool disabled) +@brief 菜单是否被禁用 +@return true 菜单被禁用 false 菜单没有被禁用 + +@fn bool Dtk::Widget::DTitlebar::quitMenuIsDisabled() const +@brief 退出菜单是否被禁用 +@return true 退出菜单被禁用 false退出菜单没有被禁用 + +@fn void Dtk::Widget::DTitlebar::setQuitMenuDisabled(bool disabled) +@brief 设置退出菜单是否被禁用 +@param[in] disabled true 退出菜单被禁用 false退出菜单没有被禁用 + +@fn void Dtk::Widget::DTitlebar::setQuitMenuVisible(bool visible) +@brief 设置退出菜单是否可见 +@param[in] visible true 退出菜单可见 false退出菜单不可见 + +@fn bool Dtk::Widget::DTitlebar::switchThemeMenuIsVisible() const +@brief 设置主题切换菜单的可视化 +@return true 切换主题菜单可见 false切换主题菜单不可见 + +@fn void Dtk::Widget::DTitlebar::setSwitchThemeMenuVisible(bool visible) +@brief 设置切换主题菜单是否可见 +@param[in] visible true 切换主题菜单可见 false 切换主题菜单不可见 + +@fn void Dtk::Widget::DTitlebar::setDisableFlags(Qt::WindowFlags flags) +@brief 设置需要被禁用的按钮,仅仅是在界面上禁用按钮,还是可以通过事件等机制来调用对应接口 +@param[in] flags 需要被禁用的按钮标志位 + +@fn Qt::WindowFlags Dtk::Widget::DTitlebar::disableFlags() const +@brief 当前被禁用的按钮标志位 +@return 被禁用的窗口标志 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dtoolbutton.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dtoolbutton.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dtoolbutton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dtoolbutton.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dtoolbutton.h +@ingroup button +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dtooltip.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dtooltip.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dtooltip.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dtooltip.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dtooltip.h +@ingroup tooltip +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dwarningbutton.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dwarningbutton.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dwarningbutton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dwarningbutton.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dwarningbutton.h +@ingroup button +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dwatermarkhelper.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dwatermarkhelper.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dwatermarkhelper.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dwatermarkhelper.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,25 @@ +/*! +@~chinese +@file dwatermarkhelper.h + +@class Dtk::Widget::DWaterMaskHelper +@inmodule dtkwidget +@brief 不允许直接实例化此对象 +@param[in] parent +@sa DWaterMaskHelper::instance + +@fn DWaterMarkHelper::instance +@brief DWaterMarkHelper 的单例对象,使用 Q_GLOBAL_STATIC 定义,在第一次调用时实例化。 + +@fn void DWaterMarkHelper::registerWidget(QWidget *widget) +@brief 为指定窗口添加水印 +@param[in] widget 要添加水印的窗口 + +@property WaterMarkData DWaterMarkHelper::data() const +@brief 当前设置的水印信息 + +@fn void DWaterMarkHelper::setData(const WaterMarkData &data) +@brief 设置当前水印信息 +@param[in] data 需要设置的水印信息 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dwatermarkwidget.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dwatermarkwidget.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dwatermarkwidget.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dwatermarkwidget.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,108 @@ +/*! +@~chinese +@file dwatermarkwidget.h + +@class Dtk::Widget::WaterMarkData +@inmodule dtkwidget +@brief 水印信息结构 +@param[in] parent + +@property const Dtk::Widget::WaterMarkData::WaterMarkType &WaterMarkData::type() +@brief 当前设置的水印类型 + +@fn void Dtk::Widget::WaterMarkData::setType(WaterMarkType type) +@brief 设置当前水印的类型 +@param[in] type 需要设置的水印类型 + +@property const Dtk::Widget::WaterMarkData::WaterMarkLayout &WaterMarkData::layout() +@brief 当前设置的水印布局类型 + +@fn void WaterMarkData::setLayout(WaterMarkLayout layout) +@brief 设置的水印布局类型 +@param[in] layout 需要设置的水印布局类型 + +@property qreal WaterMarkData::scaleFactor() +@brief 当前设置的水印整体缩放系数 + +@fn void WaterMarkData::setScaleFactor(qreal scaleFactor) +@brief 设置当前水印的整体缩放系数 +@param[in] scaleFactor 需要设置的水印整体缩放系数 + +@property int WaterMarkData::spacing() +@brief 当前设置的水印间距 + +@fn void WaterMarkData::setSpacing(int spacing) +@brief 设置当前水印的间距 +@param[in] spacing 需要设置的水印的间距 + +@property int WaterMarkData::lineSpacing() +@brief 当前设置的水印行间距 + +@fn void WaterMarkData::setLineSpacing(int lineSpacing) +@brief 设置当前水印的行间距 +@param[in] lineSpacing 需要设置的水印行间距 + +@property const QString &WaterMarkData::text() +@brief 当前设置的水印文本内容 + +@fn void WaterMarkData::setText(const QString &text) +@brief 设置当前水印的文本内容 +@param[in] text 需要设置的水印文本内容 + +@property const QFont &WaterMarkData::font() +@brief 当前设置的水印字体 + +@fn void WaterMarkData::setFont(const QFont &font) +@brief 设置当前水印的字体 +@param[in] font 需要设置的水印字体 + +@property const QColor &WaterMarkData::color() +@brief 当前设置的水印颜色 + +@fn void WaterMarkData::setColor(const QColor &color) +@brief 设置当前水印的颜色 +@param[in] color 需要设置的水印颜色 + +@property qreal WaterMarkData::rotation() +@brief 当前设置的水印旋转角度(0~360) + +@fn void WaterMarkData::setRotation(qreal rotation) +@brief 设置当前水印的旋转角度(0~360) +@param[in] rotation 需要设置的水印旋转角度 + +@property qreal WaterMarkData::opacity() +@brief 当前设置的水印透明度(0~1.0) + +@fn void WaterMarkData::setOpacity(qreal opacity) +@brief 设置当前水印透明度(0~1.0) +@param[in] opacity 需要设置的水印透明度 + +@property const QImage &WaterMarkData::image() +@brief 当前设置的水印图片 + +@fn void WaterMarkData::setImage(const QImage &image) +@brief 设置当前水印图片 +@param[in] 需要设置的水印图片 + +@property bool WaterMarkData::grayScale() +@brief 当前设置的水印图片是否需要灰度化 + +@fn void WaterMarkData::setGrayScale(bool grayScale) +@brief 设置当前水印图片是否需要灰度化,默认为true +@param[in] grayScale 设置当前水印图片是否需要灰度化 + + + +@class Dtk::Widget::DWaterMarkWidget +@inmodule dtkwidget +@brief 水印类,将覆盖设置的父界面,并跟随父界面动态调整大小 +@param[in] parent + +@property const WaterMarkData &DWaterMarkWidget::data() +@brief 当前设置的水印信息 + +@fn void DWaterMarkWidget::setData(const WaterMarkData &data) +@brief 设置当前水印信息 +@param[in] data 需要设置的水印信息 + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dwaterprogress.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dwaterprogress.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dwaterprogress.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dwaterprogress.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +/*! +@~chinese +@file dwaterprogress.h +@ingroup progressbar +@class +@brief +@details + +TODO: 添加类简介、示例代码、示例截图和函数使用说明等 + + +*/ diff -Nru dtkwidget-5.5.48/docs/widgets/dwindowoptionbutton.zh_CN.dox dtkwidget-5.6.12/docs/widgets/dwindowoptionbutton.zh_CN.dox --- dtkwidget-5.5.48/docs/widgets/dwindowoptionbutton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/dwindowoptionbutton.zh_CN.dox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,24 @@ +/*! +@~chinese +@file dwindowoptionbutton.h +@ingroup dtkwidget + +@class Dtk::Widget::DWindowOptionButton +@brief DWindowOptionButton 类是 DTK 窗口统一的菜单按钮控件 + +@details 它实际上是一个特殊的DImageButton,它有着选项按钮的外观点击按钮后, +默认会显示程序主菜单,包含“关于”、“帮助”等项。 + +*/ + +/*! +@~chinese +@file dwindowoptionbutton.h +@ingroup dtkwidget + +@fn DWindowOptionButton::DWindowOptionButton(QWidget * parent) +@brief DWindowOptionButton::DWindowOptionButton 是 DWindowOptionButton 的构造 +函数,返回 DWindowOptionButton 对象,普通程序一般无需使用。 +'parent 为创建对象的父控件' +*/ + diff -Nru dtkwidget-5.5.48/docs/widgets/index.zh_CN.md dtkwidget-5.6.12/docs/widgets/index.zh_CN.md --- dtkwidget-5.5.48/docs/widgets/index.zh_CN.md 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/docs/widgets/index.zh_CN.md 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,46 @@ +# DLog + +@mainpage + +## dtkwidget:dtk挂件 + +TODO:添加使用说明 + +@defgroup dtkwidget +@brief 统信开发套件 widget 模块 + +@defgroup dsettings +@brief 设置模块,提供设置、设置加载、设置窗口等功能和工具 + +@defgroup button +@brief 按钮模块,提供各式各样的按钮 + +@defgroup edit +@brief 编辑模块,提供各种用于输入的具有不同功能的控件 + +@defgroup slider +@brief 滑块模块 提供可用于设定数值的滑块 + +@defgroup listview +@brief 列表显示模块,提供各种可容纳列表以及其显示、编辑的控件 + +@defgroup window +@brief 窗口模块,提供各种容纳不同控件和内容的用于显示的窗口 + +@defgroup tooltip +@brief 提示模块,提供各种用于提示的控件 + +@defgroup spinner +@brief 等待提示模块,提供用于提示用户等待又不知具体时间的控件 + +@defgroup dialog +@brief 对话框模块,提供各种对话框 + +@defgroup progressbar +@brief 进度条模块,提供各式各样的进度条 + +@defgroup layout +@brief 布局模块,提供可用于布局的控件 + +@defgroup imageviewer +@brief 图片查看模块,提供可用于浏览图片的控件 diff -Nru dtkwidget-5.5.48/dtkwidget.pro dtkwidget-5.6.12/dtkwidget.pro --- dtkwidget-5.5.48/dtkwidget.pro 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/dtkwidget.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -load(dtk_lib) - diff -Nru dtkwidget-5.5.48/examples/CMakeLists.txt dtkwidget-5.6.12/examples/CMakeLists.txt --- dtkwidget-5.5.48/examples/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +add_subdirectory(collections) +add_subdirectory(PrintPreviewSettingsPlugin) diff -Nru dtkwidget-5.5.48/examples/collections/buttonexample.cpp dtkwidget-5.6.12/examples/collections/buttonexample.cpp --- dtkwidget-5.5.48/examples/collections/buttonexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/buttonexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,1041 @@ +// SPDX-FileCopyrightText: 2020 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "buttonexample.h" + +DWIDGET_USE_NAMESPACE + +ButtonExampleWindow::ButtonExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DPushButtonExample(this)); + addExampleWindow(new DWarningButtonExample(this)); + addExampleWindow(new DSuggestButtonExample(this)); + addExampleWindow(new DToolButtonExample(this)); + addExampleWindow(new DIconButtonExample(this)); + addExampleWindow(new DButtonBoxExample(this)); + addExampleWindow(new DFloatingButtonExample(this)); + addExampleWindow(new DSwitchButtonExample(this)); + addExampleWindow(new DRadioButtonExample(this)); + addExampleWindow(new DCheckButtonExample(this)); + addExampleWindow(new DComboBoxExample(this)); + addExampleWindow(new DFontComboBoxExample(this)); + addExampleWindow(new DSearchComboBoxExample(this)); +} + +DPushButtonExample::DPushButtonExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; + QHBoxLayout *pHBoxLayout_2 = new QHBoxLayout; + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + + setLayout(pVBoxLayout); + pVBoxLayout->addStretch(); + pVBoxLayout->addLayout(pHBoxLayout_1); + pVBoxLayout->addSpacing(20); + pVBoxLayout->addLayout(pHBoxLayout_2); + pVBoxLayout->addStretch(); + + DPushButton *pButtonNormal = new DPushButton("button normal", this); + pButtonNormal->setFixedWidth(200); + + DPushButton *pButtonDisabled = new DPushButton("button disabled", this); + pButtonDisabled->setFixedSize(DSizeModeHelper::element(QSize(200, 24), QSize(200, 36))); + // connect `sizeModeChanged()` signal to update Size. + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, [pButtonDisabled](DGuiApplicationHelper::SizeMode mode) { + pButtonDisabled->setFixedSize(DSizeModeHelper::element(QSize(200, 24), QSize(200, 36))); + }); + pButtonDisabled->setEnabled(false); + + pHBoxLayout_1->addStretch(); + pHBoxLayout_1->addWidget(pButtonNormal); + pHBoxLayout_1->addSpacing(20); + pHBoxLayout_1->addWidget(pButtonDisabled); + pHBoxLayout_1->addStretch(); + + DPushButton *pPushButton = new DPushButton("push button", this); + pPushButton->setFixedWidth(200); + pPushButton->setCheckable(true); + + QMenu *pMenu = new QMenu(this); + pMenu->addAction("item_1"); + pMenu->addAction("item_2"); + pMenu->addAction("item_3"); + + pPushButton->setMenu(pMenu); + + DPushButton *pPushButtonDisabled = new DPushButton("push button", this); + pPushButtonDisabled->setFixedWidth(200); + pPushButtonDisabled->setEnabled(false); + pPushButtonDisabled->setMenu(pMenu); + + pHBoxLayout_2->addStretch(); + pHBoxLayout_2->addWidget(pPushButton); + pHBoxLayout_2->addSpacing(20); + pHBoxLayout_2->addWidget(pPushButtonDisabled); + pHBoxLayout_2->addStretch(); + + connect(pButtonNormal, &DPushButton::clicked, this, [] { + DDialog dialog("", "名称push button已经被占用,请使用其他名称", nullptr); + dialog.setIcon(DStyle().standardIcon(DStyle::SP_MessageBoxWarning)); + dialog.addButton("确定"); + dialog.exec(); + }); +} + +QString DPushButtonExample::getTitleName() const +{ + return "DPushButton"; +} + +QString DPushButtonExample::getDescriptionInfo() const +{ + return "普通的文字按钮和带菜单的文字按钮\n" + "按钮的文字随着菜单的选择而改变"; +} + +int DPushButtonExample::getFixedHeight() const +{ + return 402; +} + +DWarningButtonExample::DWarningButtonExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + + setLayout(pVBoxLayout); + pVBoxLayout->addSpacing(40); + pVBoxLayout->addLayout(pHBoxLayout_1); + pVBoxLayout->addStretch(); + + DWarningButton *pWarningButton = new DWarningButton(this); + pWarningButton->setText("warning"); + pWarningButton->setFixedWidth(200); + + DWarningButton *pWarningButtonDisabled = new DWarningButton(this); + pWarningButtonDisabled->setText("warning disabled"); + pWarningButtonDisabled->setEnabled(false); + pWarningButtonDisabled->setFixedWidth(200); + + pHBoxLayout_1->addStretch(); + pHBoxLayout_1->addWidget(pWarningButton); + pHBoxLayout_1->addSpacing(20); + pHBoxLayout_1->addWidget(pWarningButtonDisabled); + pHBoxLayout_1->addStretch(); + + connect(pWarningButton, &DWarningButton::clicked, this, [] { + DDialog dialog("", "格式化操作会清空该磁盘数据,您需要继续吗?\n此操作不可以恢复", nullptr); + dialog.setIcon(DStyle().standardIcon(DStyle::SP_DriveNetIcon)); + dialog.addButton("取消"); + dialog.addButton("格式化"); + dialog.exec(); + }); +} + +QString DWarningButtonExample::getTitleName() const +{ + return "DWarningButton"; +} + +QString DWarningButtonExample::getDescriptionInfo() const +{ + return "功能和普通的文字按钮一致,不过用在\n" + "警告语上,告诉用户有危险操作."; +} + +int DWarningButtonExample::getFixedHeight() const +{ + return 368; +} + +DSuggestButtonExample::DSuggestButtonExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; + QHBoxLayout *pHBoxLayout_2 = new QHBoxLayout; + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + + setLayout(pVBoxLayout); + pVBoxLayout->addStretch(); + pVBoxLayout->addLayout(pHBoxLayout_1); + pVBoxLayout->addSpacing(20); + pVBoxLayout->addLayout(pHBoxLayout_2); + pVBoxLayout->addStretch(); + + DSuggestButton *pRecommend = new DSuggestButton("recommend", this); + pRecommend->setFixedWidth(200); + + DPushButton *pRecommendDisabled = new DPushButton("recommend disabled", this); + pRecommendDisabled->setFixedWidth(200); + pRecommendDisabled->setEnabled(false); + + pHBoxLayout_1->addStretch(); + pHBoxLayout_1->addWidget(pRecommend); + pHBoxLayout_1->addSpacing(20); + pHBoxLayout_1->addWidget(pRecommendDisabled); + pHBoxLayout_1->addStretch(); + + DSuggestButton *pHighlight = new DSuggestButton("highlight", this); + pHighlight->setFixedWidth(200); + pHighlight->setCheckable(true); + pHighlight->setFocus(); + + DPushButton *pHighlightDisabled = new DPushButton("highlight disabled", this); + pHighlightDisabled->setFixedWidth(200); + pHighlightDisabled->setEnabled(false); + + pHBoxLayout_2->addStretch(); + pHBoxLayout_2->addWidget(pHighlight); + pHBoxLayout_2->addSpacing(20); + pHBoxLayout_2->addWidget(pHighlightDisabled); + pHBoxLayout_2->addStretch(); + + connect(pRecommend, &DPushButton::clicked, this, [] { + DDialog dialog("", "这里现实简要出错信息XXXXXXXX", nullptr); + dialog.setIcon(DStyle().standardIcon(DStyle::SP_MessageBoxWarning)); + dialog.addButton("显示详情"); + dialog.addButton("确定"); + dialog.exec(); + }); +} + +QString DSuggestButtonExample::getTitleName() const +{ + return "DSuggestButton"; +} + +QString DSuggestButtonExample::getDescriptionInfo() const +{ + return "往往不会单独出现,绝大多数情况都是\n" + "和DPushButton一起出现,显示在\n" + "DPushButton的右边,主要是起引导用\n" + "户点击的作用."; +} + +int DSuggestButtonExample::getFixedHeight() const +{ + return 300; +} + +DToolButtonExample::DToolButtonExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout = new QHBoxLayout; + pHBoxLayout->setMargin(20); + pHBoxLayout->setSpacing(0); + + auto showDialog = [](const QString &info) { + DDialog dialog("", info, nullptr); + dialog.setIcon(DStyle().standardIcon(DStyle::SP_MessageBoxInformation)); + dialog.addButton("确定"); + dialog.exec(); + }; + + DToolBar *pToolBar = new DToolBar; + pToolBar->addAction(QIcon::fromTheme("icon_button"), "", this, [showDialog] { + showDialog("这是icon_button的图标"); + }); + + pToolBar->addAction(QIcon::fromTheme("icon_edit"), "", this, [showDialog] { + showDialog("这是icon_edit的图标"); + }); + + pToolBar->addAction(QIcon::fromTheme("icon_slider"), "", this, [showDialog] { + showDialog("这是icon_slider的图标"); + }); + + pToolBar->addAction(QIcon::fromTheme("icon_ListView"), "", this, [showDialog] { + showDialog("这是icon_ListView的图标"); + }); + + pToolBar->addAction(QIcon::fromTheme("icon_Window"), "", this, [showDialog] { + showDialog("这是icon_Window的图标"); + }); + + pToolBar->addAction(QIcon::fromTheme("icon_Tooltip"), "", this, [showDialog] { + showDialog("这是icon_Tooltip的图标"); + }); + + pToolBar->addAction(QIcon::fromTheme("icon_Dialog"), "", this, [] { + DDialog dialog("各种类型的ToolButton", "", nullptr); + dialog.setIcon(DStyle().standardIcon(DStyle::SP_MessageBoxInformation)); + auto toolBar = new DToolBar; + toolBar->addAction(QIcon::fromTheme("icon_button"), ""); + toolBar->addAction("文字"); + toolBar->addAction("长文字123456"); + { + auto action = toolBar->addAction("含菜单"); + auto menu = new QMenu(); + menu->addAction("Menu1"); + action->setMenu(menu); + } + { + auto action = toolBar->addAction(QIcon::fromTheme("icon_button"), ""); + auto menu = new QMenu(); + menu->addAction("Menu1"); + action->setMenu(menu); + } + { + auto action = toolBar->addAction(QIcon::fromTheme("icon_button"), "图标和文字"); + if (auto widget = qobject_cast(toolBar->widgetForAction(action))) + widget->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + } + dialog.addContent(toolBar); + dialog.exec(); + }); + + + pHBoxLayout->addWidget(pToolBar); + + pVBoxLayout->addSpacing(20); + pVBoxLayout->addLayout(pHBoxLayout); + pHBoxLayout->addSpacing(30); + + QLabel *pLabel = new QLabel; + QPixmap pix(":/images/example/DToolButton.png"); + pLabel->setFixedSize(570, 348); + pLabel->setPixmap(pix); + pLabel->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; + pHBoxLayout_pic->setMargin(0); + pHBoxLayout_pic->setSpacing(0); + pHBoxLayout_pic->addWidget(pLabel); + + pVBoxLayout->addLayout(pHBoxLayout_pic); +} + +QString DToolButtonExample::getTitleName() const +{ + return "DToolButton"; +} + +QString DToolButtonExample::getDescriptionInfo() const +{ + return "主要用在工具栏上作为应用的功能按\n" + "钮,比如画板左侧的工具栏图标."; +} + +int DToolButtonExample::getFixedHeight() const +{ + return 600; +} + +DIconButtonExample::DIconButtonExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout = new QHBoxLayout; + pHBoxLayout->setMargin(10); + pHBoxLayout->setSpacing(0); + + DIconButton *pButton_1 = new DIconButton(DStyle::SP_IncreaseElement, this); + pButton_1->setNewNotification(true); + + DIconButton *pButton_2 = new DIconButton(DStyle::SP_ArrowEnter, this); + + DIconButton *pButton_3 = new DIconButton(DStyle::SP_IncreaseElement, this); + pButton_3->setEnabled(false); + + DIconButton *pButton_4 = new DIconButton(DStyle::SP_ArrowEnter, this); + pButton_4->setEnabled(false); + + DIconButton *pButton_5 = new DIconButton(DStyle::SP_DeleteButton, this); + pButton_5->setFlat(true); + pButton_5->setIconSize(QSize(16, 16)); + DStyle::setFocusRectVisible(pButton_5, false); + + DIconButton *pButton_6 = new DIconButton(DStyle::SP_AddButton, this); + pButton_6->setFlat(true); + pButton_6->setIconSize(QSize(16, 16)); + DStyle::setFocusRectVisible(pButton_6, false); + + DIconButton *pButton_7 = new DIconButton(DStyle::SP_DeleteButton, this); + pButton_7->setEnabled(false); + pButton_7->setFlat(true); + pButton_7->setIconSize(QSize(16, 16)); + DStyle::setFocusRectVisible(pButton_7, false); + + DIconButton *pButton_8 = new DIconButton(DStyle::SP_AddButton, this); + pButton_8->setEnabled(false); + pButton_8->setFlat(true); + pButton_8->setIconSize(QSize(16, 16)); + DStyle::setFocusRectVisible(pButton_8, false); + + auto updateButtonSize = [](QWidget *widget, int mode) { + for (auto button : widget->findChildren(QString(), Qt::FindDirectChildrenOnly)) { + if (button->iconSize() == QSize(16, 16)) { + button->setFixedSize(DSizeModeHelper::element(QSize(20, 20), QSize(24, 24))); + } else { + button->setFixedSize(DSizeModeHelper::element(QSize(24, 24), QSize(36, 36))); + } + } + }; + updateButtonSize(this, DGuiApplicationHelper::instance()->sizeMode()); + // connect `sizeModeChanged` signal for a control Widget to update size. + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, [updateButtonSize, this](int mode) { + updateButtonSize(this, mode); + }); + + pHBoxLayout->addStretch(); + pHBoxLayout->addWidget(pButton_1); + pHBoxLayout->addSpacing(10); + pHBoxLayout->addWidget(pButton_2); + pHBoxLayout->addSpacing(50); + pHBoxLayout->addWidget(pButton_3); + pHBoxLayout->addSpacing(10); + pHBoxLayout->addWidget(pButton_4); + + pHBoxLayout->addSpacing(100); + pHBoxLayout->addWidget(pButton_5); + pHBoxLayout->addSpacing(10); + pHBoxLayout->addWidget(pButton_6); + pHBoxLayout->addSpacing(50); + pHBoxLayout->addWidget(pButton_7); + pHBoxLayout->addSpacing(10); + pHBoxLayout->addWidget(pButton_8); + pHBoxLayout->addStretch(); + + pVBoxLayout->addSpacing(20); + pVBoxLayout->addLayout(pHBoxLayout); + pHBoxLayout->addSpacing(20); + + QLabel *pLabel = new QLabel; + QPixmap pix(":/images/example/DIconButton.png"); + pLabel->setFixedSize(568, 444); + pLabel->setPixmap(pix); + pLabel->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; + pHBoxLayout_pic->setMargin(0); + pHBoxLayout_pic->setSpacing(0); + pHBoxLayout_pic->addWidget(pLabel); + + pVBoxLayout->addLayout(pHBoxLayout_pic); +} + +QString DIconButtonExample::getTitleName() const +{ + return "DIconButton"; +} + +QString DIconButtonExample::getDescriptionInfo() const +{ + return "性质和DPushButton一致,只不过是用\n" + "图形化代替文字,最常见的有新建,上\n" + "一个下一个等."; +} + +int DIconButtonExample::getFixedHeight() const +{ + return 600; +} + +DButtonBoxExample::DButtonBoxExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout = new QHBoxLayout; + pHBoxLayout->setMargin(10); + pHBoxLayout->setSpacing(0); + + DButtonBox *pButtonBox_1 = new DButtonBox; + + DButtonBoxButton *pButton_1 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_ArrowLeave)); + + DButtonBoxButton *pButton_2 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_ArrowEnter)); + + pButtonBox_1->setButtonList(QList() << pButton_1 << pButton_2, true); + + DButtonBox *pButtonBox_2 = new DButtonBox; + DButtonBoxButton *pButton_3 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_ArrowLeave)); + pButton_3->setEnabled(false); + + DButtonBoxButton *pButton_4 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_ArrowEnter)); + pButton_4->setEnabled(false); + + pButtonBox_2->setButtonList(QList() << pButton_3 << pButton_4, true); + + DButtonBox *pButtonBox_3 = new DButtonBox; + DButtonBoxButton *pButton_5 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_LockElement), "锁定设置"); + pButton_3->setEnabled(false); + + DButtonBoxButton *pButton_6 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_UnlockElement), "解锁设置"); + pButton_4->setEnabled(false); + + pButtonBox_3->setButtonList(QList() << pButton_5 << pButton_6, true); + + pHBoxLayout->addStretch(); + pHBoxLayout->addWidget(pButtonBox_1); + pHBoxLayout->addSpacing(10); + pHBoxLayout->addWidget(pButtonBox_2); + pHBoxLayout->addSpacing(50); + pHBoxLayout->addWidget(pButtonBox_3); + pHBoxLayout->addStretch(); + + pVBoxLayout->addSpacing(20); + pVBoxLayout->addLayout(pHBoxLayout); + pHBoxLayout->addSpacing(20); + + QLabel *pLabel = new QLabel; + QPixmap pix(":/images/example/DButtonBox.png"); + pLabel->setFixedSize(570, 426); + pLabel->setPixmap(pix); + pLabel->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; + pHBoxLayout_pic->setMargin(0); + pHBoxLayout_pic->setSpacing(0); + pHBoxLayout_pic->addWidget(pLabel); + + pVBoxLayout->addLayout(pHBoxLayout_pic); + + updateButtonsSize(); +} + +QString DButtonBoxExample::getTitleName() const +{ + return "DButtonBox"; +} + +QString DButtonBoxExample::getDescriptionInfo() const +{ + return "群组按钮,几个连体按钮选项是为了一\n" + "个共同的功能服务,比如日历的切换视\n" + "图,还有常见的文字选项如加粗下划线\n" + "中横线等."; +} + +int DButtonBoxExample::getFixedHeight() const +{ + return 600; +} + +void DButtonBoxExample::changeEvent(QEvent *event) +{ + // override `event()` to update Size. + if (event->type() == QEvent::StyleChange) { + updateButtonsSize(); + } + return ExampleWindowInterface::changeEvent(event); +} + +void DButtonBoxExample::updateButtonsSize() +{ + for (auto button : findChildren()) { + if (button->text().isEmpty()) { + button->setFixedSize(DSizeModeHelper::element(QSize(24, 24), QSize(36, 36))); + } else { + button->setFixedHeight(DSizeModeHelper::element(24, 36)); + } + } +} + +DFloatingButtonExample::DFloatingButtonExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout = new QHBoxLayout; + pHBoxLayout->setMargin(10); + pHBoxLayout->setSpacing(0); + + DFloatingButton *pFloatingButton_1 = new DFloatingButton(DStyle::SP_IncreaseElement, this); + + DFloatingButton *pFloatingButton_2 = new DFloatingButton(DStyle::SP_IncreaseElement, this); + pFloatingButton_2->setEnabled(false); + + pHBoxLayout->addStretch(); + pHBoxLayout->addWidget(pFloatingButton_1); + pHBoxLayout->addSpacing(50); + pHBoxLayout->addWidget(pFloatingButton_2); + pHBoxLayout->addStretch(); + + pVBoxLayout->addSpacing(20); + pVBoxLayout->addLayout(pHBoxLayout); + + QLabel *pLabel = new QLabel; + QPixmap pix(":/images/example/DFloatingButton.png"); + pLabel->setFixedSize(568, 444); + pLabel->setPixmap(pix); + pLabel->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; + pHBoxLayout_pic->setMargin(0); + pHBoxLayout_pic->setSpacing(0); + pHBoxLayout_pic->addWidget(pLabel); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_pic); + pVBoxLayout->addSpacing(20); +} + +QString DFloatingButtonExample::getTitleName() const +{ + return "DFloatingButton"; +} + +QString DFloatingButtonExample::getDescriptionInfo() const +{ + return "在一个场景中作为一个主要功能使用,\n" + "比如控制中心账户列表中作为添加账户\n" + "使用.这个按钮是悬浮的,不占据底下\n" + "内容的空间."; +} + +int DFloatingButtonExample::getFixedHeight() const +{ + return 600; +} + +DSwitchButtonExample::DSwitchButtonExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout = new QHBoxLayout; + pHBoxLayout->setMargin(0); + pHBoxLayout->setSpacing(0); + + DSwitchButton *pSwitchButton_1 = new DSwitchButton; + + DSwitchButton *pSwitchButton_2 = new DSwitchButton; + pSwitchButton_2->setEnabled(false); + + pHBoxLayout->addStretch(); + pHBoxLayout->addWidget(pSwitchButton_1); + pHBoxLayout->addSpacing(30); + pHBoxLayout->addWidget(pSwitchButton_2); + pHBoxLayout->addStretch(); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout); + + QLabel *pLabel = new QLabel; + QPixmap pix(":/images/example/DSwitchButton.png"); + pLabel->setFixedSize(568, 444); + pLabel->setPixmap(pix); + pLabel->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; + pHBoxLayout_pic->setMargin(0); + pHBoxLayout_pic->setSpacing(0); + pHBoxLayout_pic->addWidget(pLabel); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_pic); + pVBoxLayout->addSpacing(20); +} + +QString DSwitchButtonExample::getTitleName() const +{ + return "DSwitchButton"; +} + +QString DSwitchButtonExample::getDescriptionInfo() const +{ + return "普通的开关控件,等价控件为\n" + "DCheckButton"; +} + +int DSwitchButtonExample::getFixedHeight() const +{ + return 600; +} + +DRadioButtonExample::DRadioButtonExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout = new QHBoxLayout; + pHBoxLayout->setMargin(0); + pHBoxLayout->setSpacing(0); + + DRadioButton *pRadioButton_1 = new DRadioButton; + //也可以不设置,默认是设置为互斥的 + pRadioButton_1->setAutoExclusive(true); + + DRadioButton *pRadioButton_2 = new DRadioButton; + pRadioButton_2->setAutoExclusive(true); + + pHBoxLayout->addStretch(); + pHBoxLayout->addWidget(pRadioButton_1); + pHBoxLayout->addSpacing(30); + pHBoxLayout->addWidget(pRadioButton_2); + pHBoxLayout->addStretch(); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout); + + QLabel *pLabel = new QLabel; + QPixmap pix(":/images/example/DRadioButton.png"); + pLabel->setFixedSize(568, 444); + pLabel->setPixmap(pix); + pLabel->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; + pHBoxLayout_pic->setMargin(0); + pHBoxLayout_pic->setSpacing(0); + pHBoxLayout_pic->addWidget(pLabel); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_pic); + pVBoxLayout->addSpacing(20); +} + +QString DRadioButtonExample::getTitleName() const +{ + return "DRadioButton"; +} + +QString DRadioButtonExample::getDescriptionInfo() const +{ + return "常见于设置或者对话框中作为一个选项\n" + "存在,至少提供2个或者多个选项,选\n" + "项之间是互斥的."; +} + +int DRadioButtonExample::getFixedHeight() const +{ + return 600; +} + +DCheckButtonExample::DCheckButtonExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout = new QHBoxLayout; + pHBoxLayout->setMargin(0); + pHBoxLayout->setSpacing(0); + + DCheckBox *pCheckBox_1 = new DCheckBox(""); + pCheckBox_1->setTristate(true); + pCheckBox_1->setCheckState(Qt::PartiallyChecked); + + DCheckBox *pCheckBox_2 = new DCheckBox(""); + + DCheckBox *pCheckBox_3 = new DCheckBox(""); + pCheckBox_3->setTristate(true); + pCheckBox_3->setCheckState(Qt::Unchecked); + pCheckBox_3->setEnabled(false); + + DCheckBox *pCheckBox_4 = new DCheckBox(""); + pCheckBox_4->setTristate(true); + pCheckBox_4->setCheckState(Qt::Checked); + pCheckBox_4->setEnabled(false); + + DCheckBox *pCheckBox_5 = new DCheckBox(""); + pCheckBox_5->setTristate(true); + pCheckBox_5->setCheckState(Qt::PartiallyChecked); + pCheckBox_5->setEnabled(false); + + pHBoxLayout->addStretch(); + pHBoxLayout->addWidget(pCheckBox_1); + pHBoxLayout->addSpacing(10); + pHBoxLayout->addWidget(pCheckBox_2); + pHBoxLayout->addSpacing(50); + pHBoxLayout->addWidget(pCheckBox_3); + pHBoxLayout->addSpacing(10); + pHBoxLayout->addWidget(pCheckBox_4); + pHBoxLayout->addSpacing(10); + pHBoxLayout->addWidget(pCheckBox_5); + pHBoxLayout->addStretch(); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout); + + QLabel *pLabel = new QLabel; + QPixmap pix(":/images/example/DCheckButton.png"); + pLabel->setFixedSize(568, 444); + pLabel->setPixmap(pix); + pLabel->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; + pHBoxLayout_pic->setMargin(0); + pHBoxLayout_pic->setSpacing(0); + pHBoxLayout_pic->addWidget(pLabel); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_pic); + pVBoxLayout->addSpacing(20); +} + +QString DCheckButtonExample::getTitleName() const +{ + return "DCheckButton"; +} + +QString DCheckButtonExample::getDescriptionInfo() const +{ + return "和DRadioButton一致,也常用于设\n" + "置和对话框的选项,但每个选项之间是\n" + "独立的,不会产生冲突.每个选项的等\n" + "价控件是DSwitchButton."; +} + +int DCheckButtonExample::getFixedHeight() const +{ + return 600; +} + +DComboBoxExample::DComboBoxExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; + pHBoxLayout_1->setMargin(0); + pHBoxLayout_1->setSpacing(0); + + DComboBox *pComboBox_1 = new DComboBox; + pComboBox_1->setFixedWidth(240); + for (int i = 0; i < 30; i++) { + pComboBox_1->addItem(QString("ComboBox button - %1").arg(i)); + } + pHBoxLayout_1->addWidget(pComboBox_1); + + QComboBox *pComboBox_1_count = new QComboBox(); + pComboBox_1_count->setFixedWidth(100); + pComboBox_1_count->addItem(QString::number(10)); + pComboBox_1_count->addItem(QString::number(20)); + pComboBox_1_count->addItem(QString::number(30)); + pComboBox_1_count->setCurrentIndex(pComboBox_1_count->count() - 1); + connect(pComboBox_1_count, static_cast(&QComboBox::currentIndexChanged), [pComboBox_1, pComboBox_1_count](int index){ + pComboBox_1->clear(); + for (int i = 0; i < pComboBox_1_count->itemText(index).toInt(); i++) { + pComboBox_1->addItem(QString("ComboBox button - %1").arg(i)); + } + }); + pHBoxLayout_1->addWidget(pComboBox_1_count); + + QHBoxLayout *pHBoxLayout_2 = new QHBoxLayout; + pHBoxLayout_2->setMargin(0); + pHBoxLayout_2->setSpacing(0); + DComboBox *pComboBox_2 = new DComboBox; + pComboBox_2->setFixedWidth(340); + pComboBox_2->addItem("/space"); + pHBoxLayout_2->addWidget(pComboBox_2); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_1); + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_2); + + QLabel *pLabel_1 = new QLabel; + QPixmap pix_1(":/images/example/DComboBox_1.png"); + pLabel_1->setFixedSize(568, 444); + pLabel_1->setPixmap(pix_1); + pLabel_1->setScaledContents(true); + + QLabel *pLabel_2 = new QLabel; + QPixmap pix_2(":/images/example/DComboBox_2.png"); + pLabel_2->setFixedSize(568, 444); + pLabel_2->setPixmap(pix_2); + pLabel_2->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; + pHBoxLayout_pic_1->setMargin(0); + pHBoxLayout_pic_1->setSpacing(0); + pHBoxLayout_pic_1->addWidget(pLabel_1); + + QHBoxLayout *pHBoxLayout_pic_2 = new QHBoxLayout; + pHBoxLayout_pic_2->setMargin(0); + pHBoxLayout_pic_2->setSpacing(0); + pHBoxLayout_pic_2->addWidget(pLabel_2); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_pic_1); + pVBoxLayout->addSpacing(20); + pVBoxLayout->addLayout(pHBoxLayout_pic_2); + pVBoxLayout->addSpacing(20); +} + +QString DComboBoxExample::getTitleName() const +{ + return "DComboBox"; +} + +QString DComboBoxExample::getDescriptionInfo() const +{ + return "作为一个选项存在,多数时候前面有标\n" + "题,但也有没有标题的情况.点击是出\n" + "现一个菜单,点击选项某一项菜单后菜\n" + "单收起,选项框上的文字显示菜单里激\n" + "活的那一项."; +} + +int DComboBoxExample::getFixedHeight() const +{ + return 1200; +} + +DFontComboBoxExample::DFontComboBoxExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; + pHBoxLayout_1->setMargin(0); + pHBoxLayout_1->setSpacing(0); + + DFontComboBox *pComboBox_1 = new DFontComboBox; + pComboBox_1->setFixedWidth(240); + connect(pComboBox_1, &DFontComboBox::currentFontChanged, [](const QFont &f){ + qDebug() << "selected font:" << f; + }); + pHBoxLayout_1->addWidget(pComboBox_1); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_1); + pVBoxLayout->addSpacing(30); + + QLabel *pLabel_1 = new QLabel; + QPixmap pix_1(":/images/example/DFontComboBox.png"); + pLabel_1->setFixedSize(568, 444); + pLabel_1->setPixmap(pix_1); + pLabel_1->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; + pHBoxLayout_pic_1->setMargin(0); + pHBoxLayout_pic_1->setSpacing(0); + pHBoxLayout_pic_1->addWidget(pLabel_1); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_pic_1); + pVBoxLayout->addSpacing(20); +} + +QString DFontComboBoxExample::getTitleName() const +{ + return "DFontComboBox"; +} + +QString DFontComboBoxExample::getDescriptionInfo() const +{ + return "和DComboBox其实是一个控件,但这\n" + "里仅用于字体的选择."; +} + +int DFontComboBoxExample::getFixedHeight() const +{ + return 700; +} + +DSearchComboBoxExample::DSearchComboBoxExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; + pHBoxLayout_1->setMargin(0); + pHBoxLayout_1->setSpacing(0); + + DSearchComboBox *pComboBox_1 = new DSearchComboBox(this); + pComboBox_1->setEditable(false); + for (int i = 0; i < 16; ++i) { + pComboBox_1->addItem(QString("手动选择驱动方案%1").arg(i + 1)); + } + pComboBox_1->setFixedWidth(240); + pHBoxLayout_1->addWidget(pComboBox_1); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_1); + pVBoxLayout->addSpacing(30); + + QLabel *pLabel_1 = new QLabel; + QPixmap pix_1(":/images/example/DSearchComboBox.png"); + pLabel_1->setFixedSize(568, 444); + pLabel_1->setPixmap(pix_1); + pLabel_1->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; + pHBoxLayout_pic_1->setMargin(0); + pHBoxLayout_pic_1->setSpacing(0); + pHBoxLayout_pic_1->addWidget(pLabel_1); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_pic_1); + pVBoxLayout->addSpacing(20); +} + +QString DSearchComboBoxExample::getTitleName() const +{ + return "DSearchComboBox"; +} + +QString DSearchComboBoxExample::getDescriptionInfo() const +{ + return "一个带搜索功能的ComboBox控件."; +} + +int DSearchComboBoxExample::getFixedHeight() const +{ + return 700; +} diff -Nru dtkwidget-5.5.48/examples/collections/buttonexample.h dtkwidget-5.6.12/examples/collections/buttonexample.h --- dtkwidget-5.5.48/examples/collections/buttonexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/buttonexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,180 @@ +// SPDX-FileCopyrightText: 2020 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef BUTTONEXAMPLE_H +#define BUTTONEXAMPLE_H +#include +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class ButtonExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit ButtonExampleWindow(QWidget *parent = nullptr); +}; + +class DPushButtonExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DPushButtonExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DWarningButtonExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DWarningButtonExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DSuggestButtonExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DSuggestButtonExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DToolButtonExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DToolButtonExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DIconButtonExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DIconButtonExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DButtonBoxExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DButtonBoxExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; + virtual void changeEvent(QEvent *event) override; + void updateButtonsSize(); +}; + +class DFloatingButtonExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DFloatingButtonExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DSwitchButtonExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DSwitchButtonExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DRadioButtonExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DRadioButtonExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DCheckButtonExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DCheckButtonExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DComboBoxExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DComboBoxExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DFontComboBoxExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DFontComboBoxExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DSearchComboBoxExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DSearchComboBoxExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // BUTTONEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/cameraform.ui dtkwidget-5.6.12/examples/collections/cameraform.ui --- dtkwidget-5.5.48/examples/collections/cameraform.ui 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/cameraform.ui 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,110 @@ + + + CameraForm + + + + 0 + 0 + 506 + 268 + + + + Form + + + + + 10 + 240 + 201 + 16 + + + + Qt::Horizontal + + + + + + 290 + 10 + 200 + 200 + + + + + + + + + + 440 + 240 + 51 + 20 + + + + ok + + + + + + 10 + 10 + 200 + 200 + + + + + + + 310 + 240 + 61 + 21 + + + + + + + mirrored + + + + + + 380 + 240 + 51 + 21 + + + + Round + + + + + + 250 + 240 + 51 + 22 + + + + start + + + + + + diff -Nru dtkwidget-5.5.48/examples/collections/CMakeLists.txt dtkwidget-5.6.12/examples/collections/CMakeLists.txt --- dtkwidget-5.5.48/examples/collections/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,62 @@ +set(BIN_NAME collections) +set(CMAKE_AUTOUIC ON) + +find_package(Qt5 REQUIRED COMPONENTS Gui Widgets) + +add_executable(${BIN_NAME} + images.qrc + resources.qrc + icons/theme-icons.qrc + cameraform.ui + mainwindow.h + buttonexample.h + examplewindowinterface.h + pagewindowinterface.h + editexample.h + sliderexample.h + listviewexample.h + windowexample.h + tooltipexample.h + spinnerexample.h + dialogexample.h + progressbarexample.h + layoutexample.h + scrollbarexample.h + rubberbandexample.h + widgetexample.h + lcdnumberexample.h + menuexample.h + imageviewerexample.h + main.cpp + mainwindow.cpp + buttonexample.cpp + examplewindowinterface.cpp + pagewindowinterface.cpp + editexample.cpp + sliderexample.cpp + listviewexample.cpp + windowexample.cpp + tooltipexample.cpp + spinnerexample.cpp + dialogexample.cpp + progressbarexample.cpp + layoutexample.cpp + scrollbarexample.cpp + rubberbandexample.cpp + widgetexample.cpp + lcdnumberexample.cpp + menuexample.cpp + imageviewerexample.cpp +) + +target_link_libraries(${BIN_NAME} PRIVATE + Qt5::Widgets + Qt5::GuiPrivate + ${LIB_NAME} +) +install( + TARGETS ${BIN_NAME} + DESTINATION "${CMAKE_INSTALL_LIBDIR}/dtk${PROJECT_VERSION_MAJOR}/DWidget/examples/" +) + +dconfig_override_files(APPID dtk-example META_NAME org.deepin.dtkwidget.feature-display FILES ${CMAKE_CURRENT_LIST_DIR}/org.deepin.dtkwidget.feature-display.json) diff -Nru dtkwidget-5.5.48/examples/collections/dialogexample.cpp dtkwidget-5.6.12/examples/collections/dialogexample.cpp --- dtkwidget-5.5.48/examples/collections/dialogexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/dialogexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,184 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "dialogexample.h" + +DWIDGET_USE_NAMESPACE + +DialogExampleWindow::DialogExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DDialogExample(this)); + addExampleWindow(new DFileDialogExample(this)); + addExampleWindow(new DMessageManagerExample(this)); +} + +DDialogExample::DDialogExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QLabel *label1 = new QLabel; + QLabel *label2 = new QLabel; + + label1->setFixedSize(381, 181); + label1->setScaledContents(true); + label2->setFixedSize(381, 160); + label2->setScaledContents(true); + label1->setPixmap(QPixmap(":/images/example/DDialog_1.png")); + label2->setPixmap(QPixmap(":/images/example/DDialog_2.png")); + + DLabel *label = new DLabel; + QVBoxLayout *mainlayout = new QVBoxLayout(this); + DPushButton *btn = new DPushButton("开始还原"); + mainlayout->setMargin(0); + mainlayout->setSpacing(0); + + label->setPixmap(QPixmap(":/images/example/DDialog.png")); + label->setFixedSize(550, 426); + label->setScaledContents(true); + + mainlayout->addWidget(btn, 0, Qt::AlignCenter); + mainlayout->addWidget(label1, 0, Qt::AlignCenter); + mainlayout->addWidget(label2, 0, Qt::AlignCenter); + mainlayout->addSpacing(60); + mainlayout->addWidget(label, 0, Qt::AlignCenter); + mainlayout->addSpacing(70); + + connect(btn, &DPushButton::clicked, this, [ = ] { + DDialog dialog; + dialog.setIcon(style()->standardIcon(QStyle::SP_MessageBoxWarning)); + dialog.setTitle("还原当前系统需要管理员权限"); + dialog.addContent(new DPasswordEdit); + dialog.addButton("取消"); + dialog.addButton("授权", false, DDialog::ButtonRecommend); + dialog.exec(); + }); + +} + +QString DDialogExample::getTitleName() const +{ + return "DDialog"; +} + +QString DDialogExample::getDescriptionInfo() const +{ + return "用于需要用户处理事务,又不希望跳转\n" + "页面以致打断工作流程时。"; +} + +int DDialogExample::getFixedHeight() const +{ + return 967; +} + +DFileDialogExample::DFileDialogExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QLabel *label1 = new QLabel; + QLabel *label2 = new QLabel; + DLabel *label3 = new DLabel; + DFileChooserEdit *dialog = new DFileChooserEdit; + QVBoxLayout *mainLayout= new QVBoxLayout(this); + + mainLayout->setMargin(0); + mainLayout->setSpacing(0); + label1->setFixedSize(550, 334); + label2->setFixedSize(550, 334); + label3->setFixedSize(550, 387); + label1->setScaledContents(true); + label2->setScaledContents(true); + label3->setScaledContents(true); + label1->setPixmap(QPixmap(":/images/example/DFileDialog_1.png")); + label2->setPixmap(QPixmap(":/images/example/DFileDialog_2.png")); + label3->setPixmap(QPixmap(":/images/example/DFileDialog.png")); + + mainLayout->addWidget(dialog, 0, Qt::AlignCenter); + mainLayout->addWidget(label1, 0, Qt::AlignCenter); + mainLayout->addWidget(label2, 0, Qt::AlignCenter); + mainLayout->addWidget(label3, 0, Qt::AlignCenter); +} + +QString DFileDialogExample::getTitleName() const +{ + return "DFileDialog"; +} + +QString DFileDialogExample::getDescriptionInfo() const +{ + return "有需要调用打开文件,保存文件的地\n" + "方。底部工具栏上面的选项和内容多少\n" + "会根据应用自身的需要显示不同的内容。\n"; +} + +int DFileDialogExample::getFixedHeight() const +{ + return 1256; +} + +DMessageManagerExample::DMessageManagerExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainlayout = new QVBoxLayout(this); + QLabel *label = new QLabel; + QVBoxLayout *labelLayout = new QVBoxLayout(label); + DPushButton *btn1 = new DPushButton("点击按钮呼出自动消失的提示信息"); + DPushButton *btn2 = new DPushButton("点击按钮呼出不会自动消失的提示信息"); + + connect(btn1, &DPushButton::clicked, this, [ = ] { + DMessageManager::instance()->sendMessage(this, style()->standardIcon(QStyle::SP_MessageBoxWarning), + "成功添加到\"校园民谣\""); + }); + connect(btn2, &DPushButton::clicked, this, [ = ] { + DFloatingMessage *message = new DFloatingMessage(DFloatingMessage::ResidentType); + message->setIcon(style()->standardIcon(QStyle::SP_MessageBoxWarning)); + message->setMessage("磁盘中的原文件已被修改,是否重新输入?"); + message->setWidget(new DPushButton("重新载入")); + labelLayout->addWidget(message, 0, Qt::AlignCenter | Qt::AlignBottom); + DMessageManager::instance()->sendMessage(this, message); + }); + + label->setScaledContents(true); + label->setFixedSize(550, 309); + label->setPixmap(QPixmap(":/images/example/dock_notice.png")); + labelLayout->addStretch(10); + + mainlayout->setMargin(0); + mainlayout->setSpacing(0); + mainlayout->addWidget(btn1, 0, Qt::AlignCenter); + mainlayout->addWidget(btn2, 0, Qt::AlignCenter); + mainlayout->addWidget(label, 0, Qt::AlignCenter); +} + +QString DMessageManagerExample::getTitleName() const +{ + return "DMessageManager"; +} + +QString DMessageManagerExample::getDescriptionInfo() const +{ + return "类型1\n" + "这类应用内提醒是不需要用户进行操作\n" + "的,过几秒钟后会自主消失,仅仅是向\n" + "用户告知一些信息,比如什么成功或失\n" + "败了,有什么需要注意的之类的。\n" + "类型2\n" + "这类应用内提醒需要用户的操作,在用\n" + "户操作之前不会自主消失\n"; +} + +int DMessageManagerExample::getFixedHeight() const +{ + return 588; +} diff -Nru dtkwidget-5.5.48/examples/collections/dialogexample.h dtkwidget-5.6.12/examples/collections/dialogexample.h --- dtkwidget-5.5.48/examples/collections/dialogexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/dialogexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,59 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DIALOGEXAMPLE_H +#define DIALOGEXAMPLE_H + +#include +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class DialogExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit DialogExampleWindow(QWidget *parent = nullptr); +}; + +class DDialogExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DDialogExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DFileDialogExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DFileDialogExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DMessageManagerExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DMessageManagerExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // DIALOGEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/editexample.cpp dtkwidget-5.6.12/examples/collections/editexample.cpp --- dtkwidget-5.5.48/examples/collections/editexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/editexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,427 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "editexample.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +DWIDGET_USE_NAMESPACE + +EditExampleWindow::EditExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DSearchEditExample(this)); + addExampleWindow(new DLineEditExample(this)); + addExampleWindow(new DIpv4LineEditExample(this)); + addExampleWindow(new DPasswordEditExample(this)); + addExampleWindow(new DFileChooserEditExample(this)); + addExampleWindow(new DSpinBoxExample(this)); + addExampleWindow(new DTextEditExample(this)); + addExampleWindow(new DCrumbTextFormatExample(this)); + addExampleWindow(new DKeySequenceEditExample(this)); +} + +DSearchEditExample::DSearchEditExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + setLayout(mainLayout); + + DSearchEdit *edit = new DSearchEdit(this); + edit->setFixedWidth(340); + edit->lineEdit()->setClearButtonEnabled(true); + QLabel *label = new QLabel(this); + label->setPixmap(QPixmap("://images/example/DSearchEdit.png")); + label->setScaledContents(true); + label->setFixedSize(550, 426); + + mainLayout->addWidget(edit, 0, Qt::AlignHCenter); + mainLayout->addSpacing(76); + mainLayout->addWidget(label, 0, Qt::AlignHCenter); +} + +QString DSearchEditExample::getTitleName() const +{ + return "DSearchEdit"; +} + +QString DSearchEditExample::getDescriptionInfo() const +{ + return "用户工具栏或者主要区域的搜索框。配\n" + "合一起使用的会有补全菜单。输入文字\n" + "后一定会有清除按钮"; +} + +int DSearchEditExample::getFixedHeight() const +{ + return 632; +} + +DLineEditExample::DLineEditExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + setLayout(mainLayout); + + DLineEdit *edit = new DLineEdit(this); + edit->setFixedWidth(340); + edit->lineEdit()->setPlaceholderText("选填"); + edit->lineEdit()->setClearButtonEnabled(true); + connect(edit->lineEdit(), &QLineEdit::textChanged, [edit](const QString & text) { + if (text.size() < 2) { + edit->setAlert(true); + edit->showAlertMessage("字符不能少于2个"); + } else { + edit->setAlert(false); + } + }); + QLabel *label = new QLabel(this); + label->setPixmap(QPixmap("://images/example/DLineEdit.png")); + label->setScaledContents(true); + label->setFixedSize(550, 426); + + mainLayout->addWidget(edit, 0, Qt::AlignHCenter); + mainLayout->addSpacing(76); + mainLayout->addWidget(label, 0, Qt::AlignHCenter); +} + +QString DLineEditExample::getTitleName() const +{ + return "DLineEdit"; +} + +QString DLineEditExample::getDescriptionInfo() const +{ + return "普通的单行文本输入框,一般有输入字\n" + "数限制,但是字数限制需要根据实际情\n" + "况来约定。\n" + "输入内容后输入尾部有清空按钮。"; +} + +int DLineEditExample::getFixedHeight() const +{ + return 632; +} + +DIpv4LineEditExample::DIpv4LineEditExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + setLayout(mainLayout); + + DIpv4LineEdit *edit = new DIpv4LineEdit(this); + edit->setFixedWidth(340); + QLabel *label = new QLabel(this); + label->setPixmap(QPixmap("://images/example/DIpv4LineEdit.png")); + label->setScaledContents(true); + label->setFixedSize(550, 426); + + mainLayout->addWidget(edit, 0, Qt::AlignHCenter); + mainLayout->addSpacing(76); + mainLayout->addWidget(label, 0, Qt::AlignHCenter); +} + +QString DIpv4LineEditExample::getTitleName() const +{ + return "DIpv4LineEdit"; +} + +QString DIpv4LineEditExample::getDescriptionInfo() const +{ + return "比较特殊的IP地址输入框,用的较少"; +} + +int DIpv4LineEditExample::getFixedHeight() const +{ + return 602; +} + +DPasswordEditExample::DPasswordEditExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + setLayout(mainLayout); + + DPasswordEdit *edit = new DPasswordEdit(this); + edit->setFixedWidth(340); + edit->setText("0123456789"); + QLabel *label = new QLabel(this); + label->setPixmap(QPixmap("://images/example/DPasswordEdit.png")); + label->setScaledContents(true); + label->setFixedSize(380, 230); + + mainLayout->addWidget(edit, 0, Qt::AlignHCenter); + mainLayout->addSpacing(76); + mainLayout->addWidget(label, 0, Qt::AlignHCenter); +} + +QString DPasswordEditExample::getTitleName() const +{ + return "DPasswordEdit"; +} + +QString DPasswordEditExample::getDescriptionInfo() const +{ + return "常见的密码输入框"; +} + +int DPasswordEditExample::getFixedHeight() const +{ + return 436; +} + +DFileChooserEditExample::DFileChooserEditExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + setLayout(mainLayout); + + DFileChooserEdit *edit = new DFileChooserEdit(this); + edit->setFixedWidth(340); + edit->lineEdit()->setClearButtonEnabled(true); + edit->setText("~/.ssh/ssh_keygin.key"); + QLabel *label = new QLabel(this); + label->setPixmap(QPixmap("://images/example/DFileChooserEdit.png")); + label->setScaledContents(true); + label->setFixedSize(550, 426); + + mainLayout->addWidget(edit, 0, Qt::AlignHCenter); + mainLayout->addSpacing(76); + mainLayout->addWidget(label, 0, Qt::AlignHCenter); +} + +QString DFileChooserEditExample::getTitleName() const +{ + return "DFileChooserEdit"; +} + +QString DFileChooserEditExample::getDescriptionInfo() const +{ + return "普通的文件选择输入框"; +} + +int DFileChooserEditExample::getFixedHeight() const +{ + return 632; +} + +DSpinBoxExample::DSpinBoxExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + setLayout(mainLayout); + + DSpinBox *plusMinus = new DSpinBox(this); + plusMinus->setFixedWidth(340); + plusMinus->setButtonSymbols(QAbstractSpinBox::PlusMinus); + QHBoxLayout *upDownLayout = new QHBoxLayout(); + DSpinBox *upDown = new DSpinBox(this); + upDown->setFixedWidth(248); + upDown->setButtonSymbols(QAbstractSpinBox::UpDownArrows); + upDown->setEnabledEmbedStyle(true); + QLabel *label = new QLabel(this); + label->setPixmap(QPixmap("://images/example/DSpinBox.png")); + label->setScaledContents(true); + label->setFixedSize(550, 426); + + upDownLayout->addStretch(); + upDownLayout->addWidget(upDown); + upDownLayout->addSpacing(92); + upDownLayout->addStretch(); + + mainLayout->addWidget(plusMinus, 0, Qt::AlignHCenter); + mainLayout->addSpacing(10); + mainLayout->addItem(upDownLayout); + mainLayout->addSpacing(50); + mainLayout->addWidget(label, 0, Qt::AlignHCenter); +} + +QString DSpinBoxExample::getTitleName() const +{ + return "DSpinBox"; +} + +QString DSpinBoxExample::getDescriptionInfo() const +{ + return "常见的数值输入框,只能输入数字字\n" + "符,且多数时候只能是整数,上面三个\n" + "性质上是一样的,根据实际情况需要选\n" + "择即可。"; +} + +int DSpinBoxExample::getFixedHeight() const +{ + return 814; +} + +DTextEditExample::DTextEditExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + setLayout(mainLayout); + + DTextEdit *edit = new DTextEdit(this); + edit->setFixedSize(340, 144); + QLabel *label = new QLabel(this); + label->setPixmap(QPixmap("://images/example/DTextEdit.png")); + label->setScaledContents(true); + label->setFixedSize(550, 426); + + mainLayout->addWidget(edit, 0, Qt::AlignHCenter); + mainLayout->addSpacing(76); + mainLayout->addWidget(label, 0, Qt::AlignHCenter); +} + +QString DTextEditExample::getTitleName() const +{ + return "DTextEdit"; +} + +QString DTextEditExample::getDescriptionInfo() const +{ + return "多行文本输入框,在网页上常见,应用\n" + "内使用相对较少。"; +} + +int DTextEditExample::getFixedHeight() const +{ + return 740; +} + +DCrumbTextFormatExample::DCrumbTextFormatExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + setLayout(mainLayout); + + DCrumbEdit *edit = new DCrumbEdit(this); + edit->setFixedSize(340, 70); + + DCrumbTextFormat first = edit->makeTextFormat(); + first.setText("人物"); + DCrumbTextFormat second = edit->makeTextFormat(); + second.setText("儿童"); + DCrumbTextFormat third = edit->makeTextFormat(); + third.setText("照片"); + edit->insertCrumb(first); + edit->insertCrumb(second); + edit->insertCrumb(third); + + QLabel *label = new QLabel(this); + label->setPixmap(QPixmap("://images/example/DCrumbEdit.png")); + label->setScaledContents(true); + label->setFixedSize(300, 708); + + mainLayout->addWidget(edit, 0, Qt::AlignHCenter); + mainLayout->addSpacing(76); + mainLayout->addWidget(label, 0, Qt::AlignHCenter); +} + +QString DCrumbTextFormatExample::getTitleName() const +{ + return "DCrumbEdit"; +} + +QString DCrumbTextFormatExample::getDescriptionInfo() const +{ + return "标签输入框,用的情况不多,目前主要" + "\n是文管使用"; +} + +int DCrumbTextFormatExample::getFixedHeight() const +{ + return 948; +} + +DKeySequenceEditExample::DKeySequenceEditExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(); + QHBoxLayout *keyHLayout = new QHBoxLayout(); + QHBoxLayout *closeHLayout1 = new QHBoxLayout(); + QHBoxLayout *closeHLayout2 = new QHBoxLayout(); + setLayout(mainLayout); + mainLayout->addLayout(keyHLayout); + mainLayout->addLayout(closeHLayout1); + mainLayout->addLayout(closeHLayout2); + + QLabel *keyLabel = new QLabel("切换键盘布局", this); + keyLabel->setFixedSize(108, 19); + keyLabel->setAlignment(Qt::AlignLeft); + DKeySequenceEdit *keyEdit = new DKeySequenceEdit(this); + keyEdit->setKeySequence(QKeySequence(Qt::CTRL + Qt::SHIFT)); + QLabel *closeLabel1 = new QLabel("关闭窗口", this); + closeLabel1->setFixedSize(72, 19); + closeLabel1->setAlignment(Qt::AlignLeft); + DKeySequenceEdit *closeEdit1 = new DKeySequenceEdit(this); + closeEdit1->setKeySequence(QKeySequence(Qt::ALT + Qt::Key_F4)); + QLabel *closeLabel2 = new QLabel("关闭窗口", this); + closeLabel2->setFixedSize(72, 19); + closeLabel2->setAlignment(Qt::AlignLeft); + DKeySequenceEdit *closeEdit2 = new DKeySequenceEdit(this); + QLabel *label = new QLabel(this); + label->setPixmap(QPixmap("://images/example/DKeySequenceEdit.png")); + label->setScaledContents(true); + label->setFixedSize(550, 426); + + keyHLayout->addStretch(); + keyHLayout->addWidget(keyLabel); + keyHLayout->addSpacing(220); + keyHLayout->addWidget(keyEdit, 0, Qt::AlignRight); + keyHLayout->addStretch(); + + closeHLayout1->addStretch(); + closeHLayout1->addWidget(closeLabel1); + closeHLayout1->addSpacing(260); + closeHLayout1->addWidget(closeEdit1, 0, Qt::AlignRight); + closeHLayout1->addStretch(); + + closeHLayout2->addStretch(); + closeHLayout2->addWidget(closeLabel2); + closeHLayout2->addSpacing(260); + closeHLayout2->addWidget(closeEdit2, 0, Qt::AlignRight); + closeHLayout2->addStretch(); + + mainLayout->addSpacing(76); + mainLayout->addWidget(label, 0, Qt::AlignHCenter); + + QShortcut *shortCut = new QShortcut(this); + shortCut->setKey(QKeySequence(keyEdit->keySequence())); + connect(shortCut, &QShortcut::activated, this, [shortCut](){ + qWarning() << "shorcut is trigger" << shortCut->key(); + }); + connect(keyEdit, &DKeySequenceEdit::editingFinished, this, [shortCut](QKeySequence key){ + shortCut->setKey(key); + }); +} + +QString DKeySequenceEditExample::getTitleName() const +{ + return "DKeySequenceEdit"; +} + +QString DKeySequenceEditExample::getDescriptionInfo() const +{ + return "应用设置和控制中心部分设置快捷键的\n" + "地方。"; +} + +int DKeySequenceEditExample::getFixedHeight() const +{ + return 724; +} diff -Nru dtkwidget-5.5.48/examples/collections/editexample.h dtkwidget-5.6.12/examples/collections/editexample.h --- dtkwidget-5.5.48/examples/collections/editexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/editexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,131 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef EDITEXAMPLE_H +#define EDITEXAMPLE_H + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class QWidget; +class QLabel; + +class EditExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit EditExampleWindow(QWidget *parent = nullptr); +}; + +class DSearchEditExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DSearchEditExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DLineEditExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DLineEditExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DIpv4LineEditExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DIpv4LineEditExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DPasswordEditExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DPasswordEditExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DFileChooserEditExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DFileChooserEditExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DSpinBoxExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DSpinBoxExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DTextEditExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DTextEditExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DCrumbTextFormatExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DCrumbTextFormatExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DKeySequenceEditExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DKeySequenceEditExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // EDITEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/examplewindowinterface.cpp dtkwidget-5.6.12/examples/collections/examplewindowinterface.cpp --- dtkwidget-5.5.48/examples/collections/examplewindowinterface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/examplewindowinterface.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,16 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "examplewindowinterface.h" + +ExampleWindowInterface::ExampleWindowInterface(QWidget *parent) + : QWidget(parent) +{ + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); +} + +ExampleWindowInterface::~ExampleWindowInterface() +{ + // +} diff -Nru dtkwidget-5.5.48/examples/collections/examplewindowinterface.h dtkwidget-5.6.12/examples/collections/examplewindowinterface.h --- dtkwidget-5.5.48/examples/collections/examplewindowinterface.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/examplewindowinterface.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,21 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef EXAMPLEWINDOWINTERFACE_H +#define EXAMPLEWINDOWINTERFACE_H +#include + +class ExampleWindowInterface : public QWidget +{ +public: + explicit ExampleWindowInterface(QWidget *parent); + virtual ~ExampleWindowInterface(); + +public: + virtual QString getTitleName() const = 0; + virtual QString getDescriptionInfo() const = 0; + virtual int getFixedHeight() const = 0; +}; + +#endif // EXAMPLEWINDOWINTERFACE_H diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_button_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_button_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_button_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_button_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,7 @@ + + + icon_button/normal + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_Dial_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_Dial_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_Dial_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_Dial_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,9 @@ + + + icon_Dial/normal + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_Dialog_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_Dialog_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_Dialog_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_Dialog_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,9 @@ + + + icon_Dialog/normal + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_edit_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_edit_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_edit_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_edit_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,7 @@ + + + icon_edit/normal + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_Layout_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_Layout_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_Layout_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_Layout_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,14 @@ + + + icon_Layout/normal + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_LCDNumber_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_LCDNumber_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_LCDNumber_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_LCDNumber_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,26 @@ + + + icon_LCDNumber/normal + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_ListView_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_ListView_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_ListView_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_ListView_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,18 @@ + + + icon_ListView/normal + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_menu_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_menu_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_menu_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_menu_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,13 @@ + + + icon_menu/normal + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_ProgressBar_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_ProgressBar_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_ProgressBar_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_ProgressBar_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,7 @@ + + + icon_ProgressBar/normal + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_RubberBand_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_RubberBand_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_RubberBand_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_RubberBand_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,11 @@ + + + icon_RubberBand/normal + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_ScrollBar_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_ScrollBar_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_ScrollBar_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_ScrollBar_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,7 @@ + + + icon_ScrollBar/normal + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_slider_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_slider_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_slider_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_slider_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,7 @@ + + + icon_slider/normal + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_Spinner_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_Spinner_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_Spinner_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_Spinner_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,14 @@ + + + icon_Spinner/normal + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_Tooltip_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_Tooltip_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_Tooltip_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_Tooltip_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,11 @@ + + + icon_Tooltip/normal + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_Widget_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_Widget_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_Widget_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_Widget_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,9 @@ + + + icon_Widget/normal + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/texts/icon_Window_16px.svg dtkwidget-5.6.12/examples/collections/icons/texts/icon_Window_16px.svg --- dtkwidget-5.5.48/examples/collections/icons/texts/icon_Window_16px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/texts/icon_Window_16px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ + + + icon_Window/normal + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/icons/theme-icons.qrc dtkwidget-5.6.12/examples/collections/icons/theme-icons.qrc --- dtkwidget-5.5.48/examples/collections/icons/theme-icons.qrc 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/icons/theme-icons.qrc 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,20 @@ + + + texts/icon_button_16px.svg + texts/icon_Dial_16px.svg + texts/icon_Dialog_16px.svg + texts/icon_edit_16px.svg + texts/icon_Layout_16px.svg + texts/icon_LCDNumber_16px.svg + texts/icon_ListView_16px.svg + texts/icon_menu_16px.svg + texts/icon_ProgressBar_16px.svg + texts/icon_RubberBand_16px.svg + texts/icon_ScrollBar_16px.svg + texts/icon_slider_16px.svg + texts/icon_Spinner_16px.svg + texts/icon_Tooltip_16px.svg + texts/icon_Widget_16px.svg + texts/icon_Window_16px.svg + + Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/buttonChecked.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/buttonChecked.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/buttonHover.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/buttonHover.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/button.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/button.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/buttonPress.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/buttonPress.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/default_background.jpg and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/default_background.jpg differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_01.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_01.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_02.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_02.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_03.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_03.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_04.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_04.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_05.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_05.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_06.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_06.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_07.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_07.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_08.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_08.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_09.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_09.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_10.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_10.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_11.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_11.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_12.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_12.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_13.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_13.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_14.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_14.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_15.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_15.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_16.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_16.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_17.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_17.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_18.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_18.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_19.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_19.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_20.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_20.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_21.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_21.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_22.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_22.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_23.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_23.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_24.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_24.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_25.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_25.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_26.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_26.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_27.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_27.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_28.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_28.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_29.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_29.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_30.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_30.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_31.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_31.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_32.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_32.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_33.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_33.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_34.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_34.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_35.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_35.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_36.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_36.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_37.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_37.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_38.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_38.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_39.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_39.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_40.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_40.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_41.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_41.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_42.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_42.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_43.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_43.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_44.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_44.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_45.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_45.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_46.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_46.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_47.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_47.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_48.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_48.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_49.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_49.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_50.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_50.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_51.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_51.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_52.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_52.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_53.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_53.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_54.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_54.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_55.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_55.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_56.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_56.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_57.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_57.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_58.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_58.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_59.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_59.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/eLoading/eLoading_60.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/eLoading/eLoading_60.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/background.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/background.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DArrowRectangle.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DArrowRectangle.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DBackgroundGroup.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DBackgroundGroup.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DButtonBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DButtonBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DCalendarWidget.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DCalendarWidget.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DCheckButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DCheckButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DColumViewPicIcon_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DColumViewPicIcon_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DColumViewPicIcon_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DColumViewPicIcon_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DColumViewPicIcon_3.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DColumViewPicIcon_3.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DColumViewPicIcon_4.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DColumViewPicIcon_4.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DColumViewPicIcon_5.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DColumViewPicIcon_5.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DColumViewPicIcon_6.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DColumViewPicIcon_6.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DColumViewPicIcon_7.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DColumViewPicIcon_7.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DColumViewPicIcon_8.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DColumViewPicIcon_8.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DColumViewPicIcon_9.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DColumViewPicIcon_9.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DComboBox_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DComboBox_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DComboBox_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DComboBox_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DCommandLinkButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DCommandLinkButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DCrumbEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DCrumbEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DDialog_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DDialog_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DDialog_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DDialog_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DDialog.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DDialog.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DFileChooserEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DFileChooserEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DFileDialog_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DFileDialog_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DFileDialog_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DFileDialog_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DFileDialog.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DFileDialog.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DFloatingButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DFloatingButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DFontComboBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DFontComboBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DFrame.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DFrame.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DGroupBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DGroupBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DHeaderView.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DHeaderView.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DIconButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DIconButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DIpv4LineEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DIpv4LineEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DKeySequenceEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DKeySequenceEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DLCDNumber.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DLCDNumber.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DLineEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DLineEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DListView_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DListView_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DListView_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DListView_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DListView_3.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DListView_3.png differ diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DListViewBrowser_1.svg dtkwidget-5.6.12/examples/collections/images/example/DListViewBrowser_1.svg --- dtkwidget-5.5.48/examples/collections/images/example/DListViewBrowser_1.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DListViewBrowser_1.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,68 @@ + + + google-chrome-32px + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DListViewBrowser_2.svg dtkwidget-5.6.12/examples/collections/images/example/DListViewBrowser_2.svg --- dtkwidget-5.5.48/examples/collections/images/example/DListViewBrowser_2.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DListViewBrowser_2.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,112 @@ + + + firefox + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DListViewBrowser_3.svg dtkwidget-5.6.12/examples/collections/images/example/DListViewBrowser_3.svg --- dtkwidget-5.5.48/examples/collections/images/example/DListViewBrowser_3.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DListViewBrowser_3.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,27 @@ + + + 编组 2 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DListViewBrowser_4.svg dtkwidget-5.6.12/examples/collections/images/example/DListViewBrowser_4.svg --- dtkwidget-5.5.48/examples/collections/images/example/DListViewBrowser_4.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DListViewBrowser_4.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,28 @@ + + + 编组 3 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DListViewEditAction.svg dtkwidget-5.6.12/examples/collections/images/example/DListViewEditAction.svg --- dtkwidget-5.5.48/examples/collections/images/example/DListViewEditAction.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DListViewEditAction.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,23 @@ + + + edit + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DListViewScreen_1.svg dtkwidget-5.6.12/examples/collections/images/example/DListViewScreen_1.svg --- dtkwidget-5.5.48/examples/collections/images/example/DListViewScreen_1.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DListViewScreen_1.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,37 @@ + + + 编组 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DListViewScreen_2.svg dtkwidget-5.6.12/examples/collections/images/example/DListViewScreen_2.svg --- dtkwidget-5.5.48/examples/collections/images/example/DListViewScreen_2.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DListViewScreen_2.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,37 @@ + + + 编组 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DListViewScreen_3.svg dtkwidget-5.6.12/examples/collections/images/example/DListViewScreen_3.svg --- dtkwidget-5.5.48/examples/collections/images/example/DListViewScreen_3.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DListViewScreen_3.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,37 @@ + + + 编组 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DListViewScreen_4.svg dtkwidget-5.6.12/examples/collections/images/example/DListViewScreen_4.svg --- dtkwidget-5.5.48/examples/collections/images/example/DListViewScreen_4.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DListViewScreen_4.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,37 @@ + + + 编组 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DMainWindow.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DMainWindow.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DMenuPicture_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DMenuPicture_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DMenuPicture_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DMenuPicture_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DMenuPicture_3.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DMenuPicture_3.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DMenuPicture_4.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DMenuPicture_4.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DMenu.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DMenu.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DMessageManager.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DMessageManager.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/dock_notice.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/dock_notice.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DPasswordEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DPasswordEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DProgressBar_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DProgressBar_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DProgressBar_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DProgressBar_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DPushButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DPushButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DRadioButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DRadioButton.png differ diff -Nru dtkwidget-5.5.48/examples/collections/images/example/drive-harddisk-48px_1.svg dtkwidget-5.6.12/examples/collections/images/example/drive-harddisk-48px_1.svg --- dtkwidget-5.5.48/examples/collections/images/example/drive-harddisk-48px_1.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/drive-harddisk-48px_1.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,93 @@ + + + drive-harddisk-48px + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/drive-harddisk-48px_2.svg dtkwidget-5.6.12/examples/collections/images/example/drive-harddisk-48px_2.svg --- dtkwidget-5.5.48/examples/collections/images/example/drive-harddisk-48px_2.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/drive-harddisk-48px_2.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,86 @@ + + + drive-harddisk-48px + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/drive-harddisk-48px_3.svg dtkwidget-5.6.12/examples/collections/images/example/drive-harddisk-48px_3.svg --- dtkwidget-5.5.48/examples/collections/images/example/drive-harddisk-48px_3.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/drive-harddisk-48px_3.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,78 @@ + + + drive-harddisk-48px + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/drive-harddisk-48px.svg dtkwidget-5.6.12/examples/collections/images/example/drive-harddisk-48px.svg --- dtkwidget-5.5.48/examples/collections/images/example/drive-harddisk-48px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/drive-harddisk-48px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,82 @@ + + + drive-harddisk-48px + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DRubberBand.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DRubberBand.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DScrollBar_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DScrollBar_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DScrollBar.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DScrollBar.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DSearchComboBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DSearchComboBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DSearchEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DSearchEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DSizegrip.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DSizegrip.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DSlider_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DSlider_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DSlider_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DSlider_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DSpinBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DSpinBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DSpinner.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DSpinner.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DSplitter.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DSplitter.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DStatusBar.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DStatusBar.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DSuggestButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DSuggestButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DSwitchButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DSwitchButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DTabBar_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DTabBar_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DTabBar_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DTabBar_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DTextEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DTextEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DTitlebar_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DTitlebar_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DTitlebar_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DTitlebar_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DTitlebar_3.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DTitlebar_3.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DTitlebar_4.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DTitlebar_4.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DToolButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DToolButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DToolTip.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DToolTip.png differ diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DTreeViewIcon_1.svg dtkwidget-5.6.12/examples/collections/images/example/DTreeViewIcon_1.svg --- dtkwidget-5.5.48/examples/collections/images/example/DTreeViewIcon_1.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DTreeViewIcon_1.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,27 @@ + + + 椭圆形 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DTreeViewIcon_2.svg dtkwidget-5.6.12/examples/collections/images/example/DTreeViewIcon_2.svg --- dtkwidget-5.5.48/examples/collections/images/example/DTreeViewIcon_2.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DTreeViewIcon_2.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,36 @@ + + + 蒙版 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DTreeViewIcon_3.svg dtkwidget-5.6.12/examples/collections/images/example/DTreeViewIcon_3.svg --- dtkwidget-5.5.48/examples/collections/images/example/DTreeViewIcon_3.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DTreeViewIcon_3.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,36 @@ + + + 椭圆形 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DTreeViewIcon_4.svg dtkwidget-5.6.12/examples/collections/images/example/DTreeViewIcon_4.svg --- dtkwidget-5.5.48/examples/collections/images/example/DTreeViewIcon_4.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DTreeViewIcon_4.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,36 @@ + + + 椭圆形 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/DTreeViewIcon_5.svg dtkwidget-5.6.12/examples/collections/images/example/DTreeViewIcon_5.svg --- dtkwidget-5.5.48/examples/collections/images/example/DTreeViewIcon_5.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/DTreeViewIcon_5.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,36 @@ + + + 椭圆形 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DTreeView.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DTreeView.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DVerticalline.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DVerticalline.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DWarningButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DWarningButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/example/DWaterProgress.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/example/DWaterProgress.png differ diff -Nru dtkwidget-5.5.48/examples/collections/images/example/movie-logo.svg dtkwidget-5.6.12/examples/collections/images/example/movie-logo.svg --- dtkwidget-5.5.48/examples/collections/images/example/movie-logo.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/movie-logo.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,41 @@ + + + + deepin-movie-128px 2 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/example/Oval_186.svg dtkwidget-5.6.12/examples/collections/images/example/Oval_186.svg --- dtkwidget-5.5.48/examples/collections/images/example/Oval_186.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/example/Oval_186.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,19 @@ + + + Oval 186 + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/collections/images/google-chrome-32-px.svg dtkwidget-5.6.12/examples/collections/images/google-chrome-32-px.svg --- dtkwidget-5.5.48/examples/collections/images/google-chrome-32-px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/google-chrome-32-px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/loading_indicator.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/loading_indicator.png differ diff -Nru dtkwidget-5.5.48/examples/collections/images/logo_icon.svg dtkwidget-5.6.12/examples/collections/images/logo_icon.svg --- dtkwidget-5.5.48/examples/collections/images/logo_icon.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images/logo_icon.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,23 @@ + + + logo icon + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/reload_normal.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/reload_normal.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner01.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner01.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner02.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner02.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner03.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner03.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner04.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner04.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner05.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner05.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner06.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner06.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner07.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner07.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner08.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner08.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner09.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner09.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner10.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner10.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner11.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner11.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner12.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner12.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner13.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner13.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner14.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner14.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner15.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner15.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner16.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner16.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner17.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner17.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner18.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner18.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner19.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner19.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner20.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner20.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner21.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner21.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner22.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner22.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner23.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner23.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner24.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner24.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner25.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner25.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner26.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner26.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner27.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner27.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner28.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner28.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner29.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner29.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner30.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner30.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner31.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner31.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner32.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner32.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner33.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner33.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner34.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner34.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner35.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner35.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner36.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner36.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner37.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner37.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner38.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner38.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner39.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner39.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner40.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner40.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner41.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner41.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner42.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner42.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner43.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner43.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner44.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner44.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner45.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner45.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner46.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner46.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner47.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner47.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner48.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner48.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner49.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner49.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner50.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner50.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner51.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner51.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner52.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner52.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner53.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner53.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner54.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner54.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner55.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner55.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner56.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner56.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner57.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner57.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner58.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner58.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner59.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner59.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner60.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner60.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner61.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner61.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner62.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner62.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner63.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner63.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner64.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner64.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner65.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner65.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner66.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner66.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner67.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner67.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner68.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner68.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner69.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner69.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner70.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner70.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner71.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner71.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner72.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner72.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner73.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner73.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner74.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner74.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner75.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner75.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner76.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner76.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner77.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner77.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner78.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner78.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner79.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner79.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner80.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner80.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner81.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner81.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner82.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner82.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner83.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner83.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner84.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner84.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner85.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner85.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner86.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner86.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner87.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner87.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner88.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner88.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner89.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner89.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/collections/images/Spinner/Spinner90.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/collections/images/Spinner/Spinner90.png differ diff -Nru dtkwidget-5.5.48/examples/collections/images.qrc dtkwidget-5.6.12/examples/collections/images.qrc --- dtkwidget-5.5.48/examples/collections/images.qrc 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/images.qrc 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,261 @@ + + + images/button.png + images/buttonChecked.png + images/buttonHover.png + images/buttonPress.png + images/loading_indicator.png + images/reload_normal.png + images/Spinner/Spinner01.png + images/Spinner/Spinner02.png + images/Spinner/Spinner03.png + images/Spinner/Spinner04.png + images/Spinner/Spinner05.png + images/Spinner/Spinner06.png + images/Spinner/Spinner07.png + images/Spinner/Spinner08.png + images/Spinner/Spinner09.png + images/Spinner/Spinner10.png + images/Spinner/Spinner11.png + images/Spinner/Spinner12.png + images/Spinner/Spinner13.png + images/Spinner/Spinner14.png + images/Spinner/Spinner15.png + images/Spinner/Spinner16.png + images/Spinner/Spinner17.png + images/Spinner/Spinner18.png + images/Spinner/Spinner19.png + images/Spinner/Spinner20.png + images/Spinner/Spinner21.png + images/Spinner/Spinner22.png + images/Spinner/Spinner23.png + images/Spinner/Spinner24.png + images/Spinner/Spinner25.png + images/Spinner/Spinner26.png + images/Spinner/Spinner27.png + images/Spinner/Spinner28.png + images/Spinner/Spinner29.png + images/Spinner/Spinner30.png + images/Spinner/Spinner31.png + images/Spinner/Spinner32.png + images/Spinner/Spinner33.png + images/Spinner/Spinner34.png + images/Spinner/Spinner35.png + images/Spinner/Spinner36.png + images/Spinner/Spinner37.png + images/Spinner/Spinner38.png + images/Spinner/Spinner39.png + images/Spinner/Spinner40.png + images/Spinner/Spinner41.png + images/Spinner/Spinner42.png + images/Spinner/Spinner43.png + images/Spinner/Spinner44.png + images/Spinner/Spinner45.png + images/Spinner/Spinner46.png + images/Spinner/Spinner47.png + images/Spinner/Spinner48.png + images/Spinner/Spinner49.png + images/Spinner/Spinner50.png + images/Spinner/Spinner51.png + images/Spinner/Spinner52.png + images/Spinner/Spinner53.png + images/Spinner/Spinner54.png + images/Spinner/Spinner55.png + images/Spinner/Spinner56.png + images/Spinner/Spinner57.png + images/Spinner/Spinner58.png + images/Spinner/Spinner59.png + images/Spinner/Spinner60.png + images/Spinner/Spinner61.png + images/Spinner/Spinner62.png + images/Spinner/Spinner63.png + images/Spinner/Spinner64.png + images/Spinner/Spinner65.png + images/Spinner/Spinner66.png + images/Spinner/Spinner67.png + images/Spinner/Spinner68.png + images/Spinner/Spinner69.png + images/Spinner/Spinner70.png + images/Spinner/Spinner71.png + images/Spinner/Spinner72.png + images/Spinner/Spinner73.png + images/Spinner/Spinner74.png + images/Spinner/Spinner75.png + images/Spinner/Spinner76.png + images/Spinner/Spinner77.png + images/Spinner/Spinner78.png + images/Spinner/Spinner79.png + images/Spinner/Spinner80.png + images/Spinner/Spinner81.png + images/Spinner/Spinner82.png + images/Spinner/Spinner83.png + images/Spinner/Spinner84.png + images/Spinner/Spinner85.png + images/Spinner/Spinner86.png + images/Spinner/Spinner87.png + images/Spinner/Spinner88.png + images/Spinner/Spinner89.png + images/Spinner/Spinner90.png + images/eLoading/eLoading_01.png + images/eLoading/eLoading_02.png + images/eLoading/eLoading_03.png + images/eLoading/eLoading_04.png + images/eLoading/eLoading_05.png + images/eLoading/eLoading_06.png + images/eLoading/eLoading_07.png + images/eLoading/eLoading_08.png + images/eLoading/eLoading_09.png + images/eLoading/eLoading_10.png + images/eLoading/eLoading_11.png + images/eLoading/eLoading_12.png + images/eLoading/eLoading_13.png + images/eLoading/eLoading_14.png + images/eLoading/eLoading_15.png + images/eLoading/eLoading_16.png + images/eLoading/eLoading_17.png + images/eLoading/eLoading_18.png + images/eLoading/eLoading_19.png + images/eLoading/eLoading_20.png + images/eLoading/eLoading_21.png + images/eLoading/eLoading_22.png + images/eLoading/eLoading_23.png + images/eLoading/eLoading_24.png + images/eLoading/eLoading_25.png + images/eLoading/eLoading_26.png + images/eLoading/eLoading_27.png + images/eLoading/eLoading_28.png + images/eLoading/eLoading_29.png + images/eLoading/eLoading_30.png + images/eLoading/eLoading_31.png + images/eLoading/eLoading_32.png + images/eLoading/eLoading_33.png + images/eLoading/eLoading_34.png + images/eLoading/eLoading_35.png + images/eLoading/eLoading_36.png + images/eLoading/eLoading_37.png + images/eLoading/eLoading_38.png + images/eLoading/eLoading_39.png + images/eLoading/eLoading_40.png + images/eLoading/eLoading_41.png + images/eLoading/eLoading_42.png + images/eLoading/eLoading_43.png + images/eLoading/eLoading_44.png + images/eLoading/eLoading_45.png + images/eLoading/eLoading_46.png + images/eLoading/eLoading_47.png + images/eLoading/eLoading_48.png + images/eLoading/eLoading_49.png + images/eLoading/eLoading_50.png + images/eLoading/eLoading_51.png + images/eLoading/eLoading_52.png + images/eLoading/eLoading_53.png + images/eLoading/eLoading_54.png + images/eLoading/eLoading_55.png + images/eLoading/eLoading_56.png + images/eLoading/eLoading_57.png + images/eLoading/eLoading_58.png + images/eLoading/eLoading_59.png + images/eLoading/eLoading_60.png + images/default_background.jpg + images/logo_icon.svg + images/example/DArrowRectangle.png + images/example/DBackgroundGroup.png + images/example/DButtonBox.png + images/example/DCalendarWidget.png + images/example/DCheckButton.png + images/example/DComboBox_1.png + images/example/DComboBox_2.png + images/example/DCommandLinkButton.png + images/example/DCrumbEdit.png + images/example/DFileChooserEdit.png + images/example/DFloatingButton.png + images/example/DFontComboBox.png + images/example/DFrame.png + images/example/DHeaderView.png + images/example/DIconButton.png + images/example/DIpv4LineEdit.png + images/example/DKeySequenceEdit.png + images/example/DLCDNumber.png + images/example/DLineEdit.png + images/example/DMainWindow.png + images/example/DMessageManager.png + images/example/DPasswordEdit.png + images/example/DProgressBar_1.png + images/example/DProgressBar_2.png + images/example/DPushButton.png + images/example/DRadioButton.png + images/example/DRubberBand.png + images/example/DScrollBar_1.png + images/example/DScrollBar.png + images/example/DSearchEdit.png + images/example/DSizegrip.png + images/example/DSlider_1.png + images/example/DSlider_2.png + images/example/DSpinBox.png + images/example/DSpinner.png + images/example/DSplitter.png + images/example/DStatusBar.png + images/example/DSuggestButton.png + images/example/DSwitchButton.png + images/example/DTabBar_1.png + images/example/DTabBar_2.png + images/example/DTextEdit.png + images/example/DTitlebar_1.png + images/example/DTitlebar_2.png + images/example/DTitlebar_3.png + images/example/DTitlebar_4.png + images/example/DToolButton.png + images/example/DToolTip.png + images/example/DTreeView.png + images/example/DWarningButton.png + images/example/DWaterProgress.png + images/example/DListViewEditAction.svg + images/example/DListViewBrowser_1.svg + images/example/DListViewBrowser_2.svg + images/example/DListViewBrowser_3.svg + images/example/DListViewBrowser_4.svg + images/example/DListViewScreen_4.svg + images/example/DListViewScreen_3.svg + images/example/DListViewScreen_2.svg + images/example/DListViewScreen_1.svg + images/example/DTreeViewIcon_5.svg + images/example/DTreeViewIcon_4.svg + images/example/DTreeViewIcon_3.svg + images/example/DTreeViewIcon_1.svg + images/example/DTreeViewIcon_2.svg + images/example/DColumViewPicIcon_4.png + images/example/DColumViewPicIcon_9.png + images/example/DColumViewPicIcon_8.png + images/example/DColumViewPicIcon_5.png + images/example/DColumViewPicIcon_6.png + images/example/DColumViewPicIcon_7.png + images/example/DColumViewPicIcon_3.png + images/example/DColumViewPicIcon_2.png + images/example/DColumViewPicIcon_1.png + images/example/DListView_3.png + images/example/DListView_2.png + images/example/DListView_1.png + images/example/DGroupBox.png + images/example/DVerticalline.png + images/example/DSearchComboBox.png + images/example/drive-harddisk-48px_1.svg + images/example/drive-harddisk-48px_2.svg + images/example/drive-harddisk-48px_3.svg + images/example/drive-harddisk-48px.svg + images/example/Oval_186.svg + images/example/movie-logo.svg + images/example/background.png + images/example/DMenu.png + images/example/DMenuPicture_1.png + images/example/DMenuPicture_2.png + images/example/DMenuPicture_4.png + images/example/DMenuPicture_3.png + images/example/DDialog.png + images/example/DFileDialog.png + images/example/dock_notice.png + images/example/DDialog_1.png + images/example/DDialog_2.png + images/example/DFileDialog_2.png + images/example/DFileDialog_1.png + + diff -Nru dtkwidget-5.5.48/examples/collections/imageviewerexample.cpp dtkwidget-5.6.12/examples/collections/imageviewerexample.cpp --- dtkwidget-5.5.48/examples/collections/imageviewerexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/imageviewerexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,79 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "imageviewerexample.h" + +#include +#include + +#include + +ImageViewerExampleWindow::ImageViewerExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new ImageViewerExample(this)); +} + +ImageViewerExample::ImageViewerExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QHBoxLayout *mainLayout = new QHBoxLayout(this); + setLayout(mainLayout); + + QVBoxLayout *buttonLayout = new QVBoxLayout; + buttonLayout->setMargin(0); + buttonLayout->setSpacing(0); + + DPushButton *fitToWidget = new DPushButton("适应窗口", this); + DPushButton *fitNormalSize = new DPushButton("1:1视图", this); + DPushButton *rotate = new DPushButton("顺时针旋转", this); + DPushButton *counterRotate = new DPushButton("顺时针旋转", this); + DPushButton *beginCrop = new DPushButton("开始裁剪", this); + DPushButton *endCrop = new DPushButton("结束裁剪", this); + DPushButton *reset = new DPushButton("复位", this); + + buttonLayout->addWidget(fitToWidget); + buttonLayout->addWidget(fitNormalSize); + buttonLayout->addWidget(rotate); + buttonLayout->addWidget(counterRotate); + buttonLayout->addWidget(beginCrop); + buttonLayout->addWidget(endCrop); + buttonLayout->addWidget(reset); + + DImageViewer *imageViewer = new DImageViewer(this); + imageViewer->setFixedSize(550, 350); + imageViewer->setImage(QImage(":/images/example/DArrowRectangle.png")); + imageViewer->fitToWidget(); + + mainLayout->addSpacing(20); + mainLayout->addLayout(buttonLayout, 0); + mainLayout->addSpacing(20); + mainLayout->addWidget(imageViewer, 1, Qt::AlignCenter); + + connect(fitToWidget, &DPushButton::clicked, this, [=]() { imageViewer->fitToWidget(); }); + connect(fitNormalSize, &DPushButton::clicked, this, [=]() { imageViewer->fitNormalSize(); }); + connect(rotate, &DPushButton::clicked, this, [=]() { imageViewer->rotateClockwise(); }); + connect(counterRotate, &DPushButton::clicked, this, [=]() { imageViewer->rotateCounterclockwise(); }); + connect(beginCrop, &DPushButton::clicked, this, [=]() { imageViewer->beginCropImage(); }); + connect(endCrop, &DPushButton::clicked, this, [=]() { imageViewer->endCropImage(); }); + connect(reset, &DPushButton::clicked, this, [=]() { + imageViewer->resetRotateAngle(); + imageViewer->resetCropImage(); + }); +} + +QString ImageViewerExample::getTitleName() const +{ + return "DImageViewer"; +} + +QString ImageViewerExample::getDescriptionInfo() const +{ + return "图片浏览控件,提供图片展示、旋转及裁剪功能"; +} + +int ImageViewerExample::getFixedHeight() const +{ + return 400; +} diff -Nru dtkwidget-5.5.48/examples/collections/imageviewerexample.h dtkwidget-5.6.12/examples/collections/imageviewerexample.h --- dtkwidget-5.5.48/examples/collections/imageviewerexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/imageviewerexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef IMAGEVIEWEREXAMPLE_H +#define IMAGEVIEWEREXAMPLE_H + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +DWIDGET_USE_NAMESPACE + +class ImageViewerExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit ImageViewerExampleWindow(QWidget *parent = nullptr); +}; + +class ImageViewerExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit ImageViewerExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // IMAGEVIEWEREXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/layoutexample.cpp dtkwidget-5.6.12/examples/collections/layoutexample.cpp --- dtkwidget-5.5.48/examples/collections/layoutexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/layoutexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,209 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include + +#include +#include + +#include "layoutexample.h" + +DWIDGET_USE_NAMESPACE + +LayoutExampleWindow::LayoutExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DFrameExample(this)); + addExampleWindow(new DSplitterExample(this)); + addExampleWindow(new DVerticalLineExample(this)); + addExampleWindow(new DHorizontalLineExample(this)); +} + +DFrameExample::DFrameExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *layout = new QVBoxLayout(this); + QWidget *frameWidget = new QWidget(this); + QWidget *framePicWidget = new QWidget(this); + + DFrame *frame = new DFrame(frameWidget); + QLabel *picLabel = new QLabel(framePicWidget); + + QHBoxLayout *frameLayout = new QHBoxLayout(frameWidget); + QHBoxLayout *picLayout = new QHBoxLayout(framePicWidget); + + QPixmap picPixmap(":/images/example/DFrame.png"); + + frame->setFixedHeight(240); + + picLabel->setFixedSize(550, 426); + picLabel->setScaledContents(true); + picLabel->setPixmap(picPixmap); + + frameLayout->setContentsMargins(23, 0, 23, 0); + frameLayout->addWidget(frame); + picLayout->setMargin(0); + picLayout->addWidget(picLabel); + + layout->setSpacing(0); + layout->addSpacing(30); + layout->addWidget(frameWidget); + layout->addSpacing(70); + layout->addWidget(framePicWidget); + layout->addSpacing(70); + layout->setContentsMargins(10, 0, 10, 0); +} + +QString DFrameExample::getTitleName() const +{ + return "DFrame"; +} + +QString DFrameExample::getDescriptionInfo() const +{ + return QString("用于框选某一部分选项,让这些框选的\n部分作为一个整体。"); +} + +int DFrameExample::getFixedHeight() const +{ + return 836; +} + +DSplitterExample::DSplitterExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *layout = new QVBoxLayout(this); + QWidget *splitterWidget = new QWidget(this); + QWidget *splitterPicWidget = new QWidget(this); + + DSplitter *hSplitter = new DSplitter(Qt::Horizontal, splitterWidget); + QLabel *picLabel = new QLabel(splitterPicWidget); + + QHBoxLayout *splitterLayout = new QHBoxLayout(splitterWidget); + QHBoxLayout *picLayout = new QHBoxLayout(splitterPicWidget); + + QPixmap picPixmap(":/images/example/DSplitter.png"); + + QWidget *spRightWidget = new QWidget; + + spRightWidget->setBackgroundRole(QPalette::Window); + spRightWidget->setAutoFillBackground(true); + + hSplitter->setFrameShape(QFrame::Panel); + hSplitter->setFrameShadow(QFrame::Raised); + hSplitter->setHandleWidth(2); + hSplitter->setFixedHeight(126); + hSplitter->addWidget(new QWidget); + hSplitter->addWidget(spRightWidget); + hSplitter->setSizes({1, 6}); + + picLabel->setFixedSize(550, 372); + picLabel->setScaledContents(true); + picLabel->setPixmap(picPixmap); + + splitterLayout->setSpacing(100); + splitterLayout->setContentsMargins(169, 0, 169, 0); + splitterLayout->addWidget(hSplitter); + picLayout->setMargin(0); + picLayout->addWidget(picLabel); + + layout->setSpacing(0); + layout->addSpacing(30); + layout->addWidget(splitterWidget); + layout->addSpacing(70); + layout->addWidget(splitterPicWidget); + layout->addSpacing(70); + layout->setContentsMargins(10, 0, 10, 0); +} + +QString DSplitterExample::getTitleName() const +{ + return "DSplitter"; +} + +QString DSplitterExample::getDescriptionInfo() const +{ + return QString("所有需要左右隔开的地方,进行区域分\n隔。"); +} + +int DSplitterExample::getFixedHeight() const +{ + return 668; +} + +DVerticalLineExample::DVerticalLineExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *layout = new QVBoxLayout(this); + QWidget *verticalLineWidget = new QWidget(this); + QWidget *verticalLinePicWidget = new QWidget(this); + + DVerticalLine *verticalLine = new DVerticalLine(verticalLineWidget); + QLabel *picLabel = new QLabel(verticalLinePicWidget); + + QHBoxLayout *verticalLineLayout = new QHBoxLayout(verticalLineWidget); + QHBoxLayout *picLayout = new QHBoxLayout(verticalLinePicWidget); + + QPixmap picPixmap(":/images/example/DVerticalline.png"); + + verticalLine->setFixedHeight(28); + + picLabel->setFixedSize(550, 356); + picLabel->setScaledContents(true); + picLabel->setPixmap(picPixmap); + + verticalLineLayout->setMargin(0); + verticalLineLayout->addWidget(verticalLine); + picLayout->setMargin(0); + picLayout->addWidget(picLabel); + + layout->setSpacing(0); + layout->addSpacing(30); + layout->addWidget(verticalLineWidget); + layout->addSpacing(70); + layout->addWidget(verticalLinePicWidget); + layout->addSpacing(70); + layout->setContentsMargins(10, 0, 10, 0); +} + +QString DVerticalLineExample::getTitleName() const +{ + return "DVerticalLine"; +} + +QString DVerticalLineExample::getDescriptionInfo() const +{ + return QString("垂直分割线,用在左右需要分割的地\n方,比如DHeaderView里的列分割线。"); +} + +int DVerticalLineExample::getFixedHeight() const +{ + return 554; +} + +DHorizontalLineExample::DHorizontalLineExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QHBoxLayout *layout = new QHBoxLayout(this); + + DHorizontalLine *line = new DHorizontalLine(this); + layout->addWidget(line); + + layout->setContentsMargins(35, 0, 35, 0); +} + +QString DHorizontalLineExample::getTitleName() const +{ + return "DHorizontalLine"; +} + +QString DHorizontalLineExample::getDescriptionInfo() const +{ + return QString("水平分割线,用在上下需要分割的地\n方。"); +} + +int DHorizontalLineExample::getFixedHeight() const +{ + return 165; +} diff -Nru dtkwidget-5.5.48/examples/collections/layoutexample.h dtkwidget-5.6.12/examples/collections/layoutexample.h --- dtkwidget-5.5.48/examples/collections/layoutexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/layoutexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,71 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef LAYOUTEXAMPLE_H +#define LAYOUTEXAMPLE_H + +#include +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class LayoutExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit LayoutExampleWindow(QWidget *parent = nullptr); +}; + +class DFrameExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DFrameExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DSplitterExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DSplitterExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DVerticalLineExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DVerticalLineExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DHorizontalLineExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DHorizontalLineExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // LAYOUTEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/lcdnumberexample.cpp dtkwidget-5.6.12/examples/collections/lcdnumberexample.cpp --- dtkwidget-5.5.48/examples/collections/lcdnumberexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/lcdnumberexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,73 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include +#include + +#include +#include + +#include "lcdnumberexample.h" + +DWIDGET_USE_NAMESPACE + +LCDNumberExampleWindow::LCDNumberExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DLCDNumberExample(this)); +} + +DLCDNumberExample::DLCDNumberExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; + pHBoxLayout_1->setMargin(0); + pHBoxLayout_1->setSpacing(0); + + DLCDNumber *pNumber = new DLCDNumber; + pNumber->setFixedSize(82, 64); + pNumber->setDecMode(); + pNumber->setDigitCount(2); + pNumber->display("08"); + pNumber->setFrameShape(QFrame::NoFrame); + pHBoxLayout_1->addWidget(pNumber); + + pVBoxLayout->addLayout(pHBoxLayout_1); + + QLabel *pLabel_1 = new QLabel; + QPixmap pix_1(":/images/example/DLCDNumber.png"); + pLabel_1->setFixedSize(568, 444); + pLabel_1->setPixmap(pix_1); + pLabel_1->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; + pHBoxLayout_pic_1->setMargin(0); + pHBoxLayout_pic_1->setSpacing(0); + pHBoxLayout_pic_1->addWidget(pLabel_1); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_pic_1); + pVBoxLayout->addSpacing(20); +} + +QString DLCDNumberExample::getTitleName() const +{ + return "DLCDNumber"; +} + +QString DLCDNumberExample::getDescriptionInfo() const +{ + return "需要用到电子数字的地方"; +} + +int DLCDNumberExample::getFixedHeight() const +{ + return 630; +} diff -Nru dtkwidget-5.5.48/examples/collections/lcdnumberexample.h dtkwidget-5.6.12/examples/collections/lcdnumberexample.h --- dtkwidget-5.5.48/examples/collections/lcdnumberexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/lcdnumberexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef LCDNUMBEREXAMPLE_H +#define LCDNUMBEREXAMPLE_H + +#include +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class LCDNumberExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit LCDNumberExampleWindow(QWidget *parent = nullptr); +}; + +class DLCDNumberExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DLCDNumberExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // LCDNUMBEREXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/listviewexample.cpp dtkwidget-5.6.12/examples/collections/listviewexample.cpp --- dtkwidget-5.5.48/examples/collections/listviewexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/listviewexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,559 @@ +// SPDX-FileCopyrightText: 2020 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "listviewexample.h" + +DWIDGET_USE_NAMESPACE + +ListViewExampleWindow::ListViewExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DBackgroundGroupExample(this)); + addExampleWindow(new DListViewExample(this)); + addExampleWindow(new DGroupBoxExample(this)); + addExampleWindow(new DTreeViewExample(this)); + addExampleWindow(new DHeaderViewExample(this)); + addExampleWindow(new DColumnViewExample(this)); +} + +DBackgroundGroupExample::DBackgroundGroupExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + this->setFixedHeight(706); + QVBoxLayout *layout = new QVBoxLayout(this); + QWidget *bgWidget = new QWidget(this); + QWidget *bgPicWidget = new QWidget(this); + QHBoxLayout *bgwLayout = new QHBoxLayout(bgWidget); + QVBoxLayout *bgGLayout = new QVBoxLayout; + QHBoxLayout *bgpicLayout = new QHBoxLayout(bgPicWidget); + DBackgroundGroup *bgGroup = new DBackgroundGroup(bgGLayout, bgWidget); + QLabel *bgPicLabel = new QLabel(bgPicWidget); + + bgPicLabel->setAlignment(Qt::AlignCenter); + bgPicLabel->setPixmap(QPixmap(":/images/example/DBackgroundGroup.png").scaled(550, 426, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + bgpicLayout->addWidget(bgPicLabel); + + bgGroup->setItemSpacing(1); + bgGroup->setItemMargins(QMargins(0, 0, 0, 0)); + bgGroup->setBackgroundRole(QPalette::Window); + + QWidget *frame1 = new QWidget; + QWidget *frame2 = new QWidget; + QWidget *frame3 = new QWidget; + + frame1->setFixedHeight(36); + frame2->setFixedHeight(36); + frame3->setFixedHeight(36); + + bgGLayout->addWidget(frame1); + bgGLayout->addWidget(frame2); + bgGLayout->addWidget(frame3); + bgwLayout->addWidget(bgGroup); + bgwLayout->setContentsMargins(105, 0, 105, 0); + bgGLayout->setContentsMargins(0, 0, 0, 0); + bgpicLayout->setContentsMargins(0, 0, 0, 0); + + layout->setContentsMargins(10, 0, 10, 0); + layout->addSpacing(30); + layout->addWidget(bgWidget); + layout->addSpacing(70); + layout->addWidget(bgPicWidget); + layout->addStretch(); +} + +QString DBackgroundGroupExample::getTitleName() const +{ + return "DBackgroundGroup"; +} + +QString DBackgroundGroupExample::getDescriptionInfo() const +{ + return "在设置选项里作为一个组合选项的背景\n使用。"; +} + +int DBackgroundGroupExample::getFixedHeight() const +{ + return 706; +} + +DListViewExample::DListViewExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + auto listViewInit = [](DListView *lv, int fixHeight, int space, QStandardItemModel *model) { + lv->setModel(model); + lv->setItemSpacing(space); + lv->setSpacing(0); + lv->setFixedHeight(fixHeight); + lv->setContentsMargins(0, 0, 0, 0); + }; + + QVBoxLayout *layout = new QVBoxLayout(this); + QWidget *listViewWidget = new QWidget(this); + QWidget *listviewPicWidget = new QWidget(this); + QVBoxLayout *listViewWLayout = new QVBoxLayout(listViewWidget); + QVBoxLayout *listviewPicLayout = new QVBoxLayout(listviewPicWidget); + DListView *fingerPrintLV = new DListView(listViewWidget); + DListView *browserLV = new DListView(listViewWidget); + browserLV->setDragDropMode(QListView::InternalMove); + DListView *screenLV = new DListView(listViewWidget); + QStandardItemModel *fingerPrintModel = new QStandardItemModel(fingerPrintLV); + QStandardItemModel *browserModel = new QStandardItemModel(browserLV); + QStandardItemModel *screenModel = new QStandardItemModel(screenLV); + QLabel *picLabel1 = new QLabel(listviewPicWidget); + QLabel *picLabel2 = new QLabel(listviewPicWidget); + QLabel *picLabel3 = new QLabel(listviewPicWidget); + + listViewInit(fingerPrintLV, 111, 1, fingerPrintModel); + listViewInit(browserLV, 232, 10, browserModel); + listViewInit(screenLV, 326, 10, screenModel); + + picLabel1->setAlignment(Qt::AlignCenter); + picLabel2->setAlignment(Qt::AlignCenter); + picLabel3->setAlignment(Qt::AlignCenter); + picLabel1->setPixmap(QPixmap(":/images/example/DListView_1.png").scaled(550, 426, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + picLabel2->setPixmap(QPixmap(":/images/example/DListView_2.png").scaled(550, 426, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + picLabel3->setPixmap(QPixmap(":/images/example/DListView_3.png").scaled(550, 426, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + + DStandardItem *fingerPrintItem1 = new DStandardItem("右手大拇指"); + DStandardItem *fingerPrintItem2 = new DStandardItem("手指2"); + DStandardItem *fingerPrintItem3 = new DStandardItem("添加指纹"); + + DStandardItem *browserItem1 = new DStandardItem(QIcon("://images/example/DListViewBrowser_1.svg"), "谷歌浏览器"); + + browserModel->setItemPrototype(new DStandardItem()); + // 设置其他style时,转换指针为空 + if (DStyle *ds = qobject_cast(style())) { + auto action = new DViewItemAction(Qt::AlignVCenter, QSize(), QSize(), true); + action->setIcon(ds->standardIcon(DStyle::SP_IndicatorChecked)); + action->setParent(this); + browserItem1->setActionList(Qt::Edge::RightEdge, {action}); + connect(action, &DViewItemAction::triggered, this, [action, browserModel]() { + for (int i = 0; i < browserModel->rowCount(); i++) { + auto item = dynamic_cast(browserModel->item(i)); + Q_ASSERT(item); + if (item->actionList(Qt::RightEdge).contains(action)) + qDebug() << "clicked the row" << i; + } + }); + } + + DStandardItem *browserItem2 = new DStandardItem(QIcon("://images/example/DListViewBrowser_2.svg"), "火狐浏览器"); + DStandardItem *browserItem3 = new DStandardItem(QIcon("://images/example/DListViewBrowser_3.svg"), "遨游浏览器"); + DStandardItem *browserItem4 = new DStandardItem(QIcon("://images/example/DListViewBrowser_4.svg"), "Opera"); + + DStandardItem *screenItem1 = new DStandardItem(QIcon(":/images/example/DListViewScreen_1.svg"), "复制"); + DViewItemAction *screenItemAction1 = new DViewItemAction; + + screenItemAction1->setText("把您的一个屏幕的内容复制到另外一个或多个屏幕"); + screenItemAction1->setFontSize(DFontSizeManager::T8); + screenItemAction1->setTextColorRole(DPalette::TextTips); + screenItemAction1->setParent(this); + screenItem1->setTextActionList({screenItemAction1}); + + DStandardItem *screenItem2 = new DStandardItem(QIcon(":/images/example/DListViewScreen_2.svg"), "拓展"); + DViewItemAction *screenItemAction2 = new DViewItemAction; + + screenItemAction2->setText("将您的屏幕内容扩展,在不同屏幕上显示不同内容"); + screenItemAction2->setFontSize(DFontSizeManager::T8); + screenItemAction2->setTextColorRole(DPalette::TextTips); + screenItemAction2->setParent(this); + screenItem2->setTextActionList({screenItemAction2}); + + DStandardItem *screenItem3 = new DStandardItem(QIcon(":/images/example/DListViewScreen_3.svg"), "只在 VGA1显示"); + DViewItemAction *screenItemAction3 = new DViewItemAction; + + screenItemAction3->setText("只在 VGA1上显示屏幕内容,其他屏幕不显示"); + screenItemAction3->setFontSize(DFontSizeManager::T8); + screenItemAction3->setTextColorRole(DPalette::TextTips); + screenItemAction3->setParent(this); + screenItem3->setTextActionList({screenItemAction3}); + + DStandardItem *screenItem4 = new DStandardItem(QIcon(":/images/example/DListViewScreen_4.svg"), "只在 LVDS1显示"); + DViewItemAction *screenItemAction4 = new DViewItemAction; + + screenItemAction4->setText("只在 LVDS1上显示屏幕内容,其他屏幕不显示"); + screenItemAction4->setFontSize(DFontSizeManager::T8); + screenItemAction4->setTextColorRole(DPalette::TextTips); + screenItemAction4->setParent(this); + screenItem4->setTextActionList({screenItemAction4}); + + fingerPrintItem3->setFontSize(DFontSizeManager::T8); + fingerPrintItem3->setTextColorRole(DPalette::Link); + fingerPrintItem3->setSelectable(false); + + fingerPrintModel->appendRow(fingerPrintItem1); + fingerPrintModel->appendRow(fingerPrintItem2); + fingerPrintModel->appendRow(fingerPrintItem3); + browserModel->appendRow(browserItem1); + browserModel->appendRow(browserItem2); + browserModel->appendRow(browserItem3); + browserModel->appendRow(browserItem4); + screenModel->appendRow(screenItem1); + screenModel->appendRow(screenItem2); + screenModel->appendRow(screenItem3); + screenModel->appendRow(screenItem4); + + for (int i = 0 ; i < browserModel->rowCount(); i++) + { + auto item = browserModel->item(i); + item->setDragEnabled(true); + item->setDropEnabled(false); + } + + listViewWLayout->setContentsMargins(85, 0, 85, 0); + listViewWLayout->setSpacing(60); + listViewWLayout->addWidget(fingerPrintLV, 2); + listViewWLayout->addWidget(browserLV, 3); + listViewWLayout->addWidget(screenLV, 4); + listviewPicLayout->setSpacing(30); + listviewPicLayout->addWidget(picLabel1); + listviewPicLayout->addWidget(picLabel2); + listviewPicLayout->addWidget(picLabel3); + layout->addSpacing(30); + layout->setSpacing(70); + layout->setContentsMargins(10, 0, 10, 0); + layout->addWidget(listViewWidget); + layout->addWidget(listviewPicWidget); + layout->addStretch(); +} + +QString DListViewExample::getTitleName() const +{ + return "DListView"; +} + +QString DListViewExample::getDescriptionInfo() const +{ + return "标准的单行列表\n带图标的单行列表\n带图标的多行列表"; +} + +int DListViewExample::getFixedHeight() const +{ + return 2286; +} + +DGroupBoxExample::DGroupBoxExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + this->setFixedHeight(644); + + QWidget *groupBoxWidget = new QWidget(this); + QWidget *gbPicWidget = new QWidget(this); + QHBoxLayout *gbPicLayout = new QHBoxLayout(gbPicWidget); + QVBoxLayout *layout = new QVBoxLayout(this); + QVBoxLayout *groupBoxWLayout = new QVBoxLayout(groupBoxWidget); + DGroupBox *groupBox = new DGroupBox(groupBoxWidget); + QVBoxLayout *groupBoxLayout = new QVBoxLayout(groupBox); + QWidget *contentWidget = new QWidget(groupBox); + QHBoxLayout *contentLayout = new QHBoxLayout(contentWidget); + QLabel *contentTextLabel = new QLabel("代理方式"); + QComboBox *contentComboBox = new QComboBox; + QLabel *gbPicLabel = new QLabel(gbPicWidget); + + gbPicLabel->setAlignment(Qt::AlignCenter); + gbPicLabel->setPixmap(QPixmap(":/images/example/DGroupBox.png").scaled(568, 444, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + contentComboBox->addItems({"自动"}); + contentComboBox->setMinimumWidth(213); + + contentLayout->setContentsMargins(10, 6, 10, 6); + contentLayout->addWidget(contentTextLabel); + contentLayout->addStretch(); + contentLayout->addWidget(contentComboBox); + + groupBoxLayout->setContentsMargins(0, 0, 0, 0); + groupBoxLayout->addWidget(contentWidget); + groupBoxWLayout->setContentsMargins(105, 0, 105, 0); + groupBoxWLayout->addWidget(groupBox); + + gbPicLayout->setContentsMargins(0, 0, 0, 0); + gbPicLayout->addWidget(gbPicLabel); + layout->setContentsMargins(0, 0, 0, 0); + layout->setSpacing(0); + layout->addSpacing(30); + layout->addWidget(groupBoxWidget, 0); + layout->addSpacing(70); + layout->addWidget(gbPicWidget, 1); + layout->addSpacing(70); +} + +QString DGroupBoxExample::getTitleName() const +{ + return "DGroupBox"; +} + +QString DGroupBoxExample::getDescriptionInfo() const +{ + return "提供一个可以存放多个控件的区域,里\n面内容可以随意组合。"; +} + +int DGroupBoxExample::getFixedHeight() const +{ + return 644; +} + +DTreeViewExample::DTreeViewExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + this->setFixedHeight(908); + + QVBoxLayout *layout = new QVBoxLayout(this); + QWidget *treeViewWidget = new QWidget; + QWidget *tvPicWidget = new QWidget; + QVBoxLayout *tvLayout = new QVBoxLayout(treeViewWidget); + QVBoxLayout *tvPLayout = new QVBoxLayout(tvPicWidget); + DTreeView *treeView = new DTreeView; + QStandardItemModel *model = new QStandardItemModel(treeView); + QStyledItemDelegate *delegate = new QStyledItemDelegate(treeView); + QLabel *picLabel = new QLabel; + + picLabel->setAlignment(Qt::AlignCenter); + picLabel->setPixmap(QPixmap(":/images/example/DTreeView.png").scaled(550, 414, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + + treeView->setItemDelegate(delegate); + treeView->setModel(model); + treeView->setHeaderHidden(true); + treeView->setFrameShape(QFrame::NoFrame); + treeView->expandAll(); + treeViewWidget->setFixedHeight(324); + + DStandardItem *groupItem = new DStandardItem("群组"); + DStandardItem *friendItem = new DStandardItem("我的好友"); + DStandardItem *classmateItem = new DStandardItem("同学"); + DStandardItem *relativeItem = new DStandardItem("亲人"); + + DStandardItem *friend1 = new DStandardItem(QIcon(":/images/example/DTreeViewIcon_1.svg"), "张三"); + DStandardItem *friend2 = new DStandardItem(QIcon(":/images/example/DTreeViewIcon_2.svg"), "老吴"); + DStandardItem *friend3 = new DStandardItem(QIcon(":/images/example/DTreeViewIcon_3.svg"), "李四"); + DStandardItem *friend4 = new DStandardItem(QIcon(":/images/example/DTreeViewIcon_4.svg"), "安吉"); + DStandardItem *friend5 = new DStandardItem(QIcon(":/images/example/DTreeViewIcon_5.svg"), "陈永斌"); + + groupItem->setFontSize(DFontSizeManager::T6); + groupItem->setSizeHint(QSize(groupItem->sizeHint().width(), 36)); + friendItem->setFontSize(DFontSizeManager::T6); + friendItem->setSizeHint(QSize(friendItem->sizeHint().width(), 36)); + classmateItem->setFontSize(DFontSizeManager::T6); + classmateItem->setSizeHint(QSize(classmateItem->sizeHint().width(), 36)); + relativeItem->setFontSize(DFontSizeManager::T6); + relativeItem->setSizeHint(QSize(relativeItem->sizeHint().width(), 36)); + + friend1->setSizeHint(QSize(friend1->sizeHint().width(), 36)); + friend1->setFontSize(DFontSizeManager::T7); + friend1->setBackgroundRole(DPalette::AlternateBase); + friend2->setSizeHint(QSize(friend2->sizeHint().width(), 36)); + friend2->setFontSize(DFontSizeManager::T7); + friend2->setBackgroundRole(DPalette::AlternateBase); + friend3->setSizeHint(QSize(friend3->sizeHint().width(), 36)); + friend3->setFontSize(DFontSizeManager::T7); + friend3->setBackgroundRole(DPalette::AlternateBase); + friend4->setSizeHint(QSize(friend4->sizeHint().width(), 36)); + friend4->setFontSize(DFontSizeManager::T7); + friend4->setBackgroundRole(DPalette::AlternateBase); + friend5->setSizeHint(QSize(friend5->sizeHint().width(), 36)); + friend5->setFontSize(DFontSizeManager::T7); + friend5->setBackgroundRole(DPalette::AlternateBase); + + model->appendRow(groupItem); + model->appendRow(friendItem); + model->appendRow(classmateItem); + model->appendRow(relativeItem); + treeView->setExpanded(model->index(1, 0), true); + // 此处统一设置了iconsize 但仅有第一个生效 原因不明 + treeView->setIconSize(QSize(24, 24)); + + friendItem->appendRows({friend1, friend2, friend3, friend4, friend5}); + treeView->setCurrentIndex(model->indexFromItem(friend4)); + + tvLayout->setContentsMargins(160, 0, 160, 0); + tvPLayout->setContentsMargins(0, 0, 0, 0); + tvLayout->addWidget(treeView); + tvPLayout->addWidget(picLabel); + layout->setContentsMargins(10, 0, 10, 0); + layout->addSpacing(30); + layout->setSpacing(70); + layout->addWidget(treeViewWidget); + layout->addWidget(tvPicWidget); + layout->addSpacing(70); +} + +QString DTreeViewExample::getTitleName() const +{ + return "DTreeView"; +} + +QString DTreeViewExample::getDescriptionInfo() const +{ + return "需要使用树状结构的地方。"; +} + +int DTreeViewExample::getFixedHeight() const +{ + return 908; +} + +DHeaderViewExample::DHeaderViewExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + this->setFixedHeight(805); + + QVBoxLayout *layout = new QVBoxLayout(this); + QWidget *headerviewWidget = new QWidget(this); + QWidget *hvPicWidget = new QWidget(this); + QVBoxLayout *hvLayout = new QVBoxLayout(headerviewWidget); + QVBoxLayout *hvpicLayout = new QVBoxLayout(hvPicWidget); + DListView *tv = new DListView; + QLabel *picLabel = new QLabel; + QStandardItemModel *model = new QStandardItemModel(this); + DHeaderView *headerview = new DHeaderView(Qt::Horizontal); + QStandardItemModel *hmodel = new QStandardItemModel(this); + + headerview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + headerview->setModel(hmodel); + picLabel->setAlignment(Qt::AlignCenter); + picLabel->setPixmap(QPixmap(":/images/example/DHeaderView.png").scaled(560, 373, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + headerview->setMaximumHeight(36); + headerview->setSectionResizeMode(DHeaderView::Stretch); + headerview->setSortIndicator(0, Qt::SortOrder::DescendingOrder); + headerview->setSectionsClickable(true); + headerview->setSortIndicatorShown(true); + + tv->setModel(model); + tv->setItemSpacing(0); + tv->setSpacing(0); + tv->addHeaderWidget(headerview); + headerviewWidget->setFixedHeight(278); + + hmodel->setHorizontalHeaderLabels({"名称", "修改时间", "类型", "大小"}); + + model->appendRow(new DStandardItem(QIcon::fromTheme("folder-videos"), "视频")); + model->appendRow(new DStandardItem(QIcon::fromTheme("folder-pictures"), "图片")); + model->appendRow(new DStandardItem(QIcon::fromTheme("folder-documents"), "文档")); + model->appendRow(new DStandardItem(QIcon::fromTheme("folder-downloads"), "下载")); + model->appendRow(new DStandardItem(QIcon::fromTheme("folder-music"), "音乐")); + model->appendRow(new DStandardItem(QIcon::fromTheme("user-desktop"), "桌面")); + + hvpicLayout->addWidget(picLabel); + hvpicLayout->setContentsMargins(0, 0, 0, 0); + hvLayout->addWidget(tv); + hvLayout->setContentsMargins(0, 0, 0, 0); + layout->addSpacing(30); + layout->setSpacing(70); + layout->setContentsMargins(10, 0, 10, 0); + layout->addWidget(headerviewWidget); + layout->addWidget(hvPicWidget); + layout->addSpacing(70); +} + +QString DHeaderViewExample::getTitleName() const +{ + return "DHeaderView"; +} + +QString DHeaderViewExample::getDescriptionInfo() const +{ + return "列表视图的头部,方便用户进行排序及\n正序倒序。"; +} + +int DHeaderViewExample::getFixedHeight() const +{ + return 805; +} + +DColumnViewExample::DColumnViewExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *layout = new QVBoxLayout(this); + DFrame *frame = new DFrame(this); + QHBoxLayout *frameLayout = new QHBoxLayout(frame); + + DColumnView *cv = new DColumnView; + QStandardItemModel *model = new QStandardItemModel(this); + QStyledItemDelegate *itemDelegate = new QStyledItemDelegate(cv); + + auto insertItem = [](const QString &name, const QIcon &icon, QStandardItemModel *model = nullptr, DStandardItem *parentItem = nullptr) + -> DStandardItem * { + DStandardItem *item = new DStandardItem(icon, name); + item->setEditable(false); + item->setFontSize(DFontSizeManager::T8); + + if (model) + model->appendRow(item); + + if (parentItem) + parentItem->appendRow(item); + + return item; + }; + + frame->setFixedHeight(336); + cv->setFrameShape(QFrame::NoFrame); + cv->setColumnWidths({121, 162}); + cv->setItemDelegate(itemDelegate); + cv->setIconSize(DSizeModeHelper::element(QSize(16,16), QSize(24, 24))); + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, [cv]() { + cv->setIconSize(DSizeModeHelper::element(QSize(16,16), QSize(24, 24))); + }); + + insertItem("视频", style()->standardIcon(QStyle::SP_DirIcon), model); + DStandardItem *picItem = insertItem("图片", style()->standardIcon(QStyle::SP_DirIcon), model); + insertItem("文档", style()->standardIcon(QStyle::SP_DirIcon), model); + insertItem("下载", style()->standardIcon(QStyle::SP_DirIcon), model); + insertItem("音乐", style()->standardIcon(QStyle::SP_DirIcon), model); + insertItem("桌面", style()->standardIcon(QStyle::SP_DirIcon), model); + + insertItem("我的图片", style()->standardIcon(QStyle::SP_DirIcon), nullptr, picItem); + DStandardItem *myPicItem = insertItem("我的壁纸", style()->standardIcon(QStyle::SP_DirIcon), nullptr, picItem); + insertItem("Snapshot", style()->standardIcon(QStyle::SP_DirIcon), nullptr, picItem); + insertItem("深度截图", style()->standardIcon(QStyle::SP_DirIcon), nullptr, picItem); + insertItem("iphone相册", style()->standardIcon(QStyle::SP_DirIcon), nullptr, picItem); + + insertItem("[WP] Mosaic [textless].jpg", QIcon(":/images/example/DColumViewPicIcon_1.png"), nullptr, myPicItem); + insertItem("2.jpg", QIcon(":/images/example/DColumViewPicIcon_2.png"), nullptr, myPicItem); + insertItem("underwater_16_10.jpg", QIcon(":/images/example/DColumViewPicIcon_3.png"), nullptr, myPicItem); + insertItem("inthe sky.jpg", QIcon(":/images/example/DColumViewPicIcon_4.png"), nullptr, myPicItem); + insertItem("25_III_2560_1600.jpg", QIcon(":/images/example/DColumViewPicIcon_5.png"), nullptr, myPicItem); + insertItem("164_scaled.jpg", QIcon(":/images/example/DColumViewPicIcon_6.png"), nullptr, myPicItem); + insertItem("[WP] Mosaic [textless].jpg", QIcon(":/images/example/DColumViewPicIcon_7.png"), nullptr, myPicItem); + insertItem("03345_tyrrhenum_3840x2400.jpg", QIcon(":/images/example/DColumViewPicIcon_8.png"), nullptr, myPicItem); + insertItem("03215_goodmorningyosemite_38..", QIcon(":/images/example/DColumViewPicIcon_9.png"), nullptr, myPicItem); + + cv->setModel(model); + cv->setCurrentIndex(model->indexFromItem(picItem)); + cv->setCurrentIndex(model->indexFromItem(myPicItem)); + + frameLayout->addWidget(cv); + frameLayout->setContentsMargins(5, 5, 5, 5); + layout->setContentsMargins(10, 0, 10, 0); + layout->addSpacing(30); + layout->addWidget(frame); + layout->addSpacing(70); +} + +QString DColumnViewExample::getTitleName() const +{ + return "DColumnView"; +} + +QString DColumnViewExample::getDescriptionInfo() const +{ + return "列视图,列数不是固定的,根据显示的\n空间和实际的层级决定。"; +} + +int DColumnViewExample::getFixedHeight() const +{ + return 425; +} diff -Nru dtkwidget-5.5.48/examples/collections/listviewexample.h dtkwidget-5.6.12/examples/collections/listviewexample.h --- dtkwidget-5.5.48/examples/collections/listviewexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/listviewexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,95 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef LISTVIEWEXAMPLE_H +#define LISTVIEWEXAMPLE_H + +#include +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class ListViewExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit ListViewExampleWindow(QWidget *parent = nullptr); +}; + +class DBackgroundGroupExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DBackgroundGroupExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DListViewExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DListViewExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DGroupBoxExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DGroupBoxExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DTreeViewExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DTreeViewExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DHeaderViewExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DHeaderViewExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DColumnViewExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DColumnViewExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // LISTVIEWEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/main.cpp dtkwidget-5.6.12/examples/collections/main.cpp --- dtkwidget-5.5.48/examples/collections/main.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/main.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,54 @@ +// SPDX-FileCopyrightText: 2015 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "mainwindow.h" + +#include +#include +#include + +#include + +DCORE_USE_NAMESPACE +DWIDGET_USE_NAMESPACE + +int main(int argc, char *argv[]) +{ +#if defined(DTK_STATIC_LIB) + DWIDGET_INIT_RESOURCE(); +#endif + DApplication *a = DApplication::globalApplication(argc, argv); + + DApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); + DLogManager::registerConsoleAppender(); + + a->loadTranslator(); +#ifdef Q_OS_UNIX + a->setOOMScoreAdj(500); +#endif + + a->setAutoActivateWindows(true); + if (!a->setSingleInstance("deepin-tool-kit-examples")) { + qDebug() << "another instance is running!!"; + return 0; + } + + a->setApplicationName("dtk-example"); + a->setOrganizationName("deepin"); + a->setApplicationVersion("1.0"); + a->setProductIcon(QIcon(":/images/logo_icon.svg")); + a->setWindowIcon(QIcon(":/images/logo_icon.svg")); + a->setApplicationDescription(QApplication::translate("main", "Collections provides the examples for dtk applications.")); + a->setApplicationDisplayName(QObject::tr("Collections")); + a->setApplicationLicense(QObject::tr("2023 UnionTech Software Technology Co., Ltd.")); + a->setApplicationCreditsFile(":/resources/data/example-license.json"); + a->setLicensePath(":/resources/data"); + + MainWindow w; + w.show(); + + Dtk::Widget::moveToCenter(&w); + + return a->exec(); +} diff -Nru dtkwidget-5.5.48/examples/collections/mainwindow.cpp dtkwidget-5.6.12/examples/collections/mainwindow.cpp --- dtkwidget-5.5.48/examples/collections/mainwindow.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/mainwindow.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,468 @@ +// SPDX-FileCopyrightText: 2015 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "buttonexample.h" +#include "dlicensedialog.h" +#include "editexample.h" +#include "sliderexample.h" +#include "menuexample.h" +#include "listviewexample.h" +#include "windowexample.h" +#include "tooltipexample.h" +#include "spinnerexample.h" +#include "dialogexample.h" +#include "progressbarexample.h" +#include "layoutexample.h" +#include "scrollbarexample.h" +#include "rubberbandexample.h" +#include "widgetexample.h" +#include "lcdnumberexample.h" +#include "imageviewerexample.h" +#include "mainwindow.h" +#include "dsettingsbackend.h" +#include "qsettingbackend.h" +#include "dsettingsdialog.h" +#include "dsettingsoption.h" +#include "dsettings.h" +#include "dfeaturedisplaydialog.h" +#include "dtitlebarsettings.h" + +DCORE_USE_NAMESPACE +DWIDGET_USE_NAMESPACE + +class DTitleBarToolCut : public DTitleBarToolInterface { +public: + virtual QString id() const override + { + return "builtin/edit-cut"; + } + virtual QString description() override + { + return "edit-cut"; + } + virtual QString iconName() override + { + return "edit-cut"; + } + virtual QWidget *createView() override + { + auto view = new DIconButton(); + view->setFixedSize(82, 36); + view->setIconSize(QSize(36, 36)); + view->setIcon(QIcon::fromTheme("edit-cut")); + connect(this, &DTitleBarToolInterface::triggered, this, [this](){ + qInfo() << "edit-cut executed"; + }); + connect(view, &DIconButton::clicked, this, [this](){ + qInfo() << "edit-cut executed"; + }); + return view; + } +}; + +class DTitleBarToolDelete : public DTitleBarToolInterface { +public: + virtual QString id() const override + { + return "builtin/edit-delete"; + } + virtual QString description() override + { + return "edit-delete"; + } + virtual QString iconName() override + { + return "edit-delete"; + } + virtual QWidget *createView() override + { + auto view = new DIconButton(); + view->setFixedSize(82, 36); + view->setIconSize(QSize(36, 36)); + view->setIcon(QIcon::fromTheme("edit-delete")); + + connect(this, &DTitleBarToolInterface::triggered, this, [this](){ + qInfo() << "edit-delete executed"; + }); + connect(view, &DIconButton::clicked, this, [this](){ + qInfo() << "edit-delete executed"; + }); + return view; + } +}; + +class DTitleBarToolFind : public DTitleBarToolInterface { +public: + virtual QString id() const override + { + return "builtin/edit-find"; + } + virtual QString description() override + { + return "edit-find"; + } + virtual QString iconName() override + { + return "edit-find"; + } + virtual QWidget *createView() override + { + auto view = new DIconButton(); + view->setFixedSize(36, 36); + view->setIconSize(QSize(36, 36)); + view->setIcon(QIcon::fromTheme("edit-find")); + + connect(this, &DTitleBarToolInterface::triggered,this, [this](){ + qInfo() << "edit-find executed"; + }); + connect(view, &DIconButton::clicked, this, [this](){ + qInfo() << "edit-find executed"; + }); + return view; + } +}; + + +MainWindow::MainWindow(QWidget *parent) + : DMainWindow(parent) +{ + setWindowIcon(QIcon(":/images/logo_icon.svg")); + setMinimumSize(qApp->primaryScreen()->availableSize() / 5 * 3); + + QHBoxLayout *mainLayout = new QHBoxLayout(); + mainLayout->setMargin(0); + mainLayout->setSpacing(5); + + QWidget *centralWidget = new QWidget(this); + centralWidget->setLayout(mainLayout); + setCentralWidget(centralWidget); + + m_pStackedWidget = new QStackedWidget; + m_pListViewModel = new QStandardItemModel(this); + + m_pListView = new DListView(this); + m_pListView->setFixedWidth(200); + m_pListView->setItemSpacing(0); + m_pListView->setModel(m_pListViewModel); + + setSidebarWidget(m_pListView); + setSidebarWidth(200); + +// mainLayout->addWidget(m_pListView); + + mainLayout->addWidget(m_pStackedWidget); + + initModel(); + + connect(m_pListView, SIGNAL(currentChanged(const QModelIndex &)), this, SLOT(onCurrentIndexChanged(const QModelIndex &))); + + DTitlebar *titlebar = this->titlebar(); + titlebar->setIcon(QIcon(":/images/logo_icon.svg")); + + if (titlebar) { + titlebar->setMenu(new QMenu(titlebar)); + titlebar->setSeparatorVisible(true); + titlebar->menu()->addAction("dfm-settings"); + titlebar->menu()->addAction("dt-settings"); + titlebar->menu()->addAction("testPrinter"); + auto sizeModeAction = titlebar->menu()->addAction( + QString("SizeMode/%1").arg(DGuiApplicationHelper::isCompactMode() ? "Compact" : "Normal")); + connect(sizeModeAction, &QAction::triggered, this, [sizeModeAction]() { + DGuiApplicationHelper::instance()->setSizeMode(DGuiApplicationHelper::isCompactMode() + ? DGuiApplicationHelper::NormalMode + : DGuiApplicationHelper::CompactMode); + sizeModeAction->setText( + QString("SizeMode/%1").arg(DGuiApplicationHelper::isCompactMode() ? "Compact" : "Normal")); + }); + QMenu *menu = titlebar->menu()->addMenu("sub-menu"); + connect(menu->addAction("show full screen"), &QAction::triggered, this, [this]() { + this->isFullScreen() ? this->showNormal() : this->showFullScreen(); + if (QAction *action = qobject_cast(sender())) { + action->setText(this->isFullScreen() ? "show normal window" : "show full screen"); + } + }); + connect(menu->addAction("ddialog"), &QAction::triggered, this, []() { + DDialog dlg("this is title", "this is message text......"); + dlg.addButton("ok", true, DDialog::ButtonWarning); + dlg.setIcon(QIcon::fromTheme("dialog-information")); + dlg.exec(); + }); + connect(titlebar->menu(), &QMenu::triggered, this, &MainWindow::menuItemInvoked); + + titlebar->setDisableFlags(Qt::WindowMinimizeButtonHint + | Qt::WindowMaximizeButtonHint + | Qt::WindowSystemMenuHint); + titlebar->setAutoHideOnFullscreen(true); + +#ifdef D_TITLEBARSETTINGS + QList tools; + tools << new DTitleBarToolCut() + << new DTitleBarToolDelete() + << new DTitleBarToolFind(); + auto settings = titlebar->settings(); + settings->initilize(tools, ":/resources/data/titlebar-settings.json"); + settings->toolsEditPanel()->setMinimumWidth(this->width()); +#endif + } + + DButtonBox *buttonBox = new DButtonBox(titlebar); + buttonBox->setFixedWidth(220); + buttonBox->setButtonList({new DButtonBoxButton("浅色模式"), new DButtonBoxButton("深色模式")}, true); + buttonBox->setId(buttonBox->buttonList().at(0), 0); + buttonBox->setId(buttonBox->buttonList().at(1), 1); + + if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) { + buttonBox->buttonList().at(0)->click(); + } else { + buttonBox->buttonList().at(1)->click(); + } + + connect(buttonBox, &DButtonBox::buttonClicked, this, [buttonBox](QAbstractButton *button) { + if (buttonBox->id(button) == 0) { + DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::LightType); + } else { + DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::DarkType); + } + }); + + titlebar->addWidget(buttonBox); + + //初始化选中主菜单第一项 + m_pListView->setCurrentIndex(m_pListViewModel->index(0, 0)); + + DFeatureDisplayDialog *dlg = qApp->featureDisplayDialog(); + dlg->setLinkButtonVisible(true); + dlg->setLinkUrl("http://www.chinauos.com"); + dlg->setTitle("欢迎使用dtk"); + dlg->addItem(new DFeatureItem(QIcon::fromTheme("dialog-warning"), "按钮", "普通的文字按钮(DPushButton),带警告颜色的按钮(DWarningButton),起引导作用的按钮(DSuggestButton),工具栏按钮(DToolButton),图标按钮(DIconButton)等。", dlg)); + dlg->addItem(new DFeatureItem(QIcon::fromTheme("dialog-warning"), "提示", "悬停显示(DToolTip),提示出现有延迟,鼠标是悬停2妙左右出现,触屏是按住就出现,带尖角的popup窗口(DArrowRectangle)。", dlg)); + dlg->addItem(new DFeatureItem(QIcon::fromTheme("dialog-warning"), "对话框", "普通对话框(DDialog),用于需要用户处理事务,又不希望跳转页面以致打断工作流程时。", dlg)); + dlg->addItem(new DFeatureItem(QIcon::fromTheme("dialog-warning"), "DSpinner", "所有需要用户等待的地方,且没有具体的等待时间,不知道进度,可能很快也可能需要比较久。", dlg)); + dlg->addItem(new DFeatureItem(QIcon::fromTheme("dialog-warning"), "进度条", "进度条(DWaterProgress)一种带趣味的展示形式,作用是减少用户枯燥的等待。", dlg)); +} + +#if 1 +#define AsynPreview +#endif + +void MainWindow::menuItemInvoked(QAction *action) +{ + if (action->text() == "testPrinter") { +// 下面注释的目的用于在 QDoc 生成文档是能够直接使用 \snippet 命令选取这段代码进行展示 +//! [0] + DPrintPreviewDialog dialog(this); + //测试保存PDF文件名称接口 + dialog.setDocName("test"); + dialog.setPluginMimeData("secrecy"); +#ifdef AsynPreview + dialog.setAsynPreview(31); + connect(&dialog, QOverload &>::of(&DPrintPreviewDialog::paintRequested), +#else + connect(&dialog, QOverload::of(&DPrintPreviewDialog::paintRequested), +#endif +#ifdef AsynPreview + this, [=](DPrinter *_printer, const QVector &pageRange) { +#else + this, [=](DPrinter *_printer) { +#endif + // 此函数内代码为调试打印内容代码,调整较随意! + _printer->setFromTo(1, 31); + QPainter painter(_printer); + bool firstPage = true; + for (int page = _printer->fromPage(); page <= _printer->toPage(); ++page) { +#ifdef AsynPreview + if (!pageRange.contains(page)) + continue; +#endif + + painter.resetTransform(); + if (!firstPage) + _printer->newPage(); + + // 给出调用方widget界面作为打印内容 + double xscale = _printer->pageRect().width() / double(this->width()); + double yscale = _printer->pageRect().height() / double(this->height()); + double scale = qMin(xscale, yscale); + painter.translate(_printer->pageRect().width() / 2.0, _printer->pageRect().height() / 2.0); + painter.scale(scale, scale); + painter.translate(-this->width() / 2, -this->height() / 2); + this->render(&painter); + + painter.resetTransform(); + QFont font /*("CESI仿宋-GB2312")*/; + font.setPixelSize(16); + font = QFont(font, painter.device()); + QRectF rect = _printer->pageRect(); + rect = QRectF(0, 0, rect.width(), rect.height()); + painter.setFont(font); + // 画可用页面矩形,提供调试效果参考 + painter.drawRect(rect); + QFontMetricsF fontMetrics(font); + QString text = QString("统信软件 第%1页").arg(page); + QRectF stringRect = fontMetrics.boundingRect(text); + //添加页脚页面信息 + painter.drawText(QPointF(rect.bottomRight().x() - stringRect.width(), rect.bottomRight().y() - stringRect.height()), + QString("统信软件 第%1页").arg(page)); + firstPage = false; + } + }); + dialog.exec(); +//! [0] + return; + } + if (action->text() == "dfm-settings") { + QTemporaryFile tmpFile; + tmpFile.open(); + Dtk::Core::QSettingBackend backend(tmpFile.fileName()); + + auto settings = Dtk::Core::DSettings::fromJsonFile(":/resources/data/dfm-settings.json"); + settings->setBackend(&backend); + + DSettingsDialog dsd(this); + dsd.updateSettings(settings); + dsd.exec(); + return; + } + + if (action->text() == "dt-settings") { + QTemporaryFile tmpFile; + tmpFile.open(); + Dtk::Core::QSettingBackend backend(tmpFile.fileName()); + + auto settings = Dtk::Core::DSettings::fromJsonFile(":/resources/data/dt-settings.json"); + settings->setBackend(&backend); + + QFontDatabase fontDatabase; + auto fontFamliy = settings->option("base.font.family"); + QMap fontDatas; + + QStringList values = fontDatabase.families(); + QStringList keys; + for (auto &v : values) { + keys << v.toLower().trimmed(); + } + fontDatas.insert("keys", keys); + fontDatas.insert("values", values); + fontFamliy->setData("items", fontDatas); + + // or you can set default value by json + if (fontFamliy->value().toString().isEmpty()) { + fontFamliy->setValue("droid serif"); + } + + connect(fontFamliy, &DSettingsOption::valueChanged, + this, [](QVariant value) { + qDebug() << "fontFamliy change" << value; + }); + + QStringList codings; + for (auto coding : QTextCodec::availableCodecs()) { + codings << coding; + } + + auto encoding = settings->option("advance.encoding.encoding"); + encoding->setData("items", codings); + encoding->setValue(0); + + DSettingsDialog dsd(this); + dsd.widgetFactory()->registerWidget("custom-button", [](QObject *obj) -> QWidget * { + if (DSettingsOption *option = qobject_cast(obj)) { + qDebug() << "create custom button:" << option->value(); + QPushButton *button = new QPushButton(option->value().toString()); + return button; + } + + return nullptr; + }); + + // 测试DSettingsDialog::setGroupVisible接口 + auto hLayout = dsd.layout(); + auto test = new QWidget; + auto layout = new QHBoxLayout(test); + auto testBtn = new QPushButton(); + testBtn->setText("test setGroupVisible"); + auto combobox = new QComboBox(); + combobox->addItem("base"); + combobox->addItem("base.custom-widgets"); + combobox->addItem("base.theme"); + combobox->addItem("shortcuts"); + combobox->addItem("advance"); + layout->addWidget(combobox); + layout->addWidget(testBtn); + hLayout->addWidget(test); + connect(testBtn, &QPushButton::clicked, [&dsd, combobox](){ + auto key = combobox->currentText(); + dsd.setGroupVisible(key, !dsd.groupIsVisible(key)); + }); + + dsd.updateSettings(settings); + dsd.exec(); + return; + } + + qDebug() << "click" << action << action->isChecked(); +} + +MainWindow::~MainWindow() +{ +} + + +void MainWindow::initModel() +{ + registerPage("Button", new ButtonExampleWindow(this), QIcon::fromTheme("icon_button")); + registerPage("Edit", new EditExampleWindow(this), QIcon::fromTheme("icon_edit")); + registerPage("Slider", new SliderExampleWindow(this), QIcon::fromTheme("icon_slider")); + registerPage("Menu", new MenuExampleWindow(this), QIcon::fromTheme("icon_menu")); + registerPage("ListView", new ListViewExampleWindow(this), QIcon::fromTheme("icon_ListView")); + registerPage("Window", new WindowExampleWindow(this), QIcon::fromTheme("icon_Window")); + registerPage("ToolTip", new ToolTipExampleWindow(this), QIcon::fromTheme("icon_Tooltip")); + registerPage("Spinner", new SpinnerExampleWindow(this), QIcon::fromTheme("icon_Spinner")); + registerPage("Dialog", new DialogExampleWindow(this), QIcon::fromTheme("icon_Dialog")); + registerPage("ProgressBar", new ProgressBarExampleWindow(this), QIcon::fromTheme("icon_ProgressBar")); + registerPage("Layout", new LayoutExampleWindow(this), QIcon::fromTheme("icon_Layout")); + registerPage("ScrollBar", new ScrollBarExampleWindow(this), QIcon::fromTheme("icon_ScrollBar")); + registerPage("RubberBand", new RubberBandExampleWindow(this), QIcon::fromTheme("icon_RubberBand")); + registerPage("Widget", new WidgetExampleWindow(this), QIcon::fromTheme("icon_Widget")); + registerPage("LCDNumber", new LCDNumberExampleWindow(this), QIcon::fromTheme("icon_LCDNumber")); + registerPage("ImageViewer", new ImageViewerExampleWindow(this), QIcon::fromTheme("icon_ScrollBar")); +} + +void MainWindow::registerPage(const QString &pageName, PageWindowInterface *pPageWindow, const QIcon &icon) +{ + auto pItem = new DStandardItem(pageName); + pItem->setIcon(icon); + pItem->setEditable(false); + m_pListViewModel->appendRow(pItem); + m_pStackedWidget->addWidget(pPageWindow); + pPageWindow->initPageWindow(); +} + +void MainWindow::onCurrentIndexChanged(const QModelIndex &) +{ + m_pStackedWidget->setCurrentIndex(m_pListView->currentIndex().row()); +} diff -Nru dtkwidget-5.5.48/examples/collections/mainwindow.h dtkwidget-5.6.12/examples/collections/mainwindow.h --- dtkwidget-5.5.48/examples/collections/mainwindow.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/mainwindow.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,43 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include + +#include "dmainwindow.h" +#include + +class PageWindowInterface; + +DWIDGET_USE_NAMESPACE + +class MainWindow : public DMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +protected Q_SLOTS: + void menuItemInvoked(QAction *action); + void onCurrentIndexChanged(const QModelIndex &index); + +private: + void initModel(); + void registerPage(const QString &pageName, PageWindowInterface *pPageWindow, const QIcon &icon = QIcon()); + +private: + QStackedWidget *m_pStackedWidget; + DListView *m_pListView; + QStandardItemModel *m_pListViewModel; +}; + +#endif // MAINWINDOW_H diff -Nru dtkwidget-5.5.48/examples/collections/menuexample.cpp dtkwidget-5.6.12/examples/collections/menuexample.cpp --- dtkwidget-5.5.48/examples/collections/menuexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/menuexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,232 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "menuexample.h" + +#include + +#include +#include +#include +#include +#include + +DWIDGET_USE_NAMESPACE + +MenuExampleWindow::MenuExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DMenuExample(this)); +} + +DMenuExample::DMenuExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + animation = new QPropertyAnimation(this, "aColor", this); + + restoreAnimation(); + connect(animation, &QPropertyAnimation::finished, this, [=]() { + animation->setStartValue(animation->endValue()); + QColor startColor = animation->startValue().value(); + animation->setEndValue(QColor(startColor.red(), startColor.green(), startColor.blue(), (255 - startColor.alpha()))); + animation->start(); + }); + + QVBoxLayout *layout = new QVBoxLayout(this); + QWidget *menuWidget = new QWidget(this); + QWidget *menuPicWidget = new QWidget(this); + QWidget *menuTopWidget = new QWidget(menuWidget); + QHBoxLayout *menuTopLayout = new QHBoxLayout(menuTopWidget); + QVBoxLayout *menuLayout = new QVBoxLayout(menuWidget); + QHBoxLayout *picLayout = new QHBoxLayout(menuPicWidget); + QLabel *label = new QLabel(menuPicWidget); + QLabel *topLeftMenuLabel = new QLabel(menuTopWidget); + QLabel *topMidMenuLabel = new QLabel(menuTopWidget); + QLabel *topRightMenuLabel = new QLabel(menuTopWidget); + QLabel *topBottomMenuLabel = new QLabel(menuTopWidget); + + topLeftMenuLabel->setFixedSize(182, 400); + topLeftMenuLabel->setPixmap(QPixmap(":/images/example/DMenuPicture_1.png")); + topLeftMenuLabel->setScaledContents(true); + + topMidMenuLabel->setFixedSize(182, 391); + topMidMenuLabel->setPixmap(QPixmap(":/images/example/DMenuPicture_2.png")); + topMidMenuLabel->setScaledContents(true); + + topRightMenuLabel->setFixedSize(162, 211); + topRightMenuLabel->setPixmap(QPixmap(":/images/example/DMenuPicture_3.png")); + topRightMenuLabel->setScaledContents(true); + + topBottomMenuLabel->setFixedSize(350, 113); + topBottomMenuLabel->setPixmap(QPixmap(":/images/example/DMenuPicture_4.png")); + topBottomMenuLabel->setScaledContents(true); + + pixmap = QPixmap(":/images/example/DMenu.png").scaled(550, 373, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + label->setFixedSize(550, 373); + label->setPixmap(pixmap); + label->setScaledContents(true); + label->setObjectName("menuPicLabel"); + label->installEventFilter(this); + + leftMenu = new QMenu(menuTopWidget); + + picLayout->setMargin(0); + picLayout->setSpacing(0); + picLayout->addWidget(label); + + connect(leftMenu, &QMenu::aboutToShow, [=]() { + animation->stop(); + restoreAnimation(); + acolor = QColor(15, 207, 255, 0); + paintRegion(); + }); + + connect(leftMenu, &QMenu::aboutToHide, [=]() { + if (label->underMouse()) { + restoreAnimation(); + animation->start(); + } else { + restoreAnimation(); + paintRegion(); + } + }); + + QMenu *leftDocumentMenu = new QMenu("新建文档"); + leftDocumentMenu->addAction("办公文档"); + leftDocumentMenu->addAction("电子表格"); + leftDocumentMenu->addAction("演示文档"); + leftDocumentMenu->addAction("文本文档"); + + QMenu *leftSortMenu = new QMenu("排序方式"); + leftSortMenu->addAction("名称"); + leftSortMenu->addAction("修改时间"); + leftSortMenu->addAction("大小"); + leftSortMenu->addAction("类型"); + + QMenu *leftShowMenu = new QMenu("显示方式"); + leftShowMenu->addAction("图标"); + leftShowMenu->addAction("列表"); + leftShowMenu->addAction("分栏"); + + leftMenu->addAction("新建文件夹"); + leftMenu->addMenu(leftDocumentMenu); + leftMenu->addMenu(leftShowMenu); + leftMenu->addMenu(leftSortMenu); + leftMenu->addAction("以管理员身份打开"); + leftMenu->addAction("在终端中打开"); + leftMenu->addSeparator(); + leftMenu->addAction("粘贴"); + leftMenu->addAction("全选"); + leftMenu->addSeparator(); + leftMenu->addAction("属性"); + + menuTopLayout->setSpacing(10); + menuTopLayout->setMargin(0); + menuTopLayout->addWidget(topLeftMenuLabel, 0, Qt::AlignBottom); + menuTopLayout->addWidget(topMidMenuLabel, 0, Qt::AlignBottom); + menuTopLayout->addWidget(topRightMenuLabel, 0, Qt::AlignBottom); + + menuLayout->setSpacing(30); + menuLayout->setMargin(0); + menuLayout->addWidget(menuTopWidget); + menuLayout->addWidget(topBottomMenuLabel, 0, Qt::AlignCenter); + + layout->setContentsMargins(10, 0, 10, 0); + layout->addSpacing(30); + layout->addWidget(menuWidget); + layout->addSpacing(70); + layout->addWidget(menuPicWidget); + layout->addSpacing(30); +} + +QString DMenuExample::getTitleName() const +{ + return "DMenu"; +} + +QString DMenuExample::getDescriptionInfo() const +{ + return QString("DTK上经常用到的控件,主要出现在右\n" + "键,DCombobox弹出,主菜单,搜索\n" + "框的补全等一些地方。带尖角的菜单有\n" + "明确的指向,告诉用户这个菜单对应的\n" + "是哪个地方的。"); +} + +int DMenuExample::getFixedHeight() const +{ + return 1089; +} + +QColor DMenuExample::getAColor() +{ + return acolor; +} + +void DMenuExample::setAColor(const QColor &color) +{ + acolor = color; + paintRegion(); +} + +bool DMenuExample::eventFilter(QObject *watched, QEvent *event) +{ + if (watched == this->findChild("menuPicLabel")) { + if (event->type() == QEvent::Enter) { + animation->start(); + } else if (event->type() == QEvent::Leave && !leftMenu->isVisible()) { + animation->stop(); + restoreAnimation(); + paintRegion(); + } else if (event->type() == QEvent::MouseButtonRelease) { + QMouseEvent *mouseEvent = static_cast(event); + QLabel *menuPicLabel = this->findChild("menuPicLabel"); + + if (mouseEvent->button() & Qt::RightButton) { + QPoint mousePos = menuPicLabel->mapTo(menuPicLabel, mouseEvent->pos()); + QRegion region; + region = region.united(QRect(278, 136, 259, 100)); + region = region.united(QRect(76, 236, 461, 109)); + + if (region.contains(mousePos)) { + leftMenu->popup(menuPicLabel->mapToGlobal(mouseEvent->pos())); + } + } + } + } + + return false; +} + +void DMenuExample::paintRegion() +{ + QLabel *menuPicLabel = this->findChild("menuPicLabel"); + QPixmap tPixmap = this->pixmap; + QPainter p(&tPixmap); + QPainterPath path; + + path.moveTo(QPoint(76, 236)); + path.lineTo(QPoint(278, 236)); + path.lineTo(QPoint(278, 136)); + path.lineTo(QPoint(537, 136)); + path.lineTo(QPoint(537, 345)); + path.lineTo(QPoint(76, 345)); + path.lineTo(QPoint(76, 236)); + + p.setPen(this->acolor); + p.setBrush(Qt::NoBrush); + + p.drawPath(path); + + p.drawText(QPoint(370, 218), "右键点击空白区域"); + menuPicLabel->setPixmap(tPixmap); +} + +void DMenuExample::restoreAnimation() +{ + acolor = QColor(15, 207, 255, 255); + animation->setStartValue(QVariant::fromValue(QColor(15, 207, 255, 255))); + animation->setEndValue(QVariant::fromValue(QColor(15, 207, 255, 0))); + animation->setDuration(1000); +} diff -Nru dtkwidget-5.5.48/examples/collections/menuexample.h dtkwidget-5.6.12/examples/collections/menuexample.h --- dtkwidget-5.5.48/examples/collections/menuexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/menuexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,52 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef MENUEXAMPLE_H +#define MENUEXAMPLE_H + +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class QPropertyAnimation; +class QMenu; +class MenuExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit MenuExampleWindow(QWidget *parent = nullptr); +}; + +class DMenuExample : public ExampleWindowInterface +{ + Q_OBJECT + Q_PROPERTY(QColor aColor READ getAColor WRITE setAColor) + + // ExampleWindowInterface interface +public: + explicit DMenuExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; + + QColor getAColor(); + void setAColor(const QColor &color); + +protected: + bool eventFilter(QObject *watched, QEvent *event) override; + void paintRegion(); + void restoreAnimation(); + +private: + QPropertyAnimation *animation; + QColor acolor; + QPixmap pixmap; + QMenu *leftMenu; +}; + +#endif // MENUEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/org.deepin.dtkwidget.feature-display.json dtkwidget-5.6.12/examples/collections/org.deepin.dtkwidget.feature-display.json --- dtkwidget-5.5.48/examples/collections/org.deepin.dtkwidget.feature-display.json 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/org.deepin.dtkwidget.feature-display.json 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,16 @@ +{ + "magic": "dsg.config.override", + "version": "1.0", + "contents": { + "autoDisplayFeature": { + "value": true, + "serial": 1, + "permissions": "readwrite" + }, + "featureUpdated": { + "value": true, + "serial": 1, + "permissions": "readwrite" + } + } +} diff -Nru dtkwidget-5.5.48/examples/collections/pagewindowinterface.cpp dtkwidget-5.6.12/examples/collections/pagewindowinterface.cpp --- dtkwidget-5.5.48/examples/collections/pagewindowinterface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/pagewindowinterface.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,116 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "pagewindowinterface.h" +#include "examplewindowinterface.h" + +#include + +#include +#include +#include +#include + +DWIDGET_USE_NAMESPACE + +PageWindowInterface::PageWindowInterface(QWidget *parent) + : QWidget(parent) +{ +} + +PageWindowInterface::~PageWindowInterface() +{ +} + +QWidget *PageWindowInterface::doLayout(ExampleWindowInterface *pExample) +{ + Q_ASSERT(pExample != nullptr); + + DFrame *pWidget = new DFrame; + pWidget->setFrameRounded(true); + + QLabel *pDescriptionLabel = new QLabel; + pDescriptionLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + pDescriptionLabel->setFixedWidth(292); + pDescriptionLabel->setFixedHeight(pExample->getFixedHeight()); + + QLabel *pLabel_1 = new QLabel; + pLabel_1->setTextInteractionFlags(Qt::TextBrowserInteraction); + pLabel_1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + QFont font_1; + font_1.setPixelSize(24); + pLabel_1->setFont(font_1); + pLabel_1->setText(pExample->getTitleName()); + + QLabel *pLabel_2 = new QLabel; + pLabel_2->setTextInteractionFlags(Qt::TextBrowserInteraction); + pLabel_2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + QFont font_2; + font_2.setPixelSize(12); + pLabel_2->setFont(font_2); + pLabel_2->setText(pExample->getDescriptionInfo()); + + QVBoxLayout *pVBoxLayout_label = new QVBoxLayout; + pVBoxLayout_label->setMargin(10); + pVBoxLayout_label->setSpacing(0); + pDescriptionLabel->setLayout(pVBoxLayout_label); + + pVBoxLayout_label->addWidget(pLabel_1); + pVBoxLayout_label->setSpacing(10); + pVBoxLayout_label->addWidget(pLabel_2); + pVBoxLayout_label->addStretch(); + + QHBoxLayout *pHBoxLayout = new QHBoxLayout; + pHBoxLayout->setMargin(0); + pHBoxLayout->setSpacing(0); + + pWidget->setLayout(pHBoxLayout); + + pExample->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + pHBoxLayout->addWidget(pDescriptionLabel); + pHBoxLayout->addWidget(new DVerticalLine); + pHBoxLayout->addWidget(pExample); + + pWidget->setFixedHeight(pExample->getFixedHeight()); + + return pWidget; +} + +void PageWindowInterface::initPageWindow() +{ + QScrollArea *pArea = new QScrollArea(this); + + QWidget *pWidget = new QWidget(this); + + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(10); + pVBoxLayout->setSpacing(10); + pWidget->setLayout(pVBoxLayout); + + for (auto pExample : m_exampleList) { + pVBoxLayout->addWidget(doLayout(pExample)); + } + + pVBoxLayout->addStretch(); + + pArea->setWidget(pWidget); + pArea->setWidgetResizable(true); + + QHBoxLayout *pHBoxLayout = new QHBoxLayout; + pHBoxLayout->setMargin(0); + pHBoxLayout->setSpacing(0); + setLayout(pHBoxLayout); + pHBoxLayout->addWidget(pArea); +} + +void PageWindowInterface::mouseMoveEvent(QMouseEvent *event) +{ + //屏蔽掉鼠标移动事件 + event->accept(); +} + +void PageWindowInterface::addExampleWindow(ExampleWindowInterface *pExample) +{ + m_exampleList << pExample; +} diff -Nru dtkwidget-5.5.48/examples/collections/pagewindowinterface.h dtkwidget-5.6.12/examples/collections/pagewindowinterface.h --- dtkwidget-5.5.48/examples/collections/pagewindowinterface.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/pagewindowinterface.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef PAGEWINDOWINTERFACE_H +#define PAGEWINDOWINTERFACE_H + +#include +#include + +class ExampleWindowInterface; + +class PageWindowInterface : public QWidget +{ +public: + explicit PageWindowInterface(QWidget *parent); + virtual ~PageWindowInterface() override; + +public: + virtual void initPageWindow(); + +protected: + void mouseMoveEvent(QMouseEvent *event) override; + + virtual QWidget *doLayout(ExampleWindowInterface *pExample); + void addExampleWindow(ExampleWindowInterface *pExample); + +private: + QList m_exampleList; +}; + +#endif // PAGEWINDOWINTERFACE_H diff -Nru dtkwidget-5.5.48/examples/collections/progressbarexample.cpp dtkwidget-5.6.12/examples/collections/progressbarexample.cpp --- dtkwidget-5.5.48/examples/collections/progressbarexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/progressbarexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,183 @@ +// SPDX-FileCopyrightText: 2020 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include +#include +#include +#include +#include +#include +#include "progressbarexample.h" + +DWIDGET_USE_NAMESPACE + +static auto pBarRun = [](QWidget *pBar){ + auto animation = new QPropertyAnimation(pBar, "value"); + animation->setDuration(10000); + animation->setLoopCount(-1); + animation->setStartValue(0); + animation->setEndValue(100); + animation->start(); +}; + +ProgressBarExampleWindow::ProgressBarExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DProgressBarExample(this)); + addExampleWindow(new DWaterProgressExample(this)); + addExampleWindow(new DColoredProgressBarExample(this)); +} + +DProgressBarExample::DProgressBarExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + auto mainLayout = new QVBoxLayout(this); + auto pTextBar = new DProgressBar(); + auto pNoTextBar = new DProgressBar(); + auto image1 = new DLabel(); + auto image2 = new DLabel(); + + pTextBar->setTextVisible(true); + pTextBar->setFixedWidth(500); + pTextBar->setValue(45); + pTextBar->setAlignment(Qt::AlignCenter); + + pNoTextBar->setFixedWidth(500); + pNoTextBar->setValue(62); + + image1->setFixedSize(550, 426); + image1->setScaledContents(true); + image1->setPixmap(QPixmap(":/images/example/DProgressBar_1.png")); + + image2->setFixedSize(550, 426); + image2->setScaledContents(true); + image2->setPixmap(QPixmap(":/images/example/DProgressBar_2.png")); + + mainLayout->addWidget(pTextBar, 0, Qt::AlignCenter); + mainLayout->addSpacing(49); + mainLayout->addWidget(pNoTextBar, 0, Qt::AlignCenter); + mainLayout->addSpacing(69); + mainLayout->addWidget(image1, 0, Qt::AlignCenter); + mainLayout->addSpacing(30); + mainLayout->addWidget(image2, 0, Qt::AlignCenter); + + setLayout(mainLayout); + + connect(pTextBar, &DProgressBar::valueChanged, this, [=](int value){ + pTextBar->setFormat(QString("已下载%1%").arg(value)); + }); + + pBarRun(pTextBar); + pBarRun(pNoTextBar); +} + +QString DProgressBarExample::getTitleName() const +{ + return "DProgressBar"; +} + +QString DProgressBarExample::getDescriptionInfo() const +{ + return QString("类型1\n" + "可以操作的进度条,点击可以进行暂\n" + "停,进度条内有文字。目前只有控制中\n" + "心更新部分用了。\n" + "类型2\n" + "所有需要用到进度条的地方,这种进度\n" + "条不可以操作,而是一种状态的指示,\n" + "告诉用户当前完成了多少或者使用了多\n" + "少的一个比例。"); +} + +int DProgressBarExample::getFixedHeight() const +{ + return 1143; +} + +DWaterProgressExample::DWaterProgressExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + auto mainLayout = new QVBoxLayout(this); + auto waterPBar = new DWaterProgress(); + auto image = new DLabel(); + + waterPBar->setFixedSize(98, 98); + waterPBar->setValue(99); + waterPBar->start(); + + image->setFixedSize(320, 410); + image->setScaledContents(true); + image->setPixmap(QPixmap(":/images/example/DWaterProgress.png")); + + mainLayout->addWidget(waterPBar, 0, Qt::AlignCenter); + mainLayout->addSpacing(85); + mainLayout->addWidget(image, 0, Qt::AlignCenter); + + setLayout(mainLayout); + + pBarRun(waterPBar); +} + +QString DWaterProgressExample::getTitleName() const +{ + return "DWaterProgress"; +} + +QString DWaterProgressExample::getDescriptionInfo() const +{ + return QString("进度条另外一种带趣味的展示形式,作\n" + "用是减少用户枯燥的等待。主要用在小\n" + "工具主窗口内部,作为一个中间状态展\n" + "示给用户,最终的结果往往会跟随成功\n" + "或者失败的图标。"); +} + +int DWaterProgressExample::getFixedHeight() const +{ + return 708; +} + +DColoredProgressBarExample::DColoredProgressBarExample(QWidget *parent) + : ExampleWindowInterface(parent) + +{ + auto mainLayout = new QVBoxLayout(this); + auto clrPBar = new DColoredProgressBar(); + + clrPBar->addThreshold(10, QBrush(QColor(Qt::black))); + clrPBar->addThreshold(20, QBrush(QColor(Qt::red))); + clrPBar->addThreshold(30, QBrush(QColor(Qt::green))); + clrPBar->addThreshold(40, QBrush(QColor(Qt::blue))); + clrPBar->addThreshold(50, QBrush(QColor(Qt::cyan))); + clrPBar->addThreshold(60, QBrush(QColor(Qt::darkGray))); + clrPBar->addThreshold(70, QBrush(QColor(Qt::black))); + clrPBar->addThreshold(80, QBrush(QColor(Qt::green))); + clrPBar->addThreshold(90, QBrush(QColor(Qt::magenta))); + + clrPBar->setFixedSize(500, 35); + mainLayout->addWidget(clrPBar, 0, Qt::AlignCenter); + setLayout(mainLayout); + + pBarRun(clrPBar); +} + +QString DColoredProgressBarExample::getTitleName() const +{ + return "DColoredProgressBar"; +} + +QString DColoredProgressBarExample::getDescriptionInfo() const +{ + return QString("进度条另外一种带趣味的展示形式,作\n" + "用是减少用户枯燥的等待。主要用在小\n" + "工具主窗口内部,作为一个中间状态展\n" + "示给用户,最终的结果往往会跟随成功\n" + "或者失败的图标。"); +} + +int DColoredProgressBarExample::getFixedHeight() const +{ + return 200; +} diff -Nru dtkwidget-5.5.48/examples/collections/progressbarexample.h dtkwidget-5.6.12/examples/collections/progressbarexample.h --- dtkwidget-5.5.48/examples/collections/progressbarexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/progressbarexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,56 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef PROGRESSBAREXAMPLE_H +#define PROGRESSBAREXAMPLE_H + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class ProgressBarExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit ProgressBarExampleWindow(QWidget *parent = nullptr); +}; + +class DProgressBarExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DProgressBarExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DWaterProgressExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DWaterProgressExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DColoredProgressBarExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DColoredProgressBarExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // PROGRESSBAREXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/resources/data/dfm-settings.json dtkwidget-5.6.12/examples/collections/resources/data/dfm-settings.json --- dtkwidget-5.5.48/examples/collections/resources/data/dfm-settings.json 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/resources/data/dfm-settings.json 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,62 @@ +{ + "gsettings": { + "id": "com.deepin.filemanager", + "path": "/com/deepin/filemanager/" + }, + "groups": [ + { + "key": "base", + "name": "Basic settings", + "groups": [ + { + "key": "open_action", + "name": "Open Action", + "options": [ + { + "key": "alway_open_on_new", + "type": "checkbox", + "text": "Always Open On New Windows", + "default": true + }, + { + "key": "open_file_action", + "name": "Open File:", + "type": "combobox", + "default": "" + } + ] + }, + { + "key": "new_tab_windows", + "name": "New Tab & Window", + "options": [ + { + "key": "new_window_path", + "name": "New Window Open:", + "type": "combobox", + "default": "" + }, + { + "key": "new_tab_path", + "name": "New Tab Open:", + "type": "combobox", + "default": "" + } + ] + }, + { + "key": "default_view", + "name": "Default View", + "options": [ + { + "key": "icon_size", + "name": "Icon Size:", + "type": "combobox", + "default": "" + } + ] + } + ] + } + ] +} diff -Nru dtkwidget-5.5.48/examples/collections/resources/data/dt-settings.json dtkwidget-5.6.12/examples/collections/resources/data/dt-settings.json --- dtkwidget-5.5.48/examples/collections/resources/data/dt-settings.json 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/resources/data/dt-settings.json 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,244 @@ +{ + "groups": [ + { + "key": "base", + "name": "Basic settings", + "groups": [ + { + "key": "custom-widgets", + "name": "Custom Widgets", + + "options": [ + { + "key": "title2", + "type": "title2", + "default": "Custom Level2 Title" + }, + { + "key": "custom-button", + "type": "custom-button", + "default": "Custom Button" + }, + { + "key": "switchbutton", + "type": "switchbutton", + "default": true, + "name": "Switch Button" + } + ] + }, + { + "key": "theme", + "name": "Theme", + "options": [ + { + "key": "theme", + "type": "checkpicture", + "default": 0 + }, + { + "key": "opticy", + "name": "Opticy", + "type": "slider", + "max": 100, + "min": 0, + "default": 90 + } + ] + }, + { + "key": "font", + "name": "Font Style", + "options": [ + { + "key": "family", + "name": "Font", + "type": "combobox", + "default": "" + }, + { + "key": "size", + "name": "Font Size", + "type": "spinbutton", + "default": 12, + "max": 20, + "min": 9 + }, + { + "key": "style", + "name": "Font Style", + "type": "buttongroup", + "items": ["B","/"], + "default": 0 + } + ] + } + ] + }, + { + "key": "shortcuts", + "name": "Shortcuts", + "groups": [ + { + "key": "ternimal", + "name": "Ternimal", + "hide": true, + "options": [ + { + "key": "copy", + "name": "Copy", + "type": "shortcut", + "default": "Ctrl+Alt+C" + }, + { + "key": "paste", + "name": "Paste", + "type": "shortcut", + "default": "Ctrl+Alt+V" + }, + { + "key": "scroll_up", + "name": "Scroll Up", + "type": "shortcut", + "default": "Alt+." + }, + { + "key": "scroll_down", + "name": "Scroll down", + "type": "shortcut", + "default": "Alt+," + } + ] + }, + { + "key": "workspace", + "name": "Workspace", + "options": [ + { + "key": "new_window", + "name": "New Window", + "type": "shortcut", + "default": "Ctrl+Shitf+<" + }, + { + "key": "next_tab", + "name": "Next Tab", + "type": "shortcut", + "default": "Ctrl+N" + }, + { + "key": "prev_up", + "name": "Previous Tab", + "type": "shortcut", + "default": "Ctrl+Shitf+>" + }, + { + "key": "close_tab", + "name": "Close Tab", + "type": "shortcut", + "default": "Ctrl+W" + } + ] + } + ] + }, + { + "key": "advance", + "name": "Advance", + "groups": [ + { + "key": "cursor", + "name": "Cursor", + "options": [ + { + "key": "shrap", + "name": "Cursor Shrap", + "type": "buttongroup", + "items": ["█","_","|"], + "default": 0 + }, + { + "key": "blink", + "type": "checkbox", + "text": "Cursor blink", + "default": true + }, + { + "key": "radiogroup", + "name": " ", + "type": "radiogroup", + "items": ["Minimize to tray","Exit Deepin Music"], + "default": 0 + } + ] + }, + { + "key": "encoding", + "name": "Default encoding", + "options": [ + { + "key": "encoding", + "name": "Encoding", + "type": "combobox", + "default": "utf-8" + } + ] + }, + { + "key": "coustom", + "name": "Coustom", + "options": [ + { + "key": "coustom_command", + "name": "Coustom Command", + "type": "lineedit", + "default": "" + }, + { + "key": "coustom_directory", + "name": "Coustom Directory", + "type": "lineedit", + "default": "" + } + ] + }, + { + "key": "scroll", + "name": "Scroll", + "options": [ + { + "key": "scroll_bottom", + "text": "Scroll Bottom", + "type": "checkbox", + "default": "" + }, + { + "key": "scroll_line_count", + "name": "Scroll line count", + "type": "spinbutton", + "default": 10 + } + ] + }, + { + "key": "compatibility", + "name": "Compatibility", + "options": [ + { + "key": "breakspce_action", + "name": "Breakspce Action", + "type": "combobox", + "default": "" + }, + { + "key": "delete_action", + "name": "Delete Action", + "type": "combobox", + "default": "" + } + ] + } + ] + } + ] +} diff -Nru dtkwidget-5.5.48/examples/collections/resources/data/example-license.json dtkwidget-5.6.12/examples/collections/resources/data/example-license.json --- dtkwidget-5.5.48/examples/collections/resources/data/example-license.json 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/resources/data/example-license.json 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,32 @@ +[ + { + "name": "pkg-config", + "version": "", + "copyright": "NOASSERTION", + "license": "MIT" + }, + { + "name": "lshw", + "version": "", + "copyright": "NOASSERTION", + "license": "GPL-2" + }, + { + "name": "debhelper", + "version": "", + "copyright": "NOASSERTION", + "license": "GPL-2" + }, + { + "name": "pkg-config", + "version": "", + "copyright": "NOASSERTION", + "license": "MIT" + }, + { + "name": "debhelper", + "version": "", + "copyright": "NOASSERTION", + "license": "GPL-2" + } +] diff -Nru dtkwidget-5.5.48/examples/collections/resources/data/GPL-2.txt dtkwidget-5.6.12/examples/collections/resources/data/GPL-2.txt --- dtkwidget-5.5.48/examples/collections/resources/data/GPL-2.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/resources/data/GPL-2.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 2 of the License, or + (at your option) any later version. + + This program 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff -Nru dtkwidget-5.5.48/examples/collections/resources/data/MIT.txt dtkwidget-5.6.12/examples/collections/resources/data/MIT.txt --- dtkwidget-5.5.48/examples/collections/resources/data/MIT.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/resources/data/MIT.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2016-2022 TheAlgorithms and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -Nru dtkwidget-5.5.48/examples/collections/resources/data/titlebar-settings.json dtkwidget-5.6.12/examples/collections/resources/data/titlebar-settings.json --- dtkwidget-5.5.48/examples/collections/resources/data/titlebar-settings.json 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/resources/data/titlebar-settings.json 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,18 @@ +{ + "spacingSize": 40, + "alignment": "left", + "tools": [ + { + "key": "builtin/edit-cut" + }, + { + "key": "builtin/spacer", + "fixed": true, + "count": 2 + }, + { + "key": "builtin/edit-delete", + "fixed": true + } + ] +} diff -Nru dtkwidget-5.5.48/examples/collections/resources.qrc dtkwidget-5.6.12/examples/collections/resources.qrc --- dtkwidget-5.5.48/examples/collections/resources.qrc 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/resources.qrc 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,10 @@ + + + resources/data/dfm-settings.json + resources/data/dt-settings.json + resources/data/titlebar-settings.json + resources/data/example-license.json + resources/data/MIT.txt + resources/data/GPL-2.txt + + diff -Nru dtkwidget-5.5.48/examples/collections/rubberbandexample.cpp dtkwidget-5.6.12/examples/collections/rubberbandexample.cpp --- dtkwidget-5.5.48/examples/collections/rubberbandexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/rubberbandexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,74 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include +#include +#include + +#include "rubberbandexample.h" + +DWIDGET_USE_NAMESPACE + +RubberBandExampleWindow::RubberBandExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DRubberBandExample(this)); +} + +DRubberBandExample::DRubberBandExample(QWidget *parent) + : ExampleWindowInterface(parent) + , m_pRubberBand(nullptr) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + + setLayout(pVBoxLayout); + + QLabel *pLabel_1 = new QLabel; + QPixmap pix_1(":/images/example/DRubberBand.png"); + pLabel_1->setFixedSize(550, 356); + pLabel_1->setPixmap(pix_1); + pLabel_1->setScaledContents(true); + + pVBoxLayout->addStretch(); + pVBoxLayout->addWidget(pLabel_1, 0, Qt::AlignCenter); + pVBoxLayout->addSpacing(30); +} + +void DRubberBandExample::mousePressEvent(QMouseEvent *event) +{ + m_origin = event->pos(); + if (!m_pRubberBand) + m_pRubberBand = new DRubberBand(DRubberBand::Rectangle, this); + m_pRubberBand->setGeometry(QRect(m_origin, QSize())); + m_pRubberBand->show(); +} + +void DRubberBandExample::mouseMoveEvent(QMouseEvent *event) +{ + m_pRubberBand->setGeometry(QRect(m_origin, event->pos()).normalized()); +} + +void DRubberBandExample::mouseReleaseEvent(QMouseEvent * /*event*/) +{ + m_pRubberBand->hide(); +} + +QString DRubberBandExample::getTitleName() const +{ + return "DRubberBand"; +} + +QString DRubberBandExample::getDescriptionInfo() const +{ + return "所有用户可以用鼠标拖拽矩形区域进行\n" + "框选的地方,比如文件管理器,桌面."; +} + +int DRubberBandExample::getFixedHeight() const +{ + return 810; +} diff -Nru dtkwidget-5.5.48/examples/collections/rubberbandexample.h dtkwidget-5.6.12/examples/collections/rubberbandexample.h --- dtkwidget-5.5.48/examples/collections/rubberbandexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/rubberbandexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,46 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef RUBBERBANDEXAMPLE_H +#define RUBBERBANDEXAMPLE_H + +#include +#include + +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class RubberBandExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit RubberBandExampleWindow(QWidget *parent = nullptr); +}; + +class DRubberBandExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DRubberBandExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; + +protected: + void mousePressEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + +private: + Dtk::Widget::DRubberBand *m_pRubberBand; + QPoint m_origin; +}; + +#endif // RUBBERBANDEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/scrollbarexample.cpp dtkwidget-5.6.12/examples/collections/scrollbarexample.cpp --- dtkwidget-5.5.48/examples/collections/scrollbarexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/scrollbarexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,56 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include +#include +#include +#include +#include "scrollbarexample.h" + +DWIDGET_USE_NAMESPACE +DCORE_USE_NAMESPACE + +ScrollBarExampleWindow::ScrollBarExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DScrollBarExample(this)); +} + +DScrollBarExample::DScrollBarExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mLayout = new QVBoxLayout(this); + QImageReader reader; + reader.setFileName(":/images/example/DScrollBar_1.png"); + reader.setScaledSize(reader.size().scaled(480, 120, Qt::KeepAspectRatio)); + + QLabel *sbimg = new QLabel; + sbimg->setAlignment(Qt::AlignHCenter); + sbimg->setPixmap(QPixmap::fromImageReader(&reader)); + + DScrollArea *sa = new DScrollArea; + QLabel *image = new QLabel; + image->setPixmap(QPixmap(":/images/example/DScrollBar.png")); + sa->setWidget(image); + + mLayout->addWidget(sbimg, 0, Qt::AlignTop | Qt::AlignHCenter); + mLayout->addSpacing(5); + mLayout->addWidget(sa); +} + +QString DScrollBarExample::getTitleName() const +{ + return "DScrollBar"; +} + +QString DScrollBarExample::getDescriptionInfo() const +{ + return QStringLiteral("所有产生滚动的地方"); +} + +int DScrollBarExample::getFixedHeight() const +{ + return 500; +} diff -Nru dtkwidget-5.5.48/examples/collections/scrollbarexample.h dtkwidget-5.6.12/examples/collections/scrollbarexample.h --- dtkwidget-5.5.48/examples/collections/scrollbarexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/scrollbarexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef SCROLLBAREXAMPLE_H +#define SCROLLBAREXAMPLE_H + +#include +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class ScrollBarExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit ScrollBarExampleWindow(QWidget *parent = nullptr); +}; + +class DScrollBarExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DScrollBarExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // SCROLLBAREXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/sliderexample.cpp dtkwidget-5.6.12/examples/collections/sliderexample.cpp --- dtkwidget-5.5.48/examples/collections/sliderexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/sliderexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,95 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sliderexample.h" + +DWIDGET_USE_NAMESPACE + +SliderExampleWindow::SliderExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DSliderExample(this)); +} + +DSliderExample::DSliderExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + DSlider *vSlider = new DSlider(Qt::Vertical); + DSlider *hSlider = new DSlider(Qt::Horizontal); + hSlider->setLeftIcon(QIcon::fromTheme("emblem-remove")); + hSlider->setRightIcon(QIcon::fromTheme("emblem-added")); + hSlider->setIconSize({16, 16}); + connect(hSlider, &DSlider::iconClicked, this, [hSlider](DSlider::SliderIcons icon, bool checked){ + qDebug() << "........." << icon << checked; + if(icon == DSlider::LeftIcon) { + hSlider->setValue(hSlider->value() - hSlider->pageStep()); + } else { + hSlider->setValue(hSlider->value() + hSlider->pageStep()); + } + }); + DSlider *hCalibration = new DSlider(Qt::Horizontal); + DLabel *hLabel = new DLabel; + DLabel *vLabel = new DLabel; + QVBoxLayout *mainLayout = new QVBoxLayout; + + vSlider->setMinimumHeight(283); + hSlider->setMinimumWidth(479); + hCalibration->setMinimumWidth(507); + hCalibration->setBelowTicks({"", "", "", "", "", "", ""}); + + hLabel->setScaledContents(true); + vLabel->setScaledContents(true); + + hLabel->setFixedSize(550, 426); + vLabel->setFixedSize(550, 350); + + hLabel->setPixmap(QPixmap(":/images/example/DSlider_1.png")); + vLabel->setPixmap(QPixmap(":/images/example/DSlider_2.png")); + + setLayout(mainLayout); + mainLayout->setSpacing(10); + mainLayout->addWidget(vSlider, 0, Qt::AlignCenter); + mainLayout->addWidget(hSlider, 0, Qt::AlignCenter); + mainLayout->addWidget(hCalibration, 0, Qt::AlignCenter); + mainLayout->addWidget(hLabel, 0, Qt::AlignCenter); + mainLayout->addWidget(vLabel, 0, Qt::AlignCenter); +} + +QString DSliderExample::getTitleName() const +{ + return "DSlider"; +} + +QString DSliderExample::getDescriptionInfo() const +{ + return "圆角矩形滑块可以随意拖动,起止点一\n" + "定是从左往右递增,滑块以左部分是活\n" + "动色显示。\n\n" + "尖角的滑块不可以像圆角矩形滑块那样\n" + "进行随意拖动,底下对应的有刻度,刻\n" + "度上产生吸附力,尖角也只能在几个刻\n" + "度值上调整,更多强调的是用户一个值\n" + "的取舍。\n " + "对应的刻度可能有刻度值显示,也可能\n" + "没有刻度值(界面上的)。"; +} + +int DSliderExample::getFixedHeight() const +{ + return 1276; +} diff -Nru dtkwidget-5.5.48/examples/collections/sliderexample.h dtkwidget-5.6.12/examples/collections/sliderexample.h --- dtkwidget-5.5.48/examples/collections/sliderexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/sliderexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef SLIDEREXAMPLE_H +#define SLIDEREXAMPLE_H + +#include +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class SliderExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit SliderExampleWindow(QWidget *parent = nullptr); +}; + +class DSliderExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DSliderExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // SLIDEREXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/spinnerexample.cpp dtkwidget-5.6.12/examples/collections/spinnerexample.cpp --- dtkwidget-5.5.48/examples/collections/spinnerexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/spinnerexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,86 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include +#include + +#include +#include + +#include "spinnerexample.h" + +DWIDGET_USE_NAMESPACE + +SpinnerExampleWindow::SpinnerExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DSpinnerExample(this)); +} + +DSpinnerExample::DSpinnerExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; + pHBoxLayout_1->setMargin(0); + pHBoxLayout_1->setSpacing(0); + + auto getSpinnerWidget = [](const QSize &size) { + DSpinner *pSpinner = new DSpinner; + pSpinner->setFixedSize(size); + pSpinner->start(); + return pSpinner; + }; + + pHBoxLayout_1->addStretch(1); + pHBoxLayout_1->addWidget(getSpinnerWidget(QSize(16, 16))); + pHBoxLayout_1->addStretch(1); + pHBoxLayout_1->addWidget(getSpinnerWidget(QSize(24, 24))); + pHBoxLayout_1->addStretch(1); + pHBoxLayout_1->addWidget(getSpinnerWidget(QSize(32, 32))); + pHBoxLayout_1->addStretch(1); + pHBoxLayout_1->addWidget(getSpinnerWidget(QSize(54, 54))); + pHBoxLayout_1->addStretch(1); + pHBoxLayout_1->addWidget(getSpinnerWidget(QSize(96, 96))); + pHBoxLayout_1->addStretch(1); + + pVBoxLayout->addLayout(pHBoxLayout_1); + + QLabel *pLabel_1 = new QLabel; + QPixmap pix_1(":/images/example/DSpinner.png"); + pLabel_1->setFixedSize(570, 326); + pLabel_1->setPixmap(pix_1); + pLabel_1->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; + pHBoxLayout_pic_1->setMargin(0); + pHBoxLayout_pic_1->setSpacing(0); + pHBoxLayout_pic_1->addWidget(pLabel_1); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_pic_1); + pVBoxLayout->addSpacing(20); +} + +QString DSpinnerExample::getTitleName() const +{ + return "DSpinner"; +} + +QString DSpinnerExample::getDescriptionInfo() const +{ + return "所有需要用户等待的地方,且没有具体\n" + "的等待时间,不知道进度,可能很快也\n" + "可能需要比较久."; +} + +int DSpinnerExample::getFixedHeight() const +{ + return 800; +} diff -Nru dtkwidget-5.5.48/examples/collections/spinnerexample.h dtkwidget-5.6.12/examples/collections/spinnerexample.h --- dtkwidget-5.5.48/examples/collections/spinnerexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/spinnerexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef SPINNEREXAMPLE_H +#define SPINNEREXAMPLE_H + +#include +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class SpinnerExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit SpinnerExampleWindow(QWidget *parent = nullptr); +}; + +class DSpinnerExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DSpinnerExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // SPINNEREXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/tooltipexample.cpp dtkwidget-5.6.12/examples/collections/tooltipexample.cpp --- dtkwidget-5.5.48/examples/collections/tooltipexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/tooltipexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,228 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "tooltipexample.h" + +DWIDGET_USE_NAMESPACE + +ToolTipExampleWindow::ToolTipExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DToolTipExample(this)); + addExampleWindow(new DArrowRectangleExample(this)); +} + +DToolTipExample::DToolTipExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; + pHBoxLayout_1->setMargin(0); + pHBoxLayout_1->setSpacing(0); + + DPushButton *pButton_1 = new DPushButton("悬停显示ToolTip"); + pButton_1->setToolTip("返回上一级"); + + DPushButton *pButton_2 = new DPushButton("悬停显示ToolTip"); + pButton_2->setToolTip("点击搜索或输入地址"); + + pHBoxLayout_1->addStretch(1); + pHBoxLayout_1->addWidget(pButton_1); + pHBoxLayout_1->addStretch(1); + pHBoxLayout_1->addWidget(pButton_2); + pHBoxLayout_1->addStretch(1); + + pVBoxLayout->addLayout(pHBoxLayout_1); + + QLabel *pLabel_1 = new QLabel; + QPixmap pix_1(":/images/example/DToolTip.png"); + pLabel_1->setFixedSize(550, 356); + pLabel_1->setPixmap(pix_1); + pLabel_1->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; + pHBoxLayout_pic_1->setMargin(0); + pHBoxLayout_pic_1->setSpacing(0); + pHBoxLayout_pic_1->addWidget(pLabel_1); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_pic_1); + pVBoxLayout->addSpacing(20); +} + +QString DToolTipExample::getTitleName() const +{ + return "DToolTip"; +} + +QString DToolTipExample::getDescriptionInfo() const +{ + return "所有需要用到提示的地方.\n" + "出现需要有延迟,鼠标是悬停2妙左右\n" + "出现,触屏是按住就出现."; +} + +int DToolTipExample::getFixedHeight() const +{ + return 600; +} + +DArrowRectangleExample::DArrowRectangleExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + setLayout(pVBoxLayout); + + QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; + pHBoxLayout_1->setMargin(0); + pHBoxLayout_1->setSpacing(0); + + //DArrowRectangle的FloatWidget模式必须要有父窗口 + DArrowRectangle *pRectangle_1 = new DArrowRectangle(DArrowRectangle::ArrowBottom, DArrowRectangle::FloatWidget, this); + pRectangle_1->setRadiusArrowStyleEnable(true); + pRectangle_1->setRadius(8); + QWidget *pContentWidget = new QWidget; + pContentWidget->setFixedSize(300, 300); + pRectangle_1->setContent(pContentWidget); + QVBoxLayout *pVBoxLayout_content = new QVBoxLayout; + pVBoxLayout_content->setMargin(0); + pVBoxLayout_content->setSpacing(0); + pContentWidget->setLayout(pVBoxLayout_content); + + DLabel *pTitle = new DLabel("图标列表"); + pTitle->setFixedHeight(46); + QFont font; + font.setPixelSize(20); + pTitle->setFont(font); + + auto getListItem = [](const QPixmap &pixIcon, const QString &str) { + QLabel *pLeftIcon = new QLabel; + pLeftIcon->setPixmap(pixIcon); + + QLabel *rightIcon = new QLabel; + rightIcon->setPixmap(QPixmap(":/images/example/Oval_186.svg")); + + QLabel *middleLabel = new QLabel; + middleLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); + QLabel *pTitle_1 = new QLabel; + pTitle_1->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); + pTitle_1->setText(str); + QFont font; + font.setPixelSize(14); + pTitle_1->setFont(font); + + QLabel *pTitle_2 = new QLabel; + pTitle_2->setText("23/48G"); + font.setPixelSize(12); + pTitle_2->setFont(font); + + QVBoxLayout *pVBoxLayout = new QVBoxLayout; + pVBoxLayout->setMargin(0); + pVBoxLayout->setSpacing(0); + middleLabel->setLayout(pVBoxLayout); + + pVBoxLayout->addSpacing(11); + pVBoxLayout->addWidget(pTitle_1); + pVBoxLayout->addWidget(pTitle_2); + + QProgressBar *pBar = new QProgressBar; + pBar->setFixedHeight(3); + pBar->setRange(0, 100); + pBar->setValue(60); + + pVBoxLayout->addWidget(pBar); + pVBoxLayout->addSpacing(10); + + QHBoxLayout *pHBoxLayout = new QHBoxLayout; + pHBoxLayout->setMargin(0); + pHBoxLayout->setSpacing(0); + pHBoxLayout->addSpacing(10); + pHBoxLayout->addWidget(pLeftIcon); + pHBoxLayout->addSpacing(10); + pHBoxLayout->addWidget(middleLabel); + pHBoxLayout->addSpacing(10); + pHBoxLayout->addWidget(rightIcon); + pHBoxLayout->addSpacing(12); + + QWidget *pItem = new QWidget; + pItem->setFixedHeight(64); + pItem->setLayout(pHBoxLayout); + return pItem; + }; + + pVBoxLayout_content->addWidget(pTitle); + pVBoxLayout_content->addWidget(new DHorizontalLine); + pVBoxLayout_content->addWidget(getListItem(QPixmap(":/images/example/drive-harddisk-48px.svg"), "我的磁盘")); + pVBoxLayout_content->addWidget(getListItem(QPixmap(":/images/example/drive-harddisk-48px_1.svg"), "文档")); + pVBoxLayout_content->addWidget(getListItem(QPixmap(":/images/example/drive-harddisk-48px_2.svg"), "可移动磁盘")); + pVBoxLayout_content->addWidget(getListItem(QPixmap(":/images/example/drive-harddisk-48px_3.svg"), "SD卡")); + pVBoxLayout_content->addStretch(); + + DArrowRectangle *pRectangle_2 = new DArrowRectangle(DArrowRectangle::ArrowBottom, DArrowRectangle::FloatWidget, this); + pRectangle_2->setRadius(8); + pRectangle_2->setRadiusArrowStyleEnable(true); + QLabel *pContentWidget_2 = new QLabel("深度音乐"); + pContentWidget_2->setAlignment(Qt::AlignCenter); + pContentWidget_2->setFixedSize(90, 40); + pRectangle_2->setContent(pContentWidget_2); + + pHBoxLayout_1->addStretch(); + pHBoxLayout_1->addWidget(pRectangle_1, 0, Qt::AlignTop | Qt::AlignHCenter); + pHBoxLayout_1->addStretch(); + pHBoxLayout_1->addWidget(pRectangle_2, 0, Qt::AlignTop | Qt::AlignHCenter); + pHBoxLayout_1->addStretch(); + + pVBoxLayout->addSpacing(20); + pVBoxLayout->addLayout(pHBoxLayout_1); + + QLabel *pLabel_1 = new QLabel; + QPixmap pix_1(":/images/example/DArrowRectangle.png"); + pLabel_1->setFixedSize(570, 330); + pLabel_1->setPixmap(pix_1); + pLabel_1->setScaledContents(true); + + QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; + pHBoxLayout_pic_1->setMargin(0); + pHBoxLayout_pic_1->setSpacing(0); + pHBoxLayout_pic_1->addWidget(pLabel_1); + + pVBoxLayout->addSpacing(30); + pVBoxLayout->addLayout(pHBoxLayout_pic_1); + pVBoxLayout->addSpacing(20); +} + +QString DArrowRectangleExample::getTitleName() const +{ + return "DArrowRectangle"; +} + +QString DArrowRectangleExample::getDescriptionInfo() const +{ + return "带尖角的popup窗口,内容部分不是固\n" + "定的,可以做多种定制."; +} + +int DArrowRectangleExample::getFixedHeight() const +{ + return 818; +} diff -Nru dtkwidget-5.5.48/examples/collections/tooltipexample.h dtkwidget-5.6.12/examples/collections/tooltipexample.h --- dtkwidget-5.5.48/examples/collections/tooltipexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/tooltipexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef TOOLTIPEXAMPLE_H +#define TOOLTIPEXAMPLE_H + +#include +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class ToolTipExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit ToolTipExampleWindow(QWidget *parent = nullptr); +}; + +class DToolTipExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DToolTipExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DArrowRectangleExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DArrowRectangleExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // TOOLTIPEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/widgetexample.cpp dtkwidget-5.6.12/examples/collections/widgetexample.cpp --- dtkwidget-5.5.48/examples/collections/widgetexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/widgetexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,209 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "widgetexample.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +WidgetExampleWindow::WidgetExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DCalendarWidgetExample(this)); + addExampleWindow(new DTableWidgetExample(this)); + addExampleWindow(new DMPRISControlWidgetExample(this)); +} + +DCalendarWidgetExample::DCalendarWidgetExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + setLayout(mainLayout); + + DCalendarWidget *calender = new DCalendarWidget(this); + QLabel *label = new QLabel(this); + label->setPixmap(QPixmap("://images/example/DCalendarWidget.png")); + label->setScaledContents(true); + label->setFixedSize(550, 406); + + mainLayout->addWidget(calender, 0, Qt::AlignHCenter); + mainLayout->addSpacing(50); + mainLayout->addWidget(label, 0, Qt::AlignHCenter); +} + +QString DCalendarWidgetExample::getTitleName() const +{ + return "DCalendarWidget"; +} + +QString DCalendarWidgetExample::getDescriptionInfo() const +{ + return "所涉及到日期操作的地方。"; +} + +int DCalendarWidgetExample::getFixedHeight() const +{ + return 816; +} + +DTableWidgetExample::DTableWidgetExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + setLayout(mainLayout); + + tableView = new QTableView(this); + CalendarModel *model = new CalendarModel(this); + tableView->setModel(model); + tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + tableView->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch); + tableView->setShowGrid(false); + tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); + tableView->verticalHeader()->hide(); + tableView->horizontalHeader()->setSectionsClickable(false); + tableView->setSelectionMode(QAbstractItemView::SingleSelection); + + tableView->setFixedSize(504, 252); + mainLayout->addWidget(tableView, 0, Qt::AlignHCenter); +} + +QString DTableWidgetExample::getTitleName() const +{ + return "DTableWidget"; +} + +QString DTableWidgetExample::getDescriptionInfo() const +{ + return "标准的表格控件。"; +} + +int DTableWidgetExample::getFixedHeight() const +{ + return 352; +} + +CalendarModel::CalendarModel(QObject *parent) + : QAbstractTableModel(parent) +{ + header << "周日" + << "周一" + << "周二" + << "周三" + << "周四" + << "周五" + << "周六"; + + //生成一个6行7列的数组 + for (int index = 0; index < 6; ++index) { + m_tableData.push_back(QVector(7)); + } + + const QDate curMonthFirstDay(QDate::currentDate().year(), QDate::currentDate().month(), 1); + const int first_day_index = curMonthFirstDay.dayOfWeek() % 7; + //本月第一天在数组中初始化 + m_tableData[0][first_day_index] = curMonthFirstDay; + + const int days_in_month = QDate::currentDate().daysInMonth(); + const QDate curMonthLastDay(QDate::currentDate().year(), QDate::currentDate().month(), days_in_month); + + const int last_day_index = first_day_index + days_in_month - 1; + //本月最后一天在数组中初始化 + m_tableData[last_day_index / 7][last_day_index % 7] = curMonthLastDay; + + for (int rowIndex = 0; rowIndex < 6; ++rowIndex) { + for (int colIndex = 0; colIndex < 7; ++colIndex) { + if (m_tableData[rowIndex][colIndex].isValid()) { + continue; + } + + int index = rowIndex * 7 + colIndex; + m_tableData[rowIndex][colIndex] = curMonthFirstDay.addDays(index - first_day_index); + } + } +} + +int CalendarModel::rowCount(const QModelIndex &) const +{ + return m_tableData.size(); +} + +int CalendarModel::columnCount(const QModelIndex &) const +{ + return header.size(); +} + +QVariant CalendarModel::data(const QModelIndex &index, int role) const +{ + DPalette palette = DGuiApplicationHelper::instance()->applicationPalette(); + + switch (role) { + case Qt::DisplayRole: { + int days = m_tableData[index.row()][index.column()].day(); + if (days == 1) { + return QString("%1/1").arg(m_tableData[index.row()][index.column()].month()); + } else { + return QString::number(days); + } + } + case Qt::TextColorRole: { + // 设置文字颜色 + if (m_tableData[index.row()][index.column()].month() == QDate::currentDate().month()) { + return palette.color(DPalette::TextTitle); + } else { + return palette.color(DPalette::PlaceholderText); + } + } + case Qt::TextAlignmentRole: + return Qt::AlignCenter; + case Qt::BackgroundRole: + // 设置单元格背景色 + break; + default: + break; + } + return QVariant(); +} + +QVariant CalendarModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role == Qt::BackgroundColorRole || role == Qt::BackgroundRole) + return DGuiApplicationHelper::instance()->applicationPalette().brush(DPalette::ItemBackground); + if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { + return header.value(section); + } else { + return QVariant(); + } +} + +DMPRISControlWidgetExample::DMPRISControlWidgetExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *layout = new QVBoxLayout(this); + + DMPRISControl *control = new DMPRISControl(this); + layout->addWidget(control, 0, Qt::AlignCenter); + control->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); +} + +QString DMPRISControlWidgetExample::getTitleName() const +{ + return QStringLiteral("DMPRISControl"); +} + +QString DMPRISControlWidgetExample::getDescriptionInfo() const +{ + return QStringLiteral("支持MPRIS协议的媒体控制控件。"); +} + +int DMPRISControlWidgetExample::getFixedHeight() const +{ + return 200; +} diff -Nru dtkwidget-5.5.48/examples/collections/widgetexample.h dtkwidget-5.6.12/examples/collections/widgetexample.h --- dtkwidget-5.5.48/examples/collections/widgetexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/widgetexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef WIDGETEXAMPLE_H +#define WIDGETEXAMPLE_H + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +#include + +#include +#include +#include +#include + +DGUI_USE_NAMESPACE +DWIDGET_USE_NAMESPACE + +class QTableView; + +class WidgetExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit WidgetExampleWindow(QWidget *parent = nullptr); +}; + +class DCalendarWidgetExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DCalendarWidgetExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DTableWidgetExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DTableWidgetExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; + +private: + QTableView *tableView; +}; + +class DMPRISControlWidgetExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DMPRISControlWidgetExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class CalendarModel : public QAbstractTableModel +{ + Q_OBJECT +public: + CalendarModel(QObject *parent = nullptr); + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + QVariant headerData(int section, Qt::Orientation orientation, + int role = Qt::DisplayRole) const override; + +private: + QStringList header; + QVector> m_tableData; // row = 6, col = 7 +}; + +#endif // WIDGETEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/collections/windowexample.cpp dtkwidget-5.6.12/examples/collections/windowexample.cpp --- dtkwidget-5.5.48/examples/collections/windowexample.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/windowexample.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,439 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "windowexample.h" + +DWIDGET_USE_NAMESPACE + +class ExampTitlebar : public DTitlebar +{ +public: + ExampTitlebar(QIcon icon) + : m_clipWidget(new DClipEffectWidget(this)) + { + setIcon(icon); + setFixedWidth(530); + } + +private: + void paintEvent(QPaintEvent *e) override + { + DTitlebar::paintEvent(e); + QPainter p(this); + const DPalette &dp = DPaletteHelper::instance()->palette(this); + + p.save(); + p.setPen(QPen(dp.frameBorder(), 1)); + int radius = 18; + if (auto window = qobject_cast(topLevelWidget()->window())) + radius = window->windowRadius(); + DDrawUtils::drawRoundedRect(&p, rect().adjusted(0 , 0, -1 , -1), radius, radius, + DDrawUtils::Corner::TopLeftCorner | DDrawUtils::Corner::TopRightCorner); + p.restore(); + + // clip `closeButton` + QPainterPath path; + path.addRect(rect().adjusted(0, radius, 0, 0)); + QPainterPath path2; + path2.addRoundedRect(rect(), radius, radius); + path += path2; + m_clipWidget->setClipPath(path); + } + DClipEffectWidget *m_clipWidget; +}; + +class ExampWindow : public DMainWindow +{ +public: + ExampWindow(QIcon icon) + { + titlebar()->hide(); + title = new ExampTitlebar(icon); + title->setParent(this); + title->move(0, 0); + } + + ExampTitlebar* eTitlebar() + { + return title; + } +private: + void paintEvent(QPaintEvent *e) override + { + DMainWindow::paintEvent(e); + QPainter p(this); + const DPalette &dp = DPaletteHelper::instance()->palette(this); + + p.save(); + p.setPen(QPen(dp.frameBorder(), 2)); + p.drawRoundedRect(rect().adjusted(1, 1, -1, -1), 16, 16); + p.restore(); + } +private: + ExampTitlebar *title = nullptr; +}; + +class ExampStatusBar : public DStatusBar +{ +public: + ExampStatusBar() + { + QWidget *central = new QWidget; + QHBoxLayout *layout = new QHBoxLayout; + DSlider *slider = new DSlider(Qt::Horizontal); + slider->setFixedWidth(131); + + layout->setSpacing(0); + layout->setMargin(0); + layout->addSpacing(254); + layout->addWidget(new QLabel("7项")); + layout->addWidget(slider, 0, Qt::AlignRight); + central->setLayout(layout); + + setFixedSize(530, 30); + central->setFixedWidth(530); + addWidget(central, 10); + } +private: + void paintEvent(QPaintEvent *e) override + { + QPainter p(this); + const DPalette &dp = DPaletteHelper::instance()->palette(this); + + p.setPen(QPen(dp.frameBorder(), 2)); + DDrawUtils::drawRoundedRect(&p, rect().adjusted(0 , 0, -1 , -1), 16, 16, + DDrawUtils::Corner::BottomLeftCorner | DDrawUtils::Corner::BottomRightCorner); + DStatusBar::paintEvent(e); + } +}; + +WindowExampleWindow::WindowExampleWindow(QWidget *parent) + : PageWindowInterface(parent) +{ + addExampleWindow(new DTitleBarExample(this)); + addExampleWindow(new DMainWindowExample(this)); + addExampleWindow(new DStatusBarExample(this)); + addExampleWindow(new DSizegripExample(this)); + addExampleWindow(new DTabBarExample(this)); +} + +DTitleBarExample::DTitleBarExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + setProperty("DTitleBarExample", true); + QVBoxLayout *mainLayout = new QVBoxLayout; + ExampTitlebar *titlebar1 = new ExampTitlebar(QIcon::fromTheme("preferences-system")); + ExampTitlebar *titlebar2 = new ExampTitlebar(QIcon(":/images/example/movie-logo.svg")); + ExampTitlebar *titlebar3 = new ExampTitlebar(QIcon::fromTheme("preferences-system")); + ExampTitlebar *titlebar4 = new ExampTitlebar(QIcon::fromTheme("preferences-system")); + + titlebar2->setBackgroundTransparent(true); + + + QLabel *label1 = new QLabel; + QLabel *label2 = new QLabel; + QLabel *label3 = new QLabel; + QLabel *label4 = new QLabel; + QLabel *background = new QLabel(titlebar2); + + background->setObjectName("background"); + titlebar2->setObjectName("title"); + + background->setFixedSize(550, 70); + background->setPixmap(QPixmap(":/images/example/background.png")); + background->setScaledContents(true); + background->move(-10, -5); + background->lower(); + + mainLayout->setSpacing(20); + + titlebar2->addWidget(new QLabel("avatar(2009)108...-ndi[Team DRSD].mkv"), Qt::AlignLeft); + //当前不能通过setWindowFlags()函数设置标志位隐藏,setVisible()也不可 + titlebar3->findChild()->setFixedSize(0, 0); + titlebar4->findChild()->setFixedSize(0, 0); + + label1->setScaledContents(true); + label1->setFixedSize(550, 372); + label1->setPixmap(QPixmap(":/images/example/DTitlebar_1.png")); + + label2->setScaledContents(true); + label2->setFixedSize(550, 372); + label2->setPixmap(QPixmap(":/images/example/DTitlebar_2.png")); + + label3->setScaledContents(true); + label3->setFixedSize(550, 372); + label3->setPixmap(QPixmap(":/images/example/DTitlebar_3.png")); + + label4->setScaledContents(true); + label4->setFixedSize(550, 372); + label4->setPixmap(QPixmap(":/images/example/DTitlebar_4.png")); + + + mainLayout->addWidget(titlebar1, 0, Qt::AlignCenter); + mainLayout->addWidget(titlebar2, 0, Qt::AlignCenter); + mainLayout->addWidget(titlebar3, 0, Qt::AlignCenter); + mainLayout->addWidget(titlebar4, 0, Qt::AlignCenter); + + mainLayout->addWidget(label1, 0, Qt::AlignCenter); + mainLayout->addWidget(label2, 0, Qt::AlignCenter); + mainLayout->addWidget(label3, 0, Qt::AlignCenter); + mainLayout->addWidget(label4, 0, Qt::AlignCenter); + + setLayout(mainLayout); +} + +QString DTitleBarExample::getTitleName() const +{ + return "DTitleBar"; +} + +QString DTitleBarExample::getDescriptionInfo() const +{ + return "DTitleBar有几种样式:\n" + "一,可以最大化且带不透明背景\n" + "二,可以最大化带透明背景\n" + "三,不可以最大化带不透明背景\n" + "四,不可以最大化带透明背景\n"; +} + +int DTitleBarExample::getFixedHeight() const +{ + return 1942; +} + +DMainWindowExample::DMainWindowExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + QLabel *label = new QLabel; + + + label->setScaledContents(true); + label->setFixedSize(550, 372); + label->setPixmap(QPixmap(":/images/example/DTitlebar_1.png")); + + mainLayout->addWidget(label, 0, Qt::AlignCenter); +} + +QString DMainWindowExample::getTitleName() const +{ + return "DMainWindow"; +} + +QString DMainWindowExample::getDescriptionInfo() const +{ + return "主窗口"; +} + +int DMainWindowExample::getFixedHeight() const +{ + return 662; +} + +DStatusBarExample::DStatusBarExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout; + ExampStatusBar *bar = new ExampStatusBar; + QLabel *label = new QLabel; + + setLayout(mainLayout); + label->setScaledContents(true); + label->setFixedSize(550, 372); + label->setPixmap(QPixmap(":/images/example/DTitlebar_1.png")); + + + mainLayout->addWidget(bar, 0, Qt::AlignCenter); + mainLayout->addSpacing(80); + mainLayout->addWidget(label, 0, Qt::AlignCenter); +} + +QString DStatusBarExample::getTitleName() const +{ + return "DStatusBar"; +} + +QString DStatusBarExample::getDescriptionInfo() const +{ + return "状态栏"; +} + +int DStatusBarExample::getFixedHeight() const +{ + return 572; +} + +// 构造指定类型的Tabbar +template +T* generateTabBar(const QTabBar::Shape shape, QWidget* parent = nullptr) +{ + auto tabbar = new T(parent); + + tabbar->addTab(""); + tabbar->setTabIcon(0, QIcon(":/images/logo_icon.svg")); + tabbar->addTab("标签二"); + tabbar->addTab("标签三"); + tabbar->addTab("标签四"); + tabbar->addTab("标签五"); + tabbar->addTab("标签六"); + tabbar->addTab("标签七"); + + tabbar->setShape(shape); + tabbar->setTabsClosable(true); + + return tabbar; +} + +// 测试DTabBar::setShape接口 +inline static QWidget* createTabBarSetShape(const QList& shapes, QWidget* parent) +{ + auto view = new QWidget(parent); + + auto layout = new QHBoxLayout(view); + layout->setSpacing(40); + + for (auto shape : shapes) { + auto *tabbar1 = generateTabBar(shape); + tabbar1->setEnabledEmbedStyle(false); + layout->addWidget(tabbar1, 0); + { + auto border = new QFrame(); + border->setFrameShape(QFrame::VLine); + border->setFrameShadow(QFrame::Sunken); + layout->addWidget(border); + } + auto *tabbar2 = generateTabBar(shape); + tabbar2->setEnabledEmbedStyle(true); + layout->addWidget(tabbar2, 0); + { + auto border = new QFrame(); + border->setFrameShape(QFrame::VLine); + border->setFrameShadow(QFrame::Sunken); + layout->addWidget(border); + } + + QObject::connect(tabbar1, &DTabBar::tabAddRequested, [tabbar1, tabbar2](){ + tabbar1->addTab(QString("Add Tab %1").arg(tabbar1->count())); + tabbar2->addTab(QString("Add Tab %1").arg(tabbar2->count())); + }); + } + return view; +} + +DTabBarExample::DTabBarExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + DTabBar *tabbar1 = new DTabBar; + DTabBar *tabbar2 = new DTabBar; + QLabel *label1 = new QLabel; + QLabel *label2 = new QLabel; + ExampWindow *window = new ExampWindow(QIcon::fromTheme("preferences-system")); + QVBoxLayout *layout = new QVBoxLayout(this); + + tabbar1->setEnabledEmbedStyle(true); + tabbar1->addTab("标签一"); + tabbar1->addTab("标签二"); + tabbar1->addTab("标签三"); + tabbar1->addTab("标签四"); + tabbar1->addTab("标签五"); + tabbar1->setExpanding(true); + tabbar1->setFixedWidth(550); + + tabbar2->addTab("/etc/.co."); + tabbar2->addTab("gtk-wid..."); + + window->eTitlebar()->addWidget(tabbar2, Qt::AlignLeft); + + window->setFixedSize(550, 120); + window->eTitlebar()->setFixedWidth(550); + + label1->setScaledContents(true); + label2->setScaledContents(true); + label1->setFixedSize(550, 356); + label2->setFixedSize(550, 328); + label1->setPixmap(QPixmap(":/images/example/DTabBar_1.png")); + label2->setPixmap(QPixmap(":/images/example/DTabBar_2.png")); + + layout->addWidget(tabbar1, 0, Qt::AlignCenter); + layout->addSpacing(40); + layout->addWidget(window, 0, Qt::AlignCenter); + layout->addSpacing(40); + layout->addWidget(createTabBarSetShape({QTabBar::RoundedWest, QTabBar::RoundedEast}, this), 0, Qt::AlignCenter); + layout->addSpacing(40); + layout->addWidget(createTabBarSetShape({QTabBar::TriangularWest, QTabBar::TriangularEast}, this), 0, Qt::AlignCenter); + layout->addSpacing(70); + layout->addWidget(label1, 0, Qt::AlignCenter); + layout->addWidget(label2, 0, Qt::AlignCenter); +} + +QString DTabBarExample::getTitleName() const +{ + return "DTabBar"; +} + +QString DTabBarExample::getDescriptionInfo() const +{ + return "类型1" + "这类标签用在应用主窗口内在DTitlebar\n" + "底下用作多视图的切换,DTitlebar是在\n" + "用户新建标签的时候才会出现,比如文\n" + "件管理器。\n" + "类型2\n" + "这类标签用在DTitlebar内,也是用作\n" + "多视图的切换,但和类型1性质一样,但\n" + "是使用场景不一样,之所以合并在\n" + "DTitlebar内是因为该应用没有别的功能\n" + "需要放在DTitlebar上,比如文本编辑器\n" + "和终端,除了文字部分,标签就是它们\n" + "最常用的功能。\n"; +} + +int DTabBarExample::getFixedHeight() const +{ + return 1880; +} + +DSizegripExample::DSizegripExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + QVBoxLayout *layout = new QVBoxLayout; + QLabel *label = new QLabel; + + label->setScaledContents(true); + label->setFixedSize(550, 372); + label->setPixmap(QPixmap(":/images/example/DSizegrip.png")); + layout->addWidget(label, 0, Qt::AlignCenter); + + setLayout(layout); +} + +QString DSizegripExample::getTitleName() const +{ + return "DSizegrip"; +} + +QString DSizegripExample::getDescriptionInfo() const +{ + return "尺寸控制"; +} + +int DSizegripExample::getFixedHeight() const +{ + return 662; +} diff -Nru dtkwidget-5.5.48/examples/collections/windowexample.h dtkwidget-5.6.12/examples/collections/windowexample.h --- dtkwidget-5.5.48/examples/collections/windowexample.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/collections/windowexample.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,83 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef WINDOWEXAMPLE_H +#define WINDOWEXAMPLE_H + +#include +#include + +#include +#include "examplewindowinterface.h" +#include "pagewindowinterface.h" + +class WindowExampleWindow : public PageWindowInterface +{ + Q_OBJECT + +public: + explicit WindowExampleWindow(QWidget *parent = nullptr); +}; + +class DTitleBarExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DTitleBarExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DMainWindowExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DMainWindowExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DStatusBarExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DStatusBarExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DSizegripExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DSizegripExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +class DTabBarExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DTabBarExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + +#endif // WINDOWEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/buttonexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/buttonexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/buttonexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/buttonexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1002 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "buttonexample.h" - -DWIDGET_USE_NAMESPACE - -ButtonExampleWindow::ButtonExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DPushButtonExample(this)); - addExampleWindow(new DWarningButtonExample(this)); - addExampleWindow(new DSuggestButtonExample(this)); - addExampleWindow(new DToolButtonExample(this)); - addExampleWindow(new DIconButtonExample(this)); - addExampleWindow(new DButtonBoxExample(this)); - addExampleWindow(new DFloatingButtonExample(this)); - addExampleWindow(new DSwitchButtonExample(this)); - addExampleWindow(new DRadioButtonExample(this)); - addExampleWindow(new DCheckButtonExample(this)); - addExampleWindow(new DComboBoxExample(this)); - addExampleWindow(new DFontComboBoxExample(this)); - addExampleWindow(new DSearchComboBoxExample(this)); -} - -DPushButtonExample::DPushButtonExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; - QHBoxLayout *pHBoxLayout_2 = new QHBoxLayout; - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - - setLayout(pVBoxLayout); - pVBoxLayout->addStretch(); - pVBoxLayout->addLayout(pHBoxLayout_1); - pVBoxLayout->addSpacing(20); - pVBoxLayout->addLayout(pHBoxLayout_2); - pVBoxLayout->addStretch(); - - DPushButton *pButtonNormal = new DPushButton("button normal", this); - pButtonNormal->setFixedSize(200, 36); - - DPushButton *pButtonDisabled = new DPushButton("button disabled", this); - pButtonDisabled->setFixedSize(200, 36); - pButtonDisabled->setEnabled(false); - - pHBoxLayout_1->addStretch(); - pHBoxLayout_1->addWidget(pButtonNormal); - pHBoxLayout_1->addSpacing(20); - pHBoxLayout_1->addWidget(pButtonDisabled); - pHBoxLayout_1->addStretch(); - - DPushButton *pPushButton = new DPushButton("push button", this); - pPushButton->setFixedSize(200, 36); - pPushButton->setCheckable(true); - - QMenu *pMenu = new QMenu(this); - pMenu->addAction("item_1"); - pMenu->addAction("item_2"); - pMenu->addAction("item_3"); - - pPushButton->setMenu(pMenu); - - DPushButton *pPushButtonDisabled = new DPushButton("push button", this); - pPushButtonDisabled->setFixedSize(200, 36); - pPushButtonDisabled->setEnabled(false); - pPushButtonDisabled->setMenu(pMenu); - - pHBoxLayout_2->addStretch(); - pHBoxLayout_2->addWidget(pPushButton); - pHBoxLayout_2->addSpacing(20); - pHBoxLayout_2->addWidget(pPushButtonDisabled); - pHBoxLayout_2->addStretch(); - - connect(pButtonNormal, &DPushButton::clicked, this, [] { - DDialog dialog("", "名称push button已经被占用,请使用其他名称", nullptr); - dialog.setIcon(DStyle().standardIcon(DStyle::SP_MessageBoxWarning)); - dialog.addButton("确定"); - dialog.exec(); - }); -} - -QString DPushButtonExample::getTitleName() const -{ - return "DPushButton"; -} - -QString DPushButtonExample::getDescriptionInfo() const -{ - return "普通的文字按钮和带菜单的文字按钮\n" - "按钮的文字随着菜单的选择而改变"; -} - -int DPushButtonExample::getFixedHeight() const -{ - return 402; -} - -DWarningButtonExample::DWarningButtonExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - - setLayout(pVBoxLayout); - pVBoxLayout->addSpacing(40); - pVBoxLayout->addLayout(pHBoxLayout_1); - pVBoxLayout->addStretch(); - - DWarningButton *pWarningButton = new DWarningButton(this); - pWarningButton->setText("warning"); - pWarningButton->setFixedSize(200, 36); - - DWarningButton *pWarningButtonDisabled = new DWarningButton(this); - pWarningButtonDisabled->setText("warning disabled"); - pWarningButtonDisabled->setEnabled(false); - pWarningButtonDisabled->setFixedSize(200, 36); - - pHBoxLayout_1->addStretch(); - pHBoxLayout_1->addWidget(pWarningButton); - pHBoxLayout_1->addSpacing(20); - pHBoxLayout_1->addWidget(pWarningButtonDisabled); - pHBoxLayout_1->addStretch(); - - connect(pWarningButton, &DWarningButton::clicked, this, [] { - DDialog dialog("", "格式化操作会清空该磁盘数据,您需要继续吗?\n此操作不可以恢复", nullptr); - dialog.setIcon(DStyle().standardIcon(DStyle::SP_DriveNetIcon)); - dialog.addButton("取消"); - dialog.addButton("格式化"); - dialog.exec(); - }); -} - -QString DWarningButtonExample::getTitleName() const -{ - return "DWarningButton"; -} - -QString DWarningButtonExample::getDescriptionInfo() const -{ - return "功能和普通的文字按钮一致,不过用在\n" - "警告语上,告诉用户有危险操作."; -} - -int DWarningButtonExample::getFixedHeight() const -{ - return 368; -} - -DSuggestButtonExample::DSuggestButtonExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; - QHBoxLayout *pHBoxLayout_2 = new QHBoxLayout; - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - - setLayout(pVBoxLayout); - pVBoxLayout->addStretch(); - pVBoxLayout->addLayout(pHBoxLayout_1); - pVBoxLayout->addSpacing(20); - pVBoxLayout->addLayout(pHBoxLayout_2); - pVBoxLayout->addStretch(); - - DSuggestButton *pRecommend = new DSuggestButton("recommend", this); - pRecommend->setFixedSize(200, 36); - - DPushButton *pRecommendDisabled = new DPushButton("recommend disabled", this); - pRecommendDisabled->setFixedSize(200, 36); - pRecommendDisabled->setEnabled(false); - - pHBoxLayout_1->addStretch(); - pHBoxLayout_1->addWidget(pRecommend); - pHBoxLayout_1->addSpacing(20); - pHBoxLayout_1->addWidget(pRecommendDisabled); - pHBoxLayout_1->addStretch(); - - DSuggestButton *pHighlight = new DSuggestButton("highlight", this); - pHighlight->setFixedSize(200, 36); - pHighlight->setCheckable(true); - pHighlight->setFocus(); - - DPushButton *pHighlightDisabled = new DPushButton("highlight disabled", this); - pHighlightDisabled->setFixedSize(200, 36); - pHighlightDisabled->setEnabled(false); - - pHBoxLayout_2->addStretch(); - pHBoxLayout_2->addWidget(pHighlight); - pHBoxLayout_2->addSpacing(20); - pHBoxLayout_2->addWidget(pHighlightDisabled); - pHBoxLayout_2->addStretch(); - - connect(pRecommend, &DPushButton::clicked, this, [] { - DDialog dialog("", "这里现实简要出错信息XXXXXXXX", nullptr); - dialog.setIcon(DStyle().standardIcon(DStyle::SP_MessageBoxWarning)); - dialog.addButton("显示详情"); - dialog.addButton("确定"); - dialog.exec(); - }); -} - -QString DSuggestButtonExample::getTitleName() const -{ - return "DSuggestButton"; -} - -QString DSuggestButtonExample::getDescriptionInfo() const -{ - return "往往不会单独出现,绝大多数情况都是\n" - "和DPushButton一起出现,显示在\n" - "DPushButton的右边,主要是起引导用\n" - "户点击的作用."; -} - -int DSuggestButtonExample::getFixedHeight() const -{ - return 300; -} - -DToolButtonExample::DToolButtonExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout = new QHBoxLayout; - pHBoxLayout->setMargin(20); - pHBoxLayout->setSpacing(0); - - auto showDialog = [](const QString &info) { - DDialog dialog("", info, nullptr); - dialog.setIcon(DStyle().standardIcon(DStyle::SP_MessageBoxInformation)); - dialog.addButton("确定"); - dialog.exec(); - }; - - DToolBar *pToolBar = new DToolBar; - pToolBar->addAction(QIcon::fromTheme("icon_button"), "", this, [showDialog] { - showDialog("这是icon_button的图标"); - }); - - pToolBar->addAction(QIcon::fromTheme("icon_edit"), "", this, [showDialog] { - showDialog("这是icon_edit的图标"); - }); - - pToolBar->addAction(QIcon::fromTheme("icon_slider"), "", this, [showDialog] { - showDialog("这是icon_slider的图标"); - }); - - pToolBar->addAction(QIcon::fromTheme("icon_ListView"), "", this, [showDialog] { - showDialog("这是icon_ListView的图标"); - }); - - pToolBar->addAction(QIcon::fromTheme("icon_Window"), "", this, [showDialog] { - showDialog("这是icon_Window的图标"); - }); - - pToolBar->addAction(QIcon::fromTheme("icon_Tooltip"), "", this, [showDialog] { - showDialog("这是icon_Tooltip的图标"); - }); - - pHBoxLayout->addWidget(pToolBar); - - pVBoxLayout->addSpacing(20); - pVBoxLayout->addLayout(pHBoxLayout); - pHBoxLayout->addSpacing(30); - - QLabel *pLabel = new QLabel; - QPixmap pix(":/images/example/DToolButton.png"); - pLabel->setFixedSize(570, 348); - pLabel->setPixmap(pix); - pLabel->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; - pHBoxLayout_pic->setMargin(0); - pHBoxLayout_pic->setSpacing(0); - pHBoxLayout_pic->addWidget(pLabel); - - pVBoxLayout->addLayout(pHBoxLayout_pic); -} - -QString DToolButtonExample::getTitleName() const -{ - return "DToolButton"; -} - -QString DToolButtonExample::getDescriptionInfo() const -{ - return "主要用在工具栏上作为应用的功能按\n" - "钮,比如画板左侧的工具栏图标."; -} - -int DToolButtonExample::getFixedHeight() const -{ - return 600; -} - -DIconButtonExample::DIconButtonExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout = new QHBoxLayout; - pHBoxLayout->setMargin(10); - pHBoxLayout->setSpacing(0); - - DIconButton *pButton_1 = new DIconButton(DStyle::SP_IncreaseElement, this); - pButton_1->setFixedSize(36, 36); - - DIconButton *pButton_2 = new DIconButton(DStyle::SP_ArrowEnter, this); - pButton_2->setFixedSize(36, 36); - - DIconButton *pButton_3 = new DIconButton(DStyle::SP_IncreaseElement, this); - pButton_3->setEnabled(false); - pButton_3->setFixedSize(36, 36); - - DIconButton *pButton_4 = new DIconButton(DStyle::SP_ArrowEnter, this); - pButton_4->setEnabled(false); - pButton_4->setFixedSize(36, 36); - - DIconButton *pButton_5 = new DIconButton(DStyle::SP_DeleteButton, this); - pButton_5->setFlat(true); - pButton_5->setFixedSize(QSize(24, 24)); - pButton_5->setIconSize(QSize(16, 16)); - DStyle::setFocusRectVisible(pButton_5, false); - - DIconButton *pButton_6 = new DIconButton(DStyle::SP_AddButton, this); - pButton_6->setFlat(true); - pButton_6->setFixedSize(QSize(24, 24)); - pButton_6->setIconSize(QSize(16, 16)); - DStyle::setFocusRectVisible(pButton_6, false); - - DIconButton *pButton_7 = new DIconButton(DStyle::SP_DeleteButton, this); - pButton_7->setEnabled(false); - pButton_7->setFlat(true); - pButton_7->setFixedSize(QSize(24, 24)); - pButton_7->setIconSize(QSize(16, 16)); - DStyle::setFocusRectVisible(pButton_7, false); - - DIconButton *pButton_8 = new DIconButton(DStyle::SP_AddButton, this); - pButton_8->setEnabled(false); - pButton_8->setFlat(true); - pButton_8->setFixedSize(QSize(24, 24)); - pButton_8->setIconSize(QSize(16, 16)); - DStyle::setFocusRectVisible(pButton_8, false); - - pHBoxLayout->addStretch(); - pHBoxLayout->addWidget(pButton_1); - pHBoxLayout->addSpacing(10); - pHBoxLayout->addWidget(pButton_2); - pHBoxLayout->addSpacing(50); - pHBoxLayout->addWidget(pButton_3); - pHBoxLayout->addSpacing(10); - pHBoxLayout->addWidget(pButton_4); - - pHBoxLayout->addSpacing(100); - pHBoxLayout->addWidget(pButton_5); - pHBoxLayout->addSpacing(10); - pHBoxLayout->addWidget(pButton_6); - pHBoxLayout->addSpacing(50); - pHBoxLayout->addWidget(pButton_7); - pHBoxLayout->addSpacing(10); - pHBoxLayout->addWidget(pButton_8); - pHBoxLayout->addStretch(); - - pVBoxLayout->addSpacing(20); - pVBoxLayout->addLayout(pHBoxLayout); - pHBoxLayout->addSpacing(20); - - QLabel *pLabel = new QLabel; - QPixmap pix(":/images/example/DIconButton.png"); - pLabel->setFixedSize(568, 444); - pLabel->setPixmap(pix); - pLabel->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; - pHBoxLayout_pic->setMargin(0); - pHBoxLayout_pic->setSpacing(0); - pHBoxLayout_pic->addWidget(pLabel); - - pVBoxLayout->addLayout(pHBoxLayout_pic); -} - -QString DIconButtonExample::getTitleName() const -{ - return "DIconButton"; -} - -QString DIconButtonExample::getDescriptionInfo() const -{ - return "性质和DPushButton一致,只不过是用\n" - "图形化代替文字,最常见的有新建,上\n" - "一个下一个等."; -} - -int DIconButtonExample::getFixedHeight() const -{ - return 600; -} - -DButtonBoxExample::DButtonBoxExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout = new QHBoxLayout; - pHBoxLayout->setMargin(10); - pHBoxLayout->setSpacing(0); - - DButtonBox *pButtonBox_1 = new DButtonBox; - - DButtonBoxButton *pButton_1 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_ArrowLeave)); - pButton_1->setFixedSize(36, 36); - - DButtonBoxButton *pButton_2 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_ArrowEnter)); - pButton_2->setFixedSize(36, 36); - - pButtonBox_1->setButtonList(QList() << pButton_1 << pButton_2, true); - - DButtonBox *pButtonBox_2 = new DButtonBox; - DButtonBoxButton *pButton_3 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_ArrowLeave)); - pButton_3->setFixedSize(36, 36); - pButton_3->setEnabled(false); - - DButtonBoxButton *pButton_4 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_ArrowEnter)); - pButton_4->setFixedSize(36, 36); - pButton_4->setEnabled(false); - - pButtonBox_2->setButtonList(QList() << pButton_3 << pButton_4, true); - - DButtonBox *pButtonBox_3 = new DButtonBox; - DButtonBoxButton *pButton_5 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_LockElement), "锁定设置"); - pButton_3->setFixedSize(36, 36); - pButton_3->setEnabled(false); - - DButtonBoxButton *pButton_6 = new DButtonBoxButton(DStyle().standardIcon(DStyle::SP_UnlockElement), "解锁设置"); - pButton_4->setFixedSize(36, 36); - pButton_4->setEnabled(false); - - pButtonBox_3->setButtonList(QList() << pButton_5 << pButton_6, true); - - pHBoxLayout->addStretch(); - pHBoxLayout->addWidget(pButtonBox_1); - pHBoxLayout->addSpacing(10); - pHBoxLayout->addWidget(pButtonBox_2); - pHBoxLayout->addSpacing(50); - pHBoxLayout->addWidget(pButtonBox_3); - pHBoxLayout->addStretch(); - - pVBoxLayout->addSpacing(20); - pVBoxLayout->addLayout(pHBoxLayout); - pHBoxLayout->addSpacing(20); - - QLabel *pLabel = new QLabel; - QPixmap pix(":/images/example/DButtonBox.png"); - pLabel->setFixedSize(570, 426); - pLabel->setPixmap(pix); - pLabel->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; - pHBoxLayout_pic->setMargin(0); - pHBoxLayout_pic->setSpacing(0); - pHBoxLayout_pic->addWidget(pLabel); - - pVBoxLayout->addLayout(pHBoxLayout_pic); -} - -QString DButtonBoxExample::getTitleName() const -{ - return "DButtonBox"; -} - -QString DButtonBoxExample::getDescriptionInfo() const -{ - return "群组按钮,几个连体按钮选项是为了一\n" - "个共同的功能服务,比如日历的切换视\n" - "图,还有常见的文字选项如加粗下划线\n" - "中横线等."; -} - -int DButtonBoxExample::getFixedHeight() const -{ - return 600; -} - -DFloatingButtonExample::DFloatingButtonExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout = new QHBoxLayout; - pHBoxLayout->setMargin(10); - pHBoxLayout->setSpacing(0); - - DFloatingButton *pFloatingButton_1 = new DFloatingButton(DStyle::SP_IncreaseElement, this); - pFloatingButton_1->setFixedSize(48, 48); - - DFloatingButton *pFloatingButton_2 = new DFloatingButton(DStyle::SP_IncreaseElement, this); - pFloatingButton_2->setFixedSize(48, 48); - pFloatingButton_2->setEnabled(false); - - pHBoxLayout->addStretch(); - pHBoxLayout->addWidget(pFloatingButton_1); - pHBoxLayout->addSpacing(50); - pHBoxLayout->addWidget(pFloatingButton_2); - pHBoxLayout->addStretch(); - - pVBoxLayout->addSpacing(20); - pVBoxLayout->addLayout(pHBoxLayout); - - QLabel *pLabel = new QLabel; - QPixmap pix(":/images/example/DFloatingButton.png"); - pLabel->setFixedSize(568, 444); - pLabel->setPixmap(pix); - pLabel->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; - pHBoxLayout_pic->setMargin(0); - pHBoxLayout_pic->setSpacing(0); - pHBoxLayout_pic->addWidget(pLabel); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_pic); - pVBoxLayout->addSpacing(20); -} - -QString DFloatingButtonExample::getTitleName() const -{ - return "DFloatingButton"; -} - -QString DFloatingButtonExample::getDescriptionInfo() const -{ - return "在一个场景中作为一个主要功能使用,\n" - "比如控制中心账户列表中作为添加账户\n" - "使用.这个按钮是悬浮的,不占据底下\n" - "内容的空间."; -} - -int DFloatingButtonExample::getFixedHeight() const -{ - return 600; -} - -DSwitchButtonExample::DSwitchButtonExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout = new QHBoxLayout; - pHBoxLayout->setMargin(0); - pHBoxLayout->setSpacing(0); - - DSwitchButton *pSwitchButton_1 = new DSwitchButton; - - DSwitchButton *pSwitchButton_2 = new DSwitchButton; - pSwitchButton_2->setEnabled(false); - - pHBoxLayout->addStretch(); - pHBoxLayout->addWidget(pSwitchButton_1); - pHBoxLayout->addSpacing(30); - pHBoxLayout->addWidget(pSwitchButton_2); - pHBoxLayout->addStretch(); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout); - - QLabel *pLabel = new QLabel; - QPixmap pix(":/images/example/DSwitchButton.png"); - pLabel->setFixedSize(568, 444); - pLabel->setPixmap(pix); - pLabel->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; - pHBoxLayout_pic->setMargin(0); - pHBoxLayout_pic->setSpacing(0); - pHBoxLayout_pic->addWidget(pLabel); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_pic); - pVBoxLayout->addSpacing(20); -} - -QString DSwitchButtonExample::getTitleName() const -{ - return "DSwitchButton"; -} - -QString DSwitchButtonExample::getDescriptionInfo() const -{ - return "普通的开关控件,等价控件为\n" - "DCheckButton"; -} - -int DSwitchButtonExample::getFixedHeight() const -{ - return 600; -} - -DRadioButtonExample::DRadioButtonExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout = new QHBoxLayout; - pHBoxLayout->setMargin(0); - pHBoxLayout->setSpacing(0); - - DRadioButton *pRadioButton_1 = new DRadioButton; - //也可以不设置,默认是设置为互斥的 - pRadioButton_1->setAutoExclusive(true); - - DRadioButton *pRadioButton_2 = new DRadioButton; - pRadioButton_2->setAutoExclusive(true); - - pHBoxLayout->addStretch(); - pHBoxLayout->addWidget(pRadioButton_1); - pHBoxLayout->addSpacing(30); - pHBoxLayout->addWidget(pRadioButton_2); - pHBoxLayout->addStretch(); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout); - - QLabel *pLabel = new QLabel; - QPixmap pix(":/images/example/DRadioButton.png"); - pLabel->setFixedSize(568, 444); - pLabel->setPixmap(pix); - pLabel->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; - pHBoxLayout_pic->setMargin(0); - pHBoxLayout_pic->setSpacing(0); - pHBoxLayout_pic->addWidget(pLabel); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_pic); - pVBoxLayout->addSpacing(20); -} - -QString DRadioButtonExample::getTitleName() const -{ - return "DRadioButton"; -} - -QString DRadioButtonExample::getDescriptionInfo() const -{ - return "常见于设置或者对话框中作为一个选项\n" - "存在,至少提供2个或者多个选项,选\n" - "项之间是互斥的."; -} - -int DRadioButtonExample::getFixedHeight() const -{ - return 600; -} - -DCheckButtonExample::DCheckButtonExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout = new QHBoxLayout; - pHBoxLayout->setMargin(0); - pHBoxLayout->setSpacing(0); - - DCheckBox *pCheckBox_1 = new DCheckBox(""); - pCheckBox_1->setTristate(true); - pCheckBox_1->setCheckState(Qt::PartiallyChecked); - - DCheckBox *pCheckBox_2 = new DCheckBox(""); - - DCheckBox *pCheckBox_3 = new DCheckBox(""); - pCheckBox_3->setTristate(true); - pCheckBox_3->setCheckState(Qt::Unchecked); - pCheckBox_3->setEnabled(false); - - DCheckBox *pCheckBox_4 = new DCheckBox(""); - pCheckBox_4->setTristate(true); - pCheckBox_4->setCheckState(Qt::Checked); - pCheckBox_4->setEnabled(false); - - DCheckBox *pCheckBox_5 = new DCheckBox(""); - pCheckBox_5->setTristate(true); - pCheckBox_5->setCheckState(Qt::PartiallyChecked); - pCheckBox_5->setEnabled(false); - - pHBoxLayout->addStretch(); - pHBoxLayout->addWidget(pCheckBox_1); - pHBoxLayout->addSpacing(10); - pHBoxLayout->addWidget(pCheckBox_2); - pHBoxLayout->addSpacing(50); - pHBoxLayout->addWidget(pCheckBox_3); - pHBoxLayout->addSpacing(10); - pHBoxLayout->addWidget(pCheckBox_4); - pHBoxLayout->addSpacing(10); - pHBoxLayout->addWidget(pCheckBox_5); - pHBoxLayout->addStretch(); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout); - - QLabel *pLabel = new QLabel; - QPixmap pix(":/images/example/DCheckButton.png"); - pLabel->setFixedSize(568, 444); - pLabel->setPixmap(pix); - pLabel->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic = new QHBoxLayout; - pHBoxLayout_pic->setMargin(0); - pHBoxLayout_pic->setSpacing(0); - pHBoxLayout_pic->addWidget(pLabel); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_pic); - pVBoxLayout->addSpacing(20); -} - -QString DCheckButtonExample::getTitleName() const -{ - return "DCheckButton"; -} - -QString DCheckButtonExample::getDescriptionInfo() const -{ - return "和DRadioButton一致,也常用于设\n" - "置和对话框的选项,但每个选项之间是\n" - "独立的,不会产生冲突.每个选项的等\n" - "价控件是DSwitchButton."; -} - -int DCheckButtonExample::getFixedHeight() const -{ - return 600; -} - -DComboBoxExample::DComboBoxExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; - pHBoxLayout_1->setMargin(0); - pHBoxLayout_1->setSpacing(0); - - DComboBox *pComboBox_1 = new DComboBox; - pComboBox_1->setFixedSize(240, 36); - for (int i = 0; i < 30; i++) { - pComboBox_1->addItem(QString("ComboBox button - %1").arg(i)); - } - pHBoxLayout_1->addWidget(pComboBox_1); - - QComboBox *pComboBox_1_count = new QComboBox(); - pComboBox_1_count->setFixedSize(100, 36); - pComboBox_1_count->addItem(QString::number(10)); - pComboBox_1_count->addItem(QString::number(20)); - pComboBox_1_count->addItem(QString::number(30)); - pComboBox_1_count->setCurrentIndex(pComboBox_1_count->count() - 1); - connect(pComboBox_1_count, static_cast(&QComboBox::currentIndexChanged), [pComboBox_1, pComboBox_1_count](int index){ - pComboBox_1->clear(); - for (int i = 0; i < pComboBox_1_count->itemText(index).toInt(); i++) { - pComboBox_1->addItem(QString("ComboBox button - %1").arg(i)); - } - }); - pHBoxLayout_1->addWidget(pComboBox_1_count); - - QHBoxLayout *pHBoxLayout_2 = new QHBoxLayout; - pHBoxLayout_2->setMargin(0); - pHBoxLayout_2->setSpacing(0); - DComboBox *pComboBox_2 = new DComboBox; - pComboBox_2->setFixedSize(340, 36); - pComboBox_2->addItem("/space"); - pHBoxLayout_2->addWidget(pComboBox_2); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_1); - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_2); - - QLabel *pLabel_1 = new QLabel; - QPixmap pix_1(":/images/example/DComboBox_1.png"); - pLabel_1->setFixedSize(568, 444); - pLabel_1->setPixmap(pix_1); - pLabel_1->setScaledContents(true); - - QLabel *pLabel_2 = new QLabel; - QPixmap pix_2(":/images/example/DComboBox_2.png"); - pLabel_2->setFixedSize(568, 444); - pLabel_2->setPixmap(pix_2); - pLabel_2->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; - pHBoxLayout_pic_1->setMargin(0); - pHBoxLayout_pic_1->setSpacing(0); - pHBoxLayout_pic_1->addWidget(pLabel_1); - - QHBoxLayout *pHBoxLayout_pic_2 = new QHBoxLayout; - pHBoxLayout_pic_2->setMargin(0); - pHBoxLayout_pic_2->setSpacing(0); - pHBoxLayout_pic_2->addWidget(pLabel_2); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_pic_1); - pVBoxLayout->addSpacing(20); - pVBoxLayout->addLayout(pHBoxLayout_pic_2); - pVBoxLayout->addSpacing(20); -} - -QString DComboBoxExample::getTitleName() const -{ - return "DComboBox"; -} - -QString DComboBoxExample::getDescriptionInfo() const -{ - return "作为一个选项存在,多数时候前面有标\n" - "题,但也有没有标题的情况.点击是出\n" - "现一个菜单,点击选项某一项菜单后菜\n" - "单收起,选项框上的文字显示菜单里激\n" - "活的那一项."; -} - -int DComboBoxExample::getFixedHeight() const -{ - return 1200; -} - -DFontComboBoxExample::DFontComboBoxExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; - pHBoxLayout_1->setMargin(0); - pHBoxLayout_1->setSpacing(0); - - DFontComboBox *pComboBox_1 = new DFontComboBox; - pComboBox_1->setFixedSize(240, 36); - connect(pComboBox_1, &DFontComboBox::currentFontChanged, [](const QFont &f){ - qDebug() << "selected font:" << f; - }); - pHBoxLayout_1->addWidget(pComboBox_1); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_1); - pVBoxLayout->addSpacing(30); - - QLabel *pLabel_1 = new QLabel; - QPixmap pix_1(":/images/example/DFontComboBox.png"); - pLabel_1->setFixedSize(568, 444); - pLabel_1->setPixmap(pix_1); - pLabel_1->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; - pHBoxLayout_pic_1->setMargin(0); - pHBoxLayout_pic_1->setSpacing(0); - pHBoxLayout_pic_1->addWidget(pLabel_1); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_pic_1); - pVBoxLayout->addSpacing(20); -} - -QString DFontComboBoxExample::getTitleName() const -{ - return "DFontComboBox"; -} - -QString DFontComboBoxExample::getDescriptionInfo() const -{ - return "和DComboBox其实是一个控件,但这\n" - "里仅用于字体的选择."; -} - -int DFontComboBoxExample::getFixedHeight() const -{ - return 700; -} - -DSearchComboBoxExample::DSearchComboBoxExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; - pHBoxLayout_1->setMargin(0); - pHBoxLayout_1->setSpacing(0); - - DSearchComboBox *pComboBox_1 = new DSearchComboBox(this); - pComboBox_1->setEditable(false); - for (int i = 0; i < 16; ++i) { - pComboBox_1->addItem(QString("手动选择驱动方案%1").arg(i + 1)); - } - pComboBox_1->setFixedSize(240, 36); - pHBoxLayout_1->addWidget(pComboBox_1); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_1); - pVBoxLayout->addSpacing(30); - - QLabel *pLabel_1 = new QLabel; - QPixmap pix_1(":/images/example/DSearchComboBox.png"); - pLabel_1->setFixedSize(568, 444); - pLabel_1->setPixmap(pix_1); - pLabel_1->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; - pHBoxLayout_pic_1->setMargin(0); - pHBoxLayout_pic_1->setSpacing(0); - pHBoxLayout_pic_1->addWidget(pLabel_1); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_pic_1); - pVBoxLayout->addSpacing(20); -} - -QString DSearchComboBoxExample::getTitleName() const -{ - return "DSearchComboBox"; -} - -QString DSearchComboBoxExample::getDescriptionInfo() const -{ - return "一个带搜索功能的ComboBox控件."; -} - -int DSearchComboBoxExample::getFixedHeight() const -{ - return 700; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/buttonexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/buttonexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/buttonexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/buttonexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,195 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef BUTTONEXAMPLE_H -#define BUTTONEXAMPLE_H -#include -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class ButtonExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit ButtonExampleWindow(QWidget *parent = nullptr); -}; - -class DPushButtonExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DPushButtonExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DWarningButtonExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DWarningButtonExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DSuggestButtonExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DSuggestButtonExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DToolButtonExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DToolButtonExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DIconButtonExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DIconButtonExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DButtonBoxExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DButtonBoxExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DFloatingButtonExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DFloatingButtonExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DSwitchButtonExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DSwitchButtonExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DRadioButtonExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DRadioButtonExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DCheckButtonExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DCheckButtonExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DComboBoxExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DComboBoxExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DFontComboBoxExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DFontComboBoxExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DSearchComboBoxExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DSearchComboBoxExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // BUTTONEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/cameraform.ui dtkwidget-5.6.12/examples/dwidget-examples/collections/cameraform.ui --- dtkwidget-5.5.48/examples/dwidget-examples/collections/cameraform.ui 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/cameraform.ui 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ - - - CameraForm - - - - 0 - 0 - 506 - 268 - - - - Form - - - - - 10 - 240 - 201 - 16 - - - - Qt::Horizontal - - - - - - 290 - 10 - 200 - 200 - - - - - - - - - - 440 - 240 - 51 - 20 - - - - ok - - - - - - 10 - 10 - 200 - 200 - - - - - - - 310 - 240 - 61 - 21 - - - - - - - mirrored - - - - - - 380 - 240 - 51 - 21 - - - - Round - - - - - - 250 - 240 - 51 - 22 - - - - start - - - - - - diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/collections.pro dtkwidget-5.6.12/examples/dwidget-examples/collections/collections.pro --- dtkwidget-5.5.48/examples/dwidget-examples/collections/collections.pro 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/collections.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -include(../../../src/d_version.pri) - -QT += core gui svg -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -QT += dtkcore$$D_VERION dtkgui$$D_VERION printsupport-private -linux* { - CONFIG += link_pkgconfig -} - -TARGET = collections -TEMPLATE = app -CONFIG += c++11 - -DEFINES += QT_MESSAGELOGCONTEXT - -unix { - QT += dbus -} - -#!isEmpty(DTK_NO_MULTIMEDIA){ - DEFINES += DTK_NO_MULTIMEDIA -# QT -= multimedia -#} else { -# HEADERS += \ -# cameraform.h -# SOURCES += \ -# cameraform.cpp -# FORMS += \ -# cameraform.ui -#} - -!isEmpty(DTK_STATIC_LIB){ - DEFINES += DTK_STATIC_LIB -} - -SOURCES += main.cpp\ - mainwindow.cpp \ - buttonexample.cpp \ - examplewindowinterface.cpp \ - pagewindowinterface.cpp \ - editexample.cpp \ - sliderexample.cpp \ - listviewexample.cpp \ - windowexample.cpp \ - tooltipexample.cpp \ - spinnerexample.cpp \ - dialogexample.cpp \ - progressbarexample.cpp \ - layoutexample.cpp \ - scrollbarexample.cpp \ - rubberbandexample.cpp \ - widgetexample.cpp \ - lcdnumberexample.cpp \ - menuexample.cpp - -HEADERS += mainwindow.h \ - buttonexample.h \ - examplewindowinterface.h \ - pagewindowinterface.h \ - editexample.h \ - sliderexample.h \ - listviewexample.h \ - windowexample.h \ - tooltipexample.h \ - spinnerexample.h \ - dialogexample.h \ - progressbarexample.h \ - layoutexample.h \ - scrollbarexample.h \ - rubberbandexample.h \ - widgetexample.h \ - lcdnumberexample.h \ - menuexample.h - -RESOURCES += \ - images.qrc \ - resources.qrc \ - icons/theme-icons.qrc - - -win32* { - CONFIG += no_lflags_merge -} - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../src/release -ldtkwidget -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../src/debug -ldtkwidgetd -else:unix: LIBS += -L$$OUT_PWD/../../../src -ldtkwidget$$D_VERION - -INCLUDEPATH += $$PWD/../../../src -INCLUDEPATH += $$PWD/../../../src/widgets -INCLUDEPATH += $$PWD/../../../src/util -DEPENDPATH += $$PWD/../../../src - -CONFIG(debug, debug|release) { - unix:QMAKE_RPATHDIR += $$OUT_PWD/../../../src -} - -target.path = $$QT.dtkcore.libs/examples - -INSTALLS += target - diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/dialogexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/dialogexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/dialogexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/dialogexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,201 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "dialogexample.h" - -DWIDGET_USE_NAMESPACE - -DialogExampleWindow::DialogExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DDialogExample(this)); - addExampleWindow(new DFileDialogExample(this)); - addExampleWindow(new DMessageManagerExample(this)); -} - -DDialogExample::DDialogExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QLabel *label1 = new QLabel; - QLabel *label2 = new QLabel; - - label1->setFixedSize(381, 181); - label1->setScaledContents(true); - label2->setFixedSize(381, 160); - label2->setScaledContents(true); - label1->setPixmap(QPixmap(":/images/example/DDialog_1.png")); - label2->setPixmap(QPixmap(":/images/example/DDialog_2.png")); - - DLabel *label = new DLabel; - QVBoxLayout *mainlayout = new QVBoxLayout(this); - DPushButton *btn = new DPushButton("开始还原"); - mainlayout->setMargin(0); - mainlayout->setSpacing(0); - - label->setPixmap(QPixmap(":/images/example/DDialog.png")); - label->setFixedSize(550, 426); - label->setScaledContents(true); - - mainlayout->addWidget(btn, 0, Qt::AlignCenter); - mainlayout->addWidget(label1, 0, Qt::AlignCenter); - mainlayout->addWidget(label2, 0, Qt::AlignCenter); - mainlayout->addSpacing(60); - mainlayout->addWidget(label, 0, Qt::AlignCenter); - mainlayout->addSpacing(70); - - connect(btn, &DPushButton::clicked, this, [ = ] { - DDialog dialog; - dialog.setIcon(style()->standardIcon(QStyle::SP_MessageBoxWarning)); - dialog.setTitle("还原当前系统需要管理员权限"); - dialog.addContent(new DPasswordEdit); - dialog.addButton("取消"); - dialog.addButton("授权", false, DDialog::ButtonRecommend); - dialog.exec(); - }); - -} - -QString DDialogExample::getTitleName() const -{ - return "DDialog"; -} - -QString DDialogExample::getDescriptionInfo() const -{ - return "用于需要用户处理事务,又不希望跳转\n" - "页面以致打断工作流程时。"; -} - -int DDialogExample::getFixedHeight() const -{ - return 967; -} - -DFileDialogExample::DFileDialogExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QLabel *label1 = new QLabel; - QLabel *label2 = new QLabel; - DLabel *label3 = new DLabel; - DFileChooserEdit *dialog = new DFileChooserEdit; - QVBoxLayout *mainLayout= new QVBoxLayout(this); - - mainLayout->setMargin(0); - mainLayout->setSpacing(0); - label1->setFixedSize(550, 334); - label2->setFixedSize(550, 334); - label3->setFixedSize(550, 387); - label1->setScaledContents(true); - label2->setScaledContents(true); - label3->setScaledContents(true); - label1->setPixmap(QPixmap(":/images/example/DFileDialog_1.png")); - label2->setPixmap(QPixmap(":/images/example/DFileDialog_2.png")); - label3->setPixmap(QPixmap(":/images/example/DFileDialog.png")); - - mainLayout->addWidget(dialog, 0, Qt::AlignCenter); - mainLayout->addWidget(label1, 0, Qt::AlignCenter); - mainLayout->addWidget(label2, 0, Qt::AlignCenter); - mainLayout->addWidget(label3, 0, Qt::AlignCenter); -} - -QString DFileDialogExample::getTitleName() const -{ - return "DFileDialog"; -} - -QString DFileDialogExample::getDescriptionInfo() const -{ - return "有需要调用打开文件,保存文件的地\n" - "方。底部工具栏上面的选项和内容多少\n" - "会根据应用自身的需要显示不同的内容。\n"; -} - -int DFileDialogExample::getFixedHeight() const -{ - return 1256; -} - -DMessageManagerExample::DMessageManagerExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainlayout = new QVBoxLayout(this); - QLabel *label = new QLabel; - QVBoxLayout *labelLayout = new QVBoxLayout(label); - DPushButton *btn1 = new DPushButton("点击按钮呼出自动消失的提示信息"); - DPushButton *btn2 = new DPushButton("点击按钮呼出不会自动消失的提示信息"); - - connect(btn1, &DPushButton::clicked, this, [ = ] { - DMessageManager::instance()->sendMessage(this, style()->standardIcon(QStyle::SP_MessageBoxWarning), - "成功添加到\"校园民谣\""); - }); - connect(btn2, &DPushButton::clicked, this, [ = ] { - DFloatingMessage *message = new DFloatingMessage(DFloatingMessage::ResidentType); - message->setIcon(style()->standardIcon(QStyle::SP_MessageBoxWarning)); - message->setMessage("磁盘中的原文件已被修改,是否重新输入?"); - message->setWidget(new DPushButton("重新载入")); - labelLayout->addWidget(message, 0, Qt::AlignCenter | Qt::AlignBottom); - DMessageManager::instance()->sendMessage(this, message); - }); - - label->setScaledContents(true); - label->setFixedSize(550, 309); - label->setPixmap(QPixmap(":/images/example/dock_notice.png")); - labelLayout->addStretch(10); - - mainlayout->setMargin(0); - mainlayout->setSpacing(0); - mainlayout->addWidget(btn1, 0, Qt::AlignCenter); - mainlayout->addWidget(btn2, 0, Qt::AlignCenter); - mainlayout->addWidget(label, 0, Qt::AlignCenter); -} - -QString DMessageManagerExample::getTitleName() const -{ - return "DMessageManager"; -} - -QString DMessageManagerExample::getDescriptionInfo() const -{ - return "类型1\n" - "这类应用内提醒是不需要用户进行操作\n" - "的,过几秒钟后会自主消失,仅仅是向\n" - "用户告知一些信息,比如什么成功或失\n" - "败了,有什么需要注意的之类的。\n" - "类型2\n" - "这类应用内提醒需要用户的操作,在用\n" - "户操作之前不会自主消失\n"; -} - -int DMessageManagerExample::getFixedHeight() const -{ - return 588; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/dialogexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/dialogexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/dialogexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/dialogexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DIALOGEXAMPLE_H -#define DIALOGEXAMPLE_H - -#include -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class DialogExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit DialogExampleWindow(QWidget *parent = nullptr); -}; - -class DDialogExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DDialogExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DFileDialogExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DFileDialogExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DMessageManagerExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DMessageManagerExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // DIALOGEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/editexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/editexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/editexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/editexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,444 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include "editexample.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -DWIDGET_USE_NAMESPACE - -EditExampleWindow::EditExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DSearchEditExample(this)); - addExampleWindow(new DLineEditExample(this)); - addExampleWindow(new DIpv4LineEditExample(this)); - addExampleWindow(new DPasswordEditExample(this)); - addExampleWindow(new DFileChooserEditExample(this)); - addExampleWindow(new DSpinBoxExample(this)); - addExampleWindow(new DTextEditExample(this)); - addExampleWindow(new DCrumbTextFormatExample(this)); - addExampleWindow(new DKeySequenceEditExample(this)); -} - -DSearchEditExample::DSearchEditExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - setLayout(mainLayout); - - DSearchEdit *edit = new DSearchEdit(this); - edit->setFixedWidth(340); - edit->lineEdit()->setClearButtonEnabled(true); - QLabel *label = new QLabel(this); - label->setPixmap(QPixmap("://images/example/DSearchEdit.png")); - label->setScaledContents(true); - label->setFixedSize(550, 426); - - mainLayout->addWidget(edit, 0, Qt::AlignHCenter); - mainLayout->addSpacing(76); - mainLayout->addWidget(label, 0, Qt::AlignHCenter); -} - -QString DSearchEditExample::getTitleName() const -{ - return "DSearchEdit"; -} - -QString DSearchEditExample::getDescriptionInfo() const -{ - return "用户工具栏或者主要区域的搜索框。配\n" - "合一起使用的会有补全菜单。输入文字\n" - "后一定会有清除按钮"; -} - -int DSearchEditExample::getFixedHeight() const -{ - return 632; -} - -DLineEditExample::DLineEditExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - setLayout(mainLayout); - - DLineEdit *edit = new DLineEdit(this); - edit->setFixedWidth(340); - edit->lineEdit()->setPlaceholderText("选填"); - edit->lineEdit()->setClearButtonEnabled(true); - connect(edit->lineEdit(), &QLineEdit::textChanged, [edit](const QString & text) { - if (text.size() < 2) { - edit->setAlert(true); - edit->showAlertMessage("字符不能少于2个"); - } else { - edit->setAlert(false); - } - }); - QLabel *label = new QLabel(this); - label->setPixmap(QPixmap("://images/example/DLineEdit.png")); - label->setScaledContents(true); - label->setFixedSize(550, 426); - - mainLayout->addWidget(edit, 0, Qt::AlignHCenter); - mainLayout->addSpacing(76); - mainLayout->addWidget(label, 0, Qt::AlignHCenter); -} - -QString DLineEditExample::getTitleName() const -{ - return "DLineEdit"; -} - -QString DLineEditExample::getDescriptionInfo() const -{ - return "普通的单行文本输入框,一般有输入字\n" - "数限制,但是字数限制需要根据实际情\n" - "况来约定。\n" - "输入内容后输入尾部有清空按钮。"; -} - -int DLineEditExample::getFixedHeight() const -{ - return 632; -} - -DIpv4LineEditExample::DIpv4LineEditExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - setLayout(mainLayout); - - DIpv4LineEdit *edit = new DIpv4LineEdit(this); - edit->setFixedWidth(340); - QLabel *label = new QLabel(this); - label->setPixmap(QPixmap("://images/example/DIpv4LineEdit.png")); - label->setScaledContents(true); - label->setFixedSize(550, 426); - - mainLayout->addWidget(edit, 0, Qt::AlignHCenter); - mainLayout->addSpacing(76); - mainLayout->addWidget(label, 0, Qt::AlignHCenter); -} - -QString DIpv4LineEditExample::getTitleName() const -{ - return "DIpv4LineEdit"; -} - -QString DIpv4LineEditExample::getDescriptionInfo() const -{ - return "比较特殊的IP地址输入框,用的较少"; -} - -int DIpv4LineEditExample::getFixedHeight() const -{ - return 602; -} - -DPasswordEditExample::DPasswordEditExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - setLayout(mainLayout); - - DPasswordEdit *edit = new DPasswordEdit(this); - edit->setFixedWidth(340); - edit->setText("0123456789"); - QLabel *label = new QLabel(this); - label->setPixmap(QPixmap("://images/example/DPasswordEdit.png")); - label->setScaledContents(true); - label->setFixedSize(380, 230); - - mainLayout->addWidget(edit, 0, Qt::AlignHCenter); - mainLayout->addSpacing(76); - mainLayout->addWidget(label, 0, Qt::AlignHCenter); -} - -QString DPasswordEditExample::getTitleName() const -{ - return "DPasswordEdit"; -} - -QString DPasswordEditExample::getDescriptionInfo() const -{ - return "常见的密码输入框"; -} - -int DPasswordEditExample::getFixedHeight() const -{ - return 436; -} - -DFileChooserEditExample::DFileChooserEditExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - setLayout(mainLayout); - - DFileChooserEdit *edit = new DFileChooserEdit(this); - edit->setFixedWidth(340); - edit->lineEdit()->setClearButtonEnabled(true); - edit->setText("~/.ssh/ssh_keygin.key"); - QLabel *label = new QLabel(this); - label->setPixmap(QPixmap("://images/example/DFileChooserEdit.png")); - label->setScaledContents(true); - label->setFixedSize(550, 426); - - mainLayout->addWidget(edit, 0, Qt::AlignHCenter); - mainLayout->addSpacing(76); - mainLayout->addWidget(label, 0, Qt::AlignHCenter); -} - -QString DFileChooserEditExample::getTitleName() const -{ - return "DFileChooserEdit"; -} - -QString DFileChooserEditExample::getDescriptionInfo() const -{ - return "普通的文件选择输入框"; -} - -int DFileChooserEditExample::getFixedHeight() const -{ - return 632; -} - -DSpinBoxExample::DSpinBoxExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - setLayout(mainLayout); - - DSpinBox *plusMinus = new DSpinBox(this); - plusMinus->setFixedWidth(340); - plusMinus->setButtonSymbols(QAbstractSpinBox::PlusMinus); - QHBoxLayout *upDownLayout = new QHBoxLayout(); - DSpinBox *upDown = new DSpinBox(this); - upDown->setFixedWidth(248); - upDown->setButtonSymbols(QAbstractSpinBox::UpDownArrows); - upDown->setEnabledEmbedStyle(true); - QLabel *label = new QLabel(this); - label->setPixmap(QPixmap("://images/example/DSpinBox.png")); - label->setScaledContents(true); - label->setFixedSize(550, 426); - - upDownLayout->addStretch(); - upDownLayout->addWidget(upDown); - upDownLayout->addSpacing(92); - upDownLayout->addStretch(); - - mainLayout->addWidget(plusMinus, 0, Qt::AlignHCenter); - mainLayout->addSpacing(10); - mainLayout->addItem(upDownLayout); - mainLayout->addSpacing(50); - mainLayout->addWidget(label, 0, Qt::AlignHCenter); -} - -QString DSpinBoxExample::getTitleName() const -{ - return "DSpinBox"; -} - -QString DSpinBoxExample::getDescriptionInfo() const -{ - return "常见的数值输入框,只能输入数字字\n" - "符,且多数时候只能是整数,上面三个\n" - "性质上是一样的,根据实际情况需要选\n" - "择即可。"; -} - -int DSpinBoxExample::getFixedHeight() const -{ - return 814; -} - -DTextEditExample::DTextEditExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - setLayout(mainLayout); - - DTextEdit *edit = new DTextEdit(this); - edit->setFixedSize(340, 144); - QLabel *label = new QLabel(this); - label->setPixmap(QPixmap("://images/example/DTextEdit.png")); - label->setScaledContents(true); - label->setFixedSize(550, 426); - - mainLayout->addWidget(edit, 0, Qt::AlignHCenter); - mainLayout->addSpacing(76); - mainLayout->addWidget(label, 0, Qt::AlignHCenter); -} - -QString DTextEditExample::getTitleName() const -{ - return "DTextEdit"; -} - -QString DTextEditExample::getDescriptionInfo() const -{ - return "多行文本输入框,在网页上常见,应用\n" - "内使用相对较少。"; -} - -int DTextEditExample::getFixedHeight() const -{ - return 740; -} - -DCrumbTextFormatExample::DCrumbTextFormatExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - setLayout(mainLayout); - - DCrumbEdit *edit = new DCrumbEdit(this); - edit->setFixedSize(340, 70); - - DCrumbTextFormat first = edit->makeTextFormat(); - first.setText("人物"); - DCrumbTextFormat second = edit->makeTextFormat(); - second.setText("儿童"); - DCrumbTextFormat third = edit->makeTextFormat(); - third.setText("照片"); - edit->insertCrumb(first); - edit->insertCrumb(second); - edit->insertCrumb(third); - - QLabel *label = new QLabel(this); - label->setPixmap(QPixmap("://images/example/DCrumbEdit.png")); - label->setScaledContents(true); - label->setFixedSize(300, 708); - - mainLayout->addWidget(edit, 0, Qt::AlignHCenter); - mainLayout->addSpacing(76); - mainLayout->addWidget(label, 0, Qt::AlignHCenter); -} - -QString DCrumbTextFormatExample::getTitleName() const -{ - return "DCrumbEdit"; -} - -QString DCrumbTextFormatExample::getDescriptionInfo() const -{ - return "标签输入框,用的情况不多,目前主要" - "\n是文管使用"; -} - -int DCrumbTextFormatExample::getFixedHeight() const -{ - return 948; -} - -DKeySequenceEditExample::DKeySequenceEditExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(); - QHBoxLayout *keyHLayout = new QHBoxLayout(); - QHBoxLayout *closeHLayout1 = new QHBoxLayout(); - QHBoxLayout *closeHLayout2 = new QHBoxLayout(); - setLayout(mainLayout); - mainLayout->addLayout(keyHLayout); - mainLayout->addLayout(closeHLayout1); - mainLayout->addLayout(closeHLayout2); - - QLabel *keyLabel = new QLabel("切换键盘布局", this); - keyLabel->setFixedSize(108, 19); - keyLabel->setAlignment(Qt::AlignLeft); - DKeySequenceEdit *keyEdit = new DKeySequenceEdit(this); - keyEdit->setKeySequence(QKeySequence(Qt::CTRL + Qt::SHIFT)); - QLabel *closeLabel1 = new QLabel("关闭窗口", this); - closeLabel1->setFixedSize(72, 19); - closeLabel1->setAlignment(Qt::AlignLeft); - DKeySequenceEdit *closeEdit1 = new DKeySequenceEdit(this); - closeEdit1->setKeySequence(QKeySequence(Qt::ALT + Qt::Key_F4)); - QLabel *closeLabel2 = new QLabel("关闭窗口", this); - closeLabel2->setFixedSize(72, 19); - closeLabel2->setAlignment(Qt::AlignLeft); - DKeySequenceEdit *closeEdit2 = new DKeySequenceEdit(this); - QLabel *label = new QLabel(this); - label->setPixmap(QPixmap("://images/example/DKeySequenceEdit.png")); - label->setScaledContents(true); - label->setFixedSize(550, 426); - - keyHLayout->addStretch(); - keyHLayout->addWidget(keyLabel); - keyHLayout->addSpacing(220); - keyHLayout->addWidget(keyEdit, 0, Qt::AlignRight); - keyHLayout->addStretch(); - - closeHLayout1->addStretch(); - closeHLayout1->addWidget(closeLabel1); - closeHLayout1->addSpacing(260); - closeHLayout1->addWidget(closeEdit1, 0, Qt::AlignRight); - closeHLayout1->addStretch(); - - closeHLayout2->addStretch(); - closeHLayout2->addWidget(closeLabel2); - closeHLayout2->addSpacing(260); - closeHLayout2->addWidget(closeEdit2, 0, Qt::AlignRight); - closeHLayout2->addStretch(); - - mainLayout->addSpacing(76); - mainLayout->addWidget(label, 0, Qt::AlignHCenter); - - QShortcut *shortCut = new QShortcut(this); - shortCut->setKey(QKeySequence(keyEdit->keySequence())); - connect(shortCut, &QShortcut::activated, this, [shortCut](){ - qWarning() << "shorcut is trigger" << shortCut->key(); - }); - connect(keyEdit, &DKeySequenceEdit::editingFinished, this, [shortCut](QKeySequence key){ - shortCut->setKey(key); - }); -} - -QString DKeySequenceEditExample::getTitleName() const -{ - return "DKeySequenceEdit"; -} - -QString DKeySequenceEditExample::getDescriptionInfo() const -{ - return "应用设置和控制中心部分设置快捷键的\n" - "地方。"; -} - -int DKeySequenceEditExample::getFixedHeight() const -{ - return 724; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/editexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/editexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/editexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/editexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef EDITEXAMPLE_H -#define EDITEXAMPLE_H - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class QWidget; -class QLabel; - -class EditExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit EditExampleWindow(QWidget *parent = nullptr); -}; - -class DSearchEditExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DSearchEditExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DLineEditExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DLineEditExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DIpv4LineEditExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DIpv4LineEditExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DPasswordEditExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DPasswordEditExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DFileChooserEditExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DFileChooserEditExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DSpinBoxExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DSpinBoxExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DTextEditExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DTextEditExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DCrumbTextFormatExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DCrumbTextFormatExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DKeySequenceEditExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DKeySequenceEditExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // EDITEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/examplewindowinterface.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/examplewindowinterface.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/examplewindowinterface.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/examplewindowinterface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include "examplewindowinterface.h" - -ExampleWindowInterface::ExampleWindowInterface(QWidget *parent) - : QWidget(parent) -{ - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); -} - -ExampleWindowInterface::~ExampleWindowInterface() -{ - // -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/examplewindowinterface.h dtkwidget-5.6.12/examples/dwidget-examples/collections/examplewindowinterface.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/examplewindowinterface.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/examplewindowinterface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef EXAMPLEWINDOWINTERFACE_H -#define EXAMPLEWINDOWINTERFACE_H -#include - -class ExampleWindowInterface : public QWidget -{ -public: - explicit ExampleWindowInterface(QWidget *parent); - virtual ~ExampleWindowInterface(); - -public: - virtual QString getTitleName() const = 0; - virtual QString getDescriptionInfo() const = 0; - virtual int getFixedHeight() const = 0; -}; - -#endif // EXAMPLEWINDOWINTERFACE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_button_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_button_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_button_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_button_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - - - icon_button/normal - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Dial_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Dial_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Dial_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Dial_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ - - - icon_Dial/normal - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Dialog_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Dialog_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Dialog_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Dialog_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ - - - icon_Dialog/normal - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_edit_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_edit_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_edit_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_edit_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - - - icon_edit/normal - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Layout_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Layout_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Layout_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Layout_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ - - - icon_Layout/normal - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_LCDNumber_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_LCDNumber_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_LCDNumber_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_LCDNumber_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ - - - icon_LCDNumber/normal - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_ListView_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_ListView_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_ListView_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_ListView_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ - - - icon_ListView/normal - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_menu_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_menu_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_menu_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_menu_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ - - - icon_menu/normal - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_ProgressBar_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_ProgressBar_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_ProgressBar_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_ProgressBar_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - - - icon_ProgressBar/normal - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_RubberBand_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_RubberBand_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_RubberBand_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_RubberBand_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ - - - icon_RubberBand/normal - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_ScrollBar_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_ScrollBar_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_ScrollBar_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_ScrollBar_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - - - icon_ScrollBar/normal - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_slider_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_slider_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_slider_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_slider_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - - - icon_slider/normal - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Spinner_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Spinner_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Spinner_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Spinner_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ - - - icon_Spinner/normal - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Tooltip_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Tooltip_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Tooltip_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Tooltip_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ - - - icon_Tooltip/normal - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Widget_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Widget_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Widget_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Widget_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ - - - icon_Widget/normal - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Window_16px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Window_16px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/texts/icon_Window_16px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/texts/icon_Window_16px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ - - - icon_Window/normal - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/theme-icons.qrc dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/theme-icons.qrc --- dtkwidget-5.5.48/examples/dwidget-examples/collections/icons/theme-icons.qrc 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/icons/theme-icons.qrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ - - - texts/icon_button_16px.svg - texts/icon_Dial_16px.svg - texts/icon_Dialog_16px.svg - texts/icon_edit_16px.svg - texts/icon_Layout_16px.svg - texts/icon_LCDNumber_16px.svg - texts/icon_ListView_16px.svg - texts/icon_menu_16px.svg - texts/icon_ProgressBar_16px.svg - texts/icon_RubberBand_16px.svg - texts/icon_ScrollBar_16px.svg - texts/icon_slider_16px.svg - texts/icon_Spinner_16px.svg - texts/icon_Tooltip_16px.svg - texts/icon_Widget_16px.svg - texts/icon_Window_16px.svg - - Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/buttonChecked.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/buttonChecked.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/buttonHover.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/buttonHover.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/button.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/button.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/buttonPress.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/buttonPress.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/default_background.jpg and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/default_background.jpg differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_01.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_01.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_02.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_02.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_03.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_03.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_04.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_04.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_05.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_05.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_06.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_06.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_07.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_07.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_08.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_08.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_09.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_09.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_10.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_10.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_11.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_11.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_12.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_12.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_13.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_13.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_14.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_14.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_15.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_15.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_16.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_16.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_17.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_17.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_18.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_18.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_19.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_19.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_20.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_20.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_21.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_21.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_22.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_22.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_23.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_23.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_24.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_24.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_25.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_25.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_26.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_26.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_27.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_27.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_28.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_28.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_29.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_29.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_30.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_30.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_31.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_31.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_32.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_32.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_33.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_33.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_34.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_34.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_35.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_35.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_36.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_36.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_37.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_37.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_38.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_38.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_39.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_39.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_40.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_40.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_41.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_41.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_42.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_42.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_43.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_43.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_44.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_44.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_45.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_45.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_46.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_46.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_47.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_47.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_48.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_48.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_49.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_49.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_50.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_50.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_51.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_51.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_52.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_52.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_53.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_53.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_54.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_54.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_55.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_55.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_56.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_56.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_57.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_57.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_58.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_58.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_59.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_59.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/eLoading/eLoading_60.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/eLoading/eLoading_60.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/background.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/background.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DArrowRectangle.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DArrowRectangle.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DBackgroundGroup.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DBackgroundGroup.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DButtonBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DButtonBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DCalendarWidget.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DCalendarWidget.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DCheckButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DCheckButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_3.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_3.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_4.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_4.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_5.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_5.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_6.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_6.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_7.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_7.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_8.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_8.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_9.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DColumViewPicIcon_9.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DComboBox_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DComboBox_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DComboBox_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DComboBox_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DCommandLinkButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DCommandLinkButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DCrumbEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DCrumbEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DDialog_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DDialog_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DDialog_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DDialog_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DDialog.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DDialog.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DFileChooserEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DFileChooserEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DFileDialog_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DFileDialog_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DFileDialog_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DFileDialog_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DFileDialog.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DFileDialog.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DFloatingButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DFloatingButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DFontComboBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DFontComboBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DFrame.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DFrame.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DGroupBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DGroupBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DHeaderView.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DHeaderView.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DIconButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DIconButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DIpv4LineEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DIpv4LineEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DKeySequenceEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DKeySequenceEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DLCDNumber.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DLCDNumber.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DLineEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DLineEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListView_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListView_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListView_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListView_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListView_3.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListView_3.png differ diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewBrowser_1.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewBrowser_1.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewBrowser_1.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewBrowser_1.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ - - - google-chrome-32px - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewBrowser_2.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewBrowser_2.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewBrowser_2.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewBrowser_2.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ - - - firefox - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewBrowser_3.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewBrowser_3.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewBrowser_3.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewBrowser_3.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ - - - 编组 2 - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewBrowser_4.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewBrowser_4.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewBrowser_4.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewBrowser_4.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ - - - 编组 3 - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewEditAction.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewEditAction.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewEditAction.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewEditAction.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ - - - edit - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewScreen_1.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewScreen_1.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewScreen_1.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewScreen_1.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ - - - 编组 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewScreen_2.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewScreen_2.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewScreen_2.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewScreen_2.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ - - - 编组 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewScreen_3.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewScreen_3.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewScreen_3.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewScreen_3.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ - - - 编组 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewScreen_4.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewScreen_4.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DListViewScreen_4.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DListViewScreen_4.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ - - - 编组 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DMainWindow.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DMainWindow.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DMenuPicture_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DMenuPicture_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DMenuPicture_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DMenuPicture_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DMenuPicture_3.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DMenuPicture_3.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DMenuPicture_4.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DMenuPicture_4.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DMenu.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DMenu.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DMessageManager.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DMessageManager.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/dock_notice.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/dock_notice.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DPasswordEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DPasswordEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DProgressBar_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DProgressBar_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DProgressBar_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DProgressBar_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DPushButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DPushButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DRadioButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DRadioButton.png differ diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_1.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_1.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_1.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_1.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ - - - drive-harddisk-48px - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_2.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_2.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_2.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_2.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ - - - drive-harddisk-48px - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_3.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_3.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_3.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/drive-harddisk-48px_3.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ - - - drive-harddisk-48px - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/drive-harddisk-48px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/drive-harddisk-48px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/drive-harddisk-48px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/drive-harddisk-48px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ - - - drive-harddisk-48px - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DRubberBand.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DRubberBand.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DScrollBar_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DScrollBar_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DScrollBar.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DScrollBar.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DSearchComboBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DSearchComboBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DSearchEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DSearchEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DSizegrip.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DSizegrip.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DSlider_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DSlider_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DSlider_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DSlider_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DSpinBox.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DSpinBox.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DSpinner.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DSpinner.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DSplitter.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DSplitter.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DStatusBar.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DStatusBar.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DSuggestButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DSuggestButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DSwitchButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DSwitchButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTabBar_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTabBar_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTabBar_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTabBar_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTextEdit.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTextEdit.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTitlebar_1.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTitlebar_1.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTitlebar_2.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTitlebar_2.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTitlebar_3.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTitlebar_3.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTitlebar_4.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTitlebar_4.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DToolButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DToolButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DToolTip.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DToolTip.png differ diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTreeViewIcon_1.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTreeViewIcon_1.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTreeViewIcon_1.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTreeViewIcon_1.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ - - - 椭圆形 - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTreeViewIcon_2.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTreeViewIcon_2.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTreeViewIcon_2.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTreeViewIcon_2.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - - 蒙版 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTreeViewIcon_3.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTreeViewIcon_3.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTreeViewIcon_3.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTreeViewIcon_3.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - - 椭圆形 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTreeViewIcon_4.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTreeViewIcon_4.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTreeViewIcon_4.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTreeViewIcon_4.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - - 椭圆形 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTreeViewIcon_5.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTreeViewIcon_5.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTreeViewIcon_5.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTreeViewIcon_5.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - - 椭圆形 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DTreeView.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DTreeView.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DVerticalline.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DVerticalline.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DWarningButton.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DWarningButton.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/DWaterProgress.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/DWaterProgress.png differ diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/movie-logo.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/movie-logo.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/movie-logo.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/movie-logo.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ - - - - deepin-movie-128px 2 - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/Oval_186.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/Oval_186.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/example/Oval_186.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/example/Oval_186.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ - - - Oval 186 - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/google-chrome-32-px.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/google-chrome-32-px.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/google-chrome-32-px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/google-chrome-32-px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/loading_indicator.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/loading_indicator.png differ diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images/logo_icon.svg dtkwidget-5.6.12/examples/dwidget-examples/collections/images/logo_icon.svg --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images/logo_icon.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images/logo_icon.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ - - - logo icon - - - - - - - - - - - - - - - - - - - - \ No newline at end of file Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/reload_normal.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/reload_normal.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner01.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner01.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner02.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner02.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner03.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner03.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner04.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner04.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner05.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner05.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner06.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner06.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner07.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner07.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner08.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner08.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner09.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner09.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner10.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner10.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner11.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner11.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner12.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner12.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner13.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner13.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner14.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner14.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner15.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner15.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner16.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner16.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner17.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner17.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner18.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner18.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner19.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner19.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner20.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner20.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner21.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner21.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner22.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner22.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner23.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner23.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner24.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner24.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner25.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner25.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner26.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner26.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner27.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner27.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner28.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner28.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner29.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner29.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner30.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner30.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner31.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner31.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner32.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner32.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner33.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner33.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner34.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner34.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner35.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner35.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner36.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner36.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner37.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner37.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner38.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner38.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner39.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner39.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner40.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner40.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner41.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner41.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner42.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner42.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner43.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner43.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner44.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner44.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner45.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner45.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner46.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner46.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner47.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner47.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner48.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner48.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner49.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner49.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner50.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner50.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner51.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner51.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner52.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner52.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner53.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner53.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner54.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner54.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner55.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner55.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner56.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner56.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner57.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner57.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner58.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner58.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner59.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner59.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner60.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner60.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner61.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner61.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner62.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner62.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner63.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner63.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner64.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner64.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner65.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner65.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner66.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner66.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner67.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner67.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner68.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner68.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner69.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner69.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner70.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner70.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner71.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner71.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner72.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner72.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner73.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner73.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner74.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner74.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner75.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner75.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner76.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner76.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner77.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner77.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner78.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner78.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner79.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner79.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner80.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner80.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner81.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner81.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner82.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner82.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner83.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner83.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner84.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner84.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner85.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner85.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner86.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner86.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner87.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner87.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner88.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner88.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner89.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner89.png differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/examples/dwidget-examples/collections/images/Spinner/Spinner90.png and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/examples/dwidget-examples/collections/images/Spinner/Spinner90.png differ diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/images.qrc dtkwidget-5.6.12/examples/dwidget-examples/collections/images.qrc --- dtkwidget-5.5.48/examples/dwidget-examples/collections/images.qrc 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/images.qrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,261 +0,0 @@ - - - images/button.png - images/buttonChecked.png - images/buttonHover.png - images/buttonPress.png - images/loading_indicator.png - images/reload_normal.png - images/Spinner/Spinner01.png - images/Spinner/Spinner02.png - images/Spinner/Spinner03.png - images/Spinner/Spinner04.png - images/Spinner/Spinner05.png - images/Spinner/Spinner06.png - images/Spinner/Spinner07.png - images/Spinner/Spinner08.png - images/Spinner/Spinner09.png - images/Spinner/Spinner10.png - images/Spinner/Spinner11.png - images/Spinner/Spinner12.png - images/Spinner/Spinner13.png - images/Spinner/Spinner14.png - images/Spinner/Spinner15.png - images/Spinner/Spinner16.png - images/Spinner/Spinner17.png - images/Spinner/Spinner18.png - images/Spinner/Spinner19.png - images/Spinner/Spinner20.png - images/Spinner/Spinner21.png - images/Spinner/Spinner22.png - images/Spinner/Spinner23.png - images/Spinner/Spinner24.png - images/Spinner/Spinner25.png - images/Spinner/Spinner26.png - images/Spinner/Spinner27.png - images/Spinner/Spinner28.png - images/Spinner/Spinner29.png - images/Spinner/Spinner30.png - images/Spinner/Spinner31.png - images/Spinner/Spinner32.png - images/Spinner/Spinner33.png - images/Spinner/Spinner34.png - images/Spinner/Spinner35.png - images/Spinner/Spinner36.png - images/Spinner/Spinner37.png - images/Spinner/Spinner38.png - images/Spinner/Spinner39.png - images/Spinner/Spinner40.png - images/Spinner/Spinner41.png - images/Spinner/Spinner42.png - images/Spinner/Spinner43.png - images/Spinner/Spinner44.png - images/Spinner/Spinner45.png - images/Spinner/Spinner46.png - images/Spinner/Spinner47.png - images/Spinner/Spinner48.png - images/Spinner/Spinner49.png - images/Spinner/Spinner50.png - images/Spinner/Spinner51.png - images/Spinner/Spinner52.png - images/Spinner/Spinner53.png - images/Spinner/Spinner54.png - images/Spinner/Spinner55.png - images/Spinner/Spinner56.png - images/Spinner/Spinner57.png - images/Spinner/Spinner58.png - images/Spinner/Spinner59.png - images/Spinner/Spinner60.png - images/Spinner/Spinner61.png - images/Spinner/Spinner62.png - images/Spinner/Spinner63.png - images/Spinner/Spinner64.png - images/Spinner/Spinner65.png - images/Spinner/Spinner66.png - images/Spinner/Spinner67.png - images/Spinner/Spinner68.png - images/Spinner/Spinner69.png - images/Spinner/Spinner70.png - images/Spinner/Spinner71.png - images/Spinner/Spinner72.png - images/Spinner/Spinner73.png - images/Spinner/Spinner74.png - images/Spinner/Spinner75.png - images/Spinner/Spinner76.png - images/Spinner/Spinner77.png - images/Spinner/Spinner78.png - images/Spinner/Spinner79.png - images/Spinner/Spinner80.png - images/Spinner/Spinner81.png - images/Spinner/Spinner82.png - images/Spinner/Spinner83.png - images/Spinner/Spinner84.png - images/Spinner/Spinner85.png - images/Spinner/Spinner86.png - images/Spinner/Spinner87.png - images/Spinner/Spinner88.png - images/Spinner/Spinner89.png - images/Spinner/Spinner90.png - images/eLoading/eLoading_01.png - images/eLoading/eLoading_02.png - images/eLoading/eLoading_03.png - images/eLoading/eLoading_04.png - images/eLoading/eLoading_05.png - images/eLoading/eLoading_06.png - images/eLoading/eLoading_07.png - images/eLoading/eLoading_08.png - images/eLoading/eLoading_09.png - images/eLoading/eLoading_10.png - images/eLoading/eLoading_11.png - images/eLoading/eLoading_12.png - images/eLoading/eLoading_13.png - images/eLoading/eLoading_14.png - images/eLoading/eLoading_15.png - images/eLoading/eLoading_16.png - images/eLoading/eLoading_17.png - images/eLoading/eLoading_18.png - images/eLoading/eLoading_19.png - images/eLoading/eLoading_20.png - images/eLoading/eLoading_21.png - images/eLoading/eLoading_22.png - images/eLoading/eLoading_23.png - images/eLoading/eLoading_24.png - images/eLoading/eLoading_25.png - images/eLoading/eLoading_26.png - images/eLoading/eLoading_27.png - images/eLoading/eLoading_28.png - images/eLoading/eLoading_29.png - images/eLoading/eLoading_30.png - images/eLoading/eLoading_31.png - images/eLoading/eLoading_32.png - images/eLoading/eLoading_33.png - images/eLoading/eLoading_34.png - images/eLoading/eLoading_35.png - images/eLoading/eLoading_36.png - images/eLoading/eLoading_37.png - images/eLoading/eLoading_38.png - images/eLoading/eLoading_39.png - images/eLoading/eLoading_40.png - images/eLoading/eLoading_41.png - images/eLoading/eLoading_42.png - images/eLoading/eLoading_43.png - images/eLoading/eLoading_44.png - images/eLoading/eLoading_45.png - images/eLoading/eLoading_46.png - images/eLoading/eLoading_47.png - images/eLoading/eLoading_48.png - images/eLoading/eLoading_49.png - images/eLoading/eLoading_50.png - images/eLoading/eLoading_51.png - images/eLoading/eLoading_52.png - images/eLoading/eLoading_53.png - images/eLoading/eLoading_54.png - images/eLoading/eLoading_55.png - images/eLoading/eLoading_56.png - images/eLoading/eLoading_57.png - images/eLoading/eLoading_58.png - images/eLoading/eLoading_59.png - images/eLoading/eLoading_60.png - images/default_background.jpg - images/logo_icon.svg - images/example/DArrowRectangle.png - images/example/DBackgroundGroup.png - images/example/DButtonBox.png - images/example/DCalendarWidget.png - images/example/DCheckButton.png - images/example/DComboBox_1.png - images/example/DComboBox_2.png - images/example/DCommandLinkButton.png - images/example/DCrumbEdit.png - images/example/DFileChooserEdit.png - images/example/DFloatingButton.png - images/example/DFontComboBox.png - images/example/DFrame.png - images/example/DHeaderView.png - images/example/DIconButton.png - images/example/DIpv4LineEdit.png - images/example/DKeySequenceEdit.png - images/example/DLCDNumber.png - images/example/DLineEdit.png - images/example/DMainWindow.png - images/example/DMessageManager.png - images/example/DPasswordEdit.png - images/example/DProgressBar_1.png - images/example/DProgressBar_2.png - images/example/DPushButton.png - images/example/DRadioButton.png - images/example/DRubberBand.png - images/example/DScrollBar_1.png - images/example/DScrollBar.png - images/example/DSearchEdit.png - images/example/DSizegrip.png - images/example/DSlider_1.png - images/example/DSlider_2.png - images/example/DSpinBox.png - images/example/DSpinner.png - images/example/DSplitter.png - images/example/DStatusBar.png - images/example/DSuggestButton.png - images/example/DSwitchButton.png - images/example/DTabBar_1.png - images/example/DTabBar_2.png - images/example/DTextEdit.png - images/example/DTitlebar_1.png - images/example/DTitlebar_2.png - images/example/DTitlebar_3.png - images/example/DTitlebar_4.png - images/example/DToolButton.png - images/example/DToolTip.png - images/example/DTreeView.png - images/example/DWarningButton.png - images/example/DWaterProgress.png - images/example/DListViewEditAction.svg - images/example/DListViewBrowser_1.svg - images/example/DListViewBrowser_2.svg - images/example/DListViewBrowser_3.svg - images/example/DListViewBrowser_4.svg - images/example/DListViewScreen_4.svg - images/example/DListViewScreen_3.svg - images/example/DListViewScreen_2.svg - images/example/DListViewScreen_1.svg - images/example/DTreeViewIcon_5.svg - images/example/DTreeViewIcon_4.svg - images/example/DTreeViewIcon_3.svg - images/example/DTreeViewIcon_1.svg - images/example/DTreeViewIcon_2.svg - images/example/DColumViewPicIcon_4.png - images/example/DColumViewPicIcon_9.png - images/example/DColumViewPicIcon_8.png - images/example/DColumViewPicIcon_5.png - images/example/DColumViewPicIcon_6.png - images/example/DColumViewPicIcon_7.png - images/example/DColumViewPicIcon_3.png - images/example/DColumViewPicIcon_2.png - images/example/DColumViewPicIcon_1.png - images/example/DListView_3.png - images/example/DListView_2.png - images/example/DListView_1.png - images/example/DGroupBox.png - images/example/DVerticalline.png - images/example/DSearchComboBox.png - images/example/drive-harddisk-48px_1.svg - images/example/drive-harddisk-48px_2.svg - images/example/drive-harddisk-48px_3.svg - images/example/drive-harddisk-48px.svg - images/example/Oval_186.svg - images/example/movie-logo.svg - images/example/background.png - images/example/DMenu.png - images/example/DMenuPicture_1.png - images/example/DMenuPicture_2.png - images/example/DMenuPicture_4.png - images/example/DMenuPicture_3.png - images/example/DDialog.png - images/example/DFileDialog.png - images/example/dock_notice.png - images/example/DDialog_1.png - images/example/DDialog_2.png - images/example/DFileDialog_2.png - images/example/DFileDialog_1.png - - diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/layoutexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/layoutexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/layoutexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/layoutexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,226 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include - -#include -#include - -#include "layoutexample.h" - -DWIDGET_USE_NAMESPACE - -LayoutExampleWindow::LayoutExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DFrameExample(this)); - addExampleWindow(new DSplitterExample(this)); - addExampleWindow(new DVerticalLineExample(this)); - addExampleWindow(new DHorizontalLineExample(this)); -} - -DFrameExample::DFrameExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *layout = new QVBoxLayout(this); - QWidget *frameWidget = new QWidget(this); - QWidget *framePicWidget = new QWidget(this); - - DFrame *frame = new DFrame(frameWidget); - QLabel *picLabel = new QLabel(framePicWidget); - - QHBoxLayout *frameLayout = new QHBoxLayout(frameWidget); - QHBoxLayout *picLayout = new QHBoxLayout(framePicWidget); - - QPixmap picPixmap(":/images/example/DFrame.png"); - - frame->setFixedHeight(240); - - picLabel->setFixedSize(550, 426); - picLabel->setScaledContents(true); - picLabel->setPixmap(picPixmap); - - frameLayout->setContentsMargins(23, 0, 23, 0); - frameLayout->addWidget(frame); - picLayout->setMargin(0); - picLayout->addWidget(picLabel); - - layout->setSpacing(0); - layout->addSpacing(30); - layout->addWidget(frameWidget); - layout->addSpacing(70); - layout->addWidget(framePicWidget); - layout->addSpacing(70); - layout->setContentsMargins(10, 0, 10, 0); -} - -QString DFrameExample::getTitleName() const -{ - return "DFrame"; -} - -QString DFrameExample::getDescriptionInfo() const -{ - return QString("用于框选某一部分选项,让这些框选的\n部分作为一个整体。"); -} - -int DFrameExample::getFixedHeight() const -{ - return 836; -} - -DSplitterExample::DSplitterExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *layout = new QVBoxLayout(this); - QWidget *splitterWidget = new QWidget(this); - QWidget *splitterPicWidget = new QWidget(this); - - DSplitter *hSplitter = new DSplitter(Qt::Horizontal, splitterWidget); - QLabel *picLabel = new QLabel(splitterPicWidget); - - QHBoxLayout *splitterLayout = new QHBoxLayout(splitterWidget); - QHBoxLayout *picLayout = new QHBoxLayout(splitterPicWidget); - - QPixmap picPixmap(":/images/example/DSplitter.png"); - - QWidget *spRightWidget = new QWidget; - - spRightWidget->setBackgroundRole(QPalette::Window); - spRightWidget->setAutoFillBackground(true); - - hSplitter->setFrameShape(QFrame::Panel); - hSplitter->setFrameShadow(QFrame::Raised); - hSplitter->setHandleWidth(2); - hSplitter->setFixedHeight(126); - hSplitter->addWidget(new QWidget); - hSplitter->addWidget(spRightWidget); - hSplitter->setSizes({1, 6}); - - picLabel->setFixedSize(550, 372); - picLabel->setScaledContents(true); - picLabel->setPixmap(picPixmap); - - splitterLayout->setSpacing(100); - splitterLayout->setContentsMargins(169, 0, 169, 0); - splitterLayout->addWidget(hSplitter); - picLayout->setMargin(0); - picLayout->addWidget(picLabel); - - layout->setSpacing(0); - layout->addSpacing(30); - layout->addWidget(splitterWidget); - layout->addSpacing(70); - layout->addWidget(splitterPicWidget); - layout->addSpacing(70); - layout->setContentsMargins(10, 0, 10, 0); -} - -QString DSplitterExample::getTitleName() const -{ - return "DSplitter"; -} - -QString DSplitterExample::getDescriptionInfo() const -{ - return QString("所有需要左右隔开的地方,进行区域分\n隔。"); -} - -int DSplitterExample::getFixedHeight() const -{ - return 668; -} - -DVerticalLineExample::DVerticalLineExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *layout = new QVBoxLayout(this); - QWidget *verticalLineWidget = new QWidget(this); - QWidget *verticalLinePicWidget = new QWidget(this); - - DVerticalLine *verticalLine = new DVerticalLine(verticalLineWidget); - QLabel *picLabel = new QLabel(verticalLinePicWidget); - - QHBoxLayout *verticalLineLayout = new QHBoxLayout(verticalLineWidget); - QHBoxLayout *picLayout = new QHBoxLayout(verticalLinePicWidget); - - QPixmap picPixmap(":/images/example/DVerticalline.png"); - - verticalLine->setFixedHeight(28); - - picLabel->setFixedSize(550, 356); - picLabel->setScaledContents(true); - picLabel->setPixmap(picPixmap); - - verticalLineLayout->setMargin(0); - verticalLineLayout->addWidget(verticalLine); - picLayout->setMargin(0); - picLayout->addWidget(picLabel); - - layout->setSpacing(0); - layout->addSpacing(30); - layout->addWidget(verticalLineWidget); - layout->addSpacing(70); - layout->addWidget(verticalLinePicWidget); - layout->addSpacing(70); - layout->setContentsMargins(10, 0, 10, 0); -} - -QString DVerticalLineExample::getTitleName() const -{ - return "DVerticalLine"; -} - -QString DVerticalLineExample::getDescriptionInfo() const -{ - return QString("垂直分割线,用在左右需要分割的地\n方,比如DHeaderView里的列分割线。"); -} - -int DVerticalLineExample::getFixedHeight() const -{ - return 554; -} - -DHorizontalLineExample::DHorizontalLineExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QHBoxLayout *layout = new QHBoxLayout(this); - - DHorizontalLine *line = new DHorizontalLine(this); - layout->addWidget(line); - - layout->setContentsMargins(35, 0, 35, 0); -} - -QString DHorizontalLineExample::getTitleName() const -{ - return "DHorizontalLine"; -} - -QString DHorizontalLineExample::getDescriptionInfo() const -{ - return QString("水平分割线,用在上下需要分割的地\n方。"); -} - -int DHorizontalLineExample::getFixedHeight() const -{ - return 165; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/layoutexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/layoutexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/layoutexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/layoutexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef LAYOUTEXAMPLE_H -#define LAYOUTEXAMPLE_H - -#include -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class LayoutExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit LayoutExampleWindow(QWidget *parent = nullptr); -}; - -class DFrameExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DFrameExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DSplitterExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DSplitterExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DVerticalLineExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DVerticalLineExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DHorizontalLineExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DHorizontalLineExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // LAYOUTEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/lcdnumberexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/lcdnumberexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/lcdnumberexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/lcdnumberexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include -#include - -#include -#include - -#include "lcdnumberexample.h" - -DWIDGET_USE_NAMESPACE - -LCDNumberExampleWindow::LCDNumberExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DLCDNumberExample(this)); -} - -DLCDNumberExample::DLCDNumberExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; - pHBoxLayout_1->setMargin(0); - pHBoxLayout_1->setSpacing(0); - - DLCDNumber *pNumber = new DLCDNumber; - pNumber->setFixedSize(82, 64); - pNumber->setDecMode(); - pNumber->setDigitCount(2); - pNumber->display("08"); - pNumber->setFrameShape(QFrame::NoFrame); - pHBoxLayout_1->addWidget(pNumber); - - pVBoxLayout->addLayout(pHBoxLayout_1); - - QLabel *pLabel_1 = new QLabel; - QPixmap pix_1(":/images/example/DLCDNumber.png"); - pLabel_1->setFixedSize(568, 444); - pLabel_1->setPixmap(pix_1); - pLabel_1->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; - pHBoxLayout_pic_1->setMargin(0); - pHBoxLayout_pic_1->setSpacing(0); - pHBoxLayout_pic_1->addWidget(pLabel_1); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_pic_1); - pVBoxLayout->addSpacing(20); -} - -QString DLCDNumberExample::getTitleName() const -{ - return "DLCDNumber"; -} - -QString DLCDNumberExample::getDescriptionInfo() const -{ - return "需要用到电子数字的地方"; -} - -int DLCDNumberExample::getFixedHeight() const -{ - return 630; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/lcdnumberexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/lcdnumberexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/lcdnumberexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/lcdnumberexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef LCDNUMBEREXAMPLE_H -#define LCDNUMBEREXAMPLE_H - -#include -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class LCDNumberExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit LCDNumberExampleWindow(QWidget *parent = nullptr); -}; - -class DLCDNumberExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DLCDNumberExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // LCDNUMBEREXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/listviewexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/listviewexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/listviewexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/listviewexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,558 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "listviewexample.h" - -DWIDGET_USE_NAMESPACE - -ListViewExampleWindow::ListViewExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DBackgroundGroupExample(this)); - addExampleWindow(new DListViewExample(this)); - addExampleWindow(new DGroupBoxExample(this)); - addExampleWindow(new DTreeViewExample(this)); - addExampleWindow(new DHeaderViewExample(this)); - addExampleWindow(new DColumnViewExample(this)); -} - -DBackgroundGroupExample::DBackgroundGroupExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - this->setFixedHeight(706); - QVBoxLayout *layout = new QVBoxLayout(this); - QWidget *bgWidget = new QWidget(this); - QWidget *bgPicWidget = new QWidget(this); - QHBoxLayout *bgwLayout = new QHBoxLayout(bgWidget); - QVBoxLayout *bgGLayout = new QVBoxLayout; - QHBoxLayout *bgpicLayout = new QHBoxLayout(bgPicWidget); - DBackgroundGroup *bgGroup = new DBackgroundGroup(bgGLayout, bgWidget); - QLabel *bgPicLabel = new QLabel(bgPicWidget); - - bgPicLabel->setAlignment(Qt::AlignCenter); - bgPicLabel->setPixmap(QPixmap(":/images/example/DBackgroundGroup.png").scaled(550, 426, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - bgpicLayout->addWidget(bgPicLabel); - - bgGroup->setItemSpacing(1); - bgGroup->setItemMargins(QMargins(0, 0, 0, 0)); - bgGroup->setBackgroundRole(QPalette::Window); - - QWidget *frame1 = new QWidget; - QWidget *frame2 = new QWidget; - QWidget *frame3 = new QWidget; - - frame1->setFixedHeight(36); - frame2->setFixedHeight(36); - frame3->setFixedHeight(36); - - bgGLayout->addWidget(frame1); - bgGLayout->addWidget(frame2); - bgGLayout->addWidget(frame3); - bgwLayout->addWidget(bgGroup); - bgwLayout->setContentsMargins(105, 0, 105, 0); - bgGLayout->setContentsMargins(0, 0, 0, 0); - bgpicLayout->setContentsMargins(0, 0, 0, 0); - - layout->setContentsMargins(10, 0, 10, 0); - layout->addSpacing(30); - layout->addWidget(bgWidget); - layout->addSpacing(70); - layout->addWidget(bgPicWidget); - layout->addStretch(); -} - -QString DBackgroundGroupExample::getTitleName() const -{ - return "DBackgroundGroup"; -} - -QString DBackgroundGroupExample::getDescriptionInfo() const -{ - return "在设置选项里作为一个组合选项的背景\n使用。"; -} - -int DBackgroundGroupExample::getFixedHeight() const -{ - return 706; -} - -DListViewExample::DListViewExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - auto listViewInit = [](DListView *lv, int fixHeight, int space, QStandardItemModel *model) { - lv->setModel(model); - lv->setItemSpacing(space); - lv->setSpacing(0); - lv->setIconSize(QSize(32, 32)); - lv->setFixedHeight(fixHeight); - lv->setContentsMargins(0, 0, 0, 0); - }; - - QVBoxLayout *layout = new QVBoxLayout(this); - QWidget *listViewWidget = new QWidget(this); - QWidget *listviewPicWidget = new QWidget(this); - QVBoxLayout *listViewWLayout = new QVBoxLayout(listViewWidget); - QVBoxLayout *listviewPicLayout = new QVBoxLayout(listviewPicWidget); - DListView *fingerPrintLV = new DListView(listViewWidget); - DListView *browserLV = new DListView(listViewWidget); - DListView *screenLV = new DListView(listViewWidget); - QStandardItemModel *fingerPrintModel = new QStandardItemModel(fingerPrintLV); - QStandardItemModel *browserModel = new QStandardItemModel(browserLV); - QStandardItemModel *screenModel = new QStandardItemModel(screenLV); - QLabel *picLabel1 = new QLabel(listviewPicWidget); - QLabel *picLabel2 = new QLabel(listviewPicWidget); - QLabel *picLabel3 = new QLabel(listviewPicWidget); - - listViewInit(fingerPrintLV, 111, 1, fingerPrintModel); - listViewInit(browserLV, 232, 10, browserModel); - listViewInit(screenLV, 326, 10, screenModel); - - picLabel1->setAlignment(Qt::AlignCenter); - picLabel2->setAlignment(Qt::AlignCenter); - picLabel3->setAlignment(Qt::AlignCenter); - picLabel1->setPixmap(QPixmap(":/images/example/DListView_1.png").scaled(550, 426, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - picLabel2->setPixmap(QPixmap(":/images/example/DListView_2.png").scaled(550, 426, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - picLabel3->setPixmap(QPixmap(":/images/example/DListView_3.png").scaled(550, 426, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - - DStandardItem *fingerPrintItem1 = new DStandardItem("右手大拇指"); - DStandardItem *fingerPrintItem2 = new DStandardItem("手指2"); - DStandardItem *fingerPrintItem3 = new DStandardItem("添加指纹"); - - DStandardItem *browserItem1 = new DStandardItem(QIcon("://images/example/DListViewBrowser_1.svg"), "谷歌浏览器"); - - // 设置其他style时,转换指针为空 - if (DStyle *ds = qobject_cast(style())) { - auto action = new DViewItemAction(Qt::AlignVCenter, QSize(), QSize(), true); - action->setIcon(ds->standardIcon(DStyle::SP_IndicatorChecked)); - action->setParent(this); - browserItem1->setActionList(Qt::Edge::RightEdge, {action}); - } - - DStandardItem *browserItem2 = new DStandardItem(QIcon("://images/example/DListViewBrowser_2.svg"), "火狐浏览器"); - DStandardItem *browserItem3 = new DStandardItem(QIcon("://images/example/DListViewBrowser_3.svg"), "遨游浏览器"); - DStandardItem *browserItem4 = new DStandardItem(QIcon("://images/example/DListViewBrowser_4.svg"), "Opera"); - - DStandardItem *screenItem1 = new DStandardItem(QIcon(":/images/example/DListViewScreen_1.svg"), "复制"); - DViewItemAction *screenItemAction1 = new DViewItemAction; - - screenItemAction1->setText("把您的一个屏幕的内容复制到另外一个或多个屏幕"); - screenItemAction1->setFontSize(DFontSizeManager::T8); - screenItemAction1->setTextColorRole(DPalette::TextTips); - screenItemAction1->setParent(this); - screenItem1->setTextActionList({screenItemAction1}); - - DStandardItem *screenItem2 = new DStandardItem(QIcon(":/images/example/DListViewScreen_2.svg"), "拓展"); - DViewItemAction *screenItemAction2 = new DViewItemAction; - - screenItemAction2->setText("将您的屏幕内容扩展,在不同屏幕上显示不同内容"); - screenItemAction2->setFontSize(DFontSizeManager::T8); - screenItemAction2->setTextColorRole(DPalette::TextTips); - screenItemAction2->setParent(this); - screenItem2->setTextActionList({screenItemAction2}); - - DStandardItem *screenItem3 = new DStandardItem(QIcon(":/images/example/DListViewScreen_3.svg"), "只在 VGA1显示"); - DViewItemAction *screenItemAction3 = new DViewItemAction; - - screenItemAction3->setText("只在 VGA1上显示屏幕内容,其他屏幕不显示"); - screenItemAction3->setFontSize(DFontSizeManager::T8); - screenItemAction3->setTextColorRole(DPalette::TextTips); - screenItemAction3->setParent(this); - screenItem3->setTextActionList({screenItemAction3}); - - DStandardItem *screenItem4 = new DStandardItem(QIcon(":/images/example/DListViewScreen_4.svg"), "只在 LVDS1显示"); - DViewItemAction *screenItemAction4 = new DViewItemAction; - - screenItemAction4->setText("只在 LVDS1上显示屏幕内容,其他屏幕不显示"); - screenItemAction4->setFontSize(DFontSizeManager::T8); - screenItemAction4->setTextColorRole(DPalette::TextTips); - screenItemAction4->setParent(this); - screenItem4->setTextActionList({screenItemAction4}); - - fingerPrintItem3->setFontSize(DFontSizeManager::T8); - fingerPrintItem3->setTextColorRole(DPalette::Link); - fingerPrintItem3->setSelectable(false); - - fingerPrintModel->appendRow(fingerPrintItem1); - fingerPrintModel->appendRow(fingerPrintItem2); - fingerPrintModel->appendRow(fingerPrintItem3); - browserModel->appendRow(browserItem1); - browserModel->appendRow(browserItem2); - browserModel->appendRow(browserItem3); - browserModel->appendRow(browserItem4); - screenModel->appendRow(screenItem1); - screenModel->appendRow(screenItem2); - screenModel->appendRow(screenItem3); - screenModel->appendRow(screenItem4); - - listViewWLayout->setContentsMargins(85, 0, 85, 0); - listViewWLayout->setSpacing(60); - listViewWLayout->addWidget(fingerPrintLV, 2); - listViewWLayout->addWidget(browserLV, 3); - listViewWLayout->addWidget(screenLV, 4); - listviewPicLayout->setSpacing(30); - listviewPicLayout->addWidget(picLabel1); - listviewPicLayout->addWidget(picLabel2); - listviewPicLayout->addWidget(picLabel3); - layout->addSpacing(30); - layout->setSpacing(70); - layout->setContentsMargins(10, 0, 10, 0); - layout->addWidget(listViewWidget); - layout->addWidget(listviewPicWidget); - layout->addStretch(); -} - -QString DListViewExample::getTitleName() const -{ - return "DListView"; -} - -QString DListViewExample::getDescriptionInfo() const -{ - return "标准的单行列表\n带图标的单行列表\n带图标的多行列表"; -} - -int DListViewExample::getFixedHeight() const -{ - return 2286; -} - -DGroupBoxExample::DGroupBoxExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - this->setFixedHeight(644); - - QWidget *groupBoxWidget = new QWidget(this); - QWidget *gbPicWidget = new QWidget(this); - QHBoxLayout *gbPicLayout = new QHBoxLayout(gbPicWidget); - QVBoxLayout *layout = new QVBoxLayout(this); - QVBoxLayout *groupBoxWLayout = new QVBoxLayout(groupBoxWidget); - DGroupBox *groupBox = new DGroupBox(groupBoxWidget); - QVBoxLayout *groupBoxLayout = new QVBoxLayout(groupBox); - QWidget *contentWidget = new QWidget(groupBox); - QHBoxLayout *contentLayout = new QHBoxLayout(contentWidget); - QLabel *contentTextLabel = new QLabel("代理方式"); - QComboBox *contentComboBox = new QComboBox; - QLabel *gbPicLabel = new QLabel(gbPicWidget); - - gbPicLabel->setAlignment(Qt::AlignCenter); - gbPicLabel->setPixmap(QPixmap(":/images/example/DGroupBox.png").scaled(568, 444, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - contentComboBox->addItems({"自动"}); - contentComboBox->setMinimumWidth(213); - groupBoxWidget->setFixedHeight(48); - - contentLayout->setContentsMargins(10, 6, 10, 6); - contentLayout->addWidget(contentTextLabel); - contentLayout->addStretch(); - contentLayout->addWidget(contentComboBox); - - groupBoxLayout->setContentsMargins(0, 0, 0, 0); - groupBoxLayout->addWidget(contentWidget); - groupBoxWLayout->setContentsMargins(105, 0, 105, 0); - groupBoxWLayout->addWidget(groupBox); - - gbPicLayout->setContentsMargins(0, 0, 0, 0); - gbPicLayout->addWidget(gbPicLabel); - layout->setContentsMargins(0, 0, 0, 0); - layout->setSpacing(0); - layout->addSpacing(30); - layout->addWidget(groupBoxWidget, 0); - layout->addSpacing(70); - layout->addWidget(gbPicWidget, 1); - layout->addSpacing(70); -} - -QString DGroupBoxExample::getTitleName() const -{ - return "DGroupBox"; -} - -QString DGroupBoxExample::getDescriptionInfo() const -{ - return "提供一个可以存放多个控件的区域,里\n面内容可以随意组合。"; -} - -int DGroupBoxExample::getFixedHeight() const -{ - return 644; -} - -DTreeViewExample::DTreeViewExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - this->setFixedHeight(908); - - QVBoxLayout *layout = new QVBoxLayout(this); - QWidget *treeViewWidget = new QWidget; - QWidget *tvPicWidget = new QWidget; - QVBoxLayout *tvLayout = new QVBoxLayout(treeViewWidget); - QVBoxLayout *tvPLayout = new QVBoxLayout(tvPicWidget); - DTreeView *treeView = new DTreeView; - QStandardItemModel *model = new QStandardItemModel(treeView); - QStyledItemDelegate *delegate = new QStyledItemDelegate(treeView); - QLabel *picLabel = new QLabel; - - picLabel->setAlignment(Qt::AlignCenter); - picLabel->setPixmap(QPixmap(":/images/example/DTreeView.png").scaled(550, 414, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - - treeView->setItemDelegate(delegate); - treeView->setModel(model); - treeView->setHeaderHidden(true); - treeView->setFrameShape(QFrame::NoFrame); - treeView->expandAll(); - treeViewWidget->setFixedHeight(324); - - DStandardItem *groupItem = new DStandardItem("群组"); - DStandardItem *friendItem = new DStandardItem("我的好友"); - DStandardItem *classmateItem = new DStandardItem("同学"); - DStandardItem *relativeItem = new DStandardItem("亲人"); - - DStandardItem *friend1 = new DStandardItem(QIcon(":/images/example/DTreeViewIcon_1.svg"), "张三"); - DStandardItem *friend2 = new DStandardItem(QIcon(":/images/example/DTreeViewIcon_2.svg"), "老吴"); - DStandardItem *friend3 = new DStandardItem(QIcon(":/images/example/DTreeViewIcon_3.svg"), "李四"); - DStandardItem *friend4 = new DStandardItem(QIcon(":/images/example/DTreeViewIcon_4.svg"), "安吉"); - DStandardItem *friend5 = new DStandardItem(QIcon(":/images/example/DTreeViewIcon_5.svg"), "陈永斌"); - - groupItem->setFontSize(DFontSizeManager::T6); - groupItem->setSizeHint(QSize(groupItem->sizeHint().width(), 36)); - friendItem->setFontSize(DFontSizeManager::T6); - friendItem->setSizeHint(QSize(friendItem->sizeHint().width(), 36)); - classmateItem->setFontSize(DFontSizeManager::T6); - classmateItem->setSizeHint(QSize(classmateItem->sizeHint().width(), 36)); - relativeItem->setFontSize(DFontSizeManager::T6); - relativeItem->setSizeHint(QSize(relativeItem->sizeHint().width(), 36)); - - friend1->setSizeHint(QSize(friend1->sizeHint().width(), 36)); - friend1->setFontSize(DFontSizeManager::T7); - friend1->setBackgroundRole(DPalette::AlternateBase); - friend2->setSizeHint(QSize(friend2->sizeHint().width(), 36)); - friend2->setFontSize(DFontSizeManager::T7); - friend2->setBackgroundRole(DPalette::AlternateBase); - friend3->setSizeHint(QSize(friend3->sizeHint().width(), 36)); - friend3->setFontSize(DFontSizeManager::T7); - friend3->setBackgroundRole(DPalette::AlternateBase); - friend4->setSizeHint(QSize(friend4->sizeHint().width(), 36)); - friend4->setFontSize(DFontSizeManager::T7); - friend4->setBackgroundRole(DPalette::AlternateBase); - friend5->setSizeHint(QSize(friend5->sizeHint().width(), 36)); - friend5->setFontSize(DFontSizeManager::T7); - friend5->setBackgroundRole(DPalette::AlternateBase); - - model->appendRow(groupItem); - model->appendRow(friendItem); - model->appendRow(classmateItem); - model->appendRow(relativeItem); - treeView->setExpanded(model->index(1, 0), true); - // 此处统一设置了iconsize 但仅有第一个生效 原因不明 - treeView->setIconSize(QSize(24, 24)); - - friendItem->appendRows({friend1, friend2, friend3, friend4, friend5}); - treeView->setCurrentIndex(model->indexFromItem(friend4)); - - tvLayout->setContentsMargins(160, 0, 160, 0); - tvPLayout->setContentsMargins(0, 0, 0, 0); - tvLayout->addWidget(treeView); - tvPLayout->addWidget(picLabel); - layout->setContentsMargins(10, 0, 10, 0); - layout->addSpacing(30); - layout->setSpacing(70); - layout->addWidget(treeViewWidget); - layout->addWidget(tvPicWidget); - layout->addSpacing(70); -} - -QString DTreeViewExample::getTitleName() const -{ - return "DTreeView"; -} - -QString DTreeViewExample::getDescriptionInfo() const -{ - return "需要使用树状结构的地方。"; -} - -int DTreeViewExample::getFixedHeight() const -{ - return 908; -} - -DHeaderViewExample::DHeaderViewExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - this->setFixedHeight(805); - - QVBoxLayout *layout = new QVBoxLayout(this); - QWidget *headerviewWidget = new QWidget(this); - QWidget *hvPicWidget = new QWidget(this); - QVBoxLayout *hvLayout = new QVBoxLayout(headerviewWidget); - QVBoxLayout *hvpicLayout = new QVBoxLayout(hvPicWidget); - DListView *tv = new DListView; - QLabel *picLabel = new QLabel; - QStandardItemModel *model = new QStandardItemModel(this); - DHeaderView *headerview = new DHeaderView(Qt::Horizontal); - QStandardItemModel *hmodel = new QStandardItemModel(this); - - headerview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - headerview->setModel(hmodel); - picLabel->setAlignment(Qt::AlignCenter); - picLabel->setPixmap(QPixmap(":/images/example/DHeaderView.png").scaled(560, 373, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - headerview->setMaximumHeight(36); - headerview->setSectionResizeMode(DHeaderView::Stretch); - headerview->setSortIndicator(0, Qt::SortOrder::DescendingOrder); - headerview->setSectionsClickable(true); - headerview->setSortIndicatorShown(true); - - tv->setModel(model); - tv->setItemSpacing(0); - tv->setSpacing(0); - tv->addHeaderWidget(headerview); - headerviewWidget->setFixedHeight(278); - - hmodel->setHorizontalHeaderLabels({"名称", "修改时间", "类型", "大小"}); - - model->appendRow(new DStandardItem(QIcon::fromTheme("folder-videos"), "视频")); - model->appendRow(new DStandardItem(QIcon::fromTheme("folder-pictures"), "图片")); - model->appendRow(new DStandardItem(QIcon::fromTheme("folder-documents"), "文档")); - model->appendRow(new DStandardItem(QIcon::fromTheme("folder-downloads"), "下载")); - model->appendRow(new DStandardItem(QIcon::fromTheme("folder-music"), "音乐")); - model->appendRow(new DStandardItem(QIcon::fromTheme("user-desktop"), "桌面")); - - hvpicLayout->addWidget(picLabel); - hvpicLayout->setContentsMargins(0, 0, 0, 0); - hvLayout->addWidget(tv); - hvLayout->setContentsMargins(0, 0, 0, 0); - layout->addSpacing(30); - layout->setSpacing(70); - layout->setContentsMargins(10, 0, 10, 0); - layout->addWidget(headerviewWidget); - layout->addWidget(hvPicWidget); - layout->addSpacing(70); -} - -QString DHeaderViewExample::getTitleName() const -{ - return "DHeaderView"; -} - -QString DHeaderViewExample::getDescriptionInfo() const -{ - return "列表视图的头部,方便用户进行排序及\n正序倒序。"; -} - -int DHeaderViewExample::getFixedHeight() const -{ - return 805; -} - -DColumnViewExample::DColumnViewExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *layout = new QVBoxLayout(this); - DFrame *frame = new DFrame(this); - QHBoxLayout *frameLayout = new QHBoxLayout(frame); - - DColumnView *cv = new DColumnView; - QStandardItemModel *model = new QStandardItemModel(this); - QStyledItemDelegate *itemDelegate = new QStyledItemDelegate(cv); - - auto insertItem = [](const QString &name, const QIcon &icon, int height, QStandardItemModel *model = nullptr, DStandardItem *parentItem = nullptr) - -> DStandardItem * { - DStandardItem *item = new DStandardItem(icon, name); - item->setSizeHint(QSize(item->sizeHint().width(), height)); - item->setEditable(false); - item->setFontSize(DFontSizeManager::T8); - - if (model) - model->appendRow(item); - - if (parentItem) - parentItem->appendRow(item); - - return item; - }; - - frame->setFixedHeight(336); - cv->setFrameShape(QFrame::NoFrame); - cv->setColumnWidths({121, 162}); - cv->setItemDelegate(itemDelegate); - cv->setIconSize(QSize(24, 24)); - - insertItem("视频", style()->standardIcon(QStyle::SP_DirIcon), 36, model); - DStandardItem *picItem = insertItem("图片", style()->standardIcon(QStyle::SP_DirIcon), 36, model); - insertItem("文档", style()->standardIcon(QStyle::SP_DirIcon), 36, model); - insertItem("下载", style()->standardIcon(QStyle::SP_DirIcon), 36, model); - insertItem("音乐", style()->standardIcon(QStyle::SP_DirIcon), 36, model); - insertItem("桌面", style()->standardIcon(QStyle::SP_DirIcon), 36, model); - - insertItem("我的图片", style()->standardIcon(QStyle::SP_DirIcon), 36, nullptr, picItem); - DStandardItem *myPicItem = insertItem("我的壁纸", style()->standardIcon(QStyle::SP_DirIcon), 36, nullptr, picItem); - insertItem("Snapshot", style()->standardIcon(QStyle::SP_DirIcon), 36, nullptr, picItem); - insertItem("深度截图", style()->standardIcon(QStyle::SP_DirIcon), 36, nullptr, picItem); - insertItem("iphone相册", style()->standardIcon(QStyle::SP_DirIcon), 36, nullptr, picItem); - - insertItem("[WP] Mosaic [textless].jpg", QIcon(":/images/example/DColumViewPicIcon_1.png"), 36, nullptr, myPicItem); - insertItem("2.jpg", QIcon(":/images/example/DColumViewPicIcon_2.png"), 36, nullptr, myPicItem); - insertItem("underwater_16_10.jpg", QIcon(":/images/example/DColumViewPicIcon_3.png"), 36, nullptr, myPicItem); - insertItem("inthe sky.jpg", QIcon(":/images/example/DColumViewPicIcon_4.png"), 36, nullptr, myPicItem); - insertItem("25_III_2560_1600.jpg", QIcon(":/images/example/DColumViewPicIcon_5.png"), 36, nullptr, myPicItem); - insertItem("164_scaled.jpg", QIcon(":/images/example/DColumViewPicIcon_6.png"), 36, nullptr, myPicItem); - insertItem("[WP] Mosaic [textless].jpg", QIcon(":/images/example/DColumViewPicIcon_7.png"), 36, nullptr, myPicItem); - insertItem("03345_tyrrhenum_3840x2400.jpg", QIcon(":/images/example/DColumViewPicIcon_8.png"), 36, nullptr, myPicItem); - insertItem("03215_goodmorningyosemite_38..", QIcon(":/images/example/DColumViewPicIcon_9.png"), 36, nullptr, myPicItem); - - cv->setModel(model); - cv->setCurrentIndex(model->indexFromItem(picItem)); - cv->setCurrentIndex(model->indexFromItem(myPicItem)); - - frameLayout->addWidget(cv); - frameLayout->setContentsMargins(5, 5, 5, 5); - layout->setContentsMargins(10, 0, 10, 0); - layout->addSpacing(30); - layout->addWidget(frame); - layout->addSpacing(70); -} - -QString DColumnViewExample::getTitleName() const -{ - return "DColumnView"; -} - -QString DColumnViewExample::getDescriptionInfo() const -{ - return "列视图,列数不是固定的,根据显示的\n空间和实际的层级决定。"; -} - -int DColumnViewExample::getFixedHeight() const -{ - return 425; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/listviewexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/listviewexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/listviewexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/listviewexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef LISTVIEWEXAMPLE_H -#define LISTVIEWEXAMPLE_H - -#include -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class ListViewExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit ListViewExampleWindow(QWidget *parent = nullptr); -}; - -class DBackgroundGroupExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DBackgroundGroupExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DListViewExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DListViewExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DGroupBoxExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DGroupBoxExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DTreeViewExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DTreeViewExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DHeaderViewExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DHeaderViewExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DColumnViewExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DColumnViewExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // LISTVIEWEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/main.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/main.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/main.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/main.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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. - * - - * along with this program. If not, see . - */ - -#include "mainwindow.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -DWIDGET_USE_NAMESPACE - -int main(int argc, char *argv[]) -{ -#if defined(DTK_STATIC_LIB) - DWIDGET_INIT_RESOURCE(); -#endif - DApplication *a = DApplication::globalApplication(argc, argv); - qDebug() << a->arguments(); - DApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); - Dtk::Core::DLogManager::registerConsoleAppender(); - - a->loadTranslator(); -#ifdef Q_OS_UNIX - a->setOOMScoreAdj(500); -#endif - - if (!DGuiApplicationHelper::setSingleInstance("deepin-tool-kit-examples")) { - qDebug() << "another instance is running!!"; - return 0; - } - - a->setApplicationName("dtk-example"); - a->setOrganizationName("deepin"); - DApplicationSettings as; - Q_UNUSED(as) - - MainWindow w; - w.show(); - - Dtk::Widget::moveToCenter(&w); - - return a->exec(); -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/mainwindow.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/mainwindow.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/mainwindow.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/mainwindow.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,352 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "buttonexample.h" -#include "editexample.h" -#include "sliderexample.h" -#include "menuexample.h" -#include "listviewexample.h" -#include "windowexample.h" -#include "tooltipexample.h" -#include "spinnerexample.h" -#include "dialogexample.h" -#include "progressbarexample.h" -#include "layoutexample.h" -#include "scrollbarexample.h" -#include "rubberbandexample.h" -#include "widgetexample.h" -#include "lcdnumberexample.h" -#include "mainwindow.h" -#include "dsettingsbackend.h" -#include "qsettingbackend.h" -#include "dsettingsdialog.h" -#include "dsettingsoption.h" -#include "dsettings.h" - -DCORE_USE_NAMESPACE -DWIDGET_USE_NAMESPACE - -MainWindow::MainWindow(QWidget *parent) - : DMainWindow(parent) -{ - setWindowIcon(QIcon(":/images/logo_icon.svg")); - setMinimumSize(qApp->primaryScreen()->availableSize() / 5 * 3); - - QHBoxLayout *mainLayout = new QHBoxLayout(); - mainLayout->setMargin(0); - mainLayout->setSpacing(5); - - QWidget *centralWidget = new QWidget(this); - centralWidget->setLayout(mainLayout); - setCentralWidget(centralWidget); - - m_pStackedWidget = new QStackedWidget; - m_pListViewModel = new QStandardItemModel(this); - - m_pListView = new DListView(this); - m_pListView->setFixedWidth(200); - m_pListView->setItemSpacing(0); - m_pListView->setItemSize(QSize(200, 50)); - m_pListView->setModel(m_pListViewModel); - - mainLayout->addWidget(m_pListView); - - mainLayout->addWidget(m_pStackedWidget); - - initModel(); - - connect(m_pListView, SIGNAL(currentChanged(const QModelIndex &)), this, SLOT(onCurrentIndexChanged(const QModelIndex &))); - - DTitlebar *titlebar = this->titlebar(); - titlebar->setIcon(QIcon(":/images/logo_icon.svg")); - - if (titlebar) { - titlebar->setMenu(new QMenu(titlebar)); - titlebar->setSeparatorVisible(true); - titlebar->menu()->addAction("dfm-settings"); - titlebar->menu()->addAction("dt-settings"); - titlebar->menu()->addAction("testPrinter"); - QMenu *menu = titlebar->menu()->addMenu("sub-menu"); - connect(menu->addAction("show full screen"), &QAction::triggered, this, [this]() { - this->isFullScreen() ? this->showNormal() : this->showFullScreen(); - if (QAction *action = qobject_cast(sender())) { - action->setText(this->isFullScreen() ? "show normal window" : "show full screen"); - } - }); - connect(menu->addAction("ddialog"), &QAction::triggered, this, []() { - DDialog dlg("this is title", "this is message text......"); - dlg.addButton("ok", true, DDialog::ButtonWarning); - dlg.setIcon(QIcon::fromTheme("dialog-information")); - dlg.exec(); - }); - connect(titlebar->menu(), &QMenu::triggered, this, &MainWindow::menuItemInvoked); - - titlebar->setDisableFlags(Qt::WindowMinimizeButtonHint - | Qt::WindowMaximizeButtonHint - | Qt::WindowSystemMenuHint); - titlebar->setAutoHideOnFullscreen(true); - } - - DButtonBox *buttonBox = new DButtonBox(titlebar); - buttonBox->setFixedWidth(220); - buttonBox->setButtonList({new DButtonBoxButton("浅色模式"), new DButtonBoxButton("深色模式")}, true); - buttonBox->setId(buttonBox->buttonList().at(0), 0); - buttonBox->setId(buttonBox->buttonList().at(1), 1); - - if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) { - buttonBox->buttonList().at(0)->click(); - } else { - buttonBox->buttonList().at(1)->click(); - } - - connect(buttonBox, &DButtonBox::buttonClicked, this, [buttonBox](QAbstractButton *button) { - if (buttonBox->id(button) == 0) { - DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::LightType); - } else { - DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::DarkType); - } - }); - - titlebar->addWidget(buttonBox); - - //初始化选中主菜单第一项 - m_pListView->setCurrentIndex(m_pListViewModel->index(0, 0)); -} - -#if 1 -#define AsynPreview -#endif - -void MainWindow::menuItemInvoked(QAction *action) -{ - if (action->text() == "testPrinter") { -// 下面注释的目的用于在 QDoc 生成文档是能够直接使用 \snippet 命令选取这段代码进行展示 -//! [0] - DPrintPreviewDialog dialog(this); - //测试保存PDF文件名称接口 - dialog.setDocName("test"); -#ifdef AsynPreview - dialog.setAsynPreview(31); - connect(&dialog, QOverload &>::of(&DPrintPreviewDialog::paintRequested), -#else - connect(&dialog, QOverload::of(&DPrintPreviewDialog::paintRequested), -#endif -#ifdef AsynPreview - this, [=](DPrinter *_printer, const QVector &pageRange) { -#else - this, [=](DPrinter *_printer) { -#endif - // 此函数内代码为调试打印内容代码,调整较随意! - _printer->setFromTo(1, 31); - QPainter painter(_printer); - bool firstPage = true; - for (int page = _printer->fromPage(); page <= _printer->toPage(); ++page) { -#ifdef AsynPreview - if (!pageRange.contains(page)) - continue; -#endif - - painter.resetTransform(); - if (!firstPage) - _printer->newPage(); - // qApp->processEvents(); - - // 给出调用方widget界面作为打印内容 - double xscale = _printer->pageRect().width() / double(this->width()); - double yscale = _printer->pageRect().height() / double(this->height()); - double scale = qMin(xscale, yscale); - painter.translate(_printer->pageRect().width() / 2.0, _printer->pageRect().height() / 2.0); - painter.scale(scale, scale); - painter.translate(-this->width() / 2, -this->height() / 2); - this->render(&painter); - - painter.resetTransform(); - QFont font /*("CESI仿宋-GB2312")*/; - font.setPixelSize(16); - font = QFont(font, painter.device()); - QRectF rect = _printer->pageRect(); - rect = QRectF(0, 0, rect.width(), rect.height()); - painter.setFont(font); - // 画可用页面矩形,提供调试效果参考 - painter.drawRect(rect); - QFontMetricsF fontMetrics(font); - QString text = QString("统信软件 第%1页").arg(page); - QRectF stringRect = fontMetrics.boundingRect(text); - //添加页脚页面信息 - painter.drawText(QPointF(rect.bottomRight().x() - stringRect.width(), rect.bottomRight().y() - stringRect.height()), - QString("统信软件 第%1页").arg(page)); - firstPage = false; - } - }); - dialog.exec(); -//! [0] - return; - } - if (action->text() == "dfm-settings") { - QTemporaryFile tmpFile; - tmpFile.open(); - Dtk::Core::QSettingBackend backend(tmpFile.fileName()); - - auto settings = Dtk::Core::DSettings::fromJsonFile(":/resources/data/dfm-settings.json"); - settings->setBackend(&backend); - - DSettingsDialog dsd(this); - dsd.updateSettings(settings); - dsd.exec(); - return; - } - - if (action->text() == "dt-settings") { - QTemporaryFile tmpFile; - tmpFile.open(); - Dtk::Core::QSettingBackend backend(tmpFile.fileName()); - - auto settings = Dtk::Core::DSettings::fromJsonFile(":/resources/data/dt-settings.json"); - settings->setBackend(&backend); - - QFontDatabase fontDatabase; - auto fontFamliy = settings->option("base.font.family"); - QMap fontDatas; - - QStringList values = fontDatabase.families(); - QStringList keys; - for (auto &v : values) { - keys << v.toLower().trimmed(); - } - fontDatas.insert("keys", keys); - fontDatas.insert("values", values); - fontFamliy->setData("items", fontDatas); - - // or you can set default value by json - if (fontFamliy->value().toString().isEmpty()) { - fontFamliy->setValue("droid serif"); - } - - connect(fontFamliy, &DSettingsOption::valueChanged, - this, [](QVariant value) { - qDebug() << "fontFamliy change" << value; - }); - - QStringList codings; - for (auto coding : QTextCodec::availableCodecs()) { - codings << coding; - } - - auto encoding = settings->option("advance.encoding.encoding"); - encoding->setData("items", codings); - encoding->setValue(0); - - DSettingsDialog dsd(this); - dsd.widgetFactory()->registerWidget("custom-button", [](QObject *obj) -> QWidget * { - if (DSettingsOption *option = qobject_cast(obj)) { - qDebug() << "create custom button:" << option->value(); - QPushButton *button = new QPushButton(option->value().toString()); - return button; - } - - return nullptr; - }); - - // 测试DSettingsDialog::setGroupVisible接口 - auto hLayout = dsd.layout(); - auto test = new QWidget; - auto layout = new QHBoxLayout(test); - auto testBtn = new QPushButton(); - testBtn->setText("test setGroupVisible"); - auto combobox = new QComboBox(); - combobox->addItem("base"); - combobox->addItem("base.custom-widgets"); - combobox->addItem("base.theme"); - combobox->addItem("shortcuts"); - combobox->addItem("advance"); - layout->addWidget(combobox); - layout->addWidget(testBtn); - hLayout->addWidget(test); - connect(testBtn, &QPushButton::clicked, [&dsd, combobox](){ - auto key = combobox->currentText(); - dsd.setGroupVisible(key, !dsd.groupIsVisible(key)); - }); - - dsd.updateSettings(settings); - dsd.exec(); - return; - } - - qDebug() << "click" << action << action->isChecked(); -} - -MainWindow::~MainWindow() -{ -} - - -void MainWindow::initModel() -{ - registerPage("Button", new ButtonExampleWindow(this), QIcon::fromTheme("icon_button")); - registerPage("Edit", new EditExampleWindow(this), QIcon::fromTheme("icon_edit")); - registerPage("Slider", new SliderExampleWindow(this), QIcon::fromTheme("icon_slider")); - registerPage("Menu", new MenuExampleWindow(this), QIcon::fromTheme("icon_menu")); - registerPage("ListView", new ListViewExampleWindow(this), QIcon::fromTheme("icon_ListView")); - registerPage("Window", new WindowExampleWindow(this), QIcon::fromTheme("icon_Window")); - registerPage("ToolTip", new ToolTipExampleWindow(this), QIcon::fromTheme("icon_Tooltip")); - registerPage("Spinner", new SpinnerExampleWindow(this), QIcon::fromTheme("icon_Spinner")); - registerPage("Dialog", new DialogExampleWindow(this), QIcon::fromTheme("icon_Dialog")); - registerPage("ProgressBar", new ProgressBarExampleWindow(this), QIcon::fromTheme("icon_ProgressBar")); - registerPage("Layout", new LayoutExampleWindow(this), QIcon::fromTheme("icon_Layout")); - registerPage("ScrollBar", new ScrollBarExampleWindow(this), QIcon::fromTheme("icon_ScrollBar")); - registerPage("RubberBand", new RubberBandExampleWindow(this), QIcon::fromTheme("icon_RubberBand")); - registerPage("Widget", new WidgetExampleWindow(this), QIcon::fromTheme("icon_Widget")); - registerPage("LCDNumber", new LCDNumberExampleWindow(this), QIcon::fromTheme("icon_LCDNumber")); -} - -void MainWindow::registerPage(const QString &pageName, PageWindowInterface *pPageWindow, const QIcon &icon) -{ - auto pItem = new DStandardItem(pageName); - pItem->setIcon(icon); - pItem->setEditable(false); - m_pListViewModel->appendRow(pItem); - m_pStackedWidget->addWidget(pPageWindow); - pPageWindow->initPageWindow(); -} - -void MainWindow::onCurrentIndexChanged(const QModelIndex &) -{ - m_pStackedWidget->setCurrentIndex(m_pListView->currentIndex().row()); -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/mainwindow.h dtkwidget-5.6.12/examples/dwidget-examples/collections/mainwindow.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/mainwindow.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/mainwindow.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include -#include -#include - -#include "widgets/dmainwindow.h" -#include - -class PageWindowInterface; - -DWIDGET_USE_NAMESPACE - -class MainWindow : public DMainWindow -{ - Q_OBJECT - -public: - MainWindow(QWidget *parent = nullptr); - ~MainWindow(); - -protected Q_SLOTS: - void menuItemInvoked(QAction *action); - void onCurrentIndexChanged(const QModelIndex &index); - -private: - void initModel(); - void registerPage(const QString &pageName, PageWindowInterface *pPageWindow, const QIcon &icon = QIcon()); - -private: - QStackedWidget *m_pStackedWidget; - DListView *m_pListView; - QStandardItemModel *m_pListViewModel; -}; - -#endif // MAINWINDOW_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/menuexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/menuexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/menuexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/menuexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,249 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include "menuexample.h" - -#include - -#include -#include -#include -#include -#include - -DWIDGET_USE_NAMESPACE - -MenuExampleWindow::MenuExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DMenuExample(this)); -} - -DMenuExample::DMenuExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - animation = new QPropertyAnimation(this, "aColor", this); - - restoreAnimation(); - connect(animation, &QPropertyAnimation::finished, this, [=]() { - animation->setStartValue(animation->endValue()); - QColor startColor = animation->startValue().value(); - animation->setEndValue(QColor(startColor.red(), startColor.green(), startColor.blue(), (255 - startColor.alpha()))); - animation->start(); - }); - - QVBoxLayout *layout = new QVBoxLayout(this); - QWidget *menuWidget = new QWidget(this); - QWidget *menuPicWidget = new QWidget(this); - QWidget *menuTopWidget = new QWidget(menuWidget); - QHBoxLayout *menuTopLayout = new QHBoxLayout(menuTopWidget); - QVBoxLayout *menuLayout = new QVBoxLayout(menuWidget); - QHBoxLayout *picLayout = new QHBoxLayout(menuPicWidget); - QLabel *label = new QLabel(menuPicWidget); - QLabel *topLeftMenuLabel = new QLabel(menuTopWidget); - QLabel *topMidMenuLabel = new QLabel(menuTopWidget); - QLabel *topRightMenuLabel = new QLabel(menuTopWidget); - QLabel *topBottomMenuLabel = new QLabel(menuTopWidget); - - topLeftMenuLabel->setFixedSize(182, 400); - topLeftMenuLabel->setPixmap(QPixmap(":/images/example/DMenuPicture_1.png")); - topLeftMenuLabel->setScaledContents(true); - - topMidMenuLabel->setFixedSize(182, 391); - topMidMenuLabel->setPixmap(QPixmap(":/images/example/DMenuPicture_2.png")); - topMidMenuLabel->setScaledContents(true); - - topRightMenuLabel->setFixedSize(162, 211); - topRightMenuLabel->setPixmap(QPixmap(":/images/example/DMenuPicture_3.png")); - topRightMenuLabel->setScaledContents(true); - - topBottomMenuLabel->setFixedSize(350, 113); - topBottomMenuLabel->setPixmap(QPixmap(":/images/example/DMenuPicture_4.png")); - topBottomMenuLabel->setScaledContents(true); - - pixmap = QPixmap(":/images/example/DMenu.png").scaled(550, 373, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - label->setFixedSize(550, 373); - label->setPixmap(pixmap); - label->setScaledContents(true); - label->setObjectName("menuPicLabel"); - label->installEventFilter(this); - - leftMenu = new QMenu(menuTopWidget); - - picLayout->setMargin(0); - picLayout->setSpacing(0); - picLayout->addWidget(label); - - connect(leftMenu, &QMenu::aboutToShow, [=]() { - animation->stop(); - restoreAnimation(); - acolor = QColor(15, 207, 255, 0); - paintRegion(); - }); - - connect(leftMenu, &QMenu::aboutToHide, [=]() { - if (label->underMouse()) { - restoreAnimation(); - animation->start(); - } else { - restoreAnimation(); - paintRegion(); - } - }); - - QMenu *leftDocumentMenu = new QMenu("新建文档"); - leftDocumentMenu->addAction("办公文档"); - leftDocumentMenu->addAction("电子表格"); - leftDocumentMenu->addAction("演示文档"); - leftDocumentMenu->addAction("文本文档"); - - QMenu *leftSortMenu = new QMenu("排序方式"); - leftSortMenu->addAction("名称"); - leftSortMenu->addAction("修改时间"); - leftSortMenu->addAction("大小"); - leftSortMenu->addAction("类型"); - - QMenu *leftShowMenu = new QMenu("显示方式"); - leftShowMenu->addAction("图标"); - leftShowMenu->addAction("列表"); - leftShowMenu->addAction("分栏"); - - leftMenu->addAction("新建文件夹"); - leftMenu->addMenu(leftDocumentMenu); - leftMenu->addMenu(leftShowMenu); - leftMenu->addMenu(leftSortMenu); - leftMenu->addAction("以管理员身份打开"); - leftMenu->addAction("在终端中打开"); - leftMenu->addSeparator(); - leftMenu->addAction("粘贴"); - leftMenu->addAction("全选"); - leftMenu->addSeparator(); - leftMenu->addAction("属性"); - - menuTopLayout->setSpacing(10); - menuTopLayout->setMargin(0); - menuTopLayout->addWidget(topLeftMenuLabel, 0, Qt::AlignBottom); - menuTopLayout->addWidget(topMidMenuLabel, 0, Qt::AlignBottom); - menuTopLayout->addWidget(topRightMenuLabel, 0, Qt::AlignBottom); - - menuLayout->setSpacing(30); - menuLayout->setMargin(0); - menuLayout->addWidget(menuTopWidget); - menuLayout->addWidget(topBottomMenuLabel, 0, Qt::AlignCenter); - - layout->setContentsMargins(10, 0, 10, 0); - layout->addSpacing(30); - layout->addWidget(menuWidget); - layout->addSpacing(70); - layout->addWidget(menuPicWidget); - layout->addSpacing(30); -} - -QString DMenuExample::getTitleName() const -{ - return "DMenu"; -} - -QString DMenuExample::getDescriptionInfo() const -{ - return QString("DTK上经常用到的控件,主要出现在右\n" - "键,DCombobox弹出,主菜单,搜索\n" - "框的补全等一些地方。带尖角的菜单有\n" - "明确的指向,告诉用户这个菜单对应的\n" - "是哪个地方的。"); -} - -int DMenuExample::getFixedHeight() const -{ - return 1089; -} - -QColor DMenuExample::getAColor() -{ - return acolor; -} - -void DMenuExample::setAColor(const QColor &color) -{ - acolor = color; - paintRegion(); -} - -bool DMenuExample::eventFilter(QObject *watched, QEvent *event) -{ - if (watched == this->findChild("menuPicLabel")) { - if (event->type() == QEvent::Enter) { - animation->start(); - } else if (event->type() == QEvent::Leave && !leftMenu->isVisible()) { - animation->stop(); - restoreAnimation(); - paintRegion(); - } else if (event->type() == QEvent::MouseButtonRelease) { - QMouseEvent *mouseEvent = static_cast(event); - QLabel *menuPicLabel = this->findChild("menuPicLabel"); - - if (mouseEvent->button() & Qt::RightButton) { - QPoint mousePos = menuPicLabel->mapTo(menuPicLabel, mouseEvent->pos()); - QRegion region; - region = region.united(QRect(278, 136, 259, 100)); - region = region.united(QRect(76, 236, 461, 109)); - - if (region.contains(mousePos)) { - leftMenu->popup(menuPicLabel->mapToGlobal(mouseEvent->pos())); - } - } - } - } - - return false; -} - -void DMenuExample::paintRegion() -{ - QLabel *menuPicLabel = this->findChild("menuPicLabel"); - QPixmap tPixmap = this->pixmap; - QPainter p(&tPixmap); - QPainterPath path; - - path.moveTo(QPoint(76, 236)); - path.lineTo(QPoint(278, 236)); - path.lineTo(QPoint(278, 136)); - path.lineTo(QPoint(537, 136)); - path.lineTo(QPoint(537, 345)); - path.lineTo(QPoint(76, 345)); - path.lineTo(QPoint(76, 236)); - - p.setPen(this->acolor); - p.setBrush(Qt::NoBrush); - - p.drawPath(path); - - p.drawText(QPoint(370, 218), "右键点击空白区域"); - menuPicLabel->setPixmap(tPixmap); -} - -void DMenuExample::restoreAnimation() -{ - acolor = QColor(15, 207, 255, 255); - animation->setStartValue(QVariant::fromValue(QColor(15, 207, 255, 255))); - animation->setEndValue(QVariant::fromValue(QColor(15, 207, 255, 0))); - animation->setDuration(1000); -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/menuexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/menuexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/menuexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/menuexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -#ifndef MENUEXAMPLE_H -#define MENUEXAMPLE_H - -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class QPropertyAnimation; -class QMenu; -class MenuExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit MenuExampleWindow(QWidget *parent = nullptr); -}; - -class DMenuExample : public ExampleWindowInterface -{ - Q_OBJECT - Q_PROPERTY(QColor aColor READ getAColor WRITE setAColor) - - // ExampleWindowInterface interface -public: - explicit DMenuExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; - - QColor getAColor(); - void setAColor(const QColor &color); - -protected: - bool eventFilter(QObject *watched, QEvent *event) override; - void paintRegion(); - void restoreAnimation(); - -private: - QPropertyAnimation *animation; - QColor acolor; - QPixmap pixmap; - QMenu *leftMenu; -}; - -#endif // MENUEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/pagewindowinterface.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/pagewindowinterface.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/pagewindowinterface.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/pagewindowinterface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include "pagewindowinterface.h" -#include "examplewindowinterface.h" - -#include - -#include -#include -#include -#include - -DWIDGET_USE_NAMESPACE - -PageWindowInterface::PageWindowInterface(QWidget *parent) - : QWidget(parent) -{ -} - -PageWindowInterface::~PageWindowInterface() -{ -} - -QWidget *PageWindowInterface::doLayout(ExampleWindowInterface *pExample) -{ - Q_ASSERT(pExample != nullptr); - - DFrame *pWidget = new DFrame; - pWidget->setFrameRounded(true); - - QLabel *pDescriptionLabel = new QLabel; - pDescriptionLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - pDescriptionLabel->setFixedWidth(292); - pDescriptionLabel->setFixedHeight(pExample->getFixedHeight()); - - QLabel *pLabel_1 = new QLabel; - pLabel_1->setTextInteractionFlags(Qt::TextBrowserInteraction); - pLabel_1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - QFont font_1; - font_1.setPixelSize(24); - pLabel_1->setFont(font_1); - pLabel_1->setText(pExample->getTitleName()); - - QLabel *pLabel_2 = new QLabel; - pLabel_2->setTextInteractionFlags(Qt::TextBrowserInteraction); - pLabel_2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - QFont font_2; - font_2.setPixelSize(12); - pLabel_2->setFont(font_2); - pLabel_2->setText(pExample->getDescriptionInfo()); - - QVBoxLayout *pVBoxLayout_label = new QVBoxLayout; - pVBoxLayout_label->setMargin(10); - pVBoxLayout_label->setSpacing(0); - pDescriptionLabel->setLayout(pVBoxLayout_label); - - pVBoxLayout_label->addWidget(pLabel_1); - pVBoxLayout_label->setSpacing(10); - pVBoxLayout_label->addWidget(pLabel_2); - pVBoxLayout_label->addStretch(); - - QHBoxLayout *pHBoxLayout = new QHBoxLayout; - pHBoxLayout->setMargin(0); - pHBoxLayout->setSpacing(0); - - pWidget->setLayout(pHBoxLayout); - - pExample->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - pHBoxLayout->addWidget(pDescriptionLabel); - pHBoxLayout->addWidget(new DVerticalLine); - pHBoxLayout->addWidget(pExample); - - pWidget->setFixedHeight(pExample->getFixedHeight()); - - return pWidget; -} - -void PageWindowInterface::initPageWindow() -{ - QScrollArea *pArea = new QScrollArea(this); - - QWidget *pWidget = new QWidget(this); - - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(10); - pVBoxLayout->setSpacing(10); - pWidget->setLayout(pVBoxLayout); - - for (auto pExample : m_exampleList) { - pVBoxLayout->addWidget(doLayout(pExample)); - } - - pVBoxLayout->addStretch(); - - pArea->setWidget(pWidget); - pArea->setWidgetResizable(true); - - QHBoxLayout *pHBoxLayout = new QHBoxLayout; - pHBoxLayout->setMargin(0); - pHBoxLayout->setSpacing(0); - setLayout(pHBoxLayout); - pHBoxLayout->addWidget(pArea); -} - -void PageWindowInterface::mouseMoveEvent(QMouseEvent *event) -{ - //屏蔽掉鼠标移动事件 - event->accept(); -} - -void PageWindowInterface::addExampleWindow(ExampleWindowInterface *pExample) -{ - m_exampleList << pExample; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/pagewindowinterface.h dtkwidget-5.6.12/examples/dwidget-examples/collections/pagewindowinterface.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/pagewindowinterface.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/pagewindowinterface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef PAGEWINDOWINTERFACE_H -#define PAGEWINDOWINTERFACE_H - -#include -#include - -class ExampleWindowInterface; - -class PageWindowInterface : public QWidget -{ -public: - explicit PageWindowInterface(QWidget *parent); - virtual ~PageWindowInterface() override; - -public: - virtual void initPageWindow(); - -protected: - void mouseMoveEvent(QMouseEvent *event) override; - - virtual QWidget *doLayout(ExampleWindowInterface *pExample); - void addExampleWindow(ExampleWindowInterface *pExample); - -private: - QList m_exampleList; -}; - -#endif // PAGEWINDOWINTERFACE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/progressbarexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/progressbarexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/progressbarexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/progressbarexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,200 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include -#include -#include -#include -#include -#include -#include "progressbarexample.h" - -DWIDGET_USE_NAMESPACE - -static auto pBarRun = [](QWidget *pBar){ - auto animation = new QPropertyAnimation(pBar, "value"); - animation->setDuration(10000); - animation->setLoopCount(-1); - animation->setStartValue(0); - animation->setEndValue(100); - animation->start(); -}; - -ProgressBarExampleWindow::ProgressBarExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DProgressBarExample(this)); - addExampleWindow(new DWaterProgressExample(this)); - addExampleWindow(new DColoredProgressBarExample(this)); -} - -DProgressBarExample::DProgressBarExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - auto mainLayout = new QVBoxLayout(this); - auto pTextBar = new DProgressBar(); - auto pNoTextBar = new DProgressBar(); - auto image1 = new DLabel(); - auto image2 = new DLabel(); - - pTextBar->setFixedSize(500, 35); - pTextBar->setTextVisible(true); - pTextBar->setValue(45); - pTextBar->setAlignment(Qt::AlignCenter); - - pNoTextBar->setFixedSize(500, 8); - pNoTextBar->setValue(62); - - image1->setFixedSize(550, 426); - image1->setScaledContents(true); - image1->setPixmap(QPixmap(":/images/example/DProgressBar_1.png")); - - image2->setFixedSize(550, 426); - image2->setScaledContents(true); - image2->setPixmap(QPixmap(":/images/example/DProgressBar_2.png")); - - mainLayout->addWidget(pTextBar, 0, Qt::AlignCenter); - mainLayout->addSpacing(49); - mainLayout->addWidget(pNoTextBar, 0, Qt::AlignCenter); - mainLayout->addSpacing(69); - mainLayout->addWidget(image1, 0, Qt::AlignCenter); - mainLayout->addSpacing(30); - mainLayout->addWidget(image2, 0, Qt::AlignCenter); - - setLayout(mainLayout); - - connect(pTextBar, &DProgressBar::valueChanged, this, [=](int value){ - pTextBar->setFormat(QString("已下载%1%").arg(value)); - }); - - pBarRun(pTextBar); - pBarRun(pNoTextBar); -} - -QString DProgressBarExample::getTitleName() const -{ - return "DProgressBar"; -} - -QString DProgressBarExample::getDescriptionInfo() const -{ - return QString("类型1\n" - "可以操作的进度条,点击可以进行暂\n" - "停,进度条内有文字。目前只有控制中\n" - "心更新部分用了。\n" - "类型2\n" - "所有需要用到进度条的地方,这种进度\n" - "条不可以操作,而是一种状态的指示,\n" - "告诉用户当前完成了多少或者使用了多\n" - "少的一个比例。"); -} - -int DProgressBarExample::getFixedHeight() const -{ - return 1143; -} - -DWaterProgressExample::DWaterProgressExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - auto mainLayout = new QVBoxLayout(this); - auto waterPBar = new DWaterProgress(); - auto image = new DLabel(); - - waterPBar->setFixedSize(98, 98); - waterPBar->setValue(99); - waterPBar->start(); - - image->setFixedSize(320, 410); - image->setScaledContents(true); - image->setPixmap(QPixmap(":/images/example/DWaterProgress.png")); - - mainLayout->addWidget(waterPBar, 0, Qt::AlignCenter); - mainLayout->addSpacing(85); - mainLayout->addWidget(image, 0, Qt::AlignCenter); - - setLayout(mainLayout); - - pBarRun(waterPBar); -} - -QString DWaterProgressExample::getTitleName() const -{ - return "DWaterProgress"; -} - -QString DWaterProgressExample::getDescriptionInfo() const -{ - return QString("进度条另外一种带趣味的展示形式,作\n" - "用是减少用户枯燥的等待。主要用在小\n" - "工具主窗口内部,作为一个中间状态展\n" - "示给用户,最终的结果往往会跟随成功\n" - "或者失败的图标。"); -} - -int DWaterProgressExample::getFixedHeight() const -{ - return 708; -} - -DColoredProgressBarExample::DColoredProgressBarExample(QWidget *parent) - : ExampleWindowInterface(parent) - -{ - auto mainLayout = new QVBoxLayout(this); - auto clrPBar = new DColoredProgressBar(); - - clrPBar->addThreshold(10, QBrush(QColor(Qt::black))); - clrPBar->addThreshold(20, QBrush(QColor(Qt::red))); - clrPBar->addThreshold(30, QBrush(QColor(Qt::green))); - clrPBar->addThreshold(40, QBrush(QColor(Qt::blue))); - clrPBar->addThreshold(50, QBrush(QColor(Qt::cyan))); - clrPBar->addThreshold(60, QBrush(QColor(Qt::darkGray))); - clrPBar->addThreshold(70, QBrush(QColor(Qt::black))); - clrPBar->addThreshold(80, QBrush(QColor(Qt::green))); - clrPBar->addThreshold(90, QBrush(QColor(Qt::magenta))); - - clrPBar->setFixedSize(500, 35); - mainLayout->addWidget(clrPBar, 0, Qt::AlignCenter); - setLayout(mainLayout); - - pBarRun(clrPBar); -} - -QString DColoredProgressBarExample::getTitleName() const -{ - return "DColoredProgressBar"; -} - -QString DColoredProgressBarExample::getDescriptionInfo() const -{ - return QString("进度条另外一种带趣味的展示形式,作\n" - "用是减少用户枯燥的等待。主要用在小\n" - "工具主窗口内部,作为一个中间状态展\n" - "示给用户,最终的结果往往会跟随成功\n" - "或者失败的图标。"); -} - -int DColoredProgressBarExample::getFixedHeight() const -{ - return 200; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/progressbarexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/progressbarexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/progressbarexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/progressbarexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef PROGRESSBAREXAMPLE_H -#define PROGRESSBAREXAMPLE_H - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class ProgressBarExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit ProgressBarExampleWindow(QWidget *parent = nullptr); -}; - -class DProgressBarExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DProgressBarExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DWaterProgressExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DWaterProgressExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DColoredProgressBarExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DColoredProgressBarExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // PROGRESSBAREXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/resources/data/dfm-settings.json dtkwidget-5.6.12/examples/dwidget-examples/collections/resources/data/dfm-settings.json --- dtkwidget-5.5.48/examples/dwidget-examples/collections/resources/data/dfm-settings.json 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/resources/data/dfm-settings.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -{ - "gsettings": { - "id": "com.deepin.filemanager", - "path": "/com/deepin/filemanager/" - }, - "groups": [ - { - "key": "base", - "name": "Basic settings", - "groups": [ - { - "key": "open_action", - "name": "Open Action", - "options": [ - { - "key": "alway_open_on_new", - "type": "checkbox", - "text": "Always Open On New Windows", - "default": true - }, - { - "key": "open_file_action", - "name": "Open File:", - "type": "combobox", - "default": "" - } - ] - }, - { - "key": "new_tab_windows", - "name": "New Tab & Window", - "options": [ - { - "key": "new_window_path", - "name": "New Window Open:", - "type": "combobox", - "default": "" - }, - { - "key": "new_tab_path", - "name": "New Tab Open:", - "type": "combobox", - "default": "" - } - ] - }, - { - "key": "default_view", - "name": "Default View", - "options": [ - { - "key": "icon_size", - "name": "Icon Size:", - "type": "combobox", - "default": "" - } - ] - } - ] - } - ] -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/resources/data/dt-settings.json dtkwidget-5.6.12/examples/dwidget-examples/collections/resources/data/dt-settings.json --- dtkwidget-5.5.48/examples/dwidget-examples/collections/resources/data/dt-settings.json 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/resources/data/dt-settings.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,244 +0,0 @@ -{ - "groups": [ - { - "key": "base", - "name": "Basic settings", - "groups": [ - { - "key": "custom-widgets", - "name": "Custom Widgets", - - "options": [ - { - "key": "title2", - "type": "title2", - "default": "Custom Level2 Title" - }, - { - "key": "custom-button", - "type": "custom-button", - "default": "Custom Button" - }, - { - "key": "switchbutton", - "type": "switchbutton", - "default": true, - "name": "Switch Button" - } - ] - }, - { - "key": "theme", - "name": "Theme", - "options": [ - { - "key": "theme", - "type": "checkpicture", - "default": 0 - }, - { - "key": "opticy", - "name": "Opticy", - "type": "slider", - "max": 100, - "min": 0, - "default": 90 - } - ] - }, - { - "key": "font", - "name": "Font Style", - "options": [ - { - "key": "family", - "name": "Font", - "type": "combobox", - "default": "" - }, - { - "key": "size", - "name": "Font Size", - "type": "spinbutton", - "default": 12, - "max": 20, - "min": 9 - }, - { - "key": "style", - "name": "Font Style", - "type": "buttongroup", - "items": ["B","/"], - "default": 0 - } - ] - } - ] - }, - { - "key": "shortcuts", - "name": "Shortcuts", - "groups": [ - { - "key": "ternimal", - "name": "Ternimal", - "hide": true, - "options": [ - { - "key": "copy", - "name": "Copy", - "type": "shortcut", - "default": "Ctrl+Alt+C" - }, - { - "key": "paste", - "name": "Paste", - "type": "shortcut", - "default": "Ctrl+Alt+V" - }, - { - "key": "scroll_up", - "name": "Scroll Up", - "type": "shortcut", - "default": "Alt+." - }, - { - "key": "scroll_down", - "name": "Scroll down", - "type": "shortcut", - "default": "Alt+," - } - ] - }, - { - "key": "workspace", - "name": "Workspace", - "options": [ - { - "key": "new_window", - "name": "New Window", - "type": "shortcut", - "default": "Ctrl+Shitf+<" - }, - { - "key": "next_tab", - "name": "Next Tab", - "type": "shortcut", - "default": "Ctrl+N" - }, - { - "key": "prev_up", - "name": "Previous Tab", - "type": "shortcut", - "default": "Ctrl+Shitf+>" - }, - { - "key": "close_tab", - "name": "Close Tab", - "type": "shortcut", - "default": "Ctrl+W" - } - ] - } - ] - }, - { - "key": "advance", - "name": "Advance", - "groups": [ - { - "key": "cursor", - "name": "Cursor", - "options": [ - { - "key": "shrap", - "name": "Cursor Shrap", - "type": "buttongroup", - "items": ["█","_","|"], - "default": 0 - }, - { - "key": "blink", - "type": "checkbox", - "text": "Cursor blink", - "default": true - }, - { - "key": "radiogroup", - "name": " ", - "type": "radiogroup", - "items": ["Minimize to tray","Exit Deepin Music"], - "default": 0 - } - ] - }, - { - "key": "encoding", - "name": "Default encoding", - "options": [ - { - "key": "encoding", - "name": "Encoding", - "type": "combobox", - "default": "utf-8" - } - ] - }, - { - "key": "coustom", - "name": "Coustom", - "options": [ - { - "key": "coustom_command", - "name": "Coustom Command", - "type": "lineedit", - "default": "" - }, - { - "key": "coustom_directory", - "name": "Coustom Directory", - "type": "lineedit", - "default": "" - } - ] - }, - { - "key": "scroll", - "name": "Scroll", - "options": [ - { - "key": "scroll_bottom", - "text": "Scroll Bottom", - "type": "checkbox", - "default": "" - }, - { - "key": "scroll_line_count", - "name": "Scroll line count", - "type": "spinbutton", - "default": 10 - } - ] - }, - { - "key": "compatibility", - "name": "Compatibility", - "options": [ - { - "key": "breakspce_action", - "name": "Breakspce Action", - "type": "combobox", - "default": "" - }, - { - "key": "delete_action", - "name": "Delete Action", - "type": "combobox", - "default": "" - } - ] - } - ] - } - ] -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/resources.qrc dtkwidget-5.6.12/examples/dwidget-examples/collections/resources.qrc --- dtkwidget-5.5.48/examples/dwidget-examples/collections/resources.qrc 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/resources.qrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ - - - resources/data/dfm-settings.json - resources/data/dt-settings.json - - diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/rubberbandexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/rubberbandexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/rubberbandexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/rubberbandexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include -#include -#include - -#include "rubberbandexample.h" - -DWIDGET_USE_NAMESPACE - -RubberBandExampleWindow::RubberBandExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DRubberBandExample(this)); -} - -DRubberBandExample::DRubberBandExample(QWidget *parent) - : ExampleWindowInterface(parent) - , m_pRubberBand(nullptr) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - - setLayout(pVBoxLayout); - - QLabel *pLabel_1 = new QLabel; - QPixmap pix_1(":/images/example/DRubberBand.png"); - pLabel_1->setFixedSize(550, 356); - pLabel_1->setPixmap(pix_1); - pLabel_1->setScaledContents(true); - - pVBoxLayout->addStretch(); - pVBoxLayout->addWidget(pLabel_1, 0, Qt::AlignCenter); - pVBoxLayout->addSpacing(30); -} - -void DRubberBandExample::mousePressEvent(QMouseEvent *event) -{ - m_origin = event->pos(); - if (!m_pRubberBand) - m_pRubberBand = new DRubberBand(DRubberBand::Rectangle, this); - m_pRubberBand->setGeometry(QRect(m_origin, QSize())); - m_pRubberBand->show(); -} - -void DRubberBandExample::mouseMoveEvent(QMouseEvent *event) -{ - m_pRubberBand->setGeometry(QRect(m_origin, event->pos()).normalized()); -} - -void DRubberBandExample::mouseReleaseEvent(QMouseEvent * /*event*/) -{ - m_pRubberBand->hide(); -} - -QString DRubberBandExample::getTitleName() const -{ - return "DRubberBand"; -} - -QString DRubberBandExample::getDescriptionInfo() const -{ - return "所有用户可以用鼠标拖拽矩形区域进行\n" - "框选的地方,比如文件管理器,桌面."; -} - -int DRubberBandExample::getFixedHeight() const -{ - return 810; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/rubberbandexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/rubberbandexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/rubberbandexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/rubberbandexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef RUBBERBANDEXAMPLE_H -#define RUBBERBANDEXAMPLE_H - -#include -#include - -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class RubberBandExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit RubberBandExampleWindow(QWidget *parent = nullptr); -}; - -class DRubberBandExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DRubberBandExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; - -protected: - void mousePressEvent(QMouseEvent *event) override; - void mouseMoveEvent(QMouseEvent *event) override; - void mouseReleaseEvent(QMouseEvent *event) override; - -private: - Dtk::Widget::DRubberBand *m_pRubberBand; - QPoint m_origin; -}; - -#endif // RUBBERBANDEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/scrollbarexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/scrollbarexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/scrollbarexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/scrollbarexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include -#include -#include -#include -#include "scrollbarexample.h" - -DWIDGET_USE_NAMESPACE -DCORE_USE_NAMESPACE - -ScrollBarExampleWindow::ScrollBarExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DScrollBarExample(this)); -} - -DScrollBarExample::DScrollBarExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mLayout = new QVBoxLayout(this); - QImageReader reader; - reader.setFileName(":/images/example/DScrollBar_1.png"); - reader.setScaledSize(reader.size().scaled(480, 120, Qt::KeepAspectRatio)); - - QLabel *sbimg = new QLabel; - sbimg->setAlignment(Qt::AlignHCenter); - sbimg->setPixmap(QPixmap::fromImageReader(&reader)); - - DScrollArea *sa = new DScrollArea; - QLabel *image = new QLabel; - image->setPixmap(QPixmap(":/images/example/DScrollBar.png")); - sa->setWidget(image); - - mLayout->addWidget(sbimg, 0, Qt::AlignTop | Qt::AlignHCenter); - mLayout->addSpacing(5); - mLayout->addWidget(sa); -} - -QString DScrollBarExample::getTitleName() const -{ - return "DScrollBar"; -} - -QString DScrollBarExample::getDescriptionInfo() const -{ - return QStringLiteral("所有产生滚动的地方"); -} - -int DScrollBarExample::getFixedHeight() const -{ - return 500; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/scrollbarexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/scrollbarexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/scrollbarexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/scrollbarexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef SCROLLBAREXAMPLE_H -#define SCROLLBAREXAMPLE_H - -#include -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class ScrollBarExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit ScrollBarExampleWindow(QWidget *parent = nullptr); -}; - -class DScrollBarExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DScrollBarExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // SCROLLBAREXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/sliderexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/sliderexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/sliderexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/sliderexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "sliderexample.h" - -DWIDGET_USE_NAMESPACE - -SliderExampleWindow::SliderExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DSliderExample(this)); -} - -DSliderExample::DSliderExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - DSlider *vSlider = new DSlider(Qt::Vertical); - DSlider *hSlider = new DSlider(Qt::Horizontal); - hSlider->setLeftIcon(QIcon::fromTheme("emblem-remove")); - hSlider->setRightIcon(QIcon::fromTheme("emblem-added")); - hSlider->setIconSize({16, 16}); - connect(hSlider, &DSlider::iconClicked, this, [hSlider](DSlider::SliderIcons icon, bool checked){ - qDebug() << "........." << icon << checked; - if(icon == DSlider::LeftIcon) { - hSlider->setValue(hSlider->value() - hSlider->pageStep()); - } else { - hSlider->setValue(hSlider->value() + hSlider->pageStep()); - } - }); - DSlider *hCalibration = new DSlider(Qt::Horizontal); - DLabel *hLabel = new DLabel; - DLabel *vLabel = new DLabel; - QVBoxLayout *mainLayout = new QVBoxLayout; - - vSlider->setMinimumHeight(283); - hSlider->setMinimumWidth(479); - hCalibration->setMinimumWidth(507); - hCalibration->setBelowTicks({"", "", "", "", "", "", ""}); - - hLabel->setScaledContents(true); - vLabel->setScaledContents(true); - - hLabel->setFixedSize(550, 426); - vLabel->setFixedSize(550, 350); - - hLabel->setPixmap(QPixmap(":/images/example/DSlider_1.png")); - vLabel->setPixmap(QPixmap(":/images/example/DSlider_2.png")); - - setLayout(mainLayout); - mainLayout->setSpacing(10); - mainLayout->addWidget(vSlider, 0, Qt::AlignCenter); - mainLayout->addWidget(hSlider, 0, Qt::AlignCenter); - mainLayout->addWidget(hCalibration, 0, Qt::AlignCenter); - mainLayout->addWidget(hLabel, 0, Qt::AlignCenter); - mainLayout->addWidget(vLabel, 0, Qt::AlignCenter); -} - -QString DSliderExample::getTitleName() const -{ - return "DSlider"; -} - -QString DSliderExample::getDescriptionInfo() const -{ - return "圆角矩形滑块可以随意拖动,起止点一\n" - "定是从左往右递增,滑块以左部分是活\n" - "动色显示。\n\n" - "尖角的滑块不可以像圆角矩形滑块那样\n" - "进行随意拖动,底下对应的有刻度,刻\n" - "度上产生吸附力,尖角也只能在几个刻\n" - "度值上调整,更多强调的是用户一个值\n" - "的取舍。\n " - "对应的刻度可能有刻度值显示,也可能\n" - "没有刻度值(界面上的)。"; -} - -int DSliderExample::getFixedHeight() const -{ - return 1276; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/sliderexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/sliderexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/sliderexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/sliderexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef SLIDEREXAMPLE_H -#define SLIDEREXAMPLE_H - -#include -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class SliderExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit SliderExampleWindow(QWidget *parent = nullptr); -}; - -class DSliderExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DSliderExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // SLIDEREXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/spinnerexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/spinnerexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/spinnerexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/spinnerexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include -#include - -#include -#include - -#include "spinnerexample.h" - -DWIDGET_USE_NAMESPACE - -SpinnerExampleWindow::SpinnerExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DSpinnerExample(this)); -} - -DSpinnerExample::DSpinnerExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; - pHBoxLayout_1->setMargin(0); - pHBoxLayout_1->setSpacing(0); - - auto getSpinnerWidget = [](const QSize &size) { - DSpinner *pSpinner = new DSpinner; - pSpinner->setFixedSize(size); - pSpinner->start(); - return pSpinner; - }; - - pHBoxLayout_1->addStretch(1); - pHBoxLayout_1->addWidget(getSpinnerWidget(QSize(16, 16))); - pHBoxLayout_1->addStretch(1); - pHBoxLayout_1->addWidget(getSpinnerWidget(QSize(24, 24))); - pHBoxLayout_1->addStretch(1); - pHBoxLayout_1->addWidget(getSpinnerWidget(QSize(32, 32))); - pHBoxLayout_1->addStretch(1); - pHBoxLayout_1->addWidget(getSpinnerWidget(QSize(54, 54))); - pHBoxLayout_1->addStretch(1); - pHBoxLayout_1->addWidget(getSpinnerWidget(QSize(96, 96))); - pHBoxLayout_1->addStretch(1); - - pVBoxLayout->addLayout(pHBoxLayout_1); - - QLabel *pLabel_1 = new QLabel; - QPixmap pix_1(":/images/example/DSpinner.png"); - pLabel_1->setFixedSize(570, 326); - pLabel_1->setPixmap(pix_1); - pLabel_1->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; - pHBoxLayout_pic_1->setMargin(0); - pHBoxLayout_pic_1->setSpacing(0); - pHBoxLayout_pic_1->addWidget(pLabel_1); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_pic_1); - pVBoxLayout->addSpacing(20); -} - -QString DSpinnerExample::getTitleName() const -{ - return "DSpinner"; -} - -QString DSpinnerExample::getDescriptionInfo() const -{ - return "所有需要用户等待的地方,且没有具体\n" - "的等待时间,不知道进度,可能很快也\n" - "可能需要比较久."; -} - -int DSpinnerExample::getFixedHeight() const -{ - return 800; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/spinnerexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/spinnerexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/spinnerexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/spinnerexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef SPINNEREXAMPLE_H -#define SPINNEREXAMPLE_H - -#include -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class SpinnerExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit SpinnerExampleWindow(QWidget *parent = nullptr); -}; - -class DSpinnerExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DSpinnerExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // SPINNEREXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/tooltipexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/tooltipexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/tooltipexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/tooltipexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,245 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "tooltipexample.h" - -DWIDGET_USE_NAMESPACE - -ToolTipExampleWindow::ToolTipExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DToolTipExample(this)); - addExampleWindow(new DArrowRectangleExample(this)); -} - -DToolTipExample::DToolTipExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; - pHBoxLayout_1->setMargin(0); - pHBoxLayout_1->setSpacing(0); - - DPushButton *pButton_1 = new DPushButton("悬停显示ToolTip"); - pButton_1->setToolTip("返回上一级"); - - DPushButton *pButton_2 = new DPushButton("悬停显示ToolTip"); - pButton_2->setToolTip("点击搜索或输入地址"); - - pHBoxLayout_1->addStretch(1); - pHBoxLayout_1->addWidget(pButton_1); - pHBoxLayout_1->addStretch(1); - pHBoxLayout_1->addWidget(pButton_2); - pHBoxLayout_1->addStretch(1); - - pVBoxLayout->addLayout(pHBoxLayout_1); - - QLabel *pLabel_1 = new QLabel; - QPixmap pix_1(":/images/example/DToolTip.png"); - pLabel_1->setFixedSize(550, 356); - pLabel_1->setPixmap(pix_1); - pLabel_1->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; - pHBoxLayout_pic_1->setMargin(0); - pHBoxLayout_pic_1->setSpacing(0); - pHBoxLayout_pic_1->addWidget(pLabel_1); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_pic_1); - pVBoxLayout->addSpacing(20); -} - -QString DToolTipExample::getTitleName() const -{ - return "DToolTip"; -} - -QString DToolTipExample::getDescriptionInfo() const -{ - return "所有需要用到提示的地方.\n" - "出现需要有延迟,鼠标是悬停2妙左右\n" - "出现,触屏是按住就出现."; -} - -int DToolTipExample::getFixedHeight() const -{ - return 600; -} - -DArrowRectangleExample::DArrowRectangleExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - setLayout(pVBoxLayout); - - QHBoxLayout *pHBoxLayout_1 = new QHBoxLayout; - pHBoxLayout_1->setMargin(0); - pHBoxLayout_1->setSpacing(0); - - //DArrowRectangle的FloatWidget模式必须要有父窗口 - DArrowRectangle *pRectangle_1 = new DArrowRectangle(DArrowRectangle::ArrowBottom, DArrowRectangle::FloatWidget, this); - pRectangle_1->setRadiusArrowStyleEnable(true); - pRectangle_1->setRadius(8); - QWidget *pContentWidget = new QWidget; - pContentWidget->setFixedSize(300, 300); - pRectangle_1->setContent(pContentWidget); - QVBoxLayout *pVBoxLayout_content = new QVBoxLayout; - pVBoxLayout_content->setMargin(0); - pVBoxLayout_content->setSpacing(0); - pContentWidget->setLayout(pVBoxLayout_content); - - DLabel *pTitle = new DLabel("图标列表"); - pTitle->setFixedHeight(46); - QFont font; - font.setPixelSize(20); - pTitle->setFont(font); - - auto getListItem = [](const QPixmap &pixIcon, const QString &str) { - QLabel *pLeftIcon = new QLabel; - pLeftIcon->setPixmap(pixIcon); - - QLabel *rightIcon = new QLabel; - rightIcon->setPixmap(QPixmap(":/images/example/Oval_186.svg")); - - QLabel *middleLabel = new QLabel; - middleLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); - QLabel *pTitle_1 = new QLabel; - pTitle_1->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); - pTitle_1->setText(str); - QFont font; - font.setPixelSize(14); - pTitle_1->setFont(font); - - QLabel *pTitle_2 = new QLabel; - pTitle_2->setText("23/48G"); - font.setPixelSize(12); - pTitle_2->setFont(font); - - QVBoxLayout *pVBoxLayout = new QVBoxLayout; - pVBoxLayout->setMargin(0); - pVBoxLayout->setSpacing(0); - middleLabel->setLayout(pVBoxLayout); - - pVBoxLayout->addSpacing(11); - pVBoxLayout->addWidget(pTitle_1); - pVBoxLayout->addWidget(pTitle_2); - - QProgressBar *pBar = new QProgressBar; - pBar->setFixedHeight(3); - pBar->setRange(0, 100); - pBar->setValue(60); - - pVBoxLayout->addWidget(pBar); - pVBoxLayout->addSpacing(10); - - QHBoxLayout *pHBoxLayout = new QHBoxLayout; - pHBoxLayout->setMargin(0); - pHBoxLayout->setSpacing(0); - pHBoxLayout->addSpacing(10); - pHBoxLayout->addWidget(pLeftIcon); - pHBoxLayout->addSpacing(10); - pHBoxLayout->addWidget(middleLabel); - pHBoxLayout->addSpacing(10); - pHBoxLayout->addWidget(rightIcon); - pHBoxLayout->addSpacing(12); - - QWidget *pItem = new QWidget; - pItem->setFixedHeight(64); - pItem->setLayout(pHBoxLayout); - return pItem; - }; - - pVBoxLayout_content->addWidget(pTitle); - pVBoxLayout_content->addWidget(new DHorizontalLine); - pVBoxLayout_content->addWidget(getListItem(QPixmap(":/images/example/drive-harddisk-48px.svg"), "我的磁盘")); - pVBoxLayout_content->addWidget(getListItem(QPixmap(":/images/example/drive-harddisk-48px_1.svg"), "文档")); - pVBoxLayout_content->addWidget(getListItem(QPixmap(":/images/example/drive-harddisk-48px_2.svg"), "可移动磁盘")); - pVBoxLayout_content->addWidget(getListItem(QPixmap(":/images/example/drive-harddisk-48px_3.svg"), "SD卡")); - pVBoxLayout_content->addStretch(); - - DArrowRectangle *pRectangle_2 = new DArrowRectangle(DArrowRectangle::ArrowBottom, DArrowRectangle::FloatWidget, this); - pRectangle_2->setRadius(8); - pRectangle_2->setRadiusArrowStyleEnable(true); - QLabel *pContentWidget_2 = new QLabel("深度音乐"); - pContentWidget_2->setAlignment(Qt::AlignCenter); - pContentWidget_2->setFixedSize(90, 40); - pRectangle_2->setContent(pContentWidget_2); - - pHBoxLayout_1->addStretch(); - pHBoxLayout_1->addWidget(pRectangle_1, 0, Qt::AlignTop | Qt::AlignHCenter); - pHBoxLayout_1->addStretch(); - pHBoxLayout_1->addWidget(pRectangle_2, 0, Qt::AlignTop | Qt::AlignHCenter); - pHBoxLayout_1->addStretch(); - - pVBoxLayout->addSpacing(20); - pVBoxLayout->addLayout(pHBoxLayout_1); - - QLabel *pLabel_1 = new QLabel; - QPixmap pix_1(":/images/example/DArrowRectangle.png"); - pLabel_1->setFixedSize(570, 330); - pLabel_1->setPixmap(pix_1); - pLabel_1->setScaledContents(true); - - QHBoxLayout *pHBoxLayout_pic_1 = new QHBoxLayout; - pHBoxLayout_pic_1->setMargin(0); - pHBoxLayout_pic_1->setSpacing(0); - pHBoxLayout_pic_1->addWidget(pLabel_1); - - pVBoxLayout->addSpacing(30); - pVBoxLayout->addLayout(pHBoxLayout_pic_1); - pVBoxLayout->addSpacing(20); -} - -QString DArrowRectangleExample::getTitleName() const -{ - return "DArrowRectangle"; -} - -QString DArrowRectangleExample::getDescriptionInfo() const -{ - return "带尖角的popup窗口,内容部分不是固\n" - "定的,可以做多种定制."; -} - -int DArrowRectangleExample::getFixedHeight() const -{ - return 818; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/tooltipexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/tooltipexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/tooltipexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/tooltipexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef TOOLTIPEXAMPLE_H -#define TOOLTIPEXAMPLE_H - -#include -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class ToolTipExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit ToolTipExampleWindow(QWidget *parent = nullptr); -}; - -class DToolTipExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DToolTipExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DArrowRectangleExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DArrowRectangleExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // TOOLTIPEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/widgetexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/widgetexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/widgetexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/widgetexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,199 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include "widgetexample.h" - -#include - -#include -#include -#include -#include -#include -#include - -WidgetExampleWindow::WidgetExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DCalendarWidgetExample(this)); - addExampleWindow(new DTableWidgetExample(this)); -} - -DCalendarWidgetExample::DCalendarWidgetExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - setLayout(mainLayout); - - DCalendarWidget *calender = new DCalendarWidget(this); - QLabel *label = new QLabel(this); - label->setPixmap(QPixmap("://images/example/DCalendarWidget.png")); - label->setScaledContents(true); - label->setFixedSize(550, 406); - - mainLayout->addWidget(calender, 0, Qt::AlignHCenter); - mainLayout->addSpacing(50); - mainLayout->addWidget(label, 0, Qt::AlignHCenter); -} - -QString DCalendarWidgetExample::getTitleName() const -{ - return "DCalendarWidget"; -} - -QString DCalendarWidgetExample::getDescriptionInfo() const -{ - return "所涉及到日期操作的地方。"; -} - -int DCalendarWidgetExample::getFixedHeight() const -{ - return 816; -} - -DTableWidgetExample::DTableWidgetExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - setLayout(mainLayout); - - tableView = new QTableView(this); - CalendarModel *model = new CalendarModel(this); - tableView->setModel(model); - tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); - tableView->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch); - tableView->setShowGrid(false); - tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); - tableView->verticalHeader()->hide(); - tableView->horizontalHeader()->setSectionsClickable(false); - tableView->setSelectionMode(QAbstractItemView::SingleSelection); - - tableView->setFixedSize(504, 252); - mainLayout->addWidget(tableView, 0, Qt::AlignHCenter); -} - -QString DTableWidgetExample::getTitleName() const -{ - return "DTableWidget"; -} - -QString DTableWidgetExample::getDescriptionInfo() const -{ - return "标准的表格控件。"; -} - -int DTableWidgetExample::getFixedHeight() const -{ - return 352; -} - -CalendarModel::CalendarModel(QObject *parent) - : QAbstractTableModel(parent) -{ - header << "周日" - << "周一" - << "周二" - << "周三" - << "周四" - << "周五" - << "周六"; - - //生成一个6行7列的数组 - for (int index = 0; index < 6; ++index) { - m_tableData.push_back(QVector(7)); - } - - const QDate curMonthFirstDay(QDate::currentDate().year(), QDate::currentDate().month(), 1); - const int first_day_index = curMonthFirstDay.dayOfWeek() % 7; - //本月第一天在数组中初始化 - m_tableData[0][first_day_index] = curMonthFirstDay; - - const int days_in_month = QDate::currentDate().daysInMonth(); - const QDate curMonthLastDay(QDate::currentDate().year(), QDate::currentDate().month(), days_in_month); - - const int last_day_index = first_day_index + days_in_month - 1; - //本月最后一天在数组中初始化 - m_tableData[last_day_index / 7][last_day_index % 7] = curMonthLastDay; - - for (int rowIndex = 0; rowIndex < 6; ++rowIndex) { - for (int colIndex = 0; colIndex < 7; ++colIndex) { - if (m_tableData[rowIndex][colIndex].isValid()) { - continue; - } - - int index = rowIndex * 7 + colIndex; - m_tableData[rowIndex][colIndex] = curMonthFirstDay.addDays(index - first_day_index); - } - } -} - -int CalendarModel::rowCount(const QModelIndex &) const -{ - return m_tableData.size(); -} - -int CalendarModel::columnCount(const QModelIndex &) const -{ - return header.size(); -} - -QVariant CalendarModel::data(const QModelIndex &index, int role) const -{ - DPalette palette = DGuiApplicationHelper::instance()->applicationPalette(); - - switch (role) { - case Qt::DisplayRole: { - int days = m_tableData[index.row()][index.column()].day(); - if (days == 1) { - return QString("%1/1").arg(m_tableData[index.row()][index.column()].month()); - } else { - return QString::number(days); - } - } - case Qt::TextColorRole: { - // 设置文字颜色 - if (m_tableData[index.row()][index.column()].month() == QDate::currentDate().month()) { - return palette.color(DPalette::TextTitle); - } else { - return palette.color(DPalette::PlaceholderText); - } - } - case Qt::TextAlignmentRole: - return Qt::AlignCenter; - case Qt::BackgroundRole: - // 设置单元格背景色 - break; - default: - break; - } - return QVariant(); -} - -QVariant CalendarModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - if (role == Qt::BackgroundColorRole || role == Qt::BackgroundRole) - return DGuiApplicationHelper::instance()->applicationPalette().brush(DPalette::ItemBackground); - if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { - return header.value(section); - } else { - return QVariant(); - } -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/widgetexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/widgetexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/widgetexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/widgetexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef WIDGETEXAMPLE_H -#define WIDGETEXAMPLE_H - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -#include - -#include -#include -#include -#include - -DGUI_USE_NAMESPACE -DWIDGET_USE_NAMESPACE - -class QTableView; - -class WidgetExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit WidgetExampleWindow(QWidget *parent = nullptr); -}; - -class DCalendarWidgetExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DCalendarWidgetExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DTableWidgetExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DTableWidgetExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; - -private: - QTableView *tableView; -}; - -class CalendarModel : public QAbstractTableModel -{ - Q_OBJECT -public: - CalendarModel(QObject *parent = nullptr); - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - int columnCount(const QModelIndex &parent = QModelIndex()) const override; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - QVariant headerData(int section, Qt::Orientation orientation, - int role = Qt::DisplayRole) const override; - -private: - QStringList header; - QVector> m_tableData; // row = 6, col = 7 -}; - -#endif // WIDGETEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/windowexample.cpp dtkwidget-5.6.12/examples/dwidget-examples/collections/windowexample.cpp --- dtkwidget-5.5.48/examples/dwidget-examples/collections/windowexample.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/windowexample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,442 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "windowexample.h" - -DWIDGET_USE_NAMESPACE - -class ExampTitlebar : public DTitlebar -{ -public: - ExampTitlebar(QIcon icon) - { - setIcon(icon); - setFixedSize(530, 50); - } - -private: - void paintEvent(QPaintEvent *e) override - { - DTitlebar::paintEvent(e); - QPainter p(this); - const DPalette &dp = DPaletteHelper::instance()->palette(this); - - p.save(); - p.setPen(QPen(dp.frameBorder(), 2)); - DDrawUtils::drawRoundedRect(&p, rect().adjusted(0 , 0, -1 , -1), 16, 16, - DDrawUtils::Corner::TopLeftCorner | DDrawUtils::Corner::TopRightCorner); - p.restore(); - } -}; - -class ExampWindow : public DMainWindow -{ -public: - ExampWindow(QIcon icon) - { - titlebar()->hide(); - title = new ExampTitlebar(icon); - title->setParent(this); - title->move(0, 0); - } - - ExampTitlebar* eTitlebar() - { - return title; - } -private: - void paintEvent(QPaintEvent *e) override - { - DMainWindow::paintEvent(e); - QPainter p(this); - const DPalette &dp = DPaletteHelper::instance()->palette(this); - - p.save(); - p.setPen(QPen(dp.frameBorder(), 2)); - p.drawRoundedRect(rect().adjusted(1, 1, -1, -1), 16, 16); - p.restore(); - } -private: - ExampTitlebar *title = nullptr; -}; - -class ExampStatusBar : public DStatusBar -{ -public: - ExampStatusBar() - { - QWidget *central = new QWidget; - QHBoxLayout *layout = new QHBoxLayout; - DSlider *slider = new DSlider(Qt::Horizontal); - slider->setFixedWidth(131); - - layout->setSpacing(0); - layout->setMargin(0); - layout->addSpacing(254); - layout->addWidget(new QLabel("7项")); - layout->addWidget(slider, 0, Qt::AlignRight); - central->setLayout(layout); - - setFixedSize(530, 30); - central->setFixedWidth(530); - addWidget(central, 10); - } -private: - void paintEvent(QPaintEvent *e) override - { - QPainter p(this); - const DPalette &dp = DPaletteHelper::instance()->palette(this); - - p.setPen(QPen(dp.frameBorder(), 2)); - DDrawUtils::drawRoundedRect(&p, rect().adjusted(0 , 0, -1 , -1), 16, 16, - DDrawUtils::Corner::BottomLeftCorner | DDrawUtils::Corner::BottomRightCorner); - DStatusBar::paintEvent(e); - } -}; - -WindowExampleWindow::WindowExampleWindow(QWidget *parent) - : PageWindowInterface(parent) -{ - addExampleWindow(new DTitleBarExample(this)); - addExampleWindow(new DMainWindowExample(this)); - addExampleWindow(new DStatusBarExample(this)); - addExampleWindow(new DSizegripExample(this)); - addExampleWindow(new DTabBarExample(this)); -} - -DTitleBarExample::DTitleBarExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - setProperty("DTitleBarExample", true); - QVBoxLayout *mainLayout = new QVBoxLayout; - ExampTitlebar *titlebar1 = new ExampTitlebar(QIcon::fromTheme("preferences-system")); - ExampTitlebar *titlebar2 = new ExampTitlebar(QIcon(":/images/example/movie-logo.svg")); - ExampTitlebar *titlebar3 = new ExampTitlebar(QIcon::fromTheme("preferences-system")); - ExampTitlebar *titlebar4 = new ExampTitlebar(QIcon::fromTheme("preferences-system")); - - titlebar2->setBackgroundTransparent(true); - - - QLabel *label1 = new QLabel; - QLabel *label2 = new QLabel; - QLabel *label3 = new QLabel; - QLabel *label4 = new QLabel; - QLabel *background = new QLabel(titlebar2); - - background->setObjectName("background"); - titlebar2->setObjectName("title"); - - background->setFixedSize(550, 70); - background->setPixmap(QPixmap(":/images/example/background.png")); - background->setScaledContents(true); - background->move(-10, -5); - background->lower(); - - mainLayout->setSpacing(20); - - titlebar2->addWidget(new QLabel("avatar(2009)108...-ndi[Team DRSD].mkv"), Qt::AlignLeft); - //当前不能通过setWindowFlags()函数设置标志位隐藏,setVisible()也不可 - titlebar3->findChild()->setFixedSize(0, 0); - titlebar4->findChild()->setFixedSize(0, 0); - - label1->setScaledContents(true); - label1->setFixedSize(550, 372); - label1->setPixmap(QPixmap(":/images/example/DTitlebar_1.png")); - - label2->setScaledContents(true); - label2->setFixedSize(550, 372); - label2->setPixmap(QPixmap(":/images/example/DTitlebar_2.png")); - - label3->setScaledContents(true); - label3->setFixedSize(550, 372); - label3->setPixmap(QPixmap(":/images/example/DTitlebar_3.png")); - - label4->setScaledContents(true); - label4->setFixedSize(550, 372); - label4->setPixmap(QPixmap(":/images/example/DTitlebar_4.png")); - - - mainLayout->addWidget(titlebar1, 0, Qt::AlignCenter); - mainLayout->addWidget(titlebar2, 0, Qt::AlignCenter); - mainLayout->addWidget(titlebar3, 0, Qt::AlignCenter); - mainLayout->addWidget(titlebar4, 0, Qt::AlignCenter); - - mainLayout->addWidget(label1, 0, Qt::AlignCenter); - mainLayout->addWidget(label2, 0, Qt::AlignCenter); - mainLayout->addWidget(label3, 0, Qt::AlignCenter); - mainLayout->addWidget(label4, 0, Qt::AlignCenter); - - setLayout(mainLayout); -} - -QString DTitleBarExample::getTitleName() const -{ - return "DTitleBar"; -} - -QString DTitleBarExample::getDescriptionInfo() const -{ - return "DTitleBar有几种样式:\n" - "一,可以最大化且带不透明背景\n" - "二,可以最大化带透明背景\n" - "三,不可以最大化带不透明背景\n" - "四,不可以最大化带透明背景\n"; -} - -int DTitleBarExample::getFixedHeight() const -{ - return 1942; -} - -DMainWindowExample::DMainWindowExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - QLabel *label = new QLabel; - - - label->setScaledContents(true); - label->setFixedSize(550, 372); - label->setPixmap(QPixmap(":/images/example/DTitlebar_1.png")); - - mainLayout->addWidget(label, 0, Qt::AlignCenter); -} - -QString DMainWindowExample::getTitleName() const -{ - return "DMainWindow"; -} - -QString DMainWindowExample::getDescriptionInfo() const -{ - return "主窗口"; -} - -int DMainWindowExample::getFixedHeight() const -{ - return 662; -} - -DStatusBarExample::DStatusBarExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *mainLayout = new QVBoxLayout; - ExampStatusBar *bar = new ExampStatusBar; - QLabel *label = new QLabel; - - setLayout(mainLayout); - label->setScaledContents(true); - label->setFixedSize(550, 372); - label->setPixmap(QPixmap(":/images/example/DTitlebar_1.png")); - - - mainLayout->addWidget(bar, 0, Qt::AlignCenter); - mainLayout->addSpacing(80); - mainLayout->addWidget(label, 0, Qt::AlignCenter); -} - -QString DStatusBarExample::getTitleName() const -{ - return "DStatusBar"; -} - -QString DStatusBarExample::getDescriptionInfo() const -{ - return "状态栏"; -} - -int DStatusBarExample::getFixedHeight() const -{ - return 572; -} - -// 构造指定类型的Tabbar -template -T* generateTabBar(const QTabBar::Shape shape, QWidget* parent = nullptr) -{ - auto tabbar = new T(parent); - - tabbar->addTab(""); - tabbar->setTabIcon(0, QIcon(":/images/logo_icon.svg")); - tabbar->addTab("标签二"); - tabbar->addTab("标签三"); - tabbar->addTab("标签四"); - tabbar->addTab("标签五"); - tabbar->addTab("标签六"); - tabbar->addTab("标签七"); - - tabbar->setShape(shape); - tabbar->setTabsClosable(true); - - return tabbar; -} - -// 测试DTabBar::setShape接口 -inline static QWidget* createTabBarSetShape(const QList& shapes, QWidget* parent) -{ - auto view = new QWidget(parent); - - auto layout = new QHBoxLayout(view); - layout->setSpacing(40); - - for (auto shape : shapes) { - auto *tabbar1 = generateTabBar(shape); - tabbar1->setEnabledEmbedStyle(false); - layout->addWidget(tabbar1, 0); - { - auto border = new QFrame(); - border->setFrameShape(QFrame::VLine); - border->setFrameShadow(QFrame::Sunken); - layout->addWidget(border); - } - auto *tabbar2 = generateTabBar(shape); - tabbar2->setEnabledEmbedStyle(true); - layout->addWidget(tabbar2, 0); - { - auto border = new QFrame(); - border->setFrameShape(QFrame::VLine); - border->setFrameShadow(QFrame::Sunken); - layout->addWidget(border); - } - - QObject::connect(tabbar1, &DTabBar::tabAddRequested, [tabbar1, tabbar2](){ - tabbar1->addTab(QString("Add Tab %1").arg(tabbar1->count())); - tabbar2->addTab(QString("Add Tab %1").arg(tabbar2->count())); - }); - } - return view; -} - -DTabBarExample::DTabBarExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - DTabBar *tabbar1 = new DTabBar; - DTabBar *tabbar2 = new DTabBar; - QLabel *label1 = new QLabel; - QLabel *label2 = new QLabel; - ExampWindow *window = new ExampWindow(QIcon::fromTheme("preferences-system")); - QVBoxLayout *layout = new QVBoxLayout(this); - - tabbar1->setEnabledEmbedStyle(true); - tabbar1->addTab("标签一"); - tabbar1->addTab("标签二"); - tabbar1->addTab("标签三"); - tabbar1->addTab("标签四"); - tabbar1->addTab("标签五"); - tabbar1->setExpanding(true); - tabbar1->setFixedWidth(550); - - tabbar2->addTab("/etc/.co."); - tabbar2->addTab("gtk-wid..."); - - window->eTitlebar()->addWidget(tabbar2, Qt::AlignLeft); - - window->setFixedSize(550, 120); - window->eTitlebar()->setFixedWidth(550); - - label1->setScaledContents(true); - label2->setScaledContents(true); - label1->setFixedSize(550, 356); - label2->setFixedSize(550, 328); - label1->setPixmap(QPixmap(":/images/example/DTabBar_1.png")); - label2->setPixmap(QPixmap(":/images/example/DTabBar_2.png")); - - layout->addWidget(tabbar1, 0, Qt::AlignCenter); - layout->addSpacing(40); - layout->addWidget(window, 0, Qt::AlignCenter); - layout->addSpacing(40); - layout->addWidget(createTabBarSetShape({QTabBar::RoundedWest, QTabBar::RoundedEast}, this), 0, Qt::AlignCenter); - layout->addSpacing(40); - layout->addWidget(createTabBarSetShape({QTabBar::TriangularWest, QTabBar::TriangularEast}, this), 0, Qt::AlignCenter); - layout->addSpacing(70); - layout->addWidget(label1, 0, Qt::AlignCenter); - layout->addWidget(label2, 0, Qt::AlignCenter); -} - -QString DTabBarExample::getTitleName() const -{ - return "DTabBar"; -} - -QString DTabBarExample::getDescriptionInfo() const -{ - return "类型1" - "这类标签用在应用主窗口内在DTitlebar\n" - "底下用作多视图的切换,DTitlebar是在\n" - "用户新建标签的时候才会出现,比如文\n" - "件管理器。\n" - "类型2\n" - "这类标签用在DTitlebar内,也是用作\n" - "多视图的切换,但和类型1性质一样,但\n" - "是使用场景不一样,之所以合并在\n" - "DTitlebar内是因为该应用没有别的功能\n" - "需要放在DTitlebar上,比如文本编辑器\n" - "和终端,除了文字部分,标签就是它们\n" - "最常用的功能。\n"; -} - -int DTabBarExample::getFixedHeight() const -{ - return 1880; -} - -DSizegripExample::DSizegripExample(QWidget *parent) - : ExampleWindowInterface(parent) -{ - QVBoxLayout *layout = new QVBoxLayout; - QLabel *label = new QLabel; - - label->setScaledContents(true); - label->setFixedSize(550, 372); - label->setPixmap(QPixmap(":/images/example/DSizegrip.png")); - layout->addWidget(label, 0, Qt::AlignCenter); - - setLayout(layout); -} - -QString DSizegripExample::getTitleName() const -{ - return "DSizegrip"; -} - -QString DSizegripExample::getDescriptionInfo() const -{ - return "尺寸控制"; -} - -int DSizegripExample::getFixedHeight() const -{ - return 662; -} diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/collections/windowexample.h dtkwidget-5.6.12/examples/dwidget-examples/collections/windowexample.h --- dtkwidget-5.5.48/examples/dwidget-examples/collections/windowexample.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/collections/windowexample.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef WINDOWEXAMPLE_H -#define WINDOWEXAMPLE_H - -#include -#include - -#include -#include "examplewindowinterface.h" -#include "pagewindowinterface.h" - -class WindowExampleWindow : public PageWindowInterface -{ - Q_OBJECT - -public: - explicit WindowExampleWindow(QWidget *parent = nullptr); -}; - -class DTitleBarExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DTitleBarExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DMainWindowExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DMainWindowExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DStatusBarExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DStatusBarExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DSizegripExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DSizegripExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -class DTabBarExample : public ExampleWindowInterface -{ - Q_OBJECT - -public: - explicit DTabBarExample(QWidget *parent = nullptr); - - QString getTitleName() const override; - QString getDescriptionInfo() const override; - int getFixedHeight() const override; -}; - -#endif // WINDOWEXAMPLE_H diff -Nru dtkwidget-5.5.48/examples/dwidget-examples/dwidget-examples.pro dtkwidget-5.6.12/examples/dwidget-examples/dwidget-examples.pro --- dtkwidget-5.5.48/examples/dwidget-examples/dwidget-examples.pro 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/dwidget-examples/dwidget-examples.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += collections diff -Nru dtkwidget-5.5.48/examples/examples.pro dtkwidget-5.6.12/examples/examples.pro --- dtkwidget-5.5.48/examples/examples.pro 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/examples/examples.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += dwidget-examples diff -Nru dtkwidget-5.5.48/examples/PrintPreviewSettingsPlugin/CMakeLists.txt dtkwidget-5.6.12/examples/PrintPreviewSettingsPlugin/CMakeLists.txt --- dtkwidget-5.5.48/examples/PrintPreviewSettingsPlugin/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/PrintPreviewSettingsPlugin/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +set(PLUGIN_NAME PrintPreviewSettingsPlugin) + +find_package(Qt5 REQUIRED COMPONENTS Core) + +add_library(${PLUGIN_NAME} SHARED + settingsplugin.h + settingsplugin.cpp +) + +target_link_libraries(${PLUGIN_NAME} PRIVATE + ${LIB_NAME} +) diff -Nru dtkwidget-5.5.48/examples/PrintPreviewSettingsPlugin/PrintPreviewSettingsPlugin.json dtkwidget-5.6.12/examples/PrintPreviewSettingsPlugin/PrintPreviewSettingsPlugin.json --- dtkwidget-5.5.48/examples/PrintPreviewSettingsPlugin/PrintPreviewSettingsPlugin.json 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/PrintPreviewSettingsPlugin/PrintPreviewSettingsPlugin.json 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,3 @@ +{ + "Keys" : [ ] +} diff -Nru dtkwidget-5.5.48/examples/PrintPreviewSettingsPlugin/settingsplugin.cpp dtkwidget-5.6.12/examples/PrintPreviewSettingsPlugin/settingsplugin.cpp --- dtkwidget-5.5.48/examples/PrintPreviewSettingsPlugin/settingsplugin.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/PrintPreviewSettingsPlugin/settingsplugin.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,152 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "settingsplugin.h" + +#include "dprintpreviewwidget.h" + +PrintPreviewSettingsPlugin::PrintPreviewSettingsPlugin(QObject *parent) : + QObject(parent) +{ +} + +QString PrintPreviewSettingsPlugin::name() const +{ + return QLatin1String("WaterMarkFilter"); +} + +bool PrintPreviewSettingsPlugin::settingFilter(const QVariant &mimeData, DPrintPreviewSettingInfo *info) +{ + const QString &path = mimeData.toString(); + + // Filter the special file + if (!path.endsWith("secrecy")) + return false; + + switch (info->type()) { + case DPrintPreviewSettingInfo::PS_Printer: { + auto printerInfo = static_cast(info); + auto &printers = printerInfo->printers; + auto it = std::remove_if(printers.begin(), printers.end(), [](const QString &printer) { + if (printer.contains("Pdf", Qt::CaseInsensitive)) + return true; + return false; + }); + + if (it == printers.end()) + break; + printers.erase(it); + printerInfo->printers = printers; + } + return true; + case DPrintPreviewSettingInfo::PS_Copies: { + auto copiesInfo = static_cast(info); + copiesInfo->copies = 2; + } + return true; + case DPrintPreviewSettingInfo::PS_Scaling: { + auto scalingInfo = static_cast(info); + scalingInfo->scalingType = DPrintPreviewScalingInfo::ScaleSize; + scalingInfo->scaleRatio = 20; + } + return true; + case DPrintPreviewSettingInfo::PS_ColorMode: { + auto colorModeInfo = static_cast(info); + auto &colorModes = colorModeInfo->colorMode; + auto it = std::remove_if(colorModes.begin(), colorModes.end(), [](const QString &printer) { + if (printer.contains("color", Qt::CaseInsensitive)) + return true; + return false; + }); + + if (it == colorModes.end()) + break; + colorModes.erase(it); + colorModeInfo->colorMode = colorModes; + } + return true; + case DPrintPreviewSettingInfo::PS_PageOrder: { + auto pageOrderInfo = static_cast(info); + pageOrderInfo->pageOrder = DPrintPreviewPageOrderInfo::InOrderPage; + pageOrderInfo->inOrdertype = DPrintPreviewPageOrderInfo::BackToFront; + } + return true; + case DPrintPreviewSettingInfo::PS_PageRange: { + auto pageRangeInfo = static_cast(info); + pageRangeInfo->rangeType = DPrintPreviewWidget::SelectPage; + pageRangeInfo->selectPages = "1,2,3,4"; + } + return true; + case DPrintPreviewSettingInfo::PS_PaperSize: { + auto paperSizeInfo = static_cast(info); + if (paperSizeInfo->pageSize.contains("A4")) { + paperSizeInfo->pageSize = (QStringList() << "A4"); + return true; + } + return false; + } + case DPrintPreviewSettingInfo::PS_Watermark: { + auto waterMarkInfo = static_cast(info); + waterMarkInfo->currentWatermarkType = DPrintPreviewWatermarkInfo::TextWatermark; + waterMarkInfo->textType = DPrintPreviewWatermarkInfo::Custom; + waterMarkInfo->customText = "控制的自定义文本"; + waterMarkInfo->textColor = Qt::red; + + waterMarkInfo->opened = true; + waterMarkInfo->angle = 0; + waterMarkInfo->layout = DPrintPreviewWatermarkInfo::Tiled; + waterMarkInfo->size = 20; + waterMarkInfo->transparency = 60; + waterMarkInfo->rowSpacing = 1.0; + waterMarkInfo->columnSpacing = 0.5; + } + return true; + case DPrintPreviewSettingInfo::PS_NUpPrinting: { + auto nupprintInfo = static_cast(info); + nupprintInfo->enable = true; + nupprintInfo->imposition = DPrintPreviewWidget::OneRowTwoCol; + } + return true; + case DPrintPreviewSettingInfo::PS_Orientation: { + auto orientation = static_cast(info); + orientation->orientationMode = DPrinter::Landscape; + } + return true; + case DPrintPreviewSettingInfo::PS_PrintDuplex: { + auto duplexInfo = static_cast(info); + duplexInfo->enable = true; + duplexInfo->duplex = DPrinter::DuplexLongSide; + } + return true; + case DPrintPreviewSettingInfo::PS_PaperMargins: { + auto marginInfo = static_cast(info); + marginInfo->marginType = DPrintPreviewPaperMarginsInfo::Customize; + marginInfo->leftMargin = 40; + } + return true; + default: + break; + } + + return false; +} + +DPrintPreviewSettingInterface::SettingStatus PrintPreviewSettingsPlugin::settingStatus(const QVariant &mimeData, DPrintPreviewSettingInterface::SettingSubControl control) +{ + const QString &path = mimeData.toString(); + + // Filter the special file + if (!path.endsWith("secrecy")) + return DPrintPreviewSettingInterface::settingStatus(mimeData, control); + + DPrintPreviewSettingInterface::SettingStatus status = DPrintPreviewSettingInterface::Default; + switch (control) { + case DPrintPreviewSettingInterface::SC_WatermarkWidget: + status = DPrintPreviewSettingInterface::Disabled; + break; + default: + break; + } + return status; +} diff -Nru dtkwidget-5.5.48/examples/PrintPreviewSettingsPlugin/settingsplugin.h dtkwidget-5.6.12/examples/PrintPreviewSettingsPlugin/settingsplugin.h --- dtkwidget-5.5.48/examples/PrintPreviewSettingsPlugin/settingsplugin.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/examples/PrintPreviewSettingsPlugin/settingsplugin.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef PRINTPREVIEWSETTINGSPLUGIN_H +#define PRINTPREVIEWSETTINGSPLUGIN_H + +#include +#include "dprintpreviewsettinginterface.h" + +DWIDGET_USE_NAMESPACE + +class PrintPreviewSettingsPlugin : public QObject, public DPrintPreviewSettingInterface +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.deepin.dtk.plugin.PrintPreview.SettingsExample" FILE "PrintPreviewSettingsPlugin.json") + +public: + PrintPreviewSettingsPlugin(QObject *parent = nullptr); + QString name() const; + bool settingFilter(const QVariant &mimeData, DPrintPreviewSettingInfo *info); + SettingStatus settingStatus(const QVariant &mimeData, SettingSubControl control); +}; + +#endif // PRINTPREVIEWSETTINGSPLUGIN_H diff -Nru dtkwidget-5.5.48/.github/ISSUE_TEMPLATE/config.yml dtkwidget-5.6.12/.github/ISSUE_TEMPLATE/config.yml --- dtkwidget-5.5.48/.github/ISSUE_TEMPLATE/config.yml 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/.github/ISSUE_TEMPLATE/config.yml 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,20 @@ +blank_issues_enabled: false +contact_links: + - name: BUG Report | 缺陷报告 + url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=bug-report.yml + about: Please create bug reports to the issue board in our dtk repo. + + - name: docs-update | 文档补充 + url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=docs-update.yml + about: Please create docs-update to the issue board in our dtk repo. + + - name: unit-test-report | 单元测试报告 + url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=unit-test-report.yml + about: Please create unit-test-report to the issue board in our dtk repo. + + - name: Feature Request | 特性请求 + url: https://github.com/linuxdeepin/developer-center/discussions/new?category=features-request-ideas-%E7%89%B9%E6%80%A7%E8%AF%B7%E6%B1%82-%E5%A4%B4%E8%84%91%E9%A3%8E%E6%9A%B4 + about: Please create feature requests to the discussion board in our developer-center repo. + - name: General Discussion & Questions | 常规讨论与问答 + url: https://github.com/linuxdeepin/developer-center/discussions/categories/q-a-%E9%97%AE%E7%AD%94%E6%9D%BF%E5%9D%97 + about: Please use the discussion board in our developer-center repo. diff -Nru dtkwidget-5.5.48/.github/ISSUE_TEMPLATE/document.md dtkwidget-5.6.12/.github/ISSUE_TEMPLATE/document.md --- dtkwidget-5.5.48/.github/ISSUE_TEMPLATE/document.md 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/.github/ISSUE_TEMPLATE/document.md 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,17 @@ +--- +name: Docs update +about: Document Normalization +title: 'Doc: [Document Type][file name]' +labels: 'Doc' +assignees: '' +--- +## Target files (目标文件) + +## Planned completion time (计划完成时间) + +## Document Type (文档类型) + +[] New documents +[] Standardized documents +[] Internationalization of documents +[] Example documents diff -Nru dtkwidget-5.5.48/.github/workflows/backup-to-gitlab.yml dtkwidget-5.6.12/.github/workflows/backup-to-gitlab.yml --- dtkwidget-5.5.48/.github/workflows/backup-to-gitlab.yml 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/.github/workflows/backup-to-gitlab.yml 2023-05-15 03:42:41.000000000 +0000 @@ -6,47 +6,12 @@ cancel-in-progress: true jobs: - backup-to-gitlab: - if: github.repository_owner == 'linuxdeepin' - name: backup-to-gitlab - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - repository: "linuxdeepin/jenkins-bridge-client" - path: jenkins-bridge-client - - - name: Install Client - run: | - cd $GITHUB_WORKSPACE/jenkins-bridge-client - go build . - sudo install -Dvm755 jenkins-bridge-client -t /usr/bin/ - - name: Trigger sync - id: generate-runid - run: | - echo "::set-output name=RUN_ID::$(jenkins-bridge-client -triggerSync -token '${{ secrets.BRIDGETOKEN }}')" - - name: Print log - run: | - jenkins-bridge-client -printlog -token "${{ secrets.BRIDGETOKEN }}" -runid "${{ steps.generate-runid.outputs.RUN_ID }}" + backup-to-gitlabwh: + uses: linuxdeepin/.github/.github/workflows/backup-to-gitlabwh.yml@master + secrets: + BRIDGETOKEN: ${{ secrets.BRIDGETOKEN }} backup-to-gitee: - if: github.repository_owner == 'linuxdeepin' - runs-on: ubuntu-latest - steps: - - name: create-repo - run: | - repo=${{ github.event.repository.name }} - homepage="https://github.com/linuxdeepin/${repo}" - description="mirror of ${homepage}" - # remove '.' prefix - repo=${repo#"."} - curl -X POST --header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/enterprises/linuxdeepin/repos' -d '{"private": 1,"access_token":"${{ secrets.GITEE_SYNC_TOKEN }}","name":"'"$repo"'","description":"'"$description"'","homepage":"'"$homepage"'","has_issues":"false","has_wiki":"false","can_comment":"false"}' || true - - name: push - run: | - git clone --bare https://github.com/linuxdeepin/${{ github.event.repository.name }}.git .git - repo=${{ github.event.repository.name }} - # remove '.' prefix - repo=${repo#"."} - git remote set-url origin https://myml:${{ secrets.GITEE_SYNC_TOKEN }}@gitee.com/linuxdeepin/${repo}.git - git push -f --all --prune origin - git push --tags origin + uses: linuxdeepin/.github/.github/workflows/backup-to-gitee.yml@master + secrets: + GITEE_SYNC_TOKEN: ${{ secrets.GITEE_SYNC_TOKEN }} diff -Nru dtkwidget-5.5.48/.github/workflows/call-auto-tag.yml dtkwidget-5.6.12/.github/workflows/call-auto-tag.yml --- dtkwidget-5.5.48/.github/workflows/call-auto-tag.yml 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/.github/workflows/call-auto-tag.yml 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,16 @@ +name: auto tag + +on: + pull_request_target: + types: [opened, synchronize, closed] + paths: + - "debian/changelog" + +concurrency: + group: ${{ github.workflow }}-pull/${{ github.event.number }} + cancel-in-progress: true + +jobs: + auto_tag: + uses: linuxdeepin/.github/.github/workflows/auto-tag.yml@master + secrets: inherit diff -Nru dtkwidget-5.5.48/.github/workflows/call-build-deb.yml dtkwidget-5.6.12/.github/workflows/call-build-deb.yml --- dtkwidget-5.5.48/.github/workflows/call-build-deb.yml 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/.github/workflows/call-build-deb.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -name: Call build-deb -on: - pull_request_target: - paths-ignore: - - ".github/workflows/**" - -concurrency: - group: ${{ github.workflow }}-pull/${{ github.event.number }} - cancel-in-progress: true - -jobs: - check_job: - uses: linuxdeepin/.github/.github/workflows/build-deb.yml@master - secrets: - BridgeToken: ${{ secrets.BridgeToken }} diff -Nru dtkwidget-5.5.48/.github/workflows/call-chatOps.yml dtkwidget-5.6.12/.github/workflows/call-chatOps.yml --- dtkwidget-5.5.48/.github/workflows/call-chatOps.yml 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/.github/workflows/call-chatOps.yml 2023-05-15 03:42:41.000000000 +0000 @@ -6,5 +6,4 @@ jobs: chatopt: uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master - secrets: - APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} + secrets: inherit diff -Nru dtkwidget-5.5.48/.github/workflows/call-deploy-dev-doc.yml dtkwidget-5.6.12/.github/workflows/call-deploy-dev-doc.yml --- dtkwidget-5.5.48/.github/workflows/call-deploy-dev-doc.yml 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/.github/workflows/call-deploy-dev-doc.yml 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,27 @@ +name: deploy docs +on: + push: + branches: ["master"] + workflow_dispatch: + inputs: + tag: + required: true + type: string + +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + deploydocs: + uses: linuxdeepin/.github/.github/workflows/deploy-dev-doc.yml@master + with: + ref: ${{ inputs.tag }} + secrets: + APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} diff -Nru dtkwidget-5.5.48/.github/workflows/call-doc-check.yml dtkwidget-5.6.12/.github/workflows/call-doc-check.yml --- dtkwidget-5.5.48/.github/workflows/call-doc-check.yml 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/.github/workflows/call-doc-check.yml 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,15 @@ +name: doxygen-check +on: + pull_request_target: + paths-ignore: + - ".github/workflows/**" + +concurrency: + group: ${{ github.workflow }}-pull/${{ github.event.number }} + cancel-in-progress: true + +jobs: + check_job: + uses: linuxdeepin/.github/.github/workflows/doc-check.yml@master + secrets: + APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} diff -Nru dtkwidget-5.5.48/.github/workflows/call-license-check.yml dtkwidget-5.6.12/.github/workflows/call-license-check.yml --- dtkwidget-5.5.48/.github/workflows/call-license-check.yml 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/.github/workflows/call-license-check.yml 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,16 @@ +name: Call License and README Check +on: + pull_request_target: + types: [opened, synchronize, reopened] + +permissions: + pull-requests: write + contents: read + +concurrency: + group: ${{ github.workflow }}-pull/${{ github.event.number }} + cancel-in-progress: true + +jobs: + license-check: + uses: linuxdeepin/.github/.github/workflows/license-check.yml@master diff -Nru dtkwidget-5.5.48/.gitignore dtkwidget-5.6.12/.gitignore --- dtkwidget-5.5.48/.gitignore 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/.gitignore 2023-05-15 03:42:41.000000000 +0000 @@ -21,11 +21,22 @@ src/DtkWidgets src/dtkwidget_config.h -cmake/DtkWidget/DtkWidgetConfig.cmake +cmake/DtkWidget src/qt_lib_dtk*.pri # misc .vscode/ - +build +.cache # cmake files -cmake/* +asan* +archlinux/source.tar.gz +archlinux/src +archlinux/pkg +archlinux/*.pkg.tar.zst +include/dtkwidget/global/dtkwidget_config.h +DtkWidgetConfig.cmake +qt_lib_dtkwidget.pri +dtkwidget.pc +*.qdoc +CMakeLists.txt.user diff -Nru dtkwidget-5.5.48/include/DWidget/DAboutDialog dtkwidget-5.6.12/include/DWidget/DAboutDialog --- dtkwidget-5.5.48/include/DWidget/DAboutDialog 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DAboutDialog 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "daboutdialog.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DAbstractDialog dtkwidget-5.6.12/include/DWidget/DAbstractDialog --- dtkwidget-5.5.48/include/DWidget/DAbstractDialog 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DAbstractDialog 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dabstractdialog.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DAccessibilityChecker dtkwidget-5.6.12/include/DWidget/DAccessibilityChecker --- dtkwidget-5.5.48/include/DWidget/DAccessibilityChecker 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DAccessibilityChecker 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "daccessibilitychecker.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DAccessibleWidget dtkwidget-5.6.12/include/DWidget/DAccessibleWidget --- dtkwidget-5.5.48/include/DWidget/DAccessibleWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DAccessibleWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DAlertControl dtkwidget-5.6.12/include/DWidget/DAlertControl --- dtkwidget-5.5.48/include/DWidget/DAlertControl 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DAlertControl 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dalertcontrol.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DAnchors dtkwidget-5.6.12/include/DWidget/DAnchors --- dtkwidget-5.5.48/include/DWidget/DAnchors 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DAnchors 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "danchors.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DApplication dtkwidget-5.6.12/include/DWidget/DApplication --- dtkwidget-5.5.48/include/DWidget/DApplication 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DApplication 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dapplication.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DApplicationHelper dtkwidget-5.6.12/include/DWidget/DApplicationHelper --- dtkwidget-5.5.48/include/DWidget/DApplicationHelper 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DApplicationHelper 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dapplicationhelper.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DApplicationSettings dtkwidget-5.6.12/include/DWidget/DApplicationSettings --- dtkwidget-5.5.48/include/DWidget/DApplicationSettings 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DApplicationSettings 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dapplicationsettings.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DArrowButton dtkwidget-5.6.12/include/DWidget/DArrowButton --- dtkwidget-5.5.48/include/DWidget/DArrowButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DArrowButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "darrowbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DArrowLineDrawer dtkwidget-5.6.12/include/DWidget/DArrowLineDrawer --- dtkwidget-5.5.48/include/DWidget/DArrowLineDrawer 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DArrowLineDrawer 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "darrowlinedrawer.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DArrowLineExpand dtkwidget-5.6.12/include/DWidget/DArrowLineExpand --- dtkwidget-5.5.48/include/DWidget/DArrowLineExpand 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DArrowLineExpand 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "darrowlineexpand.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DArrowRectangle dtkwidget-5.6.12/include/DWidget/DArrowRectangle --- dtkwidget-5.5.48/include/DWidget/DArrowRectangle 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DArrowRectangle 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "darrowrectangle.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DBackgroundGroup dtkwidget-5.6.12/include/DWidget/DBackgroundGroup --- dtkwidget-5.5.48/include/DWidget/DBackgroundGroup 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DBackgroundGroup 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dbackgroundgroup.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DBlurEffectWidget dtkwidget-5.6.12/include/DWidget/DBlurEffectWidget --- dtkwidget-5.5.48/include/DWidget/DBlurEffectWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DBlurEffectWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dblureffectwidget.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DButtonBox dtkwidget-5.6.12/include/DWidget/DButtonBox --- dtkwidget-5.5.48/include/DWidget/DButtonBox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DButtonBox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dbuttonbox.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DCalendarWidget dtkwidget-5.6.12/include/DWidget/DCalendarWidget --- dtkwidget-5.5.48/include/DWidget/DCalendarWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DCalendarWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DCheckBox dtkwidget-5.6.12/include/DWidget/DCheckBox --- dtkwidget-5.5.48/include/DWidget/DCheckBox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DCheckBox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DClipEffectWidget dtkwidget-5.6.12/include/DWidget/DClipEffectWidget --- dtkwidget-5.5.48/include/DWidget/DClipEffectWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DClipEffectWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dclipeffectwidget.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DColorDialog dtkwidget-5.6.12/include/DWidget/DColorDialog --- dtkwidget-5.5.48/include/DWidget/DColorDialog 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DColorDialog 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DColoredProgressBar dtkwidget-5.6.12/include/DWidget/DColoredProgressBar --- dtkwidget-5.5.48/include/DWidget/DColoredProgressBar 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DColoredProgressBar 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dcoloredprogressbar.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DColumnView dtkwidget-5.6.12/include/DWidget/DColumnView --- dtkwidget-5.5.48/include/DWidget/DColumnView 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DColumnView 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DComboBox dtkwidget-5.6.12/include/DWidget/DComboBox --- dtkwidget-5.5.48/include/DWidget/DComboBox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DComboBox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dcombobox.h" +#include "dwidgetstype.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DCommandLinkButton dtkwidget-5.6.12/include/DWidget/DCommandLinkButton --- dtkwidget-5.5.48/include/DWidget/DCommandLinkButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DCommandLinkButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dcommandlinkbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DCrumbEdit dtkwidget-5.6.12/include/DWidget/DCrumbEdit --- dtkwidget-5.5.48/include/DWidget/DCrumbEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DCrumbEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dcrumbedit.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DDataWidgetMapper dtkwidget-5.6.12/include/DWidget/DDataWidgetMapper --- dtkwidget-5.5.48/include/DWidget/DDataWidgetMapper 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDataWidgetMapper 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DDateEdit dtkwidget-5.6.12/include/DWidget/DDateEdit --- dtkwidget-5.5.48/include/DWidget/DDateEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDateEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DDateTimeEdit dtkwidget-5.6.12/include/DWidget/DDateTimeEdit --- dtkwidget-5.5.48/include/DWidget/DDateTimeEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDateTimeEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DDesktopServices dtkwidget-5.6.12/include/DWidget/DDesktopServices --- dtkwidget-5.5.48/include/DWidget/DDesktopServices 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDesktopServices 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "ddesktopservices.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DDial dtkwidget-5.6.12/include/DWidget/DDial --- dtkwidget-5.5.48/include/DWidget/DDial 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDial 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DDialog dtkwidget-5.6.12/include/DWidget/DDialog --- dtkwidget-5.5.48/include/DWidget/DDialog 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDialog 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "ddialog.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DDialogButtonBox dtkwidget-5.6.12/include/DWidget/DDialogButtonBox --- dtkwidget-5.5.48/include/DWidget/DDialogButtonBox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDialogButtonBox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DDialogCloseButton dtkwidget-5.6.12/include/DWidget/DDialogCloseButton --- dtkwidget-5.5.48/include/DWidget/DDialogCloseButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDialogCloseButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "ddialogclosebutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DDockWidget dtkwidget-5.6.12/include/DWidget/DDockWidget --- dtkwidget-5.5.48/include/DWidget/DDockWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDockWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DDoubleSpinBox dtkwidget-5.6.12/include/DWidget/DDoubleSpinBox --- dtkwidget-5.5.48/include/DWidget/DDoubleSpinBox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDoubleSpinBox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dspinbox.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DDrawer dtkwidget-5.6.12/include/DWidget/DDrawer --- dtkwidget-5.5.48/include/DWidget/DDrawer 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDrawer 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "ddrawer.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DDrawerGroup dtkwidget-5.6.12/include/DWidget/DDrawerGroup --- dtkwidget-5.5.48/include/DWidget/DDrawerGroup 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DDrawerGroup 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "ddrawergroup.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DErrorMessage dtkwidget-5.6.12/include/DWidget/DErrorMessage --- dtkwidget-5.5.48/include/DWidget/DErrorMessage 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DErrorMessage 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DExpandGroup dtkwidget-5.6.12/include/DWidget/DExpandGroup --- dtkwidget-5.5.48/include/DWidget/DExpandGroup 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DExpandGroup 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dexpandgroup.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DFeatureDisplayDialog dtkwidget-5.6.12/include/DWidget/DFeatureDisplayDialog --- dtkwidget-5.5.48/include/DWidget/DFeatureDisplayDialog 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFeatureDisplayDialog 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dfeaturedisplaydialog.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DFileChooserEdit dtkwidget-5.6.12/include/DWidget/DFileChooserEdit --- dtkwidget-5.5.48/include/DWidget/DFileChooserEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFileChooserEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dfilechooseredit.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DFileDialog dtkwidget-5.6.12/include/DWidget/DFileDialog --- dtkwidget-5.5.48/include/DWidget/DFileDialog 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFileDialog 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dfiledialog.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DFileIconProvider dtkwidget-5.6.12/include/DWidget/DFileIconProvider --- dtkwidget-5.5.48/include/DWidget/DFileIconProvider 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFileIconProvider 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dfileiconprovider.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DFloatingButton dtkwidget-5.6.12/include/DWidget/DFloatingButton --- dtkwidget-5.5.48/include/DWidget/DFloatingButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFloatingButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dfloatingbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DFloatingMessage dtkwidget-5.6.12/include/DWidget/DFloatingMessage --- dtkwidget-5.5.48/include/DWidget/DFloatingMessage 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFloatingMessage 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dfloatingmessage.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DFloatingWidget dtkwidget-5.6.12/include/DWidget/DFloatingWidget --- dtkwidget-5.5.48/include/DWidget/DFloatingWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFloatingWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dfloatingwidget.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DFocusFrame dtkwidget-5.6.12/include/DWidget/DFocusFrame --- dtkwidget-5.5.48/include/DWidget/DFocusFrame 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFocusFrame 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DFontComboBox dtkwidget-5.6.12/include/DWidget/DFontComboBox --- dtkwidget-5.5.48/include/DWidget/DFontComboBox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFontComboBox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dfontcombobox.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DFontDialog dtkwidget-5.6.12/include/DWidget/DFontDialog --- dtkwidget-5.5.48/include/DWidget/DFontDialog 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFontDialog 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DFontSizeManager dtkwidget-5.6.12/include/DWidget/DFontSizeManager --- dtkwidget-5.5.48/include/DWidget/DFontSizeManager 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFontSizeManager 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DFrame dtkwidget-5.6.12/include/DWidget/DFrame --- dtkwidget-5.5.48/include/DWidget/DFrame 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DFrame 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dframe.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DGraphicsClipEffect dtkwidget-5.6.12/include/DWidget/DGraphicsClipEffect --- dtkwidget-5.5.48/include/DWidget/DGraphicsClipEffect 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DGraphicsClipEffect 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dgraphicsclipeffect.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DGraphicsDropShadowEffect dtkwidget-5.6.12/include/DWidget/DGraphicsDropShadowEffect --- dtkwidget-5.5.48/include/DWidget/DGraphicsDropShadowEffect 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DGraphicsDropShadowEffect 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dgraphicsgloweffect.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DGraphicsView dtkwidget-5.6.12/include/DWidget/DGraphicsView --- dtkwidget-5.5.48/include/DWidget/DGraphicsView 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DGraphicsView 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DGroupBox dtkwidget-5.6.12/include/DWidget/DGroupBox --- dtkwidget-5.5.48/include/DWidget/DGroupBox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DGroupBox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DHeaderView dtkwidget-5.6.12/include/DWidget/DHeaderView --- dtkwidget-5.5.48/include/DWidget/DHeaderView 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DHeaderView 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DHiDPIHelper dtkwidget-5.6.12/include/DWidget/DHiDPIHelper --- dtkwidget-5.5.48/include/DWidget/DHiDPIHelper 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DHiDPIHelper 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dhidpihelper.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DHorizontalLine dtkwidget-5.6.12/include/DWidget/DHorizontalLine --- dtkwidget-5.5.48/include/DWidget/DHorizontalLine 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DHorizontalLine 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dframe.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DHorizontalSlider dtkwidget-5.6.12/include/DWidget/DHorizontalSlider --- dtkwidget-5.5.48/include/DWidget/DHorizontalSlider 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DHorizontalSlider 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DIconButton dtkwidget-5.6.12/include/DWidget/DIconButton --- dtkwidget-5.5.48/include/DWidget/DIconButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DIconButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "diconbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DImageButton dtkwidget-5.6.12/include/DWidget/DImageButton --- dtkwidget-5.5.48/include/DWidget/DImageButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DImageButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dimagebutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DImageViewer dtkwidget-5.6.12/include/DWidget/DImageViewer --- dtkwidget-5.5.48/include/DWidget/DImageViewer 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DImageViewer 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dimageviewer.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DInputDialog dtkwidget-5.6.12/include/DWidget/DInputDialog --- dtkwidget-5.5.48/include/DWidget/DInputDialog 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DInputDialog 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DIpv4LineEdit dtkwidget-5.6.12/include/DWidget/DIpv4LineEdit --- dtkwidget-5.5.48/include/DWidget/DIpv4LineEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DIpv4LineEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dipv4lineedit.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DKeySequenceEdit dtkwidget-5.6.12/include/DWidget/DKeySequenceEdit --- dtkwidget-5.5.48/include/DWidget/DKeySequenceEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DKeySequenceEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dkeysequenceedit.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DLabel dtkwidget-5.6.12/include/DWidget/DLabel --- dtkwidget-5.5.48/include/DWidget/DLabel 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DLabel 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dlabel.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DLCDNumber dtkwidget-5.6.12/include/DWidget/DLCDNumber --- dtkwidget-5.5.48/include/DWidget/DLCDNumber 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DLCDNumber 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DLicenseDialog dtkwidget-5.6.12/include/DWidget/DLicenseDialog --- dtkwidget-5.5.48/include/DWidget/DLicenseDialog 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DLicenseDialog 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dlicensedialog.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DLineEdit dtkwidget-5.6.12/include/DWidget/DLineEdit --- dtkwidget-5.5.48/include/DWidget/DLineEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DLineEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dlineedit.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DListView dtkwidget-5.6.12/include/DWidget/DListView --- dtkwidget-5.5.48/include/DWidget/DListView 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DListView 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dlistview.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DListWidget dtkwidget-5.6.12/include/DWidget/DListWidget --- dtkwidget-5.5.48/include/DWidget/DListWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DListWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DMainWindow dtkwidget-5.6.12/include/DWidget/DMainWindow --- dtkwidget-5.5.48/include/DWidget/DMainWindow 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DMainWindow 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dmainwindow.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DMdiArea dtkwidget-5.6.12/include/DWidget/DMdiArea --- dtkwidget-5.5.48/include/DWidget/DMdiArea 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DMdiArea 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DMDIArea dtkwidget-5.6.12/include/DWidget/DMDIArea --- dtkwidget-5.5.48/include/DWidget/DMDIArea 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DMDIArea 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DMdiSubWindow dtkwidget-5.6.12/include/DWidget/DMdiSubWindow --- dtkwidget-5.5.48/include/DWidget/DMdiSubWindow 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DMdiSubWindow 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DMenu dtkwidget-5.6.12/include/DWidget/DMenu --- dtkwidget-5.5.48/include/DWidget/DMenu 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DMenu 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DMenuBar dtkwidget-5.6.12/include/DWidget/DMenuBar --- dtkwidget-5.5.48/include/DWidget/DMenuBar 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DMenuBar 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DMessageBox dtkwidget-5.6.12/include/DWidget/DMessageBox --- dtkwidget-5.5.48/include/DWidget/DMessageBox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DMessageBox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DMessageManager dtkwidget-5.6.12/include/DWidget/DMessageManager --- dtkwidget-5.5.48/include/DWidget/DMessageManager 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DMessageManager 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dmessagemanager.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DOpenGLWidget dtkwidget-5.6.12/include/DWidget/DOpenGLWidget --- dtkwidget-5.5.48/include/DWidget/DOpenGLWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DOpenGLWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DPageIndicator dtkwidget-5.6.12/include/DWidget/DPageIndicator --- dtkwidget-5.5.48/include/DWidget/DPageIndicator 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DPageIndicator 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dpageindicator.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DPaletteHelper dtkwidget-5.6.12/include/DWidget/DPaletteHelper --- dtkwidget-5.5.48/include/DWidget/DPaletteHelper 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DPaletteHelper 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dpalettehelper.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DPasswordEdit dtkwidget-5.6.12/include/DWidget/DPasswordEdit --- dtkwidget-5.5.48/include/DWidget/DPasswordEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DPasswordEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dpasswordedit.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DPlainTextEdit dtkwidget-5.6.12/include/DWidget/DPlainTextEdit --- dtkwidget-5.5.48/include/DWidget/DPlainTextEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DPlainTextEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DPlatformWindowHandle dtkwidget-5.6.12/include/DWidget/DPlatformWindowHandle --- dtkwidget-5.5.48/include/DWidget/DPlatformWindowHandle 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DPlatformWindowHandle 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dplatformwindowhandle.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DPrintPreviewDialog dtkwidget-5.6.12/include/DWidget/DPrintPreviewDialog --- dtkwidget-5.5.48/include/DWidget/DPrintPreviewDialog 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DPrintPreviewDialog 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dprintpreviewdialog.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DProgressBar dtkwidget-5.6.12/include/DWidget/DProgressBar --- dtkwidget-5.5.48/include/DWidget/DProgressBar 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DProgressBar 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dprogressbar.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DPushButton dtkwidget-5.6.12/include/DWidget/DPushButton --- dtkwidget-5.5.48/include/DWidget/DPushButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DPushButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DQuickWidget dtkwidget-5.6.12/include/DWidget/DQuickWidget --- dtkwidget-5.5.48/include/DWidget/DQuickWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DQuickWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DRadioButton dtkwidget-5.6.12/include/DWidget/DRadioButton --- dtkwidget-5.5.48/include/DWidget/DRadioButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DRadioButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DRubberBand dtkwidget-5.6.12/include/DWidget/DRubberBand --- dtkwidget-5.5.48/include/DWidget/DRubberBand 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DRubberBand 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DScrollArea dtkwidget-5.6.12/include/DWidget/DScrollArea --- dtkwidget-5.5.48/include/DWidget/DScrollArea 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DScrollArea 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DScrollBar dtkwidget-5.6.12/include/DWidget/DScrollBar --- dtkwidget-5.5.48/include/DWidget/DScrollBar 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DScrollBar 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DSearchComboBox dtkwidget-5.6.12/include/DWidget/DSearchComboBox --- dtkwidget-5.5.48/include/DWidget/DSearchComboBox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSearchComboBox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dsearchcombobox.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSearchEdit dtkwidget-5.6.12/include/DWidget/DSearchEdit --- dtkwidget-5.5.48/include/DWidget/DSearchEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSearchEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dsearchedit.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSegmentedControl dtkwidget-5.6.12/include/DWidget/DSegmentedControl --- dtkwidget-5.5.48/include/DWidget/DSegmentedControl 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSegmentedControl 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dsegmentedcontrol.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSegmentedHighlight dtkwidget-5.6.12/include/DWidget/DSegmentedHighlight --- dtkwidget-5.5.48/include/DWidget/DSegmentedHighlight 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSegmentedHighlight 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dsegmentedcontrol.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSettingsDialog dtkwidget-5.6.12/include/DWidget/DSettingsDialog --- dtkwidget-5.5.48/include/DWidget/DSettingsDialog 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSettingsDialog 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dsettingsdialog.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSettingsWidgetFactory dtkwidget-5.6.12/include/DWidget/DSettingsWidgetFactory --- dtkwidget-5.5.48/include/DWidget/DSettingsWidgetFactory 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSettingsWidgetFactory 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dsettingswidgetfactory.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DShadowLine dtkwidget-5.6.12/include/DWidget/DShadowLine --- dtkwidget-5.5.48/include/DWidget/DShadowLine 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DShadowLine 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dshadowline.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSimpleListItem dtkwidget-5.6.12/include/DWidget/DSimpleListItem --- dtkwidget-5.5.48/include/DWidget/DSimpleListItem 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSimpleListItem 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dsimplelistitem.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSimpleListView dtkwidget-5.6.12/include/DWidget/DSimpleListView --- dtkwidget-5.5.48/include/DWidget/DSimpleListView 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSimpleListView 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dsimplelistview.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSizeMode dtkwidget-5.6.12/include/DWidget/DSizeMode --- dtkwidget-5.5.48/include/DWidget/DSizeMode 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSizeMode 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dsizemode.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSlider dtkwidget-5.6.12/include/DWidget/DSlider --- dtkwidget-5.5.48/include/DWidget/DSlider 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSlider 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dslider.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSpinBox dtkwidget-5.6.12/include/DWidget/DSpinBox --- dtkwidget-5.5.48/include/DWidget/DSpinBox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSpinBox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dspinbox.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSpinner dtkwidget-5.6.12/include/DWidget/DSpinner --- dtkwidget-5.5.48/include/DWidget/DSpinner 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSpinner 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dspinner.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSplitter dtkwidget-5.6.12/include/DWidget/DSplitter --- dtkwidget-5.5.48/include/DWidget/DSplitter 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSplitter 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DStackedWidget dtkwidget-5.6.12/include/DWidget/DStackedWidget --- dtkwidget-5.5.48/include/DWidget/DStackedWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStackedWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DStandardItem dtkwidget-5.6.12/include/DWidget/DStandardItem --- dtkwidget-5.5.48/include/DWidget/DStandardItem 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStandardItem 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyleditemdelegate.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DStatusBar dtkwidget-5.6.12/include/DWidget/DStatusBar --- dtkwidget-5.5.48/include/DWidget/DStatusBar 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStatusBar 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DStyle dtkwidget-5.6.12/include/DWidget/DStyle --- dtkwidget-5.5.48/include/DWidget/DStyle 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStyle 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyle.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DStyledIconEngine dtkwidget-5.6.12/include/DWidget/DStyledIconEngine --- dtkwidget-5.5.48/include/DWidget/DStyledIconEngine 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStyledIconEngine 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyle.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DStyledItemDelegate dtkwidget-5.6.12/include/DWidget/DStyledItemDelegate --- dtkwidget-5.5.48/include/DWidget/DStyledItemDelegate 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStyledItemDelegate 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyleditemdelegate.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DStyleHelper dtkwidget-5.6.12/include/DWidget/DStyleHelper --- dtkwidget-5.5.48/include/DWidget/DStyleHelper 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStyleHelper 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyle.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DStyleOption dtkwidget-5.6.12/include/DWidget/DStyleOption --- dtkwidget-5.5.48/include/DWidget/DStyleOption 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStyleOption 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DStyleOptionBackgroundGroup dtkwidget-5.6.12/include/DWidget/DStyleOptionBackgroundGroup --- dtkwidget-5.5.48/include/DWidget/DStyleOptionBackgroundGroup 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStyleOptionBackgroundGroup 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DStyleOptionButton dtkwidget-5.6.12/include/DWidget/DStyleOptionButton --- dtkwidget-5.5.48/include/DWidget/DStyleOptionButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStyleOptionButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DStyleOptionLineEdit dtkwidget-5.6.12/include/DWidget/DStyleOptionLineEdit --- dtkwidget-5.5.48/include/DWidget/DStyleOptionLineEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStyleOptionLineEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DStyleOptionViewItem dtkwidget-5.6.12/include/DWidget/DStyleOptionViewItem --- dtkwidget-5.5.48/include/DWidget/DStyleOptionViewItem 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStyleOptionViewItem 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DStylePainter dtkwidget-5.6.12/include/DWidget/DStylePainter --- dtkwidget-5.5.48/include/DWidget/DStylePainter 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DStylePainter 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dstyle.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSuggestButton dtkwidget-5.6.12/include/DWidget/DSuggestButton --- dtkwidget-5.5.48/include/DWidget/DSuggestButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSuggestButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dsuggestbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DSwitchButton dtkwidget-5.6.12/include/DWidget/DSwitchButton --- dtkwidget-5.5.48/include/DWidget/DSwitchButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DSwitchButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dswitchbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DTabBar dtkwidget-5.6.12/include/DWidget/DTabBar --- dtkwidget-5.5.48/include/DWidget/DTabBar 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTabBar 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dtabbar.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DTabletWindowOptionButton dtkwidget-5.6.12/include/DWidget/DTabletWindowOptionButton --- dtkwidget-5.5.48/include/DWidget/DTabletWindowOptionButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTabletWindowOptionButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dtabletwindowoptionbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DTableView dtkwidget-5.6.12/include/DWidget/DTableView --- dtkwidget-5.5.48/include/DWidget/DTableView 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTableView 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DTableWidget dtkwidget-5.6.12/include/DWidget/DTableWidget --- dtkwidget-5.5.48/include/DWidget/DTableWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTableWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DTabWidget dtkwidget-5.6.12/include/DWidget/DTabWidget --- dtkwidget-5.5.48/include/DWidget/DTabWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTabWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DTextBrowser dtkwidget-5.6.12/include/DWidget/DTextBrowser --- dtkwidget-5.5.48/include/DWidget/DTextBrowser 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTextBrowser 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DTextEdit dtkwidget-5.6.12/include/DWidget/DTextEdit --- dtkwidget-5.5.48/include/DWidget/DTextEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTextEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dtextedit.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DThemeManager dtkwidget-5.6.12/include/DWidget/DThemeManager --- dtkwidget-5.5.48/include/DWidget/DThemeManager 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DThemeManager 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dthememanager.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DTileRules dtkwidget-5.6.12/include/DWidget/DTileRules --- dtkwidget-5.5.48/include/DWidget/DTileRules 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTileRules 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DTimeEdit dtkwidget-5.6.12/include/DWidget/DTimeEdit --- dtkwidget-5.5.48/include/DWidget/DTimeEdit 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTimeEdit 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DTipLabel dtkwidget-5.6.12/include/DWidget/DTipLabel --- dtkwidget-5.5.48/include/DWidget/DTipLabel 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTipLabel 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dtiplabel.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DTitlebar dtkwidget-5.6.12/include/DWidget/DTitlebar --- dtkwidget-5.5.48/include/DWidget/DTitlebar 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTitlebar 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dtitlebar.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DtkWidgets dtkwidget-5.6.12/include/DWidget/DtkWidgets --- dtkwidget-5.5.48/include/DWidget/DtkWidgets 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DtkWidgets 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,111 @@ +#ifndef DTK_WIDGET_MODULE_H +#define DTK_WIDGET_MODULE_H +#include "dfileiconprovider.h" +#include "dthumbnailprovider.h" +#include "dwidgetutil.h" +#include "ddesktopservices.h" +#include "dtrashmanager.h" +#include "dhidpihelper.h" +#include "dapplicationsettings.h" +#include "daccessibilitychecker.h" +#include "dregionmonitor.h" +#include "dabstractdialog.h" +#include "ddialog.h" +#include "dialog_constants.h" +#include "dinputdialog.h" +#include "daboutdialog.h" +#include "dsettingsdialog.h" +#include "dfiledialog.h" +#include "dprintpreviewdialog.h" +#include "dmpriscontrol.h" +#include "dslider.h" +#include "dbackgroundgroup.h" +#include "dthememanager.h" +#include "dapplication.h" +#include "dconstants.h" +#include "dbaseline.h" +#include "dheaderline.h" +#include "dbaseexpand.h" +#include "darrowbutton.h" +#include "darrowlineexpand.h" +#include "dswitchlineexpand.h" +#include "dimagebutton.h" +#include "dloadingindicator.h" +#include "dsearchedit.h" +#include "dswitchbutton.h" +#include "dsegmentedcontrol.h" +#include "dlineedit.h" +#include "dwindowmaxbutton.h" +#include "dwindowminbutton.h" +#include "dwindowclosebutton.h" +#include "dwindowoptionbutton.h" +#include "dtabletwindowoptionbutton.h" +#include "dwindowquitfullbutton.h" +#include "dshortcutedit.h" +#include "dsimplelistview.h" +#include "dsimplelistitem.h" +#include "dexpandgroup.h" +#include "darrowrectangle.h" +#include "dgraphicsgloweffect.h" +#include "dboxwidget.h" +#include "dcircleprogress.h" +#include "dstackwidget.h" +#include "dfilechooseredit.h" +#include "dpasswordedit.h" +#include "dipv4lineedit.h" +#include "dspinbox.h" +#include "dpicturesequenceview.h" +#include "dflowlayout.h" +#include "dlistview.h" +#include "denhancedwidget.h" +#include "dtitlebar.h" +#include "dplatformwindowhandle.h" +#include "dmainwindow.h" +#include "dblureffectwidget.h" +#include "dpageindicator.h" +#include "dclipeffectwidget.h" +#include "dgraphicsclipeffect.h" +#include "dtickeffect.h" +#include "dwaterprogress.h" +#include "dsettingswidgetfactory.h" +#include "dspinner.h" +#include "dcrumbedit.h" +#include "dtabbar.h" +#include "dsuggestbutton.h" +#include "dstyleoption.h" +#include "dtoast.h" +#include "danchors.h" +#include "dstyle.h" +#include "dfloatingbutton.h" +#include "dwidgetstype.h" +#include "dstyleditemdelegate.h" +#include "diconbutton.h" +#include "dfloatingwidget.h" +#include "dapplicationhelper.h" +#include "dfloatingmessage.h" +#include "dmessagemanager.h" +#include "dbuttonbox.h" +#include "dwarningbutton.h" +#include "dcommandlinkbutton.h" +#include "ddialogclosebutton.h" +#include "dtiplabel.h" +#include "dtooltip.h" +#include "dframe.h" +#include "dshadowline.h" +#include "dcoloredprogressbar.h" +#include "dkeysequenceedit.h" +#include "dprogressbar.h" +#include "dlabel.h" +#include "dtextedit.h" +#include "ddrawer.h" +#include "darrowlinedrawer.h" +#include "ddrawergroup.h" +#include "dalertcontrol.h" +#include "dtoolbutton.h" +#include "dsearchcombobox.h" +#include "dprintpreviewwidget.h" +#include "dprintpickcolorwidget.h" +#include "dpalettehelper.h" +#include "dcombobox.h" +#include "dfontcombobox.h" +#endif diff -Nru dtkwidget-5.5.48/include/DWidget/DToast dtkwidget-5.6.12/include/DWidget/DToast --- dtkwidget-5.5.48/include/DWidget/DToast 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DToast 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DToolBar dtkwidget-5.6.12/include/DWidget/DToolBar --- dtkwidget-5.5.48/include/DWidget/DToolBar 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DToolBar 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DToolBox dtkwidget-5.6.12/include/DWidget/DToolBox --- dtkwidget-5.5.48/include/DWidget/DToolBox 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DToolBox 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DToolButton dtkwidget-5.6.12/include/DWidget/DToolButton --- dtkwidget-5.5.48/include/DWidget/DToolButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DToolButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dtoolbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DToolTip dtkwidget-5.6.12/include/DWidget/DToolTip --- dtkwidget-5.5.48/include/DWidget/DToolTip 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DToolTip 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dtooltip.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DTreeView dtkwidget-5.6.12/include/DWidget/DTreeView --- dtkwidget-5.5.48/include/DWidget/DTreeView 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTreeView 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DTreeWidget dtkwidget-5.6.12/include/DWidget/DTreeWidget --- dtkwidget-5.5.48/include/DWidget/DTreeWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DTreeWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DUndoView dtkwidget-5.6.12/include/DWidget/DUndoView --- dtkwidget-5.5.48/include/DWidget/DUndoView 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DUndoView 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DVerticalLine dtkwidget-5.6.12/include/DWidget/DVerticalLine --- dtkwidget-5.5.48/include/DWidget/DVerticalLine 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DVerticalLine 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dframe.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DVerticalSlider dtkwidget-5.6.12/include/DWidget/DVerticalSlider --- dtkwidget-5.5.48/include/DWidget/DVerticalSlider 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DVerticalSlider 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DWarningButton dtkwidget-5.6.12/include/DWidget/DWarningButton --- dtkwidget-5.5.48/include/DWidget/DWarningButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWarningButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dwarningbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DWaterMarkHelper dtkwidget-5.6.12/include/DWidget/DWaterMarkHelper --- dtkwidget-5.5.48/include/DWidget/DWaterMarkHelper 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWaterMarkHelper 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dwatermarkhelper.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DWaterProgress dtkwidget-5.6.12/include/DWidget/DWaterProgress --- dtkwidget-5.5.48/include/DWidget/DWaterProgress 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWaterProgress 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dwaterprogress.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DWebView dtkwidget-5.6.12/include/DWidget/DWebView --- dtkwidget-5.5.48/include/DWidget/DWebView 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWebView 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DWhatsThis dtkwidget-5.6.12/include/DWidget/DWhatsThis --- dtkwidget-5.5.48/include/DWidget/DWhatsThis 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWhatsThis 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#inlcude diff -Nru dtkwidget-5.5.48/include/DWidget/DWidget dtkwidget-5.6.12/include/DWidget/DWidget --- dtkwidget-5.5.48/include/DWidget/DWidget 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWidget 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DWidgetUtil dtkwidget-5.6.12/include/DWidget/DWidgetUtil --- dtkwidget-5.5.48/include/DWidget/DWidgetUtil 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWidgetUtil 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,3 @@ +// dwidgetutil -*- C++ -*- + +#include "dwidgetutil.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DWindowCloseButton dtkwidget-5.6.12/include/DWidget/DWindowCloseButton --- dtkwidget-5.5.48/include/DWidget/DWindowCloseButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWindowCloseButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dwindowclosebutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DWindowMaxButton dtkwidget-5.6.12/include/DWidget/DWindowMaxButton --- dtkwidget-5.5.48/include/DWidget/DWindowMaxButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWindowMaxButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dwindowmaxbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DWindowMinButton dtkwidget-5.6.12/include/DWidget/DWindowMinButton --- dtkwidget-5.5.48/include/DWidget/DWindowMinButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWindowMinButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dwindowminbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DWindowOptionButton dtkwidget-5.6.12/include/DWidget/DWindowOptionButton --- dtkwidget-5.5.48/include/DWidget/DWindowOptionButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWindowOptionButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dwindowoptionbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DWindowQuitFullButton dtkwidget-5.6.12/include/DWidget/DWindowQuitFullButton --- dtkwidget-5.5.48/include/DWidget/DWindowQuitFullButton 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWindowQuitFullButton 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +#include "dwindowquitfullbutton.h" diff -Nru dtkwidget-5.5.48/include/DWidget/DWizard dtkwidget-5.6.12/include/DWidget/DWizard --- dtkwidget-5.5.48/include/DWidget/DWizard 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWizard 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +#include "dwidgetstype.h" +#include diff -Nru dtkwidget-5.5.48/include/DWidget/DWizardPage dtkwidget-5.6.12/include/DWidget/DWizardPage --- dtkwidget-5.5.48/include/DWidget/DWizardPage 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/DWidget/DWizardPage 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later +#include "dwidgetstype.h" +#inlcude diff -Nru dtkwidget-5.5.48/include/global/dtkwidget_global.h dtkwidget-5.6.12/include/global/dtkwidget_global.h --- dtkwidget-5.5.48/include/global/dtkwidget_global.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/global/dtkwidget_global.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,79 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#pragma once + +#include +#include + +#include + +#define DWIDGET_NAMESPACE Widget +#define DTK_WIDGET_NAMESPACE DTK_NAMESPACE::Widget + +#define DWIDGET_BEGIN_NAMESPACE namespace DTK_NAMESPACE { namespace DWIDGET_NAMESPACE { +#define DWIDGET_END_NAMESPACE }} +#define DWIDGET_USE_NAMESPACE using namespace DTK_WIDGET_NAMESPACE; + +#if defined(DTK_STATIC_LIB) +void inline dtk_windget_init_resource() +{ + Q_INIT_RESOURCE(icons); + Q_INIT_RESOURCE(dui_theme_dark); + Q_INIT_RESOURCE(dui_theme_light); + // TODO: use marco create by dtk_build +#if defined(DTK_STATIC_TRANSLATION) + Q_INIT_RESOURCE(dtkwidget_translations); +#endif +} +#endif + +namespace Dtk +{ +namespace Widget +{ + +#if defined(DTK_STATIC_LIB) +#define DWIDGET_INIT_RESOURCE() \ + do { \ + dtk_windget_init_resource(); \ + } while (0) +#endif + +} +} + +#if defined(DTK_STATIC_LIB) +# define LIBDTKWIDGETSHARED_EXPORT +#else +#if defined(LIBDTKWIDGET_LIBRARY) +# define LIBDTKWIDGETSHARED_EXPORT Q_DECL_EXPORT +#else +# define LIBDTKWIDGETSHARED_EXPORT Q_DECL_IMPORT +#endif +#endif + +#define DTKWIDGET_DECL_DEPRECATED D_DECL_DEPRECATED + +#define D_THEME_INIT_WIDGET(className, ...) do{\ + DThemeManager * manager = DThemeManager::instance(); \ + {const QString &sheet = this->styleSheet() + manager->getQssForWidget(#className, this); \ + if (!sheet.isEmpty()) this->setStyleSheet(sheet); \ + } \ + connect(manager, &DThemeManager::themeChanged, this, [this, manager] (QString) { \ + const QString &sheet = manager->getQssForWidget(#className, this); \ + if (!sheet.isEmpty()) this->setStyleSheet(sheet); \ + });\ + connect(manager, &DThemeManager::widgetThemeChanged, this, [this, manager] (QWidget *w, QString) { \ + if (w == this) this->setStyleSheet(manager->getQssForWidget(#className, this)); \ + }); \ + QStringList list = QString(#__VA_ARGS__).replace(" ", "").split(",");\ + const QMetaObject *self = metaObject();\ + Q_FOREACH (const QString &str, list) {\ + if(str.isEmpty())\ + continue;\ + connect(this, self->property(self->indexOfProperty(str.toLatin1().data())).notifySignal(),\ + manager, manager->metaObject()->method(manager->metaObject()->indexOfMethod("updateQss()")));\ + } \ + } while (0); diff -Nru dtkwidget-5.5.48/include/util/daccessibilitychecker.h dtkwidget-5.6.12/include/util/daccessibilitychecker.h --- dtkwidget-5.5.48/include/util/daccessibilitychecker.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/util/daccessibilitychecker.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,48 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DACCESSIBILITYCHECKER_H +#define DACCESSIBILITYCHECKER_H + +#include "dtkwidget_global.h" + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DAccessibilityCheckerPrivate; +class LIBDTKWIDGETSHARED_EXPORT DAccessibilityChecker : public QObject, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DAccessibilityChecker) + Q_PROPERTY(OutputFormat outputFormat READ outputFormat WRITE setOutputFormat) + +public: + enum OutputFormat { + AssertFormat, + FullFormat + }; + + enum Role { + Widget, + ViewItem + }; + + explicit DAccessibilityChecker(QObject *parent = nullptr); + + void setOutputFormat(OutputFormat format); + OutputFormat outputFormat() const; + + bool check(); + void start(int msec = 3000); + +protected: + virtual bool isIgnore(Role role, const QWidget *w); + +private: + D_PRIVATE_SLOT(void _q_checkTimeout()) +}; + +DWIDGET_END_NAMESPACE +#endif // DACCESSIBILITYCHECKER_H diff -Nru dtkwidget-5.5.48/include/util/dapplicationsettings.h dtkwidget-5.6.12/include/util/dapplicationsettings.h --- dtkwidget-5.5.48/include/util/dapplicationsettings.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/util/dapplicationsettings.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,30 @@ +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DAPPLICATIONSETTINGS_H +#define DAPPLICATIONSETTINGS_H + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DApplicationSettingsPrivate; +class DApplicationSettings : public QObject, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DApplicationSettings) + +public: + Q_DECL_DEPRECATED_X("The feature has been moved to DGuiApplicationHelper, We can disable it by setting DGuiApplicationHelper::DontSaveApplicationTheme enum with setAttribute.") + explicit DApplicationSettings(QObject *parent = nullptr); + +private: + D_PRIVATE_SLOT(void _q_onChanged(const QString &)) + D_PRIVATE_SLOT(void _q_onPaletteTypeChanged()) +}; + +DWIDGET_END_NAMESPACE + +#endif // DAPPLICATIONSETTINGS_H diff -Nru dtkwidget-5.5.48/include/util/ddesktopservices.h dtkwidget-5.6.12/include/util/ddesktopservices.h --- dtkwidget-5.5.48/include/util/ddesktopservices.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/util/ddesktopservices.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,75 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DDESKTOPSERVICES_H +#define DDESKTOPSERVICES_H + +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DDesktopServices +{ +public: + +#ifdef Q_OS_LINUX + enum SystemSoundEffect { + SSE_Notifications, + SEE_Screenshot, + SSE_EmptyTrash, + SSE_SendFileComplete, + SSE_BootUp, + SSE_Shutdown, + SSE_Logout, + SSE_WakeUp, + SSE_VolumeChange, + SSE_LowBattery, + SSE_PlugIn, + SSE_PlugOut, + SSE_DeviceAdded, + SSE_DeviceRemoved, + SSE_Error, + }; +#endif + + static bool showFolder(QString localFilePath, const QString &startupId = QString()); + static bool showFolders(const QList localFilePaths, const QString &startupId = QString()); + static bool showFolder(QUrl url, const QString &startupId = QString()); + static bool showFolders(const QList urls, const QString &startupId = QString()); + + static bool showFileItemPropertie(QString localFilePath, const QString &startupId = QString()); + static bool showFileItemProperties(const QList localFilePaths, const QString &startupId = QString()); + static bool showFileItemPropertie(QUrl url, const QString &startupId = QString()); + static bool showFileItemProperties(const QList urls, const QString &startupId = QString()); + + static bool showFileItem(QString localFilePath, const QString &startupId = QString()); + static bool showFileItems(const QList localFilePaths, const QString &startupId = QString()); + static bool showFileItem(QUrl url, const QString &startupId = QString()); + static bool showFileItems(const QList urls, const QString &startupId = QString()); + + static bool trash(QString localFilePath); + static bool trash(const QList localFilePaths); + static bool trash(QUrl urlstartupId); + static bool trash(const QList urls); + +#ifdef Q_OS_LINUX + static bool playSystemSoundEffect(const SystemSoundEffect &effect); + static bool playSystemSoundEffect(const QString &name); + static bool previewSystemSoundEffect(const SystemSoundEffect &effect); + static bool previewSystemSoundEffect(const QString &name); + static QString getNameByEffectType(const SystemSoundEffect &effect); +#endif + + static QString errorMessage(); +}; + +DWIDGET_END_NAMESPACE + +#ifdef Q_OS_LINUX +Q_DECLARE_METATYPE(DTK_WIDGET_NAMESPACE::DDesktopServices::SystemSoundEffect) +#endif + +#endif // DDESKTOPSERVICES_H diff -Nru dtkwidget-5.5.48/include/util/dfileiconprovider.h dtkwidget-5.6.12/include/util/dfileiconprovider.h --- dtkwidget-5.5.48/include/util/dfileiconprovider.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/util/dfileiconprovider.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DFILEICONPROVIDER_H +#define DFILEICONPROVIDER_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DFileIconProviderPrivate; +class DFileIconProvider : public QFileIconProvider, public DTK_CORE_NAMESPACE::DObject +{ +public: + DFileIconProvider(); + virtual ~DFileIconProvider() Q_DECL_OVERRIDE; + + static DFileIconProvider *globalProvider(); + + QIcon icon(const QFileInfo &info) const Q_DECL_OVERRIDE; + QIcon icon(const QFileInfo &info, const QIcon &feedback) const; + +private: + D_DECLARE_PRIVATE(DFileIconProvider) + Q_DISABLE_COPY(DFileIconProvider) +}; + +DWIDGET_END_NAMESPACE + +#endif // DFILEICONPROVIDER_H diff -Nru dtkwidget-5.5.48/include/util/dhidpihelper.h dtkwidget-5.6.12/include/util/dhidpihelper.h --- dtkwidget-5.5.48/include/util/dhidpihelper.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/util/dhidpihelper.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DHIDPIHELPER_H +#define DHIDPIHELPER_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DHiDPIHelper +{ +public: + static QPixmap loadNxPixmap(const QString &fileName); +}; + +DWIDGET_END_NAMESPACE + +#endif // DHIDPIHELPER_H diff -Nru dtkwidget-5.5.48/include/util/dregionmonitor.h dtkwidget-5.6.12/include/util/dregionmonitor.h --- dtkwidget-5.5.48/include/util/dregionmonitor.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/util/dregionmonitor.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,64 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DREGIONMONITOR_H_DWIDGET +#define DREGIONMONITOR_H_DWIDGET + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DRegionMonitorPrivate; +class D_DECL_DEPRECATED_X("Use libdtkgui") DRegionMonitor : public QObject + , public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DRegionMonitor) + Q_DISABLE_COPY(DRegionMonitor) + Q_PROPERTY(CoordinateType coordinateType READ coordinateType WRITE setCoordinateType NOTIFY coordinateTypeChanged) + +public: + explicit DRegionMonitor(QObject *parent = nullptr); + + enum WatchedFlags { + Button_Left = 1, + Button_Right = 3, + }; + + enum CoordinateType { + ScaleRatio, + Original + }; + Q_ENUM(CoordinateType) + + bool registered() const; + QRegion watchedRegion() const; + CoordinateType coordinateType() const; + +Q_SIGNALS: + void buttonPress(const QPoint &p, const int flag) const; + void buttonRelease(const QPoint &p, const int flag) const; + void cursorMove(const QPoint &p) const; + void keyPress(const QString &keyname) const; + void keyRelease(const QString &keyname) const; + void coordinateTypeChanged(CoordinateType type) const; + +public Q_SLOTS: + void registerRegion(); + inline void registerRegion(const QRegion ®ion) + { + setWatchedRegion(region); + registerRegion(); + } + void unregisterRegion(); + void setWatchedRegion(const QRegion ®ion); + void setCoordinateType(CoordinateType type); +}; + +DWIDGET_END_NAMESPACE + +#endif // DREGIONMONITOR_H_DWIDGET diff -Nru dtkwidget-5.5.48/include/util/dsizemode.h dtkwidget-5.6.12/include/util/dsizemode.h --- dtkwidget-5.5.48/include/util/dsizemode.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/util/dsizemode.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSIZEMODE_H +#define DSIZEMODE_H + +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DSizeModeHelper +{ +public: + template + static inline T element(const T &t1, const T &t2) + { + return DGUI_NAMESPACE::DGuiApplicationHelper::isCompactMode() ? t1 : t2; + } +}; + +DWIDGET_END_NAMESPACE +#endif // DSIZEMODE_H diff -Nru dtkwidget-5.5.48/include/util/dthumbnailprovider.h dtkwidget-5.6.12/include/util/dthumbnailprovider.h --- dtkwidget-5.5.48/include/util/dthumbnailprovider.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/util/dthumbnailprovider.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,71 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DTKWIDGET_DFILETHUMBNAILPROVIDER_H +#define DTKWIDGET_DFILETHUMBNAILPROVIDER_H + +#include +#include + +#include +#include + +#include + +QT_BEGIN_NAMESPACE +class QMimeType; +QT_END_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE + +class DThumbnailProviderPrivate; +class D_DECL_DEPRECATED_X("Use libdtkgui") DThumbnailProvider : public QThread, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + +public: + enum Size { + Small = 64, + Normal = 128, + Large = 256, + }; + + static DThumbnailProvider *instance(); + + bool hasThumbnail(const QFileInfo &info) const; + bool hasThumbnail(const QMimeType &mimeType) const; + + QString thumbnailFilePath(const QFileInfo &info, Size size) const; + + QString createThumbnail(const QFileInfo &info, Size size); + typedef std::function CallBack; + void appendToProduceQueue(const QFileInfo &info, Size size, CallBack callback = 0); + void removeInProduceQueue(const QFileInfo &info, Size size); + + QString errorString() const; + + qint64 defaultSizeLimit() const; + void setDefaultSizeLimit(qint64 size); + + qint64 sizeLimit(const QMimeType &mimeType) const; + void setSizeLimit(const QMimeType &mimeType, qint64 size); + +Q_SIGNALS: + void thumbnailChanged(const QString &sourceFilePath, const QString &thumbnailPath) const; + void createThumbnailFinished(const QString &sourceFilePath, const QString &thumbnailPath) const; + void createThumbnailFailed(const QString &sourceFilePath) const; + +protected: + explicit DThumbnailProvider(QObject *parent = 0); + ~DThumbnailProvider(); + + void run() Q_DECL_OVERRIDE; + +private: + D_DECLARE_PRIVATE(DThumbnailProvider) +}; + +DWIDGET_END_NAMESPACE + +#endif // DTKWIDGET_DFILETHUMBNAILPROVIDER_H diff -Nru dtkwidget-5.5.48/include/util/dtrashmanager.h dtkwidget-5.6.12/include/util/dtrashmanager.h --- dtkwidget-5.5.48/include/util/dtrashmanager.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/util/dtrashmanager.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DTKWIDGET_DTRASHMANAGER_H +#define DTKWIDGET_DTRASHMANAGER_H + +#include + +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DTrashManagerPrivate; +class D_DECL_DEPRECATED_X("Use libdtkcore") DTrashManager : public QObject, public DTK_CORE_NAMESPACE::DObject +{ +public: + static DTrashManager *instance(); + + bool trashIsEmpty() const; + bool cleanTrash(); + bool moveToTrash(const QString &filePath, bool followSymlink = false); + +protected: + DTrashManager(); + +private: + D_DECLARE_PRIVATE(DTrashManager) +}; + +DWIDGET_END_NAMESPACE + +#endif // DTKWIDGET_DTRASHMANAGER_H diff -Nru dtkwidget-5.5.48/include/util/dwidgetutil.h dtkwidget-5.6.12/include/util/dwidgetutil.h --- dtkwidget-5.5.48/include/util/dwidgetutil.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/util/dwidgetutil.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,37 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DUTILITY_H +#define DUTILITY_H + +#include + +#include +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +QImage dropShadow(const QPixmap &px, qreal radius, const QColor &color = Qt::black); + +QStringList wordWrapText(const QString &text, int width, + QTextOption::WrapMode wrapMode, + int *lineCount = 0); + +QStringList elideText(const QString &text, const QSize &size, + const QFontMetrics &fontMetrics, + QTextOption::WrapMode wordWrap, + Qt::TextElideMode mode, + int flags = 0); + +QIcon getCircleIcon(const QPixmap &pixmap, int diameter = 36); +QIcon getCircleIcon(const QIcon &icon, int diameter = 36); + +void grayScale(const QImage &image, QImage &dest, const QRect &rect = QRect()); +void moveToCenter(QWidget *w); + +DWIDGET_END_NAMESPACE + +#endif // DUTILITY_H diff -Nru dtkwidget-5.5.48/include/widgets/daboutdialog.h dtkwidget-5.6.12/include/widgets/daboutdialog.h --- dtkwidget-5.5.48/include/widgets/daboutdialog.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/daboutdialog.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,72 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DABOUTDIALOG_H +#define DABOUTDIALOG_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DAboutDialogPrivate; +class DAboutDialog : public DDialog +{ + Q_OBJECT + + Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle) + Q_PROPERTY(QString productName READ productName WRITE setProductName) + Q_PROPERTY(QString version READ version WRITE setVersion) + Q_PROPERTY(QString description READ description WRITE setDescription) + Q_PROPERTY(QString license READ license WRITE setLicense) + Q_PROPERTY(QString websiteName READ websiteName WRITE setWebsiteName) + Q_PROPERTY(QString websiteLink READ websiteLink WRITE setWebsiteLink) + Q_PROPERTY(QString acknowledgementLink READ acknowledgementLink WRITE setAcknowledgementLink) + +public: + DAboutDialog(QWidget *parent = 0); + + QString windowTitle() const; + QString productName() const; + QString version() const; + QString description() const; + const QPixmap *companyLogo() const; + QString websiteName() const; + QString websiteLink() const; + D_DECL_DEPRECATED_X("acknowledgement is no longer used") QString acknowledgementLink() const; + QString license() const; + void setLicenseEnabled(bool enabled); + +Q_SIGNALS: + void featureActivated(); + void licenseActivated(); + +public Q_SLOTS: + void setWindowTitle(const QString &windowTitle); + void setProductIcon(const QIcon &icon); + void setProductName(const QString &productName); + void setVersion(const QString &version); + void setDescription(const QString &description); + void setCompanyLogo(const QPixmap &companyLogo); + void setWebsiteName(const QString &websiteName); + void setWebsiteLink(const QString &websiteLink); + D_DECL_DEPRECATED_X("acknowledgement is no longer used") void setAcknowledgementLink(const QString &acknowledgementLink); + void setAcknowledgementVisible(bool visible); + void setLicense(const QString &license); + +protected: + void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; + void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; + +private: + Q_PRIVATE_SLOT(d_func(), void _q_onLinkActivated(const QString &link)) + Q_PRIVATE_SLOT(d_func(), void _q_onFeatureActivated(const QString &link)) + Q_PRIVATE_SLOT(d_func(), void _q_onLicenseActivated(const QString &link)) + + Q_DISABLE_COPY(DAboutDialog) + D_DECLARE_PRIVATE(DAboutDialog) +}; + +DWIDGET_END_NAMESPACE + +#endif // DABOUTDIALOG_H diff -Nru dtkwidget-5.5.48/include/widgets/dabstractdialog.h dtkwidget-5.6.12/include/widgets/dabstractdialog.h --- dtkwidget-5.5.48/include/widgets/dabstractdialog.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dabstractdialog.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,86 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DABSTRACTDIALOG_H +#define DABSTRACTDIALOG_H + +#include +#include + +#include + +#include + +class QMouseEvent; +class QPushButton; +class QResizeEvent; + +DWIDGET_BEGIN_NAMESPACE + +class DAbstractDialogPrivate; +class LIBDTKWIDGETSHARED_EXPORT DAbstractDialog : public QDialog, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(DisplayPosition displayPosition READ displayPosition WRITE setDisplayPosition) + +public: + enum DisplayPosition { + Center,/*!<@~english display this dialog in the center of the screen */ + TopRight/*!<@~english display this dialog in the top right of the screen */ + }; + enum DisplayPostion { // This is wrong, but keep it for compatibility + DisplayCenter = Center, + DisplayTopRight = TopRight + }; + + Q_ENUMS(DisplayPosition) + Q_ENUMS(DisplayPostion) + + DAbstractDialog(QWidget *parent = nullptr); + DAbstractDialog(bool blurIfPossible, QWidget *parent = nullptr); + + DisplayPosition displayPosition() const; + + void move(const QPoint &pos); + inline void move(int x, int y) + { move(QPoint(x, y));} + + void setGeometry(const QRect &rect); + inline void setGeometry(int x, int y, int width, int height) + { setGeometry(QRect(x, y, width, height));} + +public Q_SLOTS: + void moveToCenter(); + void moveToTopRight(); + void moveToCenterByRect(const QRect &rect); + void moveToTopRightByRect(const QRect &rect); + + void setDisplayPosition(DisplayPosition displayPosition); + +Q_SIGNALS: + /** + @~english + * \brief sizeChanged is emitted when the size of this dialog changed. + * \a size is the target size. + */ + void sizeChanged(QSize size); + +protected: + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void showEvent(QShowEvent *event) override; + +protected: + DAbstractDialog(DAbstractDialogPrivate &dd, QWidget *parent = nullptr); + +private: + D_DECLARE_PRIVATE(DAbstractDialog) +}; + +DWIDGET_END_NAMESPACE + +#endif // DABSTRACTDIALOG_H diff -Nru dtkwidget-5.5.48/include/widgets/dalertcontrol.h dtkwidget-5.6.12/include/widgets/dalertcontrol.h --- dtkwidget-5.5.48/include/widgets/dalertcontrol.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dalertcontrol.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,49 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DALERTCONTROL_H +#define DALERTCONTROL_H + +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE +class DAlertControlPrivate; +class LIBDTKWIDGETSHARED_EXPORT DAlertControl : public QObject, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_DISABLE_COPY(DAlertControl) + D_DECLARE_PRIVATE(DAlertControl) + Q_PROPERTY(bool alert READ isAlert WRITE setAlert NOTIFY alertChanged) + Q_PROPERTY(QColor alertColor READ alertColor WRITE setAlertColor) + +public: + explicit DAlertControl(QWidget *target, QObject *parent = nullptr); + ~DAlertControl() override; + + void setAlert(bool isAlert); + bool isAlert() const; + void setAlertColor(QColor c); + QColor alertColor() const; + QColor defaultAlertColor() const; + void setMessageAlignment(Qt::Alignment alignment); + Qt::Alignment messageAlignment() const; + void showAlertMessage(const QString &text, int duration = 3000); + void showAlertMessage(const QString &text, QWidget *follower, int duration = 3000); + void hideAlertMessage(); + +Q_SIGNALS: + void alertChanged(bool alert) const; + +protected: + DAlertControl(DAlertControlPrivate &d, QObject *parent); + bool eventFilter(QObject *watched, QEvent *event) override; + +}; + +DWIDGET_END_NAMESPACE +#endif // DALERTCONTROL_H diff -Nru dtkwidget-5.5.48/include/widgets/danchors.h dtkwidget-5.6.12/include/widgets/danchors.h --- dtkwidget-5.5.48/include/widgets/danchors.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/danchors.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,246 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DANCHORS_H +#define DANCHORS_H + + +#include +#include +#include +#include +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DAnchorsBase; +struct DAnchorInfo { + DAnchorInfo(DAnchorsBase *b, const Qt::AnchorPoint &t): + base(b), + type(t) + { + } + + DAnchorsBase *base; + Qt::AnchorPoint type; + const DAnchorInfo *targetInfo = NULL; + + bool operator==(const DAnchorInfo *info) const + { + return info == targetInfo; + } + + bool operator==(const DAnchorInfo &info) const + { + return &info == targetInfo; + } + + bool operator!=(const DAnchorInfo *info) const + { + return info != targetInfo; + } + + bool operator!=(const DAnchorInfo &info) const + { + return &info != targetInfo; + } + + const DAnchorInfo &operator=(const DAnchorInfo *info) + { + targetInfo = info; + + return *this; + } +}; + +class DAnchorsBasePrivate; +class DEnhancedWidget; +class DAnchorsBase : public QObject +{ + Q_OBJECT + + Q_PROPERTY(QWidget *target READ target CONSTANT) + Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) + Q_PROPERTY(const DAnchorsBase *anchors READ anchors) + Q_PROPERTY(const DAnchorInfo *top READ top WRITE setTop NOTIFY topChanged) + Q_PROPERTY(const DAnchorInfo *bottom READ bottom WRITE setBottom NOTIFY bottomChanged) + Q_PROPERTY(const DAnchorInfo *left READ left WRITE setLeft NOTIFY leftChanged) + Q_PROPERTY(const DAnchorInfo *right READ right WRITE setRight NOTIFY rightChanged) + Q_PROPERTY(const DAnchorInfo *horizontalCenter READ horizontalCenter WRITE setHorizontalCenter NOTIFY horizontalCenterChanged) + Q_PROPERTY(const DAnchorInfo *verticalCenter READ verticalCenter WRITE setVerticalCenter NOTIFY verticalCenterChanged) + Q_PROPERTY(QWidget *fill READ fill WRITE setFill NOTIFY fillChanged) + Q_PROPERTY(QWidget *centerIn READ centerIn WRITE setCenterIn NOTIFY centerInChanged) + Q_PROPERTY(int margins READ margins WRITE setMargins NOTIFY marginsChanged) + Q_PROPERTY(int topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged) + Q_PROPERTY(int bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged) + Q_PROPERTY(int leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged) + Q_PROPERTY(int rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged) + Q_PROPERTY(int horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged) + Q_PROPERTY(int verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged) + Q_PROPERTY(bool alignWhenCentered READ alignWhenCentered WRITE setAlignWhenCentered NOTIFY alignWhenCenteredChanged) + +public: + explicit DAnchorsBase(QWidget *w); + ~DAnchorsBase(); + + enum AnchorError { + NoError, + Conflict, + TargetInvalid, + PointInvalid, + LoopBind + }; + + QWidget *target() const; + DEnhancedWidget *enhancedWidget() const; + bool enabled() const; + const DAnchorsBase *anchors() const; + const DAnchorInfo *top() const; + const DAnchorInfo *bottom() const; + const DAnchorInfo *left() const; + const DAnchorInfo *right() const; + const DAnchorInfo *horizontalCenter() const; + const DAnchorInfo *verticalCenter() const; + QWidget *fill() const; + QWidget *centerIn() const; + int margins() const; + int topMargin() const; + int bottomMargin() const; + int leftMargin() const; + int rightMargin() const; + int horizontalCenterOffset() const; + int verticalCenterOffset() const; + int alignWhenCentered() const; + AnchorError errorCode() const; + QString errorString() const; + bool isBinding(const DAnchorInfo *info) const; + + static bool setAnchor(QWidget *w, const Qt::AnchorPoint &p, QWidget *target, const Qt::AnchorPoint &point); + static void clearAnchors(const QWidget *w); + static DAnchorsBase *getAnchorBaseByWidget(const QWidget *w); + +public Q_SLOTS: + void setEnabled(bool enabled); + bool setAnchor(const Qt::AnchorPoint &p, QWidget *target, const Qt::AnchorPoint &point); + bool setTop(const DAnchorInfo *top); + bool setBottom(const DAnchorInfo *bottom); + bool setLeft(const DAnchorInfo *left); + bool setRight(const DAnchorInfo *right); + bool setHorizontalCenter(const DAnchorInfo *horizontalCenter); + bool setVerticalCenter(const DAnchorInfo *verticalCenter); + bool setFill(QWidget *fill); + bool setCenterIn(QWidget *centerIn); + bool setFill(DAnchorsBase *fill); + bool setCenterIn(DAnchorsBase *centerIn); + void setMargins(int margins); + void setTopMargin(int topMargin); + void setBottomMargin(int bottomMargin); + void setLeftMargin(int leftMargin); + void setRightMargin(int rightMargin); + void setHorizontalCenterOffset(int horizontalCenterOffset); + void setVerticalCenterOffset(int verticalCenterOffset); + void setAlignWhenCentered(bool alignWhenCentered); + + void setTop(int arg, Qt::AnchorPoint point); + void setBottom(int arg, Qt::AnchorPoint point); + void setLeft(int arg, Qt::AnchorPoint point); + void setRight(int arg, Qt::AnchorPoint point); + void setHorizontalCenter(int arg, Qt::AnchorPoint point); + void setVerticalCenter(int arg, Qt::AnchorPoint point); + + void moveTop(int arg); + void moveBottom(int arg); + void moveLeft(int arg); + void moveRight(int arg); + void moveHorizontalCenter(int arg); + void moveVerticalCenter(int arg); + void moveCenter(const QPoint &arg); + +private Q_SLOTS: + void updateVertical(); + void updateHorizontal(); + void updateFill(); + void updateCenterIn(); + +Q_SIGNALS: + void enabledChanged(bool enabled); + void topChanged(const DAnchorInfo *top); + void bottomChanged(const DAnchorInfo *bottom); + void leftChanged(const DAnchorInfo *left); + void rightChanged(const DAnchorInfo *right); + void horizontalCenterChanged(const DAnchorInfo *horizontalCenter); + void verticalCenterChanged(const DAnchorInfo *verticalCenter); + void fillChanged(QWidget *fill); + void centerInChanged(QWidget *centerIn); + void marginsChanged(int margins); + void topMarginChanged(int topMargin); + void bottomMarginChanged(int bottomMargin); + void leftMarginChanged(int leftMargin); + void rightMarginChanged(int rightMargin); + void horizontalCenterOffsetChanged(int horizontalCenterOffset); + void verticalCenterOffsetChanged(int verticalCenterOffset); + void alignWhenCenteredChanged(bool alignWhenCentered); + +protected: + void init(QWidget *w); + +private: + DAnchorsBase(QWidget *w, bool); + + QExplicitlySharedDataPointer d_ptr; + + Q_DECLARE_PRIVATE(DAnchorsBase) +}; + +template +class DAnchors : public DAnchorsBase +{ +public: + inline DAnchors(): DAnchorsBase((QWidget*)NULL), m_widget(NULL) {} + inline DAnchors(T *w): DAnchorsBase(w), m_widget(w) {} + inline DAnchors(const DAnchors &me): DAnchorsBase(me.m_widget), m_widget(me.m_widget) {} + + inline T &operator=(const DAnchors &me) + { + m_widget = me.m_widget; + init(m_widget); + return *m_widget; + } + inline T &operator=(T *w) + { + m_widget = w; + init(w); + return *m_widget; + } + inline T *widget() const + { + return m_widget; + } + inline T *operator ->() const + { + return m_widget; + } + inline T &operator *() const + { + return *m_widget; + } + inline operator T *() const + { + return m_widget; + } + inline operator T &() const + { + return *m_widget; + } + +private: + T *m_widget; +}; + +DWIDGET_END_NAMESPACE + +#endif // DANCHORS_H diff -Nru dtkwidget-5.5.48/include/widgets/dapplication.h dtkwidget-5.6.12/include/widgets/dapplication.h --- dtkwidget-5.5.48/include/widgets/dapplication.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dapplication.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,206 @@ +// SPDX-FileCopyrightText: 2015 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DAPPLICATION_H +#define DAPPLICATION_H + +#include +#include +#include + +#include + +DGUI_USE_NAMESPACE +DWIDGET_BEGIN_NAMESPACE + +#define DAPPLICATION_XSTRING(s) DAPPLICATION_STRING(s) +#define DAPPLICATION_STRING(s) #s + +class DApplication; +class DApplicationPrivate; +class DAboutDialog; +class DFeatureDisplayDialog; +class DLicenseDialog; +class DAppHandler; + +#if defined(qApp) +#undef qApp +#endif +#define qApp (static_cast(QCoreApplication::instance())) + +class LIBDTKWIDGETSHARED_EXPORT DApplication : public QApplication, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DApplication) + Q_PROPERTY(bool visibleMenuShortcutText READ visibleMenuShortcutText WRITE setVisibleMenuShortcutText) + Q_PROPERTY(bool visibleMenuCheckboxWidget READ visibleMenuCheckboxWidget WRITE setVisibleMenuCheckboxWidget) + Q_PROPERTY(bool visibleMenuIcon READ visibleMenuIcon WRITE setVisibleMenuIcon) + Q_PROPERTY(bool autoActivateWindows READ autoActivateWindows WRITE setAutoActivateWindows) + +public: + static DApplication *globalApplication(int &argc, char **argv); + + DApplication(int &argc, char **argv); + + enum SingleScope { + UserScope, + SystemScope + }; + + D_DECL_DEPRECATED QString theme() const; + D_DECL_DEPRECATED void setTheme(const QString &theme); + +#ifdef Q_OS_UNIX + void setOOMScoreAdj(const int score); +#endif + + bool setSingleInstance(const QString &key); + bool setSingleInstance(const QString &key, SingleScope singleScope); + + bool loadTranslator(QList localeFallback = QList() << QLocale::system()); + + //! warning: Must call before QGuiApplication defined object + D_DECL_DEPRECATED static bool loadDXcbPlugin(); + static bool isDXcbPlatform(); + + // return the libdtkwidget version of build application + static int buildDtkVersion(); + // return the libdtkwidget version of runing application + static int runtimeDtkVersion(); + + // let startdde know that we've already started. + static void registerDDESession(); + + static void customQtThemeConfigPathByUserHome(const QString &home); + static void customQtThemeConfigPath(const QString &path); + static QString customizedQtThemeConfigPath(); + + // meta information that necessary to create a about dialog for the application. + QString productName() const; + void setProductName(const QString &productName); + + const QIcon &productIcon() const; + void setProductIcon(const QIcon &productIcon); + + QString applicationLicense() const; + void setApplicationLicense(const QString &license); + + QString applicationDescription() const; + void setApplicationDescription(const QString &description); + + QString applicationHomePage() const; + void setApplicationHomePage(const QString &link); + + QString applicationAcknowledgementPage() const; + void setApplicationAcknowledgementPage(const QString &link); + + bool applicationAcknowledgementVisible() const; + void setApplicationAcknowledgementVisible(bool visible); + + DAboutDialog *aboutDialog(); + void setAboutDialog(DAboutDialog *aboutDialog); + + DFeatureDisplayDialog *featureDisplayDialog(); + void setFeatureDisplayDialog(DFeatureDisplayDialog *featureDisplayDialog); + + bool visibleMenuShortcutText() const; + void setVisibleMenuShortcutText(bool value); + + bool visibleMenuCheckboxWidget() const; + void setVisibleMenuCheckboxWidget(bool value); + + bool visibleMenuIcon() const; + void setVisibleMenuIcon(bool value); + + bool autoActivateWindows() const; + void setAutoActivateWindows(bool autoActivateWindows); + + // 使窗口内的输入框自动适应虚拟键盘 + void acclimatizeVirtualKeyboard(QWidget *window); + void ignoreVirtualKeyboard(QWidget *window); + bool isAcclimatizedVirtualKeyboard(QWidget *window) const; + + QString applicationCreditsFile() const; + void setApplicationCreditsFile(const QString &file); + + QByteArray applicationCreditsContent() const; + void setApplicationCreditsContent(const QByteArray &content); + + QString licensePath() const; + void setLicensePath(const QString &path); + +#ifdef VERSION + static inline QString buildVersion(const QString &fallbackVersion) + { + QString autoVersion = DAPPLICATION_XSTRING(VERSION); + if (autoVersion.isEmpty()) { + autoVersion = fallbackVersion; + } + return autoVersion; + } +#else + static inline QString buildVersion(const QString &fallbackVersion) + { + return fallbackVersion; + } +#endif + +Q_SIGNALS: + void newInstanceStarted(); + + //###(zccrs): Depend the Qt platform theme plugin(from the package: dde-qt5integration) + void iconThemeChanged(); + //###(zccrs): Emit form the Qt platform theme plugin(from the package: dde-qt5integration) + void screenDevicePixelRatioChanged(QScreen *screen); + +public: + void setCustomHandler(DAppHandler *handler); + DAppHandler *customHandler(); + +protected: + virtual void handleHelpAction(); + virtual void handleAboutAction(); + virtual void handleQuitAction(); + +public: + bool notify(QObject *obj, QEvent *event) Q_DECL_OVERRIDE; + +private: + friend class DTitlebarPrivate; + friend class DMainWindowPrivate; + + D_PRIVATE_SLOT(void _q_onNewInstanceStarted()) + D_PRIVATE_SLOT(void _q_panWindowContentsForVirtualKeyboard()) + D_PRIVATE_SLOT(void _q_resizeWindowContentsForVirtualKeyboard()) + D_PRIVATE_SLOT(void _q_sizeModeChanged()) +}; + +class LIBDTKWIDGETSHARED_EXPORT DAppHandler { +public: + inline virtual ~DAppHandler() = default; + + virtual void handleHelpAction() = 0; + virtual void handleAboutAction() = 0; + virtual void handleQuitAction() = 0; +}; + +class DtkBuildVersion { +public: + static int value; +}; + +#ifndef LIBDTKWIDGET_LIBRARY +class Q_DECL_HIDDEN _DtkBuildVersion { +public: + _DtkBuildVersion() { + DtkBuildVersion::value = DTK_VERSION; + } +}; + +static _DtkBuildVersion _dtk_build_version; +#endif + +DWIDGET_END_NAMESPACE + +#endif // DAPPLICATION_H diff -Nru dtkwidget-5.5.48/include/widgets/dapplicationhelper.h dtkwidget-5.6.12/include/widgets/dapplicationhelper.h --- dtkwidget-5.5.48/include/widgets/dapplicationhelper.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dapplicationhelper.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,38 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DAPPLICATIONHELPER_H +#define DAPPLICATIONHELPER_H + +#include +#include +#include + +DGUI_USE_NAMESPACE +DWIDGET_BEGIN_NAMESPACE + +class D_DECL_DEPRECATED_X("Use DPaletteHelper") DApplicationHelper : public DGuiApplicationHelper +{ + Q_OBJECT + +public: + static DApplicationHelper *instance(); + + DPalette palette(const QWidget *widget, const QPalette &base = QPalette()) const; + void setPalette(QWidget *widget, const DPalette &palette); + void resetPalette(QWidget *widget); + +private: + DApplicationHelper(); + ~DApplicationHelper(); + + bool eventFilter(QObject *watched, QEvent *event) override; + bool event(QEvent *event) override; + + friend class _DApplicationHelper; +}; + +DWIDGET_END_NAMESPACE + +#endif // DAPPLICATIONHELPER_H diff -Nru dtkwidget-5.5.48/include/widgets/darrowbutton.h dtkwidget-5.6.12/include/widgets/darrowbutton.h --- dtkwidget-5.5.48/include/widgets/darrowbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/darrowbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,88 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DARROWBUTTON_H +#define DARROWBUTTON_H + +#include +#include +#include +#include +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class ArrowButtonIcon : public QLabel +{ + Q_OBJECT + Q_PROPERTY(int arrowButtonDirection READ arrowDirection) + Q_PROPERTY(int arrowButtonState READ buttonState) +public: + explicit ArrowButtonIcon(QWidget *parent = 0); + void setArrowDirection(int direction); + void setButtonState(int state); + int arrowDirection() const; + int buttonState() const; + +private: + int m_direction; + int m_buttonState; +}; + +class LIBDTKWIDGETSHARED_EXPORT DArrowButton : public QLabel +{ + Q_OBJECT +public: + enum ArrowDirection { + ArrowUp, + ArrowDown, + ArrowLeft, + ArrowRight + }; + + enum ArrowButtonState { + ArrowStateNormal, + ArrowStateHover, + ArrowStatePress + }; + + explicit DArrowButton(QWidget *parent = 0); + void setArrowDirection(ArrowDirection direction); + int arrowDirection() const; + int buttonState() const; + +protected: + void mousePressEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + void enterEvent(QEvent *); + void leaveEvent(QEvent *); + +Q_SIGNALS: + void mousePress(); + void mouseRelease(); + void mouseEnter(); + void mouseLeave(); + +private: + void initButtonState(); + void setButtonState(ArrowButtonState state); + void updateIconDirection(ArrowDirection direction); + void updateIconState(ArrowButtonState state); + +private: + ArrowButtonIcon *m_normalLabel = NULL; + ArrowButtonIcon *m_hoverLabel = NULL; + ArrowButtonIcon *m_pressLabel = NULL; + + ArrowDirection m_arrowDirection = ArrowDown; + ArrowButtonState m_buttonState = ArrowStateNormal; +}; + +DWIDGET_END_NAMESPACE + +#endif // DARROWBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/darrowlinedrawer.h dtkwidget-5.6.12/include/widgets/darrowlinedrawer.h --- dtkwidget-5.5.48/include/widgets/darrowlinedrawer.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/darrowlinedrawer.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DARROWLINEDRAWER_H +#define DARROWLINEDRAWER_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DBaseLine; +class DArrowLineDrawerPrivate; +class LIBDTKWIDGETSHARED_EXPORT DArrowLineDrawer : public DDrawer +{ + Q_OBJECT + D_DECLARE_PRIVATE(DArrowLineDrawer) + +public: + explicit DArrowLineDrawer(QWidget *parent = nullptr); + void setTitle(const QString &title); + void setExpand(bool value); + D_DECL_DEPRECATED DBaseLine *headerLine(); + +private: + void setHeader(QWidget *header); + void resizeEvent(QResizeEvent *e); +}; + +DWIDGET_END_NAMESPACE + +#endif // DARROWLINEDRAWER_H diff -Nru dtkwidget-5.5.48/include/widgets/darrowlineexpand.h dtkwidget-5.6.12/include/widgets/darrowlineexpand.h --- dtkwidget-5.5.48/include/widgets/darrowlineexpand.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/darrowlineexpand.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,56 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DARROWLINEEXPAND_H +#define DARROWLINEEXPAND_H + +#include + +#include +#include +#include +#include +#include +DWIDGET_BEGIN_NAMESPACE + +class D_DECL_DEPRECATED ArrowHeaderLine : public DHeaderLine +{ + Q_OBJECT +public: + ArrowHeaderLine(QWidget *parent = nullptr); + void setExpand(bool value); + +Q_SIGNALS: + void mousePress(); + +protected: + void mousePressEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + +private: + void reverseArrowDirection(); + bool m_isExpanded = false; + DIconButton *m_arrowButton = nullptr; +}; + +class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DArrowLineDrawer") DArrowLineExpand : public DBaseExpand +{ + Q_OBJECT +public: + explicit DArrowLineExpand(QWidget *parent = nullptr); + void setTitle(const QString &title); + void setExpand(bool value); + DBaseLine *headerLine(); + +private: + void setHeader(QWidget *header); + void resizeEvent(QResizeEvent *e); + +private: + ArrowHeaderLine *m_headerLine = nullptr; +}; + +DWIDGET_END_NAMESPACE + +#endif // DARROWLINEEXPAND_H diff -Nru dtkwidget-5.5.48/include/widgets/darrowrectangle.h dtkwidget-5.6.12/include/widgets/darrowrectangle.h --- dtkwidget-5.5.48/include/widgets/darrowrectangle.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/darrowrectangle.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,124 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DARROWRECTANGLE_H +#define DARROWRECTANGLE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DPlatformWindowHandle; +class DArrowRectanglePrivate; +class LIBDTKWIDGETSHARED_EXPORT DArrowRectangle : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_DISABLE_COPY(DArrowRectangle) + D_DECLARE_PRIVATE(DArrowRectangle) + +public: + + enum ArrowDirection { + ArrowLeft, + ArrowRight, + ArrowTop, + ArrowBottom + }; + + enum FloatMode { + FloatWindow, + FloatWidget, + }; + + explicit DArrowRectangle(ArrowDirection direction, QWidget *parent = nullptr); + explicit DArrowRectangle(ArrowDirection direction, FloatMode floatMode, QWidget *parent = nullptr); + ~DArrowRectangle() override; + + Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor) + Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor) + Q_PROPERTY(int borderWidth READ borderWidth WRITE setBorderWidth) + Q_PROPERTY(int radius READ radius WRITE setRadius) + Q_PROPERTY(int arrowWidth READ arrowWidth WRITE setArrowWidth) + Q_PROPERTY(int arrowHeight READ arrowHeight WRITE setArrowHeight) + Q_PROPERTY(int arrowX READ arrowX WRITE setArrowX) + Q_PROPERTY(int arrowY READ arrowY WRITE setArrowY) + Q_PROPERTY(int margin READ margin WRITE setMargin) + Q_PROPERTY(ArrowDirection arrowDirection READ arrowDirection WRITE setArrowDirection) + Q_PROPERTY(qreal shadowXOffset READ shadowXOffset WRITE setShadowXOffset) + Q_PROPERTY(qreal shadowYOffset READ shadowYOffset WRITE setShadowYOffset) + Q_PROPERTY(qreal shadowBlurRadius READ shadowBlurRadius WRITE setShadowBlurRadius) + + int radius() const; + bool radiusForceEnabled() const; + int arrowHeight() const; + int arrowWidth() const; + int arrowX() const; + int arrowY() const; + int margin() const; + int borderWidth() const; + QColor borderColor() const; + QColor backgroundColor() const; + ArrowDirection arrowDirection() const; + + void setRadius(int value); + void setRadiusForceEnable(bool enable); + void setArrowHeight(int value); + void setArrowWidth(int value); + void setArrowX(int value); + void setArrowY(int value); + void setMargin(int value); + void setBorderWidth(int borderWidth); + void setBorderColor(const QColor &borderColor); + void setBackgroundColor(const QColor &backgroundColor); + void setBackgroundColor(DBlurEffectWidget::MaskColorType type); + void setArrowDirection(ArrowDirection value); + void setWidth(int value); + void setHeight(int value); + + virtual void show(int x, int y); + + void setContent(QWidget *content); + QWidget *getContent() const; + void resizeWithContent(); + void move(int x, int y); + QSize getFixedSize(); + + qreal shadowXOffset() const; + qreal shadowYOffset() const; + qreal shadowBlurRadius() const; + + void setShadowBlurRadius(const qreal &shadowBlurRadius); + void setShadowXOffset(const qreal &shadowXOffset); + void setShadowYOffset(const qreal &shadowYOffset); + + void setLeftRightRadius(bool enable); + void setRadiusArrowStyleEnable(bool enable); + +Q_SIGNALS: + void windowDeactivate() const; + +protected: + void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) Q_DECL_OVERRIDE; +}; + +DWIDGET_END_NAMESPACE + +#endif // DARROWRECTANGLE_H + diff -Nru dtkwidget-5.5.48/include/widgets/dbackgroundgroup.h dtkwidget-5.6.12/include/widgets/dbackgroundgroup.h --- dtkwidget-5.5.48/include/widgets/dbackgroundgroup.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dbackgroundgroup.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,54 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DBACKGROUNDGROUP_H +#define DBACKGROUNDGROUP_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DBackgroundGroupPrivate; +class LIBDTKWIDGETSHARED_EXPORT DBackgroundGroup : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DBackgroundGroup) + + Q_PROPERTY(QMargins itemMargins READ itemMargins WRITE setItemMargins) + Q_PROPERTY(bool useWidgetBackground READ useWidgetBackground WRITE setUseWidgetBackground NOTIFY useWidgetBackgroundChanged) + +public: + explicit DBackgroundGroup(QLayout *layout = nullptr, QWidget *parent = nullptr); + + QMargins itemMargins() const; + bool useWidgetBackground() const; + + void setLayout(QLayout *layout); + + void setBackgroundRole(QPalette::ColorRole role); + QPalette::ColorRole backgroundRole() const; + +public Q_SLOTS: + void setItemMargins(QMargins itemMargins); + void setItemSpacing(int spacing); + void setUseWidgetBackground(bool useWidgetBackground); + +Q_SIGNALS: + void useWidgetBackgroundChanged(bool useWidgetBackground); + +protected: + void paintEvent(QPaintEvent *event) override; + bool event(QEvent *event) override; + +private: + using QWidget::setLayout; + using QWidget::setAutoFillBackground; +}; + +DWIDGET_END_NAMESPACE + +#endif // DBACKGROUNDGROUP_H diff -Nru dtkwidget-5.5.48/include/widgets/dbaseexpand.h dtkwidget-5.6.12/include/widgets/dbaseexpand.h --- dtkwidget-5.5.48/include/widgets/dbaseexpand.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dbaseexpand.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,64 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DBASEEXPAND_H +#define DBASEEXPAND_H + +#include +#include +#include +#include + +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class D_DECL_DEPRECATED ContentLoader : public QFrame +{ + Q_OBJECT + Q_PROPERTY(int height READ height WRITE setFixedHeight) +public: + explicit ContentLoader(QWidget *parent = nullptr) : QFrame(parent){} +}; + +class DBoxWidget; + +class DBaseExpandPrivate; +class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DDrawer") DBaseExpand : public QWidget +{ + Q_OBJECT +public: + explicit DBaseExpand(QWidget *parent = nullptr); + ~DBaseExpand() override; + + void setHeader(QWidget *header); + void setContent(QWidget *content, Qt::Alignment alignment = Qt::AlignHCenter); + QWidget *getContent() const; + void setHeaderHeight(int height); + virtual void setExpand(bool value); + bool expand() const; + void setAnimationDuration(int duration); + void setAnimationEasingCurve(QEasingCurve curve); + void setSeparatorVisible(bool arg); + void setExpandedSeparatorVisible(bool arg); + +Q_SIGNALS: + void expandChange(bool e); + void sizeChanged(QSize s); + +protected: + void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; + +private: + QScopedPointer d_private; + + Q_DECLARE_PRIVATE_D(d_private, DBaseExpand) +}; + +DWIDGET_END_NAMESPACE + +#endif // DBASEEXPAND_H diff -Nru dtkwidget-5.5.48/include/widgets/dbaseline.h dtkwidget-5.6.12/include/widgets/dbaseline.h --- dtkwidget-5.5.48/include/widgets/dbaseline.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dbaseline.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,45 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DBASELINE_H +#define DBASELINE_H + +#include +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DBaseLine : public QLabel +{ + Q_OBJECT +public: + explicit DBaseLine(QWidget *parent = 0); + + void setLeftContent(QWidget *content); + void setRightContent(QWidget *content); + + QBoxLayout *leftLayout(); + QBoxLayout *rightLayout(); + + void setLeftMargin(int margin); + void setRightMargin(int margin); + int leftMargin() const; + int rightMargin() const; + +private: + QHBoxLayout *m_mainLayout = NULL; + QHBoxLayout *m_leftLayout= NULL; + QHBoxLayout *m_rightLayout = NULL; + + int m_leftMargin = 10; + int m_rightMargin = HEADER_RIGHT_MARGIN; +}; + +DWIDGET_END_NAMESPACE + +#endif // DBASELINE_H diff -Nru dtkwidget-5.5.48/include/widgets/dblureffectwidget.h dtkwidget-5.6.12/include/widgets/dblureffectwidget.h --- dtkwidget-5.5.48/include/widgets/dblureffectwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dblureffectwidget.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,140 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DBLUREFFECTWIDGET_H +#define DBLUREFFECTWIDGET_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DBlurEffectWidgetPrivate; +class LIBDTKWIDGETSHARED_EXPORT DBlurEffectWidget : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + // The "radius" property is only support for InWindowBlend. See property "blendMode" + Q_PROPERTY(int radius READ radius WRITE setRadius NOTIFY radiusChanged) + Q_PROPERTY(BlurMode mode READ mode WRITE setMode NOTIFY modeChanged) + Q_PROPERTY(BlendMode blendMode READ blendMode WRITE setBlendMode NOTIFY blendModeChanged) + Q_PROPERTY(int blurRectXRadius READ blurRectXRadius WRITE setBlurRectXRadius NOTIFY blurRectXRadiusChanged) + Q_PROPERTY(int blurRectYRadius READ blurRectYRadius WRITE setBlurRectYRadius NOTIFY blurRectYRadiusChanged) + // ###(zccrs): The alpha channel of the color is fixed. + // The alpha channel is 102 if the DPlatformWindowHandle::hasBlurWindow() is true, otherwise is 204). + Q_PROPERTY(QColor maskColor READ maskColor WRITE setMaskColor NOTIFY maskColorChanged) + Q_PROPERTY(quint8 maskAlpha READ maskAlpha WRITE setMaskAlpha NOTIFY maskAlphaChanged) + Q_PROPERTY(bool full READ isFull WRITE setFull NOTIFY fullChanged) + Q_PROPERTY(bool blurEnabled READ blurEnabled WRITE setBlurEnabled NOTIFY blurEnabledChanged) + +public: + // TODO: To support MeanBlur, MedianBlur, BilateralFilter + enum BlurMode { + GaussianBlur + }; + + Q_ENUMS(BlurMode) + + enum BlendMode { + InWindowBlend, + BehindWindowBlend, + InWidgetBlend + }; + + Q_ENUMS(BlendMode) + + enum MaskColorType { + DarkColor, + LightColor, + AutoColor, + CustomColor + }; + + Q_ENUMS(MaskColorType) + + explicit DBlurEffectWidget(QWidget *parent = 0); + ~DBlurEffectWidget(); + + int radius() const; + BlurMode mode() const; + + BlendMode blendMode() const; + int blurRectXRadius() const; + int blurRectYRadius() const; + + bool isFull() const; + bool blurEnabled() const; + + QColor maskColor() const; + + quint8 maskAlpha() const; + + void setMaskPath(const QPainterPath &path); + void setSourceImage(const QImage &image, bool autoScale = true); + +public Q_SLOTS: + void setRadius(int radius); + void setMode(BlurMode mode); + + void setBlendMode(BlendMode blendMode); + void setBlurRectXRadius(int blurRectXRadius); + void setBlurRectYRadius(int blurRectYRadius); + void setMaskAlpha(quint8 alpha); + void setMaskColor(QColor maskColor); + void setMaskColor(MaskColorType type); + void setFull(bool full); + void setBlurEnabled(bool blurEnabled); + + void updateBlurSourceImage(const QRegion &ren); + +Q_SIGNALS: + void radiusChanged(int radius); + void modeChanged(BlurMode mode); + + void blendModeChanged(BlendMode blendMode); + void blurRectXRadiusChanged(int blurRectXRadius); + void blurRectYRadiusChanged(int blurRectYRadius); + void maskAlphaChanged(quint8 alpha); + void maskColorChanged(QColor maskColor); + void fullChanged(bool full); + void blurEnabledChanged(bool blurEnabled); + + void blurSourceImageDirtied(); + +protected: + DBlurEffectWidget(DBlurEffectWidgetPrivate &dd, QWidget *parent = 0); + + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void moveEvent(QMoveEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; + void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE; + void changeEvent(QEvent *event) Q_DECL_OVERRIDE; + bool eventFilter(QObject *watched, QEvent *event) override; + +private: + D_DECLARE_PRIVATE(DBlurEffectWidget) + friend class DBlurEffectGroup; +}; + +class DBlurEffectGroupPrivate; +class DBlurEffectGroup : public DTK_CORE_NAMESPACE::DObject +{ + D_DECLARE_PRIVATE(DBlurEffectGroup) +public: + explicit DBlurEffectGroup(); + ~DBlurEffectGroup(); + + void setSourceImage(QImage image, int blurRadius = 35); + void addWidget(DBlurEffectWidget *widget, const QPoint &offset = QPoint(0, 0)); + void removeWidget(DBlurEffectWidget *widget); + + void paint(QPainter *pa, DBlurEffectWidget *widget) const; +}; + +DWIDGET_END_NAMESPACE + +#endif // DBLUREFFECTWIDGET_H diff -Nru dtkwidget-5.5.48/include/widgets/dboxwidget.h dtkwidget-5.6.12/include/widgets/dboxwidget.h --- dtkwidget-5.5.48/include/widgets/dboxwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dboxwidget.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,64 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DBOXWIDGET_H +#define DBOXWIDGET_H + +#include + +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DBoxWidgetPrivate; +class DBoxWidget : public QFrame, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(QBoxLayout::Direction direction READ direction WRITE setDirection NOTIFY directionChanged) + +public: + explicit DBoxWidget(QBoxLayout::Direction direction, QWidget *parent = 0); + + QBoxLayout::Direction direction() const; + QBoxLayout *layout() const; + + void addWidget(QWidget *widget); + QSize sizeHint() const Q_DECL_OVERRIDE; + +public Q_SLOTS: + void setDirection(QBoxLayout::Direction direction); + +Q_SIGNALS: + void sizeChanged(QSize size); + void directionChanged(QBoxLayout::Direction direction); + +protected: + virtual void updateSize(const QSize &size); + bool event(QEvent *ee) Q_DECL_OVERRIDE; + +private: + D_DECLARE_PRIVATE(DBoxWidget) +}; + +class DHBoxWidget : public DBoxWidget +{ + Q_OBJECT +public: + explicit DHBoxWidget(QWidget *parent = 0); +}; + +class DVBoxWidget : public DBoxWidget +{ + Q_OBJECT +public: + explicit DVBoxWidget(QWidget *parent = 0); +}; + +DWIDGET_END_NAMESPACE + +#endif // DBOXWIDGET_H diff -Nru dtkwidget-5.5.48/include/widgets/dbuttonbox.h dtkwidget-5.6.12/include/widgets/dbuttonbox.h --- dtkwidget-5.5.48/include/widgets/dbuttonbox.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dbuttonbox.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,89 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DBUTTONBOX_H +#define DBUTTONBOX_H + +#include +#include +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DStyleOptionButtonBoxButton; +class DButtonBoxButtonPrivate; +class DButtonBoxButton : public QAbstractButton, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DButtonBoxButton) + +public: + explicit DButtonBoxButton(const QString &text, QWidget *parent = nullptr); + DButtonBoxButton(const QIcon& icon, const QString &text = QString(), QWidget *parent = nullptr); + DButtonBoxButton(QStyle::StandardPixmap iconType = static_cast(-1), + const QString &text = QString(), QWidget *parent = nullptr); + DButtonBoxButton(DStyle::StandardPixmap iconType = static_cast(-1), + const QString &text = QString(), QWidget *parent = nullptr); + DButtonBoxButton(const DDciIcon &dciIcon, const QString &text = QString(), QWidget *parent = nullptr); + + void setIcon(const QIcon &icon); + void setIcon(QStyle::StandardPixmap iconType); + void setIcon(DStyle::StandardPixmap iconType); + + void setIcon(const DDciIcon &icon); + DDciIcon dciIcon() const; + + QSize iconSize() const; + QSize sizeHint() const; + QSize minimumSizeHint() const override; + +private: + void initStyleOption(DStyleOptionButtonBoxButton *option) const; + + void paintEvent(QPaintEvent *e) override; + void keyPressEvent(QKeyEvent *event) override; + bool event(QEvent *e) override; +}; + +class DButtonBoxPrivate; +class DButtonBox : public QWidget, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DButtonBox) + +public: + explicit DButtonBox(QWidget *parent = nullptr); + + Qt::Orientation orientation() const; + void setOrientation(Qt::Orientation orientation); + + void setButtonList(const QList &list, bool checkable); + QList buttonList() const; + + QAbstractButton * checkedButton() const; + // no setter on purpose! + + QAbstractButton *button(int id) const; + void setId(QAbstractButton *button, int id); + int id(QAbstractButton *button) const; + int checkedId() const; + +Q_SIGNALS: + void buttonClicked(QAbstractButton *); + void buttonPressed(QAbstractButton *); + void buttonReleased(QAbstractButton *); + void buttonToggled(QAbstractButton *, bool); + +private: + void paintEvent(QPaintEvent *e) override; + + friend class DButtonBoxButton; +}; + +DWIDGET_END_NAMESPACE + +#endif // DBUTTONBOX_H diff -Nru dtkwidget-5.5.48/include/widgets/dcircleprogress.h dtkwidget-5.6.12/include/widgets/dcircleprogress.h --- dtkwidget-5.5.48/include/widgets/dcircleprogress.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dcircleprogress.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,67 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DCIRCLEPROGRESS_H +#define DCIRCLEPROGRESS_H + +#include +#include +#include + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DCircleProgressPrivate; +class LIBDTKWIDGETSHARED_EXPORT DCircleProgress : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor DESIGNABLE true) + Q_PROPERTY(QColor chunkColor READ chunkColor WRITE setChunkColor DESIGNABLE true) + Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth DESIGNABLE true) + +Q_SIGNALS: + void clicked(); + void mouseEntered(); + void mouseLeaved(); + +public: + explicit DCircleProgress(QWidget *parent = 0); + + int value() const; + void setValue(int value); + + const QString text() const; + void setText(const QString &text); + + const QColor backgroundColor() const; + void setBackgroundColor(const QColor &color); + + const QColor chunkColor() const; + void setChunkColor(const QColor &color); + + int lineWidth() const; + void setLineWidth(const int width); + + QLabel *topLabel(); + QLabel *bottomLabel(); + +Q_SIGNALS: + void valueChanged(const int value) const; + +protected: + void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void enterEvent(QEvent *e) Q_DECL_OVERRIDE; + void leaveEvent(QEvent *e) Q_DECL_OVERRIDE; + +private: + D_DECLARE_PRIVATE(DCircleProgress) +}; + +DWIDGET_END_NAMESPACE + +#endif // DCIRCLEPROGRESS_H diff -Nru dtkwidget-5.5.48/include/widgets/dclipeffectwidget.h dtkwidget-5.6.12/include/widgets/dclipeffectwidget.h --- dtkwidget-5.5.48/include/widgets/dclipeffectwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dclipeffectwidget.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,55 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DCLIPEFFECTWIDGET_H +#define DCLIPEFFECTWIDGET_H + +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DClipEffectWidgetPrivate; +class DClipEffectWidget : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(QMargins margins READ margins WRITE setMargins NOTIFY marginsChanged) + Q_PROPERTY(QPainterPath clipPath READ clipPath WRITE setClipPath NOTIFY clipPathChanged) + +public: + explicit DClipEffectWidget(QWidget *parent); + + QMargins margins() const; + QPainterPath clipPath() const; + +public Q_SLOTS: + void setMargins(QMargins margins); + void setClipPath(const QPainterPath &path); + +Q_SIGNALS: + void marginsChanged(QMargins margins); + void clipPathChanged(QPainterPath clipPath); + +protected: + bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; + void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE; + +private: + using QWidget::move; + using QWidget::resize; + using QWidget::setGeometry; + + D_DECLARE_PRIVATE(DClipEffectWidget) +}; + +DWIDGET_END_NAMESPACE + +#endif // DCLIPEFFECTWIDGET_H diff -Nru dtkwidget-5.5.48/include/widgets/dcoloredprogressbar.h dtkwidget-5.6.12/include/widgets/dcoloredprogressbar.h --- dtkwidget-5.5.48/include/widgets/dcoloredprogressbar.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dcoloredprogressbar.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DColoredProgressBarPrivate; +class LIBDTKWIDGETSHARED_EXPORT DColoredProgressBar : public QProgressBar, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT +public: + explicit DColoredProgressBar(QWidget *parent = nullptr); + void addThreshold(int threshold, QBrush brush); + void removeThreshold(int threshold); + QList thresholds() const; + +protected: + void paintEvent(QPaintEvent *) override; + +private: + D_DECLARE_PRIVATE(DColoredProgressBar) +}; + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/include/widgets/dcombobox.h dtkwidget-5.6.12/include/widgets/dcombobox.h --- dtkwidget-5.5.48/include/widgets/dcombobox.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dcombobox.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DCOMBOBOX_H +#define DCOMBOBOX_H + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DComboBoxPrivate; +class LIBDTKWIDGETSHARED_EXPORT DComboBox : public QComboBox, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DComboBox) + +public: + explicit DComboBox(QWidget *parent = nullptr); + +protected: + DComboBox(DComboBoxPrivate &dd, QWidget *parent); + + // QComboBox interface +public: + virtual void showPopup() override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DCOMBOBOX_H diff -Nru dtkwidget-5.5.48/include/widgets/dcommandlinkbutton.h dtkwidget-5.6.12/include/widgets/dcommandlinkbutton.h --- dtkwidget-5.5.48/include/widgets/dcommandlinkbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dcommandlinkbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,30 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DCOMMANDLINKBUTTON_H +#define DCOMMANDLINKBUTTON_H + +#include +#include + +DWIDGET_BEGIN_NAMESPACE +class DStyleOptionButton; + +class DCommandLinkButton : public QAbstractButton +{ + Q_OBJECT + +public: + explicit DCommandLinkButton(const QString text, QWidget *parent = nullptr); + + QSize sizeHint() const override; + +protected: + void initStyleOption(DStyleOptionButton *option) const; + void paintEvent(QPaintEvent *e) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DCOMMANDLINKBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dconstants.h dtkwidget-5.6.12/include/widgets/dconstants.h --- dtkwidget-5.5.48/include/widgets/dconstants.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dconstants.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DCONSTANTS_H +#define DCONSTANTS_H + +#include + +DWIDGET_BEGIN_NAMESPACE + //basis width and height + const int BUTTON_HEIGHT = 22; + const int EXPAND_HEADER_HEIGHT = 30; + const int CONTENT_HEADER_HEIGHT = 38; + const int RADIO_ITEM_HEIGHT = 30; + const int MENU_ITEM_HEIGHT = 24; + const int MENU_ITEM_LEFT_MARGIN = 24; //NOT include the tick + const int HEADER_LEFT_MARGIN = 14; + const int HEADER_RIGHT_MARGIN = 14; + const int TEXT_LEFT_MARGIN = 6; + const int TEXT_RIGHT_MARGIN = 6; + const int BUTTON_MARGIN = 8; + const int TEXT_BUTTON_MIN_WIDTH = 70; + const int IMAGE_BUTTON_WIDTH = 24; + const int FONT_SIZE = 12; + const int NORMAL_RADIUS = 3; +DWIDGET_END_NAMESPACE + +#endif //DCONSTANTS_H diff -Nru dtkwidget-5.5.48/include/widgets/dcrumbedit.h dtkwidget-5.6.12/include/widgets/dcrumbedit.h --- dtkwidget-5.5.48/include/widgets/dcrumbedit.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dcrumbedit.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,130 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DCRUMBEDIT_H +#define DCRUMBEDIT_H + +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DCrumbTextFormat : public QTextCharFormat +{ +public: + DCrumbTextFormat(); + + QColor tagColor() const; + void setTagColor(const QColor &color); + QString text() const; + void setText(const QString &text); + QColor textColor() const; + void setTextColor(const QColor &color); + QBrush background() const; + void setBackground(const QBrush &background); + int backgroundRadius() const; + void setBackgroundRadius(int radius); + +protected: + DCrumbTextFormat(int objectType); + explicit DCrumbTextFormat(const QTextFormat &fmt); + friend class CrumbObjectInterface; + friend class DCrumbEdit; + friend class DCrumbEditPrivate; +}; + +class DCrumbEditPrivate; +class LIBDTKWIDGETSHARED_EXPORT DCrumbEdit : public QTextEdit, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(bool crumbReadOnly READ crumbReadOnly WRITE setCrumbReadOnly) + Q_PROPERTY(int crumbRadius READ crumbRadius WRITE setCrumbRadius) + Q_PROPERTY(QString splitter READ splitter WRITE setSplitter) + Q_PROPERTY(bool dualClickMakeCrumb READ dualClickMakeCrumb WRITE setDualClickMakeCrumb) + +public: + enum CrumbType { + black = Qt::black, + white = Qt::white, + darkGray = Qt::darkGray, + gray = Qt::gray, + lightGray = Qt::lightGray, + red = Qt::red, + green = Qt::green, + blue = Qt::blue, + cyan = Qt::cyan, + magenta = Qt::magenta, + yellow = Qt::yellow, + darkRed = Qt::darkRed, + darkGreen = Qt::darkGreen, + darkBlue = Qt::darkBlue, + darkCyan = Qt::darkCyan, + darkMagenta = Qt::darkMagenta, + darkYellow = Qt::darkYellow + }; + + explicit DCrumbEdit(QWidget *parent = 0); + + bool insertCrumb(const DCrumbTextFormat &format, int pos = -1); + bool insertCrumb(const QString &text, int pos = -1); + bool appendCrumb(const DCrumbTextFormat &format); + bool appendCrumb(const QString &text); + + bool containCrumb(const QString &text) const; + QStringList crumbList() const; + + DCrumbTextFormat crumbTextFormat(const QString &text) const; + DCrumbTextFormat makeTextFormat() const; + DCrumbTextFormat makeTextFormat(CrumbType type) const; + + bool dualClickMakeCrumb() const Q_DECL_NOEXCEPT; + bool crumbReadOnly() const; + int crumbRadius() const; + QString splitter() const; + +Q_SIGNALS: + void crumbAdded(const QString &text); + void crumbRemoved(const QString &text); + void crumbListChanged(); + +public Q_SLOTS: + void setCrumbReadOnly(bool crumbReadOnly); + void setCrumbRadius(int crumbRadius); + void setSplitter(const QString &splitter); + + void setDualClickMakeCrumb(bool flag) Q_DECL_NOEXCEPT; + +protected: + bool event(QEvent *e) override; + void paintEvent(QPaintEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + void focusOutEvent(QFocusEvent *event) override; + + QMimeData *createMimeDataFromSelection() const override; + bool canInsertFromMimeData(const QMimeData *source) const override; + void insertFromMimeData(const QMimeData *source) override; + +private: + using QTextEdit::setDocument; + using QTextEdit::document; + using QTextEdit::setText; + using QTextEdit::setHtml; + using QTextEdit::setPlaceholderText; + using QTextEdit::insertPlainText; + using QTextEdit::insertHtml; + using QTextEdit::append; + + D_DECLARE_PRIVATE(DCrumbEdit) + Q_PRIVATE_SLOT(d_func(), void _q_onDocumentLayoutChanged()) + Q_PRIVATE_SLOT(d_func(), void _q_onCurrentPositionChanged()) + Q_PRIVATE_SLOT(d_func(), void _q_onTextChanged()) +}; + +DWIDGET_END_NAMESPACE + +#endif // DCRUMBEDIT_H diff -Nru dtkwidget-5.5.48/include/widgets/ddialogclosebutton.h dtkwidget-5.6.12/include/widgets/ddialogclosebutton.h --- dtkwidget-5.5.48/include/widgets/ddialogclosebutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/ddialogclosebutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,21 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DDIALOGCLOSEBUTTON_H +#define DDIALOGCLOSEBUTTON_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DDialogCloseButton : public DIconButton +{ + Q_OBJECT +public: + explicit DDialogCloseButton(QWidget *parent = nullptr); +}; + +DWIDGET_END_NAMESPACE + +#endif // DDIALOGCLOSEBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/ddialog.h dtkwidget-5.6.12/include/widgets/ddialog.h --- dtkwidget-5.5.48/include/widgets/ddialog.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/ddialog.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,127 @@ +// SPDX-FileCopyrightText: 2015 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DDIALOG_H +#define DDIALOG_H + +#include + +#include + +class QAbstractButton; +class QButtonGroup; +class QLabel; +class QCloseEvent; +class QVBoxLayout; + +DWIDGET_BEGIN_NAMESPACE + +class DDialogPrivate; +class DDialog : public DAbstractDialog +{ + Q_OBJECT + + Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) + Q_PROPERTY(QString message READ message WRITE setMessage NOTIFY messageChanged) + Q_PROPERTY(QIcon icon READ icon WRITE setIcon) + Q_PROPERTY(Qt::TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged) + Q_PROPERTY(bool onButtonClickedClose READ onButtonClickedClose WRITE setOnButtonClickedClose) + Q_PROPERTY(bool closeButtonVisible READ closeButtonVisible WRITE setCloseButtonVisible) + +public: + enum ButtonType { + ButtonNormal, + ButtonWarning, + ButtonRecommend + }; + + explicit DDialog(QWidget *parent = nullptr); + explicit DDialog(const QString &title, const QString& message, QWidget *parent = 0); + + int getButtonIndexByText(const QString &text) const; + int buttonCount() const; + int contentCount() const; + QList getButtons() const; + QList getContents() const; + QAbstractButton* getButton(int index) const; + QWidget* getContent(int index) const; + QString title() const; + QString message() const; + QIcon icon() const; + D_DECL_DEPRECATED QPixmap iconPixmap() const; + Qt::TextFormat textFormat() const; + bool onButtonClickedClose() const; + + void setContentLayoutContentsMargins(const QMargins &margins); + QMargins contentLayoutContentsMargins() const; + + bool closeButtonVisible() const; + +Q_SIGNALS: + void aboutToClose(); + void closed(); + void buttonClicked(int index, const QString &text); + void titleChanged(QString title); + void messageChanged(QString massage); + void textFormatChanged(Qt::TextFormat textFormat); + void sizeChanged(QSize size); + void visibleChanged(bool visible); + +public Q_SLOTS: + int addButton(const QString &text, bool isDefault = false, ButtonType type = ButtonNormal); + int addButtons(const QStringList &text); + void insertButton(int index, const QString &text, bool isDefault = false, ButtonType type = ButtonNormal); + void insertButton(int index, QAbstractButton* button, bool isDefault = false); + void insertButtons(int index, const QStringList &text); + void removeButton(int index); + void removeButton(QAbstractButton *button); + void removeButtonByText(const QString &text); + void clearButtons(); + bool setDefaultButton(int index); + bool setDefaultButton(const QString &str); + void setDefaultButton(QAbstractButton *button); + void addContent(QWidget *widget, Qt::Alignment alignment = {}); + void insertContent(int index, QWidget *widget, Qt::Alignment alignment = {}); + void removeContent(QWidget *widget, bool isDelete = true); + void clearContents(bool isDelete = true); + void setSpacing(int spacing); + void addSpacing(int spacing); + void insertSpacing(int index, int spacing); + void clearSpacing(); + void setButtonText(int index, const QString &text); + void setButtonIcon(int index, const QIcon &icon); + void setTitle(const QString &title); + void setWordWrapTitle(bool wordWrap); + void setMessage(const QString& message); + void setWordWrapMessage(bool wordWrap); + void setIcon(const QIcon &icon); + D_DECL_DEPRECATED void setIcon(const QIcon &icon, const QSize &expectedSize); + D_DECL_DEPRECATED void setIconPixmap(const QPixmap &iconPixmap); + void setTextFormat(Qt::TextFormat textFormat); + void setOnButtonClickedClose(bool onButtonClickedClose); + void setCloseButtonVisible(bool closeButtonVisible); + + int exec() Q_DECL_OVERRIDE; + +protected: + explicit DDialog(DDialogPrivate &dd, QWidget *parent = 0); + + void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; + void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE; + void closeEvent(QCloseEvent *event) override; + void childEvent(QChildEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; + bool eventFilter(QObject *watched, QEvent *event) override; + void changeEvent(QEvent *event) override; + +private: + D_DECLARE_PRIVATE(DDialog) + + Q_PRIVATE_SLOT(d_func(), void _q_onButtonClicked()) +}; + +DWIDGET_END_NAMESPACE + +#endif // DDIALOG_H diff -Nru dtkwidget-5.5.48/include/widgets/ddrawergroup.h dtkwidget-5.6.12/include/widgets/ddrawergroup.h --- dtkwidget-5.5.48/include/widgets/ddrawergroup.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/ddrawergroup.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,38 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DDRAWERGROUP_H +#define DDRAWERGROUP_H + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DDrawer; +class DDrawerGroupPrivate; +class LIBDTKWIDGETSHARED_EXPORT DDrawerGroup : public QObject, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DDrawerGroup) + +public: + explicit DDrawerGroup(QObject *parent = 0); + + QList expands() const; + DDrawer * checkedExpand() const; + DDrawer * expand(int id) const; + void addExpand(DDrawer *expand, int id = -1); + void setId(DDrawer *expand, int id); + void removeExpand(DDrawer *expand); + int checkedId() const; + int id(DDrawer *expand) const; + +private: + void onExpandChanged(bool v); +}; + +DWIDGET_END_NAMESPACE + +#endif // DDRAWERGROUP_H diff -Nru dtkwidget-5.5.48/include/widgets/ddrawer.h dtkwidget-5.6.12/include/widgets/ddrawer.h --- dtkwidget-5.5.48/include/widgets/ddrawer.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/ddrawer.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,43 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DDRAWER_H +#define DDRAWER_H + +#include + +DWIDGET_BEGIN_NAMESPACE +class DDrawerPrivate; +class LIBDTKWIDGETSHARED_EXPORT DDrawer : public DFrame +{ + Q_OBJECT + D_DECLARE_PRIVATE(DDrawer) + +public: + explicit DDrawer(QWidget *parent = nullptr); + ~DDrawer() override; + + void setHeader(QWidget *header); + void setContent(QWidget *content, Qt::Alignment alignment = Qt::AlignHCenter); + QWidget *getContent() const; + void setHeaderHeight(int height); + virtual void setExpand(bool value); + bool expand() const; + void setAnimationDuration(int duration); + void setAnimationEasingCurve(QEasingCurve curve); + void setSeparatorVisible(bool arg); + void setExpandedSeparatorVisible(bool arg); + +Q_SIGNALS: + void expandChange(bool e); + void sizeChanged(QSize s); + +protected: + DDrawer(DDrawerPrivate &dd, QWidget *parent = nullptr); + void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; +}; + +DWIDGET_END_NAMESPACE + +#endif // DDRAWER_H diff -Nru dtkwidget-5.5.48/include/widgets/denhancedwidget.h dtkwidget-5.6.12/include/widgets/denhancedwidget.h --- dtkwidget-5.5.48/include/widgets/denhancedwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/denhancedwidget.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,57 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DENHANCEDWIDGET_H +#define DENHANCEDWIDGET_H + +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DEnhancedWidgetPrivate; +class DEnhancedWidget: public QObject +{ + Q_OBJECT + + Q_PROPERTY(QWidget *target READ target WRITE setTarget NOTIFY targetChanged) + Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) + +public: + explicit DEnhancedWidget(QWidget *target, QObject *parent = 0); + ~DEnhancedWidget(); + + QWidget *target() const; + bool enabled() const; + +public Q_SLOTS: + void setTarget(QWidget *target); + void setEnabled(bool enabled); + +Q_SIGNALS: + void xChanged(int x); + void yChanged(int y); + void positionChanged(const QPoint &point); + void widthChanged(int width); + void heightChanged(int height); + void sizeChanged(const QSize &size); + void targetChanged(QWidget *target); + void enabledChanged(bool enabled); + void showed(); + +protected: + bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; + +private: + explicit DEnhancedWidget(DEnhancedWidgetPrivate *dd, QWidget *w, QObject *parent = 0); + + DEnhancedWidgetPrivate *d_ptr; + + Q_DECLARE_PRIVATE(DEnhancedWidget) +}; + +DWIDGET_END_NAMESPACE + +#endif // DENHANCEDWIDGET_H diff -Nru dtkwidget-5.5.48/include/widgets/dexpandgroup.h dtkwidget-5.6.12/include/widgets/dexpandgroup.h --- dtkwidget-5.5.48/include/widgets/dexpandgroup.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dexpandgroup.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,42 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef EXPANDGROUP_H +#define EXPANDGROUP_H + +#include +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DDrawerGroup") DExpandGroup : public QObject +{ + Q_OBJECT +public: + explicit DExpandGroup(QObject *parent = 0); + + QList expands() const; + DBaseExpand * checkedExpand() const; + DBaseExpand * expand(int id) const; + void addExpand(DBaseExpand *expand, int id = -1); + void setId(DBaseExpand *expand, int id); + void removeExpand(DBaseExpand *expand); + int checkedId() const; + int id(DBaseExpand *expand) const; + +private: + void onExpandChanged(bool v); + +private: + QMap m_expandMap; + QMap m_checkedMap; +}; + +DWIDGET_END_NAMESPACE + +#endif // EXPANDGROUP_H diff -Nru dtkwidget-5.5.48/include/widgets/dfeaturedisplaydialog.h dtkwidget-5.6.12/include/widgets/dfeaturedisplaydialog.h --- dtkwidget-5.5.48/include/widgets/dfeaturedisplaydialog.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dfeaturedisplaydialog.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,61 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DFEATUREDISPLAYDIALOG_H +#define DFEATUREDISPLAYDIALOG_H + +#include + +class QLabel; +DWIDGET_BEGIN_NAMESPACE + +class DFeatureItemPrivate; +class DFeatureItem :public QObject, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT +public: + explicit DFeatureItem(const QIcon &icon = QIcon(), const QString &name = QString(), + const QString &description = QString(), QObject *parent = nullptr); + ~DFeatureItem() override; + + QIcon icon() const; + void setIcon(const QIcon &icon); + + QString name() const; + void setName(const QString &name); + + QString description() const; + void setDescription(const QString &description); + +private: + D_DECLARE_PRIVATE(DFeatureItem) +}; + +class DFeatureDisplayDialogPrivate; +class DFeatureDisplayDialog : public DDialog +{ + Q_OBJECT +public: + explicit DFeatureDisplayDialog(QWidget *parent = nullptr); + ~DFeatureDisplayDialog() override; + + void setTitle(const QString &title); + void addItem(DFeatureItem *item); + void removeItem(DFeatureItem* item); + void addItems(QList items); + void clearItems(); + void setLinkButtonVisible(bool isVisible); + void setLinkUrl(const QString &url); + void show(); + bool isEmpty() const; + +private: + D_DECLARE_PRIVATE(DFeatureDisplayDialog) + D_PRIVATE_SLOT(void _q_toggleLinkBtn()) + +}; + +DWIDGET_END_NAMESPACE + +#endif // DFEATUREDISPLAYDIALOG_H diff -Nru dtkwidget-5.5.48/include/widgets/dfilechooseredit.h dtkwidget-5.6.12/include/widgets/dfilechooseredit.h --- dtkwidget-5.5.48/include/widgets/dfilechooseredit.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dfilechooseredit.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,58 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DFILECHOOSEREDIT_H +#define DFILECHOOSEREDIT_H + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DFileChooserEditPrivate; +class LIBDTKWIDGETSHARED_EXPORT DFileChooserEdit : public DLineEdit +{ + Q_OBJECT + + Q_ENUMS(DialogDisplayPosition) + +public: + enum DialogDisplayPosition { + FollowParentWindow, + CurrentMonitorCenter + }; + + DFileChooserEdit(QWidget *parent = nullptr); + + void setFileMode(QFileDialog::FileMode mode); + QFileDialog::FileMode fileMode() const; + + void setNameFilters(const QStringList &filters); + QStringList nameFilters() const; + + void setDirectoryUrl(const QUrl &directory); + QUrl directoryUrl(); + + void setDialogDisplayPosition(DialogDisplayPosition dialogDisplayPosition); + DFileChooserEdit::DialogDisplayPosition dialogDisplayPosition() const; + + void setFileDialog(QFileDialog *fileDialog); + QFileDialog *fileDialog() const; + + void initDialog(); + +Q_SIGNALS: + void fileChoosed(const QString &fileName); + void dialogOpened(); + void dialogClosed(int code); + +protected: + Q_DISABLE_COPY(DFileChooserEdit) + D_DECLARE_PRIVATE(DFileChooserEdit) + Q_PRIVATE_SLOT(d_func(), void _q_showFileChooserDialog()) +}; + +DWIDGET_END_NAMESPACE + +#endif // DFILECHOOSEREDIT_H diff -Nru dtkwidget-5.5.48/include/widgets/dfiledialog.h dtkwidget-5.6.12/include/widgets/dfiledialog.h --- dtkwidget-5.5.48/include/widgets/dfiledialog.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dfiledialog.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,54 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DFILEDIALOG_H +#define DFILEDIALOG_H + +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DFileDialog : public QFileDialog +{ + Q_OBJECT + +public: + DFileDialog(QWidget *parent, Qt::WindowFlags f); + explicit DFileDialog(QWidget *parent = Q_NULLPTR, + const QString &caption = QString(), + const QString &directory = QString(), + const QString &filter = QString()); + + struct DComboBoxOptions { + bool editable; + QStringList data; + QString defaultValue; + }; + + struct DLineEditOptions { + int maxLength; + QLineEdit::EchoMode echoMode; + QString defaultValue; + QString inputMask; + QString placeholderText; + }; + + void addComboBox(const QString &text, const QStringList &data); + void addComboBox(const QString &text, const DComboBoxOptions &options); + void addLineEdit(const QString &text); + void addLineEdit(const QString &text, const DLineEditOptions &options); + void setAllowMixedSelection(bool on); + + QString getComboBoxValue(const QString &text) const; + QString getLineEditValue(const QString &text) const; + + void setVisible(bool visible) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DFILEDIALOG_H diff -Nru dtkwidget-5.5.48/include/widgets/dfloatingbutton.h dtkwidget-5.6.12/include/widgets/dfloatingbutton.h --- dtkwidget-5.5.48/include/widgets/dfloatingbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dfloatingbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DFLOATINGBUTTON_H +#define DFLOATINGBUTTON_H +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DFloatingButton : public DIconButton +{ + Q_OBJECT + +public: + explicit DFloatingButton(QWidget *parent = nullptr); + explicit DFloatingButton(QStyle::StandardPixmap iconType, QWidget *parent = nullptr); + explicit DFloatingButton(DStyle::StandardPixmap iconType, QWidget *parent = nullptr); + explicit DFloatingButton(const QString &text, QWidget *parent = nullptr); + DFloatingButton(const QIcon& icon, const QString &text = QString(), QWidget *parent = nullptr); + DFloatingButton(const DDciIcon &icon, const QString &text = QString(), QWidget *parent = nullptr); + +protected: + DStyleOptionButton baseStyleOption() const override; + void initStyleOption(DStyleOptionButton *option) const override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DFLOATINGBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dfloatingmessage.h dtkwidget-5.6.12/include/widgets/dfloatingmessage.h --- dtkwidget-5.5.48/include/widgets/dfloatingmessage.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dfloatingmessage.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,52 @@ +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DFLOATINGMESSAGE_H +#define DFLOATINGMESSAGE_H + +#include +#include +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DFloatingMessagePrivate; +class DFloatingMessage : public DFloatingWidget +{ + Q_OBJECT + D_DECLARE_PRIVATE(DFloatingMessage) + +public: + enum MessageType { + TransientType, //临时的消息, + ResidentType //常驻的消息 + }; + + explicit DFloatingMessage(MessageType notifyType = MessageType::TransientType, QWidget *parent = nullptr); + MessageType messageType() const; + + void setIcon(const QIcon &ico); + void setIcon(const DDciIcon &icon); + void setMessage(const QString &str); + void setWidget(QWidget *w); + void setDuration(int msec); + + virtual QSize sizeHint() const override; + +Q_SIGNALS: + void closeButtonClicked(); + +protected: + using DFloatingWidget::setWidget; + + virtual void changeEvent(QEvent *event) override; +private: + void showEvent(QShowEvent *event) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DFLOATINGMESSAGE_H diff -Nru dtkwidget-5.5.48/include/widgets/dfloatingwidget.h dtkwidget-5.6.12/include/widgets/dfloatingwidget.h --- dtkwidget-5.5.48/include/widgets/dfloatingwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dfloatingwidget.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,51 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DFLOATINGWIDGET_H +#define DFLOATINGWIDGET_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DStyleOptionFloatingWidget; +class DBlurEffectWidget; +class DFloatingWidgetPrivate; +class DFloatingWidget : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DFloatingWidget) + Q_PROPERTY(bool blurBackgroundEnabled READ blurBackgroundIsEnabled WRITE setBlurBackgroundEnabled) + +public: + explicit DFloatingWidget(QWidget *parent = nullptr); + + virtual QSize sizeHint() const override; + void setWidget(QWidget *widget); + void setFramRadius(int radius); + +protected: + DFloatingWidget(DFloatingWidgetPrivate &dd, QWidget *parent); + + void paintEvent(QPaintEvent* e) override; + bool event(QEvent *event) override; + + using QWidget::setContentsMargins; + using QWidget::setAutoFillBackground; + +public: + virtual void initStyleOption(DStyleOptionFloatingWidget *option) const; + bool blurBackgroundIsEnabled() const; + DBlurEffectWidget *blurBackground() const; + +public Q_SLOTS: + void setBlurBackgroundEnabled(bool blurBackgroundEnabled); +}; + +DWIDGET_END_NAMESPACE + +#endif // DFLOATINGWIDGET_H diff -Nru dtkwidget-5.5.48/include/widgets/dflowlayout.h dtkwidget-5.6.12/include/widgets/dflowlayout.h --- dtkwidget-5.5.48/include/widgets/dflowlayout.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dflowlayout.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,81 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DFLOWLAYOUT_H +#define DFLOWLAYOUT_H + +#include + +#include + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DFlowLayoutPrivate; +class DFlowLayout : public QLayout, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(int horizontalSpacing READ horizontalSpacing WRITE setHorizontalSpacing NOTIFY horizontalSpacingChanged) + Q_PROPERTY(int verticalSpacing READ verticalSpacing WRITE setVerticalSpacing NOTIFY verticalSpacingChanged) + Q_PROPERTY(int count READ count NOTIFY countChanged) + Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged) + Q_PROPERTY(QSize sizeHint READ sizeHint NOTIFY sizeHintChanged) + +public: + typedef QListView::Flow Flow; + Q_ENUMS(Flow) + + explicit DFlowLayout(QWidget *parent); + DFlowLayout(); + ~DFlowLayout(); + + void insertItem(int index, QLayoutItem *item); + void insertWidget(int index, QWidget *widget); + void insertLayout(int index, QLayout *layout); + void insertSpacing(int index, int size); + void insertStretch(int index, int stretch = 0); + void insertSpacerItem(int index, QSpacerItem *spacerItem); + + void addSpacing(int size); + void addStretch(int stretch = 0); + void addSpacerItem(QSpacerItem *spacerItem); + void addItem(QLayoutItem *item) Q_DECL_OVERRIDE; + bool hasHeightForWidth() const Q_DECL_OVERRIDE; + int heightForWidth(int) const Q_DECL_OVERRIDE; + int count() const Q_DECL_OVERRIDE; + QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE; + QSize minimumSize() const Q_DECL_OVERRIDE; + void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; + QSize sizeHint() const Q_DECL_OVERRIDE; + QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE; + Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE; + + int horizontalSpacing() const; + int verticalSpacing() const; + Flow flow() const; + +public Q_SLOTS: + void setHorizontalSpacing(int horizontalSpacing); + void setVerticalSpacing(int verticalSpacing); + void setSpacing(int spacing); + void setFlow(Flow flow); + +Q_SIGNALS: + void horizontalSpacingChanged(int horizontalSpacing); + void verticalSpacingChanged(int verticalSpacing); + void countChanged(int count); + void flowChanged(Flow flow); + void sizeHintChanged(QSize sizeHint) const; + +private: + D_DECLARE_PRIVATE(DFlowLayout) +}; + +DWIDGET_END_NAMESPACE + +#endif // DFLOWLAYOUT_H diff -Nru dtkwidget-5.5.48/include/widgets/dfontcombobox.h dtkwidget-5.6.12/include/widgets/dfontcombobox.h --- dtkwidget-5.5.48/include/widgets/dfontcombobox.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dfontcombobox.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DFONTCOMBOBOX_H +#define DFONTCOMBOBOX_H + +#include +#include +#include + +QT_REQUIRE_CONFIG(fontcombobox); + +DWIDGET_BEGIN_NAMESPACE + +class DFontComboBoxPrivate; +class LIBDTKWIDGETSHARED_EXPORT DFontComboBox : public DComboBox +{ + Q_OBJECT + Q_PROPERTY(QFontDatabase::WritingSystem writingSystem READ writingSystem WRITE setWritingSystem) + Q_PROPERTY(QFontComboBox::FontFilters fontFilters READ fontFilters WRITE setFontFilters) + Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged) + +public: + explicit DFontComboBox(QWidget *parent = nullptr); + virtual ~DFontComboBox() override; + + void setWritingSystem(QFontDatabase::WritingSystem); + QFontDatabase::WritingSystem writingSystem() const; + + void setFontFilters(QFontComboBox::FontFilters filters); + QFontComboBox::FontFilters fontFilters() const; + + QFont currentFont() const; + virtual QSize sizeHint() const override; + +public Q_SLOTS: + void setCurrentFont(const QFont &f); + +Q_SIGNALS: + void currentFontChanged(const QFont &f); + +protected: + virtual bool event(QEvent *e) override; + +private: + Q_DISABLE_COPY(DFontComboBox) + D_DECLARE_PRIVATE(DFontComboBox) +}; + +DWIDGET_END_NAMESPACE + +#endif // DFONTCOMBOBOX_H diff -Nru dtkwidget-5.5.48/include/widgets/dframe.h dtkwidget-5.6.12/include/widgets/dframe.h --- dtkwidget-5.5.48/include/widgets/dframe.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dframe.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,59 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DFRAME_H +#define DFRAME_H + +#include +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DFramePrivate; +class DFrame : public QFrame, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DFrame) + +public: + explicit DFrame(QWidget *parent = nullptr); + + void setFrameRounded(bool on); + void setBackgroundRole(DGUI_NAMESPACE::DPalette::ColorType type); + using QFrame::setBackgroundRole; + +protected: + DFrame(DFramePrivate &dd, QWidget *parent = nullptr); + + void paintEvent(QPaintEvent *event) override; +}; + +class DHorizontalLine : public QFrame +{ + Q_OBJECT +public: + explicit DHorizontalLine(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()) + : QFrame(parent, f) + { + setFrameShape(HLine); + } +}; + +class DVerticalLine : public QFrame +{ + Q_OBJECT +public: + explicit DVerticalLine(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()) + : QFrame(parent, f) + { + setFrameShape(VLine); + } +}; + +DWIDGET_END_NAMESPACE + +#endif // DFRAME_H diff -Nru dtkwidget-5.5.48/include/widgets/dgraphicsclipeffect.h dtkwidget-5.6.12/include/widgets/dgraphicsclipeffect.h --- dtkwidget-5.5.48/include/widgets/dgraphicsclipeffect.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dgraphicsclipeffect.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DGRAPHICSCLIPEFFECT_H +#define DGRAPHICSCLIPEFFECT_H + +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DGraphicsClipEffectPrivate; +class DGraphicsClipEffect : public QGraphicsEffect, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(QMargins margins READ margins WRITE setMargins NOTIFY marginsChanged) + Q_PROPERTY(QPainterPath clipPath READ clipPath WRITE setClipPath NOTIFY clipPathChanged) + +public: + explicit DGraphicsClipEffect(QObject *parent = Q_NULLPTR); + + QMargins margins() const; + QPainterPath clipPath() const; + +public Q_SLOTS: + void setMargins(const QMargins &margins); + void setClipPath(const QPainterPath &clipPath); + +Q_SIGNALS: + void marginsChanged(QMargins margins); + void clipPathChanged(QPainterPath clipPath); + +protected: + void draw(QPainter *painter) Q_DECL_OVERRIDE; + +private: + D_DECLARE_PRIVATE(DGraphicsClipEffect) +}; + +DWIDGET_END_NAMESPACE + +#endif // DGRAPHICSCLIPEFFECT_H diff -Nru dtkwidget-5.5.48/include/widgets/dgraphicsgloweffect.h dtkwidget-5.6.12/include/widgets/dgraphicsgloweffect.h --- dtkwidget-5.5.48/include/widgets/dgraphicsgloweffect.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dgraphicsgloweffect.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,57 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DGRAPHICSGLOWEFFECT_H +#define DGRAPHICSGLOWEFFECT_H + +#include +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DGraphicsGlowEffect : public QGraphicsEffect +{ + Q_OBJECT +public: + explicit DGraphicsGlowEffect(QObject *parent = nullptr); + + void draw(QPainter *painter); + QRectF boundingRectFor(const QRectF &rect) const; + + inline void setOffset(qreal dx, qreal dy) {m_xOffset = dx; m_yOffset = dy;} + + inline void setXOffset(qreal dx) {m_xOffset = dx;} + inline qreal xOffset() const {return m_xOffset;} + + inline void setYOffset(qreal dy) {m_yOffset = dy;} + inline qreal yOffset() const {return m_yOffset;} + + inline void setDistance(qreal distance) { m_distance = distance; updateBoundingRect(); } + inline qreal distance() const { return m_distance; } + + inline void setBlurRadius(qreal blurRadius) { m_blurRadius = blurRadius; updateBoundingRect(); } + inline qreal blurRadius() const { return m_blurRadius; } + + inline void setColor(const QColor &color) { m_color = color; } + inline QColor color() const { return m_color; } + + // TODO: refactor with d-pointer; + inline qreal opacity() const { return m_opacity; } + inline void setOpacity(qreal opacity) { m_opacity = opacity; } + +private: + qreal m_opacity = 1.0; + qreal m_xOffset; + qreal m_yOffset; + qreal m_distance; + qreal m_blurRadius; + QColor m_color; +}; + +DWIDGET_END_NAMESPACE + +#endif // DGRAPHICSGLOWEFFECT_H diff -Nru dtkwidget-5.5.48/include/widgets/dheaderline.h dtkwidget-5.6.12/include/widgets/dheaderline.h --- dtkwidget-5.5.48/include/widgets/dheaderline.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dheaderline.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,36 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DHEADERLINE_H +#define DHEADERLINE_H + +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DHeaderLine : public DBaseLine +{ + Q_OBJECT +public: + explicit DHeaderLine(QWidget *parent = 0); + void setTitle(const QString &title); + void setContent(QWidget *content); + + QString title() const; + +private: + void setLeftContent(QWidget *content); + void setRightContent(QWidget *content); + +private: + QLabel *m_titleLabel = NULL; +}; + +DWIDGET_END_NAMESPACE + +#endif // DHEADERLINE_H diff -Nru dtkwidget-5.5.48/include/widgets/dialog_constants.h dtkwidget-5.6.12/include/widgets/dialog_constants.h --- dtkwidget-5.5.48/include/widgets/dialog_constants.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dialog_constants.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef BUTTON_CONSTANTS_H +#define BUTTON_CONSTANTS_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +namespace DIALOG { + const int DEFAULT_WIDTH = 380; + const int DEFAULT_HEIGHT = 120; + const int BORDER_SHADOW_WIDTH = 0; + const int BORDER_RADIUS = 4; + const int CONTENT_INSERT_OFFSET = 2; + const int BUTTON_HEIGHT = 28; + const int CLOSE_BUTTON_WIDTH = 21; + const int CLOSE_BUTTON_HEIGHT = 21; + const int ICON_LAYOUT_TOP_MARGIN = 14; + const int ICON_LAYOUT_BOTTOM_MARGIN = 14; + const int ICON_LAYOUT_LEFT_MARGIN = 20; + const int ICON_LAYOUT_RIGHT_MARGIN = 20; + const int ICON_LAYOUT_SPACING = 20; + const int BUTTON_LAYOUT_TOP_MARGIN = 0; + const int BUTTON_LAYOUT_BOTTOM_MARGIN = 10; + const int BUTTON_LAYOUT_LEFT_MARGIN = 10; + const int BUTTON_LAYOUT_RIGHT_MARGIN = 10; +} + +DWIDGET_END_NAMESPACE + +#endif // BUTTON_CONSTANTS_H + diff -Nru dtkwidget-5.5.48/include/widgets/diconbutton.h dtkwidget-5.6.12/include/widgets/diconbutton.h --- dtkwidget-5.5.48/include/widgets/diconbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/diconbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,73 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DICONBUTTON_H +#define DICONBUTTON_H + +#include +#include +#include +#include + +#include + +DGUI_BEGIN_NAMESPACE +class DDciIcon; +DGUI_END_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE + +class DIconButtonPrivate; +class DStyleOptionButton; +class DIconButton : public QAbstractButton, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DIconButton) + + Q_PROPERTY(bool flat READ isFlat WRITE setFlat) + +public: + explicit DIconButton(QWidget *parent = nullptr); + explicit DIconButton(QStyle::StandardPixmap iconType, QWidget *parent = nullptr); + explicit DIconButton(DStyle::StandardPixmap iconType, QWidget *parent = nullptr); + explicit DIconButton(const DDciIcon &dciIcon, QWidget *parent = nullptr); + ~DIconButton() override; + + void setIcon(const QIcon &icon); + void setIcon(QStyle::StandardPixmap iconType); + void setIcon(DStyle::StandardPixmap iconType); + void setIcon(const DDciIcon &icon); + + DDciIcon dciIcon() const; + + QSize sizeHint() const override; + QSize minimumSizeHint() const override; + QSize iconSize() const; + + bool isFlat() const; + + void setEnabledCircle(bool status); + bool enabledCircle() const; + void setNewNotification(const bool set_new); + +public Q_SLOTS: + void setFlat(bool flat); + +protected: + using QAbstractButton::setText; + using QAbstractButton::text; + + DIconButton(DIconButtonPrivate &dd, QWidget *parent = nullptr); + virtual DStyleOptionButton baseStyleOption() const; + virtual void initStyleOption(DStyleOptionButton *option) const; + void keyPressEvent(QKeyEvent *event) override; + +private: + void paintEvent(QPaintEvent *event) override; + bool event(QEvent *e) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DICONBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dimagebutton.h dtkwidget-5.6.12/include/widgets/dimagebutton.h --- dtkwidget-5.5.48/include/widgets/dimagebutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dimagebutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,91 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DIMAGEBUTTON_H +#define DIMAGEBUTTON_H + +#include +#include +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE +class DImageButtonPrivate; +class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DIconButton") DImageButton : public QLabel, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_PROPERTY(QString normalPic READ getNormalPic WRITE setNormalPic DESIGNABLE true) + Q_PROPERTY(QString hoverPic READ getHoverPic WRITE setHoverPic DESIGNABLE true) + Q_PROPERTY(QString pressPic READ getPressPic WRITE setPressPic DESIGNABLE true) + Q_PROPERTY(QString checkedPic READ getCheckedPic WRITE setCheckedPic DESIGNABLE true) + Q_PROPERTY(QString disabledPic READ getDisabledPic WRITE setDisabledPic DESIGNABLE true) + Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged) + Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable) + +public: + DImageButton(QWidget *parent = 0); + + DImageButton(const QString &normalPic, const QString &hoverPic, + const QString &pressPic, QWidget *parent = 0); + + DImageButton(const QString &normalPic, const QString &hoverPic, + const QString &pressPic, const QString &checkedPic, QWidget *parent = 0); + + ~DImageButton(); + + void setEnabled(bool enabled); + void setDisabled(bool disabled); + + void setChecked(bool flag); + void setCheckable(bool flag); + bool isChecked() const; + bool isCheckable() const; + + void setNormalPic(const QString &normalPic); + void setHoverPic(const QString &hoverPic); + void setPressPic(const QString &pressPic); + void setCheckedPic(const QString &checkedPic); + void setDisabledPic(const QString &disabledPic); + + const QString getNormalPic() const; + const QString getHoverPic() const; + const QString getPressPic() const; + const QString getCheckedPic() const; + const QString getDisabledPic() const; + + enum State { + Normal, + Hover, + Press, + Checked, + Disabled + }; + + void setState(State state); + State getState() const; + +Q_SIGNALS: + void clicked(); + void checkedChanged(bool checked); + void stateChanged(); + +protected: + DImageButton(DImageButtonPrivate &q, QWidget *parent); + void enterEvent(QEvent *event) Q_DECL_OVERRIDE; + void leaveEvent(QEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + +private: + Q_DISABLE_COPY(DImageButton) + D_DECLARE_PRIVATE(DImageButton) +}; + +DWIDGET_END_NAMESPACE + +#endif // DIMAGEBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dimageviewer.h dtkwidget-5.6.12/include/widgets/dimageviewer.h --- dtkwidget-5.5.48/include/widgets/dimageviewer.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dimageviewer.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,83 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DIMAGEVIEWER_H +#define DIMAGEVIEWER_H + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DImageViewerPrivate; +class LIBDTKWIDGETSHARED_EXPORT DImageViewer : public DGraphicsView, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(QImage image READ image WRITE setImage NOTIFY imageChanged) + Q_PROPERTY(QString fileName READ fileName WRITE setFileName NOTIFY fileNameChanged) + Q_PROPERTY(qreal scaleFactor READ scaleFactor WRITE setScaleFactor NOTIFY scaleFactorChanged) + Q_PROPERTY(int rotateAngle READ rotateAngle NOTIFY rotateAngleChanged) + +public: + explicit DImageViewer(QWidget *parent = nullptr); + explicit DImageViewer(const QImage &image, QWidget *parent = nullptr); + explicit DImageViewer(const QString &fileName, QWidget *parent = nullptr); + ~DImageViewer() Q_DECL_OVERRIDE; + + QImage image() const; + void setImage(const QImage &image); + QString fileName() const; + void setFileName(const QString &fileName); + + qreal scaleFactor() const; + void setScaleFactor(qreal factor); + void scaleImage(qreal factor); + + void autoFitImage(); + void fitToWidget(); + void fitNormalSize(); + void rotateClockwise(); + void rotateCounterclockwise(); + int rotateAngle() const; + void resetRotateAngle(); + void clear(); + + void centerOn(qreal x, qreal y); + QRect visibleImageRect() const; + + Q_SLOT void scaleAtPoint(QPoint pos, qreal factor); + + void beginCropImage(); + void endCropImage(); + void resetCropImage(); + void setCropAspectRatio(qreal w, qreal h); + QRect cropImageRect() const; + +Q_SIGNALS: + void imageChanged(const QImage &image); + void fileNameChanged(const QString &fileName); + void scaleFactorChanged(qreal scaleFactor); + void rotateAngleChanged(int angle); + void transformChanged(); + void requestPreviousImage(); + void requestNextImage(); + void cropImageChanged(const QRect &rect); + +protected: + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; + bool event(QEvent *event) Q_DECL_OVERRIDE; + +private: + Q_DISABLE_COPY(DImageViewer) + D_DECLARE_PRIVATE(DImageViewer) + + D_PRIVATE_SLOT(void _q_pinchAnimeFinished()) +}; + +DWIDGET_END_NAMESPACE + +#endif // DIMAGEVIEWER_H diff -Nru dtkwidget-5.5.48/include/widgets/dinputdialog.h dtkwidget-5.6.12/include/widgets/dinputdialog.h --- dtkwidget-5.5.48/include/widgets/dinputdialog.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dinputdialog.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,146 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DINPUTDIALOG_H +#define DINPUTDIALOG_H + +#include + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DInputDialogPrivate; +class DInputDialog : public DDialog +{ + Q_OBJECT + + Q_PROPERTY(InputMode inputMode READ inputMode WRITE setInputMode) + Q_PROPERTY(QString textValue READ textValue WRITE setTextValue NOTIFY textValueChanged) + Q_PROPERTY(int intValue READ intValue WRITE setIntValue NOTIFY intValueChanged) + Q_PROPERTY(int doubleValue READ doubleValue WRITE setDoubleValue NOTIFY doubleValueChanged) + Q_PROPERTY(QLineEdit::EchoMode textEchoMode READ textEchoMode WRITE setTextEchoMode) + Q_PROPERTY(bool comboBoxEditable READ isComboBoxEditable WRITE setComboBoxEditable) + Q_PROPERTY(QStringList comboBoxItems READ comboBoxItems WRITE setComboBoxItems) + Q_PROPERTY(int comboBoxCurrentIndex READ comboBoxCurrentIndex WRITE setComboBoxCurrentIndex NOTIFY comboBoxCurrentIndexChanged) + Q_PROPERTY(int intMinimum READ intMinimum WRITE setIntMinimum) + Q_PROPERTY(int intMaximum READ intMaximum WRITE setIntMaximum) + Q_PROPERTY(int intStep READ intStep WRITE setIntStep) + Q_PROPERTY(double doubleMinimum READ doubleMinimum WRITE setDoubleMinimum) + Q_PROPERTY(double doubleMaximum READ doubleMaximum WRITE setDoubleMaximum) + Q_PROPERTY(int doubleDecimals READ doubleDecimals WRITE setDoubleDecimals) + Q_PROPERTY(QString okButtonText READ okButtonText WRITE setOkButtonText) + Q_PROPERTY(QString cancelButtonText READ cancelButtonText WRITE setCancelButtonText) + Q_PROPERTY(bool textAlert READ isTextAlert WRITE setTextAlert NOTIFY textAlertChanged) + +public: + enum InputMode { + TextInput, + ComboBox, + IntInput, + DoubleInput + }; + + explicit DInputDialog(QWidget *parent = 0); + + Q_SLOT void setInputMode(InputMode mode); + InputMode inputMode() const; + + Q_SLOT void setTextValue(const QString &text); + QString textValue() const; + + Q_SLOT void setTextEchoMode(QLineEdit::EchoMode mode); + QLineEdit::EchoMode textEchoMode() const; + + Q_SLOT void setComboBoxEditable(bool editable); + bool isComboBoxEditable() const; + + Q_SLOT void setComboBoxItems(const QStringList &items); + QStringList comboBoxItems() const; + + Q_SLOT void setComboBoxCurrentIndex(int comboBoxCurrentIndex); + int comboBoxCurrentIndex() const; + + Q_SLOT void setIntValue(int value); + int intValue() const; + + Q_SLOT void setIntMinimum(int min); + int intMinimum() const; + + Q_SLOT void setIntMaximum(int max); + int intMaximum() const; + + Q_SLOT void setIntRange(int min, int max); + + Q_SLOT void setIntStep(int step); + int intStep() const; + + Q_SLOT void setDoubleValue(double value); + double doubleValue() const; + + Q_SLOT void setDoubleMinimum(double min); + double doubleMinimum() const; + + Q_SLOT void setDoubleMaximum(double max); + double doubleMaximum() const; + + Q_SLOT void setDoubleRange(double min, double max); + + Q_SLOT void setDoubleDecimals(int decimals); + int doubleDecimals() const; + + Q_SLOT void setOkButtonText(const QString &text); + QString okButtonText() const; + + Q_SLOT void setOkButtonEnabled(const bool enable); + bool okButtonIsEnabled() const; + + Q_SLOT void setCancelButtonText(const QString &text); + QString cancelButtonText() const; + + Q_SLOT void setTextAlert(bool textAlert); + bool isTextAlert() const; + + static QString getText(QWidget *parent, const QString &title, const QString &message, + QLineEdit::EchoMode echo = QLineEdit::Normal, + const QString &text = QString(), bool *ok = 0, Qt::WindowFlags flags = 0, + Qt::InputMethodHints inputMethodHints = Qt::ImhNone); + + static QString getItem(QWidget *parent, const QString &title, const QString &message, + const QStringList &items, int current = 0, bool editable = true, + bool *ok = 0, Qt::WindowFlags flags = 0, + Qt::InputMethodHints inputMethodHints = Qt::ImhNone); + + static int getInt(QWidget *parent, const QString &title, const QString &message, int value = 0, + int minValue = -2147483647, int maxValue = 2147483647, + int step = 1, bool *ok = 0, Qt::WindowFlags flags = 0); + static double getDouble(QWidget *parent, const QString &title, const QString &message, double value = 0, + double minValue = -2147483647, double maxValue = 2147483647, + int decimals = 1, bool *ok = 0, Qt::WindowFlags flags = 0); + +protected: + void showEvent(QShowEvent *e); + +Q_SIGNALS: + // ### Q_EMIT signals! + void textValueChanged(const QString &text); + void textValueSelected(const QString &text); + void intValueChanged(int value); + void intValueSelected(int value); + void doubleValueChanged(double value); + void doubleValueSelected(double value); + void cancelButtonClicked(); + void okButtonClicked(); + void comboBoxCurrentIndexChanged(int comboBoxCurrentIndex); + void textAlertChanged(bool textAlert); + +private: + D_DECLARE_PRIVATE(DInputDialog) +}; + +DWIDGET_END_NAMESPACE + +#endif // DINPUTDIALOG_H diff -Nru dtkwidget-5.5.48/include/widgets/dinputdialog_p.h dtkwidget-5.6.12/include/widgets/dinputdialog_p.h --- dtkwidget-5.5.48/include/widgets/dinputdialog_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dinputdialog_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,9 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DINPUTDIALOG_P_H +#define DINPUTDIALOG_P_H + +#endif // DINPUTDIALOG_P_H + diff -Nru dtkwidget-5.5.48/include/widgets/dipv4lineedit.h dtkwidget-5.6.12/include/widgets/dipv4lineedit.h --- dtkwidget-5.5.48/include/widgets/dipv4lineedit.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dipv4lineedit.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,66 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DIPV4LINEEDIT_H +#define DIPV4LINEEDIT_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DIpv4LineEditPrivate; +class LIBDTKWIDGETSHARED_EXPORT DIpv4LineEdit : public QLineEdit, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_DISABLE_COPY(DIpv4LineEdit) + D_DECLARE_PRIVATE(DIpv4LineEdit) + Q_PROPERTY(QString displayText READ displayText) + Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition) + Q_PROPERTY(Qt::Alignment alignment READ alignment) + Q_PROPERTY(QString selectedText READ selectedText) + Q_PROPERTY(bool acceptableInput READ hasAcceptableInput) + Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) + Q_PROPERTY(QString placeholderText READ placeholderText) + Q_PROPERTY(bool clearButtonEnabled READ isClearButtonEnabled) + +public: + explicit DIpv4LineEdit(QWidget *parent = 0); + + QString displayText() const; + int cursorPosition() const; + Qt::Alignment alignment() const; + bool hasAcceptableInput() const; + bool isReadOnly() const; + +public Q_SLOTS: + void setCursorPosition(int cursorPosition); + void setReadOnly(bool readOnly); + void setSelection(int start, int length); + void selectAll(); + +Q_SIGNALS: + void focusChanged(bool focus); + +protected: + bool eventFilter(QObject *obj, QEvent *e) Q_DECL_OVERRIDE; + +private: + DIpv4LineEdit(DIpv4LineEditPrivate &q, QWidget *parent); + void setPlaceholderText(QString placeholderText); + void setClearButtonEnabled(bool clearButtonEnabled); + + Q_PRIVATE_SLOT(d_func(), void _q_updateLineEditText()) + Q_PRIVATE_SLOT(d_func(), void _q_setIpLineEditText(const QString &)) + +protected: + void resizeEvent(QResizeEvent *event) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DIPV4LINEEDIT_H diff -Nru dtkwidget-5.5.48/include/widgets/dkeysequenceedit.h dtkwidget-5.6.12/include/widgets/dkeysequenceedit.h --- dtkwidget-5.5.48/include/widgets/dkeysequenceedit.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dkeysequenceedit.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,46 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DKEYSEQUENCEEDIT_H +#define DKEYSEQUENCEEDIT_H + +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DKeySequenceEditPrivate; +class LIBDTKWIDGETSHARED_EXPORT DKeySequenceEdit : public QLineEdit, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_DISABLE_COPY(DKeySequenceEdit) + D_DECLARE_PRIVATE(DKeySequenceEdit) + +public: + explicit DKeySequenceEdit(QWidget *parent = nullptr); + + void clear(); + bool setKeySequence(const QKeySequence &keySequence); + QKeySequence keySequence(); + void ShortcutDirection(Qt::AlignmentFlag alig); + + QString getKeySequence(QKeySequence sequence); + +Q_SIGNALS: + void editingFinished(const QKeySequence &keySequence); + void keySequenceChanged(const QKeySequence &keySequence); + +protected: + void keyPressEvent(QKeyEvent *event) override; + bool event(QEvent *e) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DKEYSEQUENCEEDIT_H + + diff -Nru dtkwidget-5.5.48/include/widgets/dlabel.h dtkwidget-5.6.12/include/widgets/dlabel.h --- dtkwidget-5.5.48/include/widgets/dlabel.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dlabel.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,41 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DLABEL_H +#define DLABEL_H + +#include +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DLabelPrivate; +class LIBDTKWIDGETSHARED_EXPORT DLabel : public QLabel, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_DISABLE_COPY(DLabel) + D_DECLARE_PRIVATE(DLabel) +public: + explicit DLabel(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); + DLabel(const QString &text, QWidget *parent = nullptr); + ~DLabel(); + + void setForegroundRole(QPalette::ColorRole role); + void setForegroundRole(DPalette::ColorType color); + void setElideMode(Qt::TextElideMode elideMode); + Qt::TextElideMode elideMode() const; + +protected: + DLabel(DLabelPrivate &dd, QWidget *parent = nullptr); + + void initPainter(QPainter *painter) const override; + void paintEvent(QPaintEvent *event) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DLABEL_H diff -Nru dtkwidget-5.5.48/include/widgets/dlicensedialog.h dtkwidget-5.6.12/include/widgets/dlicensedialog.h --- dtkwidget-5.5.48/include/widgets/dlicensedialog.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dlicensedialog.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DLICENSEDIALOG_H +#define DLICENSEDIALOG_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DLicenseDialogPrivate; +class DLicenseDialog : public DAbstractDialog +{ + Q_OBJECT +public: + explicit DLicenseDialog(QWidget *parent = nullptr); + ~DLicenseDialog() override; + + void setContent(const QByteArray &content); + void setFile(const QString &file); + void setLicenseSearchPath(const QString &path); + bool load(); + bool isValid() const; + +protected: + void hideEvent(QHideEvent *) override; + +private: + D_DECLARE_PRIVATE(DLicenseDialog) +}; + +DWIDGET_END_NAMESPACE + +#endif // DLICENSEDIALOG_H diff -Nru dtkwidget-5.5.48/include/widgets/dlineedit.h dtkwidget-5.6.12/include/widgets/dlineedit.h --- dtkwidget-5.5.48/include/widgets/dlineedit.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dlineedit.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,96 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DLINEEDIT_H +#define DLINEEDIT_H + +#include +#include + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DLineEditPrivate; +class DStyleOptionLineEdit; +class LIBDTKWIDGETSHARED_EXPORT DLineEdit : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_DISABLE_COPY(DLineEdit) + D_DECLARE_PRIVATE(DLineEdit) + Q_PROPERTY(bool alert READ isAlert WRITE setAlert NOTIFY alertChanged) + +public: + DLineEdit(QWidget *parent = nullptr); + virtual ~DLineEdit() override; + + QLineEdit *lineEdit() const; + void setPlaceholderText(const QString &); + + void setAlert(bool isAlert); + bool isAlert() const; + void showAlertMessage(const QString &text, int duration = 3000); + void showAlertMessage(const QString &text, QWidget *follower, int duration = 3000); + void setAlertMessageAlignment(Qt::Alignment alignment); + Qt::Alignment alertMessageAlignment() const; + void hideAlertMessage(); + + void setLeftWidgets(const QList &list); + void setRightWidgets(const QList &list); + + void setLeftWidgetsVisible(bool visible); + void setRightWidgetsVisible(bool visible); + + void setClearButtonEnabled(bool enable); + bool isClearButtonEnabled() const; + + void setText(const QString &text); + QString text(); + + void clear(); + + QLineEdit::EchoMode echoMode() const; + void setEchoMode(QLineEdit::EchoMode mode); + + void setContextMenuPolicy(Qt::ContextMenuPolicy policy); + + bool speechToTextIsEnabled() const; + void setSpeechToTextEnabled(bool enable); + + bool textToSpeechIsEnabled() const; + void setTextToSpeechEnabled(bool enable); + + bool textToTranslateIsEnabled() const; + void setTextToTranslateEnabled(bool enable); + + bool copyEnabled() const; + void setCopyEnabled(bool enable); + + bool cutEnabled() const; + void setCutEnabled(bool enable); + +Q_SIGNALS: + void alertChanged(bool alert) const; + void focusChanged(bool onFocus) const; + + void textChanged(const QString &); + void textEdited(const QString &); + void cursorPositionChanged(int, int); + void returnPressed(); + void editingFinished(); + void selectionChanged(); + +protected: + DLineEdit(DLineEditPrivate &q, QWidget *parent); + bool eventFilter(QObject *watched, QEvent *event) override; + bool event(QEvent *event) override; + + friend class DStyleOptionLineEdit; +}; + +DWIDGET_END_NAMESPACE + +#endif // DLINEEDIT_H diff -Nru dtkwidget-5.5.48/include/widgets/dlistview.h dtkwidget-5.6.12/include/widgets/dlistview.h --- dtkwidget-5.5.48/include/widgets/dlistview.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dlistview.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,128 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DLISTVIEW_H +#define DLISTVIEW_H + +#include + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DVariantListModel : public QAbstractListModel +{ +public: + explicit DVariantListModel(QObject *parent = 0); + + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + bool setData(const QModelIndex &index, const QVariant &value, int role) Q_DECL_OVERRIDE; + + bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; + bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; + +private: + QList dataList; +}; + +class DListViewPrivate; +class LIBDTKWIDGETSHARED_EXPORT DListView : public QListView, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + /// item count. + Q_PROPERTY(int count READ count NOTIFY rowCountChanged) + /// list layout orientation + Q_PROPERTY(Qt::Orientation orientation READ orientation NOTIFY orientationChanged) + Q_PROPERTY(DStyledItemDelegate::BackgroundType backgroundType READ backgroundType WRITE setBackgroundType) + Q_PROPERTY(QMargins itemMargins READ itemMargins WRITE setItemMargins) + Q_PROPERTY(QSize itemSize READ itemSize WRITE setItemSize) + +public: + explicit DListView(QWidget *parent = 0); + + State state() const; + + QWidget *getHeaderWidget(int index) const; + QWidget *getFooterWidget(int index) const; + + /// return true if rect intersects contentsVisualRect+qMax(cacheBuffer,cacheCount) + bool isActiveRect(const QRect &rect) const; + bool isVisualRect(const QRect &rect) const; + + int count() const; + + Qt::Orientation orientation() const; + + void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; + + DStyledItemDelegate::BackgroundType backgroundType() const; + QMargins itemMargins() const; + QSize itemSize() const; + + using QListView::contentsSize; + using QListView::setViewportMargins; + +public Q_SLOTS: + bool addItem(const QVariant &data); + bool addItems(const QVariantList &datas); + bool insertItem(int index, const QVariant &data); + bool insertItems(int index, const QVariantList &datas); + bool removeItem(int index); + bool removeItems(int index, int count); + + int addHeaderWidget(QWidget *widget); + void removeHeaderWidget(int index); + QWidget *takeHeaderWidget(int index); + int addFooterWidget(QWidget *widget); + void removeFooterWidget(int index); + QWidget *takeFooterWidget(int index); + + void setOrientation(QListView::Flow flow, bool wrapping); + void edit(const QModelIndex &index); + + void setBackgroundType(DStyledItemDelegate::BackgroundType backgroundType); + void setItemMargins(const QMargins &itemMargins); + void setItemSize(QSize itemSize); + void setItemSpacing(int spacing); + void setItemRadius(int radius); + +Q_SIGNALS: + void rowCountChanged(); + void orientationChanged(Qt::Orientation orientation); + void currentChanged(const QModelIndex &previous); + void triggerEdit(const QModelIndex &index); + +protected: +#if(QT_VERSION < 0x050500) + void setViewportMargins(int left, int top, int right, int bottom); + void setViewportMargins(const QMargins &margins); + QMargins viewportMargins() const; +#endif + + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) Q_DECL_OVERRIDE; + bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event) Q_DECL_OVERRIDE; + + QStyleOptionViewItem viewOptions() const override; + virtual QModelIndex moveCursor(CursorAction cursorAction, + Qt::KeyboardModifiers modifiers) override; + QSize viewportSizeHint() const override; + int horizontalOffset() const override; + +private: + void setFlow(QListView::Flow flow); + void setWrapping(bool enable); + + D_DECLARE_PRIVATE(DListView) +}; + +DWIDGET_END_NAMESPACE + +#endif // DLISTVIEW_H diff -Nru dtkwidget-5.5.48/include/widgets/dloadingindicator.h dtkwidget-5.6.12/include/widgets/dloadingindicator.h --- dtkwidget-5.5.48/include/widgets/dloadingindicator.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dloadingindicator.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,93 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DLOADINGINDICATOR_H +#define DLOADINGINDICATOR_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DLoadingIndicatorPrivate; +class LIBDTKWIDGETSHARED_EXPORT DLoadingIndicator : public QGraphicsView, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor DESIGNABLE true SCRIPTABLE true) + Q_PROPERTY(bool loading READ loading WRITE setLoading) + Q_PROPERTY(bool smooth READ smooth WRITE setSmooth) + Q_PROPERTY(QPixmap imageSource READ imageSource WRITE setImageSource) + Q_PROPERTY(QWidget* widgetSource READ widgetSource WRITE setWidgetSource) + Q_PROPERTY(int aniDuration READ aniDuration WRITE setAniDuration) + Q_PROPERTY(QEasingCurve::Type aniEasingType READ aniEasingType WRITE setAniEasingType) + Q_PROPERTY(RotationDirection direction READ direction WRITE setDirection NOTIFY directionChanged) + Q_PROPERTY(qreal rotate READ rotate WRITE setRotate NOTIFY rotateChanged) + +public: + /*! + * \brief The RotationDirection enum contains the possible rotation + * directions of the DLoadingIndicator widget. + */ + enum RotationDirection{ + Clockwise, /*!< the rotation is clockwise */ + Counterclockwise /*!< the rotation is counterclockwise */ + }; + + Q_ENUMS(RotationDirection) + + DLoadingIndicator(QWidget * parent = 0); + ~DLoadingIndicator(); + + QColor backgroundColor() const; + bool loading() const; + QWidget* widgetSource() const; + QPixmap imageSource() const; + int aniDuration() const; + QEasingCurve::Type aniEasingType() const; + QSize sizeHint() const Q_DECL_OVERRIDE; + bool smooth() const; + RotationDirection direction() const; + qreal rotate() const; + +public Q_SLOTS: + void start(); + void stop(); + void setLoading(bool flag); + void setAniDuration(int msecs); + void setAniEasingCurve(const QEasingCurve & easing); + void setBackgroundColor(const QColor &color); + void setRotate(QVariant angle); + void setWidgetSource(QWidget* widgetSource); + void setImageSource(const QPixmap &imageSource); + void setAniEasingType(QEasingCurve::Type aniEasingType); + void setSmooth(bool smooth); + void setDirection(RotationDirection direction); + +Q_SIGNALS: + void directionChanged(RotationDirection direction); + void rotateChanged(qreal rotate); + +protected: + void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; + +private: + D_DECLARE_PRIVATE(DLoadingIndicator) +}; + +DWIDGET_END_NAMESPACE + +#endif // DLOADINGINDICATOR_H diff -Nru dtkwidget-5.5.48/include/widgets/dmainwindow.h dtkwidget-5.6.12/include/widgets/dmainwindow.h --- dtkwidget-5.5.48/include/widgets/dmainwindow.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dmainwindow.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,140 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DMAINWINDOW_H +#define DMAINWINDOW_H + +#include +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DMainWindowPrivate; +class DTitlebar; +class LIBDTKWIDGETSHARED_EXPORT DMainWindow : public QMainWindow, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(int windowRadius READ windowRadius WRITE setWindowRadius NOTIFY windowRadiusChanged) + Q_PROPERTY(int borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged) + Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) + Q_PROPERTY(int shadowRadius READ shadowRadius WRITE setShadowRadius NOTIFY shadowRadiusChanged) + Q_PROPERTY(QPoint shadowOffset READ shadowOffset WRITE setShadowOffset NOTIFY shadowOffsetChanged) + Q_PROPERTY(QColor shadowColor READ shadowColor WRITE setShadowColor NOTIFY shadowColorChanged) + Q_PROPERTY(QPainterPath clipPath READ clipPath WRITE setClipPath NOTIFY clipPathChanged) + Q_PROPERTY(QRegion frameMask READ frameMask WRITE setFrameMask NOTIFY frameMaskChanged) + Q_PROPERTY(QMargins frameMargins READ frameMargins NOTIFY frameMarginsChanged) + Q_PROPERTY(bool translucentBackground READ translucentBackground WRITE setTranslucentBackground NOTIFY translucentBackgroundChanged) + Q_PROPERTY(bool enableSystemResize READ enableSystemResize WRITE setEnableSystemResize NOTIFY enableSystemResizeChanged) + Q_PROPERTY(bool enableSystemMove READ enableSystemMove WRITE setEnableSystemMove NOTIFY enableSystemMoveChanged) + Q_PROPERTY(bool enableBlurWindow READ enableBlurWindow WRITE setEnableBlurWindow NOTIFY enableBlurWindowChanged) + Q_PROPERTY(bool autoInputMaskByClipPath READ autoInputMaskByClipPath WRITE setAutoInputMaskByClipPath NOTIFY autoInputMaskByClipPathChanged) + Q_PROPERTY(bool titlebarShadowEnabled READ titlebarShadowIsEnabled WRITE setTitlebarShadowEnabled) + +public: + explicit DMainWindow(QWidget *parent = 0); + + DTitlebar *titlebar() const; + + void setSidebarWidget(QWidget *widget); + QWidget * sidebarWidget(); + + int sidebarWidth() const; + void setSidebarWidth(int width); + + D_DECL_DEPRECATED_X("Please use sidebarVisible") bool sidebarVisble() const; + bool sidebarVisible() const ; + void setSidebarVisible(bool visible); + + bool sidebarExpanded() const; + void setSidebarExpanded(bool expended); + + bool isDXcbWindow() const; + + int windowRadius() const; + + int borderWidth() const; + QColor borderColor() const; + + int shadowRadius() const; + QPoint shadowOffset() const; + QColor shadowColor() const; + + QPainterPath clipPath() const; + QRegion frameMask() const; + QMargins frameMargins() const; + + bool translucentBackground() const; + bool enableSystemResize() const; + bool enableSystemMove() const; + bool enableBlurWindow() const; + bool autoInputMaskByClipPath() const; + + bool titlebarShadowIsEnabled() const; + +public Q_SLOTS: + void setWindowRadius(int windowRadius); + + void setBorderWidth(int borderWidth); + void setBorderColor(const QColor &borderColor); + + void setShadowRadius(int shadowRadius); + void setShadowOffset(const QPoint &shadowOffset); + void setShadowColor(const QColor &shadowColor); + + void setClipPath(const QPainterPath &clipPath); + void setFrameMask(const QRegion &frameMask); + + void setTranslucentBackground(bool translucentBackground); + void setEnableSystemResize(bool enableSystemResize); + void setEnableSystemMove(bool enableSystemMove); + void setEnableBlurWindow(bool enableBlurWindow); + void setAutoInputMaskByClipPath(bool autoInputMaskByClipPath); + + // TODO: remove it if there is an batter sulotion +#ifdef Q_OS_MAC + void setWindowFlags(Qt::WindowFlags type); +#endif + + void sendMessage(const QIcon &icon, const QString &message); + void sendMessage(DFloatingMessage *message); + + void setTitlebarShadowEnabled(bool titlebarShadowEnabled); + +Q_SIGNALS: + void windowRadiusChanged(); + void borderWidthChanged(); + void borderColorChanged(); + void shadowRadiusChanged(); + void shadowOffsetChanged(); + void shadowColorChanged(); + void clipPathChanged(); + void frameMaskChanged(); + void frameMarginsChanged(); + void translucentBackgroundChanged(); + void enableSystemResizeChanged(); + void enableSystemMoveChanged(); + void enableBlurWindowChanged(); + void autoInputMaskByClipPathChanged(); + void sidebarVisbleChanged(bool visible); + void sidebarExpanedChanged(bool expaned); + +protected: + DMainWindow(DMainWindowPrivate &dd, QWidget *parent = 0); + void mouseMoveEvent(QMouseEvent *event) override; + void resizeEvent(QResizeEvent *event) override; + void changeEvent(QEvent *event) override; + +private: + D_DECLARE_PRIVATE(DMainWindow) + D_PRIVATE_SLOT(void _q_autoShowFeatureDialog()) +}; + +DWIDGET_END_NAMESPACE + +#endif // DMAINWINDOW_H diff -Nru dtkwidget-5.5.48/include/widgets/dmessagemanager.h dtkwidget-5.6.12/include/widgets/dmessagemanager.h --- dtkwidget-5.5.48/include/widgets/dmessagemanager.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dmessagemanager.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DMESSAGEMANAGER_H +#define DMESSAGEMANAGER_H + +#include +#include +#include +#include + +DGUI_BEGIN_NAMESPACE +class DDciIcon; +DGUI_END_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE +class DFloatingMessage; +class DMessageManager: public QObject +{ + Q_OBJECT + +private: + DMessageManager(); //构造函数是私有的 + +public: + static DMessageManager *instance(); + + void sendMessage(QWidget *par, DFloatingMessage *floMsg); + void sendMessage(QWidget *par, const QIcon &icon, const QString &message); + void sendMessage(QWidget *par, const DGUI_NAMESPACE::DDciIcon &icon, const QString &message); + bool setContentMargens(QWidget *par, const QMargins &margins); + +protected: + bool eventFilter(QObject *watched, QEvent *event) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DMESSAGEMANAGER_H diff -Nru dtkwidget-5.5.48/include/widgets/dmpriscontrol.h dtkwidget-5.6.12/include/widgets/dmpriscontrol.h --- dtkwidget-5.5.48/include/widgets/dmpriscontrol.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dmpriscontrol.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,52 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DMPRISCONTROL_H +#define DMPRISCONTROL_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DMPRISControlPrivate; +class LIBDTKWIDGETSHARED_EXPORT DMPRISControl : public QFrame, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_DISABLE_COPY(DMPRISControl) + D_DECLARE_PRIVATE(DMPRISControl) + +public: + explicit DMPRISControl(QWidget *parent = 0); + + bool isWorking() const; + +Q_SIGNALS: + void mprisAcquired() const; + void mprisChanged() const; + void mprisLosted() const; + +public Q_SLOTS: + void setPictureVisible(bool visible); + void setPictureSize(const QSize &size); + +protected: + void showEvent(QShowEvent *event); + + D_PRIVATE_SLOT(void _q_onMetaDataChanged()) + D_PRIVATE_SLOT(void _q_onPlaybackStatusChanged()) + D_PRIVATE_SLOT(void _q_onPrevClicked()) + D_PRIVATE_SLOT(void _q_onPlayClicked()) + D_PRIVATE_SLOT(void _q_onPauseClicked()) + D_PRIVATE_SLOT(void _q_onNextClicked()) + D_PRIVATE_SLOT(void _q_loadMPRISPath(const QString &)) + D_PRIVATE_SLOT(void _q_removeMPRISPath(const QString &)) + D_PRIVATE_SLOT(void _q_onCanControlChanged(bool canControl)) +}; + +DWIDGET_END_NAMESPACE + +#endif // DMPRISCONTROL_H diff -Nru dtkwidget-5.5.48/include/widgets/dpageindicator.h dtkwidget-5.6.12/include/widgets/dpageindicator.h --- dtkwidget-5.5.48/include/widgets/dpageindicator.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dpageindicator.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,61 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DPAGEINDICATOR_H +#define DPAGEINDICATOR_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DPageIndicatorPrivate; +class LIBDTKWIDGETSHARED_EXPORT DPageIndicator : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_DISABLE_COPY(DPageIndicator) + D_DECLARE_PRIVATE(DPageIndicator) + Q_PROPERTY(QColor pointColor READ pointColor WRITE setPointColor DESIGNABLE true) + Q_PROPERTY(QColor secondaryPointColor READ secondaryPointColor WRITE setSecondaryPointColor DESIGNABLE true) + Q_PROPERTY(int pointRadius READ pointRadius WRITE setPointRadius) + Q_PROPERTY(int secondaryPointRadius READ secondaryPointRadius WRITE setSecondaryPointRadius) + Q_PROPERTY(int pageCount READ pageCount WRITE setPageCount) + Q_PROPERTY(int currentPage READ currentPageIndex WRITE setCurrentPage) + Q_PROPERTY(int pointDistance READ pointDistance WRITE setPointDistance) + +public: + explicit DPageIndicator(QWidget *parent = 0); + + int pageCount() const; + void setPageCount(const int count); + + void nextPage(); + void previousPage(); + void setCurrentPage(const int index); + int currentPageIndex() const; + + QColor pointColor() const; + void setPointColor(QColor color); + + QColor secondaryPointColor() const; + void setSecondaryPointColor(QColor color); + + int pointRadius() const; + void setPointRadius(int size); + + int secondaryPointRadius() const; + void setSecondaryPointRadius(int size); + + int pointDistance() const; + void setPointDistance(int distance); + +protected: + void paintEvent(QPaintEvent *e) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DPAGEINDICATOR_H diff -Nru dtkwidget-5.5.48/include/widgets/dpalettehelper.h dtkwidget-5.6.12/include/widgets/dpalettehelper.h --- dtkwidget-5.5.48/include/widgets/dpalettehelper.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dpalettehelper.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DPALETTEHELPER_H +#define DPALETTEHELPER_H + +#include +#include +#include + +DGUI_USE_NAMESPACE +DWIDGET_BEGIN_NAMESPACE + +class DPaletteHelperPrivate; +class DPaletteHelper : public QObject + , public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + +public: + static DPaletteHelper *instance(); + + DPalette palette(const QWidget *widget, const QPalette &base = QPalette()) const; + void setPalette(QWidget *widget, const DPalette &palette); + void resetPalette(QWidget *widget); + +private: + DPaletteHelper(QObject *parent = nullptr); + ~DPaletteHelper() override; + + bool eventFilter(QObject *watched, QEvent *event) override; + + D_DECLARE_PRIVATE(DPaletteHelper) +}; + +DWIDGET_END_NAMESPACE + +#endif // DPALETTEHELPER_H diff -Nru dtkwidget-5.5.48/include/widgets/dpasswordedit.h dtkwidget-5.6.12/include/widgets/dpasswordedit.h --- dtkwidget-5.5.48/include/widgets/dpasswordedit.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dpasswordedit.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: 2015 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DPASSWORDEDIT_H +#define DPASSWORDEDIT_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DPasswordEditPrivate; +class LIBDTKWIDGETSHARED_EXPORT DPasswordEdit : public DLineEdit +{ + Q_OBJECT + Q_PROPERTY(bool isEchoMode READ isEchoMode NOTIFY echoModeChanged) + +public: + DPasswordEdit(QWidget *parent = nullptr); + + bool isEchoMode() const; + void setEchoMode(QLineEdit::EchoMode mode); + + void setEchoButtonIsVisible(bool visible); + bool echoButtonIsVisible () const; + +Q_SIGNALS: + void echoModeChanged(bool echoOn); + +protected: + Q_DISABLE_COPY(DPasswordEdit) + D_DECLARE_PRIVATE(DPasswordEdit) + Q_PRIVATE_SLOT(d_func(), void _q_toggleEchoMode()) + + void changeEvent(QEvent *event) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DPASSWORDEDIT_H diff -Nru dtkwidget-5.5.48/include/widgets/dpicturesequenceview.h dtkwidget-5.6.12/include/widgets/dpicturesequenceview.h --- dtkwidget-5.5.48/include/widgets/dpicturesequenceview.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dpicturesequenceview.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DPICTURESEQUENCEVIEW_H +#define DPICTURESEQUENCEVIEW_H + +#include +#include + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DPictureSequenceViewPrivate; +class LIBDTKWIDGETSHARED_EXPORT DPictureSequenceView : public QGraphicsView, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_PROPERTY(int speed READ speed WRITE setSpeed NOTIFY speedChanged) + Q_PROPERTY(bool singleShot READ singleShot WRITE setSingleShot) + +public: + DPictureSequenceView(QWidget *parent = nullptr); + + void setPictureSequence(const QString &srcFormat, const QPair &range, const int fieldWidth = 0, const bool autoScale = false); + void setPictureSequence(const QStringList &sequence, const bool autoScale = false); + void setPictureSequence(const QList &sequence, const bool autoScale = false); + void play(); + void pause(); + void stop(); + + int speed() const; + void setSpeed(int speed); + + bool singleShot() const; + void setSingleShot(bool singleShot); + +Q_SIGNALS: + void speedChanged(int speed) const; + void playEnd() const; + +private: + D_PRIVATE_SLOT(void _q_refreshPicture()) + + Q_DISABLE_COPY(DPictureSequenceView) + D_DECLARE_PRIVATE(DPictureSequenceView) +}; + +DWIDGET_END_NAMESPACE + +#endif // DPICTURESEQUENCEVIEW_H diff -Nru dtkwidget-5.5.48/include/widgets/dplatformwindowhandle.h dtkwidget-5.6.12/include/widgets/dplatformwindowhandle.h --- dtkwidget-5.5.48/include/widgets/dplatformwindowhandle.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dplatformwindowhandle.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DPLATFORMWINDOWHANDLE_H +#define DPLATFORMWINDOWHANDLE_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE +class QWidget; +QT_END_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE + +class DPlatformWindowHandle : public DPlatformHandle +{ + Q_OBJECT + +public: + explicit DPlatformWindowHandle(QWidget *widget, QObject *parent = nullptr); + + static void enableDXcbForWindow(QWidget *widget); + static void enableDXcbForWindow(QWidget *widget, bool redirectContent); + static bool isEnabledDXcb(const QWidget *widget); + + static bool setWindowBlurAreaByWM(QWidget *widget, const QVector &area); + static bool setWindowBlurAreaByWM(QWidget *widget, const QList &paths); + static bool setWindowWallpaperParaByWM(QWidget *widget, const QRect &area, WallpaperScaleMode sMode, WallpaperFillMode fMode); + + using DPlatformHandle::setWindowBlurAreaByWM; + using DPlatformHandle::setWindowWallpaperParaByWM; +}; + +DWIDGET_END_NAMESPACE + +#endif // DPLATFORMWINDOWHANDLE_H diff -Nru dtkwidget-5.5.48/include/widgets/dprintpickcolorwidget.h dtkwidget-5.6.12/include/widgets/dprintpickcolorwidget.h --- dtkwidget-5.5.48/include/widgets/dprintpickcolorwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dprintpickcolorwidget.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,120 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DPRINTPICKCOLORWIDGET_H +#define DPRINTPICKCOLORWIDGET_H +#include "qdbusinterface.h" +#include +#include + +#include +#include + +class QVBoxLayout; +DWIDGET_BEGIN_NAMESPACE +class DIconButton; +class DLineEdit; +class DLabel; +class DSlider; + +class ColorButton : public DPushButton +{ + Q_OBJECT +public: + ColorButton(QColor color, QWidget *parent = nullptr); +Q_SIGNALS: + void selectColorButton(QColor color); + void btnIsChecked(bool checked); + +protected: + void paintEvent(QPaintEvent *) override; + +private: + QColor m_color; + bool m_flag = false; + bool m_checked = false; +}; +class ColorLabel : public DLabel +{ + Q_OBJECT +public: + ColorLabel(DWidget *parent = nullptr); + ~ColorLabel(); + + //h∈(0, 360), s∈(0, 1), v∈(0, 1) + QColor getColor(qreal h, qreal s, qreal v); + void setHue(int hue); + + void pickColor(QPoint pos); + QCursor pickColorCursor(); + +Q_SIGNALS: + void clicked(); + void pickedColor(QColor color); + +protected: + void paintEvent(QPaintEvent *); + void enterEvent(QEvent *e); + void leaveEvent(QEvent *e); + void mousePressEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + +private: + QCursor m_lastCursor; + int m_hue = 0; + bool m_pressed; + QColor m_pickedColor; + QPoint m_clickedPos; + QPoint m_tipPoint; +}; +class ColorSlider : public QSlider +{ + Q_OBJECT +public: + ColorSlider(QWidget *parent = nullptr); + ~ColorSlider(); + + //h∈(0, 360), s∈(0, 1), v∈(0, 1) + QColor getColor(qreal h, qreal s, qreal v); + +protected: + void paintEvent(QPaintEvent *ev); + +private: + int m_value; + QImage m_backgroundImage; +}; +class DPrintPickColorWidget : public DWidget +{ + Q_OBJECT +public: + DPrintPickColorWidget(QWidget *parent = nullptr); + ~DPrintPickColorWidget(); + void initUI(); + void initConnection(); + void setRgbEdit(QColor color, bool btnColor = false); + void convertColor(QColor color, bool btnColor = false); +Q_SIGNALS: + void selectColorButton(QColor color); + void signalColorChanged(QColor color); +public Q_SLOTS: + void slotColorPick(QString uuid, QString colorName); + void slotEditColor(QString str); + +private: + QList btnlist; + QList colorList; + QButtonGroup *btnGroup; + DLineEdit *valueLineEdit; + DIconButton *pickColorBtn; + QDBusInterface *pinterface; + DLineEdit *rEdit; + DLineEdit *gEdit; + DLineEdit *bEdit; + ColorLabel *colorLabel; + ColorSlider *colorSlider; +}; +DWIDGET_END_NAMESPACE +#endif // DPRINTPICKCOLORWIDGET_H diff -Nru dtkwidget-5.5.48/include/widgets/dprintpreviewdialog.h dtkwidget-5.6.12/include/widgets/dprintpreviewdialog.h --- dtkwidget-5.5.48/include/widgets/dprintpreviewdialog.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dprintpreviewdialog.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,78 @@ +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DPRINTPREVIEWDIALOG_H +#define DPRINTPREVIEWDIALOG_H +#ifndef DTK_PRINTSUPPORT_PLUGIN +#define DTK_PRINTSUPPORT_PLUGIN +#endif + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE +class DPrintPreviewDialogPrivate; +class DPrintPreviewDialog : public DDialog +{ + Q_OBJECT +public: + explicit DPrintPreviewDialog(QWidget *parent = nullptr); + ~DPrintPreviewDialog() override; + + static void setPluginMimeData(const QVariant &mimeData); + static QVariant pluginMimeData(); + + static bool setCurrentPlugin(const QString &pluginName); + static QString currentPlugin(); + + static QStringList availablePlugins(); +Q_SIGNALS: + void paintRequested(DPrinter *printer); + void paintRequested(DPrinter *printer, const QVector &pageRange); + +private: + D_DECLARE_PRIVATE(DPrintPreviewDialog) + D_PRIVATE_SLOT(void _q_printerChanged(int)) + D_PRIVATE_SLOT(void _q_pageRangeChanged(int)) + D_PRIVATE_SLOT(void _q_pageMarginChanged(int)) + D_PRIVATE_SLOT(void _q_ColorModeChange(int)) + D_PRIVATE_SLOT(void _q_startPrint(bool)) + D_PRIVATE_SLOT(void _q_orientationChanged(int)) + D_PRIVATE_SLOT(void _q_customPagesFinished()) + D_PRIVATE_SLOT(void _q_marginspinChanged(double)) + D_PRIVATE_SLOT(void _q_marginEditFinished()) + D_PRIVATE_SLOT(void _q_currentPageSpinChanged(int)) + D_PRIVATE_SLOT(void _q_checkStateChanged(int)) + D_PRIVATE_SLOT(void _q_textWaterMarkModeChanged(int)) + D_PRIVATE_SLOT(void _q_customTextWatermarkFinished()) + D_PRIVATE_SLOT(void _q_colorButtonCliked(bool)) + D_PRIVATE_SLOT(void _q_selectColorButton(QColor)) + D_PRIVATE_SLOT(void _q_pagePersheetComboIndexChanged(int)) + D_PRIVATE_SLOT(void _q_printOrderComboIndexChanged(int)) + D_PRIVATE_SLOT(void _q_spinboxValueEmptyChecked(const QString &)) +public: + virtual bool event(QEvent *event) override; + bool eventFilter(QObject *watched, QEvent *event) override; + void setDocName(const QString &); + QString docName() const; + + bool setPrintFromPath(const QString &path = QString()); + QString printFromPath() const; + + bool setAsynPreview(int totalPage); + bool isAsynPreview() const; + + DPrintPreviewSettingInfo *createDialogSettingInfo(DPrintPreviewSettingInfo::SettingType type); + void updateDialogSettingInfo(DPrintPreviewSettingInfo *info); + + // QWidget interface +protected: + virtual void resizeEvent(QResizeEvent *event) override; + void timerEvent(QTimerEvent *event) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DPRINTPREVIEWDIALOG_H diff -Nru dtkwidget-5.5.48/include/widgets/dprintpreviewsettinginfo.h dtkwidget-5.6.12/include/widgets/dprintpreviewsettinginfo.h --- dtkwidget-5.5.48/include/widgets/dprintpreviewsettinginfo.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dprintpreviewsettinginfo.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,244 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DPRINTPREVIEWSETTINGS_H +#define DPRINTPREVIEWSETTINGS_H + +#include + +#include "dprintpreviewwidget.h" + +DWIDGET_BEGIN_NAMESPACE + +class DPrintPreviewSettingInfo +{ +public: + enum SettingType { + PS_Printer, + PS_Copies, + PS_PageRange, + PS_Orientation, + PS_PaperSize, + PS_PrintDuplex, + PS_NUpPrinting, + PS_PageOrder, + PS_ColorMode, + PS_PaperMargins, + PS_Scaling, + PS_Watermark, + PS_SettingsCount = 65535 + }; + + explicit DPrintPreviewSettingInfo(SettingType type); + virtual ~DPrintPreviewSettingInfo(); + + inline SettingType type() const { + return static_cast(t); + } + +private: + ushort t; +}; + +class DPrintPreviewPrinterInfo : public DPrintPreviewSettingInfo +{ +public: + DPrintPreviewPrinterInfo() + : DPrintPreviewSettingInfo(PS_Printer) + { + + } + + QStringList printers; +}; + +class DPrintPreviewCopiesInfo : public DPrintPreviewSettingInfo +{ +public: + DPrintPreviewCopiesInfo() + : DPrintPreviewSettingInfo(PS_Copies) + { + + } + + int copies; +}; + +class DPrintPreviewPageRangeInfo : public DPrintPreviewSettingInfo +{ +public: + DPrintPreviewPageRangeInfo() + : DPrintPreviewSettingInfo(PS_PageRange) + { + + } + + DPrintPreviewWidget::PageRange rangeType; + QString selectPages; +}; + +class DPrintPreviewOrientationInfo : public DPrintPreviewSettingInfo +{ +public: + DPrintPreviewOrientationInfo() + : DPrintPreviewSettingInfo(PS_Orientation) + { + + } + + DPrinter::Orientation orientationMode; +}; + +class DPrintPreviewPaperSizeInfo : public DPrintPreviewSettingInfo +{ +public: + DPrintPreviewPaperSizeInfo() + : DPrintPreviewSettingInfo(PS_PaperSize) + { + + } + + QStringList pageSize; +}; + +class DPrintPreviewPrintDuplexInfo : public DPrintPreviewSettingInfo +{ +public: + DPrintPreviewPrintDuplexInfo() + : DPrintPreviewSettingInfo(PS_PrintDuplex) + { + + } + + bool enable; + DPrinter::DuplexMode duplex; +}; + +class DPrintPreviewNUpPrintInfo : public DPrintPreviewSettingInfo +{ +public: + DPrintPreviewNUpPrintInfo() + : DPrintPreviewSettingInfo(PS_NUpPrinting) + { + + } + + bool enable; + DPrintPreviewWidget::Imposition imposition; + DPrintPreviewWidget::Order order; +}; + +class DPrintPreviewPageOrderInfo : public DPrintPreviewSettingInfo +{ +public: + enum PageOrder { + CollatePage, + InOrderPage + }; + enum OrderType { + FrontToBack, + BackToFront + }; + DPrintPreviewPageOrderInfo() + : DPrintPreviewSettingInfo(PS_PageOrder) + { + + } + + PageOrder pageOrder; + OrderType inOrdertype; +}; + +class DPrintPreviewColorModeInfo : public DPrintPreviewSettingInfo +{ +public: + DPrintPreviewColorModeInfo() + : DPrintPreviewSettingInfo(PS_ColorMode) + { + + } + + QStringList colorMode; +}; + +class DPrintPreviewPaperMarginsInfo : public DPrintPreviewSettingInfo +{ +public: + enum MarginType { + Narrow, + Normal, + Moderate, + Customize + }; + DPrintPreviewPaperMarginsInfo() + : DPrintPreviewSettingInfo(PS_PaperMargins) + { + + } + + MarginType marginType; + qreal topMargin; + qreal bottomMargin; + qreal leftMargin; + qreal rightMargin; +}; + +class DPrintPreviewScalingInfo : public DPrintPreviewSettingInfo +{ +public: + enum ScalingType { + ActualSize, + ScaleSize + }; + DPrintPreviewScalingInfo() + : DPrintPreviewSettingInfo(PS_Scaling) + { + + } + + ScalingType scalingType; + int scaleRatio; +}; + +class DPrintPreviewWatermarkInfo : public DPrintPreviewSettingInfo +{ +public: + enum WatermarkType { + TextWatermark, + ImageWatermark + }; + enum Layout { + Tiled, + Center + }; + enum TextType { + Confidential, + Draft, + Sample, + Custom + }; + + DPrintPreviewWatermarkInfo() + : DPrintPreviewSettingInfo(PS_Watermark) + { + + } + + bool opened; + int angle; + int size; + int transparency; + qreal rowSpacing; + qreal columnSpacing; + Layout layout; + WatermarkType currentWatermarkType; + TextType textType; + QString customText; + QStringList fontList; + QColor textColor; + QString imagePath; +}; + +DWIDGET_END_NAMESPACE +#endif // DPRINTPREVIEWSETTINGS_H diff -Nru dtkwidget-5.5.48/include/widgets/dprintpreviewsettinginterface.h dtkwidget-5.6.12/include/widgets/dprintpreviewsettinginterface.h --- dtkwidget-5.5.48/include/widgets/dprintpreviewsettinginterface.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dprintpreviewsettinginterface.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,85 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DPRINTPREVIEWSETTINGINTERFACE_H +#define DPRINTPREVIEWSETTINGINTERFACE_H + +#include +#include + +#include "dprintpreviewsettinginfo.h" + +DWIDGET_BEGIN_NAMESPACE + +class DPrintPreviewSettingInterface +{ +public: + enum SettingStatus { + Default, + Disabled, + Hidden + }; + + enum SettingSubControl { + SC_PrinterWidget, + SC_CopiesWidget, + SC_PageRangeWidget, + SC_PageRange_TypeControl, + SC_PageRange_SelectEdit, + SC_OrientationWidget, + SC_PaperSizeWidget, + SC_DuplexWidget, + SC_Duplex_TypeControl, + SC_NPrintWidget, + SC_NPrint_Numbers, + SC_NPrint_Layout, + SC_PageOrderWidget, + SC_PageOrder_SequentialPrint, + SC_PageOrder_TypeControl, + SC_ColorModeWidget, + SC_MarginWidget, + SC_Margin_TypeControl, + SC_Margin_AdjustContol, + SC_ScalingWidget, + SC_WatermarkWidget, + SC_WatermarkContentWidget, + SC_Watermark_TypeGroup, + SC_Watermark_TextType, + SC_Watermark_CustomText, + SC_Watermark_TextFont, + SC_Watermark_TextColor, + SC_Watermark_ImageEdit, + SC_Watermark_Layout, + SC_Watermark_Angle, + SC_Watermark_Size, + SC_Watermark_Transparency, + + SC_ControlCount + }; + + virtual ~DPrintPreviewSettingInterface() {} + + virtual QString name() const = 0; + inline virtual bool settingFilter(const QVariant &mimeData, DPrintPreviewSettingInfo *info) + { + Q_UNUSED(mimeData); + Q_UNUSED(info); + return false; + } + inline virtual SettingStatus settingStatus(const QVariant &mimeData, SettingSubControl control) + { + Q_UNUSED(mimeData); + Q_UNUSED(control); + return SettingStatus::Default; + } +}; + + +DWIDGET_END_NAMESPACE + +QT_BEGIN_NAMESPACE +#define SettingInterface_iid "org.deepin.dtk.printpreview.SettingInterface/1.0" +Q_DECLARE_INTERFACE(DTK_WIDGET_NAMESPACE::DPrintPreviewSettingInterface, SettingInterface_iid) +QT_END_NAMESPACE +#endif // DPRINTPREVIEWSETTINGINTERFACE_H diff -Nru dtkwidget-5.5.48/include/widgets/dprintpreviewwidget.h dtkwidget-5.6.12/include/widgets/dprintpreviewwidget.h --- dtkwidget-5.5.48/include/widgets/dprintpreviewwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dprintpreviewwidget.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,150 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DPRINTPREVIEWWIDGET_H +#define DPRINTPREVIEWWIDGET_H + +#include +#include +#include + +#include +#include +#include +#include + +#define private protected +#include +#undef private + +DGUI_USE_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE + +class DPrintPreviewWidgetPrivate; + +class DPrinter : public QPrinter +{ +public: + explicit DPrinter(PrinterMode mode = ScreenResolution); + ~DPrinter() {} + + void setPreviewMode(bool isPreview); + + QList getPrinterPages(); + +private: +}; + +class LIBDTKWIDGETSHARED_EXPORT DPrintPreviewWidget : public DFrame +{ + Q_OBJECT +public: + enum Imposition { // 并打 + One, // 单页 + OneRowTwoCol, // 一行两列 + TwoRowTwoCol, // 两行两列 + TwoRowThreeCol, // 两行三列 + ThreeRowThreeCol, // 三行三列 + FourRowFourCol // 四行四列 + }; + enum PageRange { + AllPage, + CurrentPage, + SelectPage + }; + enum Order { // 并打顺序 + L2R_T2B, // 从左到右,从上到下 + R2L_T2B, // 从右到左,从上到下 + T2B_L2R, // 从上到下,从左到右 + T2B_R2L, // 从上到下,从右到左 + Copy // 重复 + }; + + enum PrintMode { // 打印模式 + PrintToPrinter, // 打印到打印机 + PrintToPdf, // 打印到pdf + PrintToImage // 另存为图片 + }; + + explicit DPrintPreviewWidget(DPrinter *printer, QWidget *parent = nullptr); + ~DPrintPreviewWidget() override; + + void setVisible(bool visible) override; + void setPageRange(const QVector &rangePages); + void setPageRange(int from, int to); + void setPageRangeALL(); + D_DECL_DEPRECATED void setReGenerate(bool generate); + void setPageRangeMode(PageRange mode); + PageRange pageRangeMode(); + void reviewChange(bool generate); + int pagesCount(); + int currentPage(); + bool turnPageAble(); + void setColorMode(const DPrinter::ColorMode &colorMode); + void setOrientation(const DPrinter::Orientation &pageOrientation); + DPrinter::ColorMode getColorMode(); + void setScale(qreal scale); + qreal getScale() const; + void updateView(); + void updateWaterMark(); + void refreshBegin(); + void refreshEnd(); + void setWaterMarkType(int type); + void setWaterMargImage(const QImage &image); + void setWaterMarkRotate(qreal rotate); + void setWaterMarkScale(qreal scale); + void setWaterMarkOpacity(qreal opacity); + void setConfidentialWaterMark(); + void setDraftWaterMark(); + void setSampleWaterMark(); + void setCustomWaterMark(const QString &text); + void setTextWaterMark(const QString &text); + void setWaterMarkFont(const QFont &font); + QColor waterMarkColor() const; + void setWaterMarkColor(const QColor &color); + void setWaterMarkLayout(int layout); + void setImposition(Imposition im); + Imposition imposition() const; + void setOrder(Order order); + DPrintPreviewWidget::Order order() const; + void setPrintFromPath(const QString &path); + QString printFromPath() const; + void setPrintMode(PrintMode pt); + void setAsynPreview(int totalPage); + bool isAsynPreview() const; + void isPageByPage(int pageCopy,bool isFirst); + int targetPageCount(int pageCount); + int originPageCount(); + QByteArray printerColorModel() const; + +public Q_SLOTS: + void updatePreview(); + void turnFront(); + void turnBack(); + void turnBegin(); + void turnEnd(); + void setCurrentPage(int page); + void print(bool isSavedPicture = false); + void themeTypeChanged(DGuiApplicationHelper::ColorType themeType); + +Q_SIGNALS: + void paintRequested(DPrinter *printer); + void paintRequested(DPrinter *printer, const QVector &pageRange); + void previewChanged(); + void currentPageChanged(int page); + void totalPages(int); + void pagesCountChanged(int pages); + +private: + void timerEvent(QTimerEvent *event) override; + void setCurrentTargetPage(int page); + + D_DECLARE_PRIVATE(DPrintPreviewWidget) + friend class ContentItem; +}; + +DWIDGET_END_NAMESPACE + +#endif // DPRINTPREVIEWWIDGET_H diff -Nru dtkwidget-5.5.48/include/widgets/dprogressbar.h dtkwidget-5.6.12/include/widgets/dprogressbar.h --- dtkwidget-5.5.48/include/widgets/dprogressbar.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dprogressbar.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DPROGRESSBAR_H +#define DPROGRESSBAR_H + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DProgressBar : public QProgressBar, public DCORE_NAMESPACE::DObject +{ +public: + explicit DProgressBar(QWidget *parent = nullptr); + + QSize sizeHint() const override; + QSize minimumSizeHint() const override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DPROGRESSBAR_H diff -Nru dtkwidget-5.5.48/include/widgets/dsearchcombobox.h dtkwidget-5.6.12/include/widgets/dsearchcombobox.h --- dtkwidget-5.5.48/include/widgets/dsearchcombobox.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dsearchcombobox.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSEARCHCOMBOBOX_H +#define DSEARCHCOMBOBOX_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DSearchComboBoxPrivate; +class LIBDTKWIDGETSHARED_EXPORT DSearchComboBox : public DComboBox +{ + Q_OBJECT + Q_DISABLE_COPY(DSearchComboBox) + D_DECLARE_PRIVATE(DSearchComboBox) +public: + explicit DSearchComboBox(QWidget *parent = nullptr); + void setEditable(bool editable); + +protected: + void showPopup() override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DSEARCHCOMBOBOX_H diff -Nru dtkwidget-5.5.48/include/widgets/dsearchedit.h dtkwidget-5.6.12/include/widgets/dsearchedit.h --- dtkwidget-5.5.48/include/widgets/dsearchedit.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dsearchedit.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,48 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSEARCHEDIT_H +#define DSEARCHEDIT_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DSearchEditPrivate; +class LIBDTKWIDGETSHARED_EXPORT DSearchEdit : public DLineEdit +{ + Q_OBJECT + Q_PROPERTY(bool voiceInput READ isVoiceInput NOTIFY voiceChanged) + +public: + explicit DSearchEdit(QWidget *parent = nullptr); + ~DSearchEdit(); + + void setPlaceHolder(QString placeHolder); + QString placeHolder() const; + + void clear(); + void clearEdit(); + + bool isVoiceInput() const; + + void setPlaceholderText(const QString &text); + QString placeholderText() const; + +Q_SIGNALS: + void voiceInputFinished(); + void searchAborted(); + void voiceChanged(); + +protected: + Q_DISABLE_COPY(DSearchEdit) + D_DECLARE_PRIVATE(DSearchEdit) + Q_PRIVATE_SLOT(d_func(), void _q_toEditMode(bool)) + D_PRIVATE_SLOT(void _q_onVoiceActionTrigger(bool)) + D_PRIVATE_SLOT(void _q_clearFocus()) +}; + +DWIDGET_END_NAMESPACE + +#endif // DSEARCHEDIT_H diff -Nru dtkwidget-5.5.48/include/widgets/dsegmentedcontrol.h dtkwidget-5.6.12/include/widgets/dsegmentedcontrol.h --- dtkwidget-5.5.48/include/widgets/dsegmentedcontrol.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dsegmentedcontrol.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,83 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSEGMENTEDCONTROL_H +#define DSEGMENTEDCONTROL_H + +#include +#include +#include +#include +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED DSegmentedHighlight : public QToolButton +{ + Q_OBJECT + +public: + explicit DSegmentedHighlight(QWidget *parent = 0); +}; + +class DSegmentedControlPrivate; +class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DButtonBox") DSegmentedControl : public QWidget, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DSegmentedControl) + + Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged) + Q_PROPERTY(int count READ count) + Q_PROPERTY(int animationDuration READ animationDuration WRITE setAnimationDuration) + Q_PROPERTY(QEasingCurve::Type animationType READ animationType WRITE setAnimationType) +public: + explicit DSegmentedControl(QWidget *parent = 0); + + int count() const; + const DSegmentedHighlight *highlight() const; + int currentIndex() const; + QToolButton *at(int index) const; + QString getText(int index) const; + QIcon getIcon(int index) const; + int animationDuration() const; + int indexByTitle(const QString &title) const; + + QEasingCurve::Type animationType() const; + +public Q_SLOTS: + int addSegmented(const QString &title); + int addSegmented(const QIcon &icon, const QString &title); + void addSegmented(const QStringList &titleList); + void addSegmented(const QList &iconList, const QStringList &titleList); + void insertSegmented(int index, const QString &title); + void insertSegmented(int index, const QIcon &icon, const QString &title); + void removeSegmented(int index); + void clear(); + bool setCurrentIndex(int currentIndex); + bool setCurrentIndexByTitle(const QString &title); + void setText(int index, const QString &title); + void setIcon(int index, const QIcon &icon); + void setAnimationDuration(int animationDuration); + void setAnimationType(QEasingCurve::Type animationType); + +private Q_SLOTS: + void updateHighlightGeometry(bool animation = true); + void buttonClicked(); + +Q_SIGNALS: + void currentChanged(int index); + void currentTitleChanged(QString title); + void animationDurationChanged(int animationDuration); + +protected: + bool eventFilter(QObject *, QEvent *) override; + void resizeEvent(QResizeEvent *event) override; +}; + +DWIDGET_END_NAMESPACE +#endif // DSEGMENTEDCONTROL_H diff -Nru dtkwidget-5.5.48/include/widgets/dsettingsdialog.h dtkwidget-5.6.12/include/widgets/dsettingsdialog.h --- dtkwidget-5.5.48/include/widgets/dsettingsdialog.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dsettingsdialog.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,41 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#pragma once + +#include +#include + +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DSettingsWidgetFactory; +class DSettingsDialogPrivate; +class LIBDTKWIDGETSHARED_EXPORT DSettingsDialog : public DAbstractDialog +{ + Q_OBJECT +public: + DSettingsDialog(QWidget *parent = nullptr); + ~DSettingsDialog(); + + DSettingsWidgetFactory* widgetFactory() const; + bool groupIsVisible(const QString &groupKey) const; + void setResetVisible(bool visible); + void scrollToGroup(const QString &groupKey); //需要在对话框 show 以后使用 + void setIcon(const QIcon &icon); + +public Q_SLOTS: + void updateSettings(DTK_CORE_NAMESPACE::DSettings *settings); + void updateSettings(const QByteArray &translateContext, DTK_CORE_NAMESPACE::DSettings *settings); + void setGroupVisible(const QString &groupKey, bool visible); + +private: + QScopedPointer dd_ptr; + Q_DECLARE_PRIVATE_D(qGetPtrHelper(dd_ptr), DSettingsDialog) +}; + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/include/widgets/dsettingswidgetfactory.h dtkwidget-5.6.12/include/widgets/dsettingswidgetfactory.h --- dtkwidget-5.5.48/include/widgets/dsettingswidgetfactory.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dsettingswidgetfactory.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,48 @@ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#pragma once + +#include + +#include +#include + +#include + +DCORE_BEGIN_NAMESPACE +class DSettingsOption; +DCORE_END_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE + +class DSettingsWidgetFactoryPrivate; +class LIBDTKWIDGETSHARED_EXPORT DSettingsWidgetFactory : public QObject +{ + Q_OBJECT +public: + typedef QWidget *(WidgetCreateHandler)(QObject *); + typedef QPair (ItemCreateHandler)(QObject *); + + explicit DSettingsWidgetFactory(QObject *parent = Q_NULLPTR); + ~DSettingsWidgetFactory(); + + void registerWidget(const QString &viewType, std::function handler); + void registerWidget(const QString &viewType, std::function handler); + + QWidget *createWidget(QPointer option); + QWidget *createWidget(const QByteArray &translateContext, QPointer option); + QPair createItem(QPointer option) const; + QPair createItem(const QByteArray &translateContext, QPointer option) const; + + D_DECL_DEPRECATED static QWidget *createTwoColumWidget(DTK_CORE_NAMESPACE::DSettingsOption *option, QWidget *rightWidget); + D_DECL_DEPRECATED static QWidget *createTwoColumWidget(const QByteArray &translateContext, DTK_CORE_NAMESPACE::DSettingsOption *option, QWidget *rightWidget); + static QPair createStandardItem(const QByteArray &translateContext, DTK_CORE_NAMESPACE::DSettingsOption *option, QWidget *rightWidget); + +private: + QScopedPointer dd_ptr; + Q_DECLARE_PRIVATE_D(qGetPtrHelper(dd_ptr), DSettingsWidgetFactory) +}; + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/include/widgets/dshadowline.h dtkwidget-5.6.12/include/widgets/dshadowline.h --- dtkwidget-5.5.48/include/widgets/dshadowline.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dshadowline.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSHADOWLINE_H +#define DSHADOWLINE_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DShadowLinePrivate; +class LIBDTKWIDGETSHARED_EXPORT DShadowLine : public QWidget, public DCORE_NAMESPACE::DObject +{ + D_DECLARE_PRIVATE(DShadowLine) + +public: + explicit DShadowLine(QWidget *parent = nullptr); + + QSize sizeHint() const; + +protected: + void paintEvent(QPaintEvent *event) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DSHADOWLINE_H diff -Nru dtkwidget-5.5.48/include/widgets/dshortcutedit.h dtkwidget-5.6.12/include/widgets/dshortcutedit.h --- dtkwidget-5.5.48/include/widgets/dshortcutedit.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dshortcutedit.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,97 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSHORTCUTEDIT_H +#define DSHORTCUTEDIT_H + +#include +#include +#include +#include +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DShortcutEditLabel; +class D_DECL_DEPRECATED_X("Use DKeySequenceEdit instead.") LIBDTKWIDGETSHARED_EXPORT DShortcutEdit : public QFrame +{ + Q_OBJECT + +public: + DShortcutEdit(QWidget *parent = Q_NULLPTR); + + QSize sizeHint() const; + bool eventFilter(QObject *o, QEvent *e); + bool isValidShortcutKey(const QString & key); + const QMap &getKeyMapping() const; + const QList &getBlockShortcutKeysList() const; + +Q_SIGNALS: + void shortcutKeysChanged(const QString & shortcutKeys); + void shortcutKeysFinished(const QString & shortcutKeys); + void invalidShortcutKey(const QString & shortcutKeys); + +public Q_SLOTS: + void clearShortcutKey(); + void setShortcutKey(const QString & key); + void setKeyMapping(const QMap & mapping); + void setBlockShortcutKeysList(const QList & kList); + void setInValidState() const; + void setNormalState() const; + +private Q_SLOTS: + void toEchoMode(); + void toInputMode() const; + void shortcutKeyPress(QKeyEvent *e); + +private: + QString convertShortcutKeys(const QString & keys); + +private: + DShortcutEditLabel *m_keysLabel; + QLabel *m_keysEdit; + + QString m_shortcutKeys; + QList m_blockedShortcutKeys; + QMap m_keyMapping; + + static const QString DefaultTips; +}; + +class DShortcutEditLabel : public QLabel +{ + Q_OBJECT + Q_PROPERTY(QColor echoNormal MEMBER m_colorNormal NOTIFY colorSettingChange DESIGNABLE true SCRIPTABLE true) + Q_PROPERTY(QColor echoHover MEMBER m_colorHover NOTIFY colorSettingChange DESIGNABLE true SCRIPTABLE true) + Q_PROPERTY(QColor echoInvalid MEMBER m_colorInvalid NOTIFY colorSettingChange DESIGNABLE true SCRIPTABLE true) + +public: + enum EchoState {Normal = 1, Hover, Invalid}; + +public: + DShortcutEditLabel(QWidget * parent = 0); + + void setEchoState(const EchoState state); + +Q_SIGNALS: + void colorSettingChange(); + +private: + void enterEvent(QEvent *); + void leaveEvent(QEvent *); + +private: + QColor m_colorNormal; + QColor m_colorHover; + QColor m_colorInvalid; + + EchoState m_state = Normal; +}; + +DWIDGET_END_NAMESPACE + +#endif // DSHORTCUTEDIT_H diff -Nru dtkwidget-5.5.48/include/widgets/dsimplelistitem.h dtkwidget-5.6.12/include/widgets/dsimplelistitem.h --- dtkwidget-5.5.48/include/widgets/dsimplelistitem.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dsimplelistitem.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,60 @@ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSIMPLELISTITEM_H +#define DSIMPLELISTITEM_H + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DSimpleListItem : public QObject +{ + Q_OBJECT + +public: + DSimpleListItem(); + + /* + * The interface function that used to compare the two DSimpleListItem + * The DSimpleListView requires this interface to keep the selected items unchanged when refreshed + * + * \item any subclass of DSimpleListItem, you can use static_cast in implementation to access any attribute to compare two items + * \return return true if two items have same attribute, the compare method implement by subclass of DSimpleListItem + */ + + virtual bool sameAs(DSimpleListItem *item)=0; + + /* + * The interface function that used to draw background of DSimpleListItem. + * Such as background and selected effect. + * + * \rect row corresponding to the drawing of the rectangular area + * \painter the painter used to draw anything you want + * \index the index of DSimpleListItem, you can draw different rows effect based on the index, such as the zebra crossing + * \isSelect current item is selected, you can draw selected effect under content when isSelect is true + * \isHover current item is hovered, you can draw hover effect under content when isHover is true + */ + + virtual void drawBackground(QRect rect, QPainter *painter, int index, bool isSelect, bool isHover)=0; + + /* + * The interface function that used to draw foreground of DSimpleListItem. + * + * \rect column corresponding to the drawing of the rectangular area + * \painter the painter used to draw anything you want + * \column the column of DSimpleListItem, you can draw different column content based on the column index + * \index the index of DSimpleListItem, you can draw different rows effect based on the index, such as the zebra crossing + * \isSelect current item is selected, you can draw selected effect under content when isSelect is true + * \isHover current item is hovered, you can draw hover effect under content when isHover is true + */ + + virtual void drawForeground(QRect rect, QPainter *painter, int column, int index, bool isSelect, bool isHover)=0; +}; + +DWIDGET_END_NAMESPACE + +#endif diff -Nru dtkwidget-5.5.48/include/widgets/dsimplelistview.h dtkwidget-5.6.12/include/widgets/dsimplelistview.h --- dtkwidget-5.5.48/include/widgets/dsimplelistview.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dsimplelistview.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,270 @@ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSIMPLELISTVIEW_H +#define DSIMPLELISTVIEW_H + +#include +#include +#include +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +typedef bool (* SortAlgorithm) (const DSimpleListItem *item1, const DSimpleListItem *item2, bool descendingSort); +typedef bool (* SearchAlgorithm) (const DSimpleListItem *item, QString searchContent); + +class DSimpleListViewPrivate; +class LIBDTKWIDGETSHARED_EXPORT DSimpleListView : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + +public: + explicit DSimpleListView(QWidget *parent = 0); + ~DSimpleListView(); + + // DSimpleListView interfaces. + + /* + * Set row height of DSimpleListView. + * + * \height the height of row + */ + void setRowHeight(int height); + + /* + * Set column titles, widths and height. + * If you want some column use expand space, please set width with -1 + * Only allowed one -1 to set in width list. + * + * \titles a list to contains titles + * \widths the width of column, list length same as titles list + * \height height of titlebar, don't display titlebar if set height with 0 + */ + void setColumnTitleInfo(QList titles, QList widths, int height); + + /* + * Set column hide flags. + * At least have false in hide flags list, and hide flags count must same as titles list. + * + * \toggleHideFlags the hide flags to control column wether toggle show/hide. + * \alwaysVisibleColumn the column index that column is always visible, default is -1, mean no column can always visible. + */ + void setColumnHideFlags(QList toggleHideFlags, int alwaysVisibleColumn=-1); + + /* + * Set column sorting algorithms. + * Note SortAlgorithm function type must be 'static', otherwise function pointer can't match type. + * + * \algorithms a list of SortAlgorithm, SortAlgorithm is function pointer, it's type is: 'bool (*) (const DSimpleListItem *item1, const DSimpleListItem *item2, bool descendingSort)' + * \sortColumn default sort column, -1 mean don't sort any column default + * \descendingSort whether sort column descending, default is false + */ + void setColumnSortingAlgorithms(QList *algorithms, int sortColumn=-1, bool descendingSort=false); + + /* + * Set search algorithm to filter match items. + * + * \algorithm the search algorithm, it's type is: 'bool (*) (const DSimpleListItem *item, QString searchContent)' + */ + void setSearchAlgorithm(SearchAlgorithm algorithm); + + /* + * Set radius to clip listview. + * + * \radius the radius of clip area, default is 0 pixel. + */ + void setClipRadius(int radius); + + /* + * Set frame details. + * + * \enableFrame draw frame if enableFrame is true, default is false + * the frame color, default is black + * \opacity the frame opacity, default is 0.1 + */ + void setFrame(bool enableFrame, QColor color=QColor("#000000"), double opacity=0.1); + + /* + * Add DSimpleListItem list to ListView. + * If user has click title to sort, sort items after add items to list. + * + * \items List of LiteItem* + */ + void addItems(QList items); + + /* + * Remove DSimpleListItem from list. + * + * \item item to remove + */ + void removeItem(DSimpleListItem* item); + + /* + * Clear items from DSimpleListView. + */ + void clearItems(); + + /* + * Add DSimpleListItem list to mark selected effect in ListView. + * + * \items List of DSimpleListItem* to mark selected + * \recordLastSelection record last selection item to make selected operation continuously, default is true + */ + void addSelections(QList items, bool recordLastSelection=true); + + /* + * Clear selection items from DSimpleListView. + * + * \clearLastSelection clear last selection item if option is true, default is true + */ + void clearSelections(bool clearLastSelection=true); + + /* + * Get selection items. + * + * \return List of DSimpleListItem* to mark selected + */ + QList getSelections(); + + /* + * Refresh all items in DSimpleListView. + * This function is different that addItems is: it will clear items first before add new items. + * This function will keep selection status and scroll offset when add items. + * + * \items List of DSimpleListItem* to add + */ + void refreshItems(QList items); + + /* + * Search + */ + void search(QString searchContent); + + /* + * Set single selection. + */ + void setSingleSelect(bool singleSelect); + + /* + * Keep select items when click blank area. + */ + void keepSelectWhenClickBlank(bool keep); + + // DSimpleListView operations. + void selectAllItems(); + void selectFirstItem(); + void selectLastItem(); + void selectNextItem(); + void selectPrevItem(); + + void shiftSelectPageDown(); + void shiftSelectPageUp(); + void shiftSelectToEnd(); + void shiftSelectToHome(); + void shiftSelectToNext(); + void shiftSelectToPrev(); + + void scrollPageDown(); + void scrollPageUp(); + + void ctrlScrollPageDown(); + void ctrlScrollPageUp(); + void ctrlScrollToEnd(); + void ctrlScrollToHome(); + +protected: + virtual void leaveEvent(QEvent * event); + + QPixmap arrowDownDarkHoverImage; + QPixmap arrowDownDarkNormalImage; + QPixmap arrowDownDarkPressImage; + QPixmap arrowDownHoverImage; + QPixmap arrowDownLightHoverImage; + QPixmap arrowDownLightNormalImage; + QPixmap arrowDownLightPressImage; + QPixmap arrowDownNormalImage; + QPixmap arrowDownPressImage; + QPixmap arrowUpDarkHoverImage; + QPixmap arrowUpDarkNormalImage; + QPixmap arrowUpDarkPressImage; + QPixmap arrowUpHoverImage; + QPixmap arrowUpLightHoverImage; + QPixmap arrowUpLightNormalImage; + QPixmap arrowUpLightPressImage; + QPixmap arrowUpNormalImage; + QPixmap arrowUpPressImage; + QString backgroundColor = "#ffffff"; + QString scrollbarColor = "#ffffff"; + QString searchColor = "#000000"; + QString titleAreaColor = "#ffffff"; + QString titleColor = "#000000"; + QString titleLineColor = "#000000"; + QColor frameColor = QColor("#000000"); + double backgroundOpacity = 0.03; + double frameOpacity = 0.1; + double titleAreaOpacity = 0.02; + int titleSize = 10; + qreal scrollbarFrameHoverOpacity = 0; + qreal scrollbarFrameNormalOpacity = 0; + qreal scrollbarFramePressOpacity = 0; + qreal scrollbarHoverOpacity = 0.7; + qreal scrollbarNormalOpacity = 0.5; + qreal scrollbarPressOpacity = 0.8; + +Q_SIGNALS: + void rightClickItems(QPoint pos, QList items); + void changeColumnVisible(int index, bool visible, QList columnVisibles); + void changeSortingStatus(int index, bool sortingOrder); + void changeHoverItem(QPoint pos, DSimpleListItem* item, int columnIndex); + + void mouseHoverChanged(DSimpleListItem* oldItem, DSimpleListItem* newItem, int columnIndex, QPoint pos); + void mousePressChanged(DSimpleListItem* item, int columnIndex, QPoint pos); + void mouseReleaseChanged(DSimpleListItem* item, int columnIndex, QPoint pos); + +protected: + bool eventFilter(QObject *, QEvent *event); + void keyPressEvent(QKeyEvent *keyEvent); + void mouseMoveEvent(QMouseEvent *mouseEvent); + void mousePressEvent(QMouseEvent *mouseEvent); + void mouseReleaseEvent(QMouseEvent *mouseEvent); + void paintEvent(QPaintEvent *); + void wheelEvent(QWheelEvent *event); + + void paintScrollbar(QPainter *painter); + + void selectPrevItemWithOffset(int scrollOffset); + void selectNextItemWithOffset(int scrollOffset); + void shiftSelectNextItemWithOffset(int scrollOffset); + void shiftSelectPrevItemWithOffset(int scrollOffset); + + int getBottomRenderOffset(); + int getScrollbarY(); + int getScrollAreaHeight(); + int getScrollbarHeight(); + + QList getRenderWidths(); + + void shiftSelectItemsWithBound(int selectionStartIndex, int selectionEndIndex); + int adjustRenderOffset(int offset); + + void startScrollbarHideTimer(); + + bool isMouseAtScrollArea(int x); + bool isMouseAtTitleArea(int y); + + QList columnVisibles; + +private Q_SLOTS: + void hideScrollbar(); + +private: + D_DECLARE_PRIVATE(DSimpleListView) +}; + +DWIDGET_END_NAMESPACE + +#endif diff -Nru dtkwidget-5.5.48/include/widgets/dslider.h dtkwidget-5.6.12/include/widgets/dslider.h --- dtkwidget-5.5.48/include/widgets/dslider.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dslider.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,118 @@ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSLIDER_H +#define DSLIDER_H + +#include +#include +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DSliderPrivate; +class LIBDTKWIDGETSHARED_EXPORT DSlider : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_DISABLE_COPY(DSlider) + D_DECLARE_PRIVATE(DSlider) +public: + enum SliderIcons { + LeftIcon, + RightIcon + }; + DSlider(Qt::Orientation orientation = Qt::Horizontal, QWidget *parent = nullptr); + + Qt::Orientation orientation() const; + + QSlider *slider(); + + void setLeftIcon(const QIcon &left); + void setRightIcon(const QIcon &right); + + void setIconSize(const QSize &size); + + void setMinimum(int min); + int minimum() const; + + void setValue(int value); + int value() const; + + void setPageStep(int pageStep); + int pageStep() const; + + void setMaximum(int max); + int maximum() const; + + void setLeftTicks(const QStringList &info); + void setRightTicks(const QStringList &info); + + void setAboveTicks(const QStringList &info); + void setBelowTicks(const QStringList &info); + + void setMarkPositions(QList list); + + void setMouseWheelEnabled(bool enabled); + + void setTipValue(const QString &value); + + QSlider::TickPosition tickPosition() const; + QSize sizeHint() const override; + + void setHandleVisible(bool b); + bool handleVisible() const; + + void setEnabledAcrossStyle(bool enabled); + +Q_SIGNALS: + void valueChanged(int value); + + void sliderPressed(); + void sliderMoved(int position); + void sliderReleased(); + + void rangeChanged(int min, int max); + + void actionTriggered(int action); + void iconClicked(SliderIcons icon, bool checked); + +protected: + DSlider(DSliderPrivate &q, QWidget *parent); + + bool event(QEvent *event) override; + bool eventFilter(QObject *watched, QEvent *event) override; +}; + +class SpecialSlider : public QSlider { +public: + SpecialSlider(Qt::Orientation orientation, QWidget *parent = nullptr) : QSlider(orientation, parent) { + } + + void paintEvent(QPaintEvent *ev) { + Q_UNUSED(ev) + QPainter p(this); + QStyleOptionSlider opt; + initStyleOption(&opt); + + DSlider* dSlider = qobject_cast(this->parent()); + + if (!dSlider) + return; + + if (dSlider->handleVisible()) + opt.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderHandle; + else + opt.subControls = QStyle::SC_SliderGroove; + + style()->drawComplexControl(QStyle::CC_Slider, &opt, &p, parentWidget()); + } +}; + +DWIDGET_END_NAMESPACE + +#endif // DSLIDER_H diff -Nru dtkwidget-5.5.48/include/widgets/dspinbox.h dtkwidget-5.6.12/include/widgets/dspinbox.h --- dtkwidget-5.5.48/include/widgets/dspinbox.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dspinbox.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,80 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSPINBOX_H +#define DSPINBOX_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DSpinBoxPrivate; +class LIBDTKWIDGETSHARED_EXPORT DSpinBox : public QSpinBox, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(bool alert READ isAlert WRITE setAlert NOTIFY alertChanged) + Q_PROPERTY(int defaultValue READ defaultValue WRITE setDefaultValue NOTIFY defaultValueChanged) + +public: + explicit DSpinBox(QWidget *parent = nullptr); + + QLineEdit *lineEdit() const; + + bool isAlert() const; + void showAlertMessage(const QString &text, int duration = 3000); + void showAlertMessage(const QString &text, QWidget *follower, int duration = 3000); + D_DECL_DEPRECATED int defaultValue() const; + + void setEnabledEmbedStyle(bool enabled); + +public Q_SLOTS: + void setAlert(bool alert); + D_DECL_DEPRECATED void setDefaultValue(int defaultValue); + +Q_SIGNALS: + void alertChanged(bool alert); + D_DECL_DEPRECATED void defaultValueChanged(int defaultValue); + +private: + D_DECLARE_PRIVATE(DSpinBox) +}; + +class DDoubleSpinBoxPrivate; +class LIBDTKWIDGETSHARED_EXPORT DDoubleSpinBox : public QDoubleSpinBox, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(bool alert READ isAlert WRITE setAlert NOTIFY alertChanged) + Q_PROPERTY(double defaultValue READ defaultValue WRITE setDefaultValue NOTIFY defaultValueChanged) + +public: + explicit DDoubleSpinBox(QWidget *parent = nullptr); + + bool isAlert() const; + void showAlertMessage(const QString &text, int duration = 3000); + void showAlertMessage(const QString &text, QWidget *follower, int duration = 3000); + D_DECL_DEPRECATED double defaultValue() const; + + QLineEdit *lineEdit() const; + void setEnabledEmbedStyle(bool enabled); + +public Q_SLOTS: + void setAlert(bool alert); + D_DECL_DEPRECATED void setDefaultValue(double defaultValue); + +Q_SIGNALS: + void alertChanged(bool alert); + D_DECL_DEPRECATED void defaultValueChanged(double defaultValue); + +private: + D_DECLARE_PRIVATE(DDoubleSpinBox) +}; + +DWIDGET_END_NAMESPACE + +#endif // DSPINBOX_H diff -Nru dtkwidget-5.5.48/include/widgets/dspinner.h dtkwidget-5.6.12/include/widgets/dspinner.h --- dtkwidget-5.5.48/include/widgets/dspinner.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dspinner.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,42 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSPINNER_H +#define DSPINNER_H + +#include +#include + +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DSpinnerPrivate; +class LIBDTKWIDGETSHARED_EXPORT DSpinner : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT +public: + explicit DSpinner(QWidget *parent = 0); + ~DSpinner(); + + bool isPlaying() const; + +public Q_SLOTS: + void start(); + void stop(); + void setBackgroundColor(QColor color); + +protected: + void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; + void changeEvent(QEvent *e) override; + +private: + D_DECLARE_PRIVATE(DSpinner) +}; + +DWIDGET_END_NAMESPACE + +#endif diff -Nru dtkwidget-5.5.48/include/widgets/dstackwidget.h dtkwidget-5.6.12/include/widgets/dstackwidget.h --- dtkwidget-5.5.48/include/widgets/dstackwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dstackwidget.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,137 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSTACKWIDGET_H +#define DSTACKWIDGET_H + +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DStackWidget; +class DAbstractStackWidgetTransitionPrivate; +class DAbstractStackWidgetTransition : public QObject, public DTK_CORE_NAMESPACE::DObject +{ +public: + enum TransitionType{ + Push, + Pop + }; + + struct TransitionInfo{ + TransitionType type; + DStackWidget *stackWidget = nullptr; + QWidget *oldWidget = nullptr; + QWidget *newWidget = nullptr; + }; + + explicit DAbstractStackWidgetTransition(QObject *parent = 0); + + virtual void beginTransition(const TransitionInfo &info); + virtual QVariantAnimation *animation() const; + +protected: + virtual void updateVariant(const QVariant& variant) = 0; + +protected: + explicit DAbstractStackWidgetTransition(DAbstractStackWidgetTransitionPrivate &dd, + QObject *parent = 0); + + const TransitionInfo &info() const; + +private: + D_DECLARE_PRIVATE(DAbstractStackWidgetTransition) +}; + +class DSlideStackWidgetTransition : public DAbstractStackWidgetTransition +{ + Q_OBJECT + +public: + explicit DSlideStackWidgetTransition(QObject *parent = 0); + + void beginTransition(const TransitionInfo &info) Q_DECL_OVERRIDE; + +private Q_SLOTS: + void updateVariant(const QVariant &variant) Q_DECL_OVERRIDE; +}; + +class DStackWidgetPrivate; +class DStackWidget : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + ///busy is true if a transition is running, and false otherwise. + Q_PROPERTY(bool busy READ busy NOTIFY busyChanged FINAL) + ///The number of widgets currently pushed onto the stack. + Q_PROPERTY(int depth READ depth NOTIFY depthChanged FINAL) + Q_PROPERTY(int currentIndex READ currentIndex NOTIFY currentIndexChanged) + Q_PROPERTY(QWidget* currentWidget READ currentWidget NOTIFY currentWidgetChanged) + Q_PROPERTY(DAbstractStackWidgetTransition* transition READ transition WRITE setTransition) + Q_PROPERTY(int animationDuration READ animationDuration WRITE setAnimationDuration) + Q_PROPERTY(QEasingCurve::Type animationType READ animationType WRITE setAnimationType) + +public: + explicit DStackWidget(QWidget *parent = 0); + + bool busy() const; + int depth() const; + + int currentIndex() const; + QWidget* currentWidget() const; + + DAbstractStackWidgetTransition* transition() const; + int animationDuration() const; + QEasingCurve::Type animationType() const; + +public Q_SLOTS: + int pushWidget(QWidget *widget, bool enableTransition = true); + void insertWidget(int index, QWidget *widget, bool enableTransition = true); + + /// If widget is nullptr, all widgets up to the currentIndex+count widgets will be popped. + /// If not specified, all widgets up to the depthOf(widget)+count widgets will be popped. + void popWidget(QWidget *widget = nullptr, bool isDelete = true, + int count = 1, bool enableTransition = true); + void clear(); + + int indexOf(QWidget *widget) const; + QWidget* getWidgetByIndex(int index) const; + + void setTransition(DAbstractStackWidgetTransition* transition); + void setAnimationDuration(int animationDuration); + void setAnimationType(QEasingCurve::Type animationType); + +Q_SIGNALS: + void busyChanged(bool busy); + void depthChanged(int depth); + + void currentIndexChanged(int currentIndex); + void currentWidgetChanged(QWidget* currentWidget); + + void widgetDepthChanged(QWidget *widget, int depth); + + void switchWidgetFinished(); + +protected: + explicit DStackWidget(DStackWidgetPrivate &dd, QWidget *parent = 0); + + void setCurrentIndex(int currentIndex, + DAbstractStackWidgetTransition::TransitionType type = DAbstractStackWidgetTransition::Push, + bool enableTransition = true); + void setCurrentWidget(QWidget* currentWidget, + DAbstractStackWidgetTransition::TransitionType type = DAbstractStackWidgetTransition::Push, + bool enableTransition = true); + +private: + Q_DISABLE_COPY(DStackWidget) + D_DECLARE_PRIVATE(DStackWidget) +}; + +DWIDGET_END_NAMESPACE + +#endif // DSTACKWIDGET_H diff -Nru dtkwidget-5.5.48/include/widgets/dstyleditemdelegate.h dtkwidget-5.6.12/include/widgets/dstyleditemdelegate.h --- dtkwidget-5.5.48/include/widgets/dstyleditemdelegate.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dstyleditemdelegate.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,140 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSTYLEDITEMDELEGATE_H +#define DSTYLEDITEMDELEGATE_H + +#include +#include +#include +#include + +#include +#include +#include +#include + +DGUI_BEGIN_NAMESPACE +class DDciIcon; +DGUI_END_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE + +class DViewItemActionPrivate; +class DViewItemAction : public QAction, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DViewItemAction) + +public: + explicit DViewItemAction(Qt::Alignment alignment = Qt::Alignment(), const QSize &iconSize = QSize(), + const QSize &maxSize = QSize(), bool clickable = false); + D_DECL_DEPRECATED explicit DViewItemAction(Qt::Alignment alignment, const QSize &iconSize, + const QSize &maxSize, bool clickable, QObject *parent); + + Qt::Alignment alignment() const; + QSize iconSize() const; + QSize maximumSize() const; + + QMargins clickAreaMargins() const; + void setClickAreaMargins(const QMargins &margins); + + void setTextColorRole(DPalette::ColorType role); + void setTextColorRole(DPalette::ColorRole role); + DPalette::ColorType textColorType() const; + DPalette::ColorRole textColorRole() const; + + void setFontSize(DFontSizeManager::SizeType size); + QFont font() const; + + bool isClickable() const; + + void setWidget(QWidget *widget); + QWidget *widget() const; + + void setDciIcon(const DDciIcon &dciIcon); + DDciIcon dciIcon() const; +}; +typedef QList DViewItemActionList; + +class DStyledItemDelegatePrivate; +class DStyledItemDelegate : public QStyledItemDelegate, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT + D_DECLARE_PRIVATE(DStyledItemDelegate) + + Q_PROPERTY(BackgroundType backgroundType READ backgroundType WRITE setBackgroundType) + Q_PROPERTY(QMargins margins READ margins WRITE setMargins) + Q_PROPERTY(QSize itemSize READ itemSize WRITE setItemSize) + +public: + enum BackgroundType { + NoBackground = 0, + ClipCornerBackground = 1, + RoundedBackground = 2, + BackgroundType_Mask = 0xff, + NoNormalState = 0x100 + }; + + explicit DStyledItemDelegate(QAbstractItemView *parent = nullptr); + + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; + + void updateEditorGeometry(QWidget *editor, + const QStyleOptionViewItem &option, + const QModelIndex &index) const override; + + BackgroundType backgroundType() const; + QMargins margins() const; + QSize itemSize() const; + int spacing() const; + +public Q_SLOTS: + void setBackgroundType(BackgroundType backgroundType); + void setMargins(const QMargins margins); + void setItemSize(QSize itemSize); + void setItemSpacing(int spacing); + +protected: + void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override; + bool eventFilter(QObject *object, QEvent *event) override; +}; + +class DStandardItem : public QStandardItem +{ +public: + using QStandardItem::QStandardItem; + virtual ~DStandardItem(); + + void setActionList(Qt::Edge edge, const DViewItemActionList &list); + DViewItemActionList actionList(Qt::Edge edge) const; + + void setTextActionList(const DViewItemActionList &list); + DViewItemActionList textActionList() const; + + void setTextColorRole(DPalette::ColorType role); + void setTextColorRole(DPalette::ColorRole role); + DPalette::ColorType textColorType() const; + DPalette::ColorRole textColorRole() const; + + void setBackgroundRole(DPalette::ColorType role); + void setBackgroundRole(DPalette::ColorRole role); + DPalette::ColorType backgroundType() const; + DPalette::ColorRole backgroundRole() const; + + void setFontSize(DFontSizeManager::SizeType size); + QFont font() const; + + void setDciIcon(const DDciIcon &dciIcon); + DDciIcon dciIcon() const; + + virtual QStandardItem *clone() const override; +}; + +DWIDGET_END_NAMESPACE + +Q_DECLARE_METATYPE(DTK_WIDGET_NAMESPACE::DViewItemActionList) + +#endif // DSTYLEDITEMDELEGATE_H diff -Nru dtkwidget-5.5.48/include/widgets/dstyle.h dtkwidget-5.6.12/include/widgets/dstyle.h --- dtkwidget-5.5.48/include/widgets/dstyle.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dstyle.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,452 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSTYLE_H +#define DSTYLE_H + +#include +#include +#include + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE +class QTextLayout; +QT_END_NAMESPACE + +DGUI_USE_NAMESPACE +DWIDGET_BEGIN_NAMESPACE + +namespace DDrawUtils +{ +enum Corner { + TopLeftCorner = 0x00001, + TopRightCorner = 0x00002, + BottomLeftCorner = 0x00004, + BottomRightCorner = 0x00008 +}; +Q_DECLARE_FLAGS(Corners, Corner) + +void drawShadow(QPainter *pa, const QRect &rect, qreal xRadius, qreal yRadius, const QColor &sc, qreal radius, const QPoint &offset); +void drawShadow(QPainter *pa, const QRect &rect, const QPainterPath &path, const QColor &sc, int radius, const QPoint &offset); +void drawRoundedRect(QPainter *pa, const QRect &rect, qreal xRadius, qreal yRadius, Corners corners, Qt::SizeMode mode = Qt::AbsoluteSize); +void drawFork(QPainter *pa, const QRectF &rect, const QColor &color, int width = 2); +void drawMark(QPainter *pa, const QRectF &rect, const QColor &boxInside, const QColor &boxOutside, const int penWidth, const int outLineLeng = 2); +void drawBorder(QPainter *pa, const QRectF &rect, const QBrush &brush, int borderWidth, int radius); +void drawArrow(QPainter *pa, const QRectF &rect, const QColor &color, Qt::ArrowType arrow, int width = 2); +void drawPlus(QPainter *painter, const QRectF &rect, const QColor &color , qreal width); +void drawSubtract(QPainter *painter, const QRectF &rect, const QColor &color, qreal width); + +void drawForkElement(QPainter *pa, const QRectF &rect); +void drawArrowElement(Qt::ArrowType arrow, QPainter *pa, const QRectF &rect); +void drawDecreaseElement(QPainter *pa, const QRectF &rect); +void drawIncreaseElement(QPainter *pa, const QRectF &rect); +void drawMarkElement(QPainter *pa, const QRectF &rect); +void drawSelectElement(QPainter *pa, const QRectF &rect); +void drawEditElement(QPainter *pa, const QRectF &rect); +void drawExpandElement(QPainter *pa, const QRectF &rect); +void drawReduceElement(QPainter *pa, const QRectF &rect); +void drawLockElement(QPainter *pa, const QRectF &rect); +void drawUnlockElement(QPainter *pa, const QRectF &rect); +void drawMediaVolumeElement(QPainter *pa, const QRectF &rect); +void drawMediaVolumeFullElement(QPainter *pa, const QRectF &rect); +void drawMediaVolumeMutedElement(QPainter *pa, const QRectF &rect); +void drawMediaVolumeLeftElement(QPainter *pa, const QRectF &rect); +void drawMediaVolumeRightElement(QPainter *pa, const QRectF &rect); +void drawArrowEnter(QPainter *pa, const QRectF &rect); +void drawArrowLeave(QPainter *pa, const QRectF &rect); +void drawArrowNext(QPainter *pa, const QRectF &rect); +void drawArrowPrev(QPainter *pa, const QRectF &rect); +void drawShowPassword(QPainter *pa, const QRectF &rect); +void drawHidePassword(QPainter *pa, const QRectF &rect); +void drawCloseButton(QPainter *pa, const QRectF &rect); +void drawIndicatorMajuscule(QPainter *pa, const QRectF &rect); +void drawIndicatorUnchecked(QPainter *pa, const QRectF &rect); +void drawIndicatorChecked(QPainter *pa, const QRectF &rect); +void drawDeleteButton(QPainter *pa, const QRectF &rect); +void drawAddButton(QPainter *pa, const QRectF &rect); + +void drawTitleBarMenuButton(QPainter *pa, const QRectF &rect); +void drawTitleBarMinButton(QPainter *pa, const QRectF &rect); +void drawTitleBarMaxButton(QPainter *pa, const QRectF &rect); +void drawTitleBarCloseButton(QPainter *pa, const QRectF &rect); +void drawTitleBarNormalButton(QPainter *pa, const QRectF &rect); +void drawTitleQuitFullButton(QPainter *pa, const QRectF &rect); +void drawArrowUp(QPainter *pa, const QRectF &rect); +void drawArrowDown(QPainter *pa, const QRectF &rect); +void drawArrowLeft(QPainter *pa, const QRectF &rect); +void drawArrowRight(QPainter *pa, const QRectF &rect); +void drawArrowBack(QPainter *pa, const QRectF &rect); +void drawArrowForward(QPainter *pa, const QRectF &rect); +void drawLineEditClearButton(QPainter *pa, const QRectF &rect); + +Q_DECLARE_OPERATORS_FOR_FLAGS(Corners) +} + +class DViewItemAction; +class DStyle : public QCommonStyle +{ + Q_OBJECT + +public: + enum PrimitiveElement { + PE_ItemBackground = QStyle::PE_CustomBase + 1, //列表项的背景色 + PE_IconButtonPanel, + PE_IconButtonIcon, + PE_Icon, + PE_SwitchButtonGroove, + PE_SwitchButtonHandle, + PE_FloatingWidget, + PE_CustomBase = QStyle::PE_CustomBase + 0xf00000 + }; + + enum ControlElement { + CE_IconButton = QStyle::CE_CustomBase + 1, + CE_SwitchButton, + CE_FloatingWidget, + CE_ButtonBoxButton, + CE_ButtonBoxButtonBevel, + CE_ButtonBoxButtonLabel, + CE_TextButton, + CE_CustomBase = QStyle::CE_CustomBase + 0xf00000 + }; + + enum PixelMetric { + PM_FocusBorderWidth = QStyle::PM_CustomBase + 1, //控件焦点状态的边框宽度 + PM_FocusBorderSpacing, //控件内容和border之间的间隔 + PM_FrameRadius, //控件的圆角大小 + PM_ShadowRadius, //控件阴影效果的半径 + PM_ShadowHOffset, //阴影在水平方向的偏移 + PM_ShadowVOffset, //阴影在竖直方向的偏移 + PM_FrameMargins, //控件的margins区域,控件内容 = 控件大小 - FrameMargins + PM_IconButtonIconSize, + PM_TopLevelWindowRadius, //窗口的圆角大小 + PM_SwitchButtonHandleWidth, + PM_SwithcButtonHandleHeight, + PM_FloatingWidgetRadius, //(基类)的圆角半径:控件内容-Radius < 控件内容 < 控件显示大小 + PM_FloatingWidgetShadowRadius, //(基类)的阴影Radius区域:控件内容 < 控件内容+阴影margins < 控件内容+阴影margins+阴影Radius = 控件显示大小 + PM_FloatingWidgetShadowMargins, //(基类)阴影的宽度 = 控件显示大小 - 阴影Radius - 控件内容 + PM_FloatingWidgetShadowHOffset, //(基类)的阴影水平偏移 + PM_FloatingWidgetShadowVOffset, //(基类)的阴影竖直偏移 + PM_ContentsMargins, //内容的边距(一般只用于左右边距) + PM_ContentsSpacing, //内容的间距(可用于列表项中每一项的距离) + PM_ButtonMinimizedSize, //按钮控件的最小大小 + PM_ToolTipLabelWidth, // Maximum width that a ToolTip label can reach + PM_FloatingButtonFrameMargin, // Frame margin that a floatingbutton has + PM_CustomBase = QStyle::PM_CustomBase + 0xf00000 + }; + + enum SubElement { + SE_IconButtonIcon = QStyle::SE_CustomBase + 1, + SE_SwitchButtonGroove, + SE_SwitchButtonHandle, + SE_FloatingWidget, + SE_ButtonBoxButtonContents, + SE_ButtonBoxButtonFocusRect, + SE_CustomBase = QStyle::SE_CustomBase + 0xf00000 + }; + + enum ContentsType { + CT_IconButton = QStyle::CT_CustomBase + 1, + CT_SwitchButton, + CT_FloatingWidget, + CT_ButtonBoxButton, + CT_CustomBase = QStyle::CT_CustomBase + 0xf00000 + }; + + enum StyleState { + SS_NormalState = 0x00000000, + SS_HoverState = 0x00000001, + SS_PressState = 0x00000002, + SS_StateCustomBase = 0x000000f0, + + StyleState_Mask = 0x000000ff, + SS_CheckedFlag = 0x00000100, + SS_SelectedFlag = 0x00000200, + SS_FocusFlag = 0x00000400, + SS_FlagCustomBase = 0xf00000 + }; + Q_DECLARE_FLAGS(StateFlags, StyleState) + + enum StandardPixmap { + SP_ForkElement = QStyle::SP_CustomBase + 1, + SP_DecreaseElement, //减少(-) + SP_IncreaseElement, //增加(+) + SP_MarkElement, //对勾 + SP_SelectElement, //选择(...) + SP_EditElement, //编辑 + SP_ExpandElement, //展开 + SP_ReduceElement, //收缩 + SP_LockElement, //锁定 + SP_UnlockElement, //解锁 + SP_MediaVolumeLowElement, //音量 + SP_MediaVolumeHighElement, //满音量 + SP_MediaVolumeMutedElement, //静音 + SP_MediaVolumeLeftElement, //左声道 + SP_MediaVolumeRightElement, //右声道 + SP_ArrowEnter, //进入 + SP_ArrowLeave, //离开 + SP_ArrowNext, //下一页 + SP_ArrowPrev, //上一页 + SP_ShowPassword, //显示密码 + SP_HidePassword, //因此密码 + SP_CloseButton, //关闭按钮(X) + SP_IndicatorMajuscule, //大写标识 + SP_IndicatorSearch, //搜索标识(放大镜) + SP_IndicatorUnchecked, //搜索标识(对应对勾的选中状态) + SP_IndicatorChecked, //搜索标识(对勾) + SP_DeleteButton, //删除按钮 + SP_AddButton, //新增按钮 + SP_TitleQuitFullButton, //标题栏(「」) + SP_TitleMoreButton, //标题栏 "更多" 按钮 + + SP_Title_SS_LeftButton, //标题栏左分屏按钮 + SP_Title_SS_RightButton, //标题栏右分屏按钮 + SP_Title_SS_ShowMaximizeButton, //标题栏最大化分屏按钮 + SP_Title_SS_ShowNormalButton, //标题栏还原分屏按钮 + SP_CustomBase = QStyle::SP_CustomBase + 0xf00000 + }; + + static QColor adjustColor(const QColor &base, + qint8 hueFloat = 0, qint8 saturationFloat = 0, qint8 lightnessFloat = 0, + qint8 redFloat = 0, qint8 greenFloat = 0, qint8 blueFloat = 0, qint8 alphaFloat = 0); + static QColor blendColor(const QColor &substrate, const QColor &superstratum); + static QPair toIconModeState(const QStyleOption *option); + static DDciIcon::Mode toDciIconMode(const QStyleOption *option); + + D_DECL_DEPRECATED_X("Use DToolTip::setToolTipTextFormat(Qt::TextFormat format)") static void setTooltipTextFormat(Qt::TextFormat format); + D_DECL_DEPRECATED_X("Use DToolTip::toolTipTextFormat()") static Qt::TextFormat tooltipTextFormat(); + static DStyle::StyleState getState(const QStyleOption *option); + static void setFocusRectVisible(QWidget *widget, bool visible); + static void setFrameRadius(QWidget *widget, int radius); + static void setUncheckedItemIndicatorVisible(QWidget *widget, bool visible); + static void setRedPointVisible(QObject *object, bool visible); + DStyle(); + + static void drawPrimitive(const QStyle *style, DStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr); + static void drawControl(const QStyle *style, DStyle::ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr); + static int pixelMetric(const QStyle *style, DStyle::PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr); + static QRect subElementRect(const QStyle *style, DStyle::SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr); + static QSize sizeFromContents(const QStyle *style, DStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = nullptr); + static QIcon standardIcon(const QStyle *style, StandardPixmap st, const QStyleOption *opt = nullptr, const QWidget *widget = 0); + + inline void drawPrimitive(DStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const + { proxy()->drawPrimitive(static_cast(pe), opt, p, w); } + inline void drawControl(DStyle::ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const + { proxy()->drawControl(static_cast(ce), opt, p, w); } + inline int pixelMetric(DStyle::PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const + { return proxy()->pixelMetric(static_cast(m), opt, widget); } + inline QRect subElementRect(DStyle::SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const + { return proxy()->subElementRect(static_cast(r), opt, widget); } + inline QSize sizeFromContents(DStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = nullptr) const + { return proxy()->sizeFromContents(static_cast(ct), opt, contentsSize, widget); } + inline QIcon standardIcon(DStyle::StandardPixmap st, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const + { return proxy()->standardIcon(static_cast(st), opt, widget); } + + void drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const override; + void drawControl(QStyle::ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const override; + int pixelMetric(QStyle::PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const override; + int styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w, QStyleHintReturn *shret) const override; + QRect subElementRect(QStyle::SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const override; + QSize sizeFromContents(QStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = nullptr) const override; + QIcon standardIcon(QStyle::StandardPixmap st, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const override; + + QPalette standardPalette() const override; + QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override; + + // 获取一个加工后的画笔 + QBrush generatedBrush(const QStyleOption *option, const QBrush &base, + QPalette::ColorGroup cg = QPalette::Normal, + QPalette::ColorRole role = QPalette::NoRole) const; + QBrush generatedBrush(StyleState state, const QStyleOption *option, const QBrush &base, + QPalette::ColorGroup cg = QPalette::Normal, + QPalette::ColorRole role = QPalette::NoRole) const; + virtual QBrush generatedBrush(StateFlags flags, const QBrush &base, + QPalette::ColorGroup cg = QPalette::Normal, + QPalette::ColorRole role = QPalette::NoRole, + const QStyleOption *option = nullptr) const; + + QBrush generatedBrush(const QStyleOption *option, const QBrush &base, + DPalette::ColorGroup cg = DPalette::Normal, + DPalette::ColorType type = DPalette::ItemBackground) const; + QBrush generatedBrush(StyleState state, const QStyleOption *option, const QBrush &base, + DPalette::ColorGroup cg = DPalette::Normal, + DPalette::ColorType type = DPalette::ItemBackground) const; + virtual QBrush generatedBrush(StateFlags flags, const QBrush &base, + DPalette::ColorGroup cg = DPalette::Normal, + DPalette::ColorType type = DPalette::ItemBackground, + const QStyleOption *option = nullptr) const; + + using QCommonStyle::drawPrimitive; + using QCommonStyle::drawControl; + using QCommonStyle::pixelMetric; + using QCommonStyle::subElementRect; + using QCommonStyle::sizeFromContents; + using QCommonStyle::standardIcon; + +#if QT_CONFIG(itemviews) + static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth); + static QSize viewItemSize(const QStyle *style, const QStyleOptionViewItem *option, int role); + static void viewItemLayout(const QStyle *style, const QStyleOptionViewItem *opt, QRect *pixmapRect, + QRect *textRect, QRect *checkRect, bool sizehint); + virtual void viewItemLayout(const QStyleOptionViewItem *opt, QRect *pixmapRect, + QRect *textRect, QRect *checkRect, bool sizehint) const; + + static QRect viewItemDrawText(const QStyle *style, QPainter *p, const QStyleOptionViewItem *option, const QRect &rect); + virtual QRect viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const; +#endif +}; + +class DStyleHelper +{ +public: + inline DStyleHelper(const QStyle *style = QApplication::style()) { + setStyle(style); + } + + inline void setStyle(const QStyle *style) { + m_style = style; + m_dstyle = qobject_cast(style); + } + + inline const QStyle *style() const + { return m_style; } + inline const DStyle *dstyle() const + { return m_dstyle; } + + inline QBrush generatedBrush(const QStyleOption *option, const QBrush &base, + QPalette::ColorGroup cg = QPalette::Normal, + QPalette::ColorRole role = QPalette::NoRole) const + { return m_dstyle ? m_dstyle->generatedBrush(option, base, cg, role) : base; } + inline QBrush generatedBrush(const QStyleOption *option, const QBrush &base, + QPalette::ColorGroup cg = QPalette::Normal, + DPalette::ColorType type = DPalette::NoType) const + { return m_dstyle ? m_dstyle->generatedBrush(option, base, cg, type) : base; } + inline QColor getColor(const QStyleOption *option, QPalette::ColorRole role) const + { return generatedBrush(option, option->palette.brush(role), option->palette.currentColorGroup(), role).color(); } + inline QColor getColor(const QStyleOption *option, const DPalette &palette, DPalette::ColorType type) const + { return generatedBrush(option, palette.brush(type), palette.currentColorGroup(), type).color(); } + template + inline QColor getColor(const T *option, DPalette::ColorType type) const + { return getColor(option, option->dpalette, type); } + + inline void drawPrimitive(DStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const + { m_dstyle ? m_dstyle->drawPrimitive(pe, opt, p, w) : DStyle::drawPrimitive(m_style, pe, opt, p, w); } + inline void drawControl(DStyle::ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const + { m_dstyle ? m_dstyle->drawControl(ce, opt, p, w) : DStyle::drawControl(m_style, ce, opt, p, w); } + inline int pixelMetric(DStyle::PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const + { return m_dstyle ? m_dstyle->pixelMetric(m, opt, widget) : DStyle::pixelMetric(m_style, m, opt, widget); } + inline QRect subElementRect(DStyle::SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const + { return m_dstyle ? m_dstyle->subElementRect(r, opt, widget) : DStyle::subElementRect(m_style, r, opt, widget); } + inline QSize sizeFromContents(DStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = nullptr) const + { return m_dstyle ? m_dstyle->sizeFromContents(ct, opt, contentsSize, widget) : DStyle::sizeFromContents(m_style, ct, opt, contentsSize, widget); } + inline QIcon standardIcon(DStyle::StandardPixmap standardIcon, const QStyleOption *opt, const QWidget *widget = nullptr) const + { return m_dstyle ? m_dstyle->standardIcon(standardIcon, opt, widget) : DStyle::standardIcon(m_style, standardIcon, opt, widget); } + +private: + const QStyle *m_style; + const DStyle *m_dstyle; +}; + +class DStylePainter : public QPainter +{ +public: + inline DStylePainter() : QPainter(), widget(nullptr), wstyle(nullptr) {} + inline explicit DStylePainter(QWidget *w) { begin(w, w); } + inline DStylePainter(QPaintDevice *pd, QWidget *w) { begin(pd, w); } + inline bool begin(QWidget *w) { return begin(w, w); } + inline bool begin(QPaintDevice *pd, QWidget *w) { + Q_ASSERT_X(w, "DStylePainter::DStylePainter", "Widget must be non-zero"); + widget = w; + wstyle = w->style(); + dstyle.setStyle(wstyle); + return QPainter::begin(pd); + }; + inline void drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption &opt); + inline void drawPrimitive(DStyle::PrimitiveElement pe, const QStyleOption &opt); + inline void drawControl(QStyle::ControlElement ce, const QStyleOption &opt); + inline void drawControl(DStyle::ControlElement ce, const QStyleOption &opt); + inline void drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex &opt); + inline void drawItemText(const QRect &r, int flags, const QPalette &pal, bool enabled, + const QString &text, QPalette::ColorRole textRole = QPalette::NoRole); + inline void drawItemPixmap(const QRect &r, int flags, const QPixmap &pixmap); + inline QStyle *style() const { return wstyle; } + +private: + QWidget *widget; + QStyle *wstyle; + DStyleHelper dstyle; + Q_DISABLE_COPY(DStylePainter) +}; + +void DStylePainter::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption &opt) +{ + wstyle->drawPrimitive(pe, &opt, this, widget); +} + +void DStylePainter::drawPrimitive(DStyle::PrimitiveElement pe, const QStyleOption &opt) +{ + dstyle.drawPrimitive(pe, &opt, this, widget); +} + +void DStylePainter::drawControl(QStyle::ControlElement ce, const QStyleOption &opt) +{ + wstyle->drawControl(ce, &opt, this, widget); +} + +void DStylePainter::drawControl(DStyle::ControlElement ce, const QStyleOption &opt) +{ + dstyle.drawControl(ce, &opt, this, widget); +} + +void DStylePainter::drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex &opt) +{ + wstyle->drawComplexControl(cc, &opt, this, widget); +} + +void DStylePainter::drawItemText(const QRect &r, int flags, const QPalette &pal, bool enabled, + const QString &text, QPalette::ColorRole textRole) +{ + wstyle->drawItemText(this, r, flags, pal, enabled, text, textRole); +} + +void DStylePainter::drawItemPixmap(const QRect &r, int flags, const QPixmap &pixmap) +{ + wstyle->drawItemPixmap(this, r, flags, pixmap); +} + +class DStyledIconEngine : public QIconEngine +{ +public: + static void drawIcon(const QIcon &icon, QPainter *pa, const QRectF &rect); + + typedef std::function DrawFun; + DStyledIconEngine(DrawFun drawFun, const QString &iconName = QString()); + + void bindDrawFun(DrawFun drawFun); + void setIconName(const QString &name); + + QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override; + void paint(QPainter *painter, const QPalette &palette, const QRectF &rect); + void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override; + + QIconEngine *clone() const override; + void setFrontRole(const QWidget* widget, QPalette::ColorRole role); + +protected: + void virtual_hook(int id, void *data) override; + + DrawFun m_drawFun = nullptr; + QString m_iconName; + QPalette::ColorRole m_painterRole; + const QWidget *m_widget; +}; + +DWIDGET_END_NAMESPACE + +#endif // DSTYLE_H diff -Nru dtkwidget-5.5.48/include/widgets/dstyleoption.h dtkwidget-5.6.12/include/widgets/dstyleoption.h --- dtkwidget-5.5.48/include/widgets/dstyleoption.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dstyleoption.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,222 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSTYLEOPTION_H +#define DSTYLEOPTION_H + +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE +class QGuiApplication; +QT_END_NAMESPACE + +DGUI_USE_NAMESPACE + +DTK_BEGIN_NAMESPACE + +enum ItemDataRole { + MarginsRole = Qt::UserRole + 1, + LeftActionListRole, + TopActionListRole, + RightActionListRole, + BottomActionListRole, + TextActionListRole, + ViewItemFontLevelRole, + ViewItemBackgroundRole, + ViewItemForegroundRole, + ViewItemShowToolTipRole, + UserRole = Qt::UserRole << 2 +}; + +DTK_END_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE + +class DStyleOption +{ +public: + enum OptionType { + SO_HighlightButton = QStyleOption::SO_CustomBase + 1, + SO_CustomBase = QStyleOption::SO_CustomBase << 2 + }; + + virtual void init(QWidget *widget); + virtual void init(const QWidget *widget); + virtual ~DStyleOption() {} + + DPalette dpalette; +}; + +class DStyleOptionButton : public QStyleOptionButton, public DStyleOption +{ +public: + explicit DStyleOptionButton(); + DStyleOptionButton(const DStyleOptionButton &other); + DStyleOptionButton &operator=(const DStyleOptionButton &other); + enum ButtonFeature { + SuggestButton = (CommandLinkButton << 1), + WarningButton = (SuggestButton << 1), + FloatingButton = (WarningButton << 1), + TitleBarButton = (FloatingButton << 1), + CircleButton = (TitleBarButton << 1), + HasDciIcon = (CircleButton << 1) + }; + + void init(const QWidget *widget) override; + DDciIcon dciIcon; +}; + +class DStyleOptionButtonBoxButton : public DStyleOptionButton +{ +public: + enum ButtonPosition { + Invalid, + Beginning, + Middle, + End, + OnlyOne + }; + + Qt::Orientation orientation; + ButtonPosition position; +}; + +class DStyleOptionLineEdit : public DStyleOption +{ +public: + enum LineEditFeature { + None = 0x0, + Alert = 0x1, + IconButton = 0x2 + }; + Q_DECLARE_FLAGS(LineEditFeatures, LineEditFeature) + + void init(const QWidget *widget) override; + + LineEditFeatures features = None; + QRect iconButtonRect; +}; + +class DStyleOptionBackgroundGroup : public QStyleOption, public DStyleOption +{ +public: + enum ItemBackgroundPosition { + Invalid, + Beginning, + Middle, + End, + OnlyOne + }; + + using DStyleOption::DStyleOption; + using QStyleOption::QStyleOption; + void init(const QWidget *widget) override; + + Qt::Orientations directions; + ItemBackgroundPosition position; +}; + +class DStyleOptionIcon : public QStyleOption, public DStyleOption +{ +public: + QIcon icon; +}; + +typedef DStyleOptionIcon DStyleOptionIconV1; + +class DStyleOptionIconV2 : public DStyleOptionIconV1 +{ +public: + enum IconType { SI_QIcon, SI_DciIcon }; + + IconType iconType; + QSize iconSize; + Qt::Alignment iconAlignment; + + DDciIcon dciIcon; + DDciIcon::Theme dciTheme; + DDciIcon::Mode dciMode; +}; + +class DStyleOptionViewItem : public QStyleOptionViewItem, public DStyleOption +{ +public: + enum ViewItemFeature { + + }; +}; + +class DStyleOptionFloatingWidget : public QStyleOption, public DStyleOption +{ +public: + using DStyleOption::init; + bool noBackground; + int frameRadius = -1; +}; + +class DFontSizeManagerPrivate; +class DFontSizeManager +{ +public: + enum SizeType { + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + NSizeTypes + }; + + static DFontSizeManager *instance(); + void bind(QWidget *widget, SizeType type); + void bind(QWidget *widget, SizeType type, int weight); + void unbind(QWidget *widget); + + quint16 fontPixelSize(SizeType type) const; + void setFontPixelSize(SizeType type, quint16 size); + void setFontGenericPixelSize(quint16 size); + const QFont get(SizeType type, const QFont &base = QFont()) const; + const QFont get(SizeType type, int weight, const QFont &base = QFont()) const; + + inline const QFont t1(const QFont &base = QFont()) const + { return get(T1, base); } + inline const QFont t2(const QFont &base = QFont()) const + { return get(T2, base); } + inline const QFont t3(const QFont &base = QFont()) const + { return get(T3, base); } + inline const QFont t4(const QFont &base = QFont()) const + { return get(T4, base); } + inline const QFont t5(const QFont &base = QFont()) const + { return get(T5, base); } + inline const QFont t6(const QFont &base = QFont()) const + { return get(T6, base); } + inline const QFont t7(const QFont &base = QFont()) const + { return get(T7, base); } + inline const QFont t8(const QFont &base = QFont()) const + { return get(T8, base); } + inline const QFont t9(const QFont &base = QFont()) const + { return get(T9, base); } + inline const QFont t10(const QFont &base = QFont()) const + { return get(T10, base); } + + static int fontPixelSize(const QFont &font); + +private: + DFontSizeManager(); + + QScopedPointer d; +}; + +DWIDGET_END_NAMESPACE + +#endif // DSTYLEOPTION_H diff -Nru dtkwidget-5.5.48/include/widgets/dsuggestbutton.h dtkwidget-5.6.12/include/widgets/dsuggestbutton.h --- dtkwidget-5.5.48/include/widgets/dsuggestbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dsuggestbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSUGGESTBUTTON_H +#define DSUGGESTBUTTON_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DSuggestButton : public QPushButton, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + +public: + explicit DSuggestButton(QWidget *parent = nullptr); + explicit DSuggestButton(const QString &text, QWidget *parent = nullptr); + +protected: + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; +}; + +DWIDGET_END_NAMESPACE + +#endif // DSUGGESTBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dswitchbutton.h dtkwidget-5.6.12/include/widgets/dswitchbutton.h --- dtkwidget-5.5.48/include/widgets/dswitchbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dswitchbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,41 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSWITCHBUTTON_H +#define DSWITCHBUTTON_H + +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DSwitchButtonPrivate; +class DStyleOptionButton; +class LIBDTKWIDGETSHARED_EXPORT DSwitchButton : public QAbstractButton, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + +public: + explicit DSwitchButton(QWidget *parent = Q_NULLPTR); + + QSize sizeHint() const Q_DECL_OVERRIDE; + +Q_SIGNALS: + void checkedChanged(bool arg); + +protected: + void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; + void initStyleOption(DStyleOptionButton *option) const; + +private: + D_DECLARE_PRIVATE(DSwitchButton) +}; + +DWIDGET_END_NAMESPACE + +#endif // DSWITCHBUTTON_H + diff -Nru dtkwidget-5.5.48/include/widgets/dswitchlineexpand.h dtkwidget-5.6.12/include/widgets/dswitchlineexpand.h --- dtkwidget-5.5.48/include/widgets/dswitchlineexpand.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dswitchlineexpand.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,56 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DSWITCHLINEEXPAND_H +#define DSWITCHLINEEXPAND_H + +#include + +#include +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DSwitchHeaderLine : public DHeaderLine +{ + Q_OBJECT +public: + DSwitchHeaderLine(QWidget *parent = 0); + void setExpand(bool value); + +Q_SIGNALS: + void checkedChanged(bool arg); + +protected: + void mousePressEvent(QMouseEvent *); + +private: + void reverseArrowDirection(); + DSwitchButton *m_switchButton = NULL; + +}; + +class LIBDTKWIDGETSHARED_EXPORT DSwitchLineExpand : public DBaseExpand +{ + Q_OBJECT +public: + explicit DSwitchLineExpand(QWidget *parent = 0); + void setTitle(const QString &title); + void setExpand(bool value); + + DBaseLine *header(); + +private: + void setHeader(QWidget *header); + void resizeEvent(QResizeEvent *e); + +private: + DSwitchHeaderLine *m_headerLine = NULL; +}; + +DWIDGET_END_NAMESPACE + +#endif // DSWITCHLINEEXPAND_H diff -Nru dtkwidget-5.5.48/include/widgets/dtabbar.h dtkwidget-5.6.12/include/widgets/dtabbar.h --- dtkwidget-5.5.48/include/widgets/dtabbar.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dtabbar.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,204 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DTABBAR_H +#define DTABBAR_H + +#include + +#include +#include + +QT_BEGIN_NAMESPACE +class QMimeData; +QT_END_NAMESPACE + +DCORE_USE_NAMESPACE +DWIDGET_BEGIN_NAMESPACE + +class DTabBarPrivate; +class DTabBar : public QWidget, public DObject +{ + Q_OBJECT + + Q_PROPERTY(bool visibleAddButton READ visibleAddButton WRITE setVisibleAddButton) + Q_PROPERTY(QTabBar::Shape shape READ shape WRITE setShape) + Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged) + Q_PROPERTY(int count READ count) + Q_PROPERTY(bool drawBase READ drawBase WRITE setDrawBase) + Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) + Q_PROPERTY(Qt::TextElideMode elideMode READ elideMode WRITE setElideMode) + Q_PROPERTY(bool usesScrollButtons READ usesScrollButtons WRITE setUsesScrollButtons) + Q_PROPERTY(bool tabsClosable READ tabsClosable WRITE setTabsClosable) + Q_PROPERTY(QTabBar::SelectionBehavior selectionBehaviorOnRemove READ selectionBehaviorOnRemove WRITE setSelectionBehaviorOnRemove) + Q_PROPERTY(bool expanding READ expanding WRITE setExpanding) + Q_PROPERTY(bool movable READ isMovable WRITE setMovable) + Q_PROPERTY(bool dragable READ isDragable WRITE setDragable) + Q_PROPERTY(bool documentMode READ documentMode WRITE setDocumentMode) + Q_PROPERTY(bool autoHide READ autoHide WRITE setAutoHide) + Q_PROPERTY(bool changeCurrentOnDrag READ changeCurrentOnDrag WRITE setChangeCurrentOnDrag) + Q_PROPERTY(int startDragDistance READ startDragDistance WRITE setStartDragDistance) + // on drag enter + Q_PROPERTY(QColor maskColor READ maskColor WRITE setMaskColor) + // on inserted tab from mime data + Q_PROPERTY(QColor flashColor READ flashColor WRITE setFlashColor) + +public: + explicit DTabBar(QWidget *parent = 0); + + void setTabMinimumSize(int index, const QSize &size); + void setTabMaximumSize(int index, const QSize &size); + + bool visibleAddButton() const; + + QTabBar::Shape shape() const; + void setShape(QTabBar::Shape shape); + + int addTab(const QString &text); + int addTab(const QIcon &icon, const QString &text); + + int insertTab(int index, const QString &text); + int insertTab(int index, const QIcon&icon, const QString &text); + + void removeTab(int index); + void moveTab(int from, int to); + + bool isTabEnabled(int index) const; + void setTabEnabled(int index, bool); + + QString tabText(int index) const; + void setTabText(int index, const QString &text); + + QIcon tabIcon(int index) const; + void setTabIcon(int index, const QIcon &icon); + + Qt::TextElideMode elideMode() const; + void setElideMode(Qt::TextElideMode mode); + +#ifndef QT_NO_TOOLTIP + void setTabToolTip(int index, const QString &tip); + QString tabToolTip(int index) const; +#endif + +#ifndef QT_NO_WHATSTHIS + void setTabWhatsThis(int index, const QString &text); + QString tabWhatsThis(int index) const; +#endif + + void setTabData(int index, const QVariant &data); + QVariant tabData(int index) const; + + QRect tabRect(int index) const; + int tabAt(const QPoint &pos) const; + + int currentIndex() const; + int count() const; + + void setDrawBase(bool drawTheBase); + bool drawBase() const; + + QSize iconSize() const; + void setIconSize(const QSize &size); + + bool usesScrollButtons() const; + void setUsesScrollButtons(bool useButtons); + + bool tabsClosable() const; + void setTabsClosable(bool closable); + + void setTabButton(int index, QTabBar::ButtonPosition position, QWidget *widget); + QWidget *tabButton(int index, QTabBar::ButtonPosition position) const; + + QTabBar::SelectionBehavior selectionBehaviorOnRemove() const; + void setSelectionBehaviorOnRemove(QTabBar::SelectionBehavior behavior); + + bool expanding() const; + void setExpanding(bool enabled); + + bool isMovable() const; + void setMovable(bool movable); + + bool isDragable() const; + void setDragable(bool dragable); + + bool documentMode() const; + void setDocumentMode(bool set); + + bool autoHide() const; + void setAutoHide(bool hide); + + bool changeCurrentOnDrag() const; + void setChangeCurrentOnDrag(bool change); + + int startDragDistance() const; + + QColor maskColor() const; + QColor flashColor() const; + + QWindow *dragIconWindow() const; + + void setEnabledEmbedStyle(bool enable); + + void setTabLabelAlignment(Qt::Alignment alignment); + +Q_SIGNALS: + void currentChanged(int index); + void tabCloseRequested(int index); + void tabMoved(int from, int to); + void tabIsInserted(int index); + void tabIsRemoved(int index); + void tabBarClicked(int index); + void tabBarDoubleClicked(int index); + void tabAddRequested(); + void tabReleaseRequested(int index); + void tabDroped(int index, Qt::DropAction action, QObject *target); + void dragActionChanged(Qt::DropAction action); + void dragStarted(); + void dragEnd(Qt::DropAction action); + +public Q_SLOTS: + void setCurrentIndex(int index); + void setVisibleAddButton(bool visibleAddButton); + void setStartDragDistance(int startDragDistance); + + void setMaskColor(QColor maskColor); + void setFlashColor(QColor flashColor); + + void startDrag(int index); + void stopDrag(Qt::DropAction action); + +protected: + void dragEnterEvent(QDragEnterEvent *e) override; + void dragLeaveEvent(QDragLeaveEvent *e) override; + void dragMoveEvent(QDragMoveEvent *e) override; + void dropEvent(QDropEvent *e) override; + void resizeEvent(QResizeEvent *e) override; + + void startTabFlash(int index); + + virtual void paintTab(QPainter *painter, int index, const QStyleOptionTab &option) const; + + virtual QPixmap createDragPixmapFromTab(int index, const QStyleOptionTab &option, QPoint *hotspot) const; + virtual QMimeData *createMimeDataFromTab(int index, const QStyleOptionTab &option) const; + virtual bool canInsertFromMimeData(int index, const QMimeData *source) const; + virtual void insertFromMimeData(int index, const QMimeData *source); + virtual void insertFromMimeDataOnDragEnter(int index, const QMimeData *source); + + virtual void tabInserted(int index); + virtual void tabLayoutChange(); + virtual void tabRemoved(int index); + + virtual QSize tabSizeHint(int index) const; + virtual QSize minimumTabSizeHint(int index) const; + virtual QSize maximumTabSizeHint(int index) const; + +private: + DTabBarPrivate* d_func(); + const DTabBarPrivate* d_func() const; + friend class DTabBarPrivate; +}; + +DWIDGET_END_NAMESPACE + +#endif // DTABBAR_H diff -Nru dtkwidget-5.5.48/include/widgets/dtabletwindowoptionbutton.h dtkwidget-5.6.12/include/widgets/dtabletwindowoptionbutton.h --- dtkwidget-5.5.48/include/widgets/dtabletwindowoptionbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dtabletwindowoptionbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DTABLETWINDOWOPTIONBUTTON_H +#define DTABLETWINDOWOPTIONBUTTON_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DTabletWindowOptionButton : public DIconButton +{ + Q_OBJECT +public: + DTabletWindowOptionButton(QWidget *parent = 0); + + QSize sizeHint() const override; + +protected: + void initStyleOption(DStyleOptionButton *option) const override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DTABLETWINDOWOPTIONBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dtextedit.h dtkwidget-5.6.12/include/widgets/dtextedit.h --- dtkwidget-5.5.48/include/widgets/dtextedit.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dtextedit.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,46 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DTEXTEDIT_H +#define DTEXTEDIT_H + +#include + +#include +#include + +QT_BEGIN_NAMESPACE +class QContextMenuEvent; +QT_END_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE +class DTextEditPrivate; +class DTextEdit : public QTextEdit, public DCORE_NAMESPACE::DObject +{ +public: + explicit DTextEdit(QWidget *parent = nullptr); + explicit DTextEdit(const QString& text, QWidget* parent = nullptr); + +public: + bool speechToTextIsEnabled() const; + void setSpeechToTextEnabled(bool enable); + + bool textToSpeechIsEnabled() const; + void setTextToSpeechEnabled(bool enable); + + bool textToTranslateIsEnabled() const; + void setTextToTranslateEnabled(bool enable); + +protected: + bool event(QEvent *e) override; + void contextMenuEvent(QContextMenuEvent *e) override; + virtual void keyPressEvent(QKeyEvent *e) override; + +private: + D_DECLARE_PRIVATE(DTextEdit) +}; + +DWIDGET_END_NAMESPACE + +#endif // DTEXTEDIT_H diff -Nru dtkwidget-5.5.48/include/widgets/dthememanager.h dtkwidget-5.6.12/include/widgets/dthememanager.h --- dtkwidget-5.5.48/include/widgets/dthememanager.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dthememanager.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,57 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DTHEMEMANAGER_H +#define DTHEMEMANAGER_H + +#include +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DThemeManagerPrivate; +class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED DThemeManager : public QObject, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + +public: + static DThemeManager *instance(); + + QString theme() const; + QString theme(const QWidget *widget, QWidget **baseWidget = nullptr) const; + void setTheme(const QString theme); + void setTheme(QWidget *widget, const QString theme); + + QString getQssForWidget(const QString className, const QString &theme = QString()) const; + QString getQssForWidget(const QWidget *widget) const; + + static void registerWidget(QWidget *widget, QStringList properties = QStringList()); + // TODO: use blow instead, the only thing should do is rebuilding + // static void registerWidget(QWidget *widget, const QStringList &properties = QStringList()); + static void registerWidget(QWidget *widget, const QString &filename, const QStringList &properties = QStringList()); + +public Q_SLOTS: + void updateQss(); + void updateThemeOnParentChanged(QWidget *widget); + +Q_SIGNALS: + void themeChanged(QString theme); + void widgetThemeChanged(QWidget *widget, QString theme); + +protected: + DThemeManager(); + bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; + +private: + friend class DApplication; + D_DECLARE_PRIVATE(DThemeManager) +}; + +DWIDGET_END_NAMESPACE + +#endif // DTHEMEMANAGER_H diff -Nru dtkwidget-5.5.48/include/widgets/dtickeffect.h dtkwidget-5.6.12/include/widgets/dtickeffect.h --- dtkwidget-5.5.48/include/widgets/dtickeffect.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dtickeffect.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,51 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DTICKEFFECT_H +#define DTICKEFFECT_H + +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DTickEffectPrivate; +class LIBDTKWIDGETSHARED_EXPORT DTickEffect : public QGraphicsEffect, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT +public: + explicit DTickEffect(QWidget *widget, QWidget *parent = 0); + + enum Direction{ + LeftToRight, + RightToLeft, + TopToBottom, + BottomToTop + }; + + void play(); + void stop(); + void pause(); + void resume(); + + void setDirection(Direction direction); + void setFixedPixelMove(const int pixel); + +Q_SIGNALS: + void finished(); + void stateChanged(); + +protected: + void draw(QPainter *painter) Q_DECL_OVERRIDE; + bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; + +private: + D_DECLARE_PRIVATE(DTickEffect) +}; + +DWIDGET_END_NAMESPACE + +#endif // DTICKEFFECT_H diff -Nru dtkwidget-5.5.48/include/widgets/dtiplabel.h dtkwidget-5.6.12/include/widgets/dtiplabel.h --- dtkwidget-5.5.48/include/widgets/dtiplabel.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dtiplabel.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DTIPLABEL_H +#define DTIPLABEL_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DTipLabelPrivate; +class LIBDTKWIDGETSHARED_EXPORT DTipLabel : public DLabel +{ + Q_OBJECT + Q_DISABLE_COPY(DTipLabel) + D_DECLARE_PRIVATE(DTipLabel) +public: + DTipLabel(const QString &text = QString(), QWidget *parent = nullptr); + ~DTipLabel(); + + using QLabel::show; + void show(const QPoint &pos); + void setForegroundRole(DPalette::ColorType color); + +protected: + void initPainter(QPainter *painter) const override; + void paintEvent(QPaintEvent *event) override; +}; +DWIDGET_END_NAMESPACE + +#endif // DTIPLABEL_H diff -Nru dtkwidget-5.5.48/include/widgets/dtitlebar.h dtkwidget-5.6.12/include/widgets/dtitlebar.h --- dtkwidget-5.5.48/include/widgets/dtitlebar.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dtitlebar.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,134 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DTITLEBAR_H +#define DTITLEBAR_H + +#include +#include +#include + +#include +#include + +DGUI_USE_NAMESPACE +DWIDGET_BEGIN_NAMESPACE + +class DSidebarHelper; +class DTitlebarSettings; +class DTitlebarPrivate; +class LIBDTKWIDGETSHARED_EXPORT DTitlebar : public QFrame, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + Q_PROPERTY(bool blurBackground READ blurBackground WRITE setBlurBackground) + +public: + explicit DTitlebar(QWidget *parent = Q_NULLPTR); + +#ifndef QT_NO_MENU + QMenu *menu() const; + void setMenu(QMenu *menu); +#endif + + QWidget *customWidget() const; + void setCustomWidget(QWidget *, bool fixCenterPos = false); + + void setSidebarHelper(DSidebarHelper *helper); + + void addWidget(QWidget *w, Qt::Alignment alignment = Qt::Alignment()); + void removeWidget(QWidget *w); + + int buttonAreaWidth() const; + bool separatorVisible() const; + + bool autoHideOnFullscreen() const; + void setAutoHideOnFullscreen(bool autohide); + + virtual void setVisible(bool visible) Q_DECL_OVERRIDE; + void setEmbedMode(bool embed); + + bool menuIsVisible() const; + void setMenuVisible(bool visible); + + bool menuIsDisabled() const; + void setMenuDisabled(bool disabled); + + bool quitMenuIsDisabled() const; + void setQuitMenuDisabled(bool disabled); + void setQuitMenuVisible(bool visible); + + bool switchThemeMenuIsVisible() const; + void setSwitchThemeMenuVisible(bool visible); + + void setDisableFlags(Qt::WindowFlags flags); + Qt::WindowFlags disableFlags() const; + + void setSplitScreenEnabled(bool enabled); + bool splitScreenIsEnabled() const; + + virtual QSize sizeHint() const override; + virtual QSize minimumSizeHint() const override; + + bool blurBackground() const; + void setFullScreenButtonVisible(bool enabled); + + DTitlebarSettings *settings(); + +Q_SIGNALS: + void optionClicked(); + void doubleClicked(); + void mousePressed(Qt::MouseButtons buttons); + void mouseMoving(Qt::MouseButton button); + +#ifdef DTK_TITLE_DRAG_WINDOW + void mousePosPressed(Qt::MouseButtons buttons, QPoint pos); + void mousePosMoving(Qt::MouseButton button, QPoint pos); +#endif + +public Q_SLOTS: + void setFixedHeight(int h); + void setBackgroundTransparent(bool transparent); + void setSeparatorVisible(bool visible); + void setTitle(const QString &title); + void setIcon(const QIcon &icon); + /// Maximized/Minumized + void toggleWindowState(); + + void setBlurBackground(bool blurBackground); + +private Q_SLOTS: +#ifndef QT_NO_MENU + void showMenu(); +#endif + +protected: + bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE; + bool event(QEvent *e) override; + void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + +private: + D_DECLARE_PRIVATE(DTitlebar) + D_PRIVATE_SLOT(void _q_toggleWindowState()) + D_PRIVATE_SLOT(void _q_showMinimized()) + D_PRIVATE_SLOT(void _q_onTopWindowMotifHintsChanged(quint32)) + +#ifndef QT_NO_MENU + D_PRIVATE_SLOT(void _q_addDefaultMenuItems()) + D_PRIVATE_SLOT(void _q_helpActionTriggered()) + D_PRIVATE_SLOT(void _q_feedbackActionTriggerd()) + D_PRIVATE_SLOT(void _q_aboutActionTriggered()) + D_PRIVATE_SLOT(void _q_quitActionTriggered()) + D_PRIVATE_SLOT(void _q_switchThemeActionTriggered(QAction*)) + D_PRIVATE_SLOT(void _q_toolBarActionTriggerd()) +#endif +}; + +DWIDGET_END_NAMESPACE + +#endif // DTITLEBAR_H diff -Nru dtkwidget-5.5.48/include/widgets/dtitlebarsettings.h dtkwidget-5.6.12/include/widgets/dtitlebarsettings.h --- dtkwidget-5.5.48/include/widgets/dtitlebarsettings.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dtitlebarsettings.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,62 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#pragma once + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DTitlebarToolBaseInterface : public QObject +{ + Q_OBJECT +public: + explicit DTitlebarToolBaseInterface(QObject *parent = nullptr) : QObject(parent) {} + virtual ~DTitlebarToolBaseInterface(){} + + virtual QString id() const = 0; + virtual QString description() = 0; + virtual QString iconName() = 0; +}; + +class LIBDTKWIDGETSHARED_EXPORT DTitleBarToolInterface : public DTitlebarToolBaseInterface { + Q_OBJECT +public: + explicit DTitleBarToolInterface(QObject *parent = nullptr) : DTitlebarToolBaseInterface(parent) {} + virtual ~DTitleBarToolInterface(){} + + virtual QWidget *createView() = 0; +Q_SIGNALS: + void triggered(); +}; + +class LIBDTKWIDGETSHARED_EXPORT DTitleBarSpacerInterface : public DTitlebarToolBaseInterface { + Q_OBJECT +public: + explicit DTitleBarSpacerInterface(QObject *parent = nullptr) : DTitlebarToolBaseInterface(parent) {} + virtual ~DTitleBarSpacerInterface(){} + + virtual QWidget *createPlaceholderView() = 0; + virtual int size() const = 0; +}; + +class DTitlebarSettingsPrivate; +class DTitlebarSettingsImpl; +class DTitlebar; +class LIBDTKWIDGETSHARED_EXPORT DTitlebarSettings : public DCORE_NAMESPACE::DObject +{ +public: + explicit DTitlebarSettings(DTitlebar *titlebar); + bool initilize(QList &tools, const QString &path); + + QWidget *toolsEditPanel() const; + +private: + D_DECLARE_PRIVATE(DTitlebarSettings) + DTitlebarSettingsImpl *impl(); + friend class DTitlebar; +}; + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/include/widgets/dtoast.h dtkwidget-5.6.12/include/widgets/dtoast.h --- dtkwidget-5.5.48/include/widgets/dtoast.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dtoast.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#pragma once + +#include +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DToastPrivate; +class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DMessageManager") DToast : public QFrame, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity) + Q_PROPERTY(qreal duration READ duration WRITE setDuration) +public: + explicit DToast(QWidget *parent = 0); + ~DToast(); + + QString text() const; + QIcon icon() const; + int duration() const; + +Q_SIGNALS: + void visibleChanged(bool isVisible); + +public Q_SLOTS: + void pop(); + void pack(); + void showEvent(QShowEvent *event) override; + void hideEvent(QHideEvent *event) override; + + void setText(QString text); + void setIcon(QString icon); + void setIcon(QIcon icon, QSize defaultSize = QSize(20, 20)); + void setDuration(int duration); + +private: + qreal opacity() const; + void setOpacity(qreal); + + D_DECLARE_PRIVATE(DToast) +}; + + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/include/widgets/dtoolbutton.h dtkwidget-5.6.12/include/widgets/dtoolbutton.h --- dtkwidget-5.5.48/include/widgets/dtoolbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dtoolbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DTOOLBUTTON_H +#define DTOOLBUTTON_H + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DToolButton : public QToolButton +{ + Q_OBJECT +public: + DToolButton(QWidget *parent = nullptr); + void setAlignment(Qt::Alignment flag); + Qt::Alignment alignment() const; + +protected: + void paintEvent(QPaintEvent *event) override; + void initStyleOption(QStyleOptionToolButton *option) const; + QSize sizeHint() const override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DTOOLBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dtooltip.h dtkwidget-5.6.12/include/widgets/dtooltip.h --- dtkwidget-5.5.48/include/widgets/dtooltip.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dtooltip.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DTOOLTIP_H +#define DTOOLTIP_H + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DToolTip : public DTipLabel +{ + Q_OBJECT + +public: + enum ToolTipShowMode { + NotShow, + AlwaysShow, + ShowWhenElided, + Default + }; + Q_ENUM(ToolTipShowMode) + + static void setToolTipTextFormat(Qt::TextFormat format); + static Qt::TextFormat toolTipTextFormat(); + static void setToolTipShowMode(QWidget *widget, ToolTipShowMode mode); + static ToolTipShowMode toolTipShowMode(const QWidget *widget); + static QString wrapToolTipText(QString text, QTextOption option); + static bool needUpdateToolTip(const QWidget *widget, bool showToolTip); + static void setShowToolTip(QWidget *widget, bool showToolTip); + + explicit DToolTip(const QString &text, bool completionClose = true); + + QSize sizeHint() const override; + void show(const QPoint &pos, int duration); +}; + +DWIDGET_END_NAMESPACE + +Q_DECLARE_METATYPE(Dtk::Widget::DToolTip::ToolTipShowMode) +#endif // DTOOLTIP_H diff -Nru dtkwidget-5.5.48/include/widgets/dwarningbutton.h dtkwidget-5.6.12/include/widgets/dwarningbutton.h --- dtkwidget-5.5.48/include/widgets/dwarningbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dwarningbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DWARNINGBUTTON_H +#define DWARNINGBUTTON_H + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DWarningButton : public DPushButton +{ +public: + DWarningButton(QWidget *parent = nullptr); + +protected: + void initStyleOption(QStyleOptionButton *option) const; + void paintEvent(QPaintEvent *e) override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DWARNINGBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dwatermarkhelper.h dtkwidget-5.6.12/include/widgets/dwatermarkhelper.h --- dtkwidget-5.5.48/include/widgets/dwatermarkhelper.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dwatermarkhelper.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,36 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DWATERMARKHELPER_H +#define DWATERMARKHELPER_H +#include "dwatermarkwidget.h" + +#include +#include + +#include + +DTK_USE_NAMESPACE +DWIDGET_BEGIN_NAMESPACE +class DWaterMarkHelperPrivate; +class DWaterMarkHelper : public QObject, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT +public: + static DWaterMarkHelper *instance(); + void registerWidget(QWidget *w); + + WaterMarkData data() const; + void setData(const WaterMarkData &data); + +protected: + explicit DWaterMarkHelper(QObject *parent = nullptr); + +private: + D_DECLARE_PRIVATE(DWaterMarkHelper) +}; + +DWIDGET_END_NAMESPACE + +#endif // DWATERMARKHELPER_H diff -Nru dtkwidget-5.5.48/include/widgets/dwatermarkwidget.h dtkwidget-5.6.12/include/widgets/dwatermarkwidget.h --- dtkwidget-5.5.48/include/widgets/dwatermarkwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dwatermarkwidget.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,94 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef WATERMARKWIDGET_H +#define WATERMARKWIDGET_H + +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class WaterMarkDataPrivate; +class WaterMarkData : public DTK_CORE_NAMESPACE::DObject +{ +public: + enum WaterMarkType { + None, /*!<@~chinese 不会绘制水印 */ + Text, /*!<@~chinese 绘制文字水印 */ + Image /*!<@~chinese 绘制图片水印 */ + }; + enum WaterMarkLayout { + Center, /*!<@~chinese 居中 */ + Tiled /*!<@~chinese 平铺 */ + }; + + explicit WaterMarkData(); + + WaterMarkData(const WaterMarkData& p); + WaterMarkData& operator=(const WaterMarkData& p); + + WaterMarkType type() const; + void setType(WaterMarkType type); + + WaterMarkLayout layout() const; + void setLayout(WaterMarkLayout layout); + + qreal scaleFactor() const; + void setScaleFactor(qreal scaleFactor); + + int spacing() const; + void setSpacing(int spacing); + + int lineSpacing() const; + void setLineSpacing(int lineSpacing); + + QString text() const; + void setText(const QString &text); + + QFont font() const; + void setFont(const QFont &font); + + QColor color() const; + void setColor(const QColor &color); + + qreal rotation() const; + void setRotation(qreal rotation); + + qreal opacity() const; + void setOpacity(qreal opacity); + + QImage image() const; + void setImage(const QImage &image); + + bool grayScale() const; + void setGrayScale(bool grayScale); + +private: + D_DECLARE_PRIVATE(WaterMarkData) +}; + +class DWaterMarkWidgetPrivate; +class DWaterMarkWidget : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT +public: + explicit DWaterMarkWidget(QWidget *parent = nullptr); + + const WaterMarkData &data(); + void setData(const WaterMarkData &data); + +protected: + void paintEvent(QPaintEvent *) override; + bool eventFilter(QObject *watched, QEvent *event) override; + +private: + D_DECLARE_PRIVATE(DWaterMarkWidget) +}; + +DWIDGET_END_NAMESPACE + +#endif // WATERMARKWIDGET_H diff -Nru dtkwidget-5.5.48/include/widgets/dwaterprogress.h dtkwidget-5.6.12/include/widgets/dwaterprogress.h --- dtkwidget-5.5.48/include/widgets/dwaterprogress.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dwaterprogress.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DWATERPROGRESS_H +#define DWATERPROGRESS_H + +#include +#include + +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DWaterProgressPrivate; +class LIBDTKWIDGETSHARED_EXPORT DWaterProgress : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT + + Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged) +public: + explicit DWaterProgress(QWidget *parent = 0); + ~DWaterProgress(); + + int value() const; + +Q_SIGNALS: + void valueChanged(); + +public Q_SLOTS: + void start(); + void stop(); + void setValue(int value); + void setTextVisible(bool visible); + +protected: + void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; + void changeEvent(QEvent *e) override; + +private: + D_DECLARE_PRIVATE(DWaterProgress) +}; + +DWIDGET_END_NAMESPACE + +#endif // DWATERPROGRESS_H diff -Nru dtkwidget-5.5.48/include/widgets/dwidgetstype.h dtkwidget-5.6.12/include/widgets/dwidgetstype.h --- dtkwidget-5.5.48/include/widgets/dwidgetstype.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dwidgetstype.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,139 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DWIDGETSTYPE_H +#define DWIDGETSTYPE_H + +#include + +QT_BEGIN_NAMESPACE + +class QScrollBar; +class QPushButton; +class QRadioButton; +class QDialogButtonBox; +class QListWidget; +class QTreeWidget; +class QTableWidget; +class QGroupBox; +class QScrollArea; +class QToolBox; +class QTableWidget; +class QStackedWidget; +class QWidget; +class QMDIArea; +class QDockWidget; +class QComboBox; +class QFontComboBox; +class QPlainTextEdit; +class QSpinBox; +class QDoubleSpinBox; +class QTimeEdit; +class QDateEdit; +class QDateTimeEdit; +class QDial; +class QTextBrowser; +class QGraphicsView; +class QCalendarWidget; +class QLCDNumber; +class QHorizontalLine; +class QVerticalLine; +class QOpenGLWidget; +class QQuickWidget; +class QWebView; +class QAccessibleWidget; +class QCheckBox; +class QColorDialog; +class QColumnView; +class QDataWidgetMapper; +class QFocusFrame; +class QHeaderView; +class QInputDialog; +class QMdiArea; +class QMdiSubWindow; +class QErrorMessage; +class QFontDialog; +class QMenu; +class QMenuBar; +class QMessageBox; +class QRubberBand; +class QSlider; +class QSplitter; +class QStatusBar; +class QTabWidget; +class QTableView; +class QTileRules; +class QToolBar; +class QTreeView; +class QUndoView; +class QWhatsThis; +class QWizard; +class QWizardPage; +class QSizeGrip; + +QT_END_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE + +typedef QScrollBar DScrollBar; +typedef QPushButton DPushButton; +typedef QRadioButton DRadioButton; +typedef QDialogButtonBox DDialogButtonBox; +typedef QListWidget DListWidget; +typedef QTreeWidget DTreeWidget; +typedef QTableWidget DTableWidget; +typedef QGroupBox DGroupBox; +typedef QScrollArea DScrollArea; +typedef QToolBox DToolBox; +typedef QTableWidget DTableWidget; +typedef QStackedWidget DStackedWidget; +typedef QWidget DWidget; +typedef QMDIArea DMDIArea; +typedef QDockWidget DDockWidget; +typedef QPlainTextEdit DPlainTextEdit; +typedef QTimeEdit DTimeEdit; +typedef QDateEdit DDateEdit; +typedef QDateTimeEdit DDateTimeEdit; +typedef QDial DDial; +typedef QTextBrowser DTextBrowser; +typedef QGraphicsView DGraphicsView; +typedef QCalendarWidget DCalendarWidget; +typedef QLCDNumber DLCDNumber; +typedef QOpenGLWidget DOpenGLWidget; +typedef QQuickWidget DQuickWidget; +typedef QWebView DWebView; +typedef QAccessibleWidget DAccessibleWidget; +typedef QCheckBox DCheckBox; +typedef QColorDialog DColorDialog; +typedef QColumnView DColumnView; +typedef QDataWidgetMapper DDataWidgetMapper; +typedef QFocusFrame DFocusFrame; +typedef QHeaderView DHeaderView; +#ifndef Q_QDOC +//typedef QInputDialog DInputDialog; +#endif +typedef QMdiArea DMdiArea; +typedef QMdiSubWindow DMdiSubWindow; +typedef QErrorMessage DErrorMessage; +typedef QFontDialog DFontDialog; +typedef QMenu DMenu; +typedef QMenuBar DMenuBar; +typedef QMessageBox DMessageBox; +typedef QRubberBand DRubberBand; +typedef QSplitter DSplitter; +typedef QStatusBar DStatusBar; +typedef QTabWidget DTabWidget; +typedef QTableView DTableView; +typedef QTileRules DTileRules; +typedef QToolBar DToolBar; +typedef QTreeView DTreeView; +typedef QUndoView DUndoView; +typedef QWhatsThis DWhatsThis; +typedef QWizard DWizard; +typedef QWizardPage DWizardPage; +typedef QSizeGrip DSizeGrip; + +DWIDGET_END_NAMESPACE + +#endif // DWIDGETSTYPE_H diff -Nru dtkwidget-5.5.48/include/widgets/dwindowclosebutton.h dtkwidget-5.6.12/include/widgets/dwindowclosebutton.h --- dtkwidget-5.5.48/include/widgets/dwindowclosebutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dwindowclosebutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DWINDOWCLOSEBUTTON_H +#define DWINDOWCLOSEBUTTON_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DWindowCloseButton : public DIconButton +{ + Q_OBJECT +public: + DWindowCloseButton(QWidget * parent = 0); + + QSize sizeHint() const override; + +protected: + void initStyleOption(DStyleOptionButton *option) const override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DWINDOWCLOSEBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dwindowmaxbutton.h dtkwidget-5.6.12/include/widgets/dwindowmaxbutton.h --- dtkwidget-5.5.48/include/widgets/dwindowmaxbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dwindowmaxbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DWINDOWMAXBUTTON_H +#define DWINDOWMAXBUTTON_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class DWindowMaxButtonPrivate; + +class LIBDTKWIDGETSHARED_EXPORT DWindowMaxButton : public DIconButton +{ + Q_OBJECT +public: + DWindowMaxButton(QWidget * parent = 0); + + Q_PROPERTY(bool isMaximized READ isMaximized WRITE setMaximized NOTIFY maximizedChanged) + + bool isMaximized() const; + QSize sizeHint() const override; + +public Q_SLOTS: + void setMaximized(bool isMaximized); + +Q_SIGNALS: + void maximizedChanged(bool isMaximized); + +protected: + void initStyleOption(DStyleOptionButton *option) const override; + +private: + D_DECLARE_PRIVATE(DWindowMaxButton) +}; + +DWIDGET_END_NAMESPACE + +#endif // DWINDOWMAXBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dwindowminbutton.h dtkwidget-5.6.12/include/widgets/dwindowminbutton.h --- dtkwidget-5.5.48/include/widgets/dwindowminbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dwindowminbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DWINDOWMINBUTTON_H +#define DWINDOWMINBUTTON_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DWindowMinButton : public DIconButton +{ + Q_OBJECT + +public: + DWindowMinButton(QWidget * parent = 0); + + QSize sizeHint() const override; + +protected: + void initStyleOption(DStyleOptionButton *option) const override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DWINDOWMINBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dwindowoptionbutton.h dtkwidget-5.6.12/include/widgets/dwindowoptionbutton.h --- dtkwidget-5.5.48/include/widgets/dwindowoptionbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dwindowoptionbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DWINDOWOPTIONBUTTON_H +#define DWINDOWOPTIONBUTTON_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DWindowOptionButton : public DIconButton +{ + Q_OBJECT +public: + DWindowOptionButton(QWidget * parent = 0); + + QSize sizeHint() const override; + +protected: + void initStyleOption(DStyleOptionButton *option) const override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DWINDOWOPTIONBUTTON_H diff -Nru dtkwidget-5.5.48/include/widgets/dwindowquitfullbutton.h dtkwidget-5.6.12/include/widgets/dwindowquitfullbutton.h --- dtkwidget-5.5.48/include/widgets/dwindowquitfullbutton.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/include/widgets/dwindowquitfullbutton.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DWINDOWQUITFULLBUTTON_H +#define DWINDOWQUITFULLBUTTON_H + +#include + +DWIDGET_BEGIN_NAMESPACE + +class LIBDTKWIDGETSHARED_EXPORT DWindowQuitFullButton : public DIconButton +{ + Q_OBJECT + +public: + DWindowQuitFullButton(QWidget * parent = nullptr); + + QSize sizeHint() const override; + +protected: + void initStyleOption(DStyleOptionButton *option) const override; +}; + +DWIDGET_END_NAMESPACE + +#endif // DWINDOWQUITFULLBUTTON_H diff -Nru dtkwidget-5.5.48/LICENSE dtkwidget-5.6.12/LICENSE --- dtkwidget-5.5.48/LICENSE 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/LICENSE 2023-05-15 03:42:41.000000000 +0000 @@ -1,165 +1,305 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 +GNU LESSER GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. + +0. Additional Definitions. + +As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. + +"The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. + +An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. + +A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". + +The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. + +The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. + +1. Exception to Section 3 of the GNU GPL. +You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. + +2. Conveying Modified Versions. +If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: + + a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. + +3. Object Code Incorporating Material from Library Header Files. +The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license document. + +4. Combined Works. +You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: + + a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license document. + + c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. + + e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) + +5. Combined Libraries. +You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +6. Revised Versions of the GNU Lesser General Public License. +The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. + +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + +0. Definitions. + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on the Program. + +To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +1. Source Code. +The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. + +A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. + + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +7. Additional Terms. +“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +11. Patents. +A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + +14. Revised Versions of this License. +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 program 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 . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. + +You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . + +The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff -Nru dtkwidget-5.5.48/LICENSES/CC0-1.0.txt dtkwidget-5.6.12/LICENSES/CC0-1.0.txt --- dtkwidget-5.5.48/LICENSES/CC0-1.0.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/LICENSES/CC0-1.0.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff -Nru dtkwidget-5.5.48/LICENSES/CC-BY-4.0.txt dtkwidget-5.6.12/LICENSES/CC-BY-4.0.txt --- dtkwidget-5.5.48/LICENSES/CC-BY-4.0.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/LICENSES/CC-BY-4.0.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,156 @@ +Creative Commons Attribution 4.0 International + + Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. + +Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. + +Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. + +Section 1 – Definitions. + + a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + + d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. + + g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. + + i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. + +Section 2 – Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: + + A. reproduce and Share the Licensed Material, in whole or in part; and + + B. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. + + 3. Term. The term of this Public License is specified in Section 6(a). + + 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. + + 5. Downstream recipients. + + A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. + + B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. + + 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). + +b. Other rights. + + 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this Public License. + + 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. + +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified form), You must: + + A. retain the following if it is supplied by the Licensor with the Licensed Material: + + i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of warranties; + + v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + + B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and + + C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. + + 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. + +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; + + b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. +For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. + +Section 5 – Disclaimer of Warranties and Limitation of Liability. + + a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. + + b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. + + c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination. + + a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or + + 2. upon express reinstatement by the Licensor. + + c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. + + d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. + + e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. + +Section 8 – Interpretation. + + a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. + + c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. + + d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. + +Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. + +Creative Commons may be contacted at creativecommons.org. diff -Nru dtkwidget-5.5.48/LICENSES/LGPL-3.0-or-later.txt dtkwidget-5.6.12/LICENSES/LGPL-3.0-or-later.txt --- dtkwidget-5.5.48/LICENSES/LGPL-3.0-or-later.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/LICENSES/LGPL-3.0-or-later.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,304 @@ +GNU LESSER GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. + +0. Additional Definitions. + +As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. + +"The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. + +An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. + +A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". + +The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. + +The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. + +1. Exception to Section 3 of the GNU GPL. +You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. + +2. Conveying Modified Versions. +If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: + + a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. + +3. Object Code Incorporating Material from Library Header Files. +The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license document. + +4. Combined Works. +You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: + + a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license document. + + c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. + + e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) + +5. Combined Libraries. +You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +6. Revised Versions of the GNU Lesser General Public License. +The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. + +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + +0. Definitions. + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on the Program. + +To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +1. Source Code. +The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. + +A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. + + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +7. Additional Terms. +“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +11. Patents. +A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + +14. Revised Versions of this License. +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 program 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 . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. + +You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . + +The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . diff -Nru dtkwidget-5.5.48/linglong.yaml dtkwidget-5.6.12/linglong.yaml --- dtkwidget-5.5.48/linglong.yaml 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/linglong.yaml 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,37 @@ +package: + id: dtkwidget + name: dtkwidget + kind: lib + version: 5.6.3 + description: | + Deepin graphical user interface library \ + DtkWidget is Deepin graphical user interface for deepin desktop development. + +source: + kind: local + +base: + id: org.deepin.base/23.0.0 + +depends: + - id: qtbase/5.15.7 + - id: qttools/5.15.7 + - id: qtx11extras/5.15.7 + - id: qtsvg/5.15.7 + - id: gsettings-qt/0.3.1.1 + - id: dtkcommon/5.6.3 + - id: dtkcore/5.6.3 + - id: dtkgui/5.6.3 + - id: googletest/1.8.1 + - id: libqtxdg/3.6.0.1 + - id: cups/2.3.0.2 + +variables: + extra_args: | + -DBUILD_EXAMPLES=OFF \ + -DBUILD_DOCS=OFF \ + -DVERSION=${VERSION} + +build: + kind: cmake + diff -Nru dtkwidget-5.5.48/misc/DtkWidgetConfig.cmake.in dtkwidget-5.6.12/misc/DtkWidgetConfig.cmake.in --- dtkwidget-5.5.48/misc/DtkWidgetConfig.cmake.in 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/misc/DtkWidgetConfig.cmake.in 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,20 @@ +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) +find_dependency(DtkCore) +find_dependency(DtkGui) +find_dependency(Qt@QT_VERSION_MAJOR@Core) +find_dependency(Qt@QT_VERSION_MAJOR@Widgets) +find_dependency(Qt@QT_VERSION_MAJOR@DBus) +find_dependency(Qt@QT_VERSION_MAJOR@Network) +find_dependency(Qt@QT_VERSION_MAJOR@PrintSupport) +include(${CMAKE_CURRENT_LIST_DIR}/DtkWidgetTargets.cmake) +set(DtkWidget_LIBRARIES Dtk::Widget) +get_target_property(DtkWidget_INCLUDE_DIRS Dtk::Widget INTERFACE_INCLUDE_DIRECTORIES) +get_target_property(DtkWidget_LIBRARY_DIRS Dtk::Widget INTERFACE_LINK_DIRECTORIES) +set(DtkWidget_TOOL_DIRS "@PACKAGE_TOOL_INSTALL_DIR@") +check_required_components(DtkWidget) + +# Keep deprecated variables for compatibility +set(DTKWIDGET_INCLUDE_DIR ${DtkWidget_INCLUDE_DIRS}) +set(DTKWIDGET_TOOL_DIR ${DtkWidget_TOOL_DIRS}) diff -Nru dtkwidget-5.5.48/misc/dtkwidget.pc.in dtkwidget-5.6.12/misc/dtkwidget.pc.in --- dtkwidget-5.5.48/misc/dtkwidget.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/misc/dtkwidget.pc.in 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@LIBRARY_INSTALL_DIR@ +includedir=${prefix}/@INCLUDE_INSTALL_DIR@ + +Name: dtkwidget +Description: Deepin Tool Kit dtkwidget header files +Version: @PROJECT_VERSION@ +Libs: -L${libdir} -ldtkwidget +Cflags: -I${includedir} +Requires: dtkcore dtkgui Qt@QT_VERSION_MAJOR@Core Qt@QT_VERSION_MAJOR@Widgets Qt@QT_VERSION_MAJOR@DBus Qt@QT_VERSION_MAJOR@Network Qt@QT_VERSION_MAJOR@PrintSupport diff -Nru dtkwidget-5.5.48/misc/qt_lib_dtkwidget.pri.in dtkwidget-5.6.12/misc/qt_lib_dtkwidget.pri.in --- dtkwidget-5.5.48/misc/qt_lib_dtkwidget.pri.in 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/misc/qt_lib_dtkwidget.pri.in 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,14 @@ +QT.dtkwidget.VERSION = @PROJECT_VERSION@ +QT.dtkwidget.MAJOR_VERSION = @PROJECT_VERSION_MAJOR@ +QT.dtkwidget.MINOR_VERSION = @PROJECT_VERSION_MINOR@ +QT.dtkwidget.PATCH_VERSION = @PROJECT_VERSION_PATCH@ +QT.dtkwidget.name = dtkwidget +QT.dtkwidget.module = dtkwidget +QT.dtkwidget.tools = @CMAKE_INSTALL_PREFIX@/@TOOL_INSTALL_DIR@ +QT.dtkwidget.libs = @CMAKE_INSTALL_PREFIX@/@LIBRARY_INSTALL_DIR@ +QT.dtkwidget.includes = @CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_DIR@ +QT.dtkwidget.frameworks = +QT.dtkwidget.depends = core gui dtkcore network concurrent dtkgui printsupport printsupport_private widgets widgets_private gui_private x11extras dbus +QT.dtkwidget.module_config = v2 internal_module ltcg +QT.dtkwidget.DEFINES = +QT_MODULES += diff -Nru dtkwidget-5.5.48/.obs/workflows.yml dtkwidget-5.6.12/.obs/workflows.yml --- dtkwidget-5.5.48/.obs/workflows.yml 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/.obs/workflows.yml 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,51 @@ +test_build: + steps: + - link_package: + source_project: deepin:Develop:dde + source_package: %{SCM_REPOSITORY_NAME} + target_project: deepin:CI + + - configure_repositories: + project: deepin:CI + repositories: + - name: deepin_develop + paths: + - target_project: deepin:CI + target_repository: deepin_develop + architectures: + - x86_64 + - aarch64 + + - name: debian + paths: + - target_project: deepin:CI + target_repository: debian_sid + architectures: + - x86_64 + + - name: archlinux + paths: + - target_project: deepin:CI + target_repository: archlinux + architectures: + - x86_64 + + filters: + event: pull_request + +tag_build: + steps: + - branch_package: + source_project: deepin:Develop:dde + source_package: %{SCM_REPOSITORY_NAME} + target_project: deepin:Unstable:dde + filters: + event: tag_push + +commit_build: + steps: + - trigger_services: + project: deepin:Develop:dde + package: %{SCM_REPOSITORY_NAME} + filters: + event: push diff -Nru dtkwidget-5.5.48/plugin/CMakeLists.txt dtkwidget-5.6.12/plugin/CMakeLists.txt --- dtkwidget-5.5.48/plugin/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/plugin/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +add_subdirectory(dtkuidemo) +add_subdirectory(dtkuiplugin) diff -Nru dtkwidget-5.5.48/plugin/dtkuidemo/CMakeLists.txt dtkwidget-5.6.12/plugin/dtkuidemo/CMakeLists.txt --- dtkwidget-5.5.48/plugin/dtkuidemo/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/plugin/dtkuidemo/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,21 @@ +set(DEMO dtkuidemo) + +set(CMAKE_AUTOUIC ON) + +# We must find Qt5Widgets explicitly to include Qt5::uic target for AUTOUIC, although Qt5::Widgets is implicitly linked to demo through dtkwidget +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets) + +add_executable( + ${DEMO} + main.cpp + mainwindow.h + mainwindow.cpp + dtkuidemo.qrc + mainwindow.ui +) + +target_link_libraries(${DEMO} PRIVATE + Qt${QT_VERSION_MAJOR}::Core + Qt${QT_VERSION_MAJOR}::GuiPrivate + ${LIB_NAME} +) diff -Nru dtkwidget-5.5.48/plugin/dtkuidemo/dtkuidemo.pro dtkwidget-5.6.12/plugin/dtkuidemo/dtkuidemo.pro --- dtkwidget-5.5.48/plugin/dtkuidemo/dtkuidemo.pro 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/plugin/dtkuidemo/dtkuidemo.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2021-06-22T10:53:35 -# -#------------------------------------------------- - -QT += core gui dtkgui dtkwidget - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -TARGET = dtkuidemo -TEMPLATE = app - -# The following define makes your compiler emit warnings if you use -# any feature of Qt which has been marked as deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if you use deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -CONFIG += c++11 - -SOURCES += \ - main.cpp \ - mainwindow.cpp - -HEADERS += \ - mainwindow.h - -FORMS += \ - mainwindow.ui - -# Default rules for deployment. -qnx: target.path = /tmp/$${TARGET}/bin -else: unix:!android: target.path = /opt/$${TARGET}/bin -!isEmpty(target.path): INSTALLS += target - -RESOURCES += \ - dtkuidemo.qrc diff -Nru dtkwidget-5.5.48/plugin/dtkuidemo/main.cpp dtkwidget-5.6.12/plugin/dtkuidemo/main.cpp --- dtkwidget-5.5.48/plugin/dtkuidemo/main.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/plugin/dtkuidemo/main.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: alex - * - * Maintainer: alex - * - * 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 - * any later version. - * - * This program 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 . - */ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "mainwindow.h" #include #include diff -Nru dtkwidget-5.5.48/plugin/dtkuidemo/mainwindow.cpp dtkwidget-5.6.12/plugin/dtkuidemo/mainwindow.cpp --- dtkwidget-5.5.48/plugin/dtkuidemo/mainwindow.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/plugin/dtkuidemo/mainwindow.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: alex - * - * Maintainer: alex - * - * 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 - * any later version. - * - * This program 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 . - */ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "mainwindow.h" #include "ui_mainwindow.h" #include diff -Nru dtkwidget-5.5.48/plugin/dtkuidemo/mainwindow.h dtkwidget-5.6.12/plugin/dtkuidemo/mainwindow.h --- dtkwidget-5.5.48/plugin/dtkuidemo/mainwindow.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/plugin/dtkuidemo/mainwindow.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: alex - * - * Maintainer: alex - * - * 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 - * any later version. - * - * This program 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 . - */ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef MAINWINDOW_H #define MAINWINDOW_H diff -Nru dtkwidget-5.5.48/plugin/dtkuiplugin/CMakeLists.txt dtkwidget-5.6.12/plugin/dtkuiplugin/CMakeLists.txt --- dtkwidget-5.5.48/plugin/dtkuiplugin/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/plugin/dtkuiplugin/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.10) + +set(UIPLUGIN dtkuiplugin) +project(${UIPLUGIN} VERSION 1.0.0 LANGUAGES CXX) + +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS UiPlugin Gui) + +set(LIB_DWIDGET ${LIB_NAME}) + +if (CMAKE_PROJECT_NAME STREQUAL ${UIPLUGIN}) + message("compile ${UIPLUGIN} individually") + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + set(CMAKE_AUTOMOC ON) + set(CMAKE_AUTORCC ON) + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + include(GNUInstallDirs) + if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX /usr) + endif() + find_package(DtkWidget REQUIRED) + set(LIB_DWIDGET Dtk::Widget) +endif() + +add_library( + ${UIPLUGIN} SHARED + dcustomerplugins.h + dcustomerplugins.cpp + dcustomermacrowidget.h + dtkuiplugin.qrc +) + +target_link_libraries( + ${UIPLUGIN} PRIVATE + ${LIB_DWIDGET} + Qt${QT_VERSION_MAJOR}::UiPlugin + Qt${QT_VERSION_MAJOR}::GuiPrivate +) + +set(INSTALL_PLUGIN OFF CACHE BOOL "Install dtk designer plugin") +if(INSTALL_PLUGIN) + set(QT_PLUGIN_DESIGNER_PATH "qt5/plugins/designer") + install(TARGETS ${UIPLUGIN} DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/${QT_PLUGIN_DESIGNER_PATH}") + message(STATUS "Install path:" "${CMAKE_INSTALL_FULL_LIBDIR}/${QT_PLUGIN_DESIGNER_PATH}") +endif() diff -Nru dtkwidget-5.5.48/plugin/dtkuiplugin/dcustomermacrowidget.h dtkwidget-5.6.12/plugin/dtkuiplugin/dcustomermacrowidget.h --- dtkwidget-5.5.48/plugin/dtkuiplugin/dcustomermacrowidget.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/plugin/dtkuiplugin/dcustomermacrowidget.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: alex - * - * Maintainer: alex - * - * 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 - * any later version. - * - * This program 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 . - */ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DCUSTOMERMACROWIDGET_H #define DCUSTOMERMACROWIDGET_H diff -Nru dtkwidget-5.5.48/plugin/dtkuiplugin/dcustomerplugins.cpp dtkwidget-5.6.12/plugin/dtkuiplugin/dcustomerplugins.cpp --- dtkwidget-5.5.48/plugin/dtkuiplugin/dcustomerplugins.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/plugin/dtkuiplugin/dcustomerplugins.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: alex - * - * Maintainer: alex - * - * 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 - * any later version. - * - * This program 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 . - */ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dcustomerplugins.h" DCustomWidgets::DCustomWidgets(QObject *parent) diff -Nru dtkwidget-5.5.48/plugin/dtkuiplugin/dcustomerplugins.h dtkwidget-5.6.12/plugin/dtkuiplugin/dcustomerplugins.h --- dtkwidget-5.5.48/plugin/dtkuiplugin/dcustomerplugins.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/plugin/dtkuiplugin/dcustomerplugins.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * Author: alex - * - * Maintainer: alex - * - * 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 - * any later version. - * - * This program 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 . - */ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DCUSTOMERPLUGINS_H #define DCUSTOMERPLUGINS_H diff -Nru dtkwidget-5.5.48/plugin/dtkuiplugin/dtkuiplugin.pro dtkwidget-5.6.12/plugin/dtkuiplugin/dtkuiplugin.pro --- dtkwidget-5.5.48/plugin/dtkuiplugin/dtkuiplugin.pro 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/plugin/dtkuiplugin/dtkuiplugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -TARGET = dcustomwidgets -QT += widgets dtkwidget uiplugin - -load(qt_build_config) -#MODULE_VERSION = 5.11.3 -PLUGIN_CLASS_NAME = DCustomWidgetsPlugin -PLUGIN_TYPE = designer -CONFIG += tool_plugin -load(qt_plugin) - -SOURCES += \ - dcustomerplugins.cpp - -HEADERS += \ - dcustomerplugins.h \ - dcustomermacrowidget.h - -RESOURCES += dtkuiplugin.qrc - diff -Nru dtkwidget-5.5.48/plugin/dtkuiplugin/.qmake.conf dtkwidget-5.6.12/plugin/dtkuiplugin/.qmake.conf --- dtkwidget-5.5.48/plugin/dtkuiplugin/.qmake.conf 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/plugin/dtkuiplugin/.qmake.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# load(qt_build_config) -# MODULE_VERSION = 5.11.3 -# Move to dtkgui_plugin.pro, .qmake.conf is needed. diff -Nru dtkwidget-5.5.48/plugin/plugin.pro dtkwidget-5.6.12/plugin/plugin.pro --- dtkwidget-5.5.48/plugin/plugin.pro 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/plugin/plugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += dtkuidemo dtkuiplugin diff -Nru dtkwidget-5.5.48/README.md dtkwidget-5.6.12/README.md --- dtkwidget-5.5.48/README.md 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/README.md 2023-05-15 03:42:41.000000000 +0000 @@ -1,6 +1,12 @@ -# Deepin Tool Kit Widget {#mainpage} +# Deepin Tool Kit Widget -Deepin Tool Kit (Dtk) is the base devlopment tool of all C++/Qt Developer work on Deepin. +Deepin Tool Kit Widget(DtkWidget) provides the base widgets on Deepin. + +中文说明:[README_zh_CN.md](./README.zh_CN.md) + +## Documentation + +中文文档:[dtkwidget文档](https://linuxdeepin.github.io/dtkwidget/index.html) ## Dependencies @@ -13,27 +19,38 @@ ### Build from source code 1. Make sure you have installed all dependencies. -```` -sudo apt build-dep . -```` -If you need to use the designer plugin, you should also install: -```` -sudo apt install qttools5-dev -```` -2. Build: -```` -$ mkdir build +```bash +sudo apt build-dep ./ +``` + +If you need to use the designer plugin, you can: + +```bash +$ sudo apt install qttools5-dev + +# build +$ cmake ./plugin/dtkuiplugin -B build -DINSTALL_PLUGIN=ON -DCMAKE_INSTALL_PREFIX=/usr +$ cmake --build build -j$(nproc) + +# install $ cd build -$ qmake .. -$ make -```` +$ sudo make install +``` + +2. Build: + +```bash +cmake -B build +cmake --build build -j$(nproc) +``` 3. Install: -```` -$ sudo make install -```` +```bash +cd build +sudo make install +``` ## Getting help @@ -49,8 +66,19 @@ We encourage you to report issues and contribute changes * [Contribution guide for developers](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers-en). (English) -* [开发者代码贡献指南](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers) (中文) + +## Made with dtkwidget + +List of some open source projects using dtkwidget: (Contact us or open a pull request to add yours) + +* **[DMarked](https://github.com/DMarked/DMarked)**: Markdown Editor with dtkwidget +* **[DtkTimer](https://github.com/gfdgd-xi/timer)**: Clock with dtkwidget +* **[simple-image-filter](https://github.com/dependon/simple-image-filter)**: Image Process with dtkwidget +* **[SparkStore](https://github.com/Spark-Store/Spark-Store)**: SparkStore +* **[WingHexExplorer](https://github.com/Wing-summer/WingHexExplorer)**: Powerful Hexadecimal Editor with dtkwidget +* **[WingTool](https://github.com/Wing-summer/WingTool)**: A Productivity Plugin-based Toolbox with dtkwidget +* **[ScreenLight](https://github.com/Wing-summer/ScreenLight)**: A small tool to ajust the brightness of the screen with dtkwidget ## License -deepin-tool-kit is licensed under [GPLv3](LICENSE). +deepin-tool-kit is licensed under [LGPL-3.0-or-later](LICENSE). diff -Nru dtkwidget-5.5.48/README.zh_CN.md dtkwidget-5.6.12/README.zh_CN.md --- dtkwidget-5.5.48/README.zh_CN.md 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/README.zh_CN.md 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,82 @@ +## Deepin Tool Kit Widget + +Deepin Tool Kit Widget(DtkWidget) 提供各种UOS风格dtk基础控件. + +## 文档 + +中文文档:[dtkwidget文档](https://linuxdeepin.github.io/dtkwidget/index.html) + +## 依赖 + +### 编译依赖 + +* Qt >= 5.6 + +## 安装 + +### 从源代码构建 + +1. 确保已经安装了所有的编译依赖. + +```bash +sudo apt build-dep ./ +``` + +如果需要使用 `qtcreator` 的设计功能,可以 : + +```bash +$ sudo apt install qttools5-dev + +# build +$ cmake ./plugin/dtkuiplugin -B build -DINSTALL_PLUGIN=ON -DCMAKE_INSTALL_PREFIX=/usr +$ cmake --build build -j$(nproc) + +# install +$ cd build +$ sudo make install +``` + +2. 构建 `dtkwidget` : + +```bash +cmake -B build +cmake --build build -j$(nproc) +``` + +3. 安装: + +```bash +cd build +sudo make install +``` + +## 帮助 + +任何使用问题都可以通过以下方式寻求帮助: + +* [Gitter](https://gitter.im/orgs/linuxdeepin/rooms) +* [IRC channel](https://webchat.freenode.net/?channels=deepin) +* [Forum](https://bbs.deepin.org) +* [WiKi](https://wiki.deepin.org/) + +## 参与贡献 + +我们鼓励您报告问题并作出更改 + +* [开发者代码贡献指南](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers) + +## 使用dtkwidget的项目 + +下面是使用dtkwidget的开源项目:(如果您想添加属于自己的开源项目请给我们提交PR) + +* **[DMarked](https://github.com/DMarked/DMarked)**: 使用Dtk构建的Markdown编辑器 +* **[DtkTimer](https://github.com/gfdgd-xi/timer)**: 使用DtkWidget构建的时钟 +* **[simple-image-filter](https://github.com/dependon/simple-image-filter)**: 使用DtkWidget构建的图像处理软件 +* **[SparkStore](https://github.com/Spark-Store/Spark-Store)**: 星火商店 +* **[WingHexExplorer](https://github.com/Wing-summer/WingHexExplorer)**: 使用DtkWidget构建的强大的十六进制编辑器 +* **[WingTool](https://github.com/Wing-summer/WingTool)**: 使用DtkWidget构建的基于插件的工具箱 +* **[ScreenLight](https://github.com/Wing-summer/ScreenLight)**: 使用DtkWidget构建的用于调节屏幕亮度的小工具 + +## 协议 + +DTK工具包遵循协议 [LGPL-3.0-or-later](LICENSE). diff -Nru dtkwidget-5.5.48/.reuse/dep5 dtkwidget-5.6.12/.reuse/dep5 --- dtkwidget-5.5.48/.reuse/dep5 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/.reuse/dep5 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,94 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: dtkwidget +Upstream-Contact: UnionTech Software Technology Co., Ltd. <> +Source: https://github.com/linuxdeepin/dtkwidget + +# ci +Files: .github/* .gitlab-ci.yml output/results.txt .obs/* +Copyright: None +License: CC0-1.0 + +# gitignore +Files: .gitignore +Copyright: None +License: CC0-1.0 + +# xml toml json conf yaml +Files: *.toml *.json *conf *.yaml +Copyright: None +License: CC0-1.0 + +#interface +Files: include/DWidget/* +Copyright: None +License: CC0-1.0 + +#DBus +Files: src/widgets/dbus/* src/widgets/private/mpris/* +Copyright: None +License: CC0-1.0 + +# rpm +Files: rpm/* +Copyright: None +License: CC0-1.0 + +# debian +Files: debian/* +Copyright: None +License: LGPL-3.0-or-later + +# Arch +Files: archlinux/* +Copyright: None +License: CC0-1.0 + +# README +Files: README.md README.zh_CN.md CHANGELOG.md +Copyright: UnionTech Software Technology Co., Ltd. +License: CC-BY-4.0 + +# Docs +Files: docs/* +Copyright: 2023 deepin doc doc go SIG +License: CC-BY-4.0 + +# Project file +Files: *.pro *.prf *.pri *.qrc *CMakeLists.txt *.cmake *.in +Copyright: None +License: CC0-1.0 + +# Printview +Files: tests/testcases/printpreview/* +Copyright: None +License: CC0-1.0 + +# others +Files: examples/collections/resources/data/*.txt +Copyright: None +License: CC0-1.0 + +# imag +Files: doc/images/* src/widgets/assets/images/* plugin/dtkuiplugin/images/* +Copyright: UnionTech Software Technology Co., Ltd. +License: LGPL-3.0-or-later + +# svg +Files: examples/collections/icons/texts/* plugin/dtkuidemo/logo_icon.svg +Copyright: UnionTech Software Technology Co., Ltd. +License: LGPL-3.0-or-later + +#example png +Files: examples/collections/images/* +Copyright: UnionTech Software Technology Co., Ltd. +License: LGPL-3.0-or-later + +#icon +Files: src/widgets/assets/icons/* src/widgets/assets/built-in-icons/* +Copyright: UnionTech Software Technology Co., Ltd. +License: LGPL-3.0-or-later + +#ui +Files: *.ui +Copyright: UnionTech Software Technology Co., Ltd. +License: LGPL-3.0-or-later diff -Nru dtkwidget-5.5.48/rpm/dtkwidget.spec dtkwidget-5.6.12/rpm/dtkwidget.spec --- dtkwidget-5.5.48/rpm/dtkwidget.spec 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/rpm/dtkwidget.spec 2023-05-15 03:42:41.000000000 +0000 @@ -28,7 +28,6 @@ BuildRequires: pkgconfig(dframeworkdbus) BuildRequires: pkgconfig(gsettings-qt) BuildRequires: pkgconfig(libudev) -BuildRequires: pkgconfig(librsvg-2.0) BuildRequires: pkgconfig(libstartup-notification-1.0) BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(x11) diff -Nru dtkwidget-5.5.48/src/CMakeLists.txt dtkwidget-5.6.12/src/CMakeLists.txt --- dtkwidget-5.5.48/src/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,101 @@ +pkg_check_modules(QGSettings REQUIRED IMPORTED_TARGET gsettings-qt) +pkg_check_modules(XcbUtil REQUIRED IMPORTED_TARGET xcb-util) +pkg_check_modules(StartupNotification REQUIRED IMPORTED_TARGET libstartup-notification-1.0) +pkg_check_modules(Xext REQUIRED IMPORTED_TARGET xext) +pkg_check_modules(Xi REQUIRED IMPORTED_TARGET xi) +pkg_check_modules(X11 REQUIRED IMPORTED_TARGET x11) + +include(util/util.cmake) +include(widgets/widgets.cmake) + +file(GLOB TRANSLATIONS translations/*.ts) +qt5_add_translation(QM_FILES ${TRANSLATIONS}) + +add_library(${LIB_NAME} SHARED + ${WIDGETS} + ${QM_FILES} + ${UTIL} + ${PUBLIC_HEADERS} +) + +set(TRANSLATIONS_INSTALL_DIR + "dtk${PROJECT_VERSION_MAJOR}/DWidget/translations" +) + +target_compile_definitions(${LIB_NAME} PRIVATE + SN_API_NOT_YET_FROZEN + DTK_NO_MULTIMEDIA + DWIDGET_TRANSLATIONS_DIR="${TRANSLATIONS_INSTALL_DIR}" + LIBDTKWIDGET_LIBRARY +) + +if(DTK_STATIC_TRANSLATION) +target_compile_definitions(${LIB_NAME} PRIVATE + DTK_STATIC_TRANSLATION +) +endif() + +target_include_directories(${LIB_NAME} +PUBLIC + $ + $ + $ + $ + $ + $ +INTERFACE + $ +) + +target_link_libraries(${LIB_NAME} +PUBLIC + Qt5::Widgets + Qt5::Network + Qt5::Core + Qt5::DBus + Qt5::PrintSupport + Dtk::Gui + Dtk::Core +PRIVATE + Qt5::Concurrent + Qt5::X11Extras + Qt5::GuiPrivate + Qt5::WidgetsPrivate + Qt5::PrintSupportPrivate + PkgConfig::QGSettings + PkgConfig::StartupNotification + PkgConfig::Xext + PkgConfig::Xi + PkgConfig::X11 + PkgConfig::XcbUtil +) + +target_link_directories(${LIB_NAME} INTERFACE + $ + $ +) + +set_target_properties(${LIB_NAME} + PROPERTIES + VERSION ${CMAKE_PROJECT_VERSION} + SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR} + EXPORT_NAME Widget + PUBLIC_HEADER "${PUBLIC_HEADERS}" +) +install( + TARGETS ${LIB_NAME} + EXPORT DtkWidgetTargets + DESTINATION ${LIBRARY_INSTALL_DIR} + PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR} +) + +install( + EXPORT DtkWidgetTargets + FILE DtkWidgetTargets.cmake + NAMESPACE Dtk:: + DESTINATION ${CONFIG_INSTALL_DIR} +) + +install(FILES ${QM_FILES} DESTINATION "${CMAKE_INSTALL_DATADIR}/${TRANSLATIONS_INSTALL_DIR}") + +dconfig_meta_files(COMMONID org.deepin.dtkwidget FILES ${CMAKE_CURRENT_LIST_DIR}/org.deepin.dtkwidget.feature-display.json) diff -Nru dtkwidget-5.5.48/src/dtkwidget_global.h dtkwidget-5.6.12/src/dtkwidget_global.h --- dtkwidget-5.5.48/src/dtkwidget_global.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/dtkwidget_global.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include - -#include - -#define DWIDGET_NAMESPACE Widget -#define DTK_WIDGET_NAMESPACE DTK_NAMESPACE::Widget - -#define DWIDGET_BEGIN_NAMESPACE namespace DTK_NAMESPACE { namespace DWIDGET_NAMESPACE { -#define DWIDGET_END_NAMESPACE }} -#define DWIDGET_USE_NAMESPACE using namespace DTK_WIDGET_NAMESPACE; - -#if defined(DTK_STATIC_LIB) -void inline dtk_windget_init_resource() -{ - Q_INIT_RESOURCE(icons); - Q_INIT_RESOURCE(dui_theme_dark); - Q_INIT_RESOURCE(dui_theme_light); - // TODO: use marco create by dtk_build -#if defined(DTK_STATIC_TRANSLATION) - Q_INIT_RESOURCE(dtkwidget_translations); -#endif -} -#endif - -namespace Dtk -{ -namespace Widget -{ - -#if defined(DTK_STATIC_LIB) -#define DWIDGET_INIT_RESOURCE() \ - do { \ - dtk_windget_init_resource(); \ - } while (0) -#endif - -} -} - -#if defined(DTK_STATIC_LIB) -# define LIBDTKWIDGETSHARED_EXPORT -#else -#if defined(LIBDTKWIDGET_LIBRARY) -# define LIBDTKWIDGETSHARED_EXPORT Q_DECL_EXPORT -#else -# define LIBDTKWIDGETSHARED_EXPORT Q_DECL_IMPORT -#endif -#endif - -#define DTKWIDGET_DECL_DEPRECATED D_DECL_DEPRECATED - -#define D_THEME_INIT_WIDGET(className, ...) do{\ - DThemeManager * manager = DThemeManager::instance(); \ - {const QString &sheet = this->styleSheet() + manager->getQssForWidget(#className, this); \ - if (!sheet.isEmpty()) this->setStyleSheet(sheet); \ - } \ - connect(manager, &DThemeManager::themeChanged, this, [this, manager] (QString) { \ - const QString &sheet = manager->getQssForWidget(#className, this); \ - if (!sheet.isEmpty()) this->setStyleSheet(sheet); \ - });\ - connect(manager, &DThemeManager::widgetThemeChanged, this, [this, manager] (QWidget *w, QString) { \ - if (w == this) this->setStyleSheet(manager->getQssForWidget(#className, this)); \ - }); \ - QStringList list = QString(#__VA_ARGS__).replace(" ", "").split(",");\ - const QMetaObject *self = metaObject();\ - Q_FOREACH (const QString &str, list) {\ - if(str.isEmpty())\ - continue;\ - connect(this, self->property(self->indexOfProperty(str.toLatin1().data())).notifySignal(),\ - manager, manager->metaObject()->method(manager->metaObject()->indexOfMethod("updateQss()")));\ - } \ - } while (0); diff -Nru dtkwidget-5.5.48/src/d_version.pri dtkwidget-5.6.12/src/d_version.pri --- dtkwidget-5.5.48/src/d_version.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/d_version.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -CONFIG(debug, debug|release){ -# D_VERION=5.5 -# export(D_VERION) -} diff -Nru dtkwidget-5.5.48/src/lib.pri dtkwidget-5.6.12/src/lib.pri --- dtkwidget-5.5.48/src/lib.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/lib.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -include($$PWD/config.pri) - -CONFIG += c++11 create_pc create_prl no_install_prl - -isEmpty(LIB_INSTALL_DIR) { - target.path = $$PREFIX/lib -} else { - target.path = $$LIB_INSTALL_DIR -} - -message("Build dtkwidget version: $${VERSION}") - -QMAKE_PKGCONFIG_LIBDIR = $$target.path -QMAKE_PKGCONFIG_VERSION = $$VERSION -QMAKE_PKGCONFIG_DESTDIR = pkgconfig - -isEmpty(INCLUDE_INSTALL_DIR) { - DTK_INCLUDEPATH = $$PREFIX/include/libdtk-$${VER_MAJ}.$${VER_MIN}.$${VER_PAT} -} else { - DTK_INCLUDEPATH = $$INCLUDE_INSTALL_DIR/libdtk-$${VER_MAJ}.$${VER_MIN}.$${VER_PAT} -} - -load(configure) -qtCompileTest(libdframeworkdbus) { - DEFINES += DBUS_VERSION_0_4_2 -} - -INSTALLS += includes target - -win32* { - CONFIG += staticlib -} diff -Nru dtkwidget-5.5.48/src/org.deepin.dtkwidget.feature-display.json dtkwidget-5.6.12/src/org.deepin.dtkwidget.feature-display.json --- dtkwidget-5.5.48/src/org.deepin.dtkwidget.feature-display.json 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/org.deepin.dtkwidget.feature-display.json 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,26 @@ +{ + "magic": "dsg.config.meta", + "version": "1.0", + "contents": { + "featureUpdated": { + "value": false, + "serial": 0, + "flags": [], + "name": "Whether the application has new feature updates", + "name[zh_CN]": "配置应用的更新状态", + "description": "Configure the update status of the application", + "permissions": "readwrite", + "visibility": "public" + }, + "autoDisplayFeature": { + "value": false, + "serial": 0, + "flags": [], + "name": "The application automatically display new features once", + "name[zh_CN]": "配置应用是否自动展示一次新特性", + "description": "The application automatically display updated contents once", + "permissions": "readwrite", + "visibility": "public" + } + } +} diff -Nru dtkwidget-5.5.48/src/platforms/mac/osxwindow.h dtkwidget-5.6.12/src/platforms/mac/osxwindow.h --- dtkwidget-5.5.48/src/platforms/mac/osxwindow.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/platforms/mac/osxwindow.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later namespace OSX { void HideWindowTitlebar(long winid); diff -Nru dtkwidget-5.5.48/src/platforms/mac/osxwindow.mm dtkwidget-5.6.12/src/platforms/mac/osxwindow.mm --- dtkwidget-5.5.48/src/platforms/mac/osxwindow.mm 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/platforms/mac/osxwindow.mm 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * 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 - * any later version. - * - * This program 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 . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "osxwindow.h" diff -Nru dtkwidget-5.5.48/src/platforms/platforms.pri dtkwidget-5.6.12/src/platforms/platforms.pri --- dtkwidget-5.5.48/src/platforms/platforms.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/platforms/platforms.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - -linux { - include($$PWD/x11/x11.pri) -} - -win32* { - include($$PWD/windows/windows.pri) -} diff -Nru dtkwidget-5.5.48/src/platforms/windows/popupmenustyle.cpp dtkwidget-5.6.12/src/platforms/windows/popupmenustyle.cpp --- dtkwidget-5.5.48/src/platforms/windows/popupmenustyle.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/platforms/windows/popupmenustyle.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "popupmenustyle.h" #include diff -Nru dtkwidget-5.5.48/src/platforms/windows/popupmenustyle.h dtkwidget-5.6.12/src/platforms/windows/popupmenustyle.h --- dtkwidget-5.5.48/src/platforms/windows/popupmenustyle.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/platforms/windows/popupmenustyle.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef POPUPMENUSTYLEH #define POPUPMENUSTYLEH diff -Nru dtkwidget-5.5.48/src/platforms/windows/windows.pri dtkwidget-5.6.12/src/platforms/windows/windows.pri --- dtkwidget-5.5.48/src/platforms/windows/windows.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/platforms/windows/windows.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -HEADERS += \ - $$PWD/popupmenustyle.h - - -SOURCES += \ - $$PWD/popupmenustyle.cpp diff -Nru dtkwidget-5.5.48/src/platforms/x11/x11.pri dtkwidget-5.6.12/src/platforms/x11/x11.pri --- dtkwidget-5.5.48/src/platforms/x11/x11.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/platforms/x11/x11.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -HEADERS += \ - $$PWD/xutil.h - -SOURCES += \ - $$PWD/xutil.cpp diff -Nru dtkwidget-5.5.48/src/platforms/x11/xutil.cpp dtkwidget-5.6.12/src/platforms/x11/xutil.cpp --- dtkwidget-5.5.48/src/platforms/x11/xutil.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/platforms/x11/xutil.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "xutil.h" diff -Nru dtkwidget-5.5.48/src/platforms/x11/xutil.h dtkwidget-5.6.12/src/platforms/x11/xutil.h --- dtkwidget-5.5.48/src/platforms/x11/xutil.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/platforms/x11/xutil.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #pragma once diff -Nru dtkwidget-5.5.48/src/src.pro dtkwidget-5.6.12/src/src.pro --- dtkwidget-5.5.48/src/src.pro 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/src.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -include(d_version.pri) - -TARGET = dtkwidget$$D_VERION -TEMPLATE = lib -QT += dtkcore$$D_VERION - -CONFIG += internal_module -CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT - -# 龙芯架构上没有默认添加PT_GNU_STACK-section,所以此处手动指定一下 -contains(QMAKE_HOST.arch, mips.*): QMAKE_LFLAGS_SHLIB += "-Wl,-z,noexecstack" - -QT += network concurrent dtkgui$$D_VERION printsupport printsupport-private -greaterThan(QT_MAJOR_VERSION, 4) { - QT += widgets widgets-private - # Qt >= 5.8 - greaterThan(QT_MAJOR_VERSION, 5)|greaterThan(QT_MINOR_VERSION, 7): QT += gui-private - else: QT += platformsupport-private -} - -linux* { - QT += x11extras dbus - #LIBS += -lcups - ###(zccrs): use load(dtk_qmake), dtkcore5.5 > 2.0.9 - ARCH = $$QMAKE_HOST.arch - isEqual(ARCH, sw_64) | isEqual(ARCH, mips64) | isEqual(ARCH, mips32) { - DEFINES += FORCE_RASTER_WIDGETS - } - - isEmpty(DTK_NO_AI_SERVICE) { - DEFINES += ENABLE_AI - DBUS_INTERFACES += \ - $$PWD/widgets/dbus/com.iflytek.aiservice.iat.xml\ - $$PWD/widgets/dbus/com.iflytek.aiservice.session.xml - } -} - -mac* { - QT += svg dbus - DEFINES += DTK_TITLE_DRAG_WINDOW -} - -win* { - QT += svg - DEFINES += DTK_TITLE_DRAG_WINDOW -} - -isEmpty(DTK_NO_MULTIMEDIA){ - DEFINES += DTK_NO_MULTIMEDIA -# QT -= multimedia -} - -!isEmpty(DTK_STATIC_LIB){ - DEFINES += DTK_STATIC_LIB - CONFIG += staticlib -} - -HEADERS += dtkwidget_global.h - -includes.files += \ - $$PWD/dtkwidget_global.h\ - $$PWD/DtkWidgets\ - $$PWD/dtkwidget_config.h - -include($$PWD/util/util.pri) -include($$PWD/widgets/widgets.pri) - -linux* { - includes.files += $$PWD/platforms/linux/*.h -} -win32* { - includes.files += $$PWD/platforms/windows/*.h -} - -DTK_MODULE_NAME=$$TARGET -load(dtk_build) - -INSTALLS += includes target - -load(dtk_cmake) - -load(dtk_module) - -!isEmpty(DTK_MULTI_VERSION) { -# 支持上游一包多依赖 -load(dtk_multiversion) -# 5.5 5.6可通过重复调用此函数,来增加对更多版本的支持 -dtkBuildMultiVersion(5.5) - -# INSTALL变量增加多版本下的配置文件 -load(dtk_install_multiversion) -} diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ady.ts dtkwidget-5.6.12/src/translations/dtkwidget_ady.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ady.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ady.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_af.ts dtkwidget-5.6.12/src/translations/dtkwidget_af.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_af.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_af.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_am_ET.ts dtkwidget-5.6.12/src/translations/dtkwidget_am_ET.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_am_ET.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_am_ET.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - ምስጋና ለ ተርጓሚው ሳምሶን በለጠ በላይነህ - - - - Version: %1 - እትም: %1 - - - + %1 is released under %2 %1 የ ተለቀቀው በዚህ መሰረት ነው %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black ጥቁር - + White ነጭ - + Dark Gray ጥቁር ግራጫ - + Gray ግራጫ - + Light Gray ነጣ ያለ ግራጫ - + Red ቀይ - + Green አረንጓዴ - + Blue ሰማያዊ - + Cyan ሲያን - + Magenta ማጄንታ - + Yellow ቢጫ - + Dark Red ጥቁር ቀይ - + Dark Green ጥቁር አረንጓዴ - + Dark Blue ጥቁር ሰማያዊ - + Dark Cyan ጥቁር ሲያን - + Dark Magenta ጥቁር ማጄንታ - + Dark Yellow ጥቁር ቢጫ @@ -110,12 +105,12 @@ DInputDialog - + Cancel መሰረዣ - + Confirm ማረጋገጫ @@ -123,580 +118,637 @@ DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - መሰረዣ + መሰረዣ - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel መሰረዣ - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut እባክዎን አዲስ አቋራጭ ያስገቡ - + None ምንም - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + ማረጋገጫ PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result ምንም ውጤት አልተገኘም - + Restore Defaults ነባር እንደ ነበር መመለሻ + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + ምስጋና ለ ተርጓሚው ሳምሶን በለጠ በላይነህ + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut እባክዎን አዲስ አቋራጭ ያስገቡ @@ -704,44 +756,49 @@ TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help እርዳታ - + Feedback - + + + + + Custom toolbar + - + About ስለ - + Exit መውጫ - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ar.ts dtkwidget-5.6.12/src/translations/dtkwidget_ar.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ar.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ar.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - شكر وتقدير - - - - Version: %1 - اﻹصدار : %1 - - - + %1 is released under %2 %1 أصدر تحت رخصة %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black أسود - + White أبيض - + Dark Gray رمادي غامق - + Gray رمادي - + Light Gray رمادي فاتح - + Red أحمر - + Green أخضر - + Blue أزرق - + Cyan سماوي - + Magenta أرجواني - + Yellow أصفر - + Dark Red أحمر غامق - + Dark Green أخضر غامق - + Dark Blue أزرق غامق - + Dark Cyan سماوي غامق - + Dark Magenta أرجواني غامق - + Dark Yellow أصفر غامق @@ -110,12 +105,12 @@ DInputDialog - + Cancel إلغاء - + Confirm تأكيد @@ -123,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut إدخل اختصار جديد @@ -131,22 +126,22 @@ DLineEdit - + Stop reading التوقف عن القراءة - + Text to Speech النص الى الكلام - + Translate ترجم - + Speech To Text الكلام الى النص @@ -154,417 +149,422 @@ DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - إلغاء + إلغاء - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search بحث @@ -572,17 +572,17 @@ DSettingsDialog - + Cancel إلغاء - + Replace إستبدال - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately يتعارض هذا الاختصار مع 1%، انقر فوق "إضافة" لجعل هذا الاختصار فعالاً على الفور @@ -590,113 +590,165 @@ DShortcutEdit - + Please input a new shortcut الرجاء إدخال اختصاراّ جديداً - + None غير موجود - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + التوقف عن القراءة - - Maximize - + + Text to Speech + النص الى الكلام - - Tile window to left of screen - + + Translate + ترجم - - Tile window to right of screen - + + Speech To Text + الكلام الى النص - DTextEdit + DToolbarEditPanel - - Stop reading - التوقف عن القراءة + + Default toolset + - - Text to Speech - النص الى الكلام + + Drag your favorite items into the toolbar + - - Translate - ترجم + + Drag below items into the toolbar to restore defaults + - - Speech To Text - الكلام الى النص + + Confirm + تأكيد PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result لا توجد نتائج بحث - + Restore Defaults استعادة الإعدادت الإفتراضية + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + شكر وتقدير + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut يرجى إدخال اختصار جديد @@ -704,44 +756,49 @@ TitleBarMenu - + Theme الموضوع - + Light Theme موضوع فاتح - + Dark Theme موضوع غامق - + System Theme موضوع النظام - + Help مساعدة - + Feedback - + + + + + Custom toolbar + - + About حول - + Exit خروج - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ast.ts dtkwidget-5.6.12/src/translations/dtkwidget_ast.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ast.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ast.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - Agradecimientos - - - - Version: %1 - Versión: %1 - - - + %1 is released under %2 %1 llánzase so %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black Prietu - + White Blancu - + Dark Gray Buxu escuro - + Gray Buxu - + Light Gray Buxu claro - + Red Bermeyu - + Green Verde - + Blue Azul - + Cyan Cianu - + Magenta Maxenta - + Yellow Mariellu - + Dark Red Bermeyu escuro - + Dark Green Verde escuro - + Dark Blue Azul escuro - + Dark Cyan Cianu escuro - + Dark Magenta Maxenta escuro - + Dark Yellow Mariellu escuro @@ -110,593 +105,650 @@ DInputDialog - + Cancel Encaboxar - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - Encaboxar + Encaboxar - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel Encaboxar - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut Introduz un atayu nuevu - + None Nada - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result Nun hai resultaos de la gueta - + Restore Defaults Reafitar valores + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Agradecimientos + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut Introduz un atayu nuevu @@ -704,44 +756,49 @@ TitleBarMenu - + Theme Estilu - + Light Theme Estilu claru - + Dark Theme Estilu escuru - + System Theme Estilu del sistema - + Help Ayuda - + Feedback - + + + + + Custom toolbar + - + About Tocante a - + Exit Colar - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_az.ts dtkwidget-5.6.12/src/translations/dtkwidget_az.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_az.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_az.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Təşəkkürlər - - - - Version: %1 - Versiya: %1 - - - + %1 is released under %2 %1,%2 altında buraxılır @@ -20,87 +17,87 @@ DCrumbEdit - + Black Geriyə - + White Bəyaz - + Dark Gray Tutqun boz - + Gray Boz - + Light Gray Açıq boz - + Red Qırmızı - + Green Yaşıl - + Blue Mavi - + Cyan Yaşılı mavi - + Magenta Maqenta - + Yellow Sarı - + Dark Red Tünd qırmızı - + Dark Green Tünd yaşıl - + Dark Blue Tünd mavi - + Dark Cyan Tünd yaşılı mavi - + Dark Magenta Tünd maqenta - + Dark Yellow Tünd sarı @@ -108,12 +105,12 @@ DInputDialog - + Cancel Ləğv et - + Confirm Təsdiq edin @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Yeni qısayol əlavə edin @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Oxumanı dayandırın - + Text to Speech Mətndən nitqə - + Translate Tərcümə - + Speech To Text Mətndən nitqə @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Əlavə - + Cancel button Ləğv et - - + + Print button Çap - + Basic Əsas - + Printer Printer - + Copies Nüsxələr - + Page range Səhifə aralığı - + All Bütöv - + Current page Cari səhifə - + Select pages Səhifələri seçin - + Orientation İstiqamət - + Portrait Portret - + Landscape Mənzərə - + Pages Səhifələr - + Color mode Rəng rejimi - - - + + + + + Color Rəng - - - + + + Grayscale Boz çalarlı - + Margins Haşiyələr - + Narrow (mm) Ensiz (mm) - + Normal (mm) Adi (mm) - + Moderate (mm) Məqbul (mm) - + Customize (mm) Ayarlanan (mm) - + Top Yuxarı - + Left Sol - + Bottom Aşağı - + Right Sağ - + Scaling Miqyaslama - + Actual size Həqiqi ölçüsü - + Scale Miqyas - + Paper Kağız - + Paper size Kağızın ölçüsü - + Print Layout Çap qatı - + Duplex İkili - + N-up printing N-up çapı - + 2 pages/sheet, 1×2 2 səhifə/vərəq, 1×2 - + 4 pages/sheet, 2×2 4 vərəq/səhifə, 2×2 - + 6 pages/sheet, 2×3 6 vərəq/səhifə, 2×3 - + 9 pages/sheet, 3×3 9 vərəq/səhifə, 3×3 - + 16 pages/sheet, 4×4 16 vərəq/səhifə, 4×4 - + Layout direction Qatın istiqaməti - + Page Order Səhifə sırası - + Collate pages Səhifələri nizamlamaq - + Print pages in order Sıradakı səhifələrin çapı - + Front to back Öndən - sona - + Back to front Sondan - önə - + Watermark Zərif nişan - + Add watermark Zərif nişan əlavə edin - + Text watermark Zərif nişanın mətni - + Confidential Məxfi - + Draft Qaralama - + Sample Nümunə - + Custom Fərdi - + Input your text Mətni daxil edin - + Picture watermark Şəkilli zərif nişan - + Layout Qat - + Tile Mozaika - + Center Mərkəz - + Angle Bucaq - + Size Ölçü - + Transparency Şəffaflıq - + + Print to PDF PDF kimi saxlamaq - + + Save as Image Şəkil kimi saxlamaq - + Collapse Yığmaq - - + + Flip on short edge Qısa kənara görə əks etdirmək - - + + + Flip on long edge Uzun kənara görə əks etdirmək - + Input page numbers please Səhifə nömrələrini daxil edin - + Maximum page number reached Səhifənin maksimum sayını aşdı - + Input English comma please İngiliscə vergül daxil edin - + Input page numbers like this: 1,3,5-7,11-15,18,21 Bu şəkildə səhifə nömrələri daxil edin: 1,3,5-7,11-15,18,21 - + Save button Saxlayın - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Nümunə üçün, 1,3,5-7,11-15,18,21 - + Save as PDF PDF kimi saxlayın - + Save as image Şəkil kimi saxlayın - + Images Şəkillər @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Məxfi - - + + Draft Qaralama - - + + Sample Nümunə @@ -562,7 +564,7 @@ DSearchEdit - + Search Axtarış @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Ləğv et - + Replace Əvəz etmək - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Bu qısayol %1 ilə uzlaşmır, bu qısayolun dərhal aktiv olması üçün Əlavə edin düyməsinə vurun @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Xahiş edirik yeni bir kısayol daxil edin - + None Yoxdur - DSplitScreenWidget + DTextEdit - - Unmaximize - Tam böyütmədən + + Stop reading + Oxumanı dayandırın - - Maximize - Tam böyüdün + + Text to Speech + Mətndən nitqə - - Tile window to left of screen - Pəncərə ekranın soluna + + Translate + Tərcümə - - Tile window to right of screen - Pəncərə ekranın sağına + + Speech To Text + Mətndən nitqə - DTextEdit + DToolbarEditPanel - - Stop reading - Oxumanı dayandırın + + Default toolset + Standart alətlər dəsti - - Text to Speech - Mətndən nitqə + + Drag your favorite items into the toolbar + Seçilmiş elementi alətlər panelinə at - - Translate - Tərcümə + + Drag below items into the toolbar to restore defaults + Varsayılanları bərpa etmək üçün elementləri alətlər panelinə at - - Speech To Text - Mətndən nitqə + + Confirm + Təsdiq edin PickColorWidget - + Color Rəng @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Kopyalayın - + Cu&t Kəsi&n - + Select All Hamısını seçin @@ -673,20 +675,72 @@ QObject - + No search result Axtarış nəticəsi yoxdur - + Restore Defaults Standartları bərpa edin + + + Version + Versiya + + + + Features + Funksiyalar + + + + Homepage + Ev səhifəsi + + + + Description + Təsviri + + + + Acknowledgements + Təşəkkürlər + + + + + + Sincerely appreciate the open-source software used. + İstifadə olunan bütün açıq mənbə proqram təminatını səmimiyyətlə qiymətləndiririk. + + + + open-source software + açıq-qaynaq proqram tıminatı + + + + Continue + Davamı + + + + Learn More + Daha çox öyrənin + + + + Credits + Müəlliflər + QWidgetTextControl - + Select All Hamısını seçin @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Xahiş edirik yeni bir kısayol daxil edin @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Mövzu - + Light Theme İşıqlı mövzu - + Dark Theme Tutqun mövzu - + System Theme Sistem mövzusu - + Help Kömək - + Feedback - + Rəy bildirişi + + + + Custom toolbar + Xüsusi alətlər paneli - + About Haqqında - + Exit Çıxış diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_bg.ts dtkwidget-5.6.12/src/translations/dtkwidget_bg.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_bg.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_bg.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - Благодарности - - - - Version: %1 - Версия: %1 - - - + %1 is released under %2 %1 е реализиран под %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black Черно - + White Бяло - + Dark Gray Тъмно сиво - + Gray Сиво - + Light Gray Светло сиво - + Red Червено - + Green Зелено - + Blue Синьо - + Cyan Циан - + Magenta Пурпурен - + Yellow Жълт - + Dark Red Тъмно червен - + Dark Green Тъмно зелен - + Dark Blue Тъмно син - + Dark Cyan Тъмен циан - + Dark Magenta Тъмно пурпурно - + Dark Yellow Тъмно жълто @@ -110,12 +105,12 @@ DInputDialog - + Cancel Отказ - + Confirm Потвърждавам @@ -123,580 +118,637 @@ DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - Отказ + Отказ - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel Отказ - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut Моля въведете нов пряк път - + None Нищо - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + Потвърждавам PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result Търсенето е без резултат - + Restore Defaults Възстановяване на настройките + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Благодарности + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut Моля въведете нов пряк път @@ -704,44 +756,49 @@ TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help Помощ - + Feedback - + + + + + Custom toolbar + - + About Относно - + Exit Изход - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_bn.ts dtkwidget-5.6.12/src/translations/dtkwidget_bn.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_bn.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_bn.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - প্রাপ্তি স্বীকার - - - - Version: %1 - ভার্সন: %1 - - - + %1 is released under %2 %1 রিলিজ হয়েছে %2 এর অধীনে @@ -22,87 +17,87 @@ DCrumbEdit - + Black কালো - + White সাদা - + Dark Gray গাঢ় ধূসর - + Gray ধূসর - + Light Gray হালকা ধূসর - + Red লাল - + Green সবুজ - + Blue নীল - + Cyan সবজে নীল - + Magenta ম্যাজেন্টা - + Yellow হলুদ - + Dark Red গাঢ় লাল - + Dark Green গাঢ় সবুজ - + Dark Blue গাঢ় নীল - + Dark Cyan গাঢ় সবজে নীল - + Dark Magenta গাঢ় ম্যাজেন্টা - + Dark Yellow গাঢ় হলুদ @@ -110,12 +105,12 @@ DInputDialog - + Cancel বাতিল করুন - + Confirm নিশ্চিত করুন @@ -123,580 +118,637 @@ DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - বাতিল করুন + বাতিল করুন - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel বাতিল করুন - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut দয়াকরে নতুন শর্টকাট চাপুন - + None কোনোটিই নয় - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + নিশ্চিত করুন PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result অনুসন্ধানের কোনো ফলাফল নেই - + Restore Defaults পূর্বনির্ধারিত জিনিসে ফিরে যান + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + প্রাপ্তি স্বীকার + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut দয়াকরে নতুন শর্টকাট চাপুন @@ -704,44 +756,49 @@ TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help সাহায্য - + Feedback - + + + + + Custom toolbar + - + About সম্পর্কে - + Exit বের হয়ে যান - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_bo.ts dtkwidget-5.6.12/src/translations/dtkwidget_bo.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_bo.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_bo.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - ཐུགས་རྗེ་ཞུ་བ། - - - - Version: %1 - པར་གཞི། %1 - - - + %1 is released under %2 %1ཡིས་%2ཡི་གྲོས་དོན་བརྩི་སྲུང་བྱས་ནས་ཁྱབ་བསྒྲགས་བྱ་རྒྱུ། @@ -20,87 +17,87 @@ DCrumbEdit - + Black ནག་པོ། - + White དཀར་པོ། - + Dark Gray སྐྱ་ནག - + Gray སྐྱ་མདོག - + Light Gray སྐྱ་དཀར། - + Red དམར་པོ། - + Green ལྗང་གུ། - + Blue སྔོན་པོ། - + Cyan མཐིང་མདོག - + Magenta དམར་སྐྱ། - + Yellow སེར་པོ། - + Dark Red དམར་སྨུག - + Dark Green ལྗང་ནག - + Dark Blue སྔོ་ནག - + Dark Cyan མཐིང་ནག - + Dark Magenta མཆིན་མདོག - + Dark Yellow སྨུག་སེར། @@ -108,12 +105,12 @@ DInputDialog - + Cancel འདོར་བ། - + Confirm གཏན་འཁེལ། @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut མྱུར་མཐེབ་གསར་པ་འཇུག་རོགས། @@ -129,22 +126,22 @@ DLineEdit - + Stop reading ཀློག་འདོན་བྱེད་མཚམས་འཇོག་རྒྱུ། - + Text to Speech སྐད་སྒྲའི་ཀློག་འདོན། - + Translate ཡིག་སྒྱུར། - + Speech To Text སྐད་སྒྲའི་དཔོད་བྲིས། @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced མཐོ་རིམ་སྒྲིག་བཀོད། - + Cancel button འདོར་བ། - - + + Print button པར་འདེབས། - + Basic རྨང་གཞིའི་སྒྲིག་བཀོད། - + Printer པར་འདེབས་འཕྲུལ་འཁོར། - + Copies པར་འདེབས་གྲངས། - + Page range ཤོག་གྲངས་ཁྱབ་ཁོངས། - + All ཚང་མ། - + Current page མིག་སྔའི་ཤོག་ངོས། - + Select pages དམིགས་བཙུགས་ཤོག་ངོས། - + Orientation པར་འདེབས་ཕྱོགས། - + Portrait འཕྲེད་དུ། - + Landscape གཞུང་དུ། - + Pages ཤོག་ངོས་སྒྲིག་བཀོད། - + Color mode ཚོས་གཞི། - - - + + + + + Color ཚོན་ཁྲ། - - - + + + Grayscale ཚོན་མེད། - + Margins མཐའ་ཐག - + Narrow (mm) ཆུང་བ།(mm) - + Normal (mm) དཀྱུས་མ།(mm) - + Moderate (mm) འོས་འཚམ།(mm) - + Customize (mm) རང་སྒྲུབ།(mm) - + Top སྟེང་། - + Left གཡོན། - + Bottom འོག - + Right གཡས། - + Scaling ཆུང་སྒྱུར། - + Actual size དངོས་ཡོད་ཆེ་ཆུང་། - + Scale རང་སྒྲུབ་བསྡུར་ཚད། - + Paper ཤོག་བུ། - + Paper size ཤོག་བུའི་ཆེ་ཆུང་། - + Print Layout པར་འདེབས་བྱེད་ཐབས། - + Duplex ངོས་ཟུང་པར་འདེབས། - + N-up printing འདྲ་གཤིབ་པར་འདེབས། - + 2 pages/sheet, 1×2 ཤོག་ལྷེ་རེར་པར་ངོས་2 1×2 - + 4 pages/sheet, 2×2 ཤོག་ལྷེ་རེར་པར་ངོས་4 2×2 - + 6 pages/sheet, 2×3 ཤོག་ལྷེ་རེར་པར་ངོས་6 2×3 - + 9 pages/sheet, 3×3 ཤོག་ལྷེ་རེར་པར་ངོས་9 3×3 - + 16 pages/sheet, 4×4 ཤོག་ལྷེ་རེར་པར་ངོས་16 4×4 - + Layout direction མཉམ་འདེབས་ཀྱི་གོ་རིམ། - + Page Order པར་འདེབས་གོ་རིམ། - + Collate pages རེ་རེ་བཞིན་པར་འདེབས། - + Print pages in order གོ་རིམ་ལྟར་པར་འདེབས་པ། - + Front to back མདུན་ནས་རྒྱབ། - + Back to front རྒྱབ་ནས་མདུན། - + Watermark ཆུ་ཚོན་པར་རྒྱག - + Add watermark ཆུ་ཚོན་པར་རྒྱག་སྣོན་པ། - + Text watermark ཡི་གེ་ཆུ་ཚོན་པར་རྒྱག - + Confidential གསང་ཆེན། - + Draft ཟིན་བྲིས། - + Sample མ་དཔེ། - + Custom རང་སྒྲུབ། - + Input your text རང་སྒྲུབ་ཆུ་ཚོན་པར་རྒྱག་ནང་འཇུག་བྱེད་པ། - + Picture watermark པར་རིས་ཆུ་ཚོན་པར་རྒྱག - + Layout པར་འདེབས་བྱེད་ཐབས། - + Tile སྙོམས་འདིང་། - + Center དཀྱིལ་སྒྲིག - + Angle ཀྱོག་ཚད། - + Size ཆེ་ཆུང་། - + Transparency གསལ་ཚད། - + + Print to PDF PDFལ་ཉར་བ། - + + Save as Image པར་རིས་གཞན་ཉར། - + Collapse བསྡུ་བ། - - + + Flip on short edge ཐག་ཐུང་ནས་ཕྱིར་སྐོར་བ། - - + + + Flip on long edge ཐག་རིང་ནས་ཕྱིར་སྐོར་བ། - + Input page numbers please པར་འདེབས་པའི་ཤོག་གྲངས་ནང་འཇུག་བྱེད། - + Maximum page number reached པར་འདེབས་ཀྱི་ཁྱབ་ཁོངས་ལས་བརྒལ་བ། - + Input English comma please དབྱིན་ཡིག་གི་ཚེག་འབྲིང་བྲིས། - + Input page numbers like this: 1,3,5-7,11-15,18,21 ཡང་དག་པའི་རྣམ་གཞག་ནང་འཇུག་བྱེད། དཔེར་ན། 1,3,5-7,11-15,18,21 - + Save button ཉར་བ། - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 རྣམ་གཞག་ནང་འཇུག་བྱོས། 1,3,5-7,11-15,18,21 - + Save as PDF PDFལྟར་ཉར་བ། - + Save as image པར་རིས་ལ་ཉར་བ། - + Images པར་རིས་ཡིག་ཆ། @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential གསང་ཆེན། - - + + Draft ཟིན་བྲིས། - - + + Sample མ་དཔེ། @@ -562,7 +564,7 @@ DSearchEdit - + Search འཚོལ་ཞིབ། @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel འདོར་བ། - + Replace བརྗེ་བ། - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately མྱུར་མཐེབ་འདི་དང་%1འགལ་ཟླ་ཡོད་པས། སྣོན་པར་མནན་ན་མྱུར་མཐེབ་འདི་ལམ་སེང་སྤྱོད་གོ་ཆོད་ཐུབ། @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut མྱུར་མཐེབ་གསར་པ་འཇུག་རོགས། - + None མེད། - DSplitScreenWidget + DTextEdit - - Unmaximize - སོར་ཆུད། + + Stop reading + ཀློག་འདོན་བྱེད་མཚམས་འཇོག་རྒྱུ། - - Maximize - ཆེ་སྒྱུར། + + Text to Speech + སྐད་སྒྲའི་ཀློག་འདོན། - - Tile window to left of screen - སྒེའུ་ཁུང་གཡོན་ངོས་སུ་མཐུད་པ། + + Translate + ཡིག་སྒྱུར། - - Tile window to right of screen - སྒེའུ་ཁུང་གཡས་ངོས་སུ་མཐུད་པ། + + Speech To Text + སྐད་སྒྲའི་དཔོད་བྲིས། - DTextEdit + DToolbarEditPanel - - Stop reading - ཀློག་འདོན་བྱེད་མཚམས་འཇོག་རྒྱུ། + + Default toolset + སོར་བཞག་རྣམ་གྲངས། - - Text to Speech - སྐད་སྒྲའི་ཀློག་འདོན། + + Drag your favorite items into the toolbar + དགའ་པོ་ཡོད་པའི་རྣམ་གྲངས་ཡོ་བྱད་བསྟར་བྱང་དུ་དྲུད། - - Translate - ཡིག་སྒྱུར། + + Drag below items into the toolbar to restore defaults + ཚོ་པ་འདིའི་རྣམ་གྲངས་ཡོ་བྱད་བསྟར་བྱང་དུ་འདྲུད་དེ་སོར་བལག་སླར་གསོ་བྱེད་པ། - - Speech To Text - སྐད་སྒྲའི་དཔོད་བྲིས། + + Confirm + གཏན་འཁེལ། PickColorWidget - + Color ཚོན་ཁྲ། @@ -655,17 +657,17 @@ QLineEdit - + &Copy པར་སློག(&C) - + Cu&t དྲས་པ།(&T) - + Select All ཡོངས་འདེམས། @@ -673,20 +675,72 @@ QObject - + No search result འཚོལ་ཞིབ་བྱས་འབྲས་མེད། - + Restore Defaults སོར་བཞག་སླར་གསོ། + + + Version + པར་གཞི། + + + + Features + པར་གཞིའི་ཁྱད་ཆོས། + + + + Homepage + གཙོ་ངོས། + + + + Description + ཞིབ་བརྗོད། + + + + Acknowledgements + ཐུགས་རྗེ་ཞུ་བ། + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + མུ་མཐུད། + + + + Learn More + དེ་བས་མང་བར་རྒྱུས་ལོན། + + + + Credits + + QWidgetTextControl - + Select All ཡོངས་འདེམས། @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut མྱུར་མཐེབ་གསར་པ་འཇུག་རོགས། @@ -702,42 +756,47 @@ TitleBarMenu - + Theme བརྗོད་བྱ་གཙོ་བོ། - + Light Theme ཁ་དཀར་པོ། - + Dark Theme ཁ་སྨུག་པོ། - + System Theme མ་ལག་གི་རྗེས་འབྲངས་བ། - + Help རོགས་པ། - + Feedback ཕྱིར་འདྲེན། - + + Custom toolbar + + + + About སྐོར། - + Exit ཕྱིར་འབུད། diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_bqi.ts dtkwidget-5.6.12/src/translations/dtkwidget_bqi.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_bqi.ts 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_bqi.ts 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,804 @@ + + + + + + DAboutDialog + + + %1 is released under %2 + + + + + DCrumbEdit + + + Black + + + + + White + + + + + Dark Gray + + + + + Gray + + + + + Light Gray + + + + + Red + + + + + Green + + + + + Blue + + + + + Cyan + + + + + Magenta + + + + + Yellow + + + + + Dark Red + + + + + Dark Green + + + + + Dark Blue + + + + + Dark Cyan + + + + + Dark Magenta + + + + + Dark Yellow + + + + + DInputDialog + + + Cancel + + + + + Confirm + + + + + DKeySequenceEdit + + + Enter a new shortcut + + + + + DLineEdit + + + Stop reading + + + + + Text to Speech + + + + + Translate + + + + + Speech To Text + + + + + DPrintPreviewDialogPrivate + + + + Advanced + + + + + Cancel + button + + + + + + Print + button + + + + + Basic + + + + + Printer + + + + + Copies + + + + + Page range + + + + + All + + + + + Current page + + + + + Select pages + + + + + Orientation + + + + + Portrait + + + + + Landscape + + + + + Pages + + + + + Color mode + + + + + + + + + Color + + + + + + + Grayscale + + + + + Margins + + + + + Narrow (mm) + + + + + Normal (mm) + + + + + Moderate (mm) + + + + + Customize (mm) + + + + + Top + + + + + Left + + + + + Bottom + + + + + Right + + + + + Scaling + + + + + Actual size + + + + + Scale + + + + + Paper + + + + + Paper size + + + + + Print Layout + + + + + Duplex + + + + + N-up printing + + + + + 2 pages/sheet, 1×2 + + + + + 4 pages/sheet, 2×2 + + + + + 6 pages/sheet, 2×3 + + + + + 9 pages/sheet, 3×3 + + + + + 16 pages/sheet, 4×4 + + + + + Layout direction + + + + + Page Order + + + + + Collate pages + + + + + Print pages in order + + + + + Front to back + + + + + Back to front + + + + + Watermark + + + + + Add watermark + + + + + Text watermark + + + + + Confidential + + + + + Draft + + + + + Sample + + + + + Custom + + + + + Input your text + + + + + Picture watermark + + + + + Layout + + + + + Tile + + + + + Center + + + + + Angle + + + + + Size + + + + + Transparency + + + + + + Print to PDF + + + + + + Save as Image + + + + + Collapse + + + + + + Flip on short edge + + + + + + + Flip on long edge + + + + + Input page numbers please + + + + + Maximum page number reached + + + + + Input English comma please + + + + + Input page numbers like this: 1,3,5-7,11-15,18,21 + + + + + Save + button + + + + + *.pdf + + + + + For example, 1,3,5-7,11-15,18,21 + + + + + Save as PDF + + + + + Save as image + + + + + Images + + + + + DPrintPreviewWidget + + + + Confidential + + + + + + Draft + + + + + + Sample + + + + + DSearchEdit + + + Search + + + + + DSettingsDialog + + + Cancel + + + + + Replace + + + + + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately + + + + + DShortcutEdit + + + Please input a new shortcut + + + + + None + + + + + DTextEdit + + + Stop reading + + + + + Text to Speech + + + + + Translate + + + + + Speech To Text + + + + + DToolbarEditPanel + + + Default toolset + + + + + Drag your favorite items into the toolbar + + + + + Drag below items into the toolbar to restore defaults + + + + + Confirm + + + + + PickColorWidget + + + Color + + + + + QLineEdit + + + &Copy + + + + + Cu&t + + + + + Select All + + + + + QObject + + + No search result + + + + + Restore Defaults + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + + + + QWidgetTextControl + + + Select All + + + + + ShortcutEdit + + + Please enter a new shortcut + + + + + TitleBarMenu + + + Theme + + + + + Light Theme + + + + + Dark Theme + + + + + System Theme + + + + + Help + + + + + Feedback + + + + + Custom toolbar + + + + + About + + + + + Exit + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_br.ts dtkwidget-5.6.12/src/translations/dtkwidget_br.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_br.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_br.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - Trugarekadennoù - - - - Version: %1 - Stumm: %1 - - - + %1 is released under %2 %1 a zo embannet dindan %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black Du - + White Gwenn - + Dark Gray Gris teñval - + Gray Gris - + Light Gray Gris sklaer - + Red Ruz - + Green Gwer - + Blue Glas - + Cyan Sian - + Magenta Majenta - + Yellow Melen - + Dark Red Ruz teñval - + Dark Green Gwer teñval - + Dark Blue Glas teñval - + Dark Cyan Sian teñval - + Dark Magenta Majenta teñval - + Dark Yellow Melen teñval @@ -110,12 +105,12 @@ DInputDialog - + Cancel Nullañ - + Confirm Kadarnaat @@ -123,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Ebarzhiñ ur berradur nevez @@ -131,22 +126,22 @@ DLineEdit - + Stop reading Paouez da lenn - + Text to Speech Testenn e mouezh - + Translate Treiñ - + Speech To Text Mouezh e testenn @@ -154,417 +149,422 @@ DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - Nullañ + Nullañ - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search Klask @@ -572,17 +572,17 @@ DSettingsDialog - + Cancel Nullañ - + Replace Erlec'hiañ - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Ar berradur-mañ a zo e dizemglev gant %1, klikit war Ouzhpennañ evit ma vefe oberiant ar berradur-mañ kerkent @@ -590,113 +590,165 @@ DShortcutEdit - + Please input a new shortcut Ebarzhit ur berradur nevez mar plij - + None Hini ebet - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Paouez da lenn - - Maximize - + + Text to Speech + Testenn e mouezh - - Tile window to left of screen - + + Translate + Treiñ - - Tile window to right of screen - + + Speech To Text + Mouezh e testenn - DTextEdit + DToolbarEditPanel - - Stop reading - Paouez da lenn + + Default toolset + - - Text to Speech - Testenn e mouezh + + Drag your favorite items into the toolbar + - - Translate - Treiñ + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Mouezh e testenn + + Confirm + Kadarnaat PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result Disoc'h ebet kavet - + Restore Defaults Adderaouiñ + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Trugarekadennoù + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut Ebarzhit ur berradur nevez mar plij @@ -704,44 +756,49 @@ TitleBarMenu - + Theme Tem - + Light Theme Tem sklaer - + Dark Theme Tem teñval - + System Theme Tem ar sistem - + Help Skoazell - + Feedback - + + + + + Custom toolbar + - + About Diwar-benn - + Exit Kuitaat - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ca.ts dtkwidget-5.6.12/src/translations/dtkwidget_ca.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ca.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ca.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Agraïments - - - - Version: %1 - Versió: %1 - - - + %1 is released under %2 %1 està publicada d'acord amb %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Negre - + White Blanc - + Dark Gray Gris fosc - + Gray Gris - + Light Gray Gris clar - + Red Vermell - + Green Verd - + Blue Blau - + Cyan Cian - + Magenta Magenta - + Yellow Groc - + Dark Red Vermell fosc - + Dark Green Verd fosc - + Dark Blue Blau fosc - + Dark Cyan Cian fosc - + Dark Magenta Magenta fosc - + Dark Yellow Groc fosc @@ -108,12 +105,12 @@ DInputDialog - + Cancel Cancel·la - + Confirm Confirmeu-ho @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Introduïu una drecera nova. @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Atura la lectura - + Text to Speech Text a veu - + Translate Tradueix - + Speech To Text Veu a text @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Avançat - + Cancel button Cancel·la - - + + Print button Imprimeix - + Basic Bàsic - + Printer Impressora - + Copies Còpies - + Page range Interval de pàgines - + All Tot - + Current page Pàgina actual - + Select pages Seleccioneu les pàgines - + Orientation Orientació - + Portrait Retrat - + Landscape Paisatge - + Pages Pàgines - + Color mode Mode del color - - - + + + + + Color Color - - - + + + Grayscale Escala de grisos - + Margins Marges - + Narrow (mm) Estret (mm) - + Normal (mm) Normal (mm) - + Moderate (mm) Moderat (mm) - + Customize (mm) Personalitzat (mm) - + Top Superior - + Left Esquerre - + Bottom Inferior - + Right Dret - + Scaling Escala - + Actual size Mida real - + Scale Escala - + Paper Paper - + Paper size Mida del paper - + Print Layout Disposició de la impressió - + Duplex Doble cara - + N-up printing Impressió N-amunt - + 2 pages/sheet, 1×2 2 pàgines per full, 1×2 - + 4 pages/sheet, 2×2 4 pàgines per full, 2×2 - + 6 pages/sheet, 2×3 6 pàgines per full, 2×3 - + 9 pages/sheet, 3×3 9 pàgines per full, 3×3 - + 16 pages/sheet, 4×4 16 pàgines per full, 4×4 - + Layout direction Direcció de la disposició - + Page Order Ordre de la pàgina - + Collate pages Enganxa les pàgines - + Print pages in order Ordre de les pàgines - + Front to back De la primera a l'última - + Back to front De l'última a la primera - + Watermark Marca d'aigua - + Add watermark Afegeix la marca d'aigua - + Text watermark Text de la marca - + Confidential Confidencial - + Draft Esborrany - + Sample Exemple - + Custom Personalitzat - + Input your text Escriviu el text - + Picture watermark Marca d'imatge - + Layout Disposició - + Tile Títol - + Center Centrada - + Angle Angle - + Size Mida - + Transparency Transparència - + + Print to PDF Imprimeix en un PDF - + + Save as Image Desa-ho com a imatge - + Collapse Replega - - + + Flip on short edge Gira al marge curt - - + + + Flip on long edge Gira al marge llarg - + Input page numbers please Indiqueu els números de les pàgines. - + Maximum page number reached S'ha arribat al nombre màxim de pàgines. - + Input English comma please Useu una coma, si us plau. - + Input page numbers like this: 1,3,5-7,11-15,18,21 Escriviu els números de pàgina així: 1,3,5-7,11-15,18,21 - + Save button Desa - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Per exemple: 1,3,5-7,11-15,18,21 - + Save as PDF Desa-ho com a PDF - + Save as image Desa-ho com a imatge - + Images Imatges @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Confidencial - - + + Draft Esborrany - - + + Sample Exemple @@ -562,7 +564,7 @@ DSearchEdit - + Search Cerca @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Cancel·la - + Replace Reemplaça - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Aquesta drecera té conflicte amb %1. Cliqueu a Afegeix per fer-la efectiva immediatament. @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Si us plau, introduïu una drecera nova. - + None Cap - DSplitScreenWidget + DTextEdit - - Unmaximize - Desmaximitza + + Stop reading + Atura la lectura - - Maximize - Maximitza + + Text to Speech + Text a veu - - Tile window to left of screen - Mosaic a l'esquerra de la pantalla + + Translate + Tradueix - - Tile window to right of screen - Mosaic a la dreta de la pantalla + + Speech To Text + Veu a text - DTextEdit + DToolbarEditPanel - - Stop reading - Atura la lectura + + Default toolset + Conjunt d'eines per defecte - - Text to Speech - Text a veu + + Drag your favorite items into the toolbar + Arrossegueu els elements preferits a la barra d'eines - - Translate - Tradueix + + Drag below items into the toolbar to restore defaults + Arrossegueu els elements de sota a la barra d'eines per restaurar els valors per defecte. - - Speech To Text - Veu a text + + Confirm + Confirmeu-ho PickColorWidget - + Color Color @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Copia - + Cu&t Re&talla - + Select All Selecciona-ho tot @@ -673,20 +675,72 @@ QObject - + No search result Cap resultat de la cerca - + Restore Defaults Restableix els valors per defecte + + + Version + Versió + + + + Features + Característiques + + + + Homepage + Pàgina inicial + + + + Description + Descripció + + + + Acknowledgements + Agraïments + + + + + + Sincerely appreciate the open-source software used. + Agraïm sincerament tot el programari de codi obert usat. + + + + open-source software + programari de codi obert + + + + Continue + Continua + + + + Learn More + Més informació + + + + Credits + Crèdits + QWidgetTextControl - + Select All Selecciona-ho tot @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Si us plau, introduïu una drecera nova: @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Tema - + Light Theme Tema clar - + Dark Theme Tema fosc - + System Theme Tema del sistema - + Help Ajuda - + Feedback - + Retroacció + + + + Custom toolbar + Barra d'eines personalitzada - + About Quant a - + Exit Surt diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_cs.ts dtkwidget-5.6.12/src/translations/dtkwidget_cs.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_cs.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_cs.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Poděkování - - - - Version: %1 - Verze: %1 - - - + %1 is released under %2 %1 je vydáno pod %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Černá - + White Bílá - + Dark Gray Tmavě šedá - + Gray Šedá - + Light Gray Světle šedá - + Red Červená - + Green Zelená - + Blue Modrá - + Cyan Modrozelená - + Magenta Fialová - + Yellow Žlutá - + Dark Red Tmavě červená - + Dark Green Tmavě zelená - + Dark Blue Tmavě modrá - + Dark Cyan Tmavě modrozelená - + Dark Magenta Tmavě fialová - + Dark Yellow Tmavě žlutá @@ -108,12 +105,12 @@ DInputDialog - + Cancel Zrušit - + Confirm Potvrdit @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Zadejte novou zkratku @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Přestat předčítat - + Text to Speech Text na řeč - + Translate Přeložit - + Speech To Text Řeč na text @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Pokročilé - + Cancel button Zrušit - - + + Print button Tisk - + Basic Základní - + Printer Tiskárna - + Copies Kopie - + Page range Rozsah stránek - + All Vše - + Current page Stávající stránka - + Select pages Vybrat stránky - + Orientation Orientace - + Portrait Na výšku - + Landscape Na šířku - + Pages Stránky - + Color mode Barevný režim - - - + + + + + Color Barva - - - + + + Grayscale Stupně šedé - + Margins Okraje - + Narrow (mm) Úzké (mm) - + Normal (mm) Normální (mm) - + Moderate (mm) Střední (mm) - + Customize (mm) Přizpůsobit (mm) - + Top Nahoře - + Left Vlevo - + Bottom Dole - + Right Vpravo - + Scaling Změna měřítka - + Actual size Stávající velikost - + Scale Měřítko - + Paper Papír - + Paper size Velikost papíru - + Print Layout Rozvržení tisku - + Duplex Oboustranně - + N-up printing Tisk více stránek na list - + 2 pages/sheet, 1×2 2 stránky/list, 1x2 - + 4 pages/sheet, 2×2 4 stránky/list, 2x2 - + 6 pages/sheet, 2×3 6 stránek/list, 2x3 - + 9 pages/sheet, 3×3 9 stránek/list, 3x3 - + 16 pages/sheet, 4×4 16 stránek/list, 4x4 - + Layout direction Směr rozvření - + Page Order Pořadí stránek - + Collate pages Řadit stránky - + Print pages in order Tisknout stránky v pořadí - + Front to back Odpředu dozadu - + Back to front Odzadu dopředu - + Watermark Vodoznak - + Add watermark Přidat vodoznak - + Text watermark Textový vodoznak - + Confidential Důvěrné - + Draft Koncept - + Sample Ukázka - + Custom Uživatelsky určené - + Input your text Zadejte svůj text - + Picture watermark Obrázkový vodoznak - + Layout Rozvržení - + Tile Nadpis - + Center Vystředit - + Angle Úhel - + Size Velikost - + Transparency Průhlednost - + + Print to PDF Vytisknout do PDF - + + Save as Image Uložit jako obrázek - + Collapse Snášet - - + + Flip on short edge Převrátit na krátké straně - - + + + Flip on long edge Převrátit na dlouhé straně - + Input page numbers please Zadejte čísla stránek - + Maximum page number reached Dosaženo maximálního počtu stránek - + Input English comma please Zadejte anglickou čárku - + Input page numbers like this: 1,3,5-7,11-15,18,21 Zadejte čísla stránek jako např.: 1,3,5-7,11-15,18,21 - + Save button Uložit - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Například, 1,3,5-7,11-15,18,21 - + Save as PDF Uložit jako PDF - + Save as image Uložit jako obrázek - + Images Obrázky @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Důvěrné - - + + Draft Koncept - - + + Sample Ukázka @@ -562,7 +564,7 @@ DSearchEdit - + Search Hledat @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Zrušit - + Replace Nahradit - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Tato klávesová zkratka se střetává s %1. Aby začala platit, klepněte na Přidat @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Zadejte novou zkratku - + None Žádný - DSplitScreenWidget + DTextEdit - - Unmaximize - Zrušit zvětšení + + Stop reading + Přestat předčítat - - Maximize - Zvětšit + + Text to Speech + Text na řeč - - Tile window to left of screen - Dlaždice okna nalevo obrazovky + + Translate + Přeložit - - Tile window to right of screen - Dlaždice okna napravo obrazovky + + Speech To Text + Řeč na text - DTextEdit + DToolbarEditPanel - - Stop reading - Přestat předčítat + + Default toolset + Výchozí sada nástrojů - - Text to Speech - Text na řeč + + Drag your favorite items into the toolbar + Přetáhněte oblíbené položky na panel nástrojů - - Translate - Přeložit + + Drag below items into the toolbar to restore defaults + Přetažením níže uvedených položek na panel nástrojů obnovíte výchozí nastavení. - - Speech To Text - Řeč na text + + Confirm + Potvrdit PickColorWidget - + Color Barva @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Kopírovat - + Cu&t Vyjmou&t - + Select All Vybrat vše @@ -673,20 +675,72 @@ QObject - + No search result Nic nenalezeno - + Restore Defaults Vráti na výchozí hodnoty + + + Version + Verze + + + + Features + Funkce + + + + Homepage + Hlavní stránka + + + + Description + Popisek + + + + Acknowledgements + Poděkování + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + Další + + + + Learn More + Zjistit více + + + + Credits + + QWidgetTextControl - + Select All Vybrat vše @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Zadejte novou zkratku @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Vzhled - + Light Theme Světlý vzhled - + Dark Theme Tmavý vzhled - + System Theme Systémový vzhled - + Help Nápověda - + Feedback - + Zpětná vazba + + + + Custom toolbar + Vlastní panel nástrojů - + About O aplikaci - + Exit Ukončit diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_da.ts dtkwidget-5.6.12/src/translations/dtkwidget_da.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_da.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_da.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - Tilkendegivelser - - - - Version: %1 - Version: %1 - - - + %1 is released under %2 %1 er udgivet under %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black Sort - + White Hvid - + Dark Gray Mørkegrå - + Gray Grå - + Light Gray Lysegrå - + Red Rød - + Green Grøn - + Blue Blå - + Cyan Cyan - + Magenta Magenta - + Yellow Gul - + Dark Red Mørkerød - + Dark Green Mørkegrøn - + Dark Blue Mørkeblå - + Dark Cyan Mørkecyan - + Dark Magenta Mørkemagenta - + Dark Yellow Mørkegul @@ -110,12 +105,12 @@ DInputDialog - + Cancel Annuller - + Confirm Bekræft @@ -123,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Indtast en ny genvej @@ -131,22 +126,22 @@ DLineEdit - + Stop reading Stop læsning - + Text to Speech Tekst til tale - + Translate Oversæt - + Speech To Text Tale til tekst @@ -154,417 +149,422 @@ DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - Annuller + Annuller - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search Søg @@ -572,17 +572,17 @@ DSettingsDialog - + Cancel Annuller - + Replace Erstat - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Genvejen er i konflikt med %1. Klik på Tilføj for øjeblikkeligt at gøre genvejen gældende @@ -590,113 +590,165 @@ DShortcutEdit - + Please input a new shortcut Input venligst en ny genvej - + None Ingen - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Stop læsning - - Maximize - + + Text to Speech + Tekst til tale - - Tile window to left of screen - + + Translate + Oversæt - - Tile window to right of screen - + + Speech To Text + Tale til tekst - DTextEdit + DToolbarEditPanel - - Stop reading - Stop læsning + + Default toolset + - - Text to Speech - Tekst til tale + + Drag your favorite items into the toolbar + - - Translate - Oversæt + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Tale til tekst + + Confirm + Bekræft PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result Intet søgeresultat - + Restore Defaults Gendan standarder + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Tilkendegivelser + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut Indtast venligst en ny genvej @@ -704,44 +756,49 @@ TitleBarMenu - + Theme Tema - + Light Theme Lyst tema - + Dark Theme Mørkt tema - + System Theme Systemets tema - + Help Hjælp - + Feedback - + + + + + Custom toolbar + - + About Om - + Exit Afslut - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_de.ts dtkwidget-5.6.12/src/translations/dtkwidget_de.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_de.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_de.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Anerkennungen - - - - Version: %1 - Version: %1 - - - + %1 is released under %2 %1 wurde unter %2 veröffentlicht. @@ -20,87 +17,87 @@ DCrumbEdit - + Black Schwarz - + White Weiß - + Dark Gray Dunkelgrau - + Gray Grau - + Light Gray Hellgrau - + Red Rot - + Green Grün - + Blue Blau - + Cyan Cyan - + Magenta Magenta - + Yellow Gelb - + Dark Red Dunkelrot - + Dark Green Dunkelgrün - + Dark Blue Dunkelblau - + Dark Cyan Dunkles Cyan - + Dark Magenta Dunkles Magenta - + Dark Yellow Dunkelgelb @@ -108,12 +105,12 @@ DInputDialog - + Cancel Abbrechen - + Confirm Bestätigen @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Geben Sie ein neues Tastenkürzel ein @@ -129,411 +126,416 @@ DLineEdit - + Stop reading Lesen beenden - + Text to Speech Text zu Sprache - + Translate Übersetzen - + Speech To Text - Text zu Sprache + Sprache zu Text DPrintPreviewDialogPrivate - - + + Advanced Fortgeschritten - + Cancel button Abbrechen - - + + Print button Drucken - + Basic Basis - + Printer Drucker - + Copies Kopien - + Page range Seitenumfang - + All Alle - + Current page Aktuelle Seite - + Select pages Seiten auswählen - + Orientation Ausrichtung - + Portrait Hochformat - + Landscape Querformat - + Pages Seiten - + Color mode Farbmodus - - - + + + + + Color Farbe - - - + + + Grayscale Graustufen - + Margins Ränder - + Narrow (mm) Schmal (mm) - + Normal (mm) Normal (mm) - + Moderate (mm) Moderat (mm) - + Customize (mm) Anpassen (mm) - + Top Oben - + Left Links - + Bottom Unten - + Right Rechts - + Scaling Skalierung - + Actual size Tatsächliche Größe - + Scale Skala - + Paper Papier - + Paper size Papiergröße - + Print Layout Druckanordnung - + Duplex Duplex - + N-up printing - + 2 pages/sheet, 1×2 2 Seiten/Blatt, 1×2 - + 4 pages/sheet, 2×2 4 Seiten/Blatt, 2×2 - + 6 pages/sheet, 2×3 6 Seiten/Blatt, 2×3 - + 9 pages/sheet, 3×3 9 Seiten/Blatt, 3×3 - + 16 pages/sheet, 4×4 16 Seiten/Blatt, 4×4 - + Layout direction Richtung der Anordnung - + Page Order Seitenreihenfolge - + Collate pages Seiten zusammenstellen - + Print pages in order Seiten der Reihe nach drucken - + Front to back Von vorne nach hinten - + Back to front Von hinten nach vorne - + Watermark Wasserzeichen - + Add watermark Wasserzeichen hinzufügen - + Text watermark Textwasserzeichen - + Confidential Vertraulich - + Draft Entwurf - + Sample Muster - + Custom - + Input your text Geben Sie Ihren Text ein - + Picture watermark Bildwasserzeichen - + Layout Anordnung - + Tile Kachel - + Center Mitte - + Angle Winkel - + Size Größe - + Transparency Transparenz - + + Print to PDF In PDF drucken - + + Save as Image Als Bild speichern - + Collapse Einklappen - - + + Flip on short edge Auf der kurzen Kante spiegeln - - + + + Flip on long edge Auf der langen Kante spiegeln - + Input page numbers please Bitte Seitenzahlen eingeben - + Maximum page number reached Maximale Seitenzahl erreicht - + Input English comma please Bitte englisches Komma eingeben - + Input page numbers like this: 1,3,5-7,11-15,18,21 Seitenzahlen wie folgt eingeben: 1,3,5-7,11-15,18,21 - + Save button Speichern - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Zum Beispiel 1,3,5-7,11-15,18,21 - + Save as PDF Als PDF speichern - + Save as image Als Bild speichern - + Images Bilder @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Vertraulich - - + + Draft Entwurf - - + + Sample Muster @@ -562,7 +564,7 @@ DSearchEdit - + Search Suchen @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Abbrechen - + Replace Ersetzen - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Dieses Tastenkürzel steht in Konflikt mit %1. Klicken Sie auf "Hinzufügen", damit dieses Tastenkürzel sofort wirksam wird @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Bitte geben Sie ein neues Tastenkürzel ein - + None Keine - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Lesen beenden - - Maximize - Maximieren + + Text to Speech + Text zu Sprache - - Tile window to left of screen - Fenster auf die linke Bildschirmseite kacheln + + Translate + Übersetzen - - Tile window to right of screen - Fenster auf die rechte Bildschirmseite kacheln + + Speech To Text + Sprache zu Text - DTextEdit + DToolbarEditPanel - - Stop reading - Lesen beenden + + Default toolset + - - Text to Speech - Text zu Sprache + + Drag your favorite items into the toolbar + - - Translate - Übersetzen + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Text zu Sprache + + Confirm + Bestätigen PickColorWidget - + Color Farbe @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Kopieren - + Cu&t &Ausschneiden - + Select All Alles auswählen @@ -673,20 +675,72 @@ QObject - + No search result Keine Suchergebnisse - + Restore Defaults Standardeinstellungen wiederherstellen + + + Version + Version + + + + Features + Funktionen + + + + Homepage + + + + + Description + Beschreibung + + + + Acknowledgements + Anerkennungen + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + Fortsetzen + + + + Learn More + Mehr erfahren + + + + Credits + + QWidgetTextControl - + Select All Alles auswählen @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Bitte geben Sie ein neues Tastenkürzel ein @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Thema - + Light Theme Helles Thema - + Dark Theme Dunkles Thema - + System Theme Systemthema - + Help Hilfe - + Feedback + Rückmeldung + + + + Custom toolbar - + About Über - + Exit Beenden diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_el.ts dtkwidget-5.6.12/src/translations/dtkwidget_el.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_el.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_el.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - αναγνωρισμοί - - - - Version: %1 - Έκδοση: %1 - - - + %1 is released under %2 Το %1 έχει δημοσιοποιηθεί ύπο %2 @@ -22,100 +17,100 @@ DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel Ακύρωση - + Confirm Επικύρωση @@ -123,625 +118,687 @@ DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - Ακύρωση + Ακύρωση - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel Ακύρωση - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut Παρακαλώ εισάγετε ένα νέο σύνδεσμο - + None Κανένα - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + Επικύρωση PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + αναγνωρισμοί + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help Βοήθεια - + Feedback - + + + + + Custom toolbar + - + About Περί - + Exit Έξοδος - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_en_AU.ts dtkwidget-5.6.12/src/translations/dtkwidget_en_AU.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_en_AU.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_en_AU.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_eo.ts dtkwidget-5.6.12/src/translations/dtkwidget_eo.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_eo.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_eo.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_es.ts dtkwidget-5.6.12/src/translations/dtkwidget_es.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_es.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_es.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Agradecimientos - - - - Version: %1 - Versión %1 - - - + %1 is released under %2 %1 está lanzado bajo %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Negro - + White Blanco - + Dark Gray Gris oscuro - + Gray Gris - + Light Gray Gris claro - + Red Rojo - + Green Verde - + Blue Azul - + Cyan Cian - + Magenta Magenta - + Yellow Amarillo - + Dark Red Rojo oscuro - + Dark Green Verde oscuro - + Dark Blue Azul oscuro - + Dark Cyan Cian oscuro - + Dark Magenta Magenta oscuro - + Dark Yellow Amarillo oscuro @@ -108,12 +105,12 @@ DInputDialog - + Cancel Cancelar - + Confirm Confirmar @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Introducir un nuevo atajo @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Detener lectura - + Text to Speech Texto a voz - + Translate Traducir - + Speech To Text Voz a texto @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Avanzado - + Cancel button Cancelar - - + + Print button Imprimir - + Basic Básico - + Printer Imprimir - + Copies Copias - + Page range Rango de página - + All Todo - + Current page Página actual - + Select pages Seleccionar página - + Orientation Orientación - + Portrait Retrato - + Landscape Paisaje - + Pages Páginas - + Color mode Modo de color - - - + + + + + Color Color - - - + + + Grayscale Escala de grises - + Margins Márgenes - + Narrow (mm) Estrecho (mm) - + Normal (mm) Normal (mm) - + Moderate (mm) Moderado (mm) - + Customize (mm) Personalizado (mm) - + Top Arriba - + Left Izquierda - + Bottom Abajo - + Right Derecha - + Scaling Escalado - + Actual size Tamaño real - + Scale Escala - + Paper Papel - + Paper size Tamaño del papel - + Print Layout Imprimir diseño - + Duplex Doble - + N-up printing impresión N-up - + 2 pages/sheet, 1×2 2 páginas/hoja, 1×2 - + 4 pages/sheet, 2×2 4 páginas/hoja, 2×2 - + 6 pages/sheet, 2×3 6 páginas/hoja, 2×3 - + 9 pages/sheet, 3×3 9 páginas/hoja, 3×3 - + 16 pages/sheet, 4×4 16 páginas/hoja, 4×4 - + Layout direction Dirección de diseño - + Page Order Orden de página - + Collate pages Clasificar páginas - + Print pages in order Imprimir páginas en orden - + Front to back De frente hacia atrás - + Back to front De atrás hacia el frente - + Watermark Marca de agua - + Add watermark Añadir marca de agua - + Text watermark Texto de la marca de agua - + Confidential Confidencial - + Draft Borrador - + Sample Muestra - + Custom Personalizado - + Input your text Ingrese su texto - + Picture watermark Imagen de la marca de agua - + Layout Diseño - + Tile Teselas - + Center Centro - + Angle Ángulo - + Size Tamaño - + Transparency Transparencia - + + Print to PDF Imprimir en PDF - + + Save as Image Guardar como imagen - + Collapse Colapsar - - + + Flip on short edge Voltear en el borde corto - - + + + Flip on long edge Voltear en el borde largo - + Input page numbers please Por favor, ingrese el número de páginas - + Maximum page number reached Se ha alcanzado el número máximo de páginas - + Input English comma please Por favor ingrese la coma inglesa - + Input page numbers like this: 1,3,5-7,11-15,18,21 Ingrese números de página tales como: 1,3,5-7,11-15,18,21 - + Save button Guardar - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 1-%1. Por ejemplo, 1,3,5-7,11-15,18,21 - + Save as PDF Guardar como PDF - + Save as image Guardar como imagen - + Images Imágenes @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Confidencial - - + + Draft Borrador - - + + Sample Muestra @@ -562,7 +564,7 @@ DSearchEdit - + Search Buscar @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Cancelar - + Replace Reemplazar - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Este atajo tiene conflicto con %1, haga clic en Añadir para que este atajo sea efectivo inmediatamente. @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Introduzca un nuevo atajo - + None Nada - DSplitScreenWidget + DTextEdit - - Unmaximize - Minimizar + + Stop reading + Detener lectura - - Maximize - Maximizar + + Text to Speech + Texto a voz - - Tile window to left of screen - Ventana en mosaico a la izquierda de la pantalla + + Translate + Traducir - - Tile window to right of screen - Ventana en mosaico a la derecha de la pantalla + + Speech To Text + Voz a texto - DTextEdit + DToolbarEditPanel - - Stop reading - Detener lectura + + Default toolset + Herramientas por defecto - - Text to Speech - Texto a voz + + Drag your favorite items into the toolbar + Arrastre sus elementos favoritos a la barra de herramientas - - Translate - Traducir + + Drag below items into the toolbar to restore defaults + Arrastre los siguientes elementos a la barra de herramientas para restaurar los valores predeterminados - - Speech To Text - Voz a texto + + Confirm + Confirmar PickColorWidget - + Color Color @@ -655,17 +657,17 @@ QLineEdit - + &Copy - %Copiar + &Copiar - + Cu&t - &Cortar + Cor&tar - + Select All Seleccionar todo @@ -673,20 +675,72 @@ QObject - + No search result No se encontraron resultados - + Restore Defaults Restaurar valores predeterminados + + + Version + Versión + + + + Features + Características + + + + Homepage + Página web + + + + Description + Descripción + + + + Acknowledgements + Agradecimientos + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + Continuar + + + + Learn More + Saber más + + + + Credits + + QWidgetTextControl - + Select All Seleccionar todo @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Ingrese un nuevo atajo @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Tema - + Light Theme Tema claro - + Dark Theme Tema oscuro - + System Theme Tema del sistema - + Help Ayuda - + Feedback - + Comentarios + + + + Custom toolbar + Barra de herramientas personalizada - + About Acerca de - + Exit Salir diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_eu.ts dtkwidget-5.6.12/src/translations/dtkwidget_eu.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_eu.ts 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_eu.ts 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,804 @@ + + + + + + DAboutDialog + + + %1 is released under %2 + %1 %2 pean argitaratu da + + + + DCrumbEdit + + + Black + Beltza + + + + White + Zuria + + + + Dark Gray + Gris iluna + + + + Gray + Grisa + + + + Light Gray + Gris argia + + + + Red + Gorria + + + + Green + Berdea + + + + Blue + Urdina + + + + Cyan + Zian + + + + Magenta + Magenta + + + + Yellow + Horia + + + + Dark Red + Gorri iluna + + + + Dark Green + Berde iluna + + + + Dark Blue + Urdin iluna + + + + Dark Cyan + Zian iluna + + + + Dark Magenta + Magenta iluna + + + + Dark Yellow + Hori iluna + + + + DInputDialog + + + Cancel + Utzi + + + + Confirm + Berretsi + + + + DKeySequenceEdit + + + Enter a new shortcut + Sartu lasterbide berri bat + + + + DLineEdit + + + Stop reading + Utzi irakurtzeari + + + + Text to Speech + Testutik hizketara + + + + Translate + Itzuli + + + + Speech To Text + Hizketatik testura + + + + DPrintPreviewDialogPrivate + + + + Advanced + Aurreratua + + + + Cancel + button + Utzi + + + + + Print + button + Inprimatu + + + + Basic + Oinarrizkoa + + + + Printer + Inprimagailua + + + + Copies + Kopiak + + + + Page range + Orri tartea + + + + All + Denak + + + + Current page + Uneko orria + + + + Select pages + Hautatu orriak + + + + Orientation + Orientazioa + + + + Portrait + + + + + Landscape + + + + + Pages + + + + + Color mode + + + + + + + + + Color + + + + + + + Grayscale + + + + + Margins + + + + + Narrow (mm) + + + + + Normal (mm) + + + + + Moderate (mm) + + + + + Customize (mm) + + + + + Top + + + + + Left + + + + + Bottom + + + + + Right + + + + + Scaling + + + + + Actual size + + + + + Scale + + + + + Paper + + + + + Paper size + + + + + Print Layout + + + + + Duplex + + + + + N-up printing + + + + + 2 pages/sheet, 1×2 + + + + + 4 pages/sheet, 2×2 + + + + + 6 pages/sheet, 2×3 + + + + + 9 pages/sheet, 3×3 + + + + + 16 pages/sheet, 4×4 + + + + + Layout direction + + + + + Page Order + + + + + Collate pages + + + + + Print pages in order + + + + + Front to back + + + + + Back to front + + + + + Watermark + + + + + Add watermark + + + + + Text watermark + + + + + Confidential + + + + + Draft + + + + + Sample + + + + + Custom + + + + + Input your text + + + + + Picture watermark + + + + + Layout + + + + + Tile + + + + + Center + + + + + Angle + + + + + Size + + + + + Transparency + + + + + + Print to PDF + + + + + + Save as Image + + + + + Collapse + + + + + + Flip on short edge + + + + + + + Flip on long edge + + + + + Input page numbers please + + + + + Maximum page number reached + + + + + Input English comma please + + + + + Input page numbers like this: 1,3,5-7,11-15,18,21 + + + + + Save + button + + + + + *.pdf + + + + + For example, 1,3,5-7,11-15,18,21 + + + + + Save as PDF + + + + + Save as image + + + + + Images + + + + + DPrintPreviewWidget + + + + Confidential + + + + + + Draft + + + + + + Sample + + + + + DSearchEdit + + + Search + Bilatu + + + + DSettingsDialog + + + Cancel + Utzi + + + + Replace + + + + + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately + + + + + DShortcutEdit + + + Please input a new shortcut + + + + + None + + + + + DTextEdit + + + Stop reading + Utzi irakurtzeari + + + + Text to Speech + Testutik hizketara + + + + Translate + Itzuli + + + + Speech To Text + Hizketatik testura + + + + DToolbarEditPanel + + + Default toolset + + + + + Drag your favorite items into the toolbar + + + + + Drag below items into the toolbar to restore defaults + + + + + Confirm + Berretsi + + + + PickColorWidget + + + Color + + + + + QLineEdit + + + &Copy + + + + + Cu&t + + + + + Select All + + + + + QObject + + + No search result + + + + + Restore Defaults + Leheneratu lehenetsiak + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Eskertzeak + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + + + + QWidgetTextControl + + + Select All + + + + + ShortcutEdit + + + Please enter a new shortcut + + + + + TitleBarMenu + + + Theme + Gaia + + + + Light Theme + Gai argia + + + + Dark Theme + Gai iluna + + + + System Theme + Sistemaren gaia + + + + Help + Irten + + + + Feedback + + + + + Custom toolbar + + + + + About + Honi buruz + + + + Exit + Irten + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_fa.ts dtkwidget-5.6.12/src/translations/dtkwidget_fa.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_fa.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_fa.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - سپاسگزاریها - - - - Version: %1 - نسخه:%1 - - - + %1 is released under %2 %1 زیر %2 منتشر می شود @@ -22,87 +17,87 @@ DCrumbEdit - + Black مشکی - + White سفید - + Dark Gray خاکستری تیره - + Gray خاکستری - + Light Gray خاکستری روشن - + Red قرمز - + Green سبز - + Blue آبی - + Cyan فیروزه ای - + Magenta ارغوانی - + Yellow زرد - + Dark Red قرمز تیره - + Dark Green سبز تیره - + Dark Blue آبی تیره - + Dark Cyan فیروزه ای تیره - + Dark Magenta ارغوانی تیره - + Dark Yellow زرد تیره @@ -110,12 +105,12 @@ DInputDialog - + Cancel لغو - + Confirm تائید @@ -123,448 +118,453 @@ DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - لغو + لغو - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search جستجو @@ -572,131 +572,183 @@ DSettingsDialog - + Cancel لغو - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut لطفا میانبر جدید وارد کنید - + None هیچ کدام - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + تائید PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result جستجو نتیجه ایی نداشت - + Restore Defaults بازیابی پیش فرض + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + سپاسگزاریها + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut لطفا میانبر جدید وارد کنید @@ -704,44 +756,49 @@ TitleBarMenu - + Theme تم - + Light Theme تم روشن - + Dark Theme تم تیره - + System Theme تم سیستم - + Help راهنما - + Feedback - + + + + + Custom toolbar + - + About درباره - + Exit خروج - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_fil.ts dtkwidget-5.6.12/src/translations/dtkwidget_fil.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_fil.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_fil.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_fi.ts dtkwidget-5.6.12/src/translations/dtkwidget_fi.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_fi.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_fi.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Kiitokset - - - - Version: %1 - Versio: %1 - - - + %1 is released under %2 %1 on julkaistu %2 -lisenssin alla @@ -20,87 +17,87 @@ DCrumbEdit - + Black Musta - + White Valkoinen - + Dark Gray Tummanharmaa - + Gray Harmaa - + Light Gray Vaaleanharmaa - + Red Punainen - + Green Vihreä - + Blue Sininen - + Cyan Syaani - + Magenta Purppura - + Yellow Keltainen - + Dark Red Tummanpunainen - + Dark Green Tummanvihreä - + Dark Blue Tummansininen - + Dark Cyan Tumma syaani - + Dark Magenta Tumma purppura - + Dark Yellow Tummankeltainen @@ -108,12 +105,12 @@ DInputDialog - + Cancel Peruuta - + Confirm Vahvista @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Tee pikakuvake @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Lopeta lukeminen - + Text to Speech Teksti puheeksi - + Translate Käännös - + Speech To Text Puhe tekstiksi @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Lisäasetukset - + Cancel button Peruuta - - + + Print button Tulosta - + Basic Oletus - + Printer Tulostin - + Copies Kopiot - + Page range Sivualue - + All Kaikki - + Current page Nykyinen sivu - + Select pages Valitse sivut - + Orientation Suunta - + Portrait Pysty - + Landscape Vaaka - + Pages Sivut - + Color mode Väritila - - - + + + + + Color Väri - - - + + + Grayscale Harmaasävy - + Margins Marginaalit - + Narrow (mm) Kapea (mm) - + Normal (mm) Normaali (mm) - + Moderate (mm) Kohtalainen (mm) - + Customize (mm) Mukauta (mm) - + Top Ylös - + Left Vasen - + Bottom Alas - + Right Oikea - + Scaling Skaalaus - + Actual size Todellinen koko - + Scale Skaalaa - + Paper Paperi - + Paper size Paperin koko - + Print Layout Tulosteen asettelu - + Duplex Kääntöyksikkö - + N-up printing Sivuja sivulle - + 2 pages/sheet, 1×2 2 sivua/arkki, 1×2 - + 4 pages/sheet, 2×2 4 sivua/arkki, 2×2 - + 6 pages/sheet, 2×3 6 sivua/arkki, 2×3 - + 9 pages/sheet, 3×3 9 sivua/arkki, 3×3 - + 16 pages/sheet, 4×4 16 sivua/arkki, 4×4 - + Layout direction Asettelun suunta - + Page Order Sivujärjestys - + Collate pages Lajittele sivut - + Print pages in order Sivujen tulostusjärjestys - + Front to back Edestä taakse - + Back to front Takaa eteen - + Watermark Vesileima - + Add watermark Lisää vesileima - + Text watermark Vesileiman teksti - + Confidential Salassapito - + Draft Vedos - + Sample Näyte - + Custom Mukautettu - + Input your text Syötä teksti - + Picture watermark Vesileima kuvana - + Layout Asettelu - + Tile Ruutu - + Center Keskitetty - + Angle Kulma - + Size Koko - + Transparency Läpikuultava - + + Print to PDF Tulosta PDF - + + Save as Image Tallenna kuvana - + Collapse Taita - - + + Flip on short edge Käännä lyhyellä reunalla - - + + + Flip on long edge Käännä pitkällä reunalla - + Input page numbers please Syötä sivunumerot - + Maximum page number reached Sivunumeron enimmäismäärä saavutettu - + Input English comma please Anna englantilainen pilkku - + Input page numbers like this: 1,3,5-7,11-15,18,21 Syötä sivunumerot näin: 1,3,5-7,11-15,18,21 - + Save button Tallenna - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Esimerkki, 1,3,5-7,11-15,18,21 - + Save as PDF Tallenna PDF - + Save as image Tallenna kuvana - + Images Kuvat @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Salassapito - - + + Draft Vedos - - + + Sample Näyte @@ -562,7 +564,7 @@ DSearchEdit - + Search Etsi @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Peruuta - + Replace Korvaa - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Tämä pikakuvake on ristiriidassa %1 kanssa, napsauta Lisää, jotta pikakuvake tulee voimaan heti @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Uusi pikakuvake - + None Tyhjä - DSplitScreenWidget + DTextEdit - - Unmaximize - Pienennä + + Stop reading + Lopeta lukeminen - - Maximize - Suurenna + + Text to Speech + Teksti puheeksi - - Tile window to left of screen - Ikkuna näytön vasemmalle puolelle + + Translate + Käännös - - Tile window to right of screen - Ikkuna näytön oikealle puolelle + + Speech To Text + Puhe tekstiksi - DTextEdit + DToolbarEditPanel - - Stop reading - Lopeta lukeminen + + Default toolset + Oletus työkalut - - Text to Speech - Teksti puheeksi + + Drag your favorite items into the toolbar + Vedä sinun suosikit työkalupalkkiin - - Translate - Käännös + + Drag below items into the toolbar to restore defaults + Palauta oletukset vetämällä alla olevat työkalupalkkiin - - Speech To Text - Puhe tekstiksi + + Confirm + Vahvista PickColorWidget - + Color Väri @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Kopioi - + Cu&t &Leikkaa - + Select All Valitse kaikki @@ -673,20 +675,72 @@ QObject - + No search result Ei hakutuloksia - + Restore Defaults Palauta oletukset + + + Version + Versio + + + + Features + Ominaisuuksia + + + + Homepage + Kotisivu + + + + Description + Kuvaus + + + + Acknowledgements + Kiitokset + + + + + + Sincerely appreciate the open-source software used. + Arvostamme avoimen lähdekoodin ohjelmistoa. + + + + open-source software + avoimen lähdekoodin ohjelmisto + + + + Continue + Jatka + + + + Learn More + Lisätietoja + + + + Credits + Tekijät + QWidgetTextControl - + Select All Valitse kaikki @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Anna uusi pikakuvake @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Teema - + Light Theme Vaalea - + Dark Theme Tumma - + System Theme Järjestelmän - + Help Apua - + Feedback - + Palaute + + + + Custom toolbar + Mukautettu työkalupalkki - + About Tietoja - + Exit Poistu diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_fr.ts dtkwidget-5.6.12/src/translations/dtkwidget_fr.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_fr.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_fr.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Remerciements - - - - Version: %1 - Version : %1 - - - + %1 is released under %2 %1 est publié sous %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Noir - + White Blanc - + Dark Gray Gris foncé - + Gray Gris - + Light Gray Gris clair - + Red Rouge - + Green Vert - + Blue Bleu - + Cyan Cyan - + Magenta Magenta - + Yellow Jaune - + Dark Red Rouge foncé - + Dark Green Vert foncé - + Dark Blue Bleu foncé - + Dark Cyan Cyan foncé - + Dark Magenta Magenta foncé - + Dark Yellow Jaune foncé @@ -108,12 +105,12 @@ DInputDialog - + Cancel Annuler - + Confirm Confirmer @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Entrer un nouveau raccourci @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Arrêter la lecture - + Text to Speech Texte vers voix - + Translate Traduire - + Speech To Text Voix vers texte @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Avancé - + Cancel button Annuler - - + + Print button Impression - + Basic - Basique + De base - + Printer Imprimante - + Copies Copies - + Page range Intervalle de pages - + All Tout - + Current page Page actuelle - + Select pages Sélectionner les pages - + Orientation Orientation - + Portrait Portrait - + Landscape Paysage - + Pages Pages - + Color mode Mode de couleur - - - + + + + + Color Couleur - - - + + + Grayscale Niveaux de gris - + Margins Marges - + Narrow (mm) Étroit (mm) - + Normal (mm) Normale (mm) - + Moderate (mm) Modéré (mm) - + Customize (mm) Personnaliser (mm) - + Top Haut - + Left Gauche - + Bottom Bas - + Right Droite - + Scaling Mise à l'échelle - + Actual size Taille actuelle - + Scale Échelle - + Paper Papier - + Paper size Taille du papier - + Print Layout Mise en page de l'impression - + Duplex Duplex - + N-up printing Impression N-up - + 2 pages/sheet, 1×2 2 pages/feuille, 1×2 - + 4 pages/sheet, 2×2 4 pages/feuille, 2×2 - + 6 pages/sheet, 2×3 6 pages/feuille, 2x3 - + 9 pages/sheet, 3×3 9 pages/feuille, 3x3 - + 16 pages/sheet, 4×4 16 pages/feuille, 4×4 - + Layout direction Direction de la mise en page - + Page Order Ordre des pages - + Collate pages Assembler les pages - + Print pages in order Imprimer les pages dans l'ordre - + Front to back De l'avant vers l'arrière - + Back to front De l'arrière vers l'avant - + Watermark Filigrane - + Add watermark Ajouter un filigrane - + Text watermark Filigrane de texte - + Confidential Confidentiel - + Draft Brouillon - + Sample Échantillon - + Custom Personnaliser - + Input your text Saisissez votre texte - + Picture watermark Filigrane d'image - + Layout Disposition - + Tile Tuile - + Center Centre - + Angle Angle - + Size Taille - + Transparency Transparence - + + Print to PDF Imprimer au format PDF - + + Save as Image Enregistrer comme image - + Collapse Réduire - - + + Flip on short edge Retourner sur le bord court - - + + + Flip on long edge Retourner sur le bord long - + Input page numbers please Veuillez saisir les numéros de page - + Maximum page number reached Numéro de page maximum atteint - + Input English comma please Veuillez entrer une virgule anglaise, s'il vous plaît - + Input page numbers like this: 1,3,5-7,11-15,18,21 Entrez les numéros de page comme ceci : 1,3,5-7,11-15,18,21 - + Save button Sauvegarder - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Par exemple, 1,3,5-7,11-15,18,21 - + Save as PDF Enregistrer au format PDF - + Save as image Enregistrer comme image - + Images Images @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Confidentiel - - + + Draft Brouillon - - + + Sample Échantillon @@ -562,7 +564,7 @@ DSearchEdit - + Search Rechercher @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Annuler - + Replace Remplacer - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Ce raccourci est en conflit avec %1, cliquer sur Ajouter pour que ce raccourci soit effectif immédiatement. @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Veuillez entrer un nouveau raccourci - + None Aucun - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Arrêter la lecture - - Maximize - + + Text to Speech + Texte vers voix - - Tile window to left of screen - + + Translate + Traduire - - Tile window to right of screen - + + Speech To Text + Voix vers texte - DTextEdit + DToolbarEditPanel - - Stop reading - Arrêter la lecture + + Default toolset + - - Text to Speech - Texte vers voix + + Drag your favorite items into the toolbar + - - Translate - Traduire + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Voix vers texte + + Confirm + Confirmer PickColorWidget - + Color Couleur @@ -655,17 +657,17 @@ QLineEdit - + &Copy - + Copier - + Cu&t - + Couper - + Select All Tout sélectionner @@ -673,20 +675,72 @@ QObject - + No search result Aucun résultat trouvé - + Restore Defaults Réinitialiser par défaut + + + Version + Version + + + + Features + Fonctionnalités + + + + Homepage + Page d’accueil + + + + Description + Description + + + + Acknowledgements + Remerciements + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + Continuer + + + + Learn More + En apprendre plus + + + + Credits + + QWidgetTextControl - + Select All Tout sélectionner @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Veuillez entrer un nouveau raccourci @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Thème - + Light Theme Thème clair - + Dark Theme Thème sombre - + System Theme Thème du système - + Help Aide - + Feedback + Retour d'information + + + + Custom toolbar - + About À propos - + Exit Quitter diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_gl_ES.ts dtkwidget-5.6.12/src/translations/dtkwidget_gl_ES.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_gl_ES.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_gl_ES.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - Recoñecementos - - - - Version: %1 - Versión: %1 - - - + %1 is released under %2 %1 está liberada baixo %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black Negro - + White Branco - + Dark Gray Gris escuro - + Gray Gris - + Light Gray Gris claro - + Red Vermello - + Green Verde - + Blue Azul - + Cyan Ciano - + Magenta Maxenta - + Yellow Amarelo - + Dark Red Vermello escuro - + Dark Green Verde escuro - + Dark Blue Azul escuro - + Dark Cyan Ciano escuro - + Dark Magenta Maxenta escuro - + Dark Yellow Amarelo escuro @@ -110,12 +105,12 @@ DInputDialog - + Cancel Cancelar - + Confirm Confirmar @@ -123,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Inserir atallo novo @@ -131,22 +126,22 @@ DLineEdit - + Stop reading Parar de ler - + Text to Speech De texto a voz - + Translate Traducir - + Speech To Text Da voz ao texto @@ -154,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Avanzado - + Cancel button - Cancelar + Cancelar - - + + Print button - Imprimir + Imprimir - + Basic Básico - + Printer Impresora - + Copies Copias - + Page range Rangos de páxina - + All Todo - + Current page Páxina actual - + Select pages Seleccionar páxinas - + Orientation Orientación - + Portrait Vertical - + Landscape Horizontal - + Pages Páxinas - + Color mode Modo de cor - - - + + + + + Color Cor - - - + + + Grayscale Escala de grises - + Margins Marxes - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top Superior - + Left Esquerda - + Bottom Inferior - + Right Dereita - + Scaling Escalado - + Actual size Tamaño actual - + Scale Escala - + Paper Papel - + Paper size Tamaño do papel - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 2 páxinas/folla, 1×2 - + 4 pages/sheet, 2×2 4 páxinas/folla, 2×2 - + 6 pages/sheet, 2×3 6 páxinas/folla, 2×3 - + 9 pages/sheet, 3×3 9 páxinas/folla, 3×3 - + 16 pages/sheet, 4×4 16 páxinas/folla, 4×4 - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order Imprimir páxinas en orde - + Front to back - + - + Back to front - + - + Watermark Marca de auga - + Add watermark Engadir marca de auga - + Text watermark Texto da marca de auga - + Confidential Confidencial - + Draft - + - + Sample Exemplo - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF Gardar como PDF - + Save as image Gardar como imaxe - + Images Imaxes @@ -543,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Confidencial - - + + Draft - + - - + + Sample Exemplo @@ -564,7 +564,7 @@ DSearchEdit - + Search Buscar @@ -572,17 +572,17 @@ DSettingsDialog - + Cancel Cancelar - + Replace Substituír - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Este atallo entra en conflito con 1%, prema en Engadir para facer efectivo este atallo inmediatamente @@ -590,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Por favor, inserte un novo atallo - + None Ningún - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Parar de ler - - Maximize - + + Text to Speech + De texto a voz - - Tile window to left of screen - + + Translate + Traducir - - Tile window to right of screen - + + Speech To Text + Da voz ao texto - DTextEdit + DToolbarEditPanel - - Stop reading - Parar de ler + + Default toolset + - - Text to Speech - De texto a voz + + Drag your favorite items into the toolbar + - - Translate - Traducir + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Da voz ao texto + + Confirm + Confirmar PickColorWidget - + Color Cor @@ -657,17 +657,17 @@ QLineEdit - + &Copy - + - + Cu&t - + - + Select All Seleccionar todo @@ -675,20 +675,72 @@ QObject - + No search result Sen resultados - + Restore Defaults Restaurar predefinidos + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Recoñecementos + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All Seleccionar todo @@ -696,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Por favor, insire un novo atallo @@ -704,44 +756,49 @@ TitleBarMenu - + Theme Tema - + Light Theme Tema claro - + Dark Theme Tema escuro - + System Theme Tema do sistema - + Help Axuda - + Feedback - + + + + + Custom toolbar + - + About Sobre - + Exit Saír - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_he.ts dtkwidget-5.6.12/src/translations/dtkwidget_he.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_he.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_he.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - הוקרת תודה - - - - Version: %1 - גרסה: %1 - - - + %1 is released under %2 %1 מופץ תחת הרשיון %2 @@ -22,100 +17,100 @@ DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel ביטול - + Confirm אישור @@ -123,625 +118,687 @@ DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - ביטול + ביטול - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel ביטול - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut נא להקליד צירוף מקשים חדש - + None ללא - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + אישור PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + הוקרת תודה + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help עזרה - + Feedback - + + + + + Custom toolbar + - + About על אודות - + Exit יציאה - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_hi_IN.ts dtkwidget-5.6.12/src/translations/dtkwidget_hi_IN.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_hi_IN.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_hi_IN.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - आभार - - - - Version: %1 - संस्करण : %1 - - - + %1 is released under %2 %1, %2 के अंतर्गत विमोचित @@ -20,87 +17,87 @@ DCrumbEdit - + Black श्याम - + White श्वेत - + Dark Gray गहरा स्लेटी - + Gray स्लेटी - + Light Gray हल्का स्लेटी - + Red लाल - + Green हरा - + Blue नीला - + Cyan हरिनील - + Magenta गुलाबी - + Yellow पीला - + Dark Red गहरा लाल - + Dark Green गहरा हरा - + Dark Blue गहरा नीला - + Dark Cyan गहरा हरिनील - + Dark Magenta गहरा गुलाबी - + Dark Yellow गहरा पीला @@ -108,12 +105,12 @@ DInputDialog - + Cancel रद्द करें - + Confirm पुष्टि करें @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut नया शॉर्टकट दर्ज़ करें @@ -129,22 +126,22 @@ DLineEdit - + Stop reading पढ़ना बंद करें - + Text to Speech टेक्स्ट से वाणी - + Translate अनुवाद करें - + Speech To Text वाणी से टेक्स्ट @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced विस्तृत - + Cancel button रद्द करें - - + + Print button प्रिंट - + Basic सामान्य - + Printer प्रिंटर - + Copies प्रतिलिपियाँ - + Page range पृष्ठ सीमा - + All सभी - + Current page वर्तमान पृष्ठ - + Select pages पृष्ठ चयन - + Orientation अभिविन्यास - + Portrait लंबवत अभिविन्यास - + Landscape क्षैतिज अभिविन्यास - + Pages पृष्ठ - + Color mode रंगीन मोड - - - + + + + + Color रंग - - - + + + Grayscale श्वेत-श्याम - + Margins सीमांत - + Narrow (mm) संकीर्ण (मि॰ मी॰) - + Normal (mm) सामान्य (मि॰ मी॰) - + Moderate (mm) औसत (मि॰ मी॰) - + Customize (mm) अनुकूलित (मि॰ मी॰) - + Top शीर्ष - + Left बायां - + Bottom तल - + Right दायां - + Scaling अनुमाप परिवर्तन - + Actual size वास्तविक आकार - + Scale अनुमाप परिवर्तन - + Paper पृष्ठ - + Paper size पृष्ठ आकार - + Print Layout प्रिंट का अभिन्यास - + Duplex दोहरा प्रिंट - + N-up printing एकल पृष्ठ पर एकाधिक पृष्ठ संयोजन - + 2 pages/sheet, 1×2 2 पृष्ठ/कागज़, 1x2 - + 4 pages/sheet, 2×2 4 पृष्ठ/कागज़, 2x2 - + 6 pages/sheet, 2×3 6 पृष्ठ/कागज़, 2x3 - + 9 pages/sheet, 3×3 9 पृष्ठ/कागज़, 3x3 - + 16 pages/sheet, 4×4 16 पृष्ठ/कागज़, 4x4 - + Layout direction अभिन्यास दिशा - + Page Order पृष्ठ क्रम - + Collate pages पृष्ठ संयोजन - + Print pages in order पृष्ठों को क्रमानुसार प्रिंट करें - + Front to back प्रथम से अंतिम - + Back to front अंतिम से प्रथम - + Watermark वॉटरमार्क - + Add watermark वॉटरमार्क जोड़ें - + Text watermark शब्द युक्त वॉटरमार्क - + Confidential गोपनीय - + Draft प्रारूप - + Sample नमूना - + Custom अनुकूलित - + Input your text शब्द दर्ज करें - + Picture watermark चित्र युक्त वॉटरमार्क - + Layout अभिन्यास - + Tile एकाधिक अनुभाग - + Center केंद्रित - + Angle कोण - + Size आकार - + Transparency पारदर्शिता - + + Print to PDF PDF रूप में प्रिंट - + + Save as Image चित्र के रूप में संचित करें - + Collapse संक्षिप्त करें - - + + Flip on short edge क्षैतिज पृष्ठ क्रम - - + + + Flip on long edge लंबवत पृष्ठ क्रम - + Input page numbers please कृपया पृष्ठ संख्या दर्ज करें - + Maximum page number reached यह पृष्ठ हेतु अधिकतम संख्या है - + Input English comma please कृपया अल्पविराम दर्ज करें - + Input page numbers like this: 1,3,5-7,11-15,18,21 इस प्रकार अल्पविराम दर्ज करें : 1,3,5-7,11-15,18,21 - + Save button संचित करें - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 उदाहरण, 1,3,5-7,11-15,18,21 - + Save as PDF PDF रूप में संचित - + Save as image चित्र के रूप में संचित - + Images चित्र @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential गोपनीय - - + + Draft प्रारूप - - + + Sample नमूना @@ -562,7 +564,7 @@ DSearchEdit - + Search खोजें @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel रद्द करें - + Replace से बदलें - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately यह शॉर्टकट %1 के विरुद्ध है, जोड़ें पर क्लिक कर इसे तुरंत प्रभाव से लागू करें @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut कृपया नया इनपुट करें - + None कुछ नहीं - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + पढ़ना बंद करें - - Maximize - + + Text to Speech + टेक्स्ट से वाणी - - Tile window to left of screen - + + Translate + अनुवाद करें - - Tile window to right of screen - + + Speech To Text + वाणी से टेक्स्ट - DTextEdit + DToolbarEditPanel - - Stop reading - पढ़ना बंद करें + + Default toolset + - - Text to Speech - टेक्स्ट से वाणी + + Drag your favorite items into the toolbar + - - Translate - अनुवाद करें + + Drag below items into the toolbar to restore defaults + - - Speech To Text - वाणी से टेक्स्ट + + Confirm + पुष्टि करें PickColorWidget - + Color रंग @@ -655,17 +657,17 @@ QLineEdit - + &Copy - + Cu&t - + Select All सारा चयनित @@ -673,20 +675,72 @@ QObject - + No search result खोज का परिणाम नहीं मिला - + Restore Defaults मूल स्वरूप पुनः स्थापित करें + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + आभार + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All सारा चयनित @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut कृपया नया शॉर्टकट दर्ज़ करें @@ -702,42 +756,47 @@ TitleBarMenu - + Theme थीम - + Light Theme हल्की थीम - + Dark Theme गहरी थीम - + System Theme सिस्टम थीम - + Help मदद - + Feedback - + + Custom toolbar + + + + About बारे में - + Exit बंद करें diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_hr.ts dtkwidget-5.6.12/src/translations/dtkwidget_hr.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_hr.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_hr.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - Priznanja - - - - Version: %1 - Inačica: %1 - - - + %1 is released under %2 %1 je objavljeno pod %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black Crno - + White Bijelo - + Dark Gray Tamno sivo - + Gray Sivo - + Light Gray Svijetlo sivo - + Red Crveno - + Green Zeleno - + Blue Plavo - + Cyan - + - + Magenta - + Magenta - + Yellow Žuto - + Dark Red Tamnocrveno - + Dark Green Tamno zeleno - + Dark Blue Tamnoplavo - + Dark Cyan - + - + Dark Magenta - + Tamna magenta - + Dark Yellow Tamnožuto @@ -110,12 +105,12 @@ DInputDialog - + Cancel Odustani - + Confirm Potvrdi @@ -123,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Unesi novi prečac @@ -131,22 +126,22 @@ DLineEdit - + Stop reading - + Prestani čitati - + Text to Speech Tekst u govor - + Translate Prevedi - + Speech To Text Govor u tekst @@ -154,417 +149,422 @@ DPrintPreviewDialogPrivate - - + + Advanced Napredno - + Cancel button - Odustani + Otkaži - - + + Print button - Ispis + Ispis - + Basic Osnovno - + Printer Pisač - + Copies Kopije - + Page range - + - + All Sve - + Current page Trenutna stranica - + Select pages Odaberite stranice - + Orientation Orijentacija - + Portrait Portret - + Landscape Krajobraz - + Pages Stranice - + Color mode - + - - - + + + + + Color Boja - - - + + + Grayscale - + - + Margins - + Margine - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + Prilagodi (mm) - + Top Gore - + Left Lijevo - + Bottom Dolje - + Right Desno - + Scaling - + - + Actual size - + Stvarna veličina - + Scale - + - + Paper Papir - + Paper size Veličina papira - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + Redoslijed stranica - + Collate pages - + - + Print pages in order - + Ispis stranica redom - + Front to back - + Naprijed prema natrag - + Back to front - + Natrag prema naprijed - + Watermark - + Vodeni žig - + Add watermark - + Dodaj vodeni žig - + Text watermark - + - + Confidential - + Povjerljivo - + Draft - + Skica - + Sample - + - + Custom - + Prilagođeno - + Input your text - + Unesite vaš tekst - + Picture watermark - + - + Layout - Rasporet + Raspored - + Tile - + - + Center - + Centar - + Angle - + Kut - + Size - + Veličina - + Transparency - + Prozirnost - + + Print to PDF - + - + + Save as Image - + Spremi kao sliku - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - Spremi + Spremi - + *.pdf - + *.pdf - + For example, 1,3,5-7,11-15,18,21 - + Na primjer, 1,3,5-7,11-15,18,21 - + Save as PDF - + Spremi kao PDF - + Save as image - + Spremi kao sliku - + Images - + Slike DPrintPreviewWidget - - + + Confidential - + Povjerljivo - - + + Draft - + Skica - - + + Sample - + DSearchEdit - + Search Traži @@ -572,84 +572,84 @@ DSettingsDialog - + Cancel Odustani - + Replace Zamijeni - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut Molimo Vas da unesete novi prečac - + None Niti jedan - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Prestani čitati - - Maximize - + + Text to Speech + Tekst u govor - - Tile window to left of screen - + + Translate + Prevedi - - Tile window to right of screen - + + Speech To Text + Govor u tekst - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - Tekst u govor + + Drag your favorite items into the toolbar + - - Translate - Prevedi + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Govor u tekst + + Confirm + Potvrdi PickColorWidget - + Color Boja @@ -657,17 +657,17 @@ QLineEdit - + &Copy - + - + Cu&t - + - + Select All Odaberi sve @@ -675,20 +675,72 @@ QObject - + No search result Nema rezultata pretrage - + Restore Defaults - + Obnovi zadano + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Priznanja + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All Odaberi sve @@ -696,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Molim unesite novi prečac @@ -704,44 +756,49 @@ TitleBarMenu - + Theme Tema - + Light Theme Svijetla tema - + Dark Theme Tamna tema - + System Theme Tema sustava - + Help Pomoć - + Feedback - + + + + + Custom toolbar + - + About O programu - + Exit Izlaz - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_hu.ts dtkwidget-5.6.12/src/translations/dtkwidget_hu.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_hu.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_hu.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Köszönetnyilvánítás - - - - Version: %1 - Verzió: %1 - - - + %1 is released under %2 A %1 a %2 alatti kiadás @@ -20,87 +17,87 @@ DCrumbEdit - + Black Fekete - + White Fehér - + Dark Gray Sötét szürke - + Gray Szürke - + Light Gray Világos szürke - + Red Piros - + Green Zöld - + Blue Kék - + Cyan Cián - + Magenta Magenta - + Yellow Sárga - + Dark Red Vörös - + Dark Green Sötét zöld - + Dark Blue Sötét kék - + Dark Cyan Sötét cián - + Dark Magenta Sötét bíbor - + Dark Yellow Sötét sárga @@ -108,12 +105,12 @@ DInputDialog - + Cancel Mégsem - + Confirm Megerősítés @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Adjon meg egy új gyorsbillentyűt @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Olvasás leállítása - + Text to Speech Szöveg felolvasása - + Translate Fordítás - + Speech To Text Beszéd szöveggé alakítása @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Haladó - + Cancel button Mégsem - - + + Print button Nyomtatás - + Basic Alapvető - + Printer Nyomtató - + Copies Másolatok - + Page range Oldal arány - + All Összes - + Current page Jelenlegi oldal - + Select pages Oldalak kiválasztása - + Orientation Tájolás - + Portrait Álló - + Landscape Fekvő - + Pages Oldalak - + Color mode Színes mód - - - + + + + + Color Szín - - - + + + Grayscale Szürkeárnyalatos - + Margins Margók - + Narrow (mm) Keskeny (mm) - + Normal (mm) Normál (mm) - + Moderate (mm) Mérsékelt (mm) - + Customize (mm) Testreszabott (mm) - + Top Fent - + Left Balra - + Bottom Lent - + Right Jobbra - + Scaling Méretezés - + Actual size Eredeti méret - + Scale Méretezés - + Paper Papír - + Paper size Papír méret - + Print Layout Nyomtatási elrendezés - + Duplex Kétoldalas - + N-up printing N-up nyomtatás - + 2 pages/sheet, 1×2 2 oldal / lap, 1×2 - + 4 pages/sheet, 2×2 4 oldal / lap, 2×2 - + 6 pages/sheet, 2×3 6 oldal / lap, 2×3 - + 9 pages/sheet, 3×3 9 oldal / lap, 3×3 - + 16 pages/sheet, 4×4 16 oldal / lap, 4×4 - + Layout direction Elrendezés iránya - + Page Order Oldalsorrend - + Collate pages Oldalak leválogatása - + Print pages in order Oldalak nyomtatása sorrendben - + Front to back Elölről hátra - + Back to front Hátulról előre - + Watermark Vízjel - + Add watermark Vízjel hozzáadása - + Text watermark Szöveges vízjel - + Confidential Bizalmas - + Draft Piszkozat - + Sample Minta - + Custom Egyedi - + Input your text Írja be a szövegét - + Picture watermark Képes vízjel - + Layout Elrendezés - + Tile Csempe - + Center Közép - + Angle Szög - + Size Méret - + Transparency Áttetszőség - + + Print to PDF Nyomtatás PDF fájlba - + + Save as Image Mentés kép fájlként - + Collapse Összeomlás - - + + Flip on short edge Fordítás a rövidebbik él mentén - - + + + Flip on long edge Fordítás a hosszabbik él mentén - + Input page numbers please Adja meg az oldalszámokat - + Maximum page number reached Elérte a maximális oldalszámot - + Input English comma please Kérjük írja be az angol vesszőt - + Input page numbers like this: 1,3,5-7,11-15,18,21 Adja meg az oldalszámokat, mint például: 1,3,5-7,11-15,18,21 - + Save button Mentés - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Például: 1,3,5-7,11-15,18,21 - + Save as PDF Mentés PDF fájlként - + Save as image Mentés képként - + Images Képek @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Bizalmas - - + + Draft Piszkozat - - + + Sample Minta @@ -562,7 +564,7 @@ DSearchEdit - + Search Keresés @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Mégsem - + Replace Csere - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Ez a gyorsbillentyű ütközik %1-el, kattintson a Hozzáadás gombra ennek használatához @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Kérjük adjon meg egy új gyorsbillentyűt - + None Egyik sem - DSplitScreenWidget + DTextEdit - - Unmaximize - Teljes képernyő viszavonása + + Stop reading + Olvasás leállítása - - Maximize - Teljes képernyő + + Text to Speech + Szöveg felolvasása - - Tile window to left of screen - Csempe ablak a képernyő bal oldalán + + Translate + Fordítás - - Tile window to right of screen - Csempe ablak a képernyő jobb oldalán + + Speech To Text + Beszéd szöveggé alakítása - DTextEdit + DToolbarEditPanel - - Stop reading - Olvasás leállítása + + Default toolset + Alapértelmezett eszközkészlet - - Text to Speech - Szöveg felolvasása + + Drag your favorite items into the toolbar + Húzza kedvenc elemeit az eszköztárba - - Translate - Fordítás + + Drag below items into the toolbar to restore defaults + Az alapértelmezett értékek visszaállításához húzza az alábbi elemeket az eszköztárba - - Speech To Text - Beszéd szöveggé alakítása + + Confirm + Megerősítés PickColorWidget - + Color Szín @@ -655,17 +657,17 @@ QLineEdit - + &Copy Másolás - + Cu&t Kivágás - + Select All Összes kijelölése @@ -673,20 +675,72 @@ QObject - + No search result Nincs keresési eredmény - + Restore Defaults Alapértelmezések visszaállítása + + + Version + Verzió + + + + Features + Tulajdonságok + + + + Homepage + Kezdőoldal + + + + Description + Leírás + + + + Acknowledgements + Köszönetnyilvánítás + + + + + + Sincerely appreciate the open-source software used. + Őszintén köszönjük, hogy nyílt forráskódú szoftvert használ. + + + + open-source software + Nyílt forráskódú szoftver + + + + Continue + Folytatás + + + + Learn More + Tudjon meg többet + + + + Credits + Elismerés + QWidgetTextControl - + Select All Összes kijelölése @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Kérjük hozzon létre egy új parancsikont @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Téma - + Light Theme Világos mód - + Dark Theme Sötét mód - + System Theme Rendszer téma - + Help Segítség - + Feedback - + Visszajelzés + + + + Custom toolbar + Egyéni eszköztár - + About Az alkalmazásról - + Exit Kilépés diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_hy.ts dtkwidget-5.6.12/src/translations/dtkwidget_hy.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_hy.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_hy.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_id.ts dtkwidget-5.6.12/src/translations/dtkwidget_id.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_id.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_id.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - Ucapan terima kasih - - - - Version: %1 - Versi: %1 - - - + %1 is released under %2 %1 dirilis dalam %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black Hitam - + White Putih - + Dark Gray Abu-abu hitam - + Gray Abu-abu - + Light Gray Abu-abu Terang - + Red Merah - + Green Hijau - + Blue Biru - + Cyan Cyan - + Magenta Magenta - + Yellow Kuning - + Dark Red - Merah Gelap  + Merah Gelap  - + Dark Green Hijau Gelap - + Dark Blue Biru Gelap - + Dark Cyan Cyan Gelap - + Dark Magenta Magenta Gelap - + Dark Yellow Kuning Gelap @@ -110,12 +105,12 @@ DInputDialog - + Cancel Batal - + Confirm Konfirmasi @@ -123,580 +118,637 @@ DKeySequenceEdit - + Enter a new shortcut - + Masukan jalan pintas baru DLineEdit - + Stop reading - + Berhenti membaca - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - Batal + Batal - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel Batal - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut Silakan masukan pintasan baru - + None Tidak ada - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Berhenti membaca - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + Konfirmasi PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result Tidak ada hasil pencarian - + Restore Defaults Pulihkan ke baku + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Ucapan terima kasih + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut Mohon masukan sebuah jalan pintas yang baru @@ -704,44 +756,49 @@ TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help Bantuan - + Feedback - + + + + + Custom toolbar + - + About Tentang - + Exit Keluar - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_it.ts dtkwidget-5.6.12/src/translations/dtkwidget_it.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_it.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_it.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Ringraziamenti - - - - Version: %1 - Versione: %1 - - - + %1 is released under %2 %1 è rilasciato secondo %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Nero - + White Bianco - + Dark Gray Grigio scuro - + Gray Grigio - + Light Gray Grigio chiaro - + Red Rosso - + Green Verde - + Blue Blu - + Cyan Ciano - + Magenta Magenta - + Yellow Giallo - + Dark Red Rosso scuro - + Dark Green Verde scuro - + Dark Blue Blu scuro - + Dark Cyan Ciano scuro - + Dark Magenta Magenta scuro - + Dark Yellow Giallo scuro @@ -108,12 +105,12 @@ DInputDialog - + Cancel Annulla - + Confirm Conferma @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Inserisci una nuova scorciatoia @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Interrompi lettura - + Text to Speech Da testo ad audio - + Translate Traduci - + Speech To Text Da audio a testo @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Avanzate - + Cancel button Annulla - - + + Print button Stampa - + Basic Base - + Printer Stampante - + Copies Copie - + Page range Intervallo pagine - + All Tutte - + Current page Pagina corrente - + Select pages Pagine selezionate - + Orientation Orientamento - + Portrait Verticale - + Landscape Orizzontale - + Pages Pagine - + Color mode Modalità colore - - - + + + + + Color Colori - - - + + + Grayscale Scala di griglio - + Margins Margini - + Narrow (mm) Stretto (mm) - + Normal (mm) Normale (mm) - + Moderate (mm) Moderato (mm) - + Customize (mm) Personalizzato (mm) - + Top Alto - + Left Sinistra - + Bottom Basso - + Right Destra - + Scaling Scala - + Actual size Dimensione effettiva - + Scale Scala - + Paper Carta - + Paper size Dimensione carta - + Print Layout Layout di stampa - + Duplex Fronte e retro - + N-up printing Stampa N-up - + 2 pages/sheet, 1×2 2 pagine/foglio, 1×2 - + 4 pages/sheet, 2×2 4 pagine/foglio, 2×2 - + 6 pages/sheet, 2×3 6 pagine/foglio, 2×3 - + 9 pages/sheet, 3×3 9 pagine/foglio, 3×3 - + 16 pages/sheet, 4×4 16 pagine/foglio, 4×4 - + Layout direction Direzione Layout - + Page Order Ordine pagine - + Collate pages Fascicola pagine - + Print pages in order Stampa pagine in ordine - + Front to back Dal fronte al retro - + Back to front Dal retro al fronte - + Watermark Filigrana - + Add watermark Aggiungi filigrana - + Text watermark Filigrana testuale - + Confidential Confidenziale - + Draft Bozza - + Sample Esempio - + Custom Personalizzato - + Input your text Inserisci il testo - + Picture watermark Immagine filigrana - + Layout Disposizione - + Tile Titolo - + Center Centrata - + Angle Ad angolo - + Size Dimensione - + Transparency Trasparenza - + + Print to PDF Stampa su PDF - + + Save as Image Salva come immagine - + Collapse Collassa - - + + Flip on short edge Rilega sul lato corto - - + + + Flip on long edge Rilega sul lato lungo - + Input page numbers please Inserisci il numero di pagine - + Maximum page number reached Numero massimo di pagine raggiunto - + Input English comma please Inserisci la virgola come separatore - + Input page numbers like this: 1,3,5-7,11-15,18,21 Inserisci il numero di pagine come: 1,3,5-7,11-15,18,21 - + Save button Salva - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Ad esempio, 1,3,5-7,11-15,18,21 - + Save as PDF Salva come PDF - + Save as image Salva come immagine - + Images Immagini @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Confidenziale - - + + Draft Bozza - - + + Sample Esempio @@ -562,7 +564,7 @@ DSearchEdit - + Search Cerca @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Annulla - + Replace Sostituisci - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Questa scorciatoia è in conflitto con %1, clicca su Aggiungi per rendere predefinita questa scorciatoia @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Inserisci una nuova scorciatoia - + None No - DSplitScreenWidget + DTextEdit - - Unmaximize - Riduci l'ingrandimento + + Stop reading + Interrompi lettura - - Maximize - Ingrandisci + + Text to Speech + Da testo ad audio - - Tile window to left of screen - Affianca la finestra a sinistra dello schermo + + Translate + Traduci - - Tile window to right of screen - Affianca la finestra a destra dello schermo + + Speech To Text + Da audio a testo - DTextEdit + DToolbarEditPanel - - Stop reading - Interrompi lettura + + Default toolset + - - Text to Speech - Da testo ad audio + + Drag your favorite items into the toolbar + - - Translate - Traduci + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Da audio a testo + + Confirm + Conferma PickColorWidget - + Color Colori @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Copy - + Cu&t Cu&t - + Select All Seleziona tutto @@ -673,20 +675,72 @@ QObject - + No search result Nessun risultato - + Restore Defaults Ripristina valori predefiniti + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Ringraziamenti + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All Seleziona tutto @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Inserisci una nuova scorciatoia @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Tema - + Light Theme Tema chiaro - + Dark Theme Tema scuro - + System Theme Tema di Sistema - + Help Aiuto - + Feedback + Feedback + + + + Custom toolbar - + About Info - + Exit Esci diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ja.ts dtkwidget-5.6.12/src/translations/dtkwidget_ja.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ja.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ja.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - 謝辞 - - - - Version: %1 - バージョン: %1 - - - + %1 is released under %2 %1 は %2 の下でリリースされています @@ -22,87 +17,87 @@ DCrumbEdit - + Black ブラック - + White ホワイト - + Dark Gray ダークグレー - + Gray グレー - + Light Gray ライトグレー - + Red レッド - + Green グリーン - + Blue ブルー - + Cyan シアン - + Magenta マゼンタ - + Yellow イエロー - + Dark Red ダークレッド - + Dark Green ダークグリーン - + Dark Blue ダークブルー - + Dark Cyan ダークシアン - + Dark Magenta ダークマゼンタ - + Dark Yellow ダークイエロー @@ -110,12 +105,12 @@ DInputDialog - + Cancel キャンセル - + Confirm 確認 @@ -123,580 +118,637 @@ DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - キャンセル + キャンセル - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel キャンセル - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut 新しいショートカットを入力してください - + None なし - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + 確認 PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result 検索結果が見つかりませんでした - + Restore Defaults デフォルトに戻す + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + 謝辞 + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut 新しいショートカットを入力してください @@ -704,44 +756,49 @@ TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help ヘルプ - + Feedback - + + + + + Custom toolbar + - + About このアプリケーションについて - + Exit 終了 - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ka.ts dtkwidget-5.6.12/src/translations/dtkwidget_ka.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ka.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ka.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_km_KH.ts dtkwidget-5.6.12/src/translations/dtkwidget_km_KH.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_km_KH.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_km_KH.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_kn_IN.ts dtkwidget-5.6.12/src/translations/dtkwidget_kn_IN.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_kn_IN.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_kn_IN.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ko.ts dtkwidget-5.6.12/src/translations/dtkwidget_ko.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ko.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ko.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - 감사의 말 - - - - Version: %1 - 버전: %1 - - - + %1 is released under %2 %1은(는) %2에 따라 배포됩니다 @@ -22,87 +17,87 @@ DCrumbEdit - + Black 검은색 - + White 흰색 - + Dark Gray 진한 회색 - + Gray 회색 - + Light Gray 밝은 회색 - + Red 빨간색 - + Green 녹색 - + Blue 파란색 - + Cyan 청록색 - + Magenta 자홍색 - + Yellow 노란색 - + Dark Red 진한 빨간색 - + Dark Green 진한 녹색 - + Dark Blue 진한 파란색 - + Dark Cyan 진한 청록색 - + Dark Magenta 진한 자홍색 - + Dark Yellow 진한 노란색 @@ -110,12 +105,12 @@ DInputDialog - + Cancel 취소 - + Confirm 확인 @@ -123,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut 새 단축키를 입력하십시오 @@ -131,22 +126,22 @@ DLineEdit - + Stop reading 읽기 중지 - + Text to Speech 텍스트 음성 변환 - + Translate 번역하기 - + Speech To Text 음성 텍스트 변환 @@ -154,417 +149,422 @@ DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - 취소 + 취소 - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + 페이지 번호를 입력하세요 - + Maximum page number reached - + 최대 페이지 수에 도달했습니다. - + Input English comma please - + 영어 쉼표를 입력하세요 - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + PDF로 저장 - + Save as image - + 이미지로 저장 - + Images - + 이미지 DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search 검색 @@ -572,17 +572,17 @@ DSettingsDialog - + Cancel 취소 - + Replace 바꾸기 - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately 이 단축키는 %1과 충돌합니다. 추가를 클릭하여이 단축키를 즉시 적용하십시오 @@ -590,113 +590,165 @@ DShortcutEdit - + Please input a new shortcut 새 단축키를 입력하십시오 - + None 없음 - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + 읽기 중지 - - Maximize - + + Text to Speech + 텍스트 음성 변환 - - Tile window to left of screen - + + Translate + 번역하기 - - Tile window to right of screen - + + Speech To Text + 음성 텍스트 변환 - DTextEdit + DToolbarEditPanel - - Stop reading - 읽기 중지 + + Default toolset + - - Text to Speech - 텍스트 음성 변환 + + Drag your favorite items into the toolbar + - - Translate - 번역하기 + + Drag below items into the toolbar to restore defaults + - - Speech To Text - 음성 텍스트 변환 + + Confirm + 확인 PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result 검색 결과 없음 - + Restore Defaults 기본값 복원 + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + 감사의 말 + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut 새 단축키를 입력하십시오 @@ -704,44 +756,49 @@ TitleBarMenu - + Theme 테마 - + Light Theme 밝은 색상 테마 - + Dark Theme 어두운 색상 테마 - + System Theme 시스템 테마 - + Help 도움말 - + Feedback - + + + + + Custom toolbar + - + About 프로그램 정보 - + Exit 종료 - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ku_IQ.ts dtkwidget-5.6.12/src/translations/dtkwidget_ku_IQ.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ku_IQ.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ku_IQ.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ku.ts dtkwidget-5.6.12/src/translations/dtkwidget_ku.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ku.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ku.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ky@Arab.ts dtkwidget-5.6.12/src/translations/dtkwidget_ky@Arab.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ky@Arab.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ky@Arab.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ky.ts dtkwidget-5.6.12/src/translations/dtkwidget_ky.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ky.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ky.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_lt.ts dtkwidget-5.6.12/src/translations/dtkwidget_lt.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_lt.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_lt.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - Padėkos - - - - Version: %1 - Versija: %1 - - - + %1 is released under %2 %1 yra išleista pagal %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black Juoda - + White Balta - + Dark Gray Tamsiai pilka - + Gray Pilka - + Light Gray Šviesiai pilka - + Red Raudona - + Green Žalia - + Blue Mėlyna - + Cyan Žydra - + Magenta Purpurinė - + Yellow Geltona - + Dark Red Tamsiai raudona - + Dark Green Tamsiai žalia - + Dark Blue Tamsiai mėlyna - + Dark Cyan Tamsiai žydra - + Dark Magenta Tamsiai purpurinė - + Dark Yellow Tamsiai geltona @@ -110,12 +105,12 @@ DInputDialog - + Cancel Atsisakyti - + Confirm Patvirtinti @@ -123,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Įveskite naują trumpinį @@ -131,440 +126,445 @@ DLineEdit - + Stop reading Stabdyti skaitymą - + Text to Speech Garsinis teksto atkūrimas - + Translate Išversti - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - Atsisakyti + Atsisakyti - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search Ieškoti @@ -572,17 +572,17 @@ DSettingsDialog - + Cancel Atsisakyti - + Replace Pakeisti - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Šis trumpinys konfliktuoja su %1. Spustelėkite ant mygtuko "Pridėti" norėdami nedelsiant įjungti trumpinį @@ -590,113 +590,165 @@ DShortcutEdit - + Please input a new shortcut Įveskite naują trumpinį - + None Nėra - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Stabdyti skaitymą - - Maximize - + + Text to Speech + Garsinis teksto atkūrimas - - Tile window to left of screen - + + Translate + Išversti - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - Stabdyti skaitymą + + Default toolset + - - Text to Speech - Garsinis teksto atkūrimas + + Drag your favorite items into the toolbar + - - Translate - Išversti + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + Patvirtinti PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result Nėra paieškos rezultatų - + Restore Defaults Atkurti numatytuosius + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Padėkos + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut Įveskite naują trumpinį @@ -704,44 +756,49 @@ TitleBarMenu - + Theme Tema - + Light Theme Šviesi tema - + Dark Theme Tamsi tema - + System Theme Sistemos tema - + Help Žinynas - + Feedback - + + + + + Custom toolbar + - + About Apie - + Exit Išeiti - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ml.ts dtkwidget-5.6.12/src/translations/dtkwidget_ml.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ml.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ml.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_mn.ts dtkwidget-5.6.12/src/translations/dtkwidget_mn.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_mn.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_mn.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_mr.ts dtkwidget-5.6.12/src/translations/dtkwidget_mr.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_mr.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_mr.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ms.ts dtkwidget-5.6.12/src/translations/dtkwidget_ms.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ms.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ms.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Penghargaan - - - - Version: %1 - Versi: %1 - - - + %1 is released under %2 %1 dikeluarkan bawah %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Hitam - + White Putih - + Dark Gray Kelabu Gelap - + Gray Kelabu - + Light Gray Kelabu Cerah - + Red Merah - + Green Hijau - + Blue Biru - + Cyan Sian - + Magenta Magenta - + Yellow Kuning - + Dark Red Merah Gelap - + Dark Green Hijau Gelap - + Dark Blue Biru Gelap - + Dark Cyan Sian Gelap - + Dark Magenta Magenta Gelap - + Dark Yellow Kuning Gelap @@ -108,12 +105,12 @@ DInputDialog - + Cancel Batal - + Confirm Sahkan @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Masukkan satu pintasan baharu @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Henti membaca - + Text to Speech Teks ke Pertuturan - + Translate Terjemah - + Speech To Text Pertuturan Ke Teks @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Lanjutan - + Cancel button Batal - - + + Print button Cetak - + Basic Asas - + Printer Pencetak - + Copies Salinan - + Page range Julat halaman - + All Semua - + Current page Halaman semasa - + Select pages Pilih halaman - + Orientation Orientasi - + Portrait Potret - + Landscape Lanskap - + Pages Halaman - + Color mode Mod warna - - - + + + + + Color Warna - - - + + + Grayscale Skala kelabu - + Margins Jidar - + Narrow (mm) Sempit (mm) - + Normal (mm) Biasa (mm) - + Moderate (mm) Sederhana (mm) - + Customize (mm) Suai (mm) - + Top Atas - + Left Kiri - + Bottom Bawah - + Right Kanan - + Scaling Penskalaan - + Actual size Saiz sebenar - + Scale Skala - + Paper Kertas - + Paper size Saiz kertas - + Print Layout Bentangan cetak - + Duplex Dupleks - + N-up printing Percetakan N-up - + 2 pages/sheet, 1×2 2 halaman/helai, 1x2 - + 4 pages/sheet, 2×2 4 halaman/helai, 2x2 - + 6 pages/sheet, 2×3 6 halaman/helai, 2x3 - + 9 pages/sheet, 3×3 9 halaman/helai, 3x3 - + 16 pages/sheet, 4×4 16 halaman/helai, 4x4 - + Layout direction Arah bentangan - + Page Order Tertib Halaman - + Collate pages Kumpul semak halaman - + Print pages in order Cetak halaman mengikut tertib - + Front to back Hadapan ke belakang - + Back to front Belakang ke hadapan - + Watermark Tera air - + Add watermark Tambah tera air - + Text watermark Tera air teks - + Confidential Sulit - + Draft Draf - + Sample Sampel - + Custom Suai - + Input your text Masukkan teks anda - + Picture watermark Tera air gambar - + Layout Bentangan - + Tile Jubin - + Center Tengah - + Angle Sudut - + Size Saiz - + Transparency Kelutsinaran - + + Print to PDF Cetak ke PDF - + + Save as Image Simpan sebagai Imej - + Collapse Kuncup - - + + Flip on short edge Kalih pinggir pendek - - + + + Flip on long edge Kalih pinggir panjang - + Input page numbers please Sila masukkan nombor halaman - + Maximum page number reached Bilangan halaman maksimum dicapai - + Input English comma please Sila masukkan tanda koma - + Input page numbers like this: 1,3,5-7,11-15,18,21 Masukkan nombor halaman seperti berikut: 1,3,5-7,11-15,18,21 - + Save button Simpan - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Contohnya, 1,3,5-7,11-15,18,21 - + Save as PDF Simpan sebagai PDF - + Save as image Simpan sebagai imej - + Images Imej @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Sulit - - + + Draft Draf - - + + Sample Sampel @@ -562,7 +564,7 @@ DSearchEdit - + Search Gelintar @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Batal - + Replace Ganti - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Pintasan ini berkonflik dengan %1, klik pada Tambah untuk menjadikan pintasan ini berkesan serta-merta @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Sila masukkan satu pintasan baharu - + None Tiada - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Henti membaca - - Maximize - + + Text to Speech + Teks ke Pertuturan - - Tile window to left of screen - + + Translate + Terjemah - - Tile window to right of screen - + + Speech To Text + Pertuturan Ke Teks - DTextEdit + DToolbarEditPanel - - Stop reading - Henti membaca + + Default toolset + - - Text to Speech - Teks ke Pertuturan + + Drag your favorite items into the toolbar + - - Translate - Terjemah + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Pertuturan Ke Teks + + Confirm + Sahkan PickColorWidget - + Color Warna @@ -655,17 +657,17 @@ QLineEdit - + &Copy - + Sa&lin - + Cu&t - + Po&tong - + Select All Pilih Semua @@ -673,20 +675,72 @@ QObject - + No search result Tiada keputusan gelintar - + Restore Defaults Pulih Lalai + + + Version + Versi + + + + Features + Ciri-ciri + + + + Homepage + Laman Utama + + + + Description + Keterangan + + + + Acknowledgements + Penghargaan + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + Teruskan + + + + Learn More + Ketahui Lagi + + + + Credits + + QWidgetTextControl - + Select All Pilih Semua @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Sila masukkan satu pintasan baharu @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Tema - + Light Theme Tema Cerah - + Dark Theme Tema Gelap - + System Theme Tema Sistem - + Help Bantuan - + Feedback + Maklum balas + + + + Custom toolbar - + About Perihal - + Exit Keluar diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_nb.ts dtkwidget-5.6.12/src/translations/dtkwidget_nb.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_nb.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_nb.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - Anerkjennelser - - - - Version: %1 - Versjon: %1 - - - + %1 is released under %2 %1 er utgitt under %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black Svart - + White Hvit - + Dark Gray Mørk Grå - + Gray Grå - + Light Gray Lys Grå - + Red Rød - + Green Grønn - + Blue Blå - + Cyan Cyan - + Magenta Magenta - + Yellow Gul - + Dark Red Mørk Rød - + Dark Green Mørk Grønn - + Dark Blue Mørk Blå - + Dark Cyan Mørk Cyan - + Dark Magenta Mørk Magenta - + Dark Yellow Mørk Gul @@ -110,12 +105,12 @@ DInputDialog - + Cancel Avbryt - + Confirm Bekreft @@ -123,580 +118,637 @@ DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - Avbryt + Avbryt - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel Avbryt - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut Sett inn en ny snarvei - + None Ingen - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + Bekreft PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result Søk gav ingen resultat - + Restore Defaults Gjenopprett Standard + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Anerkjennelser + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut Skriv inn en ny snarvei @@ -704,44 +756,49 @@ TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help Hjelp - + Feedback - + + + + + Custom toolbar + - + About Om - + Exit Avslutt - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ne.ts dtkwidget-5.6.12/src/translations/dtkwidget_ne.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ne.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ne.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - स्वीकृतिहरू - - - - Version: %1 - संस्करण:% 1 - - - + %1 is released under %2 % 1% 2 अन्तर्गत रिलीज गरिएको छ @@ -22,87 +17,87 @@ DCrumbEdit - + Black कालो - + White सेतो - + Dark Gray गाढा खैरो - + Gray खैरो - + Light Gray हल्का खैरो - + Red रातो - + Green हरियो - + Blue नीलो - + Cyan सायन - + Magenta म्याजेन्टा - + Yellow पहेंलो - + Dark Red गाढा रातो - + Dark Green गाढा हरियो - + Dark Blue गाढा निलो - + Dark Cyan गाढा सियान - + Dark Magenta डार्क म्याजेन्टा - + Dark Yellow गाढा पहेंलो @@ -110,12 +105,12 @@ DInputDialog - + Cancel रद्द गर्नुहोस् - + Confirm निश्चित गर्नुहोस् @@ -123,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut नयाँ सर्टकट प्रविष्ट गर्नुहोस् @@ -131,22 +126,22 @@ DLineEdit - + Stop reading पढ्न रोक्नुहोस् - + Text to Speech टेक्स्ट तु स्पीच - + Translate अनुवाद - + Speech To Text स्पीच तु टेक्स्ट @@ -154,417 +149,422 @@ DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - रद्द गर्नुहोस् + रद्द गर्नुहोस् - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search खोज्नुहोस् @@ -572,17 +572,17 @@ DSettingsDialog - + Cancel रद्द गर्नुहोस् - + Replace बदल्नुहोस् - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately यो सर्टकट% 1 सँग टकराव हुन्छ, यस सर्टकटलाई तुरून्त प्रभावकारी बनाउनको लागि Add मा क्लिक गर्नुहोस् @@ -590,113 +590,165 @@ DShortcutEdit - + Please input a new shortcut कृपया नयाँ सर्टकट इनपुट गर्नुहोस् - + None कुनै पनि होइन - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + पढ्न रोक्नुहोस् - - Maximize - + + Text to Speech + टेक्स्ट तु स्पीच - - Tile window to left of screen - + + Translate + अनुवाद - - Tile window to right of screen - + + Speech To Text + स्पीच तु टेक्स्ट - DTextEdit + DToolbarEditPanel - - Stop reading - पढ्न रोक्नुहोस् + + Default toolset + - - Text to Speech - टेक्स्ट तु स्पीच + + Drag your favorite items into the toolbar + - - Translate - अनुवाद + + Drag below items into the toolbar to restore defaults + - - Speech To Text - स्पीच तु टेक्स्ट + + Confirm + निश्चित गर्नुहोस् PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result कुनै खोजी परिणाम छैन - + Restore Defaults फेरी पहिलाकै अवस्था मा लैजाऊ + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + स्वीकृतिहरू + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut कृपया नयाँ सर्टकट प्रविष्ट गर्नुहोस् @@ -704,44 +756,49 @@ TitleBarMenu - + Theme थेम - + Light Theme लाईट थेम - + Dark Theme दर्क थेम - + System Theme सिस्टम थेम - + Help मद्दत - + Feedback - + + + + + Custom toolbar + - + About बारेमा - + Exit बाहिर निस्कनुहोस् - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_nl.ts dtkwidget-5.6.12/src/translations/dtkwidget_nl.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_nl.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_nl.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Erkenningen - - - - Version: %1 - Versie: %1 - - - + %1 is released under %2 %1 is uitgebracht onder de %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Zwart - + White Wit - + Dark Gray Donkergrijs - + Gray Grijs - + Light Gray Lichtgrijs - + Red Rood - + Green Groen - + Blue Blauw - + Cyan Groenblauw - + Magenta Magenta - + Yellow Geel - + Dark Red Donkerrood - + Dark Green Donkergroen - + Dark Blue Donkerblauw - + Dark Cyan Donkergroenblauw - + Dark Magenta Donkermagenta - + Dark Yellow Donkergeel @@ -108,12 +105,12 @@ DInputDialog - + Cancel Annuleren - + Confirm Oké @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Druk op een nieuwe sneltoets @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Stoppen met voorlezen - + Text to Speech Tekst-naar-spraak - + Translate Vertalen - + Speech To Text Spraak-naar-tekst @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Geavanceerd - + Cancel button Annuleren - - + + Print button Afdrukken - + Basic Algemeen - + Printer Printer - + Copies Aantal kopieën - + Page range Paginabereik - + All Alle - + Current page Huidige pagina - + Select pages Bepaalde pagina's - + Orientation Oriëntatie - + Portrait Verticaal - + Landscape Horizontaal - + Pages Pagina's - + Color mode Kleurmodus - - - + + + + + Color Kleur - - - + + + Grayscale Grijswaarden - + Margins Marges - + Narrow (mm) Smal (mm) - + Normal (mm) Normaal (mm) - + Moderate (mm) Redelijk smal (mm) - + Customize (mm) Aangepast (mm) - + Top Bovenkant - + Left Linkerkant - + Bottom Onderkant - + Right Rechterkant - + Scaling Grootte - + Actual size Ware grootte - + Scale Schaal - + Paper Papier - + Paper size Papiergrootte - + Print Layout Afdrukindeling - + Duplex Duplex - + N-up printing N-omhoog afdrukken - + 2 pages/sheet, 1×2 2 pagina's/vellen, 1x2 - + 4 pages/sheet, 2×2 4 pagina's/vellen, 2x2 - + 6 pages/sheet, 2×3 6 pagina's/vellen, 2x3 - + 9 pages/sheet, 3×3 9 pagina's/vellen, 3x3 - + 16 pages/sheet, 4×4 16 pagina's/vellen, 4x4 - + Layout direction Indelingsrichting - + Page Order Paginavolgorde - + Collate pages Pagina's bundelen - + Print pages in order Pagina's op volgorde afdrukken - + Front to back Voor-naar-achter - + Back to front Achter-naar-voor - + Watermark Watermerk - + Add watermark Watermerk toevoegen - + Text watermark Tekstwatermerk - + Confidential Vertrouwelijk - + Draft Concept - + Sample Voorbeeld - + Custom Aangepast - + Input your text Voer hier tekst in - + Picture watermark Afbeeldingswatermerk - + Layout Indeling - + Tile Tegels - + Center Centreren - + Angle Hoek - + Size Afmetingen - + Transparency Doorzichtigheid - + + Print to PDF Afdrukken naar pdf - + + Save as Image Opslaan als afbeelding - + Collapse Inklappen - - + + Flip on short edge Omdraaien aan korte zijde - - + + + Flip on long edge Omdraaien aan lange zijde - + Input page numbers please Voer de paginanummers in - + Maximum page number reached Het maximale pagina-aantal is bereikt - + Input English comma please Voer een Europese komma in - + Input page numbers like this: 1,3,5-7,11-15,18,21 Voer de paginanummers als volgt in: 1,3,5-7,11-15,18,21 - + Save button Opslaan - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Voorbeeld: 1,3,5-7,11-15,18,21 - + Save as PDF Opslaan als pdf-bestand - + Save as image Opslaan als afbeelding - + Images Afbeeldingen @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Vertrouwelijk - - + + Draft Concept - - + + Sample Voorbeeld @@ -562,7 +564,7 @@ DSearchEdit - + Search Zoeken @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Annuleren - + Replace Vervangen - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Deze sneltoets is al in gebruik voor ‘%1’. Klik op ‘Toevoegen’ om déze sneltoets toe te wijzen. @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Druk op een nieuwe sneltoets - + None Geen - DSplitScreenWidget + DTextEdit - - Unmaximize - De-maximaliseren + + Stop reading + Stoppen met voorlezen - - Maximize - Maximaliseren + + Text to Speech + Tekst-naar-spraak - - Tile window to left of screen - Venster tegelen aan linkerkant + + Translate + Vertalen - - Tile window to right of screen - Venster tegelen aan rechterkant + + Speech To Text + Spraak-naar-tekst - DTextEdit + DToolbarEditPanel - - Stop reading - Stoppen met voorlezen + + Default toolset + Standaard gereedschapsset - - Text to Speech - Tekst-naar-spraak + + Drag your favorite items into the toolbar + Sleep je favoriete items naar de werkbalk - - Translate - Vertalen + + Drag below items into the toolbar to restore defaults + Sleep onderstaande items naar de werkbalk om de standaardwaarden te herstellen - - Speech To Text - Spraak-naar-tekst + + Confirm + Bevestigen PickColorWidget - + Color Kleur @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Kopiëren - + Cu&t Kni&ppen - + Select All Alles selecteren @@ -673,20 +675,72 @@ QObject - + No search result Geen zoekresultaten - + Restore Defaults Standaardwaarden herstellen + + + Version + Versie + + + + Features + Kenmerken + + + + Homepage + Website + + + + Description + Beschrijving + + + + Acknowledgements + Kennisgeving + + + + + + Sincerely appreciate the open-source software used. + Maak dankbaar gebruik van opensourcesoftware. + + + + open-source software + opensourcesoftware + + + + Continue + Doorgaan + + + + Learn More + Meer informatie + + + + Credits + Met dank aan + QWidgetTextControl - + Select All Alles selecteren @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Druk op een nieuwe sneltoets @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Thema - + Light Theme Licht thema - + Dark Theme Donker thema - + System Theme Systeemthema - + Help Hulp - + Feedback - + Feedback + + + + Custom toolbar + Aangepaset werkbalk - + About Over - + Exit Afsluiten diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_pam.ts dtkwidget-5.6.12/src/translations/dtkwidget_pam.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_pam.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_pam.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_pl.ts dtkwidget-5.6.12/src/translations/dtkwidget_pl.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_pl.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_pl.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,119 +1,116 @@ + + + DAboutDialog - - Acknowledgements - Podziękowania - - - - Version: %1 - Wersja: %1 - - - + %1 is released under %2 - %1 zostało wydane w oparciu o %2 + %1 został wydany na licencji %2 DCrumbEdit - + Black Czarny - + White Biały - + Dark Gray - Ciemnoszary + Ciemny szary - + Gray Szary - + Light Gray - Jasnoszary + Jasny szary - + Red Czerwony - + Green Zielony - + Blue Niebieski - + Cyan Turkusowy - + Magenta Purpurowy - + Yellow Żółty - + Dark Red - Ciemnoczerwony + Ciemny czerwony - + Dark Green - Ciemnozielony + Ciemny zielony - + Dark Blue - Ciemnoniebieski + Ciemny niebieski - + Dark Cyan - Ciemnoturkusowy + Ciemny turkus - + Dark Magenta - Ciemnopurpurowy + Ciemny purpurowy - + Dark Yellow - Ciemnożółty + Ciemny żółty DInputDialog - + Cancel Anuluj - + Confirm Potwierdź @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Wprowadź nowy skrót @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Przestań czytać - + Text to Speech Tekst na mowę - + Translate Przetłumacz - + Speech To Text Mowa na tekst @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Zaawansowane - + Cancel button Anuluj - - + + Print button Drukuj - + Basic - Podstawowy + Podstawowe - + Printer Drukarka - + Copies Kopie - + Page range Zakres stron - + All Wszystkie - + Current page Bieżąca strona - + Select pages Wybierz strony - + Orientation Orientacja - + Portrait Pionowo - + Landscape Poziomo - + Pages Strony - + Color mode Tryb koloru - - - + + + + + Color Kolor - - - + + + Grayscale Odcienie szarości - + Margins Marginesy - + Narrow (mm) - Wąskie(mm) + Wąskie (mm) - + Normal (mm) - Normalny(mm) + Standardowe (mm) - + Moderate (mm) - Umiarkowany(mm) + Umiarkowane (mm) - + Customize (mm) - Dostosuj(mm) + Dostosuj (mm) - + Top Góra - + Left - Lewa + Lewo - + Bottom Dół - + Right - Prawa + Prawo - + Scaling Skalowanie - + Actual size - Rzeczywisty rozmiar + Rozmiar rzeczywisty - + Scale Skala - + Paper Papier - + Paper size Rozmiar papieru - + Print Layout - Wygląd wydruku + Układ wydruku - + Duplex Dupleks - + N-up printing Drukowanie N-up - + 2 pages/sheet, 1×2 2 strony/kartka, 1x2 - + 4 pages/sheet, 2×2 4 strony/kartka, 2x2 - + 6 pages/sheet, 2×3 6 strony/kartka, 2x3 - + 9 pages/sheet, 3×3 9 stron/kartka, 3x3 - + 16 pages/sheet, 4×4 16 stron/kartka, 4x4 - + Layout direction Kierunek układu - + Page Order Kolejność stron - + Collate pages Zestaw strony ze sobą - + Print pages in order Drukuj strony w kolejności - + Front to back Od przodu do tyłu - + Back to front Od tyłu do przodu - + Watermark Znak wodny - + Add watermark Dodaj znak wodny - + Text watermark Tekst jako znak wodny - + Confidential Poufne - + Draft - Wersja Robocza + Wersja robocza - + Sample Próbka - + Custom Niestandardowe - + Input your text Wprowadź swój tekst - + Picture watermark - Obraz jako znak wodny + Zdjęcie jako znak wodny - + Layout Układ - + Tile - Płytka + Kafelki - + Center - Centrum + Środek - + Angle Kąt - + Size Rozmiar - + Transparency Przezroczystość - + + Print to PDF Drukuj do PDF - + + Save as Image Zapisz jako obraz - + Collapse - Połącz + Zwiń - - + + Flip on short edge - Odwróć krótszą krawędź + Odwróć wzdłuż krótszej krawędzi - - + + + Flip on long edge - Przerzuć wzdłuż długiej krawędzi + Odwróć wzdłuż dłuższej krawędzi - + Input page numbers please Wprowadź numery stron - + Maximum page number reached - Maksymalna liczba stron osiągnięta + Osiągnięto maksymalną liczbę stron - + Input English comma please Wprowadź Angielski przecinek - + Input page numbers like this: 1,3,5-7,11-15,18,21 Wprowadź numery stron w ten sposób: 1,3,5-7,11-15,18,21 - + Save button Zapisz - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Na przykład, 1,3,5-7,11-15,18,21 - + Save as PDF Zapisz jako PDF - + Save as image Zapisz jako obraz - + Images Obrazy @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Poufne - - + + Draft - Wersja Robocza + Wersja robocza - - + + Sample Próbka @@ -562,7 +564,7 @@ DSearchEdit - + Search Szukaj @@ -570,84 +572,84 @@ DSettingsDialog - + Cancel Anuluj - + Replace Zmień - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - Ten skrót powoduje konflikt z %1, kliknij Dodaj, aby skrót zadziałał od razu + Ten skrót jest w konflikcie z %1, kliknij Dodaj, aby go nadpisać DShortcutEdit - + Please input a new shortcut - Prosimy wprowadzić nowy skrót + Wprowadź nowy skrót - + None Brak - DSplitScreenWidget + DTextEdit - - Unmaximize - Normalizuj + + Stop reading + Przestań czytać - - Maximize - Maksymalizuj + + Text to Speech + Tekst na mowę - - Tile window to left of screen - Przypnij okno do lewej części ekranu + + Translate + Przetłumacz - - Tile window to right of screen - Przypnij okno do prawej części ekranu + + Speech To Text + Mowa na tekst - DTextEdit + DToolbarEditPanel - - Stop reading - Przestań czytać + + Default toolset + Domyślny pasek narzędzi - - Text to Speech - Tekst na mowę + + Drag your favorite items into the toolbar + Przeciągnij ulubione przedmioty na pasek narzędzi - - Translate - Przetłumacz + + Drag below items into the toolbar to restore defaults + Przeciągnij przedmioty poniżej na pasek narzędzi, aby przywrócić ustawienie domyślne - - Speech To Text - Mowa na tekst + + Confirm + Potwierdź PickColorWidget - + Color Kolor @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Kopiuj - + Cu&t Cu&t - + Select All Zaznacz wszystko @@ -673,20 +675,72 @@ QObject - + No search result Brak wyników wyszukiwania - + Restore Defaults Przywróć domyślne + + + Version + Wersja + + + + Features + Funkcje + + + + Homepage + Strona główna + + + + Description + Opis + + + + Acknowledgements + Podziękowania + + + + + + Sincerely appreciate the open-source software used. + Szczere podziękowania dla użytego oprogramowania open-source. + + + + open-source software + oprogramowanie open-source + + + + Continue + Kontynuuj + + + + Learn More + Dowiedz się więcej + + + + Credits + Zasługi + QWidgetTextControl - + Select All Zaznacz wszystko @@ -694,50 +748,55 @@ ShortcutEdit - + Please enter a new shortcut - Prosimy wprowadzić nowy skrót + Wprowadź nowy skrót TitleBarMenu - + Theme Motyw - + Light Theme Jasny - + Dark Theme Ciemny - + System Theme Systemowy - + Help Pomoc - + Feedback - + Opinia użytkownika + + + + Custom toolbar + Niestandardowy pasek narzędzi - + About O programie - + Exit Wyjdź diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_pt_BR.ts dtkwidget-5.6.12/src/translations/dtkwidget_pt_BR.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_pt_BR.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_pt_BR.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Agradecimentos - - - - Version: %1 - Versão: %1 - - - + %1 is released under %2 %1 é lançado em %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Preto - + White Branco - + Dark Gray Cinza Escuro - + Gray Cinza - + Light Gray Cinza Claro - + Red Vermelho - + Green Verde - + Blue Azul - + Cyan Ciano - + Magenta Magenta - + Yellow Amarelo - + Dark Red Vermelho Escuro - + Dark Green Verde Escuro - + Dark Blue Azul Escuro - + Dark Cyan Ciano Escuro - + Dark Magenta Magenta Escuro - + Dark Yellow Amarelo Escuro @@ -108,12 +105,12 @@ DInputDialog - + Cancel Cancelar - + Confirm Confirmar @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Insira um novo atalho @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Parar de ler - + Text to Speech Texto em Voz - + Translate Traduzir - + Speech To Text Voz em Texto @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Avançado - + Cancel button Cancelar - - + + Print button Imprimir - + Basic Básico - + Printer Impressora - + Copies Cópias - + Page range Intervalo de páginas - + All Tudo - + Current page Página atual - + Select pages Selecionar páginas - + Orientation Orientação - + Portrait Retrato - + Landscape Paisagem - + Pages Páginas - + Color mode Modo de cores - - - + + + + + Color Cor - - - + + + Grayscale Escala cinza - + Margins Margens - + Narrow (mm) Estreita (mm) - + Normal (mm) Normal (mm) - + Moderate (mm) Moderada (mm) - + Customize (mm) Personalizada (mm) - + Top Superior - + Left Esquerda - + Bottom Inferior - + Right Direita - + Scaling Escala - + Actual size Tamanho atual - + Scale Escala - + Paper Papel - + Paper size Tamanho do papel - + Print Layout Layout de Impressão - + Duplex Duplex - + N-up printing Impressão N-up - + 2 pages/sheet, 1×2 2 páginas/folha, 1×2 - + 4 pages/sheet, 2×2 4 páginas/folha, 2×2 - + 6 pages/sheet, 2×3 6 páginas/folha, 2×3 - + 9 pages/sheet, 3×3 9 páginas/folha, 3×3 - + 16 pages/sheet, 4×4 16 páginas/folha, 4×4 - + Layout direction Orientação do layout - + Page Order Ordem das Páginas - + Collate pages Agrupar páginas - + Print pages in order Imprimir páginas em ordem - + Front to back De frente para trás - + Back to front De trás para frente - + Watermark Marca d'água - + Add watermark Adicionar marca d'água - + Text watermark Marca d'água de texto - + Confidential Confidencial - + Draft Rascunho - + Sample Amostra - + Custom Personalizado - + Input your text Insira o texto - + Picture watermark Marca d'água de imagem - + Layout Layout - + Tile Ladrilho - + Center Centro - + Angle Ângulo - + Size Tamanho - + Transparency Transparência - + + Print to PDF Imprimir em PDF - + + Save as Image Salvar como Imagem - + Collapse Recolher - - + + Flip on short edge Virar na borda curta - - + + + Flip on long edge Virar na borda longa - + Input page numbers please Insira o números de páginas - + Maximum page number reached O número máximo de páginas foi atingido - + Input English comma please Insira uma vírgula - + Input page numbers like this: 1,3,5-7,11-15,18,21 Insira os números das páginas assim: 1, 3, 5-7, 11-15, 18, 21 - + Save button Salvar - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Por exemplo: 1, 3, 5-7, 11-15, 18, 21 - + Save as PDF Salvar como PDF - + Save as image Salvar como imagem - + Images Imagens @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Confidencial - - + + Draft Rascunho - - + + Sample Amostra @@ -562,7 +564,7 @@ DSearchEdit - + Search Pesquisar @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Cancelar - + Replace Substituir - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Este atalho entra em conflito com %1; clique em Adicionar para efetivar este atalho @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Insira um novo atalho - + None Nenhum - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Parar de ler - - Maximize - + + Text to Speech + Texto em Voz - - Tile window to left of screen - + + Translate + Traduzir - - Tile window to right of screen - + + Speech To Text + Voz em Texto - DTextEdit + DToolbarEditPanel - - Stop reading - Parar de ler + + Default toolset + - - Text to Speech - Texto em Voz + + Drag your favorite items into the toolbar + - - Translate - Traduzir + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Voz em Texto + + Confirm + Confirmar PickColorWidget - + Color Cor @@ -655,17 +657,17 @@ QLineEdit - + &Copy - + &Copiar - + Cu&t - + Recor&tar - + Select All Selecionar Tudo @@ -673,20 +675,72 @@ QObject - + No search result Nenhum resultado - + Restore Defaults Restaurar Padrões + + + Version + Versão + + + + Features + Recursos + + + + Homepage + Página na Internet + + + + Description + Descrição + + + + Acknowledgements + Agradecimentos + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + Continuar + + + + Learn More + Aprenda Mais + + + + Credits + + QWidgetTextControl - + Select All Selecionar Tudo @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Insira um novo atalho @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Tema - + Light Theme Claro - + Dark Theme Escuro - + System Theme Padrão - + Help Ajuda - + Feedback + Opinião + + + + Custom toolbar - + About Sobre - + Exit Sair diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_pt.ts dtkwidget-5.6.12/src/translations/dtkwidget_pt.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_pt.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_pt.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Agradecimentos - - - - Version: %1 - Versão: %1 - - - + %1 is released under %2 %1 é lançado sob %2 @@ -20,100 +17,100 @@ DCrumbEdit - + Black Preto - + White Branco - + Dark Gray - Cinzento Escuro + Cinzento escuro - + Gray Cinzento - + Light Gray - Cinzento Claro + Cinzento claro - + Red Vermelho - + Green Verde - + Blue Azul - + Cyan Ciano - + Magenta Magenta - + Yellow Amarelo - + Dark Red - Vermelho Escuro + Vermelho escuro - + Dark Green - Verde Escuro + Verde escuro - + Dark Blue - Azul Escuro + Azul escuro - + Dark Cyan - Ciano Escuro + Ciano escuro - + Dark Magenta - Magenta Escuro + Magenta escuro - + Dark Yellow - Amarelo Escuro + Amarelo escuro DInputDialog - + Cancel Cancelar - + Confirm Confirmar @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Inserir um novo atalho @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Parar a leitura - + Text to Speech Texto para Voz - + Translate Traduzir - + Speech To Text Voz para Texto @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Avançado - + Cancel button Cancelar - - + + Print button Imprimir - + Basic Básico - + Printer Impressora - + Copies Cópias - + Page range Intervalo de páginas - + All Tudo - + Current page Pagina atual - + Select pages Selecionar páginas - + Orientation Orientação - + Portrait Retrato - + Landscape Paisagem - + Pages Páginas - + Color mode Modo de cor - - - + + + + + Color Cor - - - + + + Grayscale Escala de cinzentos - + Margins Margens - + Narrow (mm) Estreita (mm) - + Normal (mm) Normal (mm) - + Moderate (mm) Moderada (mm) - + Customize (mm) Personalizada (mm) - + Top Superior - + Left Esquerda - + Bottom Inferior - + Right Direita - + Scaling Dimensionamento - + Actual size Tamanho atual - + Scale Escala - + Paper Papel - + Paper size Tamanho do papel - + Print Layout Esquema de impressão - + Duplex Frente e Verso - + N-up printing Impressão N-up - + 2 pages/sheet, 1×2 2 páginas/folha, 1×2 - + 4 pages/sheet, 2×2 4 páginas/folha, 2×2 - + 6 pages/sheet, 2×3 6 páginas/folha, 2×3 - + 9 pages/sheet, 3×3 9 páginas/folha, 3×3 - + 16 pages/sheet, 4×4 16 páginas/folha, 4×4 - + Layout direction Direção do esquema - + Page Order Ordem das páginas - + Collate pages Agrupar páginas - + Print pages in order Imprimir páginas por ordem - + Front to back De frente para trás - + Back to front De trás para a frente - + Watermark Marca d'água - + Add watermark Adicionar marca d'água - + Text watermark Marca d'água de texto - + Confidential Confidencial - + Draft Rascunho - + Sample Exemplo - + Custom Personalizada - + Input your text Introduza o seu texto - + Picture watermark Marca d'água de imagem - + Layout Esquema - + Tile Mosaico - + Center Centro - + Angle Ângulo - + Size Tamanho - + Transparency Transparência - + + Print to PDF Imprimir para PDF - + + Save as Image Guardar como imagem - + Collapse Recolher - - + + Flip on short edge Virar na margem curta - - + + + Flip on long edge Virar na margem comprida - + Input page numbers please Introduza os números da página - + Maximum page number reached Número máximo de páginas atingido - + Input English comma please Introduza a vírgula inglesa - + Input page numbers like this: 1,3,5-7,11-15,18,21 Introduza números de páginas assim: 1,3,5-7,11-15,18,21 - + Save button Guardar - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Por exemplo, 1,3,5-7,11-15,18,21 - + Save as PDF Guardar como PDF - + Save as image Guardar como imagem - + Images Imagens @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Confidencial - - + + Draft Rascunho - - + + Sample Exemplo @@ -562,7 +564,7 @@ DSearchEdit - + Search Pesquisar @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Cancelar - + Replace Substituir - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Esse atalho entra em conflito com %1, clique em "Adicionar" para aplicar este atalho imediatamente @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Introduza um novo atalho - + None Nenhum - DSplitScreenWidget + DTextEdit - - Unmaximize - Repor + + Stop reading + Parar a leitura - - Maximize - Maximizar + + Text to Speech + Texto para Voz - - Tile window to left of screen - Agrupar janela à esquerda do ecrã + + Translate + Traduzir - - Tile window to right of screen - Agrupar janela à direita do ecrã + + Speech To Text + Voz para Texto - DTextEdit + DToolbarEditPanel - - Stop reading - Parar a leitura + + Default toolset + - - Text to Speech - Texto para Voz + + Drag your favorite items into the toolbar + - - Translate - Traduzir + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Voz para Texto + + Confirm + Confirmar PickColorWidget - + Color Cor @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Copiar - + Cu&t Cor&tar - + Select All Selecionar tudo @@ -673,20 +675,72 @@ QObject - + No search result Nenhum resultado da pesquisa - + Restore Defaults - Restaurar Predefinições + Restaurar predefinições + + + + Version + Versão + + + + Features + Funcionalidades + + + + Homepage + Página inicial + + + + Description + Descrição + + + + Acknowledgements + Agradecimentos + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + Continuar + + + + Learn More + Saiba mais + + + + Credits + QWidgetTextControl - + Select All Selecionar tudo @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Introduza um novo atalho @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Tema - + Light Theme - Tema Claro + Tema claro - + Dark Theme - Tema Escuro + Tema escuro - + System Theme - Tema do Sistema + Tema do sistema - + Help Ajuda - + Feedback + Feedback + + + + Custom toolbar - + About Sobre - + Exit Sair diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ro.ts dtkwidget-5.6.12/src/translations/dtkwidget_ro.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ro.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ro.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Mulțumiri - - - - Version: %1 - Versiunea: %1 - - - + %1 is released under %2 %1 este lansat ca %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Negru - + White Alb - + Dark Gray Gri închis - + Gray Gri - + Light Gray Gri deschis - + Red Roșu - + Green Verde - + Blue Albastru - + Cyan Cyan - + Magenta Purpuriu - + Yellow Galben - + Dark Red Roșu închis - + Dark Green Verde închis - + Dark Blue Albastru închis - + Dark Cyan Cyan închis - + Dark Magenta Purpuriu închis - + Dark Yellow Galben închis @@ -108,12 +105,12 @@ DInputDialog - + Cancel Anulare - + Confirm Confirmare @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Introduceți o nouă comandă scurtă @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Stopare citire - + Text to Speech Pronunțare text - + Translate Traducere - + Speech To Text Transformare vocei în text @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Avansat - + Cancel button Anulare - - + + Print button Printare - + Basic De bază - + Printer Imprimantă - + Copies Copii - + Page range Interval de pagini - + All Tot - + Current page Pagina curentă - + Select pages Selectați paginile - + Orientation Orientare - + Portrait Portret - + Landscape Peisaj - + Pages Paginile - + Color mode Mod culoare - - - + + + + + Color Culoare - - - + + + Grayscale Balanța gri - + Margins Margini - + Narrow (mm) Îngust (mm) - + Normal (mm) Normal (mm) - + Moderate (mm) Moderat (mm) - + Customize (mm) Personalizat (mm) - + Top Sus - + Left Stânga - + Bottom Jos - + Right Dreapta - + Scaling Scalare - + Actual size Mărimea actuală - + Scale Scară - + Paper Foaie - + Paper size Mărimea foii - + Print Layout Aspect imprimare - + Duplex Duplex - + N-up printing N-up printare - + 2 pages/sheet, 1×2 2 pagini/foaie, 1×2 - + 4 pages/sheet, 2×2 4 pagini/foaie, 2×2 - + 6 pages/sheet, 2×3 6 pagini/foaie, 2×3 - + 9 pages/sheet, 3×3 9 pagini/foaie, 3×3 - + 16 pages/sheet, 4×4 16 pagini/foaie, 4×4 - + Layout direction Direcție aspect - + Page Order Ordonarea paginii - + Collate pages Pagini asociate - + Print pages in order Imprimarea paginilor în ordinea - + Front to back Față - spate - + Back to front Spate - față - + Watermark Filigran - + Add watermark Adăugare filigran - + Text watermark Filigran în text - + Confidential Confidențial - + Draft Schiță - + Sample Probă - + Custom Personalizat - + Input your text Introduceți textul dvs. - + Picture watermark Filigran desen - + Layout Aspect - + Tile Acoperire - + Center Centru - + Angle Unghi - + Size Mărime - + Transparency Transparență - + + Print to PDF Imprimare în PDF - + + Save as Image Salvați ca imagine - + Collapse Micșorare - - + + Flip on short edge De-a lungul marginii scurte - - + + + Flip on long edge De-a lungul marginii lungi - + Input page numbers please Introduceți numere de pagini - + Maximum page number reached A fost atins numărul maxim de pagini - + Input English comma please Introduceți, vă rog, virgula englezească - + Input page numbers like this: 1,3,5-7,11-15,18,21 Introduceți numere de pagini în acest mod: 1,3,5-7,11-15,18,21 - + Save button Salvare - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 De exemplu, 1,3,5-7,11-15,18,21 - + Save as PDF Salvați în format PDF - + Save as image Salvați ca imagine - + Images Imagini @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Confidențial - - + + Draft Schiță - - + + Sample Exemplar @@ -562,7 +564,7 @@ DSearchEdit - + Search Căutare @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Anulare - + Replace Substituire - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Această comandă rapidă intră în conflict cu %1, apăsați Adăugare pentru a face această comandă rapidă una efectivă în mod imediat @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Introduceți, vă rog, o nouă comandă rapidă - + None Nici unul - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Stopare citire - - Maximize - + + Text to Speech + Pronunțare text - - Tile window to left of screen - + + Translate + Traducere - - Tile window to right of screen - + + Speech To Text + Transformare vocei în text - DTextEdit + DToolbarEditPanel - - Stop reading - Stopare citire + + Default toolset + - - Text to Speech - Pronunțare text + + Drag your favorite items into the toolbar + - - Translate - Traducere + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Transformare vocei în text + + Confirm + Confirmare PickColorWidget - + Color Culoare @@ -655,17 +657,17 @@ QLineEdit - + &Copy - + Cu&t - + Select All Selectați tot @@ -673,20 +675,72 @@ QObject - + No search result Căutare nu a dat rezultat - + Restore Defaults Restabilirea sătărilor de bază + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Mulțumiri + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All Selectați tot @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Introduceți o nouă comandă rapidă @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Temă - + Light Theme Temă culoare deschisă - + Dark Theme Temă culoare întunecată - + System Theme Temă de sistem - + Help Ajutor - + Feedback - + + Custom toolbar + + + + About Despre - + Exit Ieșire diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ru.ts dtkwidget-5.6.12/src/translations/dtkwidget_ru.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ru.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ru.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Выражение признательности - - - - Version: %1 - Версия: %1 - - - + %1 is released under %2 %1 выпущен под %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Черный - + White Белый - + Dark Gray Темно-Серый - + Gray Серый - + Light Gray Светло-Серый - + Red Красный - + Green Зеленый - + Blue Синий - + Cyan Голубой - + Magenta Пурпурный - + Yellow Желтый - + Dark Red Темно-Красный - + Dark Green Темно-Зеленый - + Dark Blue Темно-Синий - + Dark Cyan Темно-Голубой - + Dark Magenta Темно-Пурпурный - + Dark Yellow Темно-Желтый @@ -108,12 +105,12 @@ DInputDialog - + Cancel Отмена - + Confirm Подтвердить @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Введите новое сочетание клавиш @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Прекращение чтения - + Text to Speech Преобразование текста в речь - + Translate Перевод - + Speech To Text Преобразование речи в текст @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Продвинутый - + Cancel button Отмена - - + + Print button Печать - + Basic Основной - + Printer Принтер - + Copies Копии - + Page range Диапазон страницы - + All Все - + Current page Текущая страница - + Select pages Выбрать страницы - + Orientation Ориентация - + Portrait Портрет - + Landscape Ландшафт - + Pages Страницы - + Color mode Цветовой режим - - - + + + + + Color Цвет - - - + + + Grayscale Градация серого - + Margins Поля - + Narrow (mm) Узкий (мм) - + Normal (mm) Обычный (мм) - + Moderate (mm) Умеренный (мм) - + Customize (mm) Настроить (мм) - + Top Верх - + Left Лево - + Bottom Низ - + Right Право - + Scaling Масштабирование - + Actual size Текущий размер - + Scale Масштаб - + Paper Бумага - + Paper size Размер бумаги - + Print Layout Макет Печати - + Duplex Двойной - + N-up printing Печать N-страниц - + 2 pages/sheet, 1×2 2 страницы/лист, 1х2 - + 4 pages/sheet, 2×2 4 страниц/лист, 2х2 - + 6 pages/sheet, 2×3 6 страниц/лист, 2х3 - + 9 pages/sheet, 3×3 9 страниц/лист, 3х3 - + 16 pages/sheet, 4×4 16 страниц/лист, 4х4 - + Layout direction Направление макета - + Page Order Порядок страниц - + Collate pages Сопоставление страниц - + Print pages in order Печать страниц согласно порядку - + Front to back С лицевой стороны обратно - + Back to front С обратной стороны на лицевую - + Watermark Водяной знак - + Add watermark Добавить водяной знак - + Text watermark Водяной знак на тексте - + Confidential Конфиденциально - + Draft Черновик - + Sample Пример - + Custom Настройка - + Input your text Введите текст - + Picture watermark Изображение водяного знака - + Layout Макет - + Tile Покрыть - + Center Центр - + Angle Угол - + Size Размер - + Transparency Прозрачность - + + Print to PDF Печать в PDF - + + Save as Image Сохранить как изображение - + Collapse Свернуть - - + + Flip on short edge Отразить по короткому краю - - + + + Flip on long edge Отразить по длинному краю - + Input page numbers please Пожалуйста, введите номера страниц - + Maximum page number reached Достигнуто максимальное количество страниц - + Input English comma please Пожалуйста, введите английскую запятую - + Input page numbers like this: 1,3,5-7,11-15,18,21 Введите номера страниц следующим образом: 1,3,5-7,11-15,18,21 - + Save button Сохранить - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Например, 1,3,5-7,11-15,18,21 - + Save as PDF Сохранить в PDF - + Save as image Сохранить как изображение - + Images Изображения @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Конфиденциально - - + + Draft Черновик - - + + Sample Пример @@ -562,7 +564,7 @@ DSearchEdit - + Search Поиск @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Отмена - + Replace Заменить - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Выбранное сочетание клавиш конфликтует с %1, нажмите Добавить, чтобы применить данное сочетание @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Пожалуйста введите новое сочетание - + None Ничего - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Прекращение чтения - - Maximize - + + Text to Speech + Преобразование текста в речь - - Tile window to left of screen - + + Translate + Перевод - - Tile window to right of screen - + + Speech To Text + Преобразование речи в текст - DTextEdit + DToolbarEditPanel - - Stop reading - Прекращение чтения + + Default toolset + - - Text to Speech - Преобразование текста в речь + + Drag your favorite items into the toolbar + - - Translate - Перевод + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Преобразование речи в текст + + Confirm + Подтвердить PickColorWidget - + Color Цвет @@ -655,17 +657,17 @@ QLineEdit - + &Copy - + &Копировать - + Cu&t - + В&ырезать - + Select All Выбрать все @@ -673,20 +675,72 @@ QObject - + No search result Поиск не дал результатов - + Restore Defaults Восстановить значения По-умолчанию + + + Version + Версия + + + + Features + Функции + + + + Homepage + Домашняя страница + + + + Description + Описание + + + + Acknowledgements + Выражение признательности + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + Продолжить + + + + Learn More + Узнать больше + + + + Credits + + QWidgetTextControl - + Select All Выбрать все @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Пожалуйста введите новое сочетание @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Тема - + Light Theme Светлая Тема - + Dark Theme Темная Тема - + System Theme Тема Системы - + Help Помощь - + Feedback + Отправить отзыв + + + + Custom toolbar - + About О программе - + Exit Выход diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_sc.ts dtkwidget-5.6.12/src/translations/dtkwidget_sc.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_sc.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_sc.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_si.ts dtkwidget-5.6.12/src/translations/dtkwidget_si.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_si.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_si.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + කළු - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_sk.ts dtkwidget-5.6.12/src/translations/dtkwidget_sk.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_sk.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_sk.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,15 @@ - - - + + + + DAboutDialog - - Acknowledgements - Poďakovanie - - - - Version: %1 - Verzia: %1 - - - + %1 is released under %2 %1 je vydaná pod %2 @@ -22,87 +17,87 @@ DCrumbEdit - + Black Čierna - + White Biela - + Dark Gray Tmavosivá - + Gray Sivá - + Light Gray Svetlosivá - + Red Červená - + Green Zelená - + Blue Modrá - + Cyan Tyrkysová - + Magenta Purpurová - + Yellow Žltá - + Dark Red Tmavočervená - + Dark Green Tmavozelená - + Dark Blue Tmavomodrá - + Dark Cyan Tmavotyrkysová - + Dark Magenta Tmavopurpurová - + Dark Yellow Tmavožltá @@ -110,12 +105,12 @@ DInputDialog - + Cancel Zrušiť - + Confirm Potvrdiť @@ -123,580 +118,637 @@ DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - Zrušiť + Zrušiť - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel Zrušiť - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut Prosím zadajte novú skratku - + None Nič - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + Potvrdiť PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result Žiadny výsledok vyhľadávania - + Restore Defaults Obnoviť predvolené nastavenia + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Poďakovanie + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut Zadajte novú skratku @@ -704,44 +756,49 @@ TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help Pomoc - + Feedback - + + + + + Custom toolbar + - + About O - + Exit Ukončiť - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_sl.ts dtkwidget-5.6.12/src/translations/dtkwidget_sl.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_sl.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_sl.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Zasluge - - - - Version: %1 - Različica: %1 - - - + %1 is released under %2 %1 je izdana pod %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Črna - + White Bela - + Dark Gray Temno siva - + Gray Siva - + Light Gray Svetlo siva - + Red Rdeča - + Green Zelena - + Blue Modra - + Cyan Cian - + Magenta Škrlatna - + Yellow Rumena - + Dark Red Temno rdeča - + Dark Green Temno zelena - + Dark Blue Temno modra - + Dark Cyan Temna cijan - + Dark Magenta Temna škrlatna - + Dark Yellow Temno rumena @@ -108,12 +105,12 @@ DInputDialog - + Cancel Prekliči - + Confirm Potrdi @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Določite novo bližnjico @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Zaustavi branje - + Text to Speech Besedilo v govor - + Translate Prevedi - + Speech To Text Govor v besedilo @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Napredno - + Cancel button Prekliči - - + + Print button Tiskaj - + Basic Osnovno - + Printer Tiskalnik - + Copies Kopije - + Page range Obseg strani - + All vse - + Current page trenutna stran - + Select pages izbor strani - + Orientation Orientacija - + Portrait pokončno - + Landscape ležeče - + Pages Strani - + Color mode Barvni način - - - + + + + + Color Barvno - - - + + + Grayscale Sivo - + Margins Robovi - + Narrow (mm) Ozko (mm) - + Normal (mm) Navadno (mm) - + Moderate (mm) Zmerno (mm) - + Customize (mm) Prilagodi (mm) - + Top Zgoraj - + Left Levo - + Bottom Spodaj - + Right Desno - + Scaling Povečava - + Actual size Dejanska velikost - + Scale Merilo - + Paper paipr - + Paper size Velikost papirja - + Print Layout Razporeditev tiskanja - + Duplex Dvostransko - + N-up printing N-na list - + 2 pages/sheet, 1×2 2 strani/list, 1×2 - + 4 pages/sheet, 2×2 4 strani/list, 2×2 - + 6 pages/sheet, 2×3 6 strani/list, 2×3 - + 9 pages/sheet, 3×3 9 strani/list, 3×3 - + 16 pages/sheet, 4×4 16 strani/list, 4×4 - + Layout direction Smer razporejanja - + Page Order Vrstni red strani - + Collate pages Zbiraj strani - + Print pages in order natisni strani po vrstnem redu - + Front to back od prve do zadnje - + Back to front od zadnje do prve - + Watermark Vodni žig - + Add watermark Dodaj vodni žig - + Text watermark Besedilni vodni žig - + Confidential Zaupno - + Draft Osnutek - + Sample Vzorec - + Custom Prilagojeno - + Input your text Vnesite besedilo - + Picture watermark Slikovni vodni žig - + Layout Razpored - + Tile Razpostavi - + Center Sredina - + Angle Kot - + Size Velikost - + Transparency Prosojnost - + + Print to PDF Tiskaj v PDF - + + Save as Image Shrani kot sliko - + Collapse Zloži - - + + Flip on short edge Prelom na kratki stranici - - + + + Flip on long edge Prelom na dolgi stranici - + Input page numbers please Vnesite strani - + Maximum page number reached Doseženo je največje število strani - + Input English comma please Vnesite angleško vejico - + Input page numbers like this: 1,3,5-7,11-15,18,21 Vnesite strani kot: 1,3,5-7,11-15,18,21 - + Save button Shrani - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Na primer 1,3,5-7,11-15,18,21 - + Save as PDF Shrani kot PDF - + Save as image Shrani kot sliko - + Images Slike @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Zaupno - - + + Draft Osnutek - - + + Sample Vzorec @@ -562,7 +564,7 @@ DSearchEdit - + Search iskanje @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Prekliči - + Replace Zamenjaj - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Bližnjica je enaka kot %1. Kliknite na Dodaj, ta postane takoj aktivna @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Prosim, vnesite novo bližnjico - + None Nič - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + zaustavi branje - - Maximize - + + Text to Speech + Besedilo v govor - - Tile window to left of screen - + + Translate + Prevedi - - Tile window to right of screen - + + Speech To Text + Govor v besedilo - DTextEdit + DToolbarEditPanel - - Stop reading - zaustavi branje + + Default toolset + - - Text to Speech - Besedilo v govor + + Drag your favorite items into the toolbar + - - Translate - Prevedi + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Govor v besedilo + + Confirm + Potrdi PickColorWidget - + Color Barvno @@ -655,17 +657,17 @@ QLineEdit - + &Copy - + Cu&t - + Select All Izberi vse @@ -673,20 +675,72 @@ QObject - + No search result Ni rezultatov iskanja - + Restore Defaults Obnovi privzeto + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Zasluge + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All Izberi vse @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Prosim, vnesite novo bližnjico @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Tema - + Light Theme Svetla tema - + Dark Theme Temna tema - + System Theme Sistemska tema - + Help Pomoč - + Feedback - + + Custom toolbar + + + + About O tem - + Exit Izhod diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_sq.ts dtkwidget-5.6.12/src/translations/dtkwidget_sq.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_sq.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_sq.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Falënderime - - - - Version: %1 - Version: %1 - - - + %1 is released under %2 %1 hidhet në qarkullim sipas %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black E zezë - + White E bardhë - + Dark Gray Gri e Errët - + Gray Gri - + Light Gray Gri e Çelët - + Red E kuqe - + Green E gjelbër - + Blue Blu - + Cyan Gurkali - + Magenta E purpur - + Yellow E verdhë - + Dark Red E kuqe e Errët - + Dark Green E gjelbër e Errët - + Dark Blue Blu e Errët - + Dark Cyan Gurkali e Errët - + Dark Magenta E purpurt e Errët - + Dark Yellow E verdhë e Errët @@ -108,12 +105,12 @@ DInputDialog - + Cancel Anuloje - + Confirm Ripohojeni @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Jepni shkurtore të re @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Ndale leximin - + Text to Speech Nga Tekst Në të Folur - + Translate Përktheni - + Speech To Text Nga e Folur Në Tekst @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced E thelluar - + Cancel button Anuloje - - + + Print button Shtype - + Basic Bazë - + Printer Shtypës - + Copies Kopje - + Page range Interval shtypjeje - + All Krejt - + Current page Faqen e tanishme - + Select pages Përzgjidhni faqe - + Orientation Orientim - + Portrait Portret - + Landscape Së gjeri - + Pages Faqe - + Color mode Mënyrë ngjyrash - - - + + + + + Color Ngjyrë - - - + + + Grayscale Shkallë e grisë - + Margins Mënjana - + Narrow (mm) E ngushtë (mm) - + Normal (mm) Normale (mm) - + Moderate (mm) Mesatare (mm) - + Customize (mm) Përshtateni (mm) - + Top Në krye - + Left Majtas - + Bottom Në fund - + Right Djathtas - + Scaling Përshkallëzim - + Actual size Madhësia aktuale - + Scale Ripërmasoje - + Paper Letër - + Paper size Madhësi letre - + Print Layout Skemë Shtypjeje - + Duplex Dupleks - + N-up printing Shumë faqe për fletë - + 2 pages/sheet, 1×2 2 faqe/fletë, 1×2 - + 4 pages/sheet, 2×2 4 faqe/fletë, 2×2 - + 6 pages/sheet, 2×3 6 faqe/fletë, 2×3 - + 9 pages/sheet, 3×3 9 faqe/fletë, 3×3 - + 16 pages/sheet, 4×4 16 faqe/fletë, 4×4 - + Layout direction Drejtim skeme - + Page Order Rend Faqesh - + Collate pages Ngjiti faqet - + Print pages in order Shtypi faqet në radhë - + Front to back Nga para, prapa - + Back to front Nga prapa, para - + Watermark Filigran - + Add watermark Shtoni filigran - + Text watermark Fiilgran tekst - + Confidential Rezervat - + Draft Skicë - + Sample Shembull - + Custom Vetjake - + Input your text Jepni tekstin tuaj - + Picture watermark Filigran figurë - + Layout Skemë - + Tile Kuadrat - + Center Në qendër - + Angle Kënd - + Size Madhësi - + Transparency Tejdukshmëri - + + Print to PDF Shtype si PDF - + + Save as Image Ruaje si Figurë - + Collapse Tkurre - - + + Flip on short edge Ktheje në anë tjetër sipas anës së shkurtër - - + + + Flip on long edge Ktheje në anë tjetër sipas anës së gjatë - + Input page numbers please Ju lutemi, jepni numra faqesh - + Maximum page number reached U mbërrit në numrin maksimum të faqeve - + Input English comma please Ju lutemi, jepni presje anglishteje - + Input page numbers like this: 1,3,5-7,11-15,18,21 Jepni numra faqesh si: 1,3,5-7,11-15,18,21 - + Save button Ruaje - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Për shembull, 1,3,5-7,11-15,18,21 - + Save as PDF Ruaje si PDF - + Save as image Ruaje si figurë - + Images Figura @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Rezervat - - + + Draft Skicë - - + + Sample Shembull @@ -562,7 +564,7 @@ DSearchEdit - + Search Kërko @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Anuloje - + Replace Zëvendësoje - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Kjo shkurtore përplaset me %1, klikoni mbi Shtoje që ta bëni këtë shkurtore menjëherë efektive @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Ju lutemi, jepni shkurtore të re - + None Asnjë - DSplitScreenWidget + DTextEdit - - Unmaximize - Çmaksimizoje + + Stop reading + Ndale leximin - - Maximize - Maksimizoje + + Text to Speech + Nga Tekst Në të Folur - - Tile window to left of screen - Dritare kuadrati majtas ekranit + + Translate + Përktheni - - Tile window to right of screen - Dritare kuadrati djathtas ekranit + + Speech To Text + Nga e Folur Në Tekst - DTextEdit + DToolbarEditPanel - - Stop reading - Ndale leximin + + Default toolset + Grup parazgjedhje mjetesh - - Text to Speech - Nga Tekst Në të Folur + + Drag your favorite items into the toolbar + Tërhiqini deri te paneli objektet tuaj të parapëlqyer - - Translate - Përktheni + + Drag below items into the toolbar to restore defaults + Që të rikthehen parazgjedhjet, tërhiqini objektet më poshtë deri te paneli - - Speech To Text - Nga e Folur Në Tekst + + Confirm + Ripohojeni PickColorWidget - + Color Ngjyrë @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Kopjoje - + Cu&t &Prije - + Select All Përzgjidhi Krejt @@ -673,20 +675,72 @@ QObject - + No search result S’ka përfundime kërkimi - + Restore Defaults Rikthe Parazgjedhjet + + + Version + Version + + + + Features + Veçori + + + + Homepage + Faqe hyrëse + + + + Description + Përshkrim + + + + Acknowledgements + Falënderime + + + + + + Sincerely appreciate the open-source software used. + Vlerësoni sinqerisht software-in me burim të hapët të përdorur. + + + + open-source software + software me burim të hapët + + + + Continue + Vazhdoni + + + + Learn More + Mësoni Më Tepër + + + + Credits + + QWidgetTextControl - + Select All Përzgjidhi Krejt @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Ju lutemi, jepni shkurtore të re @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Temë - + Light Theme Temë e Çelët - + Dark Theme Temë e Errët - + System Theme Temë Sistemi - + Help Ndihmë - + Feedback - + Përshtypje + + + + Custom toolbar + Panel vetjak - + About Mbi - + Exit Dil diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_sr.ts dtkwidget-5.6.12/src/translations/dtkwidget_sr.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_sr.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_sr.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Заслуге - - - - Version: %1 - Верзија: %1 - - - + %1 is released under %2 %1 је објављен под %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Црна - + White Бела - + Dark Gray Тамно сива - + Gray Сива - + Light Gray Светло сива - + Red Црвена - + Green Зелена - + Blue Плава - + Cyan Цијан - + Magenta Магента - + Yellow Жута - + Dark Red Тамно црвена - + Dark Green Тамно зелена - + Dark Blue Тамно плава - + Dark Cyan Тамно цијан - + Dark Magenta Тамно магента - + Dark Yellow Тамно жута @@ -108,12 +105,12 @@ DInputDialog - + Cancel Откажи - + Confirm Потврди @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Унесите нову пречицу @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Заустави читање - + Text to Speech Текст у говор - + Translate Преведи - + Speech To Text Говор у текст @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Напредно - + Cancel button Откажи - - + + Print button Штампај - + Basic Основно - + Printer Штампач - + Copies Копије - + Page range Опсег странице - + All Све - + Current page Тренутна страница - + Select pages Изабери странице - + Orientation Усмерење - + Portrait Усправно - + Landscape Положено - + Pages Странице - + Color mode Режим боја - - - + + + + + Color Боја - - - + + + Grayscale Сиве нијансе - + Margins Маргине - + Narrow (mm) Уско (mm) - + Normal (mm) Нормално (mm) - + Moderate (mm) Умерено (mm) - + Customize (mm) Прилагоди (mm) - + Top Врх - + Left Лево - + Bottom Дно - + Right Десно - + Scaling Скалирање - + Actual size Стварна величина - + Scale Скалирај - + Paper Папир - + Paper size Величина папира - + Print Layout Приказ пре штампања - + Duplex Двострано - + N-up printing Страница по листу - + 2 pages/sheet, 1×2 2 странице/лист, 1×2 - + 4 pages/sheet, 2×2 4 странице/лист, 2×2 - + 6 pages/sheet, 2×3 6 страница/лист, 2×3 - + 9 pages/sheet, 3×3 9 страница/лист, 3×3 - + 16 pages/sheet, 4×4 16 страница/лист, 4×4 - + Layout direction Усмерење распореда - + Page Order Редослед страница - + Collate pages Поређај странице - + Print pages in order Штампај странице по реду - + Front to back Напред ка назад - + Back to front Назад ка напред - + Watermark Водени жиг - + Add watermark Додај водени жиг - + Text watermark Текстуални водени жиг - + Confidential Поверљиво - + Draft Нацрт - + Sample Узорак - + Custom Прилагођено - + Input your text Унесите текст - + Picture watermark Сликовни водени жиг - + Layout Распоред - + Tile Поплочано - + Center Центрирано - + Angle Угао - + Size Величина - + Transparency Провидност - + + Print to PDF Испис у ПДФ - + + Save as Image Сачувај као слику - + Collapse Скупи - - + + Flip on short edge Oкрећи по краћој ивици - - + + + Flip on long edge Окрећи по дужој ивици - + Input page numbers please Унесите бројеве страница - + Maximum page number reached Достигнут је максималан број страница - + Input English comma please Молимо унесите енглеску запету - + Input page numbers like this: 1,3,5-7,11-15,18,21 Унеси бројеве страница овако: 1,3,5-7,11-15,18,21 - + Save button Сачувај - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 На пример, 1,3,5-7,11-15,18,21 - + Save as PDF Сачувај као ПДФ - + Save as image Сачувај као слику - + Images Слике @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Поверљиво - - + + Draft Нацрт - - + + Sample Узорак @@ -562,7 +564,7 @@ DSearchEdit - + Search Претражи @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Откажи - + Replace Замени - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Ова пречица је у сукобу са %1, кликните на Додај да пречица ступи на снагу @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Унесите нову пречицу - + None Ништа - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + Заустави читање - - Maximize - + + Text to Speech + Текст у говор - - Tile window to left of screen - + + Translate + Преведи - - Tile window to right of screen - + + Speech To Text + Говор у текст - DTextEdit + DToolbarEditPanel - - Stop reading - Заустави читање + + Default toolset + - - Text to Speech - Текст у говор + + Drag your favorite items into the toolbar + - - Translate - Преведи + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Говор у текст + + Confirm + Потврди PickColorWidget - + Color Боја @@ -655,17 +657,17 @@ QLineEdit - + &Copy - + Cu&t - + Select All Изабери све @@ -673,20 +675,72 @@ QObject - + No search result Нема резултата претраге - + Restore Defaults Врати Подразумевано + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Заслуге + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All Изабери све @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Унесите нову пречицу @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Тема - + Light Theme Светла тема - + Dark Theme Тамна тема - + System Theme Системска тема - + Help Помоћ - + Feedback - + + Custom toolbar + + + + About О програму - + Exit Изађи diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_sv.ts dtkwidget-5.6.12/src/translations/dtkwidget_sv.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_sv.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_sv.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_sw.ts dtkwidget-5.6.12/src/translations/dtkwidget_sw.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_sw.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_sw.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ta.ts dtkwidget-5.6.12/src/translations/dtkwidget_ta.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ta.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ta.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_th.ts dtkwidget-5.6.12/src/translations/dtkwidget_th.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_th.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_th.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_tr.ts dtkwidget-5.6.12/src/translations/dtkwidget_tr.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_tr.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_tr.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Teşekkürler - - - - Version: %1 - Sürüm: %1 - - - + %1 is released under %2 %1, %2 koşulları altında yayınlanmıştır @@ -20,87 +17,87 @@ DCrumbEdit - + Black Siyah - + White Beyaz - + Dark Gray Koyu Gri - + Gray Gri - + Light Gray Açık Gri - + Red Kırmızı - + Green Yeşil - + Blue Mavi - + Cyan Cam Göbeği - + Magenta Mor - + Yellow Sarı - + Dark Red Koyu Kırmızı - + Dark Green Koyu Yeşil - + Dark Blue Koyu Mavi - + Dark Cyan Koyu Cam Göbeği - + Dark Magenta Koyu Mor - + Dark Yellow Koyu Sarı @@ -108,12 +105,12 @@ DInputDialog - + Cancel İptal - + Confirm Onayla @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Yeni bir kısayol gir @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Okumayı bırak - + Text to Speech Metni Sese Dönüştür - + Translate Çeviri - + Speech To Text Sesten Metne Dönüştür @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Gelişmiş - + Cancel button İptal - - + + Print button Yazdır - + Basic Basit - + Printer Yazıcı - + Copies Kopyalar - + Page range Sayfa aralığı - + All Tümü - + Current page Mevcut sayfa - + Select pages Sayfaları seç - + Orientation Oryantasyon - + Portrait Portre - + Landscape Manzara - + Pages Sayfalar - + Color mode Renk kipi - - - + + + + + Color Renk - - - + + + Grayscale Gri tonlamalı - + Margins Kenar boşlukları - + Narrow (mm) Dar (mm) - + Normal (mm) Normal (mm) - + Moderate (mm) Orta (mm) - + Customize (mm) Özel (mm) - + Top Üst - + Left Sol - + Bottom Alt - + Right Sağ - + Scaling Ölçeklendir - + Actual size Gerçek boyut - + Scale Ölçek - + Paper Kağıt - + Paper size Kağıt boyutu - + Print Layout Baskı Düzeni - + Duplex İkili - + N-up printing N-yukarı baskı - + 2 pages/sheet, 1×2 2 sayfa/yaprak, 1×2 - + 4 pages/sheet, 2×2 4 sayfa/yaprak, 2×2 - + 6 pages/sheet, 2×3 6 sayfa/yaprak, 2×3 - + 9 pages/sheet, 3×3 9 sayfa/yaprak, 3×3 - + 16 pages/sheet, 4×4 16 sayfa/yaprak, 4×4 - + Layout direction Düzen yönü - + Page Order Sayfa Düzeni - + Collate pages Sayfaları harmanla - + Print pages in order Sayfaları sırayla yazdır - + Front to back Önden arkaya - + Back to front Öne arkaya - + Watermark Filigran - + Add watermark Filigran ekle - + Text watermark Metin filigranı - + Confidential Gizli - + Draft Taslak - + Sample Örnek - + Custom Özel - + Input your text Metninizi girin - + Picture watermark Resim filigranı - + Layout Düzen - + Tile Karo - + Center Merkez - + Angle Açı - + Size Boyut - + Transparency Şeffaflık - + + Print to PDF PDF olarak yazdır - + + Save as Image Görüntü olarak kaydet - + Collapse Çöküş - - + + Flip on short edge Kısa kenarda çevir - - + + + Flip on long edge Uzun kenarda çevir - + Input page numbers please Lütfen sayfa numaralarını girin - + Maximum page number reached Maksimum sayfa sayısına ulaşıldı - + Input English comma please İngilizce virgül girin lütfen - + Input page numbers like this: 1,3,5-7,11-15,18,21 Bunun gibi sayfa numaralarını girin: 1,3,5-7,11-15,18,21 - + Save button Kaydet - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Örneğin, 1,3,5-7,11-15,18,21 - + Save as PDF PDF olarak kaydet - + Save as image Görüntü olarak kaydet - + Images Resimler @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Gizli - - + + Draft Taslak - - + + Sample Örnek @@ -562,7 +564,7 @@ DSearchEdit - + Search Ara @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel İptal - + Replace Değiştir - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Bu kısayol %1 ile çakışıyor, bu kısayolu hemen etkin hale getirmek için Ekle'yi tıkla @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Lütfen yeni bir kısayol gir - + None Hiçbiri - DSplitScreenWidget + DTextEdit - - Unmaximize - Küçült + + Stop reading + Okumayı bırak - - Maximize - Büyüt + + Text to Speech + Metni Sese Dönüştür - - Tile window to left of screen - Pencereyi ekranın soluna döşe + + Translate + Çeviri - - Tile window to right of screen - Pencereyi ekranın sağına döşeyin + + Speech To Text + Sesten Metne Dönüştür - DTextEdit + DToolbarEditPanel - - Stop reading - Okumayı bırak + + Default toolset + - - Text to Speech - Metni Sese Dönüştür + + Drag your favorite items into the toolbar + - - Translate - Çeviri + + Drag below items into the toolbar to restore defaults + - - Speech To Text - Sesten Metne Dönüştür + + Confirm + Onayla PickColorWidget - + Color Renk @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Kopyala - + Cu&t Ke&s - + Select All Tümünü Seç @@ -673,20 +675,72 @@ QObject - + No search result Aramada herhangi bir sonuç bulunamadı - + Restore Defaults Varsayılanları Geri Yükle + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + Teşekkürler + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + + QWidgetTextControl - + Select All Tümünü Seç @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Lütfen yeni bir kısayol gir @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Tema - + Light Theme Açık Tema - + Dark Theme Koyu Tema - + System Theme Sistem Teması - + Help Yardım - + Feedback + Geri bildirim + + + + Custom toolbar - + About Hakkında - + Exit Çıkış diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget.ts dtkwidget-5.6.12/src/translations/dtkwidget.ts --- dtkwidget-5.5.48/src/translations/dtkwidget.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Acknowledgements - - - - Version: %1 - Version: %1 - - - + %1 is released under %2 %1 is released under %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Black - + White White - + Dark Gray Dark Gray - + Gray Gray - + Light Gray Light Gray - + Red Red - + Green Green - + Blue Blue - + Cyan Cyan - + Magenta Magenta - + Yellow Yellow - + Dark Red Dark Red - + Dark Green Dark Green - + Dark Blue Dark Blue - + Dark Cyan Dark Cyan - + Dark Magenta Dark Magenta - + Dark Yellow Dark Yellow @@ -108,12 +105,12 @@ DInputDialog - + Cancel Cancel - + Confirm Confirm @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Enter a new shortcut @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Stop reading - + Text to Speech Text to Speech - + Translate Translate - + Speech To Text Speech To Text @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Advanced - + Cancel button Cancel - - + + Print button Print - + Basic Basic - + Printer Printer - + Copies Copies - + Page range Page range - + All All - + Current page Current page - + Select pages Select pages - + Orientation Orientation - + Portrait Portrait - + Landscape Landscape - + Pages Pages - + Color mode Color mode - - - + + + + + Color Color - - - + + + Grayscale Grayscale - + Margins Margins - + Narrow (mm) Narrow (mm) - + Normal (mm) Normal (mm) - + Moderate (mm) Moderate (mm) - + Customize (mm) Customize (mm) - + Top Top - + Left Left - + Bottom Bottom - + Right Right - + Scaling Scaling - + Actual size Actual size - + Scale Scale - + Paper Paper - + Paper size Paper size - + Print Layout Print Layout - + Duplex Duplex - + N-up printing N-up printing - + 2 pages/sheet, 1×2 2 pages/sheet, 1×2 - + 4 pages/sheet, 2×2 4 pages/sheet, 2×2 - + 6 pages/sheet, 2×3 6 pages/sheet, 2×3 - + 9 pages/sheet, 3×3 9 pages/sheet, 3×3 - + 16 pages/sheet, 4×4 16 pages/sheet, 4×4 - + Layout direction Layout direction - + Page Order Page Order - + Collate pages Collate pages - + Print pages in order Print pages in order - + Front to back Front to back - + Back to front Back to front - + Watermark Watermark - + Add watermark Add watermark - + Text watermark Text watermark - + Confidential Confidential - + Draft Draft - + Sample Sample - + Custom Custom - + Input your text Input your text - + Picture watermark Picture watermark - + Layout Layout - + Tile Tile - + Center Center - + Angle Angle - + Size Size - + Transparency Transparency - + + Print to PDF Print to PDF - + + Save as Image Save as Image - + Collapse Collapse - - + + Flip on short edge Flip on short edge - - + + + Flip on long edge Flip on long edge - + Input page numbers please Input page numbers please - + Maximum page number reached Maximum page number reached - + Input English comma please Input English comma please - + Input page numbers like this: 1,3,5-7,11-15,18,21 Input page numbers like this: 1,3,5-7,11-15,18,21 - + Save button Save - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 For example, 1,3,5-7,11-15,18,21 - + Save as PDF Save as PDF - + Save as image Save as image - + Images Images @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Confidential - - + + Draft Draft - - + + Sample Sample @@ -562,7 +564,7 @@ DSearchEdit - + Search Search @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Cancel - + Replace Replace - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately This shortcut conflicts with %1, click on Add to make this shortcut effective immediately @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Please input a new shortcut - + None None - DSplitScreenWidget + DTextEdit - - Unmaximize - Unmaximize + + Stop reading + Stop reading - - Maximize - Maximize + + Text to Speech + Text to Speech - - Tile window to left of screen - Tile window to left of screen + + Translate + Translate - - Tile window to right of screen - Tile window to right of screen + + Speech To Text + Speech To Text - DTextEdit + DToolbarEditPanel - - Stop reading - Stop reading + + Default toolset + Default toolset - - Text to Speech - Text to Speech + + Drag your favorite items into the toolbar + Drag your favorite items into the toolbar - - Translate - Translate + + Drag below items into the toolbar to restore defaults + Drag below items into the toolbar to restore defaults - - Speech To Text - Speech To Text + + Confirm + Confirm PickColorWidget - + Color Color @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Copy - + Cu&t Cu&t - + Select All Select All @@ -673,20 +675,72 @@ QObject - + No search result No search result - + Restore Defaults Restore Defaults + + + Version + Version + + + + Features + Features + + + + Homepage + Homepage + + + + Description + Description + + + + Acknowledgements + Acknowledgements + + + + + + Sincerely appreciate the open-source software used. + Sincerely appreciate the open-source software used. + + + + open-source software + open-source software + + + + Continue + Continue + + + + Learn More + Learn More + + + + Credits + Credits + QWidgetTextControl - + Select All Select All @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Please enter a new shortcut @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Theme - + Light Theme Light Theme - + Dark Theme Dark Theme - + System Theme System Theme - + Help Help - + Feedback Feedback - + + Custom toolbar + Custom toolbar + + + About About - + Exit Exit diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ug.ts dtkwidget-5.6.12/src/translations/dtkwidget_ug.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ug.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ug.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - مۇقىملاشتۇرۇش - - - - Version: %1 - نەشرى : %1 - - - + %1 is released under %2 %1 قۇيۇپ بېرىش ئاستىداi %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black قارا رەڭ - + White ئاق رەڭ - + Dark Gray قېنىق كۈلرەڭ - + Gray كۈلرەڭ - + Light Gray سۇس كۈلرەڭ - + Red قىزىل رەڭ - + Green يېشىل رەڭ - + Blue كۆك رەڭ - + Cyan كۆك يېشىل رەڭ - + Magenta ماگېن - + Yellow سېرىق رەڭ - + Dark Red قېنىق قىزىل رەڭ - + Dark Green قېنىق يېشىل رەڭ - + Dark Blue قېنىق كۆك رەڭ - + Dark Cyan قېنىق كۆك يېشىل رەڭ - + Dark Magenta قېنىق ماگېن - + Dark Yellow قېنىق سېرىق رەڭ @@ -108,12 +105,12 @@ DInputDialog - + Cancel ئەمەلدىن قالدۇرۇش - + Confirm مۇقىملاش @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut يېڭى تېزلەتمە كىرگۈزۈڭ @@ -129,22 +126,22 @@ DLineEdit - + Stop reading ئوقۇشنى توختىتىش - + Text to Speech تېكىستنى ئاۋازغا ئايلاندۇرۇش - + Translate تەرجىمە - + Speech To Text ئاۋازنى تېكىستكە ئايلاندۇرۇش @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced ئالىي تەڭشەك - + Cancel button ئەمەلدىن قالدۇرۇش - - + + Print button بېسىش - + Basic ئاساسىي تەڭشەك - + Printer پىرىنتېر - + Copies نۇسخا سانى - + Page range بەت دائىرىسى - + All ھەممىنى - + Current page مۇشۇ بەتنى - + Select pages بەلگىلىگەن بەتنى - + Orientation بسېىس يۆنىلىشى - + Portrait ۋېرتىكال - + Landscape توغرىسىغا - + Pages بەت تەڭشىكى - + Color mode رەڭ - - - + + + + + Color رەڭلىك - - - + + + Grayscale رەڭسىز - + Margins بەت يېنى ئارىلىقى - + Narrow (mm) تار (mm) - + Normal (mm) نورمال (mm) - + Moderate (mm) مۇۋاپىق (mm) - + Customize (mm) بەلگىلەش (mm) - + Top ئۈستى - + Left سول - + Bottom ئاستى - + Right ئوڭ - + Scaling كۆرۈنۈشى - + Actual size ئەمەلىي چوڭلۇقى - + Scale بەلگىلىگەن نىسبەتتە - + Paper قەغەز - + Paper size قەغەز چوڭلۇقى - + Print Layout بېسىش ئۇسۇلى - + Duplex قوش بەتلىك - + N-up printing قاتار بېسىش - + 2 pages/sheet, 1×2 بىر بەتكە 2 بەت 1×2 - + 4 pages/sheet, 2×2 بىر بەتكە 4 بەت 2×2 - + 6 pages/sheet, 2×3 بىر بەتكە 6 بەت 3×2 - + 9 pages/sheet, 3×3 بىر بەتكە 9 بەت 3×3 - + 16 pages/sheet, 4×4 بىر بەتكە 16 بەت 4×4 - + Layout direction تەرتىپ بويىچە بېسىش - + Page Order بېسىش تەرتىپى - + Collate pages بىرمۇبىر بېسىش - + Print pages in order تەرتىپ بويىچە بېسىش - + Front to back ئالدىدىن ئارقىغا - + Back to front ئارقىدىن ئالدىغا - + Watermark تامغا - + Add watermark تامغا قوشۇش - + Text watermark خەتلىك تامغا - + Confidential مۇتلەق مەخپىي - + Draft كۇپىيە - + Sample نۇسخا - + Custom بەلگىلەش - + Input your text تامغا كىرگۈزۈڭ - + Picture watermark رەسىم تامغا - + Layout بېسىش ئۇسۇلى - + Tile يېيىش - + Center ئوتتورىغا - + Angle يانتۇلۇقى - + Size سىغىمى - + Transparency سۈزۈكلۈكى - + + Print to PDF PDF شەكلىدە باشقا ساقلاش - + + Save as Image رەسىم شەكلىدە ساقلاش - + Collapse يىغىش - - + + Flip on short edge قىسقا ياندىن ئۆرۈش - - + + + Flip on long edge ئۇزۇن ياندىن ئۆرۈش - + Input page numbers please باسىدىغان بەت نومۇرىنى كىرگۈزۈڭ - + Maximum page number reached بېسىش دائىرىسىدىن ئېشىپ كەتتى - + Input English comma please ئىنگلىزچە پەش كىرگۈزۈڭ - + Input page numbers like this: 1,3,5-7,11-15,18,21 توغرا فورماتتا كىرگۈزۈڭ، مەسىلەن: 1,3,5-7,11-15,18,21 - + Save button ساقلاش - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 كىرگۈزگىلى بولىدىغان فورمات: 1,3,5-7,11-15,18,21 - + Save as PDF PDF شەكلىدە ساقلاش - + Save as image رەسىم شەكلىدە ساقلاش - + Images رەسىم @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential مۇتلەق مەخپىي - - + + Draft كۇپىيە - - + + Sample نۇسخا @@ -562,7 +564,7 @@ DSearchEdit - + Search ئىزدەش @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel ئەمەلدىن قالدۇرۇش - + Replace ئالماشتۇرۇش - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately بۇ تېزلەتمە %1 بىلەن توقۇنۇشىدۇ، قوشۇشنى چەكسىڭىز بۇ تېزلەتمە ئۈنۈملۈك بولىدۇ @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut يېڭى بىر تېزلەتمە شەكلىنى كىرگۈزۈڭ - + None قۇرۇق - DSplitScreenWidget + DTextEdit - - Unmaximize - ئەسلىگە قايتۇرۇش + + Stop reading + ئوقۇشنى توختىتىش - - Maximize - ئەڭ چوڭ + + Text to Speech + تېكىستنى ئاۋازغا ئايلاندۇرۇش - - Tile window to left of screen - كۆزنەكنى سول تەرەپكە چاپلاش + + Translate + تەرجىمە - - Tile window to right of screen - كۆزنەكنى ئوڭ تەرەپكە چاپلاش + + Speech To Text + ئاۋازنى تېكىستكە ئايلاندۇرۇش - DTextEdit + DToolbarEditPanel - - Stop reading - ئوقۇشنى توختىتىش + + Default toolset + سۈكۈتتىكى تۈر گۇرۇپپىسى - - Text to Speech - تېكىستنى ئاۋازغا ئايلاندۇرۇش + + Drag your favorite items into the toolbar + ياخشى كۆرىدىغان تۈرنى قورال ئىستونىغا كىرگۈزۈش - - Translate - تەرجىمە + + Drag below items into the toolbar to restore defaults + بۇ گۇرۇپپىنى ياخشى كۆرىدىغان تۈرنى قورال ئىستونىغا كىرگۈزۈپ سۈكۈتتىكى قىلىش - - Speech To Text - ئاۋازنى تېكىستكە ئايلاندۇرۇش + + Confirm + مۇقىملاش PickColorWidget - + Color رەڭلىك @@ -655,17 +657,17 @@ QLineEdit - + &Copy كۆچۈرۈش (C&) - + Cu&t چاپلاش (T&) - + Select All ھەممە @@ -673,20 +675,72 @@ QObject - + No search result ئىزدەش نەتىجىسى يوق - + Restore Defaults ئەسلىدىكى تەڭشەك ھالىتىگە قايتۇرۇش + + + Version + نەشرى + + + + Features + نەشر ئالاھىدىلىكى + + + + Homepage + باش بەت + + + + Description + تەسۋىر + + + + Acknowledgements + مۇقىملاشتۇرۇش + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + داۋاملاشتۇرۇش + + + + Learn More + تېخىمۇ كۆپ چۈشىنىش + + + + Credits + + QWidgetTextControl - + Select All ھەممە @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut يېڭى بىر تېزلەتمە شەكلىنى كىرگۈزۈڭ @@ -702,42 +756,47 @@ TitleBarMenu - + Theme ئۇسلۇب - + Light Theme يورۇق ئۇسلۇب - + Dark Theme قارا ئۇسلۇب - + System Theme سېستىما ئۇسلۇبى - + Help ياردەم - + Feedback ئىنكاس يېزىش - + + Custom toolbar + + + + About ھەققىدە - + Exit چېكىنىش diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_uk.ts dtkwidget-5.6.12/src/translations/dtkwidget_uk.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_uk.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_uk.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - Подяки - - - - Version: %1 - Версія: %1 - - - + %1 is released under %2 %1 випущено за умов дотримання %2 @@ -20,87 +17,87 @@ DCrumbEdit - + Black Чорний - + White Білий - + Dark Gray Темно сірий - + Gray Сірий - + Light Gray Світло сірий - + Red Червоний - + Green Зелений - + Blue Синій - + Cyan Бірюзовий - + Magenta Пурпурний - + Yellow Жовтий - + Dark Red Темно-червоний - + Dark Green Темно-зелений - + Dark Blue Темно-синій - + Dark Cyan Темно-бірюзовий - + Dark Magenta Темно-пурпурний - + Dark Yellow Темно-жовтий @@ -108,12 +105,12 @@ DInputDialog - + Cancel Скасувати - + Confirm Підтвердити @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut Введіть новий ярлик @@ -129,22 +126,22 @@ DLineEdit - + Stop reading Припинити читання - + Text to Speech Озвучення тексту - + Translate Перекласти - + Speech To Text Промовити текст @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced Додатково - + Cancel button Скасувати - - + + Print button Друк - + Basic Основне - + Printer Принтер - + Copies Копії - + Page range Діапазон сторінок - + All Усі - + Current page Поточна сторінка - + Select pages Вибрані сторінки - + Orientation Орієнтація - + Portrait Книжкова - + Landscape Альбомна - + Pages Сторінки - + Color mode Режим кольорів - - - + + + + + Color Кольоровий - - - + + + Grayscale Відтінки сірого - + Margins Поля - + Narrow (mm) Вузькі (мм) - + Normal (mm) Звичайні (мм) - + Moderate (mm) Помірні (мм) - + Customize (mm) Нетипові (мм) - + Top Згори - + Left Ліворуч - + Bottom Внизу - + Right Праворуч - + Scaling Масштабування - + Actual size Природний розмір - + Scale Масштаб - + Paper Папір - + Paper size Розмір аркуша - + Print Layout Компонування друку - + Duplex Двобічний друк - + N-up printing Друк декількох сторінок на аркуші - + 2 pages/sheet, 1×2 2 сторінки/аркуш, 1×2 - + 4 pages/sheet, 2×2 4 сторінки/аркуш, 2×2 - + 6 pages/sheet, 2×3 6 сторінок/аркуш, 2×3 - + 9 pages/sheet, 3×3 9 сторінок/аркуш, 3×3 - + 16 pages/sheet, 4×4 16 сторінок/аркуш, 4×4 - + Layout direction Напрямок компонування - + Page Order Порядок сторінок - + Collate pages Упорядкувати сторінки - + Print pages in order Друкувати сторінки за порядком - + Front to back Спереду назад - + Back to front Задом наперед - + Watermark Накладний знак - + Add watermark Додати накладний знак - + Text watermark Текстовий накладний знак - + Confidential Секретно - + Draft Чернетка - + Sample Зразок - + Custom Нетиповий - + Input your text Введіть ваш текст - + Picture watermark Накладний знак — малюнок - + Layout Компонування - + Tile Мозаїка - + Center За центром - + Angle Кут - + Size Розмір - + Transparency Прозорість - + + Print to PDF Друкувати до PDF - + + Save as Image Зберегти як зображення - + Collapse Згорнути - - + + Flip on short edge Перевернути на короткій стороні - - + + + Flip on long edge Перевернути на довгій стороні - + Input page numbers please Введіть номери сторінок - + Maximum page number reached Досягнуто максимального номера сторінки - + Input English comma please Введіть із англійською комою - + Input page numbers like this: 1,3,5-7,11-15,18,21 Введіть номери сторінок, ось так: 1,3,5-7,11-15,18,21 - + Save button Зберегти - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 Приклад: 1,3,5-7,11-15,18,21 - + Save as PDF Зберегти як PDF - + Save as image Зберегти як зображення - + Images Зображення @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential Секретно - - + + Draft Чернетка - - + + Sample Зразок @@ -562,7 +564,7 @@ DSearchEdit - + Search Пошук @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel Скасувати - + Replace Замінити - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately Цей ярлик конфліктує з %1, натисніть кнопку Додати, щоб негайно застосувати цей ярлик @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut Будь ласка, вкажіть нове клавіатурне скорочення - + None Немає - DSplitScreenWidget + DTextEdit - - Unmaximize - Скасувати максимізацію + + Stop reading + Припинити читання - - Maximize - Максимізувати + + Text to Speech + Озвучення тексту - - Tile window to left of screen - Розташувати у мозаїці у лівій частині екрана + + Translate + Перекласти - - Tile window to right of screen - Розташувати у мозаїці у правій частині екрана + + Speech To Text + Промовити текст - DTextEdit + DToolbarEditPanel - - Stop reading - Припинити читання + + Default toolset + Типовий набір інструментів - - Text to Speech - Озвучення тексту + + Drag your favorite items into the toolbar + Перетягніть ваші улюблені пункти на панель інструментів - - Translate - Перекласти + + Drag below items into the toolbar to restore defaults + Перетягніть наведені нижче пункти на панель інструментів, щоб відновити типові параметри - - Speech To Text - Промовити текст + + Confirm + Підтвердити PickColorWidget - + Color Кольоровий @@ -655,17 +657,17 @@ QLineEdit - + &Copy &Копіювати - + Cu&t Ви&різати - + Select All Вибрати усі @@ -673,20 +675,72 @@ QObject - + No search result Нічого не знайдено - + Restore Defaults Відновити значення за замовчуванням + + + Version + Версія + + + + Features + Можливості + + + + Homepage + Домашня сторінка + + + + Description + Опис + + + + Acknowledgements + Подяки + + + + + + Sincerely appreciate the open-source software used. + Щиро вдячні за використане програмне забезпечення з відкритим кодом. + + + + open-source software + програмне забезпечення з відкритим кодом + + + + Continue + Продовжити + + + + Learn More + Дізнатися більше + + + + Credits + Подяки + QWidgetTextControl - + Select All Вибрати усі @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut Будь ласка, введіть новий ярлик @@ -702,42 +756,47 @@ TitleBarMenu - + Theme Тема - + Light Theme Світла тема - + Dark Theme Темна тема - + System Theme Тема системи - + Help Довідка - + Feedback - + Відгуки + + + + Custom toolbar + Нетипова панель інструментів - + About Про програму - + Exit Вийти diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_ur.ts dtkwidget-5.6.12/src/translations/dtkwidget_ur.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_ur.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_ur.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_vi.ts dtkwidget-5.6.12/src/translations/dtkwidget_vi.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_vi.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_vi.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,747 +1,804 @@ - - - + + + + DAboutDialog - - Acknowledgements - - - - - Version: %1 - - - - + %1 is released under %2 - + DCrumbEdit - + Black - + - + White - + - + Dark Gray - + - + Gray - + - + Light Gray - + - + Red - + - + Green - + - + Blue - + - + Cyan - + - + Magenta - + - + Yellow - + - + Dark Red - + - + Dark Green - + - + Dark Blue - + - + Dark Cyan - + - + Dark Magenta - + - + Dark Yellow - + DInputDialog - + Cancel - + - + Confirm - + DKeySequenceEdit - + Enter a new shortcut - + DLineEdit - + Stop reading - + - + Text to Speech - + - + Translate - + - + Speech To Text - + DPrintPreviewDialogPrivate - - + + Advanced - + - + Cancel button - + - - + + Print button - + - + Basic - + - + Printer - + - + Copies - + - + Page range - + - + All - + - + Current page - + - + Select pages - + - + Orientation - + - + Portrait - + - + Landscape - + - + Pages - + - + Color mode - + - - - + + + + + Color - + - - - + + + Grayscale - + - + Margins - + - + Narrow (mm) - + - + Normal (mm) - + - + Moderate (mm) - + - + Customize (mm) - + - + Top - + - + Left - + - + Bottom - + - + Right - + - + Scaling - + - + Actual size - + - + Scale - + - + Paper - + - + Paper size - + - + Print Layout - + - + Duplex - + - + N-up printing - + - + 2 pages/sheet, 1×2 - + - + 4 pages/sheet, 2×2 - + - + 6 pages/sheet, 2×3 - + - + 9 pages/sheet, 3×3 - + - + 16 pages/sheet, 4×4 - + - + Layout direction - + - + Page Order - + - + Collate pages - + - + Print pages in order - + - + Front to back - + - + Back to front - + - + Watermark - + - + Add watermark - + - + Text watermark - + - + Confidential - + - + Draft - + - + Sample - + - + Custom - + - + Input your text - + - + Picture watermark - + - + Layout - + - + Tile - + - + Center - + - + Angle - + - + Size - + - + Transparency - + - + + Print to PDF - + - + + Save as Image - + - + Collapse - + - - + + Flip on short edge - + - - + + + Flip on long edge - + - + Input page numbers please - + - + Maximum page number reached - + - + Input English comma please - + - + Input page numbers like this: 1,3,5-7,11-15,18,21 - + - + Save button - + - + *.pdf - + - + For example, 1,3,5-7,11-15,18,21 - + - + Save as PDF - + - + Save as image - + - + Images - + DPrintPreviewWidget - - + + Confidential - + - - + + Draft - + - - + + Sample - + DSearchEdit - + Search - + DSettingsDialog - + Cancel - + - + Replace - + - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - + DShortcutEdit - + Please input a new shortcut - + - + None - + - DSplitScreenWidget + DTextEdit - - Unmaximize - + + Stop reading + - - Maximize - + + Text to Speech + - - Tile window to left of screen - + + Translate + - - Tile window to right of screen - + + Speech To Text + - DTextEdit + DToolbarEditPanel - - Stop reading - + + Default toolset + - - Text to Speech - + + Drag your favorite items into the toolbar + - - Translate - + + Drag below items into the toolbar to restore defaults + - - Speech To Text - + + Confirm + PickColorWidget - + Color - + QLineEdit - + &Copy - + - + Cu&t - + - + Select All - + QObject - + No search result - + - + Restore Defaults - + + + + + Version + + + + + Features + + + + + Homepage + + + + + Description + + + + + Acknowledgements + + + + + + + Sincerely appreciate the open-source software used. + + + + + open-source software + + + + + Continue + + + + + Learn More + + + + + Credits + QWidgetTextControl - + Select All - + ShortcutEdit - + Please enter a new shortcut - + TitleBarMenu - + Theme - + - + Light Theme - + - + Dark Theme - + - + System Theme - + - + Help - + - + Feedback - + + + + + Custom toolbar + - + About - + - + Exit - + - + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_zh_CN.ts dtkwidget-5.6.12/src/translations/dtkwidget_zh_CN.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_zh_CN.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_zh_CN.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - 鸣谢 - - - - Version: %1 - 版本:%1 - - - + %1 is released under %2 %1遵循%2协议发布 @@ -20,87 +17,87 @@ DCrumbEdit - + Black 黑色 - + White 白色 - + Dark Gray 深灰色 - + Gray 灰色 - + Light Gray 浅灰色 - + Red 红色 - + Green 绿色 - + Blue 蓝色 - + Cyan 青色 - + Magenta 洋红色 - + Yellow 黄色 - + Dark Red 深红色 - + Dark Green 深绿色 - + Dark Blue 深蓝色 - + Dark Cyan 深青色 - + Dark Magenta 深紫红色 - + Dark Yellow 深黄色 @@ -108,12 +105,12 @@ DInputDialog - + Cancel 取消 - + Confirm 确定 @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut 请输入新的快捷键 @@ -129,22 +126,22 @@ DLineEdit - + Stop reading 停止朗读 - + Text to Speech 语音朗读 - + Translate 翻译 - + Speech To Text 语音听写 @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced 高级设置 - + Cancel button 取 消 - - + + Print button 打 印 - + Basic 基础设置 - + Printer 打印机 - + Copies 打印份数 - + Page range 页码范围 - + All 全部 - + Current page 当前页 - + Select pages 指定页面 - + Orientation 打印方向 - + Portrait 纵向 - + Landscape 横向 - + Pages 页面设置 - + Color mode 色彩 - - - + + + + + Color 彩色 - - - + + + Grayscale 黑白 - + Margins 页边距 - + Narrow (mm) 窄 (mm) - + Normal (mm) 普通 (mm) - + Moderate (mm) 适中 (mm) - + Customize (mm) 自定义 (mm) - + Top - + Left - + Bottom - + Right - + Scaling 缩放 - + Actual size 实际大小 - + Scale 自定义比例 - + Paper 纸张 - + Paper size 纸张大小 - + Print Layout 打印方式 - + Duplex 双面打印 - + N-up printing 并列打印 - + 2 pages/sheet, 1×2 每页2版 1×2 - + 4 pages/sheet, 2×2 每页4版 2×2 - + 6 pages/sheet, 2×3 每页6版 2×3 - + 9 pages/sheet, 3×3 每页9版 3×3 - + 16 pages/sheet, 4×4 每页16版 4×4 - + Layout direction 并打顺序 - + Page Order 打印顺序 - + Collate pages 逐份打印 - + Print pages in order 按顺序打印 - + Front to back 由前向后 - + Back to front 由后向前 - + Watermark 水印 - + Add watermark 添加水印 - + Text watermark 文字水印 - + Confidential 绝密 - + Draft 草稿 - + Sample 样本 - + Custom 自定义 - + Input your text 请输入自定义水印 - + Picture watermark 图片水印 - + Layout 布局 - + Tile 平铺 - + Center 居中 - + Angle 倾度 - + Size 大小 - + Transparency 透明度 - + + Print to PDF 存为PDF - + + Save as Image 另存为图片 - + Collapse 收起 - - + + Flip on short edge 短边翻转 - - + + + Flip on long edge 长边翻转 - + Input page numbers please 请输入打印页码 - + Maximum page number reached 超出打印范围 - + Input English comma please 请输入英文逗号 - + Input page numbers like this: 1,3,5-7,11-15,18,21 请输入正确格式,例:1,3,5-7,11-15,18,21 - + Save button 保 存 - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 可输入格式:1,3,5-7,11-15,18,21 - + Save as PDF 保存为PDF - + Save as image 保存为图片 - + Images 图片文件 @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential 绝密 - - + + Draft 草稿 - - + + Sample 样本 @@ -562,7 +564,7 @@ DSearchEdit - + Search 搜索 @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel 取消 - + Replace 替换 - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately 此快捷键与%1冲突,点击添加使这个快捷键立即生效 @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut 请输入新的快捷键 - + None - DSplitScreenWidget + DTextEdit - - Unmaximize - 还原 + + Stop reading + 停止朗读 - - Maximize - 最大化 + + Text to Speech + 语音朗读 - - Tile window to left of screen - 将窗口拼贴到左侧 + + Translate + 翻译 - - Tile window to right of screen - 将窗口拼贴到右侧 + + Speech To Text + 语音听写 - DTextEdit + DToolbarEditPanel - - Stop reading - 停止朗读 + + Default toolset + 默认项目组 - - Text to Speech - 语音朗读 + + Drag your favorite items into the toolbar + 将喜爱的项目拖入工具栏 - - Translate - 翻译 + + Drag below items into the toolbar to restore defaults + 将该组项目拖入工具栏以恢复默认 - - Speech To Text - 语音听写 + + Confirm + 确定 PickColorWidget - + Color 颜色 @@ -655,17 +657,17 @@ QLineEdit - + &Copy 复制(&C) - + Cu&t 剪切(&T) - + Select All 全选 @@ -673,20 +675,72 @@ QObject - + No search result 无搜索结果 - + Restore Defaults 恢复默认 + + + Version + 版本 + + + + Features + 版本特性 + + + + Homepage + 主页 + + + + Description + 描述 + + + + Acknowledgements + 致谢 + + + + + + Sincerely appreciate the open-source software used. + 致谢所使用的开源软件 + + + + open-source software + 开源软件 + + + + Continue + 继续 + + + + Learn More + 了解更多 + + + + Credits + 许可 + QWidgetTextControl - + Select All 全选 @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut 请输入新的快捷键 @@ -702,44 +756,49 @@ TitleBarMenu - + Theme 主题 - + Light Theme 浅色 - + Dark Theme 深色 - + System Theme 跟随系统 - + Help 帮助 - + Feedback 反馈 - + + Custom toolbar + 自定义工具栏 + + + About 关于 - + Exit 退出 - \ No newline at end of file + diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_zh_HK.ts dtkwidget-5.6.12/src/translations/dtkwidget_zh_HK.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_zh_HK.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_zh_HK.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,18 +1,15 @@ + + + DAboutDialog - - Acknowledgements - 鳴謝 - - - - Version: %1 - 版本:%1 - - - + %1 is released under %2 %1遵循%2協議發佈 @@ -20,87 +17,87 @@ DCrumbEdit - + Black 黑色 - + White 白色 - + Dark Gray 深灰色 - + Gray 灰色 - + Light Gray 淺灰色 - + Red 紅色 - + Green 綠色 - + Blue 藍色 - + Cyan 青色 - + Magenta 洋紅色 - + Yellow 黃色 - + Dark Red 深紅色 - + Dark Green 深綠色 - + Dark Blue 深藍色 - + Dark Cyan 深青色 - + Dark Magenta 深紫紅色 - + Dark Yellow 深黃色 @@ -108,12 +105,12 @@ DInputDialog - + Cancel 取消 - + Confirm 確定 @@ -121,7 +118,7 @@ DKeySequenceEdit - + Enter a new shortcut 請輸入新的快捷鍵 @@ -129,22 +126,22 @@ DLineEdit - + Stop reading 停止朗讀 - + Text to Speech 語音朗讀 - + Translate 翻譯 - + Speech To Text 語音聽寫 @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced - 進階 + 高级设置 - + Cancel button 取 消 - - + + Print button 打 印 - + Basic - 基本 + 基礎設置 - + Printer - 印表機 + 打印機 - + Copies - 份數 + 打印份數 - + Page range - 列印範圍 + 頁碼範圍 - + All - 所有 + 全部 - + Current page - 目前頁面 + 當前頁 - + Select pages - 選擇頁面 + 指定頁面 - + Orientation - 方向 + 打印方向 - + Portrait - 直向 + 縱向 - + Landscape 橫向 - + Pages - 頁面 + 頁面設置 - + Color mode - 彩色模式 + 色彩 - - - + + + + + Color 彩色 - - - + + + Grayscale - 灰階 + 黑白 - + Margins - 邊界 + 頁邊距 - + Narrow (mm) 窄 (mm) - + Normal (mm) - 標準 (mm) + 普通 (mm) - + Moderate (mm) - 中等 (mm) + 適中 (mm) - + Customize (mm) - 自訂 (mm) + 自定義 (mm) - + Top - + Left - + Bottom - + Right - + Scaling 縮放 - + Actual size 實際大小 - + Scale - 比例 + 自定義比例 - + Paper 紙張 - + Paper size 紙張大小 - + Print Layout 打印方式 - + Duplex - 雙面 + 雙面打印 - + N-up printing 並列打印 - + 2 pages/sheet, 1×2 每頁2版 1×2 - + 4 pages/sheet, 2×2 每頁4版 2×2 - + 6 pages/sheet, 2×3 每頁6版 2×3 - + 9 pages/sheet, 3×3 每頁9版 3×3 - + 16 pages/sheet, 4×4 每頁16版 4×4 - + Layout direction 並打順序 - + Page Order 打印順序 - + Collate pages 逐份打印 - + Print pages in order 按順序打印 - + Front to back 由前向後 - + Back to front 由後向前 - + Watermark 水印 - + Add watermark 添加水印 - + Text watermark 文字水印 - + Confidential 絕密 - + Draft 草稿 - + Sample 樣本 - + Custom 自定義 - + Input your text 請輸入自定義水印 - + Picture watermark 圖片水印 - + Layout - 打印方式 + 佈局 - + Tile 平鋪 - + Center 居中 - + Angle 傾度 - + Size 大小 - + Transparency 透明度 - + + Print to PDF - 打印至 PDF + 存為PDF - + + Save as Image 另存為圖片 - + Collapse 收起 - - + + Flip on short edge - 從短邊翻頁 + 短邊翻轉 - - + + + Flip on long edge - 從長邊翻頁 + 長邊翻轉 - + Input page numbers please 請輸入打印頁碼 - + Maximum page number reached 超出打印範圍 - + Input English comma please 請輸入英文逗號 - + Input page numbers like this: 1,3,5-7,11-15,18,21 請輸入正確格式,例:1,3,5-7,11-15,18,21 - + Save button - 儲 存 + 保 存 - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 可輸入格式:1,3,5-7,11-15,18,21 - + Save as PDF - 儲存為 PDF + 保存為PDF - + Save as image 保存為圖片 - + Images 圖片文件 @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential 絕密 - - + + Draft 草稿 - - + + Sample 樣本 @@ -562,7 +564,7 @@ DSearchEdit - + Search 搜索 @@ -570,17 +572,17 @@ DSettingsDialog - + Cancel 取消 - + Replace 替換 - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately 此快捷鍵與%1衝突,點擊添加使這個快捷鍵立即生效 @@ -588,66 +590,66 @@ DShortcutEdit - + Please input a new shortcut 請輸入新的快捷鍵 - + None - DSplitScreenWidget + DTextEdit - - Unmaximize - 還原 + + Stop reading + 停止朗讀 - - Maximize - 最大化 + + Text to Speech + 語音朗讀 - - Tile window to left of screen - 將窗口拼貼到左側 + + Translate + 翻譯 - - Tile window to right of screen - 將窗口拼貼到右側 + + Speech To Text + 語音聽寫 - DTextEdit + DToolbarEditPanel - - Stop reading - 停止朗讀 + + Default toolset + 默認項目組 - - Text to Speech - 語音朗讀 + + Drag your favorite items into the toolbar + 將喜愛的項目拖入工具欄 - - Translate - 翻譯 + + Drag below items into the toolbar to restore defaults + 將該組項目拖入工具欄以恢復默認 - - Speech To Text - 語音聽寫 + + Confirm + 確定 PickColorWidget - + Color 顏色 @@ -655,17 +657,17 @@ QLineEdit - + &Copy 複製(&C) - + Cu&t 剪切(&T) - + Select All 全選 @@ -673,20 +675,72 @@ QObject - + No search result 無搜索結果 - + Restore Defaults 恢復默認 + + + Version + 版本 + + + + Features + 版本特性 + + + + Homepage + 主頁 + + + + Description + 描述 + + + + Acknowledgements + 致謝 + + + + + + Sincerely appreciate the open-source software used. + 致謝所使用的開源軟件 + + + + open-source software + 開源軟件 + + + + Continue + 繼續 + + + + Learn More + 了解更多 + + + + Credits + 許可 + QWidgetTextControl - + Select All 全選 @@ -694,7 +748,7 @@ ShortcutEdit - + Please enter a new shortcut 請輸入新的快捷鍵 @@ -702,44 +756,49 @@ TitleBarMenu - + Theme 主題 - + Light Theme - 淺色主題 + 淺色 - + Dark Theme - 深色主題 + 深色 - + System Theme - 系統主題 + 跟隨系統 - + Help 幫助 - + Feedback 反饋 - + + Custom toolbar + 自定義工具欄 + + + About 關於 - + Exit 退出 - \ No newline at end of file + diff -Nru dtkwidget-5.5.48/src/translations/dtkwidget_zh_TW.ts dtkwidget-5.6.12/src/translations/dtkwidget_zh_TW.ts --- dtkwidget-5.5.48/src/translations/dtkwidget_zh_TW.ts 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/translations/dtkwidget_zh_TW.ts 2023-05-15 03:42:41.000000000 +0000 @@ -1,119 +1,116 @@ + + + DAboutDialog - - Acknowledgements - 鳴謝 - - - - Version: %1 - 版本:%1 - - - + %1 is released under %2 - %1 遵循 %2 發布 + %1遵循%2協議發布 DCrumbEdit - + Black 黑色 - + White 白色 - + Dark Gray - 暗灰 + 深灰色 - + Gray 灰色 - + Light Gray - 亮灰 + 淺灰色 - + Red 紅色 - + Green 綠色 - + Blue 藍色 - + Cyan 青色 - + Magenta - 洋紅 + 洋紅色 - + Yellow 黃色 - + Dark Red - 暗紅 + 深紅色 - + Dark Green - 暗綠 + 深綠色 - + Dark Blue - 暗藍 + 深藍色 - + Dark Cyan - 暗青 + 深青色 - + Dark Magenta - 暗洋紅 + 深紫紅色 - + Dark Yellow - 暗黃 + 深黃色 DInputDialog - + Cancel 取消 - + Confirm 確定 @@ -121,30 +118,30 @@ DKeySequenceEdit - + Enter a new shortcut - 請輸入新快速鍵 + 請輸入新的快捷鍵 DLineEdit - + Stop reading 停止朗讀 - + Text to Speech 語音朗讀 - + Translate 翻譯 - + Speech To Text 語音聽寫 @@ -152,388 +149,393 @@ DPrintPreviewDialogPrivate - - + + Advanced 進階設定 - + Cancel button 取 消 - - + + Print button - 列 印 + 打 印 - + Basic 基礎設定 - + Printer 印表機 - + Copies 列印份數 - + Page range 頁碼範圍 - + All 全部 - + Current page 目前頁 - + Select pages 指定頁面 - + Orientation 列印方向 - + Portrait 縱向 - + Landscape 橫向 - + Pages 頁面設定 - + Color mode 色彩 - - - + + + + + Color 彩色 - - - + + + Grayscale 黑白 - + Margins 頁邊距 - + Narrow (mm) 窄 (mm) - + Normal (mm) 普通 (mm) - + Moderate (mm) 適中 (mm) - + Customize (mm) 自訂 (mm) - + Top - + Left - + Bottom - + Right - + Scaling 縮放 - + Actual size 實際大小 - + Scale 自訂比例 - + Paper 紙張 - + Paper size 紙張大小 - + Print Layout 列印方式 - + Duplex 雙面列印 - + N-up printing 並列列印 - + 2 pages/sheet, 1×2 每頁2版 1×2 - + 4 pages/sheet, 2×2 每頁4版 2×2 - + 6 pages/sheet, 2×3 每頁6版 2×3 - + 9 pages/sheet, 3×3 每頁9版 3×3 - + 16 pages/sheet, 4×4 每頁16版 4×4 - + Layout direction 並打順序 - + Page Order 列印順序 - + Collate pages 逐份列印 - + Print pages in order 按順序列印 - + Front to back 由前向後 - + Back to front 由後向前 - + Watermark - 水印 + 浮水印 - + Add watermark - 添加水印 + 添加浮水印 - + Text watermark - 文字水印 + 文字浮水印 - + Confidential - 絕密 + 機密 - + Draft 草稿 - + Sample 樣本 - + Custom 自訂 - + Input your text - 請輸入自定義水印 + 請輸入自訂浮水印 - + Picture watermark - 圖片水印 + 圖片浮水印 - + Layout - 列印方式 + 布局 - + Tile 平鋪 - + Center 居中 - + Angle 傾度 - + Size 大小 - + Transparency 透明度 - + + Print to PDF 存為PDF - + + Save as Image 另存為圖片 - + Collapse 收起 - - + + Flip on short edge 短邊翻轉 - - + + + Flip on long edge 長邊翻轉 - + Input page numbers please 請輸入列印頁碼 - + Maximum page number reached 超出列印範圍 - + Input English comma please 請輸入英文逗號 - + Input page numbers like this: 1,3,5-7,11-15,18,21 請輸入正確格式,例:1,3,5-7,11-15,18,21 - + Save button 儲 存 - + *.pdf *.pdf - + For example, 1,3,5-7,11-15,18,21 可輸入格式:1,3,5-7,11-15,18,21 - + Save as PDF 儲存為PDF - + Save as image - 保存為圖片 + 儲存為圖片 - + Images 圖片文件 @@ -541,20 +543,20 @@ DPrintPreviewWidget - - + + Confidential - 絕密 + 機密 - - + + Draft 草稿 - - + + Sample 樣本 @@ -562,7 +564,7 @@ DSearchEdit - + Search 搜尋 @@ -570,84 +572,84 @@ DSettingsDialog - + Cancel 取消 - + Replace 取代 - + This shortcut conflicts with %1, click on Add to make this shortcut effective immediately - 此快速鍵與 %1 衝突,請按下「加入」以使此快速鍵立即生效。 + 此快捷鍵與%1衝突,點擊添加使這個快捷鍵立即生效 DShortcutEdit - + Please input a new shortcut - 請輸入新快速鍵 + 請輸入新的快捷鍵 - + None - DSplitScreenWidget + DTextEdit - - Unmaximize - 還原 + + Stop reading + 停止朗讀 - - Maximize - 最大化 + + Text to Speech + 語音朗讀 - - Tile window to left of screen - 將視窗拼貼到左側 + + Translate + 翻譯 - - Tile window to right of screen - 將視窗拼貼到右側 + + Speech To Text + 語音聽寫 - DTextEdit + DToolbarEditPanel - - Stop reading - 停止朗讀 + + Default toolset + 預設項目組 - - Text to Speech - 語音朗讀 + + Drag your favorite items into the toolbar + 將喜愛的項目拖入工具列 - - Translate - 翻譯 + + Drag below items into the toolbar to restore defaults + 將該組項目拖入工具列以復原預設 - - Speech To Text - 語音聽寫 + + Confirm + 確定 PickColorWidget - + Color 顏色 @@ -655,17 +657,17 @@ QLineEdit - + &Copy 複製(&C) - + Cu&t 剪下(&T) - + Select All 全選 @@ -673,20 +675,72 @@ QObject - + No search result - 沒有搜尋結果 + 無搜尋結果 - + Restore Defaults - 還原預設值 + 復原預設 + + + + Version + 版本 + + + + Features + 版本特性 + + + + Homepage + 首頁 + + + + Description + 描述 + + + + Acknowledgements + 致謝 + + + + + + Sincerely appreciate the open-source software used. + 致謝所使用的開源軟體 + + + + open-source software + 開源軟體 + + + + Continue + 繼續 + + + + Learn More + 了解更多 + + + + Credits + 許可 QWidgetTextControl - + Select All 全選 @@ -694,52 +748,57 @@ ShortcutEdit - + Please enter a new shortcut - 請輸入新快速鍵 + 請輸入新的快捷鍵 TitleBarMenu - + Theme 主題 - + Light Theme - 亮色主題 + 淺色 - + Dark Theme - 暗色主題 + 深色 - + System Theme - 系統主題 + 跟隨系統 - + Help - 說明 + 幫助 - + Feedback 回饋 - + + Custom toolbar + 自訂工具列 + + + About 關於 - + Exit 退出 - \ No newline at end of file + diff -Nru dtkwidget-5.5.48/src/util/daccessibilitychecker.cpp dtkwidget-5.6.12/src/util/daccessibilitychecker.cpp --- dtkwidget-5.5.48/src/util/daccessibilitychecker.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/daccessibilitychecker.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,8 @@ -/* - * Copyright (C) 2021 ~ 2021 Uniontech Technology Co., Ltd. - * - * Author: Chen Bin - * - * Maintainer: Chen Bin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + + #include "daccessibilitychecker.h" #include diff -Nru dtkwidget-5.5.48/src/util/daccessibilitychecker.h dtkwidget-5.6.12/src/util/daccessibilitychecker.h --- dtkwidget-5.5.48/src/util/daccessibilitychecker.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/daccessibilitychecker.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2021 ~ 2021 Uniontech Technology Co., Ltd. - * - * Author: Chen Bin - * - * Maintainer: Chen Bin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DACCESSIBILITYCHECKER_H -#define DACCESSIBILITYCHECKER_H - -#include "dtkwidget_global.h" - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DAccessibilityCheckerPrivate; -class LIBDTKWIDGETSHARED_EXPORT DAccessibilityChecker : public QObject, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DAccessibilityChecker) - Q_PROPERTY(OutputFormat outputFormat READ outputFormat WRITE setOutputFormat) - -public: - enum OutputFormat { - AssertFormat, - FullFormat - }; - - enum Role { - Widget, - ViewItem - }; - - explicit DAccessibilityChecker(QObject *parent = nullptr); - - void setOutputFormat(OutputFormat format); - OutputFormat outputFormat() const; - - bool check(); - void start(int msec = 3000); - -protected: - virtual bool isIgnore(Role role, const QWidget *w); - -private: - D_PRIVATE_SLOT(void _q_checkTimeout()) -}; - -DWIDGET_END_NAMESPACE -#endif // DACCESSIBILITYCHECKER_H diff -Nru dtkwidget-5.5.48/src/util/dapplicationsettings.cpp dtkwidget-5.6.12/src/util/dapplicationsettings.cpp --- dtkwidget-5.5.48/src/util/dapplicationsettings.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dapplicationsettings.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,50 +1,21 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#include "dapplicationsettings.h" +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later -#include -#include -#ifdef Q_OS_LINUX -#include -#endif -#include +#include "dapplicationsettings.h" -#define PALETTE_TYPE_KEY "paletteType" +#include -DGUI_USE_NAMESPACE DWIDGET_BEGIN_NAMESPACE class DApplicationSettingsPrivate : public DCORE_NAMESPACE::DObjectPrivate { public: DApplicationSettingsPrivate(DApplicationSettings *qq); - void init(); void _q_onChanged(const QString &key); void _q_onPaletteTypeChanged(); -#ifdef Q_OS_LINUX - QGSettings *genericSettings; -#endif - D_DECLARE_PUBLIC(DApplicationSettings) }; @@ -54,71 +25,20 @@ } -void DApplicationSettingsPrivate::init() -{ -#ifdef Q_OS_LINUX - D_Q(DApplicationSettings); - - const QString &on = qApp->organizationName(); - const QString &name = qApp->applicationName(); - - if (on.isEmpty() || name.isEmpty()) { - qFatal("%s\n", "Must set organizationName & applicationName"); - std::abort(); - } - - if (!QGSettings::isSchemaInstalled("com.deepin.dtk")) - return; - - genericSettings = new QGSettings("com.deepin.dtk", QString("/dtk/%2/%3/").arg(on, name).toLocal8Bit(), q); - // 初始化设置 - _q_onChanged(PALETTE_TYPE_KEY); - - q->connect(genericSettings, SIGNAL(changed(const QString &)), q, SLOT(_q_onChanged(const QString &))); - q->connect(DGuiApplicationHelper::instance(), SIGNAL(paletteTypeChanged(ColorType)), - q, SLOT(_q_onPaletteTypeChanged())); -#endif -} - -void DApplicationSettingsPrivate::_q_onChanged(const QString &key) +void DApplicationSettingsPrivate::_q_onChanged(const QString &) { -#ifdef Q_OS_LINUX - if (key != PALETTE_TYPE_KEY) - return; - - const QString &palette_type = genericSettings->get(PALETTE_TYPE_KEY).toString(); - - if (palette_type == "LightType") { - DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::LightType); - } else if (palette_type == "DarkType") { - DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::DarkType); - } else if (palette_type == "UnknownType") { - DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::UnknownType); - } -#endif } void DApplicationSettingsPrivate::_q_onPaletteTypeChanged() { -#ifdef Q_OS_LINUX - switch (DGuiApplicationHelper::instance()->paletteType()) { - case DGuiApplicationHelper::LightType: - genericSettings->set(PALETTE_TYPE_KEY, "LightType"); - break; - case DGuiApplicationHelper::DarkType: - genericSettings->set(PALETTE_TYPE_KEY, "DarkType"); - break; - default: - genericSettings->set(PALETTE_TYPE_KEY, "UnknownType"); - break; - } -#endif } /*! \class Dtk::Widget::DApplicationSettings \inmodule dtkwidget + \deprecated The feature has been moved to DGuiApplicationHelper, + We can disable it by setting DGuiApplicationHelper::DontSaveApplicationTheme enum with setAttribute. \brief DApplicationSettings保存应用程序的设置. DApplicationSettings存储程序的通用性设置的信息,如当前选择的主题 @@ -133,7 +53,6 @@ : QObject(parent) , DObject(*new DApplicationSettingsPrivate(this)) { - d_func()->init(); } DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/util/dapplicationsettings.h dtkwidget-5.6.12/src/util/dapplicationsettings.h --- dtkwidget-5.5.48/src/util/dapplicationsettings.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dapplicationsettings.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DAPPLICATIONSETTINGS_H -#define DAPPLICATIONSETTINGS_H - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DApplicationSettingsPrivate; -class DApplicationSettings : public QObject, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DApplicationSettings) - -public: - explicit DApplicationSettings(QObject *parent = nullptr); - -private: - D_PRIVATE_SLOT(void _q_onChanged(const QString &)) - D_PRIVATE_SLOT(void _q_onPaletteTypeChanged()) -}; - -DWIDGET_END_NAMESPACE - -#endif // DAPPLICATIONSETTINGS_H diff -Nru dtkwidget-5.5.48/src/util/DDesktopServices dtkwidget-5.6.12/src/util/DDesktopServices --- dtkwidget-5.5.48/src/util/DDesktopServices 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/DDesktopServices 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "ddesktopservices.h" diff -Nru dtkwidget-5.5.48/src/util/ddesktopservices.h dtkwidget-5.6.12/src/util/ddesktopservices.h --- dtkwidget-5.5.48/src/util/ddesktopservices.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/ddesktopservices.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DDESKTOPSERVICES_H -#define DDESKTOPSERVICES_H - -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DDesktopServices -{ -public: - -#ifdef Q_OS_LINUX - enum SystemSoundEffect { - SSE_Notifications, - SEE_Screenshot, - SSE_EmptyTrash, - SSE_SendFileComplete, - SSE_BootUp, - SSE_Shutdown, - SSE_Logout, - SSE_WakeUp, - SSE_VolumeChange, - SSE_LowBattery, - SSE_PlugIn, - SSE_PlugOut, - SSE_DeviceAdded, - SSE_DeviceRemoved, - SSE_Error, - }; -#endif - - static bool showFolder(QString localFilePath, const QString &startupId = QString()); - static bool showFolders(const QList localFilePaths, const QString &startupId = QString()); - static bool showFolder(QUrl url, const QString &startupId = QString()); - static bool showFolders(const QList urls, const QString &startupId = QString()); - - static bool showFileItemPropertie(QString localFilePath, const QString &startupId = QString()); - static bool showFileItemProperties(const QList localFilePaths, const QString &startupId = QString()); - static bool showFileItemPropertie(QUrl url, const QString &startupId = QString()); - static bool showFileItemProperties(const QList urls, const QString &startupId = QString()); - - static bool showFileItem(QString localFilePath, const QString &startupId = QString()); - static bool showFileItems(const QList localFilePaths, const QString &startupId = QString()); - static bool showFileItem(QUrl url, const QString &startupId = QString()); - static bool showFileItems(const QList urls, const QString &startupId = QString()); - - static bool trash(QString localFilePath); - static bool trash(const QList localFilePaths); - static bool trash(QUrl urlstartupId); - static bool trash(const QList urls); - -#ifdef Q_OS_LINUX - static bool playSystemSoundEffect(const SystemSoundEffect &effect); - static bool playSystemSoundEffect(const QString &name); - static bool previewSystemSoundEffect(const SystemSoundEffect &effect); - static bool previewSystemSoundEffect(const QString &name); - static QString getNameByEffectType(const SystemSoundEffect &effect); -#endif - - static QString errorMessage(); -}; - -DWIDGET_END_NAMESPACE - -#ifdef Q_OS_LINUX -Q_DECLARE_METATYPE(DTK_WIDGET_NAMESPACE::DDesktopServices::SystemSoundEffect) -#endif - -#endif // DDESKTOPSERVICES_H diff -Nru dtkwidget-5.5.48/src/util/ddesktopservices_linux.cpp dtkwidget-5.6.12/src/util/ddesktopservices_linux.cpp --- dtkwidget-5.5.48/src/util/ddesktopservices_linux.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/ddesktopservices_linux.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,24 +1,9 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "ddesktopservices.h" - -#include -#include +#include #include #include #include @@ -227,11 +212,19 @@ return false; } +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + const auto& infc = QDBusConnection::sessionBus().interface(); + QStringList activatableServiceNames = infc->activatableServiceNames(); + bool isNewInterface = activatableServiceNames.contains(QLatin1String("org.deepin.dde.SoundEffect1")); +#else + bool isNewInterface = false; // Qt 5.14 以下就直接用旧的接口 +#endif + const QLatin1String service(isNewInterface ? "org.deepin.dde.SoundEffect1" :"com.deepin.daemon.SoundEffect"); + const QLatin1String path(isNewInterface ? "/org/deepin/dde/SoundEffect1" : "/com/deepin/daemon/SoundEffect"); + const QLatin1String interface(isNewInterface ? "org.deepin.dde.SoundEffect1" :"com.deepin.daemon.SoundEffect"); + // 使用后端 dbus 接口播放系统音频,音频存放目录: /usr/share/sounds/deepin/stereo/ - QDBusInterface interface(QStringLiteral("com.deepin.daemon.SoundEffect"), - QStringLiteral("/com/deepin/daemon/SoundEffect"), - QStringLiteral("com.deepin.daemon.SoundEffect")); - return interface.call("PlaySound", name).type() != QDBusMessage::ErrorMessage; + return QDBusInterface(service, path, interface).call("PlaySound", name).type() != QDBusMessage::ErrorMessage; } QString DDesktopServices::getNameByEffectType(const DDesktopServices::SystemSoundEffect &effect) diff -Nru dtkwidget-5.5.48/src/util/ddesktopservices_win.cpp dtkwidget-5.6.12/src/util/ddesktopservices_win.cpp --- dtkwidget-5.5.48/src/util/ddesktopservices_win.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/ddesktopservices_win.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "ddesktopservices.h" diff -Nru dtkwidget-5.5.48/src/util/desktop.pri dtkwidget-5.6.12/src/util/desktop.pri --- dtkwidget-5.5.48/src/util/desktop.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/desktop.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -HEADERS += \ - $$PWD/ddesktopservices.h \ - $$PWD/dtrashmanager.h - -linux { - qtHaveModule(dbus) { - QT += dbus - SOURCES += $$PWD/ddesktopservices_linux.cpp - } - - CONFIG += link_pkgconfig - PKGCONFIG += gsettings-qt - - SOURCES += \ - $$PWD/dtrashmanager_linux.cpp -} else:win* { - SOURCES += \ - $$PWD/ddesktopservices_win.cpp \ - $$PWD/dtrashmanager_win.cpp -} else:mac* { - SOURCES += \ - $$PWD/ddesktopservices_win.cpp \ - $$PWD/dtrashmanager_win.cpp -} - -includes.files += $$PWD/*.h -includes.files += $$PWD/*.cpp -includes.files += \ - $$PWD/DDesktopServices \ - $$PWD/DTrashManager diff -Nru dtkwidget-5.5.48/src/util/DFileIconProvider dtkwidget-5.6.12/src/util/DFileIconProvider --- dtkwidget-5.5.48/src/util/DFileIconProvider 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/DFileIconProvider 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dfileiconprovider.h" diff -Nru dtkwidget-5.5.48/src/util/dfileiconprovider.cpp dtkwidget-5.6.12/src/util/dfileiconprovider.cpp --- dtkwidget-5.5.48/src/util/dfileiconprovider.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dfileiconprovider.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/src/util/dfileiconprovider.h dtkwidget-5.6.12/src/util/dfileiconprovider.h --- dtkwidget-5.5.48/src/util/dfileiconprovider.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dfileiconprovider.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DFILEICONPROVIDER_H -#define DFILEICONPROVIDER_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DFileIconProviderPrivate; -class DFileIconProvider : public QFileIconProvider, public DTK_CORE_NAMESPACE::DObject -{ -public: - DFileIconProvider(); - virtual ~DFileIconProvider() Q_DECL_OVERRIDE; - - static DFileIconProvider *globalProvider(); - - QIcon icon(const QFileInfo &info) const Q_DECL_OVERRIDE; - QIcon icon(const QFileInfo &info, const QIcon &feedback) const; - -private: - D_DECLARE_PRIVATE(DFileIconProvider) - Q_DISABLE_COPY(DFileIconProvider) -}; - -DWIDGET_END_NAMESPACE - -#endif // DFILEICONPROVIDER_H diff -Nru dtkwidget-5.5.48/src/util/DHiDPIHelper dtkwidget-5.6.12/src/util/DHiDPIHelper --- dtkwidget-5.5.48/src/util/DHiDPIHelper 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/DHiDPIHelper 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dhidpihelper.h" diff -Nru dtkwidget-5.5.48/src/util/dhidpihelper.cpp dtkwidget-5.6.12/src/util/dhidpihelper.cpp --- dtkwidget-5.5.48/src/util/dhidpihelper.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dhidpihelper.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dhidpihelper.h" #include diff -Nru dtkwidget-5.5.48/src/util/dhidpihelper.h dtkwidget-5.6.12/src/util/dhidpihelper.h --- dtkwidget-5.5.48/src/util/dhidpihelper.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dhidpihelper.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#ifndef DHIDPIHELPER_H -#define DHIDPIHELPER_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DHiDPIHelper -{ -public: - static QPixmap loadNxPixmap(const QString &fileName); -}; - -DWIDGET_END_NAMESPACE - -#endif // DHIDPIHELPER_H diff -Nru dtkwidget-5.5.48/src/util/dregionmonitor.cpp dtkwidget-5.6.12/src/util/dregionmonitor.cpp --- dtkwidget-5.5.48/src/util/dregionmonitor.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dregionmonitor.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dregionmonitor.h" #include "private/dregionmonitor_p.h" diff -Nru dtkwidget-5.5.48/src/util/dregionmonitor.h dtkwidget-5.6.12/src/util/dregionmonitor.h --- dtkwidget-5.5.48/src/util/dregionmonitor.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dregionmonitor.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -#ifndef DREGIONMONITOR_H_DWIDGET -#define DREGIONMONITOR_H_DWIDGET - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DRegionMonitorPrivate; -class D_DECL_DEPRECATED_X("Use libdtkgui") DRegionMonitor : public QObject - , public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DRegionMonitor) - Q_DISABLE_COPY(DRegionMonitor) - Q_PROPERTY(CoordinateType coordinateType READ coordinateType WRITE setCoordinateType NOTIFY coordinateTypeChanged) - -public: - explicit DRegionMonitor(QObject *parent = nullptr); - - enum WatchedFlags { - Button_Left = 1, - Button_Right = 3, - }; - - enum CoordinateType { - ScaleRatio, - Original - }; - Q_ENUM(CoordinateType) - - bool registered() const; - QRegion watchedRegion() const; - CoordinateType coordinateType() const; - -Q_SIGNALS: - void buttonPress(const QPoint &p, const int flag) const; - void buttonRelease(const QPoint &p, const int flag) const; - void cursorMove(const QPoint &p) const; - void keyPress(const QString &keyname) const; - void keyRelease(const QString &keyname) const; - void coordinateTypeChanged(CoordinateType type) const; - -public Q_SLOTS: - void registerRegion(); - inline void registerRegion(const QRegion ®ion) - { - setWatchedRegion(region); - registerRegion(); - } - void unregisterRegion(); - void setWatchedRegion(const QRegion ®ion); - void setCoordinateType(CoordinateType type); -}; - -DWIDGET_END_NAMESPACE - -#endif // DREGIONMONITOR_H_DWIDGET diff -Nru dtkwidget-5.5.48/src/util/dthumbnailprovider.cpp dtkwidget-5.6.12/src/util/dthumbnailprovider.cpp --- dtkwidget-5.5.48/src/util/dthumbnailprovider.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dthumbnailprovider.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dthumbnailprovider.h" #include diff -Nru dtkwidget-5.5.48/src/util/dthumbnailprovider.h dtkwidget-5.6.12/src/util/dthumbnailprovider.h --- dtkwidget-5.5.48/src/util/dthumbnailprovider.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dthumbnailprovider.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DTKWIDGET_DFILETHUMBNAILPROVIDER_H -#define DTKWIDGET_DFILETHUMBNAILPROVIDER_H - -#include -#include - -#include -#include - -#include - -QT_BEGIN_NAMESPACE -class QMimeType; -QT_END_NAMESPACE - -DWIDGET_BEGIN_NAMESPACE - -class DThumbnailProviderPrivate; -class D_DECL_DEPRECATED_X("Use libdtkgui") DThumbnailProvider : public QThread, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - -public: - enum Size { - Small = 64, - Normal = 128, - Large = 256, - }; - - static DThumbnailProvider *instance(); - - bool hasThumbnail(const QFileInfo &info) const; - bool hasThumbnail(const QMimeType &mimeType) const; - - QString thumbnailFilePath(const QFileInfo &info, Size size) const; - - QString createThumbnail(const QFileInfo &info, Size size); - typedef std::function CallBack; - void appendToProduceQueue(const QFileInfo &info, Size size, CallBack callback = 0); - void removeInProduceQueue(const QFileInfo &info, Size size); - - QString errorString() const; - - qint64 defaultSizeLimit() const; - void setDefaultSizeLimit(qint64 size); - - qint64 sizeLimit(const QMimeType &mimeType) const; - void setSizeLimit(const QMimeType &mimeType, qint64 size); - -Q_SIGNALS: - void thumbnailChanged(const QString &sourceFilePath, const QString &thumbnailPath) const; - void createThumbnailFinished(const QString &sourceFilePath, const QString &thumbnailPath) const; - void createThumbnailFailed(const QString &sourceFilePath) const; - -protected: - explicit DThumbnailProvider(QObject *parent = 0); - ~DThumbnailProvider(); - - void run() Q_DECL_OVERRIDE; - -private: - D_DECLARE_PRIVATE(DThumbnailProvider) -}; - -DWIDGET_END_NAMESPACE - -#endif // DTKWIDGET_DFILETHUMBNAILPROVIDER_H diff -Nru dtkwidget-5.5.48/src/util/dtrashmanager.h dtkwidget-5.6.12/src/util/dtrashmanager.h --- dtkwidget-5.5.48/src/util/dtrashmanager.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dtrashmanager.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DTKWIDGET_DTRASHMANAGER_H -#define DTKWIDGET_DTRASHMANAGER_H - -#include - -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DTrashManagerPrivate; -class D_DECL_DEPRECATED_X("Use libdtkcore") DTrashManager : public QObject, public DTK_CORE_NAMESPACE::DObject -{ -public: - static DTrashManager *instance(); - - bool trashIsEmpty() const; - bool cleanTrash(); - bool moveToTrash(const QString &filePath, bool followSymlink = false); - -protected: - DTrashManager(); - -private: - D_DECLARE_PRIVATE(DTrashManager) -}; - -DWIDGET_END_NAMESPACE - -#endif // DTKWIDGET_DTRASHMANAGER_H diff -Nru dtkwidget-5.5.48/src/util/dtrashmanager_linux.cpp dtkwidget-5.6.12/src/util/dtrashmanager_linux.cpp --- dtkwidget-5.5.48/src/util/dtrashmanager_linux.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dtrashmanager_linux.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dtrashmanager.h" diff -Nru dtkwidget-5.5.48/src/util/dtrashmanager_win.cpp dtkwidget-5.6.12/src/util/dtrashmanager_win.cpp --- dtkwidget-5.5.48/src/util/dtrashmanager_win.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dtrashmanager_win.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dtrashmanager.h" diff -Nru dtkwidget-5.5.48/src/util/DWidgetUtil dtkwidget-5.6.12/src/util/DWidgetUtil --- dtkwidget-5.5.48/src/util/DWidgetUtil 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/DWidgetUtil 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dwidgetutil.h" diff -Nru dtkwidget-5.5.48/src/util/dwidgetutil.cpp dtkwidget-5.6.12/src/util/dwidgetutil.cpp --- dtkwidget-5.5.48/src/util/dwidgetutil.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dwidgetutil.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dwidgetutil.h" @@ -105,4 +92,41 @@ return getCircleIcon(pixmap, diameter); } +// 取自Qt源码qpixmapfilter.cpp 945行 +void grayScale(const QImage &image, QImage &dest, const QRect &rect) +{ + QRect destRect = rect; + QRect srcRect = rect; + if (rect.isNull()) { + srcRect = dest.rect(); + destRect = dest.rect(); + } + if (&image != &dest) { + destRect.moveTo(QPoint(0, 0)); + } + + const unsigned int *data = reinterpret_cast(image.bits()); + unsigned int *outData = reinterpret_cast(dest.bits()); + + if (dest.size() == image.size() && image.rect() == srcRect) { + // a bit faster loop for grayscaling everything + int pixels = dest.width() * dest.height(); + for (int i = 0; i < pixels; ++i) { + int val = qGray(data[i]); + outData[i] = qRgba(val, val, val, qAlpha(data[i])); + } + } else { + int yd = destRect.top(); + for (int y = srcRect.top(); y <= srcRect.bottom() && y < image.height(); y++) { + data = reinterpret_cast(image.scanLine(y)); + outData = reinterpret_cast(dest.scanLine(yd++)); + int xd = destRect.left(); + for (int x = srcRect.left(); x <= srcRect.right() && x < image.width(); x++) { + int val = qGray(data[x]); + outData[xd++] = qRgba(val, val, val, qAlpha(data[x])); + } + } + } +} + DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/util/dwidgetutil.h dtkwidget-5.6.12/src/util/dwidgetutil.h --- dtkwidget-5.5.48/src/util/dwidgetutil.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/dwidgetutil.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DUTILITY_H -#define DUTILITY_H - -#include - -#include -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -QImage dropShadow(const QPixmap &px, qreal radius, const QColor &color = Qt::black); - -QStringList wordWrapText(const QString &text, int width, - QTextOption::WrapMode wrapMode, - int *lineCount = 0); - -QStringList elideText(const QString &text, const QSize &size, - const QFontMetrics &fontMetrics, - QTextOption::WrapMode wordWrap, - Qt::TextElideMode mode, - int flags = 0); - -QIcon getCircleIcon(const QPixmap &pixmap, int diameter = 36); -QIcon getCircleIcon(const QIcon &icon, int diameter = 36); - -void moveToCenter(QWidget *w); - -DWIDGET_END_NAMESPACE - -#endif // DUTILITY_H diff -Nru dtkwidget-5.5.48/src/util/private/dregionmonitor_p.h dtkwidget-5.6.12/src/util/private/dregionmonitor_p.h --- dtkwidget-5.5.48/src/util/private/dregionmonitor_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/private/dregionmonitor_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DREGIONMONITOR_P_H_DWIDGET #define DREGIONMONITOR_P_H_DWIDGET diff -Nru dtkwidget-5.5.48/src/util/util.cmake dtkwidget-5.6.12/src/util/util.cmake --- dtkwidget-5.5.48/src/util/util.cmake 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/util/util.cmake 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ +file(GLOB_RECURSE UTIL_HEADERS "${CMAKE_CURRENT_LIST_DIR}/*.h") +file(GLOB_RECURSE UTIL_SOURCES "${CMAKE_CURRENT_LIST_DIR}/*.cpp") +if(LINUX) + list(REMOVE_ITEM UTIL_SOURCES + ${CMAKE_CURRENT_LIST_DIR}/ddesktopservices_win.cpp + ${CMAKE_CURRENT_LIST_DIR}/dtrashmanager_win.cpp) +else() + list(REMOVE_ITEM UTIL_SOURCES + ${CMAKE_CURRENT_LIST_DIR}/ddesktopservices_linux.cpp + ${CMAKE_CURRENT_LIST_DIR}/dtrashmanager_linux.cpp) +endif() +set(UTIL ${UTIL_SOURCES} ${UTIL_HEADERS}) diff -Nru dtkwidget-5.5.48/src/util/util.pri dtkwidget-5.6.12/src/util/util.pri --- dtkwidget-5.5.48/src/util/util.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/util/util.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -INCLUDEPATH += $$PWD - -HEADERS += \ - $$PWD/dfileiconprovider.h \ - $$PWD/dthumbnailprovider.h \ - $$PWD/dwidgetutil.h \ - $$PWD/ddesktopservices.h \ - $$PWD/dtrashmanager.h \ - $$PWD/dhidpihelper.h \ - $$PWD/dapplicationsettings.h \ - $$PWD/daccessibilitychecker.h - -SOURCES += \ - $$PWD/dfileiconprovider.cpp \ - $$PWD/dthumbnailprovider.cpp \ - $$PWD/dwidgetutil.cpp \ - $$PWD/dhidpihelper.cpp \ - $$PWD/dapplicationsettings.cpp \ - $$PWD/daccessibilitychecker.cpp - -linux* { -CONFIG += link_pkgconfig -PKGCONFIG += gsettings-qt - -HEADERS += \ - $$PWD/dregionmonitor.h \ - $$PWD/private/dregionmonitor_p.h - -SOURCES += \ - $$PWD/ddesktopservices_linux.cpp \ - $$PWD/dtrashmanager_linux.cpp \ - $$PWD/dregionmonitor.cpp -} - -win32* | macx* { -SOURCES += \ - $$PWD/ddesktopservices_win.cpp \ - $$PWD/dtrashmanager_win.cpp -} - -packagesExist(gtk+-2.0) { - DEFINES += USE_GTK_PLUS_2_0 - INCLUDE_PATH = $$system(pkg-config --cflags-only-I gtk+-2.0) - INCLUDEPATH += $$replace(INCLUDE_PATH, -I, ) -} - -includes.files += $$PWD/*.h \ - $$PWD/DWidgetUtil \ - $$PWD/DDesktopServices \ - $$PWD/DFileIconProvider \ - $$PWD/DHiDPIHelper - -DISTFILES += \ - $$PWD/desktop.pri \ - $$PWD/DHiDPIHelper Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/src/widgets/assets/icons/bloom/play_next.dci and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/src/widgets/assets/icons/bloom/play_next.dci differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/src/widgets/assets/icons/bloom/play_pause.dci and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/src/widgets/assets/icons/bloom/play_pause.dci differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/src/widgets/assets/icons/bloom/play_previous.dci and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/src/widgets/assets/icons/bloom/play_previous.dci differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/src/widgets/assets/icons/bloom/play_start.dci and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/src/widgets/assets/icons/bloom/play_start.dci differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/src/widgets/assets/icons/bloom/window_menu.dci and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/src/widgets/assets/icons/bloom/window_menu.dci differ Binary files /tmp/tmp05btjr05/quzMWvDSXI/dtkwidget-5.5.48/src/widgets/assets/icons/bloom/window_sidebar.dci and /tmp/tmp05btjr05/NBOtDQFe4P/dtkwidget-5.6.12/src/widgets/assets/icons/bloom/window_sidebar.dci differ diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/actions/printer_dropdown_14px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/actions/printer_dropdown_14px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/actions/printer_dropdown_14px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/actions/printer_dropdown_14px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,17 @@ + + + printer_dropdown_14px_dark + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/actions/printer_dropup_14px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/actions/printer_dropup_14px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/actions/printer_dropup_14px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/actions/printer_dropup_14px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,17 @@ + + + printer_dropup_14px_dark + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/actions/print_previewscale_18px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/actions/print_previewscale_18px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/actions/print_previewscale_18px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/actions/print_previewscale_18px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,10 @@ + + + huanyuan_dark + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/printer_dropdown_14px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/printer_dropdown_14px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/printer_dropdown_14px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/printer_dropdown_14px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ - - - printer_dropdown_14px_dark - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/printer_dropup_14px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/printer_dropup_14px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/printer_dropup_14px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/printer_dropup_14px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ - - - printer_dropup_14px_dark - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/print_previewscale_18px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/print_previewscale_18px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/print_previewscale_18px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/print_previewscale_18px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ - - - huanyuan_dark - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/selection_bottomleft_40px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/selection_bottomleft_40px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/selection_bottomleft_40px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/selection_bottomleft_40px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,24 @@ + + + selection03 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/selection_bottomright_40px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/selection_bottomright_40px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/selection_bottomright_40px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/selection_bottomright_40px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,24 @@ + + + selection04 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/selection_topleft_40px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/selection_topleft_40px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/selection_topleft_40px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/selection_topleft_40px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,20 @@ + + + selection01 + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/selection_topright_40px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/selection_topright_40px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/icons/selection_topright_40px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/icons/selection_topright_40px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,24 @@ + + + selection02 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/texts/fold_14px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/texts/fold_14px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/texts/fold_14px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/texts/fold_14px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/texts/spacer_fixed_34px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/texts/spacer_fixed_34px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/texts/spacer_fixed_34px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/texts/spacer_fixed_34px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dark/texts/spacer_stretch_34px.svg dtkwidget-5.6.12/src/widgets/assets/icons/dark/texts/spacer_stretch_34px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/dark/texts/spacer_stretch_34px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dark/texts/spacer_stretch_34px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/dtk-icon-theme.qrc dtkwidget-5.6.12/src/widgets/assets/icons/dtk-icon-theme.qrc --- dtkwidget-5.5.48/src/widgets/assets/icons/dtk-icon-theme.qrc 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/dtk-icon-theme.qrc 2023-05-15 03:42:41.000000000 +0000 @@ -7,13 +7,9 @@ light/icons/water_back_383px.svg light/icons/water_front_383px.svg light/icons/printer_colorselect_18px.svg - light/icons/printer_dropdown_14px.svg - light/icons/printer_dropup_14px.svg light/icons/printer_landscape_40px.svg light/icons/printer_portrait_40px.svg dark/icons/printer_colorselect_18px.svg - dark/icons/printer_dropdown_14px.svg - dark/icons/printer_dropup_14px.svg dark/icons/printer_landscape_40px.svg dark/icons/printer_portrait_40px.svg light/icons/printer_final_12px.svg @@ -22,8 +18,6 @@ dark/icons/printer_original_12px.svg dark/icons/search_action_36px.svg light/icons/search_action_36px.svg - dark/icons/print_previewscale_18px.svg - light/icons/print_previewscale_18px.svg dark/icons/dorpper_normal_32px.svg light/icons/dorpper_normal_32px.svg dark/icons/titlebar_more_50px.svg @@ -32,6 +26,9 @@ dark/actions/splitscreen_right_36px.svg dark/actions/splitscreen_showmaximize_36px.svg dark/actions/splitscreen_shownormal_36px.svg + light/actions/print_previewscale_18px.svg + light/actions/printer_dropup_14px.svg + light/actions/printer_dropdown_14px.svg light/actions/splitscreen_left_36px.svg light/actions/splitscreen_right_36px.svg light/actions/splitscreen_showmaximize_36px.svg @@ -41,10 +38,35 @@ light/actions/printer_lrtb_3_24px.svg light/actions/printer_lrtb_4_24px.svg light/actions/printer_lrtb_5_24px.svg + dark/actions/print_previewscale_18px.svg + dark/actions/printer_dropdown_14px.svg + dark/actions/printer_dropup_14px.svg + light/texts/spacer_fixed_34px.svg + light/texts/spacer_stretch_34px.svg + light/texts/fold_14px.svg + dark/texts/spacer_fixed_34px.svg + dark/texts/spacer_stretch_34px.svg + dark/texts/fold_14px.svg dark/actions/printer_lrtb_1_24px.svg dark/actions/printer_lrtb_2_24px.svg dark/actions/printer_lrtb_3_24px.svg dark/actions/printer_lrtb_4_24px.svg dark/actions/printer_lrtb_5_24px.svg + dark/icons/selection_bottomleft_40px.svg + dark/icons/selection_topright_40px.svg + dark/icons/selection_topleft_40px.svg + dark/icons/selection_bottomright_40px.svg + light/icons/selection_topright_40px.svg + light/icons/selection_topleft_40px.svg + light/icons/selection_bottomright_40px.svg + light/icons/selection_bottomleft_40px.svg + + + bloom/window_menu.dci + bloom/window_sidebar.dci + bloom/play_start.dci + bloom/play_pause.dci + bloom/play_previous.dci + bloom/play_next.dci diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/actions/printer_dropdown_14px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/actions/printer_dropdown_14px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/actions/printer_dropdown_14px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/actions/printer_dropdown_14px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,12 @@ + + + + printer_dropdown_14px + Created with Sketch. + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/actions/printer_dropup_14px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/actions/printer_dropup_14px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/actions/printer_dropup_14px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/actions/printer_dropup_14px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,14 @@ + + + + printer_dropup_14px + Created with Sketch. + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/actions/print_previewscale_18px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/actions/print_previewscale_18px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/actions/print_previewscale_18px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/actions/print_previewscale_18px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,10 @@ + + + huanyuan_normal + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/printer_dropdown_14px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/printer_dropdown_14px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/printer_dropdown_14px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/printer_dropdown_14px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ - - - - printer_dropdown_14px - Created with Sketch. - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/printer_dropup_14px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/printer_dropup_14px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/printer_dropup_14px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/printer_dropup_14px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ - - - - printer_dropup_14px - Created with Sketch. - - - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/print_previewscale_18px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/print_previewscale_18px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/print_previewscale_18px.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/print_previewscale_18px.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ - - - huanyuan_normal - - - - - - - \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/selection_bottomleft_40px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/selection_bottomleft_40px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/selection_bottomleft_40px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/selection_bottomleft_40px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,24 @@ + + + selection03 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/selection_bottomright_40px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/selection_bottomright_40px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/selection_bottomright_40px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/selection_bottomright_40px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,24 @@ + + + selection04 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/selection_topleft_40px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/selection_topleft_40px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/selection_topleft_40px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/selection_topleft_40px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,20 @@ + + + selection01 + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/selection_topright_40px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/selection_topright_40px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/icons/selection_topright_40px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/icons/selection_topright_40px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,24 @@ + + + selection02 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/texts/fold_14px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/texts/fold_14px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/texts/fold_14px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/texts/fold_14px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/texts/spacer_fixed_34px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/texts/spacer_fixed_34px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/texts/spacer_fixed_34px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/texts/spacer_fixed_34px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/icons/light/texts/spacer_stretch_34px.svg dtkwidget-5.6.12/src/widgets/assets/icons/light/texts/spacer_stretch_34px.svg --- dtkwidget-5.5.48/src/widgets/assets/icons/light/texts/spacer_stretch_34px.svg 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/icons/light/texts/spacer_stretch_34px.svg 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ + \ No newline at end of file diff -Nru dtkwidget-5.5.48/src/widgets/assets/images/play_next.svg dtkwidget-5.6.12/src/widgets/assets/images/play_next.svg --- dtkwidget-5.5.48/src/widgets/assets/images/play_next.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/images/play_next.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ - - - diff -Nru dtkwidget-5.5.48/src/widgets/assets/images/play_pause.svg dtkwidget-5.6.12/src/widgets/assets/images/play_pause.svg --- dtkwidget-5.5.48/src/widgets/assets/images/play_pause.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/images/play_pause.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ - - - diff -Nru dtkwidget-5.5.48/src/widgets/assets/images/play_previous.svg dtkwidget-5.6.12/src/widgets/assets/images/play_previous.svg --- dtkwidget-5.5.48/src/widgets/assets/images/play_previous.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/images/play_previous.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ - - - diff -Nru dtkwidget-5.5.48/src/widgets/assets/images/play_start.svg dtkwidget-5.6.12/src/widgets/assets/images/play_start.svg --- dtkwidget-5.5.48/src/widgets/assets/images/play_start.svg 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/assets/images/play_start.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ - - - diff -Nru dtkwidget-5.5.48/src/widgets/DAboutDialog dtkwidget-5.6.12/src/widgets/DAboutDialog --- dtkwidget-5.5.48/src/widgets/DAboutDialog 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DAboutDialog 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "daboutdialog.h" diff -Nru dtkwidget-5.5.48/src/widgets/daboutdialog.cpp dtkwidget-5.6.12/src/widgets/daboutdialog.cpp --- dtkwidget-5.5.48/src/widgets/daboutdialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/daboutdialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,37 +1,28 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "daboutdialog.h" +#include "dfeaturedisplaydialog.h" #include "private/daboutdialog_p.h" #include #include +#include +#include +#include +#include -#include #include #include #include #include #include #include -#include #include -#include #include +#include +#include #ifdef Q_OS_UNIX #include @@ -41,36 +32,25 @@ DCORE_USE_NAMESPACE DWIDGET_BEGIN_NAMESPACE -#ifdef Q_OS_UNIX -class EnvReplaceGuard -{ -public: - EnvReplaceGuard(const int uid); - ~EnvReplaceGuard(); - - char *m_backupLogName; - char *m_backupHome; -}; +const QString DAboutDialogPrivate::websiteLinkTemplate = "%2"; -EnvReplaceGuard::EnvReplaceGuard(const int uid) +DRedPointLabel::DRedPointLabel(QWidget *parent) + : QLabel(parent) { - m_backupLogName = getenv("LOGNAME"); - m_backupHome = getenv("HOME"); - - struct passwd *pwd = getpwuid(uid); - - setenv("LOGNAME", pwd->pw_name, 1); - setenv("HOME", pwd->pw_dir, 1); } -EnvReplaceGuard::~EnvReplaceGuard() +void DRedPointLabel::paintEvent(QPaintEvent *e) { - setenv("LOGNAME", m_backupLogName, 1); - setenv("HOME", m_backupHome, 1); + Q_UNUSED(e) + QPainter painter(this); + QRectF rcf(0, 0, 4, 4); + QPainterPath path; + path.addEllipse(rcf); + painter.setRenderHint(QPainter::Antialiasing); + painter.fillPath(path, QColor("#FF0000")); + painter.setPen(QColor(0, 0, 0, 255 * 0.05)); + painter.drawEllipse(rcf); } -#endif - -const QString DAboutDialogPrivate::websiteLinkTemplate = "%2"; DAboutDialogPrivate::DAboutDialogPrivate(DAboutDialog *qq) : DDialogPrivate(qq) @@ -82,7 +62,7 @@ { D_Q(DAboutDialog); - q->setMinimumWidth(360); + q->setMaximumWidth(540); // overwrite default info if distribution config file existed. loadDistributionInfo(); @@ -92,9 +72,12 @@ productNameLabel = new QLabel(); productNameLabel->setObjectName("ProductNameLabel"); + DFontSizeManager *fontManager = DFontSizeManager::instance(); + fontManager->bind(productNameLabel, DFontSizeManager::T5, QFont::DemiBold); versionLabel = new QLabel(); versionLabel->setObjectName("VersionLabel"); + fontManager->bind(versionLabel, DFontSizeManager::T8, QFont::DemiBold); companyLogoLabel = new QLabel(); companyLogoLabel->setPixmap(loadPixmap(logoPath)); @@ -105,54 +88,90 @@ websiteLabel->setOpenExternalLinks(false); updateWebsiteLabel(); - acknowledgementLabel = new QLabel(); - acknowledgementLabel->setObjectName("AcknowledgementLabel"); - acknowledgementLabel->setContextMenuPolicy(Qt::NoContextMenu); - acknowledgementLabel->setOpenExternalLinks(false); - updateAcknowledgementLabel(); - descriptionLabel = new QLabel(); + descriptionLabel->setFixedWidth(280); descriptionLabel->setObjectName("DescriptionLabel"); - descriptionLabel->setAlignment(Qt::AlignHCenter); + descriptionLabel->setAlignment(Qt::AlignLeft); descriptionLabel->setWordWrap(true); descriptionLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + fontManager->bind(descriptionLabel, DFontSizeManager::T8, QFont::DemiBold); licenseLabel = new QLabel(); + licenseLabel->setFixedWidth(180); licenseLabel->setObjectName("LicenseLabel"); licenseLabel->setAlignment(Qt::AlignHCenter); licenseLabel->setWordWrap(true); licenseLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); licenseLabel->hide(); + fontManager->bind(licenseLabel, DFontSizeManager::T10, QFont::Medium); + + QLabel *versionTipLabel = new QLabel(QObject::tr("Version")); + fontManager->bind(versionTipLabel, DFontSizeManager::T10, QFont::Normal); + featureLabel = new QLabel(websiteLinkTemplate.arg(websiteLink).arg(QObject::tr("Features"))); + featureLabel->setContextMenuPolicy(Qt::NoContextMenu); + featureLabel->setOpenExternalLinks(false); + featureLabel->setVisible(!qApp->featureDisplayDialog()->isEmpty()); + redPointLabel = new DRedPointLabel(); + redPointLabel->setFixedSize(10, 10); + QHBoxLayout *vFeatureLayout = new QHBoxLayout; + vFeatureLayout->setMargin(0); + vFeatureLayout->setSpacing(0); + vFeatureLayout->addWidget(featureLabel, 0, Qt::AlignLeft); + vFeatureLayout->addWidget(redPointLabel, 0, Qt::AlignLeft); + vFeatureLayout->addStretch(0); + QLabel *homePageTipLabel = new QLabel(QObject::tr("Homepage")); + fontManager->bind(homePageTipLabel, DFontSizeManager::T10, QFont::Normal); + QLabel *descriptionTipLabel = new QLabel(QObject::tr("Description")); + fontManager->bind(descriptionTipLabel, DFontSizeManager::T10, QFont::Normal); + acknowledgementTipLabel = new QLabel(QObject::tr("Acknowledgements")); + fontManager->bind(acknowledgementTipLabel, DFontSizeManager::T10, QFont::Normal); + acknowledgementLabel = new QLabel(QObject::tr("Sincerely appreciate the open-source software used.")); + acknowledgementLabel->setFixedWidth(280); + acknowledgementLabel->setWordWrap(true); + acknowledgementLabel->setContextMenuPolicy(Qt::NoContextMenu); + acknowledgementLabel->setOpenExternalLinks(false); + fontManager->bind(acknowledgementLabel, DFontSizeManager::T8, QFont::DemiBold); q->connect(websiteLabel, SIGNAL(linkActivated(QString)), q, SLOT(_q_onLinkActivated(QString))); - q->connect(acknowledgementLabel, SIGNAL(linkActivated(QString)), q, SLOT(_q_onLinkActivated(QString))); + q->connect(featureLabel, SIGNAL(linkActivated(QString)), q, SLOT(_q_onFeatureActivated(QString))); q->connect(descriptionLabel, SIGNAL(linkActivated(QString)), q, SLOT(_q_onLinkActivated(QString))); q->connect(licenseLabel, SIGNAL(linkActivated(QString)), q, SLOT(_q_onLinkActivated(QString))); + q->connect(acknowledgementLabel, SIGNAL(linkActivated(QString)), q, SLOT(_q_onLicenseActivated(QString))); + + QVBoxLayout *leftVLayout = new QVBoxLayout; + leftVLayout->setContentsMargins(10, 3, 0, 10); + leftVLayout->setSpacing(0); + leftVLayout->addWidget(logoLabel, 0, Qt::AlignCenter); + leftVLayout->addSpacing(8); + leftVLayout->addWidget(productNameLabel, 0, Qt::AlignCenter); + leftVLayout->addStretch(0); + leftVLayout->addWidget(companyLogoLabel, 0, Qt::AlignCenter); + leftVLayout->addSpacing(3); + leftVLayout->addWidget(licenseLabel, 0, Qt::AlignHCenter); + + QVBoxLayout *rightVLayout = new QVBoxLayout; + rightVLayout->setContentsMargins(0, 3, 20, 10); + rightVLayout->setSpacing(0); + rightVLayout->addWidget(versionTipLabel, 0, Qt::AlignLeft); + rightVLayout->addWidget(versionLabel, 0, Qt::AlignLeft); + rightVLayout->addLayout(vFeatureLayout); + rightVLayout->addSpacing(9); + rightVLayout->addWidget(homePageTipLabel, 0, Qt::AlignLeft); + rightVLayout->addWidget(websiteLabel, 0, Qt::AlignLeft); + rightVLayout->addSpacing(10); + rightVLayout->addWidget(descriptionTipLabel, 0, Qt::AlignLeft); + rightVLayout->addWidget(descriptionLabel, 0, Qt::AlignLeft); + rightVLayout->addSpacing(10); + rightVLayout->addWidget(acknowledgementTipLabel, 0, Qt::AlignLeft); + rightVLayout->addWidget(acknowledgementLabel, 0, Qt::AlignLeft); + rightVLayout->addStretch(0); - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->setContentsMargins(11, 20, 11, 10); + QHBoxLayout *mainLayout = new QHBoxLayout; mainLayout->setSpacing(0); - mainLayout->addWidget(logoLabel); - mainLayout->setAlignment(logoLabel, Qt::AlignCenter); - mainLayout->addSpacing(3); - mainLayout->addWidget(productNameLabel); - mainLayout->setAlignment(productNameLabel, Qt::AlignCenter); - mainLayout->addSpacing(6); - mainLayout->addWidget(versionLabel); - mainLayout->setAlignment(versionLabel, Qt::AlignCenter); - mainLayout->addSpacing(8); - mainLayout->addWidget(companyLogoLabel); - mainLayout->setAlignment(companyLogoLabel, Qt::AlignCenter); -// mainLayout->addSpacing(6); - mainLayout->addWidget(websiteLabel); - mainLayout->setAlignment(websiteLabel, Qt::AlignCenter); - mainLayout->addSpacing(5); -// mainLayout->addWidget(acknowledgementLabel); -// mainLayout->setAlignment(acknowledgementLabel, Qt::AlignCenter); - mainLayout->addSpacing(12); - mainLayout->addWidget(descriptionLabel, Qt::AlignHCenter); - mainLayout->addSpacing(7); - mainLayout->addWidget(licenseLabel, Qt::AlignHCenter); + mainLayout->setMargin(0); + mainLayout->addLayout(leftVLayout); + mainLayout->addSpacing(29); + mainLayout->addLayout(rightVLayout); QScrollArea *mainScrollArea = new QScrollArea; QWidget *mainContent = new QWidget; @@ -167,6 +186,9 @@ mainContent->setLayout(mainLayout); q->addContent(mainScrollArea); + DConfig config("org.deepin.dtkwidget.feature-display"); + bool isUpdated = config.value("featureUpdated", false).toBool(); + redPointLabel->setVisible(isUpdated); // make active q->setFocus(); } @@ -185,31 +207,26 @@ websiteLabel->setText(websiteText); } -void DAboutDialogPrivate::updateAcknowledgementLabel() +void DAboutDialogPrivate::_q_onLinkActivated(const QString &link) { - QString acknowledgementText = QString(websiteLinkTemplate).arg(acknowledgementLink).arg(QApplication::translate("DAboutDialog", "Acknowledgements")); - acknowledgementLabel->setText(acknowledgementText); + DGUI_NAMESPACE::DGuiApplicationHelper::openUrl(link); } -void DAboutDialogPrivate::_q_onLinkActivated(const QString &link) +void DAboutDialogPrivate::_q_onFeatureActivated(const QString &) { -#ifdef Q_OS_UNIX - // workaround for pkexec apps - bool ok = false; - const int pkexecUid = qEnvironmentVariableIntValue("PKEXEC_UID", &ok); - - if (ok) - { - EnvReplaceGuard _env_guard(pkexecUid); - Q_UNUSED(_env_guard); - - QDesktopServices::openUrl(QUrl(link)); - } - else -#endif - { - QDesktopServices::openUrl(QUrl(link)); + D_Q(DAboutDialog); + DConfig config("org.deepin.dtkwidget.feature-display"); + if (config.value("featureUpdated", false).toBool()) { + config.setValue("featureUpdated", false); + redPointLabel->setVisible(false); } + Q_EMIT q->featureActivated(); +} + +void DAboutDialogPrivate::_q_onLicenseActivated(const QString &) +{ + D_Q(DAboutDialog); + Q_EMIT q->licenseActivated(); } QPixmap DAboutDialogPrivate::loadPixmap(const QString &file) @@ -238,13 +255,14 @@ } /*! - \class Dtk::Widget::DAboutDialog - \inmodule dtkwidget - \brief DAboutDialog 类提供了应用程序的关于对话框,规范所有 deepin 应用关于窗口设计规范,符合 Deepin 风格. - - 使用 DMainWindow 创建的窗口都可以在菜单点关于弹出关于窗口,一般不需要手动创建。 - - 为了提供简便操作,可通过 DApplication 来设置关于对话框展示内容。 +@~english + @class Dtk::Widget::DAboutDialog + @ingroup dtkwidget + @brief The DaboutDialog class provides the application about dialog boxes that specify all Deepin applications about window design specifications, which meets the deepin style. + + The windows created using dmainwindow can be made in the menu about the pop -up window. Generally, it is not necessary to create manually. + + In order to provide simple operations, the content of the dialog box can be set through dapplication。 */ DAboutDialog::DAboutDialog(QWidget *parent) @@ -256,10 +274,9 @@ } /*! - \property DAboutDialog::windowTitle - - \brief the title of the dialog. - \brief 返回关于对话框窗口的标题. +@~english + @property DAboutDialog::windowTitle + @brief the title of the dialog. */ QString DAboutDialog::windowTitle() const { @@ -267,10 +284,10 @@ } /*! - \property DAboutDialog::productName - - \brief the product name to be shown on the dialog. - \brief 返回对话框显示的应用名称. +@~english + @property DAboutDialog::productName + + @brief the product name to be shown on the dialog. */ QString DAboutDialog::productName() const { @@ -280,10 +297,11 @@ } /*! - \property DAboutDialog::version - - \brief the version number to be shown on the dialog. - \brief 返回关于对话框显示的版本. +@~english + @property DAboutDialog::version + + @brief the version number to be shown on the dialog. + @brief 返回关于对话框显示的版本. */ QString DAboutDialog::version() const { @@ -293,10 +311,11 @@ } /*! - \property DAboutDialog::description +@~english + @property DAboutDialog::description - \brief the description to be show on the dialog. - \brief 返回关于对话框显示的描述. + @brief the description to be show on the dialog. + @brief 返回关于对话框显示的描述. */ QString DAboutDialog::description() const { @@ -306,8 +325,9 @@ } /*! - \brief the vendor logo to be shown on the dialog. - \return 返回对话框中的公司/组织 logo 图片. +@~english + @brief the vendor logo to be shown on the dialog. + @return 返回对话框中的公司/组织 logo 图片. */ const QPixmap *DAboutDialog::companyLogo() const { @@ -317,12 +337,10 @@ } /*! - \property DAboutDialog::websiteName - \brief the vendor website name to be shown on the dialog. - \brief 返回对话框中显示的公司/组织网站名称. - +@~english + @property DAboutDialog::websiteName + @brief the vendor website name to be shown on the dialog. Usually be in form like www.deepin.org. - 通常采用 www.deepin.org 等形式。 */ QString DAboutDialog::websiteName() const { @@ -332,13 +350,12 @@ } /*! - \property DAboutDialog::websiteLink - \brief the corresponding web address of websiteName(). - \brief 返回 websiteName() 相应的网址. - +@~english + @property DAboutDialog::websiteLink + @brief the corresponding web address of websiteName(). + @brief 返回 websiteName() 相应的网址. The website link will be open in the browser if the user clicks on the website text shown on the dialog. - 如果用户点击对话框中显示的网址,则会打开相应的链接。 */ QString DAboutDialog::websiteLink() const { @@ -348,24 +365,20 @@ } /*! - \property DAboutDialog::acknowledgementLink - - \brief the web address to be open open when user clicks on the "Acknowlegement" +@~english + @property DAboutDialog::acknowledgementLink + @brief the web address to be open open when user clicks on the "Acknowlegement" text show on the dialog. - \brief 返回鸣谢链接地址. */ QString DAboutDialog::acknowledgementLink() const { - D_DC(DAboutDialog); - - return d->acknowledgementLink; + return QString(); } /*! - \property DAboutDialog::license - - \brief the license to be shown on the dialog. - \brief 对话框显示的许可证. +@~english + @property DAboutDialog::license + @brief the license to be shown on the dialog. */ QString DAboutDialog::license() const { @@ -374,10 +387,21 @@ return d->licenseLabel->text(); } -/*! - \brief 设置对话框窗口标题. +void DAboutDialog::setLicenseEnabled(bool enabled) +{ + D_D(DAboutDialog); + QString ack = QObject::tr("Sincerely appreciate the open-source software used."); + if (enabled) { + QString tmp = QObject::tr("open-source software"); + ack = ack.replace(tmp, d->websiteLinkTemplate.arg(d->websiteLink).arg(tmp)); + } + d->acknowledgementLabel->setText(ack); +} - \a windowTitle 窗口标题字符串. +/*! +@~english + @brief Set the title of the dialog box window. + \a Window title string. */ void DAboutDialog::setWindowTitle(const QString &windowTitle) { @@ -385,20 +409,21 @@ } /*! - \brief 设置展示的 \a icon 图标. - - 在关于对话框展示的图标. +@~english + @brief Set the icon icon displayed. + + In the icon of the dialog box display. */ void DAboutDialog::setProductIcon(const QIcon &icon) { D_D(DAboutDialog); - d->logoLabel->setPixmap(icon.pixmap(windowHandle(), QSize(96, 96))); + d->logoLabel->setPixmap(icon.pixmap(windowHandle(), QSize(128, 128))); } /*! - \brief 设置应用名称. - \a productName 产品名称. +@~english + @brief Set the application name. */ void DAboutDialog::setProductName(const QString &productName) { @@ -408,7 +433,8 @@ } /*! - \brief 此函数用于设置指定的 \a version 版本信息. +@~english + @brief This function is used to set the specified version information. */ void DAboutDialog::setVersion(const QString &version) { @@ -418,7 +444,8 @@ } /*! - \brief 此函数用于设置指定的 \a description 描述信息. +@~english + @brief This function is used to set the specified description description information. */ void DAboutDialog::setDescription(const QString &description) { @@ -428,7 +455,8 @@ } /*! - \brief 此函数用于设置指定的 \a companyLogo 组织标志. +@~english + @brief This function is used to set the specified CompanyLogo organization logo. */ void DAboutDialog::setCompanyLogo(const QPixmap &companyLogo) { @@ -438,7 +466,8 @@ } /*! - \brief 此函数用于设置指定的 \a websiteName 网站名称 +@~english + @brief This function is used to set the specified websitename website name */ void DAboutDialog::setWebsiteName(const QString &websiteName) { @@ -453,7 +482,8 @@ } /*! - \brief 此函数用于设置指定的 \a websiteLink 网站链接 +@~english + @brief This function is used to set the specified WebSitelink website link */ void DAboutDialog::setWebsiteLink(const QString &websiteLink) { @@ -468,28 +498,27 @@ } /*! - \brief 此函数用于设置指定的 \a acknowledgementLink 鸣谢链接 +@~english + @brief This function is used to set the specified ACKNOWLEDGEMENTLINK Link */ -void DAboutDialog::setAcknowledgementLink(const QString &acknowledgementLink) +void DAboutDialog::setAcknowledgementLink(const QString &) { - D_D(DAboutDialog); - - d->acknowledgementLink = acknowledgementLink; - d->updateAcknowledgementLabel(); } /*! - \brief 此函数用于设置指定的 \a visible 设置鸣谢链接是否显示 +@~english + @brief This function is used to set the specified Visible settings to set the gratitude link to display */ -void DAboutDialog::setAcknowledgementVisible(bool visible) +void DAboutDialog::setAcknowledgementVisible(bool isVisible) { - Q_UNUSED(visible) D_D(DAboutDialog); -// d->acknowledgementLabel->setVisible(visible); + d->acknowledgementTipLabel->setVisible(isVisible); + d->acknowledgementLabel->setVisible(isVisible); } /*! - \brief 此函数用于设置指定的 \a license 许可证. +@~english + @brief This function is used to set the specified License license. */ void DAboutDialog::setLicense(const QString &license) { diff -Nru dtkwidget-5.5.48/src/widgets/daboutdialog.h dtkwidget-5.6.12/src/widgets/daboutdialog.h --- dtkwidget-5.5.48/src/widgets/daboutdialog.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/daboutdialog.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DABOUTDIALOG_H -#define DABOUTDIALOG_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DAboutDialogPrivate; -class DAboutDialog : public DDialog -{ - Q_OBJECT - - Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle) - Q_PROPERTY(QString productName READ productName WRITE setProductName) - Q_PROPERTY(QString version READ version WRITE setVersion) - Q_PROPERTY(QString description READ description WRITE setDescription) - Q_PROPERTY(QString license READ license WRITE setLicense) - Q_PROPERTY(QString websiteName READ websiteName WRITE setWebsiteName) - Q_PROPERTY(QString websiteLink READ websiteLink WRITE setWebsiteLink) - Q_PROPERTY(QString acknowledgementLink READ acknowledgementLink WRITE setAcknowledgementLink) - -public: - DAboutDialog(QWidget *parent = 0); - - QString windowTitle() const; - QString productName() const; - QString version() const; - QString description() const; - const QPixmap *companyLogo() const; - QString websiteName() const; - QString websiteLink() const; - QString acknowledgementLink() const; - QString license() const; - -public Q_SLOTS: - void setWindowTitle(const QString &windowTitle); - void setProductIcon(const QIcon &icon); - void setProductName(const QString &productName); - void setVersion(const QString &version); - void setDescription(const QString &description); - void setCompanyLogo(const QPixmap &companyLogo); - void setWebsiteName(const QString &websiteName); - void setWebsiteLink(const QString &websiteLink); - void setAcknowledgementLink(const QString &acknowledgementLink); - void setAcknowledgementVisible(bool visible); - void setLicense(const QString &license); - -protected: - void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; - void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; - -private: - Q_PRIVATE_SLOT(d_func(), void _q_onLinkActivated(const QString &link)) - - Q_DISABLE_COPY(DAboutDialog) - D_DECLARE_PRIVATE(DAboutDialog) -}; - -DWIDGET_END_NAMESPACE - -#endif // DABOUTDIALOG_H diff -Nru dtkwidget-5.5.48/src/widgets/DAbstractDialog dtkwidget-5.6.12/src/widgets/DAbstractDialog --- dtkwidget-5.5.48/src/widgets/DAbstractDialog 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DAbstractDialog 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dabstractdialog.h" diff -Nru dtkwidget-5.5.48/src/widgets/dabstractdialog.cpp dtkwidget-5.6.12/src/widgets/dabstractdialog.cpp --- dtkwidget-5.5.48/src/widgets/dabstractdialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dabstractdialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include @@ -71,10 +58,9 @@ bgBlurWidget->setMaskColor(DBlurEffectWidget::AutoColor); bgBlurWidget->setMaskAlpha(204); // 80% - if (!DWindowManagerHelper::instance()->hasBlurWindow() - && DGuiApplicationHelper::instance()->isTabletEnvironment()) { + // blur if possible(wm support blur window)... + if (!DWindowManagerHelper::instance()->hasBlurWindow()) blurIfPossible = false; - } bgBlurWidget->setBlurEnabled(blurIfPossible); q->setAttribute(Qt::WA_TranslucentBackground, blurIfPossible); @@ -120,6 +106,7 @@ } /*! +@~english \class Dtk::Widget::DAbstractDialog \inmodule dtkwidget \brief 可以使用 DAbstractDialog 类创建符合 DDE 风格的对话框窗口. @@ -135,7 +122,7 @@ Qt 组件或 DTK 组件不同。一个对话框总是一个顶层控件(top-level widget),但如果它有一个父组件 则对话框的默认位置将会位于其父组件的正中央,并共用其父控件的任务栏入口。 - \section1 modal 模态对话框 + @details modal 模态对话框 一个 \b{模态} (modal)对话框可以阻止对模态对话框之外的原可见窗体的操作,如请求用户输入 文件名的对话框或是对应用程序本身进行设置的对话框就常是模态对话框。模态对话框可以是 @@ -188,10 +175,9 @@ */ /*! +@~english \brief DAbstractDialog::DAbstractDialog constructs a DAbstractDialog instance. \a parent is the parent widget to be used. - - \brief 构造一个 DAbstractDialog 实例 */ DAbstractDialog::DAbstractDialog(QWidget *parent) : QDialog(parent), @@ -208,25 +194,25 @@ } /*! +@~english \enum Dtk::Widget::DAbstractDialog::DisplayPosition - + \brief The DisplayPosition enum contains the position options that can be specified by all dialogs. \brief DAbstractDialog::DisplayPosition 表示对话框的显示位置。 - + \value Center display this dialog in the center of the screen 在屏幕中央显示对话框。 - + \value TopRight display this dialog in the top right of the screen 在屏幕右上角显示对话框。 */ /*! +@~english \brief DAbstractDialog::displayPosition \return the display position of this dialog. - - \brief 获取对话框显示位置 */ DAbstractDialog::DisplayPosition DAbstractDialog::displayPosition() const { @@ -254,9 +240,8 @@ } /*! +@~english \brief DAbstractDialog::moveToCenter moves the dialog to the center of the screen or its parent widget. - - \brief 将对话框移动至屏幕中央或其父控件的中央。 */ void DAbstractDialog::moveToCenter() { @@ -266,9 +251,8 @@ } /*! +@~english \brief DAbstractDialog::moveToTopRight moves the dialog to the top right of the screen or its parent widget. - - \brief 将对话框移动至屏幕右上角或其父控件的右上角。 */ void DAbstractDialog::moveToTopRight() { @@ -278,11 +262,9 @@ } /*! +@~english \brief DAbstractDialog::moveToTopRightByRect moves the dialog to the top right corner of the rect. \a rect is the target rect. - - \brief 移动对话框到给定 \a rect 区域的右上角。 - \a rect 是移动所需要参照的 QRect 位置。 */ void DAbstractDialog::moveToTopRightByRect(const QRect &rect) { @@ -291,11 +273,9 @@ } /*! +@~english \brief DAbstractDialog::setDisplayPosition sets the position of the dialog. \a displayPosition is the target position. - - \brief 设置对话框的显示位置。 - \a displayPosition 要显示到的位置 */ void DAbstractDialog::setDisplayPosition(DAbstractDialog::DisplayPosition displayPosition) { @@ -316,9 +296,10 @@ } /*! +@~english \brief DAbstractDialog::moveToCenterByRect moves the dialog to the center of the rect. \a rect is the target rect. - + \brief 移动对话框到给定 \a rect 区域的中央。 \a rect 是移动对话框要参照的 QRect 区域 */ @@ -383,7 +364,6 @@ QDialog::mouseMoveEvent(event); } -/*! \reimp */ void DAbstractDialog::resizeEvent(QResizeEvent *event) { if (event->size().width() >= maximumWidth()) { diff -Nru dtkwidget-5.5.48/src/widgets/dabstractdialog.h dtkwidget-5.6.12/src/widgets/dabstractdialog.h --- dtkwidget-5.5.48/src/widgets/dabstractdialog.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dabstractdialog.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DABSTRACTDIALOG_H -#define DABSTRACTDIALOG_H - -#include -#include - -#include - -#include - -class QMouseEvent; -class QPushButton; -class QResizeEvent; - -DWIDGET_BEGIN_NAMESPACE - -class DAbstractDialogPrivate; -class LIBDTKWIDGETSHARED_EXPORT DAbstractDialog : public QDialog, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(DisplayPosition displayPosition READ displayPosition WRITE setDisplayPosition) - -public: - enum DisplayPosition { - Center, - TopRight - }; - enum DisplayPostion { - DisplayCenter = Center, /*!< display this dialog in the center of the screen */ - DisplayTopRight = TopRight /*!< display this dialog in the top right of the screen */ - }; - - Q_ENUMS(DisplayPosition) - Q_ENUMS(DisplayPostion) - - DAbstractDialog(QWidget *parent = nullptr); - DAbstractDialog(bool blurIfPossible, QWidget *parent = nullptr); - - DisplayPosition displayPosition() const; - - void move(const QPoint &pos); - inline void move(int x, int y) - { move(QPoint(x, y));} - - void setGeometry(const QRect &rect); - inline void setGeometry(int x, int y, int width, int height) - { setGeometry(QRect(x, y, width, height));} - -public Q_SLOTS: - void moveToCenter(); - void moveToTopRight(); - void moveToCenterByRect(const QRect &rect); - void moveToTopRightByRect(const QRect &rect); - - void setDisplayPosition(DisplayPosition displayPosition); - -Q_SIGNALS: - /** - * \brief sizeChanged is emitted when the size of this dialog changed. - * \a size is the target size. - */ - void sizeChanged(QSize size); - -protected: - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; - void showEvent(QShowEvent *event) override; - -protected: - DAbstractDialog(DAbstractDialogPrivate &dd, QWidget *parent = nullptr); - -private: - D_DECLARE_PRIVATE(DAbstractDialog) -}; - -DWIDGET_END_NAMESPACE - -#endif // DABSTRACTDIALOG_H diff -Nru dtkwidget-5.5.48/src/widgets/DAccessibilityChecker dtkwidget-5.6.12/src/widgets/DAccessibilityChecker --- dtkwidget-5.5.48/src/widgets/DAccessibilityChecker 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DAccessibilityChecker 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "daccessibilitychecker.h" diff -Nru dtkwidget-5.5.48/src/widgets/DAccessibleWidget dtkwidget-5.6.12/src/widgets/DAccessibleWidget --- dtkwidget-5.5.48/src/widgets/DAccessibleWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DAccessibleWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DAction dtkwidget-5.6.12/src/widgets/DAction --- dtkwidget-5.5.48/src/widgets/DAction 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DAction 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include diff -Nru dtkwidget-5.5.48/src/widgets/DAlertControl dtkwidget-5.6.12/src/widgets/DAlertControl --- dtkwidget-5.5.48/src/widgets/DAlertControl 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DAlertControl 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dalertcontrol.h" diff -Nru dtkwidget-5.5.48/src/widgets/dalertcontrol.cpp dtkwidget-5.6.12/src/widgets/dalertcontrol.cpp --- dtkwidget-5.5.48/src/widgets/dalertcontrol.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dalertcontrol.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2020 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: ck - * - * Maintainer: ck - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "DStyle" #include "dalertcontrol.h" @@ -98,9 +81,9 @@ } /*! - \brief DAlertControl::setAlert设置是否开启警告模式 - 警告模式,开启警告模式,target将显示警告颜色 - \a isAlert 是否开启警告模式 +@~english + \brief DAlertControl::setAlertSet whether to turn on the warning modeOpen the warning mode, Target will display the warning color + \a isAlert Whether to turn on a warning mode */ void DAlertControl::setAlert(bool isAlert) { @@ -125,7 +108,8 @@ } /*! - \brief DAlertControl::alert返回当前是否处于警告模式 +@~english + \brief DAlertControl::alertBack to whether it is currently in a warning mode */ bool DAlertControl::isAlert() const { @@ -135,8 +119,9 @@ } /*! - \brief DAlertControl::defaultAlertColor返回默认告警颜色 - \note 默认颜色和原 DLineEdit 一致 +@~english + \brief DAlertControl::defaultAlertColorBack to the default alarm color + \note The default color is consistent with the original DLINEEDIT */ QColor DAlertControl::defaultAlertColor() const { @@ -144,8 +129,9 @@ } /*! - \brief DAlertControl::setAlertColor 设置告警颜色 - \a c 告警颜色 +@~english + \brief DAlertControl::setAlertColor Set alarm color + \a c Alarm color */ void DAlertControl::setAlertColor(QColor c) { @@ -161,7 +147,8 @@ } /*! - \brief DAlertControl::alertColor 返回当前告警颜色 +@~english + \brief DAlertControl::alertColor Return to the current alarm color */ QColor DAlertControl::alertColor() const { @@ -170,9 +157,9 @@ } /*! - \brief DAlertControl::setMessageAlignment指定对齐方式 - 现只支持左,右,居中, 默认左对齐. - \note 参数为其他时,默认左对齐 +@~english + \brief DAlertControl::setMessageAlignmentSpecify the alignment method Now only support the left, right, center, default left + \note When the parameters are other, the default left \a alignment 消息对齐方式 */ void DAlertControl::setMessageAlignment(Qt::Alignment alignment) @@ -182,7 +169,8 @@ } /*! - \brief DAlertControl::messageAlignment 返回当前告警 tooltips 对齐方式 +@~english + \brief DAlertControl::messageAlignment Return to the current alarm Tooltips alignment method */ Qt::Alignment DAlertControl::messageAlignment() const { @@ -191,11 +179,12 @@ } /*! - \brief DAlertControl::showAlertMessage显示警告消息 - 显示指定的文本消息,超过指定时间后警告消息消失. - \note 时间参数为-1时,警告消息将一直存在 - \a text 警告的文本 - \a duration 显示的时间长度,单位毫秒 +@~english + \brief DAlertControl::showAlertMessage Display warning message + Display the specified text message, exceeding the warning message disappearing after the specified time. + \note When the time parameter is -1, the warning message will always exist + \a text Warning text + \a duration Display time length, unit milliseconds */ void DAlertControl::showAlertMessage(const QString &text, int duration) { @@ -203,13 +192,14 @@ } /*! - \brief DAlertControl::showAlertMessage显示警告消息. +@~english + \brief DAlertControl::showAlertMessage Display warning message. - 显示指定的文本消息,超过指定时间后警告消息消失. - \note 时间参数为-1时,警告消息将一直存在 - \a text 警告的文本 - \a follow 指定文本消息跟随的对象 - \a duration 显示的时间长度,单位毫秒 + Display the specified text message, exceeding the warning message disappearing after the specified time + \note When the time parameter is -1, the warning message will always exist + \a text Warning text + \a follow Specify the object of the text message + \a duration Display time length, unit milliseconds */ void DAlertControl::showAlertMessage(const QString &text, QWidget *follower, int duration) { @@ -259,6 +249,7 @@ } /*! +@~english \brief DAlertControl:: hideAlertMessage隐藏警告消息框 */ void DAlertControl::hideAlertMessage() diff -Nru dtkwidget-5.5.48/src/widgets/dalertcontrol.h dtkwidget-5.6.12/src/widgets/dalertcontrol.h --- dtkwidget-5.5.48/src/widgets/dalertcontrol.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dalertcontrol.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: ck - * - * Maintainer: ck - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DALERTCONTROL_H -#define DALERTCONTROL_H - -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE -class DAlertControlPrivate; -class LIBDTKWIDGETSHARED_EXPORT DAlertControl : public QObject, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_DISABLE_COPY(DAlertControl) - D_DECLARE_PRIVATE(DAlertControl) - Q_PROPERTY(bool alert READ isAlert WRITE setAlert NOTIFY alertChanged) - Q_PROPERTY(QColor alertColor READ alertColor WRITE setAlertColor) - -public: - explicit DAlertControl(QWidget *target, QObject *parent = nullptr); - ~DAlertControl() override; - - void setAlert(bool isAlert); - bool isAlert() const; - void setAlertColor(QColor c); - QColor alertColor() const; - QColor defaultAlertColor() const; - void setMessageAlignment(Qt::Alignment alignment); - Qt::Alignment messageAlignment() const; - void showAlertMessage(const QString &text, int duration = 3000); - void showAlertMessage(const QString &text, QWidget *follower, int duration = 3000); - void hideAlertMessage(); - -Q_SIGNALS: - void alertChanged(bool alert) const; - -protected: - DAlertControl(DAlertControlPrivate &d, QObject *parent); - bool eventFilter(QObject *watched, QEvent *event) override; - -}; - -DWIDGET_END_NAMESPACE -#endif // DALERTCONTROL_H diff -Nru dtkwidget-5.5.48/src/widgets/DAnchors dtkwidget-5.6.12/src/widgets/DAnchors --- dtkwidget-5.5.48/src/widgets/DAnchors 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DAnchors 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "danchors.h" diff -Nru dtkwidget-5.5.48/src/widgets/DAnchorsBase dtkwidget-5.6.12/src/widgets/DAnchorsBase --- dtkwidget-5.5.48/src/widgets/DAnchorsBase 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DAnchorsBase 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "danchors.h" diff -Nru dtkwidget-5.5.48/src/widgets/danchors.cpp dtkwidget-5.6.12/src/widgets/danchors.cpp --- dtkwidget-5.5.48/src/widgets/danchors.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/danchors.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: kirigaya - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "danchors.h" @@ -23,290 +9,329 @@ DWIDGET_BEGIN_NAMESPACE /*! - \class Dtk::Widget::DAnchorsBase +@~english + @class Dtk::Widget::DAnchorsBase \inmodule dtkwidget - \brief DAnchorsBase 提供了一种指定 QWidget 与其它 QWidget 之间的关系来确定 - 其位置的方法. + @brief DAnchorsBase provides a way to specify the relationship between a QWidget and other QWidgets to determine its position. - 除了比较传统的布局方式之外,DtkWidget 还提供了一种使用锚定概念布局控件的方法( - 类似于 QQuickItem 中的 anchors 属性),可以认为每个控件具有一组6个不可见的“锚 - 线”:left,horizontalCenter,right,top,verticalCenter和bottom,如图所示: - \image html edges_anchors.png - 使用 DAnchors 可以让 QWidget 基于这些“锚线”来确定相互间的关系,如: - \code + In addition to the more traditional layout approach, DtkWidget also provides a way to use anchored concept layout controls ( + Similar to the anchors property in QQuickItem), each control can be thought of as having a set of six invisible anchors + Lines ": left, horizontalCenter, right, top, verticalCenter, and bottom, as shown: + @image html edges_anchors.png + Using DAnchors allows QWidgets to determine relationships based on these anchor lines, such as: + @code DAnchors rect1(new QLabel("rect1")); DAnchors rect2(new QLabel("rect2")); rect2.setLeft(rect1.right()); - \endcode - 这样 rect2 的左边界就会和 rect1 的右边界对齐: - \image html edge1.png - 另外还可以同时设置多个“锚线”: - \code + @endcode + The left edge of rect2 will then line up with the right edge of rect1: + @image html edge1.png + You can also set multiple anchor lines at the same time: + @code DAnchors rect1(new QLabel("rect1")); DAnchors rect2(new QLabel("rect2")); rect2.setTop(rect1.bottom()); rect2.setLeft(rect1.right()); - \endcode - \image html edge3.png - 锚定布局同时在多个控件中使用,控件之间只需要满足以下条件: - \a 控件之间为兄弟关系,或被锚定控件为父控件 - \a 锚定关系不能循环绑定 - \section1 margin_offset 锚定的间隔和偏移 - 锚定系统允许设置“锚线”之间的间距,和“锚线”一一对应,每个控件都有一组4个 margin: - leftMargin, rightMargin, topMargin 和 bottomMargin 以及两个 offset: - horizontalCenterOffset 和 verticalCenterOffset。 - \image html margins_anchors.png - 下面是左margin的例子: - \code + @endcode + @image html edge3.png + Anchor layout can be used in multiple controls at the same time, and the controls only need to meet the following conditions: + \a Controls are siblings, or anchored controls are parent controls + \a Anchoring relations cannot be bound cyclically + \section1 margin_offset + The anchor system allows you to set the spacing between "anchor lines", and each control has a set of four margins corresponding to the "anchor lines" : + leftMargin, rightMargin, topMargin, and bottomMargin and two offsets: + horizontalCenterOffset and verticalCenterOffset. + @image html margins_anchors.png + Here's an example of a left margin: + @code DAnchors rect1(new QLabel("rect1")); DAnchors rect2(new QLabel("rect2")); rect2.setLeftMargin(5); rect2.setLeft(rect1.right()); - \endcode - rect2 的左边界相距 rect1 的右边界5个像素: - \image html edge2.png - \note margin 仅仅是对设置的锚点生效,并不是让控件本身增加了边距,如果设置了 - margin,但并没有设置相应的锚点,对控件本身而已是没有任何影响的。margin 的值可以 - 为负数,通过值的正负来决定margin的方向(内 margin 还是外 margin) + @endcode + The left border of rect2 is 5 pixels from the right border of rect1: + @image html edge2.png + @note margin applies only to the anchor point you set, not to the control itself, if it is set + margin, but no corresponding anchor is set, which has no effect on the control itself. The value of margin does + Is a negative value, which determines the direction of the margin (inner margin or outer margin). - 除了基于“锚线”来设置锚定外,另外还有 setCenterIn 和 setFill 这两个比较特殊的 - 的实现。 + In addition to setting anchors based on "anchor lines," there are also setCenterIn and setFill, which are special + Implementation of. - \section1 loop_anchor 判断循环锚定的方式 - 假设 DAnchorsBase a1, a2; a1.setRight(a2.left()); 则判断 a1 和 a2 之间 - 会不会存在循环绑定的逻辑为: - 尝试更改 a1 右边界的值,更新后如果 a2 左边界的值产出了变化,则认为会导致循环绑 - 定,否则认为不存在 + \section1 loop_anchor + Suppose DAnchorsBase a1, a2; a1.setRight(a2.left()); I'm going to say between a1 and a2 + The logic for whether there is a loop binding is: + Try to change the value of the right boundary of a1. If the value of the left boundary of a2 changes after the update, it is considered to cause a loop tie + Sure, otherwise it is considered not to exist */ /*! - \property DAnchorsBase::target - \brief 绑定了锚定功能的控件对象 - \note 只读 +@~english + @property DAnchorsBase::target + @brief The control object to which the anchor function is bound + @note Read only */ /*! - \property DAnchorsBase::enabled - \brief 控制锚定功能是否开启,为 false 时仅仅表示不会根据控件各种属性的变化来 - 来更新它的位置,但锚定关系并没有被解除 - \note 可读可写 +@~english + @property DAnchorsBase::enabled + @brief Controls whether anchoring is enabled. + A false value simply means that the position of the control will not be updated based on changes to its various properties, + but the anchoring relationship is not broken + @note Readable and writable */ /*! - \property DAnchorsBase::anchors - \brief 一个指向自己的指针 - \note 只读 +@~english + @property DAnchorsBase::anchors + @brief A pointer to itself + @note Read only */ /*! - \property DAnchorsBase::top - \brief target 控件上边界锚线的信息 - \note 只能和 top verticalCenter bottom 绑定 - \note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 - \note 可读可写 +@~english + @property DAnchorsBase::top + @brief Information about bounding anchor lines on the target control + @note Only binding to top verticalCenter bottom + @note Assigning a value to a property does not change its own value, but sets a binding to the anchor + @note Readable and writable */ /*! - \property DAnchorsBase::bottom - \note 只能和 top verticalCenter bottom 绑定 - \brief target 控件下边界锚线的信息 - \note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 - \note 可读可写 +@~english + @property DAnchorsBase::bottom + @note Only binding to top verticalCenter bottom + @brief Information about the anchor line under the target control + @note Assigning a value to a property does not change its own value, but sets a binding to the anchor + @note Readable and writable */ /*! - \property DAnchorsBase::left - \note 只能和 left horizontalCenter right 绑定 - \brief target 控件左边界锚线的信息 - \note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 - \note 可读可写 +@~english + @property DAnchorsBase::left + @note Only binding to left horizontalCenter right + @brief Information about the anchor line on the left boundary of the target control + @note Assigning a value to a property does not change its own value, but sets a binding to the anchor + @note Readable and writable */ /*! - \property DAnchorsBase::right - \note 只能和 left horizontalCenter right 绑定 - \brief target 控件右边界锚线的信息 - \note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 - \note 可读可写 +@~english + @property DAnchorsBase::right + @note Only binding to left horizontalCenter right + @brief Information about the anchor line on the right border of the target control + @note Assigning a value to a property does not change its own value, but sets a binding to the anchor + @note Readable and writable */ /*! - \property DAnchorsBase::horizontalCenter - \note 只能和 left horizontalCenter right 绑定 - \brief target 控件水平锚线的信息 - \note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 - \note 可读可写 +@~english + @property DAnchorsBase::horizontalCenter + @note Only binding to left horizontalCenter right + @brief target controls information about horizontal anchor lines + @note Assigning a value to a property does not change its own value, but sets a binding to the anchor + @note Readable and writable */ /*! - \property DAnchorsBase::verticalCenter - \note 只能和 top verticalCenter bottom 绑定 - \brief target 控件竖直锚线的信息 - \note 对属性赋值不会更改它自身的值,而是对此锚线设置绑定关系 - \note 可读可写 +@~english + @property DAnchorsBase::verticalCenter + @note Only binding to top verticalCenter bottom + @brief target controls vertical anchor line information + @note Assigning a value to a property does not change its own value, but sets a binding to the anchor + @note Readable and writable */ /*! - \property DAnchorsBase::fill - \brief target 控件的填充目标对象 - \note 可读可写 +@~english + @property DAnchorsBase::fill + @brief target control fills the target object + @note Readable and writable */ /*! - \property DAnchorsBase::centerIn - \brief target 控件的居中目标对象 - \note 可读可写 +@~english + @property DAnchorsBase::centerIn + @brief target control's centered target object + @note Readable and writable */ /*! - \property DAnchorsBase::margins - \brief 上下左右四条“锚线”的边距,此值的优先级低于每条“锚线”特定的 margin 值 - \note 可读可写 +@~english + @property DAnchorsBase::margins + @brief The margin of the top, bottom, left, and right anchor lines. This value has lower priority than the margin value specific to each anchor line + @note Readable and writable */ /*! - \property DAnchorsBase::topMargin - \brief 上“锚线”的边距,优先级高于 margins - \note 可读可写 +@~english + @property DAnchorsBase::topMargin + @brief The margin of the upper "anchor line" has higher priority than the margins + @note Readable and writable */ /*! - \property DAnchorsBase::bottomMargin - \brief 下“锚线”的边距,优先级高于 margins - \note 可读可写 +@~english + @property DAnchorsBase::bottomMargin + @brief The margin of the lower "anchor line" has higher priority than the margins + @note Readable and writable */ /*! - \property DAnchorsBase::leftMargin - \brief 左“锚线”的边距,优先级高于 margins - \note 可读可写 +@~english + @property DAnchorsBase::leftMargin + @brief The margin of the left "anchor line" has higher priority than the margins + @note Readable and writable */ /*! - \property DAnchorsBase::rightMargin - \brief 右“锚线”的边距,优先级高于 margins - \note 可读可写 +@~english + @property DAnchorsBase::rightMargin + @brief The margin of the right "anchor line" has higher priority than the margins + @note Readable and writable */ /*! - \property DAnchorsBase::horizontalCenterOffset - \brief 水平“锚线”的偏移量 - \note 可读可写 +@~english + @property DAnchorsBase::horizontalCenterOffset + @brief The offset of the horizontal "anchor line" + @note Readable and writable */ /*! - \property DAnchorsBase::verticalCenterOffset - \brief 竖直“锚线”的偏移量 - \note 可读可写 +@~english + @property DAnchorsBase::verticalCenterOffset + @brief The offset of the vertical anchor line + @note Readable and writable */ /*! - \enum Dtk::Widget::DAnchorsBase::AnchorError - DAnchorsBase::AnchorError 设置锚定信息的过程中可能出现的错误类型 +@~english + @enum Dtk::Widget::DAnchorsBase::AnchorError + DAnchorsBase::AnchorError Types of errors that can occur in the process of setting anchor information \value NoError - 设置锚定的过程中没有任何错误发生 + There were no errors in setting up the anchor \value Conflict - 表示设置的锚定关系跟已有关系存在冲突,如 fill 和 centerIn 不能同时设置 + Indicates that the anchoring relationship is in conflict with an existing relationship, + for example, fill and centerIn cannot be set at the same time \value TargetInvalid - 表示设置锚定关系时的目标控件无效 + Indicates that the target control is invalid when the anchor relationship is set \value PointInvalid - 表示设置锚定关系时的“锚线”信息错误,如把 Qt::AnchorLeft 设置到了 Qt::AnchorTop 上 + Indicates an error in the anchor information when setting the anchor relationship, + such as when setting Qt::AnchorLeft to Qt::AnchorTop \value LoopBind - 表示设置的锚定关系和已有关系形成了循环绑定 + The anchored relation representing the setting and the existing relation form a cyclic binding */ /*! - \fn void DAnchorsBase::enabledChanged(bool enabled) - \brief 信号会在 \a enabled 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::enabledChanged(bool enabled) + @brief The signal is sent when the value of the \a enabled attribute changes */ /*! - \fn void DAnchorsBase::topChanged(const DAnchorInfo *top) - \brief 信号会在 \a top 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::topChanged(const DAnchorInfo *top) + @brief The signal is sent when the value of the \a top attribute changes */ /*! - \fn void DAnchorsBase::bottomChanged(const DAnchorInfo *bottom) - \brief 信号会在 \a bottom 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::bottomChanged(const DAnchorInfo *bottom) + @brief The signal is sent when the value of the \a bottom attribute changes */ /*! - \fn void DAnchorsBase::leftChanged(const DAnchorInfo *left) - \brief 信号会在 \a left 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::leftChanged(const DAnchorInfo *left) + @brief The signal is sent when the value of the \a left attribute changes */ /*! - \fn void DAnchorsBase::rightChanged(const DAnchorInfo *right) - \brief 信号会在 \a right 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::rightChanged(const DAnchorInfo *right) + @brief The signal is sent when the value of the \a right attribute changes */ /*! - \fn void DAnchorsBase::horizontalCenterChanged(const DAnchorInfo *horizontalCenter) - \brief 信号会在 \a horizontalCenter 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::horizontalCenterChanged(const DAnchorInfo *horizontalCenter) + @brief The signal is sent when the value of the \a horizontalCenter attribute changes */ /*! - \fn void DAnchorsBase::verticalCenterChanged(const DAnchorInfo *verticalCenter) - \brief 信号会在 \a verticalCenter 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::verticalCenterChanged(const DAnchorInfo *verticalCenter) + @brief The signal is sent when the value of the \a verticalCenter attribute changes */ /*! - \fn void DAnchorsBase::fillChanged(QWidget *fill) - \brief 信号会在 \a fill 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::fillChanged(QWidget *fill) + @brief The signal is sent when the value of the \a fill attribute changes */ /*! - \fn void DAnchorsBase::centerInChanged(QWidget *centerIn) - \brief 信号会在 \a centerIn 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::centerInChanged(QWidget *centerIn) + @brief The signal is sent when the value of the \a centerIn attribute changes */ /*! - \fn void DAnchorsBase::marginsChanged(int margins) - \brief 信号会在 \a margins 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::marginsChanged(int margins) + @brief The signal is sent when the value of the \a margins attribute changes */ /*! - \fn void DAnchorsBase::topMarginChanged(int topMargin) - \brief 信号会在 \a topMargin 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::topMarginChanged(int topMargin) + @brief The signal is sent when the value of the \a topMargin attribute changes */ /*! - \fn void DAnchorsBase::bottomMarginChanged(int bottomMargin) - \brief 信号会在 \a bottomMargin 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::bottomMarginChanged(int bottomMargin) + @brief The signal is sent when the value of the \a bottomMargin attribute changes */ /*! - \fn void DAnchorsBase::leftMarginChanged(int leftMargin) - \brief 信号会在 \a leftMargin 属性的值改变时被发送 +@~english + @fn void DAnchorsBase::leftMarginChanged(int leftMargin) + @brief The signal is sent when the value of the \a leftMargin attribute changes */ /*! - \fn DAnchorsBase::rightMarginChanged(int rightMargin) - \brief 信号会在 \a rightMargin 属性的值改变时被发送 +@~english + @fn DAnchorsBase::rightMarginChanged(int rightMargin) + @brief The signal is sent when the value of the \a rightMargin attribute changes */ /*! - \fn DAnchorsBase::horizontalCenterOffsetChanged(int horizontalCenterOffset) - \brief 信号会在 \a horizontalCenterOffset 属性的值改变时被发送 +@~english + @fn DAnchorsBase::horizontalCenterOffsetChanged(int horizontalCenterOffset) + @brief The signal is sent when the value of the \a horizontalCenterOffset attribute changes */ /*! - \fn DAnchorsBase::verticalCenterOffsetChanged(int verticalCenterOffset) - \brief 信号会在 \a verticalCenterOffset 属性的值改变时被发送 +@~english + @fn DAnchorsBase::verticalCenterOffsetChanged(int verticalCenterOffset) + @brief The signal is sent when the value of the \a verticalCenterOffset attribute changes */ /*! - \class Dtk::Widget::DAnchors +@~english + @class Dtk::Widget::DAnchors \inmodule dtkwidget - \brief DAnchors 是一个模板类,在 DAnchorsBase 的基础上保存了一个控件指针, - 将控件和锚定绑定在一起使用,相当于把“锚线”属性附加到了控件本身. + @brief DAnchors is a template class that holds a control pointer on top of DAnchorsBase, + Using a control in conjunction with an anchor is like attaching an anchor property to the control itself. - 重载了 “->”、“*”、“&” 等运算符,用于把 DAnchors 这层封装透明化,尽量减少使用 - DAnchors 和直接使用 QWidget* 对象的区别。 + The "->", "*", and "&" operators are overloaded to make the DAnchors layer transparent and minimize the difference between using DAnchors and directly using QWidget* objects. */ /*! - \class Dtk::Widget::DAnchorInfo +@~english + @class Dtk::Widget::DAnchorInfo \inmodule dtkwidget - \brief DAnchorInfo 用于记录“锚线”的锚定信息:被锚定的 DAnchorsBase 对象、 - 锚定的类型、目标“锚线”的信息. + @brief DAnchorInfo is used to record the anchoring information of the "anchor line" : the DAnchorsBase object being anchored, + the type of anchoring, the information of the target "anchor line". - 每条锚线都和一个 DAnchorInfo 对象相对应。一般来说,在使用锚定布局时,只需要关心 - “锚线”的绑定关系,不用关心 DAnchorInfo 中存储的数据。 + Each anchor line is associated with a DAnchorInfo object. In general, + when using anchor layouts, you only need to care about the binding of the "anchor lines" and not about the data stored in DAnchorInfo. */ class DAnchorsRect: public QRect @@ -631,15 +656,15 @@ QMap DAnchorsBasePrivate::widgetMap; /*! - \brief 构造 DAnchorsBase 对象,传入的 w 对象会和一个新的 DAnchorsBase 对象 - 绑定到一起 - \a w 需要使用锚定关系的控件 - \note 对 w 设置的锚定关系不会随着本次构造的 DAnchorsBase 对象的销毁而消失。 - 此构造函数可能会隐式的构造一个新 DAnchorsBase 对象用于真正的功能实现,函数执行 - 时会先检查当前是否已经有和 w 对象绑定的 DAnchorsBase 对象,如果没有则会创建一 - 个新的 DAnchorsBase 对象与之绑定,否则使用已有的对象。隐式创建的 DAnchorsBase - 对象会在对应的 QWidget 对象被销毁时自动销毁。 - \sa target() clearAnchors() getAnchorBaseByWidget() +@~english + @brief Construct the DAnchorsBase object, passing in the w object and binding it to a new DAnchorsBase object + \a w Controls that need to use anchored relationships + @note The anchoring relationship for w does not disappear with the destruction of the DAnchorsBase object for this construction. + This constructor may implicitly construct a new DAnchorsBase object for actual implementation, function execution + Will first check if there is already a DAnchorsBase object bound to the w object and create one if not + A new DAnchorsBase object is bound to it; otherwise, an existing object is used. Implicitly created DAnchorsBase + Object is automatically destroyed when the corresponding QWidget object is destroyed. + @sa target() clearAnchors() getAnchorBaseByWidget() */ DAnchorsBase::DAnchorsBase(QWidget *w): QObject(w) @@ -648,12 +673,12 @@ } /*! - \brief 在析构时会判断此 DAnchorsBase 对象是否和 target 存在绑定关系,如果是 - 则从映射表中移除绑定 - \warning DAnchorsBasePrivate 对象可能是在多个 DAnchorsBase 对象之间显式 - 共享的,所以在销毁 DAnchorsBase 后,对应的 DAnchorsBasePrivate 对象不一定 - 会被销毁 - \sa QExplicitlySharedDataPointer +@~english + @brief On destruction, the DAnchorsBase object is determined to be bound to the target, + and if so, the binding is removed from the mapping table + @warning The DAnchorsBasePrivate object may be explicitly shared between multiple DAnchorsBase objects, + so the corresponding DAnchorsBasePrivate object is not necessarily destroyed after the destruction of the DAnchorsBase + @sa QExplicitlySharedDataPointer */ DAnchorsBase::~DAnchorsBase() { @@ -680,10 +705,11 @@ } /*! - \brief 返回 target 控件的扩展对象。此对象为 QWidget 对象额外提供了和控件大小、 - 位置相关的变化信号 - \return - \sa Dtk::Widget::DEnhancedWidget +@~english + @brief Returns the extension object of the target control. + This object provides additional change signals to the QWidget object related to the size and position of the widget + @return + @sa Dtk::Widget::DEnhancedWidget */ DEnhancedWidget *DAnchorsBase::enhancedWidget() const { @@ -828,10 +854,11 @@ } /*! - \brief 锚定过程中产生的错误,在一个新的锚定函数被调用之前会清空此错误状态,每次 - 调用锚定函数后,可以通过此函数的返回值来判断锚定设置是否成功 - \return - \sa errorString() +@~english + @brief Errors generated during anchoring will clear this state before a new anchoring function is called, + and each time the anchoring function is called, the return value of this function can be used to determine whether the anchoring setup was successful + @return + @sa errorString() */ DAnchorsBase::AnchorError DAnchorsBase::errorCode() const { @@ -841,9 +868,10 @@ } /*! - \brief 对 errorCode 的文本描述信息 - \return - \sa errorCode +@~english + @brief A textual description of the errorCode + @return + @sa errorCode */ QString DAnchorsBase::errorString() const { @@ -853,18 +881,19 @@ } /*! - \brief 如果此 info 设置了锚定对象,则返回 true ,否则返回 false - \code +@~english + @brief Returns true if this info sets the anchor object, false otherwise + @code DAnchors w1; DAnchors w2; w1.setLeft(w2.right()); qDebug() << w1.isBinding(w1.left()) << w2.isBinding(w2.right()); - \endcode - 打印内容为:ture false + @endcode + Print the content as:ture false \a info - \return + @return */ bool DAnchorsBase::isBinding(const DAnchorInfo *info) const { @@ -872,13 +901,14 @@ } /*! - \brief 方便用户直接设置两个对象之间锚定关系的静态函数,调用此函数可能会隐式创建 - DAnchorsBase 对象 - \a w 要锚定的控件对象 - \a p 要锚定的锚线/锚点 - \a target 锚定的目标对象 - \a point 锚定的目标锚线/锚点 - \return 如果锚定成功,则返回 true,否则返回 false +@~english + @brief A static function that allows you to set the anchoring relationship between two objects directly. + Calling this function may implicitly create a DAnchorsBase object + \a w Control object to anchor + \a p Anchor line/anchor point to be anchored + \a target The target object to anchor + \a point The target anchor line/anchor point for anchoring + @return It returns true if anchoring was successful and false otherwise */ bool DAnchorsBase::setAnchor(QWidget *w, const Qt::AnchorPoint &p, QWidget *target, const Qt::AnchorPoint &point) { @@ -895,8 +925,9 @@ } /*! - \brief 清除和控件 w 相关的所有锚定关系,包括锚定w或者被w锚定的任何关联。会直接 - 销毁 w 对应的 DAnchorsBase 对象 +@~english + @brief Clears all anchoring relationships associated with control w, including any associations that anchor w or are anchored by w. Will be direct + The DAnchorsBase object corresponding to w is destroyed \a w */ void DAnchorsBase::clearAnchors(const QWidget *w) @@ -908,9 +939,10 @@ } /*! - \brief 返回与 w 绑定的 DAnchorsBase 对象 +@~english + @brief Returns the DAnchorsBase object bound to w \a w - \return 如果 w 没有对应的锚定对象,则返回空 + @return If there is no corresponding anchored object for w, then null is returned */ DAnchorsBase *DAnchorsBase::getAnchorBaseByWidget(const QWidget *w) { @@ -928,12 +960,13 @@ } /*! - \brief 为 DAnchorsBase::target 对象设置锚定规则 - \note 可能会为目标控件隐式创建其对应的 DAnchorsBase 对象 - \a p 为当前控件的哪个锚线/锚点设置锚定规则 - \a target 锚定的目标控件 - \a point 锚定的目标锚线/锚点 - \return 如果设置成功,则返回 true,否则返回 false +@~english + @brief Set the anchoring rules for the DAnchorsBase::target object + @note A corresponding DAnchorsBase object may be created implicitly for the target control + \a p Set the anchor rule for which anchor line/anchor point of the current control + \a target The anchored target control + \a point The target anchor line/anchor point for anchoring + @return It returns true if the setting was successful and false otherwise */ bool DAnchorsBase::setAnchor(const Qt::AnchorPoint &p, QWidget *target, const Qt::AnchorPoint &point) { @@ -1168,9 +1201,10 @@ } /*! - \brief 将 fill 中的target()作为参数调用其它重载函数 +@~english + @brief Call the other overloaded functions with the target() in fill as an argument \a fill - \return + @return */ bool DAnchorsBase::setFill(DAnchorsBase *fill) { @@ -1178,9 +1212,10 @@ } /*! - \brief 将 centerIn 中的target()作为参数调用其它重载函数 +@~english + @brief Call other overloaded functions with target() in centerIn as an argument \a centerIn - \return + @return */ bool DAnchorsBase::setCenterIn(DAnchorsBase *centerIn) { @@ -1375,8 +1410,9 @@ } /*! - \brief 移动 target 控件的上边界到 arg 这个位置 - \a arg 要移动到的位置 +@~english + @brief Move the upper boundary of the target control to the arg position + \a arg The location to move to */ void DAnchorsBase::moveTop(int arg) { @@ -1384,8 +1420,9 @@ } /*! - \brief 移动 target 控件的下边界到 arg 这个位置 - \a arg 要移动到的位置 +@~english + @brief Move the lower boundary of the target control to arg + \a arg The location to move to */ void DAnchorsBase::moveBottom(int arg) { @@ -1393,8 +1430,9 @@ } /*! - \brief 移动 target 控件的左边界到 arg 这个位置 - \a arg 要移动到的位置 +@~english + @brief Move the left edge of the target control to arg + \a arg The location to move to */ void DAnchorsBase::moveLeft(int arg) { @@ -1402,8 +1440,9 @@ } /*! - \brief 移动 target 控件的右边界到 arg 这个位置 - \a arg 要移动到的位置 +@~english + @brief Move the right edge of the target control to arg + \a arg The location to move to */ void DAnchorsBase::moveRight(int arg) { @@ -1411,8 +1450,9 @@ } /*! - \brief 移动 target 控件的水平中线到 arg 这个位置 - \a arg 要移动到的位置 +@~english + @brief Move the horizontal midline of the target control to arg + \a arg The location to move to */ void DAnchorsBase::moveHorizontalCenter(int arg) { @@ -1420,8 +1460,9 @@ } /*! - \brief 移动 target 控件的竖直中线到 arg 这个位置 - \a arg 要移动到的位置 +@~english + @brief Move the middle vertical line of the target control to arg + \a arg The location to move to */ void DAnchorsBase::moveVerticalCenter(int arg) { @@ -1429,8 +1470,9 @@ } /*! - \brief 移动 target 控件的上边界到 arg 这个位置 - \a arg 要移动到的位置 +@~english + @brief Move the top boundary of the target control to arg + \a arg The location to move to */ void DAnchorsBase::moveCenter(const QPoint &arg) { diff -Nru dtkwidget-5.5.48/src/widgets/danchors.h dtkwidget-5.6.12/src/widgets/danchors.h --- dtkwidget-5.5.48/src/widgets/danchors.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/danchors.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,260 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: kirigaya - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DANCHORS_H -#define DANCHORS_H - - -#include -#include -#include -#include -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DAnchorsBase; -struct DAnchorInfo { - DAnchorInfo(DAnchorsBase *b, const Qt::AnchorPoint &t): - base(b), - type(t) - { - } - - DAnchorsBase *base; - Qt::AnchorPoint type; - const DAnchorInfo *targetInfo = NULL; - - bool operator==(const DAnchorInfo *info) const - { - return info == targetInfo; - } - - bool operator==(const DAnchorInfo &info) const - { - return &info == targetInfo; - } - - bool operator!=(const DAnchorInfo *info) const - { - return info != targetInfo; - } - - bool operator!=(const DAnchorInfo &info) const - { - return &info != targetInfo; - } - - const DAnchorInfo &operator=(const DAnchorInfo *info) - { - targetInfo = info; - - return *this; - } -}; - -class DAnchorsBasePrivate; -class DEnhancedWidget; -class DAnchorsBase : public QObject -{ - Q_OBJECT - - Q_PROPERTY(QWidget *target READ target CONSTANT) - Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) - Q_PROPERTY(const DAnchorsBase *anchors READ anchors) - Q_PROPERTY(const DAnchorInfo *top READ top WRITE setTop NOTIFY topChanged) - Q_PROPERTY(const DAnchorInfo *bottom READ bottom WRITE setBottom NOTIFY bottomChanged) - Q_PROPERTY(const DAnchorInfo *left READ left WRITE setLeft NOTIFY leftChanged) - Q_PROPERTY(const DAnchorInfo *right READ right WRITE setRight NOTIFY rightChanged) - Q_PROPERTY(const DAnchorInfo *horizontalCenter READ horizontalCenter WRITE setHorizontalCenter NOTIFY horizontalCenterChanged) - Q_PROPERTY(const DAnchorInfo *verticalCenter READ verticalCenter WRITE setVerticalCenter NOTIFY verticalCenterChanged) - Q_PROPERTY(QWidget *fill READ fill WRITE setFill NOTIFY fillChanged) - Q_PROPERTY(QWidget *centerIn READ centerIn WRITE setCenterIn NOTIFY centerInChanged) - Q_PROPERTY(int margins READ margins WRITE setMargins NOTIFY marginsChanged) - Q_PROPERTY(int topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged) - Q_PROPERTY(int bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged) - Q_PROPERTY(int leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged) - Q_PROPERTY(int rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged) - Q_PROPERTY(int horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged) - Q_PROPERTY(int verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged) - Q_PROPERTY(bool alignWhenCentered READ alignWhenCentered WRITE setAlignWhenCentered NOTIFY alignWhenCenteredChanged) - -public: - explicit DAnchorsBase(QWidget *w); - ~DAnchorsBase(); - - enum AnchorError { - NoError, - Conflict, - TargetInvalid, - PointInvalid, - LoopBind - }; - - QWidget *target() const; - DEnhancedWidget *enhancedWidget() const; - bool enabled() const; - const DAnchorsBase *anchors() const; - const DAnchorInfo *top() const; - const DAnchorInfo *bottom() const; - const DAnchorInfo *left() const; - const DAnchorInfo *right() const; - const DAnchorInfo *horizontalCenter() const; - const DAnchorInfo *verticalCenter() const; - QWidget *fill() const; - QWidget *centerIn() const; - int margins() const; - int topMargin() const; - int bottomMargin() const; - int leftMargin() const; - int rightMargin() const; - int horizontalCenterOffset() const; - int verticalCenterOffset() const; - int alignWhenCentered() const; - AnchorError errorCode() const; - QString errorString() const; - bool isBinding(const DAnchorInfo *info) const; - - static bool setAnchor(QWidget *w, const Qt::AnchorPoint &p, QWidget *target, const Qt::AnchorPoint &point); - static void clearAnchors(const QWidget *w); - static DAnchorsBase *getAnchorBaseByWidget(const QWidget *w); - -public Q_SLOTS: - void setEnabled(bool enabled); - bool setAnchor(const Qt::AnchorPoint &p, QWidget *target, const Qt::AnchorPoint &point); - bool setTop(const DAnchorInfo *top); - bool setBottom(const DAnchorInfo *bottom); - bool setLeft(const DAnchorInfo *left); - bool setRight(const DAnchorInfo *right); - bool setHorizontalCenter(const DAnchorInfo *horizontalCenter); - bool setVerticalCenter(const DAnchorInfo *verticalCenter); - bool setFill(QWidget *fill); - bool setCenterIn(QWidget *centerIn); - bool setFill(DAnchorsBase *fill); - bool setCenterIn(DAnchorsBase *centerIn); - void setMargins(int margins); - void setTopMargin(int topMargin); - void setBottomMargin(int bottomMargin); - void setLeftMargin(int leftMargin); - void setRightMargin(int rightMargin); - void setHorizontalCenterOffset(int horizontalCenterOffset); - void setVerticalCenterOffset(int verticalCenterOffset); - void setAlignWhenCentered(bool alignWhenCentered); - - void setTop(int arg, Qt::AnchorPoint point); - void setBottom(int arg, Qt::AnchorPoint point); - void setLeft(int arg, Qt::AnchorPoint point); - void setRight(int arg, Qt::AnchorPoint point); - void setHorizontalCenter(int arg, Qt::AnchorPoint point); - void setVerticalCenter(int arg, Qt::AnchorPoint point); - - void moveTop(int arg); - void moveBottom(int arg); - void moveLeft(int arg); - void moveRight(int arg); - void moveHorizontalCenter(int arg); - void moveVerticalCenter(int arg); - void moveCenter(const QPoint &arg); - -private Q_SLOTS: - void updateVertical(); - void updateHorizontal(); - void updateFill(); - void updateCenterIn(); - -Q_SIGNALS: - void enabledChanged(bool enabled); - void topChanged(const DAnchorInfo *top); - void bottomChanged(const DAnchorInfo *bottom); - void leftChanged(const DAnchorInfo *left); - void rightChanged(const DAnchorInfo *right); - void horizontalCenterChanged(const DAnchorInfo *horizontalCenter); - void verticalCenterChanged(const DAnchorInfo *verticalCenter); - void fillChanged(QWidget *fill); - void centerInChanged(QWidget *centerIn); - void marginsChanged(int margins); - void topMarginChanged(int topMargin); - void bottomMarginChanged(int bottomMargin); - void leftMarginChanged(int leftMargin); - void rightMarginChanged(int rightMargin); - void horizontalCenterOffsetChanged(int horizontalCenterOffset); - void verticalCenterOffsetChanged(int verticalCenterOffset); - void alignWhenCenteredChanged(bool alignWhenCentered); - -protected: - void init(QWidget *w); - -private: - DAnchorsBase(QWidget *w, bool); - - QExplicitlySharedDataPointer d_ptr; - - Q_DECLARE_PRIVATE(DAnchorsBase) -}; - -template -class DAnchors : public DAnchorsBase -{ -public: - inline DAnchors(): DAnchorsBase((QWidget*)NULL), m_widget(NULL) {} - inline DAnchors(T *w): DAnchorsBase(w), m_widget(w) {} - inline DAnchors(const DAnchors &me): DAnchorsBase(me.m_widget), m_widget(me.m_widget) {} - - inline T &operator=(const DAnchors &me) - { - m_widget = me.m_widget; - init(m_widget); - return *m_widget; - } - inline T &operator=(T *w) - { - m_widget = w; - init(w); - return *m_widget; - } - inline T *widget() const - { - return m_widget; - } - inline T *operator ->() const - { - return m_widget; - } - inline T &operator *() const - { - return *m_widget; - } - inline operator T *() const - { - return m_widget; - } - inline operator T &() const - { - return *m_widget; - } - -private: - T *m_widget; -}; - -DWIDGET_END_NAMESPACE - -#endif // DANCHORS_H diff -Nru dtkwidget-5.5.48/src/widgets/DApplication dtkwidget-5.6.12/src/widgets/DApplication --- dtkwidget-5.5.48/src/widgets/DApplication 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DApplication 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dapplication.h" diff -Nru dtkwidget-5.5.48/src/widgets/dapplication.cpp dtkwidget-5.6.12/src/widgets/dapplication.cpp --- dtkwidget-5.5.48/src/widgets/dapplication.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dapplication.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #ifdef Q_OS_LINUX @@ -53,24 +40,18 @@ #include "dthememanager.h" #include "private/dapplication_p.h" #include "daboutdialog.h" +#include "dfeaturedisplaydialog.h" #include "dmainwindow.h" +#include "dsizemode.h" #include #include #include #include - -#ifdef Q_OS_UNIX -#include -#include -#include -#include -#include -#include -#endif +#include #ifdef Q_OS_LINUX -#include "startupnotificationmonitor.h" +#include "private/startupnotifications/startupnotificationmonitor.h" #include @@ -85,43 +66,6 @@ DWIDGET_BEGIN_NAMESPACE -class LoadManualServiceWorker : public QThread -{ -public: - explicit LoadManualServiceWorker(QObject *parent = nullptr); - ~LoadManualServiceWorker() override; - void checkManualServiceWakeUp(); - -protected: - void run() override; -}; - -LoadManualServiceWorker::LoadManualServiceWorker(QObject *parent) - : QThread(parent) -{ - if (!parent) - connect(qApp, &QApplication::aboutToQuit, this, std::bind(&LoadManualServiceWorker::exit, this, 0)); -} - -LoadManualServiceWorker::~LoadManualServiceWorker() -{ -} - -void LoadManualServiceWorker::run() -{ - QDBusInterface("com.deepin.Manual.Search", - "/com/deepin/Manual/Search", - "com.deepin.Manual.Search"); -} - -void LoadManualServiceWorker::checkManualServiceWakeUp() -{ - if (this->isRunning()) - return; - - start(); -} - DApplicationPrivate::DApplicationPrivate(DApplication *q) : DObjectPrivate(q) { @@ -293,7 +237,7 @@ qtTranslator->load("qtbase_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); q->installTranslator(qtbaseTranslator); - QList translateDirs; + QList translateDirs; auto dtkwidgetDir = DWIDGET_TRANSLATIONS_DIR; auto dtkwidgetName = "dtkwidget"; @@ -301,71 +245,14 @@ auto dataDirs = DStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); for (const auto &path : dataDirs) { DPathBuf DPathBuf(path); - translateDirs << DPathBuf / dtkwidgetDir; + translateDirs << (DPathBuf / dtkwidgetDir).toString(); } - DPathBuf runDir(q->applicationDirPath()); - translateDirs << runDir.join("translations"); - - DPathBuf currentDir(QDir::currentPath()); - translateDirs << currentDir.join("translations"); - #ifdef DTK_STATIC_TRANSLATION - translateDirs << DPathBuf(":/dtk/translations"); + translateDirs << QString(":/dtk/translations"); #endif - return loadTranslator(translateDirs, dtkwidgetName, localeFallback); -} - -bool DApplicationPrivate::loadTranslator(QList translateDirs, const QString &name, QList localeFallback) -{ - D_Q(DApplication); - - QStringList missingQmfiles; - for (auto &locale : localeFallback) { - QString translateFilename = QString("%1_%2").arg(name).arg(locale.name()); - for (auto &path : translateDirs) { - QString translatePath = (path / translateFilename).toString(); - if (QFile::exists(translatePath + ".qm")) { - qDebug() << "load translate" << translatePath; - auto translator = new QTranslator(q); - translator->load(translatePath); - q->installTranslator(translator); - return true; - } - } - - // fix english does not need to translation.. - if (locale.language() != QLocale::English) { - missingQmfiles << translateFilename + ".qm"; - } - - QStringList parseLocalNameList = locale.name().split("_", QString::SkipEmptyParts); - if (parseLocalNameList.length() > 0) { - translateFilename = QString("%1_%2").arg(name) - .arg(parseLocalNameList.at(0)); - for (auto &path : translateDirs) { - QString translatePath = (path / translateFilename).toString(); - if (QFile::exists(translatePath + ".qm")) { - qDebug() << "translatePath after feedback:" << translatePath; - auto translator = new QTranslator(q); - translator->load(translatePath); - q->installTranslator(translator); - return true; - } - } - } - - // fix english does not need to translation.. - if (locale.language() != QLocale::English) { - missingQmfiles << translateFilename + ".qm"; - } - } - - if (missingQmfiles.size() > 0) { - qWarning() << name << "can not find qm files" << missingQmfiles; - } - return false; + return DGuiApplicationHelper::loadTranslator(dtkwidgetName, translateDirs, localeFallback); } // 自动激活DMainWindow类型的窗口 @@ -503,49 +390,32 @@ acclimatizeVirtualKeyboardForFocusWidget(false); } -bool DApplicationPrivate::isUserManualExists() +void DApplicationPrivate::_q_sizeModeChanged() { -#ifdef Q_OS_LINUX - auto loadManualFromLocalFile = [=]() -> bool { - const QString appName = qApp->applicationName(); - bool dmanAppExists = QFile::exists("/usr/bin/dman"); - bool dmanDataExists = false; - // search all subdirectories - QString strManualPath = "/usr/share/deepin-manual"; - QDirIterator it(strManualPath, QDirIterator::Subdirectories); - while (it.hasNext()) { - QFileInfo file(it.next()); - if (file.isDir() && file.fileName().contains(appName, Qt::CaseInsensitive)) { - dmanDataExists = true; - break; - } - - if (file.isDir()) - continue; - } - return dmanAppExists && dmanDataExists; - }; + QEvent ev(QEvent::StyleChange); + for (auto item : qApp->topLevelWidgets()) { + handleSizeModeChangeEvent(item, &ev); + } +} - QDBusConnection conn = QDBusConnection::sessionBus(); - if (conn.interface()->isServiceRegistered("com.deepin.Manual.Search")) { - QDBusInterface manualSearch("com.deepin.Manual.Search", - "/com/deepin/Manual/Search", - "com.deepin.Manual.Search"); - if (manualSearch.isValid()) { - QDBusReply reply = manualSearch.call("ManualExists", qApp->applicationName()); - return reply.value(); - } else { - return loadManualFromLocalFile(); - } +void DApplicationPrivate::handleSizeModeChangeEvent(QWidget *widget, QEvent *event) +{ + // 深度优先遍历,事件接受顺序:子 -> 父, 若parentWidget先处理event,可能存在布局没更新问题 + for (auto w : widget->findChildren(QString(), Qt::FindDirectChildrenOnly)) { + handleSizeModeChangeEvent(w, event); + } + if (widget->isTopLevel()) { + // TODO 顶层窗口需要延迟,否则内部控件布局出现异常,例如DDialog, 若send事件,导致 + // 从compact -> normal -> campact时,DDialog内部控件布局的两次campact大小不一致. + qApp->postEvent(widget, new QEvent(*event)); } else { - static LoadManualServiceWorker *manualWorker = new LoadManualServiceWorker; - manualWorker->checkManualServiceWakeUp(); - - return loadManualFromLocalFile(); + QCoreApplication::sendEvent(widget, event); } -#else - return false; -#endif +} + +bool DApplicationPrivate::isUserManualExists() +{ + return DGuiApplicationHelper::instance()->hasUserManual(); } /*! @@ -732,6 +602,9 @@ QTapAndHoldGesture::setTimeout(gsettings.get("longpress-duration").toInt() - 100); } #endif + + connect(DGuiApplicationHelper::instance(), SIGNAL(sizeModeChanged(DGuiApplicationHelper::SizeMode)), + this, SLOT(_q_sizeModeChanged())); } /*! @@ -876,24 +749,20 @@ d->loadDtkTranslator(localeFallback); - QList translateDirs; + QList translateDirs; auto appName = applicationName(); //("/home/user/.local/share", "/usr/local/share", "/usr/share") auto dataDirs = DStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); for (const auto &path : dataDirs) { DPathBuf DPathBuf(path); - translateDirs << DPathBuf / appName / "translations"; + translateDirs << (DPathBuf / appName / "translations").toString(); } - DPathBuf runDir(this->applicationDirPath()); - translateDirs << runDir.join("translations"); - DPathBuf currentDir(QDir::currentPath()); - translateDirs << currentDir.join("translations"); #ifdef DTK_STATIC_TRANSLATION - translateDirs << DPathBuf(":/dtk/translations"); + translateDirs << QString(":/dtk/translations"); #endif - return d->loadTranslator(translateDirs, appName, localeFallback); + return DGuiApplicationHelper::loadTranslator(appName, translateDirs, localeFallback); } /*! @@ -1239,6 +1108,31 @@ d->aboutDialog = aboutDialog; } +DFeatureDisplayDialog *DApplication::featureDisplayDialog() +{ + D_D(DApplication); + if (d->featureDisplayDialog == nullptr) { + d->featureDisplayDialog = new DFeatureDisplayDialog(); + connect(this, &DApplication::aboutToQuit, this, [this]{ + D_D(DApplication); + d->featureDisplayDialog->deleteLater(); + d->featureDisplayDialog = nullptr; + }); + } + return d->featureDisplayDialog; +} + +void DApplication::setFeatureDisplayDialog(DFeatureDisplayDialog *featureDisplayDialog) +{ + D_D(DApplication); + + if (d->featureDisplayDialog && d->featureDisplayDialog != featureDisplayDialog) { + d->featureDisplayDialog->deleteLater(); + } + + d->featureDisplayDialog = featureDisplayDialog; +} + /*! \property DApplication::visibleMenuShortcutText @@ -1428,6 +1322,42 @@ return d->acclimatizeVirtualKeyboardWindows.contains(window); } +QString DApplication::applicationCreditsFile() const +{ + D_DC(DApplication); + return d->applicationCreditsFile; +} + +void DApplication::setApplicationCreditsFile(const QString &file) +{ + D_D(DApplication); + d->applicationCreditsFile = file; +} + +QByteArray DApplication::applicationCreditsContent() const +{ + D_DC(DApplication); + return d->applicationCreditsContent; +} + +void DApplication::setApplicationCreditsContent(const QByteArray &content) +{ + D_D(DApplication); + d->applicationCreditsContent = content; +} + +QString DApplication::licensePath() const +{ + D_DC(DApplication); + return d->licensePath; +} + +void DApplication::setLicensePath(const QString &path) +{ + D_D(DApplication); + d->licensePath = path; +} + /*! \brief 设置 app 的处理程序. @@ -1470,27 +1400,7 @@ d->appHandler->handleHelpAction(); return; } - if (!DApplicationPrivate::isUserManualExists()) { - return; - } -#ifdef Q_OS_LINUX - QString appid = applicationName(); - - // new interface use applicationName as id - QDBusInterface manual("com.deepin.Manual.Open", - "/com/deepin/Manual/Open", - "com.deepin.Manual.Open"); - QDBusReply reply = manual.call("ShowManual", appid); - if (reply.isValid()) { - qDebug() << "call com.deepin.Manual.Open success"; - return; - } - qDebug() << "call com.deepin.Manual.Open failed" << reply.error(); - // fallback to old interface - QProcess::startDetached("dman", QStringList() << appid); -#else - qWarning() << "not support dman now"; -#endif + DGuiApplicationHelper::instance()->handleHelpAction(); } /*! @@ -1510,10 +1420,22 @@ d->appHandler->handleAboutAction(); return; } - + if (d->licenseDialog == nullptr) { + d->licenseDialog = new DLicenseDialog(); + d->licenseDialog->setFile(d->applicationCreditsFile); + d->licenseDialog->setContent(d->applicationCreditsContent); + d->licenseDialog->setLicenseSearchPath(d->licensePath); + d->licenseDialog->load(); + connect(this, &DApplication::aboutToQuit, this, [this]{ + D_D(DApplication); + d->licenseDialog->deleteLater(); + d->licenseDialog = nullptr; + }); + } if (d->aboutDialog) { d->aboutDialog->activateWindow(); d->aboutDialog->raise(); + d->aboutDialog->setLicenseEnabled(d->licenseDialog->isValid()); if (DGuiApplicationHelper::isTabletEnvironment()) { d->aboutDialog->exec(); } else { @@ -1525,7 +1447,7 @@ DAboutDialog *aboutDialog = new DAboutDialog(activeWindow()); aboutDialog->setProductName(productName()); aboutDialog->setProductIcon(productIcon()); - aboutDialog->setVersion(translate("DAboutDialog", "Version: %1").arg(applicationVersion())); + aboutDialog->setVersion(applicationVersion()); aboutDialog->setDescription(applicationDescription()); if (!applicationLicense().isEmpty()) { @@ -1541,10 +1463,17 @@ // 不能使用aboutToClose信号 应用能够打开多个的情况下 打开关于后直接关闭程序 // 此时aboutToColose信号不会触发 再次打开程序并打开关于会出现访问野指针 程序崩溃的情况 d->aboutDialog = aboutDialog; + d->aboutDialog->setLicenseEnabled(d->licenseDialog->isValid()); connect(d->aboutDialog, &DAboutDialog::destroyed, this, [=] { d->aboutDialog = nullptr; }); - + connect(d->aboutDialog, &DAboutDialog::featureActivated, this, [this] { + featureDisplayDialog()->show(); + }); + connect(d->aboutDialog, &DAboutDialog::licenseActivated, this, [d] { + d->licenseDialog->activateWindow(); + d->licenseDialog->show(); + }); if (DGuiApplicationHelper::isTabletEnvironment()) { aboutDialog->exec(); } else { diff -Nru dtkwidget-5.5.48/src/widgets/dapplication.h dtkwidget-5.6.12/src/widgets/dapplication.h --- dtkwidget-5.5.48/src/widgets/dapplication.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dapplication.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,204 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DAPPLICATION_H -#define DAPPLICATION_H - -#include -#include -#include - -#include - -DGUI_USE_NAMESPACE -DWIDGET_BEGIN_NAMESPACE - -#define DAPPLICATION_XSTRING(s) DAPPLICATION_STRING(s) -#define DAPPLICATION_STRING(s) #s - -class DApplication; -class DApplicationPrivate; -class DAboutDialog; -class DAppHandler; - -#if defined(qApp) -#undef qApp -#endif -#define qApp (static_cast(QCoreApplication::instance())) - -class LIBDTKWIDGETSHARED_EXPORT DApplication : public QApplication, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DApplication) - Q_PROPERTY(bool visibleMenuShortcutText READ visibleMenuShortcutText WRITE setVisibleMenuShortcutText) - Q_PROPERTY(bool visibleMenuCheckboxWidget READ visibleMenuCheckboxWidget WRITE setVisibleMenuCheckboxWidget) - Q_PROPERTY(bool visibleMenuIcon READ visibleMenuIcon WRITE setVisibleMenuIcon) - Q_PROPERTY(bool autoActivateWindows READ autoActivateWindows WRITE setAutoActivateWindows) - -public: - static DApplication *globalApplication(int &argc, char **argv); - - DApplication(int &argc, char **argv); - - enum SingleScope { - UserScope, - SystemScope - }; - - D_DECL_DEPRECATED QString theme() const; - D_DECL_DEPRECATED void setTheme(const QString &theme); - -#ifdef Q_OS_UNIX - void setOOMScoreAdj(const int score); -#endif - - bool setSingleInstance(const QString &key); - bool setSingleInstance(const QString &key, SingleScope singleScope); - - bool loadTranslator(QList localeFallback = QList() << QLocale::system()); - - //! warning: Must call before QGuiApplication defined object - D_DECL_DEPRECATED static bool loadDXcbPlugin(); - static bool isDXcbPlatform(); - - // return the libdtkwidget version of build application - static int buildDtkVersion(); - // return the libdtkwidget version of runing application - static int runtimeDtkVersion(); - - // let startdde know that we've already started. - static void registerDDESession(); - - static void customQtThemeConfigPathByUserHome(const QString &home); - static void customQtThemeConfigPath(const QString &path); - static QString customizedQtThemeConfigPath(); - - // meta information that necessary to create a about dialog for the application. - QString productName() const; - void setProductName(const QString &productName); - - const QIcon &productIcon() const; - void setProductIcon(const QIcon &productIcon); - - QString applicationLicense() const; - void setApplicationLicense(const QString &license); - - QString applicationDescription() const; - void setApplicationDescription(const QString &description); - - QString applicationHomePage() const; - void setApplicationHomePage(const QString &link); - - QString applicationAcknowledgementPage() const; - void setApplicationAcknowledgementPage(const QString &link); - - bool applicationAcknowledgementVisible() const; - void setApplicationAcknowledgementVisible(bool visible); - - DAboutDialog *aboutDialog(); - void setAboutDialog(DAboutDialog *aboutDialog); - - bool visibleMenuShortcutText() const; - void setVisibleMenuShortcutText(bool value); - - bool visibleMenuCheckboxWidget() const; - void setVisibleMenuCheckboxWidget(bool value); - - bool visibleMenuIcon() const; - void setVisibleMenuIcon(bool value); - - bool autoActivateWindows() const; - void setAutoActivateWindows(bool autoActivateWindows); - - // 使窗口内的输入框自动适应虚拟键盘 - void acclimatizeVirtualKeyboard(QWidget *window); - void ignoreVirtualKeyboard(QWidget *window); - bool isAcclimatizedVirtualKeyboard(QWidget *window) const; - -#ifdef VERSION - static inline QString buildVersion(const QString &fallbackVersion) - { - QString autoVersion = DAPPLICATION_XSTRING(VERSION); - if (autoVersion.isEmpty()) { - autoVersion = fallbackVersion; - } - return autoVersion; - } -#else - static inline QString buildVersion(const QString &fallbackVersion) - { - return fallbackVersion; - } -#endif - -Q_SIGNALS: - void newInstanceStarted(); - - //###(zccrs): Depend the Qt platform theme plugin(from the package: dde-qt5integration) - void iconThemeChanged(); - //###(zccrs): Emit form the Qt platform theme plugin(from the package: dde-qt5integration) - void screenDevicePixelRatioChanged(QScreen *screen); - -public: - void setCustomHandler(DAppHandler *handler); - DAppHandler *customHandler(); - -protected: - virtual void handleHelpAction(); - virtual void handleAboutAction(); - virtual void handleQuitAction(); - -public: - bool notify(QObject *obj, QEvent *event) Q_DECL_OVERRIDE; - -private: - friend class DTitlebarPrivate; - friend class DMainWindowPrivate; - - D_PRIVATE_SLOT(void _q_onNewInstanceStarted()) - D_PRIVATE_SLOT(void _q_panWindowContentsForVirtualKeyboard()) - D_PRIVATE_SLOT(void _q_resizeWindowContentsForVirtualKeyboard()) -}; - -class LIBDTKWIDGETSHARED_EXPORT DAppHandler { -public: - inline virtual ~DAppHandler() = default; - - virtual void handleHelpAction() = 0; - virtual void handleAboutAction() = 0; - virtual void handleQuitAction() = 0; -}; - -class DtkBuildVersion { -public: - static int value; -}; - -#ifndef LIBDTKWIDGET_LIBRARY -class Q_DECL_HIDDEN _DtkBuildVersion { -public: - _DtkBuildVersion() { - DtkBuildVersion::value = DTK_VERSION; - } -}; - -static _DtkBuildVersion _dtk_build_version; -#endif - -DWIDGET_END_NAMESPACE - -#endif // DAPPLICATION_H diff -Nru dtkwidget-5.5.48/src/widgets/DApplicationHelper dtkwidget-5.6.12/src/widgets/DApplicationHelper --- dtkwidget-5.5.48/src/widgets/DApplicationHelper 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DApplicationHelper 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dapplicationhelper.h" diff -Nru dtkwidget-5.5.48/src/widgets/dapplicationhelper.cpp dtkwidget-5.6.12/src/widgets/dapplicationhelper.cpp --- dtkwidget-5.5.48/src/widgets/dapplicationhelper.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dapplicationhelper.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dapplicationhelper.h" #include "dpalettehelper.h" @@ -33,7 +17,7 @@ } }; -__attribute__((constructor)) // 在库被加载时就执行此函数 +__attribute__((constructor)) // This function is executed when the library is loaded static void init_createHelper () { if (!QApplication::instance() || qobject_cast(QApplication::instance())) { @@ -52,11 +36,11 @@ /*! \class Dtk::Widget::DApplicationHelper \inmodule dtkwidget - \brief DApplicationHelper提供了一个修改的 DGuiApplicationHelper 类. + \brief `dApplicationHelper` provided a modified `DGuiApplicationHelper` 类. */ /*! - \brief DApplicationHelper::instance返回 DApplicationHelper 对象 + \brief `DApplicationHelper::instance`return `DApplicationHelper` object */ DApplicationHelper *DApplicationHelper::instance() { @@ -64,10 +48,10 @@ } /*! - \brief DApplicationHelper::palette返回调色板 - \a widget 控件 - \a base 调色板 - \return 调色板 + \brief `DApplicationHelper::palette` return a palette + \a widget widget + \a base Palette + \return Palette */ DPalette DApplicationHelper::palette(const QWidget *widget, const QPalette &base) const { @@ -75,9 +59,9 @@ } /*! - \brief DApplicationHelper::setPalette将调色板设置到控件 - \a widget 控件 - \a palette 调色板 + \brief `DApplicationHelper::setPalette` set the palette to the control + \a widget widget + \a palette palette */ void DApplicationHelper::setPalette(QWidget *widget, const DPalette &palette) { @@ -85,8 +69,8 @@ } /*! - \brief DApplicationHelper::resetPalette重置控件的调色板属性 - \a widget 控件 + \brief `DApplicationHelper::resetPalette` Reset the color panel attribute of the reset control + \a widget widget */ void DApplicationHelper::resetPalette(QWidget *widget) { diff -Nru dtkwidget-5.5.48/src/widgets/dapplicationhelper.h dtkwidget-5.6.12/src/widgets/dapplicationhelper.h --- dtkwidget-5.5.48/src/widgets/dapplicationhelper.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dapplicationhelper.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DAPPLICATIONHELPER_H -#define DAPPLICATIONHELPER_H - -#include -#include -#include - -DGUI_USE_NAMESPACE -DWIDGET_BEGIN_NAMESPACE - -class D_DECL_DEPRECATED_X("Use DPaletteHelper") DApplicationHelper : public DGuiApplicationHelper -{ - Q_OBJECT - -public: - static DApplicationHelper *instance(); - - DPalette palette(const QWidget *widget, const QPalette &base = QPalette()) const; - void setPalette(QWidget *widget, const DPalette &palette); - void resetPalette(QWidget *widget); - -private: - DApplicationHelper(); - ~DApplicationHelper(); - - bool eventFilter(QObject *watched, QEvent *event) override; - bool event(QEvent *event) override; - - friend class _DApplicationHelper; -}; - -DWIDGET_END_NAMESPACE - -#endif // DAPPLICATIONHELPER_H diff -Nru dtkwidget-5.5.48/src/widgets/DApplicationSettings dtkwidget-5.6.12/src/widgets/DApplicationSettings --- dtkwidget-5.5.48/src/widgets/DApplicationSettings 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DApplicationSettings 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dapplicationsettings.h" diff -Nru dtkwidget-5.5.48/src/widgets/DArrowButton dtkwidget-5.6.12/src/widgets/DArrowButton --- dtkwidget-5.5.48/src/widgets/DArrowButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DArrowButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "darrowbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/darrowbutton.cpp dtkwidget-5.6.12/src/widgets/darrowbutton.cpp --- dtkwidget-5.5.48/src/widgets/darrowbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/darrowbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "darrowbutton.h" #include "dthememanager.h" @@ -51,15 +38,14 @@ } /*! +@~english \class Dtk::Widget::DArrowButton \inmodule dtkwidget - \brief 可以使用 DArrowButton 类快速创建箭头形状的按钮. - \brief DArrowButton allowed you create button with arrow icon conveniently. + @brief DArrowButton allowed you create button with arrow icon conveniently. \image html DArrowButton.png - DArrowButton 提供了快速的方式创建包含箭头标识的按钮,并允许通过 setArrowDirection() 设置箭头方向来直接改按钮的箭头图标的方向。 - 此外,还可以通过 arrowButtonDirection 和 arrowButtonState 属性获取和修改箭头按钮的状态。 + You can use DArrowButton to create button with arrow icon, and it also allowed you update the arrow direction by calling setArrowDirection() . You can also update arrow state via arrowButtonDirection and arrowButtonState property. @@ -67,10 +53,10 @@ */ /*! - \brief Construct a new DArrowButton with DArrowButton::ArrowDown direction - \brief 构造一个 DArrowButton 箭头按钮,默认箭头方向向下 - - \a parent 父控件指针. +@~english + @brief Construct a new DArrowButton with DArrowButton::ArrowDown direction. + + \a parent Parent control pointer. */ DArrowButton::DArrowButton(QWidget *parent) : QLabel(parent) @@ -101,10 +87,10 @@ } /*! - \brief Set arrow direction of the button. - \brief 设置按钮的箭头方向. +@~english + @brief Set arrow direction of the button. - \a direction 箭头的方向. + \a direction The direction of the arrow. \sa DArrowButton::ArrowDirection DArrowButton::arrowDirection() */ @@ -115,10 +101,10 @@ } /*! - \brief Get the arrow direction of the button. - \brief 获取箭头方向. +@~english + @brief Get the arrow direction of the button. - \return 返回箭头方向. + \return Returns the direction of the arrow. */ int DArrowButton::arrowDirection() const { @@ -126,10 +112,10 @@ } /*! - \brief Set the button state. - \brief 设置按钮状态 +@~english + @brief Set the button state. - \a state 箭头按钮的状态. + \a state The state of the arrow button. */ void DArrowButton::setButtonState(ArrowButtonState state) { @@ -138,10 +124,10 @@ } /*! - \brief Get the button state - \brief 获得按钮状态 +@~english + @brief Get the button state. - \return 返回按钮的状态. + \return Returns the status of the button. */ int DArrowButton::buttonState() const { @@ -219,50 +205,43 @@ } /*! +@~english \enum Dtk::Widget::DArrowButton::ArrowDirection - - \brief The ArrowDirection enum indicate the direction of the arrow icon in the arrown button - \brief DArrowButton::ArrowDirection 表示箭头图标的方向。 + + @brief The ArrowDirection enum indicate the direction of the arrow icon in the arrown button. \value ArrowUp Up direction - 箭头朝上 \value ArrowDown Down direction - 箭头朝下 \value ArrowLeft Left direction - 箭头朝左 \value ArrowRight Right direction - 箭头朝右 - */ +*/ /*! +@~english \enum Dtk::Widget::DArrowButton::ArrowButtonState - \brief The ArrowDirection enum indicate the direction of the arrow icon in the arrown button - \brief DArrowButton::ArrowDirection 表示箭头图标的方向。 + @brief The ArrowDirection enum indicate the direction of the arrow icon in the arrown button. \value ArrowStateNormal Normal state - 普通状态 \value ArrowStateHover Mouse hover state - 鼠标在按钮上方悬停状态 \value ArrowStatePress Button got pressed state - 按钮被按下状态 */ /*! - \brief Update arrow direction of the button - \brief 更新箭头按钮中箭头的方向 +@~english + @brief Update arrow direction of the button. */ void DArrowButton::updateIconDirection(ArrowDirection direction) { @@ -272,8 +251,8 @@ } /*! - \brief Update icon state of the button - \brief 更新箭头按钮中图标的状态 +@~english + @brief Update icon state of the button. */ void DArrowButton::updateIconState(ArrowButtonState state) { diff -Nru dtkwidget-5.5.48/src/widgets/darrowbutton.h dtkwidget-5.6.12/src/widgets/darrowbutton.h --- dtkwidget-5.5.48/src/widgets/darrowbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/darrowbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DARROWBUTTON_H -#define DARROWBUTTON_H - -#include -#include -#include -#include -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class ArrowButtonIcon : public QLabel -{ - Q_OBJECT - Q_PROPERTY(int arrowButtonDirection READ arrowDirection) - Q_PROPERTY(int arrowButtonState READ buttonState) -public: - explicit ArrowButtonIcon(QWidget *parent = 0); - void setArrowDirection(int direction); - void setButtonState(int state); - int arrowDirection() const; - int buttonState() const; - -private: - int m_direction; - int m_buttonState; -}; - -class LIBDTKWIDGETSHARED_EXPORT DArrowButton : public QLabel -{ - Q_OBJECT -public: - enum ArrowDirection { - ArrowUp, - ArrowDown, - ArrowLeft, - ArrowRight - }; - - enum ArrowButtonState { - ArrowStateNormal, - ArrowStateHover, - ArrowStatePress - }; - - explicit DArrowButton(QWidget *parent = 0); - void setArrowDirection(ArrowDirection direction); - int arrowDirection() const; - int buttonState() const; - -protected: - void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void enterEvent(QEvent *); - void leaveEvent(QEvent *); - -Q_SIGNALS: - void mousePress(); - void mouseRelease(); - void mouseEnter(); - void mouseLeave(); - -private: - void initButtonState(); - void setButtonState(ArrowButtonState state); - void updateIconDirection(ArrowDirection direction); - void updateIconState(ArrowButtonState state); - -private: - ArrowButtonIcon *m_normalLabel = NULL; - ArrowButtonIcon *m_hoverLabel = NULL; - ArrowButtonIcon *m_pressLabel = NULL; - - ArrowDirection m_arrowDirection = ArrowDown; - ArrowButtonState m_buttonState = ArrowStateNormal; -}; - -DWIDGET_END_NAMESPACE - -#endif // DARROWBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/DArrowLineDrawer dtkwidget-5.6.12/src/widgets/DArrowLineDrawer --- dtkwidget-5.5.48/src/widgets/DArrowLineDrawer 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DArrowLineDrawer 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "darrowlinedrawer.h" diff -Nru dtkwidget-5.5.48/src/widgets/darrowlinedrawer.cpp dtkwidget-5.6.12/src/widgets/darrowlinedrawer.cpp --- dtkwidget-5.5.48/src/widgets/darrowlinedrawer.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/darrowlinedrawer.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "darrowlinedrawer.h" #include "dheaderline.h" #include "diconbutton.h" @@ -110,18 +94,20 @@ }; /*! +@~english \class Dtk::Widget::DArrowLineDrawer \inmodule dtkwidget - \brief 一个美观的可展开的控件. + @brief A beautiful expandable control. - DArrowLineDrawer 继承自 DDrawer 并提供了了 ArrowHeaderLine (一个带有箭头标示的按钮)作为其固定的标题控件,也就是说跟 DDrawer 相比省去了提供标题控件的步骤,只需要提供内容控件即可,如果需要自定义标题控件应该使用 DDrawer 类。 + DArrowLineDrawer inherited from DDrawer and provide ArrowHeaderLine (a button marked with an arrow)as its fixed title control,that is to say, compared with DDrawer, the step of providing title control is omitted,you only need to provide content controls,if you need a custom title control, you should use the DDrawer class. \sa DDrawer */ /*! - \brief 构造一个 DArrowLineDrawer 实例 +@~english + @brief Construct a DArrowLineDrawer example - \a parent 为实例的父控件 + \a parent is the parent control of the instance */ DArrowLineDrawer::DArrowLineDrawer(QWidget *parent) : DDrawer(*new DArrowLineDrawerPrivate(this), parent) @@ -137,9 +123,10 @@ } /*! - \brief 设置标题要显示的文字 +@~english + @brief Set the text for the title to display - \a title 标题内容 + \a title Title content */ void DArrowLineDrawer::setTitle(const QString &title) { @@ -148,9 +135,10 @@ } /*! - \brief 设置是否展开以显示内容控件 +@~english + @brief Sets whether to expand to display the content control - \a value 为 true 即为显示,反之则反 + \a value If it is true, it will be displayed, and vice versa. */ void DArrowLineDrawer::setExpand(bool value) { @@ -161,8 +149,9 @@ } /*! - \brief 获取标题控件 - \return 标题控件 +@~english + @brief Get the title control + \return Title control \sa DHeaderLine DBaseLine */ DBaseLine *DArrowLineDrawer::headerLine() diff -Nru dtkwidget-5.5.48/src/widgets/darrowlinedrawer.h dtkwidget-5.6.12/src/widgets/darrowlinedrawer.h --- dtkwidget-5.5.48/src/widgets/darrowlinedrawer.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/darrowlinedrawer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DARROWLINEDRAWER_H -#define DARROWLINEDRAWER_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DBaseLine; -class DArrowLineDrawerPrivate; -class LIBDTKWIDGETSHARED_EXPORT DArrowLineDrawer : public DDrawer -{ - Q_OBJECT - D_DECLARE_PRIVATE(DArrowLineDrawer) - -public: - explicit DArrowLineDrawer(QWidget *parent = nullptr); - void setTitle(const QString &title); - void setExpand(bool value); - D_DECL_DEPRECATED DBaseLine *headerLine(); - -private: - void setHeader(QWidget *header); - void resizeEvent(QResizeEvent *e); -}; - -DWIDGET_END_NAMESPACE - -#endif // DARROWLINEDRAWER_H diff -Nru dtkwidget-5.5.48/src/widgets/DArrowLineExpand dtkwidget-5.6.12/src/widgets/DArrowLineExpand --- dtkwidget-5.5.48/src/widgets/DArrowLineExpand 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DArrowLineExpand 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "darrowlineexpand.h" diff -Nru dtkwidget-5.5.48/src/widgets/darrowlineexpand.cpp dtkwidget-5.6.12/src/widgets/darrowlineexpand.cpp --- dtkwidget-5.5.48/src/widgets/darrowlineexpand.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/darrowlineexpand.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "darrowlineexpand.h" #include "dthememanager.h" @@ -60,18 +47,20 @@ } /*! +@~english \class Dtk::Widget::DArrowLineExpand \inmodule dtkwidget - \brief 一个美观的可展开的控件. + @brief a beautiful expandable control. - DArrowLineExpand 继承自 DBaseExpand 并提供了了 ArrowHeaderLine (一个带有箭头标示的按钮)作为其固定的标题控件,也就是说跟 DBaseExpand 相比省去了提供标题控件的步骤,只需要提供内容控件即可,如果需要自定义标题控件应该使用 DBaseExpand 类。 + DArrowLineExpand inherited from DBaseExpand and provide ArrowHeaderLine (a button marked with an arrow)as its fixed title control,that is to say, compared with DBaseExpand, the step of providing title control is omitted,you only need to provide content controls,If you need a custom title control, you should use the DBaseExpand class。 \sa DBaseExpand */ /*! - \brief 构造一个 DArrowLineExpand 实例 +@~english + @brief Construct a DArrowLineExpand instance - \a parent 为实例的父控件 + \a parent Is the parent control of the instance */ DArrowLineExpand::DArrowLineExpand(QWidget *parent) : DBaseExpand(parent) { @@ -84,9 +73,10 @@ } /*! - \brief 设置标题要显示的文字 +@~english + @brief Set the text for the title to display - \a title 标题内容 + \a title Title content */ void DArrowLineExpand::setTitle(const QString &title) { @@ -94,9 +84,10 @@ } /*! - \brief 设置是否展开以显示内容控件 +@~english + @brief Sets whether to expand to display the content control - \a value 为 true 即为显示,反之则反 + \a value If it is true, it will be displayed, and vice versa */ void DArrowLineExpand::setExpand(bool value) { @@ -106,8 +97,9 @@ } /*! - \brief 获取标题控件 - \return 标题控件 +@~english + @brief get the title control + \return title control \sa DHeaderLine DBaseLine */ DBaseLine *DArrowLineExpand::headerLine() diff -Nru dtkwidget-5.5.48/src/widgets/darrowlineexpand.h dtkwidget-5.6.12/src/widgets/darrowlineexpand.h --- dtkwidget-5.5.48/src/widgets/darrowlineexpand.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/darrowlineexpand.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DARROWLINEEXPAND_H -#define DARROWLINEEXPAND_H - -#include - -#include -#include -#include -#include -#include -DWIDGET_BEGIN_NAMESPACE - -class D_DECL_DEPRECATED ArrowHeaderLine : public DHeaderLine -{ - Q_OBJECT -public: - ArrowHeaderLine(QWidget *parent = nullptr); - void setExpand(bool value); - -Q_SIGNALS: - void mousePress(); - -protected: - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - -private: - void reverseArrowDirection(); - bool m_isExpanded = false; - DIconButton *m_arrowButton = nullptr; -}; - -class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DArrowLineDrawer") DArrowLineExpand : public DBaseExpand -{ - Q_OBJECT -public: - explicit DArrowLineExpand(QWidget *parent = nullptr); - void setTitle(const QString &title); - void setExpand(bool value); - DBaseLine *headerLine(); - -private: - void setHeader(QWidget *header); - void resizeEvent(QResizeEvent *e); - -private: - ArrowHeaderLine *m_headerLine = nullptr; -}; - -DWIDGET_END_NAMESPACE - -#endif // DARROWLINEEXPAND_H diff -Nru dtkwidget-5.5.48/src/widgets/DArrowRectangle dtkwidget-5.6.12/src/widgets/DArrowRectangle --- dtkwidget-5.5.48/src/widgets/DArrowRectangle 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DArrowRectangle 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "darrowrectangle.h" diff -Nru dtkwidget-5.5.48/src/widgets/darrowrectangle.cpp dtkwidget-5.6.12/src/widgets/darrowrectangle.cpp --- dtkwidget-5.5.48/src/widgets/darrowrectangle.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/darrowrectangle.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "darrowrectangle.h" #include "dplatformwindowhandle.h" @@ -22,7 +9,7 @@ #include "dstyle.h" #include - +#include #ifdef Q_OS_LINUX #include #include @@ -33,14 +20,17 @@ DWIDGET_BEGIN_NAMESPACE +static bool isDwayland() +{ + return qApp->platformName() == "dwayland" || qApp->property("_d_isDwayland").toBool(); +} /*! - \class Dtk::Widget::DArrowRectangle - \inmodule dtkwidget - \brief DArrowRectangle 提供了可以在四个边中的任意一个边显示箭头的矩形控件. - \brief The DArrowRectangle class provides a widget that has an arrow on one +@~english + @class Dtk::Widget::DArrowRectangle + @ingroup dtkwidget + @brief The DArrowRectangle class provides a widget that has an arrow on one of its four borders. - 通常用于作为其他控件的容器,将其显示在矩形内作为内容控件 It's usually used as a container of some other widgets, see DArrowRectangle::setContent() @@ -48,49 +38,45 @@ */ /*! - \enum Dtk::Widget::DArrowRectangle::ArrowDirection - \brief 箭头方向枚举包含 DArrowRectangle 的箭头可能指向的可能方向. - \brief The ArrowDirection enum contains the possible directions that +@~english + @enum Dtk::Widget::DArrowRectangle::ArrowDirection + @brief The ArrowDirection enum contains the possible directions that the DArrowRectangle's arrow may point to. \value ArrowLeft - 指示此矩形的箭头将指向左侧 indicates the arrow of this rectangle will point left \value ArrowRight - 指示此矩形的箭头将指向右侧 indicates the arrow of this rectangle will point right \value ArrowTop - 指示此矩形的箭头将指向上方 indicates the arrow of this rectangle will point up \value ArrowBottom - 指示此矩形的箭头将向下指向 indicates the arrow of this rectangle will point down */ /*! - \enum Dtk::Widget::DArrowRectangle::FloatMode - \brief FloatMode 表示不同的控件的浮动模式 - \brief The FloatMode enum decide the WindowType when DArrowRectangle show - - 控件的浮动模式表示控件如何显示在布局中,DArrowRectangle::FloatWindow 表示控件将会以一个单独的窗口显示,而 DArrowRectangle::FloatWidget 则表示控件只能显示在其父控件的布局中,不能超出父控件大小 - +@~english + @enum Dtk::Widget::DArrowRectangle::FloatMode + @brief The FloatMode enum decide the WindowType when DArrowRectangle show + + The floating mode of the control indicates how the control is displayed in the layout. + DArrowRectangle::FloatWindow indicates that the control will be displayed as a separate window, + while DArrowRectangle::FloatWidget indicates that the control can only be displayed in the layout of its parent control and cannot exceed the size of the parent control. + \value FloatWindow - 窗口模式 + Window mode Window will show a separate window \value FloatWidget - 控件模式 + Widget mode Widget must by show in the rect of parentWidget */ /*! - \brief DArrowRectangle::DArrowRectangle constructs an instance of DArrowRectangle. - \brief 获取 DArrowRectangle 实例 +@~english + @brief DArrowRectangle::DArrowRectangle constructs an instance of DArrowRectangle. \a direction is used to initialize the direction of which the arrow points to. \a parent is the parent widget the arrow rectangle will be attached to. - \a direction 用于初始化箭头的方向 - \a parent 作为其父控件 */ DArrowRectangle::DArrowRectangle(ArrowDirection direction, QWidget *parent) : QWidget(parent), @@ -102,14 +88,15 @@ } /*! - \brief 获取 DArrowRectangle 实例,并指定浮动模式. - \brief DArrowRectangle::DArrowRectangle can set DArrowRectangle show as a window or +@~english + @brief get the DArrowRectangle instance and specify the floating mode. + @brief DArrowRectangle::DArrowRectangle can set DArrowRectangle show as a window or a widget in parentWidget by floatMode - \a direction 用于初始化箭头的方向 - \a floatMode - \a parent 作为其父控件 - \sa DArrowRectangle::FloatMode + \a direction Used to initialize the direction of the arrow + \a floatMode + \a parent as its parent control + @sa DArrowRectangle::FloatMode */ DArrowRectangle::DArrowRectangle(ArrowDirection direction, FloatMode floatMode, QWidget *parent) : QWidget(parent), @@ -121,15 +108,12 @@ } /*! - \brief 在指定的坐标位置显示本控件; - \brief DArrowRectangle::show shows the widget at the given coordinate. +@~english + @brief DArrowRectangle::show shows the widget at the given coordinate. - \note 坐标被计算为箭头的位置,所以你不需要自己计算箭头位置 - \note The coordiate is calculated to be the arrow head's position, so you + @note The coordiate is calculated to be the arrow head's position, so you don't need to calculate the position yourself. - - \a x 控件箭头的x轴坐标 - \a y 控件箭头的y轴坐标 + \a x is the x coordinate of the arrow head. \a y is the y coordinate of the arrow head. */ @@ -141,10 +125,10 @@ } /*! - \brief DArrowRectangle::setContent sets the content of the arrow rectangle. - \brief 设置要显示在矩形内的内容控件. +@~english + @brief DArrowRectangle::setContent sets the content of the arrow rectangle. - \a content 要显示内容控件 + \a content to display a content control */ void DArrowRectangle::setContent(QWidget *content) { @@ -154,9 +138,10 @@ } /*! - \brief 获取内容控件. +@~english + @brief get content control. - \return 正在显示的内容控件 + \return the content control being displayed */ QWidget *DArrowRectangle::getContent() const { @@ -166,8 +151,8 @@ } /*! - \brief 根据内容控件的大小自动设置矩形控件的大小. - \brief DArrowRectangle::resizeWithContent automatically adjust the rectangle's +@~english + @brief DArrowRectangle::resizeWithContent automatically adjust the rectangle's size to fit the its content. */ void DArrowRectangle::resizeWithContent() @@ -178,10 +163,10 @@ } /*! - \brief 获取整个矩形控件的大小. - \brief DArrowRectangle::getFixedSize. +@~english + @brief gets the size of the entire rectangular control. + @brief DArrowRectangle::getFixedSize. - \return 矩形控件的大小 \return the size of the whole widget. */ QSize DArrowRectangle::getFixedSize() @@ -207,15 +192,12 @@ } /*! - \brief 移动到指定的坐标位置. - \brief DArrowRectangle::move moves the widget to the coordinate that provided, +@~english + @brief DArrowRectangle::move moves the widget to the coordinate that provided, - 参数的作用类似于 DArrowRectangle::show , 移动整个控件直到箭头出现在参数中指定的坐标 Like the rules in DArrowRectangle::show(int x, int y), it moves the widget so that the arrow head's coordinate matches the one that provided. - \a x 控件箭头的x轴坐标 - \a y 控件箭头的y轴坐标 \a x is the x coordinate of the arrow head. \a y is the y coordinate of the arrow head. @@ -274,6 +256,13 @@ const QRect DArrowRectanglePrivate::currentScreenRect(const int x, const int y) { + if (floatMode == DArrowRectangle::FloatWidget) { + D_Q(DArrowRectangle); + if (q->parentWidget()) { + return q->parentWidget()->rect(); + } + } + for (QScreen *screen : qApp->screens()) if (screen->geometry().contains(x, y)) { return screen->geometry(); @@ -283,11 +272,10 @@ } /*! - \property DArrowRectangle::shadowYOffset - \property DArrowRectangle::shadowYOffset +@~english + @property DArrowRectangle::shadowYOffset - \brief 这属性表示小部件及其阴影在y轴上的偏移量. - \brief the offset of the widget and its shadow on y axis. + @brief the offset of the widget and its shadow on y axis. Getter: DArrowRectangle::shadowYOffset Setter: DArrowRectangle::setShadowYOffset \sa DArrowRectangle::shadowXOffset @@ -311,9 +299,10 @@ } /*! - \brief DArrowRectangle::setLeftRightRadius 设置左右箭头时的圆角. +@~english + @brief DArrowRectangle::setLeftRightRadius fillet when setting the left and right arrows. - \a enable 是否开启. + \a enable Whether to open. */ void DArrowRectangle::setLeftRightRadius(bool enable) { @@ -322,9 +311,10 @@ } /*! - \brief DArrowRectangle::setArrowStyleEnable 设置圆角箭头样式. +@~english + @brief DArrowRectangle::setArrowStyleEnable Set Rounded Arrow Style. - \a enable 是否开启. + \a enable Whether to open. */ void DArrowRectangle::setRadiusArrowStyleEnable(bool enable) { @@ -335,10 +325,22 @@ } /*! - \property DArrowRectangle::shadowXOffset +@~english + @brief DArrowRectangle::setRadiusForceEnable Set fillet style. + @brief By default, the window tube supports the fillet when the special effect is mixed, + and there is no fillet when there is no special effect. If it is enabled, there is always a fillet + \a enable Whether to open. + */ +void DArrowRectangle::setRadiusForceEnable(bool enable) +{ + setProperty("_d_radius_force", enable); +} + +/*! +@~english + @property DArrowRectangle::shadowXOffset - \brief 这属性表示小部件及其阴影在x轴上的偏移量 - \brief the offset of the widget and its shadow on x axis. + @brief the offset of the widget and its shadow on x axis. Getter: DArrowRectangle::shadowXOffset Setter: DArrowRectangle::setShadowXOffset \sa DArrowRectangle::shadowYOffset @@ -362,10 +364,10 @@ } /*! - \property DArrowRectangle::shadowBlurRadius +@~english + @property DArrowRectangle::shadowBlurRadius - \brief 这个属性保存小部件阴影的模糊半径 - \brief This property holds the blur radius of the widget's shadow. + @brief This property holds the blur radius of the widget's shadow. Getter: DArrowRectangle::shadowBlurRadius Setter: DArrowRectangle::setShadowBlurRadius */ @@ -388,10 +390,10 @@ } /*! - \property DArrowRectangle::borderColor +@~english + @property DArrowRectangle::borderColor - \brief 这个属性表示控件边框的颜色 - \brief This property holds the border color of this widget. + @brief This property holds the border color of this widget. Getter: DArrowRectangle::borderColor , Setter: DArrowRectangle::setBorderColor */ @@ -414,10 +416,10 @@ } /*! - \property DArrowRectangle::borderWidth +@~english + @property DArrowRectangle::borderWidth - \brief 这个属性表示控件边框的宽度 - \brief This property holds the border width of this widget. + @brief This property holds the border width of this widget. Getter: DArrowRectangle::borderWidth , Setter: DArrowRectangle::setBorderWidth */ @@ -440,10 +442,10 @@ } /*! - \property DArrowRectangle::backgroundColor +@~english + @property DArrowRectangle::backgroundColor - \brief 这个属性表示矩形控件的背景颜色 - \brief the background color of this rectangle. + @brief the background color of this rectangle. Getter: DArrowRectangle::backgroundColor , Setter: DArrowRectangle::setBackgroundColor */ @@ -455,10 +457,10 @@ } /*! - \property DArrowRectangle::arrowDirection +@~english + @property DArrowRectangle::arrowDirection - \brief This property holds the direction of the rectangle's arrow points to. - \brief 这个属性表示箭头的方向 + @brief This property holds the direction of the rectangle's arrow points to. Getter: DArrowRectangle::arrowDirection , Setter: DArrowRectangle::setArrowDirection */ @@ -475,7 +477,8 @@ d->m_backgroundColor = backgroundColor; - if (d->m_handle && d->m_backgroundColor.toRgb().alpha() < 255) { + bool isFloatWindow = d->floatMode == FloatWindow; + if ((d->m_handle || (isFloatWindow && isDwayland())) && d->m_backgroundColor.toRgb().alpha() < 255) { if (!d->m_blurBackground) { d->m_blurBackground = new DBlurEffectWidget(this); d->m_blurBackground->setBlendMode(DBlurEffectWidget::BehindWindowBlend); @@ -496,10 +499,9 @@ } /*! - \brief DArrowRectangle::setBackgroundColor is an overloaded function. - \brief DArrowRectangle::setBackgroundColor 是一个重载方法 +@~english + @brief DArrowRectangle::setBackgroundColor is an overloaded function. - 通过改变 DBlurEffectWidget::MaskColorType 来修改控件矩形的背景 It sets the background color by modifing the mask color of the Dtk::Widget::DBlurEffectWidget. @@ -516,10 +518,10 @@ } /*! - \property DArrowRectangle::radius +@~english + @property DArrowRectangle::radius - \brief 这个属性表示矩形的圆角 - \brief radius of the rectangle + @brief radius of the rectangle Getter: DArrowRectangle::radius , Setter: DArrowRectangle::setRadius */ @@ -531,10 +533,23 @@ } /*! - \property DArrowRectangle::arrowHeight +@~english + @property DArrowRectangle::radiusForceEnabled + + @brief Whether to force (Ignore special effects) open the fillet - \brief height of rectangle's arrow - \brief 这个属性表示箭头的高度 + Getter: DArrowRectangle::radiusForceEnabled , Setter: DArrowRectangle::setRadiusForceEnable + */ +bool DArrowRectangle::radiusForceEnabled() const +{ + return property("_d_radius_force").toBool(); +} + +/*! +@~english + @property DArrowRectangle::arrowHeight + + @brief height of rectangle's arrow Getter: DArrowRectangle::arrowHeight , Setter: DArrowRectangle::setArrowHeight \sa DArrowRectangle::arrowWidth @@ -547,10 +562,10 @@ } /*! - \property DArrowRectangle::arrowWidth +@~english + @property DArrowRectangle::arrowWidth - \brief 这个属性表示箭头的宽度 - \brief width of the rectangle's arrow + @brief width of the rectangle's arrow Getter: DArrowRectangle::arrowWidth , Setter: DArrowRectangle::setArrowWidth \sa DArrowRectangle::arrowHeight @@ -563,10 +578,10 @@ } /*! - \property DArrowRectangle::arrowX +@~english + @property DArrowRectangle::arrowX - \brief the x coordinate of the rectangle's arrow - \brief 这个属性表示箭头的x轴坐标 + @brief the x coordinate of the rectangle's arrow Getter: DArrowRectangle::arrowX , Setter: DArrowRectangle::setArrowX \sa DArrowRectangle::arrowY @@ -579,10 +594,10 @@ } /*! - \property DArrowRectangle::arrowY +@~english + @property DArrowRectangle::arrowY - \brief 这个属性表示箭头的y轴坐标 - \brief the y coordinate of the rectangle's arrow + @brief the y coordinate of the rectangle's arrow Getter: DArrowRectangle::arrowY , Setter: DArrowRectangle::setArrowY \sa DArrowRectangle::arrowX @@ -595,15 +610,14 @@ } /*! - \property DArrowRectangle::margin +@~english + @property DArrowRectangle::margin - \brief 这个属性表示边距大小 - \brief This property holds the width of the margin + @brief This property holds the width of the margin The margin is the distance between the innermost pixel of the rectangle and the outermost pixel of its contents. The default margin is 0. - 边距是指矩形最里面的像素与其内容最外面的像素之间的距离 Getter: DArrowRectangle::margin , Setter: DArrowRectangle::setMargin \sa DArrowRectangle::setMargin @@ -616,9 +630,10 @@ } /*! - \brief 该函数用于设置箭头方向. +@~english + @brief this function is used to set the arrow direction. - \a value 箭头方向. + \a value arrow direction. \sa DArrowRectangle::arrowDirection */ @@ -630,9 +645,10 @@ } /*! - \brief 该函数用于设置整个控件固定的宽度 +@~english + @brief This function is used to set the fixed width of the entire control - \a value 宽度大小 + \a value width Size */ void DArrowRectangle::setWidth(int value) { @@ -640,9 +656,10 @@ } /*! - \brief 设置整个控件固定的高度 +@~english + @brief set the fixed height of the entire control - \a value 高度大小 + \a value height Size */ void DArrowRectangle::setHeight(int value) { @@ -650,9 +667,10 @@ } /*! - \brief 该函数用于设置圆角大小. +@~english + @brief this function is used to set the fillet size. - \a value 圆角大小. + \a value fillet size. \sa DArrowRectangle::radius */ @@ -664,9 +682,10 @@ } /*! - \brief 设置箭头高度. +@~english + @brief set arrow height. - \a value 箭头高度. + \a value arrow Height. \sa DArrowRectangle::arrowHeight */ @@ -678,9 +697,10 @@ } /*! - \brief 设置箭头宽度. +@~english + @brief set arrow width. - \a value 箭头宽度. + \a value arrow width. \sa DArrowRectangle::arrowWidth */ @@ -692,9 +712,10 @@ } /*! - \brief 设置箭头 x 坐标的值. +@~english + @brief set the value of the arrow x coordinate. - \a value x 坐标的值. + \a value x value of coordinates. \sa DArrowRectangle::arrowX */ @@ -706,9 +727,10 @@ } /*! - \brief 设置箭头 y 坐标的值. +@~english + @brief set the value of arrow y coordinate. - \a value y 坐标的值. + \a value y value of coordinates. \sa DArrowRectangle::arrowY */ @@ -720,9 +742,10 @@ } /*! - \brief 设置边距大小. +@~english + @brief set margin size. - \a value 边距大小. + \a value margin size. \sa DArrowRectangle::margin */ @@ -1112,6 +1135,9 @@ { D_Q(DArrowRectangle); + if (!isDwayland() && !m_handle) + return; + QPainterPath path; switch (m_arrowDirection) { @@ -1133,7 +1159,7 @@ if (m_handle) { m_handle->setClipPath(path); - } else { + } else if (DArrowRectangle::FloatWindow == floatMode && isDwayland()) { // clipPath without handle QPainterPathStroker stroker; stroker.setCapStyle(Qt::RoundCap); @@ -1144,13 +1170,16 @@ q->clearMask(); q->setMask(polygon); + if (m_blurBackground) + m_blurBackground->setMaskPath(path); if (QWidget *widget = q->window()) { if (QWindow *w = widget->windowHandle()) { QList painterPaths; painterPaths << outPath.united(path); - DPlatformHandle handle(w); - handle.setWindowBlurAreaByWM(painterPaths); + // 背景模糊也要设置一个 path + qApp->platformNativeInterface()->setWindowProperty(w->handle(), "_d_windowBlurPaths", + QVariant::fromValue(painterPaths)); } } } @@ -1159,7 +1188,7 @@ bool DArrowRectanglePrivate::radiusEnabled() { D_Q(DArrowRectangle); - if (q->property("_d_radius_force").toBool()) + if (q->radiusForceEnabled()) return true; if (m_wmHelper && !m_wmHelper->hasComposite()) { @@ -1217,8 +1246,17 @@ q->update(); this->updateClipPath(); }, Qt::QueuedConnection); + } else if (DArrowRectangle::FloatWidget == floatMode) { + DGraphicsGlowEffect *glowEffect = new DGraphicsGlowEffect; + glowEffect->setBlurRadius(q->shadowBlurRadius()); + glowEffect->setDistance(m_shadowDistance); + glowEffect->setXOffset(q->shadowXOffset()); + glowEffect->setYOffset(q->shadowYOffset()); + q->setGraphicsEffect(glowEffect); } else { - m_wmHelper = nullptr; +#ifndef QT_DEBUG + qDebug() << "wayland:" << isDwayland() << "floatMode:" << floatMode; +#endif } } diff -Nru dtkwidget-5.5.48/src/widgets/darrowrectangle.h dtkwidget-5.6.12/src/widgets/darrowrectangle.h --- dtkwidget-5.5.48/src/widgets/darrowrectangle.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/darrowrectangle.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DARROWRECTANGLE_H -#define DARROWRECTANGLE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DPlatformWindowHandle; -class DArrowRectanglePrivate; -class LIBDTKWIDGETSHARED_EXPORT DArrowRectangle : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_DISABLE_COPY(DArrowRectangle) - D_DECLARE_PRIVATE(DArrowRectangle) - -public: - - enum ArrowDirection { - ArrowLeft, - ArrowRight, - ArrowTop, - ArrowBottom - }; - - enum FloatMode { - FloatWindow, - FloatWidget, - }; - - explicit DArrowRectangle(ArrowDirection direction, QWidget *parent = nullptr); - explicit DArrowRectangle(ArrowDirection direction, FloatMode floatMode, QWidget *parent = nullptr); - ~DArrowRectangle() override; - - Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor) - Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor) - Q_PROPERTY(int borderWidth READ borderWidth WRITE setBorderWidth) - Q_PROPERTY(int radius READ radius WRITE setRadius) - Q_PROPERTY(int arrowWidth READ arrowWidth WRITE setArrowWidth) - Q_PROPERTY(int arrowHeight READ arrowHeight WRITE setArrowHeight) - Q_PROPERTY(int arrowX READ arrowX WRITE setArrowX) - Q_PROPERTY(int arrowY READ arrowY WRITE setArrowY) - Q_PROPERTY(int margin READ margin WRITE setMargin) - Q_PROPERTY(ArrowDirection arrowDirection READ arrowDirection WRITE setArrowDirection) - Q_PROPERTY(qreal shadowXOffset READ shadowXOffset WRITE setShadowXOffset) - Q_PROPERTY(qreal shadowYOffset READ shadowYOffset WRITE setShadowYOffset) - Q_PROPERTY(qreal shadowBlurRadius READ shadowBlurRadius WRITE setShadowBlurRadius) - - int radius() const; - int arrowHeight() const; - int arrowWidth() const; - int arrowX() const; - int arrowY() const; - int margin() const; - int borderWidth() const; - QColor borderColor() const; - QColor backgroundColor() const; - ArrowDirection arrowDirection() const; - - void setRadius(int value); - void setArrowHeight(int value); - void setArrowWidth(int value); - void setArrowX(int value); - void setArrowY(int value); - void setMargin(int value); - void setBorderWidth(int borderWidth); - void setBorderColor(const QColor &borderColor); - void setBackgroundColor(const QColor &backgroundColor); - void setBackgroundColor(DBlurEffectWidget::MaskColorType type); - void setArrowDirection(ArrowDirection value); - void setWidth(int value); - void setHeight(int value); - - virtual void show(int x, int y); - - void setContent(QWidget *content); - QWidget *getContent() const; - void resizeWithContent(); - void move(int x, int y); - QSize getFixedSize(); - - qreal shadowXOffset() const; - qreal shadowYOffset() const; - qreal shadowBlurRadius() const; - - void setShadowBlurRadius(const qreal &shadowBlurRadius); - void setShadowXOffset(const qreal &shadowXOffset); - void setShadowYOffset(const qreal &shadowYOffset); - - void setLeftRightRadius(bool enable); - void setRadiusArrowStyleEnable(bool enable); - -Q_SIGNALS: - void windowDeactivate() const; - -protected: - void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; - bool event(QEvent *e) Q_DECL_OVERRIDE; -}; - -DWIDGET_END_NAMESPACE - -#endif // DARROWRECTANGLE_H diff -Nru dtkwidget-5.5.48/src/widgets/DBackgroundGroup dtkwidget-5.6.12/src/widgets/DBackgroundGroup --- dtkwidget-5.5.48/src/widgets/DBackgroundGroup 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DBackgroundGroup 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dbackgroundgroup.h" diff -Nru dtkwidget-5.5.48/src/widgets/dbackgroundgroup.cpp dtkwidget-5.6.12/src/widgets/dbackgroundgroup.cpp --- dtkwidget-5.5.48/src/widgets/dbackgroundgroup.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbackgroundgroup.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dbackgroundgroup.h" #include "dstyleoption.h" #include "dstyle.h" #include "dobject_p.h" +#include "dsizemode.h" #include #include @@ -79,12 +84,13 @@ }; /*! +@~english \class Dtk::Widget::DBackgroundGroup \inmodule dtkwidget - \brief DBackgroundGroup提供了将布局控件改成圆角边框(将布局看成一个整体). + @brief DBackgroundGroup provides the ability to change the layout control to a rounded border(view the layout as a whole). - \note 示例代码 - \code + @note sample code + @code QWidget w; QHBoxLayout* mainlayout = new QHBoxLayout(&w); mainlayout->addWidget(new QPushButton("btn")); @@ -93,14 +99,15 @@ mainlayout->addWidget(group); hlayout->addWidget(new QFrame); hlayout->addWidget(new QFrame); - \endcode - \image html DBackgroundGroup.png + @endcode + @image html DBackgroundGroup.png */ /*! - \brief DBackgroundGroup::DBackgroundGroup构造函数 - \a layout 布局对象 - \a parent 参数被发送到 QWidget 构造函数 +@~english + @brief DBackgroundGroup::DBackgroundGroup constructor function + \a layout Layout Object + \a parent parameters are sent to QWidget constructor function */ DBackgroundGroup::DBackgroundGroup(QLayout *layout, QWidget *parent) : QWidget(parent) @@ -113,8 +120,9 @@ } /*! - \brief DBackgroundGroup::itemMargins返回控件在布局内的边距 - \return 控件在布局内的边距 +@~english + @brief DBackgroundGroup::itemMargins returns the margin of the control within the layout + \return control margins within the layout */ QMargins DBackgroundGroup::itemMargins() const { @@ -124,8 +132,9 @@ } /*! - \brief DBackgroundGroup::useWidgetBackground是否使用 QWidget 背景颜色 - \return +@~english + @brief DBackgroundGroup::useWidgetBackground whether to use the QWidget background color + \return whether to use the QWidget background color */ bool DBackgroundGroup::useWidgetBackground() const { @@ -135,8 +144,9 @@ } /*! - \brief DBackgroundGroup::setLayout设置布局 - \a layout 布局 +@~english + @brief DBackgroundGroup::setLayout setting the Layout + \a layout layout */ void DBackgroundGroup::setLayout(QLayout *layout) { @@ -171,8 +181,9 @@ } /*! - \brief DBackgroundGroup::setItemMargins设置控件在布局内的边距 - \a itemMargins 控件在布局内的边距 +@~english + @brief DBackgroundGroup::setItemMargins set the margins of the control within the layout + \a itemMargins control margins within the layout */ void DBackgroundGroup::setItemMargins(QMargins itemMargins) { @@ -183,8 +194,9 @@ } /*! - \brief DBackgroundGroup::setItemSpacing设置布局内控件间的距离 - \a spacing 距离 +@~english + @brief DBackgroundGroup::setItemSpacing set the distance between the layout internal controls + \a spacing distance */ void DBackgroundGroup::setItemSpacing(int spacing) { @@ -195,9 +207,9 @@ } /*! - \brief DBackgroundGroup::setUseWidgetBackground设置是否使用 QWidget 背景颜色 - 设置是否使用 QWidget 背景颜色,并发送 useWidgetBackgroundChanged 信号 - \a useWidgetBackground 是否使用 QWidget 背景颜色 +@~english + @brief DBackgroundGroup::setUseWidgetBackground set whether to use the QWidget background color,and send the useWidgetBackgroundChanged signal + \a useWidgetBackground whether to use QWidget background color */ void DBackgroundGroup::setUseWidgetBackground(bool useWidgetBackground) { @@ -257,6 +269,10 @@ d->updateOptions(); break; } + case QEvent::StyleChange: { + D_D(DBackgroundGroup); + d->updateLayoutSpacing(); + } break; default: break; } diff -Nru dtkwidget-5.5.48/src/widgets/dbackgroundgroup.h dtkwidget-5.6.12/src/widgets/dbackgroundgroup.h --- dtkwidget-5.5.48/src/widgets/dbackgroundgroup.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbackgroundgroup.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -#ifndef DBACKGROUNDGROUP_H -#define DBACKGROUNDGROUP_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DBackgroundGroupPrivate; -class LIBDTKWIDGETSHARED_EXPORT DBackgroundGroup : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DBackgroundGroup) - - Q_PROPERTY(QMargins itemMargins READ itemMargins WRITE setItemMargins) - Q_PROPERTY(bool useWidgetBackground READ useWidgetBackground WRITE setUseWidgetBackground NOTIFY useWidgetBackgroundChanged) - -public: - explicit DBackgroundGroup(QLayout *layout = nullptr, QWidget *parent = nullptr); - - QMargins itemMargins() const; - bool useWidgetBackground() const; - - void setLayout(QLayout *layout); - - void setBackgroundRole(QPalette::ColorRole role); - QPalette::ColorRole backgroundRole() const; - -public Q_SLOTS: - void setItemMargins(QMargins itemMargins); - void setItemSpacing(int spacing); - void setUseWidgetBackground(bool useWidgetBackground); - -Q_SIGNALS: - void useWidgetBackgroundChanged(bool useWidgetBackground); - -protected: - void paintEvent(QPaintEvent *event) override; - bool event(QEvent *event) override; - -private: - using QWidget::setLayout; - using QWidget::setAutoFillBackground; -}; - -DWIDGET_END_NAMESPACE - -#endif // DBACKGROUNDGROUP_H diff -Nru dtkwidget-5.5.48/src/widgets/dbaseexpand.cpp dtkwidget-5.6.12/src/widgets/dbaseexpand.cpp --- dtkwidget-5.5.48/src/widgets/dbaseexpand.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbaseexpand.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dbaseexpand.h" #include "dthememanager.h" diff -Nru dtkwidget-5.5.48/src/widgets/dbaseexpand.h dtkwidget-5.6.12/src/widgets/dbaseexpand.h --- dtkwidget-5.5.48/src/widgets/dbaseexpand.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbaseexpand.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DBASEEXPAND_H -#define DBASEEXPAND_H - -#include -#include -#include -#include - -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class D_DECL_DEPRECATED ContentLoader : public QFrame -{ - Q_OBJECT - Q_PROPERTY(int height READ height WRITE setFixedHeight) -public: - explicit ContentLoader(QWidget *parent = nullptr) : QFrame(parent){} -}; - -class DBoxWidget; - -class DBaseExpandPrivate; -class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DDrawer") DBaseExpand : public QWidget -{ - Q_OBJECT -public: - explicit DBaseExpand(QWidget *parent = nullptr); - ~DBaseExpand() override; - - void setHeader(QWidget *header); - void setContent(QWidget *content, Qt::Alignment alignment = Qt::AlignHCenter); - QWidget *getContent() const; - void setHeaderHeight(int height); - virtual void setExpand(bool value); - bool expand() const; - void setAnimationDuration(int duration); - void setAnimationEasingCurve(QEasingCurve curve); - void setSeparatorVisible(bool arg); - void setExpandedSeparatorVisible(bool arg); - -Q_SIGNALS: - void expandChange(bool e); - void sizeChanged(QSize s); - -protected: - void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; - -private: - QScopedPointer d_private; - - Q_DECLARE_PRIVATE_D(d_private, DBaseExpand) -}; - -DWIDGET_END_NAMESPACE - -#endif // DBASEEXPAND_H diff -Nru dtkwidget-5.5.48/src/widgets/dbaseline.cpp dtkwidget-5.6.12/src/widgets/dbaseline.cpp --- dtkwidget-5.5.48/src/widgets/dbaseline.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbaseline.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dbaseline.h" #include "dthememanager.h" diff -Nru dtkwidget-5.5.48/src/widgets/dbaseline.h dtkwidget-5.6.12/src/widgets/dbaseline.h --- dtkwidget-5.5.48/src/widgets/dbaseline.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbaseline.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DBASELINE_H -#define DBASELINE_H - -#include -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DBaseLine : public QLabel -{ - Q_OBJECT -public: - explicit DBaseLine(QWidget *parent = 0); - - void setLeftContent(QWidget *content); - void setRightContent(QWidget *content); - - QBoxLayout *leftLayout(); - QBoxLayout *rightLayout(); - - void setLeftMargin(int margin); - void setRightMargin(int margin); - int leftMargin() const; - int rightMargin() const; - -private: - QHBoxLayout *m_mainLayout = NULL; - QHBoxLayout *m_leftLayout= NULL; - QHBoxLayout *m_rightLayout = NULL; - - int m_leftMargin = 10; - int m_rightMargin = HEADER_RIGHT_MARGIN; -}; - -DWIDGET_END_NAMESPACE - -#endif // DBASELINE_H diff -Nru dtkwidget-5.5.48/src/widgets/DBlurEffectWidget dtkwidget-5.6.12/src/widgets/DBlurEffectWidget --- dtkwidget-5.5.48/src/widgets/DBlurEffectWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DBlurEffectWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dblureffectwidget.h" diff -Nru dtkwidget-5.5.48/src/widgets/dblureffectwidget.cpp dtkwidget-5.6.12/src/widgets/dblureffectwidget.cpp --- dtkwidget-5.5.48/src/widgets/dblureffectwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dblureffectwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dblureffectwidget.h" #include "private/dblureffectwidget_p.h" diff -Nru dtkwidget-5.5.48/src/widgets/dblureffectwidget.h dtkwidget-5.6.12/src/widgets/dblureffectwidget.h --- dtkwidget-5.5.48/src/widgets/dblureffectwidget.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dblureffectwidget.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,153 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DBLUREFFECTWIDGET_H -#define DBLUREFFECTWIDGET_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DBlurEffectWidgetPrivate; -class LIBDTKWIDGETSHARED_EXPORT DBlurEffectWidget : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - // The "radius" property is only support for InWindowBlend. See property "blendMode" - Q_PROPERTY(int radius READ radius WRITE setRadius NOTIFY radiusChanged) - Q_PROPERTY(BlurMode mode READ mode WRITE setMode NOTIFY modeChanged) - Q_PROPERTY(BlendMode blendMode READ blendMode WRITE setBlendMode NOTIFY blendModeChanged) - Q_PROPERTY(int blurRectXRadius READ blurRectXRadius WRITE setBlurRectXRadius NOTIFY blurRectXRadiusChanged) - Q_PROPERTY(int blurRectYRadius READ blurRectYRadius WRITE setBlurRectYRadius NOTIFY blurRectYRadiusChanged) - // ###(zccrs): The alpha channel of the color is fixed. - // The alpha channel is 102 if the DPlatformWindowHandle::hasBlurWindow() is true, otherwise is 204). - Q_PROPERTY(QColor maskColor READ maskColor WRITE setMaskColor NOTIFY maskColorChanged) - Q_PROPERTY(quint8 maskAlpha READ maskAlpha WRITE setMaskAlpha NOTIFY maskAlphaChanged) - Q_PROPERTY(bool full READ isFull WRITE setFull NOTIFY fullChanged) - Q_PROPERTY(bool blurEnabled READ blurEnabled WRITE setBlurEnabled NOTIFY blurEnabledChanged) - -public: - // TODO: To support MeanBlur, MedianBlur, BilateralFilter - enum BlurMode { - GaussianBlur - }; - - Q_ENUMS(BlurMode) - - enum BlendMode { - InWindowBlend, - BehindWindowBlend, - InWidgetBlend - }; - - Q_ENUMS(BlendMode) - - enum MaskColorType { - DarkColor, - LightColor, - AutoColor, - CustomColor - }; - - Q_ENUMS(MaskColorType) - - explicit DBlurEffectWidget(QWidget *parent = 0); - ~DBlurEffectWidget(); - - int radius() const; - BlurMode mode() const; - - BlendMode blendMode() const; - int blurRectXRadius() const; - int blurRectYRadius() const; - - bool isFull() const; - bool blurEnabled() const; - - QColor maskColor() const; - - quint8 maskAlpha() const; - - void setMaskPath(const QPainterPath &path); - void setSourceImage(const QImage &image, bool autoScale = true); - -public Q_SLOTS: - void setRadius(int radius); - void setMode(BlurMode mode); - - void setBlendMode(BlendMode blendMode); - void setBlurRectXRadius(int blurRectXRadius); - void setBlurRectYRadius(int blurRectYRadius); - void setMaskAlpha(quint8 alpha); - void setMaskColor(QColor maskColor); - void setMaskColor(MaskColorType type); - void setFull(bool full); - void setBlurEnabled(bool blurEnabled); - - void updateBlurSourceImage(const QRegion &ren); - -Q_SIGNALS: - void radiusChanged(int radius); - void modeChanged(BlurMode mode); - - void blendModeChanged(BlendMode blendMode); - void blurRectXRadiusChanged(int blurRectXRadius); - void blurRectYRadiusChanged(int blurRectYRadius); - void maskAlphaChanged(quint8 alpha); - void maskColorChanged(QColor maskColor); - void fullChanged(bool full); - void blurEnabledChanged(bool blurEnabled); - - void blurSourceImageDirtied(); - -protected: - DBlurEffectWidget(DBlurEffectWidgetPrivate &dd, QWidget *parent = 0); - - void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - void moveEvent(QMoveEvent *event) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; - void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; - void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE; - void changeEvent(QEvent *event) Q_DECL_OVERRIDE; - bool eventFilter(QObject *watched, QEvent *event) override; - -private: - D_DECLARE_PRIVATE(DBlurEffectWidget) - friend class DBlurEffectGroup; -}; - -class DBlurEffectGroupPrivate; -class DBlurEffectGroup : public DTK_CORE_NAMESPACE::DObject -{ - D_DECLARE_PRIVATE(DBlurEffectGroup) -public: - explicit DBlurEffectGroup(); - ~DBlurEffectGroup(); - - void setSourceImage(QImage image, int blurRadius = 35); - void addWidget(DBlurEffectWidget *widget, const QPoint &offset = QPoint(0, 0)); - void removeWidget(DBlurEffectWidget *widget); - - void paint(QPainter *pa, DBlurEffectWidget *widget) const; -}; - -DWIDGET_END_NAMESPACE - -#endif // DBLUREFFECTWIDGET_H diff -Nru dtkwidget-5.5.48/src/widgets/DBorderlessWindow dtkwidget-5.6.12/src/widgets/DBorderlessWindow --- dtkwidget-5.5.48/src/widgets/DBorderlessWindow 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DBorderlessWindow 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dborderlesswindow.h" diff -Nru dtkwidget-5.5.48/src/widgets/dboxwidget.cpp dtkwidget-5.6.12/src/widgets/dboxwidget.cpp --- dtkwidget-5.5.48/src/widgets/dboxwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dboxwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include @@ -46,14 +33,11 @@ } /*! - \class Dtk::Widget::DBoxWidget +@~english + @class Dtk::Widget::DBoxWidget \inmodule dtkwidget - \brief The DBoxWidget class provides widget born with QBoxLayout set. - \brief DBoxWidget提供了一个自适应子控件大小的Widget. - - 在Qt编程中,使用QBoxLayout设置控件是很常见的,DBoxWidget提供了方便的封装,会根据需要的大小自动 - 设置DBoxWidget的宽高。 + @brief The DBoxWidget class provides widget born with QBoxLayout set. Since an widget with QBoxLayout set is very common use case in Qt programming, yet very tedious, DBoxWidget is built to ease that pain. @@ -61,15 +45,13 @@ Also, DBoxWidget will calculate the size it needs automatically, so you don't need to set width for DHBoxWidget or height for DVBoxLayout. - \sa DHBoxWidget and DVBoxWidget + @sa DHBoxWidget and DVBoxWidget */ /*! - \brief DBoxWidget的构造函数. - \brief DBoxWidget::DBoxWidget constructs an instance of DBoxWidget. +@~english + @brief DBoxWidget::DBoxWidget constructs an instance of DBoxWidget. - \a direction 是设置内部QBoxLayout使用的方向 - \a parent 传递给QFrame的构造函数 \a direction is the direction used by the internal QBoxLayout. \a parent is passed to QFrame constructor. */ @@ -82,12 +64,12 @@ } /*! - \property DBoxWidget::direction +@~english + @property DBoxWidget::direction - 这个属性返回当前QBoxLayout使用的方向 - \brief This property holds the direction of the internal QBoxLayout. + @brief This property holds the direction of the internal QBoxLayout. - \return QBoxLayout::Direction 当前的方向 + @return QBoxLayout::Direction Current direction */ QBoxLayout::Direction DBoxWidget::direction() const { @@ -97,13 +79,13 @@ } /*! - \brief 这个属性会返回当前使用的布局对象 - \brief This property holds the internal layout object. +@~english + @brief This property holds the internal layout object. This property can be used to get the internal layout, so you can set some extra properties on the layout to match the custom needs. - \return QBoxLayout* + @return QBoxLayout* */ QBoxLayout *DBoxWidget::layout() const { @@ -113,10 +95,9 @@ } /*! - \brief 调用QBoxLayout的addWidget方法将QWidget添加到布局中 - \brief DBoxWidget::addWidget adds widget to the internal layout. +@~english + @brief DBoxWidget::addWidget adds widget to the internal layout. - \a widget 要添加的QWidget对象 \a widget is the widget to be added. */ void DBoxWidget::addWidget(QWidget *widget) @@ -125,7 +106,8 @@ } /*! - \brief 设置QBoxLayout当前的方向 +@~english + @brief Sets the current direction of QBoxLayout \a direction */ @@ -141,9 +123,10 @@ } /*! - \brief 当方向是QBoxLayout::TopToBottom或者QBoxLayout::BottomToTop时, - 固定高度将使用传入的高度,并设置最小宽度为传入的宽度。 - 否则将使用传入的宽度当做固定宽度,高度为最小高度。 +@~english + @brief When the direction is QBoxLayout::TopToBottom or QBoxLayout::BottomToTop, + the fixed height will use the passed height and set the minimum width to the passed width. + Otherwise, the passed width is used as the fixed width and the height is the minimum height. \a size */ void DBoxWidget::updateSize(const QSize &size) @@ -185,9 +168,10 @@ } /*! +@~english \reimp - \brief DBoxWidget::sizeHint reimplemented from QWidget::sizeHint(). - \return the recommended size of this widget. + @brief DBoxWidget::sizeHint reimplemented from QWidget::sizeHint(). + @return the recommended size of this widget. */ QSize DBoxWidget::sizeHint() const { @@ -197,17 +181,17 @@ } /*! - \class Dtk::Widget::DHBoxWidget +@~english + @class Dtk::Widget::DHBoxWidget \inmodule dtkwidget - \brief The DHBoxWidget class is DBoxWidget with DBoxWidget::direction set to + @brief The DHBoxWidget class is DBoxWidget with DBoxWidget::direction set to QBoxLayout::LeftToRight. - \brief 是设置成水平方向的DBoxWidget */ /*! - \brief DHBoxWidget的构造函数 - \brief DHBoxWidget::DHBoxWidget constructs an instance of DHBoxWidget. +@~english + @brief DHBoxWidget::DHBoxWidget constructs an instance of DHBoxWidget. \a parent is passed to DBoxWidget constructor. */ @@ -218,17 +202,17 @@ } /*! - \class Dtk::Widget::DVBoxWidget +@~english + @class Dtk::Widget::DVBoxWidget \inmodule dtkwidget - \brief The DVBoxWidget class is DBoxWidget with DBoxWidget::direction set to + @brief The DVBoxWidget class is DBoxWidget with DBoxWidget::direction set to QBoxLayout::TopToBottom. - \brief 是设置成垂直方向的DBoxWidget */ /*! - \brief DVBoxWidget的构造函数 - \brief DVBoxWidget::DVBoxWidget constructs an instance of DVBoxWidget. +@~english + @brief DVBoxWidget::DVBoxWidget constructs an instance of DVBoxWidget. \a parent is passed to DBoxWidget constructor. */ diff -Nru dtkwidget-5.5.48/src/widgets/dboxwidget.h dtkwidget-5.6.12/src/widgets/dboxwidget.h --- dtkwidget-5.5.48/src/widgets/dboxwidget.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dboxwidget.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DBOXWIDGET_H -#define DBOXWIDGET_H - -#include - -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DBoxWidgetPrivate; -class DBoxWidget : public QFrame, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(QBoxLayout::Direction direction READ direction WRITE setDirection NOTIFY directionChanged) - -public: - explicit DBoxWidget(QBoxLayout::Direction direction, QWidget *parent = 0); - - QBoxLayout::Direction direction() const; - QBoxLayout *layout() const; - - void addWidget(QWidget *widget); - QSize sizeHint() const Q_DECL_OVERRIDE; - -public Q_SLOTS: - void setDirection(QBoxLayout::Direction direction); - -Q_SIGNALS: - void sizeChanged(QSize size); - void directionChanged(QBoxLayout::Direction direction); - -protected: - virtual void updateSize(const QSize &size); - bool event(QEvent *ee) Q_DECL_OVERRIDE; - -private: - D_DECLARE_PRIVATE(DBoxWidget) -}; - -class DHBoxWidget : public DBoxWidget -{ - Q_OBJECT -public: - explicit DHBoxWidget(QWidget *parent = 0); -}; - -class DVBoxWidget : public DBoxWidget -{ - Q_OBJECT -public: - explicit DVBoxWidget(QWidget *parent = 0); -}; - -DWIDGET_END_NAMESPACE - -#endif // DBOXWIDGET_H diff -Nru dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.asr.xml dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.asr.xml --- dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.asr.xml 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.asr.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff -Nru dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.iat.xml dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.iat.xml --- dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.iat.xml 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.iat.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.ocr.xml dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.ocr.xml --- dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.ocr.xml 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.ocr.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.session.xml dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.session.xml --- dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.session.xml 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.session.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.trans.xml dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.trans.xml --- dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.trans.xml 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.trans.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.tts.xml dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.tts.xml --- dtkwidget-5.5.48/src/widgets/dbus/com.iflytek.aiservice.tts.xml 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbus/com.iflytek.aiservice.tts.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff -Nru dtkwidget-5.5.48/src/widgets/DButtonBox dtkwidget-5.6.12/src/widgets/DButtonBox --- dtkwidget-5.5.48/src/widgets/DButtonBox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DButtonBox 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dbuttonbox.h" diff -Nru dtkwidget-5.5.48/src/widgets/dbuttonbox.cpp dtkwidget-5.6.12/src/widgets/dbuttonbox.cpp --- dtkwidget-5.5.48/src/widgets/dbuttonbox.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbuttonbox.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dbuttonbox.h" #include "private/dbuttonbox_p.h" #include "dstyleoption.h" @@ -42,6 +26,7 @@ } qint64 iconType = -1; + DDciIcon dciIcon; }; /*! @@ -110,6 +95,12 @@ d_func()->iconType = static_cast(iconType); } +DButtonBoxButton::DButtonBoxButton(const DDciIcon &dciIcon, const QString &text, QWidget *parent) + : DButtonBoxButton(text, parent) +{ + setIcon(dciIcon); +} + /*! \brief 设置按钮图标. @@ -151,6 +142,20 @@ QAbstractButton::setIcon(DStyleHelper(style()).standardIcon(iconType, nullptr, this)); } +void DButtonBoxButton::setIcon(const DDciIcon &icon) +{ + D_D(DButtonBoxButton); + + d->dciIcon = icon; +} + +DDciIcon DButtonBoxButton::dciIcon() const +{ + D_DC(DButtonBoxButton); + + return d->dciIcon; +} + /*! \brief 返回图标大小. @@ -249,6 +254,12 @@ option->icon = icon(); option->iconSize = iconSize(); + D_DC(DButtonBoxButton); + if (!d->dciIcon.isNull()) { + option->dciIcon = d->dciIcon; + option->features |= QStyleOptionButton::ButtonFeature(DStyleOptionButton::HasDciIcon); + } + if (DButtonBox *p = qobject_cast(parent())) { option->orientation = p->orientation(); option->position = p->d_func()->getButtonPosition(this); diff -Nru dtkwidget-5.5.48/src/widgets/dbuttonbox.h dtkwidget-5.6.12/src/widgets/dbuttonbox.h --- dtkwidget-5.5.48/src/widgets/dbuttonbox.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dbuttonbox.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DBUTTONBOX_H -#define DBUTTONBOX_H - -#include -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DStyleOptionButtonBoxButton; -class DButtonBoxButtonPrivate; -class DButtonBoxButton : public QAbstractButton, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DButtonBoxButton) - -public: - explicit DButtonBoxButton(const QString &text, QWidget *parent = nullptr); - DButtonBoxButton(const QIcon& icon, const QString &text = QString(), QWidget *parent = nullptr); - DButtonBoxButton(QStyle::StandardPixmap iconType = static_cast(-1), - const QString &text = QString(), QWidget *parent = nullptr); - DButtonBoxButton(DStyle::StandardPixmap iconType = static_cast(-1), - const QString &text = QString(), QWidget *parent = nullptr); - - void setIcon(const QIcon &icon); - void setIcon(QStyle::StandardPixmap iconType); - void setIcon(DStyle::StandardPixmap iconType); - - QSize iconSize() const; - QSize sizeHint() const; - QSize minimumSizeHint() const override; - -private: - void initStyleOption(DStyleOptionButtonBoxButton *option) const; - - void paintEvent(QPaintEvent *e) override; - void keyPressEvent(QKeyEvent *event) override; - bool event(QEvent *e) override; -}; - -class DButtonBoxPrivate; -class DButtonBox : public QWidget, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DButtonBox) - -public: - explicit DButtonBox(QWidget *parent = nullptr); - - Qt::Orientation orientation() const; - void setOrientation(Qt::Orientation orientation); - - void setButtonList(const QList &list, bool checkable); - QList buttonList() const; - - QAbstractButton * checkedButton() const; - // no setter on purpose! - - QAbstractButton *button(int id) const; - void setId(QAbstractButton *button, int id); - int id(QAbstractButton *button) const; - int checkedId() const; - -Q_SIGNALS: - void buttonClicked(QAbstractButton *); - void buttonPressed(QAbstractButton *); - void buttonReleased(QAbstractButton *); - void buttonToggled(QAbstractButton *, bool); - -private: - void paintEvent(QPaintEvent *e) override; - - friend class DButtonBoxButton; -}; - -DWIDGET_END_NAMESPACE - -#endif // DBUTTONBOX_H diff -Nru dtkwidget-5.5.48/src/widgets/DCalendarWidget dtkwidget-5.6.12/src/widgets/DCalendarWidget --- dtkwidget-5.5.48/src/widgets/DCalendarWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DCalendarWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DCheckBox dtkwidget-5.6.12/src/widgets/DCheckBox --- dtkwidget-5.5.48/src/widgets/DCheckBox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DCheckBox 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/dcircleprogress.cpp dtkwidget-5.6.12/src/widgets/dcircleprogress.cpp --- dtkwidget-5.5.48/src/widgets/dcircleprogress.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dcircleprogress.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dcircleprogress.h" #include "private/dcircleprogress_p.h" diff -Nru dtkwidget-5.5.48/src/widgets/dcircleprogress.h dtkwidget-5.6.12/src/widgets/dcircleprogress.h --- dtkwidget-5.5.48/src/widgets/dcircleprogress.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dcircleprogress.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DCIRCLEPROGRESS_H -#define DCIRCLEPROGRESS_H - -#include -#include -#include - -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DCircleProgressPrivate; -class LIBDTKWIDGETSHARED_EXPORT DCircleProgress : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor DESIGNABLE true) - Q_PROPERTY(QColor chunkColor READ chunkColor WRITE setChunkColor DESIGNABLE true) - Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth DESIGNABLE true) - -Q_SIGNALS: - void clicked(); - void mouseEntered(); - void mouseLeaved(); - -public: - explicit DCircleProgress(QWidget *parent = 0); - - int value() const; - void setValue(int value); - - const QString text() const; - void setText(const QString &text); - - const QColor backgroundColor() const; - void setBackgroundColor(const QColor &color); - - const QColor chunkColor() const; - void setChunkColor(const QColor &color); - - int lineWidth() const; - void setLineWidth(const int width); - - QLabel *topLabel(); - QLabel *bottomLabel(); - -Q_SIGNALS: - void valueChanged(const int value) const; - -protected: - void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; - void enterEvent(QEvent *e) Q_DECL_OVERRIDE; - void leaveEvent(QEvent *e) Q_DECL_OVERRIDE; - -private: - D_DECLARE_PRIVATE(DCircleProgress) -}; - -DWIDGET_END_NAMESPACE - -#endif // DCIRCLEPROGRESS_H diff -Nru dtkwidget-5.5.48/src/widgets/DClipEffectWidget dtkwidget-5.6.12/src/widgets/DClipEffectWidget --- dtkwidget-5.5.48/src/widgets/DClipEffectWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DClipEffectWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dclipeffectwidget.h" diff -Nru dtkwidget-5.5.48/src/widgets/dclipeffectwidget.cpp dtkwidget-5.6.12/src/widgets/dclipeffectwidget.cpp --- dtkwidget-5.5.48/src/widgets/dclipeffectwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dclipeffectwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dclipeffectwidget.h" #include diff -Nru dtkwidget-5.5.48/src/widgets/dclipeffectwidget.h dtkwidget-5.6.12/src/widgets/dclipeffectwidget.h --- dtkwidget-5.5.48/src/widgets/dclipeffectwidget.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dclipeffectwidget.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DCLIPEFFECTWIDGET_H -#define DCLIPEFFECTWIDGET_H - -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DClipEffectWidgetPrivate; -class DClipEffectWidget : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(QMargins margins READ margins WRITE setMargins NOTIFY marginsChanged) - Q_PROPERTY(QPainterPath clipPath READ clipPath WRITE setClipPath NOTIFY clipPathChanged) - -public: - explicit DClipEffectWidget(QWidget *parent); - - QMargins margins() const; - QPainterPath clipPath() const; - -public Q_SLOTS: - void setMargins(QMargins margins); - void setClipPath(const QPainterPath &path); - -Q_SIGNALS: - void marginsChanged(QMargins margins); - void clipPathChanged(QPainterPath clipPath); - -protected: - bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; - void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; - void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; - void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE; - -private: - using QWidget::move; - using QWidget::resize; - using QWidget::setGeometry; - - D_DECLARE_PRIVATE(DClipEffectWidget) -}; - -DWIDGET_END_NAMESPACE - -#endif // DCLIPEFFECTWIDGET_H diff -Nru dtkwidget-5.5.48/src/widgets/DColorDialog dtkwidget-5.6.12/src/widgets/DColorDialog --- dtkwidget-5.5.48/src/widgets/DColorDialog 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DColorDialog 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DColoredProgressBar dtkwidget-5.6.12/src/widgets/DColoredProgressBar --- dtkwidget-5.5.48/src/widgets/DColoredProgressBar 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DColoredProgressBar 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dcoloredprogressbar.h" diff -Nru dtkwidget-5.5.48/src/widgets/dcoloredprogressbar.cpp dtkwidget-5.6.12/src/widgets/dcoloredprogressbar.cpp --- dtkwidget-5.5.48/src/widgets/dcoloredprogressbar.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dcoloredprogressbar.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: Chris Xiong - * - * Maintainer: Chris Xiong - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dcoloredprogressbar.h" @@ -52,7 +35,6 @@ \inmodule dtkwidget \brief DColoredProgressBar is the same as QProgressBar, except it can change its appearance depending on the value displayed. - \brief DColoredProgressBar和QProgressBar功能差不多一样,只是它可以根据显示的值更改其外观 */ DColoredProgressBar::DColoredProgressBar(QWidget *parent) : QProgressBar(parent) @@ -61,13 +43,10 @@ } /*! - \brief DColoredProgressBar::addThreshold 添加一个新的阈值,并指定达到该值后要使用的画笔。如果一个相同值的阈值已经存在,它将被覆盖。 \brief DColoredProgressBar::addThreshold adds a new threshold value and specifies the brush to use once that value is reached. If a threshold of the same value already exists, it will be overwritten. - \a brush 当前显示的值不小于 threshold且小于下一个阈值时使用的画笔。 \a brush The brush to use when the currently displayed value is no less than and less than the next threshold value. - \a threshold 使用此画笔的最小值。 \a threshold Minimum value for this brush to be used. */ void DColoredProgressBar::addThreshold(int threshold, QBrush brush) @@ -78,10 +57,8 @@ /*! \brief DColoredProgressBar::removeThreshold removes a threshold. - \brief DColoredProgressBar::removeThreshold 移除一个threshold \a threshold The threshold value to remove. - \a threshold 被移除的threshold值 */ void DColoredProgressBar::removeThreshold(int threshold) { @@ -93,10 +70,8 @@ /*! \brief DColoredProgressBar::threadsholds gets all threshold values. - \brief DColoredProgressBar::thresholds 获取所有的thresholds值 \return A list of threshold values. - \return 返回一个 threshold值的列表 */ QList DColoredProgressBar::thresholds() const { diff -Nru dtkwidget-5.5.48/src/widgets/dcoloredprogressbar.h dtkwidget-5.6.12/src/widgets/dcoloredprogressbar.h --- dtkwidget-5.5.48/src/widgets/dcoloredprogressbar.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dcoloredprogressbar.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: Chris Xiong - * - * Maintainer: Chris Xiong - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DColoredProgressBarPrivate; -class LIBDTKWIDGETSHARED_EXPORT DColoredProgressBar : public QProgressBar, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT -public: - explicit DColoredProgressBar(QWidget *parent = nullptr); - void addThreshold(int threshold, QBrush brush); - void removeThreshold(int threshold); - QList thresholds() const; - -protected: - void paintEvent(QPaintEvent *) override; - -private: - D_DECLARE_PRIVATE(DColoredProgressBar) -}; - -DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/DColumnView dtkwidget-5.6.12/src/widgets/DColumnView --- dtkwidget-5.5.48/src/widgets/DColumnView 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DColumnView 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DComboBox dtkwidget-5.6.12/src/widgets/DComboBox --- dtkwidget-5.5.48/src/widgets/DComboBox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DComboBox 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dcombobox.h" -#include "dwidgetstype.h" diff -Nru dtkwidget-5.5.48/src/widgets/dcombobox.cpp dtkwidget-5.6.12/src/widgets/dcombobox.cpp --- dtkwidget-5.5.48/src/widgets/dcombobox.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dcombobox.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dcombobox.h" #include "private/dcombobox_p.h" @@ -138,8 +121,6 @@ { D_D(DComboBox); - QComboBox::showPopup(); - auto getRowCount = [=]{ int count = 0; QStack toCheck; @@ -163,176 +144,121 @@ return count; }; // 小于 16 的时候使用 qt 默认的,直接返回,避免显示多余的空白 - if (getRowCount() <= maxVisibleItems()) { - return; - } - //获取下拉视图容器 - if (QComboBoxPrivateContainer *container = this->findChild()) { - // 重置最大高度 - - QStyle * const style = this->style(); - QStyleOptionComboBox opt; - initStyleOption(&opt); - const bool usePopup = style->styleHint(QStyle::SH_ComboBox_Popup, &opt, this); - - QRect listRect(style->subControlRect(QStyle::CC_ComboBox, &opt, - QStyle::SC_ComboBoxListBoxPopup, this)); - QRect screen = d->popupGeometry(); - - QPoint below = mapToGlobal(listRect.bottomLeft()); - int belowHeight = screen.bottom() - below.y(); - QPoint above = mapToGlobal(listRect.topLeft()); - int aboveHeight = above.y() - screen.y(); - bool boundToScreen = !window()->testAttribute(Qt::WA_DontShowOnScreen); - - { - int listHeight = 0; - int count = 0; - QStack toCheck; - toCheck.push(view()->rootIndex()); + QComboBoxPrivateContainer *container = this->findChild(); + if (getRowCount() <= maxVisibleItems() || !container) + return QComboBox::showPopup(); + + // Calculate maximum height by maximum item size + QStyle * const style = this->style(); + QStyleOptionComboBox opt; + initStyleOption(&opt); + const bool usePopup = style->styleHint(QStyle::SH_ComboBox_Popup, &opt, this); + + QRect listRect(style->subControlRect(QStyle::CC_ComboBox, &opt, + QStyle::SC_ComboBoxListBoxPopup, this)); + QRect screen = d->popupGeometry(); + + bool boundToScreen = !window()->testAttribute(Qt::WA_DontShowOnScreen); + + { + int listHeight = 0; + int count = 0; + QStack toCheck; + toCheck.push(view()->rootIndex()); #if QT_CONFIG(treeview) - QTreeView *treeView = qobject_cast(view()); - if (treeView && treeView->header() && !treeView->header()->isHidden()) - listHeight += treeView->header()->height(); + QTreeView *treeView = qobject_cast(view()); + if (treeView && treeView->header() && !treeView->header()->isHidden()) + listHeight += treeView->header()->height(); #endif - while (!toCheck.isEmpty()) { - QModelIndex parent = toCheck.pop(); - for (int i = 0, end = model()->rowCount(parent); i < end; ++i) { - QModelIndex idx = model()->index(i, modelColumn(), parent); - if (!idx.isValid()) - continue; - listHeight += view()->visualRect(idx).height(); + while (!toCheck.isEmpty()) { + QModelIndex parent = toCheck.pop(); + for (int i = 0, end = model()->rowCount(parent); i < end; ++i) { + QModelIndex idx = model()->index(i, modelColumn(), parent); + if (!idx.isValid()) + continue; + listHeight += view()->visualRect(idx).height(); #if QT_CONFIG(treeview) - if (model()->hasChildren(idx) && treeView && treeView->isExpanded(idx)) - toCheck.push(idx); + if (model()->hasChildren(idx) && treeView && treeView->isExpanded(idx)) + toCheck.push(idx); #endif - ++count; - if (count >= maxVisibleItems()) { - toCheck.clear(); - break; - } + ++count; + if (count >= maxVisibleItems()) { + toCheck.clear(); + break; } } - if (count > 1) - listHeight += (count - 1) * container->spacing(); - listRect.setHeight(listHeight); } + if (count > 1) + listHeight += (count - 1) * container->spacing(); + listRect.setHeight(listHeight); + } - { - // add the spacing for the grid on the top and the bottom; - int heightMargin = container->topMargin() + container->bottomMargin(); - - // add the frame of the container - int marginTop, marginBottom; - container->getContentsMargins(0, &marginTop, 0, &marginBottom); - heightMargin += marginTop + marginBottom; - - //add the frame of the view - view()->getContentsMargins(0, &marginTop, 0, &marginBottom); - marginTop += static_cast(QObjectPrivate::get(view()))->top; - marginBottom += static_cast(QObjectPrivate::get(view()))->bottom; - heightMargin += marginTop + marginBottom; - - listRect.setHeight(listRect.height() + heightMargin); - } - - { - // Hides or shows the scrollers when we emulate a popupmenu - if (style->styleHint(QStyle::SH_ComboBox_Popup, &opt, this) && - view()->verticalScrollBar()->minimum() < view()->verticalScrollBar()->maximum()) { - const int margin = style->pixelMetric(QStyle::PM_MenuScrollerHeight); - - bool needTop = view()->verticalScrollBar()->value() - > (view()->verticalScrollBar()->minimum() + container->topMargin()); - if (needTop) { - listRect.adjust(0, 0, 0, margin); - } - - bool needBottom = view()->verticalScrollBar()->value() - < (view()->verticalScrollBar()->maximum() - container->bottomMargin() - container->topMargin()); - if (needBottom) { - listRect.adjust(0, 0, 0, margin); - } - } - } + { + // add the spacing for the grid on the top and the bottom; + int heightMargin = container->topMargin() + container->bottomMargin(); + + // add the frame of the container + int marginTop, marginBottom; + container->getContentsMargins(0, &marginTop, 0, &marginBottom); + heightMargin += marginTop + marginBottom; + + //add the frame of the view + view()->getContentsMargins(0, &marginTop, 0, &marginBottom); + marginTop += static_cast(QObjectPrivate::get(view()))->top; + marginBottom += static_cast(QObjectPrivate::get(view()))->bottom; + heightMargin += marginTop + marginBottom; - // Add space for margin at top and bottom if the style wants it. - if (usePopup) - listRect.setHeight(listRect.height() + style->pixelMetric(QStyle::PM_MenuVMargin, &opt, this) * 2); - - // Make sure the popup is wide enough to display its contents. - if (usePopup) { - const int diff = d->computeWidthHint() - width(); - if (diff > 0) - listRect.setWidth(listRect.width() + diff); - } + listRect.setHeight(listRect.height() + heightMargin); + } - //takes account of the minimum/maximum size of the container -// listRect.setSize( listRect.size().expandedTo(container->minimumSize()) -// .boundedTo(container->maximumSize())); - - // make sure the widget fits on screen - if (boundToScreen) { - if (listRect.width() > screen.width() ) - listRect.setWidth(screen.width()); - if (mapToGlobal(listRect.bottomRight()).x() > screen.right()) { - below.setX(screen.x() + screen.width() - listRect.width()); - above.setX(screen.x() + screen.width() - listRect.width()); - } - if (mapToGlobal(listRect.topLeft()).x() < screen.x() ) { - below.setX(screen.x()); - above.setX(screen.x()); + { + // Hides or shows the scrollers when we emulate a popupmenu + if (style->styleHint(QStyle::SH_ComboBox_Popup, &opt, this) && + view()->verticalScrollBar()->minimum() < view()->verticalScrollBar()->maximum()) { + const int margin = style->pixelMetric(QStyle::PM_MenuScrollerHeight); + + bool needTop = view()->verticalScrollBar()->value() + > (view()->verticalScrollBar()->minimum() + container->topMargin()); + if (needTop) { + listRect.adjust(0, 0, 0, margin); } - } - - QScrollBar *sb = view()->horizontalScrollBar(); - Qt::ScrollBarPolicy policy = view()->horizontalScrollBarPolicy(); - bool needHorizontalScrollBar = (policy == Qt::ScrollBarAsNeeded || policy == Qt::ScrollBarAlwaysOn) - && sb->minimum() < sb->maximum(); - if (needHorizontalScrollBar) { - listRect.adjust(0, 0, 0, sb->height()); - } - - // 提前修改container高度,否则 view()->visualRect(view()->currentIndex())的位置计算错误 - container->setMaximumHeight(listRect.height()); - if (usePopup) { - // Position horizontally. - listRect.moveLeft(above.x()); - - // Position vertically so the curently selected item lines up - // with the combo box. - const QRect currentItemRect = view()->visualRect(view()->currentIndex()); - const int offset = listRect.top() - currentItemRect.top(); - listRect.moveTop(above.y() + offset - listRect.top()); - - // Clamp the listRect height and vertical position so we don't expand outside the - // available screen geometry.This may override the vertical position, but it is more - // important to show as much as possible of the popup. - const int height = !boundToScreen ? listRect.height() : qMin(listRect.height(), screen.height()); - listRect.setHeight(height); - - if (boundToScreen) { - if (listRect.top() < screen.top()) - listRect.moveTop(screen.top()); - if (listRect.bottom() > screen.bottom()) - listRect.moveBottom(screen.bottom()); + bool needBottom = view()->verticalScrollBar()->value() + < (view()->verticalScrollBar()->maximum() - container->bottomMargin() - container->topMargin()); + if (needBottom) { + listRect.adjust(0, 0, 0, margin); } - } else if (!boundToScreen || listRect.height() <= belowHeight) { - listRect.moveTopLeft(below); - } else if (listRect.height() <= aboveHeight) { - listRect.moveBottomLeft(above); - } else if (belowHeight >= aboveHeight) { - listRect.setHeight(belowHeight); - listRect.moveTopLeft(below); - } else { - listRect.setHeight(aboveHeight); - listRect.moveBottomLeft(above); } + } - container->setGeometry(listRect); + // Add space for margin at top and bottom if the style wants it. + if (usePopup) + listRect.setHeight(listRect.height() + style->pixelMetric(QStyle::PM_MenuVMargin, &opt, this) * 2); + + // Make sure the popup is wide enough to display its contents. + if (usePopup) { + const int diff = d->computeWidthHint() - width(); + if (diff > 0) + listRect.setWidth(listRect.width() + diff); } + // make sure the widget fits on screen + if (boundToScreen && listRect.width() > screen.width()) + listRect.setWidth(screen.width()); + + QScrollBar *sb = view()->horizontalScrollBar(); + Qt::ScrollBarPolicy policy = view()->horizontalScrollBarPolicy(); + bool needHorizontalScrollBar = (policy == Qt::ScrollBarAsNeeded || policy == Qt::ScrollBarAlwaysOn) + && sb->minimum() < sb->maximum(); + if (needHorizontalScrollBar) { + listRect.adjust(0, 0, 0, sb->height()); + } + container->setMaximumSize(listRect.size()); + QComboBox::showPopup(); + auto currentIndexTopLeft = view()->mapToGlobal(view()->visualRect(view()->currentIndex()).topLeft()); + int offset = mapToGlobal(rect().topLeft()).y() - currentIndexTopLeft.y(); + int newY = qMax(screen.top(), qMin(container->y() + offset, screen.bottom() - container->height())); + container->move(container->x(), newY); } DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/dcombobox.h dtkwidget-5.6.12/src/widgets/dcombobox.h --- dtkwidget-5.5.48/src/widgets/dcombobox.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dcombobox.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ -#ifndef DCOMBOBOX_H -#define DCOMBOBOX_H - -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DComboBoxPrivate; -class LIBDTKWIDGETSHARED_EXPORT DComboBox : public QComboBox, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DComboBox) - -public: - explicit DComboBox(QWidget *parent = nullptr); - -protected: - DComboBox(DComboBoxPrivate &dd, QWidget *parent); - - // QComboBox interface -public: - virtual void showPopup() override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DCOMBOBOX_H diff -Nru dtkwidget-5.5.48/src/widgets/DCommandLinkButton dtkwidget-5.6.12/src/widgets/DCommandLinkButton --- dtkwidget-5.5.48/src/widgets/DCommandLinkButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DCommandLinkButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dcommandlinkbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dcommandlinkbutton.cpp dtkwidget-5.6.12/src/widgets/dcommandlinkbutton.cpp --- dtkwidget-5.5.48/src/widgets/dcommandlinkbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dcommandlinkbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dcommandlinkbutton.h" #include "dpalettehelper.h" @@ -15,17 +19,19 @@ }; /*! + @~english \class Dtk::Widget::DCommandLinkButton \inmodule dtkwidget - \brief DCommandLinkButton 一个继承于 QAbstractButton 的按钮,外形和链接很像; - 也可以是带有箭头的链接。常用于点击之后,跳转到另外一个窗口或者页面,比如浏览器的前进后退按钮 + \brief `DCommandLinkButton` A button inherited in `QABSTRACTBUTTON`, the shape and link are very similar; + It can also be a link with arrows.Commonly used after clicking, jump to another window or page, such as the forward and back button of the browser */ /*! - \brief 构造函数 - \a text 控件显示的文字 - \a parent 控件的父对象 + @~english + \brief Constructor + \a text The text displayed by the control + \a parent The father of the control */ DCommandLinkButton::DCommandLinkButton(const QString text, QWidget *parent) : QAbstractButton(parent) @@ -34,8 +40,9 @@ } /*! - \brief 获取控件的矩形大小 - \return 返回本的控件矩形大小 + @~english + \brief Get the rectangle size of the control + \return Return the control rectangle size */ QSize DCommandLinkButton::sizeHint() const { @@ -46,8 +53,9 @@ } /*! - \brief 初始化的一个 option 的风格,和一些基本的属性 - \a option 实参是一个用来初始化的(按钮控件的)风格属性 + @~english + \brief The style of an Option, and some basic attributes + \a option Real parameters are a (button control) style attribute used to initialize */ void DCommandLinkButton::initStyleOption(DStyleOptionButton *option) const { @@ -62,8 +70,9 @@ } /*! - \brief 绘画事件 - \a e 此处不使用 + @~english + \brief Painting incident + \a e Not used here */ void DCommandLinkButton::paintEvent(QPaintEvent *e) { diff -Nru dtkwidget-5.5.48/src/widgets/dcommandlinkbutton.h dtkwidget-5.6.12/src/widgets/dcommandlinkbutton.h --- dtkwidget-5.5.48/src/widgets/dcommandlinkbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dcommandlinkbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -#ifndef DCOMMANDLINKBUTTON_H -#define DCOMMANDLINKBUTTON_H - -#include -#include - -DWIDGET_BEGIN_NAMESPACE -class DStyleOptionButton; - -class DCommandLinkButton : public QAbstractButton -{ - Q_OBJECT - -public: - explicit DCommandLinkButton(const QString text, QWidget *parent = nullptr); - - QSize sizeHint() const override; - -protected: - void initStyleOption(DStyleOptionButton *option) const; - void paintEvent(QPaintEvent *e) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DCOMMANDLINKBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/dconstants.h dtkwidget-5.6.12/src/widgets/dconstants.h --- dtkwidget-5.5.48/src/widgets/dconstants.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dconstants.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DCONSTANTS_H -#define DCONSTANTS_H - -#include - -DWIDGET_BEGIN_NAMESPACE - //basis width and height - const int BUTTON_HEIGHT = 22; - const int EXPAND_HEADER_HEIGHT = 30; - const int CONTENT_HEADER_HEIGHT = 38; - const int RADIO_ITEM_HEIGHT = 30; - const int MENU_ITEM_HEIGHT = 24; - const int MENU_ITEM_LEFT_MARGIN = 24; //NOT include the tick - const int HEADER_LEFT_MARGIN = 14; - const int HEADER_RIGHT_MARGIN = 14; - const int TEXT_LEFT_MARGIN = 6; - const int TEXT_RIGHT_MARGIN = 6; - const int BUTTON_MARGIN = 8; - const int TEXT_BUTTON_MIN_WIDTH = 70; - const int IMAGE_BUTTON_WIDTH = 24; - const int FONT_SIZE = 12; - const int NORMAL_RADIUS = 3; -DWIDGET_END_NAMESPACE - -#endif //DCONSTANTS_H diff -Nru dtkwidget-5.5.48/src/widgets/DCrumbEdit dtkwidget-5.6.12/src/widgets/DCrumbEdit --- dtkwidget-5.5.48/src/widgets/DCrumbEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DCrumbEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dcrumbedit.h" diff -Nru dtkwidget-5.5.48/src/widgets/dcrumbedit.cpp dtkwidget-5.6.12/src/widgets/dcrumbedit.cpp --- dtkwidget-5.5.48/src/widgets/dcrumbedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dcrumbedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,26 +1,11 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dcrumbedit.h" #include "dobject_p.h" #include "DStyle" +#include "dsizemode.h" #include #include @@ -34,6 +19,8 @@ #include #include +#include + DWIDGET_BEGIN_NAMESPACE enum Background { @@ -125,6 +112,30 @@ QBrush backgroundBrush(const QRect &rect, const QBrush &brush); }; +class DCrumbEditPanelFrame : public QWidget { + Q_OBJECT + +public: + explicit DCrumbEditPanelFrame(QWidget *parent = nullptr) + :QWidget(parent) + { + setFocusProxy(parent); + } + +protected: + void paintEvent(QPaintEvent *event) override; +}; + +void DCrumbEditPanelFrame::paintEvent(QPaintEvent *event) +{ + QPainter p(this); + QStyleOptionFrame panel; + panel.initFrom(parentWidget()); + panel.rect = rect(); + style()->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, &p, parentWidget()); + QWidget::paintEvent(event); +} + /*! \class Dtk::Widget::DCrumbTextFormat \inmodule dtkwidget @@ -277,11 +288,14 @@ widgetLeft = new QWidget(qq); widgetRight = new QWidget(qq); crumbRadius = DStyle::pixelMetric(qq->style(), DStyle::PM_FrameRadius); + panelFrame = new DCrumbEditPanelFrame(qq); + panelFrame->stackUnder(qq->viewport()); widgetTop->setAccessibleName("DCrumbEditTopWidget"); widgetBottom->setAccessibleName("DCrumbEditBottomWidget"); widgetLeft->setAccessibleName("DCrumbEditLeftWidget"); widgetRight->setAccessibleName("DCrumbEditRightWidget"); + panelFrame->setAccessibleName("DCrumbEditPanelFrame"); } void registerHandler(QAbstractTextDocumentLayout *layout) @@ -516,6 +530,7 @@ int objectType; bool crumbReadOnly = false; int crumbRadius = 2; + bool explicitCrumbRadius = false; QString splitter = ","; QStringList formatList; QMap formats; @@ -523,6 +538,7 @@ bool dualClickMakeCrumb = false; QString currentText; QBrush currentBrush; + DCrumbEditPanelFrame* panelFrame = nullptr; public: QWidget* widgetTop; @@ -625,9 +641,13 @@ qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); + int frameRadius = DStyle::pixelMetric(style(), DStyle::PM_FrameRadius); + int margins = DStyle::pixelMetric(style(), DStyle::PM_FrameMargins); viewport()->setAutoFillBackground(false); viewport()->setAccessibleName("DCrumbViewport"); setFrameShape(QFrame::NoFrame); + int margin = frameRadius / 2 + margins + 2; + setViewportMargins(margin, margin, margin, margin); d->widgetTop->setFixedWidth(1); d->widgetBottom->setFixedWidth(1); @@ -956,6 +976,7 @@ D_D(DCrumbEdit); d->crumbRadius = crumbRadius; + d->explicitCrumbRadius = true; } /*! @@ -991,6 +1012,30 @@ d->widgetBottom->setFixedHeight(frame_radius); d->widgetLeft->setFixedWidth(frame_radius); d->widgetRight->setFixedWidth(frame_radius); + } else if (e->type() == QEvent::Resize) { + d->panelFrame->resize(size()); + } else if (e->type() == QEvent::StyleChange) { + int frameRadius = DStyle::pixelMetric(style(), DStyle::PM_FrameRadius); + // update crumbRadius if not set. + if (!d->explicitCrumbRadius) { + d->crumbRadius = frameRadius; + auto collection = document()->docHandle()->formatCollection(); + for (int i = 0; i < collection->numFormats(); ++i) { + // only update format in d->formats. + if (!collection->format(i).hasProperty(QTextFormat::UserProperty + 1)) + continue; + const auto key = collection->format(i).property(QTextFormat::UserProperty + 1).toString(); + if (d->formats.contains(key)) + collection->formats[i].setProperty(QTextFormat::UserProperty + 4, crumbRadius()); + } + for (auto iter = d->formats.begin(); iter != d->formats.end(); iter++) { + iter->setBackgroundRadius(crumbRadius()); + } + } + + int margins = DStyle::pixelMetric(style(), DStyle::PM_FrameMargins); + int margin = frameRadius / 2 + margins + 2; + setViewportMargins(margin, margin, margin, margin); } return QTextEdit::event(e); @@ -999,13 +1044,6 @@ /*!\reimp */ void DCrumbEdit::paintEvent(QPaintEvent *event) { - QPainter p(viewport()); - - QStyleOptionFrame panel; - initStyleOption(&panel); - panel.rect = viewport()->rect(); - style()->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, &p, this); - QTextEdit::paintEvent(event); } diff -Nru dtkwidget-5.5.48/src/widgets/dcrumbedit.h dtkwidget-5.6.12/src/widgets/dcrumbedit.h --- dtkwidget-5.5.48/src/widgets/dcrumbedit.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dcrumbedit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,146 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DCRUMBEDIT_H -#define DCRUMBEDIT_H - -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DCrumbTextFormat : public QTextCharFormat -{ -public: - DCrumbTextFormat(); - - QColor tagColor() const; - void setTagColor(const QColor &color); - QString text() const; - void setText(const QString &text); - QColor textColor() const; - void setTextColor(const QColor &color); - QBrush background() const; - void setBackground(const QBrush &background); - int backgroundRadius() const; - void setBackgroundRadius(int radius); - -protected: - DCrumbTextFormat(int objectType); - explicit DCrumbTextFormat(const QTextFormat &fmt); - friend class CrumbObjectInterface; - friend class DCrumbEdit; - friend class DCrumbEditPrivate; -}; - -class DCrumbEditPrivate; -class LIBDTKWIDGETSHARED_EXPORT DCrumbEdit : public QTextEdit, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(bool crumbReadOnly READ crumbReadOnly WRITE setCrumbReadOnly) - Q_PROPERTY(int crumbRadius READ crumbRadius WRITE setCrumbRadius) - Q_PROPERTY(QString splitter READ splitter WRITE setSplitter) - Q_PROPERTY(bool dualClickMakeCrumb READ dualClickMakeCrumb WRITE setDualClickMakeCrumb) - -public: - enum CrumbType { - black = Qt::black, - white = Qt::white, - darkGray = Qt::darkGray, - gray = Qt::gray, - lightGray = Qt::lightGray, - red = Qt::red, - green = Qt::green, - blue = Qt::blue, - cyan = Qt::cyan, - magenta = Qt::magenta, - yellow = Qt::yellow, - darkRed = Qt::darkRed, - darkGreen = Qt::darkGreen, - darkBlue = Qt::darkBlue, - darkCyan = Qt::darkCyan, - darkMagenta = Qt::darkMagenta, - darkYellow = Qt::darkYellow - }; - - explicit DCrumbEdit(QWidget *parent = 0); - - bool insertCrumb(const DCrumbTextFormat &format, int pos = -1); - bool insertCrumb(const QString &text, int pos = -1); - bool appendCrumb(const DCrumbTextFormat &format); - bool appendCrumb(const QString &text); - - bool containCrumb(const QString &text) const; - QStringList crumbList() const; - - DCrumbTextFormat crumbTextFormat(const QString &text) const; - DCrumbTextFormat makeTextFormat() const; - DCrumbTextFormat makeTextFormat(CrumbType type) const; - - bool dualClickMakeCrumb() const Q_DECL_NOEXCEPT; - bool crumbReadOnly() const; - int crumbRadius() const; - QString splitter() const; - -Q_SIGNALS: - void crumbAdded(const QString &text); - void crumbRemoved(const QString &text); - void crumbListChanged(); - -public Q_SLOTS: - void setCrumbReadOnly(bool crumbReadOnly); - void setCrumbRadius(int crumbRadius); - void setSplitter(const QString &splitter); - - void setDualClickMakeCrumb(bool flag) Q_DECL_NOEXCEPT; - -protected: - bool event(QEvent *e) override; - void paintEvent(QPaintEvent *event) override; - void keyPressEvent(QKeyEvent *event) override; - void mouseDoubleClickEvent(QMouseEvent *event) override; - void focusOutEvent(QFocusEvent *event) override; - - QMimeData *createMimeDataFromSelection() const override; - bool canInsertFromMimeData(const QMimeData *source) const override; - void insertFromMimeData(const QMimeData *source) override; - -private: - using QTextEdit::setDocument; - using QTextEdit::document; - using QTextEdit::setText; - using QTextEdit::setHtml; - using QTextEdit::setPlaceholderText; - using QTextEdit::insertPlainText; - using QTextEdit::insertHtml; - using QTextEdit::append; - - D_DECLARE_PRIVATE(DCrumbEdit) - Q_PRIVATE_SLOT(d_func(), void _q_onDocumentLayoutChanged()) - Q_PRIVATE_SLOT(d_func(), void _q_onCurrentPositionChanged()) - Q_PRIVATE_SLOT(d_func(), void _q_onTextChanged()) -}; - -DWIDGET_END_NAMESPACE - -#endif // DCRUMBEDIT_H diff -Nru dtkwidget-5.5.48/src/widgets/DDataWidgetMapper dtkwidget-5.6.12/src/widgets/DDataWidgetMapper --- dtkwidget-5.5.48/src/widgets/DDataWidgetMapper 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DDataWidgetMapper 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DDateEdit dtkwidget-5.6.12/src/widgets/DDateEdit --- dtkwidget-5.5.48/src/widgets/DDateEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DDateEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DDateTimeEdit dtkwidget-5.6.12/src/widgets/DDateTimeEdit --- dtkwidget-5.5.48/src/widgets/DDateTimeEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DDateTimeEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DDial dtkwidget-5.6.12/src/widgets/DDial --- dtkwidget-5.5.48/src/widgets/DDial 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DDial 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DDialog dtkwidget-5.6.12/src/widgets/DDialog --- dtkwidget-5.5.48/src/widgets/DDialog 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DDialog 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "ddialog.h" diff -Nru dtkwidget-5.5.48/src/widgets/DDialogButtonBox dtkwidget-5.6.12/src/widgets/DDialogButtonBox --- dtkwidget-5.5.48/src/widgets/DDialogButtonBox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DDialogButtonBox 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DDialogCloseButton dtkwidget-5.6.12/src/widgets/DDialogCloseButton --- dtkwidget-5.5.48/src/widgets/DDialogCloseButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DDialogCloseButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "ddialogclosebutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/ddialogclosebutton.cpp dtkwidget-5.6.12/src/widgets/ddialogclosebutton.cpp --- dtkwidget-5.5.48/src/widgets/ddialogclosebutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/ddialogclosebutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "ddialogclosebutton.h" DWIDGET_BEGIN_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/ddialogclosebutton.h dtkwidget-5.6.12/src/widgets/ddialogclosebutton.h --- dtkwidget-5.5.48/src/widgets/ddialogclosebutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/ddialogclosebutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DDIALOGCLOSEBUTTON_H -#define DDIALOGCLOSEBUTTON_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DDialogCloseButton : public DIconButton -{ - Q_OBJECT -public: - explicit DDialogCloseButton(QWidget *parent = nullptr); -}; - -DWIDGET_END_NAMESPACE - -#endif // DDIALOGCLOSEBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/ddialog.cpp dtkwidget-5.6.12/src/widgets/ddialog.cpp --- dtkwidget-5.5.48/src/widgets/ddialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/ddialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include @@ -41,6 +28,7 @@ #include "dtitlebar.h" #include "dwarningbutton.h" #include "dsuggestbutton.h" +#include "dsizemode.h" DWIDGET_BEGIN_NAMESPACE @@ -271,23 +259,14 @@ } /*! - \class Dtk::Widget::DDialog +@~english + @class Dtk::Widget::DDialog \inmodule dtkwidget - \brief 可以使用 DDialog 类快速创建符合 DDE 风格的简要对话框窗口. - \brief Use DDialog class to create quick dialog window matched DDE style. - - \ingroup dialog-classes - \ingroup abstractwidgets - - DDialog 旨在提供简要的讯问式对话框的快速实现。提供了包含标题,对话框内容,默认图标,用以添加按钮的布局和一个可以自由添加内容的内容布局。 - 可以使用 addButton() , insertButton(), setDefaultButton() 等函数方便的给对话框插入按钮并进行管理,可以使用 addContent(), insertContent() - 等函数操作内容布局。 + @brief Use DDialog class to create quick dialog window matched DDE style. - 此外, DDialog 还提供了一些额外的函数以供实现一些常见的需求。如,可以通过设置 setOnButtonClickedClose() 为 true 来使得用 - 户在点击任何对话框上的按钮后关闭对话框。 - - 当你需要快速构建较为简单结构的对话框,你应当使用 DDialog ,对于较为复杂的需求,请参阅 DAbstractDialog 或 QDialog 相关文档。 + @ingroup dialog-classes + @ingroup abstractwidgets \section1 differences Differences with QDialog @@ -298,13 +277,14 @@ DDialog also provided some extra function which maybe useful for some common use case, for example, you can set setOnButtonClickedClose() to \c true , then once user clicked a button, the dialog will got closed. - \sa DAbstractDialog, QDialog + @sa DAbstractDialog, QDialog */ /*! - \brief 构造一个 DDialog 对话框. +@~english + @brief Construct a DDialog dialog box - \a parent 父控件指针. + \a parent Parent control pointer */ DDialog::DDialog(QWidget *parent) : DAbstractDialog(*new DDialogPrivate(this), parent) @@ -313,11 +293,12 @@ } /*! - \brief 构造一个 DDialog 对话框。 +@~english + @brief Construct a DDialog dialog box - \a title 标题 - \a message 对话框消息 - \a parent 父控件 + \a title Title + \a message Dialog box messages + \a parent Parent control pointer */ DDialog::DDialog(const QString &title, const QString &message, QWidget *parent) : DAbstractDialog(*new DDialogPrivate(this), parent) @@ -329,11 +310,12 @@ } /*! - \brief 通过按钮文字获取按钮下标. +@~english + @brief Gets the button index from its text - \a text 按钮文字 + \a text The text of the button - \return 按钮下标 + @return The index of the button */ int DDialog::getButtonIndexByText(const QString &text) const { @@ -350,7 +332,8 @@ } /*! - \brief 获得对话框包含的按钮数量. +@~english + @brief Gets the number of buttons that the dialog box contains. */ int DDialog::buttonCount() const { @@ -360,7 +343,8 @@ } /*! - \brief 获得对话框所含的所有内容控件的数量. +@~english + @brief Gets the number of all content controls that the dialog box contains. */ int DDialog::contentCount() const { @@ -370,7 +354,8 @@ } /*! - \brief 获得对话框的按钮列表 +@~english + @brief Gets a list of buttons for the dialog box */ QList DDialog::getButtons() const { @@ -380,7 +365,8 @@ } /*! - \brief 获得对话框所含的所有内容控件列表 +@~english + @brief Gets a list of all content controls that the dialog box contains */ QList DDialog::getContents() const { @@ -390,10 +376,11 @@ } /*! - \brief 获得指定下标所对应的按钮. +@~english + @brief Gets the button corresponding to the specified index - \a index 按钮下标 - \return 对应的按钮 + \a index The index of the button + @return Returns the button with the specified index */ QAbstractButton *DDialog::getButton(int index) const { @@ -403,9 +390,10 @@ } /*! - \brief 获取指定下标对应的内容控件. - \a index 控件下标 - \return 返回对应的内容控件 +@~english + @brief Gets the content control corresponding to the specified subscript + \a index The index of the control + @return Returns the corresponding content control */ QWidget *DDialog::getContent(int index) const { @@ -415,9 +403,10 @@ } /*! - \brief 返回对话框标题. +@~english + @brief Returns the dialog box title - \return 返回对话框的标题内容 + @return Returns the dialog box title */ QString DDialog::title() const { @@ -427,9 +416,10 @@ } /*! - \brief 返回对话框消息文本. +@~english + @brief Returns the dialog box message text. - \return 返回对话框的显示信息 + @return Returns the dialog box message text */ QString DDialog::message() const { @@ -439,9 +429,10 @@ } /*! - \brief 返回对话框图标. +@~english + @brief Return to the dialog box icon - \return 返回对话框的icon + @return Return to the dialog box icon */ QIcon DDialog::icon() const { @@ -451,8 +442,9 @@ } /*! - \brief 返回对话框图标的 QPixmap 对象. - \return 返回ICON的pixmap +@~english + @brief Returns the QPixmap object of the dialog icon + @return Returns the QPixmap object of the dialog icon */ QPixmap DDialog::iconPixmap() const { @@ -466,9 +458,10 @@ } /*! - \brief 返回对话框的文本格式. +@~english + @brief Returns the text format of the dialog box - \return 返回设定的文本格式 + @return Returns the text format of the dialog box */ Qt::TextFormat DDialog::textFormat() const { @@ -478,9 +471,10 @@ } /*! - \brief 检查在点击任何按钮后是否都会关闭对话框. +@~english + @brief Check to see if the dialog closes after clicking any button - \return 关闭对话框返回 true , 否则返回 false. + @return Returns true if the dialog box is closed, false otherwise */ bool DDialog::onButtonClickedClose() const { @@ -490,8 +484,9 @@ } /*! - \brief 设定内容布局的内容 margin . - \a margins 具体的 margins +@~english + @brief Sets the content margin for the content layout + \a margins Specific margins */ void DDialog::setContentLayoutContentsMargins(const QMargins &margins) { @@ -501,9 +496,10 @@ } /*! - \brief 返回内容布局的边距. +@~english + @brief Returns the margins for the content layout - \return 返回内容布局的内容margin + @return Returns the content margin of the content layout */ QMargins DDialog::contentLayoutContentsMargins() const { @@ -513,9 +509,10 @@ } /*! - \brief 关闭按钮的可见属性. +@~english + @brief Turns off the visibility property of the button - \return 返回关闭按钮是否可见的bool值 + @return Returns the bool value of whether the close button is visible */ bool DDialog::closeButtonVisible() const { @@ -523,13 +520,14 @@ } /*! - \brief 向对话框添加按钮. +@~english + @brief Adds a button to the dialog box - \a text 按钮文字 - \a isDefault 是否默认按钮 - \a type 按钮类型 + \a text The text of button + \a isDefault Default button or not + \a type Types of button - \return 所添加的按钮的下标 + @return The index of the added button */ int DDialog::addButton(const QString &text, bool isDefault, ButtonType type) { @@ -541,11 +539,12 @@ } /*! - \brief 向对话框添加按钮. +@~english + @brief Adds a button to the dialog box - \a text 按钮文字 + \a text The text of button - \return 所添加的按钮的下标 + @return The index of the added button */ int DDialog::addButtons(const QStringList &text) { @@ -557,12 +556,13 @@ } /*! - \brief 向对话框插入按钮. +@~english + @brief Adds a button to the dialog box - \a index 下标 - \a text 按钮文字 - \a isDefault 是否是默认按钮 - \a type 按钮类型 + \a index The index of the button to add + \a text The text of button + \a isDefault Default button or not + \a type Types of buttons */ void DDialog::insertButton(int index, const QString &text, bool isDefault, ButtonType type) { @@ -589,11 +589,12 @@ } /*! - \brief 向对话框插入按钮. +@~english + @brief Inserts a button into the dialog box. - \a index 下标 - \a button 待插入的按钮 - \a isDefault 是否是默认按钮 + \a index The index of the button to add + \a button Button to insert + \a isDefault Default button or not */ void DDialog::insertButton(int index, QAbstractButton *button, bool isDefault) { @@ -601,7 +602,7 @@ DVerticalLine *line = new DVerticalLine; line->setObjectName("VLine"); - line->setFixedHeight(30); + line->setFixedHeight(DSizeModeHelper::element(20, 30)); d->buttonLayout->insertWidget(index * 2 , line); d->buttonLayout->insertWidget(index * 2 + 1, button); @@ -639,10 +640,11 @@ } /*! - \brief 向对话框插入按钮. +@~english + @brief Inserts a button into the dialog box - \a index 下标 - \a text 按钮文字 + \a index The index of the button to add + \a text The text of button */ void DDialog::insertButtons(int index, const QStringList &text) { @@ -652,9 +654,10 @@ } /*! - \brief 从对话框移除按钮. +@~english + @brief Removes the button from the dialog box - \a index 待移除按钮的下标 + \a index The index of the button to remove */ void DDialog::removeButton(int index) { @@ -688,9 +691,10 @@ } /*! - \brief 从对话框移除按钮. +@~english + @brief Removes the button from the dialog box - \a button 待移除的按钮 + \a button The button to remove */ void DDialog::removeButton(QAbstractButton *button) { @@ -698,9 +702,10 @@ } /*! - \brief 从对话框移除按钮. +@~english + @brief Removes the button from the dialog box - \a text 待移除按钮的文本内容 + \a text The text of the button to remove */ void DDialog::removeButtonByText(const QString &text) { @@ -711,7 +716,8 @@ } /*! - \brief 清除所有按钮. +@~english + @brief Clear all buttons */ void DDialog::clearButtons() { @@ -729,10 +735,11 @@ } /*! - \brief 设置默认按钮. +@~english + @brief Setting the default button - \a index 要设置的默认按钮的下标. - \return 设置成功返回 true,否则返回false. + \a index The index of the default button to set + @return Returns true on success and false otherwise */ bool DDialog::setDefaultButton(int index) { @@ -745,10 +752,11 @@ } /*! - \brief 设置默认按钮. +@~english + @brief Setting the default button - \a str 要设置的默认按钮的文本内容 - \sa default + \a str The text content of the default button to set + @sa default */ bool DDialog::setDefaultButton(const QString &str) { @@ -756,10 +764,11 @@ } /*! - \brief 设置默认按钮 +@~english + @brief Setting the default button - \a button 要设置的默认按钮 - \sa default + \a button Default button to set + @sa default */ void DDialog::setDefaultButton(QAbstractButton *button) { @@ -769,10 +778,11 @@ } /*! - \brief 添加控件到对话框内容布局. +@~english + @brief Add controls to the dialog content layout. - \a widget 待添加的控件 - \a alignment 对齐方式 + \a widget Controls to add + \a alignment alignment */ void DDialog::addContent(QWidget *widget, Qt::Alignment alignment) { @@ -784,11 +794,12 @@ } /*! - \brief 在对话框内容布局指定位置插入控件. +@~english + @brief Inserts a control at the location specified in the dialog box content layout - \a index 待插入的位置下标 - \a widget 待插入的控件 - \a alignment 对齐方式 + \a index The index of the position to insert + \a widget Control to insert + \a alignment alignment */ void DDialog::insertContent(int index, QWidget *widget, Qt::Alignment alignment) { @@ -800,10 +811,11 @@ } /*! - \brief 从对话框内容布局中移除指定控件. +@~english + @brief Removes the specified control from the dialog box content layout. - \a widget 待移除的控件 - \a isDelete 是否执行删除 + \a widget Control to remove + \a isDelete Whether to delete */ void DDialog::removeContent(QWidget *widget, bool isDelete) { @@ -818,9 +830,10 @@ } /*! - \brief 清空对话框内容布局中的所有内容. +@~english + @brief Clear everything in the content layout of the dialog box. - \a isDelete 是否删除 + \a isDelete Whether to delete */ void DDialog::clearContents(bool isDelete) { @@ -837,11 +850,12 @@ } /*! - \brief 设置对话框内容间隔. +@~english + @brief Sets the dialog content interval. - 设置对话框的内容布局的间隔 \a spacing 大小 + \a spacing Spacing size for the content layout of the dialog box - \sa QBoxLayout::setSpacing + @sa QBoxLayout::setSpacing */ void DDialog::setSpacing(int spacing) { @@ -851,11 +865,12 @@ } /*! - \brief 追加对话框内容间隔. +@~english + @brief Append dialog box content intervals - 在对话框的内容布局后追加一个非弹性,大小为 \a spacing 的间隔(一个 QSpacerItem )。 + Append an inelastic interval of size \a spacing after the content layout of the dialog box (a QSpacerItem) - \sa QBoxLayout::addSpacing + @sa QBoxLayout::addSpacing */ void DDialog::addSpacing(int spacing) { @@ -865,12 +880,13 @@ } /*! - \brief 插入对话框内容间隔. +@~english + @brief Insert dialog box content intervals. - 在对话框的内容布局的指定位置插入一个非弹性,大小为 \a spacing 的间隔(一个 QSpacerItem )。 - \a index 插入间隔的索引位置. + Inserts an inelastic interval of size spacing (a QSpacerItem) at the specified position in the content layout of the dialog box. + \a index The index position at which the interval is inserted. - \sa QBoxLayout::insertSpacing + @sa QBoxLayout::insertSpacing */ void DDialog::insertSpacing(int index, int spacing) { @@ -880,9 +896,10 @@ } /*! - \brief 清除内容间隔. +@~english + @brief Clear content intervals. - 清除对话框内容布局中包含的所有 QSpacerItem 。 + Clear all QSpacerItems contained in the dialog content layout. */ void DDialog::clearSpacing() { @@ -898,10 +915,11 @@ } /*! - \brief 设置按钮文字. +@~english + @brief Setting button text. - \a index 需要设置文字的按钮的下标 - \a text 所需要设置的文字 + \a index The index of the button that requires the text to be set + \a text Text to set */ void DDialog::setButtonText(int index, const QString &text) { @@ -911,9 +929,10 @@ } /*! - \brief 设置按钮图标. - \a index 需要设置图标的按钮的下标 - \a icon 所需要设置的图标 +@~english + @brief Set button icon. + \a index The index of the button that needs to be set for the icon + \a icon Icon to set */ void DDialog::setButtonIcon(int index, const QIcon &icon) { @@ -923,9 +942,10 @@ } /*! - \brief 设置对话框标题. +@~english + @brief Sets the dialog box title. - \a title 对话框标题. + \a title Dialog box title. */ void DDialog::setTitle(const QString &title) { @@ -942,9 +962,10 @@ } /*! - \brief 设定标题Label内容是否可截断换行. +@~english + @brief Specifies whether the content of the title Label can be truncated. - \a wordWrap true可换行 false不可以换行 + \a wordWrap true can wrap a line. false can't wrap a line */ void DDialog::setWordWrapTitle(bool wordWrap) { @@ -953,9 +974,10 @@ } /*! - \brief 设置对话框消息内容. +@~english + @brief Sets the dialog box message content. - \a message 对话框消息. + \a message Dialog box messages */ void DDialog::setMessage(const QString &message) { @@ -978,8 +1000,9 @@ } /*! - \brief 设置对话框图标. - \a icon 对话框图标. +@~english + @brief Set the dialog icon + \a icon Dialog icon */ void DDialog::setIcon(const QIcon &icon) { @@ -993,12 +1016,13 @@ } /*! - \brief 设置对话框图标. +@~english + @brief Set the dialog icon. \overload - 为对话框设置图标,同时可以指定一个期望的图标大小。 + Sets the icon for the dialog box and specifies a desired icon size. - \a icon 对话框图标 \a expectedSize 期望大小. + \a icon Dialog icon \a expectedSize Expected size. */ void DDialog::setIcon(const QIcon &icon, const QSize &expectedSize) { @@ -1016,9 +1040,10 @@ } /*! - \brief 设置对话框位图图标. +@~english + @brief Sets the dialog box bitmap icon. - \a iconPixmap pixmap类型图标. + \a iconPixmap icon of pixmap type. */ void DDialog::setIconPixmap(const QPixmap &iconPixmap) { @@ -1026,8 +1051,9 @@ } /*! - \brief 设置文字格式. - \a textFormat 文字格式. +@~english + @brief Formatting text. + \a textFormat Text format. */ void DDialog::setTextFormat(Qt::TextFormat textFormat) { @@ -1044,9 +1070,10 @@ } /*! - \brief 设置是否在点击按钮后关闭对话框. +@~english + @brief Sets whether to close the dialog box when the button is clicked. - 当 \a onButtonClickedClose 设置为 true 后,无论点击什么按钮,都会在点击后关闭对话框。 + When \a onButtonClickedClose is set to true, whatever button is clicked will close the dialog box when clicked. */ void DDialog::setOnButtonClickedClose(bool onButtonClickedClose) { @@ -1056,14 +1083,15 @@ } /*! - \brief 以模态框形式显示当前对话框. +@~english + @brief Displays the current dialog box as a modal. - 以 \l{QDialog#Modal Dialogs}{模态框} 形式显示当前对话框,将会阻塞直到用户关闭对话框。 + Displaying the current dialog as {QDialog#Modal Dialogs}{modal boxes} will block until the user closes the dialog box. - onButtonClickedClose()为 true 时返回当前点击按钮的Index,否则返回 结果。 - \return 返回模态对话框处理的结果. + If \a onButtonClickedClose() is true, it returns the Index of the button that is currently clicked; otherwise, it returns the result. + @return Returns the result of the modal dialog processing. - \sa QDialog::exec() + @sa QDialog::exec() */ int DDialog::exec() { @@ -1182,6 +1210,20 @@ return DAbstractDialog::eventFilter(watched, event); } +void DDialog::changeEvent(QEvent *event) +{ + Q_D(DDialog); + if (event->type() == QEvent::StyleChange) { + for (int i = 0; i < d->buttonLayout->count(); ++i) { + if (auto line = qobject_cast(d->buttonLayout->itemAt(i)->widget())) { + line->setFixedHeight(DSizeModeHelper::element(20, 30)); + } + } + d->updateSize(); + } + return DAbstractDialog::changeEvent(event); +} + DWIDGET_END_NAMESPACE #include "moc_ddialog.cpp" diff -Nru dtkwidget-5.5.48/src/widgets/ddialog.h dtkwidget-5.6.12/src/widgets/ddialog.h --- dtkwidget-5.5.48/src/widgets/ddialog.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/ddialog.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DDIALOG_H -#define DDIALOG_H - -#include - -#include - -class QAbstractButton; -class QButtonGroup; -class QLabel; -class QCloseEvent; -class QVBoxLayout; - -DWIDGET_BEGIN_NAMESPACE - -class DDialogPrivate; -class DDialog : public DAbstractDialog -{ - Q_OBJECT - - Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) - Q_PROPERTY(QString message READ message WRITE setMessage NOTIFY messageChanged) - Q_PROPERTY(QIcon icon READ icon WRITE setIcon) - Q_PROPERTY(Qt::TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged) - Q_PROPERTY(bool onButtonClickedClose READ onButtonClickedClose WRITE setOnButtonClickedClose) - Q_PROPERTY(bool closeButtonVisible READ closeButtonVisible WRITE setCloseButtonVisible) - -public: - enum ButtonType { - ButtonNormal, - ButtonWarning, - ButtonRecommend - }; - - explicit DDialog(QWidget *parent = nullptr); - explicit DDialog(const QString &title, const QString& message, QWidget *parent = 0); - - int getButtonIndexByText(const QString &text) const; - int buttonCount() const; - int contentCount() const; - QList getButtons() const; - QList getContents() const; - QAbstractButton* getButton(int index) const; - QWidget* getContent(int index) const; - QString title() const; - QString message() const; - QIcon icon() const; - D_DECL_DEPRECATED QPixmap iconPixmap() const; - Qt::TextFormat textFormat() const; - bool onButtonClickedClose() const; - - void setContentLayoutContentsMargins(const QMargins &margins); - QMargins contentLayoutContentsMargins() const; - - bool closeButtonVisible() const; - -Q_SIGNALS: - void aboutToClose(); - void closed(); - void buttonClicked(int index, const QString &text); - void titleChanged(QString title); - void messageChanged(QString massage); - void textFormatChanged(Qt::TextFormat textFormat); - void sizeChanged(QSize size); - void visibleChanged(bool visible); - -public Q_SLOTS: - int addButton(const QString &text, bool isDefault = false, ButtonType type = ButtonNormal); - int addButtons(const QStringList &text); - void insertButton(int index, const QString &text, bool isDefault = false, ButtonType type = ButtonNormal); - void insertButton(int index, QAbstractButton* button, bool isDefault = false); - void insertButtons(int index, const QStringList &text); - void removeButton(int index); - void removeButton(QAbstractButton *button); - void removeButtonByText(const QString &text); - void clearButtons(); - bool setDefaultButton(int index); - bool setDefaultButton(const QString &str); - void setDefaultButton(QAbstractButton *button); - void addContent(QWidget *widget, Qt::Alignment alignment = {}); - void insertContent(int index, QWidget *widget, Qt::Alignment alignment = {}); - void removeContent(QWidget *widget, bool isDelete = true); - void clearContents(bool isDelete = true); - void setSpacing(int spacing); - void addSpacing(int spacing); - void insertSpacing(int index, int spacing); - void clearSpacing(); - void setButtonText(int index, const QString &text); - void setButtonIcon(int index, const QIcon &icon); - void setTitle(const QString &title); - void setWordWrapTitle(bool wordWrap); - void setMessage(const QString& message); - void setWordWrapMessage(bool wordWrap); - void setIcon(const QIcon &icon); - D_DECL_DEPRECATED void setIcon(const QIcon &icon, const QSize &expectedSize); - D_DECL_DEPRECATED void setIconPixmap(const QPixmap &iconPixmap); - void setTextFormat(Qt::TextFormat textFormat); - void setOnButtonClickedClose(bool onButtonClickedClose); - void setCloseButtonVisible(bool closeButtonVisible); - - int exec() Q_DECL_OVERRIDE; - -protected: - explicit DDialog(DDialogPrivate &dd, QWidget *parent = 0); - - void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; - void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE; - void closeEvent(QCloseEvent *event) override; - void childEvent(QChildEvent *event) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *event) override; - void keyPressEvent(QKeyEvent *event) override; - bool eventFilter(QObject *watched, QEvent *event) override; - -private: - D_DECLARE_PRIVATE(DDialog) - - Q_PRIVATE_SLOT(d_func(), void _q_onButtonClicked()) -}; - -DWIDGET_END_NAMESPACE - -#endif // DDIALOG_H diff -Nru dtkwidget-5.5.48/src/widgets/DDockWidget dtkwidget-5.6.12/src/widgets/DDockWidget --- dtkwidget-5.5.48/src/widgets/DDockWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DDockWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DDoubleSpinBox dtkwidget-5.6.12/src/widgets/DDoubleSpinBox --- dtkwidget-5.5.48/src/widgets/DDoubleSpinBox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DDoubleSpinBox 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dspinbox.h" diff -Nru dtkwidget-5.5.48/src/widgets/DDrawer dtkwidget-5.6.12/src/widgets/DDrawer --- dtkwidget-5.5.48/src/widgets/DDrawer 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DDrawer 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "ddrawer.h" diff -Nru dtkwidget-5.5.48/src/widgets/ddrawer.cpp dtkwidget-5.6.12/src/widgets/ddrawer.cpp --- dtkwidget-5.5.48/src/widgets/ddrawer.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/ddrawer.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "ddrawer.h" #include "dboxwidget.h" #include "private/ddrawer_p.h" @@ -113,22 +97,21 @@ /*! \class Dtk::Widget::DDrawer \inmodule dtkwidget - \brief 一个美观的可展开的控件. - - 使用 DDrawer 类可以创建一个可展开的带有展开动画效果的控件,这个控件包含上下两部分,上面的控件为标题控件,这个控件会始终显示,下面的控件为内容控件,默认为不会显示,调用 DDrawer::setExpand 设置内容控件的可见性。使用 DDrawer::setHeader 和 DDrawer::setContent 设置分别设置标题控件和内容控件。 + \brief A beautifully developed control. + using DDrawer Class can create a controllable control with an animation effect. This control contains the upper and lower parts. The above control is the title control. This control will always show.:: SETEXPAND to set the visibility of the content control.Use DDRAWER :: SetHeader and DDRAWER :: SetContent to set the title control and content control respectively. \sa DHeaderLine */ /*! \fn void DDrawer::expandChange(bool e) - \brief 内容控件可见性发生改变的信号 - \a e 为 true 表示内容控件变为了可见,反之则反 + \brief Content control visibility signal + \a e For TRUE, the content control becomes visible, but vice versa */ /*! - \brief 获取 DDrawer::DDrawer 实例 - \a parent 作为实例的父控件 + \brief Get DDRAWER :: DDRAWER example + \a parent As the parent control part of the example */ DDrawer::DDrawer(QWidget *parent) : DDrawer(*new DDrawerPrivate(this), parent) @@ -142,9 +125,9 @@ } /*! - \brief 设置标题控件 - 标题控件会始终显示在布局里 - \a header 标题控件 + \brief Set the title control + The title control will always be displayed in the layout + \a header Title control */ void DDrawer::setHeader(QWidget *header) { @@ -163,10 +146,10 @@ } /*! - \brief 设置内容控件 - 内容控件默认是隐藏的,调用 DDrawer::setExpand 设置其可见性 - \a content 内容控件 - \a alignment 内容控件在布局中的对齐方式 + \brief Set the content control + Content control is hidden by default, call ddrawer :: setexpand settings for its visibility + \a content Content controlent control + \a alignment The alignment method of content control in the layout method of content control in the layout method of content control in the layout method of content control in the layout method of content control in the layout method of content control in the layout method of content control in the layout */ void DDrawer::setContent(QWidget *content, Qt::Alignment alignment) { @@ -187,8 +170,8 @@ } /*! - \brief 获取内容控件对象 - \return 内容控件对象 + \brief Get the content control object + \return Content control object */ QWidget *DDrawer::getContent() const { @@ -198,9 +181,9 @@ } /*! - \brief 设置标题控件的高度. + \brief Set the height of the title control. - \a height 指定的高度 + \a height Specified height */ void DDrawer::setHeaderHeight(int height) { @@ -212,9 +195,9 @@ } /*! - \brief 设置内容控件的可见性. + \brief Set the visibility of the content control. - \a value 为 true 则内容控件可见,反之则反 + \a value For TRUE, the content control can be seen, but vice versant control can be seen, but vice versa */ void DDrawer::setExpand(bool value) { @@ -240,9 +223,9 @@ } /*! - \brief 获取当前内容控件的可见性. + \brief Visible to obtain the current content control. - \return 当前内容控件的可见性 + \return Visible of the current content control */ bool DDrawer::expand() const { @@ -251,9 +234,9 @@ } /*! - \brief 设置内容控件的可见性改变时动画的时间. + \brief Set the time for the visibility of the content control when the animation time is changed. - \a duration 指定动画时间 + \a duration Specify the animation time */ void DDrawer::setAnimationDuration(int duration) { @@ -262,8 +245,8 @@ } /*! - \brief 设置内容控件的可见性改变时动画的样式. - \a curve 指定动画样式 + \brief setTheVisibilityOfTheContentControlWhenTheAnimationStyleIsChangedOfTheContentControlWhenTheAnimationStyleIsChanged + \a curve Specify animation style */ void DDrawer::setAnimationEasingCurve(QEasingCurve curve) { @@ -272,9 +255,9 @@ } /*! - \brief 设置是否允许标题控件与内容控件之间的分割线. + \brief Set the segmentation line between the title control and the content control. - \a arg 为 ture 则显示分割线,反之则反 + \a arg For ture, the segmentation line is displayed, but the instead does not display */ void DDrawer::setSeparatorVisible(bool arg) { @@ -283,9 +266,9 @@ } /*! - \brief 设置是否允许内容控件下的分割线. + \brief Set the segmentation line under the content control. - \a arg 为 ture 则显示分割线,反之则反 + \a arg For ture, the segmentation line is displayed, but the instead does not display */ void DDrawer::setExpandedSeparatorVisible(bool arg) { diff -Nru dtkwidget-5.5.48/src/widgets/DDrawerGroup dtkwidget-5.6.12/src/widgets/DDrawerGroup --- dtkwidget-5.5.48/src/widgets/DDrawerGroup 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DDrawerGroup 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "ddrawergroup.h" diff -Nru dtkwidget-5.5.48/src/widgets/ddrawergroup.cpp dtkwidget-5.6.12/src/widgets/ddrawergroup.cpp --- dtkwidget-5.5.48/src/widgets/ddrawergroup.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/ddrawergroup.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "ddrawergroup.h" #include "ddrawer.h" diff -Nru dtkwidget-5.5.48/src/widgets/ddrawergroup.h dtkwidget-5.6.12/src/widgets/ddrawergroup.h --- dtkwidget-5.5.48/src/widgets/ddrawergroup.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/ddrawergroup.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DDRAWERGROUP_H -#define DDRAWERGROUP_H - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DDrawer; -class DDrawerGroupPrivate; -class LIBDTKWIDGETSHARED_EXPORT DDrawerGroup : public QObject, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DDrawerGroup) - -public: - explicit DDrawerGroup(QObject *parent = 0); - - QList expands() const; - DDrawer * checkedExpand() const; - DDrawer * expand(int id) const; - void addExpand(DDrawer *expand, int id = -1); - void setId(DDrawer *expand, int id); - void removeExpand(DDrawer *expand); - int checkedId() const; - int id(DDrawer *expand) const; - -private: - void onExpandChanged(bool v); -}; - -DWIDGET_END_NAMESPACE - -#endif // DDRAWERGROUP_H diff -Nru dtkwidget-5.5.48/src/widgets/ddrawer.h dtkwidget-5.6.12/src/widgets/ddrawer.h --- dtkwidget-5.5.48/src/widgets/ddrawer.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/ddrawer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DDRAWER_H -#define DDRAWER_H - -#include - -DWIDGET_BEGIN_NAMESPACE -class DDrawerPrivate; -class LIBDTKWIDGETSHARED_EXPORT DDrawer : public DFrame -{ - Q_OBJECT - D_DECLARE_PRIVATE(DDrawer) - -public: - explicit DDrawer(QWidget *parent = nullptr); - ~DDrawer() override; - - void setHeader(QWidget *header); - void setContent(QWidget *content, Qt::Alignment alignment = Qt::AlignHCenter); - QWidget *getContent() const; - void setHeaderHeight(int height); - virtual void setExpand(bool value); - bool expand() const; - void setAnimationDuration(int duration); - void setAnimationEasingCurve(QEasingCurve curve); - void setSeparatorVisible(bool arg); - void setExpandedSeparatorVisible(bool arg); - -Q_SIGNALS: - void expandChange(bool e); - void sizeChanged(QSize s); - -protected: - DDrawer(DDrawerPrivate &dd, QWidget *parent = nullptr); - void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; -}; - -DWIDGET_END_NAMESPACE - -#endif // DDRAWER_H diff -Nru dtkwidget-5.5.48/src/widgets/denhancedwidget.cpp dtkwidget-5.6.12/src/widgets/denhancedwidget.cpp --- dtkwidget-5.5.48/src/widgets/denhancedwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/denhancedwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/src/widgets/denhancedwidget.h dtkwidget-5.6.12/src/widgets/denhancedwidget.h --- dtkwidget-5.5.48/src/widgets/denhancedwidget.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/denhancedwidget.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DENHANCEDWIDGET_H -#define DENHANCEDWIDGET_H - -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DEnhancedWidgetPrivate; -class DEnhancedWidget: public QObject -{ - Q_OBJECT - - Q_PROPERTY(QWidget *target READ target WRITE setTarget NOTIFY targetChanged) - Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) - -public: - explicit DEnhancedWidget(QWidget *target, QObject *parent = 0); - ~DEnhancedWidget(); - - QWidget *target() const; - bool enabled() const; - -public Q_SLOTS: - void setTarget(QWidget *target); - void setEnabled(bool enabled); - -Q_SIGNALS: - void xChanged(int x); - void yChanged(int y); - void positionChanged(const QPoint &point); - void widthChanged(int width); - void heightChanged(int height); - void sizeChanged(const QSize &size); - void targetChanged(QWidget *target); - void enabledChanged(bool enabled); - void showed(); - -protected: - bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; - -private: - explicit DEnhancedWidget(DEnhancedWidgetPrivate *dd, QWidget *w, QObject *parent = 0); - - DEnhancedWidgetPrivate *d_ptr; - - Q_DECLARE_PRIVATE(DEnhancedWidget) -}; - -DWIDGET_END_NAMESPACE - -#endif // DENHANCEDWIDGET_H diff -Nru dtkwidget-5.5.48/src/widgets/DErrorMessage dtkwidget-5.6.12/src/widgets/DErrorMessage --- dtkwidget-5.5.48/src/widgets/DErrorMessage 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DErrorMessage 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DExpandGroup dtkwidget-5.6.12/src/widgets/DExpandGroup --- dtkwidget-5.5.48/src/widgets/DExpandGroup 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DExpandGroup 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dexpandgroup.h" diff -Nru dtkwidget-5.5.48/src/widgets/dexpandgroup.cpp dtkwidget-5.6.12/src/widgets/dexpandgroup.cpp --- dtkwidget-5.5.48/src/widgets/dexpandgroup.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dexpandgroup.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dexpandgroup.h" diff -Nru dtkwidget-5.5.48/src/widgets/dexpandgroup.h dtkwidget-5.6.12/src/widgets/dexpandgroup.h --- dtkwidget-5.5.48/src/widgets/dexpandgroup.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dexpandgroup.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef EXPANDGROUP_H -#define EXPANDGROUP_H - -#include -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DDrawerGroup") DExpandGroup : public QObject -{ - Q_OBJECT -public: - explicit DExpandGroup(QObject *parent = 0); - - QList expands() const; - DBaseExpand * checkedExpand() const; - DBaseExpand * expand(int id) const; - void addExpand(DBaseExpand *expand, int id = -1); - void setId(DBaseExpand *expand, int id); - void removeExpand(DBaseExpand *expand); - int checkedId() const; - int id(DBaseExpand *expand) const; - -private: - void onExpandChanged(bool v); - -private: - QMap m_expandMap; - QMap m_checkedMap; -}; - -DWIDGET_END_NAMESPACE - -#endif // EXPANDGROUP_H diff -Nru dtkwidget-5.5.48/src/widgets/dfeaturedisplaydialog.cpp dtkwidget-5.6.12/src/widgets/dfeaturedisplaydialog.cpp --- dtkwidget-5.5.48/src/widgets/dfeaturedisplaydialog.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfeaturedisplaydialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,343 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "dfeaturedisplaydialog.h" +#include "private/dfeaturedisplaydialog_p.h" +#include "dcommandlinkbutton.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +static constexpr int DefaultTextLineWidth = 410; +static constexpr int DefaultIconWidth = 48; +static constexpr int DefaultIconHeight = 48; + +DFeatureItemWidget::DFeatureItemWidget(const QIcon &icon, const QString &name, + const QString &description, QWidget *parent) + : QWidget(parent) + , m_iconLabel(new QLabel) + , m_featureNameLabel(new QLabel(name)) + , m_featureDescriptionLabel(new QLabel(description)) +{ + m_featureDescriptionLabel->setWordWrap(true); + DFontSizeManager *fontManager = DFontSizeManager::instance(); + fontManager->bind(m_featureNameLabel, DFontSizeManager::T5, QFont::DemiBold); + fontManager->bind(m_featureDescriptionLabel, DFontSizeManager::T6, QFont::Medium); + + m_iconLabel->setFixedSize(DefaultIconWidth, DefaultIconHeight); + m_iconLabel->setPixmap(icon.pixmap(DefaultIconWidth, DefaultIconHeight)); + QHBoxLayout *hLayout = new QHBoxLayout(); + hLayout->setMargin(10); + hLayout->setSpacing(0); + hLayout->addWidget(m_iconLabel); + QVBoxLayout *vLayout = new QVBoxLayout(); + vLayout->setMargin(10); + vLayout->setSpacing(0); + vLayout->addStretch(0); + vLayout->addWidget(m_featureNameLabel, 0, Qt::AlignVCenter); + vLayout->addWidget(m_featureDescriptionLabel, 0, Qt::AlignVCenter); + vLayout->addStretch(0); + QHBoxLayout *mLayout = new QHBoxLayout(this); + mLayout->setMargin(0); + mLayout->setSpacing(0); + mLayout->addLayout(hLayout); + mLayout->addSpacing(2); + mLayout->addLayout(vLayout); + + setMinimumWidth(360); + auto fontMetrics = m_featureDescriptionLabel->fontMetrics(); + auto size = fontMetrics.size(Qt::TextShowMnemonic, description); + setFixedHeight(size.width() <= DefaultTextLineWidth ? 66 : 86); +} + +DFeatureItemWidget::~DFeatureItemWidget() +{ +} + +void DFeatureItemWidget::setDescriptionLabelWidth(const int width) +{ + m_featureDescriptionLabel->setFixedWidth(width); +} + +int DFeatureItemWidget::descriptionLabelWidth() +{ + auto fontMetrics = m_featureDescriptionLabel->fontMetrics(); + auto size = fontMetrics.size(Qt::TextShowMnemonic, m_featureDescriptionLabel->text()); + return size.width(); +} + +DFeatureItemPrivate::DFeatureItemPrivate(Core::DObject *qq, const QIcon &icon, + const QString &name, const QString &description) + : Core::DObjectPrivate(qq) + , m_icon(icon) + , m_name(name) + , m_description(description) +{ +} + +DFeatureItemPrivate::~DFeatureItemPrivate() +{ +} + +DFeatureItem::DFeatureItem(const QIcon &icon, const QString &name, + const QString &description, QObject *parent) + : QObject(parent) + , DObject(*new DFeatureItemPrivate(this, icon, name, description)) +{ +} + +DFeatureItem::~DFeatureItem() +{ +} + +QIcon DFeatureItem::icon() const +{ + Q_D(const DFeatureItem); + return d->m_icon; +} + +void DFeatureItem::setIcon(const QIcon &icon) +{ + Q_D(DFeatureItem); + d->m_icon = icon; +} + +QString DFeatureItem::name() const +{ + Q_D(const DFeatureItem); + return d->m_name; +} + +void DFeatureItem::setName(const QString &name) +{ + Q_D(DFeatureItem); + d->m_name = name; +} + +QString DFeatureItem::description() const +{ + Q_D(const DFeatureItem); + return d->m_description; +} + +void DFeatureItem::setDescription(const QString &description) +{ + Q_D(DFeatureItem); + d->m_description = description; +} + +DFeatureDisplayDialogPrivate::DFeatureDisplayDialogPrivate(DFeatureDisplayDialog *qq) + : DDialogPrivate(qq) +{ +} + +void DFeatureDisplayDialogPrivate::init() +{ + Q_Q(DFeatureDisplayDialog); + q->setMinimumSize(660, 620); + q->setMaximumHeight(720); + q->setWindowFlags(q->windowFlags() | Qt::CustomizeWindowHint); + q->addButton(QObject::tr("Continue"), true, DDialog::ButtonRecommend); + q->getButton(0)->setFixedSize(256, 36); + q->setModal(true); + + m_title = new QLabel; + DFontSizeManager *fontManager = DFontSizeManager::instance(); + fontManager->bind(m_title, DFontSizeManager::T2, QFont::DemiBold); + + QWidget *itemWidget = new QWidget; + itemWidget->setMinimumSize(360, 66); + itemWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + m_vBoxLayout = new QVBoxLayout(itemWidget); + m_vBoxLayout->setMargin(0); + m_vBoxLayout->setSpacing(12); + QScrollArea *scrollWidget = new QScrollArea; + scrollWidget->setWidget(itemWidget); + scrollWidget->setWidgetResizable(true); + scrollWidget->setMaximumHeight(490); + scrollWidget->setAutoFillBackground(false); + scrollWidget->setFrameShape(QFrame::NoFrame); + QPalette pt = scrollWidget->palette(); + pt.setBrush(QPalette::Window, Qt::transparent); + scrollWidget->setPalette(pt); + + m_linkBtn = new DCommandLinkButton(QObject::tr("Learn More") + " >"); + m_linkBtn->setVisible(false); + + QWidget *contentWidget = new QWidget; + QVBoxLayout *vContentLayout = new QVBoxLayout(contentWidget); + vContentLayout->setContentsMargins(150, 0, 150, 0); + vContentLayout->setSpacing(0); + vContentLayout->addWidget(m_title, 0, Qt::AlignCenter); + vContentLayout->addSpacing(30); + vContentLayout->addWidget(scrollWidget); + vContentLayout->addWidget(m_linkBtn); + vContentLayout->addStretch(0); + vContentLayout->setSizeConstraint(QLayout::SetFixedSize); + + q->insertContent(0, contentWidget, Qt::AlignTop | Qt::AlignHCenter); +} + +void DFeatureDisplayDialogPrivate::addFeatureItem(const QIcon &icon, const QString &name, const QString &description) +{ + m_vBoxLayout->addWidget(new DFeatureItemWidget(icon, name, description)); +} + +int DFeatureDisplayDialogPrivate::getDescriptionMaxWidth() +{ + int maxWidth = 0; + for (int i = 0; i < m_vBoxLayout->count(); ++i) { + QWidget* widget = m_vBoxLayout->itemAt(i)->widget(); + if (widget == nullptr) + continue; + DFeatureItemWidget* w = qobject_cast(widget); + if (w == nullptr) + continue; + maxWidth = maxWidth > w->descriptionLabelWidth() ? maxWidth : w->descriptionLabelWidth(); + } + return maxWidth; +} + +void DFeatureDisplayDialogPrivate::updateItemWidth() +{ + int maxWidth = getDescriptionMaxWidth(); + if (maxWidth > DefaultTextLineWidth) { + maxWidth = (maxWidth / 2 < DefaultTextLineWidth) ? DefaultTextLineWidth: qCeil(maxWidth / 2.0); + } + for (int i = 0; i < m_vBoxLayout->count(); ++i) { + QWidget* widget = m_vBoxLayout->itemAt(i)->widget(); + if (widget == nullptr) + continue; + DFeatureItemWidget* w = qobject_cast(widget); + if (w == nullptr) + continue; + w->setDescriptionLabelWidth(maxWidth); + } +} + +void DFeatureDisplayDialogPrivate::createWidgetItems() +{ + clearLayout(); + for (auto item : m_featureItems) { + if (item == nullptr) + continue; + addFeatureItem(item->icon(), item->name(), item->description()); + } +} + +void DFeatureDisplayDialogPrivate::deleteItems() +{ + for (auto item : m_featureItems) { + if (item) + item->deleteLater(); + } + m_featureItems.clear(); +} + +void DFeatureDisplayDialogPrivate::clearLayout() +{ + QLayoutItem *item; + while((item = m_vBoxLayout->takeAt(0))) { + if (item->widget()) { + delete item->widget(); + } + delete item; + } +} + +void DFeatureDisplayDialogPrivate::_q_toggleLinkBtn() +{ + DGuiApplicationHelper::openUrl(m_linkUrl); +} + +DFeatureDisplayDialog::DFeatureDisplayDialog(QWidget *parent) + : DDialog(*new DFeatureDisplayDialogPrivate(this), parent) +{ + Q_D(DFeatureDisplayDialog); + d->init(); +} + +DFeatureDisplayDialog::~DFeatureDisplayDialog() +{ + D_D(DFeatureDisplayDialog); + d->deleteItems(); +} + +void DFeatureDisplayDialog::setTitle(const QString &title) +{ + Q_D(DFeatureDisplayDialog); + d->m_title->setText(title); +} + +void DFeatureDisplayDialog::addItem(DFeatureItem *item) +{ + Q_D(DFeatureDisplayDialog); + d->m_featureItems.append(item); +} + +void DFeatureDisplayDialog::removeItem(DFeatureItem *item) +{ + Q_D(DFeatureDisplayDialog); + d->m_featureItems.removeOne(item); +} + +void DFeatureDisplayDialog::addItems(QList items) +{ + Q_D(DFeatureDisplayDialog); + for (auto item : items) { + d->m_featureItems.append(item); + } +} + +void DFeatureDisplayDialog::clearItems() +{ + Q_D(DFeatureDisplayDialog); + d->deleteItems(); +} + +void DFeatureDisplayDialog::setLinkButtonVisible(bool isVisible) +{ + Q_D(DFeatureDisplayDialog); + d->m_linkBtn->setVisible(isVisible); + if (isVisible) { + connect(d->m_linkBtn, SIGNAL(clicked()), this, SLOT(_q_toggleLinkBtn()), Qt::UniqueConnection); + } +} + +void DFeatureDisplayDialog::setLinkUrl(const QString &url) +{ + Q_D(DFeatureDisplayDialog); + d->m_linkUrl = url; +} + +void DFeatureDisplayDialog::show() +{ + Q_D(DFeatureDisplayDialog); + d->createWidgetItems(); + d->updateItemWidth(); + DDialog::show(); + if (QWidget* window = qApp->activeWindow()) { + const auto point(window->mapToGlobal(window->rect().topLeft())); + moveToCenterByRect(QRect(point.x(), point.y(), window->rect().width(), window->rect().height())); + } +} + +bool DFeatureDisplayDialog::isEmpty() const +{ + Q_D(const DFeatureDisplayDialog); + return d->m_featureItems.isEmpty(); +} + +DWIDGET_END_NAMESPACE +#include "moc_dfeaturedisplaydialog.cpp" diff -Nru dtkwidget-5.5.48/src/widgets/DFileChooserEdit dtkwidget-5.6.12/src/widgets/DFileChooserEdit --- dtkwidget-5.5.48/src/widgets/DFileChooserEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DFileChooserEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dfilechooseredit.h" diff -Nru dtkwidget-5.5.48/src/widgets/dfilechooseredit.cpp dtkwidget-5.6.12/src/widgets/dfilechooseredit.cpp --- dtkwidget-5.5.48/src/widgets/dfilechooseredit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfilechooseredit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dfilechooseredit.h" #include "private/dfilechooseredit_p.h" @@ -28,51 +15,57 @@ DWIDGET_BEGIN_NAMESPACE /*! - \class Dtk::Widget::DFileChooserEdit +@~english + @class Dtk::Widget::DFileChooserEdit \inmodule dtkwidget - \brief 带有选择文件按钮的文本编辑框. + @brief A text editing box with a button to select a file. - 本控件基本与 DLineEdit 相同,但同时在编辑框的右侧提供了一个按钮,点击按钮将会出现一个选择文件的对话框,当在对话框中选择完毕点击确定之后,选择的结果将会出现在文本编辑框中。 - 另外还提供了设置对话框出现的位置,选择文件的类型,或设置文件名过滤器的方法以定制控件的功能。 + This control is basically the same as DLineEdit, but at the same time provides a button on the right side of the edit box, click the button will appear a select file dialog box, when the selection is completed in the dialog box click OK, the selection result will appear in the text edit box. + There are also ways to customize the functionality of the control by setting where the dialog box appears, selecting the type of file, or setting a filename filter. - \sa DLineEdit QFileDialog + @sa DLineEdit QFileDialog */ /*! - \enum Dtk::Widget::DFileChooserEdit::DialogDisplayPosition - \brief 这个枚举保存了对话框可以出现的位置 +@~english + @enum Dtk::Widget::DFileChooserEdit::DialogDisplayPosition + @brief This enum holds the locations where the dialog box can appear \value FollowParentWindow - 跟随父窗口 + Following the parent window \value CurrentMonitorCenter - 鼠标所在的显示器的中心 + The center of the display where the mouse is located */ // =========================Signals begin========================= /*! - \fn void DFileChooserEdit::fileChoosed(const QString &fileName) - \brief 这个信号在文件被选择且点击了对话框的确认按钮之后被调用 - \a fileName 被选中的文件名,包含其绝对路径 +@~english + @fn void DFileChooserEdit::fileChoosed(const QString &fileName) + @brief This signal is called after the file is selected and the Confirm button of the dialog box is clicked + \a fileName The name of the selected file, including its absolute path. */ /*! - \fn void DFileChooserEdit::dialogOpened() - \brief 这个信号在对话框即将显示时被调用 - \note 注意,此时对话框并没有显示 +@~english + @fn void DFileChooserEdit::dialogOpened() + @brief This signal is called when the dialog box is about to be displayed + @note Notice that the dialog box is not displayed */ /*! - \fn void DFileChooserEdit::dialogClosed(int code) - \brief 这信号在对话框关闭时被调用,无论对话框是被点击了确认还是取消,都会调用本信号 - \a code 对话框的返回码,返回码表示了对话框是因为点击了取消还是确认而关闭的 - \sa QDialog::DialogCode +@~english + @fn void DFileChooserEdit::dialogClosed(int code) + @brief This signal is called when the dialog box is closed, whether the dialog box is clicked to confirm or cancel, this signal is called + \a code The return code of the dialog box, which indicates whether the dialog box was closed by clicking Cancel or Confirm + @sa QDialog::DialogCode */ // =========================Signals end========================= /*! - \brief 获取 DFileChooserEdit 的一个实例 - \a parent 作为实例的父控件 +@~english + @brief Gets an instance of DFileChooserEdit + \a parent As the parent control of the instance */ DFileChooserEdit::DFileChooserEdit(QWidget *parent) : DLineEdit(*new DFileChooserEditPrivate(this), parent) @@ -83,13 +76,14 @@ } /*! - \brief 这个属性保存文件选择对话框将会出现的位置 +@~english + @brief This property holds the location where the file selection dialog box will appear - 可选值为枚举 DFileChooserEdit::DialogDisplayPosition 中的值 + Optional values for the enumeration DFileChooserEdit: : DialogDisplayPosition of values Getter: DFileChooserEdit::dialogDisplayPosition , Setter: DFileChooserEdit::setDialogDisplayPosition - \sa DFileChooserEdit::DialogDisplayPosition + @sa DFileChooserEdit::DialogDisplayPosition */ DFileChooserEdit::DialogDisplayPosition DFileChooserEdit::dialogDisplayPosition() const { @@ -99,11 +93,12 @@ } /*! - \brief 设置对话框显示位置. +@~english + @brief Set the position of the dialog box display. - \a dialogDisplayPosition 对话框的显示位置. + \a dialogDisplayPosition The position of the dialog box to display. - \sa DFileChooserEdit::dialogDisplayPosition + @sa DFileChooserEdit::dialogDisplayPosition */ void DFileChooserEdit::setDialogDisplayPosition(DFileChooserEdit::DialogDisplayPosition dialogDisplayPosition) { @@ -140,9 +135,10 @@ } /*! - \brief 设置文件选择模式 - \a mode 要使用的模式 - \sa DFileChooserEdit::fileMode +@~english + @brief Set the file selection mode + \a mode Pattern to use + @sa DFileChooserEdit::fileMode */ void DFileChooserEdit::setFileMode(QFileDialog::FileMode mode) { @@ -155,12 +151,15 @@ } /*! - \brief 获取对话框选择文件模式 +@~english + @brief Get dialog box to select file mode - 有多种类型的选择模式,也就是说对话框可以有多种显示或行为,例如选择单个文件,选择多个文件亦或选择一个目录等,详细可以查阅:QFileDialog::FileMode - \return 返回但前的选择模式 - \sa QFileDialog::FileMode - \note 目前本控件只支持选择单个文件,即便调用 DFileChooserEdit::setFileMode 设置了选择模式,当有多个文件在对话框中被选中时,取其第一个作为选择结果 + There are multiple selection modes, which means that the dialog box can have multiple displays or behaviors, + such as selecting a single file, selecting multiple files, or selecting a directory, etc. See QFileDialog::FileMode for details + @return Returns the current selection mode + @sa QFileDialog::FileMode + @note Currently only support this control to choose a single file, even call DFileChooserEdit: : setFileMode set selection mode, + when there are multiple files in the dialog box is selected, take its first as a choice */ QFileDialog::FileMode DFileChooserEdit::fileMode() const { @@ -173,9 +172,10 @@ } /*! - \brief 设置文件名过滤器 - \a filters 要使用的文件名过滤器组成的列表 - \sa DFileChooserEdit::nameFilters +@~english + @brief Set the filename filter + \a filters A list of filename filters to use + @sa DFileChooserEdit::nameFilters */ void DFileChooserEdit::setNameFilters(const QStringList &filters) { @@ -188,14 +188,17 @@ } /*! - \brief 文件名过滤器 +@~english + @brief Filename filter - 默认此选项为空,即所有文件都可以被选择,当文件名过滤器被设置后,则只有文件名与过滤器匹配的文件可以被选择, - 例如:设置了"*.txt",则表示只有后缀名为"txt"的文件可以被选择, - 或者同时设置了多个过滤器:QStringList() << "text file (*.txt)" << "picture file (*.png); - 则会在文件选择对话框的下方出现设置的多个过滤选项,只是需要注意,一次只能使用一个过滤选项,也就是说不能同时即允许选择txt文件又允许选择png文件 - \return 返回当前的文件名过滤器组成的列表 - \sa DFileChooserEdit::setNameFilters + By default, all files are selected.When the filename filter is set, + only files with a filename matching the filename filter can be selected. + For example, if "*.txt" is set, only files with the suffix "txt" can be selected, + or if multiple filters are set: QStringList() << "text file (*.txt)" << "picture file (*.png); + You will see a list of options at the bottom of the file selection dialog, + but note that only one option can be used at a time, which means you can't select both txt and png files at the same time + @return Returns a list of the current filename filters + @sa DFileChooserEdit::setNameFilters */ QStringList DFileChooserEdit::nameFilters() const { @@ -241,7 +244,13 @@ DSuggestButton *btn = new DSuggestButton(nullptr); btn->setAccessibleName("DFileChooserEditSuggestButton"); btn->setIcon(DStyleHelper(q->style()).standardIcon(DStyle::SP_SelectElement, nullptr)); - btn->setIconSize(QSize(24, 24)); + + btn->setFixedWidth(defaultButtonWidth()); + btn->setIconSize(defaultIconSize()); + QObject::connect(DGUI_NAMESPACE::DGuiApplicationHelper::instance(), &DGUI_NAMESPACE::DGuiApplicationHelper::sizeModeChanged, btn, [btn]() { + btn->setFixedWidth(defaultButtonWidth()); + btn->setIconSize(defaultIconSize()); + }); q->setDialogDisplayPosition(DFileChooserEdit::DialogDisplayPosition::CurrentMonitorCenter); diff -Nru dtkwidget-5.5.48/src/widgets/dfilechooseredit.h dtkwidget-5.6.12/src/widgets/dfilechooseredit.h --- dtkwidget-5.5.48/src/widgets/dfilechooseredit.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfilechooseredit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DFILECHOOSEREDIT_H -#define DFILECHOOSEREDIT_H - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DFileChooserEditPrivate; -class LIBDTKWIDGETSHARED_EXPORT DFileChooserEdit : public DLineEdit -{ - Q_OBJECT - - Q_ENUMS(DialogDisplayPosition) - -public: - enum DialogDisplayPosition { - FollowParentWindow, - CurrentMonitorCenter - }; - - DFileChooserEdit(QWidget *parent = nullptr); - - void setFileMode(QFileDialog::FileMode mode); - QFileDialog::FileMode fileMode() const; - - void setNameFilters(const QStringList &filters); - QStringList nameFilters() const; - - void setDirectoryUrl(const QUrl &directory); - QUrl directoryUrl(); - - void setDialogDisplayPosition(DialogDisplayPosition dialogDisplayPosition); - DFileChooserEdit::DialogDisplayPosition dialogDisplayPosition() const; - - void setFileDialog(QFileDialog *fileDialog); - QFileDialog *fileDialog() const; - - void initDialog(); - -Q_SIGNALS: - void fileChoosed(const QString &fileName); - void dialogOpened(); - void dialogClosed(int code); - -protected: - Q_DISABLE_COPY(DFileChooserEdit) - D_DECLARE_PRIVATE(DFileChooserEdit) - Q_PRIVATE_SLOT(d_func(), void _q_showFileChooserDialog()) -}; - -DWIDGET_END_NAMESPACE - -#endif // DFILECHOOSEREDIT_H diff -Nru dtkwidget-5.5.48/src/widgets/DFileDialog dtkwidget-5.6.12/src/widgets/DFileDialog --- dtkwidget-5.5.48/src/widgets/DFileDialog 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DFileDialog 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dfiledialog.h" diff -Nru dtkwidget-5.5.48/src/widgets/dfiledialog.cpp dtkwidget-5.6.12/src/widgets/dfiledialog.cpp --- dtkwidget-5.5.48/src/widgets/dfiledialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfiledialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dfiledialog.h" #include @@ -13,19 +17,16 @@ DWIDGET_BEGIN_NAMESPACE /*! - \class Dtk::Widget::DFileDialog - \inmodule dtkwidget - - \brief The DFileDialog class provides a dialog that allow users to select files or directories. - \brief DFileDialog 类提供了一个可供用户选择文件或目录的对话框. +@~english +@class Dtk::Widget::DFileDialog - You can also add extra ComboBox and LineEdit widget via addComboBox() and addLineEdit() to allowed - user fill more field when needed. Values of these extra fields can be accessed via getComboBoxValue() and - getLineEditValue() . - 你也可以通过 addComboBox() 和 addLineEdit() 来为文件选择框增加额外的输入内容控件,并通过 getComboBoxValue() - 和 getLineEditValue() 来得到用户所输入的值。 + @brief The DFileDialog class provides a dialog that allow users to select + files or directories. + You can also add extra ComboBox and LineEdit widget via addComboBox() and + addLineEdit() to allowed user fill more field when needed. Values of these + extra fields can be accessed via getComboBoxValue() and getLineEditValue() . - \image html DFileDialog.png +@image html DFileDialog.png */ DFileDialog::DFileDialog(QWidget *parent, Qt::WindowFlags f) @@ -42,14 +43,10 @@ } /*! - \brief Add an extra ComboBox widget to the DFileDialog - \brief 为文件选择框追加一个下拉单选框 - - \a text ComboBox description text (as key for getting value). - \a data ComboBox options in a string list - - \a text 追加选项的描述文字(作为键) - \a data 多选框的选项列表 +@~english + @brief Add an extra ComboBox widget to the DFileDialog + text ComboBox description text (as key for getting value). + data ComboBox options in a string list */ void DFileDialog::addComboBox(const QString &text, const QStringList &data) { @@ -62,14 +59,10 @@ } /*! - \brief Add an extra ComboBox widget to the DFileDialog - \brief 为文件选择框追加一个下拉单选框 - - \a text ComboBox description text (as key for getting value). - \a options ComboBox data - - \a text 追加选项的描述文字(作为键) - \a options 多选框的属性信息 +@~english + @brief Add an extra ComboBox widget to the DFileDialog + text ComboBox description text (as key for getting value). + options ComboBox data */ void DFileDialog::addComboBox(const QString &text, const DFileDialog::DComboBoxOptions &options) { @@ -87,11 +80,9 @@ } /*! - \brief Add an extra LineEdit widget to the DFileDialog - \brief 为文件选择框追加一个输入框 - - \a text LineEdit description text (as key for getting value). - \a text 追加选项的描述文字(作为键) +@~english + @brief Add an extra LineEdit widget to the DFileDialog + text LineEdit description text (as key for getting value). */ void DFileDialog::addLineEdit(const QString &text) { @@ -101,14 +92,10 @@ } /*! - \brief Add an extra LineEdit widget to the DFileDialog - \brief 为文件选择框追加一个输入框 - - \a text LineEdit description text (as key for getting value). - \a options LineEdit data - - \a text 追加选项的描述文字(作为键) - \a options 输入框的属性信息 +@~english + @brief Add an extra LineEdit widget to the DFileDialog + text LineEdit description text (as key for getting value). + options LineEdit data */ void DFileDialog::addLineEdit(const QString &text, const DFileDialog::DLineEditOptions &options) { @@ -128,14 +115,13 @@ } /*! - \brief Allow mixed selection - +@~english + @brief Allow mixed selection + @details Allow user choose files and folders at the same time when selecting multiple files. By default user can only select files (folder not included) when selecting multiple files. - Notice that this option only works when file mode is QFileDialog::ExistingFiles - - \a on enable this feature or not. + on enable this feature or not. */ void DFileDialog::setAllowMixedSelection(bool on) { @@ -143,13 +129,10 @@ } /*! - \brief Get the added extra ComboBox value - \brief 获得所追加的额外多选框的值 - - \a text The description (key) of the ComboBox. - \a text 所追加的多选框的描述名(作为键) - - \sa addComboBox() +@~english + @brief Get the added extra ComboBox value + text The description (key) of the ComboBox. + @sa addComboBox() */ QString DFileDialog::getComboBoxValue(const QString &text) const { @@ -157,13 +140,10 @@ } /*! - \brief Get the added extra LineEdit value - \brief 获得所追加的额外输入框的值 - - \a text The description (key) of the ComboBox. - \a text 所追加的多选框的描述名(作为键) - - \sa addLineEdit() +@~english + @brief Get the added extra LineEdit value + text The description (key) of the ComboBox. + @sa addLineEdit() */ QString DFileDialog::getLineEditValue(const QString &text) const { @@ -185,6 +165,3 @@ } DWIDGET_END_NAMESPACE - - - diff -Nru dtkwidget-5.5.48/src/widgets/dfiledialog.h dtkwidget-5.6.12/src/widgets/dfiledialog.h --- dtkwidget-5.5.48/src/widgets/dfiledialog.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfiledialog.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -#ifndef DFILEDIALOG_H -#define DFILEDIALOG_H - -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DFileDialog : public QFileDialog -{ - Q_OBJECT - -public: - DFileDialog(QWidget *parent, Qt::WindowFlags f); - explicit DFileDialog(QWidget *parent = Q_NULLPTR, - const QString &caption = QString(), - const QString &directory = QString(), - const QString &filter = QString()); - - struct DComboBoxOptions { - bool editable; - QStringList data; - QString defaultValue; - }; - - struct DLineEditOptions { - int maxLength; - QLineEdit::EchoMode echoMode; - QString defaultValue; - QString inputMask; - QString placeholderText; - }; - - void addComboBox(const QString &text, const QStringList &data); - void addComboBox(const QString &text, const DComboBoxOptions &options); - void addLineEdit(const QString &text); - void addLineEdit(const QString &text, const DLineEditOptions &options); - void setAllowMixedSelection(bool on); - - QString getComboBoxValue(const QString &text) const; - QString getLineEditValue(const QString &text) const; - - void setVisible(bool visible) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DFILEDIALOG_H diff -Nru dtkwidget-5.5.48/src/widgets/DFloatingButton dtkwidget-5.6.12/src/widgets/DFloatingButton --- dtkwidget-5.5.48/src/widgets/DFloatingButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DFloatingButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dfloatingbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dfloatingbutton.cpp dtkwidget-5.6.12/src/widgets/dfloatingbutton.cpp --- dtkwidget-5.5.48/src/widgets/dfloatingbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfloatingbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dfloatingbutton.h" #include "dstyleoption.h" #include "dobject_p.h" @@ -28,8 +12,9 @@ DWIDGET_BEGIN_NAMESPACE /*! - \brief DFloatingButton::DFloatingButton 用于定制化的button,根据传入的图标参数具体调整 - \a parent +@~english + @brief DFloatingButton::DFloatingButton 用于定制化的button,根据传入的图标参数具体调整 + @a parent */ DFloatingButton::DFloatingButton(QWidget *parent) : DIconButton(parent) @@ -65,6 +50,12 @@ setText(text); } +DFloatingButton::DFloatingButton(const DDciIcon &icon, const QString &text, QWidget *parent) + : DFloatingButton(text, parent) +{ + setIcon(icon); +} + DStyleOptionButton DFloatingButton::baseStyleOption() const { DStyleOptionButton opt; @@ -76,7 +67,6 @@ void DFloatingButton::initStyleOption(DStyleOptionButton *option) const { DIconButton::initStyleOption(option); - option->features = QStyleOptionButton::ButtonFeature(DStyleOptionButton::FloatingButton); } DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/dfloatingbutton.h dtkwidget-5.6.12/src/widgets/dfloatingbutton.h --- dtkwidget-5.5.48/src/widgets/dfloatingbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfloatingbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DFLOATINGBUTTON_H -#define DFLOATINGBUTTON_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DFloatingButton : public DIconButton -{ - Q_OBJECT - -public: - explicit DFloatingButton(QWidget *parent = nullptr); - explicit DFloatingButton(QStyle::StandardPixmap iconType = static_cast(-1), QWidget *parent = nullptr); - explicit DFloatingButton(DStyle::StandardPixmap iconType = static_cast(-1), QWidget *parent = nullptr); - explicit DFloatingButton(const QString &text, QWidget *parent = nullptr); - DFloatingButton(const QIcon& icon, const QString &text = QString(), QWidget *parent = nullptr); - -protected: - DStyleOptionButton baseStyleOption() const override; - void initStyleOption(DStyleOptionButton *option) const override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DFLOATINGBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/DFloatingMessage dtkwidget-5.6.12/src/widgets/DFloatingMessage --- dtkwidget-5.5.48/src/widgets/DFloatingMessage 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DFloatingMessage 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dfloatingmessage.h" diff -Nru dtkwidget-5.5.48/src/widgets/dfloatingmessage.cpp dtkwidget-5.6.12/src/widgets/dfloatingmessage.cpp --- dtkwidget-5.5.48/src/widgets/dfloatingmessage.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfloatingmessage.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,27 +1,11 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zhangwengeng - * - * Maintainer: zhangwengeng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dfloatingmessage.h" #include "private/dfloatingmessage_p.h" #include "ddialogclosebutton.h" +#include "dsizemode.h" #include #include @@ -67,7 +51,7 @@ iconButton->setFocusPolicy(Qt::NoFocus); iconButton->setAttribute(Qt::WA_TransparentForMouseEvents); iconButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - iconButton->setIconSize(QSize(30, 30)); + iconButton->setIconSize(DSizeModeHelper::element(QSize(20, 20), QSize(30, 30))); hBoxLayout->addWidget(iconButton); hBoxLayout->addWidget(labMessage); @@ -81,7 +65,7 @@ content = nullptr; closeButton = new DDialogCloseButton(q); // FIX bug-20506 close button too small - closeButton->setIconSize(QSize(32, 32)); + closeButton->setIconSize(DSizeModeHelper::element(QSize(20, 20), QSize(32, 32))); hBoxLayout->addWidget(closeButton); q->connect(closeButton, &DIconButton::clicked, q, &DFloatingMessage::closeButtonClicked); @@ -152,6 +136,12 @@ d->iconButton->setIcon(ico); } +void DFloatingMessage::setIcon(const DDciIcon &icon) +{ + D_D(DFloatingMessage); + d->iconButton->setIcon(icon); +} + /*! \brief 设置显示的文本消息(文字) \a str 消息文本的具体文字内容 @@ -217,5 +207,16 @@ DFloatingWidget::showEvent(event); } +void DFloatingMessage::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::StyleChange) { + D_D(DFloatingMessage); + d->iconButton->setIconSize(DSizeModeHelper::element(QSize(20, 20), QSize(30, 30))); + if (d->closeButton) + d->closeButton->setIconSize(DSizeModeHelper::element(QSize(20, 20), QSize(32, 32))); + } + return DFloatingWidget::changeEvent(event); +} + DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/dfloatingmessage.h dtkwidget-5.6.12/src/widgets/dfloatingmessage.h --- dtkwidget-5.5.48/src/widgets/dfloatingmessage.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfloatingmessage.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zhangwengeng - * - * Maintainer: zhangwengeng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DFLOATINGMESSAGE_H -#define DFLOATINGMESSAGE_H - -#include -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DFloatingMessagePrivate; -class DFloatingMessage : public DFloatingWidget -{ - Q_OBJECT - D_DECLARE_PRIVATE(DFloatingMessage) - -public: - enum MessageType { - TransientType, //临时的消息, - ResidentType //常驻的消息 - }; - - explicit DFloatingMessage(MessageType notifyType = MessageType::TransientType, QWidget *parent = nullptr); - MessageType messageType() const; - - void setIcon(const QIcon &ico); - void setMessage(const QString &str); - void setWidget(QWidget *w); - void setDuration(int msec); - - virtual QSize sizeHint() const override; - -Q_SIGNALS: - void closeButtonClicked(); - -protected: - using DFloatingWidget::setWidget; - -private: - void showEvent(QShowEvent *event) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DFLOATINGMESSAGE_H diff -Nru dtkwidget-5.5.48/src/widgets/DFloatingWidget dtkwidget-5.6.12/src/widgets/DFloatingWidget --- dtkwidget-5.5.48/src/widgets/DFloatingWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DFloatingWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dfloatingwidget.h" diff -Nru dtkwidget-5.5.48/src/widgets/dfloatingwidget.cpp dtkwidget-5.6.12/src/widgets/dfloatingwidget.cpp --- dtkwidget-5.5.48/src/widgets/dfloatingwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfloatingwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zhangwengeng - * - * Maintainer: zhangwengeng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dfloatingwidget.h" #include "private/dfloatingwidget_p.h" diff -Nru dtkwidget-5.5.48/src/widgets/dfloatingwidget.h dtkwidget-5.6.12/src/widgets/dfloatingwidget.h --- dtkwidget-5.5.48/src/widgets/dfloatingwidget.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfloatingwidget.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zhangwengeng - * - * Maintainer: zhangwengeng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DFLOATINGWIDGET_H -#define DFLOATINGWIDGET_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DStyleOptionFloatingWidget; -class DBlurEffectWidget; -class DFloatingWidgetPrivate; -class DFloatingWidget : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DFloatingWidget) - Q_PROPERTY(bool blurBackgroundEnabled READ blurBackgroundIsEnabled WRITE setBlurBackgroundEnabled) - -public: - explicit DFloatingWidget(QWidget *parent = nullptr); - - virtual QSize sizeHint() const override; - void setWidget(QWidget *widget); - void setFramRadius(int radius); - -protected: - DFloatingWidget(DFloatingWidgetPrivate &dd, QWidget *parent); - - void paintEvent(QPaintEvent* e) override; - bool event(QEvent *event) override; - - using QWidget::setContentsMargins; - using QWidget::setAutoFillBackground; - -public: - virtual void initStyleOption(DStyleOptionFloatingWidget *option) const; - bool blurBackgroundIsEnabled() const; - DBlurEffectWidget *blurBackground() const; - -public Q_SLOTS: - void setBlurBackgroundEnabled(bool blurBackgroundEnabled); -}; - -DWIDGET_END_NAMESPACE - -#endif // DFLOATINGWIDGET_H diff -Nru dtkwidget-5.5.48/src/widgets/dflowlayout.cpp dtkwidget-5.6.12/src/widgets/dflowlayout.cpp --- dtkwidget-5.5.48/src/widgets/dflowlayout.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dflowlayout.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include @@ -58,13 +45,15 @@ if(q->parentWidget()->layoutDirection() == Qt::RightToLeft) { for (QLayoutItem *item : itemList) { - int nextX = x - item->sizeHint().width() - horizontalSpacing; + if (item->isEmpty()) + continue; + // QRect's x2 = x1 + width - 1 + int nextX = x - item->sizeHint().width() - horizontalSpacing + 1; if (nextX + horizontalSpacing < effectiveRect.x() && lineHeight > 0) { - maxWidth = qMax(effectiveRect.right() - x, maxWidth); x = effectiveRect.right(); y = y + lineHeight + verticalSpacing; - nextX = x - item->sizeHint().width() - horizontalSpacing; + nextX = x - item->sizeHint().width() - horizontalSpacing + 1; lineHeight = 0; } @@ -77,19 +66,23 @@ } x = nextX; + // QRect's width = x2 - x1 + 1 + maxWidth = qMax(effectiveRect.right() - nextX - horizontalSpacing + 1, maxWidth); lineHeight = qMax(lineHeight, item->sizeHint().height()); } size_hint = QSize(maxWidth, y + lineHeight - rect.y() + bottom); } else { for (QLayoutItem *item : itemList) { - int nextX = x + item->sizeHint().width() + horizontalSpacing; + if (item->isEmpty()) + continue; + // QRect's x2 = x1 + width - 1 + int nextX = x + item->sizeHint().width() + horizontalSpacing - 1; if (nextX - horizontalSpacing > effectiveRect.right() && lineHeight > 0) { - maxWidth = qMax(x, maxWidth); x = effectiveRect.x(); y = y + lineHeight + verticalSpacing; - nextX = x + item->sizeHint().width() + horizontalSpacing; + nextX = x + item->sizeHint().width() + horizontalSpacing - 1; lineHeight = 0; } @@ -97,6 +90,8 @@ item->setGeometry(QRect(QPoint(x, y), item->sizeHint())); x = nextX; + // QRect's width = x2 - x1 + 1 + maxWidth = qMax(nextX - effectiveRect.x() - horizontalSpacing + 1, maxWidth); lineHeight = qMax(lineHeight, item->sizeHint().height()); } @@ -108,13 +103,15 @@ if(q->parentWidget()->layoutDirection() == Qt::RightToLeft) { for (QLayoutItem *item : itemList) { - int nextY = y + item->sizeHint().height() + verticalSpacing; + if (item->isEmpty()) + continue; + // QRect's y2 = y1 + height - 1 + int nextY = y + item->sizeHint().height() + verticalSpacing - 1; if(nextY - verticalSpacing > effectiveRect.bottom() && lineWidth > 0) { - maxHeight = qMax(y, maxHeight); y = effectiveRect.y(); x = x - lineWidth - horizontalSpacing; - nextY = y + item->sizeHint().height() + verticalSpacing; + nextY = y + item->sizeHint().height() + verticalSpacing - 1; lineWidth = 0; } @@ -122,19 +119,23 @@ item->setGeometry(QRect(QPoint(x - item->sizeHint().width(), y), item->sizeHint())); y = nextY; + // height = y2 - y1 + 1 + maxHeight = qMax(nextY - effectiveRect.y() - verticalSpacing + 1, maxHeight); lineWidth = qMax(lineWidth, item->sizeHint().width()); } size_hint = QSize(rect.right() - x + lineWidth + right + 1, maxHeight); } else { for (QLayoutItem *item : itemList) { - int nextY = y + item->sizeHint().height() + verticalSpacing; + if (item->isEmpty()) + continue; + // QRect's x2 = x1 + width - 1 + int nextY = y + item->sizeHint().height() + verticalSpacing - 1; if(nextY - verticalSpacing > effectiveRect.bottom() && lineWidth > 0) { - maxHeight = qMax(y, maxHeight); y = effectiveRect.y(); x = x + lineWidth + horizontalSpacing; - nextY = y + item->sizeHint().height() + verticalSpacing; + nextY = y + item->sizeHint().height() + verticalSpacing - 1; lineWidth = 0; } @@ -142,6 +143,8 @@ item->setGeometry(QRect(QPoint(x, y), item->sizeHint())); y = nextY; + // height = y2 - y1 + 1 + maxHeight = qMax(nextY - effectiveRect.y() - verticalSpacing + 1, maxHeight); lineWidth = qMax(lineWidth, item->sizeHint().width()); } @@ -473,7 +476,13 @@ Qt::Orientations DFlowLayout::expandingDirections() const { - return Qt::Vertical; + switch (d_func()->flow) { + case DFlowLayout::Flow::LeftToRight: + return Qt::Horizontal; + case DFlowLayout::Flow::TopToBottom: + return Qt::Vertical; + } + return QLayout::expandingDirections(); } /*! diff -Nru dtkwidget-5.5.48/src/widgets/dflowlayout.h dtkwidget-5.6.12/src/widgets/dflowlayout.h --- dtkwidget-5.5.48/src/widgets/dflowlayout.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dflowlayout.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DFLOWLAYOUT_H -#define DFLOWLAYOUT_H - -#include - -#include - -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DFlowLayoutPrivate; -class DFlowLayout : public QLayout, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(int horizontalSpacing READ horizontalSpacing WRITE setHorizontalSpacing NOTIFY horizontalSpacingChanged) - Q_PROPERTY(int verticalSpacing READ verticalSpacing WRITE setVerticalSpacing NOTIFY verticalSpacingChanged) - Q_PROPERTY(int count READ count NOTIFY countChanged) - Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged) - Q_PROPERTY(QSize sizeHint READ sizeHint NOTIFY sizeHintChanged) - -public: - typedef QListView::Flow Flow; - Q_ENUMS(Flow) - - explicit DFlowLayout(QWidget *parent); - DFlowLayout(); - ~DFlowLayout(); - - void insertItem(int index, QLayoutItem *item); - void insertWidget(int index, QWidget *widget); - void insertLayout(int index, QLayout *layout); - void insertSpacing(int index, int size); - void insertStretch(int index, int stretch = 0); - void insertSpacerItem(int index, QSpacerItem *spacerItem); - - void addSpacing(int size); - void addStretch(int stretch = 0); - void addSpacerItem(QSpacerItem *spacerItem); - void addItem(QLayoutItem *item) Q_DECL_OVERRIDE; - bool hasHeightForWidth() const Q_DECL_OVERRIDE; - int heightForWidth(int) const Q_DECL_OVERRIDE; - int count() const Q_DECL_OVERRIDE; - QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE; - QSize minimumSize() const Q_DECL_OVERRIDE; - void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; - QSize sizeHint() const Q_DECL_OVERRIDE; - QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE; - Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE; - - int horizontalSpacing() const; - int verticalSpacing() const; - Flow flow() const; - -public Q_SLOTS: - void setHorizontalSpacing(int horizontalSpacing); - void setVerticalSpacing(int verticalSpacing); - void setSpacing(int spacing); - void setFlow(Flow flow); - -Q_SIGNALS: - void horizontalSpacingChanged(int horizontalSpacing); - void verticalSpacingChanged(int verticalSpacing); - void countChanged(int count); - void flowChanged(Flow flow); - void sizeHintChanged(QSize sizeHint) const; - -private: - D_DECLARE_PRIVATE(DFlowLayout) -}; - -DWIDGET_END_NAMESPACE - -#endif // DFLOWLAYOUT_H diff -Nru dtkwidget-5.5.48/src/widgets/DFocusFrame dtkwidget-5.6.12/src/widgets/DFocusFrame --- dtkwidget-5.5.48/src/widgets/DFocusFrame 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DFocusFrame 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DFontComboBox dtkwidget-5.6.12/src/widgets/DFontComboBox --- dtkwidget-5.5.48/src/widgets/DFontComboBox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DFontComboBox 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dfontcombobox.h" diff -Nru dtkwidget-5.5.48/src/widgets/dfontcombobox.cpp dtkwidget-5.6.12/src/widgets/dfontcombobox.cpp --- dtkwidget-5.5.48/src/widgets/dfontcombobox.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfontcombobox.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dfontcombobox.h" diff -Nru dtkwidget-5.5.48/src/widgets/dfontcombobox.h dtkwidget-5.6.12/src/widgets/dfontcombobox.h --- dtkwidget-5.5.48/src/widgets/dfontcombobox.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dfontcombobox.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ -#ifndef DFONTCOMBOBOX_H -#define DFONTCOMBOBOX_H - -#include -#include -#include - -QT_REQUIRE_CONFIG(fontcombobox); - -DWIDGET_BEGIN_NAMESPACE - -class DFontComboBoxPrivate; -class LIBDTKWIDGETSHARED_EXPORT DFontComboBox : public DComboBox -{ - Q_OBJECT - Q_PROPERTY(QFontDatabase::WritingSystem writingSystem READ writingSystem WRITE setWritingSystem) - Q_PROPERTY(QFontComboBox::FontFilters fontFilters READ fontFilters WRITE setFontFilters) - Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged) - -public: - explicit DFontComboBox(QWidget *parent = nullptr); - virtual ~DFontComboBox() override; - - void setWritingSystem(QFontDatabase::WritingSystem); - QFontDatabase::WritingSystem writingSystem() const; - - void setFontFilters(QFontComboBox::FontFilters filters); - QFontComboBox::FontFilters fontFilters() const; - - QFont currentFont() const; - virtual QSize sizeHint() const override; - -public Q_SLOTS: - void setCurrentFont(const QFont &f); - -Q_SIGNALS: - void currentFontChanged(const QFont &f); - -protected: - virtual bool event(QEvent *e) override; - -private: - Q_DISABLE_COPY(DFontComboBox) - D_DECLARE_PRIVATE(DFontComboBox) -}; - -DWIDGET_END_NAMESPACE - -#endif // DFONTCOMBOBOX_H diff -Nru dtkwidget-5.5.48/src/widgets/DFontDialog dtkwidget-5.6.12/src/widgets/DFontDialog --- dtkwidget-5.5.48/src/widgets/DFontDialog 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DFontDialog 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DFontSizeManager dtkwidget-5.6.12/src/widgets/DFontSizeManager --- dtkwidget-5.5.48/src/widgets/DFontSizeManager 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DFontSizeManager 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/src/widgets/DFrame dtkwidget-5.6.12/src/widgets/DFrame --- dtkwidget-5.5.48/src/widgets/DFrame 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DFrame 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dframe.h" diff -Nru dtkwidget-5.5.48/src/widgets/dframe.cpp dtkwidget-5.6.12/src/widgets/dframe.cpp --- dtkwidget-5.5.48/src/widgets/dframe.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dframe.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dframe.h" #include "dpalettehelper.h" #include "private/dframe_p.h" diff -Nru dtkwidget-5.5.48/src/widgets/dframe.h dtkwidget-5.6.12/src/widgets/dframe.h --- dtkwidget-5.5.48/src/widgets/dframe.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dframe.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DFRAME_H -#define DFRAME_H - -#include -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DFramePrivate; -class DFrame : public QFrame, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DFrame) - -public: - explicit DFrame(QWidget *parent = nullptr); - - void setFrameRounded(bool on); - void setBackgroundRole(DGUI_NAMESPACE::DPalette::ColorType type); - using QFrame::setBackgroundRole; - -protected: - DFrame(DFramePrivate &dd, QWidget *parent = nullptr); - - void paintEvent(QPaintEvent *event) override; -}; - -class DHorizontalLine : public QFrame -{ - Q_OBJECT -public: - explicit DHorizontalLine(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()) - : QFrame(parent, f) - { - setFrameShape(HLine); - } -}; - -class DVerticalLine : public QFrame -{ - Q_OBJECT -public: - explicit DVerticalLine(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()) - : QFrame(parent, f) - { - setFrameShape(VLine); - } -}; - -DWIDGET_END_NAMESPACE - -#endif // DFRAME_H diff -Nru dtkwidget-5.5.48/src/widgets/DGraphicsClipEffect dtkwidget-5.6.12/src/widgets/DGraphicsClipEffect --- dtkwidget-5.5.48/src/widgets/DGraphicsClipEffect 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DGraphicsClipEffect 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dgraphicsclipeffect.h" diff -Nru dtkwidget-5.5.48/src/widgets/dgraphicsclipeffect.cpp dtkwidget-5.6.12/src/widgets/dgraphicsclipeffect.cpp --- dtkwidget-5.5.48/src/widgets/dgraphicsclipeffect.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dgraphicsclipeffect.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dgraphicsclipeffect.h" #include diff -Nru dtkwidget-5.5.48/src/widgets/dgraphicsclipeffect.h dtkwidget-5.6.12/src/widgets/dgraphicsclipeffect.h --- dtkwidget-5.5.48/src/widgets/dgraphicsclipeffect.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dgraphicsclipeffect.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DGRAPHICSCLIPEFFECT_H -#define DGRAPHICSCLIPEFFECT_H - -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DGraphicsClipEffectPrivate; -class DGraphicsClipEffect : public QGraphicsEffect, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(QMargins margins READ margins WRITE setMargins NOTIFY marginsChanged) - Q_PROPERTY(QPainterPath clipPath READ clipPath WRITE setClipPath NOTIFY clipPathChanged) - -public: - explicit DGraphicsClipEffect(QObject *parent = Q_NULLPTR); - - QMargins margins() const; - QPainterPath clipPath() const; - -public Q_SLOTS: - void setMargins(const QMargins &margins); - void setClipPath(const QPainterPath &clipPath); - -Q_SIGNALS: - void marginsChanged(QMargins margins); - void clipPathChanged(QPainterPath clipPath); - -protected: - void draw(QPainter *painter) Q_DECL_OVERRIDE; - -private: - D_DECLARE_PRIVATE(DGraphicsClipEffect) -}; - -DWIDGET_END_NAMESPACE - -#endif // DGRAPHICSCLIPEFFECT_H diff -Nru dtkwidget-5.5.48/src/widgets/DGraphicsDropShadowEffect dtkwidget-5.6.12/src/widgets/DGraphicsDropShadowEffect --- dtkwidget-5.5.48/src/widgets/DGraphicsDropShadowEffect 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DGraphicsDropShadowEffect 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dgraphicsgloweffect.h" diff -Nru dtkwidget-5.5.48/src/widgets/dgraphicsgloweffect.cpp dtkwidget-5.6.12/src/widgets/dgraphicsgloweffect.cpp --- dtkwidget-5.5.48/src/widgets/dgraphicsgloweffect.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dgraphicsgloweffect.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dgraphicsgloweffect.h" diff -Nru dtkwidget-5.5.48/src/widgets/dgraphicsgloweffect.h dtkwidget-5.6.12/src/widgets/dgraphicsgloweffect.h --- dtkwidget-5.5.48/src/widgets/dgraphicsgloweffect.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dgraphicsgloweffect.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DGRAPHICSGLOWEFFECT_H -#define DGRAPHICSGLOWEFFECT_H - -#include -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DGraphicsGlowEffect : public QGraphicsEffect -{ - Q_OBJECT -public: - explicit DGraphicsGlowEffect(QObject *parent = nullptr); - - void draw(QPainter *painter); - QRectF boundingRectFor(const QRectF &rect) const; - - inline void setOffset(qreal dx, qreal dy) {m_xOffset = dx; m_yOffset = dy;} - - inline void setXOffset(qreal dx) {m_xOffset = dx;} - inline qreal xOffset() const {return m_xOffset;} - - inline void setYOffset(qreal dy) {m_yOffset = dy;} - inline qreal yOffset() const {return m_yOffset;} - - inline void setDistance(qreal distance) { m_distance = distance; updateBoundingRect(); } - inline qreal distance() const { return m_distance; } - - inline void setBlurRadius(qreal blurRadius) { m_blurRadius = blurRadius; updateBoundingRect(); } - inline qreal blurRadius() const { return m_blurRadius; } - - inline void setColor(const QColor &color) { m_color = color; } - inline QColor color() const { return m_color; } - - // TODO: refactor with d-pointer; - inline qreal opacity() const { return m_opacity; } - inline void setOpacity(qreal opacity) { m_opacity = opacity; } - -private: - qreal m_opacity = 1.0; - qreal m_xOffset; - qreal m_yOffset; - qreal m_distance; - qreal m_blurRadius; - QColor m_color; -}; - -DWIDGET_END_NAMESPACE - -#endif // DGRAPHICSGLOWEFFECT_H diff -Nru dtkwidget-5.5.48/src/widgets/DGraphicsView dtkwidget-5.6.12/src/widgets/DGraphicsView --- dtkwidget-5.5.48/src/widgets/DGraphicsView 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DGraphicsView 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DGroupBox dtkwidget-5.6.12/src/widgets/DGroupBox --- dtkwidget-5.5.48/src/widgets/DGroupBox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DGroupBox 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/dheaderline.cpp dtkwidget-5.6.12/src/widgets/dheaderline.cpp --- dtkwidget-5.5.48/src/widgets/dheaderline.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dheaderline.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dheaderline.h" #include "dthememanager.h" diff -Nru dtkwidget-5.5.48/src/widgets/dheaderline.h dtkwidget-5.6.12/src/widgets/dheaderline.h --- dtkwidget-5.5.48/src/widgets/dheaderline.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dheaderline.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DHEADERLINE_H -#define DHEADERLINE_H - -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DHeaderLine : public DBaseLine -{ - Q_OBJECT -public: - explicit DHeaderLine(QWidget *parent = 0); - void setTitle(const QString &title); - void setContent(QWidget *content); - - QString title() const; - -private: - void setLeftContent(QWidget *content); - void setRightContent(QWidget *content); - -private: - QLabel *m_titleLabel = NULL; -}; - -DWIDGET_END_NAMESPACE - -#endif // DHEADERLINE_H diff -Nru dtkwidget-5.5.48/src/widgets/DHeaderView dtkwidget-5.6.12/src/widgets/DHeaderView --- dtkwidget-5.5.48/src/widgets/DHeaderView 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DHeaderView 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DHorizontalLine dtkwidget-5.6.12/src/widgets/DHorizontalLine --- dtkwidget-5.5.48/src/widgets/DHorizontalLine 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DHorizontalLine 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dframe.h" diff -Nru dtkwidget-5.5.48/src/widgets/DHorizontalSlider dtkwidget-5.6.12/src/widgets/DHorizontalSlider --- dtkwidget-5.5.48/src/widgets/DHorizontalSlider 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DHorizontalSlider 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/dialog_constants.h dtkwidget-5.6.12/src/widgets/dialog_constants.h --- dtkwidget-5.5.48/src/widgets/dialog_constants.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dialog_constants.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef BUTTON_CONSTANTS_H -#define BUTTON_CONSTANTS_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -namespace DIALOG { - const int DEFAULT_WIDTH = 380; - const int DEFAULT_HEIGHT = 120; - const int BORDER_SHADOW_WIDTH = 0; - const int BORDER_RADIUS = 4; - const int CONTENT_INSERT_OFFSET = 2; - const int BUTTON_HEIGHT = 28; - const int CLOSE_BUTTON_WIDTH = 21; - const int CLOSE_BUTTON_HEIGHT = 21; - const int ICON_LAYOUT_TOP_MARGIN = 14; - const int ICON_LAYOUT_BOTTOM_MARGIN = 14; - const int ICON_LAYOUT_LEFT_MARGIN = 20; - const int ICON_LAYOUT_RIGHT_MARGIN = 20; - const int ICON_LAYOUT_SPACING = 20; - const int BUTTON_LAYOUT_TOP_MARGIN = 0; - const int BUTTON_LAYOUT_BOTTOM_MARGIN = 10; - const int BUTTON_LAYOUT_LEFT_MARGIN = 10; - const int BUTTON_LAYOUT_RIGHT_MARGIN = 10; -} - -DWIDGET_END_NAMESPACE - -#endif // BUTTON_CONSTANTS_H - diff -Nru dtkwidget-5.5.48/src/widgets/dialogs.pri dtkwidget-5.6.12/src/widgets/dialogs.pri --- dtkwidget-5.5.48/src/widgets/dialogs.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dialogs.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -HEADERS += \ - $$PWD/dabstractdialog.h \ - $$PWD/ddialog.h \ - $$PWD/dialog_constants.h \ - $$PWD/dinputdialog.h \ - $$PWD/daboutdialog.h \ - $$PWD/dsettingsdialog.h \ - $$PWD/private/settings/buttongroup.h \ - $$PWD/private/settings/combobox.h \ - $$PWD/private/settings/content.h \ - $$PWD/private/settings/contenttitle.h \ - $$PWD/private/settings/navigation.h \ - $$PWD/private/settings/navigationdelegate.h \ - $$PWD/private/settings/shortcutedit.h \ - $$PWD/dfiledialog.h \ - $$PWD/dprintpreviewdialog.h - -SOURCES += \ - $$PWD/dabstractdialog.cpp \ - $$PWD/ddialog.cpp \ - $$PWD/dinputdialog.cpp \ - $$PWD/daboutdialog.cpp \ - $$PWD/dsettingsdialog.cpp \ - $$PWD/private/settings/buttongroup.cpp \ - $$PWD/private/settings/combobox.cpp \ - $$PWD/private/settings/content.cpp \ - $$PWD/private/settings/contenttitle.cpp \ - $$PWD/private/settings/navigation.cpp \ - $$PWD/private/settings/navigationdelegate.cpp \ - $$PWD/private/settings/shortcutedit.cpp \ - $$PWD/dfiledialog.cpp \ - $$PWD/dprintpreviewdialog.cpp diff -Nru dtkwidget-5.5.48/src/widgets/DIconButton dtkwidget-5.6.12/src/widgets/DIconButton --- dtkwidget-5.5.48/src/widgets/DIconButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DIconButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "diconbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/diconbutton.cpp dtkwidget-5.6.12/src/widgets/diconbutton.cpp --- dtkwidget-5.5.48/src/widgets/diconbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/diconbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "diconbutton.h" #include "dstyleoption.h" #include "dobject_p.h" @@ -57,6 +41,12 @@ setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); } +DIconButton::DIconButton(const DDciIcon &dciIcon, QWidget *parent) + : DIconButton(parent) +{ + setIcon(dciIcon); +} + DIconButton::~DIconButton() { @@ -98,6 +88,23 @@ QAbstractButton::setIcon(DStyleHelper(style()).standardIcon(iconType, nullptr, this)); } +void DIconButton::setIcon(const DDciIcon &icon) +{ + D_D(DIconButton); + + d->iconType = -1; + d->dciIcon = icon; + this->update(); + this->updateGeometry(); +} + +DDciIcon DIconButton::dciIcon() const +{ + D_DC(DIconButton); + + return d->dciIcon; +} + QSize DIconButton::sizeHint() const { QAbstractButtonPrivate *bp = static_cast(QAbstractButton::d_ptr.data()); @@ -138,7 +145,6 @@ DStyleHelper dstyle(style()); DStyleOptionButton opt = baseStyleOption(); int size = dstyle.pixelMetric(DStyle::PM_IconButtonIconSize, &opt, this); - if (Q_LIKELY(size > 0)) { return QSize(size, size); } @@ -211,6 +217,7 @@ { D_DC(DIconButton); + *option = baseStyleOption(); option->initFrom(this); option->init(this); @@ -227,7 +234,12 @@ option->state |= QStyle::State_Raised; if (enabledCircle()) { - option->features = QStyleOptionButton::ButtonFeature(DStyleOptionButton::CircleButton); + option->features |= QStyleOptionButton::ButtonFeature(DStyleOptionButton::CircleButton); + } + + if (!d->dciIcon.isNull()) { + option->dciIcon = d->dciIcon; + option->features |= QStyleOptionButton::ButtonFeature(DStyleOptionButton::HasDciIcon); } option->text = text(); @@ -263,7 +275,7 @@ */ void DIconButton::setNewNotification(const bool set_new) { - this->setProperty("_d_dtk_newNotification", set_new); + DStyle::setRedPointVisible(this, set_new); } void DIconButton::paintEvent(QPaintEvent *event) diff -Nru dtkwidget-5.5.48/src/widgets/diconbutton.h dtkwidget-5.6.12/src/widgets/diconbutton.h --- dtkwidget-5.5.48/src/widgets/diconbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/diconbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DICONBUTTON_H -#define DICONBUTTON_H - -#include -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DIconButtonPrivate; -class DStyleOptionButton; -class DIconButton : public QAbstractButton, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DIconButton) - - Q_PROPERTY(bool flat READ isFlat WRITE setFlat) - -public: - explicit DIconButton(QWidget *parent = nullptr); - explicit DIconButton(QStyle::StandardPixmap iconType = static_cast(-1), QWidget *parent = nullptr); - explicit DIconButton(DStyle::StandardPixmap iconType = static_cast(-1), QWidget *parent = nullptr); - ~DIconButton() override; - - void setIcon(const QIcon &icon); - void setIcon(QStyle::StandardPixmap iconType); - void setIcon(DStyle::StandardPixmap iconType); - - QSize sizeHint() const override; - QSize minimumSizeHint() const override; - QSize iconSize() const; - - bool isFlat() const; - - void setEnabledCircle(bool status); - bool enabledCircle() const; - void setNewNotification(const bool set_new); - -public Q_SLOTS: - void setFlat(bool flat); - -protected: - using QAbstractButton::setText; - using QAbstractButton::text; - - DIconButton(DIconButtonPrivate &dd, QWidget *parent = nullptr); - virtual DStyleOptionButton baseStyleOption() const; - virtual void initStyleOption(DStyleOptionButton *option) const; - void keyPressEvent(QKeyEvent *event) override; - -private: - void paintEvent(QPaintEvent *event) override; - bool event(QEvent *e) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DICONBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/DImageButton dtkwidget-5.6.12/src/widgets/DImageButton --- dtkwidget-5.5.48/src/widgets/DImageButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DImageButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dimagebutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dimagebutton.cpp dtkwidget-5.6.12/src/widgets/dimagebutton.cpp --- dtkwidget-5.5.48/src/widgets/dimagebutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dimagebutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dimagebutton.h" #include "dconstants.h" diff -Nru dtkwidget-5.5.48/src/widgets/dimagebutton.h dtkwidget-5.6.12/src/widgets/dimagebutton.h --- dtkwidget-5.5.48/src/widgets/dimagebutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dimagebutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DIMAGEBUTTON_H -#define DIMAGEBUTTON_H - -#include -#include -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE -class DImageButtonPrivate; -class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DIconButton") DImageButton : public QLabel, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_PROPERTY(QString normalPic READ getNormalPic WRITE setNormalPic DESIGNABLE true) - Q_PROPERTY(QString hoverPic READ getHoverPic WRITE setHoverPic DESIGNABLE true) - Q_PROPERTY(QString pressPic READ getPressPic WRITE setPressPic DESIGNABLE true) - Q_PROPERTY(QString checkedPic READ getCheckedPic WRITE setCheckedPic DESIGNABLE true) - Q_PROPERTY(QString disabledPic READ getDisabledPic WRITE setDisabledPic DESIGNABLE true) - Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged) - Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable) - -public: - DImageButton(QWidget *parent = 0); - - DImageButton(const QString &normalPic, const QString &hoverPic, - const QString &pressPic, QWidget *parent = 0); - - DImageButton(const QString &normalPic, const QString &hoverPic, - const QString &pressPic, const QString &checkedPic, QWidget *parent = 0); - - ~DImageButton(); - - void setEnabled(bool enabled); - void setDisabled(bool disabled); - - void setChecked(bool flag); - void setCheckable(bool flag); - bool isChecked() const; - bool isCheckable() const; - - void setNormalPic(const QString &normalPic); - void setHoverPic(const QString &hoverPic); - void setPressPic(const QString &pressPic); - void setCheckedPic(const QString &checkedPic); - void setDisabledPic(const QString &disabledPic); - - const QString getNormalPic() const; - const QString getHoverPic() const; - const QString getPressPic() const; - const QString getCheckedPic() const; - const QString getDisabledPic() const; - - enum State { - Normal, - Hover, - Press, - Checked, - Disabled - }; - - void setState(State state); - State getState() const; - -Q_SIGNALS: - void clicked(); - void checkedChanged(bool checked); - void stateChanged(); - -protected: - DImageButton(DImageButtonPrivate &q, QWidget *parent); - void enterEvent(QEvent *event) Q_DECL_OVERRIDE; - void leaveEvent(QEvent *event) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - -private: - Q_DISABLE_COPY(DImageButton) - D_DECLARE_PRIVATE(DImageButton) -}; - -DWIDGET_END_NAMESPACE - -#endif // DIMAGEBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/dimageviewer.cpp dtkwidget-5.6.12/src/widgets/dimageviewer.cpp --- dtkwidget-5.5.48/src/widgets/dimageviewer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dimageviewer.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,962 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "dimageviewer.h" +#include "private/dimageviewer_p.h" +#include "private/dimagevieweritems_p.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +DGUI_USE_NAMESPACE +DWIDGET_BEGIN_NAMESPACE + +const qreal MAX_SCALE_FACTOR = 20.0; +const qreal MIN_SCALE_FACTOR = 0.02; + +/*! + \class Dtk::Widget::DImageViewerPrivate + \internal + */ + +/*! \internal */ +DImageViewerPrivate::DImageViewerPrivate(DImageViewer *qq) + : DObjectPrivate(qq) +{ +} + +/*! \internal */ +DImageViewerPrivate::~DImageViewerPrivate() +{ + if (pinchData) { + delete pinchData; + } + + if (cropData) { + // Crop image item may be lose parent when setting a null image, need released manually. + // Must release before content item. + if (cropData->cropItem) { + q_func()->scene()->removeItem(cropData->cropItem); + delete cropData->cropItem; + } + + delete cropData; + } + + // Proxy item and content item will be autodelete in scene. + q_func()->scene()->clear(); +} + +/*! \internal */ +void DImageViewerPrivate::init() +{ + D_Q(DImageViewer); + + q->setScene(new QGraphicsScene(q)); + q->setContentsMargins(0, 0, 0, 0); + q->setMouseTracking(true); + q->setAcceptDrops(false); + q->setTransformationAnchor(QGraphicsView::AnchorUnderMouse); + q->setDragMode(QGraphicsView::ScrollHandDrag); + q->setViewportUpdateMode(QGraphicsView::FullViewportUpdate); + q->setResizeAnchor(QGraphicsView::AnchorViewCenter); + q->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + q->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + q->setFrameShape(QFrame::Shape::NoFrame); + + q->setAttribute(Qt::WA_AcceptTouchEvents); + q->grabGesture(Qt::PinchGesture); + q->grabGesture(Qt::SwipeGesture); + q->grabGesture(Qt::PanGesture); + q->viewport()->setCursor(Qt::ArrowCursor); + + // The proxy item store rotation info, and clip the content item when setting the crop rect. + proxyItem = new QGraphicsRectItem; + proxyItem->setFlags(proxyItem->flags() | QGraphicsItem::ItemClipsChildrenToShape); + // Not draw proxy item rect. + proxyItem->setPen(QPen(Qt::NoPen)); + proxyItem->setBrush(QBrush(Qt::NoBrush)); + q->scene()->addItem(proxyItem); +} + +/*! \internal */ +ImageType DImageViewerPrivate::detectImageType(const QString &fileName) const +{ + ImageType type = ImageType::ImageTypeBlank; + if (!fileName.isEmpty()) { + QFileInfo info(fileName); + QString typeStr = info.suffix().toLower(); + + QMimeDatabase db; + QMimeType contentType = db.mimeTypeForFile(fileName, QMimeDatabase::MatchContent); + QMimeType exntensionType = db.mimeTypeForFile(fileName, QMimeDatabase::MatchExtension); + + QImageReader reader(fileName); + int nSize = reader.imageCount(); + + if (typeStr == "svg" && DSvgRenderer(fileName).isValid()) { + type = ImageType::ImageTypeSvg; + } else if ((typeStr == "mng") || ((typeStr == "gif") && nSize > 1) || (typeStr == "webp" && nSize > 1) || + ((contentType.name().startsWith("image/gif")) && nSize > 1) || + ((exntensionType.name().startsWith("image/gif")) && nSize > 1) || + (contentType.name().startsWith("video/x-mng")) || (exntensionType.name().startsWith("video/x-mng"))) { + type = ImageType::ImageTypeDynamic; + } else { + type = ImageType::ImageTypeStatic; + } + } + + return type; +} + +/*! \internal */ +void DImageViewerPrivate::resetItem(ImageType type) +{ + D_Q(DImageViewer); + + if (type != imageType) { + if (contentItem) { + q->scene()->removeItem(contentItem); + delete contentItem; + contentItem = nullptr; + } + + imageType = type; + } else if (contentItem) { + resetCropData(); + + contentItem->setPos(0, 0); + contentItem->resetTransform(); + proxyItem->setRotation(0); + proxyItem->resetTransform(); + return; + } + + switch (imageType) { + case ImageTypeStatic: + contentItem = new DGraphicsPixmapItem; + break; + case ImageTypeDynamic: + contentItem = new DGraphicsMovieItem; + break; + case ImageTypeSvg: + contentItem = new DGraphicsSVGItem; + break; + default: + break; + } + + if (contentItem) { + contentItem->setParentItem(proxyItem); + proxyItem->setRotation(0); + proxyItem->resetTransform(); + proxyItem->setRect(contentItem->boundingRect()); + } +} + +/*! \internal */ +QImage DImageViewerPrivate::loadImage(const QString &fileName, ImageType type) const +{ + QImage image; + switch (type) { + case ImageTypeStatic: + case ImageTypeDynamic: + image = QImageReader(fileName).read(); + break; + case ImageTypeSvg: { + DSvgRenderer render(fileName); + if (render.isValid()) { + image = render.toImage(render.defaultSize()); + } + break; + } + default: + break; + } + + return image; +} + +/*! \internal */ +void DImageViewerPrivate::updateItemAndSceneRect() +{ + D_Q(DImageViewer); + if (proxyItem) { + QRectF itemRect = proxyItem->mapRectToScene(proxyItem->boundingRect()); + // The image rect top left point will be changed after rotation, + // needs to adjust top left point to the accurate position. + if (itemRect.left() != 0 || itemRect.top() != 0) { + proxyItem->moveBy(-itemRect.left(), -itemRect.top()); + itemRect.moveTopLeft(QPointF(0, 0)); + } + q->setSceneRect(itemRect); + } +} + +/*! \internal */ +bool DImageViewerPrivate::rotatable() const +{ + return (ImageTypeBlank != imageType && ImageTypeDynamic != imageType); +} + +/*! \internal */ +bool DImageViewerPrivate::isRotateVertical() const +{ + if (proxyItem) { + // Check item rotation angle around 90 and 270 degrees. + qreal angle = abs(proxyItem->rotation()); + return (angle > 35 && angle < 135) || (angle > 225 && angle < 315); + } + return false; +} + +/*! \internal */ +qreal DImageViewerPrivate::validRotateAngle(qreal angle) const +{ + // From Qt help doc: A rotation transformation of 180 degrees + // and/or 360 degrees is treated as a scaling transformation. + if (qFuzzyCompare(abs(angle), 180)) { + // 180 degrees needs adjustment to avoid transformation errors. + return angle + (angle < 0 ? -0.00001 : 0.0001); + } else { + return angle; + } +} + +/*! \internal */ +qreal DImageViewerPrivate::validScaleFactor(qreal scale) const +{ + return qBound(MIN_SCALE_FACTOR, scale, MAX_SCALE_FACTOR); +} + +/*! \internal */ +qreal DImageViewerPrivate::widgetRelativeScale() const +{ + D_QC(DImageViewer); + + QRectF sceneRect = q->sceneRect(); + if (((1.0 * q->width()) / q->height()) > (sceneRect.width() / sceneRect.height())) { + return (1.0 * q->height()) / sceneRect.height(); + } else { + return (1.0 * q->width()) / sceneRect.width(); + } +} + +/*! \internal */ +void DImageViewerPrivate::checkPinchData() +{ + if (!pinchData) { + pinchData = new PinchData; + } +} + +/*! \internal */ +void DImageViewerPrivate::handleGestureEvent(QGestureEvent *gesture) +{ + if (QGesture *pinch = gesture->gesture(Qt::PinchGesture)) { + pinchTriggered(static_cast(pinch)); + } +} + +/*! \internal */ +void DImageViewerPrivate::pinchTriggered(QPinchGesture *gesture) +{ + D_Q(DImageViewer); + // Must check pinch data before use it. + checkPinchData(); + + maxTouchPoints = 2; + QPinchGesture::ChangeFlags changeFlags = gesture->changeFlags(); + if (changeFlags & QPinchGesture::ScaleFactorChanged) { + QPoint pos = q->mapFromGlobal(gesture->centerPoint().toPoint()); + if (abs(gesture->scaleFactor() - 1) > 0.006) { + q->scaleAtPoint(pos, gesture->scaleFactor()); + } + } + + // Two finger rotation. + if (changeFlags & QPinchGesture::RotationAngleChanged) { + if (!rotatable() || maxTouchPoints > 2) { + return; + } + + // Can not use gesture while rotation animation running. + if (pinchData->isAnimationRotating) { + gesture->setRotationAngle(gesture->lastRotationAngle()); + return; + } + + qreal rotationDelta = gesture->rotationAngle() - gesture->lastRotationAngle(); + if (abs(rotationDelta) > 0.2) { + if (qFuzzyIsNull(pinchData->rotationTouchAngle)) { + // First rotation step. + pinchData->storeItemAngle = proxyItem->rotation(); + } + pinchData->rotationTouchAngle = gesture->rotationAngle(); + proxyItem->setRotation(pinchData->storeItemAngle + pinchData->rotationTouchAngle); + } + } + + if (changeFlags & QPinchGesture::CenterPointChanged) { + if (!pinchData->isFirstPinch) { + pinchData->centerPoint = gesture->centerPoint(); + pinchData->isFirstPinch = true; + } + } + + if (gesture->state() == Qt::GestureFinished) { + pinchData->isFirstPinch = false; + gesture->setCenterPoint(pinchData->centerPoint); + + if (!rotatable()) { + return; + } + + playRotationAnimation(); + } +} + +/*! \internal */ +void DImageViewerPrivate::playRotationAnimation() +{ + D_Q(DImageViewer); + checkPinchData(); + + pinchData->isAnimationRotating = true; + // Auto delete after animation finished. + QVariantAnimation *animation = new QVariantAnimation(q); + animation->setDuration(200); + if (pinchData->rotationTouchAngle < 0) { + pinchData->rotationTouchAngle += 360; + } + + qreal endvalue; + if (abs(0 - abs(pinchData->rotationTouchAngle)) <= 10) { + endvalue = 0; + } else if (abs(360 - abs(pinchData->rotationTouchAngle)) <= 10) { + endvalue = 0; + } else if (abs(90 - abs(pinchData->rotationTouchAngle)) <= 10) { + endvalue = 90; + } else if (abs(180 - abs(pinchData->rotationTouchAngle)) <= 10) { + endvalue = 180; + } else if (abs(270 - abs(pinchData->rotationTouchAngle)) <= 10) { + endvalue = 270; + } else { + endvalue = 0; + } + + pinchData->rotationEndValue = endvalue; + qreal startvalue; + if (abs(pinchData->rotationTouchAngle - endvalue) > 180) { + startvalue = pinchData->rotationTouchAngle - 360; + } else { + startvalue = pinchData->rotationTouchAngle; + } + animation->setStartValue(startvalue); + animation->setEndValue(endvalue); + + QObject::connect(animation, &QVariantAnimation::valueChanged, [=](const QVariant &value) { + pinchData->rotationTouchAngle = value.toReal(); + if (static_cast(value.toReal()) != static_cast(endvalue)) { + proxyItem->setRotation(pinchData->storeItemAngle + pinchData->rotationTouchAngle); + } + }); + + QObject::connect(animation, SIGNAL(finished()), q, SLOT(_q_pinchAnimeFinished())); + animation->start(QAbstractAnimation::DeleteWhenStopped); +} + +/*! \internal */ +void DImageViewerPrivate::_q_pinchAnimeFinished() +{ + D_Q(DImageViewer); + // Must check pinch data before use it. + checkPinchData(); + + pinchData->isAnimationRotating = false; + pinchData->rotationTouchAngle = 0; + + // Set image item rotate angle. + int rotateAngle = (pinchData->storeItemAngle + pinchData->rotationEndValue) % 360; + qreal validAngle = validRotateAngle(rotateAngle); + proxyItem->setRotation(validAngle); + updateItemAndSceneRect(); + + pinchData->storeItemAngle = 0; +} + +/*! \internal */ +void DImageViewerPrivate::checkCropData() +{ + if (!cropData) { + cropData = new CropData; + cropData->cropItem = new DGraphicsCropItem; + cropData->cropItem->setVisible(false); + } +} + +/*! \internal */ +void DImageViewerPrivate::resetCropData() +{ + if (cropData) { + cropData->cropItem->setParentItem(nullptr); + cropData->cropItem->setVisible(false); + cropData->cropRect = QRect(); + cropData->cropping = false; + } +} + +/*! \internal */ +void DImageViewerPrivate::handleMousePressEvent(QMouseEvent *event) +{ + D_Q(DImageViewer); + + q->viewport()->unsetCursor(); + q->viewport()->setCursor(Qt::ArrowCursor); + clickStartPointX = event->pos().x(); +} + +/*! \internal */ +void DImageViewerPrivate::handleMouseReleaseEvent(QMouseEvent *event) +{ + D_Q(DImageViewer); + + q->viewport()->setCursor(Qt::ArrowCursor); + if (Qt::MouseEventSynthesizedByQt == event->source() && 1 == maxTouchPoints) { + const QRect &r = q->visibleImageRect(); + const QRectF &sr = q->sceneRect(); + int xPos = event->pos().x() - clickStartPointX; + + // Swipe image. + if ((r.width() >= (sr.width() - 1) && r.height() >= (sr.height() - 1))) { + if (abs(xPos) > 200 && clickStartPointX != 0) { + if (xPos > 0) { + Q_EMIT q->requestPreviousImage(); + } else { + Q_EMIT q->requestNextImage(); + } + } + } + } + clickStartPointX = 0; + maxTouchPoints = 0; +} + +/*! \internal */ +void DImageViewerPrivate::handleResizeEvent(QResizeEvent *event) +{ + Q_UNUSED(event); + D_Q(DImageViewer); + // Keep scale factor. + if (DImageViewerPrivate::FitWidget != fitFlag) { + q->scaleImage(1.0); + } +} + +DImageViewer::DImageViewer(QWidget *parent) + : DGraphicsView(parent) + , DObject(*new DImageViewerPrivate(this)) +{ + D_D(DImageViewer); + d->init(); +} + +DImageViewer::DImageViewer(const QImage &image, QWidget *parent) + : DGraphicsView(parent) + , DObject(*new DImageViewerPrivate(this)) +{ + D_D(DImageViewer); + d->init(); + setImage(image); +} + +DImageViewer::DImageViewer(const QString &fileName, QWidget *parent) + : DGraphicsView(parent) + , DObject(*new DImageViewerPrivate(this)) +{ + D_D(DImageViewer); + d->init(); + setFileName(fileName); +} + +DImageViewer::~DImageViewer() +{ + clear(); +} + +QImage DImageViewer::image() const +{ + D_DC(DImageViewer); + + QImage result = d->contentImage; + if (d->cropData && !d->cropData->cropRect.isEmpty()) { + result = result.copy(d->cropData->cropRect); + } + + int angle = rotateAngle(); + if (0 != angle) { + QTransform rotateMatrix; + rotateMatrix.rotate(angle); + result = result.transformed(rotateMatrix, Qt::SmoothTransformation); + } + + // Return cut out and rotate image. + return result; +} + +void DImageViewer::setImage(const QImage &image) +{ + D_D(DImageViewer); + d->resetItem(ImageTypeStatic); + Q_ASSERT(d->contentItem && d->proxyItem); + + auto staticItem = static_cast(d->contentItem); + staticItem->setPixmap(QPixmap::fromImage(image)); + d->contentImage = image; + + // Change item center, will affect rotation and scale. + d->proxyItem->setRect(d->contentItem->boundingRect()); + auto itemSize = d->proxyItem->boundingRect().size(); + d->proxyItem->setTransformOriginPoint(itemSize.width() / 2, itemSize.height() / 2); + d->updateItemAndSceneRect(); + autoFitImage(); + update(); + + Q_EMIT imageChanged(d->contentImage); +} + +QString DImageViewer::fileName() const +{ + D_DC(DImageViewer); + return d->fileName; +} + +void DImageViewer::setFileName(const QString &fileName) +{ + D_D(DImageViewer); + + ImageType type = d->detectImageType(fileName); + d->resetItem(type); + + if (ImageTypeBlank == d->imageType) { + clear(); + return; + } + + Q_ASSERT(d->contentItem && d->proxyItem); + d->fileName = fileName; + d->contentImage = d->loadImage(d->fileName, d->imageType); + + switch (d->imageType) { + case ImageTypeStatic: { + auto staticItem = static_cast(d->contentItem); + staticItem->setPixmap(QPixmap::fromImage(d->contentImage)); + break; + } + case ImageTypeDynamic: { + auto movieItem = static_cast(d->contentItem); + movieItem->setFileName(d->fileName); + break; + } + case ImageTypeSvg: { + auto svgItem = static_cast(d->contentItem); + svgItem->setFileName(d->fileName); + break; + } + default: + break; + } + + // Change item center, will affect rotation and scale. + d->proxyItem->setRect(d->contentItem->boundingRect()); + d->proxyItem->setTransformOriginPoint(d->proxyItem->boundingRect().center()); + d->updateItemAndSceneRect(); + autoFitImage(); + update(); + + Q_EMIT fileNameChanged(d->fileName); + Q_EMIT imageChanged(d->contentImage); +} + +qreal DImageViewer::scaleFactor() const +{ + D_DC(DImageViewer); + return d->scaleFactor; +} + +void DImageViewer::setScaleFactor(qreal factor) +{ + D_D(DImageViewer); + factor = d->validScaleFactor(factor); + + qreal realFactor = factor / d->scaleFactor; + d->scaleFactor = factor; + scale(realFactor, realFactor); + + Q_EMIT scaleFactorChanged(d->scaleFactor); +} + +void DImageViewer::scaleImage(qreal factor) +{ + D_D(DImageViewer); + qreal tmpScaleFactor = d->scaleFactor * factor; + qreal realFactor = d->validScaleFactor(tmpScaleFactor); + if (!qFuzzyCompare(tmpScaleFactor, realFactor)) { + factor = realFactor / d->scaleFactor; + } else { + d->fitFlag = DImageViewerPrivate::Unfit; + } + + d->scaleFactor = realFactor; + scale(factor, factor); + + Q_EMIT scaleFactorChanged(d->scaleFactor); +} + +void DImageViewer::autoFitImage() +{ + D_D(DImageViewer); + if (d->contentImage.isNull()) { + return; + } + + QSize imageSize = d->contentImage.size(); + if (d->isRotateVertical()) { + int tmp = imageSize.rheight(); + imageSize.setHeight(imageSize.width()); + imageSize.setWidth(tmp); + } + + if ((imageSize.width() >= width() || imageSize.height() > height()) && width() > 0 && height() > 0) { + fitToWidget(); + } else { + fitNormalSize(); + } +} + +void DImageViewer::fitToWidget() +{ + D_D(DImageViewer); + qreal factor = d->widgetRelativeScale(); + factor = d->validScaleFactor(factor); + if (qFuzzyCompare(factor, d->scaleFactor)) { + d->fitFlag = DImageViewerPrivate::FitWidget; + return; + } + + resetTransform(); + + d->fitFlag = DImageViewerPrivate::FitWidget; + d->scaleFactor = factor; + scale(factor, factor); + Q_EMIT scaleFactorChanged(d->scaleFactor); +} + +void DImageViewer::fitNormalSize() +{ + D_D(DImageViewer); + if (qFuzzyCompare(1.0, d->scaleFactor)) { + d->fitFlag = DImageViewerPrivate::FitNotmalSize; + return; + } + + resetTransform(); + + d->fitFlag = DImageViewerPrivate::FitNotmalSize; + d->scaleFactor = 1.0; + scale(d->scaleFactor, d->scaleFactor); + + Q_EMIT scaleFactorChanged(d->scaleFactor); +} + +void DImageViewer::rotateClockwise() +{ + D_D(DImageViewer); + if (d->proxyItem) { + int rotation = (static_cast(d->proxyItem->rotation()) + 90) % 360; + d->proxyItem->setRotation(d->validRotateAngle(rotation)); + d->updateItemAndSceneRect(); + autoFitImage(); + + Q_EMIT rotateAngleChanged(d->proxyItem->rotation()); + } +} + +void DImageViewer::rotateCounterclockwise() +{ + D_D(DImageViewer); + if (d->proxyItem) { + int rotation = (static_cast(d->proxyItem->rotation()) - 90) % 360; + d->proxyItem->setRotation(d->validRotateAngle(rotation)); + d->updateItemAndSceneRect(); + autoFitImage(); + + Q_EMIT rotateAngleChanged(d->proxyItem->rotation()); + } +} + +int DImageViewer::rotateAngle() const +{ + D_DC(DImageViewer); + return d->proxyItem ? d->proxyItem->rotation() : 0; +} + +void DImageViewer::resetRotateAngle() +{ + D_D(DImageViewer); + if (d->proxyItem && !qFuzzyIsNull(d->proxyItem->rotation())) { + // Reset scene rect. + if (d->isRotateVertical()) { + d->updateItemAndSceneRect(); + } + + d->proxyItem->setRotation(0); + autoFitImage(); + + Q_EMIT rotateAngleChanged(0); + } +} + +void DImageViewer::clear() +{ + D_D(DImageViewer); + // Crop data need reset before release contentItem. + d->resetCropData(); + + if (d->contentItem) { + scene()->removeItem(d->contentItem); + delete d->contentItem; + d->contentItem = nullptr; + } + d->proxyItem->resetTransform(); + resetTransform(); + + d->fileName.clear(); + d->contentImage = QImage(); + d->imageType = ImageTypeBlank; + d->scaleFactor = 1.0; + + Q_EMIT fileNameChanged(d->fileName); + Q_EMIT imageChanged(d->contentImage); +} + +void DImageViewer::centerOn(qreal x, qreal y) +{ + DGraphicsView::centerOn(x, y); + Q_EMIT transformChanged(); +} + +QRect DImageViewer::visibleImageRect() const +{ + D_DC(DImageViewer); + if (d->contentItem) { + QRect viewRect = viewportTransform().inverted().mapRect(rect()); + return viewRect & sceneRect().toRect(); + } else { + return QRect(); + } +} + +void DImageViewer::scaleAtPoint(QPoint pos, qreal factor) +{ + const QPointF targetScenePos = mapToScene(pos); + + scaleImage(factor); + + // Restore zoom anchor point. + const QPointF curPos = mapFromScene(targetScenePos); + const QPointF centerPos = QPointF(width() / 2.0, height() / 2.0) + (curPos - pos); + const QPointF centerScenePos = mapToScene(centerPos.toPoint()); + centerOn(static_cast(centerScenePos.x()), static_cast(centerScenePos.y())); +} + +void DImageViewer::beginCropImage() +{ + D_D(DImageViewer); + if (d->proxyItem && d->contentItem) { + d->checkCropData(); + if (d->cropData->cropping) { + return; + } + + d->cropData->cropping = true; + d->cropData->cropItem->updateContentItem(d->proxyItem); + d->cropData->cropItem->setVisible(true); + } +} + +void DImageViewer::endCropImage() +{ + D_D(DImageViewer); + if (d->cropData && d->cropData->cropping) { + // Crop item must remove parent after corped. + d->cropData->cropItem->setParentItem(nullptr); + d->cropData->cropItem->setVisible(false); + + QRect newRect = d->cropData->cropItem->cropRect(); + + if (newRect != d->proxyItem->boundingRect()) { + // Already has crop rect, add new crop rect. + if (!d->cropData->cropRect.isEmpty()) { + newRect.moveTopLeft(newRect.topLeft() + d->cropData->cropRect.topLeft()); + } + d->cropData->cropRect = newRect; + + if (d->contentItem) { + d->contentItem->setPos(-newRect.left(), -newRect.top()); + } + + d->proxyItem->setRect(0, 0, newRect.width(), newRect.height()); + d->proxyItem->setTransformOriginPoint(d->proxyItem->boundingRect().center()); + d->updateItemAndSceneRect(); + + Q_EMIT cropImageChanged(d->cropData->cropRect); + } + + d->cropData->cropping = false; + } +} + +void DImageViewer::resetCropImage() +{ + D_D(DImageViewer); + if (d->cropData && d->contentItem) { + d->resetCropData(); + + d->contentItem->setPos(0, 0); + d->contentItem->resetTransform(); + d->proxyItem->setRect(d->contentItem->boundingRect()); + d->proxyItem->setTransformOriginPoint(d->proxyItem->boundingRect().center()); + d->updateItemAndSceneRect(); + autoFitImage(); + } +} + +void DImageViewer::setCropAspectRatio(qreal w, qreal h) +{ + D_D(DImageViewer); + if (d->cropData) { + d->cropData->cropItem->setAspectRatio(w, h); + } +} + +QRect DImageViewer::cropImageRect() const +{ + D_DC(DImageViewer); + if (d->cropData) { + return d->cropData->cropRect; + } + return QRect(); +} + +void DImageViewer::mouseMoveEvent(QMouseEvent *event) +{ + if (!(Qt::NoButton | event->buttons())) { + viewport()->setCursor(Qt::ArrowCursor); + } else { + DGraphicsView::mouseMoveEvent(event); + viewport()->setCursor(Qt::ClosedHandCursor); + + Q_EMIT transformChanged(); + } +} + +void DImageViewer::wheelEvent(QWheelEvent *event) +{ + if (event->modifiers() == Qt::ControlModifier) { +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + qreal delta = event->delta(); +#else + qreal delta = event->angleDelta().y(); +#endif + if (delta > 0) { + Q_EMIT requestPreviousImage(); + } else if (delta < 0) { + Q_EMIT requestNextImage(); + } + } else { + qreal factor = qPow(1.2, event->angleDelta().y() / 240.0); + // Qt deprecated pos() since 5.15 +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + scaleAtPoint(event->pos(), factor); +#else + scaleAtPoint(event->position().toPoint(), factor); +#endif + event->accept(); + } +} + +bool DImageViewer::event(QEvent *event) +{ + D_D(DImageViewer); + static int touchCount = 0; + + QEvent::Type type = event->type(); + switch (type) { + case QEvent::TouchBegin: { + touchCount = 0; + d->maxTouchPoints = 1; + break; + } + case QEvent::TouchUpdate: { + QTouchEvent *touchEvent = dynamic_cast(event); + QList touchPoints = touchEvent->touchPoints(); + if (touchPoints.size() > touchCount) { + touchCount = touchPoints.size(); + } + break; + } + case QEvent::TouchEnd: { + QTouchEvent *touchEvent = dynamic_cast(event); + QList touchPoints = touchEvent->touchPoints(); + if (touchPoints.size() == 1 && touchCount <= 1) { + // Swipe gesture. + qreal offset = touchPoints.at(0).lastPos().x() - touchPoints.at(0).startPos().x(); + if (qAbs(offset) > 200) { + if (offset > 0) { + Q_EMIT requestPreviousImage(); + } else { + Q_EMIT requestNextImage(); + } + } + } + break; + } + case QEvent::Gesture: + d->handleGestureEvent(static_cast(event)); + break; + case QEvent::Resize: + d->handleResizeEvent(static_cast(event)); + break; + default: + break; + } + + bool accept = DGraphicsView::event(event); + + switch (type) { + case QEvent::MouseButtonPress: + d->handleMousePressEvent(static_cast(event)); + break; + case QEvent::MouseButtonRelease: + d->handleMouseReleaseEvent(static_cast(event)); + break; + default: + break; + } + + return accept; +} + +DWIDGET_END_NAMESPACE + +#include "moc_dimageviewer.cpp" diff -Nru dtkwidget-5.5.48/src/widgets/DInputDialog dtkwidget-5.6.12/src/widgets/DInputDialog --- dtkwidget-5.5.48/src/widgets/DInputDialog 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DInputDialog 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/dinputdialog.cpp dtkwidget-5.6.12/src/widgets/dinputdialog.cpp --- dtkwidget-5.5.48/src/widgets/dinputdialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dinputdialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/src/widgets/dinputdialog.h dtkwidget-5.6.12/src/widgets/dinputdialog.h --- dtkwidget-5.5.48/src/widgets/dinputdialog.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dinputdialog.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DINPUTDIALOG_H -#define DINPUTDIALOG_H - -#include - -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DInputDialogPrivate; -class DInputDialog : public DDialog -{ - Q_OBJECT - - Q_PROPERTY(InputMode inputMode READ inputMode WRITE setInputMode) - Q_PROPERTY(QString textValue READ textValue WRITE setTextValue NOTIFY textValueChanged) - Q_PROPERTY(int intValue READ intValue WRITE setIntValue NOTIFY intValueChanged) - Q_PROPERTY(int doubleValue READ doubleValue WRITE setDoubleValue NOTIFY doubleValueChanged) - Q_PROPERTY(QLineEdit::EchoMode textEchoMode READ textEchoMode WRITE setTextEchoMode) - Q_PROPERTY(bool comboBoxEditable READ isComboBoxEditable WRITE setComboBoxEditable) - Q_PROPERTY(QStringList comboBoxItems READ comboBoxItems WRITE setComboBoxItems) - Q_PROPERTY(int comboBoxCurrentIndex READ comboBoxCurrentIndex WRITE setComboBoxCurrentIndex NOTIFY comboBoxCurrentIndexChanged) - Q_PROPERTY(int intMinimum READ intMinimum WRITE setIntMinimum) - Q_PROPERTY(int intMaximum READ intMaximum WRITE setIntMaximum) - Q_PROPERTY(int intStep READ intStep WRITE setIntStep) - Q_PROPERTY(double doubleMinimum READ doubleMinimum WRITE setDoubleMinimum) - Q_PROPERTY(double doubleMaximum READ doubleMaximum WRITE setDoubleMaximum) - Q_PROPERTY(int doubleDecimals READ doubleDecimals WRITE setDoubleDecimals) - Q_PROPERTY(QString okButtonText READ okButtonText WRITE setOkButtonText) - Q_PROPERTY(QString cancelButtonText READ cancelButtonText WRITE setCancelButtonText) - Q_PROPERTY(bool textAlert READ isTextAlert WRITE setTextAlert NOTIFY textAlertChanged) - -public: - enum InputMode { - TextInput, - ComboBox, - IntInput, - DoubleInput - }; - - explicit DInputDialog(QWidget *parent = 0); - - Q_SLOT void setInputMode(InputMode mode); - InputMode inputMode() const; - - Q_SLOT void setTextValue(const QString &text); - QString textValue() const; - - Q_SLOT void setTextEchoMode(QLineEdit::EchoMode mode); - QLineEdit::EchoMode textEchoMode() const; - - Q_SLOT void setComboBoxEditable(bool editable); - bool isComboBoxEditable() const; - - Q_SLOT void setComboBoxItems(const QStringList &items); - QStringList comboBoxItems() const; - - Q_SLOT void setComboBoxCurrentIndex(int comboBoxCurrentIndex); - int comboBoxCurrentIndex() const; - - Q_SLOT void setIntValue(int value); - int intValue() const; - - Q_SLOT void setIntMinimum(int min); - int intMinimum() const; - - Q_SLOT void setIntMaximum(int max); - int intMaximum() const; - - Q_SLOT void setIntRange(int min, int max); - - Q_SLOT void setIntStep(int step); - int intStep() const; - - Q_SLOT void setDoubleValue(double value); - double doubleValue() const; - - Q_SLOT void setDoubleMinimum(double min); - double doubleMinimum() const; - - Q_SLOT void setDoubleMaximum(double max); - double doubleMaximum() const; - - Q_SLOT void setDoubleRange(double min, double max); - - Q_SLOT void setDoubleDecimals(int decimals); - int doubleDecimals() const; - - Q_SLOT void setOkButtonText(const QString &text); - QString okButtonText() const; - - Q_SLOT void setOkButtonEnabled(const bool enable); - bool okButtonIsEnabled() const; - - Q_SLOT void setCancelButtonText(const QString &text); - QString cancelButtonText() const; - - Q_SLOT void setTextAlert(bool textAlert); - bool isTextAlert() const; - - static QString getText(QWidget *parent, const QString &title, const QString &message, - QLineEdit::EchoMode echo = QLineEdit::Normal, - const QString &text = QString(), bool *ok = 0, Qt::WindowFlags flags = 0, - Qt::InputMethodHints inputMethodHints = Qt::ImhNone); - - static QString getItem(QWidget *parent, const QString &title, const QString &message, - const QStringList &items, int current = 0, bool editable = true, - bool *ok = 0, Qt::WindowFlags flags = 0, - Qt::InputMethodHints inputMethodHints = Qt::ImhNone); - - static int getInt(QWidget *parent, const QString &title, const QString &message, int value = 0, - int minValue = -2147483647, int maxValue = 2147483647, - int step = 1, bool *ok = 0, Qt::WindowFlags flags = 0); - static double getDouble(QWidget *parent, const QString &title, const QString &message, double value = 0, - double minValue = -2147483647, double maxValue = 2147483647, - int decimals = 1, bool *ok = 0, Qt::WindowFlags flags = 0); - -protected: - void showEvent(QShowEvent *e); - -Q_SIGNALS: - // ### Q_EMIT signals! - void textValueChanged(const QString &text); - void textValueSelected(const QString &text); - void intValueChanged(int value); - void intValueSelected(int value); - void doubleValueChanged(double value); - void doubleValueSelected(double value); - void cancelButtonClicked(); - void okButtonClicked(); - void comboBoxCurrentIndexChanged(int comboBoxCurrentIndex); - void textAlertChanged(bool textAlert); - -private: - D_DECLARE_PRIVATE(DInputDialog) -}; - -DWIDGET_END_NAMESPACE - -#endif // DINPUTDIALOG_H diff -Nru dtkwidget-5.5.48/src/widgets/dinputdialog_p.h dtkwidget-5.6.12/src/widgets/dinputdialog_p.h --- dtkwidget-5.5.48/src/widgets/dinputdialog_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dinputdialog_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DINPUTDIALOG_P_H -#define DINPUTDIALOG_P_H - -#endif // DINPUTDIALOG_P_H - diff -Nru dtkwidget-5.5.48/src/widgets/DIpv4LineEdit dtkwidget-5.6.12/src/widgets/DIpv4LineEdit --- dtkwidget-5.5.48/src/widgets/DIpv4LineEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DIpv4LineEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dipv4lineedit.h" diff -Nru dtkwidget-5.5.48/src/widgets/dipv4lineedit.cpp dtkwidget-5.6.12/src/widgets/dipv4lineedit.cpp --- dtkwidget-5.5.48/src/widgets/dipv4lineedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dipv4lineedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/src/widgets/dipv4lineedit.h dtkwidget-5.6.12/src/widgets/dipv4lineedit.h --- dtkwidget-5.5.48/src/widgets/dipv4lineedit.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dipv4lineedit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DIPV4LINEEDIT_H -#define DIPV4LINEEDIT_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DIpv4LineEditPrivate; -class LIBDTKWIDGETSHARED_EXPORT DIpv4LineEdit : public QLineEdit, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_DISABLE_COPY(DIpv4LineEdit) - D_DECLARE_PRIVATE(DIpv4LineEdit) - Q_PROPERTY(QString displayText READ displayText) - Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition) - Q_PROPERTY(Qt::Alignment alignment READ alignment) - Q_PROPERTY(QString selectedText READ selectedText) - Q_PROPERTY(bool acceptableInput READ hasAcceptableInput) - Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) - Q_PROPERTY(QString placeholderText READ placeholderText) - Q_PROPERTY(bool clearButtonEnabled READ isClearButtonEnabled) - -public: - explicit DIpv4LineEdit(QWidget *parent = 0); - - QString displayText() const; - int cursorPosition() const; - Qt::Alignment alignment() const; - bool hasAcceptableInput() const; - bool isReadOnly() const; - -public Q_SLOTS: - void setCursorPosition(int cursorPosition); - void setReadOnly(bool readOnly); - void setSelection(int start, int length); - void selectAll(); - -Q_SIGNALS: - void focusChanged(bool focus); - -protected: - bool eventFilter(QObject *obj, QEvent *e) Q_DECL_OVERRIDE; - -private: - DIpv4LineEdit(DIpv4LineEditPrivate &q, QWidget *parent); - void setPlaceholderText(QString placeholderText); - void setClearButtonEnabled(bool clearButtonEnabled); - - Q_PRIVATE_SLOT(d_func(), void _q_updateLineEditText()) - Q_PRIVATE_SLOT(d_func(), void _q_setIpLineEditText(const QString &)) - -protected: - void resizeEvent(QResizeEvent *event) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DIPV4LINEEDIT_H diff -Nru dtkwidget-5.5.48/src/widgets/DKeySequenceEdit dtkwidget-5.6.12/src/widgets/DKeySequenceEdit --- dtkwidget-5.5.48/src/widgets/DKeySequenceEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DKeySequenceEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dkeysequenceedit.h" diff -Nru dtkwidget-5.5.48/src/widgets/dkeysequenceedit.cpp dtkwidget-5.6.12/src/widgets/dkeysequenceedit.cpp --- dtkwidget-5.5.48/src/widgets/dkeysequenceedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dkeysequenceedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,6 +1,11 @@ +// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "DApplication" #include "dkeysequenceedit.h" #include "dstyle.h" +#include "dsizemode.h" #include "private/dkeysequenceedit_p.h" @@ -154,6 +159,15 @@ setKeyVisible(false); } } + void changeEvent(QEvent *event) override + { + if (event->type() == QEvent::StyleChange) { + for (auto item : labelList) { + item->setMinimumHeight(DSizeModeHelper::element(18, 24)); + } + } + return QWidget::changeEvent(event); + } }; /*! @@ -341,7 +355,7 @@ for (QString key : keyList) { DKeyLabel *label = new DKeyLabel(key); label->setAccessibleName(QString("DKeyWidgetKeyLabelAt").append(key)); - label->setMinimumHeight(24); + label->setMinimumHeight(DSizeModeHelper::element(18, 24)); layout()->addWidget(label); labelList.append(label); } diff -Nru dtkwidget-5.5.48/src/widgets/dkeysequenceedit.h dtkwidget-5.6.12/src/widgets/dkeysequenceedit.h --- dtkwidget-5.5.48/src/widgets/dkeysequenceedit.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dkeysequenceedit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -#ifndef DKEYSEQUENCEEDIT_H -#define DKEYSEQUENCEEDIT_H - -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DKeySequenceEditPrivate; -class LIBDTKWIDGETSHARED_EXPORT DKeySequenceEdit : public QLineEdit, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_DISABLE_COPY(DKeySequenceEdit) - D_DECLARE_PRIVATE(DKeySequenceEdit) - -public: - explicit DKeySequenceEdit(QWidget *parent = nullptr); - - void clear(); - bool setKeySequence(const QKeySequence &keySequence); - QKeySequence keySequence(); - void ShortcutDirection(Qt::AlignmentFlag alig); - - QString getKeySequence(QKeySequence sequence); - -Q_SIGNALS: - void editingFinished(const QKeySequence &keySequence); - void keySequenceChanged(const QKeySequence &keySequence); - -protected: - void keyPressEvent(QKeyEvent *event) override; - bool event(QEvent *e) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DKEYSEQUENCEEDIT_H - - diff -Nru dtkwidget-5.5.48/src/widgets/DLabel dtkwidget-5.6.12/src/widgets/DLabel --- dtkwidget-5.5.48/src/widgets/DLabel 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DLabel 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dlabel.h" diff -Nru dtkwidget-5.5.48/src/widgets/dlabel.cpp dtkwidget-5.6.12/src/widgets/dlabel.cpp --- dtkwidget-5.5.48/src/widgets/dlabel.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dlabel.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,25 +1,10 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dlabel.h" #include "private/dlabel_p.h" +#include "dtooltip.h" #include @@ -28,17 +13,19 @@ DWIDGET_BEGIN_NAMESPACE /*! +@~english \class Dtk::Widget::DLabel \inmodule dtkwidget - \brief DLabel一个重新实现的 QLabel. + @brief DLabel a re-implementation QLabel. - DLabel提供了将 DLabel 显示在指定位置的函数 - DLabel提供了改变字体颜色的函数 + DLabel provides a function to display the DLabel at a specified location + DLabel provides a function to change the font color */ /*! - \brief DLabel的构造函数. - \a parent 参数被发送到 QLabel 构造函数。 +@~english + @brief Constructor for DLabel. + \a parent The argument is sent to the QLabel constructor. */ DLabel::DLabel(QWidget *parent, Qt::WindowFlags f) : QLabel(parent, f) @@ -49,9 +36,10 @@ } /*! - \brief DLabel的构造函数. - \a text 文本信息 - \a parent 参数被发送到 QLabel 构造函数。 +@~english + @brief Constructor for DLabel. + \a text Text message + \a parent Specifying the parent object. */ DLabel::DLabel(const QString &text, QWidget *parent) : QLabel(text, parent) @@ -67,8 +55,9 @@ } /*! - \brief DLabel::setForegroundRole 显示的字体颜色 - \a role 字体颜色(QPalette::ColorRole) +@~english + @brief DLabel::setForegroundRole The font color displayed + \a role Font color(QPalette::ColorRole) */ void DLabel::setForegroundRole(QPalette::ColorRole role) { @@ -79,8 +68,9 @@ } /*! - \brief DLabel::setForegroundRole显示的字体颜色 - \a color 字体颜色 +@~english + @brief DLabel::setForegroundRole The font color displayed + \a color Font color */ void DLabel::setForegroundRole(DPalette::ColorType color) { @@ -89,8 +79,9 @@ } /*! - \brief DLabel::setElideMode 设置省略号显示的模式 - \a elideMode 省略模式枚举 +@~english + @brief DLabel::setElideMode Set the mode of ellipsis display + \a elideMode Omitted schema enumeration */ void DLabel::setElideMode(Qt::TextElideMode elideMode) { @@ -103,8 +94,9 @@ } /*! - \brief DLabel::elideMode 获取省略号的模式 - \return 返回省略号的模式 +@~english + @brief DLabel::elideMode Gets the pattern of the ellipsis + \return Returns the pattern of ellipses */ Qt::TextElideMode DLabel::elideMode() const { @@ -113,9 +105,10 @@ } /*! - \brief DLabel::DLabel 构造函数 - \a dd 私有类成员变量 - \a parent 父控件 +@~english + @brief DLabel::DLabel Constructor function + \a dd Private class member variables + \a parent Parent control */ DLabel::DLabel(DLabelPrivate &dd, QWidget *parent) : QLabel(parent) @@ -125,8 +118,9 @@ } /*! - \brief DLabel::initPainter 初始化 painter - \a painter painter 形参 +@~english + @brief DLabel::initPainter Initialization painter + \a painter painter parameter */ void DLabel::initPainter(QPainter *painter) const { @@ -139,8 +133,9 @@ } /*! - \brief DLabel::paintEvent - \a event 消息事件 +@~english + @brief DLabel::paintEvent + \a event Message event \sa QLabel::paintEvent() */ void DLabel::paintEvent(QPaintEvent *event) @@ -216,6 +211,23 @@ const QFontMetrics fm(fontMetrics()); text = fm.elidedText(text, elideMode(), width(), Qt::TextShowMnemonic); } + const DToolTip::ToolTipShowMode &toolTipShowMode = DToolTip::toolTipShowMode(this); + if (toolTipShowMode != DToolTip::Default) { + const bool showToolTip = (toolTipShowMode == DToolTip::AlwaysShow) + || ((toolTipShowMode == DToolTip::ShowWhenElided) && (d->text != text)); + if (DToolTip::needUpdateToolTip(this, showToolTip)) { + QString toolTip; + if (showToolTip) { + QTextOption textOption; + textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); + textOption.setTextDirection(opt.direction); + textOption.setAlignment(Qt::Alignment(align)); + toolTip = DToolTip::wrapToolTipText(d->text, textOption); + } + this->setToolTip(toolTip); + DToolTip::setShowToolTip(this, showToolTip); + } + } style->drawItemText(&painter, lr.toRect(), flags, palette, isEnabled(), text, foregroundRole()); } } else diff -Nru dtkwidget-5.5.48/src/widgets/dlabel.h dtkwidget-5.6.12/src/widgets/dlabel.h --- dtkwidget-5.5.48/src/widgets/dlabel.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dlabel.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DLABEL_H -#define DLABEL_H - -#include -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DLabelPrivate; -class LIBDTKWIDGETSHARED_EXPORT DLabel : public QLabel, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_DISABLE_COPY(DLabel) - D_DECLARE_PRIVATE(DLabel) -public: - explicit DLabel(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); - DLabel(const QString &text, QWidget *parent = nullptr); - ~DLabel(); - - void setForegroundRole(QPalette::ColorRole role); - void setForegroundRole(DPalette::ColorType color); - void setElideMode(Qt::TextElideMode elideMode); - Qt::TextElideMode elideMode() const; - -protected: - DLabel(DLabelPrivate &dd, QWidget *parent = nullptr); - - void initPainter(QPainter *painter) const override; - void paintEvent(QPaintEvent *event) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DLABEL_H diff -Nru dtkwidget-5.5.48/src/widgets/DLCDNumber dtkwidget-5.6.12/src/widgets/DLCDNumber --- dtkwidget-5.5.48/src/widgets/DLCDNumber 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DLCDNumber 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/dlicensedialog.cpp dtkwidget-5.6.12/src/widgets/dlicensedialog.cpp --- dtkwidget-5.5.48/src/widgets/dlicensedialog.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dlicensedialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,237 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "dlicensedialog.h" +#include "private/dabstractdialogprivate_p.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +DCORE_USE_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE + +class DLicenseDialogPrivate : public DAbstractDialogPrivate +{ +public: + explicit DLicenseDialogPrivate(DLicenseDialog *qq); + +private: + void init(); + void addComponentItem(const DLicenseInfo::DComponentInfo *DComponentInfo); + bool loadLicense(); + + DTitlebar *titleBar = nullptr; + DIconButton *backwardBtn = nullptr; + DListView *listView = nullptr; + QStandardItemModel *listModel = nullptr; + QStackedLayout *stackedLayout = nullptr; + QLabel *componentNameLabel = nullptr; + QLabel *componentVersionLabel = nullptr; + QLabel *copyRightLabel = nullptr; + QLabel *licenseContentLabel = nullptr; + QScrollArea *scrollArea = nullptr; + QByteArray content; + QString path; + DLicenseInfo licenseInfo; + bool isValid = false; + +private: + Q_DECLARE_PUBLIC(DLicenseDialog) +}; + +DLicenseDialogPrivate::DLicenseDialogPrivate(DLicenseDialog *qq) + : DAbstractDialogPrivate(qq) + , backwardBtn(new DIconButton(QStyle::SP_ArrowBack)) + , listView(new DListView) + , listModel(new QStandardItemModel) + , stackedLayout(new QStackedLayout) + , componentNameLabel(new QLabel) + , componentVersionLabel(new QLabel) + , copyRightLabel(new QLabel) + , licenseContentLabel(new QLabel) + , scrollArea(new QScrollArea) +{ +} + +void DLicenseDialogPrivate::init() +{ + D_Q(DLicenseDialog); + q->setFixedSize(900, 800); + + titleBar = new DTitlebar(); + titleBar->setAccessibleName("DLicenseDialogTitleBar"); + titleBar->setMenuVisible(false); + titleBar->setBackgroundTransparent(true); + titleBar->setTitle(QObject::tr("Credits")); + titleBar->addWidget(backwardBtn, Qt::AlignLeft | Qt::AlignVCenter); + + backwardBtn->setVisible(false); + + listView->setEditTriggers(QAbstractItemView::NoEditTriggers); + listView->setSelectionMode(QAbstractItemView::NoSelection); + listView->setSpacing(0); + listView->setItemSpacing(0); + listView->setModel(listModel); + listView->setAlternatingRowColors(true); + + DFontSizeManager *fontManager = DFontSizeManager::instance(); + fontManager->bind(componentNameLabel, DFontSizeManager::T4, QFont::Bold); + fontManager->bind(componentVersionLabel, DFontSizeManager::T6, QFont::DemiBold); + fontManager->bind(copyRightLabel, DFontSizeManager::T6, QFont::DemiBold); + + licenseContentLabel->setWordWrap(true); + + QWidget *licenseWidget = new QWidget; + QVBoxLayout *licenseLayout = new QVBoxLayout(licenseWidget); + licenseLayout->setSpacing(0); + licenseLayout->setMargin(20); + licenseLayout->addWidget(componentNameLabel); + licenseLayout->addSpacing(16); + licenseLayout->addWidget(new DHorizontalLine); + licenseLayout->addSpacing(16); + licenseLayout->addWidget(componentVersionLabel); + licenseLayout->addWidget(copyRightLabel); + licenseLayout->addSpacing(40); + licenseLayout->addWidget(licenseContentLabel); + licenseLayout->addStretch(0); + + scrollArea->setFrameStyle(QFrame::NoFrame); + scrollArea->viewport()->setAutoFillBackground(false); + scrollArea->setContentsMargins(QMargins(0,0,0,0)); + scrollArea->viewport()->setContentsMargins(QMargins(0,0,0,0)); + scrollArea->setWidget(licenseWidget); + scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + scrollArea->setWidgetResizable(true); + licenseWidget->setAutoFillBackground(false); + + stackedLayout->addWidget(listView); + stackedLayout->addWidget(scrollArea); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->setContentsMargins(10, 0, 10, 0); + mainLayout->addWidget(titleBar, 0, Qt::AlignTop); + mainLayout->addLayout(stackedLayout); + + q->setLayout(mainLayout); + q->setFocusPolicy(Qt::ClickFocus); + q->setFocus(); + + QObject::connect(stackedLayout, &QStackedLayout::currentChanged, q, [this](int index) { + backwardBtn->setVisible(index != 0); + }); + QObject::connect(backwardBtn, &QAbstractButton::clicked, q, [this]{ + scrollArea->horizontalScrollBar()->setValue(0); + scrollArea->verticalScrollBar()->setValue(0); + stackedLayout->setCurrentIndex(0); + }); + QObject::connect(listView, &QAbstractItemView::clicked, q, [this](const QModelIndex &index) { + const auto &components = licenseInfo.componentInfos(); + if (components.size() <= index.row() || index.row() < 0) + return; + + auto componentInfo = components.at(index.row()); + + componentNameLabel->setText(componentInfo->name()); + componentVersionLabel->setText(componentInfo->version()); + copyRightLabel->setText(componentInfo->copyRight()); + licenseContentLabel->setText(licenseInfo.licenseContent(componentInfo->licenseName())); + stackedLayout->setCurrentIndex(1); + }); +} + +void DLicenseDialogPrivate::addComponentItem(const DLicenseInfo::DComponentInfo *componentInfo) +{ + D_Q(DLicenseDialog); + auto pItem = new DStandardItem(componentInfo->name()); + pItem->setEditable(false); + QSize size(12, 12); + DViewItemAction *enterAction = new DViewItemAction(Qt::AlignVCenter, size, size, true); + enterAction->setIcon(DStyle::standardIcon(q->style(), DStyle::SP_ArrowEnter)); + pItem->setActionList(Qt::RightEdge, DViewItemActionList() << enterAction); + listModel->appendRow(pItem); + const auto index = pItem->index(); + QObject::connect(enterAction, &DViewItemAction::triggered, enterAction, [this, index] { + Q_EMIT listView->clicked(index); + }); +} + +bool DLicenseDialogPrivate::loadLicense() +{ + if (!content.isEmpty()) { + isValid = licenseInfo.loadContent(content); + } else if (!path.isEmpty()) { + isValid = licenseInfo.loadFile(path); + } + if (isValid) { + listModel->clear(); + for (auto component : licenseInfo.componentInfos()) { + addComponentItem(component); + } + } + return isValid; +} + +DLicenseDialog::DLicenseDialog(QWidget *parent) + : DAbstractDialog(*new DLicenseDialogPrivate(this), parent) +{ + Q_D(DLicenseDialog); + d->init(); +} + +DLicenseDialog::~DLicenseDialog() +{ +} + +void DLicenseDialog::setContent(const QByteArray &content) +{ + D_D(DLicenseDialog); + d->content = content; +} + +void DLicenseDialog::setFile(const QString &file) +{ + D_D(DLicenseDialog); + d->path = file; +} + +void DLicenseDialog::setLicenseSearchPath(const QString &path) +{ + D_D(DLicenseDialog); + d->licenseInfo.setLicenseSearchPath(path); +} + +bool DLicenseDialog::load() +{ + D_D(DLicenseDialog); + return d->loadLicense(); +} + +bool DLicenseDialog::isValid() const +{ + D_DC(DLicenseDialog); + return d->isValid; +} + +void DLicenseDialog::hideEvent(QHideEvent *) +{ + D_D(DLicenseDialog); + d->backwardBtn->setVisible(false); + d->stackedLayout->setCurrentIndex(0); + d->scrollArea->horizontalScrollBar()->setValue(0); + d->scrollArea->verticalScrollBar()->setValue(0); +} +DWIDGET_END_NAMESPACE +#include "moc_dlicensedialog.cpp" diff -Nru dtkwidget-5.5.48/src/widgets/DLineEdit dtkwidget-5.6.12/src/widgets/DLineEdit --- dtkwidget-5.5.48/src/widgets/DLineEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DLineEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dlineedit.h" diff -Nru dtkwidget-5.5.48/src/widgets/dlineedit.cpp dtkwidget-5.6.12/src/widgets/dlineedit.cpp --- dtkwidget-5.5.48/src/widgets/dlineedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dlineedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include @@ -39,28 +26,31 @@ DWIDGET_BEGIN_NAMESPACE /*! +@~english \class Dtk::Widget::DLineEdit \inmodule dtkwidget - \brief DLineEdit一个聚合 QLineEdit 的输入框. + \brief DLineEdit is an input box for aggregating QLineEdit. \list - \li DLineEdit提供了向输入框左右两端插入控件的函数 - \li DLineEdit提供了带警告颜色的输入框 - \li DLineEdit提供了带文本警告消息的输入框 + \li DLineEdit provides the function of inserting controls into the left and right ends of the input box + \li DLineEdit provides an input box with warning color + \li DLineEdit provides an input box with a text warning message \endlist */ /*! +@~english \property DLineEdit::alert - \brief 警告模式属性. + \brief Warning Mode Properties. - 用于开启或者判断是否处于警告模式. + Used to turn on or judge whether it is in warning mode. */ /*! - \brief DLineEdit的构造函数 - \a parent 参数被发送到 QWidget 构造函数。 +@~english + \brief Constructor of DLineEdit + \a parent The parameter is sent to the QWidget constructor. */ DLineEdit::DLineEdit(QWidget *parent) : QWidget(parent) @@ -76,9 +66,11 @@ } /*! - \brief 返回 QLineEdit 对象. +@~english + \brief Returns the QLineEdit object. - 若 DLineEdit 不满足输入框的使用需求,请用此函数抛出的对象 + If DLineEdit does not meet the use requirements of the input box, + please use the object thrown by this function \return */ QLineEdit *DLineEdit::lineEdit() const @@ -114,13 +106,14 @@ } /*! - \brief 显示警告消息. +@~english + \brief Display warning message. - 显示指定的文本消息,超过指定时间后警告消息消失. - \note 时间参数为-1时,警告消息将一直存在 - \a text 警告的文本 - \a duration 显示的时间长度,单位毫秒 - \a follower tooltip跟随 + Display the specified text message, and the warning message disappears after the specified time. + \note When the time parameter is - 1, the warning message will always exist + \a text Warning text + \a duration The length of time displayed in milliseconds + \a follower Tooltip follow */ void DLineEdit::showAlertMessage(const QString &text, QWidget *follower, int duration) { @@ -129,11 +122,12 @@ } /*! - \brief 指定对齐方式. +@~english + \brief Specify alignment. - 现只支持(下)左,(下)右,(下水平)居中, 默认左对齐. - \note 参数为其他时,默认左对齐 - \a alignment 消息对齐方式 + Now only (bottom) left, (bottom) right, (bottom horizontal) center are supported, and left alignment is the default. + \note When the parameter is other, the default left alignment + \a alignment Message alignment */ void DLineEdit::setAlertMessageAlignment(Qt::Alignment alignment) { @@ -148,7 +142,8 @@ } /*! - \brief 隐藏警告消息框. +@~english + \brief Hide warning message box. */ @@ -168,11 +163,12 @@ } /*! - \brief 向输入框左侧添加控件. +@~english + \brief Add a control to the left of the input box. - 将 QList 里的控件插入到输入框的左侧 - \note 多次调用,只有最后一次调用生效 - \a list 存储控件的列表 + Insert the control in QList to the left of the input box + \note Call this function several times, and only the last call will take effect + \a list Stores the list of controls */ void DLineEdit::setLeftWidgets(const QList &list) @@ -203,11 +199,12 @@ } /*! - \brief 向输入框右侧添加控件. +@~english + \brief Add a control to the right of the input box. - 将 QList 里的控件插入到输入框的右侧 - \note 多次调用,只有最后一次调用生效 - \a list 存储控件的列表 + Insert the control in QList to the right of the input box + \note Call this function several times, and only the last call will take effect + \a list Stores the list of controls */ void DLineEdit::setRightWidgets(const QList &list) @@ -238,9 +235,10 @@ } /*! - \brief 是否隐藏输入框左侧控件. +@~english + \brief Whether to hide the control on the left side of the input box. - \a visible 是否隐藏 + \a visible Whether to hide */ void DLineEdit::setLeftWidgetsVisible(bool visible) { @@ -248,9 +246,10 @@ d->leftWidget->setVisible(visible); } /*! - \brief 是否隐藏输入框右侧控件. +@~english + \brief Whether to hide the control on the right of the input box. - \a visible 是否隐藏 + \a visible Whether to hide */ void DLineEdit::setRightWidgetsVisible(bool visible) { @@ -259,9 +258,10 @@ } /*! - \brief 设置清除按钮是否可见. +@~english + \brief Set whether the clear button is visible. - \a enable true 按钮可见 false 按钮不可见 + \a enable True means the button is visible, false means the button is not visible */ void DLineEdit::setClearButtonEnabled(bool enable) { @@ -274,9 +274,10 @@ } /*! - \brief 返回清除按钮是否可见. +@~english + \brief Whether the return clear button is visible. - \return true 清除按钮可见 false 清除按钮不可见 + \return True means the clear button is visible, false means the clear button is not visible */ bool DLineEdit::isClearButtonEnabled() const { @@ -285,9 +286,10 @@ } /*! - \brief 设置显示的文本. +@~english + \brief Set the displayed text. - \a text 显示的文本 + \a text Displayed text */ void DLineEdit::setText(const QString &text) { @@ -296,9 +298,10 @@ } /*! - \brief 返回当前显示的文本. +@~english + \brief Returns the currently displayed text. - \return 返回显示的文本 + \return Return the displayed text */ QString DLineEdit::text() { @@ -307,7 +310,8 @@ } /*! - \brief 清空编辑的内容. +@~english + \brief Empty the edited content. */ void DLineEdit::clear() { @@ -316,9 +320,10 @@ } /*! - \brief 返回输入框的回显模式. +@~english + \brief Returns the echo mode of the input box. - \return 返回回显的模式 + \return Returns the mode of echo */ QLineEdit::EchoMode DLineEdit::echoMode() const { @@ -327,9 +332,10 @@ } /*! - \brief 设置回显的模式. +@~english + \brief Set the mode of echo. - \a mode 回显的模式 + \a mode Echoed mode */ void DLineEdit::setEchoMode(QLineEdit::EchoMode mode) { @@ -338,10 +344,11 @@ } /*! - \brief 设置行编辑控件的文本菜单策略. +@~english + \brief Set the text menu policy of the line edit control. - \a policy 显示右键菜单的方式 - 转发实际变量 QLineEdit 的 ContextMenuEvent 消息 + \a policy How to display the right-click menu + Forwards the ContextMenuEvent message of the actual variable QLineEdit \sa QLineEdit::setContextMenuPolicy */ void DLineEdit::setContextMenuPolicy(Qt::ContextMenuPolicy policy) @@ -351,9 +358,10 @@ } /*! - \brief 返回是否显示语音听写菜单项. +@~english + \brief Return to whether the voice dictation menu item is displayed. - \return true 显示语音听写菜单项 false不显示 + \return True to display voice dictation menu items, false to not display */ bool DLineEdit::speechToTextIsEnabled() const { @@ -368,9 +376,10 @@ } /*! - \brief 设置是否显示语音听写菜单项. +@~english + \brief Set whether to display voice dictation menu items. - \a enable true显示 flase不显示 + \a enable True is displayed, and the flash is not displayed */ void DLineEdit::setSpeechToTextEnabled(bool enable) { @@ -379,9 +388,10 @@ } /*! - \brief 返回是否显示语音朗读菜单项. +@~english + \brief Return to whether to display voice reading menu item. - \return true 显示语音朗读菜单项 false不显示 + \return True to display voice reading menu items, false to not display */ bool DLineEdit::textToSpeechIsEnabled() const { @@ -390,9 +400,10 @@ } /*! - \brief 设置是否显示语音朗读菜单项. +@~english + \brief Set whether to display voice reading menu items. - \a enable true显示 flase不显示 + \a enable True is displayed, and the flash is not displayed */ void DLineEdit::setTextToSpeechEnabled(bool enable) { @@ -401,9 +412,10 @@ } /*! - \brief 返回是否显示文本翻译菜单项. +@~english + \brief Returns whether to display the text translation menu item. - \return true 显示文本翻译菜单项 false 不显示 + \return True to display the text translation menu item, false to not display */ bool DLineEdit::textToTranslateIsEnabled() const { @@ -412,9 +424,10 @@ } /*! - \brief 设置是否显示文本翻译菜单项 +@~english + \brief Set whether to display the text translation menu item - \a enable true显示 flase不显示 + \a enable True to display, false to not display */ void DLineEdit::setTextToTranslateEnabled(bool enable) { @@ -423,8 +436,9 @@ } /*! - \brief DLineEdit::cutEnabled - \return true文本可剪切 false不可剪切 +@~english + \brief Returns whether the input text can be cut + \return True means the text can be cut, false means it cannot be cut */ bool DLineEdit::cutEnabled() const { @@ -433,8 +447,9 @@ } /*! - \brief DLineEdit::setCutEnabled 设置输入文本是否可拷贝 - \a enabled true输入文本可剪切 false不可剪切 +@~english + \brief Set whether the input text can be cut + \a enabled True means the input text can be cut, false means it cannot be cut */ void DLineEdit::setCutEnabled(bool enable) { @@ -443,8 +458,9 @@ } /*! - \brief DLineEdit::copyEnabled - \return true文本可拷贝 false不可拷贝 +@~english + \brief Returns whether the input text can be copied + \return True means that the text can be copied, and false means that it cannot be copied */ bool DLineEdit::copyEnabled() const { @@ -453,8 +469,9 @@ } /*! - \brief DLineEdit::setCopyEnabled 设置输入文本是否可拷贝 - \a enabled true输入文本可拷贝 false不可拷贝 +@~english + \brief Set whether the input text can be copied + \a enabled True means the input text can be copied, false means it cannot be copied */ void DLineEdit::setCopyEnabled(bool enable) { @@ -463,13 +480,14 @@ } /*! - \brief 事件过滤器 +@~english + \brief Event filter - \a watched 被监听的子控件指针, \a event 待过滤的事件 \a event 实例. + \a watched Listened child control pointer, \a event Events to be filtered \a event example. - 该过滤器不做任何过滤动作,但会监控输入框的焦点状态,并发送信号 focusChanged()。 + The filter does not perform any filtering action, but will monitor the focus status of the input box and send the signal focusChanged () - \return 成功过滤返回 true,否则返回 false . + \return If filtering is successful, return true; otherwise, return false . */ bool DLineEdit::eventFilter(QObject *watched, QEvent *event) { @@ -501,11 +519,42 @@ return QWidget::eventFilter(watched, event); } + QLineEdit *pLineEdit = static_cast(watched); + QMenu *menu = pLineEdit->createStandardContextMenu(); + + for (QAction *action : menu->actions()) { + if (action->text().startsWith(QLineEdit::tr("&Copy")) && !copyEnabled() ) { + action->setEnabled(false); + } + if (action->text().startsWith(QLineEdit::tr("Cu&t")) && !cutEnabled()) { + action->setEnabled(false); + } + } + connect(menu, &QMenu::triggered, this, [pLineEdit](QAction *pAction) { + if (pAction->text().startsWith(QLineEdit::tr("Select All"))) { + QApplication::clipboard()->setText(pLineEdit->text(), QClipboard::Mode::Selection); + } + }); + + auto msg = QDBusMessage::createMethodCall("com.iflytek.aiassistant", "/", + "org.freedesktop.DBus.Peer", "Ping"); + // 用之前 Ping 一下, 300ms 内没回复就认定是服务出问题,不再添加助手菜单项 + // Fix:Bug-154857 此处不能使用 BlockWithGui 否则右键事件会被处理,事件传递到 + // DSearchEdit 上会导致 edit 获得焦点然后菜单弹出后又失去焦点,有闪烁现象。。 + auto pingReply = QDBusConnection::sessionBus().call(msg, QDBus::Block, 300); + auto errorType = QDBusConnection::sessionBus().lastError().type(); + if (errorType == QDBusError::Timeout || errorType == QDBusError::NoReply) { + qWarning() << pingReply << "\nwill not add aiassistant actions!"; + menu->popup(static_cast(event)->globalPos()); + event->accept(); + return true; + } + QDBusInterface testSpeech("com.iflytek.aiassistant", "/aiassistant/tts", "com.iflytek.aiassistant.tts", QDBusConnection::sessionBus()); - //测试朗读接口是否开启 + // 测试朗读接口是否开启 QDBusReply speechReply = testSpeech.call(QDBus::AutoDetect, "getTTSEnable"); QDBusInterface testReading("com.iflytek.aiassistant", @@ -529,24 +578,6 @@ //测试听写接口是否开启 QDBusReply speechToTextReply = testSpeechToText.call(QDBus::AutoDetect, "getIatEnable"); - QLineEdit *pLineEdit = static_cast(watched); - QMenu *menu = pLineEdit->createStandardContextMenu(); - - for (QAction *action : menu->actions()) { - if (action->text().startsWith(QLineEdit::tr("&Copy")) && !copyEnabled() ) { - action->setEnabled(false); - } - if (action->text().startsWith(QLineEdit::tr("Cu&t")) && !cutEnabled()) { - action->setEnabled(false); - } - } - - connect(menu, &QMenu::triggered, this, [pLineEdit](QAction *pAction) { - if (pAction->text().startsWith(QLineEdit::tr("Select All"))) { - QApplication::clipboard()->setText(pLineEdit->text(), QClipboard::Mode::Selection); - } - }); - //朗读,翻译,听写都没有开启,则弹出默认菜单 if (!speechReply.value() && !translateReply.value() && !speechToTextReply.value()) { menu->popup(static_cast(event)->globalPos()); @@ -687,6 +718,8 @@ q->connect(control, &DAlertControl::alertChanged, q, &DLineEdit::alertChanged); hLayout->setContentsMargins(0, 0, 0, 0); + // Set spacing to 10 for between widget. + hLayout->setSpacing(10); hLayout->addWidget(lineEdit); lineEdit->installEventFilter(q); diff -Nru dtkwidget-5.5.48/src/widgets/dlineedit.h dtkwidget-5.6.12/src/widgets/dlineedit.h --- dtkwidget-5.5.48/src/widgets/dlineedit.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dlineedit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DLINEEDIT_H -#define DLINEEDIT_H - -#include -#include - -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DLineEditPrivate; -class DStyleOptionLineEdit; -class LIBDTKWIDGETSHARED_EXPORT DLineEdit : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_DISABLE_COPY(DLineEdit) - D_DECLARE_PRIVATE(DLineEdit) - Q_PROPERTY(bool alert READ isAlert WRITE setAlert NOTIFY alertChanged) - -public: - DLineEdit(QWidget *parent = nullptr); - virtual ~DLineEdit() override; - - QLineEdit *lineEdit() const; - void setPlaceholderText(const QString &); - - void setAlert(bool isAlert); - bool isAlert() const; - void showAlertMessage(const QString &text, int duration = 3000); - void showAlertMessage(const QString &text, QWidget *follower, int duration = 3000); - void setAlertMessageAlignment(Qt::Alignment alignment); - Qt::Alignment alertMessageAlignment() const; - void hideAlertMessage(); - - void setLeftWidgets(const QList &list); - void setRightWidgets(const QList &list); - - void setLeftWidgetsVisible(bool visible); - void setRightWidgetsVisible(bool visible); - - void setClearButtonEnabled(bool enable); - bool isClearButtonEnabled() const; - - void setText(const QString &text); - QString text(); - - void clear(); - - QLineEdit::EchoMode echoMode() const; - void setEchoMode(QLineEdit::EchoMode mode); - - void setContextMenuPolicy(Qt::ContextMenuPolicy policy); - - bool speechToTextIsEnabled() const; - void setSpeechToTextEnabled(bool enable); - - bool textToSpeechIsEnabled() const; - void setTextToSpeechEnabled(bool enable); - - bool textToTranslateIsEnabled() const; - void setTextToTranslateEnabled(bool enable); - - bool copyEnabled() const; - void setCopyEnabled(bool enable); - - bool cutEnabled() const; - void setCutEnabled(bool enable); - -Q_SIGNALS: - void alertChanged(bool alert) const; - void focusChanged(bool onFocus) const; - - void textChanged(const QString &); - void textEdited(const QString &); - void cursorPositionChanged(int, int); - void returnPressed(); - void editingFinished(); - void selectionChanged(); - -protected: - DLineEdit(DLineEditPrivate &q, QWidget *parent); - bool eventFilter(QObject *watched, QEvent *event) override; - bool event(QEvent *event) override; - - friend class DStyleOptionLineEdit; -}; - -DWIDGET_END_NAMESPACE - -#endif // DLINEEDIT_H diff -Nru dtkwidget-5.5.48/src/widgets/DListView dtkwidget-5.6.12/src/widgets/DListView --- dtkwidget-5.5.48/src/widgets/DListView 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DListView 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dlistview.h" diff -Nru dtkwidget-5.5.48/src/widgets/dlistview.cpp dtkwidget-5.6.12/src/widgets/dlistview.cpp --- dtkwidget-5.5.48/src/widgets/dlistview.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dlistview.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include @@ -160,41 +147,49 @@ // ====================Signals begin==================== /*! + @~english \fn void DListView::currentChanged(const QModelIndex &previous) - \brief 这个信号当当前item发生改变时被调用 + \brief This signal is called when the current item changes - listview会有一个始终表示当前item索引的 QModelIndex 对象, - 当这个 QModelIndex 对象表示的位置发生改变时这个信号才会被调用,而不是当前item的内容发生改变时。 - 当鼠标单机某一个item或者使用键盘切换item时, + \details ListView will have a QModelIndex object that always represents the current Item index, + This signal is called when the location of this QModelIndex object changes, not the content of the current ITEM content changes. + When a mouse ordered machine to switch item with a keyboard - \a previous 为之前的item的索引对象 + \param[in] previous It is the index object of the previous item \sa QModelIndex QListView::currentChanged */ /*! + @~english \fn void DListView::triggerEdit(const QModelIndex &index) - \brief 这个信号当有新的item被编辑时被调用 + \brief This signal is called when a new item is edited - \a index 为正在编辑的item的索引对象 + \param[in] index the indexing object of item that is being edited \sa QModelIndex QAbstractItemView::EditTrigger */ // ====================Signals end==================== /*! + @~english \class Dtk::Widget::DListView \inmodule dtkwidget - \brief 一个用于展示一列数据的控件. + \brief A control for displaying a column of data. - DListView 类似与 QListView 属于 Qt's model/view framework 的一个类,常被用来展示一列数据,当数据较多时可以滚动控件以显示跟多内容。 - 但与 QListView 也有不同之处,DListView 提供了顶部控件和底部控件,它们始终显示在listview中,不会因为滚动而不可见,另外还提供了方便编辑 - 数据的方法,如:addItem , addItems , insertItem , takeItem , removeItem , 以及一些开发中常用的信号。 + \details DListView is similar to QListView a class that belongs to QT's Model/View Framework. + It is often used to display a column of data. When the data is more, you can roll the control + to display and multiple contents. + But it is also different from QLISTView. DListView provides top controls and bottom controls. + They are always displayed in ListView, which will not be visible because of rolling. + The method of data, such as: additem, additems, insertitem, takeItem, removeItem, and some + commonly used signals in development. */ /*! - \brief 获取一个 DListView 实例 - \a parent 被用来作为 DListView 实例的父控件 + @~english + \brief Get a dlistView instance + \param[in] parent Parents controlled by the DListView instance */ DListView::DListView(QWidget *parent) : QListView(parent), @@ -204,11 +199,12 @@ } /*! - \brief 获取控件当前的状态 + @~english + \brief Get the current state of the control - 控件可以有正在被拖拽,正在被编辑,正在播放动画等状态,详细可以查阅:QAbstractItemView::State + The control can be dragged, edited by editor, and is playing animation and other states. You can check in detail:QAbstractItemView::State - \return 控件当前的状态 + \return the current state of control \sa QAbstractItemView::State */ @@ -262,16 +258,17 @@ } /*! - \brief 获取一个顶部控件 + @~english + \brief Get a top control - 顶部控件与item一样都会在listview中被显示出来,而且顶部控件会始终在所有item之上, - 也就是说顶部控件与item不同的地方在于顶部控件始终显示在布局中,而不会因为鼠标滚动不可见。 - 另外顶部控件可以有多个,它们的布局方式(方向)与item的布局方向相同 + \details The top control will be displayed in ListView, and the top control will always be above all item. + That is to say, the difference between the top control and item is that the top control is always displayed in the layout, not because the mouse rolling is not visible. + In addition, there are multiple top controls. Their layout (direction) is the same as the layout direction of item - \a index 指定要获取的顶部控件的索引 - \return 返回在指定索引处的顶部控件对象 + \param[in] index Specify the index of the top control to be obtained + \return Return to the top control object at the designated index - \note 注意顶部控件并不是像 GridLayout 的表头,表头是始终在水平方向上布局的 + \note Note that the top control is not like the head of GridLayout, and the header is always deployed in the horizontal direction \sa DListView::getFooterWidget DListView::addHeaderWidget DListView::removeHeaderWidget DListView::takeHeaderWidget */ @@ -281,9 +278,10 @@ } /*! - \brief 获取一个底部控件 - \a index 指定要获取的底部控件的索引 - \return 返回在指定索引处的底部控件对象 + @~english + \brief Get a bottom control + \param[in] index Specify the index of the bottom control to be obtained + \return return to the bottom control object at the specified index \sa DListView::getHeaderWidget */ QWidget *DListView::getFooterWidget(int index) const @@ -292,12 +290,13 @@ } /*! - \brief 判断给定的 QRect 是否与 listview 的item可显示区域有重叠 + @~english + \brief Determine whether the given QRect is overlapped with the item of ListView. - listview 的item可显示区域即为 listview 的 viewport , items只能在 viewport 显示,超出这一区域的 item 将不可见。 + \details The Item of ListView shows the ViewPort of ListView. item can only be displayed in ViewPort. item beyond this area will be invisible. - \a rect 要对比的 QRect - \return 返回两个矩形是否有重叠区域 + \param[in] rect QRct to compare + \return Whether the two rectangles have overlapping areas \sa DListView::isVisualRect */ bool DListView::isActiveRect(const QRect &rect) const @@ -310,10 +309,11 @@ } /*! - \brief 与 DListView::isVisualRect 相同 + @~english + \brief Same as dlistView::IsvisualRect - \a rect 用于判断的位置矩形. - \return 成功包含矩形返回 true,否则返回 false. + \param[in] rect The position rectangle for judging. + \return Successfully contains rectangular return true,Otherwise, return false. \sa DListView::isVisualRect */ @@ -325,15 +325,16 @@ } /*! + @~english \fn void DListView::rowCountChanged() \sa DListView::count */ /*! + @~english \property DListView::count - \brief 这个属性保存共有多少行数据 - - Getter: DListView::count , Signal: DListView::rowCountChanged + \brief How many lines of data is there in this attribute preservation + \details Getter: DListView::count , Signal: DListView::rowCountChanged */ int DListView::count() const { @@ -341,19 +342,19 @@ } /*! + @~english \fn void DListView::orientationChanged(Qt::Orientation orientation) - \a orientation 改变的方向值. + \param[in] orientation The direction value of the change. \sa DListView::orientation */ /*! + @~english \property DListView::orientation - \brief 这个属性保存listview中item的布局方式 - - Getter: DListView::orientation , Setter: DListView::setOrientation , Signal: DListView::orientationChanged - + \brief This attribute saves the layout of Item in ListView + \details Getter: DListView::orientation , Setter: DListView::setOrientation , Signal: DListView::orientationChanged \sa Qt::Orientation */ Qt::Orientation DListView::orientation() const @@ -366,11 +367,12 @@ } /*! - \brief 设置 DListView 要使用的模型 + @~english + \brief Set the model you want to use dlistView - 模型用来为 listview 提供数据,以实现数据层与界面层分离的结构, 详细请查阅 Qt's model/view framework + \details The model is used to provide data for ListView to achieve the structure of the separation of the data layer and the interface layer. For details, please refer to Qt's Model/View Framework - \a model 模型对象 + \param[in] model Model object \sa QListView::setModel */ void DListView::setModel(QAbstractItemModel *model) @@ -420,9 +422,10 @@ } /*! - \brief 在列表底部新增一个item - \a data 要新增的数据 - \return 返回是否新增成功 + @~english + \brief Add an Item at the bottom of the list + \param[in] data New data to be added + \return return whether it is successful to add */ bool DListView::addItem(const QVariant &data) { @@ -430,9 +433,10 @@ } /*! - \brief 一次性在列表底部新增多个item - \a datas 要新增的数据组成的列表 - \return 是否新增成功 + @~english + \brief Add more item at the bottom of the list at one time + \param[in] datas List of new data composition + \return Whether it is successful */ bool DListView::addItems(const QVariantList &datas) { @@ -440,10 +444,11 @@ } /*! - \brief 在指定行处新增一个item - \a index 要增加item的行号 - \a data 要增加的item的数据 - \return 是否新增成功 + @~english + \brief Add a new item at the designated bank + \param[in] index To increase the line number of Item + \param[in] data Item data to be added + \return Whether it is successful */ bool DListView::insertItem(int index, const QVariant &data) { @@ -454,10 +459,11 @@ } /*! - \brief 在指定行处新增多个item - \a index 要增加item的行号 - \a datas 要增加的items的数据组成的列表 - \return 是否新增成功 + @~english + \brief Add more item at the designated bank + \param[in] index To increase the line number of Item + \param[in] datas List of data composition of items data + \return Whether it is successful */ bool DListView::insertItems(int index, const QVariantList &datas) { @@ -471,9 +477,10 @@ } /*! - \brief 移除指定位置的item - \a index 要移除的item的行号 - \return 是否移除成功 + @~english + \brief Remove the designated position item + \param[in] index The line number of it to remove + \return Whether it is remove successfully */ bool DListView::removeItem(int index) { @@ -481,10 +488,11 @@ } /*! - \brief 一次移除多个item - \a index 开始移除item的行号 - \a count 移除从 index 指定的行号开始,移除 count 个item - \return 返回是否移除成功 + @~english + \brief Remove multiple item at a time + \param[in] index Start removing the line number of Item + \param[in] count Remove from the line number specified by index, remove the county item + \return Whether to return to remove success */ bool DListView::removeItems(int index, int count) { @@ -492,13 +500,14 @@ } /*! - \brief 此函数用于添加顶部小控件. + @~english + \brief This function is used to add top controls. - 与 DListView::getHeaderWidget 类似,但返回要移除的顶部控件的对象. - \a widget 头部控件实例. + Similar to dlistView::GetHeaderWidget, but returns the object of the top control to be removed. + \param[in] widget Head control instance. - \return 成功添加返回添加进 DListView 的索引值,已存在返回对应控件 - 的索引值. + \return Successfully adds to the index value of adding to dlistview, and the corresponding control has been returned + The index value. \sa DListView::getHeaderWidget */ @@ -547,10 +556,11 @@ } /*! - \brief 此函数用于移除头部控件小控件. + @~english + \brief This function is used to remove the head control small control. - \a index 添加进 DListView 中头部小控件 - 的索引值,是 DListView::addHeaderWidget 的返回值. + \param[in] index Add a small head control in dlistview + The index value is the return value of dlistView::addheaderWidget. \sa DListView::addFooterWidget */ @@ -563,13 +573,13 @@ } /*! - \brief 此函数用于移除头部小控件并返回该控件. - - 与 DListView::getHeaderWidget 类似,但返回要移除的顶部控件的对象 - - \a index 添加进 DListView 中头部小控件 - 的索引值,是 DListView::addHeaderWidget 的返回值. - \return 成功移除返回获取到的头部小控件,否则返回 nullptr . + @~english + \brief This function is used to remove the small control of the head and return the control. + \details Similar to Dlistview::GetHeaderWidget, but returns the object of the top control to be removed + + \param[in] index Add a small head control in dlistview + The index value is the return value of dlistView::addheaderWidget. + \return Successfully remove the small head control obtained, otherwise return nullptr. \sa DListView::getHeaderWidget */ @@ -590,11 +600,12 @@ } /*! - \brief 此函数用于添加底层页脚小控件. + @~english + \brief This function is used to add a small control small control. - \a widget 底层页脚控件实例. - \return 成功添加返回对应的索引值,如果已存在,则返回 - 对应的索引值。 + \param[in] widget the instance of control in footer + \return Successfully add the corresponding index value, if it exists, return + Corresponding index value. \sa DListView::getFooterWidget */ @@ -648,10 +659,11 @@ } /*! - \brief 此函数用于移除底层页脚控件. + @~english + \brief This function is used to remove the underlying foot-footed control. - \a index 添加进 DListView 中底层页脚控件 - 的索引值,是 DListView::addFooterWidget 的返回值. + \param[in] index Add to dlistview mid-layer footer control + Index value,It is the return value of dlistView::addfooterWidget. \sa DListView::addFooterWidget */ @@ -664,10 +676,11 @@ } /*! - \brief 移除底层页脚控件并返回该控件. + @~english + \brief Remove the bottom foot control and return to the control. - \a index 添加进 DListView 中底层页脚控件 - 的索引值,是 DListView::addFooterWidget 的返回值. + \param[in] index Add the index value of the bottom -footed control control in dlistview, + It is the return value of dlistView::addfooterWidget. \sa DListView::getFooterWidget DListView::takeHeaderWidget */ @@ -688,12 +701,14 @@ } /*! - \brief 此函数用于设置 DListView 的方向. + @~english + \brief This function is used to set the direction of dlistview - \a flow 为 DListView 的方向,有 QListView::Flow::LeftToRight 和 - QListView::Flow::TopToBottom 两个值。 + \param[in] flow The direction of dlistview,have QListView::Flow::LeftToRight and + QListView::Flow::TopToBottom - \a wrapping 用于控制项布局是否自动换行,true 表示自动换行,false 表示非自动换行。 + \param[in] wrapping Used to control whether the layout is automatically changed. + True indicates that automatic changes are replaced, and False indicates non -automatic bank. \sa DListView::orientation */ @@ -734,9 +749,10 @@ } /*! - \brief 开始编辑一个item. + @~english + \brief Edit a item. - \a index 指定要编辑的item的位置 + \param[in] index Specify the location of the Item to edit */ void DListView::edit(const QModelIndex &index) { @@ -744,9 +760,10 @@ } /*! - \brief 设定item的背景色类型. + @~english + \brief Set the background color type of item. - \a backgroundType 背景色类型 + \param[in] backgroundType Background color */ void DListView::setBackgroundType(DStyledItemDelegate::BackgroundType backgroundType) { @@ -764,9 +781,10 @@ } /*! - \brief 设定item的内容margin. + @~english + \brief Set the content of the item Margin. - \a itemMargins margin值 + \param[in] itemMargins margin value */ void DListView::setItemMargins(const QMargins &itemMargins) { @@ -776,9 +794,10 @@ } /*! - \brief 设定item的尺寸. + @~english + \brief Set the size of Item. - \a itemSize 尺寸的大小 + \param[in] itemSize itemSize */ void DListView::setItemSize(QSize itemSize) { @@ -788,9 +807,10 @@ } /*! - \brief 设定item的间距大小. + @~english + \brief Set the spacing size of Item. - \a spacing 间距大小值 + \param[in] spacing Spacing value */ void DListView::setItemSpacing(int spacing) { @@ -800,9 +820,9 @@ } /*! - \brief 设定item的圆角大小. - - \a radius 圆角大小值 + @~english + \brief Set the rounded corner size of Item. + \param[in] radius Rounded corner size value */ void DListView::setItemRadius(int radius) { diff -Nru dtkwidget-5.5.48/src/widgets/dlistview.h dtkwidget-5.6.12/src/widgets/dlistview.h --- dtkwidget-5.5.48/src/widgets/dlistview.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dlistview.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,141 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DLISTVIEW_H -#define DLISTVIEW_H - -#include - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DVariantListModel : public QAbstractListModel -{ -public: - explicit DVariantListModel(QObject *parent = 0); - - int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - bool setData(const QModelIndex &index, const QVariant &value, int role) Q_DECL_OVERRIDE; - - bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; - bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; - -private: - QList dataList; -}; - -class DListViewPrivate; -class LIBDTKWIDGETSHARED_EXPORT DListView : public QListView, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - /// item count. - Q_PROPERTY(int count READ count NOTIFY rowCountChanged) - /// list layout orientation - Q_PROPERTY(Qt::Orientation orientation READ orientation NOTIFY orientationChanged) - Q_PROPERTY(DStyledItemDelegate::BackgroundType backgroundType READ backgroundType WRITE setBackgroundType) - Q_PROPERTY(QMargins itemMargins READ itemMargins WRITE setItemMargins) - Q_PROPERTY(QSize itemSize READ itemSize WRITE setItemSize) - -public: - explicit DListView(QWidget *parent = 0); - - State state() const; - - QWidget *getHeaderWidget(int index) const; - QWidget *getFooterWidget(int index) const; - - /// return true if rect intersects contentsVisualRect+qMax(cacheBuffer,cacheCount) - bool isActiveRect(const QRect &rect) const; - bool isVisualRect(const QRect &rect) const; - - int count() const; - - Qt::Orientation orientation() const; - - void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; - QSize minimumSizeHint() const Q_DECL_OVERRIDE; - - DStyledItemDelegate::BackgroundType backgroundType() const; - QMargins itemMargins() const; - QSize itemSize() const; - - using QListView::contentsSize; - using QListView::setViewportMargins; - -public Q_SLOTS: - bool addItem(const QVariant &data); - bool addItems(const QVariantList &datas); - bool insertItem(int index, const QVariant &data); - bool insertItems(int index, const QVariantList &datas); - bool removeItem(int index); - bool removeItems(int index, int count); - - int addHeaderWidget(QWidget *widget); - void removeHeaderWidget(int index); - QWidget *takeHeaderWidget(int index); - int addFooterWidget(QWidget *widget); - void removeFooterWidget(int index); - QWidget *takeFooterWidget(int index); - - void setOrientation(QListView::Flow flow, bool wrapping); - void edit(const QModelIndex &index); - - void setBackgroundType(DStyledItemDelegate::BackgroundType backgroundType); - void setItemMargins(const QMargins &itemMargins); - void setItemSize(QSize itemSize); - void setItemSpacing(int spacing); - void setItemRadius(int radius); - -Q_SIGNALS: - void rowCountChanged(); - void orientationChanged(Qt::Orientation orientation); - void currentChanged(const QModelIndex &previous); - void triggerEdit(const QModelIndex &index); - -protected: -#if(QT_VERSION < 0x050500) - void setViewportMargins(int left, int top, int right, int bottom); - void setViewportMargins(const QMargins &margins); - QMargins viewportMargins() const; -#endif - - void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; - void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) Q_DECL_OVERRIDE; - bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event) Q_DECL_OVERRIDE; - - QStyleOptionViewItem viewOptions() const override; - virtual QModelIndex moveCursor(CursorAction cursorAction, - Qt::KeyboardModifiers modifiers) override; - QSize viewportSizeHint() const override; - int horizontalOffset() const override; - -private: - void setFlow(QListView::Flow flow); - void setWrapping(bool enable); - - D_DECLARE_PRIVATE(DListView) -}; - -DWIDGET_END_NAMESPACE - -#endif // DLISTVIEW_H diff -Nru dtkwidget-5.5.48/src/widgets/DListWidget dtkwidget-5.6.12/src/widgets/DListWidget --- dtkwidget-5.5.48/src/widgets/DListWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DListWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/dloadingindicator.cpp dtkwidget-5.6.12/src/widgets/dloadingindicator.cpp --- dtkwidget-5.5.48/src/widgets/dloadingindicator.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dloadingindicator.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/src/widgets/dloadingindicator.h dtkwidget-5.6.12/src/widgets/dloadingindicator.h --- dtkwidget-5.5.48/src/widgets/dloadingindicator.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dloadingindicator.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DLOADINGINDICATOR_H -#define DLOADINGINDICATOR_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DLoadingIndicatorPrivate; -class LIBDTKWIDGETSHARED_EXPORT DLoadingIndicator : public QGraphicsView, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor DESIGNABLE true SCRIPTABLE true) - Q_PROPERTY(bool loading READ loading WRITE setLoading) - Q_PROPERTY(bool smooth READ smooth WRITE setSmooth) - Q_PROPERTY(QPixmap imageSource READ imageSource WRITE setImageSource) - Q_PROPERTY(QWidget* widgetSource READ widgetSource WRITE setWidgetSource) - Q_PROPERTY(int aniDuration READ aniDuration WRITE setAniDuration) - Q_PROPERTY(QEasingCurve::Type aniEasingType READ aniEasingType WRITE setAniEasingType) - Q_PROPERTY(RotationDirection direction READ direction WRITE setDirection NOTIFY directionChanged) - Q_PROPERTY(qreal rotate READ rotate WRITE setRotate NOTIFY rotateChanged) - -public: - /*! - * \brief The RotationDirection enum contains the possible rotation - * directions of the DLoadingIndicator widget. - */ - enum RotationDirection{ - Clockwise, /*!< the rotation is clockwise */ - Counterclockwise /*!< the rotation is counterclockwise */ - }; - - Q_ENUMS(RotationDirection) - - DLoadingIndicator(QWidget * parent = 0); - ~DLoadingIndicator(); - - QColor backgroundColor() const; - bool loading() const; - QWidget* widgetSource() const; - QPixmap imageSource() const; - int aniDuration() const; - QEasingCurve::Type aniEasingType() const; - QSize sizeHint() const Q_DECL_OVERRIDE; - bool smooth() const; - RotationDirection direction() const; - qreal rotate() const; - -public Q_SLOTS: - void start(); - void stop(); - void setLoading(bool flag); - void setAniDuration(int msecs); - void setAniEasingCurve(const QEasingCurve & easing); - void setBackgroundColor(const QColor &color); - void setRotate(QVariant angle); - void setWidgetSource(QWidget* widgetSource); - void setImageSource(const QPixmap &imageSource); - void setAniEasingType(QEasingCurve::Type aniEasingType); - void setSmooth(bool smooth); - void setDirection(RotationDirection direction); - -Q_SIGNALS: - void directionChanged(RotationDirection direction); - void rotateChanged(qreal rotate); - -protected: - void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; - -private: - D_DECLARE_PRIVATE(DLoadingIndicator) -}; - -DWIDGET_END_NAMESPACE - -#endif // DLOADINGINDICATOR_H diff -Nru dtkwidget-5.5.48/src/widgets/DMainWindow dtkwidget-5.6.12/src/widgets/DMainWindow --- dtkwidget-5.5.48/src/widgets/DMainWindow 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DMainWindow 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dmainwindow.h" diff -Nru dtkwidget-5.5.48/src/widgets/dmainwindow.cpp dtkwidget-5.6.12/src/widgets/dmainwindow.cpp --- dtkwidget-5.5.48/src/widgets/dmainwindow.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dmainwindow.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,26 +1,16 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dmainwindow.h" #include "dplatformwindowhandle.h" #include "dapplication.h" #include "dtitlebar.h" #include "dmessagemanager.h" - +#include "DBlurEffectWidget" +#include "dsizemode.h" +#include "dfeaturedisplaydialog.h" +#include "denhancedwidget.h" #include "private/dmainwindow_p.h" #include "private/dapplication_p.h" @@ -29,6 +19,12 @@ #include #include #include +#include +#include +#include +#include + +#include #ifdef Q_OS_MAC #include "osxwindow.h" @@ -131,13 +127,23 @@ if (!titleShadow) return; - QRect rect(0, titlebar->geometry().bottom() + 1, q->width(), titleShadow->sizeHint().height()); + int x = (sidebarHelper && sidebarHelper->expanded()) ? sidebarHelper->width() : 0; + QRect rect(x, titlebar->geometry().bottom() + 1, q->width(), titleShadow->sizeHint().height()); titleShadow->setGeometry(rect); // 全凭时会隐藏窗口标题栏,因此不应该显示标题栏的阴影 titleShadow->setVisible(!q->isFullScreen()); titleShadow->raise(); } +void DMainWindowPrivate::_q_autoShowFeatureDialog() +{ + D_QC(DMainWindow); + if (q->windowHandle()->isActive()) { + qApp->featureDisplayDialog()->show(); + q->disconnect(q->windowHandle(), SIGNAL(activeChanged()), q, SLOT(_q_autoShowFeatureDialog())); + } +} + /*! \class Dtk::Widget::DMainWindow \inmodule dtkwidget @@ -165,6 +171,18 @@ if (DGuiApplicationHelper::isTabletEnvironment()) { setWindowFlags(windowFlags() & ~(Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint)); } + DConfig config("org.deepin.dtkwidget.feature-display"); + bool isAutoDisplayFeature = config.value("autoDisplayFeature", false).toBool(); + if (isAutoDisplayFeature) { + connect(this->windowHandle(), SIGNAL(activeChanged()), this, SLOT(_q_autoShowFeatureDialog())); + config.setValue("autoDisplayFeature", false); + } + + D_D(DMainWindow); + DEnhancedWidget *hanceedWidget = new DEnhancedWidget(d->titlebar, parent); + connect(hanceedWidget, &DEnhancedWidget::heightChanged, hanceedWidget, [d]() { + d->updateTitleShadowGeometry(); + }); } /*! @@ -178,6 +196,95 @@ return d->titlebar; } +void DMainWindow::setSidebarWidget(QWidget *widget) +{ + D_D(DMainWindow); + if (d->sidebarWidget == widget) + return; + + d->sidebarWidget = widget; + d->sidebarWidget->setAutoFillBackground(true); + d->sidebarWidget->setBackgroundRole(DPalette::Button); + if (!d->sidebarHelper) { + d->sidebarHelper = new DSidebarHelper(this); + d->titlebar->setSidebarHelper(d->sidebarHelper); + QToolBar *tb = new QToolBar(this); + tb->setMovable(false); + tb->setForegroundRole(QPalette::Base); + auto *contentAction = tb->toggleViewAction(); + contentAction->setVisible(false); + addToolBar(Qt::LeftToolBarArea, tb); + widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + tb->addWidget(widget); + widget->resize(tb->size()); + + connect(d->sidebarHelper, &DSidebarHelper::widthChanged, tb, &QToolBar::setFixedWidth); + connect(d->sidebarHelper, &DSidebarHelper::expandChanged, this, [tb, d] (bool expanded) { + tb->setVisible(expanded); + d->updateTitleShadowGeometry(); + }); + connect(d->sidebarHelper, &DSidebarHelper::visibleChanged, tb, &QToolBar::setVisible); + d->tb = tb; + } + +} + +QWidget *DMainWindow::sidebarWidget() +{ + D_DC(DMainWindow); + return d->sidebarWidget; +} + +int DMainWindow::sidebarWidth() const +{ + D_DC(DMainWindow); + if (d->sidebarHelper) + return d->sidebarHelper->width(); + return 0; +} + +void DMainWindow::setSidebarWidth(int width) +{ + D_D(DMainWindow); + if (d->sidebarHelper) + d->sidebarHelper->setWidth(width); +} + +bool DMainWindow::sidebarVisble() const +{ + return sidebarVisible(); +} + +bool DMainWindow::sidebarVisible() const +{ + D_DC(DMainWindow); + if (d->sidebarHelper) + return d->sidebarHelper->visible(); + return false; +} + +void DMainWindow::setSidebarVisible(bool visible) +{ + D_D(DMainWindow); + if (d->sidebarHelper) + d->sidebarHelper->setVisible(visible); +} + +bool DMainWindow::sidebarExpanded() const +{ + D_DC(DMainWindow); + if (d->sidebarHelper) + return d->sidebarHelper->expanded(); + return false; +} + +void DMainWindow::setSidebarExpanded(bool expended) +{ + D_D(DMainWindow); + if (d->sidebarHelper) + d->sidebarHelper->setExpanded(expended); +} + /*! \brief DMainWindow::isDXcbWindow \return Whether this window is dxcb backended. @@ -702,12 +809,16 @@ d->updateTitleShadowGeometry(); + if (sidebarWidget()) { + sidebarWidget()->resize(d->tb->size()); + } return QMainWindow::resizeEvent(event); } void DMainWindow::changeEvent(QEvent *event) { - if (event->type() == QEvent::WindowStateChange) { + if (event->type() == QEvent::WindowStateChange || + event->type() == QEvent::StyleChange) { D_D(DMainWindow); d->updateTitleShadowGeometry(); } @@ -716,3 +827,5 @@ } DWIDGET_END_NAMESPACE + +#include "moc_dmainwindow.cpp" diff -Nru dtkwidget-5.5.48/src/widgets/dmainwindow.h dtkwidget-5.6.12/src/widgets/dmainwindow.h --- dtkwidget-5.5.48/src/widgets/dmainwindow.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dmainwindow.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DMAINWINDOW_H -#define DMAINWINDOW_H - -#include -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DMainWindowPrivate; -class DTitlebar; - -class LIBDTKWIDGETSHARED_EXPORT DMainWindow : public QMainWindow, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(int windowRadius READ windowRadius WRITE setWindowRadius NOTIFY windowRadiusChanged) - Q_PROPERTY(int borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged) - Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) - Q_PROPERTY(int shadowRadius READ shadowRadius WRITE setShadowRadius NOTIFY shadowRadiusChanged) - Q_PROPERTY(QPoint shadowOffset READ shadowOffset WRITE setShadowOffset NOTIFY shadowOffsetChanged) - Q_PROPERTY(QColor shadowColor READ shadowColor WRITE setShadowColor NOTIFY shadowColorChanged) - Q_PROPERTY(QPainterPath clipPath READ clipPath WRITE setClipPath NOTIFY clipPathChanged) - Q_PROPERTY(QRegion frameMask READ frameMask WRITE setFrameMask NOTIFY frameMaskChanged) - Q_PROPERTY(QMargins frameMargins READ frameMargins NOTIFY frameMarginsChanged) - Q_PROPERTY(bool translucentBackground READ translucentBackground WRITE setTranslucentBackground NOTIFY translucentBackgroundChanged) - Q_PROPERTY(bool enableSystemResize READ enableSystemResize WRITE setEnableSystemResize NOTIFY enableSystemResizeChanged) - Q_PROPERTY(bool enableSystemMove READ enableSystemMove WRITE setEnableSystemMove NOTIFY enableSystemMoveChanged) - Q_PROPERTY(bool enableBlurWindow READ enableBlurWindow WRITE setEnableBlurWindow NOTIFY enableBlurWindowChanged) - Q_PROPERTY(bool autoInputMaskByClipPath READ autoInputMaskByClipPath WRITE setAutoInputMaskByClipPath NOTIFY autoInputMaskByClipPathChanged) - Q_PROPERTY(bool titlebarShadowEnabled READ titlebarShadowIsEnabled WRITE setTitlebarShadowEnabled) - -public: - explicit DMainWindow(QWidget *parent = 0); - - DTitlebar *titlebar() const; - - bool isDXcbWindow() const; - - int windowRadius() const; - - int borderWidth() const; - QColor borderColor() const; - - int shadowRadius() const; - QPoint shadowOffset() const; - QColor shadowColor() const; - - QPainterPath clipPath() const; - QRegion frameMask() const; - QMargins frameMargins() const; - - bool translucentBackground() const; - bool enableSystemResize() const; - bool enableSystemMove() const; - bool enableBlurWindow() const; - bool autoInputMaskByClipPath() const; - - bool titlebarShadowIsEnabled() const; - -public Q_SLOTS: - void setWindowRadius(int windowRadius); - - void setBorderWidth(int borderWidth); - void setBorderColor(const QColor &borderColor); - - void setShadowRadius(int shadowRadius); - void setShadowOffset(const QPoint &shadowOffset); - void setShadowColor(const QColor &shadowColor); - - void setClipPath(const QPainterPath &clipPath); - void setFrameMask(const QRegion &frameMask); - - void setTranslucentBackground(bool translucentBackground); - void setEnableSystemResize(bool enableSystemResize); - void setEnableSystemMove(bool enableSystemMove); - void setEnableBlurWindow(bool enableBlurWindow); - void setAutoInputMaskByClipPath(bool autoInputMaskByClipPath); - - // TODO: remove it if there is an batter sulotion -#ifdef Q_OS_MAC - void setWindowFlags(Qt::WindowFlags type); -#endif - - void sendMessage(const QIcon &icon, const QString &message); - void sendMessage(DFloatingMessage *message); - - void setTitlebarShadowEnabled(bool titlebarShadowEnabled); - -Q_SIGNALS: - void windowRadiusChanged(); - void borderWidthChanged(); - void borderColorChanged(); - void shadowRadiusChanged(); - void shadowOffsetChanged(); - void shadowColorChanged(); - void clipPathChanged(); - void frameMaskChanged(); - void frameMarginsChanged(); - void translucentBackgroundChanged(); - void enableSystemResizeChanged(); - void enableSystemMoveChanged(); - void enableBlurWindowChanged(); - void autoInputMaskByClipPathChanged(); - -protected: - DMainWindow(DMainWindowPrivate &dd, QWidget *parent = 0); - void mouseMoveEvent(QMouseEvent *event) override; - void resizeEvent(QResizeEvent *event) override; - void changeEvent(QEvent *event) override; - -private: - D_DECLARE_PRIVATE(DMainWindow) -}; - -DWIDGET_END_NAMESPACE - -#endif // DMAINWINDOW_H diff -Nru dtkwidget-5.5.48/src/widgets/DMdiArea dtkwidget-5.6.12/src/widgets/DMdiArea --- dtkwidget-5.5.48/src/widgets/DMdiArea 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DMdiArea 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DMDIArea dtkwidget-5.6.12/src/widgets/DMDIArea --- dtkwidget-5.5.48/src/widgets/DMDIArea 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DMDIArea 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DMdiSubWindow dtkwidget-5.6.12/src/widgets/DMdiSubWindow --- dtkwidget-5.5.48/src/widgets/DMdiSubWindow 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DMdiSubWindow 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DMenu dtkwidget-5.6.12/src/widgets/DMenu --- dtkwidget-5.5.48/src/widgets/DMenu 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DMenu 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DMenuBar dtkwidget-5.6.12/src/widgets/DMenuBar --- dtkwidget-5.5.48/src/widgets/DMenuBar 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DMenuBar 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DMessageBox dtkwidget-5.6.12/src/widgets/DMessageBox --- dtkwidget-5.5.48/src/widgets/DMessageBox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DMessageBox 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DMessageManager dtkwidget-5.6.12/src/widgets/DMessageManager --- dtkwidget-5.5.48/src/widgets/DMessageManager 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DMessageManager 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dmessagemanager.h" diff -Nru dtkwidget-5.5.48/src/widgets/dmessagemanager.cpp dtkwidget-5.6.12/src/widgets/dmessagemanager.cpp --- dtkwidget-5.5.48/src/widgets/dmessagemanager.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dmessagemanager.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,5 +1,12 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dmessagemanager.h" + #include +#include + #include #include @@ -57,6 +64,29 @@ } DWIDGET_BEGIN_NAMESPACE +template +static void sendMessage_helper(DMessageManager *manager, QWidget *par, IconType icon, const QString &message) +{ + QWidget *content = par->findChild(D_MESSAGE_MANAGER_CONTENT, Qt::FindDirectChildrenOnly); + int text_message_count = 0; + + for (DFloatingMessage *message : content->findChildren(QString(), Qt::FindDirectChildrenOnly)) { + if (message->messageType() == DFloatingMessage::TransientType) { + ++text_message_count; + } + } + + // TransientType 类型的通知消息,最多只允许同时显示三个 + if (text_message_count >= 3) + return; + + DFloatingMessage *floMsg = new DFloatingMessage(DFloatingMessage::TransientType); + floMsg->setAttribute(Qt::WA_DeleteOnClose); + floMsg->setIcon(icon); + floMsg->setMessage(message); + manager->sendMessage(par, floMsg); +} + DMessageManager::DMessageManager() //私有静态构造函数 { } @@ -111,24 +141,12 @@ */ void DMessageManager::sendMessage(QWidget *par, const QIcon &icon, const QString &message) { - QWidget *content = par->findChild(D_MESSAGE_MANAGER_CONTENT, Qt::FindDirectChildrenOnly); - int text_message_count = 0; - - for (DFloatingMessage *message : content->findChildren(QString(), Qt::FindDirectChildrenOnly)) { - if (message->messageType() == DFloatingMessage::TransientType) { - ++text_message_count; - } - } - - // TransientType 类型的通知消息,最多只允许同时显示三个 - if (text_message_count >= 3) - return; + sendMessage_helper(instance(), par, icon, message); +} - DFloatingMessage *floMsg = new DFloatingMessage(DFloatingMessage::TransientType); - floMsg->setAttribute(Qt::WA_DeleteOnClose); - floMsg->setIcon(icon); - floMsg->setMessage(message); - sendMessage(par, floMsg); +void DMessageManager::sendMessage(QWidget *par, const DDciIcon &icon, const QString &message) +{ + sendMessage_helper(instance(), par, icon, message); } /*! diff -Nru dtkwidget-5.5.48/src/widgets/dmessagemanager.h dtkwidget-5.6.12/src/widgets/dmessagemanager.h --- dtkwidget-5.5.48/src/widgets/dmessagemanager.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dmessagemanager.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -#ifndef DMESSAGEMANAGER_H -#define DMESSAGEMANAGER_H - -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE -class DFloatingMessage; -class DMessageManager: public QObject -{ - Q_OBJECT - -private: - DMessageManager(); //构造函数是私有的 - -public: - static DMessageManager *instance(); - - void sendMessage(QWidget *par, DFloatingMessage *floMsg); - void sendMessage(QWidget *par, const QIcon &icon, const QString &message); - bool setContentMargens(QWidget *par, const QMargins &margins); - -protected: - bool eventFilter(QObject *watched, QEvent *event) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DMESSAGEMANAGER_H diff -Nru dtkwidget-5.5.48/src/widgets/dmpriscontrol.cpp dtkwidget-5.6.12/src/widgets/dmpriscontrol.cpp --- dtkwidget-5.5.48/src/widgets/dmpriscontrol.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dmpriscontrol.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dmpriscontrol.h" #include "private/dmpriscontrol_p.h" @@ -24,6 +11,13 @@ #include #include #include +#include +#include + +static const QSize ButtonSize = {52, 52}; +static const QSize CompactButtonSize = {44, 44}; +static const QSize IconSize = {36, 36}; +static constexpr int ButtonSpacing = 80; DWIDGET_BEGIN_NAMESPACE @@ -123,12 +117,27 @@ m_nextBtn = new DFloatingButton(m_controlWidget); m_tickEffect = new DTickEffect(m_title, m_title); - m_prevBtn->setIcon(QIcon::fromTheme(":/assets/images/play_previous.svg")); + auto setButtonSize = [this] { + const QSize ActualButtonSize = DSizeModeHelper::element(CompactButtonSize, ButtonSize); + m_prevBtn->setFixedSize(ActualButtonSize); + m_playBtn->setFixedSize(ActualButtonSize); + m_nextBtn->setFixedSize(ActualButtonSize); + }; + + QObject::connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, q, [setButtonSize] { + setButtonSize(); + }); + + setButtonSize(); + m_prevBtn->setIcon(DDciIcon::fromTheme("play_previous")); m_prevBtn->setAccessibleName("DMPRISControlPrevFloatingButton"); - m_playBtn->setIcon(QIcon::fromTheme(":/assets/images/play_start.svg")); + m_playBtn->setIcon(DDciIcon::fromTheme("play_start")); m_playBtn->setAccessibleName("DMPRISControlPlayFloatingButton"); - m_nextBtn->setIcon(QIcon::fromTheme(":/assets/images/play_next.svg")); + m_nextBtn->setIcon(DDciIcon::fromTheme("play_next")); m_nextBtn->setAccessibleName("DMPRISControlNextFloatingButton"); + m_prevBtn->setIconSize(IconSize); + m_playBtn->setIconSize(IconSize); + m_nextBtn->setIconSize(IconSize); m_prevBtn->setBackgroundRole(DPalette::Button); m_playBtn->setBackgroundRole(DPalette::Button); m_nextBtn->setBackgroundRole(DPalette::Button); @@ -162,17 +171,12 @@ #ifdef QT_DEBUG m_title->setText("MPRIS Title"); - - m_nextBtn->setIcon(QIcon::fromTheme(":/assets/images/arrow_right_normal.png")); - m_playBtn->setIcon(QIcon::fromTheme(":/assets/images/arrow_right_white.png")); - m_prevBtn->setIcon(QIcon::fromTheme(":/assets/images/arrow_left_normal.png")); #endif QHBoxLayout *controlLayout = new QHBoxLayout; + controlLayout->setSpacing(ButtonSpacing); controlLayout->addWidget(m_prevBtn); - controlLayout->addStretch(); controlLayout->addWidget(m_playBtn); - controlLayout->addStretch(); controlLayout->addWidget(m_nextBtn); controlLayout->setContentsMargins(0, 5, 0, 0); m_controlWidget->setLayout(controlLayout); @@ -182,7 +186,6 @@ centralLayout->addWidget(m_titleScrollArea); centralLayout->addWidget(m_picture); centralLayout->setAlignment(m_picture, Qt::AlignCenter); -// centralLayout->addLayout(controlLayout); centralLayout->addWidget(m_controlWidget); centralLayout->setMargin(0); @@ -279,23 +282,13 @@ return; const QString stat = m_mprisInter->playbackStatus(); -#ifdef QT_DEBUG if (stat == "Playing") { m_playStatus = true; - m_playBtn->setIcon(QIcon::fromTheme(":/assets/images/arrow_right_white.png")); + m_playBtn->setIcon(DDciIcon::fromTheme("play_pause")); } else { m_playStatus = false; - m_playBtn->setIcon(QIcon::fromTheme(":/assets/images/arrow_left_white.png")); + m_playBtn->setIcon(DDciIcon::fromTheme("play_start")); } -#else - if (stat == "Playing") { - m_playStatus = true; - m_playBtn->setIcon(QIcon::fromTheme(":/assets/images/play_pause.svg")); - } else { - m_playStatus = false; - m_playBtn->setIcon(QIcon::fromTheme(":/assets/images/play_start.svg")); - } -#endif } void DMPRISControlPrivate::_q_loadMPRISPath(const QString &path) diff -Nru dtkwidget-5.5.48/src/widgets/dmpriscontrol.h dtkwidget-5.6.12/src/widgets/dmpriscontrol.h --- dtkwidget-5.5.48/src/widgets/dmpriscontrol.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dmpriscontrol.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DMPRISCONTROL_H -#define DMPRISCONTROL_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DMPRISControlPrivate; -class LIBDTKWIDGETSHARED_EXPORT DMPRISControl : public QFrame, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_DISABLE_COPY(DMPRISControl) - D_DECLARE_PRIVATE(DMPRISControl) - -public: - explicit DMPRISControl(QWidget *parent = 0); - - bool isWorking() const; - -Q_SIGNALS: - void mprisAcquired() const; - void mprisChanged() const; - void mprisLosted() const; - -public Q_SLOTS: - void setPictureVisible(bool visible); - void setPictureSize(const QSize &size); - -protected: - void showEvent(QShowEvent *event); - - D_PRIVATE_SLOT(void _q_onMetaDataChanged()) - D_PRIVATE_SLOT(void _q_onPlaybackStatusChanged()) - D_PRIVATE_SLOT(void _q_onPrevClicked()) - D_PRIVATE_SLOT(void _q_onPlayClicked()) - D_PRIVATE_SLOT(void _q_onPauseClicked()) - D_PRIVATE_SLOT(void _q_onNextClicked()) - D_PRIVATE_SLOT(void _q_loadMPRISPath(const QString &)) - D_PRIVATE_SLOT(void _q_removeMPRISPath(const QString &)) - D_PRIVATE_SLOT(void _q_onCanControlChanged(bool canControl)) -}; - -DWIDGET_END_NAMESPACE - -#endif // DMPRISCONTROL_H diff -Nru dtkwidget-5.5.48/src/widgets/DOpenGLWidget dtkwidget-5.6.12/src/widgets/DOpenGLWidget --- dtkwidget-5.5.48/src/widgets/DOpenGLWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DOpenGLWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DPageIndicator dtkwidget-5.6.12/src/widgets/DPageIndicator --- dtkwidget-5.5.48/src/widgets/DPageIndicator 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DPageIndicator 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dpageindicator.h" diff -Nru dtkwidget-5.5.48/src/widgets/dpageindicator.cpp dtkwidget-5.6.12/src/widgets/dpageindicator.cpp --- dtkwidget-5.5.48/src/widgets/dpageindicator.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dpageindicator.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dpageindicator.h" #include "private/dpageindicator_p.h" diff -Nru dtkwidget-5.5.48/src/widgets/dpageindicator.h dtkwidget-5.6.12/src/widgets/dpageindicator.h --- dtkwidget-5.5.48/src/widgets/dpageindicator.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dpageindicator.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DPAGEINDICATOR_H -#define DPAGEINDICATOR_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DPageIndicatorPrivate; -class LIBDTKWIDGETSHARED_EXPORT DPageIndicator : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_DISABLE_COPY(DPageIndicator) - D_DECLARE_PRIVATE(DPageIndicator) - Q_PROPERTY(QColor pointColor READ pointColor WRITE setPointColor DESIGNABLE true) - Q_PROPERTY(QColor secondaryPointColor READ secondaryPointColor WRITE setSecondaryPointColor DESIGNABLE true) - Q_PROPERTY(int pointRadius READ pointRadius WRITE setPointRadius) - Q_PROPERTY(int secondaryPointRadius READ secondaryPointRadius WRITE setSecondaryPointRadius) - Q_PROPERTY(int pageCount READ pageCount WRITE setPageCount) - Q_PROPERTY(int currentPage READ currentPageIndex WRITE setCurrentPage) - Q_PROPERTY(int pointDistance READ pointDistance WRITE setPointDistance) - -public: - explicit DPageIndicator(QWidget *parent = 0); - - int pageCount() const; - void setPageCount(const int count); - - void nextPage(); - void previousPage(); - void setCurrentPage(const int index); - int currentPageIndex() const; - - QColor pointColor() const; - void setPointColor(QColor color); - - QColor secondaryPointColor() const; - void setSecondaryPointColor(QColor color); - - int pointRadius() const; - void setPointRadius(int size); - - int secondaryPointRadius() const; - void setSecondaryPointRadius(int size); - - int pointDistance() const; - void setPointDistance(int distance); - -protected: - void paintEvent(QPaintEvent *e) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DPAGEINDICATOR_H diff -Nru dtkwidget-5.5.48/src/widgets/DPaletteHelper dtkwidget-5.6.12/src/widgets/DPaletteHelper --- dtkwidget-5.5.48/src/widgets/DPaletteHelper 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DPaletteHelper 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dpalettehelper.h" diff -Nru dtkwidget-5.5.48/src/widgets/dpalettehelper.cpp dtkwidget-5.6.12/src/widgets/dpalettehelper.cpp --- dtkwidget-5.5.48/src/widgets/dpalettehelper.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dpalettehelper.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/src/widgets/dpalettehelper.h dtkwidget-5.6.12/src/widgets/dpalettehelper.h --- dtkwidget-5.5.48/src/widgets/dpalettehelper.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dpalettehelper.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2020 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DPALETTEHELPER_H -#define DPALETTEHELPER_H - -#include -#include -#include - -DGUI_USE_NAMESPACE -DWIDGET_BEGIN_NAMESPACE - -class DPaletteHelperPrivate; -class DPaletteHelper : public QObject - , public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - -public: - static DPaletteHelper *instance(); - - DPalette palette(const QWidget *widget, const QPalette &base = QPalette()) const; - void setPalette(QWidget *widget, const DPalette &palette); - void resetPalette(QWidget *widget); - -private: - DPaletteHelper(QObject *parent = nullptr); - ~DPaletteHelper() override; - - bool eventFilter(QObject *watched, QEvent *event) override; - - D_DECLARE_PRIVATE(DPaletteHelper) -}; - -DWIDGET_END_NAMESPACE - -#endif // DPALETTEHELPER_H diff -Nru dtkwidget-5.5.48/src/widgets/DPasswordEdit dtkwidget-5.6.12/src/widgets/DPasswordEdit --- dtkwidget-5.5.48/src/widgets/DPasswordEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DPasswordEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dpasswordedit.h" diff -Nru dtkwidget-5.5.48/src/widgets/dpasswordedit.cpp dtkwidget-5.6.12/src/widgets/dpasswordedit.cpp --- dtkwidget-5.5.48/src/widgets/dpasswordedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dpasswordedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,22 +1,10 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dpasswordedit.h" #include "private/dpasswordedit_p.h" +#include "dsizemode.h" #include #include @@ -112,6 +100,16 @@ return d->togglePasswordVisibleButton->isVisible(); } +void DPasswordEdit::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::StyleChange) { + D_D(DPasswordEdit); + d->togglePasswordVisibleButton->setFixedWidth(d->defaultButtonWidth()); + d->togglePasswordVisibleButton->setIconSize(d->defaultIconSize()); + } + return DLineEdit::changeEvent(event); +} + DPasswordEditPrivate::DPasswordEditPrivate(DPasswordEdit *q) : DLineEditPrivate(q) { @@ -129,7 +127,8 @@ togglePasswordVisibleButton = new DSuggestButton; togglePasswordVisibleButton->setAccessibleName("DPasswordEditPasswordVisibleButton"); togglePasswordVisibleButton->setIcon(DStyle::standardIcon(q->style(), DStyle::SP_ShowPassword)); - togglePasswordVisibleButton->setIconSize(QSize(24, 24)); + togglePasswordVisibleButton->setFixedWidth(defaultButtonWidth()); + togglePasswordVisibleButton->setIconSize(defaultIconSize()); list.append(togglePasswordVisibleButton); q->setRightWidgets(list); diff -Nru dtkwidget-5.5.48/src/widgets/dpasswordedit.h dtkwidget-5.6.12/src/widgets/dpasswordedit.h --- dtkwidget-5.5.48/src/widgets/dpasswordedit.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dpasswordedit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DPASSWORDEDIT_H -#define DPASSWORDEDIT_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DPasswordEditPrivate; -class LIBDTKWIDGETSHARED_EXPORT DPasswordEdit : public DLineEdit -{ - Q_OBJECT - Q_PROPERTY(bool isEchoMode READ isEchoMode NOTIFY echoModeChanged) - -public: - DPasswordEdit(QWidget *parent = nullptr); - - bool isEchoMode() const; - void setEchoMode(QLineEdit::EchoMode mode); - - void setEchoButtonIsVisible(bool visible); - bool echoButtonIsVisible () const; - -Q_SIGNALS: - void echoModeChanged(bool echoOn); - -protected: - Q_DISABLE_COPY(DPasswordEdit) - D_DECLARE_PRIVATE(DPasswordEdit) - Q_PRIVATE_SLOT(d_func(), void _q_toggleEchoMode()) -}; - -DWIDGET_END_NAMESPACE - -#endif // DPASSWORDEDIT_H diff -Nru dtkwidget-5.5.48/src/widgets/dpicturesequenceview.cpp dtkwidget-5.6.12/src/widgets/dpicturesequenceview.cpp --- dtkwidget-5.5.48/src/widgets/dpicturesequenceview.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dpicturesequenceview.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dpicturesequenceview.h" #include "private/dpicturesequenceview_p.h" diff -Nru dtkwidget-5.5.48/src/widgets/dpicturesequenceview.h dtkwidget-5.6.12/src/widgets/dpicturesequenceview.h --- dtkwidget-5.5.48/src/widgets/dpicturesequenceview.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dpicturesequenceview.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DPICTURESEQUENCEVIEW_H -#define DPICTURESEQUENCEVIEW_H - -#include -#include - -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DPictureSequenceViewPrivate; -class LIBDTKWIDGETSHARED_EXPORT DPictureSequenceView : public QGraphicsView, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_PROPERTY(int speed READ speed WRITE setSpeed NOTIFY speedChanged) - Q_PROPERTY(bool singleShot READ singleShot WRITE setSingleShot) - -public: - DPictureSequenceView(QWidget *parent = nullptr); - - void setPictureSequence(const QString &srcFormat, const QPair &range, const int fieldWidth = 0, const bool autoScale = false); - void setPictureSequence(const QStringList &sequence, const bool autoScale = false); - void setPictureSequence(const QList &sequence, const bool autoScale = false); - void play(); - void pause(); - void stop(); - - int speed() const; - void setSpeed(int speed); - - bool singleShot() const; - void setSingleShot(bool singleShot); - -Q_SIGNALS: - void speedChanged(int speed) const; - void playEnd() const; - -private: - D_PRIVATE_SLOT(void _q_refreshPicture()) - - Q_DISABLE_COPY(DPictureSequenceView) - D_DECLARE_PRIVATE(DPictureSequenceView) -}; - -DWIDGET_END_NAMESPACE - -#endif // DPICTURESEQUENCEVIEW_H diff -Nru dtkwidget-5.5.48/src/widgets/DPlainTextEdit dtkwidget-5.6.12/src/widgets/DPlainTextEdit --- dtkwidget-5.5.48/src/widgets/DPlainTextEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DPlainTextEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DPlatformWindowHandle dtkwidget-5.6.12/src/widgets/DPlatformWindowHandle --- dtkwidget-5.5.48/src/widgets/DPlatformWindowHandle 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DPlatformWindowHandle 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dplatformwindowhandle.h" diff -Nru dtkwidget-5.5.48/src/widgets/dplatformwindowhandle.cpp dtkwidget-5.6.12/src/widgets/dplatformwindowhandle.cpp --- dtkwidget-5.5.48/src/widgets/dplatformwindowhandle.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dplatformwindowhandle.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dplatformwindowhandle.h" diff -Nru dtkwidget-5.5.48/src/widgets/dplatformwindowhandle.h dtkwidget-5.6.12/src/widgets/dplatformwindowhandle.h --- dtkwidget-5.5.48/src/widgets/dplatformwindowhandle.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dplatformwindowhandle.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DPLATFORMWINDOWHANDLE_H -#define DPLATFORMWINDOWHANDLE_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE -class QWidget; -QT_END_NAMESPACE - -DWIDGET_BEGIN_NAMESPACE - -class DPlatformWindowHandle : public DPlatformHandle -{ - Q_OBJECT - -public: - explicit DPlatformWindowHandle(QWidget *widget, QObject *parent = nullptr); - - static void enableDXcbForWindow(QWidget *widget); - static void enableDXcbForWindow(QWidget *widget, bool redirectContent); - static bool isEnabledDXcb(const QWidget *widget); - - static bool setWindowBlurAreaByWM(QWidget *widget, const QVector &area); - static bool setWindowBlurAreaByWM(QWidget *widget, const QList &paths); - static bool setWindowWallpaperParaByWM(QWidget *widget, const QRect &area, WallpaperScaleMode sMode, WallpaperFillMode fMode); - - using DPlatformHandle::setWindowBlurAreaByWM; - using DPlatformHandle::setWindowWallpaperParaByWM; -}; - -DWIDGET_END_NAMESPACE - -#endif // DPLATFORMWINDOWHANDLE_H diff -Nru dtkwidget-5.5.48/src/widgets/dprintpickcolorwidget.cpp dtkwidget-5.6.12/src/widgets/dprintpickcolorwidget.cpp --- dtkwidget-5.5.48/src/widgets/dprintpickcolorwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dprintpickcolorwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: linxun -* -* Maintainer: linxun -* -* 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 -* any later version. -* -* This program 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 . -*/ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dprintpickcolorwidget.h" #include "diconbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dprintpickcolorwidget.h dtkwidget-5.6.12/src/widgets/dprintpickcolorwidget.h --- dtkwidget-5.5.48/src/widgets/dprintpickcolorwidget.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dprintpickcolorwidget.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: linxun -* -* Maintainer: linxun -* -* 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 -* any later version. -* -* This program 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 . -*/ - -#ifndef DPRINTPICKCOLORWIDGET_H -#define DPRINTPICKCOLORWIDGET_H -#include "qdbusinterface.h" -#include -#include - -#include -#include - -class QVBoxLayout; -DWIDGET_BEGIN_NAMESPACE -class DIconButton; -class DLineEdit; -class DLabel; -class DSlider; - -class ColorButton : public DPushButton -{ - Q_OBJECT -public: - ColorButton(QColor color, QWidget *parent = nullptr); -Q_SIGNALS: - void selectColorButton(QColor color); - void btnIsChecked(bool checked); - -protected: - void paintEvent(QPaintEvent *) override; - -private: - QColor m_color; - bool m_flag = false; - bool m_checked = false; -}; -class ColorLabel : public DLabel -{ - Q_OBJECT -public: - ColorLabel(DWidget *parent = nullptr); - ~ColorLabel(); - - //h∈(0, 360), s∈(0, 1), v∈(0, 1) - QColor getColor(qreal h, qreal s, qreal v); - void setHue(int hue); - - void pickColor(QPoint pos); - QCursor pickColorCursor(); - -Q_SIGNALS: - void clicked(); - void pickedColor(QColor color); - -protected: - void paintEvent(QPaintEvent *); - void enterEvent(QEvent *e); - void leaveEvent(QEvent *e); - void mousePressEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - -private: - QCursor m_lastCursor; - int m_hue = 0; - bool m_pressed; - QColor m_pickedColor; - QPoint m_clickedPos; - QPoint m_tipPoint; -}; -class ColorSlider : public QSlider -{ - Q_OBJECT -public: - ColorSlider(QWidget *parent = nullptr); - ~ColorSlider(); - - //h∈(0, 360), s∈(0, 1), v∈(0, 1) - QColor getColor(qreal h, qreal s, qreal v); - -protected: - void paintEvent(QPaintEvent *ev); - -private: - int m_value; - QImage m_backgroundImage; -}; -class DPrintPickColorWidget : public DWidget -{ - Q_OBJECT -public: - DPrintPickColorWidget(QWidget *parent); - ~DPrintPickColorWidget(); - void initUI(); - void initConnection(); - void setRgbEdit(QColor color, bool btnColor = false); - void convertColor(QColor color, bool btnColor = false); -Q_SIGNALS: - void selectColorButton(QColor color); - void signalColorChanged(QColor color); -public Q_SLOTS: - void slotColorPick(QString uuid, QString colorName); - void slotEditColor(QString str); - -private: - QList btnlist; - QList colorList; - QButtonGroup *btnGroup; - DLineEdit *valueLineEdit; - DIconButton *pickColorBtn; - QDBusInterface *pinterface; - DLineEdit *rEdit; - DLineEdit *gEdit; - DLineEdit *bEdit; - ColorLabel *colorLabel; - ColorSlider *colorSlider; -}; -DWIDGET_END_NAMESPACE -#endif // DPRINTPICKCOLORWIDGET_H diff -Nru dtkwidget-5.5.48/src/widgets/DPrintPreviewDialog dtkwidget-5.6.12/src/widgets/DPrintPreviewDialog --- dtkwidget-5.5.48/src/widgets/DPrintPreviewDialog 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DPrintPreviewDialog 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dprintpreviewdialog.h" diff -Nru dtkwidget-5.5.48/src/widgets/dprintpreviewdialog.cpp dtkwidget-5.6.12/src/widgets/dprintpreviewdialog.cpp --- dtkwidget-5.5.48/src/widgets/dprintpreviewdialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dprintpreviewdialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dprintpreviewdialog.h" #include "private/dprintpreviewdialog_p.h" @@ -23,6 +27,7 @@ #include #include #include +#include #include #include @@ -75,6 +80,41 @@ DWIDGET_BEGIN_NAMESPACE +static QLatin1String _d_printSettingNameMap[DPrintPreviewSettingInterface::SC_ControlCount] = { + QLatin1String("PrinterFrame"), + QLatin1String("CopyCountFrame"), + QLatin1String("PageRangeFrame"), + QLatin1String("PageRangeTypeWidget"), + QLatin1String("CustomPageEdit"), + QLatin1String("OrientationBackgroundGroup"), + QLatin1String("PaperSizeFrame"), + QLatin1String("DuplexFrame"), + QLatin1String("DuplexTypeComboBox"), + QLatin1String("N-UpFrame"), + QLatin1String("N-UpNumberComboBox"), + QLatin1String("N-UpButtonWidget"), + QLatin1String("PrintOrderBackgroundGroup"), + QLatin1String("PrintOrderSequentialPrintWidget"), + QLatin1String("PrintOrderTypeComboBox"), + QLatin1String("ColorModeFrame"), + QLatin1String("MarginsFrame"), + QLatin1String("MarginsTypeComboBox"), + QLatin1String("MarginsAdjustWidget"), + QLatin1String("ScalingContentBackgroundGroup"), + QLatin1String("WaterMarkFrame"), + QLatin1String("WaterMarkContentFrame"), + QLatin1String("WaterMarkTypeBackgroundGroup"), + QLatin1String("WaterMarkTextTypeComboBox"), + QLatin1String("WaterMarkCustomTextEdit"), + QLatin1String("WaterMarkTextFontComboBox"), + QLatin1String("WaterMarkTextColorButton"), + QLatin1String("WaterMarkImagePathEdit"), + QLatin1String("WaterMarkLayoutFrame"), + QLatin1String("WaterMarkAngleFrame"), + QLatin1String("WaterMarkSizeFrame"), + QLatin1String("WaterMarkTransparencyFrame"), +}; + void setwidgetfont(QWidget *widget, DFontSizeManager::SizeType type = DFontSizeManager::T5) { QFont font = widget->font(); @@ -102,6 +142,8 @@ Q_Q(DPrintPreviewDialog); this->printer = new DPrinter; + this->settingHelper = new PreviewSettingsPluginHelper(this); + PreviewSettingsPluginHelper::loadPlugin(); if (qApp) qApp->installEventFilter(q); @@ -230,6 +272,7 @@ scrollarea->setWidgetResizable(true); scrollarea->setFrameShape(QFrame::NoFrame); scrollarea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + scrollarea->setBackgroundRole(QPalette::Base); advancesettingwdg->hide(); advanceBtn = new DPushButton(qApp->translate("DPrintPreviewDialogPrivate", "Advanced")); @@ -282,31 +325,36 @@ //打印机选择 DFrame *printerFrame = new DFrame(basicsettingwdg); + printerFrame->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_PrinterWidget]); layout->addWidget(printerFrame); printerFrame->setMinimumSize(WIDTH_NORMAL, HEIGHT_NORMAL); setfrmaeback(printerFrame); QHBoxLayout *printerlayout = new QHBoxLayout(printerFrame); printerlayout->setContentsMargins(10, 0, 10, 0); DLabel *printerlabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Printer"), printerFrame); + printerlabel->setSizePolicy(QSizePolicy::Maximum, printerlabel->sizePolicy().verticalPolicy()); printDeviceCombo = new DComboBox(basicsettingwdg); printerlayout->addWidget(printerlabel, 4); + printerlayout->addStretch(1); printerlayout->addWidget(printDeviceCombo, 9); printerlayout->setAlignment(printDeviceCombo, Qt::AlignVCenter); //打印份数 DFrame *copycountFrame = new DFrame(basicsettingwdg); - copycountFrame->setObjectName("copucountframe"); + copycountFrame->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_CopiesWidget]); layout->addWidget(copycountFrame); copycountFrame->setMinimumSize(WIDTH_NORMAL, HEIGHT_NORMAL); setfrmaeback(copycountFrame); QHBoxLayout *copycountlayout = new QHBoxLayout(copycountFrame); copycountlayout->setContentsMargins(10, 0, 10, 0); DLabel *copycountlabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Copies"), copycountFrame); + copycountlabel->setSizePolicy(QSizePolicy::Maximum, copycountlabel->sizePolicy().verticalPolicy()); copycountspinbox = new DSpinBox(copycountFrame); copycountspinbox->setEnabledEmbedStyle(true); copycountspinbox->setRange(1, 999); copycountspinbox->installEventFilter(q); copycountlayout->addWidget(copycountlabel, 4); + copycountlayout->addStretch(1); copycountlayout->addWidget(copycountspinbox, 9); QRegExp re("^[1-9][0-9][0-9]$"); @@ -315,23 +363,29 @@ //页码范围 DFrame *pageFrame = new DFrame(basicsettingwdg); - pageFrame->setObjectName("pageFrame"); + pageFrame->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_PageRangeWidget]); layout->addWidget(pageFrame); pageFrame->setMinimumSize(WIDTH_NORMAL, 94); setfrmaeback(pageFrame); QVBoxLayout *pagelayout = new QVBoxLayout(pageFrame); pagelayout->setContentsMargins(10, 5, 10, 5); DLabel *pagerangelabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Page range"), pageFrame); + pagerangelabel->setSizePolicy(QSizePolicy::Maximum, printerlabel->sizePolicy().verticalPolicy()); pageRangeCombo = new DComboBox(pageFrame); pageRangeCombo->addItem(qApp->translate("DPrintPreviewDialogPrivate", "All")); pageRangeCombo->addItem(qApp->translate("DPrintPreviewDialogPrivate", "Current page")); pageRangeCombo->addItem(qApp->translate("DPrintPreviewDialogPrivate", "Select pages")); - QHBoxLayout *hrangebox = new QHBoxLayout(); + QWidget *hrangeWidget = new QWidget(q); + hrangeWidget->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_PageRange_TypeControl]); + QHBoxLayout *hrangebox = new QHBoxLayout(hrangeWidget); + hrangebox->setMargin(0); hrangebox->addWidget(pagerangelabel, 4); + hrangebox->addStretch(1); hrangebox->addWidget(pageRangeCombo, 9); pageRangeEdit = new DLineEdit; - pagelayout->addLayout(hrangebox); + pageRangeEdit->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_PageRange_SelectEdit]); + pagelayout->addWidget(hrangeWidget); pagelayout->addWidget(pageRangeEdit); pageRangeEdit->installEventFilter(q); @@ -341,6 +395,7 @@ //打印方向 DLabel *orientationLabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Orientation"), basicsettingwdg); + orientationLabel->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_OrientationWidget]); setwidgetfont(orientationLabel); QHBoxLayout *orientationtitlelayout = new QHBoxLayout; orientationtitlelayout->setContentsMargins(10, 0, 0, 0); @@ -383,7 +438,7 @@ orientationlayout->addWidget(portraitwdg); orientationlayout->addWidget(landscapewdg); DBackgroundGroup *back = new DBackgroundGroup(orientationlayout); - back->setObjectName("OrientationBackgroundGroup"); + back->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_OrientationWidget]); back->setItemSpacing(2); DPalette pa = DPaletteHelper::instance()->palette(back); pa.setBrush(DPalette::Base, pa.itemBackground()); @@ -406,33 +461,42 @@ setwidgetfont(pagesLabel, DFontSizeManager::T5); QHBoxLayout *pagestitlelayout = new QHBoxLayout; pagestitlelayout->setContentsMargins(10, 20, 0, 0); - pagestitlelayout->addWidget(pagesLabel, Qt::AlignLeft | Qt::AlignBottom); + pagestitlelayout->addWidget(pagesLabel); + pagestitlelayout->setAlignment(pagesLabel, Qt::AlignLeft | Qt::AlignBottom); DFrame *colorframe = new DFrame; + colorframe->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_ColorModeWidget]); setfrmaeback(colorframe); colorframe->setFixedHeight(HEIGHT_NORMAL); QHBoxLayout *colorlayout = new QHBoxLayout(colorframe); DLabel *colorlabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Color mode")); + colorlabel->setSizePolicy(QSizePolicy::Maximum, colorlabel->sizePolicy().verticalPolicy()); colorModeCombo = new DComboBox; colorModeCombo->addItems(QStringList() << qApp->translate("DPrintPreviewDialogPrivate", "Color") << qApp->translate("DPrintPreviewDialogPrivate", "Grayscale")); colorlayout->addWidget(colorlabel, 4); + colorlayout->addStretch(1); colorlayout->addWidget(colorModeCombo, 9); colorlayout->setContentsMargins(10, 4, 10, 4); DFrame *marginsframe = new DFrame; - marginsframe->setObjectName("marginsFrame"); + marginsframe->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_MarginWidget]); setfrmaeback(marginsframe); QVBoxLayout *marginslayout = new QVBoxLayout(marginsframe); marginslayout->setContentsMargins(10, 5, 10, 5); QHBoxLayout *marginscombolayout = new QHBoxLayout; DLabel *marginlabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Margins")); + marginlabel->setSizePolicy(QSizePolicy::Maximum, marginlabel->sizePolicy().verticalPolicy()); marginsCombo = new DComboBox; + marginsCombo->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Margin_TypeControl]); marginsCombo->addItems(QStringList() << qApp->translate("DPrintPreviewDialogPrivate", "Narrow (mm)") << qApp->translate("DPrintPreviewDialogPrivate", "Normal (mm)") << qApp->translate("DPrintPreviewDialogPrivate", "Moderate (mm)") << qApp->translate("DPrintPreviewDialogPrivate", "Customize (mm)")); marginscombolayout->addWidget(marginlabel, 4); + marginscombolayout->addStretch(1); marginscombolayout->addWidget(marginsCombo, 9); - QHBoxLayout *marginsspinlayout = new QHBoxLayout; - marginsspinlayout->setContentsMargins(0, 0, 0, 0); + QWidget *marginSpinWidget = new QWidget(q); + marginSpinWidget->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Margin_AdjustContol]); + QHBoxLayout *marginsspinlayout = new QHBoxLayout(marginSpinWidget); + DLabel *toplabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Top")); marginTopSpin = new DDoubleSpinBox; marginTopSpin->installEventFilter(q); @@ -467,8 +531,10 @@ marginsspinlayout->addLayout(marginsspinboxlayout1); marginsspinlayout->addLayout(marginslabellayout2); marginsspinlayout->addLayout(marginsspinboxlayout2); + marginslayout->setSpacing(0); marginslayout->addLayout(marginscombolayout); - marginslayout->addLayout(marginsspinlayout); + marginslayout->addSpacing(10); + marginslayout->addWidget(marginSpinWidget); QRegExp reg("^([5-5][0-4]|[1-4][0-9]|[0-9])?(\\.[0-9][0-9])|55(\\.[8-8][0-8])|55(\\.[0-7][0-9])"); QRegExpValidator *val = new QRegExpValidator(reg, marginsframe); @@ -488,9 +554,12 @@ QVBoxLayout *scalinglayout = new QVBoxLayout; scalinglayout->setContentsMargins(10, 0, 10, 0); DLabel *scalingLabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Scaling"), advancesettingwdg); + scalingLabel->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_ScalingWidget]); QHBoxLayout *scalingtitlelayout = new QHBoxLayout; scalingtitlelayout->setContentsMargins(10, 20, 0, 0); - scalingtitlelayout->addWidget(scalingLabel, Qt::AlignLeft | Qt::AlignBottom); + scalingtitlelayout->addWidget(scalingLabel); + scalingtitlelayout->setAlignment(scalingLabel, Qt::AlignLeft | Qt::AlignBottom); + setwidgetfont(scalingLabel, DFontSizeManager::T5); scaleGroup = new QButtonGroup(q); @@ -530,7 +599,7 @@ scalingcontentlayout->addWidget(customscalewdg); DBackgroundGroup *back = new DBackgroundGroup(scalingcontentlayout); - back->setObjectName("ScalingContentBackgroundGroup"); + back->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_ScalingWidget]); back->setItemSpacing(1); DPalette pa = DPaletteHelper::instance()->palette(back); pa.setBrush(DPalette::Base, pa.itemBackground()); @@ -542,19 +611,24 @@ QVBoxLayout *paperlayout = new QVBoxLayout; paperlayout->setContentsMargins(10, 0, 10, 0); DLabel *paperLabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Paper"), advancesettingwdg); + paperLabel->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_PaperSizeWidget]); setwidgetfont(paperLabel, DFontSizeManager::T5); QHBoxLayout *papertitlelayout = new QHBoxLayout; papertitlelayout->setContentsMargins(10, 0, 0, 0); - papertitlelayout->addWidget(paperLabel, Qt::AlignLeft | Qt::AlignBottom); + papertitlelayout->addWidget(paperLabel); + papertitlelayout->setAlignment(paperLabel, Qt::AlignLeft | Qt::AlignBottom); DFrame *paperframe = new DFrame; + paperframe->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_PaperSizeWidget]); setfrmaeback(paperframe); paperframe->setFixedHeight(HEIGHT_NORMAL); QHBoxLayout *paperframelayout = new QHBoxLayout(paperframe); DLabel *papersizelabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Paper size")); + papersizelabel->setSizePolicy(QSizePolicy::Maximum, papersizelabel->sizePolicy().verticalPolicy()); paperSizeCombo = new DComboBox; paperSizeCombo->setFixedHeight(36); paperframelayout->addWidget(papersizelabel, 4); + paperframelayout->addStretch(1); paperframelayout->addWidget(paperSizeCombo, 9); paperframelayout->setContentsMargins(10, 4, 10, 4); paperlayout->addLayout(papertitlelayout); @@ -568,13 +642,16 @@ setwidgetfont(drawingLabel, DFontSizeManager::T5); QHBoxLayout *drawingtitlelayout = new QHBoxLayout; drawingtitlelayout->setContentsMargins(10, 20, 0, 0); - drawingtitlelayout->addWidget(drawingLabel, Qt::AlignLeft | Qt::AlignBottom); + drawingtitlelayout->addWidget(drawingLabel); + drawingtitlelayout->setAlignment(drawingLabel, Qt::AlignLeft | Qt::AlignBottom); DFrame *duplexframe = new DFrame; + duplexframe->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_DuplexWidget]); setfrmaeback(duplexframe); duplexframe->setFixedHeight(HEIGHT_NORMAL); QHBoxLayout *duplexlayout = new QHBoxLayout(duplexframe); duplexCombo = new DComboBox; + duplexCombo->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Duplex_TypeControl]); duplexCheckBox = new DCheckBox(qApp->translate("DPrintPreviewDialogPrivate", "Duplex")); duplexCombo->setFixedHeight(36); duplexlayout->setContentsMargins(5, 5, 10, 5); @@ -583,13 +660,14 @@ //并列打印 DFrame *sidebysideframe = new DFrame; - sidebysideframe->setObjectName("btnframe"); + sidebysideframe->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_NPrintWidget]); setfrmaeback(sidebysideframe); QVBoxLayout *sidebysideframelayout = new QVBoxLayout(sidebysideframe); sidebysideframelayout->setContentsMargins(0, 0, 0, 0); QHBoxLayout *pagepersheetlayout = new QHBoxLayout; sidebysideCheckBox = new DCheckBox(qApp->translate("DPrintPreviewDialogPrivate", "N-up printing")); pagePerSheetCombo = new DComboBox; + pagePerSheetCombo->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_NPrint_Numbers]); pagePerSheetCombo->addItems(QStringList() << qApp->translate("DPrintPreviewDialogPrivate", "2 pages/sheet, 1×2") << qApp->translate("DPrintPreviewDialogPrivate", "4 pages/sheet, 2×2") << qApp->translate("DPrintPreviewDialogPrivate", "6 pages/sheet, 2×3") << qApp->translate("DPrintPreviewDialogPrivate", "9 pages/sheet, 3×3") << qApp->translate("DPrintPreviewDialogPrivate", "16 pages/sheet, 4×4")); pagePerSheetCombo->setFixedHeight(36); pagepersheetlayout->setContentsMargins(5, 5, 10, 5); @@ -597,7 +675,10 @@ pagepersheetlayout->addWidget(pagePerSheetCombo, 9); sidebysideframelayout->addLayout(pagepersheetlayout); - QHBoxLayout *printdirectlayout = new QHBoxLayout; + QWidget *printDirectWidget = new QWidget(q); + printDirectWidget->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_NPrint_Layout]); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_NPrint_Layout, false); + QHBoxLayout *printdirectlayout = new QHBoxLayout(printDirectWidget); printdirectlayout->setContentsMargins(0, 0, 10, 5); DLabel *directlabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Layout direction")); DToolButton *lrtbBtn = new DToolButton; @@ -626,14 +707,13 @@ btnLayout->addWidget(repeatBtn); printdirectlayout->addWidget(directlabel, 2); printdirectlayout->addWidget(btnWidget, 5); - sidebysideframelayout->addLayout(printdirectlayout); + sidebysideframelayout->addWidget(printDirectWidget); QList listBtn = btnWidget->findChildren(); int num = 0; for (DToolButton *btn : listBtn) { btn->setIconSize(QSize(18, 18)); btn->setFixedSize(QSize(36, 36)); btn->setCheckable(true); - btn->setEnabled(false); directGroup->addButton(btn, num); num++; } @@ -645,10 +725,12 @@ QVBoxLayout *orderlayout = new QVBoxLayout; orderlayout->setContentsMargins(10, 0, 10, 0); DLabel *orderLabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Page Order"), advancesettingwdg); + orderLabel->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_PageOrderWidget]); setwidgetfont(orderLabel, DFontSizeManager::T5); QHBoxLayout *ordertitlelayout = new QHBoxLayout; ordertitlelayout->setContentsMargins(0, 20, 0, 0); - ordertitlelayout->addWidget(orderLabel, Qt::AlignLeft | Qt::AlignBottom); + ordertitlelayout->addWidget(orderLabel); + ordertitlelayout->setAlignment(orderLabel, Qt::AlignLeft | Qt::AlignBottom); QVBoxLayout *ordercontentlayout = new QVBoxLayout; ordercontentlayout->setContentsMargins(0, 0, 0, 0); @@ -659,12 +741,13 @@ collatelayout->addWidget(printCollateRadio); printCollateRadio->setChecked(true); inorderwdg = new DWidget; - inorderwdg->setObjectName("InorderWidget"); + inorderwdg->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_PageOrder_SequentialPrint]); QHBoxLayout *inorderlayout = new QHBoxLayout(inorderwdg); printInOrderRadio = new DRadioButton(qApp->translate("DPrintPreviewDialogPrivate", "Print pages in order")); //按顺序打印 inorderCombo = new DComboBox; + inorderCombo->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_PageOrder_TypeControl]); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageOrder_TypeControl, false); inorderCombo->addItems(QStringList() << qApp->translate("DPrintPreviewDialogPrivate", "Front to back") << qApp->translate("DPrintPreviewDialogPrivate", "Back to front")); - inorderCombo->setEnabled(false); inorderlayout->addWidget(printInOrderRadio, 4); inorderlayout->addWidget(inorderCombo, 9); @@ -676,6 +759,7 @@ printOrderGroup->addButton(printInOrderRadio, 1); DBackgroundGroup *backorder = new DBackgroundGroup(ordercontentlayout); + backorder->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_PageOrderWidget]); backorder->setItemSpacing(1); pa = DPaletteHelper::instance()->palette(backorder); pa.setBrush(DPalette::Base, pa.itemBackground()); @@ -688,24 +772,30 @@ QVBoxLayout *watermarklayout = new QVBoxLayout; watermarklayout->setContentsMargins(10, 0, 10, 0); DLabel *watermarkLabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Watermark"), advancesettingwdg); + watermarkLabel->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_WatermarkWidget]); QHBoxLayout *watermarktitlelayout = new QHBoxLayout; watermarktitlelayout->setContentsMargins(10, 20, 0, 0); - watermarktitlelayout->addWidget(watermarkLabel, Qt::AlignLeft | Qt::AlignBottom); + watermarktitlelayout->addWidget(watermarkLabel); + watermarktitlelayout->setAlignment(watermarkLabel, Qt::AlignLeft | Qt::AlignBottom); + setwidgetfont(watermarkLabel, DFontSizeManager::T5); DFrame *watermarkframe = new DFrame; - watermarkframe->setObjectName("WaterMarkFrame"); + watermarkframe->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_WatermarkWidget]); setfrmaeback(watermarkframe); QHBoxLayout *texttypelayout = new QHBoxLayout; texttypelayout->setContentsMargins(10, 10, 10, 10); DLabel *addlabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Add watermark")); + addlabel->setSizePolicy(QSizePolicy::Maximum, addlabel->sizePolicy().verticalPolicy()); waterMarkBtn = new DSwitchButton; waterMarkBtn->setChecked(false); texttypelayout->addWidget(addlabel, Qt::AlignLeft); + texttypelayout->addStretch(1); texttypelayout->addWidget(waterMarkBtn, Qt::AlignRight); watermarkframe->setLayout(texttypelayout); watermarksettingwdg = new DWidget; + watermarksettingwdg->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_WatermarkContentWidget]); watermarksettingwdg->setMinimumWidth(WIDTH_NORMAL); initWaterMarkui(); watermarksettingwdg->hide(); @@ -732,32 +822,38 @@ vContentLayout->setContentsMargins(0, 5, 0, 5); vContentLayout->setSpacing(10); QVBoxLayout *vWatertypeLayout = new QVBoxLayout; + vWatertypeLayout->setContentsMargins(0, 0, 0, 0); textWatermarkWdg = new DWidget; picWatermarkWdg = new DWidget; vWatertypeLayout->addWidget(textWatermarkWdg); vWatertypeLayout->addWidget(picWatermarkWdg); QVBoxLayout *textVlayout = new QVBoxLayout; - textVlayout->setContentsMargins(0, 0, 5, 0); + textVlayout->setContentsMargins(9, 9, 14, 9); QHBoxLayout *hlayout1 = new QHBoxLayout; DRadioButton *textBtn = new DRadioButton(qApp->translate("DPrintPreviewDialogPrivate", "Text watermark")); waterTextCombo = new DComboBox; + waterTextCombo->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Watermark_TextType]); + waterTextCombo->addItems(QStringList() << qApp->translate("DPrintPreviewDialogPrivate", "Confidential") << qApp->translate("DPrintPreviewDialogPrivate", "Draft") << qApp->translate("DPrintPreviewDialogPrivate", "Sample") << qApp->translate("DPrintPreviewDialogPrivate", "Custom")); hlayout1->addWidget(textBtn, 4); hlayout1->addWidget(waterTextCombo, 9); QHBoxLayout *hlayout2 = new QHBoxLayout; waterTextEdit = new DLineEdit; - waterTextEdit->setEnabled(false); + waterTextEdit->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Watermark_CustomText]); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_CustomText, false); waterTextEdit->lineEdit()->setMaxLength(16); waterTextEdit->lineEdit()->setPlaceholderText(qApp->translate("DPrintPreviewDialogPrivate", "Input your text")); - hlayout2->addWidget(new DLabel, 4); - hlayout2->addWidget(waterTextEdit, 9); + hlayout2->addStretch(5); + hlayout2->addWidget(waterTextEdit, 10); QHBoxLayout *hlayout3 = new QHBoxLayout; fontCombo = new DComboBox; + fontCombo->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Watermark_TextFont]); waterColorBtn = new DIconButton(textWatermarkWdg); + waterColorBtn->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Watermark_TextColor]); waterColorBtn->setFixedSize(36, 36); waterColor = QColor("#6f6f6f"); _q_selectColorButton(waterColor); @@ -772,9 +868,10 @@ textWatermarkWdg->setLayout(textVlayout); QHBoxLayout *picHlayout = new QHBoxLayout; - picHlayout->setContentsMargins(0, 0, 5, 0); + picHlayout->setContentsMargins(9, 9, 14, 9); DRadioButton *picBtn = new DRadioButton(qApp->translate("DPrintPreviewDialogPrivate", "Picture watermark")); picPathEdit = new DFileChooserEdit; + picPathEdit->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Watermark_ImageEdit]); picPathEdit->setNameFilters(QStringList() << "*.png *.jpg"); QString desktopPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); picPathEdit->setDirectoryUrl(QUrl(desktopPath, QUrl::TolerantMode)); @@ -788,26 +885,32 @@ waterTypeGroup->addButton(picBtn, 1); DBackgroundGroup *back = new DBackgroundGroup(vWatertypeLayout); + back->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Watermark_TypeGroup]); back->setItemSpacing(2); DFrame *posframe = new DFrame; + posframe->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Watermark_Layout]); setfrmaeback(posframe); posframe->setFixedHeight(HEIGHT_NORMAL); QHBoxLayout *posframelayout = new QHBoxLayout(posframe); DLabel *poslabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Layout")); + poslabel->setSizePolicy(QSizePolicy::Maximum, poslabel->sizePolicy().verticalPolicy()); waterPosCombox = new DComboBox; waterPosCombox->addItems(QStringList() << qApp->translate("DPrintPreviewDialogPrivate", "Tile") << qApp->translate("DPrintPreviewDialogPrivate", "Center")); waterPosCombox->setCurrentIndex(waterPosCombox->count() - 1); waterPosCombox->setFixedHeight(36); posframelayout->addWidget(poslabel, 4); + posframelayout->addStretch(1); posframelayout->addWidget(waterPosCombox, 9); posframelayout->setContentsMargins(10, 4, 10, 4); DFrame *inclinatframe = new DFrame; + inclinatframe->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Watermark_Angle]); setfrmaeback(inclinatframe); inclinatframe->setFixedHeight(HEIGHT_NORMAL); QHBoxLayout *inclinatframelayout = new QHBoxLayout(inclinatframe); DLabel *inclinatlabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Angle")); + inclinatlabel->setSizePolicy(QSizePolicy::Maximum, inclinatlabel->sizePolicy().verticalPolicy()); inclinatBox = new DSpinBox; inclinatBox->setSuffix("°"); inclinatBox->setValue(30); @@ -816,14 +919,17 @@ inclinatBox->setFixedHeight(36); inclinatBox->setEnabledEmbedStyle(true); inclinatframelayout->addWidget(inclinatlabel, 4); + inclinatframelayout->addStretch(1); inclinatframelayout->addWidget(inclinatBox, 9); inclinatframelayout->setContentsMargins(10, 4, 10, 4); DFrame *sizeframe = new DFrame; + sizeframe->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Watermark_Size]); setfrmaeback(sizeframe); sizeframe->setFixedHeight(HEIGHT_NORMAL); QHBoxLayout *sizeframelayout = new QHBoxLayout(sizeframe); DLabel *sizelabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Size")); + sizelabel->setSizePolicy(QSizePolicy::Maximum, sizelabel->sizePolicy().verticalPolicy()); waterSizeSlider = new DSlider; sizeBox = new DSpinBox; sizeBox->lineEdit()->setReadOnly(true); @@ -836,15 +942,18 @@ waterSizeSlider->setValue(100); waterSizeSlider->setMinimum(10); sizeframelayout->addWidget(sizelabel, 4); + sizeframelayout->addStretch(1); sizeframelayout->addWidget(waterSizeSlider, 7); sizeframelayout->addWidget(sizeBox, 2); sizeframelayout->setContentsMargins(10, 4, 10, 4); DFrame *opaframe = new DFrame; + opaframe->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Watermark_Transparency]); setfrmaeback(opaframe); opaframe->setFixedHeight(HEIGHT_NORMAL); QHBoxLayout *opaframelayout = new QHBoxLayout(opaframe); DLabel *opalabel = new DLabel(qApp->translate("DPrintPreviewDialogPrivate", "Transparency")); + opalabel->setSizePolicy(QSizePolicy::Maximum, opalabel->sizePolicy().verticalPolicy()); wmOpaSlider = new DSlider; opaBox = new DSpinBox; opaBox->lineEdit()->setReadOnly(true); @@ -856,6 +965,7 @@ wmOpaSlider->setValue(30); wmOpaSlider->setMaximum(100); opaframelayout->addWidget(opalabel, 4); + opaframelayout->addStretch(1); opaframelayout->addWidget(wmOpaSlider, 7); opaframelayout->addWidget(opaBox, 2); opaframelayout->setContentsMargins(10, 4, 10, 4); @@ -898,7 +1008,6 @@ void DPrintPreviewDialogPrivate::initdata() { - Q_Q(DPrintPreviewDialog); QStringList itemlist; itemlist << QPrinterInfo::availablePrinterNames() << qApp->translate("DPrintPreviewDialogPrivate", "Print to PDF") @@ -918,8 +1027,8 @@ orientationgroup->button(0)->setChecked(true); scaleRateEdit->setValue(100); scaleRateEdit->setEnabled(false); - duplexCombo->setEnabled(false); - pagePerSheetCombo->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Duplex_TypeControl, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_NPrint_Numbers, false); isInited = true; fontSizeMore = true; } @@ -933,7 +1042,7 @@ QObject::connect(advanceBtn, &QPushButton::clicked, q, [this] { this->showadvancesetting(); }); QObject::connect(printDeviceCombo, SIGNAL(currentIndexChanged(int)), q, SLOT(_q_printerChanged(int))); - QObject::connect(cancelBtn, &DPushButton::clicked, q, &DPrintPreviewDialog::close); + QObject::connect(cancelBtn, &DPushButton::clicked, q, &DPrintPreviewDialog::reject); QObject::connect(pageRangeCombo, SIGNAL(currentIndexChanged(int)), q, SLOT(_q_pageRangeChanged(int))); QObject::connect(marginsCombo, SIGNAL(currentIndexChanged(int)), q, SLOT(_q_pageMarginChanged(int))); QObject::connect(printBtn, SIGNAL(clicked(bool)), q, SLOT(_q_startPrint(bool))); @@ -947,59 +1056,59 @@ QObject::connect(picPathEdit->lineEdit(), &QLineEdit::textEdited, q, [this] { this->customPictureWatermarkChoosed(picPathEdit->text()); }); QObject::connect(picPathEdit, &DFileChooserEdit::fileChoosed, q, [this](const QString &filePath) { this->customPictureWatermarkChoosed(filePath); }); - QObject::connect(sizeBox, static_cast(&QSpinBox::valueChanged), q, [=](int value) { + QObject::connect(sizeBox, static_cast(&QSpinBox::valueChanged), q, [this](int value) { waterSizeSlider->setValue(value); }); - QObject::connect(opaBox, static_cast(&QSpinBox::valueChanged), q, [=](int value) { + QObject::connect(opaBox, static_cast(&QSpinBox::valueChanged), q, [this](int value) { wmOpaSlider->setValue(value); }); - QObject::connect(fontCombo, static_cast(&QComboBox::currentIndexChanged), q, [=] { + QObject::connect(fontCombo, static_cast(&QComboBox::currentIndexChanged), q, [this] { QFont font(fontCombo->currentText()); font.setPointSize(WATERFONT_SIZE); pview->setWaterMarkFont(font); }); QObject::connect(pickColorWidget, SIGNAL(selectColorButton(QColor)), q, SLOT(_q_selectColorButton(QColor))); - QObject::connect(waterPosCombox, static_cast(&QComboBox::currentIndexChanged), q, [=](int index) { + QObject::connect(waterPosCombox, static_cast(&QComboBox::currentIndexChanged), q, [this](int index) { if (index == waterPosCombox->count() - 1) { pview->setWaterMarkLayout(WATERLAYOUT_CENTER); } else { pview->setWaterMarkLayout(WATERLAYOUT_TILED); } }); - QObject::connect(directGroup, static_cast(&QButtonGroup::buttonClicked), q, [=](int index) { + QObject::connect(directGroup, static_cast(&QButtonGroup::buttonClicked), q, [this](int index) { directGroup->button(index)->setChecked(true); directChoice = index; pview->setOrder(DPrintPreviewWidget::Order(index)); }); - QObject::connect(inclinatBox, &QSpinBox::editingFinished, q, [=]() { + QObject::connect(inclinatBox, &QSpinBox::editingFinished, q, [this]() { _d_setSpinboxDefaultValue(spinboxTextCaches, inclinatBox); pview->setWaterMarkRotate(inclinatBox->value()); }); - QObject::connect(waterSizeSlider, &DSlider::valueChanged, q, [=](int value) { + QObject::connect(waterSizeSlider, &DSlider::valueChanged, q, [this](int value) { sizeBox->setValue(value); qreal m_value = static_cast(value) / 100.00; pview->setWaterMarkScale(m_value); }); - QObject::connect(wmOpaSlider, &DSlider::valueChanged, q, [=](int value) { + QObject::connect(wmOpaSlider, &DSlider::valueChanged, q, [this](int value) { opaBox->setValue(value); qreal m_value = static_cast(value) / 100.00; pview->setWaterMarkOpacity(m_value); }); - QObject::connect(printOrderGroup, static_cast(&QButtonGroup::buttonClicked), q, [=](int index) { + QObject::connect(printOrderGroup, static_cast(&QButtonGroup::buttonClicked), q, [this](int index) { Q_Q(DPrintPreviewDialog); if (index == 0) { - inorderCombo->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageOrder_TypeControl, false); // 此时不是按照文件路径打印 将并打选项开启 if (q->printFromPath().isEmpty()) - q->findChild("btnframe")->setEnabled(true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_NPrintWidget, true); } else { - inorderCombo->setEnabled(true); - q->findChild("btnframe")->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageOrder_TypeControl, true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_NPrintWidget, false); } }); - QObject::connect(waterMarkBtn, &DSwitchButton::clicked, q, [=](bool isClicked) { this->waterMarkBtnClicked(isClicked); }); + QObject::connect(waterMarkBtn, &DSwitchButton::checkedChanged, q, [this](bool checked) { this->waterMarkBtnClicked(checked); }); QObject::connect(waterTypeGroup, static_cast(&QButtonGroup::buttonClicked), q, [=](int index) { this->watermarkTypeChoosed(index); }); - QObject::connect(pageRangeEdit, &DLineEdit::editingFinished, [=] { + QObject::connect(pageRangeEdit, &DLineEdit::editingFinished, [this] { _q_customPagesFinished(); }); QObject::connect(pageRangeEdit, &DLineEdit::focusChanged, q, [this](bool onFocus) { @@ -1010,16 +1119,15 @@ pageRangeError(NullTip); } }); - QObject::connect(sidebysideCheckBox, &DCheckBox::stateChanged, q, [=](int status) { + QObject::connect(sidebysideCheckBox, &DCheckBox::stateChanged, q, [this](int status) { if (status == 0) { - if (printDeviceCombo->currentIndex() < printDeviceCombo->count() - 2) - inorderwdg->setEnabled(true); + if (isActualPrinter(printDeviceCombo->currentText())) + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageOrder_SequentialPrint, true); setPageLayoutEnable(false); pview->setImposition(DPrintPreviewWidget::One); originTotalPageLabel->setVisible(false); } else { - inorderwdg->setEnabled(false); - inorderCombo->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageOrder_SequentialPrint, false); printOrderGroup->button(0)->setChecked(true); setPageLayoutEnable(true); directGroup->button(directChoice)->setChecked(true); @@ -1027,12 +1135,12 @@ originTotalPageLabel->setVisible(true); } }); - QObject::connect(jumpPageEdit->lineEdit(), &QLineEdit::textChanged, q, [ = ](QString str) { + QObject::connect(jumpPageEdit->lineEdit(), &QLineEdit::textChanged, q, [ this ](QString str) { if (str.toInt() > totalPageLabel->text().toInt()) jumpPageEdit->lineEdit()->setText(totalPageLabel->text()); }); - QObject::connect(pview, &DPrintPreviewWidget::totalPages, [this](int pages) { + QObject::connect(pview, &DPrintPreviewWidget::totalPages, q, [this](int pages) { int targetPage = pview->targetPageCount(pages); jumpPageEdit->setRange(FIRST_PAGE, targetPage); totalPageLabel->setText(QString::number(targetPage)); @@ -1044,6 +1152,7 @@ originTotalPageLabel->setVisible(false); jumpPageEdit->setMaximum(targetPage); setTurnPageBtnStatus(); + _q_customPagesFinished(); }); QObject::connect(pview, &DPrintPreviewWidget::pagesCountChanged, [this](int pages) { totalPageLabel->setNum(pview->targetPageCount(pages)); @@ -1071,51 +1180,22 @@ pview->setCurrentPage(jumpPageEdit->value()); setTurnPageBtnStatus(); }); - QObject::connect(paperSizeCombo, static_cast(&QComboBox::currentIndexChanged), q, [this](int index) { - Q_UNUSED(index) - QPrinterInfo prInfo(*printer); + QObject::connect(paperSizeCombo, static_cast(&QComboBox::currentIndexChanged), q, [this](int) { if (paperSizeCombo->count() == 0) { printer->setPageSize(QPrinter::A4); return ; } - if (printDeviceCombo->currentIndex() != printDeviceCombo->count() - 1 && printDeviceCombo->currentIndex() != printDeviceCombo->count() - 2) { - printer->setPageSize(prInfo.supportedPageSizes().at(paperSizeCombo->currentIndex())); - } else { - switch (paperSizeCombo->currentIndex()) { - case 0: - printer->setPageSize(QPrinter::A3); - break; - case 1: - printer->setPageSize(QPrinter::A4); - break; - case 2: - printer->setPageSize(QPrinter::A5); - break; - case 3: - printer->setPageSize(QPrinter::B4); - break; - case 4: - printer->setPageSize(QPrinter::B5); - break; - case 5: - printer->setPageSize(QPrinter::Custom); - printer->setPageSizeMM(QSizeF(EightK_Weight, EightK_Height)); - break; - case 6: - printer->setPageSize(QPrinter::Custom); - printer->setPageSizeMM(QSizeF(SixteenK_Weight, SixteenK_Height)); - break; - } - } + + matchFitablePageSize(); if (isInited) { this->marginsUpdate(false); } - if (pview->pageRangeMode() == DPrintPreviewWidget::SelectPage) + if (pview->pageRangeMode() == DPrintPreviewWidget::SelectPage && pageRangeCombo->isEnabled()) pageRangeCombo->setCurrentIndex(PAGERANGE_ALL); }); - QObject::connect(scaleRateEdit->lineEdit(), &QLineEdit::editingFinished, q, [=] { + QObject::connect(scaleRateEdit->lineEdit(), &QLineEdit::editingFinished, q, [this] { if (scaleGroup->checkedId() == SCALE) { _d_setSpinboxDefaultValue(spinboxTextCaches, scaleRateEdit); if (scaleRateEdit->value() < 10) @@ -1206,37 +1286,7 @@ } //高级设置 //设置纸张大小 - QPrinterInfo prInfo(*printer); - if (printDeviceCombo->currentIndex() != printDeviceCombo->count() - 1 - && printDeviceCombo->currentIndex() != printDeviceCombo->count() - 2) { - printer->setPageSize(prInfo.supportedPageSizes().at(paperSizeCombo->currentIndex())); - } else { - switch (paperSizeCombo->currentIndex()) { - case 0: - printer->setPageSize(QPrinter::A3); - break; - case 1: - printer->setPageSize(QPrinter::A4); - break; - case 2: - printer->setPageSize(QPrinter::A5); - break; - case 3: - printer->setPageSize(QPrinter::B4); - break; - case 4: - printer->setPageSize(QPrinter::B5); - break; - case 5: - printer->setPageSize(QPrinter::Custom); - printer->setPageSizeMM(QSizeF(EightK_Weight, EightK_Height)); - break; - case 6: - printer->setPageSize(QPrinter::Custom); - printer->setPageSizeMM(QSizeF(SixteenK_Weight, SixteenK_Height)); - break; - } - } + matchFitablePageSize(); //设置双面打印 if (duplexCheckBox->isChecked()) { if (duplexCombo->count() == 1) { @@ -1245,13 +1295,10 @@ else printer->setDuplex(QPrinter::DuplexShortSide); } else { - switch (duplexCombo->currentIndex()) { - case 0: + if (duplexCombo->currentText() == qApp->translate("DPrintPreviewDialogPrivate", "Flip on long edge")) { printer->setDuplex(QPrinter::DuplexLongSide); - break; - case 1: + } else { printer->setDuplex(QPrinter::DuplexShortSide); - break; } } } else { @@ -1288,12 +1335,13 @@ QStringList pageSizeList; int index = -1; for (int i = 0; i < updateinfo.supportedPageSizes().size(); i++) { - pageSizeList.append(updateinfo.supportedPageSizes().at(i).key()); + pageSizeList.append(updateinfo.supportedPageSizes().at(i).name()); if (index == -1 && updateinfo.supportedPageSizes().at(i).id() == QPageSize::PageSizeId::A4) { index = i; } } paperSizeCombo->addItems(pageSizeList); + updateSubControlSettings(DPrintPreviewSettingInfo::PS_PaperSize); if (pageSizeList.contains(lastPaperSize)) { paperSizeCombo->setCurrentText(lastPaperSize); } else { @@ -1306,22 +1354,25 @@ QString lastDuplexComboText = duplexCombo->currentText(); duplexCombo->clear(); if (updateinfo.supportedDuplexModes().contains(QPrinter::DuplexLongSide) || updateinfo.supportedDuplexModes().contains(QPrinter::DuplexShortSide)) { - duplexCheckBox->setEnabled(true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_DuplexWidget, true); if (!updateinfo.supportedDuplexModes().contains(QPrinter::DuplexLongSide)) { duplexCombo->addItem(qApp->translate("DPrintPreviewDialogPrivate", "Flip on short edge")); + updateSubControlSettings(DPrintPreviewSettingInfo::PS_PrintDuplex); supportedDuplexFlag = false; } else if (!updateinfo.supportedDuplexModes().contains(QPrinter::DuplexShortSide)) { duplexCombo->addItem(qApp->translate("DPrintPreviewDialogPrivate", "Flip on long edge")); + updateSubControlSettings(DPrintPreviewSettingInfo::PS_PrintDuplex); supportedDuplexFlag = true; } else if (updateinfo.supportedDuplexModes().contains(QPrinter::DuplexLongSide) && updateinfo.supportedDuplexModes().contains(QPrinter::DuplexShortSide)) { duplexCombo->addItem(qApp->translate("DPrintPreviewDialogPrivate", "Flip on long edge")); duplexCombo->addItem(qApp->translate("DPrintPreviewDialogPrivate", "Flip on short edge")); + updateSubControlSettings(DPrintPreviewSettingInfo::PS_PrintDuplex); duplexCombo->setCurrentText(lastDuplexComboText); } } else { duplexCheckBox->setChecked(false); - duplexCheckBox->setEnabled(false); - duplexCombo->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_DuplexWidget, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Duplex_TypeControl, false); } } @@ -1388,6 +1439,8 @@ DPaletteHelper::instance()->setPalette(m_frameList.at(i), pa); } for (int i = 0; i < m_back.size(); i++) { + if (m_back.at(i)->objectName() == "backGround") + continue; DPaletteHelper::instance()->setPalette(m_back.at(i), pa); } } @@ -1435,6 +1488,33 @@ return data; } +void DPrintPreviewDialogPrivate::updateAllControlSettings() +{ + if (!settingUpdateTimer.isActive()) + settingUpdateTimer.start(0, q_func()); +} + +void DPrintPreviewDialogPrivate::updateAllContentSettings_impl() +{ + for (int i = DPrintPreviewSettingInfo::PS_Printer; i <= DPrintPreviewSettingInfo::PS_Watermark; ++i) + updateSubControlSettings(static_cast(i)); +} + +void DPrintPreviewDialogPrivate::updateAllControlStatus() +{ + for (int i = 0; i < DPrintPreviewSettingInterface::SC_ControlCount; ++i) + settingHelper->updateSettingStatus(static_cast(i)); +} + +void DPrintPreviewDialogPrivate::updateSubControlSettings(DPrintPreviewSettingInfo::SettingType setting) +{ + DPrintPreviewSettingInfo *info = settingHelper->loadInfo(setting); + settingHelper->updateSettingInfo(info); + if (info) { + delete info; + } +} + /*! \brief DPrintPreviewDialogPrivate::setEnable 设置纸张范围自定义可输入状态 \a value 判断选择的范围类型 @@ -1444,9 +1524,9 @@ { if (combox == pageRangeCombo) { if (value != pageRangeCombo->count() - 1) { - pageRangeEdit->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageRange_SelectEdit, false); } else { - pageRangeEdit->setEnabled(true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageRange_SelectEdit, true); } } } @@ -1496,11 +1576,12 @@ if (index == 0) { pview->refreshBegin(); - waterTextCombo->setEnabled(true); - fontCombo->setEnabled(true); - picPathEdit->setEnabled(false); - if (colorModeCombo->count() == 2 && colorModeCombo->currentIndex() == colorModeCombo->count() - 2) - waterColorBtn->setEnabled(true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_TextType, true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_TextFont, true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_ImageEdit, false); + if (colorModeCombo->count() == 2 && + colorModeCombo->currentText() == qApp->translate("DPrintPreviewDialogPrivate", "Color")) + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_TextColor, true); _q_textWaterMarkModeChanged(waterTextCombo->currentIndex()); initWaterSettings(); //获取可支持的所有字体 @@ -1530,11 +1611,11 @@ pview->setWaterMarkType(Type_Text); pview->refreshEnd(); } else if (index == 1) { - waterTextCombo->setEnabled(false); - fontCombo->setEnabled(false); - waterColorBtn->setEnabled(false); - waterTextEdit->setEnabled(false); - picPathEdit->setEnabled(true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_TextType, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_TextFont, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_TextColor, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_CustomText, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_ImageEdit, true); pview->setWaterMarkType(Type_Image); } typeChoice = index; @@ -1548,24 +1629,73 @@ { Q_Q(DPrintPreviewDialog); QString lastPaperSize = paperSizeCombo->currentText(); - QString lastColormode = colorModeCombo->currentText(); paperSizeCombo->clear(); paperSizeCombo->blockSignals(true); - colorModeCombo->blockSignals(true); - if (index >= printDeviceCombo->count() - 2) { + QString currentName = printDeviceCombo->itemText(index); + if (isActualPrinter(currentName)) { + //actual printer + if (printer) { + if (q->printFromPath().isEmpty() && !sidebysideCheckBox->isChecked()) { + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageOrder_SequentialPrint, true); + } else { + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageOrder_SequentialPrint, false); + } + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_CopiesWidget, true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PaperSizeWidget, true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_ColorModeWidget, true); + printer->setPrinterName(currentName); + printBtn->setText(qApp->translate("DPrintPreviewDialogPrivate", "Print", "button")); + judgeSupportedAttributes(lastPaperSize); + } + //判断当前打印机是否支持彩色打印,不支持彩色打印删除彩色打印选择选项,pdf不做判断 + QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get(); + QPrintDevice currentDevice = ps->createPrintDevice(printDeviceCombo->currentText()); + colorModeCombo->clear(); + supportedColorMode = false; + if (currentDevice.supportedColorModes().contains(QPrint::Color)) { + if (!isInited) { + waterColor = QColor("#6f6f6f"); + _q_selectColorButton(waterColor); + pickColorWidget->convertColor(waterColor); + pickColorWidget->setRgbEdit(waterColor); + } + colorModeCombo->blockSignals(true); + colorModeCombo->addItem(qApp->translate("DPrintPreviewDialogPrivate", "Color")); + colorModeCombo->blockSignals(false); + updateSubControlSettings(DPrintPreviewSettingInfo::PS_ColorMode); + supportedColorMode = true; + } + if (currentDevice.supportedColorModes().contains(QPrint::GrayScale)) { + colorModeCombo->blockSignals(true); + colorModeCombo->addItem(qApp->translate("DPrintPreviewDialogPrivate", "Grayscale")); + colorModeCombo->blockSignals(false); + updateSubControlSettings(DPrintPreviewSettingInfo::PS_ColorMode); + waterColor = QColor("#6f6f6f"); + _q_selectColorButton(waterColor); + pickColorWidget->convertColor(waterColor); + pickColorWidget->setRgbEdit(waterColor); + } + if (supportedColorMode) { + colorModeCombo->setCurrentText(qApp->translate("DPrintPreviewDialogPrivate", "Color")); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_TextColor, true); + } else { + colorModeCombo->setCurrentText(qApp->translate("DPrintPreviewDialogPrivate", "Grayscale")); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_TextColor, false); + } + } else { //pdf - copycountspinbox->setDisabled(true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_CopiesWidget, false); copycountspinbox->setValue(1); duplexCheckBox->setCheckState(Qt::Unchecked); - duplexCheckBox->setEnabled(false); duplexCombo->clear(); - duplexCombo->setEnabled(false); - waterColorBtn->setEnabled(true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_DuplexWidget, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_TextColor, true); if (colorModeCombo->count() == 1) colorModeCombo->insertItem(0, qApp->translate("DPrintPreviewDialogPrivate", "Color")); + updateSubControlSettings(DPrintPreviewSettingInfo::PS_ColorMode); colorModeCombo->blockSignals(false); colorModeCombo->setCurrentIndex(0); - colorModeCombo->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_ColorModeWidget, false); supportedColorMode = true; printBtn->setText(qApp->translate("DPrintPreviewDialogPrivate", "Save", "button")); paperSizeCombo->setCurrentIndex(1); @@ -1577,6 +1707,7 @@ << "8K" << "16K"; paperSizeCombo->addItems(pdfPaperSize); + updateSubControlSettings(DPrintPreviewSettingInfo::PS_PaperSize); if (pdfPaperSize.contains(lastPaperSize)) paperSizeCombo->setCurrentText(lastPaperSize); else { @@ -1586,67 +1717,21 @@ } printer->setPrinterName(""); printOrderGroup->button(0)->setChecked(true); - inorderwdg->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageOrder_SequentialPrint, false); if (!isInited) { waterColor = QColor("#6f6f6f"); _q_selectColorButton(waterColor); pickColorWidget->convertColor(waterColor); pickColorWidget->setRgbEdit(waterColor); } - } else { - //actual printer - if (printer) { - if (q->printFromPath().isEmpty() && !sidebysideCheckBox->isChecked()) { - inorderwdg->setEnabled(true); - } else { - inorderwdg->setEnabled(false); - } - copycountspinbox->setDisabled(false); - paperSizeCombo->setEnabled(true); - colorModeCombo->setEnabled(true); - printer->setPrinterName(printDeviceCombo->itemText(index)); - printBtn->setText(qApp->translate("DPrintPreviewDialogPrivate", "Print", "button")); - judgeSupportedAttributes(lastPaperSize); - } - //判断当前打印机是否支持彩色打印,不支持彩色打印删除彩色打印选择选项,pdf不做判断 - QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get(); - QPrintDevice currentDevice = ps->createPrintDevice(printDeviceCombo->currentText()); - colorModeCombo->clear(); - if (!currentDevice.supportedColorModes().contains(QPrint::Color)) { - colorModeCombo->blockSignals(false); - colorModeCombo->addItem(qApp->translate("DPrintPreviewDialogPrivate", "Grayscale")); - supportedColorMode = false; - waterColorBtn->setEnabled(false); - waterColor = QColor("#6f6f6f"); - _q_selectColorButton(waterColor); - pickColorWidget->convertColor(waterColor); - pickColorWidget->setRgbEdit(waterColor); - } else { - if (!isInited) { - waterColor = QColor("#6f6f6f"); - _q_selectColorButton(waterColor); - pickColorWidget->convertColor(waterColor); - pickColorWidget->setRgbEdit(waterColor); - } - - colorModeCombo->addItems(QStringList() << qApp->translate("DPrintPreviewDialogPrivate", "Color") << qApp->translate("DPrintPreviewDialogPrivate", "Grayscale")); - colorModeCombo->blockSignals(false); - if (colorModeCombo->currentText() == lastColormode) { - colorModeCombo->setCurrentIndex(0); - supportedColorMode = true; - } else { - colorModeCombo->setCurrentIndex(1); - supportedColorMode = false; - } - if (colorModeCombo->currentIndex() == colorModeCombo->count() - 2) { - waterColorBtn->setEnabled(true); - } - } } + marginsUpdate(true); - if (pview->pageRangeMode() == DPrintPreviewWidget::SelectPage) + if (pview->pageRangeMode() == DPrintPreviewWidget::SelectPage && pageRangeCombo->isEnabled()) pageRangeCombo->setCurrentIndex(PAGERANGE_ALL); paperSizeCombo->blockSignals(false); + if (isInited) + updateAllControlSettings(); } /*! @@ -1655,8 +1740,8 @@ */ void DPrintPreviewDialogPrivate::_q_pageRangeChanged(int index) { - Q_Q(DPrintPreviewDialog); setEnable(index, pageRangeCombo); + pageRangeEdit->setVisible(index == DPrintPreviewWidget::SelectPage); pageRangeEdit->lineEdit()->setPlaceholderText(""); pageRangeEdit->setText(""); if (index == DPrintPreviewWidget::AllPage || index == DPrintPreviewWidget::CurrentPage) { @@ -1681,6 +1766,7 @@ } if (pageRangeEdit->isAlert()) { pageRangeEdit->clear(); + pageRangeEdit->setAlert(false); pageRangeEdit->lineEdit()->setPlaceholderText(qApp->translate("DPrintPreviewDialogPrivate", "For example, 1,3,5-7,11-15,18,21")); } } @@ -1731,7 +1817,7 @@ pview->updatePreview(); } - if (pview->pageRangeMode() == DPrintPreviewWidget::SelectPage) + if (pview->pageRangeMode() == DPrintPreviewWidget::SelectPage && pageRangeCombo->isEnabled()) pageRangeCombo->setCurrentIndex(PAGERANGE_ALL); if (marginOldValue.length() > 4) @@ -1756,12 +1842,12 @@ if (index == 0) { // color pview->setColorMode(DPrinter::Color); - waterColorBtn->setEnabled(true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_TextColor, true); supportedColorMode = true; } else { // gray pview->setColorMode(DPrinter::GrayScale); - waterColorBtn->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_TextColor, false); supportedColorMode = false; waterColor = QColor("#6f6f6f"); } @@ -1784,7 +1870,7 @@ // 横向按钮 pview->setOrientation(DPrinter::Landscape); } - if (pview->pageRangeMode() == DPrintPreviewWidget::SelectPage) + if (pview->pageRangeMode() == DPrintPreviewWidget::SelectPage && pageRangeCombo->isEnabled()) pageRangeCombo->setCurrentIndex(PAGERANGE_ALL); } @@ -1880,7 +1966,7 @@ marginOldValue << topMarginF << leftMarginF << rightMarginF << bottomMarginF; this->printer->setPageMargins(QMarginsF(leftMarginF, topMarginF, rightMarginF, bottomMarginF), QPageLayout::Millimeter); this->pview->updatePreview(); - if (pview->pageRangeMode() == DPrintPreviewWidget::SelectPage) + if (pview->pageRangeMode() == DPrintPreviewWidget::SelectPage && pageRangeCombo->isEnabled()) pageRangeCombo->setCurrentIndex(PAGERANGE_ALL); } @@ -1954,9 +2040,9 @@ void DPrintPreviewDialogPrivate::_q_checkStateChanged(int state) { if (!state) - duplexCombo->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Duplex_TypeControl, false); else { - duplexCombo->setEnabled(true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Duplex_TypeControl, true); } } @@ -1967,17 +2053,18 @@ void DPrintPreviewDialogPrivate::_q_textWaterMarkModeChanged(int index) { if (index != waterTextCombo->count() - 1) { - waterTextEdit->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_CustomText, false); pview->setTextWaterMark(waterTextCombo->currentText()); if (!waterTextEdit->text().isEmpty()) waterTextEdit->clear(); } else { - waterTextEdit->setEnabled(true); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_CustomText, true); if (!lastCusWatermarkText.isEmpty()) { waterTextEdit->setText(lastCusWatermarkText); pview->setTextWaterMark(lastCusWatermarkText); } } + waterTextEdit->setVisible(index == waterTextCombo->count() - 1); } /*! @@ -2014,18 +2101,18 @@ \brief DPrintPreviewDialogPrivate::waterMarkBtnClicked 是否开启水印 \a state 水印开启 */ -void DPrintPreviewDialogPrivate::waterMarkBtnClicked(bool isClicked) +void DPrintPreviewDialogPrivate::waterMarkBtnClicked(bool checked) { - if (isClicked) { + if (checked) { wmSpacer->changeSize(WIDTH_NORMAL, SPACER_HEIGHT_HIDE); - watermarksettingwdg->show(); + settingHelper->setSubControlVisible(DPrintPreviewSettingInterface::SC_WatermarkContentWidget, true); waterTypeGroup->button(typeChoice)->setChecked(true); watermarkTypeChoosed(typeChoice); if (typeChoice == Type_Image - 1 && !picPathEdit->text().isEmpty()) customPictureWatermarkChoosed(picPathEdit->text()); } else { wmSpacer->changeSize(WIDTH_NORMAL, SPACER_HEIGHT_SHOW); - watermarksettingwdg->hide(); + settingHelper->setSubControlVisible(DPrintPreviewSettingInterface::SC_WatermarkContentWidget, false); pview->setWaterMarkType(Type_None); } } @@ -2040,12 +2127,12 @@ if (pview->printFromPath().isEmpty()) return; - q->findChild("OrientationBackgroundGroup")->setEnabled(false); - q->findChild("marginsFrame")->setEnabled(false); - q->findChild("ScalingContentBackgroundGroup")->setEnabled(false); - q->findChild("WaterMarkFrame")->setEnabled(false); - q->findChild("btnframe")->setEnabled(false); - q->findChild("InorderWidget")->setEnabled(false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_OrientationWidget, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_ScalingWidget, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_MarginWidget, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_WatermarkWidget, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageOrder_SequentialPrint, false); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_NPrintWidget, false); q->findChild("CollateWidget")->setEnabled(false); } @@ -2055,11 +2142,50 @@ */ void DPrintPreviewDialogPrivate::setPageLayoutEnable(const bool &checked) { - QList btnList = advancesettingwdg->findChild("btnframe")->findChildren(); - for (DToolButton *button : btnList) { - button->setEnabled(checked); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_NPrint_Layout, checked); + settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_NPrint_Numbers, checked); +} + +void DPrintPreviewDialogPrivate::matchFitablePageSize() +{ + QPrinterInfo prInfo(*printer); + if (isActualPrinter(printDeviceCombo->currentText())) { + auto const &pageSizes = prInfo.supportedPageSizes(); + auto it = std::find_if(pageSizes.cbegin(), pageSizes.cend(), [&](const QPageSize &pageSize) { + return pageSize.name() == paperSizeCombo->currentText(); + }); + + if (it != pageSizes.end()) + printer->setPageSize(*it); + } else { + if (paperSizeCombo->currentText() == "A3") + printer->setPageSize(QPrinter::A3); + else if (paperSizeCombo->currentText() == "A4") + printer->setPageSize(QPrinter::A4); + else if (paperSizeCombo->currentText() == "A5") + printer->setPageSize(QPrinter::A4); + else if (paperSizeCombo->currentText() == "B4") + printer->setPageSize(QPrinter::A4); + else if (paperSizeCombo->currentText() == "B4") + printer->setPageSize(QPrinter::B4); + else if (paperSizeCombo->currentText() == "B5") + printer->setPageSize(QPrinter::B5); + else if (paperSizeCombo->currentText() == "8K") { + printer->setPageSize(QPrinter::Custom); + printer->setPageSizeMM(QSizeF(EightK_Weight, EightK_Height)); + } else if (paperSizeCombo->currentText() == "16K") { + printer->setPageSize(QPrinter::Custom); + printer->setPageSizeMM(QSizeF(SixteenK_Weight, SixteenK_Height)); + } else { + printer->setPageSize(QPrinter::A4); + } } - pagePerSheetCombo->setEnabled(checked); +} + +bool DPrintPreviewDialogPrivate::isActualPrinter(const QString &name) +{ + const QStringList &printerNames = QPrinterInfo::availablePrinterNames(); + return printerNames.contains(name); } /*! @@ -2153,10 +2279,11 @@ setupPrinter(); } - bool isSavePicture = (printDeviceCombo->currentIndex() == printDeviceCombo->count() - 1); + bool isSavePicture = (printDeviceCombo->currentText() == qApp->translate("DPrintPreviewDialogPrivate", "Save as Image")); + bool isSavePdf = (printDeviceCombo->currentText() == qApp->translate("DPrintPreviewDialogPrivate", "Print to PDF")); QString desktopPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); desktopPath += QStringLiteral("/"); - if (printDeviceCombo->currentIndex() == printDeviceCombo->count() - 2) { + if (isSavePdf) { /*外部通过setDocName设置,如果不做任何操作默认保存名称print.pdf*/ if (printer == nullptr) { return; @@ -2244,7 +2371,7 @@ pview->print(); - q->done(0); + q->accept(); } void DPrintPreviewDialogPrivate::pageRangeError(TipsNum tipNum) @@ -2322,6 +2449,37 @@ Q_D(DPrintPreviewDialog); if (nullptr != d->printer) delete d->printer; + delete d->settingHelper; +} + +void DPrintPreviewDialog::setPluginMimeData(const QVariant &mimeData) +{ + PreviewSettingsPluginHelper::loadPlugin(); + PreviewSettingsPluginHelper::setPluginMimeData(mimeData); +} + +QVariant DPrintPreviewDialog::pluginMimeData() +{ + PreviewSettingsPluginHelper::loadPlugin(); + return PreviewSettingsPluginHelper::pluginMimeData(); +} + +QStringList DPrintPreviewDialog::availablePlugins() +{ + PreviewSettingsPluginHelper::loadPlugin(); + return PreviewSettingsPluginHelper::availablePlugins(); +} + +bool DPrintPreviewDialog::setCurrentPlugin(const QString &pluginName) +{ + PreviewSettingsPluginHelper::loadPlugin(); + return PreviewSettingsPluginHelper::setCurrentPlugin(pluginName); +} + +QString DPrintPreviewDialog::currentPlugin() +{ + PreviewSettingsPluginHelper::loadPlugin(); + return PreviewSettingsPluginHelper::currentPlugin(); } bool DPrintPreviewDialog::event(QEvent *event) @@ -2337,6 +2495,10 @@ d->marginsLayout(false); } d->fontSizeMore = false; + } else if (event->type() == QEvent::Show) { + d->pview->updatePreview(); + d->updateAllControlSettings(); + d->updateAllControlStatus(); } return DDialog::event(event); } @@ -2484,6 +2646,18 @@ return d->pview->isAsynPreview(); } +DPrintPreviewSettingInfo *DPrintPreviewDialog::createDialogSettingInfo(DPrintPreviewSettingInfo::SettingType type) +{ + Q_D(DPrintPreviewDialog); + return d->settingHelper->loadInfo(type, true); +} + +void DPrintPreviewDialog::updateDialogSettingInfo(DPrintPreviewSettingInfo *info) +{ + Q_D(DPrintPreviewDialog); + d->settingHelper->updateSettingInfo(info); +} + void DPrintPreviewDialog::resizeEvent(QResizeEvent *event) { Q_UNUSED(event); @@ -2502,5 +2676,509 @@ } } +void DPrintPreviewDialog::timerEvent(QTimerEvent *event) +{ + Q_D(DPrintPreviewDialog); + if (event->timerId() == d->settingUpdateTimer.timerId()) { + d->settingUpdateTimer.stop(); + d->updateAllContentSettings_impl(); + } + + return DDialog::timerEvent(event); +} + +QVariant PreviewSettingsPluginHelper::m_printSettingData; +DPrintPreviewSettingInterface *PreviewSettingsPluginHelper::m_currentInterface = nullptr; +QList PreviewSettingsPluginHelper::m_availablePlugins = {}; +PreviewSettingsPluginHelper::PreviewSettingsPluginHelper(DPrintPreviewDialogPrivate *dd) + : d(dd) +{ +} + +DPrintPreviewSettingInfo *PreviewSettingsPluginHelper::loadInfo(DPrintPreviewSettingInfo::SettingType type, bool manual) +{ + // Apps can manually get the current print dialog settings. + if (!manual && !m_currentInterface) { + return nullptr; + } + + DPrintPreviewSettingInfo *info = nullptr; + switch (type) { + case DPrintPreviewSettingInfo::PS_Printer: { + DPrintPreviewPrinterInfo *printerInfo = new DPrintPreviewPrinterInfo; + for (int index = 0; index < d->printDeviceCombo->count(); ++index) + printerInfo->printers << d->printDeviceCombo->itemText(index); + info = printerInfo; + } + break; + case DPrintPreviewSettingInfo::PS_Copies: { + DPrintPreviewCopiesInfo *copiesInfo = new DPrintPreviewCopiesInfo; + copiesInfo->copies = d->copycountspinbox->value(); + info = copiesInfo; + } + break; + case DPrintPreviewSettingInfo::PS_PageRange: { + DPrintPreviewPageRangeInfo *pageRangeInfo = new DPrintPreviewPageRangeInfo; + pageRangeInfo->rangeType = d->pview->pageRangeMode(); + pageRangeInfo->selectPages = d->pageRangeEdit->text(); + info = pageRangeInfo; + } + break; + case DPrintPreviewSettingInfo::PS_Orientation: { + DPrintPreviewOrientationInfo *orientationInfo = new DPrintPreviewOrientationInfo; + orientationInfo->orientationMode = d->printer->orientation(); + info = orientationInfo; + } + break; + case DPrintPreviewSettingInfo::PS_PaperSize: { + DPrintPreviewPaperSizeInfo *paperSizeInfo = new DPrintPreviewPaperSizeInfo; + for (int index = 0; index < d->paperSizeCombo->count(); ++index) + paperSizeInfo->pageSize << d->paperSizeCombo->itemText(index); + info = paperSizeInfo; + } + break; + case DPrintPreviewSettingInfo::PS_PrintDuplex: { + DPrintPreviewPrintDuplexInfo *duplexInfo = new DPrintPreviewPrintDuplexInfo; + duplexInfo->enable = d->duplexCheckBox->isChecked(); + duplexInfo->duplex = d->printer->duplex(); + info = duplexInfo; + } + break; + case DPrintPreviewSettingInfo::PS_NUpPrinting: { + DPrintPreviewNUpPrintInfo *nupInfo = new DPrintPreviewNUpPrintInfo; + nupInfo->enable = d->sidebysideCheckBox->isChecked(); + nupInfo->imposition = d->pview->imposition(); + nupInfo->order = d->pview->order(); + info = nupInfo; + } + break; + case DPrintPreviewSettingInfo::PS_PageOrder: { + DPrintPreviewPageOrderInfo *orderInfo = new DPrintPreviewPageOrderInfo; + orderInfo->pageOrder = (d->printOrderGroup->checkedId() == 0) ? DPrintPreviewPageOrderInfo::CollatePage : DPrintPreviewPageOrderInfo::InOrderPage; + orderInfo->inOrdertype = (d->inorderCombo->currentIndex() == 0) ? DPrintPreviewPageOrderInfo::FrontToBack : DPrintPreviewPageOrderInfo::BackToFront; + info = orderInfo; + } + break; + case DPrintPreviewSettingInfo::PS_ColorMode: { + DPrintPreviewColorModeInfo *colorInfo = new DPrintPreviewColorModeInfo; + for (int index = 0; index < d->colorModeCombo->count(); ++index) + colorInfo->colorMode << d->colorModeCombo->itemText(index); + info = colorInfo; + } + break; + case DPrintPreviewSettingInfo::PS_PaperMargins: { + DPrintPreviewPaperMarginsInfo *marginInfo = new DPrintPreviewPaperMarginsInfo; + switch (d->marginsCombo->currentIndex()) { + case 0: + marginInfo->marginType = DPrintPreviewPaperMarginsInfo::Narrow; + break; + case 1: + marginInfo->marginType = DPrintPreviewPaperMarginsInfo::Normal; + break; + case 2: + marginInfo->marginType = DPrintPreviewPaperMarginsInfo::Moderate; + break; + case 3: + marginInfo->marginType = DPrintPreviewPaperMarginsInfo::Customize; + break; + default: + break; + } + marginInfo->topMargin = d->marginTopSpin->value(); + marginInfo->bottomMargin = d->marginBottomSpin->value(); + marginInfo->leftMargin = d->marginBottomSpin->value(); + marginInfo->rightMargin = d->marginBottomSpin->value(); + info = marginInfo; + } + break; + case DPrintPreviewSettingInfo::PS_Scaling: { + DPrintPreviewScalingInfo *scalingInfo = new DPrintPreviewScalingInfo; + scalingInfo->scalingType = (d->scaleGroup->checkedId() == ACTUAL_SIZE) ? DPrintPreviewScalingInfo::ActualSize + : DPrintPreviewScalingInfo::ScaleSize; + scalingInfo->scaleRatio = d->scaleRateEdit->value(); + info = scalingInfo; + } + break; + case DPrintPreviewSettingInfo::PS_Watermark: { + DPrintPreviewWatermarkInfo *watermarkInfo = new DPrintPreviewWatermarkInfo; + watermarkInfo->currentWatermarkType = static_cast(d->waterTypeGroup->checkedId()); + switch (watermarkInfo->currentWatermarkType) { + case DPrintPreviewWatermarkInfo::TextWatermark: { + switch (d->waterTextCombo->currentIndex()) { + case 0: + watermarkInfo->textType = DPrintPreviewWatermarkInfo::Confidential; + break; + case 1: + watermarkInfo->textType = DPrintPreviewWatermarkInfo::Draft; + break; + case 2: + watermarkInfo->textType = DPrintPreviewWatermarkInfo::Sample; + break; + case 3: + watermarkInfo->textType = DPrintPreviewWatermarkInfo::Custom; + break; + } + watermarkInfo->customText = d->waterTextEdit->text(); + for (int index = 0; index < d->fontCombo->count(); ++index) + watermarkInfo->fontList << d->fontCombo->itemText(index); + watermarkInfo->textColor = d->pview->waterMarkColor(); + } + break; + case DPrintPreviewWatermarkInfo::ImageWatermark: { + watermarkInfo->imagePath = d->picPathEdit->text(); + } + break; + } + + watermarkInfo->opened = d->waterMarkBtn->isChecked(); + watermarkInfo->angle = d->inclinatBox->value(); + watermarkInfo->size = d->waterSizeSlider->value(); + watermarkInfo->transparency = d->wmOpaSlider->value(); + + // TODO: Remove it. + QVariant spacingProperty = d->pview->property("_d_print_waterMarkRowSpacing"); + if (spacingProperty.isValid()) { + watermarkInfo->rowSpacing = spacingProperty.toDouble(); + } else { + watermarkInfo->rowSpacing = -1; + } + + spacingProperty = d->pview->property("_d_print_waterMarkColumnSpacing"); + if (spacingProperty.isValid()) { + watermarkInfo->columnSpacing = spacingProperty.toDouble(); + } else { + watermarkInfo->columnSpacing = -1; + } + info = watermarkInfo; + } + break; + default: + break; + } + + // Apps can get setting info without the print plugin, otherwise need to be filter by plugin. + if (!info || !m_currentInterface) + return info; + + if (m_currentInterface->settingFilter(d->settingHelper->m_printSettingData, info)) + return info; + delete info; + return nullptr; +} + +void PreviewSettingsPluginHelper::setSubControlVisible(DPrintPreviewSettingInterface::SettingSubControl subControlType, bool visible) +{ + QWidgetList sourceList = subControl(subControlType); + for (QWidget *w : sourceList) + doUpdateStatus(w, subControlType, visible, w->isEnabledTo(w->parentWidget())); +} + +void PreviewSettingsPluginHelper::setSubControlEnabled(DPrintPreviewSettingInterface::SettingSubControl subControlType, bool enabled) +{ + QWidgetList sourceList = subControl(subControlType); + for (QWidget *w : sourceList) + doUpdateStatus(w, subControlType, w->isVisibleTo(w->parentWidget()), enabled); +} + +void PreviewSettingsPluginHelper::updateSettingInfo(DPrintPreviewSettingInfo *info) +{ + if (!info) + return; + + switch (info->type()) { + case DPrintPreviewSettingInfo::PS_Printer: { + DPrintPreviewPrinterInfo *printerInfo = static_cast(info); + QStringList targetPrinters, sourcePrinters; + for (int index = 0; index < d->printDeviceCombo->count(); ++index) { + const QString &p = d->printDeviceCombo->itemText(index); + sourcePrinters << p; + if (printerInfo->printers.contains(p)) + targetPrinters << p; + } + if (targetPrinters.isEmpty() || targetPrinters == sourcePrinters) + break; + d->printDeviceCombo->blockSignals(true); + d->printDeviceCombo->clear(); + d->printDeviceCombo->blockSignals(false); + d->printDeviceCombo->addItems(targetPrinters); + } + break; + case DPrintPreviewSettingInfo::PS_Copies: { + DPrintPreviewCopiesInfo *copiesInfo = static_cast(info); + d->copycountspinbox->setValue(copiesInfo->copies); + } + break; + case DPrintPreviewSettingInfo::PS_PageRange: { + DPrintPreviewPageRangeInfo *pageRangeInfo = static_cast(info); + d->pageRangeCombo->setCurrentIndex(pageRangeInfo->rangeType); + d->pageRangeEdit->setText(pageRangeInfo->selectPages); + d->_q_customPagesFinished(); + } + break; + case DPrintPreviewSettingInfo::PS_Orientation: { + DPrintPreviewOrientationInfo *orientationInfo = static_cast(info); + d->orientationgroup->button(orientationInfo->orientationMode)->setChecked(true); + d->_q_orientationChanged(orientationInfo->orientationMode); + } + break; + case DPrintPreviewSettingInfo::PS_PaperSize: { + DPrintPreviewPaperSizeInfo *paperSizeInfo = static_cast(info); + QStringList paperSizes, sourcePaperSizes; + for (int index = 0; index < d->paperSizeCombo->count(); ++index) { + const QString &paper = d->paperSizeCombo->itemText(index); + sourcePaperSizes << paper; + if (paperSizeInfo->pageSize.contains(paper)) + paperSizes << paper; + } + if (paperSizes.isEmpty() || paperSizes == sourcePaperSizes) + break; + d->paperSizeCombo->blockSignals(true); + d->paperSizeCombo->clear(); + d->paperSizeCombo->blockSignals(false); + d->paperSizeCombo->addItems(paperSizes); + d->paperSizeCombo->setCurrentIndex(0); + } + break; + case DPrintPreviewSettingInfo::PS_PrintDuplex: { + DPrintPreviewPrintDuplexInfo *duplexInfo = static_cast(info); + d->duplexCheckBox->setChecked(duplexInfo->enable); + d->duplexCombo->setCurrentIndex(duplexInfo->duplex == DPrinter::DuplexShortSide ? 1 : 0); + } + break; + case DPrintPreviewSettingInfo::PS_NUpPrinting: { + DPrintPreviewNUpPrintInfo *nupInfo = static_cast(info); + d->sidebysideCheckBox->setChecked(nupInfo->enable); + if (nupInfo->imposition == DPrintPreviewWidget::One) { + d->sidebysideCheckBox->setChecked(false); + break; + } + + d->pagePerSheetCombo->setCurrentIndex(nupInfo->imposition - 1); + d->directGroup->button(nupInfo->order)->click(); + } + break; + case DPrintPreviewSettingInfo::PS_PageOrder: { + DPrintPreviewPageOrderInfo *orderInfo = static_cast(info); + d->printOrderGroup->button(orderInfo->pageOrder)->click(); + d->inorderCombo->setCurrentIndex(orderInfo->inOrdertype); + } + break; + case DPrintPreviewSettingInfo::PS_ColorMode: { + DPrintPreviewColorModeInfo *colorInfo = static_cast(info); + QStringList targetColors, sourceColors; + for (int index = 0; index < d->colorModeCombo->count(); ++index) { + const QString &color = d->colorModeCombo->itemText(index); + sourceColors << color; + if (colorInfo->colorMode.contains(color)) + targetColors << color; + } + if (targetColors.isEmpty() || targetColors == sourceColors) + break; + d->colorModeCombo->blockSignals(true); + d->colorModeCombo->clear(); + d->colorModeCombo->blockSignals(false); + d->colorModeCombo->addItems(targetColors); + } + break; + case DPrintPreviewSettingInfo::PS_PaperMargins: { + DPrintPreviewPaperMarginsInfo *marginInfo = static_cast(info); + d->marginsCombo->setCurrentIndex(marginInfo->marginType); + d->marginTopSpin->setValue(marginInfo->topMargin); + d->marginBottomSpin->setValue(marginInfo->bottomMargin); + d->marginLeftSpin->setValue(marginInfo->leftMargin); + d->marginRightSpin->setValue(marginInfo->rightMargin); + d->_q_marginEditFinished(); + } + break; + case DPrintPreviewSettingInfo::PS_Scaling: { + DPrintPreviewScalingInfo *scalingInfo = static_cast(info); + d->scaleGroup->button(scalingInfo->scalingType + 1)->click(); + d->scaleRateEdit->setValue(scalingInfo->scaleRatio); + } + break; + case DPrintPreviewSettingInfo::PS_Watermark: { + DPrintPreviewWatermarkInfo *watermarkInfo = static_cast(info); + d->waterMarkBtn->setChecked(watermarkInfo->opened); + if (!watermarkInfo->opened) { + d->pview->setWaterMarkType(DPrintPreviewDialogPrivate::Type_None); + break; // Watermark button should not update any watermarking function when off + } + + d->pview->refreshBegin(); + d->waterTypeGroup->button(int(watermarkInfo->currentWatermarkType))->setChecked(true); + switch (watermarkInfo->currentWatermarkType) { + case DPrintPreviewWatermarkInfo::TextWatermark: { + d->waterTextCombo->setCurrentIndex(watermarkInfo->textType); + d->waterTextEdit->setText(watermarkInfo->customText); + d->_q_customTextWatermarkFinished(); + QStringList targetFonts, sourceFonts; + for (int index = 0; index < d->fontCombo->count(); ++index) { + const QString &font = d->fontCombo->itemText(index); + sourceFonts << font; + if (watermarkInfo->fontList.contains(font)) + targetFonts << font; + } + + if (!targetFonts.isEmpty() && targetFonts != sourceFonts) { + d->fontCombo->blockSignals(true); + d->fontCombo->clear(); + d->fontCombo->blockSignals(false); + d->fontCombo->addItems(targetFonts); + } + + if (d->supportedColorMode) + d->_q_selectColorButton(watermarkInfo->textColor); + } + break; + case DPrintPreviewWatermarkInfo::ImageWatermark: { + d->picPathEdit->setText(watermarkInfo->imagePath); + } + break; + } + + d->waterPosCombox->setCurrentIndex(watermarkInfo->layout == DPrintPreviewWatermarkInfo::Tiled ? 0 : 1); + d->inclinatBox->setValue(watermarkInfo->angle); + Q_EMIT d->inclinatBox->editingFinished(); + d->waterSizeSlider->setValue(watermarkInfo->size); + d->wmOpaSlider->setValue(watermarkInfo->transparency); + + // TODO: Remove it. + if (!qFuzzyCompare(watermarkInfo->rowSpacing, -1)) { + qreal rowSpacing = watermarkInfo->rowSpacing; + rowSpacing = qBound(0.0, rowSpacing, 10.0); + d->pview->setProperty("_d_print_waterMarkRowSpacing", rowSpacing); + } + + if (!qFuzzyCompare(watermarkInfo->columnSpacing, -1)) { + qreal columnSpacing = watermarkInfo->columnSpacing; + columnSpacing = qBound(0.0, columnSpacing, 2.0); + d->pview->setProperty("_d_print_waterMarkColumnSpacing", columnSpacing); + } + d->pview->refreshEnd(); + } + break; + default: + break; + } +} + +void PreviewSettingsPluginHelper::updateSettingStatus(DPrintPreviewSettingInterface::SettingSubControl subControlType) +{ + QWidgetList sourceList = subControl(subControlType); + for (QWidget *w : sourceList) + doUpdateStatus(w, subControlType, w->isVisibleTo(w->parentWidget()), w->isEnabledTo(w->parentWidget())); +} + +void PreviewSettingsPluginHelper::doUpdateStatus(QWidget *source, DPrintPreviewSettingInterface::SettingSubControl subControlType, bool visible, bool enabled) +{ + if (!source) + return; + + do { + if (!m_currentInterface) + break; + + DPrintPreviewSettingInterface::SettingStatus status = m_currentInterface->settingStatus(d->settingHelper->m_printSettingData, subControlType); + switch (status) { + case DPrintPreviewSettingInterface::Hidden: { + source->setEnabled(enabled); + source->setVisible(false); + } + return; + case DPrintPreviewSettingInterface::Disabled: + source->setEnabled(false); + source->setVisible(visible); + return; + default: + break; + } + } while (false); + + source->setVisible(visible); + source->setEnabled(enabled); +} + +QWidgetList PreviewSettingsPluginHelper::subControl(DPrintPreviewSettingInterface::SettingSubControl subControlType) const +{ + if (subControlType >= sizeof(_d_printSettingNameMap) / sizeof(_d_printSettingNameMap[0])) + return {}; + return d->q_func()->findChildren(_d_printSettingNameMap[subControlType]); +} + +void PreviewSettingsPluginHelper::loadPlugin() +{ + static bool loaded = false; + if (loaded) + return; + const QString &path = pluginPath(); + if (!QFileInfo(path).exists()) + return; + + QDir pluginDir(path); + const QStringList &entryList = pluginDir.entryList(QDir::Files); + for (const QString &fileName : entryList) { + QPluginLoader loader(pluginDir.absoluteFilePath(fileName)); + QObject *plugin = loader.instance(); + if (!plugin) + continue; + DPrintPreviewSettingInterface *interface = dynamic_cast(plugin); + if (!interface) + continue; + m_availablePlugins.append(interface); + } + loaded = true; + if (!m_availablePlugins.isEmpty()) + m_currentInterface = m_availablePlugins.first(); +} + +void PreviewSettingsPluginHelper::setPluginMimeData(const QVariant &data) +{ + m_printSettingData = data; +} + +QVariant PreviewSettingsPluginHelper::pluginMimeData() +{ + return m_printSettingData; +} + +QStringList PreviewSettingsPluginHelper::availablePlugins() +{ + QStringList targets; + std::for_each(m_availablePlugins.cbegin(), m_availablePlugins.cend(), [&](DPrintPreviewSettingInterface *interface) { + targets << interface->name(); + }); + return targets; +} + +QString PreviewSettingsPluginHelper::currentPlugin() +{ + return m_currentInterface ? m_currentInterface->name() : QLatin1String(""); +} + +bool PreviewSettingsPluginHelper::setCurrentPlugin(const QString &pluginName) +{ + auto it = std::find_if(m_availablePlugins.cbegin(), m_availablePlugins.cend(), [=](DPrintPreviewSettingInterface *interface) { + if (interface->name() != pluginName) + return false; + return true; + }); + + if (it == m_availablePlugins.cend()) { + qWarning() << "DPrintPreviewDialog: " << "No plugin named " << pluginName << " was found."; + return false; + } + m_currentInterface = *it; + return true; +} + +QString PreviewSettingsPluginHelper::pluginPath() +{ +#if defined(Q_OS_LINUX) + return QLatin1String("/usr/share/deepin/dtk/plugins/printsupport"); +#else + return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/printsupport") + QLatin1String("/plugins"); +#endif +} + DWIDGET_END_NAMESPACE #include "moc_dprintpreviewdialog.cpp" diff -Nru dtkwidget-5.5.48/src/widgets/dprintpreviewdialog.h dtkwidget-5.6.12/src/widgets/dprintpreviewdialog.h --- dtkwidget-5.5.48/src/widgets/dprintpreviewdialog.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dprintpreviewdialog.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: chengyulong -* -* Maintainer: chengyulong -* -* 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 -* any later version. -* -* This program 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 . -*/ - -#ifndef DPRINTPREVIEWDIALOG_H -#define DPRINTPREVIEWDIALOG_H - -#include -#include - -DWIDGET_BEGIN_NAMESPACE -class DPrintPreviewDialogPrivate; -class DPrintPreviewDialog : public DDialog -{ - Q_OBJECT -public: - explicit DPrintPreviewDialog(QWidget *parent = nullptr); - ~DPrintPreviewDialog() override; - -Q_SIGNALS: - void paintRequested(DPrinter *printer); - void paintRequested(DPrinter *printer, const QVector &pageRange); - -private: - D_DECLARE_PRIVATE(DPrintPreviewDialog) - D_PRIVATE_SLOT(void _q_printerChanged(int)) - D_PRIVATE_SLOT(void _q_pageRangeChanged(int)) - D_PRIVATE_SLOT(void _q_pageMarginChanged(int)) - D_PRIVATE_SLOT(void _q_ColorModeChange(int)) - D_PRIVATE_SLOT(void _q_startPrint(bool)) - D_PRIVATE_SLOT(void _q_orientationChanged(int)) - D_PRIVATE_SLOT(void _q_customPagesFinished()) - D_PRIVATE_SLOT(void _q_marginspinChanged(double)) - D_PRIVATE_SLOT(void _q_marginEditFinished()) - D_PRIVATE_SLOT(void _q_currentPageSpinChanged(int)) - D_PRIVATE_SLOT(void _q_checkStateChanged(int)) - D_PRIVATE_SLOT(void _q_textWaterMarkModeChanged(int)) - D_PRIVATE_SLOT(void _q_customTextWatermarkFinished()) - D_PRIVATE_SLOT(void _q_colorButtonCliked(bool)) - D_PRIVATE_SLOT(void _q_selectColorButton(QColor)) - D_PRIVATE_SLOT(void _q_pagePersheetComboIndexChanged(int)) - D_PRIVATE_SLOT(void _q_printOrderComboIndexChanged(int)) - D_PRIVATE_SLOT(void _q_spinboxValueEmptyChecked(const QString &)) -public: - virtual bool event(QEvent *event) override; - bool eventFilter(QObject *watched, QEvent *event) override; - void setDocName(const QString &); - QString docName() const; - - bool setPrintFromPath(const QString &path = QString()); - QString printFromPath() const; - - bool setAsynPreview(int totalPage); - bool isAsynPreview() const; - - // QWidget interface -protected: - virtual void resizeEvent(QResizeEvent *event) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DPRINTPREVIEWDIALOG_H diff -Nru dtkwidget-5.5.48/src/widgets/dprintpreviewsettinginfo.cpp dtkwidget-5.6.12/src/widgets/dprintpreviewsettinginfo.cpp --- dtkwidget-5.5.48/src/widgets/dprintpreviewsettinginfo.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dprintpreviewsettinginfo.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "dprintpreviewsettinginfo.h" + +DWIDGET_BEGIN_NAMESPACE + +DPrintPreviewSettingInfo::DPrintPreviewSettingInfo(SettingType type) + : t(type) +{ + +} + +Dtk::Widget::DPrintPreviewSettingInfo::~DPrintPreviewSettingInfo() +{ + +} + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/dprintpreviewwidget.cpp dtkwidget-5.6.12/src/widgets/dprintpreviewwidget.cpp --- dtkwidget-5.5.48/src/widgets/dprintpreviewwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dprintpreviewwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,4 +1,7 @@ -#include "dprintpreviewwidget.h" +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "private/dprintpreviewwidget_p.h" #include #include @@ -7,6 +10,8 @@ #include #include +#include + #include #include @@ -24,42 +29,6 @@ #define WATER_TEXTSPACE WATER_DEFAULTFONTSIZE DWIDGET_BEGIN_NAMESPACE -// 取自Qt源码qpixmapfilter.cpp 945行 -static void grayscale(const QImage &image, QImage &dest, const QRect &rect = QRect()) -{ - QRect destRect = rect; - QRect srcRect = rect; - if (rect.isNull()) { - srcRect = dest.rect(); - destRect = dest.rect(); - } - if (&image != &dest) { - destRect.moveTo(QPoint(0, 0)); - } - - const unsigned int *data = reinterpret_cast(image.bits()); - unsigned int *outData = reinterpret_cast(dest.bits()); - - if (dest.size() == image.size() && image.rect() == srcRect) { - // a bit faster loop for grayscaling everything - int pixels = dest.width() * dest.height(); - for (int i = 0; i < pixels; ++i) { - int val = qGray(data[i]); - outData[i] = qRgba(val, val, val, qAlpha(data[i])); - } - } else { - int yd = destRect.top(); - for (int y = srcRect.top(); y <= srcRect.bottom() && y < image.height(); y++) { - data = reinterpret_cast(image.scanLine(y)); - outData = reinterpret_cast(dest.scanLine(yd++)); - int xd = destRect.left(); - for (int x = srcRect.left(); x <= srcRect.right() && x < image.width(); x++) { - int val = qGray(data[x]); - outData[xd++] = qRgba(val, val, val, qAlpha(data[x])); - } - } - } -} static void saveImageToFile(int index, const QString &outPutFileName, const QString &suffix, bool isJpegImage, const QImage &srcImage) { @@ -160,11 +129,14 @@ scene->setSceneRect(QRect(QPoint(0, 0), paperSize)); } -void DPrintPreviewWidgetPrivate::generatePreview() +void DPrintPreviewWidgetPrivate::updatePreview() { - if (refreshMode == RefreshDelay) - return; + generatePreview(); + graphicsView->updateGeometry(); +} +void DPrintPreviewWidgetPrivate::generatePreview() +{ int totalPages = 0; if (isAsynPreview) { if (currentPageNumber == 0) { @@ -1240,6 +1212,7 @@ { Q_D(DPrintPreviewWidget); + d->updateTimer.stop(); delete d->numberUpPrintData; } @@ -1252,9 +1225,7 @@ void DPrintPreviewWidget::setVisible(bool visible) { QWidget::setVisible(visible); - if (visible) { - updatePreview(); - } + // updatePreview() function move into DPrintPreviewDialog show event. } /*! @@ -1420,7 +1391,7 @@ Q_D(DPrintPreviewWidget); d->previewPrinter->setOrientation(pageOrientation); - d->generatePreview(); + updatePreview(); } /*! @@ -1723,6 +1694,22 @@ } /*! + \brief 获取文字水印的颜色。 + + \return 文字水印的颜色 + */ +QColor DPrintPreviewWidget::waterMarkColor() const +{ + Q_D(const DPrintPreviewWidget); + + if (imposition() == DPrintPreviewWidget::One) { + return d->waterMark->getColor(); + } else { + return d->numberUpPrintData->waterProperty->color; + } +} + +/*! \brief 设置文字水印的颜色。 \a color 文字水印的颜色 @@ -1839,7 +1826,6 @@ d->generatePreview(); Q_EMIT pagesCountChanged(d->pageRange.count()); - } else { d->order = order; totalPage = pagesCount(); @@ -1935,8 +1921,9 @@ void DPrintPreviewWidget::updatePreview() { Q_D(DPrintPreviewWidget); - d->generatePreview(); - d->graphicsView->updateGeometry(); + + if (!d->updateTimer.isActive()) + d->updateTimer.start(0, this); } /*! @@ -1998,8 +1985,9 @@ int lastPage = d->index2page(d->currentPageNumber - 1); if (lastPage > 0) d->pages.at(lastPage - 1)->setVisible(false); - } else + } else if (!d->pages.isEmpty()) { d->pages.first()->setVisible(false); + } d->setCurrentPageNumber(page); if (d->isAsynPreview) { d->previewPages = d->requestPages(page); @@ -2047,6 +2035,19 @@ d->graphicsView->setBackgroundBrush(QColor(255, 255, 255, 120)); } +void DPrintPreviewWidget::timerEvent(QTimerEvent *event) +{ + Q_D(DPrintPreviewWidget); + if (event->timerId() == d->updateTimer.timerId()) { + if (d->updateTimer.isActive()) { + d->updateTimer.stop(); + d->updatePreview(); + } + } + + return DFrame::timerEvent(event); +} + DPrinter::DPrinter(QPrinter::PrinterMode mode) : QPrinter(mode) { @@ -2195,7 +2196,7 @@ type = Image; sourceImage = img; graySourceImage = img; - grayscale(img, graySourceImage, img.rect()); + DWIDGET_NAMESPACE::grayScale(img, graySourceImage, img.rect()); } void WaterMark::paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) @@ -2237,8 +2238,25 @@ QFontMetrics fm(font); QSize textSize = fm.size(Qt::TextSingleLine, text); - int space = qMin(textSize.width(), textSize.height()); - QSize spaceSize = QSize(WATER_TEXTSPACE, space) * numberUpScale * wScale; + + // TODO: Remove it. + QVariant spacingProperty = pwidget->property("_d_print_waterMarkRowSpacing"); + int rowSpace; + if (spacingProperty.isValid()) { + rowSpace = qRound(textSize.height() * spacingProperty.toDouble()); + } else { + rowSpace = WATER_TEXTSPACE; + } + + int columnSpace; + spacingProperty = pwidget->property("_d_print_waterMarkColumnSpacing"); + if (spacingProperty.isValid()) { + columnSpace = qRound(textSize.width() * spacingProperty.toDouble()); + } else { + columnSpace = qMin(textSize.width(), textSize.height()); + } + + QSize spaceSize = QSize(columnSpace, rowSpace) * numberUpScale * wScale; QImage textImage(textSize + spaceSize, QImage::Format_ARGB32); textImage.fill(Qt::transparent); QPainter tp; diff -Nru dtkwidget-5.5.48/src/widgets/dprintpreviewwidget.h dtkwidget-5.6.12/src/widgets/dprintpreviewwidget.h --- dtkwidget-5.5.48/src/widgets/dprintpreviewwidget.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dprintpreviewwidget.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: chengyulong -* -* Maintainer: chengyulong -* -* 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 -* any later version. -* -* This program 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 . -*/ - -#ifndef DPRINTPREVIEWWIDGET_H -#define DPRINTPREVIEWWIDGET_H - -#include -#include -#include - -#include -#include -#include -#include - -#define private protected -#include -#undef private - -DGUI_USE_NAMESPACE - -DWIDGET_BEGIN_NAMESPACE - -class DPrintPreviewWidgetPrivate; - -class DPrinter : public QPrinter -{ -public: - explicit DPrinter(PrinterMode mode = ScreenResolution); - ~DPrinter() {} - - void setPreviewMode(bool isPreview); - - QList getPrinterPages(); - -private: -}; - -class LIBDTKWIDGETSHARED_EXPORT DPrintPreviewWidget : public DFrame -{ - Q_OBJECT -public: - enum Imposition { // 并打 - One, // 单页 - OneRowTwoCol, // 一行两列 - TwoRowTwoCol, // 两行两列 - TwoRowThreeCol, // 两行三列 - ThreeRowThreeCol, // 三行三列 - FourRowFourCol // 四行四列 - }; - enum PageRange { - AllPage, - CurrentPage, - SelectPage - }; - enum Order { // 并打顺序 - L2R_T2B, // 从左到右,从上到下 - R2L_T2B, // 从右到左,从上到下 - T2B_L2R, // 从上到下,从左到右 - T2B_R2L, // 从上到下,从右到左 - Copy // 重复 - }; - - enum PrintMode { // 打印模式 - PrintToPrinter, // 打印到打印机 - PrintToPdf, // 打印到pdf - PrintToImage // 另存为图片 - }; - - explicit DPrintPreviewWidget(DPrinter *printer, QWidget *parent = nullptr); - ~DPrintPreviewWidget() override; - - void setVisible(bool visible) override; - void setPageRange(const QVector &rangePages); - void setPageRange(int from, int to); - void setPageRangeALL(); - D_DECL_DEPRECATED void setReGenerate(bool generate); - void setPageRangeMode(PageRange mode); - PageRange pageRangeMode(); - void reviewChange(bool generate); - int pagesCount(); - int currentPage(); - bool turnPageAble(); - void setColorMode(const DPrinter::ColorMode &colorMode); - void setOrientation(const DPrinter::Orientation &pageOrientation); - DPrinter::ColorMode getColorMode(); - void setScale(qreal scale); - qreal getScale() const; - void updateView(); - void updateWaterMark(); - void refreshBegin(); - void refreshEnd(); - void setWaterMarkType(int type); - void setWaterMargImage(const QImage &image); - void setWaterMarkRotate(qreal rotate); - void setWaterMarkScale(qreal scale); - void setWaterMarkOpacity(qreal opacity); - void setConfidentialWaterMark(); - void setDraftWaterMark(); - void setSampleWaterMark(); - void setCustomWaterMark(const QString &text); - void setTextWaterMark(const QString &text); - void setWaterMarkFont(const QFont &font); - void setWaterMarkColor(const QColor &color); - void setWaterMarkLayout(int layout); - void setImposition(Imposition im); - Imposition imposition() const; - void setOrder(Order order); - DPrintPreviewWidget::Order order() const; - void setPrintFromPath(const QString &path); - QString printFromPath() const; - void setPrintMode(PrintMode pt); - void setAsynPreview(int totalPage); - bool isAsynPreview() const; - void isPageByPage(int pageCopy,bool isFirst); - int targetPageCount(int pageCount); - int originPageCount(); - QByteArray printerColorModel() const; - -public Q_SLOTS: - void updatePreview(); - void turnFront(); - void turnBack(); - void turnBegin(); - void turnEnd(); - void setCurrentPage(int page); - void print(bool isSavedPicture = false); - void themeTypeChanged(DGuiApplicationHelper::ColorType themeType); - -Q_SIGNALS: - void paintRequested(DPrinter *printer); - void paintRequested(DPrinter *printer, const QVector &pageRange); - void previewChanged(); - void currentPageChanged(int page); - void totalPages(int); - void pagesCountChanged(int pages); - -private: - void setCurrentTargetPage(int page); - - D_DECLARE_PRIVATE(DPrintPreviewWidget) - friend class ContentItem; -}; - -DWIDGET_END_NAMESPACE - -#endif // DPRINTPREVIEWWIDGET_H diff -Nru dtkwidget-5.5.48/src/widgets/DProgressBar dtkwidget-5.6.12/src/widgets/DProgressBar --- dtkwidget-5.5.48/src/widgets/DProgressBar 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DProgressBar 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dprogressbar.h" diff -Nru dtkwidget-5.5.48/src/widgets/dprogressbar.cpp dtkwidget-5.6.12/src/widgets/dprogressbar.cpp --- dtkwidget-5.5.48/src/widgets/dprogressbar.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dprogressbar.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dprogressbar.h" #include diff -Nru dtkwidget-5.5.48/src/widgets/dprogressbar.h dtkwidget-5.6.12/src/widgets/dprogressbar.h --- dtkwidget-5.5.48/src/widgets/dprogressbar.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dprogressbar.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DPROGRESSBAR_H -#define DPROGRESSBAR_H - -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DProgressBar : public QProgressBar, public DCORE_NAMESPACE::DObject -{ -public: - explicit DProgressBar(QWidget *parent = nullptr); - - QSize sizeHint() const override; - QSize minimumSizeHint() const override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DPROGRESSBAR_H diff -Nru dtkwidget-5.5.48/src/widgets/DPushButton dtkwidget-5.6.12/src/widgets/DPushButton --- dtkwidget-5.5.48/src/widgets/DPushButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DPushButton 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DQuickWidget dtkwidget-5.6.12/src/widgets/DQuickWidget --- dtkwidget-5.5.48/src/widgets/DQuickWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DQuickWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DRadioButton dtkwidget-5.6.12/src/widgets/DRadioButton --- dtkwidget-5.5.48/src/widgets/DRadioButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DRadioButton 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DRubberBand dtkwidget-5.6.12/src/widgets/DRubberBand --- dtkwidget-5.5.48/src/widgets/DRubberBand 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DRubberBand 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DScrollArea dtkwidget-5.6.12/src/widgets/DScrollArea --- dtkwidget-5.5.48/src/widgets/DScrollArea 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DScrollArea 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DScrollBar dtkwidget-5.6.12/src/widgets/DScrollBar --- dtkwidget-5.5.48/src/widgets/DScrollBar 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DScrollBar 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DSearchComboBox dtkwidget-5.6.12/src/widgets/DSearchComboBox --- dtkwidget-5.5.48/src/widgets/DSearchComboBox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSearchComboBox 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dsearchcombobox.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsearchcombobox.cpp dtkwidget-5.6.12/src/widgets/dsearchcombobox.cpp --- dtkwidget-5.5.48/src/widgets/dsearchcombobox.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsearchcombobox.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: wangpeng -* -* Maintainer: wangpeng -* -* 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 -* any later version. -* -* This program 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 . -*/ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dsearchcombobox.h" #include "private/dsearchcombobox_p.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsearchcombobox.h dtkwidget-5.6.12/src/widgets/dsearchcombobox.h --- dtkwidget-5.5.48/src/widgets/dsearchcombobox.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsearchcombobox.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: wangpeng -* -* Maintainer: wangpeng -* -* 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 -* any later version. -* -* This program 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 . -*/ -#ifndef DSEARCHCOMBOBOX_H -#define DSEARCHCOMBOBOX_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DSearchComboBoxPrivate; -class LIBDTKWIDGETSHARED_EXPORT DSearchComboBox : public DComboBox -{ - Q_OBJECT - Q_DISABLE_COPY(DSearchComboBox) - D_DECLARE_PRIVATE(DSearchComboBox) -public: - explicit DSearchComboBox(QWidget *parent = nullptr); - void setEditable(bool editable); - -protected: - void showPopup() override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DSEARCHCOMBOBOX_H diff -Nru dtkwidget-5.5.48/src/widgets/DSearchEdit dtkwidget-5.6.12/src/widgets/DSearchEdit --- dtkwidget-5.5.48/src/widgets/DSearchEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSearchEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dsearchedit.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsearchedit.cpp dtkwidget-5.6.12/src/widgets/dsearchedit.cpp --- dtkwidget-5.5.48/src/widgets/dsearchedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsearchedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dsearchedit.h" #include "dpalette.h" @@ -251,7 +238,9 @@ { #ifndef DTK_NO_MULTIMEDIA D_DC(DSearchEdit); +#ifdef ENABLE_AI return d->voiceInput && d->voiceInput->state() == QAudio::ActiveState; +#endif // #else return false; #endif @@ -298,10 +287,10 @@ action = new QAction(q); action->setObjectName("_d_search_leftAction"); - action->setIcon(QIcon::fromTheme("search_action")); + action->setIcon(QIcon::fromTheme("search_indicator")); q->lineEdit()->addAction(action, QLineEdit::LeadingPosition); action->setVisible(false); - iconbtn->setIconSize(QSize(32, 32)); + iconbtn->setIconSize(QSize(20, 20)); DPalette pe; QStyleOption opt; @@ -325,13 +314,14 @@ iconWidget->setAccessibleName("DSearchEditIconWidget"); QHBoxLayout *center_layout = new QHBoxLayout(iconWidget); center_layout->setMargin(0); - center_layout->setSpacing(0); + center_layout->setSpacing(6); layout->setMargin(0); layout->setSpacing(0); center_layout->addWidget(iconbtn, 0, Qt::AlignVCenter); center_layout->addWidget(label, 0, Qt::AlignCenter); + center_layout->addSpacing(12 / qApp->devicePixelRatio()); layout->addWidget(iconWidget, 0, Qt::AlignCenter); QAction* clearAction = q->lineEdit()->findChild(QLatin1String("_q_qlineeditclearaction")); diff -Nru dtkwidget-5.5.48/src/widgets/dsearchedit.h dtkwidget-5.6.12/src/widgets/dsearchedit.h --- dtkwidget-5.5.48/src/widgets/dsearchedit.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsearchedit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DSEARCHEDIT_H -#define DSEARCHEDIT_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DSearchEditPrivate; -class LIBDTKWIDGETSHARED_EXPORT DSearchEdit : public DLineEdit -{ - Q_OBJECT - Q_PROPERTY(bool voiceInput READ isVoiceInput NOTIFY voiceChanged) - -public: - explicit DSearchEdit(QWidget *parent = nullptr); - ~DSearchEdit(); - - void setPlaceHolder(QString placeHolder); - QString placeHolder() const; - - void clear(); - void clearEdit(); - - bool isVoiceInput() const; - - void setPlaceholderText(const QString &text); - QString placeholderText() const; - -Q_SIGNALS: - void voiceInputFinished(); - void searchAborted(); - void voiceChanged(); - -protected: - Q_DISABLE_COPY(DSearchEdit) - D_DECLARE_PRIVATE(DSearchEdit) - Q_PRIVATE_SLOT(d_func(), void _q_toEditMode(bool)) - D_PRIVATE_SLOT(void _q_onVoiceActionTrigger(bool)) - D_PRIVATE_SLOT(void _q_clearFocus()) -}; - -DWIDGET_END_NAMESPACE - -#endif // DSEARCHEDIT_H diff -Nru dtkwidget-5.5.48/src/widgets/DSegmentedControl dtkwidget-5.6.12/src/widgets/DSegmentedControl --- dtkwidget-5.5.48/src/widgets/DSegmentedControl 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSegmentedControl 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dsegmentedcontrol.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsegmentedcontrol.cpp dtkwidget-5.6.12/src/widgets/dsegmentedcontrol.cpp --- dtkwidget-5.5.48/src/widgets/dsegmentedcontrol.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsegmentedcontrol.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/src/widgets/dsegmentedcontrol.h dtkwidget-5.6.12/src/widgets/dsegmentedcontrol.h --- dtkwidget-5.5.48/src/widgets/dsegmentedcontrol.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsegmentedcontrol.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DSEGMENTEDCONTROL_H -#define DSEGMENTEDCONTROL_H - -#include -#include -#include -#include -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED DSegmentedHighlight : public QToolButton -{ - Q_OBJECT - -public: - explicit DSegmentedHighlight(QWidget *parent = 0); -}; - -class DSegmentedControlPrivate; -class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DButtonBox") DSegmentedControl : public QWidget, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DSegmentedControl) - - Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged) - Q_PROPERTY(int count READ count) - Q_PROPERTY(int animationDuration READ animationDuration WRITE setAnimationDuration) - Q_PROPERTY(QEasingCurve::Type animationType READ animationType WRITE setAnimationType) -public: - explicit DSegmentedControl(QWidget *parent = 0); - - int count() const; - const DSegmentedHighlight *highlight() const; - int currentIndex() const; - QToolButton *at(int index) const; - QString getText(int index) const; - QIcon getIcon(int index) const; - int animationDuration() const; - int indexByTitle(const QString &title) const; - - QEasingCurve::Type animationType() const; - -public Q_SLOTS: - int addSegmented(const QString &title); - int addSegmented(const QIcon &icon, const QString &title); - void addSegmented(const QStringList &titleList); - void addSegmented(const QList &iconList, const QStringList &titleList); - void insertSegmented(int index, const QString &title); - void insertSegmented(int index, const QIcon &icon, const QString &title); - void removeSegmented(int index); - void clear(); - bool setCurrentIndex(int currentIndex); - bool setCurrentIndexByTitle(const QString &title); - void setText(int index, const QString &title); - void setIcon(int index, const QIcon &icon); - void setAnimationDuration(int animationDuration); - void setAnimationType(QEasingCurve::Type animationType); - -private Q_SLOTS: - void updateHighlightGeometry(bool animation = true); - void buttonClicked(); - -Q_SIGNALS: - void currentChanged(int index); - void currentTitleChanged(QString title); - void animationDurationChanged(int animationDuration); - -protected: - bool eventFilter(QObject *, QEvent *) override; - void resizeEvent(QResizeEvent *event) override; -}; - -DWIDGET_END_NAMESPACE -#endif // DSEGMENTEDCONTROL_H diff -Nru dtkwidget-5.5.48/src/widgets/DSegmentedHighlight dtkwidget-5.6.12/src/widgets/DSegmentedHighlight --- dtkwidget-5.5.48/src/widgets/DSegmentedHighlight 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSegmentedHighlight 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dsegmentedcontrol.h" diff -Nru dtkwidget-5.5.48/src/widgets/DSettingsDialog dtkwidget-5.6.12/src/widgets/DSettingsDialog --- dtkwidget-5.5.48/src/widgets/DSettingsDialog 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSettingsDialog 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dsettingsdialog.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsettingsdialog.cpp dtkwidget-5.6.12/src/widgets/dsettingsdialog.cpp --- dtkwidget-5.5.48/src/widgets/dsettingsdialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsettingsdialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dsettingsdialog.h" @@ -41,13 +28,11 @@ const int DefaultTitlebarHeight = 40; /*! + @~english \class Dtk::Widget::DSettingsDialog \inmodule dtkwidget - - \brief 为使用DSettings的Dtk程序提供一个通用的设置对话框,这个对话框可以通过json配置文件来自动生成. \brief DSettingsDialog provide an common setting ui for deepin style application. - It's depend Dtk::Widget::DSettingsWidgetFactory to auot build ui compent from json file. - + \details It's depend Dtk::Widget::DSettingsWidgetFactory to auot build ui compent from json file. \sa Dtk::Widget::DSettingsWidgetFactory \sa Dtk::Core::DSettings */ @@ -136,13 +121,11 @@ } /*! - \brief 获取当前对话框使用的控件构造工厂。 - \brief Return the widget build factory of this dialog. - - 每一个设置对话框都有自己的构造工厂实例,这些实例并不会共享数据。 - Every instance of DSettingDialog has it own widgetfactory. + @~english + \brief get the factory of this dialog. + \details Every instance of DSettingDialog has it own widgetfactory. + \return Return the factory of this dialog. - \return */ DSettingsWidgetFactory *DSettingsDialog::widgetFactory() const { @@ -157,9 +140,10 @@ } /*! - \brief DSettingsDialog::setResetVisible 设置恢复默认设置按钮是否显示 - \a visible true显示 false隐藏 - \note 请在 updateSettings() 后调用 + @~english + \brief DSettingsDialog::setResetVisible Set the default setting button to display + \param[in] visible true: show, false: hide + \note Please call after updateSettings () */ void DSettingsDialog::setResetVisible(bool visible) { @@ -172,9 +156,10 @@ } /*! - \brief DSettingsDialog::scrollToGroup 使对话框跳转到指定的 group 项目 - \a groupKey DSettings中 groupKeys 以及其子项 childGroups - \note 请在对话框 show 以后调用 + @~english + \brief DSettingsDialog::scrollToGroup Turn the dialog to the specified group + \param[in] groupKey GroupKeys in DSettings and Childgroups + \note Please call after the dialog show() */ void DSettingsDialog::scrollToGroup(const QString &groupKey) { @@ -185,8 +170,9 @@ } /*! - \brief DSettingsDialog::setIcon 设置标题栏的图标 QIcon - \a icon 设置的 Icon + @~english + \brief DSettingsDialog::setIcon Set the icon of the title bar + \param[in] icon the Icon Set */ void DSettingsDialog::setIcon(const QIcon &icon) { @@ -196,12 +182,9 @@ } /*! - \brief Create all widget for settings options. - \brief 根据settings数据来创建控件,该方法只能调用一次。 - Warnning that you can only call the once. - - \a settings 配置文件实例。 - \a settings Dtk::Core::DSettings object from json + @~english + \brief Create all widget for settings options, that you can only call the once. + \param[in] settings Dtk::Core::DSettings object from json */ void DSettingsDialog::updateSettings(Dtk::Core::DSettings *settings) { @@ -210,14 +193,10 @@ } /*! - \brief 根据settings数据来创建控件,并使用translateContext来进行国际化,该方法只能调用一次. + @~english \brief Create all widget for settings options with translate context. - - \a translateContext 国际化使用的上下文。 - \a translateContext custom translate data for i18n. - \a settings 配置文件实例。 - \a settings Dtk::Core::DSettings object from json - + \param[in] translateContext custom translate data for i18n. + \param[in] settings Dtk::Core::DSettings object from json \sa DSettingsDialog::updateSettings(Dtk::Core::DSettings *settings) */ void DSettingsDialog::updateSettings(const QByteArray &translateContext, Core::DSettings *settings) diff -Nru dtkwidget-5.5.48/src/widgets/dsettingsdialog.h dtkwidget-5.6.12/src/widgets/dsettingsdialog.h --- dtkwidget-5.5.48/src/widgets/dsettingsdialog.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsettingsdialog.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include - -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DSettingsWidgetFactory; -class DSettingsDialogPrivate; -class LIBDTKWIDGETSHARED_EXPORT DSettingsDialog : public DAbstractDialog -{ - Q_OBJECT -public: - DSettingsDialog(QWidget *parent = nullptr); - ~DSettingsDialog(); - - DSettingsWidgetFactory* widgetFactory() const; - bool groupIsVisible(const QString &groupKey) const; - void setResetVisible(bool visible); - void scrollToGroup(const QString &groupKey); //需要在对话框 show 以后使用 - void setIcon(const QIcon &icon); - -public Q_SLOTS: - void updateSettings(DTK_CORE_NAMESPACE::DSettings *settings); - void updateSettings(const QByteArray &translateContext, DTK_CORE_NAMESPACE::DSettings *settings); - void setGroupVisible(const QString &groupKey, bool visible); - -private: - QScopedPointer dd_ptr; - Q_DECLARE_PRIVATE_D(qGetPtrHelper(dd_ptr), DSettingsDialog) -}; - -DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/DSettingsWidgetFactory dtkwidget-5.6.12/src/widgets/DSettingsWidgetFactory --- dtkwidget-5.5.48/src/widgets/DSettingsWidgetFactory 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSettingsWidgetFactory 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dsettingswidgetfactory.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsettingswidgetfactory.cpp dtkwidget-5.6.12/src/widgets/dsettingswidgetfactory.cpp --- dtkwidget-5.5.48/src/widgets/dsettingswidgetfactory.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsettingswidgetfactory.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dsettingswidgetfactory.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsettingswidgetfactory.h dtkwidget-5.6.12/src/widgets/dsettingswidgetfactory.h --- dtkwidget-5.5.48/src/widgets/dsettingswidgetfactory.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsettingswidgetfactory.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include - -#include -#include - -#include - -DCORE_BEGIN_NAMESPACE -class DSettingsOption; -DCORE_END_NAMESPACE - -DWIDGET_BEGIN_NAMESPACE - -class DSettingsWidgetFactoryPrivate; -class LIBDTKWIDGETSHARED_EXPORT DSettingsWidgetFactory : public QObject -{ - Q_OBJECT -public: - typedef QWidget *(WidgetCreateHandler)(QObject *); - typedef QPair (ItemCreateHandler)(QObject *); - - explicit DSettingsWidgetFactory(QObject *parent = Q_NULLPTR); - ~DSettingsWidgetFactory(); - - void registerWidget(const QString &viewType, std::function handler); - void registerWidget(const QString &viewType, std::function handler); - - QWidget *createWidget(QPointer option); - QWidget *createWidget(const QByteArray &translateContext, QPointer option); - QPair createItem(QPointer option) const; - QPair createItem(const QByteArray &translateContext, QPointer option) const; - - D_DECL_DEPRECATED static QWidget *createTwoColumWidget(DTK_CORE_NAMESPACE::DSettingsOption *option, QWidget *rightWidget); - D_DECL_DEPRECATED static QWidget *createTwoColumWidget(const QByteArray &translateContext, DTK_CORE_NAMESPACE::DSettingsOption *option, QWidget *rightWidget); - static QPair createStandardItem(const QByteArray &translateContext, DTK_CORE_NAMESPACE::DSettingsOption *option, QWidget *rightWidget); - -private: - QScopedPointer dd_ptr; - Q_DECLARE_PRIVATE_D(qGetPtrHelper(dd_ptr), DSettingsWidgetFactory) -}; - -DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/DShadowLine dtkwidget-5.6.12/src/widgets/DShadowLine --- dtkwidget-5.5.48/src/widgets/DShadowLine 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DShadowLine 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dshadowline.h" diff -Nru dtkwidget-5.5.48/src/widgets/dshadowline.cpp dtkwidget-5.6.12/src/widgets/dshadowline.cpp --- dtkwidget-5.5.48/src/widgets/dshadowline.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dshadowline.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dshadowline.h" #include @@ -36,7 +20,6 @@ DShadowLinePrivate(DShadowLine *qq) : DObjectPrivate(qq) { - } QPixmap shadow; @@ -50,11 +33,22 @@ : QWidget(parent) , DObject(*new DShadowLinePrivate(this)) { - connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [this] { - D_D(DShadowLine); - d->shadow = QPixmap(); - update(); - }); + D_D(DShadowLine); + // 在非变色龙主题下,无法通过QIcon::fromtheme访问这个图标资源 + // 为了让软件在其他非变色龙的主题上正常显示,这里不使用图标引擎,而直接使用图标 + auto getPixmap = [=](DGuiApplicationHelper::ColorType themeType) { + return themeType == DGuiApplicationHelper::LightType ? + QPixmap::fromImage(QImage(":/icons/deepin/builtin/light/texts/titlebar_shadow_20px.svg")) : + QPixmap::fromImage(QImage(":/icons/deepin/builtin/dark/texts/titlebar_shadow_20px.svg")); + }; + d->shadow = getPixmap(DGuiApplicationHelper::instance()->themeType()); + connect(DGuiApplicationHelper::instance(), + &DGuiApplicationHelper::themeTypeChanged, + this, + [=](DGuiApplicationHelper::ColorType themeType) { + d->shadow = getPixmap(themeType); + update(); + }); setAttribute(Qt::WA_TransparentForMouseEvents); setFocusPolicy(Qt::NoFocus); @@ -70,10 +64,6 @@ Q_UNUSED(event) D_D(DShadowLine); - if (d->shadow.isNull()) { - d->shadow = QIcon::fromTheme("titlebar_shadow").pixmap(sizeHint()); - } - QPainter pa(this); pa.drawPixmap(contentsRect(), d->shadow); } diff -Nru dtkwidget-5.5.48/src/widgets/dshadowline.h dtkwidget-5.6.12/src/widgets/dshadowline.h --- dtkwidget-5.5.48/src/widgets/dshadowline.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dshadowline.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DSHADOWLINE_H -#define DSHADOWLINE_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DShadowLinePrivate; -class LIBDTKWIDGETSHARED_EXPORT DShadowLine : public QWidget, public DCORE_NAMESPACE::DObject -{ - D_DECLARE_PRIVATE(DShadowLine) - -public: - explicit DShadowLine(QWidget *parent = nullptr); - - QSize sizeHint() const; - -protected: - void paintEvent(QPaintEvent *event) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DSHADOWLINE_H diff -Nru dtkwidget-5.5.48/src/widgets/dshortcutedit.cpp dtkwidget-5.6.12/src/widgets/dshortcutedit.cpp --- dtkwidget-5.5.48/src/widgets/dshortcutedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dshortcutedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dshortcutedit.h" #include "dthememanager.h" diff -Nru dtkwidget-5.5.48/src/widgets/dshortcutedit.h dtkwidget-5.6.12/src/widgets/dshortcutedit.h --- dtkwidget-5.5.48/src/widgets/dshortcutedit.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dshortcutedit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DSHORTCUTEDIT_H -#define DSHORTCUTEDIT_H - -#include -#include -#include -#include -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DShortcutEditLabel; -class D_DECL_DEPRECATED_X("Use DKeySequenceEdit instead.") LIBDTKWIDGETSHARED_EXPORT DShortcutEdit : public QFrame -{ - Q_OBJECT - -public: - DShortcutEdit(QWidget *parent = Q_NULLPTR); - - QSize sizeHint() const; - bool eventFilter(QObject *o, QEvent *e); - bool isValidShortcutKey(const QString & key); - const QMap &getKeyMapping() const; - const QList &getBlockShortcutKeysList() const; - -Q_SIGNALS: - void shortcutKeysChanged(const QString & shortcutKeys); - void shortcutKeysFinished(const QString & shortcutKeys); - void invalidShortcutKey(const QString & shortcutKeys); - -public Q_SLOTS: - void clearShortcutKey(); - void setShortcutKey(const QString & key); - void setKeyMapping(const QMap & mapping); - void setBlockShortcutKeysList(const QList & kList); - void setInValidState() const; - void setNormalState() const; - -private Q_SLOTS: - void toEchoMode(); - void toInputMode() const; - void shortcutKeyPress(QKeyEvent *e); - -private: - QString convertShortcutKeys(const QString & keys); - -private: - DShortcutEditLabel *m_keysLabel; - QLabel *m_keysEdit; - - QString m_shortcutKeys; - QList m_blockedShortcutKeys; - QMap m_keyMapping; - - static const QString DefaultTips; -}; - -class DShortcutEditLabel : public QLabel -{ - Q_OBJECT - Q_PROPERTY(QColor echoNormal MEMBER m_colorNormal NOTIFY colorSettingChange DESIGNABLE true SCRIPTABLE true) - Q_PROPERTY(QColor echoHover MEMBER m_colorHover NOTIFY colorSettingChange DESIGNABLE true SCRIPTABLE true) - Q_PROPERTY(QColor echoInvalid MEMBER m_colorInvalid NOTIFY colorSettingChange DESIGNABLE true SCRIPTABLE true) - -public: - enum EchoState {Normal = 1, Hover, Invalid}; - -public: - DShortcutEditLabel(QWidget * parent = 0); - - void setEchoState(const EchoState state); - -Q_SIGNALS: - void colorSettingChange(); - -private: - void enterEvent(QEvent *); - void leaveEvent(QEvent *); - -private: - QColor m_colorNormal; - QColor m_colorHover; - QColor m_colorInvalid; - - EchoState m_state = Normal; -}; - -DWIDGET_END_NAMESPACE - -#endif // DSHORTCUTEDIT_H diff -Nru dtkwidget-5.5.48/src/widgets/DSimpleListItem dtkwidget-5.6.12/src/widgets/DSimpleListItem --- dtkwidget-5.5.48/src/widgets/DSimpleListItem 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSimpleListItem 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dsimplelistitem.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsimplelistitem.cpp dtkwidget-5.6.12/src/widgets/dsimplelistitem.cpp --- dtkwidget-5.5.48/src/widgets/dsimplelistitem.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsimplelistitem.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,25 +1,6 @@ -/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- - * -*- coding: utf-8 -*- - * - * Copyright (C) 2011 ~ 2017 Deepin, Inc. - * 2011 ~ 2017 Wang Yong - * - * Author: Wang Yong - * Maintainer: Wang Yong - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dsimplelistitem.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsimplelistitem.h dtkwidget-5.6.12/src/widgets/dsimplelistitem.h --- dtkwidget-5.5.48/src/widgets/dsimplelistitem.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsimplelistitem.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- - * -*- coding: utf-8 -*- - * - * Copyright (C) 2011 ~ 2017 Deepin, Inc. - * 2011 ~ 2017 Wang Yong - * - * Author: Wang Yong - * Maintainer: Wang Yong - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DSIMPLELISTITEM_H -#define DSIMPLELISTITEM_H - -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DSimpleListItem : public QObject -{ - Q_OBJECT - -public: - DSimpleListItem(); - - /* - * The interface function that used to compare the two DSimpleListItem - * The DSimpleListView requires this interface to keep the selected items unchanged when refreshed - * - * \item any subclass of DSimpleListItem, you can use static_cast in implementation to access any attribute to compare two items - * \return return true if two items have same attribute, the compare method implement by subclass of DSimpleListItem - */ - - virtual bool sameAs(DSimpleListItem *item)=0; - - /* - * The interface function that used to draw background of DSimpleListItem. - * Such as background and selected effect. - * - * \rect row corresponding to the drawing of the rectangular area - * \painter the painter used to draw anything you want - * \index the index of DSimpleListItem, you can draw different rows effect based on the index, such as the zebra crossing - * \isSelect current item is selected, you can draw selected effect under content when isSelect is true - * \isHover current item is hovered, you can draw hover effect under content when isHover is true - */ - - virtual void drawBackground(QRect rect, QPainter *painter, int index, bool isSelect, bool isHover)=0; - - /* - * The interface function that used to draw foreground of DSimpleListItem. - * - * \rect column corresponding to the drawing of the rectangular area - * \painter the painter used to draw anything you want - * \column the column of DSimpleListItem, you can draw different column content based on the column index - * \index the index of DSimpleListItem, you can draw different rows effect based on the index, such as the zebra crossing - * \isSelect current item is selected, you can draw selected effect under content when isSelect is true - * \isHover current item is hovered, you can draw hover effect under content when isHover is true - */ - - virtual void drawForeground(QRect rect, QPainter *painter, int column, int index, bool isSelect, bool isHover)=0; -}; - -DWIDGET_END_NAMESPACE - -#endif diff -Nru dtkwidget-5.5.48/src/widgets/DSimpleListView dtkwidget-5.6.12/src/widgets/DSimpleListView --- dtkwidget-5.5.48/src/widgets/DSimpleListView 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSimpleListView 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dsimplelistview.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsimplelistview.cpp dtkwidget-5.6.12/src/widgets/dsimplelistview.cpp --- dtkwidget-5.5.48/src/widgets/dsimplelistview.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsimplelistview.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,25 +1,6 @@ -/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- - * -*- coding: utf-8 -*- - * - * Copyright (C) 2011 ~ 2017 Deepin, Inc. - * 2011 ~ 2017 Wang Yong - * - * Author: Wang Yong - * Maintainer: Wang Yong - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dsimplelistview.h" #include diff -Nru dtkwidget-5.5.48/src/widgets/dsimplelistview.h dtkwidget-5.6.12/src/widgets/dsimplelistview.h --- dtkwidget-5.5.48/src/widgets/dsimplelistview.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsimplelistview.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,289 +0,0 @@ -/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- - * -*- coding: utf-8 -*- - * - * Copyright (C) 2011 ~ 2017 Deepin, Inc. - * 2011 ~ 2017 Wang Yong - * - * Author: Wang Yong - * Maintainer: Wang Yong - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DSIMPLELISTVIEW_H -#define DSIMPLELISTVIEW_H - -#include -#include -#include -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -typedef bool (* SortAlgorithm) (const DSimpleListItem *item1, const DSimpleListItem *item2, bool descendingSort); -typedef bool (* SearchAlgorithm) (const DSimpleListItem *item, QString searchContent); - -class DSimpleListViewPrivate; -class LIBDTKWIDGETSHARED_EXPORT DSimpleListView : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - -public: - explicit DSimpleListView(QWidget *parent = 0); - ~DSimpleListView(); - - // DSimpleListView interfaces. - - /* - * Set row height of DSimpleListView. - * - * \height the height of row - */ - void setRowHeight(int height); - - /* - * Set column titles, widths and height. - * If you want some column use expand space, please set width with -1 - * Only allowed one -1 to set in width list. - * - * \titles a list to contains titles - * \widths the width of column, list length same as titles list - * \height height of titlebar, don't display titlebar if set height with 0 - */ - void setColumnTitleInfo(QList titles, QList widths, int height); - - /* - * Set column hide flags. - * At least have false in hide flags list, and hide flags count must same as titles list. - * - * \toggleHideFlags the hide flags to control column wether toggle show/hide. - * \alwaysVisibleColumn the column index that column is always visible, default is -1, mean no column can always visible. - */ - void setColumnHideFlags(QList toggleHideFlags, int alwaysVisibleColumn=-1); - - /* - * Set column sorting algorithms. - * Note SortAlgorithm function type must be 'static', otherwise function pointer can't match type. - * - * \algorithms a list of SortAlgorithm, SortAlgorithm is function pointer, it's type is: 'bool (*) (const DSimpleListItem *item1, const DSimpleListItem *item2, bool descendingSort)' - * \sortColumn default sort column, -1 mean don't sort any column default - * \descendingSort whether sort column descending, default is false - */ - void setColumnSortingAlgorithms(QList *algorithms, int sortColumn=-1, bool descendingSort=false); - - /* - * Set search algorithm to filter match items. - * - * \algorithm the search algorithm, it's type is: 'bool (*) (const DSimpleListItem *item, QString searchContent)' - */ - void setSearchAlgorithm(SearchAlgorithm algorithm); - - /* - * Set radius to clip listview. - * - * \radius the radius of clip area, default is 0 pixel. - */ - void setClipRadius(int radius); - - /* - * Set frame details. - * - * \enableFrame draw frame if enableFrame is true, default is false - * the frame color, default is black - * \opacity the frame opacity, default is 0.1 - */ - void setFrame(bool enableFrame, QColor color=QColor("#000000"), double opacity=0.1); - - /* - * Add DSimpleListItem list to ListView. - * If user has click title to sort, sort items after add items to list. - * - * \items List of LiteItem* - */ - void addItems(QList items); - - /* - * Remove DSimpleListItem from list. - * - * \item item to remove - */ - void removeItem(DSimpleListItem* item); - - /* - * Clear items from DSimpleListView. - */ - void clearItems(); - - /* - * Add DSimpleListItem list to mark selected effect in ListView. - * - * \items List of DSimpleListItem* to mark selected - * \recordLastSelection record last selection item to make selected operation continuously, default is true - */ - void addSelections(QList items, bool recordLastSelection=true); - - /* - * Clear selection items from DSimpleListView. - * - * \clearLastSelection clear last selection item if option is true, default is true - */ - void clearSelections(bool clearLastSelection=true); - - /* - * Get selection items. - * - * \return List of DSimpleListItem* to mark selected - */ - QList getSelections(); - - /* - * Refresh all items in DSimpleListView. - * This function is different that addItems is: it will clear items first before add new items. - * This function will keep selection status and scroll offset when add items. - * - * \items List of DSimpleListItem* to add - */ - void refreshItems(QList items); - - /* - * Search - */ - void search(QString searchContent); - - /* - * Set single selection. - */ - void setSingleSelect(bool singleSelect); - - /* - * Keep select items when click blank area. - */ - void keepSelectWhenClickBlank(bool keep); - - // DSimpleListView operations. - void selectAllItems(); - void selectFirstItem(); - void selectLastItem(); - void selectNextItem(); - void selectPrevItem(); - - void shiftSelectPageDown(); - void shiftSelectPageUp(); - void shiftSelectToEnd(); - void shiftSelectToHome(); - void shiftSelectToNext(); - void shiftSelectToPrev(); - - void scrollPageDown(); - void scrollPageUp(); - - void ctrlScrollPageDown(); - void ctrlScrollPageUp(); - void ctrlScrollToEnd(); - void ctrlScrollToHome(); - -protected: - virtual void leaveEvent(QEvent * event); - - QPixmap arrowDownDarkHoverImage; - QPixmap arrowDownDarkNormalImage; - QPixmap arrowDownDarkPressImage; - QPixmap arrowDownHoverImage; - QPixmap arrowDownLightHoverImage; - QPixmap arrowDownLightNormalImage; - QPixmap arrowDownLightPressImage; - QPixmap arrowDownNormalImage; - QPixmap arrowDownPressImage; - QPixmap arrowUpDarkHoverImage; - QPixmap arrowUpDarkNormalImage; - QPixmap arrowUpDarkPressImage; - QPixmap arrowUpHoverImage; - QPixmap arrowUpLightHoverImage; - QPixmap arrowUpLightNormalImage; - QPixmap arrowUpLightPressImage; - QPixmap arrowUpNormalImage; - QPixmap arrowUpPressImage; - QString backgroundColor = "#ffffff"; - QString scrollbarColor = "#ffffff"; - QString searchColor = "#000000"; - QString titleAreaColor = "#ffffff"; - QString titleColor = "#000000"; - QString titleLineColor = "#000000"; - QColor frameColor = QColor("#000000"); - double backgroundOpacity = 0.03; - double frameOpacity = 0.1; - double titleAreaOpacity = 0.02; - int titleSize = 10; - qreal scrollbarFrameHoverOpacity = 0; - qreal scrollbarFrameNormalOpacity = 0; - qreal scrollbarFramePressOpacity = 0; - qreal scrollbarHoverOpacity = 0.7; - qreal scrollbarNormalOpacity = 0.5; - qreal scrollbarPressOpacity = 0.8; - -Q_SIGNALS: - void rightClickItems(QPoint pos, QList items); - void changeColumnVisible(int index, bool visible, QList columnVisibles); - void changeSortingStatus(int index, bool sortingOrder); - void changeHoverItem(QPoint pos, DSimpleListItem* item, int columnIndex); - - void mouseHoverChanged(DSimpleListItem* oldItem, DSimpleListItem* newItem, int columnIndex, QPoint pos); - void mousePressChanged(DSimpleListItem* item, int columnIndex, QPoint pos); - void mouseReleaseChanged(DSimpleListItem* item, int columnIndex, QPoint pos); - -protected: - bool eventFilter(QObject *, QEvent *event); - void keyPressEvent(QKeyEvent *keyEvent); - void mouseMoveEvent(QMouseEvent *mouseEvent); - void mousePressEvent(QMouseEvent *mouseEvent); - void mouseReleaseEvent(QMouseEvent *mouseEvent); - void paintEvent(QPaintEvent *); - void wheelEvent(QWheelEvent *event); - - void paintScrollbar(QPainter *painter); - - void selectPrevItemWithOffset(int scrollOffset); - void selectNextItemWithOffset(int scrollOffset); - void shiftSelectNextItemWithOffset(int scrollOffset); - void shiftSelectPrevItemWithOffset(int scrollOffset); - - int getBottomRenderOffset(); - int getScrollbarY(); - int getScrollAreaHeight(); - int getScrollbarHeight(); - - QList getRenderWidths(); - - void shiftSelectItemsWithBound(int selectionStartIndex, int selectionEndIndex); - int adjustRenderOffset(int offset); - - void startScrollbarHideTimer(); - - bool isMouseAtScrollArea(int x); - bool isMouseAtTitleArea(int y); - - QList columnVisibles; - -private Q_SLOTS: - void hideScrollbar(); - -private: - D_DECLARE_PRIVATE(DSimpleListView) -}; - -DWIDGET_END_NAMESPACE - -#endif diff -Nru dtkwidget-5.5.48/src/widgets/DSlider dtkwidget-5.6.12/src/widgets/DSlider --- dtkwidget-5.5.48/src/widgets/DSlider 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSlider 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dslider.h" diff -Nru dtkwidget-5.5.48/src/widgets/dslider.cpp dtkwidget-5.6.12/src/widgets/dslider.cpp --- dtkwidget-5.5.48/src/widgets/dslider.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dslider.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2011 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: wp - * - * Maintainer: wp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dslider.h" #include "private/dslider_p.h" @@ -62,50 +45,56 @@ }; /*! + @~english \class Dtk::Widget::DSlider \inmodule dtkwidget - \brief DSlider一个聚合 QSlider 的滑块. + \brief DSlider A slider that aggregates QSLIDER. - DSlider提供了在滑块两侧设置图标函数 - DSlider提供了滑块的刻度及刻度标识 + DSlider Provides icon functions on both sides of the slider + DSlider Provide the size and scale identification of the slider */ /*! + @~english \fn void DSlider::valueChanged(int value) - \brief 信号会在 slider \a value 属性的值改变时被发送. + \brief The signal will be sent when the value of the Slider Value property is changed. */ /*! + @~english \fn void DSlider::sliderMoved(int position) - \brief 信号会在 slider 拖动时被发送. - - \a position 为 slider 被拖动的指针的位置。 + \brief The signal will be sent when the slider drags. + \param[in] position The position of the pointer dragged by Slider. */ /*! + @~english \fn void DSlider::sliderReleased() - \brief 信号会在 slider 被松开时被发送. + \brief The signal will be sent when the slider is loosened. */ /*! + @~english \fn void DSlider::rangeChanged(int min, int max) - \brief 信号会在 range 属性的值改变时被发送. - - \a min 为 range 的最小值, \a max 为 range 的最大值。 + \brief The signal will be sent when the value of the Range attribute is changed + \param[in] min The minimum value of Range + \param[in] max is the maximum value of Range */ /*! + @~english \fn void DSlider::actionTriggered(int action) - \brief 信号会在 slider \a action 触发时被发送 + \brief The signal is sent when the slider action triggers */ /*! + @~english \fn void DSlider::iconClicked(SliderIcons icon, bool checked) - \brief 信号会在左右 iconbutton 被点击时被发送. - - \a icon 表示按钮被点击的位置,\a checked 表示按钮是否被选中。 + \brief The signal will be sent when Iconbutton is clicked. + \param[in] icon Express the position where the button is clicked, + and Checked indicates whether the button is selected. */ /*! - \brief DSlider的构造函数. - - \a parent 参数被发送到 QWidget 构造函数。 - + @~english + \brief DSLider's constructor. + \param[in] orientation Slip direction. + \param[in] parent The parameters are sent to the QWIDGET constructor. \sa Qt::Orientation */ DSlider::DSlider(Qt::Orientation orientation, QWidget *parent) @@ -134,11 +123,11 @@ } /*! - \brief 事件过滤器函数. - \reimp - - 此函数目前仅处理了鼠标滚轮事件 - \a watched 被监听的子控件,\a e 对应的事件指针。 + @~english + \brief Event filter function + \details This function currently only handle the mouse roller incident + \param[in] watched Subsidined control + \param[in] e Corresponding event pointer */ bool DSlider::eventFilter(QObject *watched, QEvent *e) { @@ -151,10 +140,9 @@ } /*! - \brief 滑块方向 - - \return 返回当前滑块的方向。 - + @~english + \brief orientation of slider + \return Return to the direction of the current slider \sa QSlider::orientation() */ Qt::Orientation DSlider::orientation() const @@ -163,10 +151,10 @@ return d->slider->orientation(); } /*! - \brief 返回 QSlider 对象. - - 若 DSlider 不满足输入框的使用需求,请用此函数抛出的对象。 - \return QSlider 对象。 + @~english + \brief return QSLider object. + \details If DSLider does not meet the needs of the input box, use this function to throw it. + \return QSlider Object. */ QSlider *DSlider::slider() { @@ -175,8 +163,9 @@ } /*! - \brief 设置滑块左侧图标. - \a left 左图标 + @~english + \brief Set the left icon on the left side of the slider. + \param[in] left Left icon */ void DSlider::setLeftIcon(const QIcon &left) { @@ -203,8 +192,9 @@ } /*! - \brief 设置滑块右图标. - \a right 右图标 + @~english + \brief Set the right icon of slider. + \param[in] right Right icon */ void DSlider::setRightIcon(const QIcon &right) { @@ -230,8 +220,9 @@ } /*! - \brief 设置滑块图标大小. - \a size 图标大小 + @~english + \brief Set the slider icon size. + \param[in] size Icon size */ void DSlider::setIconSize(const QSize &size) { @@ -249,10 +240,9 @@ } /*! - \brief 设置滑动范围的最小值. - - \a min 滑动最小值。 - + @~english + \brief Set the minimum value of sliding range. + \param[in] min Slide the minimum value. \sa QSlider::setMinimum() DSlider::minimum() */ void DSlider::setMinimum(int min) @@ -262,10 +252,9 @@ } /*! - \brief 滑动范围的最小值. - - \return 返回滑动范围的最小值。 - + @~english + \brief The minimum value of sliding range. + \return Return to the minimum value of sliding range. \sa QSlider::minimum() DSlider::setMinimum() */ int DSlider::minimum() const @@ -275,10 +264,9 @@ } /*! - \brief 设置滑块当前值 - - \a value 滑块的当前值。 - + @~english + \brief Set the current value of slider + \param[in] value The current value of the slider. \sa QSlider::setValue() */ void DSlider::setValue(int value) @@ -288,6 +276,7 @@ } /*! + @~english \brief DSlider::value \sa QSlider::value() */ @@ -298,13 +287,10 @@ } /*! - \brief 设置页面单步的大小 - - 使用按键 PageUp 或者 PageDown 时,滑块 - 滑动的单步大小。 - - \a pageStep 单步大小. - + @~english + \brief Set the size of the page single step. + \details use the kernel Pageup or PageDown, the slider slides the single step size. + \param[in] pageStep One-step size. \sa QSlider::setPageStep() */ void DSlider::setPageStep(int pageStep) @@ -314,10 +300,9 @@ } /*! - \brief 返回页面单步大小 - - \return 页面单步大小的值。 - + @~english + \brief Back to the page single step size + \return The one-step value of the page. \sa QSlider::pageStep() DSlider::setPageStep() */ int DSlider::pageStep() const @@ -327,10 +312,9 @@ } /*! - \brief 设置滑动范围的最大值 - - \a max 滑动范围的最大值。 - + @~english + \brief Set the maximum value of sliding range + \param[in] max The maximum value of sliding range. \sa QSlider::setMaximum() DSlider::maximum() */ void DSlider::setMaximum(int max) @@ -340,10 +324,9 @@ } /*! - \brief 返回滑动范围的最大值 - - \return 滑动范围的最大值 - + @~english + \brief Back to the maximum value of sliding range + \return The maximum value of sliding range \sa QSlider::maximum */ int DSlider::maximum() const @@ -353,12 +336,12 @@ } /*! - \brief 设置滑块左侧的刻度值. - - 根据 QStringList 数量,绘制刻度的个数,绘制刻度标识: - 滑块为水平,刻度在滑块上方;滑块为垂直,刻度在滑块左侧。 - - \a info 刻度标识 + @~english + \brief Set the scale on the left side of the slider. + \details According to the quantity of QStringList,draw number of scales,Draw the scale identification: + The slider is horizontal, and the scale is above the slider; + the slider is vertical and the scale is on the left side of the slider. + \param[in] info Scale identification */ void DSlider::setLeftTicks(const QStringList &info) { @@ -389,12 +372,12 @@ } /*! - \brief 设置滑块右侧的刻度值. - - 根据 QStringList 数量,绘制刻度的个数,绘制刻度标识: - 滑块为水平,刻度在滑块下方;滑块为垂直,刻度在滑块右侧。 - - \a info 刻度标识 + @~english + \brief Set the scale value of the right side of the slider. + \details According to the number of QStringList, the number of drawing scale, draw scale identification: + The slider is horizontal, and the scale is below the slider; + the slider is vertical and the scale is on the right side of the slider. + \param[in] info Scale identification */ void DSlider::setRightTicks(const QStringList &info) { @@ -425,10 +408,9 @@ } /*! - \brief 设置滑块上方的刻度值 - - \a info 刻度标识. - + @~english + \brief Set the scale value above the slider + \param[in] info Scale logo. \sa DSlider::setLeftTicks() */ void DSlider::setAboveTicks(const QStringList &info) @@ -437,10 +419,9 @@ } /*! - \brief 设置滑块下方的刻度值 - - \a info 刻度标识. - + @~english + \brief Set the scale value below the slider + \param[in] info Scale logo. \sa DSlider::setRightTicks() */ void DSlider::setBelowTicks(const QStringList &info) @@ -449,14 +430,14 @@ } /*! - \brief 设置显示双边的刻度线(不显示刻度值). + @~english + \brief Set the bilateral scales (no scale value). - 举例用途:比如调节音量的 DSlider ,需要在 value = 100 的地方标记一个刻度,而不需要显示其他的刻度值(并且实际音量值是可以超过 100 的) - 其他:设置指定数值的刻度线(setMarkPositions)和设置刻度线+刻度值(setBelowTicks)是两个相互独立的,且互不干扰,若是同时使用,也会同时绘画各自的线; - 另外两个的先后顺序也并没有关系. + \details For example: The dslider of the sound volume requires a scale in the place of value = 100 without displaying other scale values (and the actual volume value can exceed 100) + Other: Set the specified value line (SetmarkPositions) and setting scale line+scale value (Setbelowticks) are two independent and do not interfere with each other. If they are used at the same time, they will also draw their own lines at the same time; + The other two sequential order does not matter. - \a list 双边刻度线的值. - + \param[in] list The value of the bilateral scale line. \code 示例代码 DSlider* slider = new DSlider(Qt::Horizontal, wTemp); QStringList list1; @@ -519,11 +500,10 @@ } /*! - \brief 设置鼠标滚轮是否开启. - - 开启鼠标滚轮后,用户可以通过鼠标滚轮来控制滑块的滑动。 - - \a enabled 是否开启鼠标滚轮 + @~english + \brief Set whether the mouse roller is turned on. + \details After turning on the mouse wheel, the user can control the sliding slide through the mouse roller. + \param[in] enabled Whether to turn on the mouse wheel */ void DSlider::setMouseWheelEnabled(bool enabled) { @@ -570,9 +550,10 @@ } /*! - \brief 用于创建气泡,气泡将跟随滑块移动. - - \a value 非空开启气泡 \a value 空关闭气泡(销毁) + @~english + \brief For the creation of bubbles, the bubbles will follow the slider. + \param[in] value Non-empty: open bubble + \param[in] value empty: Turn off bubbles (destroyed) */ void DSlider::setTipValue(const QString &value) { @@ -602,11 +583,10 @@ } /*! - \brief 返回滑块的记号位置. - - 获取滑块刻度当前朝向。 - - \return 滑块刻度的朝向 + @~english + \brief the slider's mark position. + \details Get the slider extension currently facing. + \return The orientation of the slider \sa QSlider::TickPosition */ QSlider::TickPosition DSlider::tickPosition() const @@ -629,11 +609,12 @@ } /*! - \brief 滑动条的大小策略 + @~english + \brief The size strategy of sliding bars - 这个函数会返回该滑动条推荐的大小,如果 - 滑动条没有布局,这个大小将会是一个无效值,如果 - 存在布局,将返回该布局下的推荐大小。 + \details This function will return the recommended size recommended by the sliding bar, if + There is no layout of sliding bars, this size will be an invalid value, if + There is a layout that will return to the recommendation size under the layout. \sa QSlider::sizeHint */ @@ -647,10 +628,10 @@ } /*! - \brief 设置滑块是否显示. - - \a b 为 true 时滑块显示,否则滑块隐藏。 - 默认地,滑块为显示状态。 + @~english + \brief Set the slider whether to display it. + \param[in] b Show the slider for True, otherwise the slider will be hidden. + By default, the slider is the display state. */ void DSlider::setHandleVisible(bool b) { @@ -664,9 +645,9 @@ } /*! - \brief 获取滑块是否显示的状态. - - \return 返回滑块是否显示的状态 + @~english + \brief Get the state of whether the slider is displayed. + \return Whether the back slider is displayed */ bool DSlider::handleVisible() const { @@ -675,11 +656,11 @@ } /*! - \brief 该函数用于设置滑槽是否禁用活动色填充已经滑过的滑槽. - - 默认普通 DSlider 滑过的滑槽是活动色填充, 调用过 setXXXTicks 的 DSlider 则默认禁用活动色填充 - \a enabled true 无活动色,可用于音量平衡等不需要显示滑过的,false 滑过的位置(如左侧)是高亮色显示,如调节亮度等(默认) - 默认地,改属性为 false 。 + @~english + \brief This function is used to set the sliding color that has been slid over. + \details The sliding skating of ordinary DSLider is filled with active color. DSLider that calls SetxXXTICKS defaults to active color filling by default + \param[in] enabled true Lustless,It can be used for the volume balance, etc. It does not need to be displayed, the position of FALSE slipping (such as the left) is a high -bright color display, such as adjusting brightness, etc. (default) + By default, the attribute is False. */ void DSlider::setEnabledAcrossStyle(bool enabled) { @@ -750,10 +731,10 @@ } /*! - \internal - \brief SliderStrip::setScaleInfo 设置显示刻度线和刻度值 - \a scaleInfo 显示的刻度值 - \a tickPosition 显示的方向枚举值 + @~english + \brief SliderStrip::setScaleInfo Set the display scales and scale values + \param[in] scaleInfo Display scale value + \param[in] tickPosition Display direction enumeration value */ void SliderStrip::setScaleInfo(QStringList scaleInfo, QSlider::TickPosition tickPosition) { @@ -762,10 +743,10 @@ } /*! - \internal - \brief SliderStrip::setMarkList 设置显示刻度线(不显示刻度值) - \a list 显示的刻度线的list - \a tickPosition 显示的方向枚举值 + @~english + \brief SliderStrip::setMarkList Set the display scales (no display scale value) + \param[in] list List of the displayed scale + \param[in] tickPosition Display direction enumeration value */ void SliderStrip::setMarkList(QList list, QSlider::TickPosition tickPosition) { @@ -774,9 +755,9 @@ } /*! - \internal - \brief SliderStrip::getList 返回刻度线的 list - \return 刻度线的 list + @~english + \brief SliderStrip::getList Return to List of the scale line + \return List of scale line */ QList SliderStrip::getList() { @@ -784,9 +765,9 @@ } /*! - \internal - \brief SliderStrip::getScaleInfo 返回刻度值的 list - \return 度值的 list + @~english + \brief SliderStrip::getScaleInfo Return to the List of Dialogue + \return List */ QStringList SliderStrip::getScaleInfo() { @@ -794,7 +775,7 @@ } /*! - \internal + @~english \brief SliderStrip::paintEvent \sa QWidget::paintEvent() */ @@ -919,7 +900,7 @@ } /*! - \internal + @~english \brief SliderStrip::event \sa QWidget::event() */ diff -Nru dtkwidget-5.5.48/src/widgets/dslider.h dtkwidget-5.6.12/src/widgets/dslider.h --- dtkwidget-5.5.48/src/widgets/dslider.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dslider.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: wp - * - * Maintainer: wp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DSLIDER_H -#define DSLIDER_H - -#include -#include -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DSliderPrivate; -class LIBDTKWIDGETSHARED_EXPORT DSlider : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_DISABLE_COPY(DSlider) - D_DECLARE_PRIVATE(DSlider) -public: - enum SliderIcons { - LeftIcon, - RightIcon - }; - DSlider(Qt::Orientation orientation = Qt::Horizontal, QWidget *parent = nullptr); - - Qt::Orientation orientation() const; - - QSlider *slider(); - - void setLeftIcon(const QIcon &left); - void setRightIcon(const QIcon &right); - - void setIconSize(const QSize &size); - - void setMinimum(int min); - int minimum() const; - - void setValue(int value); - int value() const; - - void setPageStep(int pageStep); - int pageStep() const; - - void setMaximum(int max); - int maximum() const; - - void setLeftTicks(const QStringList &info); - void setRightTicks(const QStringList &info); - - void setAboveTicks(const QStringList &info); - void setBelowTicks(const QStringList &info); - - void setMarkPositions(QList list); - - void setMouseWheelEnabled(bool enabled); - - void setTipValue(const QString &value); - - QSlider::TickPosition tickPosition() const; - QSize sizeHint() const override; - - void setHandleVisible(bool b); - bool handleVisible() const; - - void setEnabledAcrossStyle(bool enabled); - -Q_SIGNALS: - void valueChanged(int value); - - void sliderPressed(); - void sliderMoved(int position); - void sliderReleased(); - - void rangeChanged(int min, int max); - - void actionTriggered(int action); - void iconClicked(SliderIcons icon, bool checked); - -protected: - DSlider(DSliderPrivate &q, QWidget *parent); - - bool event(QEvent *event) override; - bool eventFilter(QObject *watched, QEvent *event) override; -}; - -class SpecialSlider : public QSlider { -public: - SpecialSlider(Qt::Orientation orientation, QWidget *parent = nullptr) : QSlider(orientation, parent) { - } - - void paintEvent(QPaintEvent *ev) { - Q_UNUSED(ev) - QPainter p(this); - QStyleOptionSlider opt; - initStyleOption(&opt); - - DSlider* dSlider = qobject_cast(this->parent()); - - if (!dSlider) - return; - - if (dSlider->handleVisible()) - opt.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderHandle; - else - opt.subControls = QStyle::SC_SliderGroove; - - style()->drawComplexControl(QStyle::CC_Slider, &opt, &p, parentWidget()); - } -}; - -DWIDGET_END_NAMESPACE - -#endif // DSLIDER_H diff -Nru dtkwidget-5.5.48/src/widgets/DSpinBox dtkwidget-5.6.12/src/widgets/DSpinBox --- dtkwidget-5.5.48/src/widgets/DSpinBox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSpinBox 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dspinbox.h" diff -Nru dtkwidget-5.5.48/src/widgets/dspinbox.cpp dtkwidget-5.6.12/src/widgets/dspinbox.cpp --- dtkwidget-5.5.48/src/widgets/dspinbox.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dspinbox.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/src/widgets/dspinbox.h dtkwidget-5.6.12/src/widgets/dspinbox.h --- dtkwidget-5.5.48/src/widgets/dspinbox.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dspinbox.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DSPINBOX_H -#define DSPINBOX_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DSpinBoxPrivate; -class LIBDTKWIDGETSHARED_EXPORT DSpinBox : public QSpinBox, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(bool alert READ isAlert WRITE setAlert NOTIFY alertChanged) - Q_PROPERTY(int defaultValue READ defaultValue WRITE setDefaultValue NOTIFY defaultValueChanged) - -public: - explicit DSpinBox(QWidget *parent = nullptr); - - QLineEdit *lineEdit() const; - - bool isAlert() const; - void showAlertMessage(const QString &text, int duration = 3000); - void showAlertMessage(const QString &text, QWidget *follower, int duration = 3000); - D_DECL_DEPRECATED int defaultValue() const; - - void setEnabledEmbedStyle(bool enabled); - -public Q_SLOTS: - void setAlert(bool alert); - D_DECL_DEPRECATED void setDefaultValue(int defaultValue); - -Q_SIGNALS: - void alertChanged(bool alert); - D_DECL_DEPRECATED void defaultValueChanged(int defaultValue); - -private: - D_DECLARE_PRIVATE(DSpinBox) -}; - -class DDoubleSpinBoxPrivate; -class LIBDTKWIDGETSHARED_EXPORT DDoubleSpinBox : public QDoubleSpinBox, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(bool alert READ isAlert WRITE setAlert NOTIFY alertChanged) - Q_PROPERTY(double defaultValue READ defaultValue WRITE setDefaultValue NOTIFY defaultValueChanged) - -public: - explicit DDoubleSpinBox(QWidget *parent = nullptr); - - bool isAlert() const; - void showAlertMessage(const QString &text, int duration = 3000); - void showAlertMessage(const QString &text, QWidget *follower, int duration = 3000); - D_DECL_DEPRECATED double defaultValue() const; - - QLineEdit *lineEdit() const; - void setEnabledEmbedStyle(bool enabled); - -public Q_SLOTS: - void setAlert(bool alert); - D_DECL_DEPRECATED void setDefaultValue(double defaultValue); - -Q_SIGNALS: - void alertChanged(bool alert); - D_DECL_DEPRECATED void defaultValueChanged(double defaultValue); - -private: - D_DECLARE_PRIVATE(DDoubleSpinBox) -}; - -DWIDGET_END_NAMESPACE - -#endif // DSPINBOX_H diff -Nru dtkwidget-5.5.48/src/widgets/DSpinner dtkwidget-5.6.12/src/widgets/DSpinner --- dtkwidget-5.5.48/src/widgets/DSpinner 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSpinner 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dspinner.h" diff -Nru dtkwidget-5.5.48/src/widgets/dspinner.cpp dtkwidget-5.6.12/src/widgets/dspinner.cpp --- dtkwidget-5.5.48/src/widgets/dspinner.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dspinner.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dspinner.h" #include @@ -35,12 +39,10 @@ } /*! +@~english \class Dtk::Widget::DSpinner \inmodule dtkwidget - \brief 可以使用 DSpinner 类快速创建用于指示加载中状态的旋转等待图标动画控件. - - DSpinner 提供了一个用于指示加载中状态的旋转等待图标动画控件。在创建图标后,使用 start() 即可开始图标旋转的动画。 \brief Use DSpinner to create a widget with spinning animation for display a waiting state. DSpinner provide a spinning animation widget to indicate a waiting state. Call start() to start the spinning animation. @@ -49,11 +51,10 @@ */ /*! +@~english \brief Create a DSpinner widget - \brief 创建一个 DSpinner 控件 \a parent Parent widget. - \a parent 父控件 */ DSpinner::DSpinner(QWidget *parent) : QWidget(parent), DObject(*new DSpinnerPrivate(this)) @@ -76,10 +77,10 @@ } /*! +@~english \brief Is the DSpinner spinning or not. - \brief DSpinner 是否正在播放旋转动画. - \return 正在播放返回 true,否则返回 false. + \return DSpinner is spinning and returns true, otherwise returns false */ bool DSpinner::isPlaying() const { @@ -88,8 +89,8 @@ } /*! +@~english \brief Start spinning - \brief 开始旋转动画 */ void DSpinner::start() { @@ -98,8 +99,8 @@ } /*! +@~english \brief Stop spinning - \brief 停止旋转动画 */ void DSpinner::stop() { @@ -108,8 +109,8 @@ } /*! - \brief Set background \a color - \brief 设置背景颜色 +@~english + \brief Set background \a color Color to be set */ void DSpinner::setBackgroundColor(QColor color) { diff -Nru dtkwidget-5.5.48/src/widgets/dspinner.h dtkwidget-5.6.12/src/widgets/dspinner.h --- dtkwidget-5.5.48/src/widgets/dspinner.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dspinner.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -#ifndef DSPINNER_H -#define DSPINNER_H - -#include -#include - -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DSpinnerPrivate; -class LIBDTKWIDGETSHARED_EXPORT DSpinner : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT -public: - explicit DSpinner(QWidget *parent = 0); - ~DSpinner(); - - bool isPlaying() const; - -public Q_SLOTS: - void start(); - void stop(); - void setBackgroundColor(QColor color); - -protected: - void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; - void changeEvent(QEvent *e) override; - -private: - D_DECLARE_PRIVATE(DSpinner) -}; - -DWIDGET_END_NAMESPACE - -#endif diff -Nru dtkwidget-5.5.48/src/widgets/DSplitter dtkwidget-5.6.12/src/widgets/DSplitter --- dtkwidget-5.5.48/src/widgets/DSplitter 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSplitter 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DStackedWidget dtkwidget-5.6.12/src/widgets/DStackedWidget --- dtkwidget-5.5.48/src/widgets/DStackedWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStackedWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/dstackwidget.cpp dtkwidget-5.6.12/src/widgets/dstackwidget.cpp --- dtkwidget-5.5.48/src/widgets/dstackwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dstackwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/src/widgets/dstackwidget.h dtkwidget-5.6.12/src/widgets/dstackwidget.h --- dtkwidget-5.5.48/src/widgets/dstackwidget.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dstackwidget.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DSTACKWIDGET_H -#define DSTACKWIDGET_H - -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DStackWidget; -class DAbstractStackWidgetTransitionPrivate; -class DAbstractStackWidgetTransition : public QObject, public DTK_CORE_NAMESPACE::DObject -{ -public: - enum TransitionType{ - Push, - Pop - }; - - struct TransitionInfo{ - TransitionType type; - DStackWidget *stackWidget = nullptr; - QWidget *oldWidget = nullptr; - QWidget *newWidget = nullptr; - }; - - explicit DAbstractStackWidgetTransition(QObject *parent = 0); - - virtual void beginTransition(const TransitionInfo &info); - virtual QVariantAnimation *animation() const; - -protected: - virtual void updateVariant(const QVariant& variant) = 0; - -protected: - explicit DAbstractStackWidgetTransition(DAbstractStackWidgetTransitionPrivate &dd, - QObject *parent = 0); - - const TransitionInfo &info() const; - -private: - D_DECLARE_PRIVATE(DAbstractStackWidgetTransition) -}; - -class DSlideStackWidgetTransition : public DAbstractStackWidgetTransition -{ - Q_OBJECT - -public: - explicit DSlideStackWidgetTransition(QObject *parent = 0); - - void beginTransition(const TransitionInfo &info) Q_DECL_OVERRIDE; - -private Q_SLOTS: - void updateVariant(const QVariant &variant) Q_DECL_OVERRIDE; -}; - -class DStackWidgetPrivate; -class DStackWidget : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - ///busy is true if a transition is running, and false otherwise. - Q_PROPERTY(bool busy READ busy NOTIFY busyChanged FINAL) - ///The number of widgets currently pushed onto the stack. - Q_PROPERTY(int depth READ depth NOTIFY depthChanged FINAL) - Q_PROPERTY(int currentIndex READ currentIndex NOTIFY currentIndexChanged) - Q_PROPERTY(QWidget* currentWidget READ currentWidget NOTIFY currentWidgetChanged) - Q_PROPERTY(DAbstractStackWidgetTransition* transition READ transition WRITE setTransition) - Q_PROPERTY(int animationDuration READ animationDuration WRITE setAnimationDuration) - Q_PROPERTY(QEasingCurve::Type animationType READ animationType WRITE setAnimationType) - -public: - explicit DStackWidget(QWidget *parent = 0); - - bool busy() const; - int depth() const; - - int currentIndex() const; - QWidget* currentWidget() const; - - DAbstractStackWidgetTransition* transition() const; - int animationDuration() const; - QEasingCurve::Type animationType() const; - -public Q_SLOTS: - int pushWidget(QWidget *widget, bool enableTransition = true); - void insertWidget(int index, QWidget *widget, bool enableTransition = true); - - /// If widget is nullptr, all widgets up to the currentIndex+count widgets will be popped. - /// If not specified, all widgets up to the depthOf(widget)+count widgets will be popped. - void popWidget(QWidget *widget = nullptr, bool isDelete = true, - int count = 1, bool enableTransition = true); - void clear(); - - int indexOf(QWidget *widget) const; - QWidget* getWidgetByIndex(int index) const; - - void setTransition(DAbstractStackWidgetTransition* transition); - void setAnimationDuration(int animationDuration); - void setAnimationType(QEasingCurve::Type animationType); - -Q_SIGNALS: - void busyChanged(bool busy); - void depthChanged(int depth); - - void currentIndexChanged(int currentIndex); - void currentWidgetChanged(QWidget* currentWidget); - - void widgetDepthChanged(QWidget *widget, int depth); - - void switchWidgetFinished(); - -protected: - explicit DStackWidget(DStackWidgetPrivate &dd, QWidget *parent = 0); - - void setCurrentIndex(int currentIndex, - DAbstractStackWidgetTransition::TransitionType type = DAbstractStackWidgetTransition::Push, - bool enableTransition = true); - void setCurrentWidget(QWidget* currentWidget, - DAbstractStackWidgetTransition::TransitionType type = DAbstractStackWidgetTransition::Push, - bool enableTransition = true); - -private: - Q_DISABLE_COPY(DStackWidget) - D_DECLARE_PRIVATE(DStackWidget) -}; - -DWIDGET_END_NAMESPACE - -#endif // DSTACKWIDGET_H diff -Nru dtkwidget-5.5.48/src/widgets/DStandardItem dtkwidget-5.6.12/src/widgets/DStandardItem --- dtkwidget-5.5.48/src/widgets/DStandardItem 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStandardItem 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyleditemdelegate.h" diff -Nru dtkwidget-5.5.48/src/widgets/DStatusBar dtkwidget-5.6.12/src/widgets/DStatusBar --- dtkwidget-5.5.48/src/widgets/DStatusBar 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStatusBar 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DStyle dtkwidget-5.6.12/src/widgets/DStyle --- dtkwidget-5.5.48/src/widgets/DStyle 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStyle 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyle.h" diff -Nru dtkwidget-5.5.48/src/widgets/dstyle.cpp dtkwidget-5.6.12/src/widgets/dstyle.cpp --- dtkwidget-5.5.48/src/widgets/dstyle.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dstyle.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,25 +1,14 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dstyle.h" +#include "ddciicon.h" +#include "ddciiconpalette.h" +#include "dguiapplicationhelper.h" #include "dstyleoption.h" +#include "dtooltip.h" +#include "dsizemode.h" #include @@ -46,7 +35,6 @@ DGUI_USE_NAMESPACE DWIDGET_BEGIN_NAMESPACE -static Qt::TextFormat textFormat = Qt::TextFormat::AutoText; /*! \brief 该函数用于调整给定颜色. @@ -104,6 +92,33 @@ return qMakePair(mode, state); } +DDciIcon::Mode DStyle::toDciIconMode(const QStyleOption *option) +{ + DDciIcon::Mode mode = DDciIcon::Normal; + + if (option->state & QStyle::State_Enabled) { + if (option->state & (State_Sunken | State_Selected)) { + mode = DDciIcon::Pressed; + } else if (option->state & State_MouseOver) { + mode = DDciIcon::Hover; + } + } else { + mode = DDciIcon::Disabled; + } + + return mode; +} + +static DDciIconPalette makeIconPalette(const QPalette &pal) +{ + DDciIconPalette iconPalette; + iconPalette.setForeground(pal.color(QPalette::WindowText)); + iconPalette.setBackground(pal.color(QPalette::Window)); + iconPalette.setHighlight(pal.color(QPalette::Highlight)); + iconPalette.setHighlightForeground(pal.color(QPalette::HighlightedText)); + return iconPalette; +} + /*! \brief 设置 tooltip 的文本格式. @@ -114,7 +129,7 @@ */ void DStyle::setTooltipTextFormat(Qt::TextFormat format) { - textFormat = format; + DToolTip::setToolTipTextFormat(format); } /*! \brief 获取 tooltip 文本格式. @@ -125,7 +140,7 @@ */ Qt::TextFormat DStyle::tooltipTextFormat() { - return textFormat; + return DToolTip::toolTipTextFormat(); } void DStyle::setFocusRectVisible(QWidget *widget, bool visible) @@ -143,6 +158,11 @@ widget->setProperty("_d_dtk_UncheckedItemIndicator", visible); } +void DStyle::setRedPointVisible(QObject *object, bool visible) +{ + object->setProperty("_d_menu_item_redpoint", visible); +} + namespace DDrawUtils { static QImage dropShadow(const QPixmap &px, qreal radius, const QColor &color) { @@ -152,6 +172,8 @@ QImage tmp(px.size() + QSize(radius * 2, radius * 2), QImage::Format_ARGB32_Premultiplied); tmp.fill(0); QPainter tmpPainter(&tmp); + tmpPainter.setOpacity(0.3); // design requirement + tmpPainter.setRenderHint(QPainter::Antialiasing); tmpPainter.setCompositionMode(QPainter::CompositionMode_Source); tmpPainter.drawPixmap(QPoint(radius, radius), px); tmpPainter.end(); @@ -250,6 +272,7 @@ pa.setBrush(sc); pa.setPen(Qt::NoPen); + pa.setRenderHint(QPainter::Antialiasing); pa.drawRoundedRect(shadow_base.rect(), xRadius, yRadius); pa.end(); @@ -285,6 +308,7 @@ shadow_base.setDevicePixelRatio(scale); QPainter paTmp(&shadow_base); + paTmp.setRenderHint(QPainter::Antialiasing, true); paTmp.setBrush(sc); paTmp.setPen(Qt::NoPen); paTmp.drawPath(path); @@ -622,12 +646,13 @@ content_rect.moveCenter(rect.center().toPoint()); pa->setPen(pen); - pa->setRenderHint(QPainter::Antialiasing, pa->device()->devicePixelRatioF() > 1.0); - pa->drawLine(content_rect.x(), content_rect.y(), content_rect.topRight().x() - 2, content_rect.topRight().y()); - pa->drawLine(content_rect.bottomLeft(), content_rect.bottomRight()); - - qreal y = content_rect.center().y(); - pa->drawLine(content_rect.x(), y, content_rect.topRight().x(), y); + const DDciIcon &icon = DDciIcon::fromTheme(QLatin1String("window_menu")); + auto devicePixelRatio = pa->device() ? pa->device()->devicePixelRatioF() + : qApp->devicePixelRatio(); + auto appTheme = DGuiApplicationHelper::toColorType(pa->pen().color()); + DDciIcon::Theme theme = appTheme == DGuiApplicationHelper::LightType ? DDciIcon::Light : DDciIcon::Dark; + DDciIconPalette palette(pa->pen().color()); + icon.paint(pa, rect.toRect(), devicePixelRatio, theme, DDciIcon::Normal, Qt::AlignCenter, palette); } void drawTitleBarMinButton(QPainter *pa, const QRectF &rect) @@ -1100,7 +1125,7 @@ DStyleHelper dstyle(style); if (btn->features & DStyleOptionButton::FloatingButton) { - int frame_margins = 3; + int frame_margins = dstyle.pixelMetric(DStyle::PM_FloatingButtonFrameMargin, opt, w); const QMargins margins(frame_margins, frame_margins, frame_margins, frame_margins); QRect shadow_rect = opt->rect + margins; const QRect content_rect = opt->rect - margins; @@ -1116,12 +1141,12 @@ shadow_rect.setHeight(qMin(shadow_rect.width(), shadow_rect.height())); shadow_rect.moveCenter(opt->rect.center() + QPoint(shadow_xoffset / 2.0, shadow_yoffset / 2.0)); + p->setRenderHint(QPainter::Antialiasing); DDrawUtils::drawShadow(p, shadow_rect, frame_radius, frame_radius, DStyle::adjustColor(color, 0, 0, +30), shadow_radius, QPoint(0, 0)); p->setPen(Qt::NoPen); p->setBrush(color); - p->setRenderHint(QPainter::Antialiasing); p->drawEllipse(content_rect); } else if (btn->features & DStyleOptionButton::CircleButton) { QRect content_rect = opt->rect; @@ -1140,11 +1165,24 @@ case PE_IconButtonIcon: { if (const DStyleOptionButton *btn = qstyleoption_cast(opt)) { DStyleHelper dstyle(style); - DStyleOptionIcon icon_option; + bool hasDciIcon = (btn->features & DStyleOptionButton::HasDciIcon); + DStyleOptionIconV2 icon_option; icon_option.QStyleOption::operator =(*opt); - icon_option.icon = btn->icon; + if (hasDciIcon) { + icon_option.dciIcon = btn->dciIcon; + icon_option.iconType = DStyleOptionIconV2::SI_DciIcon; + icon_option.dciMode = toDciIconMode(opt); + icon_option.dciTheme = (DGuiApplicationHelper::toColorType(btn->palette) + == DGuiApplicationHelper::LightType) ? DDciIcon::Light : DDciIcon::Dark; + } else { + icon_option.icon = btn->icon; + icon_option.iconType = DStyleOptionIconV2::SI_QIcon; + } + + icon_option.iconSize = btn->iconSize; icon_option.dpalette = btn->dpalette; + icon_option.iconAlignment = Qt::AlignCenter; QPalette pa = opt->palette; @@ -1185,20 +1223,40 @@ break; } case PE_Icon: { - if (const DStyleOptionIcon *icon_opt = qstyleoption_cast(opt)) { - if (icon_opt->icon.isNull()) { - return; + if (const DStyleOptionIconV2 *icon_opt = qstyleoption_cast(opt)) { + switch (icon_opt->iconType) { + case DStyleOptionIconV2::SI_QIcon: { + auto *data = const_cast(icon_opt)->icon.data_ptr(); + if (!data) + return; + + if (DStyledIconEngine *engine = dynamic_cast(data->engine)) { + engine->paint(p, opt->palette, opt->rect); + } else { + auto icon_mode_state = toIconModeState(opt); + p->setBrush(opt->palette.background()); + p->setPen(QPen(opt->palette.foreground(), 1)); + icon_opt->icon.paint(p, opt->rect, icon_opt->iconAlignment, icon_mode_state.first, icon_mode_state.second); + } } + break; - auto *data = const_cast(icon_opt)->icon.data_ptr(); + case DStyleOptionIconV2::SI_DciIcon: { + DDciIcon icon = icon_opt->dciIcon; + if (icon.isNull()) + break; - if (DStyledIconEngine *engine = dynamic_cast(data->engine)) { - engine->paint(p, opt->palette, opt->rect); - } else { - auto icon_mode_state = toIconModeState(opt); - p->setBrush(opt->palette.background()); - p->setPen(QPen(opt->palette.foreground(), 1)); - icon_opt->icon.paint(p, opt->rect, Qt::AlignCenter, icon_mode_state.first, icon_mode_state.second); + p->save(); + p->setBrush(Qt::NoBrush); + const DDciIconPalette &iconPalette = makeIconPalette(opt->palette); + int iconSizeForRect = qMax(icon_opt->iconSize.width(), icon_opt->iconSize.height()); + const QRect iconRect{icon_opt->rect.topLeft(), QSize(iconSizeForRect, iconSizeForRect)}; + icon_opt->dciIcon.paint(p, iconRect, p->device() ? p->device()->devicePixelRatioF() + : qApp->devicePixelRatio(), icon_opt->dciTheme, + icon_opt->dciMode, icon_opt->iconAlignment, iconPalette); + p->restore(); + } + break; } } break; @@ -1295,7 +1353,7 @@ } // 有新信息时添加小红点 - if (w && w->property("_d_dtk_newNotification").toBool()){ + if (w && w->property("_d_menu_item_redpoint").toBool()){ DPalette pa = DGuiApplicationHelper::instance()->standardPalette(DGuiApplicationHelper::LightType); // 按图标大小50x50时,小红点大小6x6,距离右边和上面8个像素的比例绘制 const int redPointRadius = 3; @@ -1398,6 +1456,8 @@ DStyleHelper dstyle(style); dstyle.drawControl(CE_ButtonBoxButtonBevel, btn, p, w); DStyleOptionButton subopt = *btn; + if (btn->features & DStyleOptionButton::HasDciIcon) + subopt.dciIcon = btn->dciIcon; subopt.rect = dstyle.subElementRect(SE_ButtonBoxButtonContents, btn, w); dstyle.drawControl(CE_ButtonBoxButtonLabel, &subopt, p, w); if ((btn->state & State_HasFocus)) { @@ -1526,7 +1586,7 @@ return radius; } } - return 8; + return DSizeModeHelper::element(6, 8); case PM_TopLevelWindowRadius: return 18; case PM_ShadowRadius: @@ -1552,9 +1612,9 @@ return 12; } case PM_SwitchButtonHandleWidth: - return 30; + return DSizeModeHelper::element(24, 30); case PM_SwithcButtonHandleHeight: - return 24; + return DSizeModeHelper::element(20, 24); case PM_FloatingWidgetRadius: { if (const DStyleOptionFloatingWidget *wid = qstyleoption_cast(opt)) { if (wid->frameRadius != -1) @@ -1563,11 +1623,11 @@ return dstyle.pixelMetric(PM_TopLevelWindowRadius, opt, widget); } case PM_FloatingWidgetShadowRadius: - return 8; + return DSizeModeHelper::element(4, 8); case PM_FloatingWidgetShadowHOffset: return 0; case PM_FloatingWidgetShadowVOffset: - return 4; + return DSizeModeHelper::element(2, 4); case PM_FloatingWidgetShadowMargins: { int shadow_radius = dstyle.pixelMetric(PM_FloatingWidgetShadowRadius, opt, widget); int shadow_hoffset = dstyle.pixelMetric(PM_FloatingWidgetShadowHOffset, opt, widget); @@ -1579,7 +1639,9 @@ case PM_ContentsSpacing: return 10; case PM_ButtonMinimizedSize: - return 36; + return DSizeModeHelper::element(24, 36); + case PM_ToolTipLabelWidth: + return 300; default: break; } @@ -1621,9 +1683,8 @@ } case SE_SwitchButtonHandle: { if (const DStyleOptionButton *btn = qstyleoption_cast(opt)) { - DStyleHelper dstyle(style); - int handleWidth = dstyle.pixelMetric(PM_SwitchButtonHandleWidth, opt, widget); - int handleHeight = dstyle.pixelMetric(PM_SwithcButtonHandleHeight, opt, widget); + int handleWidth = btn->rect.width() / 2.0; + int handleHeight = btn->rect.height(); //这里的borderWidth为2,间隙宽度为2, 所以为4 QRect rectHandle(4, 4, handleWidth, handleHeight); @@ -1676,7 +1737,10 @@ case CT_IconButton: if (const DStyleOptionButton *btn = qstyleoption_cast(opt)) { if (btn->features & DStyleOptionButton::FloatingButton) { - return btn->iconSize * 2.5; + DStyleHelper dstyle(style); + int frame_margin = dstyle.pixelMetric(DStyle::PM_FloatingButtonFrameMargin, opt, widget); + QSize marginSize(2 * frame_margin, 2 * frame_margin); + return DSizeModeHelper::element(QSize(36, 36) + marginSize, QSize(48, 48) + marginSize); } if (btn->features & DStyleOptionButton::Flat) { @@ -2080,12 +2144,13 @@ case PM_MenuDesktopFrameWidth: return 0; case PM_ButtonMargin: + return 8; case PM_DefaultChildMargin: - return pixelMetric(PM_FrameRadius, opt, widget); + return DSizeModeHelper::element(pixelMetric(PM_FrameRadius, opt, widget), pixelMetric(PM_FrameRadius, opt, widget)); case PM_DefaultFrameWidth: return 1; case PM_DefaultLayoutSpacing: - return 5; + return DSizeModeHelper::element(2, 5); case PM_DefaultTopLevelMargin: return pixelMetric(PM_TopLevelWindowRadius, opt, widget) / 2; case PM_MenuBarItemSpacing: @@ -2100,9 +2165,9 @@ return 36; case PM_SliderLength: case PM_ScrollBarExtent: - return 20; + return DSizeModeHelper::element(16, 20); case PM_SliderControlThickness: - return 24; + return DSizeModeHelper::element(20, 24); case PM_MenuBarHMargin: return 10; case PM_MenuBarVMargin: @@ -2124,6 +2189,12 @@ return 32; case PM_ScrollView_ScrollBarOverlap: return true; + case PM_ToolBarIconSize: + return 16; + case PM_MenuButtonIndicator: + return DSizeModeHelper::element(8, QCommonStyle::pixelMetric(m, opt, widget)); + case PM_FloatingButtonFrameMargin: + return 3; default: break; } @@ -2135,7 +2206,7 @@ #endif if (Q_UNLIKELY(LineEditIconSize == m)) { - return widget ? (widget->height() < 34 ? 16 : 32) : 24; + return DSizeModeHelper::element(20, 20); } if (Q_UNLIKELY(m < QStyle::PM_CustomBase)) { @@ -2186,6 +2257,9 @@ CASE_ICON(TitleQuitFullButton) case SP_LineEditClearButton: return QIcon::fromTheme("button_edit-clear"); + case SP_CommandLink: + return QIcon::fromTheme(QLatin1String("go-next"), + QIcon::fromTheme(QLatin1String("forward"))); default: break; } @@ -2746,6 +2820,8 @@ QRect DStyle::viewItemDrawText(const QStyle *style, QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) { Q_UNUSED(style) + QModelIndex index = option->index; + const QWidget *view = option->widget; QRect textRect = rect; const bool wrapText = option->features & QStyleOptionViewItem::WrapText; QTextOption textOption; @@ -2808,6 +2884,36 @@ line.draw(p, position); } + // Update ToolTip + const DToolTip::ToolTipShowMode &showMode = DToolTip::toolTipShowMode(view); + if (showMode != DToolTip::Default) { + const bool showToolTip = (showMode == DToolTip::AlwaysShow) || + ((showMode == DToolTip::ShowWhenElided) && (elidedIndex != -1)); + QVariant vShowToolTip = index.data(ItemDataRole::ViewItemShowToolTipRole); + bool needUpdate = false; + if (vShowToolTip.isValid()) { + bool oldShowStatus = vShowToolTip.toBool(); + if (showToolTip != oldShowStatus) { + needUpdate = true; + } + } else { + needUpdate = true; + } + if (needUpdate) { + QString toolTipString = index.data(Qt::DisplayRole).toString(); + QString toolTip; + if (showToolTip) { + QTextOption toolTipOption; + toolTipOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); + toolTipOption.setTextDirection(option->direction); + toolTipOption.setAlignment(QStyle::visualAlignment(option->direction, option->displayAlignment)); + toolTip = DToolTip::wrapToolTipText(toolTipString, toolTipOption); + } + QAbstractItemModel *model = const_cast(index.model()); + model->setData(index, toolTip, Qt::ToolTipRole); + model->setData(index, showToolTip, ItemDataRole::ViewItemShowToolTipRole); + } + } return layoutRect; } diff -Nru dtkwidget-5.5.48/src/widgets/DStyledIconEngine dtkwidget-5.6.12/src/widgets/DStyledIconEngine --- dtkwidget-5.5.48/src/widgets/DStyledIconEngine 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStyledIconEngine 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyle.h" diff -Nru dtkwidget-5.5.48/src/widgets/DStyledItemDelegate dtkwidget-5.6.12/src/widgets/DStyledItemDelegate --- dtkwidget-5.5.48/src/widgets/DStyledItemDelegate 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStyledItemDelegate 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyleditemdelegate.h" diff -Nru dtkwidget-5.5.48/src/widgets/dstyleditemdelegate.cpp dtkwidget-5.6.12/src/widgets/dstyleditemdelegate.cpp --- dtkwidget-5.5.48/src/widgets/dstyleditemdelegate.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dstyleditemdelegate.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,28 +1,13 @@ -/* - * Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dstyleditemdelegate.h" #include "dobject_p.h" #include "dstyleoption.h" #include "dpalettehelper.h" #include "dstyle.h" +#include "dsizemode.h" #include "dlistview.h" @@ -35,12 +20,105 @@ #include #include #include +#include #include +#include +#include Q_DECLARE_METATYPE(QMargins) DWIDGET_BEGIN_NAMESPACE +struct ActionListData : public QSharedData { + explicit ActionListData() { } + explicit ActionListData(const DViewItemActionList& v) + : list(v) + { + } + ~ActionListData () + { + qDeleteAll(list); + } + DViewItemActionList list; +}; + +class ActionList +{ +public: + explicit ActionList() { } + explicit ActionList(ActionListData *data) + : m_data(data) + { + } + inline bool isValid() const + { + return m_data; + } + inline const ActionListData* constData() const + { + return m_data.constData(); + } +private: + friend QDataStream &operator<<(QDataStream &s, const ActionList &v); + friend QDataStream &operator>>(QDataStream &s, ActionList &v); + QSharedDataPointer m_data; +}; + +QDataStream &operator<<(QDataStream &ds, const ActionList &v) +{ + quintptr data = reinterpret_cast(v.m_data.data()); + ds << data; + return ds; +} + +QDataStream &operator>>(QDataStream &ds, ActionList &v) +{ + quintptr data; + ds >> data; + v.m_data = reinterpret_cast(data); + return ds; +} +DWIDGET_END_NAMESPACE + +Q_DECLARE_METATYPE(DTK_WIDGET_NAMESPACE::ActionList) + +DWIDGET_BEGIN_NAMESPACE +static void saveDViewItemActionList(QDataStream &s, const void *d) +{ + const ActionList &data = *static_cast(d); + s << data; +} + +static void loadDViewItemActionList(QDataStream &s, void *d) +{ + ActionList &data = *static_cast(d); + s >> data; +} + +__attribute__((constructor)) +static void registerMetaType () +{ + // register DViewItemActionList's stream operator to support that QMetaType can using save and load function. + QMetaType::registerStreamOperators(QMetaTypeId::qt_metatype_id(), + saveDViewItemActionList, + loadDViewItemActionList); +} + +static DViewItemActionList qvariantToActionList(const QVariant &v) +{ + const ActionList &wrapper = v.value(); + if (wrapper.isValid()) + return wrapper.constData()->list; + + return DViewItemActionList(); +} + +static QVariant actionListToQVariant(const DViewItemActionList &v) +{ + ActionList wrapper(new ActionListData(v)); + return QVariant::fromValue(wrapper); +} + class DViewItemActionPrivate : public DCORE_NAMESPACE::DObjectPrivate { public: @@ -55,7 +133,8 @@ QSize maxSize; QMargins clickMargins; bool clickable = false; - QWidget *widget = nullptr; + DDciIcon dciIcon; + QPointer widget = nullptr; qint8 colorType = -1; qint8 colorRole = -1; @@ -116,7 +195,26 @@ return DStyle::viewItemSize(style, &item, Qt::DisplayRole); } - static QList doActionsLayout(QRect base, const QList &list, Qt::Orientation orientation, + // get rect in AlignVCenter layout for text. + static QRect textAndTextActionsLayout(const QRect &textRect, const QStyle *style, const QStyleOptionViewItem &option, const QModelIndex &index) + { + QStyleOptionViewItem opt = option; + opt.displayAlignment |= Qt::AlignVCenter; + QSize size; + + if (!opt.text.isEmpty()) + size = DStyle::viewItemSize(style, &opt, Qt::DisplayRole); + + for (const DViewItemAction *action : qvariantToActionList(index.data(Dtk::TextActionListRole))) { + const QSize &action_size = displayActionSize(action, style, opt); + size.setWidth(qMax(size.width(), action_size.width())); + size.setHeight(size.height() + action_size.height()); + } + + return QStyle::alignedRect(opt.direction , opt.displayAlignment, size, textRect); + } + + static QList doActionsLayout(QRect base, const DViewItemActionList &list, Qt::Orientation orientation, Qt::LayoutDirection direction, const QSize &fallbackIconSize, QSize *bounding) { if (list.isEmpty()) { @@ -272,14 +370,27 @@ // draw icon if (icon_size.isValid()) { - const QIcon &icon = action->icon(); QRect icon_rect(QPoint(0, 0), icon_size); icon_rect.moveCenter(rect.center()); icon_rect.moveLeft(rect.left()); - auto modeStatePair = DStyle::toIconModeState(&option); - icon.paint(pa, icon_rect, Qt::AlignCenter, modeStatePair.first, modeStatePair.second); + if (action->dciIcon().isNull()) { + const QIcon &icon = action->icon(); + auto modeStatePair = DStyle::toIconModeState(&option); + icon.paint(pa, icon_rect, Qt::AlignCenter, modeStatePair.first, modeStatePair.second); + } else { + DDciIcon dciicon = action->dciIcon(); + DDciIcon::Mode mode = DStyle::toDciIconMode(&option); + auto appTheme = DGuiApplicationHelper::toColorType(option.palette); + DDciIcon::Theme theme = appTheme == DGuiApplicationHelper::LightType ? DDciIcon::Light : DDciIcon::Dark; + DDciIconPalette palette{option.palette.color(cg, QPalette::WindowText), option.palette.color(cg, QPalette::Window), + option.palette.color(cg, QPalette::Highlight), option.palette.color(cg, QPalette::HighlightedText)}; + if (option.state & QStyle::State_Selected) + palette.setForeground(option.palette.color(cg, QPalette::HighlightedText)); + dciicon.paint(pa, icon_rect, pa->device() ? pa->device()->devicePixelRatio() + : qApp->devicePixelRatio(), theme, mode, Qt::AlignCenter, palette); + } } // draw text @@ -298,7 +409,7 @@ static QSize drawActions(QPainter *pa, const QStyleOptionViewItem &option, const QVariant &value, Qt::Edge edge, QList> *clickableActionRect) { - const DViewItemActionList &actionList = qvariant_cast(value); + const DViewItemActionList &actionList = qvariantToActionList(value); DViewItemActionList visiable_actionList; for (auto action : actionList) { if (action->isVisible()) @@ -341,12 +452,78 @@ return bounding; } + static DViewItemActionList allActions(const QModelIndex &index) + { + static const QVector rules { + LeftActionListRole, + TopActionListRole, + RightActionListRole, + BottomActionListRole, + TextActionListRole + }; + DViewItemActionList results; + for (const auto role: rules) { + const auto &list = qvariantToActionList(index.data(role)); + if (list.isEmpty()) + continue; + results << list; + } + return results; + } + + bool readyRecordVisibleWidgetOfCurrentFrame() + { + // multi QEvent maybe be merged to one using postEvent + // so we can clear cache avoid to recording multi ItemWidget. + if (Q_UNLIKELY(hasStartRecord)) { + currentWidgets.clear(); + return false; + } + hasStartRecord = true; + return true; + } + + void updateWidgetVisibleInUnvisualArea() + { + hasStartRecord = false; + if (lastWidgets.isEmpty() && currentWidgets.isEmpty()) + return; + + for (const auto &widget : qAsConst(lastWidgets)) { + if (currentWidgets.contains(widget)) + continue; + if (widget && widget->isVisible()) + widget->setVisible(false); + } + + lastWidgets.swap(currentWidgets); + currentWidgets.clear(); + } + + void recordVisibleWidgetOfCurrentFrame(const QModelIndex &index) + { + // only record virsual widget when starting record. + if (Q_UNLIKELY(!hasStartRecord)) + return; + + for (auto action : allActions(index)) { + if (!action->isVisible()) + continue; + + if (auto widget = action->widget()) + currentWidgets.append(QPointer(widget)); + } + } + DStyledItemDelegate::BackgroundType backgroundType = DStyledItemDelegate::NoBackground; QMargins margins; QSize itemSize; int itemSpacing = 0; QMap>> clickableActionMap; QAction *pressedAction = nullptr; + QList> lastWidgets; + QList> currentWidgets; + bool hasStartRecord = false; }; /*! @@ -641,7 +818,7 @@ { D_D(DViewItemAction); - d->widget = widget; + d->widget = QPointer(widget); d->widget->setVisible(false); } @@ -656,6 +833,20 @@ return d->widget; } +void DViewItemAction::setDciIcon(const DDciIcon &dciIcon) +{ + D_D(DViewItemAction); + + d->dciIcon = dciIcon; +} + +DDciIcon DViewItemAction::dciIcon() const +{ + D_DC(DViewItemAction); + + return d->dciIcon; +} + static QPalette::ColorRole getViewItemColorRole(const QModelIndex &index, int role) { const QVariant &value = index.data(role); @@ -776,7 +967,7 @@ const_cast(d)->clickableActionMap.remove(index); } - const DViewItemActionList &text_action_list = qvariant_cast(index.data(Dtk::TextActionListRole)); + const DViewItemActionList &text_action_list = qvariantToActionList(index.data(Dtk::TextActionListRole)); opt.rect = itemContentRect; QRect iconRect, textRect, checkRect; @@ -797,13 +988,31 @@ // draw icon if (opt.features & QStyleOptionViewItem::HasDecoration) { - QIcon::Mode mode = QIcon::Normal; - if (!(opt.state & QStyle::State_Enabled)) - mode = QIcon::Disabled; - else if (opt.state & QStyle::State_Selected) - mode = QIcon::Selected; - QIcon::State state = opt.state & QStyle::State_Open ? QIcon::On : QIcon::Off; - opt.icon.paint(painter, iconRect, opt.decorationAlignment, mode, state); + QVariant icon = index.data(Qt::DecorationRole); + DDciIcon dciIcon; + if (icon.canConvert()) + dciIcon = qvariant_cast(icon); + + if (dciIcon.isNull()) { + QIcon::Mode mode = QIcon::Normal; + if (!(opt.state & QStyle::State_Enabled)) + mode = QIcon::Disabled; + else if (opt.state & QStyle::State_Selected) + mode = QIcon::Selected; + QIcon::State state = opt.state & QStyle::State_Open ? QIcon::On : QIcon::Off; + opt.icon.paint(painter, iconRect, opt.decorationAlignment, mode, state); + } else { + DDciIcon::Mode mode = DStyle::toDciIconMode(&option); + auto appTheme = DGuiApplicationHelper::toColorType(option.palette); + DDciIcon::Theme theme = appTheme == DGuiApplicationHelper::LightType ? DDciIcon::Light : DDciIcon::Dark; + DDciIconPalette palette{option.palette.color(cg, QPalette::WindowText), option.palette.color(cg, QPalette::Window), + option.palette.color(cg, QPalette::Highlight), option.palette.color(cg, QPalette::HighlightedText)}; + if (option.state & QStyle::State_Selected) + palette.setForeground(opt.palette.color(cg, QPalette::HighlightedText)); + dciIcon.paint(painter, iconRect, painter->device() ? painter->device()->devicePixelRatioF() + : qApp->devicePixelRatio(), + theme, mode, Qt::AlignCenter, palette); + } } // draw the text @@ -825,7 +1034,12 @@ opt.displayAlignment &= ~Qt::AlignVCenter; opt.displayAlignment &= ~Qt::AlignBottom; - QRect bounding = DStyle::viewItemDrawText(style, painter, &opt, textRect); + QRect textRectbounding = d->textAndTextActionsLayout(textRect, style, opt, index); + + QRect bounding(textRectbounding.topLeft(), QSize()); + if (!opt.text.isEmpty()) { + bounding = DStyle::viewItemDrawText(style, painter, &opt, textRectbounding); + } // draw action text for (const DViewItemAction *action : text_action_list) { @@ -884,6 +1098,8 @@ ? QPalette::Highlight : QPalette::Window); style->drawPrimitive(QStyle::PE_FrameFocusRect, &o, painter, widget); } + + const_cast(d)->recordVisibleWidgetOfCurrentFrame(index); } QSize DStyledItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const @@ -906,7 +1122,7 @@ QRect pixmapRect, textRect, checkRect; DStyle::viewItemLayout(style, &opt, &pixmapRect, &textRect, &checkRect, true); - const DViewItemActionList &text_action_list = qvariant_cast(index.data(Dtk::TextActionListRole)); + const DViewItemActionList &text_action_list = qvariantToActionList(index.data(Dtk::TextActionListRole)); for (const DViewItemAction *action : text_action_list) { const QSize &action_size = d->displayActionSize(action, style, opt); @@ -916,10 +1132,10 @@ QSize size = (pixmapRect | textRect | checkRect).size(); - const DViewItemActionList &left_actions = qvariant_cast>(index.data(Dtk::LeftActionListRole)); - const DViewItemActionList &right_actions = qvariant_cast>(index.data(Dtk::RightActionListRole)); - const DViewItemActionList &top_actions = qvariant_cast>(index.data(Dtk::TopActionListRole)); - const DViewItemActionList &bottom_actions = qvariant_cast>(index.data(Dtk::BottomActionListRole)); + const DViewItemActionList &left_actions = qvariantToActionList(index.data(Dtk::LeftActionListRole)); + const DViewItemActionList &right_actions = qvariantToActionList(index.data(Dtk::RightActionListRole)); + const DViewItemActionList &top_actions = qvariantToActionList(index.data(Dtk::TopActionListRole)); + const DViewItemActionList &bottom_actions = qvariantToActionList(index.data(Dtk::BottomActionListRole)); QSize action_area_size; // 获取左边区域大小 @@ -1055,7 +1271,8 @@ } int frame_margin = style->pixelMetric(static_cast(DStyle::PM_FrameRadius)); - d->margins += frame_margin; + int left_right_margin = style->pixelMetric(static_cast(DStyle::PM_ContentsMargins)); + d->margins += QMargins(left_right_margin, frame_margin, left_right_margin, frame_margin); } } @@ -1084,6 +1301,25 @@ { QStyledItemDelegate::initStyleOption(option, index); + QVariant value = index.data(Qt::DecorationRole); + if (value.canConvert()) { + // The dciicon can not be set to opt.icon + auto dciIcon = qvariant_cast(value); + DDciIcon::Mode mode; + if (!(option->state & QStyle::State_Enabled)) + mode = DDciIcon::Disabled; + else if (option->state & QStyle::State_Selected) + mode = DDciIcon::Pressed; + else + mode = DDciIcon::Normal; + auto appTheme = DGuiApplicationHelper::toColorType(option->palette); + DDciIcon::Theme theme = appTheme == DGuiApplicationHelper::LightType ? DDciIcon::Light : DDciIcon::Dark; + int actualSize = dciIcon.actualSize(option->decorationSize.width(), theme, mode); + // For highdpi icons actualSize might be larger than decorationSize, which we don't want. Clamp it to decorationSize. + option->decorationSize = QSize(qMin(option->decorationSize.width(), actualSize), + qMin(option->decorationSize.height(), actualSize)); + } + if (option->viewItemPosition == QStyleOptionViewItem::ViewItemPosition::Invalid) { const int rowCount = index.model()->rowCount(); if (rowCount == 1) { @@ -1185,6 +1421,41 @@ default: break; } + const auto view = qobject_cast(parent()); + if (event->type() == QEvent::StyleChange && view) { + D_D(DStyledItemDelegate); + do { + if (d->margins.isNull()) + break; + + int frame_margin = DStyle::pixelMetric(view->style(), DStyle::PM_FrameRadius); + int left_right_margin = DStyle::pixelMetric(view->style(), DStyle::PM_ContentsMargins); + d->margins = QMargins(left_right_margin, frame_margin, left_right_margin, frame_margin); + + // relayout to calculate size. + view->doItemsLayout(); + } while (false); + } + if (view && object == view->viewport()) { + static const QEvent::Type UpdateWidgetVisibleEvent( + static_cast(QEvent::registerEventType())); + + if (event->type() == QEvent::Paint) { + D_D(DStyledItemDelegate); + const QPaintEvent *pe = static_cast(event); + // We only hide widgets when updating all area, it maybe also to be paint when hover, + // and it's area is a specific part. + if (pe->rect() == view->viewport()->rect() && + d->readyRecordVisibleWidgetOfCurrentFrame()) { + auto updateEvent = new QEvent(UpdateWidgetVisibleEvent); + qApp->postEvent(view->viewport(), updateEvent); + } + } else if (event->type() == UpdateWidgetVisibleEvent) { + D_D(DStyledItemDelegate); + d->updateWidgetVisibleInUnvisualArea(); + return true; + } + } return QStyledItemDelegate::eventFilter(object, event); } @@ -1207,13 +1478,6 @@ return Dtk::LeftActionListRole; } -static void clearActions(const DViewItemActionList &list) -{ - for (auto action : list) { - action->deleteLater(); - } -} - /*! \class Dtk::Widget::DStandardItem \inmodule dtkwidget @@ -1227,11 +1491,6 @@ */ DStandardItem::~DStandardItem() { - for (Qt::Edge e : {Qt::TopEdge, Qt::LeftEdge, Qt::RightEdge, Qt::BottomEdge}) { - clearActions(qvariant_cast(data(getActionPositionRole(e)))); - } - - clearActions(textActionList()); } /*! @@ -1245,11 +1504,10 @@ QVariant value; if (!list.isEmpty()) { - value = QVariant::fromValue(list); + value = actionListToQVariant(list);; } auto role = getActionPositionRole(edge); - clearActions(qvariant_cast(data(role))); setData(value, role); } @@ -1260,7 +1518,7 @@ */ DViewItemActionList DStandardItem::actionList(Qt::Edge edge) const { - return qvariant_cast(data(getActionPositionRole(edge))); + return qvariantToActionList(data(getActionPositionRole(edge))); } /*! @@ -1313,10 +1571,9 @@ QVariant value; if (!list.isEmpty()) { - value = QVariant::fromValue(list); + value = actionListToQVariant(list);; } - clearActions(textActionList()); setData(value, Dtk::TextActionListRole); } @@ -1325,7 +1582,7 @@ */ DViewItemActionList DStandardItem::textActionList() const { - return qvariant_cast(data(Dtk::TextActionListRole)); + return qvariantToActionList(data(Dtk::TextActionListRole)); } void DStandardItem::setTextColorRole(DPalette::ColorType role) @@ -1378,4 +1635,19 @@ return getViewItemFont(index(), Dtk::ViewItemFontLevelRole); } +void DStandardItem::setDciIcon(const DDciIcon &dciIcon) +{ + setData(QVariant::fromValue(dciIcon), Qt::DecorationRole); +} + +DDciIcon DStandardItem::dciIcon() const +{ + return qvariant_cast(data(Qt::DecorationRole)); +} + +QStandardItem *DStandardItem::clone() const +{ + return new DStandardItem(*this); +} + DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/dstyleditemdelegate.h dtkwidget-5.6.12/src/widgets/dstyleditemdelegate.h --- dtkwidget-5.5.48/src/widgets/dstyleditemdelegate.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dstyleditemdelegate.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DSTYLEDITEMDELEGATE_H -#define DSTYLEDITEMDELEGATE_H - -#include -#include -#include -#include - -#include -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DViewItemActionPrivate; -class DViewItemAction : public QAction, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DViewItemAction) - -public: - explicit DViewItemAction(Qt::Alignment alignment = Qt::Alignment(), const QSize &iconSize = QSize(), - const QSize &maxSize = QSize(), bool clickable = false); - D_DECL_DEPRECATED explicit DViewItemAction(Qt::Alignment alignment, const QSize &iconSize, - const QSize &maxSize, bool clickable, QObject *parent); - - Qt::Alignment alignment() const; - QSize iconSize() const; - QSize maximumSize() const; - - QMargins clickAreaMargins() const; - void setClickAreaMargins(const QMargins &margins); - - void setTextColorRole(DPalette::ColorType role); - void setTextColorRole(DPalette::ColorRole role); - DPalette::ColorType textColorType() const; - DPalette::ColorRole textColorRole() const; - - void setFontSize(DFontSizeManager::SizeType size); - QFont font() const; - - bool isClickable() const; - - void setWidget(QWidget *widget); - QWidget *widget() const; -}; -typedef QList DViewItemActionList; - -class DStyledItemDelegatePrivate; -class DStyledItemDelegate : public QStyledItemDelegate, public DCORE_NAMESPACE::DObject -{ - Q_OBJECT - D_DECLARE_PRIVATE(DStyledItemDelegate) - - Q_PROPERTY(BackgroundType backgroundType READ backgroundType WRITE setBackgroundType) - Q_PROPERTY(QMargins margins READ margins WRITE setMargins) - Q_PROPERTY(QSize itemSize READ itemSize WRITE setItemSize) - -public: - enum BackgroundType { - NoBackground = 0, - ClipCornerBackground = 1, - RoundedBackground = 2, - BackgroundType_Mask = 0xff, - NoNormalState = 0x100 - }; - - explicit DStyledItemDelegate(QAbstractItemView *parent = nullptr); - - void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; - - void updateEditorGeometry(QWidget *editor, - const QStyleOptionViewItem &option, - const QModelIndex &index) const override; - - BackgroundType backgroundType() const; - QMargins margins() const; - QSize itemSize() const; - int spacing() const; - -public Q_SLOTS: - void setBackgroundType(BackgroundType backgroundType); - void setMargins(const QMargins margins); - void setItemSize(QSize itemSize); - void setItemSpacing(int spacing); - -protected: - void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override; - bool eventFilter(QObject *object, QEvent *event) override; -}; - -class DStandardItem : public QStandardItem -{ -public: - using QStandardItem::QStandardItem; - virtual ~DStandardItem(); - - void setActionList(Qt::Edge edge, const DViewItemActionList &list); - DViewItemActionList actionList(Qt::Edge edge) const; - - void setTextActionList(const DViewItemActionList &list); - DViewItemActionList textActionList() const; - - void setTextColorRole(DPalette::ColorType role); - void setTextColorRole(DPalette::ColorRole role); - DPalette::ColorType textColorType() const; - DPalette::ColorRole textColorRole() const; - - void setBackgroundRole(DPalette::ColorType role); - void setBackgroundRole(DPalette::ColorRole role); - DPalette::ColorType backgroundType() const; - DPalette::ColorRole backgroundRole() const; - - void setFontSize(DFontSizeManager::SizeType size); - QFont font() const; -}; - -DWIDGET_END_NAMESPACE - -Q_DECLARE_METATYPE(DTK_WIDGET_NAMESPACE::DViewItemActionList) - -#endif // DSTYLEDITEMDELEGATE_H diff -Nru dtkwidget-5.5.48/src/widgets/dstyle.h dtkwidget-5.6.12/src/widgets/dstyle.h --- dtkwidget-5.5.48/src/widgets/dstyle.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dstyle.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,462 +0,0 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DSTYLE_H -#define DSTYLE_H - -#include -#include - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE -class QTextLayout; -QT_END_NAMESPACE - -DGUI_USE_NAMESPACE -DWIDGET_BEGIN_NAMESPACE - -namespace DDrawUtils -{ -enum Corner { - TopLeftCorner = 0x00001, - TopRightCorner = 0x00002, - BottomLeftCorner = 0x00004, - BottomRightCorner = 0x00008 -}; -Q_DECLARE_FLAGS(Corners, Corner) - -void drawShadow(QPainter *pa, const QRect &rect, qreal xRadius, qreal yRadius, const QColor &sc, qreal radius, const QPoint &offset); -void drawShadow(QPainter *pa, const QRect &rect, const QPainterPath &path, const QColor &sc, int radius, const QPoint &offset); -void drawRoundedRect(QPainter *pa, const QRect &rect, qreal xRadius, qreal yRadius, Corners corners, Qt::SizeMode mode = Qt::AbsoluteSize); -void drawFork(QPainter *pa, const QRectF &rect, const QColor &color, int width = 2); -void drawMark(QPainter *pa, const QRectF &rect, const QColor &boxInside, const QColor &boxOutside, const int penWidth, const int outLineLeng = 2); -void drawBorder(QPainter *pa, const QRectF &rect, const QBrush &brush, int borderWidth, int radius); -void drawArrow(QPainter *pa, const QRectF &rect, const QColor &color, Qt::ArrowType arrow, int width = 2); -void drawPlus(QPainter *painter, const QRectF &rect, const QColor &color , qreal width); -void drawSubtract(QPainter *painter, const QRectF &rect, const QColor &color, qreal width); - -void drawForkElement(QPainter *pa, const QRectF &rect); -void drawArrowElement(Qt::ArrowType arrow, QPainter *pa, const QRectF &rect); -void drawDecreaseElement(QPainter *pa, const QRectF &rect); -void drawIncreaseElement(QPainter *pa, const QRectF &rect); -void drawMarkElement(QPainter *pa, const QRectF &rect); -void drawSelectElement(QPainter *pa, const QRectF &rect); -void drawEditElement(QPainter *pa, const QRectF &rect); -void drawExpandElement(QPainter *pa, const QRectF &rect); -void drawReduceElement(QPainter *pa, const QRectF &rect); -void drawLockElement(QPainter *pa, const QRectF &rect); -void drawUnlockElement(QPainter *pa, const QRectF &rect); -void drawMediaVolumeElement(QPainter *pa, const QRectF &rect); -void drawMediaVolumeFullElement(QPainter *pa, const QRectF &rect); -void drawMediaVolumeMutedElement(QPainter *pa, const QRectF &rect); -void drawMediaVolumeLeftElement(QPainter *pa, const QRectF &rect); -void drawMediaVolumeRightElement(QPainter *pa, const QRectF &rect); -void drawArrowEnter(QPainter *pa, const QRectF &rect); -void drawArrowLeave(QPainter *pa, const QRectF &rect); -void drawArrowNext(QPainter *pa, const QRectF &rect); -void drawArrowPrev(QPainter *pa, const QRectF &rect); -void drawShowPassword(QPainter *pa, const QRectF &rect); -void drawHidePassword(QPainter *pa, const QRectF &rect); -void drawCloseButton(QPainter *pa, const QRectF &rect); -void drawIndicatorMajuscule(QPainter *pa, const QRectF &rect); -void drawIndicatorUnchecked(QPainter *pa, const QRectF &rect); -void drawIndicatorChecked(QPainter *pa, const QRectF &rect); -void drawDeleteButton(QPainter *pa, const QRectF &rect); -void drawAddButton(QPainter *pa, const QRectF &rect); - -void drawTitleBarMenuButton(QPainter *pa, const QRectF &rect); -void drawTitleBarMinButton(QPainter *pa, const QRectF &rect); -void drawTitleBarMaxButton(QPainter *pa, const QRectF &rect); -void drawTitleBarCloseButton(QPainter *pa, const QRectF &rect); -void drawTitleBarNormalButton(QPainter *pa, const QRectF &rect); -void drawTitleQuitFullButton(QPainter *pa, const QRectF &rect); -void drawArrowUp(QPainter *pa, const QRectF &rect); -void drawArrowDown(QPainter *pa, const QRectF &rect); -void drawArrowLeft(QPainter *pa, const QRectF &rect); -void drawArrowRight(QPainter *pa, const QRectF &rect); -void drawArrowBack(QPainter *pa, const QRectF &rect); -void drawArrowForward(QPainter *pa, const QRectF &rect); -void drawLineEditClearButton(QPainter *pa, const QRectF &rect); - -Q_DECLARE_OPERATORS_FOR_FLAGS(Corners) -} - -class DViewItemAction; -class DStyle : public QCommonStyle -{ - Q_OBJECT - -public: - enum PrimitiveElement { - PE_ItemBackground = QStyle::PE_CustomBase + 1, //列表项的背景色 - PE_IconButtonPanel, - PE_IconButtonIcon, - PE_Icon, - PE_SwitchButtonGroove, - PE_SwitchButtonHandle, - PE_FloatingWidget, - PE_CustomBase = QStyle::PE_CustomBase + 0xf00000 - }; - - enum ControlElement { - CE_IconButton = QStyle::CE_CustomBase + 1, - CE_SwitchButton, - CE_FloatingWidget, - CE_ButtonBoxButton, - CE_ButtonBoxButtonBevel, - CE_ButtonBoxButtonLabel, - CE_TextButton, - CE_CustomBase = QStyle::CE_CustomBase + 0xf00000 - }; - - enum PixelMetric { - PM_FocusBorderWidth = QStyle::PM_CustomBase + 1, //控件焦点状态的边框宽度 - PM_FocusBorderSpacing, //控件内容和border之间的间隔 - PM_FrameRadius, //控件的圆角大小 - PM_ShadowRadius, //控件阴影效果的半径 - PM_ShadowHOffset, //阴影在水平方向的偏移 - PM_ShadowVOffset, //阴影在竖直方向的偏移 - PM_FrameMargins, //控件的margins区域,控件内容 = 控件大小 - FrameMargins - PM_IconButtonIconSize, - PM_TopLevelWindowRadius, //窗口的圆角大小 - PM_SwitchButtonHandleWidth, - PM_SwithcButtonHandleHeight, - PM_FloatingWidgetRadius, //(基类)的圆角半径:控件内容-Radius < 控件内容 < 控件显示大小 - PM_FloatingWidgetShadowRadius, //(基类)的阴影Radius区域:控件内容 < 控件内容+阴影margins < 控件内容+阴影margins+阴影Radius = 控件显示大小 - PM_FloatingWidgetShadowMargins, //(基类)阴影的宽度 = 控件显示大小 - 阴影Radius - 控件内容 - PM_FloatingWidgetShadowHOffset, //(基类)的阴影水平偏移 - PM_FloatingWidgetShadowVOffset, //(基类)的阴影竖直偏移 - PM_ContentsMargins, //内容的边距(一般只用于左右边距) - PM_ContentsSpacing, //内容的间距(可用于列表项中每一项的距离) - PM_ButtonMinimizedSize, //按钮控件的最小大小 - PM_CustomBase = QStyle::PM_CustomBase + 0xf00000 - }; - - enum SubElement { - SE_IconButtonIcon = QStyle::SE_CustomBase + 1, - SE_SwitchButtonGroove, - SE_SwitchButtonHandle, - SE_FloatingWidget, - SE_ButtonBoxButtonContents, - SE_ButtonBoxButtonFocusRect, - SE_CustomBase = QStyle::SE_CustomBase + 0xf00000 - }; - - enum ContentsType { - CT_IconButton = QStyle::CT_CustomBase + 1, - CT_SwitchButton, - CT_FloatingWidget, - CT_ButtonBoxButton, - CT_CustomBase = QStyle::CT_CustomBase + 0xf00000 - }; - - enum StyleState { - SS_NormalState = 0x00000000, - SS_HoverState = 0x00000001, - SS_PressState = 0x00000002, - SS_StateCustomBase = 0x000000f0, - - StyleState_Mask = 0x000000ff, - SS_CheckedFlag = 0x00000100, - SS_SelectedFlag = 0x00000200, - SS_FocusFlag = 0x00000400, - SS_FlagCustomBase = 0xf00000 - }; - Q_DECLARE_FLAGS(StateFlags, StyleState) - - enum StandardPixmap { - SP_ForkElement = QStyle::SP_CustomBase + 1, - SP_DecreaseElement, //减少(-) - SP_IncreaseElement, //增加(+) - SP_MarkElement, //对勾 - SP_SelectElement, //选择(...) - SP_EditElement, //编辑 - SP_ExpandElement, //展开 - SP_ReduceElement, //收缩 - SP_LockElement, //锁定 - SP_UnlockElement, //解锁 - SP_MediaVolumeLowElement, //音量 - SP_MediaVolumeHighElement, //满音量 - SP_MediaVolumeMutedElement, //静音 - SP_MediaVolumeLeftElement, //左声道 - SP_MediaVolumeRightElement, //右声道 - SP_ArrowEnter, //进入 - SP_ArrowLeave, //离开 - SP_ArrowNext, //下一页 - SP_ArrowPrev, //上一页 - SP_ShowPassword, //显示密码 - SP_HidePassword, //因此密码 - SP_CloseButton, //关闭按钮(X) - SP_IndicatorMajuscule, //大写标识 - SP_IndicatorSearch, //搜索标识(放大镜) - SP_IndicatorUnchecked, //搜索标识(对应对勾的选中状态) - SP_IndicatorChecked, //搜索标识(对勾) - SP_DeleteButton, //删除按钮 - SP_AddButton, //新增按钮 - SP_TitleQuitFullButton, //标题栏(「」) - SP_TitleMoreButton, //标题栏 "更多" 按钮 - - SP_Title_SS_LeftButton, //标题栏左分屏按钮 - SP_Title_SS_RightButton, //标题栏右分屏按钮 - SP_Title_SS_ShowMaximizeButton, //标题栏最大化分屏按钮 - SP_Title_SS_ShowNormalButton, //标题栏还原分屏按钮 - SP_CustomBase = QStyle::SP_CustomBase + 0xf00000 - }; - - static QColor adjustColor(const QColor &base, - qint8 hueFloat = 0, qint8 saturationFloat = 0, qint8 lightnessFloat = 0, - qint8 redFloat = 0, qint8 greenFloat = 0, qint8 blueFloat = 0, qint8 alphaFloat = 0); - static QColor blendColor(const QColor &substrate, const QColor &superstratum); - static QPair toIconModeState(const QStyleOption *option); - - static void setTooltipTextFormat(Qt::TextFormat format); - static Qt::TextFormat tooltipTextFormat(); - static DStyle::StyleState getState(const QStyleOption *option); - static void setFocusRectVisible(QWidget *widget, bool visible); - static void setFrameRadius(QWidget *widget, int radius); - static void setUncheckedItemIndicatorVisible(QWidget *widget, bool visible); - DStyle(); - - static void drawPrimitive(const QStyle *style, DStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr); - static void drawControl(const QStyle *style, DStyle::ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr); - static int pixelMetric(const QStyle *style, DStyle::PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr); - static QRect subElementRect(const QStyle *style, DStyle::SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr); - static QSize sizeFromContents(const QStyle *style, DStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = nullptr); - static QIcon standardIcon(const QStyle *style, StandardPixmap st, const QStyleOption *opt = nullptr, const QWidget *widget = 0); - - inline void drawPrimitive(DStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const - { proxy()->drawPrimitive(static_cast(pe), opt, p, w); } - inline void drawControl(DStyle::ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const - { proxy()->drawControl(static_cast(ce), opt, p, w); } - inline int pixelMetric(DStyle::PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const - { return proxy()->pixelMetric(static_cast(m), opt, widget); } - inline QRect subElementRect(DStyle::SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const - { return proxy()->subElementRect(static_cast(r), opt, widget); } - inline QSize sizeFromContents(DStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = nullptr) const - { return proxy()->sizeFromContents(static_cast(ct), opt, contentsSize, widget); } - inline QIcon standardIcon(DStyle::StandardPixmap st, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const - { return proxy()->standardIcon(static_cast(st), opt, widget); } - - void drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const override; - void drawControl(QStyle::ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const override; - int pixelMetric(QStyle::PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const override; - int styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w, QStyleHintReturn *shret) const override; - QRect subElementRect(QStyle::SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const override; - QSize sizeFromContents(QStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = nullptr) const override; - QIcon standardIcon(QStyle::StandardPixmap st, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const override; - - QPalette standardPalette() const override; - QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override; - - // 获取一个加工后的画笔 - QBrush generatedBrush(const QStyleOption *option, const QBrush &base, - QPalette::ColorGroup cg = QPalette::Normal, - QPalette::ColorRole role = QPalette::NoRole) const; - QBrush generatedBrush(StyleState state, const QStyleOption *option, const QBrush &base, - QPalette::ColorGroup cg = QPalette::Normal, - QPalette::ColorRole role = QPalette::NoRole) const; - virtual QBrush generatedBrush(StateFlags flags, const QBrush &base, - QPalette::ColorGroup cg = QPalette::Normal, - QPalette::ColorRole role = QPalette::NoRole, - const QStyleOption *option = nullptr) const; - - QBrush generatedBrush(const QStyleOption *option, const QBrush &base, - DPalette::ColorGroup cg = DPalette::Normal, - DPalette::ColorType type = DPalette::ItemBackground) const; - QBrush generatedBrush(StyleState state, const QStyleOption *option, const QBrush &base, - DPalette::ColorGroup cg = DPalette::Normal, - DPalette::ColorType type = DPalette::ItemBackground) const; - virtual QBrush generatedBrush(StateFlags flags, const QBrush &base, - DPalette::ColorGroup cg = DPalette::Normal, - DPalette::ColorType type = DPalette::ItemBackground, - const QStyleOption *option = nullptr) const; - - using QCommonStyle::drawPrimitive; - using QCommonStyle::drawControl; - using QCommonStyle::pixelMetric; - using QCommonStyle::subElementRect; - using QCommonStyle::sizeFromContents; - using QCommonStyle::standardIcon; - -#if QT_CONFIG(itemviews) - static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth); - static QSize viewItemSize(const QStyle *style, const QStyleOptionViewItem *option, int role); - static void viewItemLayout(const QStyle *style, const QStyleOptionViewItem *opt, QRect *pixmapRect, - QRect *textRect, QRect *checkRect, bool sizehint); - virtual void viewItemLayout(const QStyleOptionViewItem *opt, QRect *pixmapRect, - QRect *textRect, QRect *checkRect, bool sizehint) const; - - static QRect viewItemDrawText(const QStyle *style, QPainter *p, const QStyleOptionViewItem *option, const QRect &rect); - virtual QRect viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const; -#endif -}; - -class DStyleHelper -{ -public: - inline DStyleHelper(const QStyle *style = nullptr) { - setStyle(style); - } - - inline void setStyle(const QStyle *style) { - m_style = style; - m_dstyle = qobject_cast(style); - } - - inline const QStyle *style() const - { return m_style; } - inline const DStyle *dstyle() const - { return m_dstyle; } - - inline QBrush generatedBrush(const QStyleOption *option, const QBrush &base, - QPalette::ColorGroup cg = QPalette::Normal, - QPalette::ColorRole role = QPalette::NoRole) const - { return m_dstyle ? m_dstyle->generatedBrush(option, base, cg, role) : base; } - inline QBrush generatedBrush(const QStyleOption *option, const QBrush &base, - QPalette::ColorGroup cg = QPalette::Normal, - DPalette::ColorType type = DPalette::NoType) const - { return m_dstyle ? m_dstyle->generatedBrush(option, base, cg, type) : base; } - inline QColor getColor(const QStyleOption *option, QPalette::ColorRole role) const - { return generatedBrush(option, option->palette.brush(role), option->palette.currentColorGroup(), role).color(); } - inline QColor getColor(const QStyleOption *option, const DPalette &palette, DPalette::ColorType type) const - { return generatedBrush(option, palette.brush(type), palette.currentColorGroup(), type).color(); } - template - inline QColor getColor(const T *option, DPalette::ColorType type) const - { return getColor(option, option->dpalette, type); } - - inline void drawPrimitive(DStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const - { m_dstyle ? m_dstyle->drawPrimitive(pe, opt, p, w) : DStyle::drawPrimitive(m_style, pe, opt, p, w); } - inline void drawControl(DStyle::ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const - { m_dstyle ? m_dstyle->drawControl(ce, opt, p, w) : DStyle::drawControl(m_style, ce, opt, p, w); } - inline int pixelMetric(DStyle::PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const - { return m_dstyle ? m_dstyle->pixelMetric(m, opt, widget) : DStyle::pixelMetric(m_style, m, opt, widget); } - inline QRect subElementRect(DStyle::SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const - { return m_dstyle ? m_dstyle->subElementRect(r, opt, widget) : DStyle::subElementRect(m_style, r, opt, widget); } - inline QSize sizeFromContents(DStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = nullptr) const - { return m_dstyle ? m_dstyle->sizeFromContents(ct, opt, contentsSize, widget) : DStyle::sizeFromContents(m_style, ct, opt, contentsSize, widget); } - inline QIcon standardIcon(DStyle::StandardPixmap standardIcon, const QStyleOption *opt, const QWidget *widget = nullptr) const - { return m_dstyle ? m_dstyle->standardIcon(standardIcon, opt, widget) : DStyle::standardIcon(m_style, standardIcon, opt, widget); } - -private: - const QStyle *m_style; - const DStyle *m_dstyle; -}; - -class DStylePainter : public QPainter -{ -public: - inline DStylePainter() : QPainter(), widget(nullptr), wstyle(nullptr) {} - inline explicit DStylePainter(QWidget *w) { begin(w, w); } - inline DStylePainter(QPaintDevice *pd, QWidget *w) { begin(pd, w); } - inline bool begin(QWidget *w) { return begin(w, w); } - inline bool begin(QPaintDevice *pd, QWidget *w) { - Q_ASSERT_X(w, "DStylePainter::DStylePainter", "Widget must be non-zero"); - widget = w; - wstyle = w->style(); - dstyle.setStyle(wstyle); - return QPainter::begin(pd); - }; - inline void drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption &opt); - inline void drawPrimitive(DStyle::PrimitiveElement pe, const QStyleOption &opt); - inline void drawControl(QStyle::ControlElement ce, const QStyleOption &opt); - inline void drawControl(DStyle::ControlElement ce, const QStyleOption &opt); - inline void drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex &opt); - inline void drawItemText(const QRect &r, int flags, const QPalette &pal, bool enabled, - const QString &text, QPalette::ColorRole textRole = QPalette::NoRole); - inline void drawItemPixmap(const QRect &r, int flags, const QPixmap &pixmap); - inline QStyle *style() const { return wstyle; } - -private: - QWidget *widget; - QStyle *wstyle; - DStyleHelper dstyle; - Q_DISABLE_COPY(DStylePainter) -}; - -void DStylePainter::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption &opt) -{ - wstyle->drawPrimitive(pe, &opt, this, widget); -} - -void DStylePainter::drawPrimitive(DStyle::PrimitiveElement pe, const QStyleOption &opt) -{ - dstyle.drawPrimitive(pe, &opt, this, widget); -} - -void DStylePainter::drawControl(QStyle::ControlElement ce, const QStyleOption &opt) -{ - wstyle->drawControl(ce, &opt, this, widget); -} - -void DStylePainter::drawControl(DStyle::ControlElement ce, const QStyleOption &opt) -{ - dstyle.drawControl(ce, &opt, this, widget); -} - -void DStylePainter::drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex &opt) -{ - wstyle->drawComplexControl(cc, &opt, this, widget); -} - -void DStylePainter::drawItemText(const QRect &r, int flags, const QPalette &pal, bool enabled, - const QString &text, QPalette::ColorRole textRole) -{ - wstyle->drawItemText(this, r, flags, pal, enabled, text, textRole); -} - -void DStylePainter::drawItemPixmap(const QRect &r, int flags, const QPixmap &pixmap) -{ - wstyle->drawItemPixmap(this, r, flags, pixmap); -} - -class DStyledIconEngine : public QIconEngine -{ -public: - static void drawIcon(const QIcon &icon, QPainter *pa, const QRectF &rect); - - typedef std::function DrawFun; - DStyledIconEngine(DrawFun drawFun, const QString &iconName = QString()); - - void bindDrawFun(DrawFun drawFun); - void setIconName(const QString &name); - - QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override; - void paint(QPainter *painter, const QPalette &palette, const QRectF &rect); - void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override; - - QIconEngine *clone() const override; - void setFrontRole(const QWidget* widget, QPalette::ColorRole role); - -protected: - void virtual_hook(int id, void *data) override; - - DrawFun m_drawFun = nullptr; - QString m_iconName; - QPalette::ColorRole m_painterRole; - const QWidget *m_widget; -}; - -DWIDGET_END_NAMESPACE - -#endif // DSTYLE_H diff -Nru dtkwidget-5.5.48/src/widgets/DStyleHelper dtkwidget-5.6.12/src/widgets/DStyleHelper --- dtkwidget-5.5.48/src/widgets/DStyleHelper 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStyleHelper 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyle.h" diff -Nru dtkwidget-5.5.48/src/widgets/DStyleOption dtkwidget-5.6.12/src/widgets/DStyleOption --- dtkwidget-5.5.48/src/widgets/DStyleOption 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStyleOption 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/src/widgets/DStyleOptionBackgroundGroup dtkwidget-5.6.12/src/widgets/DStyleOptionBackgroundGroup --- dtkwidget-5.5.48/src/widgets/DStyleOptionBackgroundGroup 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStyleOptionBackgroundGroup 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/src/widgets/DStyleOptionButton dtkwidget-5.6.12/src/widgets/DStyleOptionButton --- dtkwidget-5.5.48/src/widgets/DStyleOptionButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStyleOptionButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/src/widgets/dstyleoption.cpp dtkwidget-5.6.12/src/widgets/dstyleoption.cpp --- dtkwidget-5.5.48/src/widgets/dstyleoption.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dstyleoption.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #define private public #include @@ -119,6 +102,41 @@ \a widget \sa Dtk::Widget::DSuggestButton */ +DStyleOptionButton::DStyleOptionButton() + : QStyleOptionButton () + , DStyleOption () +{ +} + +/*! + * @brief DStyleOptionButton::DStyleOptionButton Custom copy constructor + * @param other Source object + */ +DStyleOptionButton::DStyleOptionButton(const DStyleOptionButton &other) + : QStyleOptionButton (other) + , DStyleOption (other) +{ + // `dciIcon` broke abi, so we need to distinguish weather `other` has dciIcon. + if (other.features & DStyleOptionButton::HasDciIcon) + dciIcon = other.dciIcon; +} + +/*! + * @brief DStyleOptionButton::operator = Custom assignment constructor + * @param other Source obejct + * @return + */ +DStyleOptionButton &DStyleOptionButton::operator=(const DStyleOptionButton &other) +{ + // Set the value of the parent class member variable. + this->QStyleOptionButton::operator=(other); + this->DStyleOption::operator=(other); + + if (other.features & DStyleOptionButton::HasDciIcon) + dciIcon = other.dciIcon; + return *this; +} + void DStyleOptionButton::init(const QWidget *widget) { DStyleOption::init(widget); diff -Nru dtkwidget-5.5.48/src/widgets/dstyleoption.h dtkwidget-5.6.12/src/widgets/dstyleoption.h --- dtkwidget-5.5.48/src/widgets/dstyleoption.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dstyleoption.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,214 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DSTYLEOPTION_H -#define DSTYLEOPTION_H - -#include -#include - -#include - -QT_BEGIN_NAMESPACE -class QGuiApplication; -QT_END_NAMESPACE - -DGUI_USE_NAMESPACE - -DTK_BEGIN_NAMESPACE - -enum ItemDataRole { - MarginsRole = Qt::UserRole + 1, - LeftActionListRole, - TopActionListRole, - RightActionListRole, - BottomActionListRole, - TextActionListRole, - ViewItemFontLevelRole, - ViewItemBackgroundRole, - ViewItemForegroundRole, - UserRole = Qt::UserRole << 2 -}; - -DTK_END_NAMESPACE - -DWIDGET_BEGIN_NAMESPACE - -class DStyleOption -{ -public: - enum OptionType { - SO_HighlightButton = QStyleOption::SO_CustomBase + 1, - SO_CustomBase = QStyleOption::SO_CustomBase << 2 - }; - - virtual void init(QWidget *widget); - virtual void init(const QWidget *widget); - - DPalette dpalette; -}; - -class DStyleOptionButton : public QStyleOptionButton, public DStyleOption -{ -public: - enum ButtonFeature { - SuggestButton = (CommandLinkButton << 1), - WarningButton = (SuggestButton << 1), - FloatingButton = (WarningButton << 1), - TitleBarButton = (FloatingButton << 1), - CircleButton = (TitleBarButton << 1) - }; - - void init(const QWidget *widget) override; -}; - -class DStyleOptionButtonBoxButton : public DStyleOptionButton -{ -public: - enum ButtonPosition { - Invalid, - Beginning, - Middle, - End, - OnlyOne - }; - - Qt::Orientation orientation; - ButtonPosition position; -}; - -class DStyleOptionLineEdit : public DStyleOption -{ -public: - enum LineEditFeature { - None = 0x0, - Alert = 0x1, - IconButton = 0x2 - }; - Q_DECLARE_FLAGS(LineEditFeatures, LineEditFeature) - - void init(const QWidget *widget) override; - - LineEditFeatures features = None; - QRect iconButtonRect; -}; - -class DStyleOptionBackgroundGroup : public QStyleOption, public DStyleOption -{ -public: - enum ItemBackgroundPosition { - Invalid, - Beginning, - Middle, - End, - OnlyOne - }; - - using DStyleOption::DStyleOption; - using QStyleOption::QStyleOption; - void init(const QWidget *widget) override; - - Qt::Orientations directions; - ItemBackgroundPosition position; -}; - -class DStyleOptionIcon : public QStyleOption, public DStyleOption -{ -public: - QIcon icon; -}; - -class DStyleOptionViewItem : public QStyleOptionViewItem, public DStyleOption -{ -public: - enum ViewItemFeature { - - }; -}; - -class DStyleOptionFloatingWidget : public QStyleOption, public DStyleOption -{ -public: - using DStyleOption::init; - bool noBackground; - int frameRadius = -1; -}; - -class DFontSizeManagerPrivate; -class DFontSizeManager -{ -public: - enum SizeType { - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - NSizeTypes - }; - - static DFontSizeManager *instance(); - void bind(QWidget *widget, SizeType type); - void bind(QWidget *widget, SizeType type, int weight); - void unbind(QWidget *widget); - - quint16 fontPixelSize(SizeType type) const; - void setFontPixelSize(SizeType type, quint16 size); - void setFontGenericPixelSize(quint16 size); - const QFont get(SizeType type, const QFont &base = QFont()) const; - const QFont get(SizeType type, int weight, const QFont &base = QFont()) const; - - inline const QFont t1(const QFont &base = QFont()) const - { return get(T1, base); } - inline const QFont t2(const QFont &base = QFont()) const - { return get(T2, base); } - inline const QFont t3(const QFont &base = QFont()) const - { return get(T3, base); } - inline const QFont t4(const QFont &base = QFont()) const - { return get(T4, base); } - inline const QFont t5(const QFont &base = QFont()) const - { return get(T5, base); } - inline const QFont t6(const QFont &base = QFont()) const - { return get(T6, base); } - inline const QFont t7(const QFont &base = QFont()) const - { return get(T7, base); } - inline const QFont t8(const QFont &base = QFont()) const - { return get(T8, base); } - inline const QFont t9(const QFont &base = QFont()) const - { return get(T9, base); } - inline const QFont t10(const QFont &base = QFont()) const - { return get(T10, base); } - - static int fontPixelSize(const QFont &font); - -private: - DFontSizeManager(); - - QScopedPointer d; -}; - -DWIDGET_END_NAMESPACE - -#endif // DSTYLEOPTION_H diff -Nru dtkwidget-5.5.48/src/widgets/DStyleOptionLineEdit dtkwidget-5.6.12/src/widgets/DStyleOptionLineEdit --- dtkwidget-5.5.48/src/widgets/DStyleOptionLineEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStyleOptionLineEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/src/widgets/DStyleOptionViewItem dtkwidget-5.6.12/src/widgets/DStyleOptionViewItem --- dtkwidget-5.5.48/src/widgets/DStyleOptionViewItem 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStyleOptionViewItem 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/src/widgets/DStylePainter dtkwidget-5.6.12/src/widgets/DStylePainter --- dtkwidget-5.5.48/src/widgets/DStylePainter 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DStylePainter 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dstyle.h" diff -Nru dtkwidget-5.5.48/src/widgets/DSuggestButton dtkwidget-5.6.12/src/widgets/DSuggestButton --- dtkwidget-5.5.48/src/widgets/DSuggestButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSuggestButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dsuggestbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsuggestbutton.cpp dtkwidget-5.6.12/src/widgets/dsuggestbutton.cpp --- dtkwidget-5.5.48/src/widgets/dsuggestbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsuggestbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dsuggestbutton.h" #include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/src/widgets/dsuggestbutton.h dtkwidget-5.6.12/src/widgets/dsuggestbutton.h --- dtkwidget-5.5.48/src/widgets/dsuggestbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dsuggestbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DSUGGESTBUTTON_H -#define DSUGGESTBUTTON_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DSuggestButton : public QPushButton, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - -public: - explicit DSuggestButton(QWidget *parent = nullptr); - explicit DSuggestButton(const QString &text, QWidget *parent = nullptr); - -protected: - void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; -}; - -DWIDGET_END_NAMESPACE - -#endif // DSUGGESTBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/DSwitchButton dtkwidget-5.6.12/src/widgets/DSwitchButton --- dtkwidget-5.5.48/src/widgets/DSwitchButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DSwitchButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dswitchbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dswitchbutton.cpp dtkwidget-5.6.12/src/widgets/dswitchbutton.cpp --- dtkwidget-5.5.48/src/widgets/dswitchbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dswitchbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,24 +1,11 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dswitchbutton.h" #include #include -#include +#include "private/dswitchbutton_p.h" #include @@ -26,7 +13,8 @@ DWIDGET_BEGIN_NAMESPACE /*! - \brief DSwitchButton::DSwitchButton 实现一个开关按钮 +@~english + @brief DSwitchButton::DSwitchButton implements a switch button \a parent */ DSwitchButton::DSwitchButton(QWidget *parent) @@ -39,8 +27,9 @@ } /*! - \brief DSwitchButton::sizeHint 初始化控件矩形大小(在绘画之前) - \return 控件举行大小 +@~english + @brief DSwitchButton::sizeHint initializes the control rectangle size (before drawing) + @return Control rectangle size */ QSize DSwitchButton::sizeHint() const { @@ -52,9 +41,10 @@ } /*! - \brief DSwitchButton::paintEvent 绘画处理 - \a e 绘画事件 - \sa QWidget::paintEvent() +@~english + @brief DSwitchButton::paintEvent Painting treatment + \a e Painting event + @sa QWidget::paintEvent() */ void DSwitchButton::paintEvent(QPaintEvent *e) { @@ -67,8 +57,9 @@ } /*! - \brief DSwitchButton::initStyleOption 初始化(用于继承的)抽象按钮对象,后面用于 DStylePainter 绘画 DStyle::CE_SwitchButton 枚举 - \a option 初始化了的的抽象风格按钮对象 +@~english + @brief DSwitchButton::initStyleOption Initializes the abstract button object (for inheritance), which is later used for DStylePainter painting DStyle::CE_SwitchButton enumeration + \a option The abstract style button object is initialized */ void DSwitchButton::initStyleOption(DStyleOptionButton *option) const { diff -Nru dtkwidget-5.5.48/src/widgets/dswitchbutton.h dtkwidget-5.6.12/src/widgets/dswitchbutton.h --- dtkwidget-5.5.48/src/widgets/dswitchbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dswitchbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DSWITCHBUTTON_H -#define DSWITCHBUTTON_H - -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DSwitchButtonPrivate; -class DStyleOptionButton; -class LIBDTKWIDGETSHARED_EXPORT DSwitchButton : public QAbstractButton, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - -public: - explicit DSwitchButton(QWidget *parent = Q_NULLPTR); - - QSize sizeHint() const Q_DECL_OVERRIDE; - -Q_SIGNALS: - void checkedChanged(bool arg); - -protected: - void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; - void initStyleOption(DStyleOptionButton *option) const; - -private: - D_DECLARE_PRIVATE(DSwitchButton) -}; - -DWIDGET_END_NAMESPACE - -#endif // DSWITCHBUTTON_H - diff -Nru dtkwidget-5.5.48/src/widgets/dswitchlineexpand.cpp dtkwidget-5.6.12/src/widgets/dswitchlineexpand.cpp --- dtkwidget-5.5.48/src/widgets/dswitchlineexpand.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dswitchlineexpand.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dswitchlineexpand.h" #include "dthememanager.h" diff -Nru dtkwidget-5.5.48/src/widgets/dswitchlineexpand.h dtkwidget-5.6.12/src/widgets/dswitchlineexpand.h --- dtkwidget-5.5.48/src/widgets/dswitchlineexpand.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dswitchlineexpand.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DSWITCHLINEEXPAND_H -#define DSWITCHLINEEXPAND_H - -#include - -#include -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DSwitchHeaderLine : public DHeaderLine -{ - Q_OBJECT -public: - DSwitchHeaderLine(QWidget *parent = 0); - void setExpand(bool value); - -Q_SIGNALS: - void checkedChanged(bool arg); - -protected: - void mousePressEvent(QMouseEvent *); - -private: - void reverseArrowDirection(); - DSwitchButton *m_switchButton = NULL; - -}; - -class LIBDTKWIDGETSHARED_EXPORT DSwitchLineExpand : public DBaseExpand -{ - Q_OBJECT -public: - explicit DSwitchLineExpand(QWidget *parent = 0); - void setTitle(const QString &title); - void setExpand(bool value); - - DBaseLine *header(); - -private: - void setHeader(QWidget *header); - void resizeEvent(QResizeEvent *e); - -private: - DSwitchHeaderLine *m_headerLine = NULL; -}; - -DWIDGET_END_NAMESPACE - -#endif // DSWITCHLINEEXPAND_H diff -Nru dtkwidget-5.5.48/src/widgets/DTabBar dtkwidget-5.6.12/src/widgets/DTabBar --- dtkwidget-5.5.48/src/widgets/DTabBar 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTabBar 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dtabbar.h" diff -Nru dtkwidget-5.5.48/src/widgets/dtabbar.cpp dtkwidget-5.6.12/src/widgets/dtabbar.cpp --- dtkwidget-5.5.48/src/widgets/dtabbar.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtabbar.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dtabbar.h" #include "dobject_p.h" @@ -31,6 +15,8 @@ #include #include #include +#include + #include #include @@ -625,6 +611,10 @@ drag->setPixmap(grabImage); drag->setMimeData(mime_data); + + if (window()->windowHandle() && window()->windowHandle()->screen()) + hotspot = QHighDpiScaling::mapPositionFromNative(hotspot, window()->windowHandle()->screen()->handle()); + drag->setHotSpot(hotspot); qRegisterMetaType(); diff -Nru dtkwidget-5.5.48/src/widgets/dtabbar.h dtkwidget-5.6.12/src/widgets/dtabbar.h --- dtkwidget-5.5.48/src/widgets/dtabbar.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtabbar.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,220 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ -#ifndef DTABBAR_H -#define DTABBAR_H - -#include - -#include -#include - -QT_BEGIN_NAMESPACE -class QMimeData; -QT_END_NAMESPACE - -DCORE_USE_NAMESPACE -DWIDGET_BEGIN_NAMESPACE - -class DTabBarPrivate; -class DTabBar : public QWidget, public DObject -{ - Q_OBJECT - - Q_PROPERTY(bool visibleAddButton READ visibleAddButton WRITE setVisibleAddButton) - Q_PROPERTY(QTabBar::Shape shape READ shape WRITE setShape) - Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged) - Q_PROPERTY(int count READ count) - Q_PROPERTY(bool drawBase READ drawBase WRITE setDrawBase) - Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) - Q_PROPERTY(Qt::TextElideMode elideMode READ elideMode WRITE setElideMode) - Q_PROPERTY(bool usesScrollButtons READ usesScrollButtons WRITE setUsesScrollButtons) - Q_PROPERTY(bool tabsClosable READ tabsClosable WRITE setTabsClosable) - Q_PROPERTY(QTabBar::SelectionBehavior selectionBehaviorOnRemove READ selectionBehaviorOnRemove WRITE setSelectionBehaviorOnRemove) - Q_PROPERTY(bool expanding READ expanding WRITE setExpanding) - Q_PROPERTY(bool movable READ isMovable WRITE setMovable) - Q_PROPERTY(bool dragable READ isDragable WRITE setDragable) - Q_PROPERTY(bool documentMode READ documentMode WRITE setDocumentMode) - Q_PROPERTY(bool autoHide READ autoHide WRITE setAutoHide) - Q_PROPERTY(bool changeCurrentOnDrag READ changeCurrentOnDrag WRITE setChangeCurrentOnDrag) - Q_PROPERTY(int startDragDistance READ startDragDistance WRITE setStartDragDistance) - // on drag enter - Q_PROPERTY(QColor maskColor READ maskColor WRITE setMaskColor) - // on inserted tab from mime data - Q_PROPERTY(QColor flashColor READ flashColor WRITE setFlashColor) - -public: - explicit DTabBar(QWidget *parent = 0); - - void setTabMinimumSize(int index, const QSize &size); - void setTabMaximumSize(int index, const QSize &size); - - bool visibleAddButton() const; - - QTabBar::Shape shape() const; - void setShape(QTabBar::Shape shape); - - int addTab(const QString &text); - int addTab(const QIcon &icon, const QString &text); - - int insertTab(int index, const QString &text); - int insertTab(int index, const QIcon&icon, const QString &text); - - void removeTab(int index); - void moveTab(int from, int to); - - bool isTabEnabled(int index) const; - void setTabEnabled(int index, bool); - - QString tabText(int index) const; - void setTabText(int index, const QString &text); - - QIcon tabIcon(int index) const; - void setTabIcon(int index, const QIcon &icon); - - Qt::TextElideMode elideMode() const; - void setElideMode(Qt::TextElideMode mode); - -#ifndef QT_NO_TOOLTIP - void setTabToolTip(int index, const QString &tip); - QString tabToolTip(int index) const; -#endif - -#ifndef QT_NO_WHATSTHIS - void setTabWhatsThis(int index, const QString &text); - QString tabWhatsThis(int index) const; -#endif - - void setTabData(int index, const QVariant &data); - QVariant tabData(int index) const; - - QRect tabRect(int index) const; - int tabAt(const QPoint &pos) const; - - int currentIndex() const; - int count() const; - - void setDrawBase(bool drawTheBase); - bool drawBase() const; - - QSize iconSize() const; - void setIconSize(const QSize &size); - - bool usesScrollButtons() const; - void setUsesScrollButtons(bool useButtons); - - bool tabsClosable() const; - void setTabsClosable(bool closable); - - void setTabButton(int index, QTabBar::ButtonPosition position, QWidget *widget); - QWidget *tabButton(int index, QTabBar::ButtonPosition position) const; - - QTabBar::SelectionBehavior selectionBehaviorOnRemove() const; - void setSelectionBehaviorOnRemove(QTabBar::SelectionBehavior behavior); - - bool expanding() const; - void setExpanding(bool enabled); - - bool isMovable() const; - void setMovable(bool movable); - - bool isDragable() const; - void setDragable(bool dragable); - - bool documentMode() const; - void setDocumentMode(bool set); - - bool autoHide() const; - void setAutoHide(bool hide); - - bool changeCurrentOnDrag() const; - void setChangeCurrentOnDrag(bool change); - - int startDragDistance() const; - - QColor maskColor() const; - QColor flashColor() const; - - QWindow *dragIconWindow() const; - - void setEnabledEmbedStyle(bool enable); - - void setTabLabelAlignment(Qt::Alignment alignment); - -Q_SIGNALS: - void currentChanged(int index); - void tabCloseRequested(int index); - void tabMoved(int from, int to); - void tabIsInserted(int index); - void tabIsRemoved(int index); - void tabBarClicked(int index); - void tabBarDoubleClicked(int index); - void tabAddRequested(); - void tabReleaseRequested(int index); - void tabDroped(int index, Qt::DropAction action, QObject *target); - void dragActionChanged(Qt::DropAction action); - void dragStarted(); - void dragEnd(Qt::DropAction action); - -public Q_SLOTS: - void setCurrentIndex(int index); - void setVisibleAddButton(bool visibleAddButton); - void setStartDragDistance(int startDragDistance); - - void setMaskColor(QColor maskColor); - void setFlashColor(QColor flashColor); - - void startDrag(int index); - void stopDrag(Qt::DropAction action); - -protected: - void dragEnterEvent(QDragEnterEvent *e) override; - void dragLeaveEvent(QDragLeaveEvent *e) override; - void dragMoveEvent(QDragMoveEvent *e) override; - void dropEvent(QDropEvent *e) override; - void resizeEvent(QResizeEvent *e) override; - - void startTabFlash(int index); - - virtual void paintTab(QPainter *painter, int index, const QStyleOptionTab &option) const; - - virtual QPixmap createDragPixmapFromTab(int index, const QStyleOptionTab &option, QPoint *hotspot) const; - virtual QMimeData *createMimeDataFromTab(int index, const QStyleOptionTab &option) const; - virtual bool canInsertFromMimeData(int index, const QMimeData *source) const; - virtual void insertFromMimeData(int index, const QMimeData *source); - virtual void insertFromMimeDataOnDragEnter(int index, const QMimeData *source); - - virtual void tabInserted(int index); - virtual void tabLayoutChange(); - virtual void tabRemoved(int index); - - virtual QSize tabSizeHint(int index) const; - virtual QSize minimumTabSizeHint(int index) const; - virtual QSize maximumTabSizeHint(int index) const; - -private: - DTabBarPrivate* d_func(); - const DTabBarPrivate* d_func() const; - friend class DTabBarPrivate; -}; - -DWIDGET_END_NAMESPACE - -#endif // DTABBAR_H diff -Nru dtkwidget-5.5.48/src/widgets/DTabletWindowOptionButton dtkwidget-5.6.12/src/widgets/DTabletWindowOptionButton --- dtkwidget-5.5.48/src/widgets/DTabletWindowOptionButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTabletWindowOptionButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dtabletwindowoptionbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dtabletwindowoptionbutton.cpp dtkwidget-5.6.12/src/widgets/dtabletwindowoptionbutton.cpp --- dtkwidget-5.5.48/src/widgets/dtabletwindowoptionbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtabletwindowoptionbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2020 ~ 2021 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dtabletwindowoptionbutton.h" #include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/src/widgets/dtabletwindowoptionbutton.h dtkwidget-5.6.12/src/widgets/dtabletwindowoptionbutton.h --- dtkwidget-5.5.48/src/widgets/dtabletwindowoptionbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtabletwindowoptionbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2020 ~ 2021 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DTABLETWINDOWOPTIONBUTTON_H -#define DTABLETWINDOWOPTIONBUTTON_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DTabletWindowOptionButton : public DIconButton -{ - Q_OBJECT -public: - DTabletWindowOptionButton(QWidget *parent = 0); - - QSize sizeHint() const override; - -protected: - void initStyleOption(DStyleOptionButton *option) const override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DTABLETWINDOWOPTIONBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/DTableView dtkwidget-5.6.12/src/widgets/DTableView --- dtkwidget-5.5.48/src/widgets/DTableView 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTableView 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DTableWidget dtkwidget-5.6.12/src/widgets/DTableWidget --- dtkwidget-5.5.48/src/widgets/DTableWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTableWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DTabWidget dtkwidget-5.6.12/src/widgets/DTabWidget --- dtkwidget-5.5.48/src/widgets/DTabWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTabWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DTextBrowser dtkwidget-5.6.12/src/widgets/DTextBrowser --- dtkwidget-5.5.48/src/widgets/DTextBrowser 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTextBrowser 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DTextEdit dtkwidget-5.6.12/src/widgets/DTextEdit --- dtkwidget-5.5.48/src/widgets/DTextEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTextEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dtextedit.h" diff -Nru dtkwidget-5.5.48/src/widgets/dtextedit.cpp dtkwidget-5.6.12/src/widgets/dtextedit.cpp --- dtkwidget-5.5.48/src/widgets/dtextedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtextedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dtextedit.h" #include @@ -135,6 +139,16 @@ void DTextEdit::contextMenuEvent(QContextMenuEvent *e) { + auto msg = QDBusMessage::createMethodCall("com.iflytek.aiassistant", "/", + "org.freedesktop.DBus.Peer", "Ping"); + // 用之前 Ping 一下, 300ms 内没回复就认定是服务出问题,不再添加助手菜单项 + auto pingReply = QDBusConnection::sessionBus().call(msg, QDBus::Block, 300); + auto errorType = QDBusConnection::sessionBus().lastError().type(); + if (errorType == QDBusError::Timeout || errorType == QDBusError::NoReply) { + qWarning() << pingReply << "\nwill not add aiassistant actions!"; + return QTextEdit::contextMenuEvent(e); + } + QDBusInterface testSpeech("com.iflytek.aiassistant", "/aiassistant/tts", "com.iflytek.aiassistant.tts", diff -Nru dtkwidget-5.5.48/src/widgets/dtextedit.h dtkwidget-5.6.12/src/widgets/dtextedit.h --- dtkwidget-5.5.48/src/widgets/dtextedit.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtextedit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -#ifndef DTEXTEDIT_H -#define DTEXTEDIT_H - -#include - -#include -#include - -QT_BEGIN_NAMESPACE -class QContextMenuEvent; -QT_END_NAMESPACE - -DWIDGET_BEGIN_NAMESPACE -class DTextEditPrivate; -class DTextEdit : public QTextEdit, public DCORE_NAMESPACE::DObject -{ -public: - explicit DTextEdit(QWidget *parent = nullptr); - explicit DTextEdit(const QString& text, QWidget* parent = nullptr); - -public: - bool speechToTextIsEnabled() const; - void setSpeechToTextEnabled(bool enable); - - bool textToSpeechIsEnabled() const; - void setTextToSpeechEnabled(bool enable); - - bool textToTranslateIsEnabled() const; - void setTextToTranslateEnabled(bool enable); - -protected: - bool event(QEvent *e) override; - void contextMenuEvent(QContextMenuEvent *e) override; - virtual void keyPressEvent(QKeyEvent *e) override; - -private: - D_DECLARE_PRIVATE(DTextEdit) -}; - -DWIDGET_END_NAMESPACE - -#endif // DTEXTEDIT_H diff -Nru dtkwidget-5.5.48/src/widgets/DThemeManager dtkwidget-5.6.12/src/widgets/DThemeManager --- dtkwidget-5.5.48/src/widgets/DThemeManager 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DThemeManager 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dthememanager.h" diff -Nru dtkwidget-5.5.48/src/widgets/dthememanager.cpp dtkwidget-5.6.12/src/widgets/dthememanager.cpp --- dtkwidget-5.5.48/src/widgets/dthememanager.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dthememanager.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/src/widgets/dthememanager.h dtkwidget-5.6.12/src/widgets/dthememanager.h --- dtkwidget-5.5.48/src/widgets/dthememanager.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dthememanager.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DTHEMEMANAGER_H -#define DTHEMEMANAGER_H - -#include -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DThemeManagerPrivate; -class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED DThemeManager : public QObject, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - -public: - static DThemeManager *instance(); - - QString theme() const; - QString theme(const QWidget *widget, QWidget **baseWidget = nullptr) const; - void setTheme(const QString theme); - void setTheme(QWidget *widget, const QString theme); - - QString getQssForWidget(const QString className, const QString &theme = QString()) const; - QString getQssForWidget(const QWidget *widget) const; - - static void registerWidget(QWidget *widget, QStringList properties = QStringList()); - // TODO: use blow instead, the only thing should do is rebuilding - // static void registerWidget(QWidget *widget, const QStringList &properties = QStringList()); - static void registerWidget(QWidget *widget, const QString &filename, const QStringList &properties = QStringList()); - -public Q_SLOTS: - void updateQss(); - void updateThemeOnParentChanged(QWidget *widget); - -Q_SIGNALS: - void themeChanged(QString theme); - void widgetThemeChanged(QWidget *widget, QString theme); - -protected: - DThemeManager(); - bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; - -private: - friend class DApplication; - D_DECLARE_PRIVATE(DThemeManager) -}; - -DWIDGET_END_NAMESPACE - -#endif // DTHEMEMANAGER_H diff -Nru dtkwidget-5.5.48/src/widgets/dtickeffect.cpp dtkwidget-5.6.12/src/widgets/dtickeffect.cpp --- dtkwidget-5.5.48/src/widgets/dtickeffect.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtickeffect.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dtickeffect.h" #include "private/dtickeffect_p.h" diff -Nru dtkwidget-5.5.48/src/widgets/dtickeffect.h dtkwidget-5.6.12/src/widgets/dtickeffect.h --- dtkwidget-5.5.48/src/widgets/dtickeffect.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtickeffect.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DTICKEFFECT_H -#define DTICKEFFECT_H - -#include -#include - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DTickEffectPrivate; -class LIBDTKWIDGETSHARED_EXPORT DTickEffect : public QGraphicsEffect, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT -public: - explicit DTickEffect(QWidget *widget, QWidget *parent = 0); - - enum Direction{ - LeftToRight, - RightToLeft, - TopToBottom, - BottomToTop - }; - - void play(); - void stop(); - void pause(); - void resume(); - - void setDirection(Direction direction); - void setFixedPixelMove(const int pixel); - -Q_SIGNALS: - void finished(); - void stateChanged(); - -protected: - void draw(QPainter *painter) Q_DECL_OVERRIDE; - bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; - -private: - D_DECLARE_PRIVATE(DTickEffect) -}; - -DWIDGET_END_NAMESPACE - -#endif // DTICKEFFECT_H diff -Nru dtkwidget-5.5.48/src/widgets/DTileRules dtkwidget-5.6.12/src/widgets/DTileRules --- dtkwidget-5.5.48/src/widgets/DTileRules 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTileRules 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DTimeEdit dtkwidget-5.6.12/src/widgets/DTimeEdit --- dtkwidget-5.5.48/src/widgets/DTimeEdit 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTimeEdit 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DTipLabel dtkwidget-5.6.12/src/widgets/DTipLabel --- dtkwidget-5.5.48/src/widgets/DTipLabel 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTipLabel 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dtiplabel.h" diff -Nru dtkwidget-5.5.48/src/widgets/dtiplabel.cpp dtkwidget-5.6.12/src/widgets/dtiplabel.cpp --- dtkwidget-5.5.48/src/widgets/dtiplabel.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtiplabel.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2011 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: wp - * - * Maintainer: wp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dtiplabel.h" #include "private/dtiplabel_p.h" diff -Nru dtkwidget-5.5.48/src/widgets/dtiplabel.h dtkwidget-5.6.12/src/widgets/dtiplabel.h --- dtkwidget-5.5.48/src/widgets/dtiplabel.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtiplabel.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: wp - * - * Maintainer: wp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DTIPLABEL_H -#define DTIPLABEL_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DTipLabelPrivate; -class LIBDTKWIDGETSHARED_EXPORT DTipLabel : public DLabel -{ - Q_OBJECT - Q_DISABLE_COPY(DTipLabel) - D_DECLARE_PRIVATE(DTipLabel) -public: - DTipLabel(const QString &text = QString(), QWidget *parent = nullptr); - ~DTipLabel(); - - using QLabel::show; - void show(const QPoint &pos); - void setForegroundRole(DPalette::ColorType color); - -protected: - void initPainter(QPainter *painter) const override; - void paintEvent(QPaintEvent *event) override; -}; -DWIDGET_END_NAMESPACE - -#endif // DTIPLABEL_H diff -Nru dtkwidget-5.5.48/src/widgets/DTitlebar dtkwidget-5.6.12/src/widgets/DTitlebar --- dtkwidget-5.5.48/src/widgets/DTitlebar 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTitlebar 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dtitlebar.h" diff -Nru dtkwidget-5.5.48/src/widgets/dtitlebar.cpp dtkwidget-5.6.12/src/widgets/dtitlebar.cpp --- dtkwidget-5.5.48/src/widgets/dtitlebar.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtitlebar.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,22 +1,10 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dtitlebar.h" +#include #include #include #include @@ -24,10 +12,12 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -45,21 +35,24 @@ #include "dapplication.h" #include "private/dapplication_p.h" #include "private/dsplitscreen_p.h" +#include "private/dmainwindow_p.h" #include "dmainwindow.h" #include "DHorizontalLine" #include "dimagebutton.h" #include "dblureffectwidget.h" #include "dwidgetstype.h" #include "dlabel.h" +#include "dsizemode.h" +#include "private/dtitlebarsettingsimpl.h" +#include "dtitlebarsettings.h" DWIDGET_BEGIN_NAMESPACE #define CHANGESPLITWINDOW_VAR "_d_splitWindowOnScreen" #define GETSUPPORTSPLITWINDOW_VAR "_d_supportForSplittingWindow" -const int DefaultTitlebarHeight = 50; -const int DefaultIconHeight = 32; -const int DefaultIconWidth = 32; +static inline int DefaultIconHeight() { return DSizeModeHelper::element(24, 32); } +static inline int DefaultExpandButtonHeight() { return DSizeModeHelper::element(30, 48); } class DTitlebarPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate { @@ -90,6 +83,7 @@ void _q_addDefaultMenuItems(); void _q_helpActionTriggered(); void _q_feedbackActionTriggerd(); + void _q_toolBarActionTriggerd(); void _q_aboutActionTriggered(); void _q_quitActionTriggered(); void _q_switchThemeActionTriggered(QAction*action); @@ -99,9 +93,31 @@ void updateTabOrder(); void showSplitScreenWidget(); void hideSplitScreenWidget(); - /*SplitLeft: 1; SplitRight: 2; SplitFullScreen: 15*/ - void changeWindowSplitedState(quint32 type); - bool supportSplitScreenByWM(); + void updateTitleBarSize() + { + if (optionButton) + optionButton->setIconSize(QSize(titlebarHeight, titlebarHeight)); + if (minButton) + minButton->setIconSize(QSize(titlebarHeight, titlebarHeight)); + if (maxButton) + maxButton->setIconSize(QSize(titlebarHeight, titlebarHeight)); + if (closeButton) + closeButton->setIconSize(QSize(titlebarHeight, titlebarHeight)); + if (quitFullButton) + quitFullButton->setIconSize(QSize(titlebarHeight, titlebarHeight)); + if (expandButton) + expandButton->setIconSize(QSize(DefaultExpandButtonHeight(), DefaultExpandButtonHeight())); + if (iconLabel) + iconLabel->setIconSize(QSize(DefaultIconHeight(), DefaultIconHeight())); + + D_Q(DTitlebar); + q->setFixedHeight(titlebarHeight); + q->setMinimumHeight(titlebarHeight); + } + + void setFixedButtonsEnabled(bool isEnabled); + + void updateTitlebarHeight(); QHBoxLayout *mainLayout; QWidget *leftArea; @@ -124,12 +140,18 @@ DHorizontalLine *separator; DBlurEffectWidget *blurWidget = nullptr; - QPointer splitWidget = nullptr; + QPointer splitWidget = nullptr; + DSidebarHelper *sidebarHelper = nullptr; + DIconButton *expandButton = nullptr; + + int titlebarHeight = 50; + DConfig *uiPreferDonfig = nullptr; #ifndef QT_NO_MENU QMenu *menu = Q_NULLPTR; QAction *helpAction = Q_NULLPTR; QAction *feedbackAction = Q_NULLPTR; + QAction *toolbarAction = Q_NULLPTR; QAction *aboutAction = Q_NULLPTR; QAction *quitAction = Q_NULLPTR; bool canSwitchTheme = true; @@ -149,214 +171,12 @@ bool fullScreenButtonVisible = true; bool splitScreenWidgetEnable = true; QTimer *maxButtonPressAndHoldTimer = nullptr; + QWidget *sidebarBackgroundWidget = nullptr; + DTitlebarSettingsImpl *titlebarSettingsImpl = nullptr; + DTitlebarSettings *titlebarSettings = nullptr; Q_DECLARE_PUBLIC(DTitlebar) }; -DSplitScreenButton::DSplitScreenButton(DStyle::StandardPixmap sp, QWidget *parent) - : DIconButton(sp, parent) -{ - this->setIconSize(QSize(36, 36)); - - auto dpal = DPaletteHelper::instance()->palette(this); - dpal.setColor(DPalette::FrameBorder, Qt::transparent); - DPaletteHelper::instance()->setPalette(this, dpal); -} - -void DSplitScreenButton::initStyleOption(DStyleOptionButton *option) const -{ - DIconButton::initStyleOption(option); - - bool hover = (option->state & QStyle::State_MouseOver); - bool selected = (option->state & QStyle::State_Sunken); - - if (hover && !selected) { - // 调整背景色和图标调色板 - auto pal = option->palette; - auto dpal = DPaletteHelper::instance()->palette(this); - QColor backgroundBrush = dpal.itemBackground().color(); - QColor iconForeColor = Qt::white; - if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) { - backgroundBrush = DStyle::adjustColor(backgroundBrush, 0, 0, 0, 0, 0, 0, 3); - iconForeColor = dpal.brush(DPalette::TextTitle).color(); - } - - pal.setBrush(QPalette::Light, backgroundBrush); - pal.setBrush(QPalette::Dark, backgroundBrush); - pal.setBrush(QPalette::ButtonText, iconForeColor); - - option->palette = pal; - } else if (!hover && !selected) { - option->features |= (QStyleOptionButton::Flat | QStyleOptionButton::ButtonFeature(DStyleOptionButton::TitleBarButton)); - } -} - -DSplitScreenWidget::DSplitScreenWidget(FloatMode mode, QWidget *parent) - : DArrowRectangle(ArrowTop, mode, parent) - , floatMode(mode) -{ - this->init(); -} - -void DSplitScreenWidget::hide() -{ - if (!hideTimer.isActive()) - hideTimer.start(300, this); -} - -void DSplitScreenWidget::hideImmediately() -{ - close(); -} - -void DSplitScreenWidget::updateMaximizeButtonIcon(bool isMaximized) -{ - if (isMaximized) { - this->maximizeButton->setIcon(DStyle::SP_Title_SS_ShowNormalButton); - this->maximizeButton->setToolTip(qApp->translate("DSplitScreenWidget", "Unmaximize")); - } else { - this->maximizeButton->setIcon(DStyle::SP_Title_SS_ShowMaximizeButton); - this->maximizeButton->setToolTip(qApp->translate("DSplitScreenWidget", "Maximize")); - } -} - -void DSplitScreenWidget::setButtonsEnable(bool enable) -{ - this->maximizeButton->setEnabled(enable); - this->leftSplitButton->setEnabled(enable); - this->rightSplitButton->setEnabled(enable); -} - -void DSplitScreenWidget::onThemeTypeChanged(DGuiApplicationHelper::ColorType ct) -{ - if (ct == DGuiApplicationHelper::DarkType) { - this->setBackgroundColor(QColor(25, 25, 25, qRound(0.8 * 255))); - } else { - this->setBackgroundColor(this->palette().window().color()); - } -} - -void DSplitScreenWidget::init() -{ - this->setAttribute(Qt::WA_DeleteOnClose); - this->setWindowFlag(Qt::ToolTip); - this->setMargin(10); - this->setShadowXOffset(0); - this->setShadowYOffset(6); - this->setShadowBlurRadius(20); - this->setRadius(18); - this->setArrowWidth(50); - this->setArrowHeight(30); - this->setRadiusArrowStyleEnable(true); - this->setBorderColor(QColor(0, 0, 0, qRound(0.05 * 255))); - - contentWidget = new QWidget(this); - QHBoxLayout *contentLayout = new QHBoxLayout(contentWidget); - - this->leftSplitButton = new DSplitScreenButton(DStyle::SP_Title_SS_LeftButton, this); - this->rightSplitButton = new DSplitScreenButton(DStyle::SP_Title_SS_RightButton, this); - this->maximizeButton = new DSplitScreenButton(DStyle::SP_Title_SS_ShowNormalButton, this); - this->leftSplitButton->setToolTip(qApp->translate("DSplitScreenWidget", "Tile window to left of screen")); - this->rightSplitButton->setToolTip(qApp->translate("DSplitScreenWidget", "Tile window to right of screen")); - - contentLayout->setMargin(0); - contentLayout->setSpacing(10); - contentLayout->addWidget(this->leftSplitButton); - contentLayout->addWidget(this->rightSplitButton); - contentLayout->addWidget(this->maximizeButton); - - this->setContent(contentWidget); - onThemeTypeChanged(DGuiApplicationHelper::instance()->themeType()); - qApp->installEventFilter(this); - - disabledByScreenGeometryAndWindowSize({leftSplitButton, rightSplitButton}); - - QObject::connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &DSplitScreenWidget::onThemeTypeChanged); - QObject::connect(this->leftSplitButton, &DSplitScreenButton::clicked, this, &DSplitScreenWidget::leftSplitScreenButtonClicked); - QObject::connect(this->rightSplitButton, &DSplitScreenButton::clicked, this, &DSplitScreenWidget::rightSplitScreenButtonClicked); - QObject::connect(this->maximizeButton, &DSplitScreenButton::clicked, this, &DSplitScreenWidget::maximizeButtonClicked); -} - -void DSplitScreenWidget::disabledByScreenGeometryAndWindowSize(QWidgetList wList) -{ - QDesktopWidget *desktop = qApp->desktop(); - QWidget *window = this->window(); - - if (Q_LIKELY(desktop) && Q_LIKELY(window)) { - QRect screenRect = desktop->screenGeometry(window); - - // 窗口尺寸大于屏幕分辨率时 禁用控件 - if (screenRect.width() < window->minimumWidth() || screenRect.height() < window->minimumHeight()) - for (QWidget *w : wList) - w->setDisabled(true); - } -} - -bool DSplitScreenWidget::eventFilter(QObject *o, QEvent *e) -{ - switch (e->type()) { - case QEvent::Enter: - if (o == this) - hideTimer.stop(); - break; - - case QEvent::Leave: - if (o == this) - hide(); - break; - - case QEvent::Close: - if (!o->objectName().compare(QLatin1String("qtooltip_label"))) - break; - - Q_FALLTHROUGH(); - case QEvent::WindowActivate: - case QEvent::WindowDeactivate: - case QEvent::FocusIn: - case QEvent::FocusOut: - case QEvent::MouseButtonDblClick: - case QEvent::Wheel: - hideImmediately(); - break; - case QEvent::MouseButtonRelease: - if (!isMaxButtonPressAndHold) { - hideImmediately(); - } - break; - default: - break; - } - - return false; -} - -void DSplitScreenWidget::showEvent(QShowEvent *e) -{ - this->setContent(contentWidget); - DArrowRectangle::showEvent(e); - - QRect rect = this->rect(); - qreal delta = this->shadowBlurRadius(); - int arrowSpacing = (DArrowRectangle::FloatWidget == floatMode) ? this->arrowWidth() / 2 : this->arrowWidth(); - - if (DApplication::isDXcbPlatform()) - rect = rect.marginsRemoved(QMarginsF(delta, (DArrowRectangle::FloatWidget == floatMode) ? 0 : delta, - delta, delta - this->margin()).toMargins()); - else - rect = rect.marginsRemoved(QMarginsF(delta, 0, delta, (DArrowRectangle::FloatWidget == floatMode) - ? delta - this->margin() : delta * 2).toMargins()); - - - this->setArrowX(rect.width() / 2 + arrowSpacing); -} - -void DSplitScreenWidget::timerEvent(QTimerEvent *e) -{ - if (e->timerId() == hideTimer.timerId()) { - hideTimer.stop(); - hideImmediately(); - } -} - DTitlebarPrivate::DTitlebarPrivate(DTitlebar *qq) : DObjectPrivate(qq) , quitFullButton(nullptr) @@ -388,6 +208,13 @@ optionButton = new DWindowOptionButton; } + auto config = new DConfig("org.deepin.dtkwidget.feature-display", "", q); + bool isUpdated = config->value("featureUpdated", false).toBool(); + DStyle::setRedPointVisible(optionButton, isUpdated); + + uiPreferDonfig = new DConfig("org.deepin.dtk.ui.preference", "", q); + updateTitlebarHeight(); + separatorTop = new DHorizontalLine(q); separator = new DHorizontalLine(q); titleLabel = centerArea; @@ -399,21 +226,16 @@ optionButton->installEventFilter(q); optionButton->setObjectName("DTitlebarDWindowOptionButton"); - optionButton->setIconSize(QSize(DefaultTitlebarHeight, DefaultTitlebarHeight)); optionButton->setAccessibleName("DTitlebarDWindowOptionButton"); minButton->setObjectName("DTitlebarDWindowMinButton"); - minButton->setIconSize(QSize(DefaultTitlebarHeight, DefaultTitlebarHeight)); minButton->setAccessibleName("DTitlebarDWindowMinButton"); maxButton->setObjectName("DTitlebarDWindowMaxButton"); - maxButton->setIconSize(QSize(DefaultTitlebarHeight, DefaultTitlebarHeight)); maxButton->setAccessibleName("DTitlebarDWindowMaxButton"); maxButton->setAttribute(Qt::WA_AlwaysShowToolTips); closeButton->setObjectName("DTitlebarDWindowCloseButton"); closeButton->setAccessibleName("DTitlebarDWindowCloseButton"); - closeButton->setIconSize(QSize(DefaultTitlebarHeight, DefaultTitlebarHeight)); - iconLabel->setIconSize(QSize(DefaultIconWidth, DefaultIconHeight)); iconLabel->setWindowFlags(Qt::WindowTransparentForInput); iconLabel->setAttribute( Qt::WA_TransparentForMouseEvents, true); iconLabel->setFocusPolicy(Qt::NoFocus); @@ -450,7 +272,6 @@ quitFullButton->installEventFilter(q); quitFullButton->setObjectName("DTitlebarDWindowQuitFullscreenButton"); quitFullButton->setAccessibleName("DTitlebarDWindowQuitFullscreenButton"); - quitFullButton->setIconSize(QSize(DefaultTitlebarHeight, DefaultTitlebarHeight)); quitFullButton->hide(); buttonLayout->addWidget(quitFullButton); } @@ -482,8 +303,6 @@ mainLayout->addWidget(rightArea, 0, Qt::AlignRight); q->setLayout(mainLayout); - q->setFixedHeight(DefaultTitlebarHeight); - q->setMinimumHeight(DefaultTitlebarHeight); if (!DGuiApplicationHelper::isTabletEnvironment()) { q->connect(quitFullButton, &DWindowQuitFullButton::clicked, q, [ = ]() { @@ -506,6 +325,22 @@ if (splitWidget && splitWidget->isVisible()) splitWidget->isMaxButtonPressAndHold = true; }); + if (isUpdated) { + q->connect(config, &DConfig::valueChanged, q, [config, this](const QString &key){ + if (key == "featureUpdated") { + auto result = config->value("featureUpdated", false); + DStyle::setRedPointVisible(optionButton, result.toBool()); + optionButton->update(); + config->deleteLater(); + } + }); + } + q->connect(uiPreferDonfig, &DConfig::valueChanged, q, [this](const QString &key){ + if (key == "titlebarHeight") { + updateTitlebarHeight(); + updateTitleBarSize(); + } + }); // 默认需要构造一个空的选项菜单 q->setMenu(new QMenu(q)); @@ -524,6 +359,8 @@ }; // fix wayland 下显示了两个应用图标,系统标题栏 和 dtk标题栏 均显示应用图标 q->setEmbedMode(!(DApplication::isDXcbPlatform()|| noTitlebarEnabled())); + + updateTitleBarSize(); } QWidget *DTitlebarPrivate::targetWindow() @@ -727,9 +564,6 @@ && (maxButton->isVisible())) { parentWindow->showMaximized(); } - - if (splitWidget) - splitWidget->updateMaximizeButtonIcon(parentWindow->isMaximized()); } void DTitlebarPrivate::_q_showMinimized() @@ -812,6 +646,7 @@ group->addAction(lightThemeAction); group->addAction(darkThemeAction); + QObject::connect(group, SIGNAL(triggered(QAction*)), q, SLOT(_q_switchThemeActionTriggered(QAction*))); @@ -826,6 +661,10 @@ // add help menu item. if (!helpAction) { + // init DGuiApplicationHelperPrivate::hasManual + static std::once_flag onceFlag; + std::call_once(onceFlag, DApplicationPrivate::isUserManualExists); + helpAction = new QAction(qApp->translate("TitleBarMenu", "Help"), menu); QObject::connect(helpAction, SIGNAL(triggered(bool)), q, SLOT(_q_helpActionTriggered())); menu->addAction(helpAction); @@ -839,6 +678,14 @@ menu->addAction(feedbackAction); } + // add toolbarAction menu item for deepin or uos application + if (titlebarSettingsImpl && titlebarSettingsImpl->isValid() && !toolbarAction) { + toolbarAction = new QAction(qApp->translate("TitleBarMenu", "Custom toolbar"), menu); + toolbarAction->setObjectName("TitlebarSettings"); + QObject::connect(toolbarAction, SIGNAL(triggered(bool)), q, SLOT(_q_toolBarActionTriggerd())); + menu->addAction(toolbarAction); + } + // add about menu item. if (!aboutAction) { aboutAction = new QAction(qApp->translate("TitleBarMenu", "About"), menu); @@ -868,6 +715,25 @@ QProcess::startDetached("deepin-feedback", { qApp->applicationName() }); } +void DTitlebarPrivate::_q_toolBarActionTriggerd() +{ + D_Q(DTitlebar); + + auto toolBarEditPanel = titlebarSettingsImpl->toolsEditPanel(); + if (toolBarEditPanel->minimumWidth() >= q->width()) { + toolBarEditPanel->setParent(nullptr); + int x = q->mapToGlobal(q->pos()).x() - (toolBarEditPanel->width()- q->width()) / 2 ; + toolBarEditPanel->move(x, q->mapToGlobal(q->pos()).y() + q->height()); + } else { + toolBarEditPanel->setParent(q->parentWidget()); + toolBarEditPanel->move(0, q->height()); + toolBarEditPanel->resize(q->width(), q->parentWidget()->height() * 70 / 100); + } + toolBarEditPanel->installEventFilter(q); + + titlebarSettingsImpl->showEditPanel(); +} + void DTitlebarPrivate::_q_aboutActionTriggered() { DApplication *dapp = qobject_cast(qApp); @@ -964,26 +830,16 @@ } // 窗管不支持分屏时,不显示分屏菜单 - if (!Q_LIKELY(supportSplitScreenByWM())) + if (!Q_LIKELY(DSplitScreenWidget::supportSplitScreenByWM(q->window()))) return; if (!splitWidget) { - splitWidget = new DSplitScreenWidget(DSplitScreenWidget::FloatWidget, q->window()); - - QObject::connect(splitWidget, &DSplitScreenWidget::maximizeButtonClicked, q, - std::bind(&DTitlebarPrivate::changeWindowSplitedState, this, DSplitScreenWidget::SplitFullScreen)); - QObject::connect(splitWidget, &DSplitScreenWidget::leftSplitScreenButtonClicked, q, - std::bind(&DTitlebarPrivate::changeWindowSplitedState, this, DSplitScreenWidget::SplitLeftHalf)); - QObject::connect(splitWidget, &DSplitScreenWidget::rightSplitScreenButtonClicked, q, - std::bind(&DTitlebarPrivate::changeWindowSplitedState, this, DSplitScreenWidget::SplitRightHalf)); + splitWidget = new DSplitScreenWidget(q->window()); } if (splitWidget->isVisible()) return; - if (auto window = targetWindow()) - splitWidget->updateMaximizeButtonIcon(window->isMaximized()); - auto centerPos = maxButton->mapToGlobal(maxButton->rect().center()); auto bottomPos = maxButton->mapToGlobal(maxButton->rect().bottomLeft()); @@ -995,11 +851,9 @@ } if (bottomPos.y() + splitWidget->height() > rect.height()) { - splitWidget->setArrowDirection(DArrowRectangle::ArrowBottom); - splitWidget->show(centerPos.x() - splitWidget->arrowWidth() / 2, bottomPos.y() - maxButton->rect().height()); + splitWidget->show(QPoint(centerPos.x() - splitWidget->width() / 2, bottomPos.y() - maxButton->rect().height() - splitWidget->height())); } else { - splitWidget->setArrowDirection(DArrowRectangle::ArrowTop); - splitWidget->show(centerPos.x() - splitWidget->arrowWidth() / 2, bottomPos.y()); + splitWidget->show(QPoint(centerPos.x() - splitWidget->width() / 2, bottomPos.y())); } } @@ -1014,72 +868,37 @@ splitWidget->hide(); } -void DTitlebarPrivate::changeWindowSplitedState(quint32 type) -{ - if (splitWidget && splitWidget->isVisible()) { - splitWidget->isMaxButtonPressAndHold = false; - splitWidget->hideImmediately(); - } - D_Q(DTitlebar); - QFunctionPointer splitWindowOnScreen = Q_NULLPTR; - - //### 目前接口尚不公开在 dtkgui 中,等待获取后续接口稳定再做移植 - splitWindowOnScreen = qApp->platformFunction(CHANGESPLITWINDOW_VAR); - - const QWindow *windowHandle = nullptr; - const QWidget *window = q->window(); - - if (window) - windowHandle = window->windowHandle(); +#endif - if (splitWindowOnScreen && windowHandle && windowHandle->handle()) - reinterpret_cast(splitWindowOnScreen)(windowHandle->handle()->winId(), type); +void DTitlebarPrivate::setFixedButtonsEnabled(bool isEnabled) +{ + maxButton->setEnabled(isEnabled); + minButton->setEnabled(isEnabled); + closeButton->setEnabled(isEnabled); + optionButton->setEnabled(isEnabled); } -bool DTitlebarPrivate::supportSplitScreenByWM() +void DTitlebarPrivate::updateTitlebarHeight() { - //### 目前接口尚不公开在 dtkgui 中,等待获取后续接口稳定再做移植 - D_Q(DTitlebar); - QFunctionPointer getSupportSplitWindow = Q_NULLPTR; - bool supported = false; - - getSupportSplitWindow = qApp->platformFunction(GETSUPPORTSPLITWINDOW_VAR); - - const QWindow *windowHandle = nullptr; - const QWidget *window = q->window(); - - if (window) - windowHandle = window->windowHandle(); - - if (getSupportSplitWindow && windowHandle && windowHandle->handle()) - supported = reinterpret_cast(getSupportSplitWindow)(windowHandle->handle()->winId()); - - return supported; + titlebarHeight = uiPreferDonfig->value("titlebarHeight").toInt(); + // 配置项默认值是-1,从配置读取进来的值超出0-100的范围,通过模式获取值,否则使用获取的配置值 + if (titlebarHeight <= 0 || titlebarHeight > 100) + titlebarHeight = DSizeModeHelper::element(40, 50); } -#endif - /*! + @~english \class Dtk::Widget::DTitlebar \inmodule dtkwidget - - \brief The DTitlebar class is an universal title bar on the top of windows. - \brief Dtitlebar是Dtk程序通用的标题栏组件,用于实现标题栏的高度定制化. - - \a parent is the parent widget to be attached on. - \a 父组件,一般为标题栏所在的窗口 - - Usually you don't need to construct a DTitlebar instance by your self, you + \brief The DTitlebar class is an universal title bar on the top of windows.Usually you don't need to construct a DTitlebar instance by your self, you can get an DTitlebar instance by DMainWindow::titlebar . - 一般情况下,请使用Dtk::Widget::DMainWindow::titlebar()来获取已经自动初始化的标题栏, - 不要自己来创建这个标题栏。 + \param[in] parent is the parent widget to be attached on. */ /*! + @~english \brief This function provides to create an default widget with icon/title/ and buttons - \brief 创建一个DTitlebar对象,包含默认的窗口按钮. - - \a parent 父控件指针 + \param[in] parent 父控件指针 */ DTitlebar::DTitlebar(QWidget *parent) : QFrame(parent), @@ -1100,11 +919,8 @@ #ifndef QT_NO_MENU /*! + @~english \brief DTitlebar::menu holds the QMenu object attached to this title bar. - \brief 获取和标题栏关联的应用查询菜单. - - \return 如该标题栏没有设置菜单,这里会返回空,但是如该使用 Dtk::Widget::DApplication , - 那么这里一般会自动创建一个程序菜单。 \return the QMenu object it holds, returns null if there's no one set. */ QMenu *DTitlebar::menu() const @@ -1115,11 +931,9 @@ } /*! + @~english \brief DTitlebar::setMenu attaches a QMenu object to the title bar. - \brief 设置自定义的程序菜单. - - \a menu is the target menu. - \a menu 需要被设置的菜单 + \param[in] menu is the target menu. */ void DTitlebar::setMenu(QMenu *menu) { @@ -1145,16 +959,10 @@ #endif /*! - \brief DTitlebar::customWidget - \brief 标题栏绑定的自定义控件 - + @~english + \brief DTitlebar::customWidget, One can set customized widget to show some extra widgets on the title bar. \return the customized widget used in this title bar. - \return 自定义控件 - - One can set customized widget to show some extra widgets on the title bar. - 可以通过自定义控件来在标题栏上显示复杂的组合控件 - - \sa Dtk::Widget::DTitlebar::setCustomWidget() + \param[in] Dtk::Widget::DTitlebar::setCustomWidget() */ QWidget *DTitlebar::customWidget() const { @@ -1165,19 +973,15 @@ #ifndef QT_NO_MENU /*! + @~english \brief DTitlebar::showMenu pop the menu of application on titlebar. - \brief 弹出应用程序菜单 */ void DTitlebar::showMenu() { D_D(DTitlebar); -#ifndef QT_NO_MENU - // 默认菜单应该是showmenu之前添加, 而非showevent - d->_q_addDefaultMenuItems(); -#endif - if (d->helpAction) - d->helpAction->setVisible(DApplicationPrivate::isUserManualExists()); + if (d->helpAction) + d->helpAction->setVisible(DApplicationPrivate::isUserManualExists()); if (d->menu) { // 更新主题选中的项 @@ -1199,6 +1003,10 @@ action->setChecked(true); } + DConfig config("org.deepin.dtkwidget.feature-display"); + bool isUpdated = config.value("featureUpdated", false).toBool(); + DStyle::setRedPointVisible(d->aboutAction, isUpdated); + d->menu->exec(d->optionButton->mapToGlobal(d->optionButton->rect().bottomLeft())); d->optionButton->update(); // FIX: bug-25253 sometimes optionButton not udpate after menu exec(but why?) } @@ -1219,7 +1027,13 @@ d->separatorTop->setFixedWidth(width()); d->separatorTop->move(0, 0); d->separator->setFixedWidth(width()); - d->separator->move(0, height() - d->separator->height()); + int x = (d->sidebarHelper && d->sidebarHelper->expanded()) ? d->sidebarHelper->width() : 0; + d->separator->move(x, height() - d->separator->height()); + +#ifndef QT_NO_MENU + // 默认菜单需要在showevent添加,否则`menu`接口返回空actions,导致接口逻辑不兼容 + d->_q_addDefaultMenuItems(); +#endif QWidget::showEvent(event); @@ -1323,6 +1137,13 @@ } } + if (d->titlebarSettings && d->titlebarSettingsImpl->hasEditPanel() && obj == d->titlebarSettingsImpl->toolsEditPanel()) { + if (event->type() == QEvent::Show) { + d->setFixedButtonsEnabled(false); + } else if ((event->type() == QEvent::Close)) { + d->setFixedButtonsEnabled(true); + } + } return QWidget::eventFilter(obj, event); } @@ -1341,6 +1162,10 @@ // 还需要 Tab 切换焦点时不不会出现再自己身上减少一次按 Tab 键 fix bug-65703 fe->reason() == Qt::TabFocusReason ? focusNextChild() : focusPreviousChild(); } + } else if (e->type() == QEvent::StyleChange) { + D_D(DTitlebar); + d->updateTitlebarHeight(); + d->updateTitleBarSize(); } return QFrame::event(e); @@ -1353,26 +1178,41 @@ d->separatorTop->setFixedWidth(event->size().width()); d->separator->setFixedWidth(event->size().width()); + int x = (d->sidebarHelper && d->sidebarHelper->expanded()) ? d->sidebarHelper->width() : 0; + d->separator->move(x, height() - d->separator->height()); d->updateCenterArea(); if (d->blurWidget) { d->blurWidget->resize(event->size()); } + if (d->sidebarBackgroundWidget) + d->sidebarBackgroundWidget->setFixedHeight(event->size().height()); + + if (d->titlebarSettingsImpl && d->titlebarSettingsImpl->hasEditPanel() && d->titlebarSettingsImpl->toolsEditPanel()->isVisible()) { + if (d->titlebarSettingsImpl->toolsEditPanel()->minimumWidth() >= this->width()) { + d->titlebarSettingsImpl->toolsEditPanel()->setWindowFlag(Qt::Dialog); + d->titlebarSettingsImpl->toolsEditPanel()->show(); + int x = this->mapToGlobal(this->pos()).x() - (d->titlebarSettingsImpl->toolsEditPanel()->width()- this->width()) / 2 ; + d->titlebarSettingsImpl->toolsEditPanel()->move(x, this->mapToGlobal(this->pos()).y() + this->height()); + } else { + d->titlebarSettingsImpl->toolsEditPanel()->setWindowFlag(Qt::Dialog, false); + d->titlebarSettingsImpl->toolsEditPanel()->show(); + d->titlebarSettingsImpl->toolsEditPanel()->move(0, this->height()); + d->titlebarSettingsImpl->toolsEditPanel()->resize(width(), parentWidget()->height() * 70 / 100); + } + } + return QWidget::resizeEvent(event); } /*! + @~english \brief DTitlebar::setCustomWidget is an overloaded function. - \brief 设置标题栏上的自定义控件. - - \a w is the widget to be used as the customize widget shown in the title + \param[in] w is the widget to be used as the customize widget shown in the title bar. - \a fixCenterPos indicates whether it should automatically move the + \param[in] fixCenterPos indicates whether it should automatically move the customize widget to the horizontal center of the title bar or not. - - \a w 需要显示的控件。 - \a fixCenterPos 是否需要自动修正控件位置,用于保持控件居中显示。 */ void DTitlebar::setCustomWidget(QWidget *w, bool fixCenterPos) { @@ -1414,6 +1254,49 @@ } } +void DTitlebar::setSidebarHelper(DSidebarHelper *helper) +{ + D_D(DTitlebar); + if (d->sidebarHelper == helper) + return; + + d->sidebarHelper = helper; + + if (!d->expandButton) { + d->expandButton = new DIconButton(this); + d->expandButton->setIcon(DDciIcon::fromTheme("window_sidebar")); + d->expandButton->setIconSize(QSize(DefaultExpandButtonHeight(), DefaultExpandButtonHeight())); + d->expandButton->setCheckable(true); + d->expandButton->setChecked(true); + d->expandButton->setFlat(true); + + d->sidebarBackgroundWidget = new QWidget(this); + d->sidebarBackgroundWidget->setAccessibleName("SidebarBackgroundWidget"); + d->sidebarBackgroundWidget->setAutoFillBackground(true); + d->sidebarBackgroundWidget->setBackgroundRole(DPalette::Button); + d->sidebarBackgroundWidget->move(pos()); + d->sidebarBackgroundWidget->show(); + d->sidebarBackgroundWidget->lower(); + d->leftLayout->addWidget(d->expandButton, 0, Qt::AlignLeft); + connect(d->expandButton, &DIconButton::clicked, [this, d] (bool isExpanded) { + d->sidebarHelper->setExpanded(isExpanded); + int x = isExpanded ? d->sidebarHelper->width() : 0; + d->separator->move(x, height() - d->separator->height()); + }); + } + + connect(helper, &DSidebarHelper::visibleChanged, this, [this](bool visible){ + d_func()->expandButton->setVisible(visible); + }); + connect(helper, &DSidebarHelper::expandChanged, this, [this](bool isExpanded){ + d_func()->sidebarBackgroundWidget->setVisible(isExpanded); + }); + connect(helper, &DSidebarHelper::widthChanged, this, [this](int width){ + d_func()->sidebarBackgroundWidget->setFixedWidth(width); + }); + +} + void DTitlebar::addWidget(QWidget *w, Qt::Alignment alignment) { D_D(DTitlebar); @@ -1451,12 +1334,10 @@ } /*! + @~english \brief DTitlebar::setFixedHeight change the height of the title bar to another value. - \brief 设置标题栏的高度,默认高度为 50。 - - \a h 需要设置的高度 - \a h is the target height. + \param[in] h is the target height. */ void DTitlebar::setFixedHeight(int h) { @@ -1464,11 +1345,9 @@ } /*! + @~english \brief DTitlebar::setBackgroundTransparent set the title background transparent - \brief 设置标题栏背景是否透明,当为透明时标题栏直接叠加在下层控件上. - - \a transparent is the targeting value. - \a transparent 是否透明 + \param[in] transparent is the targeting value. */ void DTitlebar::setBackgroundTransparent(bool transparent) { @@ -1481,12 +1360,10 @@ } /*! + @~english \brief DTitlebar::setSeparatorVisible sets the bottom separator of the title bar and the window contents to be visible or not. - \brief 设置菜单下面的分隔线是否可见,默认是可见的。 - - \a visible 是否可见 - \a visible is the targeting value. + \param[in] visible is the targeting value. */ void DTitlebar::setSeparatorVisible(bool visible) { @@ -1500,11 +1377,9 @@ } /*! + @~english \brief DTitlebar::setTitle sets the title to be shown on the title bar. - \brief 设置标题栏文本。 - - \a title is the text to be used as the window title. - \a title 待设置内容 + \param[in] title is the text to be used as the window title. */ void DTitlebar::setTitle(const QString &title) { @@ -1518,11 +1393,9 @@ } /*! + @~english \brief DTitlebar::setIcon sets the icon to be shown on the title bar. - \brief 设置标题栏图标 - \a icon is to be used as the window icon. - \a icon 待设置的图标 */ void DTitlebar::setIcon(const QIcon &icon) { @@ -1567,9 +1440,9 @@ } /*! + @~english \brief DTitlebar::buttonAreaWidth returns the width of the area that all the window buttons occupies. - \brief 按钮区域大小,用于手动定位自定义控件时使用. */ int DTitlebar::buttonAreaWidth() const { @@ -1578,9 +1451,9 @@ } /*! + @~english \brief DTitlebar::separatorVisible returns the visibility of the bottom separator of the titlebar. - \brief 分隔线是否可见. */ bool DTitlebar::separatorVisible() const { @@ -1589,9 +1462,9 @@ } /*! + @~english \brief DTitlebar::autoHideOnFullscreen returns if titlebar show on fullscreen mode. separator of the titlebar. - \brief 全屏模式下标题栏是否自动隐藏. */ bool DTitlebar::autoHideOnFullscreen() const { @@ -1600,9 +1473,9 @@ } /*! + @~english \brief DTitlebar::setAutoHideOnFullscreen set if titlebar show when window is fullscreen state. - \brief 设置全屏模式下是否需要自动隐藏标题栏 - \a autohide 是否自动隐藏 + \param[in] autohide Whether to hide automatically */ void DTitlebar::setAutoHideOnFullscreen(bool autohide) { @@ -1641,10 +1514,9 @@ } /*! + @~english \brief This function provides to set a titlebar is in parent. - \brief 设置为嵌入模式,而不是替换系统标题栏,用于不支持dxcb的平台. - - \a visible 为 true 时,替换系统标题栏,否则隐藏系统标题栏。 + \param[in] while visible is true ,Replace the system title bar, otherwise the system title bar is hidden. */ void DTitlebar::setEmbedMode(bool visible) { @@ -1655,9 +1527,9 @@ } /*! - \brief 菜单按钮的可视化. - - \return true 菜单可见 false菜单不可见. + @~english + \brief Visualization of the menu button. + \return true The menu is visible, false Menu is not visible. */ bool DTitlebar::menuIsVisible() const { @@ -1666,9 +1538,9 @@ } /*! - \brief 设置菜单是否可见. - - \a visible true 菜单可见 false菜单不可见. + @~english + \brief set the menu whether it is visible. + \param[in] visible true The menu is visible, falseThe menu is not visible. */ void DTitlebar::setMenuVisible(bool visible) { @@ -1677,9 +1549,9 @@ } /*! - \brief 菜单是否被禁用. - - \return true 菜单被禁用 false 菜单没有被禁用。 + @~english + \brief Whether the menu is disabled. + \return true: Menu is disabled, false: The menu is not disabled */ bool DTitlebar::menuIsDisabled() const { @@ -1688,9 +1560,9 @@ } /*! - \brief 设置菜单是否被禁用. - - \a disabled true 菜单被禁用 false菜单没有被禁用。 + @~english + \brief set the menu whether it is disabled. + \param[in] disabled true: Menu is disabled, false: The menu is not disabled */ void DTitlebar::setMenuDisabled(bool disabled) { @@ -1699,9 +1571,9 @@ } /*! - \brief 退出菜单是否被禁用. - - \return true 退出菜单被禁用 false退出菜单没有被禁用 + @~english + \brief Whether the withdrawal menu is disabled. + \return true Exit menu is disabled false The exit menu is not disabled */ bool DTitlebar::quitMenuIsDisabled() const { @@ -1711,9 +1583,9 @@ } /*! - \brief 设置退出菜单是否被禁用. - - \a disabled true 退出菜单被禁用 false退出菜单没有被禁用 + @~english + \brief Set the exit menu whether it is disabled. + \param[in] disabled true Exit menu is disabled, false The exit menu is not disabled */ void DTitlebar::setQuitMenuDisabled(bool disabled) { @@ -1727,9 +1599,9 @@ } /*! - \brief 设置退出菜单是否可见. - - \a visible true 退出菜单可见 false退出菜单不可见 + @~english + \brief Set the exit menu whether it is visible. + \a visible true exit the menu visible, false exit the menu is not visible */ void DTitlebar::setQuitMenuVisible(bool visible) { @@ -1743,9 +1615,9 @@ } /*! - \brief 设置主题切换菜单的可视化. - - \return true 切换主题菜单可见 false切换主题菜单不可见 + @~english + \brief Set the visualization of the theme switch menu. + \return true Switch theme menu can be seen, false switch theme menu is not visible */ bool DTitlebar::switchThemeMenuIsVisible() const { @@ -1755,9 +1627,9 @@ } /*! - \brief 设置切换主题菜单是否可见. - - \a visible true 切换主题菜单可见 false 切换主题菜单不可见。 + @~english + \brief Set the theme menu whether it is visible. + \param[in] visible true Switch theme menu can be seen, false Switch theme menu is not visible */ void DTitlebar::setSwitchThemeMenuVisible(bool visible) { @@ -1776,10 +1648,9 @@ } /*! + @~english \brief This function provides to disable the button match flags. - \brief 设置需要被禁用的按钮,仅仅是在界面上禁用按钮,还是可以通过事件等机制来调用对应接口. - - \a flags 需要被禁用的按钮标志位 + \param[in] flags the banned buttons that need to be disabled */ void DTitlebar::setDisableFlags(Qt::WindowFlags flags) { @@ -1789,10 +1660,9 @@ } /*! + @~english \brief Return which button is disabled. - \brief 当前被禁用的按钮标志位. - - \return 被禁用的窗口标志。 + \return The disabled window logo */ Qt::WindowFlags DTitlebar::disableFlags() const { @@ -1823,7 +1693,7 @@ int padding = qMax(d->leftArea->sizeHint().width(), d->rightArea->sizeHint().width()); int width = d->centerArea->sizeHint().width() + 2 * d->mainLayout->spacing() + 2 * padding; - return QSize(width, DefaultTitlebarHeight); + return QSize(width, d->titlebarHeight); } QSize DTitlebar::minimumSizeHint() const @@ -1843,6 +1713,18 @@ d->fullScreenButtonVisible = visible; } +DTitlebarSettings *DTitlebar::settings() +{ + D_D(DTitlebar); + + if (!d->titlebarSettings) { + auto settings = new DTitlebarSettings(this); + d->titlebarSettingsImpl = settings->impl(); + d->titlebarSettings = settings; + } + return d->titlebarSettings; +} + void DTitlebar::mouseMoveEvent(QMouseEvent *event) { D_D(DTitlebar); diff -Nru dtkwidget-5.5.48/src/widgets/dtitlebar.h dtkwidget-5.6.12/src/widgets/dtitlebar.h --- dtkwidget-5.5.48/src/widgets/dtitlebar.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtitlebar.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DTITLEBAR_H -#define DTITLEBAR_H - -#include -#include -#include - -#include -#include - -DGUI_USE_NAMESPACE -DWIDGET_BEGIN_NAMESPACE - -class DTitlebarPrivate; -class LIBDTKWIDGETSHARED_EXPORT DTitlebar : public QFrame, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - Q_PROPERTY(bool blurBackground READ blurBackground WRITE setBlurBackground) - -public: - explicit DTitlebar(QWidget *parent = Q_NULLPTR); - -#ifndef QT_NO_MENU - QMenu *menu() const; - void setMenu(QMenu *menu); -#endif - - QWidget *customWidget() const; - void setCustomWidget(QWidget *, bool fixCenterPos = false); - - void addWidget(QWidget *w, Qt::Alignment alignment = Qt::Alignment()); - void removeWidget(QWidget *w); - - int buttonAreaWidth() const; - bool separatorVisible() const; - - bool autoHideOnFullscreen() const; - void setAutoHideOnFullscreen(bool autohide); - - virtual void setVisible(bool visible) Q_DECL_OVERRIDE; - void setEmbedMode(bool embed); - - bool menuIsVisible() const; - void setMenuVisible(bool visible); - - bool menuIsDisabled() const; - void setMenuDisabled(bool disabled); - - bool quitMenuIsDisabled() const; - void setQuitMenuDisabled(bool disabled); - void setQuitMenuVisible(bool visible); - - bool switchThemeMenuIsVisible() const; - void setSwitchThemeMenuVisible(bool visible); - - void setDisableFlags(Qt::WindowFlags flags); - Qt::WindowFlags disableFlags() const; - - void setSplitScreenEnabled(bool enabled); - bool splitScreenIsEnabled() const; - - virtual QSize sizeHint() const override; - virtual QSize minimumSizeHint() const override; - - bool blurBackground() const; - void setFullScreenButtonVisible(bool enabled); - -Q_SIGNALS: - void optionClicked(); - void doubleClicked(); - void mousePressed(Qt::MouseButtons buttons); - void mouseMoving(Qt::MouseButton button); - -#ifdef DTK_TITLE_DRAG_WINDOW - void mousePosPressed(Qt::MouseButtons buttons, QPoint pos); - void mousePosMoving(Qt::MouseButton button, QPoint pos); -#endif - -public Q_SLOTS: - void setFixedHeight(int h); - void setBackgroundTransparent(bool transparent); - void setSeparatorVisible(bool visible); - void setTitle(const QString &title); - void setIcon(const QIcon &icon); - /// Maximized/Minumized - void toggleWindowState(); - - void setBlurBackground(bool blurBackground); - -private Q_SLOTS: -#ifndef QT_NO_MENU - void showMenu(); -#endif - -protected: - bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE; - bool event(QEvent *e) override; - void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; - -private: - D_DECLARE_PRIVATE(DTitlebar) - D_PRIVATE_SLOT(void _q_toggleWindowState()) - D_PRIVATE_SLOT(void _q_showMinimized()) - D_PRIVATE_SLOT(void _q_onTopWindowMotifHintsChanged(quint32)) - -#ifndef QT_NO_MENU - D_PRIVATE_SLOT(void _q_addDefaultMenuItems()) - D_PRIVATE_SLOT(void _q_helpActionTriggered()) - D_PRIVATE_SLOT(void _q_feedbackActionTriggerd()) - D_PRIVATE_SLOT(void _q_aboutActionTriggered()) - D_PRIVATE_SLOT(void _q_quitActionTriggered()) - D_PRIVATE_SLOT(void _q_switchThemeActionTriggered(QAction*)) -#endif -}; - -DWIDGET_END_NAMESPACE - -#endif // DTITLEBAR_H diff -Nru dtkwidget-5.5.48/src/widgets/dtitlebarsettings.cpp dtkwidget-5.6.12/src/widgets/dtitlebarsettings.cpp --- dtkwidget-5.5.48/src/widgets/dtitlebarsettings.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtitlebarsettings.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,65 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "dtitlebarsettings.h" +#include "dtitlebar.h" +#include "private/dtitlebarsettingsimpl.h" +#include + +DWIDGET_BEGIN_NAMESPACE + +class DTitlebarSettingsPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate +{ +public: + Q_DECLARE_PUBLIC(DTitlebarSettings) + + DTitlebarSettingsPrivate(DTitlebarSettings *qq); + + DTitlebarSettingsImpl* impl; + DTitlebar *titlebar; +}; + +DTitlebarSettingsPrivate::DTitlebarSettingsPrivate(DTitlebarSettings *qq) + : DObjectPrivate(qq) + , impl(new DTitlebarSettingsImpl()) +{ +} + +DTitlebarSettings::DTitlebarSettings(DTitlebar *titlebar) + : DObject( *new DTitlebarSettingsPrivate(this)) +{ + D_D(DTitlebarSettings); + d->titlebar = titlebar; +} + +bool DTitlebarSettings::initilize(QList &tools, const QString &path) +{ + D_D(DTitlebarSettings); + d->impl->setTools(tools); + if (!d->impl->load(path)) { + return false; + } + + auto titleBarEditPanel = d->impl->toolsView(); + titleBarEditPanel->setParent(d->titlebar->parentWidget()); + titleBarEditPanel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + d->titlebar->setCustomWidget(titleBarEditPanel); + return true; +} + +QWidget *DTitlebarSettings::toolsEditPanel() const +{ + D_DC(DTitlebarSettings); + return d->impl->toolsEditPanel(); +} + +DTitlebarSettingsImpl *DTitlebarSettings::impl() +{ + D_D(DTitlebarSettings); + return d->impl; +} + +#include "moc_dtitlebarsettings.cpp" + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/DToast dtkwidget-5.6.12/src/widgets/DToast --- dtkwidget-5.5.48/src/widgets/DToast 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DToast 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include diff -Nru dtkwidget-5.5.48/src/widgets/dtoast.cpp dtkwidget-5.6.12/src/widgets/dtoast.cpp --- dtkwidget-5.5.48/src/widgets/dtoast.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtoast.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: Iceyer - * - * Maintainer: Iceyer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dtoast.h" #include diff -Nru dtkwidget-5.5.48/src/widgets/dtoast.h dtkwidget-5.6.12/src/widgets/dtoast.h --- dtkwidget-5.5.48/src/widgets/dtoast.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtoast.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: Iceyer - * - * Maintainer: Iceyer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - - -#pragma once - -#include -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DToastPrivate; -class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X("Use DMessageManager") DToast : public QFrame, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity) - Q_PROPERTY(qreal duration READ duration WRITE setDuration) -public: - explicit DToast(QWidget *parent = 0); - ~DToast(); - - QString text() const; - QIcon icon() const; - int duration() const; - -Q_SIGNALS: - void visibleChanged(bool isVisible); - -public Q_SLOTS: - void pop(); - void pack(); - void showEvent(QShowEvent *event) override; - void hideEvent(QHideEvent *event) override; - - void setText(QString text); - void setIcon(QString icon); - void setIcon(QIcon icon, QSize defaultSize = QSize(20, 20)); - void setDuration(int duration); - -private: - qreal opacity() const; - void setOpacity(qreal); - - D_DECLARE_PRIVATE(DToast) -}; - - -DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/DToolBar dtkwidget-5.6.12/src/widgets/DToolBar --- dtkwidget-5.5.48/src/widgets/DToolBar 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DToolBar 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DToolBox dtkwidget-5.6.12/src/widgets/DToolBox --- dtkwidget-5.5.48/src/widgets/DToolBox 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DToolBox 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DToolButton dtkwidget-5.6.12/src/widgets/DToolButton --- dtkwidget-5.5.48/src/widgets/DToolButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DToolButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dtoolbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dtoolbutton.cpp dtkwidget-5.6.12/src/widgets/dtoolbutton.cpp --- dtkwidget-5.5.48/src/widgets/dtoolbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtoolbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: wangpeng -* -* Maintainer: wangpeng -* -* 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 -* any later version. -* -* This program 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 . -*/ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dtoolbutton.h" #include @@ -43,11 +27,6 @@ void DToolButton::initStyleOption(QStyleOptionToolButton *option) const { QToolButton::initStyleOption(option); - //判断条件不用Qt::ToolButtonTextBesideIcon原因 - //会强制居中,大小不受sizeHint()控制 - if (!option->icon.isNull() && !option->text.isEmpty()) { - option->toolButtonStyle = Qt::ToolButtonTextBesideIcon; - } } QSize DToolButton::sizeHint() const diff -Nru dtkwidget-5.5.48/src/widgets/dtoolbutton.h dtkwidget-5.6.12/src/widgets/dtoolbutton.h --- dtkwidget-5.5.48/src/widgets/dtoolbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtoolbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: wangpeng -* -* Maintainer: wangpeng -* -* 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 -* any later version. -* -* This program 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 . -*/ -#ifndef DTOOLBUTTON_H -#define DTOOLBUTTON_H - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DToolButton : public QToolButton -{ - Q_OBJECT -public: - DToolButton(QWidget *parent = nullptr); - void setAlignment(Qt::Alignment flag); - Qt::Alignment alignment() const; - -protected: - void paintEvent(QPaintEvent *event) override; - void initStyleOption(QStyleOptionToolButton *option) const; - QSize sizeHint() const override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DTOOLBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/DToolTip dtkwidget-5.6.12/src/widgets/DToolTip --- dtkwidget-5.5.48/src/widgets/DToolTip 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DToolTip 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dtooltip.h" diff -Nru dtkwidget-5.5.48/src/widgets/dtooltip.cpp dtkwidget-5.6.12/src/widgets/dtooltip.cpp --- dtkwidget-5.5.48/src/widgets/dtooltip.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtooltip.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dtooltip.h" #include "dstyle.h" @@ -6,8 +10,124 @@ #include #include #include +#include +#include DWIDGET_BEGIN_NAMESPACE +namespace DToolTipStatic { +static inline void registerDToolTipMetaType() +{ + qRegisterMetaType(); +} + +Q_CONSTRUCTOR_FUNCTION(registerDToolTipMetaType); + +static Qt::TextFormat textFormat = Qt::TextFormat::AutoText; +} + +/*! + \brief 设置 tooltip 的文本格式. + + 通过给定 \a format , 将 DStyle 内部中的 ToolTip + 文本格式设置为 \a format 指定的样式。 + + \sa Qt::TextFormat + */ +void DToolTip::setToolTipTextFormat(Qt::TextFormat format) +{ + DToolTipStatic::textFormat = format; +} +/*! + \brief 获取 tooltip 文本格式. + + \return 返回 DStyle 内部使用的 ToolTip 文本格式。 + + \sa Qt::TextFormat + */ +Qt::TextFormat DToolTip::toolTipTextFormat() +{ + return DToolTipStatic::textFormat; +} + +/*! + * @brief DToolTip::setToolTipShowMode + * @param widget widget to set ToolTip show mode + * @param mode ToolTip show mode + */ +void DToolTip::setToolTipShowMode(QWidget *widget, ToolTipShowMode mode) +{ + widget->setProperty("_d_dtk_toolTipMode", mode); +} + +/*! + * @brief DToolTip::toolTipShowMode + * @param widget widget to get ToolTip show mode + * @return ToolTip show mode + */ +DToolTip::ToolTipShowMode DToolTip::toolTipShowMode(const QWidget *widget) +{ + QVariant vToolTipMode = widget->property("_d_dtk_toolTipMode"); + if (vToolTipMode.isValid()) { + return qvariant_cast(vToolTipMode); + } else { + return ToolTipShowMode::Default; + } +} + +QString DToolTip::wrapToolTipText(QString text, QTextOption option) +{ + if (text.isEmpty()) { + return ""; + } + const auto MaxPixelsPerRow = DStyle::pixelMetric(nullptr, DStyle::PixelMetric::PM_ToolTipLabelWidth); + QStringList paragraphs = text.split('\n'); + const QFont &toolTipFont = QToolTip::font(); + QString toolTip{""}; + for (const QString ¶graph : qAsConst(paragraphs)) + { + if (paragraph.isEmpty()) + continue; + QTextLayout toolTipLayout(paragraph, toolTipFont); + toolTipLayout.setTextOption(option); + qreal height = 0; + toolTipLayout.beginLayout(); + QTextLine line = toolTipLayout.createLine(); + while(line.isValid()) { + line.setLineWidth(MaxPixelsPerRow); + line.setPosition({0, height}); + height += line.height(); + line = toolTipLayout.createLine(); + } + toolTipLayout.endLayout(); + for (int i = 0; i < toolTipLayout.lineCount(); ++i) { + const auto ¤tLine = toolTipLayout.lineAt(i); + toolTip.append(toolTipLayout.text().midRef(currentLine.textStart(), currentLine.textLength())); + toolTip.append('\n'); + } + } + toolTip.chop(1); + return toolTip; +} + +bool DToolTip::needUpdateToolTip(const QWidget *widget, bool showToolTip) +{ + QVariant vShowToolTip = widget->property("_d_dtk_showToolTip"); + bool needUpdate = false; + if (vShowToolTip.isValid()) { + bool oldShowStatus = vShowToolTip.toBool(); + if (showToolTip != oldShowStatus) { + needUpdate = true; + } + } else { + needUpdate = true; + } + return needUpdate; +} + +void DToolTip::setShowToolTip(QWidget *widget, bool showToolTip) +{ + widget->setProperty("_d_dtk_showToolTip", showToolTip); +} /*! \class Dtk::Widget::DToolTip diff -Nru dtkwidget-5.5.48/src/widgets/dtooltip.h dtkwidget-5.6.12/src/widgets/dtooltip.h --- dtkwidget-5.5.48/src/widgets/dtooltip.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dtooltip.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#ifndef DTOOLTIP_H -#define DTOOLTIP_H - -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DToolTip : public DTipLabel -{ - Q_OBJECT - -public: - explicit DToolTip(const QString &text, bool completionClose = true); - - QSize sizeHint() const override; - void show(const QPoint &pos, int duration); -}; - -DWIDGET_END_NAMESPACE - -#endif // DTOOLTIP_H diff -Nru dtkwidget-5.5.48/src/widgets/DTreeView dtkwidget-5.6.12/src/widgets/DTreeView --- dtkwidget-5.5.48/src/widgets/DTreeView 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTreeView 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DTreeWidget dtkwidget-5.6.12/src/widgets/DTreeWidget --- dtkwidget-5.5.48/src/widgets/DTreeWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DTreeWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DUndoView dtkwidget-5.6.12/src/widgets/DUndoView --- dtkwidget-5.5.48/src/widgets/DUndoView 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DUndoView 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DVerticalLine dtkwidget-5.6.12/src/widgets/DVerticalLine --- dtkwidget-5.5.48/src/widgets/DVerticalLine 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DVerticalLine 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dframe.h" diff -Nru dtkwidget-5.5.48/src/widgets/DVerticalSlider dtkwidget-5.6.12/src/widgets/DVerticalSlider --- dtkwidget-5.5.48/src/widgets/DVerticalSlider 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DVerticalSlider 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DVideoWidget dtkwidget-5.6.12/src/widgets/DVideoWidget --- dtkwidget-5.5.48/src/widgets/DVideoWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DVideoWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dvideowidget.h" diff -Nru dtkwidget-5.5.48/src/widgets/dvideowidget.cpp dtkwidget-5.6.12/src/widgets/dvideowidget.cpp --- dtkwidget-5.5.48/src/widgets/dvideowidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dvideowidget.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,682 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#include "dvideowidget.h" -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class VideoFormatProxy : public QAbstractVideoSurface -{ - Q_OBJECT - -public: - VideoFormatProxy(QObject *parent); - QVideoFrame& currentFrame() const; -protected: - bool present(const QVideoFrame &frame); - QList supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const; - bool isFormatSupported(const QVideoSurfaceFormat &format) const; -private: - QVideoFrame m_currentFrame; - QVideoFrame m_lastFrame; - - friend class DVideoWidget; - -Q_SIGNALS: - void currentFrameChanged(); -}; - -/*! - \internal - \class Dtk::Widget::VideoFormatProxy - \inmodule dtkwidget - \brief DVideoWidget使用的封装视频帧的代理类 - */ - -VideoFormatProxy::VideoFormatProxy(QObject *parent): - QAbstractVideoSurface(parent) -{ -} - -QVideoFrame& VideoFormatProxy::currentFrame() const -{ - return const_cast(m_currentFrame); -} - -bool VideoFormatProxy::present(const QVideoFrame &frame) -{ - m_currentFrame = frame; - - if (frame.isValid()) - m_lastFrame = frame; - - Q_EMIT currentFrameChanged(); - return true; -} - -QList VideoFormatProxy::supportedPixelFormats(QAbstractVideoBuffer::HandleType) const -{ - return QList() - << QVideoFrame::Format_RGB32 - << QVideoFrame::Format_ARGB32 - << QVideoFrame::Format_ARGB32_Premultiplied - << QVideoFrame::Format_RGB565 - << QVideoFrame::Format_RGB555; -} - -bool VideoFormatProxy::isFormatSupported(const QVideoSurfaceFormat &format) const -{ - return QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat()) != QImage::Format_Invalid; -} - -class DVideoWidgetPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate -{ -public: - DVideoWidgetPrivate(DVideoWidget *qq); - - VideoFormatProxy *formatProxy; - QPointer player; - - bool mirroredHorizontal = false; - bool mirroredVertical = false; - qreal scale = 1; - Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio; - int brightness = 0; - int contrast = 0; - int hue = 0; - int saturation = 0; - bool round = false; - qreal ratio = 1; - - D_DECLARE_PUBLIC(DVideoWidget) -}; - -DVideoWidgetPrivate::DVideoWidgetPrivate(DVideoWidget *qq) - : DObjectPrivate(qq) - , formatProxy(new VideoFormatProxy(qq)) -{ - qq->connect(formatProxy, &VideoFormatProxy::currentFrameChanged, - qq, static_cast(&DVideoWidget::repaint)); -} - -/*! - \class Dtk::Widget::DVideoWidget - \inmodule dtkwidget - \brief The DVideoWidget class provides a widget which presents video produced - by a media object. - \brief DVideoWidget类提供了呈现视频的小部件. - - Since the last frame that played is preserved, it always has better user - experience looping some media. Also it supports video flip (both vertically - or horizontally), video scale and rounded video clip. - - It's usually used just to play video animations like the one presented in - dde-zone settings page. If you want to play video or other media objects, - please refer to QVideoWidget for better performance or support. - - - 为了给循环播放提供更好的用户体验,视频的最后一帧将会被保留,同时还支持视频垂直或水平翻转, - 视频缩放和圆形视频编辑。 - - 将QMediaPlayer添加到DVideoWidget中,DVideoWidget封装了QVideoWidget来提供视频或图像的输出。 - \note 注意: 一次只能将一个QMediaPlayer连接到DVideoWidget中。 - - \code - DVideoWidget *videoWidget = new DVideoWidget(this); - QMediaPlayer *mediaPlayer = new QMediaPlayer(this); - QMediaPlaylist *list = new QMediaPlaylist(this); - list->addMedia(QUrl("qrc:/test.mp4")); - list->setPlaybackMode(QMediaPlaylist::Loop); - videoWidget->setVideoOutput(mediaPlayer); - videoWidget->play(); - \endcode - */ - -/*! - \fn void DVideoWidget::mirroredHorizontalChanged(bool mirroredHorizontal) - \brief 当前的视频或画面发生水平翻转时会发出该信号 - */ -/*! - \fn void DVideoWidget::mirroredVerticalChanged(bool mirroredVertical) - \brief 当前的视频或画面发生垂直翻转时会发出该信号 - */ -/*! - \fn void DVideoWidget::scaleChanged(qreal scale) - \brief 当相对于视频或画面的原始大小的比例发生变化时会发出该信号 - */ -/*! - \fn void DVideoWidget::brightnessChanged(int brightness) - \brief 当前的视频或画面的亮度发生变化时会发出该信号 - */ -/*! - \fn void DVideoWidget::contrastChanged(int contrast) - \brief 当前的视频或画面的对比度发生变化时会发出该信号 - */ -/*! - \fn void DVideoWidget::hueChanged(int hue) - \brief 当前的视频或画面的色彩度发生变化时会发出该信号 - */ -/*! - \fn void DVideoWidget::saturationChanged(int saturation) - \brief 当前视频或画面的饱和度发生变化时会发出该信号 - */ -/*! - \fn void DVideoWidget::roundChanged(bool round) - \brief 当前开启和关闭圆形效果时会发出该信号 - */ - -/*! - \brief DVideoWidget的构造函数 - - \a parent - */ -DVideoWidget::DVideoWidget(QWidget *parent) - : QWidget(parent) - , DObject(*new DVideoWidgetPrivate(this)) -{ - -} - -/*! - \property DVideoWidget::mirroredHorizontal - \brief indicates whether the video is horizontally flipped. - \brief 返回当前视频或画面是否水平翻转画面. - - \sa DVideoWidget::setMirroredHorizontal() - \sa DVideoWidget::mirroredHorizontalChanged() - - \return bool 是否水平翻转画面 - */ -bool DVideoWidget::mirroredHorizontal() const -{ - D_DC(DVideoWidget); - - return d->mirroredHorizontal; -} - -/*! - \property DVideoWidget::mirroredVertical - \brief indicates whether the video is vertically flipped. - \brief 返回当前视频或画面是否垂直翻转画面. - - \sa DVideoWidget::setMirroredVertical() - \sa DVideoWidget::mirroredVerticalChanged() - - \return bool 是否垂直翻转 - */ -bool DVideoWidget::mirroredVertical() const -{ - D_DC(DVideoWidget); - - return d->mirroredVertical; -} - -/*! - \brief DVideoWidget::paint paints a specific QVideoFrame onto the widget. - \a frame is the target video frame. - */ -void DVideoWidget::paint(const QVideoFrame &frame) -{ - D_DC(DVideoWidget); - - QPainter painter(this); - - QImage image( - frame.bits(), - frame.width(), - frame.height(), - frame.bytesPerLine(), - QVideoFrame::imageFormatFromPixelFormat(frame.pixelFormat())); - - painter.drawImage(0, 0, image.mirrored(d->mirroredHorizontal, d->mirroredVertical)); -} - -/*! - \property DVideoWidget::scale - - \brief the scale ratio used to paint the video frames. - \brief 返回当前视频或画面相对于原始大小的缩放比例. - - \sa DVideoWidget::setScale() - \sa DVideoWidget::scaleChanged() - - \return qreal 相对于原始大小的缩放比例 - */ -qreal DVideoWidget::scale() const -{ - D_DC(DVideoWidget); - - return d->scale; -} - -/*! - \property DVideoWidget::aspectRatioMode - - \brief 返回当前视频或画面的宽高比模式. - \brief holds the current aspect ratio. - - \sa DVideoWidget::setAspectRatioMode() - - \return Qt::AspectRatioMode - */ -Qt::AspectRatioMode DVideoWidget::aspectRatioMode() const -{ - D_DC(DVideoWidget); - - return d->aspectRatioMode; -} - -/*! - \brief 设置当前的视频或画面在HiDPI下的缩放系数 - - \a ratio - - \sa DVideoWidget::sourceVideoPixelRatio() - */ -void DVideoWidget::setSourceVideoPixelRatio(const qreal ratio) -{ - D_D(DVideoWidget); - - d->ratio = ratio; -} - -/*! - \brief 返回视频在HiDPI下的缩放系数 - - \sa DVideoWidget::setSourceVideoPixelRatio() - - \return qreal - */ -qreal DVideoWidget::sourceVideoPixelRatio() const -{ - D_DC(DVideoWidget); - - return d->ratio; -} - -/*! - \property DVideoWidget::brightness - \brief returns the brightness adjust setting. - - \property DVideoWidget::brightness - \brief 返回当前视频或画面的画面亮度 - - \note 该属性暂未实现 - \note This property is not implemented. - - \sa DVideoWidget::setBrightness() - \sa DVideoWidget::brightnessChanged() - */ -int DVideoWidget::brightness() const -{ - D_DC(DVideoWidget); - - return d->brightness; -} - -/*! - \property DVideoWidget::contrast - - \brief returns the contrast adjust setting. - \brief 返回当前的视频或画面的对比度 - - \note This property is not implemented. - \note 该属性尚未实现 - - \sa DVideoWidget::setContrast() - \sa DVideoWidget::contrastChanged() - */ -int DVideoWidget::contrast() const -{ - D_DC(DVideoWidget); - - return d->contrast; -} - -/*! - \property DVideoWidget::hue - \brief returns the hue adjust setting. - \brief 返回当前视频或画面的色调 - - \note This property is not implemented. - \note 该属性尚未实现 - - \sa DVideoWidget::setHue() - \sa DVideoWidget::hueChanged() - */ -int DVideoWidget::hue() const -{ - D_DC(DVideoWidget); - - return d->hue; -} - -/*! - \property DVideoWidget::saturation - \brief This property holds an adjustment to the saturation of displayed video. - \brief 返回当前的视频或画面的饱和度. - - \note This property is not implemented. - \note 该属性尚未实现 - - \sa DVideoWidget::setSaturation() - \sa DVideoWidget::saturationChanged() - */ -int DVideoWidget::saturation() const -{ - D_DC(DVideoWidget); - - return d->saturation; -} - -/*! - \brief DVideoWidget::currentFrame - \brief 返回当前的画面帧 - - \return the current frame displaying. - */ -const QVideoFrame *DVideoWidget::currentFrame() const -{ - D_DC(DVideoWidget); - - if (d->formatProxy) { - return &d->formatProxy->currentFrame(); - } - - return NULL; -} - -/*! - \brief 捕获当前的画面 - \brief DVideoWidget::capture grabs the current frame. - - \return a QPixmap representing the current frame. - \return QPixmap 当前的画面帧 - */ -QPixmap DVideoWidget::capture() -{ - return grab(); -} - -/*! - \property DVideoWidget::round - - \brief 控制绘制的视频是否为圆形 - \brief controls whether the painted video frame are rounded or not. - - \sa DVideoWidget::setRound() - \sa DVideoWidget::roundChanged() - - \return boo 是否为圆形 - */ -bool DVideoWidget::round() const -{ - D_DC(DVideoWidget); - - return d->round; -} - -/*! - \brief 设置要跟踪的QCamera源 - \brief DVideoWidget::setSource sets a QCamera source to be tracked. - - \a source is the target camera source. - */ -void DVideoWidget::setSource(QCamera *source) -{ - Q_ASSERT(source); - D_DC(DVideoWidget); - - source->setCaptureMode(QCamera::CaptureStillImage); - source->setViewfinder(d->formatProxy); -} - -/*! - \brief 设置要跟踪的QMediaPlayer源 - \brief DVideoWidget::setSource sets a QMediaPlayer source to be played. - - - \a source is the target media player source. - */ -void DVideoWidget::setSource(QMediaPlayer *source) -{ - Q_ASSERT(source); - D_D(DVideoWidget); - - source->setVideoOutput(d->formatProxy); - d->player = source; -} - -/*! - \brief 设置是否开启当前视频或画面水平翻转 - - \a mirroredHorizontal - - \sa DVideoWidget::mirroredHorizontal() - \sa DVideoWidget::mirroredHorizontalChanged() - */ -void DVideoWidget::setMirroredHorizontal(bool mirroredHorizontal) -{ - D_D(DVideoWidget); - - if (d->mirroredHorizontal == mirroredHorizontal) - return; - - d->mirroredHorizontal = mirroredHorizontal; - Q_EMIT mirroredHorizontalChanged(mirroredHorizontal); -} - -/*! - \brief 设置是否开启当前的视频或画面的垂直翻转 - - \a mirroredVertical - - \sa DVideoWidget::mirroredVertical() - \sa DVideoWidget::mirroredVerticalChanged() - */ -void DVideoWidget::setMirroredVertical(bool mirroredVertical) -{ - D_D(DVideoWidget); - - if (d->mirroredVertical == mirroredVertical) - return; - - d->mirroredVertical = mirroredVertical; - Q_EMIT mirroredVerticalChanged(mirroredVertical); -} - -/*! - \brief 设置相对于原始视频或画面大小的缩放 - - \sa DVideoWidget::scale() - \sa DVideoWidget::scaleChanged() - - \a scale - */ -void DVideoWidget::setScale(qreal scale) -{ - D_D(DVideoWidget); - - if (d->scale == scale) - return; - - d->scale = scale; - Q_EMIT scaleChanged(scale); -} - -/*! - \brief 设置当前的视频或画面的缩放模式 - - \a mode - - \sa DVideoWidget::aspectRatioMode() - */ -void DVideoWidget::setAspectRatioMode(Qt::AspectRatioMode mode) -{ - D_D(DVideoWidget); - - d->aspectRatioMode = mode; -} - -/*! - \brief 设置当前的视频或画面的亮度 - - \a brightness - - \sa DVideoWidget::brightness() - \sa DVideoWidget::brightnessChanged() - */ -void DVideoWidget::setBrightness(int brightness) -{ - D_D(DVideoWidget); - - if (d->brightness == brightness) - return; - - d->brightness = brightness; - Q_EMIT brightnessChanged(brightness); -} - -/*! - \brief 设置当前视频或画面的对比度 - - \a contrast - - \sa DVideoWidget::contrast() - \sa DVideoWidget::contrastChanged() - */ -void DVideoWidget::setContrast(int contrast) -{ - D_D(DVideoWidget); - - if (d->contrast == contrast) - return; - - d->contrast = contrast; - Q_EMIT contrastChanged(contrast); -} - -/*! - \brief 设置当前视频或画面的色彩度 - - \a hue - - \sa DVideoWidget::hue() - \sa DVideoWidget::hueChanged() - */ -void DVideoWidget::setHue(int hue) -{ - D_D(DVideoWidget); - - if (d->hue == hue) - return; - - d->hue = hue; - Q_EMIT hueChanged(hue); -} - -/*! - \brief 设置当前的视频或画面的饱和度 - - \a saturation - - \sa DVideoWidget::saturation() - \sa DVideoWidget::saturationChanged() - */ -void DVideoWidget::setSaturation(int saturation) -{ - D_D(DVideoWidget); - - if (d->saturation == saturation) - return; - - d->saturation = saturation; - Q_EMIT saturationChanged(saturation); -} - -/*! - \brief 设置是否开启视频圆形 - - \a round - - \sa DVideoWidget::round() - \sa DVideoWidget::roundChanged() - */ -void DVideoWidget::setRound(bool round) -{ - D_D(DVideoWidget); - - if (d->round == round) - return; - - d->round = round; - Q_EMIT roundChanged(round); -} - -void DVideoWidget::paintEvent(QPaintEvent *) -{ - D_DC(DVideoWidget); - - QPainter painter(this); - - const QMediaPlaylist *pl = d->player ? d->player->playlist() : NULL; - bool loop = pl && (pl->playbackMode() == QMediaPlaylist::Loop || pl->playbackMode() == QMediaPlaylist::CurrentItemInLoop); - QVideoFrame frame = (!loop || d->formatProxy->m_currentFrame.isValid()) ? d->formatProxy->m_currentFrame : d->formatProxy->m_lastFrame; - - frame.map(QAbstractVideoBuffer::ReadOnly); - QImage image( - frame.bits(), - frame.width(), - frame.height(), - frame.bytesPerLine(), - QVideoFrame::imageFormatFromPixelFormat(frame.pixelFormat())); - frame.unmap(); - - if (image.isNull()) { - return; - } - - image.setDevicePixelRatio(d->ratio); - image = image.scaled(size() * d->scale * d->ratio, d->aspectRatioMode, Qt::SmoothTransformation); - image = image.mirrored(d->mirroredHorizontal, d->mirroredVertical); - - if (d->round) { - QPainterPath path; - int diameter = qMin(width(), height()); - path.addEllipse(width()/2.0-diameter/2.0, height()/2.0-diameter/2.0, diameter, diameter); - painter.setRenderHint(QPainter::Antialiasing); - painter.setRenderHint(QPainter::SmoothPixmapTransform); - painter.setClipPath(path); - } - - painter.drawImage(QRectF(rect()).center() - QRectF(image.rect()).center() / d->ratio, image); -} - -DWIDGET_END_NAMESPACE - -#include "dvideowidget.moc" diff -Nru dtkwidget-5.5.48/src/widgets/dvideowidget.h dtkwidget-5.6.12/src/widgets/dvideowidget.h --- dtkwidget-5.5.48/src/widgets/dvideowidget.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dvideowidget.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DVIDEOWIDGET_H -#define DVIDEOWIDGET_H - -#include -#include - -#include - -QT_BEGIN_NAMESPACE -class QCamera; -class QMediaPlayer; -class QVideoFrame; -QT_END_NAMESPACE - -DWIDGET_BEGIN_NAMESPACE - -class DVideoWidgetPrivate; -class LIBDTKWIDGETSHARED_EXPORT DVideoWidget : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(bool mirroredHorizontal READ mirroredHorizontal WRITE setMirroredHorizontal NOTIFY mirroredHorizontalChanged) - Q_PROPERTY(bool mirroredVertical READ mirroredVertical WRITE setMirroredVertical NOTIFY mirroredVerticalChanged) - Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged) - Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode WRITE setAspectRatioMode) - Q_PROPERTY(int brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) - Q_PROPERTY(int contrast READ contrast WRITE setContrast NOTIFY contrastChanged) - Q_PROPERTY(int hue READ hue WRITE setHue NOTIFY hueChanged) - Q_PROPERTY(int saturation READ saturation WRITE setSaturation NOTIFY saturationChanged) - Q_PROPERTY(bool round READ round WRITE setRound NOTIFY roundChanged) - -public: - explicit DVideoWidget(QWidget *parent = 0); - - bool mirroredHorizontal() const; - bool mirroredVertical() const; - void paint(const QVideoFrame& frame); - qreal scale() const; - Qt::AspectRatioMode aspectRatioMode() const; - - void setSourceVideoPixelRatio(const qreal ratio); - qreal sourceVideoPixelRatio() const; - - int brightness() const; - int contrast() const; - int hue() const; - int saturation() const; - - const QVideoFrame* currentFrame() const; - - QPixmap capture(); - - bool round() const; - -Q_SIGNALS: - void mirroredHorizontalChanged(bool mirroredHorizontal); - void mirroredVerticalChanged(bool mirroredVertical); - void scaleChanged(qreal scale); - void brightnessChanged(int brightness); - void contrastChanged(int contrast); - void hueChanged(int hue); - void saturationChanged(int saturation); - void roundChanged(bool round); - -public Q_SLOTS: - void setSource(QCamera *source); - void setSource(QMediaPlayer *source); - void setMirroredHorizontal(bool mirroredHorizontal); - void setMirroredVertical(bool mirroredVertical); - - void setScale(qreal scale); - void setAspectRatioMode(Qt::AspectRatioMode mode); - void setBrightness(int brightness); - void setContrast(int contrast); - void setHue(int hue); - void setSaturation(int saturation); - void setRound(bool round); - -protected: - void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - -private: - D_DECLARE_PRIVATE(DVideoWidget) -}; - -DWIDGET_END_NAMESPACE - -#endif // DVIDEOWIDGET_H diff -Nru dtkwidget-5.5.48/src/widgets/DWarningButton dtkwidget-5.6.12/src/widgets/DWarningButton --- dtkwidget-5.5.48/src/widgets/DWarningButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWarningButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dwarningbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwarningbutton.cpp dtkwidget-5.6.12/src/widgets/dwarningbutton.cpp --- dtkwidget-5.5.48/src/widgets/dwarningbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwarningbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dwarningbutton.h" #include "dpalettehelper.h" #include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwarningbutton.h dtkwidget-5.6.12/src/widgets/dwarningbutton.h --- dtkwidget-5.5.48/src/widgets/dwarningbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwarningbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -#ifndef DWARNINGBUTTON_H -#define DWARNINGBUTTON_H - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DWarningButton : public DPushButton -{ -public: - DWarningButton(QWidget *parent = nullptr); - -protected: - void initStyleOption(QStyleOptionButton *option) const; - void paintEvent(QPaintEvent *e) override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DWARNINGBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/dwatermarkhelper.cpp dtkwidget-5.6.12/src/widgets/dwatermarkhelper.cpp --- dtkwidget-5.5.48/src/widgets/dwatermarkhelper.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwatermarkhelper.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,120 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "dwatermarkhelper.h" + +#include +#include +#include + +#include + +DWIDGET_BEGIN_NAMESPACE + +DTK_USE_NAMESPACE +DWIDGET_USE_NAMESPACE + +#define WATER_TEXTSPACE 65 +#define DEFAULT_FONTSIZE WATER_TEXTSPACE + +class DWaterMaskHelper_ : public DWaterMarkHelper {}; +Q_GLOBAL_STATIC(DWaterMaskHelper_, wmhGlobal) + +class DWaterMarkHelperPrivate: public DTK_CORE_NAMESPACE::DObjectPrivate +{ +public: + explicit DWaterMarkHelperPrivate(DWaterMarkHelper *parent) + : DObjectPrivate(parent) + { + + } + + void init(); + static void clean() { + auto helper = DWaterMarkHelper::instance(); + helper->d_func()->widgetMap.clear(); + helper->deleteLater(); + } + + WaterMarkData data; + static QMap widgetMap; +}; + +void DWaterMarkHelperPrivate::init() +{ // 进程退出时销毁资源 + qAddPostRoutine(clean); +} + +QMapDWaterMarkHelperPrivate::widgetMap; + +/*! + \brief DWaterMarkHelper::instance + The singleton object of DWaterMarkHelper is instantiated at the first call using the Q _ GLOBAL _ STATIC definition. + \return + */ +DWaterMarkHelper *DWaterMarkHelper::instance() +{ + return wmhGlobal; +} + +/*! + \class Dtk::Widget::DWaterMaskHelper + \inmodule dtkwidget + \brief Direct instantiation of this object is not allowed + \a parent + \sa DWaterMaskHelper::instance + */ +DWaterMarkHelper::DWaterMarkHelper(QObject *parent) + : QObject(parent) + , DObject(*new DWaterMarkHelperPrivate(this)) +{ + D_D(DWaterMarkHelper); + d->init(); +} + +/*! + \brief DWaterMarkHelper::registerWidget + \a widget + */ +void DWaterMarkHelper::registerWidget(QWidget *widget) +{ + D_D(DWaterMarkHelper); + + if (widget && !d->widgetMap.contains(widget)) { + DWaterMarkWidget *mark = new DWaterMarkWidget(widget); + mark->setData(d->data); + mark->setVisible(true); + d->widgetMap.insert(widget, mark); + + connect(widget, &QObject::destroyed, this, [widget] { + DWaterMarkHelper::instance()->d_func()->widgetMap.remove(widget); + }); + } +} + +/*! + \brief get the current setting + */ +WaterMarkData DWaterMarkHelper::data() const +{ + D_DC(DWaterMarkHelper); + return d->data; +} + +/*! + \brief set the current setting + \a data + */ +void DWaterMarkHelper::setData(const WaterMarkData &data) +{ + D_D(DWaterMarkHelper); + d->data = data; + + auto helper = DWaterMarkHelper::instance(); + for (auto w : helper->d_func()->widgetMap.values()) { + w->setData(data); + } +} + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/dwatermarkwidget.cpp dtkwidget-5.6.12/src/widgets/dwatermarkwidget.cpp --- dtkwidget-5.5.48/src/widgets/dwatermarkwidget.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwatermarkwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,568 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "dwatermarkwidget.h" + +#include +#include + +#include +#include +#include + +#include + +DCORE_USE_NAMESPACE +DTK_USE_NAMESPACE +DWIDGET_BEGIN_NAMESPACE + +DWIDGET_USE_NAMESPACE + +class WaterMarkDataPrivate: public DTK_CORE_NAMESPACE::DObjectPrivate +{ +protected: + explicit WaterMarkDataPrivate(WaterMarkData *parent) + : DObjectPrivate(parent) + { + } + +private: + WaterMarkData::WaterMarkType type = WaterMarkData::None; // 水印类型 + WaterMarkData::WaterMarkLayout layout = WaterMarkData::Center; // 水印布局 + qreal scaleFactor = 1.0; // 整体大小缩放系数 + int spacing = 0; // 间距 + int lineSpacing = 0; // 行间距 + QString text; // 文本水印内容 + QFont font; // 文本水印字体 + QColor color; // 文本水印颜色 + qreal rotation = 0; // 水印旋转角度(0~360) + qreal opacity = 1; // 水印透明度(0~1) + QImage image; // 图片水印中的图片 + bool grayScale = true; // 是否灰度化图片 + + D_DECLARE_PUBLIC(WaterMarkData) +}; + +/*! + \class Dtk::Widget::WaterMarkData + \inmodule dtkwidget + \brief Watermark information structure + \a parent + */ +WaterMarkData::WaterMarkData() + : DObject(*new WaterMarkDataPrivate(this)) +{ + +} + +/*! + \class Dtk::Widget::WaterMarkData + \inmodule dtkwidget + \brief coping constructing function + \a parent + */ +WaterMarkData::WaterMarkData(const WaterMarkData &p) + : DObject(*new WaterMarkDataPrivate(this)) +{ + D_D(WaterMarkData); + auto pd = p.d_func(); + + d->type = pd->type; + d->layout = pd->layout; + d->scaleFactor = pd->scaleFactor; + d->spacing = pd->spacing; + d->lineSpacing = pd->lineSpacing; + d->text = pd->text; + d->font = pd->font; + d->color = pd->color; + d->rotation = pd->rotation; + d->opacity = pd->opacity; + d->image = pd->image; + d->grayScale = pd->grayScale; +} + +/*! + \class Dtk::Widget::WaterMarkData + \inmodule dtkwidget + \brief Assignment constructor + \a parent + */ +WaterMarkData &WaterMarkData::operator=(const WaterMarkData &p) +{ + D_D(WaterMarkData); + + if (&p == this) + return *this; + + auto pd = p.d_func(); + d->type = pd->type; + d->layout = pd->layout; + d->scaleFactor = pd->scaleFactor; + d->spacing = pd->spacing; + d->lineSpacing = pd->lineSpacing; + d->text = pd->text; + d->font = pd->font; + d->color = pd->color; + d->rotation = pd->rotation; + d->opacity = pd->opacity; + d->image = pd->image; + d->grayScale = pd->grayScale; + + return *this; +} + +/*! + \brief get the current watermark type + */ +WaterMarkData::WaterMarkType WaterMarkData::type() const +{ + D_DC(WaterMarkData); + return d->type; +} + +/*! + \brief set the current waternark + \a type + */ +void WaterMarkData::setType(WaterMarkType type) +{ + D_D(WaterMarkData); + d->type = type; +} + +/*! + \brief get the current watermark layout + */ +WaterMarkData::WaterMarkLayout WaterMarkData::layout() const +{ + D_DC(WaterMarkData); + return d->layout; +} + +/*! + \brief set the current waternark + \a layout + */ +void WaterMarkData::setLayout(WaterMarkLayout layout) +{ + D_D(WaterMarkData); + d->layout = layout; +} + +/*! + \brief get the current watermark scale factor + */ +qreal WaterMarkData::scaleFactor() const +{ + D_DC(WaterMarkData); + return d->scaleFactor; +} + +/*! + \brief set the current waternark + \a scaleFactor + */ +void WaterMarkData::setScaleFactor(qreal scaleFactor) +{ + D_D(WaterMarkData); + d->scaleFactor = scaleFactor; +} + +/*! + \brief get the current watermark spacing + */ +int WaterMarkData::spacing() const +{ + D_DC(WaterMarkData); + return d->spacing; +} + +/*! + \brief set the current waternark \a spacing + */ +void WaterMarkData::setSpacing(int spacing) +{ + D_D(WaterMarkData); + d->spacing = spacing; +} + +/*! + \brief get the current watermark line spacing + */ +int WaterMarkData::lineSpacing() const +{ + D_DC(WaterMarkData); + return d->lineSpacing; +} + +/*! + \brief set the current waternark + \a lineSpacing + */ +void WaterMarkData::setLineSpacing(int lineSpacing) +{ + D_D(WaterMarkData); + d->lineSpacing = lineSpacing; +} + +/*! + \brief get the current watermark text + */ +QString WaterMarkData::text() const +{ + D_DC(WaterMarkData); + return d->text; +} + +/*! + \brief set the current waternark + \a text + */ +void WaterMarkData::setText(const QString &text) +{ + D_D(WaterMarkData); + d->text = text; +} + +/*! + \brief get the current watermark font + */ +QFont WaterMarkData::font() const +{ + D_DC(WaterMarkData); + return d->font; +} + +/*! + \brief set the current waternark + \a font + */ +void WaterMarkData::setFont(const QFont &font) +{ + D_D(WaterMarkData); + d->font = font; +} + +/*! + \brief get the current watermark color + */ +QColor WaterMarkData::color() const +{ + D_DC(WaterMarkData); + return d->color; +} + +/*! + \brief set the current waternark + \a color + */ +void WaterMarkData::setColor(const QColor &color) +{ + D_D(WaterMarkData); + d->color = color; +} + +/*! + \brief get the current watermark rotation(0~360) + */ +qreal WaterMarkData::rotation() const +{ + D_DC(WaterMarkData); + return d->rotation; +} + +/*! + \brief set the current waternark (0~360) + \a rotation + */ +void WaterMarkData::setRotation(qreal rotation) +{ + D_D(WaterMarkData); + d->rotation = rotation; +} + +/*! + \brief get the current watermark opacity(0~1.0) + */ +qreal WaterMarkData::opacity() const +{ + D_DC(WaterMarkData); + return d->opacity; +} + +/*! + \brief set the current waternark (0~1.0) + \a opacity + */ +void WaterMarkData::setOpacity(qreal opacity) +{ + D_D(WaterMarkData); + d->opacity = opacity; +} + +/*! + \brief get the current watermark image + */ +QImage WaterMarkData::image() const +{ + D_DC(WaterMarkData); + return d->image; +} + +/*! + \brief set the current waternark \a image + */ +void WaterMarkData::setImage(const QImage &image) +{ + D_D(WaterMarkData); + d->image = image; +} + +/*! + \brief get the current watermark grayscale of image + */ +bool WaterMarkData::grayScale() const +{ + D_DC(WaterMarkData); + return d->grayScale; +} + +/*! + \brief set the current waternark \a grayScale of image,default value is true + */ +void WaterMarkData::setGrayScale(bool grayScale) +{ + D_D(WaterMarkData); + d->grayScale = grayScale; +} + +static QImage createTextureImage(const WaterMarkData &data, qreal deviceScale) +{ + QImage texture; + + switch (data.type()) { + case WaterMarkData::WaterMarkType::None: + return texture; + case WaterMarkData::WaterMarkType::Text: + { + // 缩放处理 + QFont font = data.font(); + if (!(font.styleStrategy() & QFont::PreferAntialias)) + font.setStyleStrategy(QFont::PreferAntialias); + font.setPointSize(qRound(font.pointSize() * data.scaleFactor() * deviceScale)); + + // 边距计算 + QFontMetrics fm(font); + QSize textSize = fm.size(Qt::TextSingleLine, data.text()); + int realLineSpacing = qMax(qMin(textSize.width(), textSize.height()), data.lineSpacing()); + QSize spaceSize = QSize(qMax(0, data.spacing()), realLineSpacing) * deviceScale; + + // 绘制纹理 + texture = QImage(textSize + spaceSize, QImage::Format_ARGB32); + texture.fill(Qt::transparent); + QPainter tp; + tp.begin(&texture); + tp.setFont(font); + tp.setPen(data.color()); + tp.setBrush(Qt::NoBrush); + tp.setRenderHint(QPainter::TextAntialiasing); + tp.drawText(texture.rect(), Qt::AlignCenter, data.text()); + tp.end(); + } + break; + case WaterMarkData::WaterMarkType::Image: + { + // 缩放处理 + QImage img = data.image(); + if (data.grayScale()) { + DWIDGET_NAMESPACE::grayScale(data.image(), img, data.image().rect()); + } + + img = img.scaledToWidth(qRound(img.width() * data.scaleFactor() * deviceScale)); + int realLineSpacing = qMax(qMin(img.width(), img.height()), data.lineSpacing()); + texture = QImage(img.size() + QSize(qMax(0, data.spacing()), data.lineSpacing() < 0 ? realLineSpacing : data.lineSpacing()) + , QImage::Format_ARGB32); + texture.fill(Qt::transparent); + + // 拷贝所有像素到一张添加了边距和行间距的图中 + for (int i = 0; i < img.width(); ++i) { + for (int j = 0; j < img.height(); ++j) { + texture.setPixelColor(i, j, img.pixelColor(i, j)); + } + } + } + break; + } + return texture; +} + +void drawWaterTexture(QPainter &painter, const QImage &texture, qreal rotation, const QRect &paintRect) +{ + painter.save(); + painter.setRenderHint(QPainter::SmoothPixmapTransform); + painter.setRenderHint(QPainter::Antialiasing); + + // 旋转画刷,避免调整父界面大小时水印内容有移动 + QBrush b; + b.setTextureImage(texture); + QPoint center = texture.rect().center(); + QTransform t = QTransform() + .translate(center.x(), center.y()) + .rotate(rotation) + .translate(-center.x(), -center.y()); + b.setTransform(t); + +// painter.setPen(Qt::NoPen); + painter.setBrush(b); + painter.drawRect(paintRect); + painter.restore(); +} + +class DWaterMarkWidgetPrivate: public DTK_CORE_NAMESPACE::DObjectPrivate +{ +protected: + explicit DWaterMarkWidgetPrivate(DWaterMarkWidget *parent) + : DObjectPrivate(parent) + { + + } + +private: + void init(); + + WaterMarkData data; + QImage textureImage; + + D_DECLARE_PUBLIC(DWaterMarkWidget) +}; + +void DWaterMarkWidgetPrivate::init() +{ + D_Q(DWaterMarkWidget); + + q->setObjectName("DWaterMarkWidget"); + q->setAttribute(Qt::WA_TransparentForMouseEvents, true); + q->setFocusPolicy(Qt::NoFocus); +} + +/*! + \class Dtk::Widget::DWaterMarkWidget + \inmodule dtkwidget + \brief The watermark class will cover the set parent interface and dynamically adjust the size following the parent interface. + \a parent + */ +DWaterMarkWidget::DWaterMarkWidget(QWidget *parent) + : QWidget(parent) + , DObject(*new DWaterMarkWidgetPrivate(this)) +{ + D_D(DWaterMarkWidget); + d->init(); + + if (parent) + parent->installEventFilter(this); +} + +/*! + \brief get the current setting + */ +const WaterMarkData &DWaterMarkWidget::data() +{ + D_DC(DWaterMarkWidget); + return d->data; +} + +/*! + \brief set the current setting \a data + */ +void DWaterMarkWidget::setData(const WaterMarkData &data) +{ + D_D(DWaterMarkWidget); + + d->data = data; + d->textureImage = createTextureImage(d->data, devicePixelRatioF()); + + update(); +} + +void DWaterMarkWidget::paintEvent(QPaintEvent *) +{ + D_D(DWaterMarkWidget); + + qreal deviceScale = devicePixelRatioF(); + + QPainter painter(this); + painter.setOpacity(d->data.opacity()); + + switch (d->data.type()) { + case WaterMarkData::WaterMarkType::None: + return; + case WaterMarkData::WaterMarkType::Text: { + // 居中处理 + if (d->data.layout() == WaterMarkData::Center) { + // 缩放处理 + QFont font = d->data.font(); + if (!(font.styleStrategy() & QFont::PreferAntialias)) + font.setStyleStrategy(QFont::PreferAntialias); + font.setPointSize(qRound(d->data.font().pointSize() * d->data.scaleFactor() * deviceScale)); + + auto center = rect().center(); + painter.translate(center.x(), center.y()); + painter.rotate(d->data.rotation()); + painter.translate(-center.x(), -center.y()); + + painter.save(); + painter.setRenderHint(QPainter::TextAntialiasing); + painter.setFont(font); + painter.setPen(d->data.color()); + painter.drawText(rect(), Qt::AlignCenter, d->data.text()); + painter.restore(); + } else { + drawWaterTexture(painter, d->textureImage, d->data.rotation(), rect()); + } + } + case WaterMarkData::WaterMarkType::Image: + { + if (d->data.image().isNull() || qFuzzyCompare(d->data.scaleFactor(), 0)) + return; + + // 居中处理 + if (d->data.layout() == WaterMarkData::Center) { + // 缩放处理 + QImage img = d->data.image(); + if (d->data.grayScale()) + DWIDGET_NAMESPACE::grayScale(d->data.image(), img, d->data.image().rect()); + img = img.scaledToWidth(qRound(img.width() * d->data.scaleFactor() * deviceScale)); + QSize size = img.size() / img.devicePixelRatio(); + int imgWidth = size.width(); + int imgHeight = size.height(); + + auto center = rect().center(); + painter.translate(center.x(), center.y()); + painter.rotate(d->data.rotation()); + painter.translate(-center.x(), -center.y()); + + QPointF leftTop(rect().center().x() - imgWidth / 2.0, rect().center().y() - imgHeight / 2.0); + painter.drawImage(leftTop, img); + } else { + drawWaterTexture(painter, d->textureImage, d->data.rotation(), rect()); + } + } + } +} + +bool DWaterMarkWidget::eventFilter(QObject *watched, QEvent *event) +{ + if (watched != parent()) + return false; + + // 保持和父界面尺寸一致 + if (event->type() == QEvent::Resize) { + QResizeEvent *e = static_cast(event); + resize(e->size()); + } + + return QWidget::eventFilter(watched, event); +} + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/DWaterProgress dtkwidget-5.6.12/src/widgets/DWaterProgress --- dtkwidget-5.5.48/src/widgets/DWaterProgress 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWaterProgress 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dwaterprogress.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwaterprogress.cpp dtkwidget-5.6.12/src/widgets/dwaterprogress.cpp --- dtkwidget-5.5.48/src/widgets/dwaterprogress.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwaterprogress.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dwaterprogress.h" @@ -66,7 +53,7 @@ QList pops; int interval = 33; - int value = 0; + int value = -1; double frontXOffset = 0; double backXOffset = 0; @@ -156,7 +143,7 @@ /*! \brief set progress text \a visible or not \brief 设置是否显示进度 - + set the progress text value(like 50% when value is 50) \a visible. 设置进度文字是否显示,如值为 50 时显示 50% 。 */ @@ -214,8 +201,6 @@ D_Q(DWaterProgress); q->setMinimumSize(100, 100); - value = 0; - timer = new QTimer(q); timer->setInterval(interval); resizePixmap(q->size()); diff -Nru dtkwidget-5.5.48/src/widgets/dwaterprogress.h dtkwidget-5.6.12/src/widgets/dwaterprogress.h --- dtkwidget-5.5.48/src/widgets/dwaterprogress.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwaterprogress.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DWATERPROGRESS_H -#define DWATERPROGRESS_H - -#include -#include - -#include -#include - -DWIDGET_BEGIN_NAMESPACE - -class DWaterProgressPrivate; -class LIBDTKWIDGETSHARED_EXPORT DWaterProgress : public QWidget, public DTK_CORE_NAMESPACE::DObject -{ - Q_OBJECT - - Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged) -public: - explicit DWaterProgress(QWidget *parent = 0); - ~DWaterProgress(); - - int value() const; - -Q_SIGNALS: - void valueChanged(); - -public Q_SLOTS: - void start(); - void stop(); - void setValue(int value); - void setTextVisible(bool visible); - -protected: - void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; - void changeEvent(QEvent *e) override; - -private: - D_DECLARE_PRIVATE(DWaterProgress) -}; - -DWIDGET_END_NAMESPACE - -#endif // DWATERPROGRESS_H diff -Nru dtkwidget-5.5.48/src/widgets/DWebView dtkwidget-5.6.12/src/widgets/DWebView --- dtkwidget-5.5.48/src/widgets/DWebView 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWebView 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DWhatsThis dtkwidget-5.6.12/src/widgets/DWhatsThis --- dtkwidget-5.5.48/src/widgets/DWhatsThis 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWhatsThis 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#inlcude diff -Nru dtkwidget-5.5.48/src/widgets/DWidget dtkwidget-5.6.12/src/widgets/DWidget --- dtkwidget-5.5.48/src/widgets/DWidget 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWidget 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/dwidgetstype.h dtkwidget-5.6.12/src/widgets/dwidgetstype.h --- dtkwidget-5.5.48/src/widgets/dwidgetstype.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwidgetstype.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -#ifndef DWIDGETSTYPE_H -#define DWIDGETSTYPE_H - -#include - -QT_BEGIN_NAMESPACE - -class QScrollBar; -class QPushButton; -class QRadioButton; -class QDialogButtonBox; -class QListWidget; -class QTreeWidget; -class QTableWidget; -class QGroupBox; -class QScrollArea; -class QToolBox; -class QTableWidget; -class QStackedWidget; -class QWidget; -class QMDIArea; -class QDockWidget; -class QComboBox; -class QFontComboBox; -class QPlainTextEdit; -class QSpinBox; -class QDoubleSpinBox; -class QTimeEdit; -class QDateEdit; -class QDateTimeEdit; -class QDial; -class QTextBrowser; -class QGraphicsView; -class QCalendarWidget; -class QLCDNumber; -class QHorizontalLine; -class QVerticalLine; -class QOpenGLWidget; -class QQuickWidget; -class QWebView; -class QAccessibleWidget; -class QCheckBox; -class QColorDialog; -class QColumnView; -class QDataWidgetMapper; -class QFocusFrame; -class QHeaderView; -class QInputDialog; -class QMdiArea; -class QMdiSubWindow; -class QErrorMessage; -class QFontDialog; -class QMenu; -class QMenuBar; -class QMessageBox; -class QRubberBand; -class QSlider; -class QSplitter; -class QStatusBar; -class QTabWidget; -class QTableView; -class QTileRules; -class QToolBar; -class QTreeView; -class QUndoView; -class QWhatsThis; -class QWizard; -class QWizardPage; -class QSizeGrip; - -QT_END_NAMESPACE - -DWIDGET_BEGIN_NAMESPACE - -typedef QScrollBar DScrollBar; -typedef QPushButton DPushButton; -typedef QRadioButton DRadioButton; -typedef QDialogButtonBox DDialogButtonBox; -typedef QListWidget DListWidget; -typedef QTreeWidget DTreeWidget; -typedef QTableWidget DTableWidget; -typedef QGroupBox DGroupBox; -typedef QScrollArea DScrollArea; -typedef QToolBox DToolBox; -typedef QTableWidget DTableWidget; -typedef QStackedWidget DStackedWidget; -typedef QWidget DWidget; -typedef QMDIArea DMDIArea; -typedef QDockWidget DDockWidget; -typedef QPlainTextEdit DPlainTextEdit; -typedef QTimeEdit DTimeEdit; -typedef QDateEdit DDateEdit; -typedef QDateTimeEdit DDateTimeEdit; -typedef QDial DDial; -typedef QTextBrowser DTextBrowser; -typedef QGraphicsView DGraphicsView; -typedef QCalendarWidget DCalendarWidget; -typedef QLCDNumber DLCDNumber; -typedef QOpenGLWidget DOpenGLWidget; -typedef QQuickWidget DQuickWidget; -typedef QWebView DWebView; -typedef QAccessibleWidget DAccessibleWidget; -typedef QCheckBox DCheckBox; -typedef QColorDialog DColorDialog; -typedef QColumnView DColumnView; -typedef QDataWidgetMapper DDataWidgetMapper; -typedef QFocusFrame DFocusFrame; -typedef QHeaderView DHeaderView; -#ifndef Q_QDOC -typedef QInputDialog DInputDialog; -#endif -typedef QMdiArea DMdiArea; -typedef QMdiSubWindow DMdiSubWindow; -typedef QErrorMessage DErrorMessage; -typedef QFontDialog DFontDialog; -typedef QMenu DMenu; -typedef QMenuBar DMenuBar; -typedef QMessageBox DMessageBox; -typedef QRubberBand DRubberBand; -typedef QSplitter DSplitter; -typedef QStatusBar DStatusBar; -typedef QTabWidget DTabWidget; -typedef QTableView DTableView; -typedef QTileRules DTileRules; -typedef QToolBar DToolBar; -typedef QTreeView DTreeView; -typedef QUndoView DUndoView; -typedef QWhatsThis DWhatsThis; -typedef QWizard DWizard; -typedef QWizardPage DWizardPage; -typedef QSizeGrip DSizeGrip; - -DWIDGET_END_NAMESPACE - -#endif // DWIDGETSTYPE_H diff -Nru dtkwidget-5.5.48/src/widgets/DWindowCloseButton dtkwidget-5.6.12/src/widgets/DWindowCloseButton --- dtkwidget-5.5.48/src/widgets/DWindowCloseButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWindowCloseButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dwindowclosebutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwindowclosebutton.cpp dtkwidget-5.6.12/src/widgets/dwindowclosebutton.cpp --- dtkwidget-5.5.48/src/widgets/dwindowclosebutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwindowclosebutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dwindowclosebutton.h" #include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwindowclosebutton.h dtkwidget-5.6.12/src/widgets/dwindowclosebutton.h --- dtkwidget-5.5.48/src/widgets/dwindowclosebutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwindowclosebutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DWINDOWCLOSEBUTTON_H -#define DWINDOWCLOSEBUTTON_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DWindowCloseButton : public DIconButton -{ - Q_OBJECT -public: - DWindowCloseButton(QWidget * parent = 0); - - QSize sizeHint() const override; - -protected: - void initStyleOption(DStyleOptionButton *option) const override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DWINDOWCLOSEBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/DWindowMaxButton dtkwidget-5.6.12/src/widgets/DWindowMaxButton --- dtkwidget-5.5.48/src/widgets/DWindowMaxButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWindowMaxButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dwindowmaxbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwindowmaxbutton.cpp dtkwidget-5.6.12/src/widgets/dwindowmaxbutton.cpp --- dtkwidget-5.5.48/src/widgets/dwindowmaxbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwindowmaxbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dwindowmaxbutton.h" #include "private/diconbutton_p.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwindowmaxbutton.h dtkwidget-5.6.12/src/widgets/dwindowmaxbutton.h --- dtkwidget-5.5.48/src/widgets/dwindowmaxbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwindowmaxbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DWINDOWMAXBUTTON_H -#define DWINDOWMAXBUTTON_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class DWindowMaxButtonPrivate; - -class LIBDTKWIDGETSHARED_EXPORT DWindowMaxButton : public DIconButton -{ - Q_OBJECT -public: - DWindowMaxButton(QWidget * parent = 0); - - Q_PROPERTY(bool isMaximized READ isMaximized WRITE setMaximized NOTIFY maximizedChanged) - - bool isMaximized() const; - QSize sizeHint() const override; - -public Q_SLOTS: - void setMaximized(bool isMaximized); - -Q_SIGNALS: - void maximizedChanged(bool isMaximized); - -protected: - void initStyleOption(DStyleOptionButton *option) const override; - -private: - D_DECLARE_PRIVATE(DWindowMaxButton) -}; - -DWIDGET_END_NAMESPACE - -#endif // DWINDOWMAXBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/DWindowMinButton dtkwidget-5.6.12/src/widgets/DWindowMinButton --- dtkwidget-5.5.48/src/widgets/DWindowMinButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWindowMinButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dwindowminbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwindowminbutton.cpp dtkwidget-5.6.12/src/widgets/dwindowminbutton.cpp --- dtkwidget-5.5.48/src/widgets/dwindowminbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwindowminbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dwindowminbutton.h" #include "dstyleoption.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwindowminbutton.h dtkwidget-5.6.12/src/widgets/dwindowminbutton.h --- dtkwidget-5.5.48/src/widgets/dwindowminbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwindowminbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DWINDOWMINBUTTON_H -#define DWINDOWMINBUTTON_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DWindowMinButton : public DIconButton -{ - Q_OBJECT - -public: - DWindowMinButton(QWidget * parent = 0); - - QSize sizeHint() const override; - -protected: - void initStyleOption(DStyleOptionButton *option) const override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DWINDOWMINBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/DWindowOptionButton dtkwidget-5.6.12/src/widgets/DWindowOptionButton --- dtkwidget-5.5.48/src/widgets/DWindowOptionButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWindowOptionButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dwindowoptionbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwindowoptionbutton.cpp dtkwidget-5.6.12/src/widgets/dwindowoptionbutton.cpp --- dtkwidget-5.5.48/src/widgets/dwindowoptionbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwindowoptionbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dwindowoptionbutton.h" #include "dstyleoption.h" @@ -21,19 +8,23 @@ DWIDGET_BEGIN_NAMESPACE /*! - \class Dtk::Widget::DWindowOptionButton +@~english + @class Dtk::Widget::DWindowOptionButton \inmodule dtkwidget - \brief The DWindowOptionButton class is used as the unified window option button. - \brief DWindowOptionButton 类是 DTK 窗口统一的菜单按钮控件. + @brief The DWindowOptionButton class is used as the unified window option button. + It's actually a special DImageButton which has the appearance of option button. - 点击按钮后,默认会显示程序主菜单,包含“关于”、“帮助”等项。 + After clicking the button, the main menu of the program will be displayed by default, which contains items such as “About” and “Help”. + */ /*! - \brief DWindowOptionButton::DWindowOptionButton 是 DWindowOptionButton 的构造 - 函数,返回 DWindowOptionButton 对象,普通程序一般无需使用。 - \a parent 为创建对象的父控件。 +@~english + @fn DWindowOptionButton::DWindowOptionButton(QWidget * parent) + @brief DWindowOptionButton::DWindowOptionButton is the constructor of DWindowOptionButton, which returns a DWindowOptionButton object. + Normal programs do not need to use it. + \a parent is the parent widget of the created object. */ DWindowOptionButton::DWindowOptionButton(QWidget * parent) : DIconButton(parent) diff -Nru dtkwidget-5.5.48/src/widgets/dwindowoptionbutton.h dtkwidget-5.6.12/src/widgets/dwindowoptionbutton.h --- dtkwidget-5.5.48/src/widgets/dwindowoptionbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwindowoptionbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - -#ifndef DWINDOWOPTIONBUTTON_H -#define DWINDOWOPTIONBUTTON_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DWindowOptionButton : public DIconButton -{ - Q_OBJECT -public: - DWindowOptionButton(QWidget * parent = 0); - - QSize sizeHint() const override; - -protected: - void initStyleOption(DStyleOptionButton *option) const override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DWINDOWOPTIONBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/DWindowQuitFullButton dtkwidget-5.6.12/src/widgets/DWindowQuitFullButton --- dtkwidget-5.5.48/src/widgets/DWindowQuitFullButton 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWindowQuitFullButton 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include "dwindowquitfullbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwindowquitfullbutton.cpp dtkwidget-5.6.12/src/widgets/dwindowquitfullbutton.cpp --- dtkwidget-5.5.48/src/widgets/dwindowquitfullbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwindowquitfullbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: wangpeng -* -* Maintainer: wangpeng -* -* 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 -* any later version. -* -* This program 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 . -*/ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include "dstyleoption.h" #include "dwindowquitfullbutton.h" diff -Nru dtkwidget-5.5.48/src/widgets/dwindowquitfullbutton.h dtkwidget-5.6.12/src/widgets/dwindowquitfullbutton.h --- dtkwidget-5.5.48/src/widgets/dwindowquitfullbutton.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dwindowquitfullbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: wangpeng -* -* Maintainer: wangpeng -* -* 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 -* any later version. -* -* This program 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 . -*/ -#ifndef DWINDOWQUITFULLBUTTON_H -#define DWINDOWQUITFULLBUTTON_H - -#include - -DWIDGET_BEGIN_NAMESPACE - -class LIBDTKWIDGETSHARED_EXPORT DWindowQuitFullButton : public DIconButton -{ - Q_OBJECT - -public: - DWindowQuitFullButton(QWidget * parent = nullptr); - - QSize sizeHint() const override; - -protected: - void initStyleOption(DStyleOptionButton *option) const override; -}; - -DWIDGET_END_NAMESPACE - -#endif // DWINDOWQUITFULLBUTTON_H diff -Nru dtkwidget-5.5.48/src/widgets/DWizard dtkwidget-5.6.12/src/widgets/DWizard --- dtkwidget-5.5.48/src/widgets/DWizard 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWizard 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#include diff -Nru dtkwidget-5.5.48/src/widgets/DWizardPage dtkwidget-5.6.12/src/widgets/DWizardPage --- dtkwidget-5.5.48/src/widgets/DWizardPage 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/DWizardPage 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include "dwidgetstype.h" -#inlcude diff -Nru dtkwidget-5.5.48/src/widgets/dx11window.h dtkwidget-5.6.12/src/widgets/dx11window.h --- dtkwidget-5.5.48/src/widgets/dx11window.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/dx11window.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ - diff -Nru dtkwidget-5.5.48/src/widgets/icons.qrc dtkwidget-5.6.12/src/widgets/icons.qrc --- dtkwidget-5.5.48/src/widgets/icons.qrc 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/icons.qrc 2023-05-15 03:42:41.000000000 +0000 @@ -15,10 +15,6 @@ assets/images/dialog_close_round_normal@2x.png assets/images/dialog_close_round_normal.png assets/images/dialog_close_round_press.png - assets/images/play_pause.svg - assets/images/play_start.svg - assets/images/play_previous.svg - assets/images/play_next.svg assets/images/water_back.svg assets/images/water_front.svg assets/images/uos.svg diff -Nru dtkwidget-5.5.48/src/widgets/private/daboutdialog_p.h dtkwidget-5.6.12/src/widgets/private/daboutdialog_p.h --- dtkwidget-5.5.48/src/widgets/private/daboutdialog_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/daboutdialog_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,28 +1,25 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DABOUTDIALOG_P_H #define DABOUTDIALOG_P_H #include +#include + #include "ddialog_p.h" DWIDGET_BEGIN_NAMESPACE +class DRedPointLabel : public QLabel +{ +public: + DRedPointLabel(QWidget *parent = nullptr); +protected: + void paintEvent(QPaintEvent *e) override; +}; + class DAboutDialogPrivate : public DDialogPrivate { public: @@ -31,8 +28,10 @@ void init(); void loadDistributionInfo(); void updateWebsiteLabel(); - void updateAcknowledgementLabel(); void _q_onLinkActivated(const QString &link); + void _q_onFeatureActivated(const QString &link); + void _q_onLicenseActivated(const QString &link); + QPixmap loadPixmap(const QString &file); static const QString websiteLinkTemplate; @@ -45,13 +44,13 @@ QLabel *licenseLabel = nullptr; QLabel *companyLogoLabel = nullptr; QLabel *websiteLabel = nullptr; + QLabel *featureLabel = nullptr; + DRedPointLabel *redPointLabel = nullptr; + QLabel *acknowledgementTipLabel = nullptr; QLabel *acknowledgementLabel = nullptr; - QString logoPath; QString websiteName; QString websiteLink; - QString acknowledgementLink; - Q_DECLARE_PUBLIC(DAboutDialog) }; diff -Nru dtkwidget-5.5.48/src/widgets/private/dabstractdialogprivate_p.h dtkwidget-5.6.12/src/widgets/private/dabstractdialogprivate_p.h --- dtkwidget-5.5.48/src/widgets/private/dabstractdialogprivate_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dabstractdialogprivate_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DABSTRACTDIALOG_P_H #define DABSTRACTDIALOG_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dalertcontrol_p.h dtkwidget-5.6.12/src/widgets/private/dalertcontrol_p.h --- dtkwidget-5.5.48/src/widgets/private/dalertcontrol_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dalertcontrol_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2020 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: ck - * - * Maintainer: ck - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DALERTCONTROL_P_H #define DALERTCONTROL_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dapplication_p.h dtkwidget-5.6.12/src/widgets/private/dapplication_p.h --- dtkwidget-5.5.48/src/widgets/private/dapplication_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dapplication_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,25 +1,13 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DAPPLICATION_P_H #define DAPPLICATION_P_H -#include +#include "dsizemode.h" +#include #include #include @@ -33,6 +21,7 @@ DWIDGET_BEGIN_NAMESPACE class DAboutDialog; +class DFeatureDisplayDialog; class DApplicationPrivate : public DObjectPrivate { @@ -51,7 +40,6 @@ #endif bool loadDtkTranslator(QList localeFallback); - bool loadTranslator(QList translateDirs, const QString &name, QList localeFallback); void _q_onNewInstanceStarted(); // 为控件适应当前虚拟键盘的位置 @@ -59,6 +47,8 @@ void acclimatizeVirtualKeyboardForFocusWidget(bool allowResizeContentsMargins); void _q_panWindowContentsForVirtualKeyboard(); void _q_resizeWindowContentsForVirtualKeyboard(); + void _q_sizeModeChanged(); + void handleSizeModeChangeEvent(QWidget *widget, QEvent *event); static bool isUserManualExists(); public: @@ -74,6 +64,10 @@ QString appDescription; QString homePage; QString acknowledgementPage; + QString applicationCreditsFile; + QByteArray applicationCreditsContent; + QString licensePath; + bool acknowledgementPageVisible = true; bool visibleMenuShortcutText = false; @@ -83,6 +77,8 @@ DAppHandler *appHandler = Q_NULLPTR; DAboutDialog *aboutDialog = Q_NULLPTR; + DFeatureDisplayDialog *featureDisplayDialog = Q_NULLPTR; + DLicenseDialog *licenseDialog = Q_NULLPTR; // 需要自适应虚拟键盘环境的窗口 QPointer activeInputWindow; diff -Nru dtkwidget-5.5.48/src/widgets/private/darrowrectangle_p.h dtkwidget-5.6.12/src/widgets/private/darrowrectangle_p.h --- dtkwidget-5.5.48/src/widgets/private/darrowrectangle_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/darrowrectangle_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DARROWRECTANGLE_P_H #define DARROWRECTANGLE_P_H @@ -79,9 +66,9 @@ DArrowRectangle::FloatMode floatMode = DArrowRectangle::FloatWindow; QPointer m_content; - DPlatformWindowHandle *m_handle = NULL; - DBlurEffectWidget *m_blurBackground = NULL; - DWindowManagerHelper *m_wmHelper; + DPlatformWindowHandle *m_handle = nullptr; + DBlurEffectWidget *m_blurBackground = nullptr; + DWindowManagerHelper *m_wmHelper = nullptr; bool leftRightRadius = false; bool radiusArrowStyleEnable = false; }; diff -Nru dtkwidget-5.5.48/src/widgets/private/dblureffectwidget_p.h dtkwidget-5.6.12/src/widgets/private/dblureffectwidget_p.h --- dtkwidget-5.5.48/src/widgets/private/dblureffectwidget_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dblureffectwidget_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DBLUREFFECTWIDGET_P_H #define DBLUREFFECTWIDGET_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dboxwidget_p.h dtkwidget-5.6.12/src/widgets/private/dboxwidget_p.h --- dtkwidget-5.5.48/src/widgets/private/dboxwidget_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dboxwidget_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DBOXWIDGET_P_H #define DBOXWIDGET_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dbuttonbox_p.h dtkwidget-5.6.12/src/widgets/private/dbuttonbox_p.h --- dtkwidget-5.5.48/src/widgets/private/dbuttonbox_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dbuttonbox_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DBUTTONBOX_P_H #define DBUTTONBOX_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dcircleprogress_p.h dtkwidget-5.6.12/src/widgets/private/dcircleprogress_p.h --- dtkwidget-5.5.48/src/widgets/private/dcircleprogress_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dcircleprogress_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DCIRCLEPROGRESS_P_H #define DCIRCLEPROGRESS_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dcombobox_p.h dtkwidget-5.6.12/src/widgets/private/dcombobox_p.h --- dtkwidget-5.5.48/src/widgets/private/dcombobox_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dcombobox_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DCOMBOBOX_P_H #define DCOMBOBOX_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/ddialog_p.h dtkwidget-5.6.12/src/widgets/private/ddialog_p.h --- dtkwidget-5.5.48/src/widgets/private/ddialog_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/ddialog_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DDIALOG_P_H #define DDIALOG_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/ddrawer_p.h dtkwidget-5.6.12/src/widgets/private/ddrawer_p.h --- dtkwidget-5.5.48/src/widgets/private/ddrawer_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/ddrawer_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DDRAWER_P_H #define DDRAWER_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dfeaturedisplaydialog_p.h dtkwidget-5.6.12/src/widgets/private/dfeaturedisplaydialog_p.h --- dtkwidget-5.5.48/src/widgets/private/dfeaturedisplaydialog_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dfeaturedisplaydialog_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,71 @@ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DFEATUREDISPLAYDIALOG_P_H +#define DFEATUREDISPLAYDIALOG_P_H + +#include "dfeaturedisplaydialog.h" +#include "ddialog_p.h" + +DWIDGET_BEGIN_NAMESPACE +class DCommandLinkButton; + +class DFeatureItemWidget : public QWidget +{ + Q_OBJECT +public: + explicit DFeatureItemWidget(const QIcon &icon = QIcon(), const QString &name = QString(), const QString &description = QString(), QWidget *parent = nullptr); + virtual ~DFeatureItemWidget() override; + + void setDescriptionLabelWidth(const int width); + int descriptionLabelWidth(); + +private: + QLabel *m_iconLabel = nullptr; + QLabel *m_featureNameLabel = nullptr; + QLabel *m_featureDescriptionLabel = nullptr; +}; + +class DFeatureItemPrivate: public Core::DObjectPrivate +{ +public: + explicit DFeatureItemPrivate(Core::DObject *qq, const QIcon &icon, + const QString &name = QString(), const QString &description = QString()); + ~DFeatureItemPrivate() override; + + QIcon m_icon; + QString m_name; + QString m_description; +}; + +class DFeatureDisplayDialogPrivate : public DDialogPrivate +{ +protected: + explicit DFeatureDisplayDialogPrivate(DFeatureDisplayDialog *qq); + +private: + void init(); + void addFeatureItem(const QIcon &icon, const QString &name, const QString &description); + int getDescriptionMaxWidth(); + void updateItemWidth(); + void createWidgetItems(); + void deleteItems(); + void clearLayout(); + +private: + QLabel *m_title = nullptr; + QVBoxLayout *m_vBoxLayout = nullptr; + DCommandLinkButton *m_linkBtn = nullptr; + QString m_linkUrl; + QList> m_featureItems; + + Q_DECLARE_PUBLIC(DFeatureDisplayDialog) + +private: + void _q_toggleLinkBtn(); +}; + +DWIDGET_END_NAMESPACE + +#endif // DFEATUREDISPLAYDIALOG_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dfilechooseredit_p.h dtkwidget-5.6.12/src/widgets/private/dfilechooseredit_p.h --- dtkwidget-5.5.48/src/widgets/private/dfilechooseredit_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dfilechooseredit_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DFILECHOOSEREDIT_P_H #define DFILECHOOSEREDIT_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dfloatingmessage_p.h dtkwidget-5.6.12/src/widgets/private/dfloatingmessage_p.h --- dtkwidget-5.5.48/src/widgets/private/dfloatingmessage_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dfloatingmessage_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DFLOATINGMESSAGE_P_H #define DFLOATINGMESSAGE_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dfloatingwidget_p.h dtkwidget-5.6.12/src/widgets/private/dfloatingwidget_p.h --- dtkwidget-5.5.48/src/widgets/private/dfloatingwidget_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dfloatingwidget_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DFLOATINGWIDGET_P_H #define DFLOATINGWIDGET_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dflowlayout_p.h dtkwidget-5.6.12/src/widgets/private/dflowlayout_p.h --- dtkwidget-5.5.48/src/widgets/private/dflowlayout_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dflowlayout_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DFLOWLAYOUT_P_H #define DFLOWLAYOUT_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dframe_p.h dtkwidget-5.6.12/src/widgets/private/dframe_p.h --- dtkwidget-5.5.48/src/widgets/private/dframe_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dframe_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2011 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: sunkang - * - * Maintainer: sunkang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DFRAME_P_H #define DFRAME_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/diconbutton_p.h dtkwidget-5.6.12/src/widgets/private/diconbutton_p.h --- dtkwidget-5.5.48/src/widgets/private/diconbutton_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/diconbutton_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,29 +1,13 @@ -/* - * Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: zccrs - * - * Maintainer: zccrs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DICONBUTTON_P_H #define DICONBUTTON_P_H #include #include - +#include DWIDGET_BEGIN_NAMESPACE class DIconButtonPrivate : public DCORE_NAMESPACE::DObjectPrivate @@ -34,6 +18,7 @@ bool flat = false; qint64 iconType = -1; bool circleStatus = false; + DDciIcon dciIcon; D_DECLARE_PUBLIC(DIconButton) }; diff -Nru dtkwidget-5.5.48/src/widgets/private/dimagebutton_p.h dtkwidget-5.6.12/src/widgets/private/dimagebutton_p.h --- dtkwidget-5.5.48/src/widgets/private/dimagebutton_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dimagebutton_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: kirigaya - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DIMAGEBUTTON_P_H #define DIMAGEBUTTON_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dimagevieweritems.cpp dtkwidget-5.6.12/src/widgets/private/dimagevieweritems.cpp --- dtkwidget-5.5.48/src/widgets/private/dimagevieweritems.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dimagevieweritems.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,596 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "dimagevieweritems_p.h" + +#include +#include +#include +#include +#include +#include +#include + +DGUI_USE_NAMESPACE +DWIDGET_BEGIN_NAMESPACE + +DGraphicsPixmapItem::DGraphicsPixmapItem(QGraphicsItem *parent) + : QGraphicsPixmapItem(parent) +{ +} + +DGraphicsPixmapItem::DGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent) + : QGraphicsPixmapItem(pixmap, parent) +{ +} + +DGraphicsPixmapItem::~DGraphicsPixmapItem() +{ + prepareGeometryChange(); +} + +void DGraphicsPixmapItem::setPixmap(const QPixmap &pixmap) +{ + cachePixmap = qMakePair(cachePixmap.first, pixmap); + QGraphicsPixmapItem::setPixmap(pixmap); +} + +void DGraphicsPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + const QTransform ts = painter->transform(); + + if (ts.type() == QTransform::TxScale && ts.m11() < 1) { + QPixmap currentPixmap = pixmap(); + if (currentPixmap.width() < 10000 && currentPixmap.height() < 10000) { + painter->setRenderHint(QPainter::SmoothPixmapTransform, (transformationMode() == Qt::SmoothTransformation)); + + QPixmap pixmap; + if (qIsNull(cachePixmap.first - ts.m11())) { + pixmap = cachePixmap.second; + } else { + pixmap = currentPixmap.transformed(painter->transform(), transformationMode()); + cachePixmap = qMakePair(ts.m11(), pixmap); + } + + pixmap.setDevicePixelRatio(painter->device()->devicePixelRatioF()); + painter->resetTransform(); + painter->drawPixmap(offset() + QPointF(ts.dx(), ts.dy()), pixmap); + painter->setTransform(ts); + } else { + QGraphicsPixmapItem::paint(painter, option, widget); + } + } else { + QGraphicsPixmapItem::paint(painter, option, widget); + } +} + +DGraphicsMovieItem::DGraphicsMovieItem(QGraphicsItem *parent) + : QGraphicsPixmapItem(parent) +{ + movie = new QMovie; + QObject::connect(movie, &QMovie::frameChanged, this, &DGraphicsMovieItem::onMovieFrameChanged); +} + +DGraphicsMovieItem::DGraphicsMovieItem(const QString &fileName, QGraphicsItem *parent) + : QGraphicsPixmapItem(fileName, parent) +{ + movie = new QMovie; + QObject::connect(movie, &QMovie::frameChanged, this, &DGraphicsMovieItem::onMovieFrameChanged); + setFileName(fileName); +} + +DGraphicsMovieItem::~DGraphicsMovieItem() +{ + prepareGeometryChange(); + + movie->stop(); + movie->deleteLater(); + movie = nullptr; +} + +void DGraphicsMovieItem::onMovieFrameChanged() +{ + setPixmap(movie->currentPixmap()); +} + +void DGraphicsMovieItem::setFileName(const QString &fileName) +{ + movie->stop(); + movie->setFileName(fileName); + movie->start(); + + update(); +} + +DGraphicsSVGItem::DGraphicsSVGItem(QGraphicsItem *parent) + : QGraphicsObject(parent) +{ + renderer = new DSvgRenderer(this); +} + +DGraphicsSVGItem::DGraphicsSVGItem(const QString &fileName, QGraphicsItem *parent) + : QGraphicsObject(parent) +{ + renderer = new DSvgRenderer(this); + renderer->load(fileName); + updateDefaultSize(); +} + +void DGraphicsSVGItem::setFileName(const QString &fileName) +{ + // Clear cached image. + CacheMode mode = cacheMode(); + setCacheMode(QGraphicsItem::NoCache); + renderer->load(fileName); + updateDefaultSize(); + + setCacheMode(mode); + update(); +} + +QRectF DGraphicsSVGItem::boundingRect() const +{ + return imageRect; +} + +void DGraphicsSVGItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + Q_UNUSED(option); + Q_UNUSED(widget); + + if (!renderer->isValid()) { + return; + } + renderer->render(painter, imageRect); +} + +int DGraphicsSVGItem::type() const +{ + return Type; +} + +void DGraphicsSVGItem::updateDefaultSize() +{ + QRectF bounds = QRectF(QPointF(0, 0), renderer->defaultSize()); + + if (bounds.size() != imageRect.size()) { + prepareGeometryChange(); + imageRect.setSize(bounds.size()); + } +} + +DGraphicsCropItem::DGraphicsCropItem(QGraphicsItem *parent) + : QGraphicsItem(parent) +{ + updateContentItem(parent); + setZValue(100); +} + +void DGraphicsCropItem::updateContentItem(QGraphicsItem *parentItem) +{ + setParentItem(parentItem); + + if (parentItem) { + QRectF parentRect = parentItem->boundingRect(); + originalParentRect = QRectF(0, 0, parentRect.width(), parentRect.height()); + itemRect = originalParentRect; + } else { + itemRect = QRectF(); + originalParentRect = QRectF(); + } + + update(); +} + +void DGraphicsCropItem::setCropMode(CropMode mode) +{ + internalCropMode = mode; + + // CropFree will do nothing, using current item rect. + switch (internalCropMode) { + case CropOriginal: + itemRect = originalParentRect; + break; + case AspectRatio1x1: + setAspectRatio(1.0, 1.0); + break; + case AspectRatio16x9: + setAspectRatio(16, 9); + break; + case AspectRatio9x16: + setAspectRatio(9.0, 16.0); + break; + case AspectRatio4x3: + setAspectRatio(4.0, 3.0); + break; + case AspectRatio3x4: + setAspectRatio(3.0, 4.0); + break; + case AspectRatio3x2: + setAspectRatio(3.0, 2.0); + break; + case AspectRatio2x3: + setAspectRatio(2.0, 3.0); + break; + default: + break; + } + + update(); +} + +DGraphicsCropItem::CropMode DGraphicsCropItem::cropMode() const +{ + return internalCropMode; +} + +void DGraphicsCropItem::setAspectRatio(qreal w, qreal h) +{ + qreal calcWidth = originalParentRect.width(); + qreal calcHeight = calcWidth * h / w; + // Check parent item rotate. + if (parentItem()) { + int rotate = qRound(parentItem()->rotation()); + if (rotate % 180) { + calcHeight = calcWidth * w / h; + } + } + + // Make sure parent rectangle contain item rectangle. + if (calcWidth > originalParentRect.width() || calcHeight > originalParentRect.height()) { + qreal aspectRatio = originalParentRect.width() / originalParentRect.height(); + qreal calcRatio = calcWidth / calcHeight; + if (calcRatio > aspectRatio) { + calcWidth = originalParentRect.width(); + calcHeight = (calcWidth / calcRatio); + } else { + calcHeight = originalParentRect.height(); + calcWidth = calcHeight * calcRatio; + } + } + + // Move rectangle to center. + QPointF center = originalParentRect.center(); + QPointF topLeft = center - QPointF(calcWidth / 2, calcHeight / 2); + QPointF bottomRight = center + QPointF(calcWidth / 2, calcHeight / 2); + itemRect = QRectF(topLeft, bottomRight); + + update(); +} + +void DGraphicsCropItem::setRect(const QRectF &rect) +{ + prepareGeometryChange(); + itemRect = validRect(rect); + + update(); +} + +void DGraphicsCropItem::setSize(qreal width, qreal height) +{ + prepareGeometryChange(); + itemRect = validRect(itemRect.adjusted(0, 0, width, height)); + update(); +} + +void DGraphicsCropItem::move(qreal x, qreal y) +{ + prepareGeometryChange(); + itemRect.moveTo(x, y); + update(); +} + +QRect DGraphicsCropItem::cropRect() const +{ + return mapRectToParent(itemRect).toRect(); +} + +void DGraphicsCropItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + Q_UNUSED(option); + Q_UNUSED(widget); + + painter->setClipping(false); + QColor activeColor = QColor(Qt::cyan); + qreal penWidth = 0; + if (parentItem() && !qFuzzyIsNull(parentItem()->rotation())) { + auto transform = painter->worldTransform(); + transform.rotate(-parentItem()->rotation()); + penWidth = 1.0 / transform.m11(); + } else { + penWidth = 1.0 / painter->worldTransform().m11(); + } + + QRectF rct = itemRect.adjusted(penWidth, penWidth, -penWidth, -penWidth); + QPen pen; + pen.setStyle(Qt::SolidLine); + pen.setColor(QColor("#EDEDED")); + pen.setWidthF(penWidth * 3); + + // Draw the lines that divide the rectangle. + painter->save(); + painter->setPen(pen); + drawTrisectorRect(painter); + painter->restore(); + + // Draw border shadow, shadow witdh is 5 times the width of pen. + painter->save(); + QPen rectPen(pen); + rectPen.setStyle(Qt::SolidLine); + QColor rectColor(activeColor); + rectColor.setAlpha(26); + rectPen.setColor(rectColor); + rectPen.setWidthF(penWidth * 5); + painter->setPen(rectPen); + painter->setBrush(Qt::NoBrush); + painter->drawRect(rct); + painter->restore(); + + painter->save(); + rectPen.setStyle(Qt::DashLine); + rectPen.setColor(activeColor); + rectPen.setWidthF(penWidth); + painter->setPen(rectPen); + painter->setBrush(Qt::NoBrush); + painter->drawRect(rct); + painter->restore(); + + painter->save(); + drawCornerHandle(painter); + painter->restore(); + + // Draw cross fill background. + painter->save(); + QRectF sceneRct = scene()->sceneRect(); + QRectF itemSceneRect = sceneBoundingRect(); + QRegion r1(sceneRct.toRect()); + QRegion r2(itemSceneRect.toRect()); + QRegion r3 = r2.subtracted(r1); + QPainterPath path; + path.addRegion(r3); + + QColor background(activeColor); + background.setAlpha(26); + painter->setPen(Qt::NoPen); + painter->setBrush(background); + painter->drawPath(path); + painter->restore(); +} + +void DGraphicsCropItem::drawTrisectorRect(QPainter *painter) +{ + qreal penWidth = 0; + if (parentItem() && !qFuzzyIsNull(parentItem()->rotation())) { + auto transform = painter->worldTransform(); + transform.rotate(-parentItem()->rotation()); + penWidth = 1.0 / transform.m11(); + } else { + penWidth = 1.0 / painter->worldTransform().m11(); + } + QPainterPath path; + QRectF rct = itemRect.adjusted(penWidth, penWidth, -penWidth, -penWidth); + path.moveTo(rct.x(), rct.y() + rct.height() / 3); + path.lineTo(rct.x() + rct.width(), rct.y() + rct.height() / 3); + + path.moveTo(rct.x(), rct.y() + rct.height() / 3 * 2); + path.lineTo(rct.x() + rct.width(), rct.y() + rct.height() / 3 * 2); + + path.moveTo(rct.x() + rct.width() / 3, rct.y()); + path.lineTo(rct.x() + rct.width() / 3, rct.y() + rct.height()); + + path.moveTo(rct.x() + rct.width() / 3 * 2, rct.y()); + path.lineTo(rct.x() + rct.width() / 3 * 2, rct.y() + rct.height()); + + painter->drawPath(path); +} + +void DGraphicsCropItem::drawCornerHandle(QPainter *painter) +{ + QGraphicsView *view = contentView(); + if (!view) { + return; + } + + qreal penWidth = 0; + if (parentItem() && !qFuzzyIsNull(parentItem()->rotation())) { + auto transform = painter->worldTransform(); + transform.rotate(-parentItem()->rotation()); + penWidth = 1.0 / transform.m11(); + } else { + penWidth = 1.0 / painter->worldTransform().m11(); + } + QRectF rct = itemRect.adjusted(penWidth, penWidth, -penWidth, -penWidth); + + const qreal minlenth = 24; + qreal scale = view->transform().m11(); + qreal showW = itemRect.width() * scale; + qreal showH = itemRect.height() * scale; + + if (showW < minlenth || showH < minlenth) { + // When the clipping area is smaller than the corner picture, the brush is drawn + QPen pen(painter->pen()); + pen.setWidthF(1.0); + pen.setColor(QColor("#EDEDED")); + pen.setStyle(Qt::SolidLine); + + painter->setPen(pen); + painter->setBrush(Qt::NoBrush); + painter->drawRect(rct); + + QLineF topLine = QLineF(rct.topLeft(), rct.topRight()); + QLineF botLine = QLineF(rct.bottomLeft(), rct.bottomRight()); + QLineF leftLine = QLineF(rct.topLeft(), rct.bottomLeft()); + QLineF rightLine = QLineF(rct.topRight(), rct.bottomRight()); + + painter->drawLine(topLine.p1(), topLine.center()); + painter->drawLine(rightLine.p1(), rightLine.center()); + painter->drawLine(botLine.center(), botLine.p2()); + painter->drawLine(leftLine.center(), leftLine.p2()); + + painter->drawLine(topLine.center(), topLine.p2()); + painter->drawLine(rightLine.center(), rightLine.p2()); + painter->drawLine(botLine.center(), botLine.p1()); + painter->drawLine(leftLine.center(), leftLine.p1()); + } else { + painter->save(); + + int pixWidth = 20; + int offset = 2; + int offsetWidth = 18; + + auto painterTopLeft = view->mapFromScene(sceneBoundingRect().topLeft()); + auto painterBottomRight = view->mapFromScene(sceneBoundingRect().bottomRight()); + rct = QRectF(painterTopLeft, painterBottomRight); + + // Reset tranform, keep corner same size + painter->resetTransform(); + + // Draw four corner handles. + QPixmap cornerPixmap = QIcon::fromTheme("selection_topleft").pixmap(QSize(pixWidth, pixWidth)); + QRectF cornerRect = QRectF(painterTopLeft + QPointF(-offset, -offset), painterTopLeft + QPointF(pixWidth, pixWidth)); + painter->drawPixmap(cornerRect, cornerPixmap, QRectF(0, 0, cornerPixmap.width(), cornerPixmap.height())); + + cornerPixmap = QIcon::fromTheme("selection_topright").pixmap(QSize(pixWidth, pixWidth)); + cornerRect = + QRectF(QPointF(painterBottomRight.x() - offsetWidth, painterTopLeft.y() - offset), QSizeF(pixWidth, pixWidth)); + painter->drawPixmap(cornerRect, cornerPixmap, QRectF(0, 0, cornerPixmap.width(), cornerPixmap.height())); + + cornerPixmap = QIcon::fromTheme("selection_bottomright").pixmap(QSize(pixWidth, pixWidth)); + cornerRect = QRectF(rct.bottomRight() + QPointF(-pixWidth, -pixWidth), rct.bottomRight() + QPointF(offset, offset)); + painter->drawPixmap(cornerRect, cornerPixmap, QRectF(0, 0, cornerPixmap.width(), cornerPixmap.height())); + + cornerPixmap = QIcon::fromTheme("selection_bottomleft").pixmap(QSize(pixWidth, pixWidth)); + cornerRect = QRectF(QPointF(rct.x() - offset, rct.y() + rct.height() - offsetWidth), QSizeF(pixWidth, pixWidth)); + painter->drawPixmap(cornerRect, cornerPixmap, QRectF(0, 0, cornerPixmap.width(), cornerPixmap.height())); + + painter->restore(); + } +} + +QRectF DGraphicsCropItem::boundingRect() const +{ + return itemRect; +} + +void DGraphicsCropItem::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + if (!mousePressed) { + handleType = detectHandleType(event->scenePos()); + mousePressed = true; + } +} + +void DGraphicsCropItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) +{ + if (mousePressed) { + QPointF offset = event->pos() - event->lastPos(); + QRectF newRect = itemRect; + updateRect(newRect, offset, handleType); + + if (newRect != itemRect) { + itemRect = newRect; + update(); + } + } +} + +void DGraphicsCropItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +{ + Q_UNUSED(event); + if (mousePressed) { + // Reset handle mode. + handleType = Move; + mousePressed = false; + } +} + +DGraphicsCropItem::MoveHandleType DGraphicsCropItem::detectHandleType(const QPointF &mousePoint) const +{ + MoveHandleType type = Move; + QGraphicsView *view = contentView(); + if (view) { + QRectF itemSceneRect = sceneBoundingRect(); + QPointF itemViewTopLeft = view->mapFromScene(itemSceneRect.topLeft()); + QPointF itemViewBottomRight = view->mapFromScene(itemSceneRect.bottomRight()); + QRectF itemViewRect(itemViewTopLeft, itemViewBottomRight); + QPointF mouseViewPoint = view->mapFromScene(mousePoint); + + // Detect which corner handle. + if (itemViewRect.left() <= mouseViewPoint.x() && mouseViewPoint.x() <= itemViewRect.left() + HandleSize) { + if (itemViewRect.top() <= mouseViewPoint.y() && mouseViewPoint.y() <= itemViewRect.top() + HandleSize) { + type = TopLeft; + } else if (itemViewRect.bottom() - HandleSize <= mouseViewPoint.y() && mouseViewPoint.y() <= itemViewRect.bottom()) { + type = BottomLeft; + } + } else if (itemViewRect.right() - HandleSize <= mouseViewPoint.x() && mouseViewPoint.x() <= itemViewRect.right()) { + if (itemViewRect.top() <= mouseViewPoint.y() && mouseViewPoint.y() <= itemViewRect.top() + HandleSize) { + type = TopRight; + } else if (itemViewRect.bottom() - HandleSize <= mouseViewPoint.y() && mouseViewPoint.y() <= itemViewRect.bottom()) { + type = BottomRight; + } + } + } + + // Warning: Must refactor code while the enum MoveHandleType changed. + if (Move != type && parentItem()) { + // Adjust handle type while parent item is rotate. + int rotation = qRound(parentItem()->rotation()); + int rotate90Count = rotation / 90; + + // 4 is corner enum count. + type = MoveHandleType((int(type) + 4 - rotate90Count) % 4); + } + + return type; +} + +void DGraphicsCropItem::updateRect(QRectF &rect, const QPointF &offset, MoveHandleType type) +{ + switch (type) { + case Move: // Move top left point, not resize. + rect.moveTop(qBound(0, rect.top() + offset.y(), originalParentRect.height() - rect.height())); + rect.moveLeft(qBound(0, rect.left() + offset.x(), originalParentRect.width() - rect.width())); + break; + case TopLeft: // Will change item rectangle. + rect.setTop(qBound(0, rect.top() + offset.y(), rect.bottom() - MinimalSize)); + rect.setLeft(qBound(0, rect.left() + offset.x(), rect.right() - MinimalSize)); + break; + case TopRight: + rect.setTop(qBound(0, rect.top() + offset.y(), rect.bottom() - MinimalSize)); + rect.setRight(qBound(MinimalSize, rect.right() + offset.x(), originalParentRect.width())); + break; + case BottomRight: + rect.setBottom(qBound(MinimalSize, rect.bottom() + offset.y(), originalParentRect.height())); + rect.setRight(qBound(MinimalSize, rect.right() + offset.x(), originalParentRect.width())); + break; + case BottomLeft: + rect.setBottom(qBound(MinimalSize, rect.bottom() + offset.y(), originalParentRect.height())); + rect.setLeft(qBound(0, rect.left() + offset.x(), rect.right() - MinimalSize)); + break; + default: + break; + } +} + +QRectF DGraphicsCropItem::validRect(const QRectF &rect) const +{ + if (parentItem()) { + return rect.intersected(parentItem()->boundingRect()); + } + return rect; +} + +QGraphicsView *DGraphicsCropItem::contentView() const +{ + if (scene()) { + auto viewList = scene()->views(); + if (!viewList.isEmpty()) { + return viewList.first(); + } + } + + return nullptr; +} + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/private/dimagevieweritems_p.h dtkwidget-5.6.12/src/widgets/private/dimagevieweritems_p.h --- dtkwidget-5.5.48/src/widgets/private/dimagevieweritems_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dimagevieweritems_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DIMAGEVIEWERITEMS_P_H +#define DIMAGEVIEWERITEMS_P_H + +#include +#include + +#include + +class QMovie; +class QGraphicsView; + +DWIDGET_BEGIN_NAMESPACE + +class DGraphicsPixmapItem : public QGraphicsPixmapItem +{ +public: + explicit DGraphicsPixmapItem(QGraphicsItem *parent = nullptr); + explicit DGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent = nullptr); + ~DGraphicsPixmapItem() Q_DECL_OVERRIDE; + + void setPixmap(const QPixmap &pixmap); + +protected: + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; + +private: + QPair cachePixmap; +}; + +class DGraphicsMovieItem : public QObject, public QGraphicsPixmapItem +{ + Q_OBJECT +public: + explicit DGraphicsMovieItem(QGraphicsItem *parent = nullptr); + explicit DGraphicsMovieItem(const QString &fileName, QGraphicsItem *parent = nullptr); + ~DGraphicsMovieItem() Q_DECL_OVERRIDE; + + void setFileName(const QString &fileName); + +private: + Q_SLOT void onMovieFrameChanged(); + +private: + QMovie *movie; +}; + +class DGraphicsSVGItem : public QGraphicsObject +{ +public: + explicit DGraphicsSVGItem(QGraphicsItem *parent = nullptr); + explicit DGraphicsSVGItem(const QString &fileName, QGraphicsItem *parent = nullptr); + + void setFileName(const QString &fileName); + + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) Q_DECL_OVERRIDE; + + enum { Type = QGraphicsItem::UserType + 1 }; + int type() const Q_DECL_OVERRIDE; + +private: + void updateDefaultSize(); + +private: + DGUI_NAMESPACE::DSvgRenderer *renderer = nullptr; + QRectF imageRect; +}; + +class DGraphicsCropItem : public QGraphicsItem +{ +public: + explicit DGraphicsCropItem(QGraphicsItem *parent = nullptr); + void updateContentItem(QGraphicsItem *parentItem); + + enum CropMode { + CropOriginal, + CropFree, + AspectRatio1x1, + AspectRatio16x9, + AspectRatio9x16, + AspectRatio4x3, + AspectRatio3x4, + AspectRatio3x2, + AspectRatio2x3 + }; + void setCropMode(CropMode mode); + CropMode cropMode() const; + void setAspectRatio(qreal w, qreal h); + + void setRect(const QRectF &rect); + void setSize(qreal width, qreal height); + void move(qreal x, qreal y); + + QRect cropRect() const; + +protected: + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; + QRectF boundingRect() const Q_DECL_OVERRIDE; + void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + +private: + void drawTrisectorRect(QPainter *painter); + void drawCornerHandle(QPainter *painter); + + enum MoveHandleType { TopLeft, TopRight, BottomRight, BottomLeft, Move }; + MoveHandleType detectHandleType(const QPointF &mousePoint) const; + void updateRect(QRectF &rect, const QPointF &offset, MoveHandleType type); + QRectF validRect(const QRectF &rect) const; + QGraphicsView *contentView() const; + +private: + QRectF itemRect; + QRectF originalParentRect; + CropMode internalCropMode = CropFree; + + enum StaticProperty { HandleSize = 20, MinimalSize = 40 }; + MoveHandleType handleType = Move; + bool mousePressed = false; +}; + +DWIDGET_END_NAMESPACE + +#endif // DIMAGEVIEWERITEMS_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dimageviewer_p.h dtkwidget-5.6.12/src/widgets/private/dimageviewer_p.h --- dtkwidget-5.5.48/src/widgets/private/dimageviewer_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dimageviewer_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,98 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DIMAGEVIEWER_P_H +#define DIMAGEVIEWER_P_H + +#include "dimageviewer.h" +#include + +class QGestureEvent; +class QPinchGesture; +class QImageReader; +class QGraphicsRectItem; + +DWIDGET_BEGIN_NAMESPACE +class DGraphicsCropItem; + +/*! \internal */ +enum ImageType { + ImageTypeBlank = 0, //!@~english Empty image or unsupported formats. + ImageTypeStatic, //!@~english Normal image format. + ImageTypeDynamic, //!@~english Dynamic image format,e.g.:*.jpg *.webp + ImageTypeSvg, //!@~english SVG image format. +}; + +class DImageViewerPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate +{ + D_DECLARE_PUBLIC(DImageViewer) + +public: + explicit DImageViewerPrivate(DImageViewer *qq); + ~DImageViewerPrivate() Q_DECL_OVERRIDE; + + void init(); + ImageType detectImageType(const QString &fileName) const; + void resetItem(ImageType type); + QImage loadImage(const QString &fileName, ImageType type) const; + + void updateItemAndSceneRect(); + bool rotatable() const; + bool isRotateVertical() const; + qreal validRotateAngle(qreal angle) const; + + qreal validScaleFactor(qreal scale) const; + inline qreal imageRelativeScale() const { return q_func()->transform().m11(); } + qreal widgetRelativeScale() const; + + void checkPinchData(); + void handleGestureEvent(QGestureEvent *gesture); + void pinchTriggered(QPinchGesture *gesture); + void playRotationAnimation(); + void _q_pinchAnimeFinished(); + + void checkCropData(); + void resetCropData(); + + void handleMousePressEvent(QMouseEvent *event); + void handleMouseReleaseEvent(QMouseEvent *event); + void handleResizeEvent(QResizeEvent *event); + +private: + QGraphicsRectItem *proxyItem = nullptr; + QGraphicsItem *contentItem = nullptr; + ImageType imageType = ImageType::ImageTypeBlank; + QImage contentImage; + QString fileName; + + enum FitFlag { Unfit, FitWidget, FitNotmalSize }; + FitFlag fitFlag = Unfit; + qreal scaleFactor = 1.0; + int clickStartPointX = 0; + int maxTouchPoints = 0; + + struct PinchData + { + bool isFirstPinch = false; + bool isAnimationRotating = false; + int startTouchPointX = 0; + qreal rotationTouchAngle = 0; + int storeItemAngle = 0; + int rotationEndValue = 0; + QPointF centerPoint; + }; + PinchData *pinchData = nullptr; + + struct CropData + { + DGraphicsCropItem *cropItem = nullptr; + QRect cropRect; + bool cropping = false; + }; + CropData *cropData = nullptr; +}; + +DWIDGET_END_NAMESPACE + +#endif // DIMAGEVIEWER_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dinputdialog_p.h dtkwidget-5.6.12/src/widgets/private/dinputdialog_p.h --- dtkwidget-5.5.48/src/widgets/private/dinputdialog_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dinputdialog_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DINPUTDIALOG_P_H #define DINPUTDIALOG_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dipv4lineedit_p.h dtkwidget-5.6.12/src/widgets/private/dipv4lineedit_p.h --- dtkwidget-5.5.48/src/widgets/private/dipv4lineedit_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dipv4lineedit_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,26 +1,14 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DIPV4LINEEDIT_P_H #define DIPV4LINEEDIT_P_H -#include "dlineedit_p.h" #include #include +#include +#include DWIDGET_BEGIN_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/private/dkeysequenceedit_p.h dtkwidget-5.6.12/src/widgets/private/dkeysequenceedit_p.h --- dtkwidget-5.5.48/src/widgets/private/dkeysequenceedit_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dkeysequenceedit_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DKEYSEQUENCEEDIT_P_H #define DKEYSEQUENCEEDIT_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dlabel_p.h dtkwidget-5.6.12/src/widgets/private/dlabel_p.h --- dtkwidget-5.5.48/src/widgets/private/dlabel_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dlabel_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2011 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: wp - * - * Maintainer: wp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DLABEL_P_H #define DLABEL_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dlineedit_p.h dtkwidget-5.6.12/src/widgets/private/dlineedit_p.h --- dtkwidget-5.5.48/src/widgets/private/dlineedit_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dlineedit_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DLINEEDIT_P_H #define DLINEEDIT_P_H @@ -24,6 +11,7 @@ #include #include #include +#include DWIDGET_BEGIN_NAMESPACE @@ -38,6 +26,15 @@ void init(); + static inline QSize defaultIconSize() + { + return DSizeModeHelper::element(QSize(18, 18), QSize(24, 24)); + } + static inline int defaultButtonWidth() + { + return DSizeModeHelper::element(28, 40); + } + DAlertControl *control{nullptr}; QWidget *leftWidget; diff -Nru dtkwidget-5.5.48/src/widgets/private/dlistview_p.h dtkwidget-5.6.12/src/widgets/private/dlistview_p.h --- dtkwidget-5.5.48/src/widgets/private/dlistview_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dlistview_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DLISTVIEW_P_H #define DLISTVIEW_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dloadingindicator_p.h dtkwidget-5.6.12/src/widgets/private/dloadingindicator_p.h --- dtkwidget-5.5.48/src/widgets/private/dloadingindicator_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dloadingindicator_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DLOADINGINDICATOR_P #define DLOADINGINDICATOR_P diff -Nru dtkwidget-5.5.48/src/widgets/private/dmainwindow_p.h dtkwidget-5.6.12/src/widgets/private/dmainwindow_p.h --- dtkwidget-5.5.48/src/widgets/private/dmainwindow_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dmainwindow_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DMAINWINDOW_P_H #define DMAINWINDOW_P_H @@ -28,6 +15,87 @@ DWIDGET_BEGIN_NAMESPACE +class DSidebarHelper : public QObject +{ + Q_OBJECT + Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged) + Q_PROPERTY(bool expanded READ expanded WRITE setExpanded NOTIFY expandChanged) + Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged) + Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged) + +public: + DSidebarHelper(QObject *parent = nullptr) : QObject (parent){ } + virtual~DSidebarHelper(){} + + QColor backgroundColor() const + { + return m_backgroundColor; + } + void setBackgroundColor(QColor backgroundColor) + { + if (m_backgroundColor == backgroundColor) + return; + + m_backgroundColor = backgroundColor; + Q_EMIT backgroundColorChanged(m_backgroundColor); + } + + bool visible() const + { + return m_visible; + } + + void setVisible(bool visible) + { + if (m_visible == visible) + return; + + m_visible = visible; + Q_EMIT visibleChanged(m_visible); + } + + bool expanded() const + { + return m_expanded; + } + + void setExpanded(bool expanded) + { + if (m_expanded == expanded) + return; + + m_expanded = expanded; + Q_EMIT expandChanged(m_expanded); + } + + int width() const + { + return m_width; + } + + void setWidth(int width) + { + if (m_width == width) + return; + + m_width = width; + Q_EMIT widthChanged(m_width); + } + +Q_SIGNALS: + void backgroundColorChanged(QColor backgroundColor); + void visibleChanged(bool visible); + void expandChanged(bool expanded); + void widthChanged(int width); + +private: + bool m_visible = true; + bool m_expanded = true; + int m_width = -1; + QColor m_backgroundColor; + +}; + class DPlatformWindowHandle; class DTitlebar; class DMainWindowPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate @@ -42,9 +110,13 @@ DTitlebar *titlebar = Q_NULLPTR; DShadowLine *titleShadow = nullptr; QShortcut *help = Q_NULLPTR; + DSidebarHelper *sidebarHelper = nullptr; + QWidget *sidebarWidget = nullptr; + QToolBar *tb = nullptr; private: D_DECLARE_PUBLIC(DMainWindow) + void _q_autoShowFeatureDialog(); }; DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/private/dmpriscontrol_p.h dtkwidget-5.6.12/src/widgets/private/dmpriscontrol_p.h --- dtkwidget-5.5.48/src/widgets/private/dmpriscontrol_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dmpriscontrol_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DMPRISCONTROL_P_H #define DMPRISCONTROL_P_H @@ -24,8 +11,8 @@ #include #include #include -#include "private/mpris/dbusmpris.h" -#include "private/mpris/dmprismonitor.h" +#include "mpris/dbusmpris.h" +#include "mpris/dmprismonitor.h" #include diff -Nru dtkwidget-5.5.48/src/widgets/private/dpageindicator_p.h dtkwidget-5.6.12/src/widgets/private/dpageindicator_p.h --- dtkwidget-5.5.48/src/widgets/private/dpageindicator_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dpageindicator_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DPAGEINDICATOR_P_H #define DPAGEINDICATOR_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dpalettehelper_p.h dtkwidget-5.6.12/src/widgets/private/dpalettehelper_p.h --- dtkwidget-5.5.48/src/widgets/private/dpalettehelper_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dpalettehelper_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DPALETTEHELPER_P_H #define DPALETTEHELPER_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dpasswordedit_p.h dtkwidget-5.6.12/src/widgets/private/dpasswordedit_p.h --- dtkwidget-5.5.48/src/widgets/private/dpasswordedit_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dpasswordedit_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DPASSWORDEDIT_P_H #define DPASSWORDEDIT_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dpicturesequenceview_p.h dtkwidget-5.6.12/src/widgets/private/dpicturesequenceview_p.h --- dtkwidget-5.5.48/src/widgets/private/dpicturesequenceview_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dpicturesequenceview_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DPICTURESEQUENCEVIEW_P_H #define DPICTURESEQUENCEVIEW_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dprintpreviewdialog_p.h dtkwidget-5.6.12/src/widgets/private/dprintpreviewdialog_p.h --- dtkwidget-5.5.48/src/widgets/private/dprintpreviewdialog_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dprintpreviewdialog_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,27 +1,12 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: chengyulong -* -* Maintainer: chengyulong -* -* 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 -* any later version. -* -* This program 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 . -*/ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DPRINTPREVIEWDIALOG_P_H #define DPRINTPREVIEWDIALOG_P_H +#include "dprintpreviewsettinginterface.h" + #include #include "ddialog_p.h" #include @@ -32,6 +17,7 @@ #include #include #include +#include class QVBoxLayout; class QButtonGroup; @@ -51,6 +37,7 @@ class DSlider; class DBackgroundGroup; class DToolButton; +class PreviewSettingsPluginHelper; class DPrintPreviewDialogPrivate : public DDialogPrivate { public: @@ -91,13 +78,20 @@ void tipSelected(TipsNum tipNum); QVector checkDuplication(QVector data); + void updateSubControlSettings(DPrintPreviewSettingInfo::SettingType setting); + void updateAllControlSettings(); + void updateAllContentSettings_impl(); + void updateAllControlStatus(); + void setEnable(const int &value, DComboBox *combox); //控件可用 void setTurnPageBtnStatus(); void watermarkTypeChoosed(int index); void customPictureWatermarkChoosed(const QString &filename); - void waterMarkBtnClicked(bool isClicked); + void waterMarkBtnClicked(bool checked); void disablePrintSettings(); void setPageLayoutEnable(const bool &checked); + void matchFitablePageSize(); + bool isActualPrinter(const QString &name); void _q_printerChanged(int index); void _q_pageRangeChanged(int index); @@ -200,9 +194,43 @@ DWidget *inorderwdg = nullptr; DPrintPickColorWidget *pickColorWidget = nullptr; QHash spinboxTextCaches; + PreviewSettingsPluginHelper *settingHelper; + QBasicTimer settingUpdateTimer; Q_DECLARE_PUBLIC(DPrintPreviewDialog) }; +class PreviewSettingsPluginHelper +{ +public: + PreviewSettingsPluginHelper(DPrintPreviewDialogPrivate *dd); + DPrintPreviewSettingInfo *loadInfo(DPrintPreviewSettingInfo::SettingType type, bool manual = false); + + void setSubControlVisible(DPrintPreviewSettingInterface::SettingSubControl subControlType, bool visible); + void setSubControlEnabled(DPrintPreviewSettingInterface::SettingSubControl subControlType, bool enabled); + + void updateSettingInfo(DPrintPreviewSettingInfo *info); + void updateSettingStatus(DPrintPreviewSettingInterface::SettingSubControl subControlType); + + static void loadPlugin(); + static void setPluginMimeData(const QVariant &data); + static QVariant pluginMimeData(); + + static QString currentPlugin(); + static bool setCurrentPlugin(const QString &pluginName); + + static QStringList availablePlugins(); +protected: + void doUpdateStatus(QWidget *source, DPrintPreviewSettingInterface::SettingSubControl subControlType, bool visible, bool enabled); + QWidgetList subControl(DPrintPreviewSettingInterface::SettingSubControl subControlType) const; + static QString pluginPath(); + +private: + DPrintPreviewDialogPrivate *d; + static QVariant m_printSettingData; + static DPrintPreviewSettingInterface *m_currentInterface; + static QList m_availablePlugins; +}; + DWIDGET_END_NAMESPACE #endif // DPRINTPREVIEWDIALOG_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dprintpreviewwidget_p.h dtkwidget-5.6.12/src/widgets/private/dprintpreviewwidget_p.h --- dtkwidget-5.5.48/src/widgets/private/dprintpreviewwidget_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dprintpreviewwidget_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,29 +1,12 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: chengyulong -* -* Maintainer: chengyulong -* -* 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 -* any later version. -* -* This program 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 . -*/ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DPRINTPREVIEWWIDGET_P_H #define DPRINTPREVIEWWIDGET_P_H #include -#include "private/dframe_p.h" +#include "dframe_p.h" #include @@ -32,6 +15,7 @@ #include #include #include +#include DWIDGET_BEGIN_NAMESPACE @@ -165,6 +149,10 @@ { color = c; } + inline QColor getColor() const + { + return color; + } inline void setBoundingRect(const QRectF &rect) { qreal rotate = rotation(); @@ -264,6 +252,7 @@ void init(); void populateScene(); + void updatePreview(); void generatePreview(); void fitView(); void print(bool printAsPicture = false); @@ -335,6 +324,7 @@ struct NumberUpData; NumberUpData *numberUpPrintData; + QBasicTimer updateTimer; Q_DECLARE_PUBLIC(DPrintPreviewWidget) }; diff -Nru dtkwidget-5.5.48/src/widgets/private/dsearchcombobox_p.h dtkwidget-5.6.12/src/widgets/private/dsearchcombobox_p.h --- dtkwidget-5.5.48/src/widgets/private/dsearchcombobox_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dsearchcombobox_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,28 +1,12 @@ -/* -* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -* -* Author: wangpeng -* -* Maintainer: wangpeng -* -* 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 -* any later version. -* -* This program 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 . -*/ +// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DSEARCHCOMBOBOX_P_H #define DSEARCHCOMBOBOX_P_H #include "dsearchcombobox.h" -#include "private/dcombobox_p.h" +#include "dcombobox_p.h" #include #include #include diff -Nru dtkwidget-5.5.48/src/widgets/private/dsearchedit_p.h dtkwidget-5.6.12/src/widgets/private/dsearchedit_p.h --- dtkwidget-5.5.48/src/widgets/private/dsearchedit_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dsearchedit_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2011 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: wp - * - * Maintainer: wp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DSEARCHEDIT_P_H #define DSEARCHEDIT_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dslider_p.h dtkwidget-5.6.12/src/widgets/private/dslider_p.h --- dtkwidget-5.5.48/src/widgets/private/dslider_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dslider_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2011 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: wp - * - * Maintainer: wp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DSLIDER_P_H #define DSLIDER_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dspinbox_p.h dtkwidget-5.6.12/src/widgets/private/dspinbox_p.h --- dtkwidget-5.5.48/src/widgets/private/dspinbox_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dspinbox_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DSPINBOX_P_H #define DSPINBOX_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dsplitscreen.cpp dtkwidget-5.6.12/src/widgets/private/dsplitscreen.cpp --- dtkwidget-5.5.48/src/widgets/private/dsplitscreen.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dsplitscreen.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,369 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "dsplitscreen_p.h" +#include +#include +#include +#include + +#include "dpalettehelper.h" +#include "dstyleoption.h" +#include "dapplication.h" +#include "dstyle.h" +#include "dplatformwindowhandle.h" + +DGUI_USE_NAMESPACE +DWIDGET_BEGIN_NAMESPACE + +#define CHANGESPLITWINDOW_VAR "_d_splitWindowOnScreenByType" +#define GETSUPPORTSPLITWINDOW_VAR "_d_supportForSplittingWindowByType" + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(dSplitScreen, "dtk.splitscreen") +#else +Q_LOGGING_CATEGORY(dSplitScreen, "dtk.splitscreen", QtInfoMsg) +#endif + +static const QSize SplitScreenCellSize(96, 64); +static const QSize TwoInOneSplitScreenPlaceholderSize(44, 58); +static const QSize OneSplitScreenPlaceholderSize(44, 28); +static const int SplitScreenPlaceholderRadius(4); +static const QSize TowSplitScreenSize(117, 85); +static const QSize FourSplitScreenSize(222, 158); + +// Position的mask个数 +static int numberMaskOfFlag(DSplitScreenPlaceholder::Position flag) +{ + int count = 0; + const QVector flags { + DSplitScreenPlaceholder::Left, + DSplitScreenPlaceholder::Right, + DSplitScreenPlaceholder::Top, + DSplitScreenPlaceholder::Bottom + }; + for (auto item : flags) { + if (flag.testFlag(item)) + count++; + } + return count; +} +static quint32 getWinId(const QWidget *window) +{ + if (window) { + const QWindow *windowHandle = window->windowHandle(); + if (windowHandle && windowHandle->handle()) + return windowHandle->handle()->winId(); + } + return 0; +} + +//### 目前接口尚不公开在 dtkgui 中,等待获取后续接口稳定再做移植 +static bool supportForSplittingWindowByType(quint32 wid, const int screenSplittingType) +{ + bool supported = false; + + QFunctionPointer getSupportSplitWindow = qApp->platformFunction(GETSUPPORTSPLITWINDOW_VAR); + if (!getSupportSplitWindow) { + qCWarning(dSplitScreen) << "Can't get handler for `supportForSplittingWindowByType` of platform function, " + "need to update `qt5platform-plugins` related package."; + } + + if (getSupportSplitWindow) + supported = reinterpret_cast(getSupportSplitWindow)(wid, static_cast(screenSplittingType)); + + if (!getSupportSplitWindow && !supported) { + qCDebug(dSplitScreen) << "Can't support splitting Window Type:[" << screenSplittingType + << "] from `supportForSplittingWindowByType` of platform function."; + } + return supported; +} +static void splitWindowOnScreenByType(quint32 wid, quint32 position, quint32 type) +{ + QFunctionPointer splitWindowOnScreen = qApp->platformFunction(CHANGESPLITWINDOW_VAR); + + if (!splitWindowOnScreen) { + qCWarning(dSplitScreen) << "Can't get handler for `splitWindowOnScreenByType` of platform function, " + "need to update `qt5platform-plugins` related package."; + } + if (splitWindowOnScreen) { + qCDebug(dSplitScreen) << "Call `splitWindowOnScreenByType` of platform function, " + << "arguments of position is [" << position << "] and type is [" << type << "]."; + reinterpret_cast(splitWindowOnScreen)(wid, position, type); + } +} + +static void splitWindowOnScreenByType(const QWidget *widget, quint32 position, quint32 type) +{ + if (auto wid = getWinId(widget)) + splitWindowOnScreenByType(wid, position, type); +} + +DSplitScreenPlaceholder::DSplitScreenPlaceholder(Position position, QWidget *parent) + : DPushButton(parent) + , m_position(position) +{ + // 若position只含有1个mask,则是二合一类型的cell,即为大的cell. + const bool isTwoInOne = numberMaskOfFlag(position) <= 1; + if (isTwoInOne) { + setFixedSize(TwoInOneSplitScreenPlaceholderSize); + } else { + setFixedSize(OneSplitScreenPlaceholderSize); + } + DStyle::setFrameRadius(this, SplitScreenPlaceholderRadius); + // remove influence of parent's FrameBorder + auto dpal = DPaletteHelper::instance()->palette(this); + DPaletteHelper::instance()->setPalette(this, dpal); +} + +DSplitScreenPlaceholder::Position DSplitScreenPlaceholder::position() const +{ + return m_position; +} + +void DSplitScreenPlaceholder::paintEvent(QPaintEvent *event) +{ + Q_UNUSED(event); + DStylePainter p(this); + QStyleOptionButton option; + initStyleOption(&option); + if (m_paintFocus) + option.state |= QStyle::State_HasFocus; + p.drawControl(QStyle::CE_PushButton, option); +} + +bool DSplitScreenPlaceholder::event(QEvent *event) +{ + switch (event->type()) { + case QEvent::HoverEnter: + case QEvent::HoverLeave: { + m_paintFocus = event->type() == QEvent::HoverEnter; + } break; + default: + break; + } + return DPushButton::event(event); +} + +DSplitScreenCell::DSplitScreenCell(const DSplitScreenCell::Mode mode, QWidget *parent) + : DFrame(parent) +{ + layout = new DFlowLayout(this); + layout->setSpacing(2); + layout->setContentsMargins(2, 2, 2, 2); + + setFixedSize(SplitScreenCellSize); + setLineWidth(1); + setMidLineWidth(1); + auto pa = palette(); + pa.setBrush(backgroundRole(), Qt::transparent); + setPalette(pa); + + for (auto item :positionsByScreenMode(mode)) { + auto view = new DSplitScreenPlaceholder(item); + connect(view, &DSplitScreenPlaceholder::clicked, this, &DSplitScreenCell::onScreenPlaceholderSelected); + layout->addWidget(view); + } +} + +void DSplitScreenCell::onScreenPlaceholderSelected() +{ + if (auto holder = qobject_cast(sender())) { + screenSelected(m_type, holder->position()); + } +} + +QVector DSplitScreenCell::positionsByScreenMode(const DSplitScreenCell::Mode mode) +{ + QVector positions; + if (mode & TwoSplit) { + layout->setFlow(QListView::LeftToRight); + m_type = TwoSplit; + positions.append(DSplitScreenPlaceholder::Left); + positions.append(DSplitScreenPlaceholder::Right); + } else if (mode & ThreeSplit) { + layout->setFlow(QListView::TopToBottom); + m_type = ThreeSplit; + const bool left = mode & DSplitScreenCell::Left; + if (left) { + positions.append(DSplitScreenPlaceholder::Left); + positions.append(DSplitScreenPlaceholder::Right | DSplitScreenPlaceholder::Top); + positions.append(DSplitScreenPlaceholder::Right | DSplitScreenPlaceholder::Bottom); + } else { + positions.append(DSplitScreenPlaceholder::Left | DSplitScreenPlaceholder::Top); + positions.append(DSplitScreenPlaceholder::Left | DSplitScreenPlaceholder::Bottom); + positions.append(DSplitScreenPlaceholder::Right); + } + } else if (mode & FourSplit) { + layout->setFlow(QListView::LeftToRight); + m_type = FourSplit; + positions.append(DSplitScreenPlaceholder::Left | DSplitScreenPlaceholder::Top); + positions.append(DSplitScreenPlaceholder::Right | DSplitScreenPlaceholder::Top); + positions.append(DSplitScreenPlaceholder::Left | DSplitScreenPlaceholder::Bottom); + positions.append(DSplitScreenPlaceholder::Right | DSplitScreenPlaceholder::Bottom); + } + return positions; +} + +DSplitScreenWidget::DSplitScreenWidget(QWidget *parent) + : DBlurEffectWidget(parent) +{ + this->init(); +} + +void DSplitScreenWidget::hide() +{ + if (!hideTimer.isActive()) + hideTimer.start(300, this); +} + +void DSplitScreenWidget::hideImmediately() +{ + close(); +} + +bool DSplitScreenWidget::supportSplitScreenByWM(const QWidget *window) +{ + if (auto wid = getWinId(window)) + return supportForSplittingWindowByType(wid, DSplitScreenCell::SupportTwoSplit); + + return false; +} + +void DSplitScreenWidget::show(const QPoint &pos) +{ + move(pos); + QWidget::show(); +} + +void DSplitScreenWidget::onThemeTypeChanged(DGuiApplicationHelper::ColorType ct) +{ + if (ct == DGuiApplicationHelper::DarkType) { + setMaskColor(this->palette().window().color()); + } else { + setMaskColor(QColor(238, 238, 238, qRound(0.8 * 255))); + } + for (auto cell : findChildren()) { + auto dpal = DPaletteHelper::instance()->palette(cell); + if (ct == DGuiApplicationHelper::DarkType) { + // TODO + dpal.setColor(DPalette::FrameBorder, QColor(255 , 255, 255, static_cast(0.1 * 255))); + } else { + dpal.setColor(DPalette::FrameBorder, QColor(0, 0, 0, static_cast(0.1 * 255))); + } + DPaletteHelper::instance()->setPalette(cell, dpal); + } + +} + +void DSplitScreenWidget::onScreenSelected(DSplitScreenCell::Mode type, DSplitScreenPlaceholder::Position position) +{ + splitWindowOnScreenByType(this->parentWidget(), static_cast(position), static_cast(type)); + isMaxButtonPressAndHold = false; + hideImmediately(); +} + +void DSplitScreenWidget::init() +{ + this->setAttribute(Qt::WA_DeleteOnClose); + this->setWindowFlag(Qt::ToolTip); + DPlatformWindowHandle handler(this); + handler.setShadowRadius(20); + + this->setRadius(18); + setBlendMode(DBlurEffectWidget::BehindWindowBlend); + + auto layout = new DFlowLayout(this); + layout->setSpacing(10); + layout->setContentsMargins(10, 10, 10, 10); + QVector screenModes; + + auto wid = getWinId(parentWidget()); + QSize contentViewSize; + if (supportForSplittingWindowByType(wid, DSplitScreenCell::SupportTwoSplit)) { + screenModes.append(DSplitScreenCell::TwoSplit); + contentViewSize = TowSplitScreenSize; + } + if (supportForSplittingWindowByType(wid, DSplitScreenCell::SupportFourSplit)) { + screenModes.append(DSplitScreenCell::ThreeSplit | DSplitScreenCell::Left); + screenModes.append(DSplitScreenCell::ThreeSplit); + screenModes.append(DSplitScreenCell::FourSplit); + contentViewSize = FourSplitScreenSize; + } + setFixedSize(contentViewSize); + for (auto mode : screenModes) { + auto cell = new DSplitScreenCell(mode); + connect(cell, &DSplitScreenCell::screenSelected, this, &DSplitScreenWidget::onScreenSelected); + layout->insertWidget(layout->count(), cell); + } + + onThemeTypeChanged(DGuiApplicationHelper::instance()->themeType()); + qApp->installEventFilter(this); + + QObject::connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, + this, &DSplitScreenWidget::onThemeTypeChanged); +} + +bool DSplitScreenWidget::disableByScreenGeometryAndWindowSize() const +{ + QDesktopWidget *desktop = qApp->desktop(); + QWidget *window = this->window(); + + if (Q_LIKELY(desktop) && Q_LIKELY(window)) { + QRect screenRect = desktop->screenGeometry(window); + + // 窗口尺寸大于屏幕分辨率时 禁用控件 + if (screenRect.width() < window->minimumWidth() || screenRect.height() < window->minimumHeight()) + return true; + } + return false; +} + +bool DSplitScreenWidget::eventFilter(QObject *o, QEvent *e) +{ + switch (e->type()) { + case QEvent::Enter: + if (o == this) + hideTimer.stop(); + break; + + case QEvent::Leave: + if (o == this) + hide(); + break; + + case QEvent::Close: + if (!o->objectName().compare(QLatin1String("qtooltip_label"))) + break; + + Q_FALLTHROUGH(); + case QEvent::WindowActivate: + case QEvent::WindowDeactivate: + case QEvent::FocusIn: + case QEvent::FocusOut: + case QEvent::MouseButtonDblClick: + case QEvent::Wheel: + hideImmediately(); + break; + case QEvent::MouseButtonRelease: + if (!isMaxButtonPressAndHold) { + hideImmediately(); + } + break; + default: + break; + } + + return false; +} + +void DSplitScreenWidget::timerEvent(QTimerEvent *e) +{ + if (e->timerId() == hideTimer.timerId()) { + hideTimer.stop(); + hideImmediately(); + } +} + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/private/dsplitscreen_p.h dtkwidget-5.6.12/src/widgets/private/dsplitscreen_p.h --- dtkwidget-5.5.48/src/widgets/private/dsplitscreen_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dsplitscreen_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,86 +1,99 @@ -/* - * Copyright (C) 2021 UnionTech Technology Co., Ltd. - * - * Author: Chen Bin - * - * Maintainer: Chen Bin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #ifndef DSPLITSCREEN_P_H #define DSPLITSCREEN_P_H #include -#include -#include -#include +#include + +#include "DGuiApplicationHelper" +#include "dblureffectwidget.h" +#include "dflowlayout.h" +#include "dframe.h" +#include "DPushButton" -DGUI_USE_NAMESPACE DWIDGET_BEGIN_NAMESPACE -class DSplitScreenButton : public DIconButton +class DSplitScreenPlaceholder : public DPushButton { Q_OBJECT public: - explicit DSplitScreenButton(DStyle::StandardPixmap sp, QWidget *parent = nullptr); + enum PositionFlag { + Left = 1 << 0, + Right = 1 << 1, + Top = 1 << 2, + Bottom = 1 << 3, + }; + Q_DECLARE_FLAGS(Position, PositionFlag) + Q_FLAG(Position) -protected: - void initStyleOption(DStyleOptionButton *option) const; + explicit DSplitScreenPlaceholder(Position position, QWidget *parent = nullptr); + DSplitScreenPlaceholder::Position position() const; + + void paintEvent(QPaintEvent *event) override; + bool event(QEvent *event) override; + +private: + Position m_position; + bool m_paintFocus = false; }; -class DSplitScreenWidget : public DArrowRectangle +class DSplitScreenCell : public DFrame { Q_OBJECT public: - enum SplitScreenMode { - SplitLeftHalf = 1, - SplitRightHalf = 2, - SplitFullScreen = 15 + enum ModeFlag { + TwoSplit = 1, + ThreeSplit = 2, + FourSplit = 4, + SupportTwoSplit = TwoSplit, + SupportFourSplit = ThreeSplit, + PositionType = 1 << 4, + Left = 1 << (PositionType + 1) }; - Q_ENUM(SplitScreenMode) + Q_DECLARE_FLAGS(Mode, ModeFlag) + Q_FLAG(Mode) + + DSplitScreenCell(const Mode mode, QWidget *parent = nullptr); + +Q_SIGNALS: + void screenSelected(DSplitScreenCell::Mode type, DSplitScreenPlaceholder::Position position); +private Q_SLOTS: + void onScreenPlaceholderSelected(); +private: + QVector positionsByScreenMode(const DSplitScreenCell::Mode mode); + + DFlowLayout *layout = nullptr; + DSplitScreenCell::Mode m_type; +}; - explicit DSplitScreenWidget(DSplitScreenWidget::FloatMode mode, QWidget *parent = nullptr); +class DSplitScreenWidget : public DBlurEffectWidget +{ + Q_OBJECT +public: + + explicit DSplitScreenWidget(QWidget *parent = nullptr); void hide(); void hideImmediately(); - void updateMaximizeButtonIcon(bool isMaximized); - void setButtonsEnable(bool enable); - -Q_SIGNALS: - void maximizeButtonClicked(); - void leftSplitScreenButtonClicked(); - void rightSplitScreenButtonClicked(); + static bool supportSplitScreenByWM(const QWidget *window); + void show(const QPoint &pos); private Q_SLOTS: - void onThemeTypeChanged(DGuiApplicationHelper::ColorType ct); + void onThemeTypeChanged(DGUI_NAMESPACE::DGuiApplicationHelper::ColorType ct); + void onScreenSelected(DSplitScreenCell::Mode type, DSplitScreenPlaceholder::Position position); protected: void init(); - void disabledByScreenGeometryAndWindowSize(QWidgetList w); + bool disableByScreenGeometryAndWindowSize() const; bool eventFilter(QObject *o, QEvent *e) override; - void showEvent(QShowEvent *e) override; void timerEvent(QTimerEvent *e) override; private: - DSplitScreenButton *leftSplitButton = nullptr; - DSplitScreenButton *rightSplitButton = nullptr; - DSplitScreenButton *maximizeButton = nullptr; - - QWidget *contentWidget = nullptr; QBasicTimer hideTimer; - DArrowRectangle::FloatMode floatMode; bool isMaxButtonPressAndHold = false; friend class DTitlebarPrivate; @@ -88,4 +101,7 @@ }; DWIDGET_END_NAMESPACE + +Q_DECLARE_OPERATORS_FOR_FLAGS(DTK_WIDGET_NAMESPACE::DSplitScreenPlaceholder::Position) +Q_DECLARE_OPERATORS_FOR_FLAGS(DTK_WIDGET_NAMESPACE::DSplitScreenCell::Mode) #endif // DSPLITSCREEN_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dstackwidget_p.h dtkwidget-5.6.12/src/widgets/private/dstackwidget_p.h --- dtkwidget-5.5.48/src/widgets/private/dstackwidget_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dstackwidget_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DSTACKWIDGET_P_H #define DSTACKWIDGET_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dswitchbutton_p.h dtkwidget-5.6.12/src/widgets/private/dswitchbutton_p.h --- dtkwidget-5.5.48/src/widgets/private/dswitchbutton_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dswitchbutton_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,20 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: kirigaya - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DSWITCHBUTTON_P_H #define DSWITCHBUTTON_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dthemehelper.cpp dtkwidget-5.6.12/src/widgets/private/dthemehelper.cpp --- dtkwidget-5.5.48/src/widgets/private/dthemehelper.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dthemehelper.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dthemehelper.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/dthemehelper.h dtkwidget-5.6.12/src/widgets/private/dthemehelper.h --- dtkwidget-5.5.48/src/widgets/private/dthemehelper.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dthemehelper.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DTHEMEHELPER_H #define DTHEMEHELPER_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dtickeffect_p.h dtkwidget-5.6.12/src/widgets/private/dtickeffect_p.h --- dtkwidget-5.5.48/src/widgets/private/dtickeffect_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dtickeffect_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DTICKEFFECTPRIVATE_H #define DTICKEFFECTPRIVATE_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dtiplabel_p.h dtkwidget-5.6.12/src/widgets/private/dtiplabel_p.h --- dtkwidget-5.5.48/src/widgets/private/dtiplabel_p.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dtiplabel_p.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2011 ~ 2019 Deepin Technology Co., Ltd. - * - * Author: wp - * - * Maintainer: wp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DTIPLABEL_P_H #define DTIPLABEL_P_H diff -Nru dtkwidget-5.5.48/src/widgets/private/dtitlebareditpanel.cpp dtkwidget-5.6.12/src/widgets/private/dtitlebareditpanel.cpp --- dtkwidget-5.5.48/src/widgets/private/dtitlebareditpanel.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dtitlebareditpanel.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,946 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "dtitlebareditpanel.h" +#include "dtitlebarsettings.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "dtitlebar.h" + +DWIDGET_BEGIN_NAMESPACE +DGUI_USE_NAMESPACE + +#define SPACING 10 + +static const char* TitlebarZoneDataFormat = "titlebarZoneWidget"; +static const char* SelectionZoneDataFormat = "selectionZoneWidget"; +static const char* DefaultZoneDataFormat = "defaultZoneWidget"; + +static QBitmap bitmapOfMask(const QSize &size, const qreal radius) +{ + QBitmap bitMap(size); + bitMap.fill(Qt::color0); + + QPainter painter(&bitMap); + painter.setRenderHint(QPainter::SmoothPixmapTransform); + painter.setPen(Qt::NoPen); + painter.setBrush(Qt::color1); + painter.drawRoundedRect(bitMap.rect(), radius, radius); + + return bitMap; +} + +PlaceHoderWidget::PlaceHoderWidget(QWidget *parent) + : QWidget(parent) +{ + +} + +void PlaceHoderWidget::paintEvent(QPaintEvent *event) +{ + QColor color; + if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) { + color = QColor(0, 0, 0, qRound(255 * 0.06)); + } else { + color = QColor(255, 255, 255, qRound(255 * 0.06)); + } + QPainter painter(this); + painter.setRenderHints(QPainter::Antialiasing, true); + QPen pen(color); + painter.setPen(Qt::NoPen); + painter.setBrush(color); + painter.drawRoundedRect(this->rect().adjusted(1, 1, -1, -1), 8.0, 8.0); + + QWidget::paintEvent(event); +} + +DragDropWidget::DragDropWidget(const QString &id, QWidget *parent) + : DIconButton(parent) + , m_id(id) +{ +} + +DragDropWidget::~DragDropWidget() +{ + +} + +void DragDropWidget::setButtonIcon(const QIcon &icon, const QSize &size) +{ + this->setIcon(icon); + this->setIconSize(size); +} + +QString DragDropWidget::id() const +{ + return m_id; +} + +void DragDropWidget::setScreenShotedView(QWidget *view) +{ + m_view = view; +} + +void DragDropWidget::screenShot() +{ + if (m_view && m_view->size().width() > 0) { + this->setFixedSize(m_view->size()); + auto pixmap = m_view->grab(m_view->rect()); + pixmap.setMask(bitmapOfMask(pixmap.size(), 8)); + this->setButtonIcon(pixmap, m_view->size()); + } +} + +void DragDropWidget::mousePressEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) { + m_isClicked = true; + } +} + +void DragDropWidget::mouseMoveEvent(QMouseEvent *event) +{ + if (m_isClicked) + startDrag(event->pos()); +} + +void DragDropWidget::mouseReleaseEvent(QMouseEvent *event) +{ + Q_UNUSED(event) + m_isClicked = false; +} + +void DragDropWidget::startDrag(const QPoint &pos) +{ + m_startDrag = mapToGlobal(this->pos()); + + QPoint hotSpot = pos; + QPixmap pixmap(this->grab()); + pixmap.setMask(bitmapOfMask(pixmap.size(), 8)); + m_pixmap = pixmap; + int index = -1; + if (DTitlebarEditPanel *panel = qobject_cast(this->parentWidget())) { + index = panel->layout()->indexOf(this); + m_titleBarEditPanel = panel; + m_index = index; + if (panel->isFixedTool(index)) { + return; + } + } + + QMimeData *mimeData = new QMimeData; + QByteArray itemData; + QDataStream dataStream(&itemData, QIODevice::WriteOnly); + dataStream << m_id << hotSpot << this->size() << index; + + mimeData->setData(m_mimeDataFormat, itemData); + + QDrag *drag = new QDrag(this); + drag->setMimeData(mimeData); + drag->setPixmap(pixmap); + drag->setHotSpot(hotSpot); + + Qt::DropAction dropAction = drag->exec(Qt::MoveAction); + if (dropAction == Qt::IgnoreAction) { + onIgnoreAction(); + } +} + +void DragDropWidget::onIgnoreAction() +{ + gobackDrag(m_pixmap, QCursor::pos()); +} + +void DragDropWidget::gobackDrag(const QPixmap &pixmap, const QPoint &pos) +{ + QLabel *widget = new QLabel(); + widget->setAttribute(Qt::WA_TranslucentBackground); + widget->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint); + widget->setFixedSize(pixmap.size()); + widget->setPixmap(pixmap); + widget->move(pos); + widget->show(); + + auto currentXAni = new QPropertyAnimation(widget, "pos"); + const int AnimationTime = 250; + currentXAni->setEasingCurve(QEasingCurve::OutCubic); + currentXAni->setDuration(AnimationTime); + currentXAni->setStartValue(pos); + currentXAni->setEndValue(m_startDrag); + currentXAni->setDirection(QAbstractAnimation::Forward); + currentXAni->start(); + connect(currentXAni, &QPropertyAnimation::finished, currentXAni, &QWidget::deleteLater); + connect(currentXAni, &QPropertyAnimation::finished, widget, &QWidget::deleteLater); +} + +TitlebarZoneWidget::TitlebarZoneWidget(const QString &id, QWidget *parent) + : DragDropWidget(id, parent) +{ + m_mimeDataFormat = TitlebarZoneDataFormat; +} + +void TitlebarZoneWidget::onIgnoreAction() +{ + if (!m_titleBarEditPanel->dropped()) { + Q_EMIT m_titleBarEditPanel->removedToolView(m_id, m_index); + m_titleBarEditPanel->removePlaceHolder(); + m_titleBarEditPanel->updateCustomWidget(); + m_titleBarEditPanel->updateScreenShotedViews(); + m_titleBarEditPanel->setDropped(true); + this->deleteLater(); + } +} + +SelectionZoneWidget::SelectionZoneWidget(const QString &id, QWidget *parent) + : DragDropWidget(id, parent) +{ + m_mimeDataFormat = SelectionZoneDataFormat; +} + +DefaultZoneWidget::DefaultZoneWidget(const QString &id, QWidget *parent) + : DragDropWidget(id, parent) +{ + m_mimeDataFormat = DefaultZoneDataFormat; +} + +IconTextWidget::IconTextWidget(DragDropWidget *iconWidget, const QString &toolId, QWidget *parent) + : QWidget(parent) + , m_toolId(toolId) + , m_iconWidget(iconWidget) + , m_titleLabel(new QLabel) +{ +} + +IconTextWidget::~IconTextWidget() +{ + +} + +void IconTextWidget::setContent(const QIcon &icon, const QString &text, const QSize &size) +{ + m_iconWidget->setFixedSize(size); + m_iconWidget->setButtonIcon(icon, size); + m_titleLabel->setText(text); + m_titleLabel->setAlignment(Qt::AlignHCenter); + DFontSizeManager *fontManager = DFontSizeManager::instance(); + fontManager->bind(m_titleLabel, DFontSizeManager::T10, QFont::Medium); + + if (layout()) + return; + + QVBoxLayout *mainVLayout = new QVBoxLayout(this); + mainVLayout->setSpacing(0); + mainVLayout->setMargin(0); + mainVLayout->addWidget(m_iconWidget, 0, Qt::AlignHCenter); + mainVLayout->addSpacing(6); + mainVLayout->addWidget(m_titleLabel, 0, Qt::AlignHCenter); +} + +void IconTextWidget::setIconSize(const QSize &size) +{ + m_iconWidget->setFixedSize(size); +} + +DCollapseWidget::DCollapseWidget(DTitlebarSettingsImpl *settings, QWidget *parent) + : QWidget(parent) + , m_settingsImpl(settings) + , m_mainHLayout(new QHBoxLayout(this)) + , m_placeHolder(new PlaceHoderWidget) +{ + m_placeHolder->setObjectName("placeHolder"); + m_mainHLayout->setSpacing(SPACING); +} + +DCollapseWidget::~DCollapseWidget() +{ + +} + +void DCollapseWidget::removeAll() +{ + QLayoutItem *item = nullptr; + while ((item = m_mainHLayout->takeAt(0)) != nullptr) { + if (auto w = item->widget()) { + if (w->objectName() != "placeHolder") { + delete item->widget(); + delete item; + } + } + } + removePlaceHolder(); +} + +void DCollapseWidget::removePlaceHolder() +{ + if (m_placeHolder && m_placeHolder->isVisible()) { + m_mainHLayout->removeWidget(m_placeHolder); + m_placeHolder->hide(); + } +} + +void DCollapseWidget::reloadWidgets() +{ + removeAll(); + for (auto key : m_settingsImpl->keys()) { + addWidget(key, -1); + } +} + +void DCollapseWidget::addWidget(const QString &key, int index) +{ + Q_UNUSED(key) + Q_UNUSED(index) +} + +void DCollapseWidget::removeWidget(int index) +{ + if (auto item = m_mainHLayout->takeAt(index)) { + if (auto w = item->widget()) { + w->hide(); + } + } +} + +void DCollapseWidget::resizeEvent(QResizeEvent *event) +{ + updateMinimumValue(); + + if (width() < m_minimumWidth) { + collapse(); + } else { + expand(); + } + + QWidget::resizeEvent(event); +} + +void DCollapseWidget::updateMinimumValue() +{ + int minimum = 0; + + for (int i = 0; i < m_mainHLayout->count(); ++i) { + auto item = m_mainHLayout->itemAt(i); + if (auto spacerItem = item->spacerItem()) { + if (spacerItem->sizePolicy().horizontalPolicy() == QSizePolicy::Fixed) { + auto baseInterface = m_settingsImpl->tool(m_settingsImpl->findKeyByPos(i)); + if (auto spacerInterface = qobject_cast(baseInterface)) { + minimum += spacerInterface->size() + SPACING; + qDebug() << "+" << spacerInterface->size() + SPACING; + } + } + } else { + auto w = item->widget(); + if (!w || w->sizePolicy().horizontalPolicy() == QSizePolicy::Expanding) + continue; + minimum += w->width(); + qDebug() << "+" << w->width(); + if (auto dragDropWidget = qobject_cast(w)) { + if (m_settingsImpl->isSpacerTool(m_settingsImpl->findKeyByPos(i)) && !m_settingsImpl->isStrecherTool(m_settingsImpl->findKeyByPos(i))) { + minimum += SPACING; + qDebug() << "+" << SPACING; + } + } + } + } + + minimum += 2 * m_mainHLayout->margin(); + qDebug() << "+" << 2 * m_mainHLayout->margin(); + + m_minimumWidth = minimum; + qDebug() << "minimum:" << m_minimumWidth << "width:" << this->width() << "count:" << m_mainHLayout->count(); +} + +void DCollapseWidget::initExpandButton() +{ + m_expandButton = new DIconButton; + m_expandButton->setObjectName("expandButton"); + m_expandButton->setFixedSize(36, 36); + m_expandButton->setIconSize(QSize(36, 36)); + m_expandButton->setIcon(QIcon::fromTheme("fold")); + m_expandButton->setFlat(false); + m_mainHLayout->insertWidget(m_mainHLayout->count(), m_expandButton); + connect(m_expandButton, &QPushButton::clicked, this, [this] { + QMenu menu(m_expandButton); + for (auto view : m_viewsInMenu) { + DTitlebarToolBaseInterface* i = m_settingsImpl->tool(view.first); + auto interface = qobject_cast(i); + if (!interface) continue; + QAction *action = new QAction(interface->description()); + connect(action, &QAction::triggered, interface, &DTitleBarToolInterface::triggered); + menu.addAction(action); + } + menu.move(this->mapToGlobal(m_expandButton->pos()).x(), this->mapToGlobal(m_expandButton->pos()).y() + m_expandButton->height()); + menu.exec(); + }); +} + +void DCollapseWidget::collapse() +{ + if (m_mainHLayout->count() == 0) + return; + + int index = m_mainHLayout->count() - 1; + if (m_expandButton && m_expandButton->isVisible()) { + --index; + } + + if (auto item = m_mainHLayout->takeAt(index)) { + if (auto spacerItem = item->spacerItem()) { // 如果是spacer,只存数据,不处理expand按钮 + QPair tmp{m_settingsImpl->findKeyByPos(index), nullptr}; + m_viewsInMenu.append(tmp); + qDebug() << "collapse:" << m_viewsInMenu; + return; + } else { + if (auto w = item->widget()) { + w->hide(); + QPair tmp{m_settingsImpl->findKeyByPos(index), w}; + m_viewsInMenu.append(tmp); + } + } + qDebug() << "collapse:" << m_viewsInMenu; + } + + if (!m_expandButton) { + initExpandButton(); + } + + if (!m_expandButton->isVisible() && m_mainHLayout->indexOf(m_expandButton) == -1) { + m_mainHLayout->insertWidget(m_mainHLayout->count(), m_expandButton); + m_expandButton->show(); + } +} + +void DCollapseWidget::expand() +{ + if (m_viewsInMenu.isEmpty()) + return; + auto view = m_viewsInMenu.constLast(); + if (!view.second) { + if (this->width() >= m_minimumWidth + SPACING) { + m_viewsInMenu.takeLast(); + int index = m_mainHLayout->indexOf(m_expandButton); + if (m_settingsImpl->isStrecherTool(view.first)) { + m_mainHLayout->insertStretch(index, 0); + } else { + auto tool = m_settingsImpl->tool(view.first); + if (auto spacerInter = qobject_cast(tool)) { + auto spacingSize = spacerInter->size(); + m_mainHLayout->insertSpacing(index, spacingSize); + } + } + } + } else { + if (this->width() >= m_minimumWidth + view.second->width() + SPACING) { + qDebug() << "expand" << m_viewsInMenu.count(); + auto w = m_viewsInMenu.takeLast(); + int index = m_mainHLayout->indexOf(m_expandButton); + m_mainHLayout->insertWidget(index, view.second); + view.second->show(); + } + } + qDebug() << "expand:" << m_viewsInMenu; + + if (m_viewsInMenu.isEmpty()) { + m_mainHLayout->removeWidget(m_expandButton); + m_expandButton->hide(); + } +} + +DTitlebarCustomWidget::DTitlebarCustomWidget(DTitlebarSettingsImpl *settings, QWidget *parent) + : DCollapseWidget(settings, parent) +{ +} + +bool DTitlebarCustomWidget::editMode() const +{ + return m_isEditMode; +} + +void DTitlebarCustomWidget::setEditMode(bool isEditMode) +{ + m_isEditMode = isEditMode; +} + +QWidget *DTitlebarCustomWidget::widget(const int index) const +{ + if (auto item = m_mainHLayout->itemAt(index)) + return item->widget(); + return nullptr; +} + +void DTitlebarCustomWidget::addWidget(const QString &key, int index) +{ + auto tool = m_settingsImpl->tool(key); + if (!tool) { + return; + } + const bool isSpacer = DTitlebarSettingsImpl::isSpacerTool(tool); + if (isSpacer) { + auto spacerInterface = qobject_cast(tool); + if (!spacerInterface) { + return; + } + if (m_isEditMode) { + auto view = spacerInterface->createPlaceholderView(); + m_mainHLayout->insertWidget(index, view); + } else { + const auto spacingSize = spacerInterface->size(); + if (spacingSize < 0) { + m_mainHLayout->insertStretch(index, 0); + } else { + m_mainHLayout->insertSpacing(index, spacingSize + SPACING); + } + } + } else { + auto toolInterface = qobject_cast(tool); + if (!toolInterface) { + return; + } + QWidget *view = toolInterface->createView(); + m_mainHLayout->insertWidget(index, view); + } +} + +void DTitlebarCustomWidget::appendDefaultWidget(const QString &toolId) +{ + auto tool = m_settingsImpl->toolById(toolId); + if (!tool) + return; + + const bool isSpacer = DTitlebarSettingsImpl::isSpacerTool(tool); + if (isSpacer) { + auto spacerInterface = qobject_cast(tool); + if (!spacerInterface) { + return; + } + auto spacingSize = spacerInterface->size(); + if (spacingSize < 0) { + m_mainHLayout->insertStretch(-1, 1); + } else { + m_mainHLayout->insertSpacing(-1, spacingSize + SPACING); + } + } else { + auto toolInterface = qobject_cast(tool); + if (!toolInterface) { + return; + } + QWidget *view = toolInterface->createView(); + m_mainHLayout->insertWidget(-1, view); + } +} + +void DTitlebarCustomWidget::insertPlaceHolder(int index, const QSize &size) +{ + m_placeHolder->setFixedSize(size); + m_mainHLayout->insertWidget(index, m_placeHolder); + m_placeHolder->show(); +} + +void DTitlebarCustomWidget::resizeEvent(QResizeEvent *event) +{ + if (event->size() != event->oldSize() && m_isEditMode) + m_settingsImpl->adjustDisplayView(); +} + +DTitlebarEditPanel::DTitlebarEditPanel(DTitlebarSettingsImpl *settings, DTitlebarCustomWidget *customWidget, QWidget *parent) + : DCollapseWidget(settings, parent) + , m_customWidget(customWidget) +{ + setAcceptDrops(true); + setFocusPolicy(Qt::StrongFocus); + connect(this, &DTitlebarEditPanel::startScreenShot, this, &DTitlebarEditPanel::doStartScreenShot, Qt::QueuedConnection); +} + +void DTitlebarEditPanel::updateCustomWidget(bool isEditMode) +{ + m_customWidget->setEditMode(isEditMode); + m_customWidget->reloadWidgets(); +} + +void DTitlebarEditPanel::updateScreenShotedViews() +{ + for (int i = 0; i < m_mainHLayout->count(); ++i) { + auto w = m_mainHLayout->itemAt(i)->widget(); + auto btn = qobject_cast (w); + if (btn) { + btn->setScreenShotedView(m_customWidget->widget(i)); + } + } + Q_EMIT startScreenShot(); +} + +void DTitlebarEditPanel::addWidget(const QString &key, int index) +{ + DragDropWidget *w = new TitlebarZoneWidget(key); + if (m_settingsImpl->isSpacerTool(key)) { + auto spacerInterface = qobject_cast(m_settingsImpl->tool(key)); + if (!spacerInterface) { + return; + } + if (spacerInterface->size() == -1) { + w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + } else { + qDebug() << "size" << spacerInterface->size(); + w->setFixedWidth(spacerInterface->size()); + } + } + m_mainHLayout->insertWidget(index, w); +} + +bool DTitlebarEditPanel::isFixedTool(const int index) +{ + return m_settingsImpl->isFixedTool(index); +} + +bool DTitlebarEditPanel::dropped() const +{ + return m_isDropped; +} + +void DTitlebarEditPanel::setDropped(bool isDropped) +{ + m_isDropped = isDropped; +} + +void DTitlebarEditPanel::doStartScreenShot() +{ + for (int i = 0; i < m_mainHLayout->count(); ++i) { + auto w = m_mainHLayout->itemAt(i)->widget(); + auto btn = qobject_cast (w); + if (btn) { + btn->screenShot(); + } + } +} + +void DTitlebarEditPanel::dragEnterEvent(QDragEnterEvent *event) +{ + event->acceptProposedAction(); + if (event->mimeData()->hasFormat(TitlebarZoneDataFormat)) { + if (!m_isDropped) { + return; + } + QByteArray itemData = event->mimeData()->data(TitlebarZoneDataFormat); + QDataStream dataStream(&itemData, QIODevice::ReadOnly); + QString key; + QPoint hotSpot; + QSize size; + int index; + dataStream >> key >> hotSpot >> size >> index; + if (auto item = m_mainHLayout->takeAt(index)) { + if (auto w = qobject_cast(item->widget())) { + w->hide(); + m_customWidget->removeWidget(index); + m_isDropped = false; + Q_EMIT startScreenShot(); + } + } + } +} + +void DTitlebarEditPanel::dragMoveEvent(QDragMoveEvent *event) +{ + if (event->mimeData()->hasFormat(TitlebarZoneDataFormat)) { + handleTitlebarZoneWidgetMoveEvent(event); + } else if (event->mimeData()->hasFormat(SelectionZoneDataFormat)) { + handleSelectionZoneWidgetMoveEvent(event); + } else { + event->accept(); // default zone + } +} + +void DTitlebarEditPanel::dragLeaveEvent(QDragLeaveEvent *event) +{ + removePlaceHolder(); + m_customWidget->removePlaceHolder(); + QWidget::dragLeaveEvent(event); +} + +void DTitlebarEditPanel::dropEvent(QDropEvent *event) +{ + if (event->mimeData()->hasFormat(DefaultZoneDataFormat)) { + handleDefaultWidgetDropEvent(event); + } else if (event->mimeData()->hasFormat(TitlebarZoneDataFormat)) { + handleTitlebarZoneWidgetDropEvent(event); + } else { + handleSelectionZoneWidgetDropEvent(event); + } +} + +bool DTitlebarEditPanel::containsTool(const QString &toolId) +{ + for (int i = 0; i < m_mainHLayout->count(); ++i) { + auto w = m_mainHLayout->itemAt(i)->widget(); + auto view = qobject_cast(w); + if (view && m_settingsImpl->toolId(view->id()) == toolId) { + return true; + } + } + return false; +} + +void DTitlebarEditPanel::replaceOldView(const QString &toolId) +{ + for (int i = 0; i < m_mainHLayout->count(); ++i) { + auto w = m_mainHLayout->itemAt(i)->widget(); + auto view = qobject_cast(w); + if (view && m_settingsImpl->toolId(view->id()) == toolId) { + m_mainHLayout->takeAt(i); + int index = m_mainHLayout->indexOf(m_placeHolder); + m_mainHLayout->insertWidget(index, w); + removePlaceHolder(); + Q_EMIT movedToolView(view->id(), index); + updateCustomWidget(); + updateScreenShotedViews(); + break; + } + } +} + +void DTitlebarEditPanel::handleTitlebarZoneWidgetMoveEvent(QDropEvent *event) +{ + removePlaceHolder(); + m_customWidget->removePlaceHolder(); + + QByteArray itemData = event->mimeData()->data(TitlebarZoneDataFormat); + QDataStream dataStream(&itemData, QIODevice::ReadOnly); + + QString key; + QPoint hotSpot; + QSize size; + dataStream >> key >> hotSpot >> size; + + positionPlaceHolder(event->pos(), hotSpot, size); + Q_EMIT startScreenShot(); +} + +void DTitlebarEditPanel::handleSelectionZoneWidgetMoveEvent(QDropEvent *event) +{ + removePlaceHolder(); + m_customWidget->removePlaceHolder(); + + QByteArray itemData = event->mimeData()->data(SelectionZoneDataFormat); + QDataStream dataStream(&itemData, QIODevice::ReadOnly); + + QString key; + QPoint hotSpot; + QSize size; + dataStream >> key >> hotSpot >> size; + + positionPlaceHolder(event->pos(), hotSpot, size); + Q_EMIT startScreenShot(); +} + +void DTitlebarEditPanel::handleDefaultWidgetDropEvent(QDropEvent *event) +{ + Q_EMIT resetToolView(); + updateCustomWidget(); + reloadWidgets(); + updateScreenShotedViews(); + event->accept(); +} + +void DTitlebarEditPanel::handleTitlebarZoneWidgetDropEvent(QDropEvent *event) +{ + QByteArray itemData = event->mimeData()->data(TitlebarZoneDataFormat); + QDataStream dataStream(&itemData, QIODevice::ReadOnly); + + QString id; + QPoint hotSpot; + QSize size; + int type; + int index; + dataStream >> id >> hotSpot >> size >> type >> index; + if (m_mainHLayout->indexOf(m_placeHolder) != -1) { // 调整位置 + auto w = qobject_cast (event->source()); + if (m_settingsImpl->isFixedTool(id)) { + event->ignore(); + return; + } + if (w) { + m_mainHLayout->replaceWidget(m_placeHolder, w); + auto tool = m_settingsImpl->tool(id); + const bool isSpacer = DTitlebarSettingsImpl::isSpacerTool(tool); + if (isSpacer && qobject_cast(tool)->size() == -1) { + m_mainHLayout->setStretchFactor(w, 1); + } + m_placeHolder->hide(); + w->show(); + Q_EMIT movedToolView(id, m_mainHLayout->indexOf(w)); + updateCustomWidget(); + updateScreenShotedViews(); + m_isDropped = true; + event->accept(); + } + } +} + +void DTitlebarEditPanel::handleSelectionZoneWidgetDropEvent(QDropEvent *event) +{ + QByteArray itemData = event->mimeData()->data(SelectionZoneDataFormat); + QDataStream dataStream(&itemData, QIODevice::ReadOnly); + QString id; + dataStream >> id; + + if (!m_settingsImpl->isSpacerToolById(id) && containsTool(id)) { + replaceOldView(id); + } else { + int index = m_mainHLayout->indexOf(m_placeHolder); + Q_EMIT addingToolView(id, index); + updateCustomWidget(); + this->addWidget(m_settingsImpl->findKeyByPos(index), index); + removePlaceHolder(); + updateScreenShotedViews(); + } + event->accept(); +} + +void DTitlebarEditPanel::positionPlaceHolder(const QPoint &pos, const QPoint &hotSpot, const QSize &size) +{ + int newIndex = -1; + QWidget *child = childAt(pos); + if (!child) { + for (int i = 0; i < m_mainHLayout->count(); ++i) { + auto w = m_mainHLayout->itemAt(i)->widget(); + if (pos.x() < w->pos().x()) { + if (qobject_cast(w)) { + newIndex = i; + break; + } + } + } + } else if (qobject_cast(child)) { + newIndex = m_mainHLayout->indexOf(child); + if (pos.x() - hotSpot.x() + size.width() / 2 > child->pos().x() + (child->width() / 2)) { + ++newIndex; + } + } else if (qobject_cast(child)) { + return; + } else { // strech + newIndex = m_mainHLayout->count(); + } + + if (newIndex == -1) { + newIndex = m_mainHLayout->count(); + } + if (newIndex != -1) { + m_mainHLayout->insertWidget(newIndex, m_placeHolder); + m_customWidget->insertPlaceHolder(newIndex, size); + m_placeHolder->setFixedSize(size); + m_placeHolder->show(); + } +} + +bool DTitlebarEditPanel::eventFilter(QObject *obj, QEvent *event) +{ + return QWidget::eventFilter(obj, event); +} + +void DTitlebarEditPanel::resizeEvent(QResizeEvent *event) +{ + if (event->size() != event->oldSize()) + Q_EMIT startScreenShot(); +} + +DToolbarEditPanel::DToolbarEditPanel(DTitlebarSettingsImpl *settingsImpl, QWidget *parent) + : DBlurEffectWidget(parent), + m_settingsImpl(settingsImpl), + m_selectZoneView(new QWidget), + m_flowLayout(new DFlowLayout(m_selectZoneView)), + m_defaultToolBarWidget(new IconTextWidget(new DefaultZoneWidget, "default")), + m_confirmBtn(new QPushButton) +{ + init(); +} + +void DToolbarEditPanel::addWidgetToSelectionZone(const QString &id) +{ + auto tool = m_settingsImpl->toolById(id); + Q_ASSERT(tool); + + IconTextWidget * customWidget = new IconTextWidget(new SelectionZoneWidget(id), id, m_selectZoneView); + customWidget->setContent(QIcon::fromTheme(tool->iconName()), tool->description()); + m_flowLayout->addWidget(customWidget); +} + +void DToolbarEditPanel::setDefaultView(const QPixmap &pixmap, const QSize &size) +{ + m_defaultToolBarWidget->setContent(QIcon(pixmap), tr("Default toolset"), size); + m_defaultToolBarWidget->setIconSize(size); +} + +void DToolbarEditPanel::removeAll() +{ + QLayoutItem *item = nullptr; + while ((item = m_flowLayout->takeAt(0)) != nullptr) { + delete item->widget(); + delete item; + } +} + +void DToolbarEditPanel::onConfirmBtnClicked() +{ + Q_EMIT confirmBtnClicked(); + this->close(); +} + +void DToolbarEditPanel::keyPressEvent(QKeyEvent *event) +{ + if (event->key() == Qt::Key_Escape) { + onConfirmBtnClicked(); + } + DBlurEffectWidget::keyPressEvent(event); +} + +void DToolbarEditPanel::init() +{ + QVBoxLayout *mainVLayout = new QVBoxLayout(this); + + QLabel *selectZoneToolTipLabel = new QLabel(tr("Drag your favorite items into the toolbar")); + QLabel *defaultZoneToolTipLabel = new QLabel(tr("Drag below items into the toolbar to restore defaults")); + m_selectZoneView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + m_flowLayout->setSpacing(30); + + m_confirmBtn->setFixedSize(126, 36); + m_confirmBtn->setText(tr("Confirm")); + + mainVLayout->setSpacing(0); + mainVLayout->setContentsMargins(10, 0, 10, 0); + mainVLayout->addSpacing(21); + mainVLayout->addWidget(selectZoneToolTipLabel, 0, Qt::AlignCenter); + mainVLayout->addSpacing(12); + mainVLayout->addWidget(m_selectZoneView); + mainVLayout->addSpacing(20); + mainVLayout->addWidget(new DHorizontalLine); + mainVLayout->addSpacing(12); + mainVLayout->addWidget(defaultZoneToolTipLabel, 0, Qt::AlignCenter); + mainVLayout->addSpacing(12); + mainVLayout->addWidget(m_defaultToolBarWidget, 0, Qt::AlignLeft); + mainVLayout->addSpacing(10); + mainVLayout->addWidget(new DHorizontalLine); + mainVLayout->addSpacing(10); + mainVLayout->addWidget(m_confirmBtn, 0, Qt::AlignRight); + mainVLayout->addSpacing(10); + + setMouseTracking(true); + + connect(m_confirmBtn, &QPushButton::clicked, this, &DToolbarEditPanel::onConfirmBtnClicked); +} + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/private/dtitlebareditpanel.h dtkwidget-5.6.12/src/widgets/private/dtitlebareditpanel.h --- dtkwidget-5.5.48/src/widgets/private/dtitlebareditpanel.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dtitlebareditpanel.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,226 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#pragma once + +#include "dtitlebarsettingsimpl.h" + +#include +#include +#include +#include + +#include +#include + +class QPushButton; +class QLabel; + +DWIDGET_BEGIN_NAMESPACE + +class DTitlebarEditPanel; +class DFlowLayout; +class DIconButton; + +class PlaceHoderWidget: public QWidget +{ + Q_OBJECT +public: + explicit PlaceHoderWidget(QWidget *parent = nullptr); +protected: + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; +}; + +class DragDropWidget : public DIconButton +{ + Q_OBJECT +public: + explicit DragDropWidget(const QString &id = "", QWidget *parent = nullptr); + virtual~DragDropWidget() Q_DECL_OVERRIDE; + + void setButtonIcon(const QIcon &icon, const QSize &size = QSize(36, 36)); + QString id() const; + void setScreenShotedView(QWidget *view); + void screenShot(); + +protected: + virtual void onIgnoreAction(); + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + +private: + void startDrag(const QPoint &pos); + void gobackDrag(const QPixmap &pixmap, const QPoint &pos); + +protected: + QString m_mimeDataFormat; + DTitlebarEditPanel *m_titleBarEditPanel = nullptr; + int m_index = -1; + QPixmap m_pixmap; + QString m_id; // m_id is key when Type is TITLEBAR_TYPE, m_id is toolId when Type is SELECTZONE_TYPE + +private: + QPoint m_startDrag; + bool m_isClicked = false; + QPointer m_view = nullptr; +}; + +class TitlebarZoneWidget : public DragDropWidget +{ +public: + explicit TitlebarZoneWidget(const QString &id = "", QWidget *parent = nullptr); + void onIgnoreAction() Q_DECL_OVERRIDE; +}; + +class SelectionZoneWidget : public DragDropWidget +{ +public: + explicit SelectionZoneWidget(const QString &id = "", QWidget *parent = nullptr); +}; + +class DefaultZoneWidget : public DragDropWidget +{ +public: + explicit DefaultZoneWidget(const QString &id = "", QWidget *parent = nullptr); +}; + +class IconTextWidget : public QWidget { + Q_OBJECT +public: + explicit IconTextWidget(DragDropWidget *m_iconWidget, const QString &toolId, QWidget *parent = nullptr); + ~IconTextWidget(); + + void setContent(const QIcon &icon, const QString &text, const QSize &size = QSize(36, 36)); + void setIconSize(const QSize &size); + +private: + QString m_toolId; + DragDropWidget *m_iconWidget; + QLabel *m_titleLabel; +}; + +class DCollapseWidget : public QWidget +{ + Q_OBJECT +public: + explicit DCollapseWidget(DTitlebarSettingsImpl *settings, QWidget *parent = nullptr); + virtual~DCollapseWidget() Q_DECL_OVERRIDE; + + void removeAll(); + void reloadWidgets(); + void removePlaceHolder(); + virtual void addWidget(const QString &key, int index); + void removeWidget(int index); + +protected: + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void collapse(); + void expand(); + void updateMinimumValue(); + void initExpandButton(); + +protected: + DTitlebarSettingsImpl *m_settingsImpl = nullptr; + QHBoxLayout *m_mainHLayout; + QVector> m_viewsInMenu; + DIconButton *m_expandButton = nullptr; + QPointer m_placeHolder = nullptr; + +private: + int m_minimumWidth = 0; +}; + +class DTitlebarCustomWidget: public DCollapseWidget +{ + Q_OBJECT +public: + explicit DTitlebarCustomWidget(DTitlebarSettingsImpl *settings, QWidget *parent = nullptr); + bool editMode() const; + void setEditMode(bool isEditMode); + QWidget *widget(const int index) const; + void addWidget(const QString &key, int index) Q_DECL_OVERRIDE; + void appendDefaultWidget(const QString &toolId); + void insertPlaceHolder(int index, const QSize &size); + +protected: + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + +private: + bool m_isEditMode = false; +}; + +class DTitlebarEditPanel : public DCollapseWidget +{ + Q_OBJECT +public: + explicit DTitlebarEditPanel(DTitlebarSettingsImpl *settings, DTitlebarCustomWidget *customWidget, QWidget *parent = nullptr); + void updateCustomWidget(bool isEditMode = true); + void updateScreenShotedViews(); + void addWidget(const QString &key, int index) Q_DECL_OVERRIDE; + bool isFixedTool(const int index); + bool dropped() const; + void setDropped(bool isDropped); + void doStartScreenShot(); + void replaceOldView(const QString &toolId); + +Q_SIGNALS: + void addingToolView(const QString &key, const int pos); + void removedToolView(const QString &key, const int pos); + void movedToolView(const QString &key, const int pos); + void resetToolView(); + void startScreenShot(); + +protected: + void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; + void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + +private: + bool containsTool(const QString &toolId); + void handleTitlebarZoneWidgetMoveEvent(QDropEvent *event); + void handleSelectionZoneWidgetMoveEvent(QDropEvent *event); + void handleDefaultWidgetDropEvent(QDropEvent *event); + void handleTitlebarZoneWidgetDropEvent(QDropEvent *event); + void handleSelectionZoneWidgetDropEvent(QDropEvent *event); + void positionPlaceHolder(const QPoint &pos, const QPoint &hotSpot, const QSize &size); + +private: + bool m_isDropped = true; + DTitlebarCustomWidget *m_customWidget; +}; + +class DToolbarEditPanel : public DBlurEffectWidget +{ + Q_OBJECT +public: + explicit DToolbarEditPanel(DTitlebarSettingsImpl *settingsImpl, QWidget *parent = Q_NULLPTR); + void addWidgetToSelectionZone(const QString &id); + void setDefaultView(const QPixmap &pixmap, const QSize &size); + void removeAll(); + +Q_SIGNALS: + void confirmBtnClicked(); + +private Q_SLOTS: + void onConfirmBtnClicked(); + +protected: + void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; + +private: + void init(); + +private: + DTitlebarSettingsImpl *m_settingsImpl = nullptr; + QWidget *m_selectZoneView; + DFlowLayout *m_flowLayout; + IconTextWidget *m_defaultToolBarWidget; + QPushButton *m_confirmBtn; +}; + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/private/dtitlebarsettingsimpl.cpp dtkwidget-5.6.12/src/widgets/private/dtitlebarsettingsimpl.cpp --- dtkwidget-5.5.48/src/widgets/private/dtitlebarsettingsimpl.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dtitlebarsettingsimpl.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,1041 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "dtitlebarsettingsimpl.h" +#include "ddialog.h" +#include "dtitlebareditpanel.h" +#include "diconbutton.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "dflowlayout.h" +#include "dtitlebar.h" + +DWIDGET_BEGIN_NAMESPACE +DCORE_USE_NAMESPACE + +static const QString SettingsTools(u8"tools"); +static const QString SettingsAlignment(u8"alignment"); +static const QString SettingsKey(u8"key"); +static const QString SettingsFixed(u8"fixed"); +static const QString SettingsCount(u8"count"); +static const QString SettingsSpacingSize(u8"spacingSize"); +static const QString SettingsSpacerId(u8"builtin/spacer"); +static const QString SettingsStretchId(u8"builtin/stretch"); + +DTitlebarDataStore::DTitlebarDataStore(QObject *parent) + : QObject(parent) + , m_settingsGroupName("dtitlebar-settings") + , m_settingsGroupNameSubGroup(QString("%1/%2").arg(m_settingsGroupName)) +{ +} + +DTitlebarDataStore::~DTitlebarDataStore() +{ + save(); + qDeleteAll(m_instances); +} + +DTitlebarDataStore *DTitlebarDataStore::instance() +{ + static DTitlebarDataStore *dataStore = nullptr; + if (!dataStore) { + dataStore = new DTitlebarDataStore; + } + return dataStore; +} + +bool DTitlebarDataStore::load() +{ + const auto root = metaRoot(); + if (root.isEmpty()) + return false; + + m_isValid = true; + + if (root.contains(SettingsSpacingSize)) { + m_spacingSize = root[SettingsSpacingSize].toInt(); + } + + const auto cachePos = positionsFromCache(); + if (!cachePos.isEmpty()) { + for (auto item: cachePos) { + const auto data = item.toMap(); + const auto &id = data["toolId"].toString(); + const auto &key = data["key"].toString(); + const auto &fixed = data["fixed"].toBool(); + const auto instance = createInstance(id, key); + instance->isFixed = fixed; + m_instances << instance; + } + } else { + const auto metaPos = toolInstancesFromToolMeta(root); + for (int i = 0; i < metaPos.count(); i++) { + const auto item = metaPos[i]; + const auto instance = createInstance(item.toolId); + instance->isFixed = item.isFixed; + m_instances << instance; + } + } + return true; +} + +ToolInstance *DTitlebarDataStore::createInstance(const QString &id) +{ + return createInstance(id, QUuid::createUuid().toString()); +} + +ToolInstance *DTitlebarDataStore::createInstance(const QString &id, const QString &key) +{ + auto instance = new ToolInstance(); + instance->key = key; + instance->toolId = id; + return instance; +} + +ToolInstance *DTitlebarDataStore::getInstance(const QString &key) const +{ + if (isInvalid()) + return nullptr; + for (int i = 0; i < m_instances.count(); i++) { + if (m_instances[i]->key == key) + return m_instances[i]; + } + return nullptr; +} + +bool DTitlebarDataStore::load(const QString &path) +{ + m_filePath = path; + return load(); +} + +void DTitlebarDataStore::save() +{ + if (m_isValid) { + savePositionsToCache(); + } +} + +void DTitlebarDataStore::clear() +{ + clearCache(); + qDeleteAll(m_instances); + m_instances.clear(); +} + +void DTitlebarDataStore::reset() +{ + clear(); + load(); +} + +bool DTitlebarDataStore::isValid() const +{ + return m_isValid; +} + +QString DTitlebarDataStore::findKeyByPos(const int pos) const +{ + if (isInvalid()) + return QString(); + + if (m_instances.count() <= pos || pos < 0) + return QString(); + + return m_instances[pos]->key; +} + +QStringList DTitlebarDataStore::defaultIds() const +{ + return positionsFromToolMeta(); +} + +QStringList DTitlebarDataStore::keys() const +{ + if (isInvalid()) + return QStringList(); + QStringList positions; + for (auto item: m_instances) { + positions << item->key; + } + return positions; +} + +QString DTitlebarDataStore::key(const int pos) +{ + if (isInvalid()) + return QString(); + + if (m_instances.count() <= pos || pos < 0) + return QString(); + + return m_instances[pos]->key; +} + +QStringList DTitlebarDataStore::toolIds() const +{ + QStringList positions; + for (auto item: m_instances) { + positions << item->toolId; + } + return positions; +} + +QString DTitlebarDataStore::toolId(const QString &key) const +{ + for (int i = 0; i < m_instances.count(); i++) { + if (m_instances[i]->key == key) + return m_instances[i]->toolId; + } + return QString(); +} + +void DTitlebarDataStore::removeAllNotExistIds(const QStringList &ids) +{ + for (int i = m_instances.count() - 1; i >= 0; i--) { + auto instance = m_instances[i]; + if (ids.contains(instance->toolId)) + continue; + + qDebug() << QString("Don't exit the id for %1.").arg(instance->toolId); + m_instances.remove(i); + delete instance; + } +} + +int DTitlebarDataStore::position(const QString &key) const +{ + const auto instance = getInstance(key); + if (!instance) + return -1; + + return m_instances.indexOf(instance); +} + +bool DTitlebarDataStore::contains(const QString &key) const +{ + return getInstance(key); +} + +bool DTitlebarDataStore::isExistTheId(const QString &id) const +{ + if (isInvalid()) + return false; + for (const auto item: m_instances) { + if (item->toolId == id) + return true; + } + return false; +} + +int DTitlebarDataStore::spacingSize() const +{ + return m_spacingSize; +} + +QString DTitlebarDataStore::insert(const QString &id, const int pos) +{ + if (isInvalid()) + return QString(); + + const int index = pos == -1 ? m_instances.count() : pos; + + const auto instance = createInstance(id); + m_instances.insert(index, instance); + return instance->key; +} + +void DTitlebarDataStore::remove(const QString &key) +{ + if (!contains(key)) + return; + + remove(position(key)); +} + +void DTitlebarDataStore::remove(const int pos) +{ + if (isInvalid()) + return; + + if (pos < 0 || pos >= m_instances.count()) + return; + + auto instance = m_instances.takeAt(pos); + delete instance; +} + +bool DTitlebarDataStore::isFixed(const QString &key) const +{ + if (auto instance = getInstance(key)) { + return instance->isFixed; + } + return false; +} + +bool DTitlebarDataStore::isFixed(const int pos) const +{ + if (pos < 0 || pos >= m_instances.count()) + return false; + + return m_instances[pos]->isFixed; +} + +bool DTitlebarDataStore::isInvalid() const +{ + if (!m_isValid) + qWarning() << "TitleBarDataStore is invalid."; + return !m_isValid; +} + +QStringList DTitlebarDataStore::positionsFromToolMeta(const QJsonObject &root) const +{ + QStringList metaPos; + for (auto item : toolInstancesFromToolMeta(root)) { + metaPos << item.toolId; + } + + return metaPos; +} + +QList DTitlebarDataStore::toolInstancesFromToolMeta(const QJsonObject &root) const +{ + QList results; + const auto &tools = root[SettingsTools].toArray(); + for (int i = 0; i < tools.size(); i++) { + const auto item = tools[i]; + const auto id = item[SettingsKey].toString(); + int count = acceptCountField(id) ? countFromToolMeta(root, i) : 1; + + for (int j = 0; j < count; j++) { + ToolInstance ins; + ins.toolId = id; + ins.isFixed = fixedFromToolMeta(root, i); + results << ins; + } + } + + ToolInstance stretchInstance; + stretchInstance.toolId = SettingsStretchId; + stretchInstance.isFixed = true; + const QString &aligment = alignmentFromToolMeta(root); + if (aligment == "right") { + results.prepend(stretchInstance); + } else { + results << stretchInstance; + } + + return results; +} + +bool DTitlebarDataStore::fixedFromToolMeta(const QJsonObject &root, const int index) const +{ + const auto &tools = root[SettingsTools].toArray(); + if (index < 0 || index >= tools.count()) + return false; + + const QJsonObject &item = tools[index].toObject(); + if (!item.contains(SettingsFixed)) + return false; + + return item[SettingsFixed].toBool(); +} + +int DTitlebarDataStore::countFromToolMeta(const QJsonObject &root, const int index) const +{ + const auto &tools = root[SettingsTools].toArray(); + if (index < 0 || index >= tools.count()) + return 0; + + const QJsonObject &item = tools[index].toObject(); + if (!item.contains(SettingsCount)) + return 1; + + return item[SettingsCount].toInt(); +} + +QString DTitlebarDataStore::alignmentFromToolMeta(const QJsonObject &root) const +{ + if (!root.contains(SettingsAlignment)) + return "left"; + return root[SettingsAlignment].toString(); +} + +QStringList DTitlebarDataStore::positionsFromToolMeta() const +{ + const auto root = metaRoot(); + return positionsFromToolMeta(root); +} + +QJsonObject DTitlebarDataStore::metaRoot() const +{ + QFile file(m_filePath); + if (!file.open(QIODevice::ReadOnly)) { + qWarning("Failed on open file: \"%s\", error message: \"%s\"", + qPrintable(file.fileName()), qPrintable(file.errorString())); + return QJsonObject(); + } + + QJsonParseError error; + auto document = QJsonDocument::fromJson(file.readAll(), &error); + if (error.error != QJsonParseError::NoError) { + qWarning("Failed on parse file: %s", qPrintable(error.errorString())); + return QJsonObject(); + } + + return document.object(); +} + +QVariantList DTitlebarDataStore::positionsFromCache() +{ + QVariantList positions; + QSettings settings; + const int size = settings.beginReadArray(m_settingsGroupNameSubGroup.arg("positions")); + for (int i = 0; i < size; i++) { + settings.setArrayIndex(i); + QVariantMap data; + data["key"] = settings.value("key"); + data["toolId"] = settings.value("toolId"); + data["fixed"] = settings.value("fixed"); + positions << data; + } + settings.endArray(); + return positions; +} + +void DTitlebarDataStore::savePositionsToCache() +{ + QSettings settings; + settings.beginWriteArray(m_settingsGroupNameSubGroup.arg("positions")); + for (int i = 0; i < m_instances.size(); i++) { + const auto item = m_instances[i]; + settings.setArrayIndex(i); + settings.setValue("key", item->key); + settings.setValue("toolId", item->toolId); + settings.setValue("fixed", item->isFixed); + } + settings.endArray(); +} + +void DTitlebarDataStore::clearCache() +{ + QSettings settings; + settings.beginGroup(m_settingsGroupName); + settings.remove(""); + settings.endGroup(); +} + +bool DTitlebarDataStore::acceptCountField(const QString &id) const +{ + const QStringList countToolIds { + SettingsSpacerId + }; + return countToolIds.contains(id); +} + +void DTitlebarDataStore::move(const QString &key, const int pos) +{ + if (isInvalid()) + return; + + if (!contains(key)) + return; + + m_instances.move(position(key), pos); +} + +QString DTitlebarDataStore::add(const QString &id) +{ + return insert(id, -1); +} + +DTitlebarToolFactory::DTitlebarToolFactory(QObject *parent) + : QObject(parent) +{ +} + +DTitlebarToolFactory::~DTitlebarToolFactory() +{ + m_tools.clear(); +} + +void DTitlebarToolFactory::add(DTitlebarToolBaseInterface *tool) +{ + bool exist = false; + for (const auto item : qAsConst(m_tools)) { + if (item.tool->id() == tool->id()) { + exist = true; + break; + } + } + if (exist) { + qWarning() << "The tool already exist in factory, tool key: " << tool->id(); + return; + } + m_tools[tool->id()] = ToolWrapper{tool}; +} + +void DTitlebarToolFactory::remove(const QString &id) +{ + m_tools.remove(id); +} + +void DTitlebarToolFactory::setTools(const QList &tools) +{ + m_tools.clear(); + for (auto tool : qAsConst(tools)) + m_tools[tool->id()] = ToolWrapper{tool}; +} + +DTitlebarToolBaseInterface *DTitlebarToolFactory::tool(const QString &id) const +{ + if (!contains(id)) + return nullptr; + + return m_tools[id].tool.data(); +} + +QList DTitlebarToolFactory::tools() const +{ + QList result; + for (auto item : m_tools.values()) + result << item.tool.data(); + + return result; +} + +bool DTitlebarToolFactory::contains(const QString &id) const +{ + return m_tools.contains(id); +} + +QStringList DTitlebarToolFactory::toolIds() const +{ + return m_tools.keys(); +} + +ReloadSignal *ReloadSignal::instance() +{ + static ReloadSignal *reloadSignal = nullptr; + if (!reloadSignal) { + reloadSignal = new ReloadSignal; + } + return reloadSignal; +} + +class ToolSpacer: public QWidget { +public: + explicit ToolSpacer(QWidget *parent = nullptr) : QWidget(parent) + { + } + +protected: + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; +}; + +void ToolSpacer::paintEvent(QPaintEvent *event) +{ + QColor color; + if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) { + color = QColor(65, 77, 104); + } else { + color = QColor(192, 198, 212); + } + QPainter painter(this); + painter.setRenderHints(QPainter::Antialiasing, true); + painter.setPen(QColor(213, 217, 221)); + painter.drawRoundedRect(this->rect().adjusted(1, 1, -1, -1), 8.0, 8.0); + + painter.setRenderHints(QPainter::Antialiasing, false); + + QPen pen(color); + painter.setPen(color); + painter.setBrush(color); + painter.drawLine(QPoint(rect().x() + 4, height() / 2 - 4), QPoint(rect().x() + 4, height() / 2 + 4)); + painter.drawLine(QPoint(width() - 4 - 1, height() / 2 - 4), QPoint(width() - 4 -1, height() / 2 + 4)); + + pen.setStyle(Qt::DashLine); + painter.setPen(pen); + painter.drawLine(QPoint(rect().x() + 4 + 2, height() / 2), QPoint(width() - 4 - 2, height() / 2)); + + QWidget::paintEvent(event); +} + +class DTitleBarToolSpacer : public DTitleBarSpacerInterface +{ +public: + DTitleBarToolSpacer(DTitlebarDataStore *dataStore) + : m_dataStore(dataStore) + { + } + inline virtual QString id() const override { return SettingsSpacerId; } + virtual QString description() override + { + return "builtin/spacer"; + } + virtual QString iconName() override + { + return "spacer_fixed"; + } + virtual QWidget *createPlaceholderView() override + { + auto view = new ToolSpacer(); + view->setFixedWidth(size()); + return view; + } + virtual int size() const override; +private: + const DTitlebarDataStore *m_dataStore = nullptr; +}; + +int DTitleBarToolSpacer::size() const +{ + if (!m_dataStore || m_dataStore->spacingSize() == -1) + return 30; + return m_dataStore->spacingSize(); +} + +class ToolStretch: public QWidget { +public: + explicit ToolStretch(QWidget *parent = nullptr) : QWidget(parent) + { + } + +protected: + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; +}; + +void ToolStretch::paintEvent(QPaintEvent *event) +{ + QColor color; + if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) { + color = QColor(65, 77, 104); + } else { + color = QColor(192, 198, 212); + } + QPainter painter(this); + painter.setPen(QColor(213, 217, 221)); + painter.setRenderHints(QPainter::Antialiasing, true); + painter.drawRoundedRect(this->rect().adjusted(1, 1, -1, -1), 8.0, 8.0); + + painter.setRenderHints(QPainter::Antialiasing, false); + + QPen pen(color); + painter.setPen(color); + painter.setBrush(color); + QPolygon leftTriangle; + leftTriangle.setPoints(3, rect().x() + 4, height() / 2, rect().x() + 4 + 4, height() / 2 - 4, rect().x() + 4 + 4, height() / 2 + 4); + painter.drawPolygon(leftTriangle); + + QPolygon rightTriangle; + rightTriangle.setPoints(3, width() - 4, height() / 2, width() - 4 - 4, height() / 2 - 4, width() - 4 - 4, height() / 2 + 4); + painter.drawPolygon(rightTriangle); + + pen.setStyle(Qt::DashLine); + painter.setPen(pen); + painter.drawLine(QPoint(rect().x() + 4 + 6, height() / 2), QPoint(width() - 4 - 6, height() / 2)); + + QWidget::paintEvent(event); +} + +class DTitleBarToolStretch : public DTitleBarSpacerInterface +{ +public: + inline virtual QString id() const override { return SettingsStretchId; } + virtual QString description() override + { + return "builtin/stretch"; + } + virtual QString iconName() override + { + return "spacer_stretch"; + } + virtual QWidget *createPlaceholderView() override + { + auto view = new ToolStretch(); + view->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + return view; + } + virtual int size() const override; +}; + +int DTitleBarToolStretch::size() const +{ + return -1; +} + +class DTitlebarSettingsImplPrivate: public DCORE_NAMESPACE::DObjectPrivate { + D_DECLARE_PUBLIC(DTitlebarSettingsImpl) +public: + DTitlebarSettingsImplPrivate(DTitlebarSettingsImpl *qq) + : DObjectPrivate(qq) + , dataStore(DTitlebarDataStore::instance()) + { + } + + void initDisplayView() + { + D_Q(DTitlebarSettingsImpl); + + displayView = new DTitlebarEditPanel(q, customView); + displayView->setAutoFillBackground(true); + displayView->setBackgroundRole(QPalette::Base); + QObject::connect(displayView, SIGNAL(addingToolView(const QString &, const int)), + q, SLOT(_q_addingToolView(const QString &, const int))); + QObject::connect(displayView, SIGNAL(removedToolView(const QString &, const int)), + q, SLOT(_q_removedToolView(const QString &, const int))); + QObject::connect(displayView, SIGNAL(resetToolView()), + q, SLOT(_q_resetToolView())); + QObject::connect(displayView, SIGNAL(movedToolView(const QString &, const int)), + q, SLOT(_q_movedToolView(const QString &, const int))); + } + + bool load(const QString &path) + { + if (!dataStore->isValid()) { + if (!dataStore->load(path)) + return false; + } + + // remove not existed tool. + dataStore->removeAllNotExistIds(factory.toolIds()); + + D_Q(DTitlebarSettingsImpl); + QObject::connect(ReloadSignal::instance(), SIGNAL(reload()), q, SLOT(_q_onReload())); + loadCustomView(false); + return true; + } + + void loadCustomView(bool isEditMode) + { + D_Q(DTitlebarSettingsImpl); + + if (!customView) { + customView = new DTitlebarCustomWidget(q); + } + + customView->setEditMode(isEditMode); + customView->removeAll(); + + // load tool from cache. + for (auto key : dataStore->keys()) { + customView->addWidget(key, -1); + } + customView->show(); + } + + void loadSelectZoneView() + { + toolsEditPanel->removeAll(); + for (auto id : factory.toolIds()) { + toolsEditPanel->addWidgetToSelectionZone(id); + } + } + + void loadDefaultZoneView() + { + D_Q(DTitlebarSettingsImpl); + + DTitlebarCustomWidget *defaultTitleBarEditPanel = new DTitlebarCustomWidget(q); + const QSize &size = QSize(toolsEditPanel->minimumWidth(), customView->height()); + defaultTitleBarEditPanel->setFixedSize(size); + for (auto id : dataStore->defaultIds()) { + defaultTitleBarEditPanel->appendDefaultWidget(id); + } + const QPixmap &pixmap = defaultTitleBarEditPanel->grab().scaled(size.width(), size.height() * 70 / 100); + toolsEditPanel->setDefaultView(pixmap, QSize(size.width(), size.height() * 70 / 100)); + defaultTitleBarEditPanel->deleteLater(); + } + + void loadDisplayView() + { + if (!displayView) { + initDisplayView(); + } + + displayView->removeAll(); + for (auto key : dataStore->keys()) { + displayView->addWidget(key, -1); + } + + displayView->updateScreenShotedViews(); + adjustDisplayView(); + } + + void adjustDisplayView() + { + if (displayView) { + displayView->setParent(customView->parentWidget()); + displayView->setFixedSize(customView->size()); + displayView->move(customView->pos()); + displayView->raise(); + Q_EMIT displayView->startScreenShot(); + displayView->show(); + } + } + + void addBuiltinTools() + { + auto spacer = new DTitleBarToolSpacer(dataStore); + factory.add(spacer); + auto stretch = new DTitleBarToolStretch(); + factory.add(stretch); + } + + void showEditPanel() + { + loadCustomView(true); // load the real view in title bar + loadDisplayView(); // load the editable view in title bar + loadSelectZoneView(); + loadDefaultZoneView(); + + toolsEditPanel->show(); + toolsEditPanel->setFocus(); + } + + void removeTool(const QString &key) + { + factory.remove(key); + if (!dataStore->contains(key)) { + qDebug() << "The tool doesn't exist in factory, tool key: " << key; + return; + } + dataStore->remove(key); + } + + void _q_addingToolView(const QString &id, const int pos) + { + D_QC(DTitlebarSettingsImpl); + qDebug() << Q_FUNC_INFO << id << pos; + if (!factory.contains(id)) + return; + + if (!q->isSpacerToolById(id)) { + if (dataStore->isExistTheId(id)) + return; + } + dataStore->insert(id, pos); + dataStore->save(); + Q_EMIT ReloadSignal::instance()->reload(); + } + + void _q_removedToolView(const QString &key, const int pos) + { + qDebug() << Q_FUNC_INFO << key << pos; + dataStore->remove(key); + dataStore->save(); + Q_EMIT ReloadSignal::instance()->reload(); + } + + void _q_movedToolView(const QString &key, const int pos) + { + qDebug() << Q_FUNC_INFO << key << pos; + dataStore->move(key, pos); + dataStore->save(); + Q_EMIT ReloadSignal::instance()->reload(); + } + + void _q_resetToolView() + { + qDebug() << Q_FUNC_INFO; + dataStore->reset(); + Q_EMIT ReloadSignal::instance()->reload(); + } + + void _q_confirmBtnClicked() + { + qDebug() << Q_FUNC_INFO << this; + dataStore->save(); + customView->setEditMode(false); + customView->reloadWidgets(); + displayView->setVisible(false); + } + + void _q_onReload() + { + qDebug() << Q_FUNC_INFO << this; + loadCustomView(customView->editMode()); + } + + QWidget *tryCreateToolsEditPanel() + { + D_Q(DTitlebarSettingsImpl); + if (!toolsEditPanel) { + toolsEditPanel = new DToolbarEditPanel(q); + QObject::connect(toolsEditPanel.data(), SIGNAL(confirmBtnClicked()), + q, SLOT(_q_confirmBtnClicked())); + } + return toolsEditPanel; + } + + DTitlebarToolFactory factory; + DTitlebarDataStore *dataStore = nullptr; + DTitlebarCustomWidget *customView = nullptr; + DTitlebarEditPanel *displayView = nullptr; + + QPointer toolsEditPanel = nullptr; +}; + +DTitlebarSettingsImpl::DTitlebarSettingsImpl(QObject *parent) + : QObject(parent) + , DObject(*new DTitlebarSettingsImplPrivate(this)) +{ +} + +DTitlebarSettingsImpl::~DTitlebarSettingsImpl() +{ +} + +void DTitlebarSettingsImpl::setTools(const QList &tools) +{ + D_D(DTitlebarSettingsImpl); + d->factory.setTools(tools); + d->addBuiltinTools(); +} + +void DTitlebarSettingsImpl::addTool(DTitlebarToolBaseInterface *tool) +{ + D_D(DTitlebarSettingsImpl); + d->factory.add(tool); +} + +DTitlebarToolBaseInterface *DTitlebarSettingsImpl::tool(const QString &key) const +{ + D_DC(DTitlebarSettingsImpl); + auto id = d->dataStore->toolId(key); + return d->factory.tool(id); +} + +DTitlebarToolBaseInterface *DTitlebarSettingsImpl::toolById(const QString &id) const +{ + D_DC(DTitlebarSettingsImpl); + return d->factory.tool(id); +} + +QStringList DTitlebarSettingsImpl::keys() const +{ + D_DC(DTitlebarSettingsImpl); + return d->dataStore->keys(); +} + +QString DTitlebarSettingsImpl::findKeyByPos(const int pos) const +{ + D_DC(DTitlebarSettingsImpl); + return d->dataStore->findKeyByPos(pos); +} + +QString DTitlebarSettingsImpl::toolId(const QString &key) const +{ + D_DC(DTitlebarSettingsImpl); + return d->dataStore->toolId(key); +} + +void DTitlebarSettingsImpl::removeTool(const QString &key) +{ + D_D(DTitlebarSettingsImpl); + d->removeTool(key); +} + +bool DTitlebarSettingsImpl::isSpacerTool(const DTitlebarToolBaseInterface *tool) +{ + return qobject_cast(tool); +} + +bool DTitlebarSettingsImpl::isSpacerTool(const QString &key) const +{ + D_DC(DTitlebarSettingsImpl); + const auto id = d->dataStore->toolId(key); + return isSpacerToolById(id); +} + +bool DTitlebarSettingsImpl::isStrecherTool(const QString &key) const +{ + D_DC(DTitlebarSettingsImpl); + const auto id = d->dataStore->toolId(key); + if (auto tool = qobject_cast(d->factory.tool(id))) + return tool->size() < 0; + + return false; +} + +bool DTitlebarSettingsImpl::isSpacerToolById(const QString &id) const +{ + D_DC(DTitlebarSettingsImpl); + return isSpacerTool(d->factory.tool(id)); +} + +bool DTitlebarSettingsImpl::isFixedTool(const QString &key) const +{ + D_DC(DTitlebarSettingsImpl); + return d->dataStore->isFixed(key); +} + +bool DTitlebarSettingsImpl::isFixedTool(const int pos) const +{ + D_DC(DTitlebarSettingsImpl); + return d->dataStore->isFixed(pos); +} + +bool DTitlebarSettingsImpl::load(const QString &path) +{ + D_D(DTitlebarSettingsImpl); + return d->load(path); +} + +QWidget *DTitlebarSettingsImpl::toolsView() const +{ + D_DC(DTitlebarSettingsImpl); + return d->customView; +} + +QWidget *DTitlebarSettingsImpl::toolsEditPanel() const +{ + D_DC(DTitlebarSettingsImpl); + return const_cast(d)->tryCreateToolsEditPanel(); +} + +bool DTitlebarSettingsImpl::hasEditPanel() const +{ + D_DC(DTitlebarSettingsImpl); + return d->toolsEditPanel != nullptr; +} + +void DTitlebarSettingsImpl::adjustDisplayView() +{ + D_D(DTitlebarSettingsImpl); + d->adjustDisplayView(); +} + +void DTitlebarSettingsImpl::showEditPanel() +{ + D_D(DTitlebarSettingsImpl); + d->showEditPanel(); +} + +bool DTitlebarSettingsImpl::isValid() const +{ + D_DC(DTitlebarSettingsImpl); + return d->dataStore->isValid(); +} + +void DTitlebarSettingsImpl::clearCache() +{ + D_D(DTitlebarSettingsImpl); + d->dataStore->clear(); +} + +DWIDGET_END_NAMESPACE + +#include "moc_dtitlebarsettingsimpl.cpp" diff -Nru dtkwidget-5.5.48/src/widgets/private/dtitlebarsettingsimpl.h dtkwidget-5.6.12/src/widgets/private/dtitlebarsettingsimpl.h --- dtkwidget-5.5.48/src/widgets/private/dtitlebarsettingsimpl.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/dtitlebarsettingsimpl.h 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,176 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#pragma once + +#include "dtkwidget_global.h" +#include "dtitlebarsettings.h" +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE +class QWidget; +QT_END_NAMESPACE + +DWIDGET_BEGIN_NAMESPACE + +class DTitlebarToolBaseInterface; + +struct ToolInstance +{ + QString key; + QString toolId; + bool isFixed = false; +}; +class DTitlebarDataStore : public QObject +{ + Q_OBJECT + +public: + explicit DTitlebarDataStore(QObject *parent = nullptr); + virtual ~DTitlebarDataStore() override; + + static DTitlebarDataStore *instance(); + bool load(const QString &path); + void save(); + void clear(); + void reset(); + bool isValid() const; + + QString findKeyByPos(const int pos) const; + QStringList defaultIds() const; + QStringList keys() const; + QString key(const int pos); + QStringList toolIds() const; + QString toolId(const QString &key) const; + void removeAllNotExistIds(const QStringList &ids); + int position(const QString &key) const; + bool contains(const QString &key) const; + bool isExistTheId(const QString &id) const; + int spacingSize() const; + + void move(const QString &key, const int pos); + QString add(const QString &id); + QString insert(const QString &id, const int pos); + void remove(const QString &key); + void remove(const int pos); + + bool isFixed(const QString &key) const; + bool isFixed(const int pos) const; + +private: + bool load(); + ToolInstance *createInstance(const QString &id); + ToolInstance *createInstance(const QString &id, const QString &key); + ToolInstance *getInstance(const QString &key) const; + bool isInvalid() const; + QStringList positionsFromToolMeta(const QJsonObject &root) const; + QList toolInstancesFromToolMeta(const QJsonObject &root) const; + bool fixedFromToolMeta(const QJsonObject &root, const int index) const; + int countFromToolMeta(const QJsonObject &root, const int index) const; + QString alignmentFromToolMeta(const QJsonObject &root) const; + QStringList positionsFromToolMeta() const; + QJsonObject metaRoot() const; + QVariantList positionsFromCache(); + void savePositionsToCache(); + void clearCache(); + bool acceptCountField(const QString &id) const; + +private: + QString m_settingsGroupName; + QString m_settingsGroupNameSubGroup; + QVector m_instances; + int m_spacingSize = -1; + bool m_isValid = false; + QString m_filePath; +}; + +struct ToolWrapper +{ + explicit ToolWrapper(DTitlebarToolBaseInterface *t = nullptr) + : tool(t) + { + } + QSharedPointer tool = nullptr; +}; + +class DTitlebarToolFactory : public QObject +{ + Q_OBJECT +public: + explicit DTitlebarToolFactory(QObject *parent = nullptr); + virtual ~DTitlebarToolFactory() override; + + void add(DTitlebarToolBaseInterface *tool); + void remove(const QString &id); + void setTools(const QList &tools); + DTitlebarToolBaseInterface *tool(const QString &id) const; + QList tools() const; + bool contains(const QString &id) const; + + QStringList toolIds() const; + +private: + QMap m_tools; +}; + +class ReloadSignal : public QObject +{ + Q_OBJECT +public: + static ReloadSignal *instance(); +Q_SIGNALS: + void reload(); +private: + ReloadSignal() = default; + ~ReloadSignal() = default; +}; + +class DTitlebarSettingsImplPrivate; + +class DTitlebarSettingsImpl : public QObject, public DCORE_NAMESPACE::DObject +{ + Q_OBJECT +public: + explicit DTitlebarSettingsImpl(QObject *parent = nullptr); + virtual ~DTitlebarSettingsImpl() override; + + void setTools(const QList &tools); + void addTool(DTitlebarToolBaseInterface *tool); + DTitlebarToolBaseInterface *tool(const QString &key) const; + DTitlebarToolBaseInterface *toolById(const QString &id) const; + QStringList keys() const; + QString findKeyByPos(const int pos) const; + QString toolId(const QString &key) const; + void removeTool(const QString &key); + static bool isSpacerTool(const DTitlebarToolBaseInterface *tool); + bool isSpacerTool(const QString &key) const; + bool isStrecherTool(const QString &key) const; + bool isSpacerToolById(const QString &id) const; + bool isFixedTool(const QString &key) const; + bool isFixedTool(const int pos) const; + bool load(const QString &path); + + QWidget *toolsView() const; + QWidget *toolsEditPanel() const; + bool hasEditPanel() const; + void adjustDisplayView(); + void showEditPanel(); + bool isValid() const; + void clearCache(); + +private: + D_DECLARE_PRIVATE(DTitlebarSettingsImpl) + + D_PRIVATE_SLOT(void _q_addingToolView(const QString &, const int)) + D_PRIVATE_SLOT(void _q_removedToolView(const QString &, const int)) + D_PRIVATE_SLOT(void _q_movedToolView(const QString &, const int)) + D_PRIVATE_SLOT(void _q_resetToolView()) + D_PRIVATE_SLOT(void _q_confirmBtnClicked()) + D_PRIVATE_SLOT(void _q_onReload()) +}; + +DWIDGET_END_NAMESPACE diff -Nru dtkwidget-5.5.48/src/widgets/private/keyboardmonitor/dkeyboardmonitor.cpp dtkwidget-5.6.12/src/widgets/private/keyboardmonitor/dkeyboardmonitor.cpp --- dtkwidget-5.5.48/src/widgets/private/keyboardmonitor/dkeyboardmonitor.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/keyboardmonitor/dkeyboardmonitor.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,27 +1,6 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * kirigaya - * Hualet - * - * Maintainer: sbw - * kirigaya - * Hualet - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dkeyboardmonitor.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/keyboardmonitor/dkeyboardmonitor.h dtkwidget-5.6.12/src/widgets/private/keyboardmonitor/dkeyboardmonitor.h --- dtkwidget-5.5.48/src/widgets/private/keyboardmonitor/dkeyboardmonitor.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/keyboardmonitor/dkeyboardmonitor.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,27 +1,6 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * kirigaya - * Hualet - * - * Maintainer: sbw - * kirigaya - * Hualet - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef KEYBOARDMONITOR_H #define KEYBOARDMONITOR_H diff -Nru dtkwidget-5.5.48/src/widgets/private/keyboardmonitor/keyboardmonitor.pri dtkwidget-5.6.12/src/widgets/private/keyboardmonitor/keyboardmonitor.pri --- dtkwidget-5.5.48/src/widgets/private/keyboardmonitor/keyboardmonitor.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/keyboardmonitor/keyboardmonitor.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -CONFIG += c++11 link_pkgconfig -PKGCONFIG += xext x11 xi - -INCLUDEPATH += $$PWD - -HEADERS += \ - $$PWD/dkeyboardmonitor.h - -SOURCES += \ - $$PWD/dkeyboardmonitor.cpp diff -Nru dtkwidget-5.5.48/src/widgets/private/mpris/dbusinterface.cpp dtkwidget-5.6.12/src/widgets/private/mpris/dbusinterface.cpp --- dtkwidget-5.5.48/src/widgets/private/mpris/dbusinterface.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/mpris/dbusinterface.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dbusinterface.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/mpris/dbusinterface.h dtkwidget-5.6.12/src/widgets/private/mpris/dbusinterface.h --- dtkwidget-5.5.48/src/widgets/private/mpris/dbusinterface.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/mpris/dbusinterface.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DBUSINTERFACE_H #define DBUSINTERFACE_H diff -Nru dtkwidget-5.5.48/src/widgets/private/mpris/dbusmpris.cpp dtkwidget-5.6.12/src/widgets/private/mpris/dbusmpris.cpp --- dtkwidget-5.5.48/src/widgets/private/mpris/dbusmpris.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/mpris/dbusmpris.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dbusmpris.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/mpris/dbusmpris.h dtkwidget-5.6.12/src/widgets/private/mpris/dbusmpris.h --- dtkwidget-5.5.48/src/widgets/private/mpris/dbusmpris.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/mpris/dbusmpris.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DBUSMPRIS_H #define DBUSMPRIS_H diff -Nru dtkwidget-5.5.48/src/widgets/private/mpris/dmprismonitor.cpp dtkwidget-5.6.12/src/widgets/private/mpris/dmprismonitor.cpp --- dtkwidget-5.5.48/src/widgets/private/mpris/dmprismonitor.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/mpris/dmprismonitor.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "dmprismonitor.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/mpris/dmprismonitor.h dtkwidget-5.6.12/src/widgets/private/mpris/dmprismonitor.h --- dtkwidget-5.5.48/src/widgets/private/mpris/dmprismonitor.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/mpris/dmprismonitor.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DMPRISMONITOR_H #define DMPRISMONITOR_H diff -Nru dtkwidget-5.5.48/src/widgets/private/mpris/org.freedesktop.DBus.xml dtkwidget-5.6.12/src/widgets/private/mpris/org.freedesktop.DBus.xml --- dtkwidget-5.5.48/src/widgets/private/mpris/org.freedesktop.DBus.xml 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/mpris/org.freedesktop.DBus.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru dtkwidget-5.5.48/src/widgets/private/mpris/org.mpris.MediaPlayer2.xml dtkwidget-5.6.12/src/widgets/private/mpris/org.mpris.MediaPlayer2.xml --- dtkwidget-5.5.48/src/widgets/private/mpris/org.mpris.MediaPlayer2.xml 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/mpris/org.mpris.MediaPlayer2.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru dtkwidget-5.5.48/src/widgets/private/private.pri dtkwidget-5.6.12/src/widgets/private/private.pri --- dtkwidget-5.5.48/src/widgets/private/private.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/private.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -linux{ - include(keyboardmonitor/keyboardmonitor.pri) - include(startupnotifications/startupnotifications.pri) - HEADERS += \ - $$PWD/mpris/dmprismonitor.h \ - $$PWD/mpris/dbusinterface.h \ - $$PWD/dmpriscontrol_p.h \ - $$PWD/mpris/dbusmpris.h - - SOURCES += \ - $$PWD/mpris/dmprismonitor.cpp \ - $$PWD/mpris/dbusinterface.cpp \ - $$PWD/mpris/dbusmpris.cpp -} - -HEADERS += \ - $$PWD/dthemehelper.h \ - $$PWD/dcircleprogress_p.h \ - $$PWD/dlineedit_p.h \ - $$PWD/dfilechooseredit_p.h \ - $$PWD/dstackwidget_p.h \ - $$PWD/dboxwidget_p.h \ - $$PWD/dpasswordedit_p.h \ - $$PWD/dabstractdialogprivate_p.h \ - $$PWD/ddialog_p.h \ - $$PWD/dloadingindicator_p.h \ - $$PWD/dinputdialog_p.h \ - $$PWD/dipv4lineedit_p.h \ - $$PWD/dspinbox_p.h \ - $$PWD/dpicturesequenceview_p.h \ - $$PWD/dflowlayout_p.h \ - $$PWD/dlistview_p.h \ - $$PWD/dapplication_p.h \ - $$PWD/dmainwindow_p.h \ - $$PWD/dblureffectwidget_p.h \ - $$PWD/dpageindicator_p.h \ - $$PWD/daboutdialog_p.h \ - $$PWD/darrowrectangle_p.h \ - $$PWD/dtickeffect_p.h \ - $$PWD/dswitchbutton_p.h \ - $$PWD/dimagebutton_p.h \ - $$PWD/diconbutton_p.h \ - $$PWD/dsearchedit_p.h \ - $$PWD/dfloatingwidget_p.h \ - $$PWD/dfloatingmessage_p.h \ - $$PWD/dbuttonbox_p.h \ - $$PWD/dslider_p.h \ - $$PWD/dtiplabel_p.h \ - $$PWD/dkeysequenceedit_p.h \ - $$PWD/dlabel_p.h \ - $$PWD/dframe_p.h \ - $$PWD/ddrawer_p.h \ - $$PWD/dalertcontrol_p.h \ - $$PWD/dsearchcombobox_p.h \ - $$PWD/dprintpreviewdialog_p.h \ - $$PWD/dprintpreviewwidget_p.h \ - $$PWD/dpalettehelper_p.h \ - $$PWD/dcombobox_p.h \ - $$PWD/dsplitscreen_p.h - -SOURCES += \ - $$PWD/dthemehelper.cpp diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/buttongroup.cpp dtkwidget-5.6.12/src/widgets/private/settings/buttongroup.cpp --- dtkwidget-5.5.48/src/widgets/private/settings/buttongroup.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/buttongroup.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "buttongroup.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/buttongroup.h dtkwidget-5.6.12/src/widgets/private/settings/buttongroup.h --- dtkwidget-5.5.48/src/widgets/private/settings/buttongroup.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/buttongroup.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #pragma once diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/combobox.cpp dtkwidget-5.6.12/src/widgets/private/settings/combobox.cpp --- dtkwidget-5.5.48/src/widgets/private/settings/combobox.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/combobox.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "combobox.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/combobox.h dtkwidget-5.6.12/src/widgets/private/settings/combobox.h --- dtkwidget-5.5.48/src/widgets/private/settings/combobox.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/combobox.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #pragma once diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/content.cpp dtkwidget-5.6.12/src/widgets/private/settings/content.cpp --- dtkwidget-5.5.48/src/widgets/private/settings/content.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/content.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "content.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/content.h dtkwidget-5.6.12/src/widgets/private/settings/content.h --- dtkwidget-5.5.48/src/widgets/private/settings/content.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/content.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #pragma once diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/contenttitle.cpp dtkwidget-5.6.12/src/widgets/private/settings/contenttitle.cpp --- dtkwidget-5.5.48/src/widgets/private/settings/contenttitle.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/contenttitle.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "contenttitle.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/contenttitle.h dtkwidget-5.6.12/src/widgets/private/settings/contenttitle.h --- dtkwidget-5.5.48/src/widgets/private/settings/contenttitle.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/contenttitle.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #pragma once diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/navigation.cpp dtkwidget-5.6.12/src/widgets/private/settings/navigation.cpp --- dtkwidget-5.5.48/src/widgets/private/settings/navigation.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/navigation.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "navigation.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/navigationdelegate.cpp dtkwidget-5.6.12/src/widgets/private/settings/navigationdelegate.cpp --- dtkwidget-5.5.48/src/widgets/private/settings/navigationdelegate.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/navigationdelegate.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "navigationdelegate.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/navigationdelegate.h dtkwidget-5.6.12/src/widgets/private/settings/navigationdelegate.h --- dtkwidget-5.5.48/src/widgets/private/settings/navigationdelegate.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/navigationdelegate.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #pragma once diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/navigation.h dtkwidget-5.6.12/src/widgets/private/settings/navigation.h --- dtkwidget-5.5.48/src/widgets/private/settings/navigation.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/navigation.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #pragma once diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/shortcutedit.cpp dtkwidget-5.6.12/src/widgets/private/settings/shortcutedit.cpp --- dtkwidget-5.5.48/src/widgets/private/settings/shortcutedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/shortcutedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include "shortcutedit.h" diff -Nru dtkwidget-5.5.48/src/widgets/private/settings/shortcutedit.h dtkwidget-5.6.12/src/widgets/private/settings/shortcutedit.h --- dtkwidget-5.5.48/src/widgets/private/settings/shortcutedit.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/settings/shortcutedit.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #pragma once diff -Nru dtkwidget-5.5.48/src/widgets/private/startupnotifications/startupnotificationmonitor.cpp dtkwidget-5.6.12/src/widgets/private/startupnotifications/startupnotificationmonitor.cpp --- dtkwidget-5.5.48/src/widgets/private/startupnotifications/startupnotificationmonitor.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/startupnotifications/startupnotificationmonitor.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/src/widgets/private/startupnotifications/startupnotificationmonitor.h dtkwidget-5.6.12/src/widgets/private/startupnotifications/startupnotificationmonitor.h --- dtkwidget-5.5.48/src/widgets/private/startupnotifications/startupnotificationmonitor.h 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/startupnotifications/startupnotificationmonitor.h 2023-05-15 03:42:41.000000000 +0000 @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #ifndef STARTUPNOTIFICATIONMONITOR_H #define STARTUPNOTIFICATIONMONITOR_H diff -Nru dtkwidget-5.5.48/src/widgets/private/startupnotifications/startupnotifications.pri dtkwidget-5.6.12/src/widgets/private/startupnotifications/startupnotifications.pri --- dtkwidget-5.5.48/src/widgets/private/startupnotifications/startupnotifications.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/private/startupnotifications/startupnotifications.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -CONFIG += c++11 link_pkgconfig -PKGCONFIG += xcb-util libstartup-notification-1.0 - -INCLUDEPATH += $$PWD -DEFINES += SN_API_NOT_YET_FROZEN - -HEADERS += \ - $$PWD/startupnotificationmonitor.h - -SOURCES += \ - $$PWD/startupnotificationmonitor.cpp diff -Nru dtkwidget-5.5.48/src/widgets/widgets.cmake dtkwidget-5.6.12/src/widgets/widgets.cmake --- dtkwidget-5.5.48/src/widgets/widgets.cmake 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/widgets.cmake 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,19 @@ +# TODO Maybe need to check if is apple or else +file(GLOB MPRIS_HEADERS ${CMAKE_CURRENT_LIST_DIR}/private/mpris/*.h) +file(GLOB MPRIS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/private/mpris/*.cpp) +file(GLOB WIDGETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/*.cpp ${CMAKE_CURRENT_LIST_DIR}/private/*.cpp) +file(GLOB WIDGETS_PRIVATE_HEADERS ${CMAKE_CURRENT_LIST_DIR}/private/*.h) +file(GLOB SETTINGS ${CMAKE_CURRENT_LIST_DIR}/private/settings/*) +file(GLOB NOTIFICATIONS ${CMAKE_CURRENT_LIST_DIR}/private/startupnotifications/*) +file(GLOB KEYBOARD ${CMAKE_CURRENT_LIST_DIR}/private/keyboardmonitor/*) +file(GLOB_RECURSE RESOURCES ${CMAKE_CURRENT_LIST_DIR}/*.qrc) +set(WIDGETS + ${MPRIS_HEADERS} + ${MPRIS_SOURCES} + ${WIDGETS_SOURCES} + ${WIDGETS_PRIVATE_HEADERS} + ${SETTINGS} + ${NOTIFICATIONS} + ${KEYBOARD} + ${RESOURCES} +) diff -Nru dtkwidget-5.5.48/src/widgets/widgets.pri dtkwidget-5.6.12/src/widgets/widgets.pri --- dtkwidget-5.5.48/src/widgets/widgets.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/src/widgets/widgets.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,376 +0,0 @@ -include(private/private.pri) -include(dialogs.pri) -include($$PWD/../platforms/platforms.pri) - -win32* { - INCLUDEPATH += $$PWD/../platforms/windows -} - -linux{ - HEADERS += \ - $$PWD/dmpriscontrol.h - - SOURCES += \ - $$PWD/dmpriscontrol.cpp - - includes.files += \ - $$PWD/DPasswdEditAnimated -} - -mac{ - HEADERS +=\ - $$PWD/../platforms/mac/osxwindow.h - - OBJECTIVE_SOURCES += \ - $$PWD/../platforms/mac/osxwindow.mm - - INCLUDEPATH += $$PWD/../platforms/mac - - LIBS += -framework Foundation -framework Cocoa -} - -HEADERS += $$PWD/dslider.h\ - $$PWD/dbackgroundgroup.h \ - $$PWD/dthememanager.h \ - $$PWD/dapplication.h \ - $$PWD/dconstants.h \ - $$PWD/dbaseline.h \ - $$PWD/dheaderline.h \ - $$PWD/dbaseexpand.h \ - $$PWD/darrowbutton.h \ - $$PWD/darrowlineexpand.h \ - $$PWD/dswitchlineexpand.h \ - $$PWD/dimagebutton.h \ - $$PWD/dloadingindicator.h \ - $$PWD/dsearchedit.h \ - $$PWD/dswitchbutton.h \ - $$PWD/dsegmentedcontrol.h \ - $$PWD/dlineedit.h \ - $$PWD/dwindowmaxbutton.h \ - $$PWD/dwindowminbutton.h \ - $$PWD/dwindowclosebutton.h \ - $$PWD/dwindowoptionbutton.h \ - $$PWD/dtabletwindowoptionbutton.h \ - $$PWD/dwindowquitfullbutton.h \ - $$PWD/dshortcutedit.h \ - $$PWD/dsimplelistview.h \ - $$PWD/dsimplelistitem.h \ - $$PWD/dexpandgroup.h \ - $$PWD/darrowrectangle.h \ - $$PWD/dgraphicsgloweffect.h \ - $$PWD/dboxwidget.h \ - $$PWD/dcircleprogress.h \ - $$PWD/dstackwidget.h \ - $$PWD/dfilechooseredit.h \ - $$PWD/dpasswordedit.h \ - $$PWD/dipv4lineedit.h \ - $$PWD/dspinbox.h \ - $$PWD/dpicturesequenceview.h \ - $$PWD/dflowlayout.h \ - $$PWD/dlistview.h \ - $$PWD/denhancedwidget.h \ - $$PWD/dtitlebar.h \ - $$PWD/dplatformwindowhandle.h \ - $$PWD/dmainwindow.h \ - $$PWD/dblureffectwidget.h \ - $$PWD/dpageindicator.h \ - $$PWD/dclipeffectwidget.h \ - $$PWD/dgraphicsclipeffect.h \ - $$PWD/dtickeffect.h \ - $$PWD/dwaterprogress.h \ - $$PWD/dsettingswidgetfactory.h \ - $$PWD/dspinner.h \ - $$PWD/dcrumbedit.h \ - $$PWD/dtabbar.h \ - $$PWD/dsuggestbutton.h \ - $$PWD/dstyleoption.h \ - $$PWD/dtoast.h \ - $$PWD/danchors.h \ - $$PWD/dstyle.h \ - $$PWD/dfloatingbutton.h \ - $$PWD/dwidgetstype.h \ - $$PWD/dstyleditemdelegate.h \ - $$PWD/diconbutton.h \ - $$PWD/dfloatingwidget.h \ - $$PWD/dapplicationhelper.h \ - $$PWD/dfloatingmessage.h \ - $$PWD/dmessagemanager.h \ - $$PWD/dbuttonbox.h \ - $$PWD/dwarningbutton.h \ - $$PWD/dcommandlinkbutton.h \ - $$PWD/ddialogclosebutton.h \ - $$PWD/dtiplabel.h \ - $$PWD/dtooltip.h \ - $$PWD/dframe.h \ - $$PWD/dshadowline.h \ - $$PWD/dcoloredprogressbar.h \ - $$PWD/dkeysequenceedit.h \ - $$PWD/dprogressbar.h \ - $$PWD/dlabel.h \ - $$PWD/dtextedit.h \ - $$PWD/ddrawer.h \ - $$PWD/darrowlinedrawer.h \ - $$PWD/ddrawergroup.h \ - $$PWD/dalertcontrol.h \ - $$PWD/dtoolbutton.h \ - $$PWD/dsearchcombobox.h \ - $$PWD/dprintpreviewwidget.h \ - $$PWD/dprintpickcolorwidget.h \ - $$PWD/dpalettehelper.h \ - $$PWD/dcombobox.h \ - $$PWD/dfontcombobox.h - -SOURCES += $$PWD/dslider.cpp \ - $$PWD/dbackgroundgroup.cpp \ - $$PWD/dthememanager.cpp \ - $$PWD/dapplication.cpp \ - $$PWD/dbaseline.cpp \ - $$PWD/dheaderline.cpp \ - $$PWD/dbaseexpand.cpp \ - $$PWD/darrowbutton.cpp \ - $$PWD/darrowlineexpand.cpp \ - $$PWD/dswitchlineexpand.cpp \ - $$PWD/dimagebutton.cpp \ - $$PWD/dloadingindicator.cpp \ - $$PWD/dsearchedit.cpp \ - $$PWD/dswitchbutton.cpp\ - $$PWD/dsegmentedcontrol.cpp \ - $$PWD/dlineedit.cpp \ - $$PWD/dwindowmaxbutton.cpp \ - $$PWD/dwindowminbutton.cpp \ - $$PWD/dwindowclosebutton.cpp \ - $$PWD/dwindowoptionbutton.cpp \ - $$PWD/dtabletwindowoptionbutton.cpp \ - $$PWD/dwindowquitfullbutton.cpp \ - $$PWD/dshortcutedit.cpp \ - $$PWD/dsimplelistview.cpp \ - $$PWD/dsimplelistitem.cpp \ - $$PWD/dexpandgroup.cpp \ - $$PWD/darrowrectangle.cpp \ - $$PWD/dgraphicsgloweffect.cpp \ - $$PWD/dboxwidget.cpp \ - $$PWD/dcircleprogress.cpp \ - $$PWD/dstackwidget.cpp \ - $$PWD/dfilechooseredit.cpp \ - $$PWD/dpasswordedit.cpp \ - $$PWD/dipv4lineedit.cpp \ - $$PWD/dspinbox.cpp \ - $$PWD/dpicturesequenceview.cpp \ - $$PWD/dflowlayout.cpp \ - $$PWD/dlistview.cpp \ - $$PWD/denhancedwidget.cpp \ - $$PWD/dtitlebar.cpp \ - $$PWD/dplatformwindowhandle.cpp \ - $$PWD/dmainwindow.cpp \ - $$PWD/dblureffectwidget.cpp \ - $$PWD/dpageindicator.cpp \ - $$PWD/dclipeffectwidget.cpp \ - $$PWD/dgraphicsclipeffect.cpp \ - $$PWD/dtickeffect.cpp \ - $$PWD/dwaterprogress.cpp \ - $$PWD/dsettingswidgetfactory.cpp \ - $$PWD/dspinner.cpp \ - $$PWD/dcrumbedit.cpp \ - $$PWD/dtabbar.cpp \ - $$PWD/dsuggestbutton.cpp \ - $$PWD/dstyleoption.cpp \ - $$PWD/dtoast.cpp \ - $$PWD/danchors.cpp \ - $$PWD/dstyle.cpp \ - $$PWD/dfloatingbutton.cpp \ - $$PWD/dstyleditemdelegate.cpp \ - $$PWD/diconbutton.cpp \ - $$PWD/dfloatingwidget.cpp \ - $$PWD/dapplicationhelper.cpp \ - $$PWD/dfloatingmessage.cpp \ - $$PWD/dmessagemanager.cpp \ - $$PWD/dbuttonbox.cpp \ - $$PWD/dwarningbutton.cpp \ - $$PWD/dcommandlinkbutton.cpp \ - $$PWD/ddialogclosebutton.cpp \ - $$PWD/dtiplabel.cpp \ - $$PWD/dtooltip.cpp \ - $$PWD/dframe.cpp \ - $$PWD/dshadowline.cpp \ - $$PWD/dcoloredprogressbar.cpp \ - $$PWD/dkeysequenceedit.cpp \ - $$PWD/dprogressbar.cpp \ - $$PWD/dlabel.cpp \ - $$PWD/dtextedit.cpp \ - $$PWD/ddrawer.cpp \ - $$PWD/darrowlinedrawer.cpp \ - $$PWD/ddrawergroup.cpp \ - $$PWD/dalertcontrol.cpp \ - $$PWD/dtoolbutton.cpp \ - $$PWD/dsearchcombobox.cpp \ - $$PWD/dprintpreviewwidget.cpp \ - $$PWD/dprintpickcolorwidget.cpp \ - $$PWD/dpalettehelper.cpp \ - $$PWD/dcombobox.cpp \ - $$PWD/dfontcombobox.cpp - -RESOURCES += \ - $$PWD/icons.qrc \ - $$PWD/assets/icons/dtk-icon-theme.qrc - -INCLUDEPATH += $$PWD - -includes.files += $$PWD/*.h -includes.files += \ - $$PWD/DTitlebar \ - $$PWD/DMainWindow \ - $$PWD/DAboutDialog \ - $$PWD/DApplication \ - $$PWD/DBlurEffectWidget \ - $$PWD/DClipEffectWidget \ - $$PWD/DGraphicsDropShadowEffect \ - $$PWD/DPlatformWindowHandle \ - $$PWD/DGraphicsClipEffect \ - $$PWD/DExpandGroup \ - $$PWD/DArrowButton \ - $$PWD/DArrowLineExpand \ - $$PWD/DThemeManager \ - $$PWD/DWaterProgress \ - $$PWD/DSimpleListView \ - $$PWD/DSimpleListItem \ - $$PWD/DSearchEdit \ - $$PWD/DPageIndicator \ - $$PWD/DSettingsWidgetFactory \ - $$PWD/DSettingsDialog \ - $$PWD/DSpinner \ - $$PWD/DCrumbEdit \ - $$PWD/DTabBar \ - $$PWD/DSuggestButton \ - $$PWD/DStyleOption \ - $$PWD/DToast \ - $$PWD/DFileDialog \ - $$PWD/DLineEdit \ - $$PWD/DIpv4LineEdit \ - $$PWD/DStyleOptionLineEdit \ - $$PWD/DAnchors \ - $$PWD/DSegmentedControl \ - $$PWD/DSegmentedHighlight \ - $$PWD/DBackgroundGroup \ - $$PWD/DStyleOptionBackgroundGroup \ - $$PWD/DStyleOptionButton \ - $$PWD/DPalette \ - $$PWD/DFontSizeManager \ - $$PWD/DStyle \ - $$PWD/DFloatingButton \ - $$PWD/DListView \ - $$PWD/DStyleOptionViewItem \ - $$PWD/DScrollBar \ - $$PWD/DPushButton \ - $$PWD/DToolButton \ - $$PWD/DRadioButton \ - $$PWD/DCheckButton \ - $$PWD/DCommandLinkButton \ - $$PWD/DDialogButtonBox \ - $$PWD/DListWidget \ - $$PWD/DTreeWidget \ - $$PWD/DTableWidget \ - $$PWD/DGroupBox \ - $$PWD/DScrollArea \ - $$PWD/DToolBox \ - $$PWD/DTableWidget \ - $$PWD/DStackedWidget \ - $$PWD/DFrame \ - $$PWD/DWidget \ - $$PWD/DMDIArea \ - $$PWD/DDockWidget \ - $$PWD/DComboBox \ - $$PWD/DFontComboBox \ - $$PWD/DLineEdit \ - $$PWD/DTextEdit \ - $$PWD/DPlainTextEdit \ - $$PWD/DSpinBox \ - $$PWD/DDoubleSpinBox \ - $$PWD/DTimeEdit \ - $$PWD/DDateEdit \ - $$PWD/DDateTimeEdit \ - $$PWD/DDial \ - $$PWD/DHorizontalScrollBar \ - $$PWD/DVerticalScrollBar \ - $$PWD/DHorizontalSlider \ - $$PWD/DVerticalSlider \ - $$PWD/DKeySequenceEdit \ - $$PWD/DLabel \ - $$PWD/DTextBrowser \ - $$PWD/DGraphicsView \ - $$PWD/DCalendarWidget \ - $$PWD/DLCDNumber \ - $$PWD/DProgressBar \ - $$PWD/DHorizontalLine \ - $$PWD/DVerticalLine \ - $$PWD/DOpenGLWidget \ - $$PWD/DQuickWidget \ - $$PWD/DWebView \ - $$PWD/DAccessibleWidget \ - $$PWD/DCheckBox \ - $$PWD/DColorDialog \ - $$PWD/DColumnView \ - $$PWD/DDataWidgetMapper \ - $$PWD/DFocusFrame \ - $$PWD/DHeaderView \ - $$PWD/DInputDialog \ - $$PWD/DMdiArea \ - $$PWD/DMdiSubWindow \ - $$PWD/DErrorMessage \ - $$PWD/DFontDialog \ - $$PWD/DMenu \ - $$PWD/DMenuBar \ - $$PWD/DMessageBox \ - $$PWD/DRubberBand \ - $$PWD/DSlider \ - $$PWD/DSplitter \ - $$PWD/DStatusBar \ - $$PWD/DTabWidget \ - $$PWD/DTableView \ - $$PWD/DTileRules \ - $$PWD/DToolBar \ - $$PWD/DToolTip \ - $$PWD/DTreeView \ - $$PWD/DUndoView \ - $$PWD/DWhatsThis \ - $$PWD/DWizard \ - $$PWD/DWizardPage \ - $$PWD/DDialog \ - $$PWD/DStyledItemDelegate \ - $$PWD/DStandardItem \ - $$PWD/DIconButton \ - $$PWD/DFloatingWidget \ - $$PWD/DStyleHelper \ - $$PWD/DStylePainter \ - $$PWD/DStyledIconEngine \ - $$PWD/DArrowRectangle \ - $$PWD/DImageButton \ - $$PWD/DSwitchButton \ - $$PWD/DWindowCloseButton \ - $$PWD/DWindowMaxButton \ - $$PWD/DWindowMinButton \ - $$PWD/DWindowOptionButton \ - $$PWD/DTabletWindowOptionButton \ - $$PWD/DWindowQuitFullButton \ - $$PWD/DApplicationHelper \ - $$PWD/DFloatingWidget \ - $$PWD/DFloatingMessage \ - $$PWD/DMessageManager \ - $$PWD/DButtonBox \ - $$PWD/DApplicationSettings \ - $$PWD/DWarningButton \ - $$PWD/DDialogCloseButton \ - $$PWD/DPasswordEdit \ - $$PWD/DTipLabel \ - $$PWD/DShadowLine \ - $$PWD/DColoredProgressBar \ - $$PWD/DAbstractdialog \ - $$PWD/DLabel \ - $$PWD/DDrawer \ - $$PWD/DDrawerGroup \ - $$PWD/DArrowLineDrawer \ - $$PWD/DAlertControl \ - $$PWD/DSearchComboBox \ - $$PWD/DPrintPreviewDialog \ - $$PWD/DFileChooserEdit \ - $$PWD/DPaletteHelper \ - $$PWD/DAccessibilityChecker diff -Nru dtkwidget-5.5.48/tests/CMakeLists.txt dtkwidget-5.6.12/tests/CMakeLists.txt --- dtkwidget-5.5.48/tests/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/tests/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,173 @@ +set(BIN_NAME "ut-${LIB_NAME}") + +find_package(Qt5 REQUIRED COMPONENTS Test) +find_package(GTest REQUIRED) + +pkg_check_modules(QGSettings REQUIRED IMPORTED_TARGET gsettings-qt) +pkg_check_modules(XcbUtil REQUIRED IMPORTED_TARGET xcb-util) +pkg_check_modules(StartupNotification REQUIRED IMPORTED_TARGET libstartup-notification-1.0) +pkg_check_modules(Xext REQUIRED IMPORTED_TARGET xext) +pkg_check_modules(Xi REQUIRED IMPORTED_TARGET xi) +pkg_check_modules(X11 REQUIRED IMPORTED_TARGET x11) + +set(WIDGET_TEST + testcases/widgets/ut_daboutdialog.cpp + testcases/widgets/ut_dabstractdialog.cpp + testcases/widgets/ut_dalertcontrol.cpp + testcases/widgets/ut_danchor.cpp + # TODO break the test + #testcases/widgets/ut_danchors.cpp + testcases/widgets/ut_darrowbutton.cpp + testcases/widgets/ut_darrowlinedrawer.cpp + testcases/widgets/ut_darrowlineexpand.cpp + testcases/widgets/ut_darrowrectangle.cpp + testcases/widgets/ut_dbackgroundgroup.cpp + testcases/widgets/ut_dbaseexpand.cpp + testcases/widgets/ut_dbaseline.cpp + testcases/widgets/ut_dblureffectwidget.cpp + testcases/widgets/ut_dboxwidget.cpp + testcases/widgets/ut_dbuttonbox.cpp + testcases/widgets/ut_dcircleprogress.cpp + testcases/widgets/ut_dclipeffectwidget.cpp + testcases/widgets/ut_dcoloredprogressbar.cpp + testcases/widgets/ut_dcommandlinkbutton.cpp + testcases/widgets/ut_dcrumbedit.cpp + testcases/widgets/ut_ddialog.cpp + testcases/widgets/ut_ddialogclosebutton.cpp + testcases/widgets/ut_ddrawer.cpp + testcases/widgets/ut_ddrawergroup.cpp + testcases/widgets/ut_denhancedwidget.cpp + # TODO test break + #testcases/widgets/ut_dexpandgroup.cpp + testcases/widgets/ut_dfilechooseredit.cpp + testcases/widgets/ut_dfiledialog.cpp + testcases/widgets/ut_dfloatingbutton.cpp + testcases/widgets/ut_dfloatingmessage.cpp + testcases/widgets/ut_dfloatingwidget.cpp + # TODO break + # testcases/widgets/ut_dflowlayout.cpp + testcases/widgets/ut_dframe.cpp + testcases/widgets/ut_dgraphicsclipeffect.cpp + testcases/widgets/ut_dgraphicsgloweffect.cpp + testcases/widgets/ut_dheaderline.cpp + testcases/widgets/ut_diconbutton.cpp + testcases/widgets/ut_dimageviewer.cpp + testcases/widgets/ut_dinputdialog.cpp + testcases/widgets/ut_dipv4lineedit.cpp + testcases/widgets/ut_dkeysequenceedit.cpp + testcases/widgets/ut_dlabel.cpp + testcases/widgets/ut_dlineedit.cpp + testcases/widgets/ut_dlistview.cpp + testcases/widgets/ut_dloadingindicator.cpp + testcases/widgets/ut_dmainwindow.cpp + testcases/widgets/ut_dmessagemanager.cpp + testcases/widgets/ut_dmpriscontrol.cpp + testcases/widgets/ut_dpageindicator.cpp + testcases/widgets/ut_dpasswordedit.cpp + testcases/widgets/ut_dpicturesequenceview.cpp + # TODO PREAK + #testcases/widgets/ut_dprintpickcolorwidget.cpp + #testcases/widgets/ut_dprintpreviewdialog.cpp + testcases/widgets/ut_dprintpreviewwidget.cpp + testcases/widgets/ut_dprogressbar.cpp + testcases/widgets/ut_dpushbutton.cpp + #TODO BREAK kf.windowsystem: Could not find any platform plugin + # testcases/widgets/ut_dsearchcombobox.cpp + testcases/widgets/ut_dsearchedit.cpp + testcases/widgets/ut_dsettingsdialog.cpp + testcases/widgets/ut_dsettingswidgetfactory.cpp + testcases/widgets/ut_dshaowline.cpp + testcases/widgets/ut_dsimplelistview.cpp + testcases/widgets/ut_dslider.cpp + # TODO break + #testcases/widgets/ut_dspinbox.cpp + # testcases/widgets/ut_dspinner.cpp + testcases/widgets/ut_dstackwidget.cpp + testcases/widgets/ut_dstyleditemdelegate.cpp + testcases/widgets/ut_dstyleoption.cpp + testcases/widgets/ut_dsuggestbutton.cpp + testcases/widgets/ut_dswitchbutton.cpp + testcases/widgets/ut_dtabbar.cpp + testcases/widgets/ut_dtextedit.cpp + testcases/widgets/ut_dtickeffect.cpp + testcases/widgets/ut_dtiplabel.cpp + testcases/widgets/ut_dtitlebar.cpp + testcases/widgets/ut_dtoolbutton.cpp + testcases/widgets/ut_dtooltip.cpp + testcases/widgets/ut_dwarningbutton.cpp + # FIXME break + # testcases/widgets/ut_dwaterprogress.cpp + testcases/widgets/ut_dwindowclosebutton.cpp + testcases/widgets/ut_dwindowmaxbutton.cpp + testcases/widgets/ut_dwindowminbutton.cpp + testcases/widgets/ut_dwindowoptionbutton.cpp + testcases/widgets/ut_dwindowquitfullbutton.cpp +) + +include(${PROJECT_SOURCE_DIR}/src/util/util.cmake) +include(${PROJECT_SOURCE_DIR}/src/widgets/widgets.cmake) + +set(RESCOUCES data.qrc) + +add_executable(${BIN_NAME} + main.cpp + ${UTIL} + ${WIDGETS} + ${WIDGET_TEST} + ${PUBLIC_HEADERS} +) + +target_compile_definitions(${BIN_NAME} PRIVATE + SN_API_NOT_YET_FROZEN + DTK_NO_MULTIMEDIA + DWIDGET_TRANSLATIONS_DIR="dtk${PROJECT_VERSION_MAJOR}/DWidget/translations" +) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options(${BIN_NAME} PRIVATE -fprofile-instr-generate -ftest-coverage) +endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(${BIN_NAME} PRIVATE -fprofile-arcs -ftest-coverage) +endif() + +target_compile_options(${BIN_NAME} PRIVATE -fno-access-control -fsanitize=address) +target_link_options(${BIN_NAME} PRIVATE -fsanitize=address) + +target_include_directories(${BIN_NAME} PRIVATE + ${PROJECT_SOURCE_DIR}/src/widgets + ${PROJECT_SOURCE_DIR}/include/DWidget + ${PROJECT_SOURCE_DIR}/include/util + ${PROJECT_SOURCE_DIR}/include/widgets + ${PROJECT_SOURCE_DIR}/include/global + ${PROJECT_SOURCE_DIR}/include + ${CONFIG_INCLUDE} +) + +target_link_libraries(${BIN_NAME} PRIVATE + Qt5::Test + Qt5::Widgets + Qt5::WidgetsPrivate + Qt5::Core + Qt5::GuiPrivate + Qt5::DBus + Qt5::PrintSupport + Qt5::PrintSupportPrivate + Qt5::Concurrent + Qt5::X11Extras + Qt5::Network + PkgConfig::QGSettings + PkgConfig::StartupNotification + PkgConfig::Xext + PkgConfig::Xi + PkgConfig::X11 + PkgConfig::XcbUtil + Dtk::Gui + Dtk::Core + GTest::GTest + gmock + pthread + m + gcov +) + +add_test(NAME ${BIN_NAME} COMMAND ${BIN_NAME}) diff -Nru dtkwidget-5.5.48/tests/data/titlebar-settings.json dtkwidget-5.6.12/tests/data/titlebar-settings.json --- dtkwidget-5.5.48/tests/data/titlebar-settings.json 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/tests/data/titlebar-settings.json 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,11 @@ +{ + "spacingSize": 20, + "tools": [ + { + "key": "builtin/search-tool" + }, + { + "key": "test-tool" + } + ] +} diff -Nru dtkwidget-5.5.48/tests/data.qrc dtkwidget-5.6.12/tests/data.qrc --- dtkwidget-5.5.48/tests/data.qrc 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/tests/data.qrc 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,5 @@ + + + data/titlebar-settings.json + + diff -Nru dtkwidget-5.5.48/tests/main.cpp dtkwidget-5.6.12/tests/main.cpp --- dtkwidget-5.5.48/tests/main.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/main.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,24 +1,9 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Chen Bin - * - * Maintainer: Chen Bin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include +#include #include @@ -26,6 +11,20 @@ #include #endif +/** + 添加Qt事件循环,兼容gtest. + */ +int runTest(QCoreApplication &app) +{ + int ret = 0; + QTimer::singleShot(0, &app, [&app, &ret](){ + ret = RUN_ALL_TESTS(); + app.quit(); + }); + app.exec(); + return ret; +} + int main(int argc, char *argv[]) { // gerrit编译时没有显示器,需要指定环境变量 @@ -33,11 +32,10 @@ QApplication app(argc, argv); ::testing::InitGoogleTest(&argc, argv); - int ret = RUN_ALL_TESTS(); #ifdef QT_DEBUG __sanitizer_set_report_path("asan.log"); #endif - return ret; + return runTest(app); } diff -Nru dtkwidget-5.5.48/tests/src/src.pri dtkwidget-5.6.12/tests/src/src.pri --- dtkwidget-5.5.48/tests/src/src.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/src.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -include($$PWD/widgets/widgets.pri) diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dalertcontrol.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dalertcontrol.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dalertcontrol.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dalertcontrol.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include #include "dalertcontrol.h" #include "private/dalertcontrol_p.h" diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_danchor.cpp dtkwidget-5.6.12/tests/src/widgets/ut_danchor.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_danchor.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_danchor.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dblureffectwidget.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dblureffectwidget.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dblureffectwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dblureffectwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dboxwidget.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dboxwidget.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dboxwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dboxwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dcrumbedit.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dcrumbedit.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dcrumbedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dcrumbedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dfloatingmessage.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dfloatingmessage.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dfloatingmessage.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dfloatingmessage.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_diconbutton.cpp dtkwidget-5.6.12/tests/src/widgets/ut_diconbutton.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_diconbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_diconbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include @@ -65,5 +48,5 @@ ASSERT_TRUE(button->enabledCircle()); button->setNewNotification(true); - ASSERT_TRUE(button->property("_d_dtk_newNotification").toBool()); + ASSERT_TRUE(button->property("_d_menu_item_redpoint").toBool()); } diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dkeysequenceedit.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dkeysequenceedit.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dkeysequenceedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dkeysequenceedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dmainwindow.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dmainwindow.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dmainwindow.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dmainwindow.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dprogressbar.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dprogressbar.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dprogressbar.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dprogressbar.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dsimplelistview.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dsimplelistview.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dsimplelistview.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dsimplelistview.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dswitchbutton.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dswitchbutton.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dswitchbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dswitchbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dtoolbutton.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dtoolbutton.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dtoolbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dtoolbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dwarningbutton.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dwarningbutton.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dwarningbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dwarningbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/ut_dwaterprogress.cpp dtkwidget-5.6.12/tests/src/widgets/ut_dwaterprogress.cpp --- dtkwidget-5.5.48/tests/src/widgets/ut_dwaterprogress.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/ut_dwaterprogress.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/src/widgets/widgets.pri dtkwidget-5.6.12/tests/src/widgets/widgets.pri --- dtkwidget-5.5.48/tests/src/widgets/widgets.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src/widgets/widgets.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -INCLUDEPATH += $$PWD/../../../src/ -INCLUDEPATH += $$PWD/../../../src/widgets/ -INCLUDEPATH += $$OUT_PWD/../src/ - -SOURCES += \ - $$PWD/ut_dalertcontrol.cpp \ - $$PWD/ut_dcrumbedit.cpp \ - $$PWD/ut_dboxwidget.cpp \ - $$PWD/ut_dblureffectwidget.cpp \ - $$PWD/ut_diconbutton.cpp \ - $$PWD/ut_dtoolbutton.cpp \ - $$PWD/ut_dprogressbar.cpp \ - $$PWD/ut_dwaterprogress.cpp \ - $$PWD/ut_danchor.cpp \ - $$PWD/ut_dmainwindow.cpp \ - $$PWD/ut_dfloatingmessage.cpp \ - $$PWD/ut_dswitchbutton.cpp \ - $$PWD/ut_dwarningbutton.cpp \ - $$PWD/ut_dsimplelistview.cpp \ - $$PWD/ut_dkeysequenceedit.cpp diff -Nru dtkwidget-5.5.48/tests/src.pri dtkwidget-5.6.12/tests/src.pri --- dtkwidget-5.5.48/tests/src.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/src.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -QT += x11extras dbus widgets-private - -!contains(QT, printsupport): QT += printsupport printsupport-private -!contains(QT, concurrent): QT += concurrent - -# 防止源文件编译失败指定相应宏 -isEmpty(DTK_NO_MULTIMEDIA){ - DEFINES += DTK_NO_MULTIMEDIA -} - -DMODULE_NAME=dwidget -load(dtk_translation) - -include($$PWD/../src/util/util.pri) -include($$PWD/../src/widgets/widgets.pri) diff -Nru dtkwidget-5.5.48/tests/testcases/printpreview/printpreview.pri dtkwidget-5.6.12/tests/testcases/printpreview/printpreview.pri --- dtkwidget-5.5.48/tests/testcases/printpreview/printpreview.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/printpreview/printpreview.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -INCLUDEPATH += $$PWD/../../../src/ -INCLUDEPATH += $$PWD/../../../src/widgets/ -INCLUDEPATH += $$PWD/../../../src/widgets/dialogs -INCLUDEPATH += $$PWD/../../../src/widgets/private -INCLUDEPATH += $$OUT_PWD/../../src/ - -SOURCES += \ - $$PWD/ut_dprintpreviewwidget.cpp \ - $$PWD/ut_dprintpreviewdialog.cpp \ - $$PWD/ut_dprintpickcolorwidget.cpp \ - -RESOURCES += \ - $$PWD/res.qrc diff -Nru dtkwidget-5.5.48/tests/testcases/printpreview/ut_dprintpickcolorwidget.cpp dtkwidget-5.6.12/tests/testcases/printpreview/ut_dprintpickcolorwidget.cpp --- dtkwidget-5.5.48/tests/testcases/printpreview/ut_dprintpickcolorwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/printpreview/ut_dprintpickcolorwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Chen Bin - * - * Maintainer: Chen Bin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/printpreview/ut_dprintpreviewdialog.cpp dtkwidget-5.6.12/tests/testcases/printpreview/ut_dprintpreviewdialog.cpp --- dtkwidget-5.5.48/tests/testcases/printpreview/ut_dprintpreviewdialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/printpreview/ut_dprintpreviewdialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,26 +1,11 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Chen Bin - * - * Maintainer: Chen Bin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include #include +#include #include #include #include @@ -1648,3 +1633,61 @@ DGuiApplicationHelper::instance()->themeTypeChanged(DGuiApplicationHelper::DarkType); } + +TEST_F(ut_DPrintPreviewDialog, testPrivateUpdateSubControlSettings) +{ + test_dialog_d->waterMarkBtn->setChecked(true); + QSignalSpy spy(test_dialog_d->inclinatBox, &DSpinBox::editingFinished); + test_dialog_d->updateSubControlSettings(DPrintPreviewSettingInfo::PS_Watermark); + if (DPrintPreviewDialog::currentPlugin().isEmpty()) { + EXPECT_EQ(spy.count(), 0); + } else { + auto info = testPrintDialog->createDialogSettingInfo(DPrintPreviewSettingInfo::PS_Watermark); + if (info) { + EXPECT_EQ(spy.count(), 1); + delete info; + } else { + EXPECT_EQ(spy.count(), 0); + } + } +} + +TEST_F(ut_DPrintPreviewDialog, createDialogSettingInfo) +{ + if (!DPrintPreviewDialog::currentPlugin().isEmpty()) { + return; + } + + auto info = testPrintDialog->createDialogSettingInfo(DPrintPreviewSettingInfo::PS_Watermark); + ASSERT_TRUE(info); + EXPECT_EQ(info->type(), DPrintPreviewSettingInfo::PS_Watermark); + delete info; + + info = testPrintDialog->createDialogSettingInfo(DPrintPreviewSettingInfo::PS_SettingsCount); + ASSERT_FALSE(info); +} + +TEST_F(ut_DPrintPreviewDialog, updateDialogSettingInfo) +{ + if (!DPrintPreviewDialog::currentPlugin().isEmpty()) { + return; + } + + test_dialog_d->waterMarkBtn->setChecked(true); + auto info = testPrintDialog->createDialogSettingInfo(DPrintPreviewSettingInfo::PS_Watermark); + auto watermarkInfo = dynamic_cast(info); + ASSERT_TRUE(watermarkInfo); + EXPECT_EQ(watermarkInfo->opened, true); + + watermarkInfo->opened = false; + bool newFlag = false; + testPrintDialog->updateDialogSettingInfo(watermarkInfo); + delete watermarkInfo; + + info = testPrintDialog->createDialogSettingInfo(DPrintPreviewSettingInfo::PS_Watermark); + watermarkInfo = dynamic_cast(info); + ASSERT_TRUE(watermarkInfo); + EXPECT_EQ(newFlag, watermarkInfo->opened); + + delete watermarkInfo; +} diff -Nru dtkwidget-5.5.48/tests/testcases/printpreview/ut_dprintpreviewwidget.cpp dtkwidget-5.6.12/tests/testcases/printpreview/ut_dprintpreviewwidget.cpp --- dtkwidget-5.5.48/tests/testcases/printpreview/ut_dprintpreviewwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/printpreview/ut_dprintpreviewwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Chen Bin - * - * Maintainer: Chen Bin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/testcases.pri dtkwidget-5.6.12/tests/testcases/testcases.pri --- dtkwidget-5.5.48/tests/testcases/testcases.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/testcases.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -include($$PWD/widgets/widgets.pri) -# 暂时屏蔽打印预览的单元测试,too slow and crashed sometimes -#!contains(DEFINES, DTK_NO_PRINTPREVIEWTEST): include($$PWD/printpreview/printpreview.pri) diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_daboutdialog.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_daboutdialog.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_daboutdialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_daboutdialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dabstractdialog.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dabstractdialog.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dabstractdialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dabstractdialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dalertcontrol.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dalertcontrol.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dalertcontrol.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dalertcontrol.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include "dalertcontrol.h" diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_danchor.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_danchor.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_danchor.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_danchor.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_danchors.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_danchors.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_danchors.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_danchors.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_darrowbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_darrowbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_darrowbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_darrowbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_darrowlinedrawer.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_darrowlinedrawer.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_darrowlinedrawer.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_darrowlinedrawer.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_darrowlineexpand.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_darrowlineexpand.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_darrowlineexpand.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_darrowlineexpand.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_darrowrectangle.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_darrowrectangle.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_darrowrectangle.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_darrowrectangle.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dbackgroundgroup.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dbackgroundgroup.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dbackgroundgroup.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dbackgroundgroup.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dbaseexpand.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dbaseexpand.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dbaseexpand.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dbaseexpand.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dbaseline.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dbaseline.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dbaseline.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dbaseline.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dblureffectwidget.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dblureffectwidget.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dblureffectwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dblureffectwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dboxwidget.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dboxwidget.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dboxwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dboxwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dbuttonbox.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dbuttonbox.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dbuttonbox.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dbuttonbox.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dcircleprogress.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dcircleprogress.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dcircleprogress.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dcircleprogress.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dclipeffectwidget.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dclipeffectwidget.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dclipeffectwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dclipeffectwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dcoloredprogressbar.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dcoloredprogressbar.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dcoloredprogressbar.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dcoloredprogressbar.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dcommandlinkbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dcommandlinkbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dcommandlinkbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dcommandlinkbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dcrumbedit.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dcrumbedit.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dcrumbedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dcrumbedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Chen Bin - * - * Maintainer: Chen Bin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_ddialogclosebutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_ddialogclosebutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_ddialogclosebutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_ddialogclosebutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_ddialog.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_ddialog.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_ddialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_ddialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_ddrawer.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_ddrawer.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_ddrawer.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_ddrawer.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_ddrawergroup.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_ddrawergroup.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_ddrawergroup.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_ddrawergroup.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_denhancedwidget.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_denhancedwidget.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_denhancedwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_denhancedwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dexpandgroup.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dexpandgroup.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dexpandgroup.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dexpandgroup.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dfilechooseredit.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dfilechooseredit.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dfilechooseredit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dfilechooseredit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dfiledialog.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dfiledialog.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dfiledialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dfiledialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dfloatingbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dfloatingbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dfloatingbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dfloatingbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dfloatingmessage.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dfloatingmessage.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dfloatingmessage.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dfloatingmessage.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dfloatingwidget.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dfloatingwidget.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dfloatingwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dfloatingwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dflowlayout.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dflowlayout.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dflowlayout.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dflowlayout.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dframe.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dframe.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dframe.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dframe.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dgraphicsclipeffect.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dgraphicsclipeffect.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dgraphicsclipeffect.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dgraphicsclipeffect.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dgraphicsgloweffect.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dgraphicsgloweffect.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dgraphicsgloweffect.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dgraphicsgloweffect.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dheaderline.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dheaderline.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dheaderline.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dheaderline.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_diconbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_diconbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_diconbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_diconbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include @@ -65,7 +48,7 @@ ASSERT_TRUE(button->enabledCircle()); button->setNewNotification(true); - ASSERT_TRUE(button->property("_d_dtk_newNotification").toBool()); + ASSERT_TRUE(button->property("_d_menu_item_redpoint").toBool()); button->setFlat(true); ASSERT_TRUE(button->isFlat()); diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dimageviewer.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dimageviewer.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dimageviewer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dimageviewer.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,469 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include + +#include +#include +#include +#include +#include + +#include "dimageviewer.h" +#include "private/dimagevieweritems_p.h" + +DWIDGET_USE_NAMESPACE + +#define NORMAL_WIDTH 300 +#define NORMAL_HEIGHT 300 + +class ut_DImageViewer : public testing::Test +{ +protected: + void SetUp() override; + void TearDown() override; + + DImageViewer *viewer = nullptr; +}; + +void ut_DImageViewer::SetUp() +{ + viewer = new DImageViewer(); + viewer->resize(NORMAL_WIDTH, NORMAL_HEIGHT); +} + +void ut_DImageViewer::TearDown() +{ + if (viewer) { + delete viewer; + viewer = nullptr; + } +} + +QImage createNormalImage() +{ + // 300 x 300 + QImage tmpImage(NORMAL_WIDTH, NORMAL_HEIGHT, QImage::Format_ARGB32); + tmpImage.fill(Qt::red); + return tmpImage; +} + +QImage createDoubleSizeImage() +{ + // 600 x 600 + QImage tmpImage(NORMAL_WIDTH * 2, NORMAL_HEIGHT * 2, QImage::Format_ARGB32); + tmpImage.fill(Qt::red); + return tmpImage; +} + +QImage createHalfSizeImage() +{ + // 150 x 150 + QImage tmpImage(NORMAL_WIDTH / 2, NORMAL_HEIGHT / 2, QImage::Format_ARGB32); + tmpImage.fill(Qt::red); + return tmpImage; +} + +TEST_F(ut_DImageViewer, testSetImage) +{ + QImage tmpImage = createNormalImage(); + + viewer->setImage(tmpImage); + ASSERT_EQ(tmpImage, viewer->image()); + + auto items = viewer->scene()->items(); + ASSERT_FALSE(items.isEmpty()); +} + +TEST_F(ut_DImageViewer, testSetImageWithNull) +{ + viewer->setImage(QImage()); + ASSERT_TRUE(viewer->image().isNull()); +} + +TEST_F(ut_DImageViewer, testSetFileNameWithStaticImage) +{ + QString tmpFilePath("/tmp/ut_DImageViewer_tmp.png"); + QImage tmpImage = createNormalImage(); + ASSERT_TRUE(tmpImage.save(tmpFilePath)); + + viewer->setFileName(tmpFilePath); + EXPECT_EQ(viewer->fileName(), tmpFilePath); + + auto items = viewer->scene()->items(); + EXPECT_FALSE(items.isEmpty()); + + QImage readImage = viewer->image(); + EXPECT_EQ(readImage.size(), tmpImage.size()); + + EXPECT_TRUE(QFile::remove(tmpFilePath)); +} + +TEST_F(ut_DImageViewer, testSetFileNameWithDynamicImage) +{ + QString tmpFilePath("/tmp/ut_DImageViewer_tmp.gif"); + QFile tmpFile(tmpFilePath); + ASSERT_TRUE(tmpFile.open(QFile::WriteOnly)); + tmpFile.write(""); + tmpFile.close(); + + viewer->setFileName(tmpFilePath); + EXPECT_EQ(viewer->fileName(), tmpFilePath); + + auto items = viewer->scene()->items(); + EXPECT_FALSE(items.isEmpty()); + + QImage readImage = viewer->image(); + EXPECT_TRUE(readImage.isNull()); + + EXPECT_TRUE(QFile::remove(tmpFilePath)); +} + +TEST_F(ut_DImageViewer, testSetFileNameWithSvgImage) +{ + QByteArray svgCode(" "); + QString tmpFilePath("/tmp/ut_DImageViewer_tmp.svg"); + QFile tmpFile(tmpFilePath); + ASSERT_TRUE(tmpFile.open(QFile::WriteOnly)); + tmpFile.write(svgCode); + tmpFile.close(); + + viewer->setFileName(tmpFilePath); + EXPECT_EQ(viewer->fileName(), tmpFilePath); + + auto items = viewer->scene()->items(); + EXPECT_FALSE(items.isEmpty()); + + QImage readImage = viewer->image(); + EXPECT_EQ(readImage.size(), QSize(300, 300)); + + EXPECT_TRUE(QFile::remove(tmpFilePath)); +} + +TEST_F(ut_DImageViewer, testAutoFitImage) +{ + QImage tmpImage = createDoubleSizeImage(); + + ASSERT_TRUE(qFuzzyCompare(1.0, viewer->scaleFactor())); + // Internal called autoFitImage. + viewer->setImage(tmpImage); + + ASSERT_TRUE(qFuzzyCompare(0.5, viewer->scaleFactor())); +} + +TEST_F(ut_DImageViewer, testFitToWidget) +{ + QImage tmpImage = createDoubleSizeImage(); + + viewer->setImage(tmpImage); + viewer->fitToWidget(); + ASSERT_TRUE(qFuzzyCompare(0.5, viewer->scaleFactor())); + + QImage tmpImage2 = createHalfSizeImage(); + + viewer->setImage(tmpImage2); + viewer->fitToWidget(); + ASSERT_TRUE(qFuzzyCompare(2.0, viewer->scaleFactor())); +} + +TEST_F(ut_DImageViewer, testFitNormalSize) +{ + QImage tmpImage = createDoubleSizeImage(); + + viewer->setImage(tmpImage); + viewer->fitNormalSize(); + ASSERT_TRUE(qFuzzyCompare(1.0, viewer->scaleFactor())); + + QImage tmpImage2 = createHalfSizeImage(); + + viewer->setImage(tmpImage2); + viewer->fitNormalSize(); + ASSERT_TRUE(qFuzzyCompare(1.0, viewer->scaleFactor())); +} + +TEST_F(ut_DImageViewer, testRotateClockwise) +{ + QImage tmpImage = createNormalImage(); + + viewer->setImage(tmpImage); + ASSERT_EQ(0, viewer->rotateAngle()); + viewer->rotateClockwise(); + ASSERT_EQ(90, viewer->rotateAngle()); + + // Rotate 360 degree. + for (int i = 0; i < 4; ++i) { + viewer->rotateClockwise(); + } + ASSERT_EQ(90, viewer->rotateAngle()); +} + +TEST_F(ut_DImageViewer, testRotateCounterclockwise) +{ + QImage tmpImage = createNormalImage(); + + viewer->setImage(tmpImage); + ASSERT_EQ(0, viewer->rotateAngle()); + viewer->rotateCounterclockwise(); + ASSERT_EQ(-90, viewer->rotateAngle()); + + // Rotate 360 degree. + for (int i = 0; i < 4; ++i) { + viewer->rotateCounterclockwise(); + } + ASSERT_EQ(-90, viewer->rotateAngle()); +} + +TEST_F(ut_DImageViewer, testResetRotateAngle) +{ + QImage tmpImage = createNormalImage(); + + viewer->setImage(tmpImage); + viewer->rotateClockwise(); + ASSERT_NE(0, viewer->rotateAngle()); + viewer->resetRotateAngle(); + ASSERT_EQ(0, viewer->rotateAngle()); +} + +TEST_F(ut_DImageViewer, testClear) +{ + QImage tmpImage = createNormalImage(); + + viewer->setImage(tmpImage); + viewer->clear(); + + ASSERT_TRUE(viewer->image().isNull()); + auto items = viewer->scene()->items(); + // Has proxy item. + ASSERT_EQ(items.size(), 1); + + ASSERT_EQ(0, viewer->rotateAngle()); + ASSERT_TRUE(qFuzzyCompare(1.0, viewer->scaleFactor())); +} + +TEST_F(ut_DImageViewer, testCenterOn) +{ + QImage tmpImage = createDoubleSizeImage(); + viewer->setImage(tmpImage); + viewer->fitNormalSize(); + + viewer->centerOn(0, 0); + QRect visibleRect = viewer->visibleImageRect(); + ASSERT_EQ(QPoint(0, 0), visibleRect.topLeft()); + + QSize imageSize = tmpImage.size(); + viewer->centerOn(imageSize.width() * 2, imageSize.height() * 2); + visibleRect = viewer->visibleImageRect(); + ASSERT_EQ(QPoint(imageSize.width() - 1, imageSize.height() - 1), visibleRect.bottomRight()); +} + +TEST_F(ut_DImageViewer, testVisibleImageRect) +{ + QImage tmpImage = createDoubleSizeImage(); + viewer->setImage(tmpImage); + + QRect visibleRect = viewer->visibleImageRect(); + ASSERT_EQ(visibleRect.size(), tmpImage.size()); + + viewer->fitNormalSize(); + visibleRect = viewer->visibleImageRect(); + ASSERT_EQ(visibleRect.size(), viewer->size()); +} + +TEST_F(ut_DImageViewer, testScaleAtPoint) +{ + QImage tmpImage = createNormalImage(); + viewer->setImage(tmpImage); + ASSERT_TRUE(qFuzzyCompare(1.0, viewer->scaleFactor())); + + viewer->scaleAtPoint(QPoint(0, 0), 2); + ASSERT_TRUE(qFuzzyCompare(2.0, viewer->scaleFactor())); +} + +TEST_F(ut_DImageViewer, testCropImageRect) +{ + viewer->setImage(createNormalImage()); + viewer->beginCropImage(); + + QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress); + pressEvent.setButton(Qt::LeftButton); + pressEvent.setPos(QPointF(0, 0)); + viewer->scene()->mousePressEvent(&pressEvent); + + QGraphicsSceneMouseEvent moveEvent(QEvent::GraphicsSceneMouseMove); + moveEvent.setButton(Qt::LeftButton); + moveEvent.setLastScenePos(QPointF(0, 0)); + moveEvent.setScenePos(QPointF(150, 150)); + viewer->scene()->mouseMoveEvent(&moveEvent); + + QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease); + releaseEvent.setButton(Qt::LeftButton); + viewer->scene()->mouseReleaseEvent(&releaseEvent); + + viewer->endCropImage(); + + ASSERT_EQ(QRect(150, 150, 150, 150), viewer->cropImageRect()); +} + +TEST_F(ut_DImageViewer, testSetCropAspectRatio) +{ + viewer->setImage(createNormalImage()); + viewer->beginCropImage(); + viewer->setCropAspectRatio(16.0, 9.0); + viewer->endCropImage(); + QRect cropRect = viewer->cropImageRect(); + qreal ratio = (1.0 * cropRect.width()) / cropRect.height(); + ASSERT_TRUE(ratio - (16.0 / 9.0) < 0.01); + + viewer->beginCropImage(); + viewer->setCropAspectRatio(3.0, 4.0); + viewer->endCropImage(); + cropRect = viewer->cropImageRect(); + ratio = (1.0 * cropRect.width()) / cropRect.height(); + ASSERT_TRUE(ratio - (3.0 / 4.0) < 0.01); +} + +TEST_F(ut_DImageViewer, testImageChanged) +{ + QImage tmpImage = createNormalImage(); + auto conn = QObject::connect(viewer, &DImageViewer::imageChanged, [&](const QImage &image) { ASSERT_EQ(tmpImage, image); }); + ASSERT_TRUE(conn); + viewer->setImage(tmpImage); + QObject::disconnect(conn); + + conn = QObject::connect(viewer, &DImageViewer::imageChanged, [](const QImage &image) { ASSERT_TRUE(image.isNull()); }); + ASSERT_TRUE(conn); + viewer->clear(); + QObject::disconnect(conn); +} + +TEST_F(ut_DImageViewer, testFileNameChanged) +{ + QString tmpFilePath("/tmp/ut_DImageViewer_tmp.png"); + QImage tmpImage = createNormalImage(); + ASSERT_TRUE(tmpImage.save(tmpFilePath)); + + auto conn = QObject::connect( + viewer, &DImageViewer::fileNameChanged, [&](const QString &fileName) { EXPECT_EQ(tmpFilePath, fileName); }); + EXPECT_TRUE(conn); + viewer->setFileName(tmpFilePath); + QObject::disconnect(conn); + + conn = QObject::connect( + viewer, &DImageViewer::fileNameChanged, [&](const QString &fileName) { EXPECT_TRUE(fileName.isEmpty()); }); + EXPECT_TRUE(conn); + viewer->clear(); + QObject::disconnect(conn); + + EXPECT_TRUE(QFile::remove(tmpFilePath)); +} + +TEST_F(ut_DImageViewer, testScaleFactorChanged) +{ + // Ensure image size not equal viewport size. + QImage tmpImage = createDoubleSizeImage(); + // Internal called autoFitImage(). + viewer->setImage(tmpImage); + + qreal scaleFactor = 0; + auto conn = QObject::connect(viewer, &DImageViewer::scaleFactorChanged, [&](qreal facotr) { scaleFactor = facotr; }); + QSignalSpy changeSignal(viewer, &DImageViewer::scaleFactorChanged); + + viewer->scaleImage(5); + ASSERT_EQ(1, changeSignal.count()); + ASSERT_TRUE(qFuzzyCompare(scaleFactor, viewer->scaleFactor())); + + viewer->fitToWidget(); + ASSERT_EQ(2, changeSignal.count()); + ASSERT_TRUE(qFuzzyCompare(scaleFactor, viewer->scaleFactor())); + + viewer->fitNormalSize(); + ASSERT_EQ(3, changeSignal.count()); + ASSERT_TRUE(qFuzzyCompare(scaleFactor, viewer->scaleFactor())); + + viewer->setScaleFactor(10); + ASSERT_EQ(4, changeSignal.count()); + ASSERT_TRUE(qFuzzyCompare(scaleFactor, viewer->scaleFactor())); + + viewer->autoFitImage(); + ASSERT_EQ(5, changeSignal.count()); + ASSERT_TRUE(qFuzzyCompare(scaleFactor, viewer->scaleFactor())); + + QObject::disconnect(conn); +} + +TEST_F(ut_DImageViewer, testRotateAngleChanged) +{ + QImage tmpImage = createNormalImage(); + viewer->setImage(tmpImage); + + int rotateAngle = 0; + auto conn = QObject::connect(viewer, &DImageViewer::rotateAngleChanged, [&](int angle) { rotateAngle = angle; }); + QSignalSpy changeSignal(viewer, &DImageViewer::rotateAngleChanged); + + viewer->rotateClockwise(); + ASSERT_EQ(1, changeSignal.count()); + ASSERT_EQ(rotateAngle, viewer->rotateAngle()); + + viewer->resetRotateAngle(); + ASSERT_EQ(2, changeSignal.count()); + ASSERT_EQ(rotateAngle, viewer->rotateAngle()); + + viewer->rotateCounterclockwise(); + ASSERT_EQ(3, changeSignal.count()); + ASSERT_EQ(rotateAngle, viewer->rotateAngle()); + + QObject::disconnect(conn); +} + +TEST_F(ut_DImageViewer, testRequestPreviousImage) +{ + viewer->setImage(createNormalImage()); + QSignalSpy changeSignal(viewer, &DImageViewer::requestPreviousImage); + + // Simulate event trigger. + QTouchEvent::TouchPoint point; + point.setStartPos(QPointF(0, 0)); + point.setLastPos(QPointF(300, 0)); + QTouchEvent touchEvent(QEvent::TouchEnd, nullptr, Qt::NoModifier, Qt::TouchPointReleased, {point}); + + viewer->event(&touchEvent); + ASSERT_EQ(changeSignal.count(), 1); + + point.setLastPos(QPointF(100, 0)); + QTouchEvent touchEvent2(QEvent::TouchEnd, nullptr, Qt::NoModifier, Qt::TouchPointReleased, {point}); + viewer->event(&touchEvent2); + ASSERT_EQ(changeSignal.count(), 1); +} + +TEST_F(ut_DImageViewer, testRequestNextImage) +{ + viewer->setImage(createNormalImage()); + QSignalSpy changeSignal(viewer, &DImageViewer::requestNextImage); + + // Simulate event trigger. + QTouchEvent::TouchPoint point; + point.setStartPos(QPointF(0, 0)); + point.setLastPos(QPointF(-300, 0)); + QTouchEvent touchEvent(QEvent::TouchEnd, nullptr, Qt::NoModifier, Qt::TouchPointReleased, {point}); + + viewer->event(&touchEvent); + ASSERT_EQ(changeSignal.count(), 1); + + // Test multi point touch. + QTouchEvent touchEvent2(QEvent::TouchEnd, nullptr, Qt::NoModifier, Qt::TouchPointReleased, {point, point}); + viewer->event(&touchEvent2); + ASSERT_EQ(changeSignal.count(), 1); +} + +TEST_F(ut_DImageViewer, testCropImageFinished) +{ + viewer->setImage(createNormalImage()); + QSignalSpy changeSignal(viewer, &DImageViewer::cropImageChanged); + + viewer->beginCropImage(); + viewer->setCropAspectRatio(16.0, 9.0); + viewer->endCropImage(); + + ASSERT_EQ(changeSignal.count(), 1); +} diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dinputdialog.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dinputdialog.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dinputdialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dinputdialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dipv4lineedit.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dipv4lineedit.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dipv4lineedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dipv4lineedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dkeysequenceedit.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dkeysequenceedit.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dkeysequenceedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dkeysequenceedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dlabel.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dlabel.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dlabel.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dlabel.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dlineedit.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dlineedit.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dlineedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dlineedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dlistview.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dlistview.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dlistview.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dlistview.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dloadingindicator.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dloadingindicator.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dloadingindicator.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dloadingindicator.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dmainwindow.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dmainwindow.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dmainwindow.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dmainwindow.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dmessagemanager.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dmessagemanager.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dmessagemanager.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dmessagemanager.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dmpriscontrol.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dmpriscontrol.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dmpriscontrol.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dmpriscontrol.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dpageindicator.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dpageindicator.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dpageindicator.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dpageindicator.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dpasswordedit.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dpasswordedit.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dpasswordedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dpasswordedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dpicturesequenceview.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dpicturesequenceview.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dpicturesequenceview.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dpicturesequenceview.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dprintpickcolorwidget.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dprintpickcolorwidget.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dprintpickcolorwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dprintpickcolorwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,26 +1,9 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include - +#include #include "dprintpickcolorwidget.h" DWIDGET_USE_NAMESPACE class ut_ColorButton : public testing::Test @@ -57,12 +40,12 @@ ColorLabel *target = nullptr; }; -TEST_F(ut_ColorLabel, pickColor) -{ - QSignalSpy spy(target, &ColorLabel::pickColor); - target->pickColor(QPoint(10, 10)); - ASSERT_EQ(spy.count(), 1); -}; +//TEST_F(ut_ColorLabel, pickColor) +//{ +// QSignalSpy spy(target, &ColorLabel::pickColor); +// target->pickColor(QPoint(10, 10)); +// ASSERT_EQ(spy.count(), 1); +//}; class ut_ColorSlider : public testing::Test { @@ -91,7 +74,7 @@ protected: void SetUp() override { - target = new DPrintPickColorWidget(); + target = new DPrintPickColorWidget(nullptr); } void TearDown() override { diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dprintpreviewdialog.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dprintpreviewdialog.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dprintpreviewdialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dprintpreviewdialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include @@ -52,7 +35,7 @@ TEST_F(ut_DPrintPreviewDialog, paintRequested) { - target->paintRequested(1, 1); +//target->paintRequested(1, 1); }; TEST_F(ut_DPrintPreviewDialog, printFromPath) @@ -62,8 +45,8 @@ TEST_F(ut_DPrintPreviewDialog, setAsynPreview) { - target->setAsynPreview(1); - ASSERT_EQ(target->asynPreview(), 1); + //target->setAsynPreview(1); + //ASSERT_EQ(target->asynPreview(), 1); }; TEST_F(ut_DPrintPreviewDialog, setDocName) @@ -72,8 +55,8 @@ ASSERT_EQ(target->docName(), "setDocName"); }; -TEST_F(ut_DPrintPreviewDialog, setPrintFromPath) -{ - target->setPrintFromPath("setPrintFromPath"); - ASSERT_EQ(target->printFromPath(), "setPrintFromPath"); -}; +//TEST_F(ut_DPrintPreviewDialog, setPrintFromPath) +//{ +// target->setPrintFromPath("setPrintFromPath"); +// ASSERT_EQ(target->printFromPath(), "setPrintFromPath"); +//}; diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dprintpreviewwidget.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dprintpreviewwidget.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dprintpreviewwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dprintpreviewwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include @@ -28,7 +11,7 @@ protected: void SetUp() override { - target = new DPrintPreviewWidget(); + target = new DPrintPreviewWidget(nullptr); } void TearDown() override { @@ -40,334 +23,334 @@ DPrintPreviewWidget *target = nullptr; }; -TEST_F(ut_DPrintPreviewWidget, currentPage) -{ - target->currentPage(); -}; - -TEST_F(ut_DPrintPreviewWidget, getColorMode) -{ - target->getColorMode(); -}; - -TEST_F(ut_DPrintPreviewWidget, getScale) -{ - target->getScale(); -}; - -TEST_F(ut_DPrintPreviewWidget, imposition) -{ - target->imposition(); -}; - -TEST_F(ut_DPrintPreviewWidget, isAsynPreview) -{ - target->isAsynPreview(); -}; - -TEST_F(ut_DPrintPreviewWidget, isPageByPage) -{ - target->isPageByPage(1, true); -}; - -TEST_F(ut_DPrintPreviewWidget, order) -{ - target->order(); -}; - -TEST_F(ut_DPrintPreviewWidget, originPageCount) -{ - target->originPageCount(); -}; - -TEST_F(ut_DPrintPreviewWidget, pageRangeMode) -{ - target->pageRangeMode(); -}; - -TEST_F(ut_DPrintPreviewWidget, pagesCount) -{ - target->pagesCount(); -}; - -TEST_F(ut_DPrintPreviewWidget, paintRequested) -{ - target->paintRequested(1, 1); -}; - -TEST_F(ut_DPrintPreviewWidget, print) -{ - target->print(true); -}; - -TEST_F(ut_DPrintPreviewWidget, printFromPath) -{ - target->printFromPath(); -}; - -TEST_F(ut_DPrintPreviewWidget, printerColorModel) -{ - target->printerColorModel(); -}; - -TEST_F(ut_DPrintPreviewWidget, refreshBegin) -{ - target->refreshBegin(); -}; - -TEST_F(ut_DPrintPreviewWidget, refreshEnd) -{ - target->refreshEnd(); -}; - -TEST_F(ut_DPrintPreviewWidget, reviewChange) -{ - target->reviewChange(true); -}; - -TEST_F(ut_DPrintPreviewWidget, setAsynPreview) -{ - target->setAsynPreview(1); - ASSERT_EQ(target->asynPreview(), 1); -}; - -TEST_F(ut_DPrintPreviewWidget, setColorMode) -{ - target->setColorMode(1); - ASSERT_EQ(target->colorMode(), 1); -}; - -TEST_F(ut_DPrintPreviewWidget, setConfidentialWaterMark) -{ - target->setConfidentialWaterMark(); -}; - -TEST_F(ut_DPrintPreviewWidget, setCurrentPage) -{ - target->setCurrentPage(1); - ASSERT_EQ(target->currentPage(), 1); -}; - -TEST_F(ut_DPrintPreviewWidget, setCurrentTargetPage) -{ - target->setCurrentTargetPage(1); - ASSERT_EQ(target->currentTargetPage(), 1); -}; - -TEST_F(ut_DPrintPreviewWidget, setCustomWaterMark) -{ - target->setCustomWaterMark("setCustomWaterMark"); - ASSERT_EQ(target->customWaterMark(), "setCustomWaterMark"); -}; - -TEST_F(ut_DPrintPreviewWidget, setDraftWaterMark) -{ - target->setDraftWaterMark(); -}; - -TEST_F(ut_DPrintPreviewWidget, setImposition) -{ - target->setImposition(0); - ASSERT_EQ(target->imposition(), 0); -}; - -TEST_F(ut_DPrintPreviewWidget, setOrder) -{ - target->setOrder(0); - ASSERT_EQ(target->order(), 0); -}; - -TEST_F(ut_DPrintPreviewWidget, setOrientation) -{ - target->setOrientation(1); - ASSERT_EQ(target->orientation(), 1); -}; - -TEST_F(ut_DPrintPreviewWidget, setPageRange) -{ - target->setPageRange(1); - ASSERT_EQ(target->pageRange(), 1); -}; - -TEST_F(ut_DPrintPreviewWidget, setPageRange) -{ - target->setPageRange(1, 1); -}; - -TEST_F(ut_DPrintPreviewWidget, setPageRangeALL) -{ - target->setPageRangeALL(); -}; - -TEST_F(ut_DPrintPreviewWidget, setPageRangeMode) -{ - target->setPageRangeMode(0); - ASSERT_EQ(target->pageRangeMode(), 0); -}; - -TEST_F(ut_DPrintPreviewWidget, setPrintFromPath) -{ - target->setPrintFromPath("setPrintFromPath"); - ASSERT_EQ(target->printFromPath(), "setPrintFromPath"); -}; - -TEST_F(ut_DPrintPreviewWidget, setPrintMode) -{ - target->setPrintMode(1); - ASSERT_EQ(target->printMode(), 1); -}; - -TEST_F(ut_DPrintPreviewWidget, setReGenerate) -{ - target->setReGenerate(true); - ASSERT_EQ(target->reGenerate(), true); -}; - -TEST_F(ut_DPrintPreviewWidget, setSampleWaterMark) -{ - target->setSampleWaterMark(); -}; - -TEST_F(ut_DPrintPreviewWidget, setScale) -{ - target->setScale(0); - ASSERT_EQ(target->scale(), 0); -}; - -TEST_F(ut_DPrintPreviewWidget, setTextWaterMark) -{ - target->setTextWaterMark("setTextWaterMark"); - ASSERT_EQ(target->textWaterMark(), "setTextWaterMark"); -}; - -TEST_F(ut_DPrintPreviewWidget, setVisible) -{ - target->setVisible(true); - ASSERT_EQ(target->visible(), true); -}; - -TEST_F(ut_DPrintPreviewWidget, setWaterMargImage) -{ - target->setWaterMargImage(0); - ASSERT_EQ(target->waterMargImage(), 0); -}; - -TEST_F(ut_DPrintPreviewWidget, setWaterMarkColor) -{ - target->setWaterMarkColor(Qt::red); - ASSERT_EQ(target->waterMarkColor(), Qt::red); -}; - -TEST_F(ut_DPrintPreviewWidget, setWaterMarkFont) -{ - target->setWaterMarkFont(0); - ASSERT_EQ(target->waterMarkFont(), 0); -}; - -TEST_F(ut_DPrintPreviewWidget, setWaterMarkLayout) -{ - target->setWaterMarkLayout(1); - ASSERT_EQ(target->waterMarkLayout(), 1); -}; - -TEST_F(ut_DPrintPreviewWidget, setWaterMarkOpacity) -{ - target->setWaterMarkOpacity(0); - ASSERT_EQ(target->waterMarkOpacity(), 0); -}; - -TEST_F(ut_DPrintPreviewWidget, setWaterMarkRotate) -{ - target->setWaterMarkRotate(0); - ASSERT_EQ(target->waterMarkRotate(), 0); -}; - -TEST_F(ut_DPrintPreviewWidget, setWaterMarkScale) -{ - target->setWaterMarkScale(0); - ASSERT_EQ(target->waterMarkScale(), 0); -}; - -TEST_F(ut_DPrintPreviewWidget, setWaterMarkType) -{ - target->setWaterMarkType(1); - ASSERT_EQ(target->waterMarkType(), 1); -}; - -TEST_F(ut_DPrintPreviewWidget, targetPageCount) -{ - target->targetPageCount(1); -}; - -TEST_F(ut_DPrintPreviewWidget, totalPages) -{ - target->totalPages(1); -}; - -TEST_F(ut_DPrintPreviewWidget, turnBack) -{ - target->turnBack(); -}; - -TEST_F(ut_DPrintPreviewWidget, turnBegin) -{ - target->turnBegin(); -}; - -TEST_F(ut_DPrintPreviewWidget, turnEnd) -{ - target->turnEnd(); -}; - -TEST_F(ut_DPrintPreviewWidget, turnFront) -{ - target->turnFront(); -}; - -TEST_F(ut_DPrintPreviewWidget, turnPageAble) -{ - target->turnPageAble(); -}; - -TEST_F(ut_DPrintPreviewWidget, updatePreview) -{ - target->updatePreview(); -}; - -TEST_F(ut_DPrintPreviewWidget, updateView) -{ - target->updateView(); -}; - -TEST_F(ut_DPrintPreviewWidget, updateWaterMark) -{ - target->updateWaterMark(); -}; - -class ut_DPrinter : public testing::Test -{ -protected: - void SetUp() override - { - target = new DPrinter(); - } - void TearDown() override - { - if (target) { - delete target; - target = nullptr; - } - } - DPrinter *target = nullptr; -}; - -TEST_F(ut_DPrinter, getPrinterPages) -{ - target->getPrinterPages(); -}; - -TEST_F(ut_DPrinter, setPreviewMode) -{ - target->setPreviewMode(true); - ASSERT_EQ(target->previewMode(), true); -}; +//TEST_F(ut_DPrintPreviewWidget, currentPage) +//{ +// target->currentPage(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, getColorMode) +//{ +// target->getColorMode(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, getScale) +//{ +// target->getScale(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, imposition) +//{ +// target->imposition(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, isAsynPreview) +//{ +// target->isAsynPreview(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, isPageByPage) +//{ +// target->isPageByPage(1, true); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, order) +//{ +// target->order(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, originPageCount) +//{ +// target->originPageCount(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, pageRangeMode) +//{ +// target->pageRangeMode(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, pagesCount) +//{ +// target->pagesCount(); +//}; + +//TEST_F(ut_DPrintPreviewWidget, paintRequested) +//{ +// target->paintRequested(1, 1); +//}; + +//TEST_F(ut_DPrintPreviewWidget, print) +//{ +// target->print(true); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, printFromPath) +//{ +// target->printFromPath(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, printerColorModel) +//{ +// target->printerColorModel(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, refreshBegin) +//{ +// target->refreshBegin(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, refreshEnd) +//{ +// target->refreshEnd(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, reviewChange) +//{ +// target->reviewChange(true); +//}; + +//TEST_F(ut_DPrintPreviewWidget, setAsynPreview) +//{ +// target->setAsynPreview(1); +// ASSERT_EQ(target->asynPreview(), 1); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setColorMode) +//{ +// target->setColorMode(1); +// ASSERT_EQ(target->colorMode(), 1); +//}; + +//TEST_F(ut_DPrintPreviewWidget, setConfidentialWaterMark) +//{ +// target->setConfidentialWaterMark(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setCurrentPage) +//{ +// target->setCurrentPage(1); +// ASSERT_EQ(target->currentPage(), 1); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setCurrentTargetPage) +//{ +// target->setCurrentTargetPage(1); +// ASSERT_EQ(target->currentTargetPage(), 1); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setCustomWaterMark) +//{ +// target->setCustomWaterMark("setCustomWaterMark"); +// ASSERT_EQ(target->customWaterMark(), "setCustomWaterMark"); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setDraftWaterMark) +//{ +// target->setDraftWaterMark(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setImposition) +//{ +// target->setImposition(0); +// ASSERT_EQ(target->imposition(), 0); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setOrder) +//{ +// target->setOrder(0); +// ASSERT_EQ(target->order(), 0); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setOrientation) +//{ +// target->setOrientation(1); +// ASSERT_EQ(target->orientation(), 1); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setPageRange) +//{ +// target->setPageRange(1); +// ASSERT_EQ(target->pageRange(), 1); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setPageRange) +//{ +// target->setPageRange(1, 1); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setPageRangeALL) +//{ +// target->setPageRangeALL(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setPageRangeMode) +//{ +// target->setPageRangeMode(0); +// ASSERT_EQ(target->pageRangeMode(), 0); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setPrintFromPath) +//{ +// target->setPrintFromPath("setPrintFromPath"); +// ASSERT_EQ(target->printFromPath(), "setPrintFromPath"); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setPrintMode) +//{ +// target->setPrintMode(1); +// ASSERT_EQ(target->printMode(), 1); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setReGenerate) +//{ +// target->setReGenerate(true); +// ASSERT_EQ(target->reGenerate(), true); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setSampleWaterMark) +//{ +// target->setSampleWaterMark(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setScale) +//{ +// target->setScale(0); +// ASSERT_EQ(target->scale(), 0); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setTextWaterMark) +//{ +// target->setTextWaterMark("setTextWaterMark"); +// ASSERT_EQ(target->textWaterMark(), "setTextWaterMark"); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setVisible) +//{ +// target->setVisible(true); +// ASSERT_EQ(target->visible(), true); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setWaterMargImage) +//{ +// target->setWaterMargImage(0); +// ASSERT_EQ(target->waterMargImage(), 0); +//}; + +//TEST_F(ut_DPrintPreviewWidget, setWaterMarkColor) +//{ +// target->setWaterMarkColor(Qt::red); +// ASSERT_EQ(target->waterMarkColor(), Qt::red); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setWaterMarkFont) +//{ +// target->setWaterMarkFont(0); +// ASSERT_EQ(target->waterMarkFont(), 0); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setWaterMarkLayout) +//{ +// target->setWaterMarkLayout(1); +// ASSERT_EQ(target->waterMarkLayout(), 1); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setWaterMarkOpacity) +//{ +// target->setWaterMarkOpacity(0); +// ASSERT_EQ(target->waterMarkOpacity(), 0); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setWaterMarkRotate) +//{ +// target->setWaterMarkRotate(0); +// ASSERT_EQ(target->waterMarkRotate(), 0); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setWaterMarkScale) +//{ +// target->setWaterMarkScale(0); +// ASSERT_EQ(target->waterMarkScale(), 0); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, setWaterMarkType) +//{ +// target->setWaterMarkType(1); +// ASSERT_EQ(target->waterMarkType(), 1); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, targetPageCount) +//{ +// target->targetPageCount(1); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, totalPages) +//{ +// target->totalPages(1); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, turnBack) +//{ +// target->turnBack(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, turnBegin) +//{ +// target->turnBegin(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, turnEnd) +//{ +// target->turnEnd(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, turnFront) +//{ +// target->turnFront(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, turnPageAble) +//{ +// target->turnPageAble(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, updatePreview) +//{ +// target->updatePreview(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, updateView) +//{ +// target->updateView(); +//}; +// +//TEST_F(ut_DPrintPreviewWidget, updateWaterMark) +//{ +// target->updateWaterMark(); +//}; +// +//class ut_DPrinter : public testing::Test +//{ +//protected: +// void SetUp() override +// { +// target = new DPrinter(); +// } +// void TearDown() override +// { +// if (target) { +// delete target; +// target = nullptr; +// } +// } +// DPrinter *target = nullptr; +//}; +// +//TEST_F(ut_DPrinter, getPrinterPages) +//{ +// target->getPrinterPages(); +//}; +// +//TEST_F(ut_DPrinter, setPreviewMode) +//{ +// target->setPreviewMode(true); +// ASSERT_EQ(target->previewMode(), true); +//}; diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dprogressbar.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dprogressbar.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dprogressbar.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dprogressbar.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dpushbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dpushbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dpushbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dpushbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dsearchcombobox.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dsearchcombobox.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dsearchcombobox.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dsearchcombobox.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dsearchedit.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dsearchedit.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dsearchedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dsearchedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dsettingsdialog.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dsettingsdialog.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dsettingsdialog.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dsettingsdialog.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dsettingswidgetfactory.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dsettingswidgetfactory.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dsettingswidgetfactory.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dsettingswidgetfactory.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dshaowline.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dshaowline.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dshaowline.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dshaowline.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dsimplelistview.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dsimplelistview.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dsimplelistview.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dsimplelistview.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dslider.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dslider.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dslider.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dslider.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dspinbox.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dspinbox.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dspinbox.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dspinbox.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dspinner.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dspinner.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dspinner.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dspinner.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dstackwidget.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dstackwidget.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dstackwidget.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dstackwidget.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dstyleditemdelegate.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dstyleditemdelegate.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dstyleditemdelegate.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dstyleditemdelegate.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,26 +1,11 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include #include +#include #include "dstyleditemdelegate.h" DWIDGET_USE_NAMESPACE @@ -207,3 +192,53 @@ ASSERT_EQ(target->widget(), widget); widget->deleteLater(); }; + +TEST_F(ut_DViewItemAction, actionDestoryByDStandItem) +{ + QStandardItemModel* model = new QStandardItemModel(); + QPointer actionPointer(new DViewItemAction()); + ASSERT_TRUE(actionPointer); + + DStandardItem *item = new DStandardItem(); + item->setActionList(Qt::RightEdge, {actionPointer}); + model->appendRow(item); + + QPointer actionPointer2(new DViewItemAction()); + item->setActionList(Qt::RightEdge, {actionPointer2}); + ASSERT_FALSE(actionPointer); + + // release now avoid DStandardItem is clear in next event loop. + delete model; + + ASSERT_FALSE(actionPointer2); +} + +TEST_F(ut_DViewItemAction, actionDestoryByDStandItemWithClone) +{ + DStandardItem *item = new DStandardItem(); + QPointer actionPointer(new DViewItemAction()); + item->setActionList(Qt::RightEdge, {actionPointer}); + + QStandardItem *item2 = item->clone(); + delete item; + ASSERT_TRUE(actionPointer); + delete item2; + ASSERT_FALSE(actionPointer); +} + +TEST_F(ut_DViewItemAction, accessActionByActionList) +{ + QStandardItemModel* model = new QStandardItemModel(); + DViewItemAction *action = new DViewItemAction(); + + DStandardItem *item = new DStandardItem(); + item->setActionList(Qt::RightEdge, {action}); + model->appendRow(item); + + auto itemModel = dynamic_cast(model->item(0)); + ASSERT_TRUE(itemModel); + + ASSERT_TRUE(itemModel->actionList(Qt::RightEdge).contains(action)); + + model->deleteLater(); +} diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dstyleoption.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dstyleoption.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dstyleoption.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dstyleoption.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dsuggestbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dsuggestbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dsuggestbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dsuggestbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dswitchbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dswitchbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dswitchbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dswitchbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dtabbar.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dtabbar.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dtabbar.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dtabbar.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dtextedit.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dtextedit.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dtextedit.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dtextedit.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dtickeffect.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dtickeffect.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dtickeffect.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dtickeffect.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dtiplabel.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dtiplabel.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dtiplabel.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dtiplabel.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dtitlebar.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dtitlebar.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dtitlebar.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dtitlebar.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dtitlebarsettings.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dtitlebarsettings.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dtitlebarsettings.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dtitlebarsettings.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,175 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include +#include + +#include "dtitlebar.h" +#include "private/dtitlebarsettingsimpl.h" + +DWIDGET_USE_NAMESPACE + +static const QString dataFilePath = ":/data/titlebar-settings.json"; + +class ut_DTitlebarDataStore : public testing::Test +{ +protected: + virtual void TearDown() override; +}; + +void ut_DTitlebarDataStore::TearDown() +{ + // clear cache. + DTitlebarDataStore dataStore; + dataStore.clear(); +} + +TEST_F(ut_DTitlebarDataStore, loadAndSave) +{ + QStringList settingsTools({"builtin/search-tool", + "test-tool"}); + { + DTitlebarDataStore dataStore; + dataStore.clear(); + ASSERT_TRUE(dataStore.load(dataFilePath)); + ASSERT_EQ(dataStore.toolIds(), settingsTools << "builtin/stretch"); + } + { + DTitlebarDataStore dataStore; + dataStore.load(dataFilePath); + dataStore.move("test-tool", 0); + ASSERT_EQ(dataStore.defaultIds(), settingsTools); + } +} + +TEST_F(ut_DTitlebarDataStore, addAndRemove) +{ + { + QStringList settingsTools({"builtin/search-tool", + "test-tool", + "builtin/stretch", + "test-tool2"}); + DTitlebarDataStore dataStore; + dataStore.load(dataFilePath); + dataStore.add("test-tool2"); + ASSERT_EQ(dataStore.toolIds(), settingsTools); + } + { + QStringList settingsTools({"builtin/search-tool", + "test-tool", + "builtin/stretch", + "test-tool2"}); + DTitlebarDataStore dataStore; + dataStore.load(dataFilePath); + ASSERT_EQ(dataStore.toolIds(), settingsTools); + } + { + QStringList settingsTools({"builtin/search-tool", + "test-tool", + "builtin/stretch", + "test-tool2"}); + DTitlebarDataStore dataStore; + dataStore.load(dataFilePath); + const auto key = dataStore.keys().at(0); + const auto toolId = dataStore.toolId(key); + dataStore.remove(key); + ASSERT_EQ(toolId, "builtin/search-tool"); + settingsTools.removeAll(toolId); + ASSERT_EQ(dataStore.toolIds().size(), settingsTools.size()); + } +} + +class TitleBarToolTest : public DTitleBarToolInterface { +public: + virtual QWidget *createView() override + { + auto view = new DLineEdit(); + connect(view, &DLineEdit::textEdited, this, [this](const QString &) { + actionExecuted = true; + }); + return view; + } + virtual QString id() const override + { + return "test-tool"; + } + virtual QString description() override + { + return "test tool"; + } + virtual QString iconName() override + { + return "test-icon"; + } + bool actionExecuted = false; +}; + +class TitleBarToolTest2 : public TitleBarToolTest { +public: + virtual QString id() const override + { + return "test-tool2"; + } + virtual QString description() override + { + return "test tool2"; + } +}; + +class ut_DTitleBarToolInterface : public testing::Test +{ +}; + +TEST_F(ut_DTitleBarToolInterface, base) +{ + auto tool = new TitleBarToolTest(); + auto view = qobject_cast(tool->createView()); + ASSERT_TRUE(view); + ASSERT_FALSE(tool->actionExecuted); + view->textEdited("text"); + ASSERT_TRUE(tool->actionExecuted); + + ASSERT_EQ(tool->id(), QString("test-tool")); + ASSERT_EQ(tool->description(), QString("test tool")); + ASSERT_EQ(tool->iconName(), QString("test-icon")); + + tool->deleteLater(); + view->deleteLater(); +} + +class ut_DTitlebarToolFactory : public testing::Test +{ +}; + +TEST_F(ut_DTitlebarToolFactory, base) +{ + DTitlebarToolFactory factory; + auto tool = new TitleBarToolTest(); + factory.add(tool); + ASSERT_EQ(factory.toolIds(), QStringList{"test-tool"}); + ASSERT_TRUE(factory.contains("test-tool")); + ASSERT_EQ(factory.tool("test-tool"), tool); +} + +class ut_DTitleBarSettings : public testing::Test +{ +protected: + virtual void TearDown() override; +}; + +void ut_DTitleBarSettings::TearDown() +{ + // clear cache. + DTitlebarSettingsImpl settings; + settings.clearCache(); +} + +TEST_F(ut_DTitleBarSettings, base) +{ + DTitlebarSettingsImpl settings; + settings.addTool(new TitleBarToolTest()); + settings.addTool(new TitleBarToolTest2()); + settings.load(dataFilePath); +} diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dtoolbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dtoolbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dtoolbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dtoolbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dtooltip.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dtooltip.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dtooltip.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dtooltip.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* -* Copyright (C) 2021 ~ 2021 Uniontech Software Technology Co.,Ltd. -* -* Author: Ye ShanShan -* -* Maintainer: Ye ShanShan > -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* any later version. -* -* This program 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 Lesser General Public License -* along with this program. If not, see . -*/ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dwarningbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dwarningbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dwarningbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dwarningbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dwaterprogress.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dwaterprogress.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dwaterprogress.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dwaterprogress.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include @@ -68,12 +51,13 @@ ASSERT_TRUE(progress->value() == 50); } +// TODO break TEST_F(ut_DWaterProgress, testDwaterProressPaintEvent) { widget->show(); ASSERT_TRUE(QTest::qWaitForWindowExposed(widget, 100)); } - +// break TEST_F(ut_DWaterProgress, testDwaterProressChangeEvent) { widget->show(); diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dwindowclosebutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dwindowclosebutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dwindowclosebutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dwindowclosebutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dwindowmaxbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dwindowmaxbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dwindowmaxbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dwindowmaxbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dwindowminbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dwindowminbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dwindowminbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dwindowminbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dwindowoptionbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dwindowoptionbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dwindowoptionbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dwindowoptionbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/ut_dwindowquitfullbutton.cpp dtkwidget-5.6.12/tests/testcases/widgets/ut_dwindowquitfullbutton.cpp --- dtkwidget-5.5.48/tests/testcases/widgets/ut_dwindowquitfullbutton.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/ut_dwindowquitfullbutton.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,23 +1,6 @@ -/* - * Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. - * - * Author: Wang Peng - * - * Maintainer: Wang Peng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program 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 Lesser General Public License - * along with this program. If not, see . - */ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later #include #include diff -Nru dtkwidget-5.5.48/tests/testcases/widgets/widgets.pri dtkwidget-5.6.12/tests/testcases/widgets/widgets.pri --- dtkwidget-5.5.48/tests/testcases/widgets/widgets.pri 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/testcases/widgets/widgets.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -INCLUDEPATH += $$PWD/../../../src/ -INCLUDEPATH += $$PWD/../../../src/widgets/ -INCLUDEPATH += $$OUT_PWD/../src/ - -!contains(QMAKE_HOST.arch, mips.*) { -SOURCES += \ - $$PWD/ut_daboutdialog.cpp \ - $$PWD/ut_dabstractdialog.cpp \ - $$PWD/ut_dalertcontrol.cpp \ - $$PWD/ut_dcrumbedit.cpp \ - $$PWD/ut_danchors.cpp \ -# $$PWD/ut_dapplication.cpp \ - $$PWD/ut_darrowbutton.cpp \ - $$PWD/ut_darrowrectangle.cpp \ - $$PWD/ut_dbackgroundgroup.cpp \ - $$PWD/ut_dbaseline.cpp \ - $$PWD/ut_dboxwidget.cpp \ -# $$PWD/ut_dblureffectwidget.cpp \ - $$PWD/ut_dbuttonbox.cpp \ - $$PWD/ut_dcircleprogress.cpp \ - $$PWD/ut_dclipeffectwidget.cpp \ - $$PWD/ut_dcoloredprogressbar.cpp \ - $$PWD/ut_dcommandlinkbutton.cpp \ - $$PWD/ut_ddialog.cpp \ - $$PWD/ut_ddialogclosebutton.cpp \ - $$PWD/ut_ddrawer.cpp \ - $$PWD/ut_ddrawergroup.cpp \ - $$PWD/ut_denhancedwidget.cpp \ - $$PWD/ut_dfilechooseredit.cpp \ - $$PWD/ut_dfiledialog.cpp \ - $$PWD/ut_dfloatingbutton.cpp \ - $$PWD/ut_dfloatingwidget.cpp \ - $$PWD/ut_dflowlayout.cpp \ - $$PWD/ut_dframe.cpp \ - $$PWD/ut_dgraphicsclipeffect.cpp \ - $$PWD/ut_dgraphicsgloweffect.cpp \ - $$PWD/ut_dheaderline.cpp \ - $$PWD/ut_diconbutton.cpp \ - $$PWD/ut_dtoolbutton.cpp \ - $$PWD/ut_dprogressbar.cpp \ - $$PWD/ut_dwaterprogress.cpp \ - $$PWD/ut_danchor.cpp \ - $$PWD/ut_dinputdialog.cpp \ - $$PWD/ut_dlabel.cpp \ - $$PWD/ut_dlineedit.cpp \ - $$PWD/ut_dlistview.cpp \ - $$PWD/ut_dloadingindicator.cpp \ - $$PWD/ut_dmainwindow.cpp \ - $$PWD/ut_dfloatingmessage.cpp \ - $$PWD/ut_dswitchbutton.cpp \ - $$PWD/ut_dwarningbutton.cpp \ - $$PWD/ut_dmessagemanager.cpp \ - $$PWD/ut_dmpriscontrol.cpp \ - $$PWD/ut_dpasswordedit.cpp \ - $$PWD/ut_dpicturesequenceview.cpp \ - $$PWD/ut_dsearchcombobox.cpp \ - $$PWD/ut_dsearchedit.cpp \ - $$PWD/ut_dsettingsdialog.cpp \ - $$PWD/ut_dsettingswidgetfactory.cpp \ - $$PWD/ut_dsimplelistview.cpp \ - $$PWD/ut_dkeysequenceedit.cpp \ - $$PWD/ut_dslider.cpp \ - $$PWD/ut_dwindowmaxbutton.cpp \ - $$PWD/ut_dipv4lineedit.cpp \ - $$PWD/ut_darrowlinedrawer.cpp \ - $$PWD/ut_darrowlineexpand.cpp \ - $$PWD/ut_dspinbox.cpp \ - $$PWD/ut_dspinner.cpp \ - $$PWD/ut_dshaowline.cpp \ - $$PWD/ut_dstackwidget.cpp \ -# $$PWD/ut_dstyle.cpp \ - $$PWD/ut_dstyleditemdelegate.cpp \ - $$PWD/ut_dstyleoption.cpp \ - $$PWD/ut_dsuggestbutton.cpp \ - $$PWD/ut_dtabbar.cpp \ -# $$PWD/ut_dthememanager.cpp \ - $$PWD/ut_dtickeffect.cpp \ - $$PWD/ut_dtooltip.cpp \ -# $$PWD/ut_dvideowidget.cpp \ - $$PWD/ut_dwindowclosebutton.cpp \ - $$PWD/ut_dwindowminbutton.cpp \ - $$PWD/ut_dwindowoptionbutton.cpp \ - $$PWD/ut_dwindowquitfullbutton.cpp \ - $$PWD/ut_dtextedit.cpp \ - $$PWD/ut_dpushbutton.cpp \ - $$PWD/ut_dtitlebar.cpp \ - $$PWD/ut_dpageindicator.cpp \ - $$PWD/ut_dtiplabel.cpp -} diff -Nru dtkwidget-5.5.48/tests/test-recoverage.sh dtkwidget-5.6.12/tests/test-recoverage.sh --- dtkwidget-5.5.48/tests/test-recoverage.sh 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/test-recoverage.sh 2023-05-15 03:42:41.000000000 +0000 @@ -1,32 +1,25 @@ #!/bin/bash -BUILD_DIR=`pwd`/../build-ut +# SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +# +# SPDX-License-Identifier: LGPL-3.0-or-later + +BUILD_DIR=`pwd`/../build/tests/ HTML_DIR=${BUILD_DIR}/html XML_DIR=${BUILD_DIR}/report -cd ../ -#rm -rf $BUILD_DIR -#mkdir $BUILD_DIR -#cd $BUILD_DIR -#qmake .. CONFIG+=debug -#make -j$(nproc) -#cd ../tests/ +export ASAN_OPTIONS="halt_on_error=0" -rm -rf $BUILD_DIR -mkdir $BUILD_DIR -cd $BUILD_DIR +# back to project directroy +cd .. + +cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -qmake .. CONFIG+=debug && make qmake_all -#make -j$(nproc) -cd ../tests/ +cmake --build build --target ut-DtkWidget -j$(nproc) -rm -rf $BUILD_DIR -mkdir $BUILD_DIR cd $BUILD_DIR -qmake ../ CONFIG+=debug -export ASAN_OPTIONS=halt_on_error=0 -TESTARGS="--gtest_output=xml:${XML_DIR}/report_dtkwidget.xml" make check -j$(nproc) +./ut-DtkWidget -gtest_output=xml:${XML_DIR}/report_dtkwidget.xml lcov -d ./ -c -o coverage_all.info lcov --extract coverage_all.info $EXTRACT_ARGS --output-file coverage.info filter_files=( diff -Nru dtkwidget-5.5.48/tests/tests.pro dtkwidget-5.6.12/tests/tests.pro --- dtkwidget-5.5.48/tests/tests.pro 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tests/tests.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -include(../src/d_version.pri) - -TEMPLATE = app -CONFIG -= app_bundle - -# 如果不需要编译打印预览的单元测试 可以打开这个宏 -#DEFINES += DTK_NO_PRINTPREVIEWTEST - -QT += widgets dtkcore$$D_VERION dtkgui$$D_VERION testlib - -unix:QMAKE_RPATHDIR += $$OUT_PWD/../src -unix:LIBS += -lgtest -lglib-2.0 - -QMAKE_CXXFLAGS += -fno-access-control -QMAKE_LFLAGS += -fno-access-control - -CONFIG(debug, debug|release) { -LIBS += -lgtest -QMAKE_CXXFLAGS += -g -Wall -fprofile-arcs -ftest-coverage -fsanitize=address -fsanitize-recover=address -O2 -QMAKE_LFLAGS += -g -Wall -fprofile-arcs -ftest-coverage -fsanitize=address -fsanitize-recover=address -O2 -QMAKE_CXX += -g -fprofile-arcs -ftest-coverage -fsanitize=address -fsanitize-recover=address -O2 -} - -# 指定moc文件生成目录和src一样 -MOC_DIR=$$OUT_PWD/../src - -include($$PWD/src.pri) -include($$PWD/testcases/testcases.pri) - -SOURCES += \ - $$PWD/main.cpp - -load(dtk_testcase) diff -Nru dtkwidget-5.5.48/tools/CMakeLists.txt dtkwidget-5.6.12/tools/CMakeLists.txt --- dtkwidget-5.5.48/tools/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/tools/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1 @@ +add_subdirectory(svgc) diff -Nru dtkwidget-5.5.48/tools/svgc/CMakeLists.txt dtkwidget-5.6.12/tools/svgc/CMakeLists.txt --- dtkwidget-5.5.48/tools/svgc/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/tools/svgc/CMakeLists.txt 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,17 @@ +set(BIN_NAME dtk-svgc) + +find_package(Dtk REQUIRED COMPONENTS Gui) +find_package(Qt5 REQUIRED COMPONENTS Svg) + +add_executable( + ${BIN_NAME} + main.cpp +) + +target_link_libraries( + ${BIN_NAME} PRIVATE + Qt5::Svg + Dtk::Gui +) + +install(TARGETS ${BIN_NAME} DESTINATION "${TOOL_INSTALL_DIR}") diff -Nru dtkwidget-5.5.48/tools/svgc/main.cpp dtkwidget-5.6.12/tools/svgc/main.cpp --- dtkwidget-5.5.48/tools/svgc/main.cpp 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tools/svgc/main.cpp 2023-05-15 03:42:41.000000000 +0000 @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + #include #include #include diff -Nru dtkwidget-5.5.48/tools/svgc/svgc.pro dtkwidget-5.6.12/tools/svgc/svgc.pro --- dtkwidget-5.5.48/tools/svgc/svgc.pro 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tools/svgc/svgc.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -QT += gui svg -QT += dtkcore dtkgui - -TARGET = dtk-svgc -CONFIG += c++11 -CONFIG -= app_bundle - -# The following define makes your compiler emit warnings if you use -# any feature of Qt which as been marked deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if you use deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -DEFINES += QT_MESSAGELOGCONTEXT - -!isEmpty(DTK_STATIC_LIB){ - DEFINES += DTK_STATIC_LIB -} - -SOURCES += main.cpp - -DTK_MODULE_NAME=dtkwidget -load(dtk_build_config) -target.path = $$TOOL_INSTALL_DIR - -INSTALLS += target diff -Nru dtkwidget-5.5.48/tools/tools.pro dtkwidget-5.6.12/tools/tools.pro --- dtkwidget-5.5.48/tools/tools.pro 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tools/tools.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += svgc diff -Nru dtkwidget-5.5.48/tools/translate_generation.py dtkwidget-5.6.12/tools/translate_generation.py --- dtkwidget-5.5.48/tools/translate_generation.py 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tools/translate_generation.py 2023-05-15 03:42:41.000000000 +0000 @@ -1,5 +1,9 @@ #!env python +# SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +# +# SPDX-License-Identifier: LGPL-3.0-or-later + import sys,os,fnmatch from subprocess import call diff -Nru dtkwidget-5.5.48/tools/translate_generation.sh dtkwidget-5.6.12/tools/translate_generation.sh --- dtkwidget-5.5.48/tools/translate_generation.sh 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/tools/translate_generation.sh 2023-05-15 03:42:41.000000000 +0000 @@ -1,4 +1,9 @@ #!/bin/bash + +# SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +# +# SPDX-License-Identifier: LGPL-3.0-or-later + # this file is used to auto-generate .qm file from .ts file. # author: shibowen at linuxdeepin.com diff -Nru dtkwidget-5.5.48/.tx/config dtkwidget-5.6.12/.tx/config --- dtkwidget-5.5.48/.tx/config 2022-07-23 06:25:25.000000000 +0000 +++ dtkwidget-5.6.12/.tx/config 2023-05-15 03:42:41.000000000 +0000 @@ -3,7 +3,7 @@ minimum_perc = 80 mode = developer -[deepin-tool-kit.dwidget] +[o:linuxdeepin:p:deepin-tool-kit:r:dwidget] file_filter = src/translations/dtkwidget_.ts source_file = src/translations/dtkwidget.ts source_lang = en diff -Nru dtkwidget-5.5.48/.tx/deepin.conf dtkwidget-5.6.12/.tx/deepin.conf --- dtkwidget-5.5.48/.tx/deepin.conf 1970-01-01 00:00:00.000000000 +0000 +++ dtkwidget-5.6.12/.tx/deepin.conf 2023-05-15 03:42:41.000000000 +0000 @@ -0,0 +1,2 @@ +[transifex] +branch = m23