pax_global_header00006660000000000000000000000064142473420210014511gustar00rootroot0000000000000052 comment=ce7a5dd398bb3790a420e06be627da428636005a qt5integration-5.5.23/000077500000000000000000000000001424734202100145625ustar00rootroot00000000000000qt5integration-5.5.23/.clog.toml000066400000000000000000000002261424734202100164610ustar00rootroot00000000000000[clog] repository = "https://github.com/linuxdeepin/qt5integration" from-latest-tag = true changelog = "CHANGELOG.md" [sections] Others = ["chore"] qt5integration-5.5.23/.github/000077500000000000000000000000001424734202100161225ustar00rootroot00000000000000qt5integration-5.5.23/.github/workflows/000077500000000000000000000000001424734202100201575ustar00rootroot00000000000000qt5integration-5.5.23/.github/workflows/backup-to-gitlab.yml000066400000000000000000000040441424734202100240310ustar00rootroot00000000000000name: backup to gitlab on: [push] concurrency: group: ${{ github.workflow }} 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-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 qt5integration-5.5.23/.github/workflows/call-build-deb.yml000066400000000000000000000005361424734202100234460ustar00rootroot00000000000000name: 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 }} qt5integration-5.5.23/.github/workflows/call-chatOps.yml000066400000000000000000000003201424734202100232070ustar00rootroot00000000000000name: chatOps on: issue_comment: types: [created] jobs: chatopt: uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master secrets: APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} qt5integration-5.5.23/.github/workflows/call-commitlint.yml000066400000000000000000000003641424734202100237750ustar00rootroot00000000000000name: Call commitlint on: pull_request_target: concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: check_job: uses: linuxdeepin/.github/.github/workflows/commitlint.yml@master qt5integration-5.5.23/.github/workflows/cppcheck.yml000066400000000000000000000012651424734202100224660ustar00rootroot00000000000000name: cppcheck on: pull_request_target: paths-ignore: - ".github/workflows/**" concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: cppchceck: name: cppcheck runs-on: ubuntu-latest steps: - run: export - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} persist-credentials: false - uses: linuxdeepin/action-cppcheck@main with: github_token: ${{ secrets.GITHUB_TOKEN }} repository: ${{ github.repository }} pull_request_id: ${{ github.event.pull_request.number }} allow_approve: false qt5integration-5.5.23/.gitignore000066400000000000000000000005761424734202100165620ustar00rootroot00000000000000*.pro.user* build*/ bin/ # C++ objects and libs *.slo *.lo *.o *.a *.la *.lai *.so *.dll *.dylib # Qt-es /.qmake.cache .qmake.stash *.pro.user *.pro.user.* *.qbs.user *.qbs.user.* *.moc moc_*.cpp qrc_*.cpp ui_*.h Makefile* *build-* # QtCreator *.autosave # QtCtreator Qml *.qmlproject.user *.qmlproject.user.* # QtCtreator CMake CMakeLists.txt.user platformthemeplugin/NUL qt5integration-5.5.23/.gitlab-ci.yml000066400000000000000000000002271424734202100172170ustar00rootroot00000000000000include: - remote: 'https://gitlab.deepin.io/dev-tools/letmeci/raw/master/gitlab-ci/dde.yml' variables: CPPCHECK: "true" CODESPELL: "true" qt5integration-5.5.23/.packit.yaml000066400000000000000000000010231424734202100167730ustar00rootroot00000000000000# See the documentation for more information: # https://packit.dev/docs/configuration/ specfile_path: rpm/deepin-qt5integration.spec # add or remove files that should be synced synced_files: - rpm/deepin-qt5integration.spec - .packit.yaml upstream_package_name: qt5integration # downstream (Fedora) RPM package name downstream_package_name: deepin-qt5integration actions: fix-spec-file: | bash -c "sed -i -r \"0,/Version:/ s/Version:(\s*)\S*/Version:\1${PACKIT_PROJECT_VERSION}/\" rpm/deepin-qt5integration.spec" qt5integration-5.5.23/.qmake.conf000066400000000000000000000000151424734202100166010ustar00rootroot00000000000000DTK_VERSION= qt5integration-5.5.23/CHANGELOG.md000066400000000000000000000311701424734202100163750ustar00rootroot00000000000000 ## 0.3.11 (2019-04-17) #### Bug Fixes * ScreenScaleFactors cannot be applied to all screens when only one value is specified ([24a73d6b](https://github.com/linuxdeepin/qt5integration/commit/24a73d6b2243602781dd7c56071efadb5387142c)) * font pixel changed when connect a screen ([fcca6b5e](https://github.com/linuxdeepin/qt5integration/commit/fcca6b5e64863741a48600bdc22b18d2c3eac3d6)) * enable real-time scale for window only on enable screenScaleFactors ([520f00eb](https://github.com/linuxdeepin/qt5integration/commit/520f00eb47e57883838040372fa4bc377cf8be78)) #### Features * support auto update the window geometry by new device pixel ratio ([6902fc8a](https://github.com/linuxdeepin/qt5integration/commit/6902fc8ad8923f1579b115561f4aa0a361ac0f64)) ## 0.3.10 (2019-04-04) ## 0.3.9 (2019-04-03) #### Bug Fixes * build failed on Qt 5.7.x ([9159a9fa](https://github.com/linuxdeepin/qt5integration/commit/9159a9fadf70c0190c698769b7f0d576bf380567)) #### Features * screen scale support takes effect in real time ([1e9c855b](https://github.com/linuxdeepin/qt5integration/commit/1e9c855b7409fdaa04eb938ddab42b5a38d51790)) ## 0.3.8 (2019-03-27) ## 0.3.7.2 (2019-01-10) #### Bug Fixes * QComboBox show icon ([9ac0b0bc](https://github.com/linuxdeepin/qt5integration/commit/9ac0b0bc54add64fa249cf78d1960a270e8f5af1)) * adjust QComboBox height ([4778931f](https://github.com/linuxdeepin/qt5integration/commit/4778931f7605a04ff5ec3c6166d89bb9166c9b4e)) #### Features * add property "touchFlickBeginMoveDelay" for DThemeSettings ([2ab1fab0](https://github.com/linuxdeepin/qt5integration/commit/2ab1fab0b65f6d4f41d3f2c06a61816346fda153)) ## 0.3.7.1 (2018-12-14) #### Bug Fixes * QPushButton icon color follow theme ([e1f6d379](https://github.com/linuxdeepin/qt5integration/commit/e1f6d379ebf05a96689ddcfa01e02126df42c540)) ## 0.3.7 (2018-11-30) #### Bug Fixes * can not read image file on the second time ([668540cf](https://github.com/linuxdeepin/qt5integration/commit/668540cfc655ae9e9953b90b70411f8f6f7a732a)) * set the QMenu Qt::WA_TranslucentBackground does not take effect ([6814e028](https://github.com/linuxdeepin/qt5integration/commit/6814e028a90e3b82e4db91e8b62ee76cc86a5489)) * **Menu:** check icon when select state ([8fe47513](https://github.com/linuxdeepin/qt5integration/commit/8fe475130f7d7aacef438b258acfaeae0560c598)) ## 0.3.6 (2018-10-25) #### Features * **menu:** add check label ([f7d4530b](https://github.com/linuxdeepin/qt5integration/commit/f7d4530bb396e79a45e6b62e0cdb0b1c14b431e9)) ## 0.3.5 (2018-08-28) #### Bug Fixes * **iconengine:** use the original one if cast failed ([50286e1d](https://github.com/linuxdeepin/qt5integration/commit/50286e1d2d4a31c86bc556f3cc8433ac2e2803bb)) ## 0.3.4 (2018-08-13) #### Bug Fixes * build failed on libqt5xdg2 ([da972cac](https://github.com/linuxdeepin/qt5integration/commit/da972cac239240ae4f2ed08e505c75a2bd7aaae9)) * return a null pixmap in QIcon::pixmap ([8d923ea9](https://github.com/linuxdeepin/qt5integration/commit/8d923ea94f49eee3ad6cda201a04b1125031ebe7)) ## 0.3.3 (2018-08-06) #### Features * anyway try to enable dxcb for QMenu and QTipLabel ([689e440b](https://github.com/linuxdeepin/qt5integration/commit/689e440bf160a0ed094f03eca9d307e1d1d0f63c)) #### Bug Fixes * the dde-desktop UI is blocked ([c75ffad8](https://github.com/linuxdeepin/qt5integration/commit/c75ffad83ff353f10840dac2e38a2daa3b8e3187)) ## 0.3.2 (2018-07-31) #### Bug Fixes * not update the xdg system icon theme when the icon theme is changed ([cc738c11](https://github.com/linuxdeepin/qt5integration/commit/cc738c114853ed9a9be46f2ebe711e2db98a41e1)) * remove gtk2 depend ([6b2d1f7d](https://github.com/linuxdeepin/qt5integration/commit/6b2d1f7dfae7d17591f3f1d98a67da933505b9f6)) #### Features * support custom the color scheme of get icon from theme ([0daec72b](https://github.com/linuxdeepin/qt5integration/commit/0daec72b6467a29bcbc126b9bfefe5a7e22c1123)) ## 0.3.1 (2018-07-19) #### Bug Fixes * can not build if the "Qt5Xdg" package version is not 2.0.0 ([444f3a47](https://github.com/linuxdeepin/qt5integration/commit/444f3a47cec873010c254c726249b476dd29c8fc)) #### Features * **DIconEngine:** bypass some path which contains '/' ([0c6a7496](https://github.com/linuxdeepin/qt5integration/commit/0c6a7496ec64348fde628866c5d42b493aa7cdd7)) ### 0.3.0 (2018-05-24) #### Features * **style:** use QPalette active text brush on DTabBar tab widget ([d8ee34e6](https://github.com/linuxdeepin/qt5integration/commit/d8ee34e6efeda4faa3a953849d2b5e5a6a183985)) #### Bug Fixes * crash on paint QTabBar ([8d74156e](https://github.com/linuxdeepin/qt5integration/commit/8d74156e4fc07eecc86bf992a9a2a05370f2756d)) * the line edit widget border color on focus state ([4718470d](https://github.com/linuxdeepin/qt5integration/commit/4718470d0b31b28d67b71c1a77d05a0443fcaa21)) * **QLineEdit:** not refresh close button after theme changed ([7aca7279](https://github.com/linuxdeepin/qt5integration/commit/7aca72794235f9345c916102f5ed9a2666c3e61f)) * **combox:** don't render text when edit state ([2f558376](https://github.com/linuxdeepin/qt5integration/commit/2f558376d7788cadf27e280eed01c174435d1262)) * **style:** DTabBar close button cannot visible ([399ad32d](https://github.com/linuxdeepin/qt5integration/commit/399ad32d4facfc73574d4a56551309f3f7c28e6b)) ### 0.2.10 (2018-03-14) #### Bug Fixes * the line edit widget border color on focus state ([4718470d](https://github.com/linuxdeepin/qt5integration/commit/4718470d0b31b28d67b71c1a77d05a0443fcaa21)) ## 0.2.9 (2018-03-08) #### Bug Fixes * set the progress bar widget radius to 4 ([3cc29bbf](https://github.com/linuxdeepin/qt5integration/commit/3cc29bbf49d93d48ec3027a35721f4ccfa6af1cb)) * progress bar border color ([7da33a5d](https://github.com/linuxdeepin/qt5integration/commit/7da33a5d5882debae5448a24fc01200b4a390e56)) * button border color in pressed state ([578948d4](https://github.com/linuxdeepin/qt5integration/commit/578948d4d1a22521f8c39d2f89914761af4a0c20)) * Style::fullBrush filled icon is not the right size ([fb785a3f](https://github.com/linuxdeepin/qt5integration/commit/fb785a3fa6fabc82117846eeca64a3ee479077f8)) * drawProgressBarContentsControl crash if widget is nullptr ([1494cff6](https://github.com/linuxdeepin/qt5integration/commit/1494cff6247968025c3c0750f30cb4f186acafcd)) * crash at drawPushButtonLabel ([795e9fb6](https://github.com/linuxdeepin/qt5integration/commit/795e9fb65f7fb88fc414fb33b230396db7e4ffb4)) * crash at drawStandardIcon/isTabBarToolButton ([45a305fd](https://github.com/linuxdeepin/qt5integration/commit/45a305fd5919525b8dc6cc9dc0234f242cf00874)) * tab of QTabBar close button visible position is wrong on after tabs move ([6049831b](https://github.com/linuxdeepin/qt5integration/commit/6049831bc14a0a39aa15d3189b1ab35155e20d0f)) * not visible close button on tab when QTabBar style is QStyleSheetStyle ([0ca51e06](https://github.com/linuxdeepin/qt5integration/commit/0ca51e0651972ebbf26d14cbbeb0528cf2e2df79)) * **dstyle:** button border corner offset ([2c74e56e](https://github.com/linuxdeepin/qt5integration/commit/2c74e56e9d75adab5b4a8853043af596abdf2710)) * **style:** * set the scroll bar padding to 2px ([8cf9a91a](https://github.com/linuxdeepin/qt5integration/commit/8cf9a91ad77c90684e2da9412810b37dbcc6be64)) * scroll bar border color on dark style ([0b3472b0](https://github.com/linuxdeepin/qt5integration/commit/0b3472b048cc20803b8c468c60662de477d3a2c5)) #### Features * support add custom widgets to deepin file chooser dialog ([63caf8ff](https://github.com/linuxdeepin/qt5integration/commit/63caf8ff553c3951ff91af12792f3c40be1eba61)) * add split line for DTabBar add button ([31730a0b](https://github.com/linuxdeepin/qt5integration/commit/31730a0b2285504cbb3d803655ad55adae545187)) * add dark style for QTabBar/DTabBar ([7c811b44](https://github.com/linuxdeepin/qt5integration/commit/7c811b440b6fafa1233261690b03abc81645011d)) * draw QTabBar widget ([9da78b60](https://github.com/linuxdeepin/qt5integration/commit/9da78b6088596da68e800a048a47d6264642ee01)) * **dstyle:** * hide menu icon with DApplication and QLineEdit ([291c7292](https://github.com/linuxdeepin/qt5integration/commit/291c7292ff6f49349e3591835962bb1c715e8972)) * support SuggestButtonColor ([a644e697](https://github.com/linuxdeepin/qt5integration/commit/a644e697d47573ee8d5dc907c9d21411d925fd99)) * **style:** * draw alert border on DLineEdit ([810ebeda](https://github.com/linuxdeepin/qt5integration/commit/810ebedad0c50610aee6edd8507858931bfc954d)) * the tab bar tab text below the close button increases the transparency gradient ([83bdc592](https://github.com/linuxdeepin/qt5integration/commit/83bdc59210366ac53a41f7397dbc32c22d364d65)) * lineedit left padding to 3px ([e56ae93c](https://github.com/linuxdeepin/qt5integration/commit/e56ae93c32f3020d528e7cd780d544c63fea3ab5)) ## 0.2.8.3 (2017-12-06) #### Bug Fixes * **style:** visable bottom lines on QMenu when hover item ([c8eb56b7](https://github.com/linuxdeepin/qt5integration/commit/c8eb56b7cadb8f7a3d95207bf6ff7a7048a89706)) ## 0.2.8.2 (2017-12-06) #### Features * **theme:** set window flags for native dialog ([3ec67bf0](https://github.com/linuxdeepin/qt5integration/commit/3ec67bf01fead41dbac5a4b096622f7ca50d685c)) #### Bug Fixes * is dxcb platform if the "_d_isDxcb" property is true of QCoreApplication ([714b5f78](https://github.com/linuxdeepin/qt5integration/commit/714b5f78b98f7e63757db15ab84a8eb653c36b31)) * **style:** * visable left/top lines on draw rubber band control ([9c06e770](https://github.com/linuxdeepin/qt5integration/commit/9c06e7709b99958e6ebb98714fbbfa2a61d7a0a5)) * bottom/right visible lines on draw rubber band rect for QListView ([1177381a](https://github.com/linuxdeepin/qt5integration/commit/1177381ae5914188ca4236e993475367071d66bd)) * slider icons ([dae8caa6](https://github.com/linuxdeepin/qt5integration/commit/dae8caa6ec73b95b3781ebe6ecd6da0b359a189f)) ## 0.2.8.1 (2017-11-02) #### Bug Fixes * remove libqt5dxcb-dev for "Conflicts" and "Provides" ([4d38dbca](https://github.com/linuxdeepin/qt5integration/commit/4d38dbcac71375f96469cfdda2b4bad0124c7b16)) ## 0.2.8 (2017-11-02) #### Features * keep the window border is 1px for hiDPI ([da8040c4](https://github.com/linuxdeepin/qt5integration/commit/da8040c42df0cbde97e21693f472a288ef46a9d8)) * **theme plugin:** read settings from config file ([aacc2995](https://github.com/linuxdeepin/qt5integration/commit/aacc299512f4006ff174c5700d471d344d7155d0)) * **theme style:** auto update the widgets font when theme config file changed ([d478074e](https://github.com/linuxdeepin/qt5integration/commit/d478074e73d8e22e2d70080ad1430c565261d9af)) #### Bug Fixes * add build-depend: libegl1-mesa-dev ([2d265267](https://github.com/linuxdeepin/qt5integration/commit/2d265267ad1f6f113a74c931a67fe938b85a5af0)) * build failed(add build-depend: libmtdev-dev) ([babdc356](https://github.com/linuxdeepin/qt5integration/commit/babdc3561ab22d85ab83e4b6e385a4daa1387516)) * set cursor is invaild ([a2e235be](https://github.com/linuxdeepin/qt5integration/commit/a2e235bed7873d35030be380e8cd73acc0192e89)) * **dxcb:** * crash when screen changed ([7e1627c2](https://github.com/linuxdeepin/qt5integration/commit/7e1627c20fd92d7b4c1d7a69c55b4de5869cf6b6)) * the window border size is wrong ([83d6ac50](https://github.com/linuxdeepin/qt5integration/commit/83d6ac500b7e070f5c97ff220da16736229fd060)) * draw shadow area ([284cae9d](https://github.com/linuxdeepin/qt5integration/commit/284cae9dd90e9b9d7af92480e3a0e217a7c5f478)) * the DFrameWindow shadow area ([6e9c8274](https://github.com/linuxdeepin/qt5integration/commit/6e9c8274ef871fe3fa48a60a0861a96b6880dbf0)) * **style:** * update all widgets on font changed ([0e28f244](https://github.com/linuxdeepin/qt5integration/commit/0e28f244217f57d454424cc7dfba488ee6be93e3)) * update all widgets on font changed ([d4a65deb](https://github.com/linuxdeepin/qt5integration/commit/d4a65deb9e21e18390447c8b26eb429843333be4)) * **theme:** * "DFileSystemWatcherPrivate::addPaths: inotify_add_watch failed" ([a0322a68](https://github.com/linuxdeepin/qt5integration/commit/a0322a68447b7d918af49fbba23ebe1d5f53da25)) * set ini codec to "utf8" for QSettings ([3a4f7d76](https://github.com/linuxdeepin/qt5integration/commit/3a4f7d7651f6c433ef9735426d936289ac04d6c9)) qt5integration-5.5.23/LICENSE000066400000000000000000001045141424734202100155740ustar00rootroot00000000000000 GNU 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. 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 . qt5integration-5.5.23/README.md000066400000000000000000000023531424734202100160440ustar00rootroot00000000000000# qt5integration qt5integration is the Qt platform theme integration plugins for Deepin Desktop Environment. It includes multiple Qt5 plugins to make make DDE more Qt5 Apps friendly. ## Dependencies ### Build dependencies * Qt (>= 5.6) * gtk+-2.0 * mtdev * [dtk](https://github.com/linuxdeepin/deepin-tool-kit) * [libqtxdg](https://github.com/lxde/libqtxdg) * Qt5 (>= 5.6) * Qt5-Core * Qt5-Gui * Qt5-Widgets * Qt5-DBus * Qt5-Multimedia * Qt5-MultimediaWidgets * Qt5-Svg * Qt5-OpenGL * Qt5-X11extras * Qt5-Core-Private * Qt5-Widgets-Private ### Runtime dependencies * DDE File Manager (suggestion, to make Qt5 file dialogs more elegant) ## Installation ### Build from source code 1. Make sure you have installed all dependencies. 2. Build: ``` $ cd qt5integration $ mkdir build $ cd build $ qmake .. $ make ``` 3. Install: ``` $ sudo make install ``` ## Usage To be done. ## Getting help You may also find these channels useful if you encounter any other issues: * [Gitter](https://gitter.im/orgs/linuxdeepin/rooms) * [IRC Channel](https://webchat.freenode.net/?channels=deepin) * [Official Forum](https://bbs.deepin.org/) * [Wiki](http://wiki.deepin.org/) ## License qt5integration is licensed under [GPLv3](LICENSE). qt5integration-5.5.23/clog.toml000066400000000000000000000001661424734202100164060ustar00rootroot00000000000000[clog] repository = "https://github.com/linuxdeepin/qt5integration" from-latest-tag = true changelog = "CHANGELOG.md" qt5integration-5.5.23/debian/000077500000000000000000000000001424734202100160045ustar00rootroot00000000000000qt5integration-5.5.23/debian/changelog000066400000000000000000000003171424734202100176570ustar00rootroot00000000000000qt5integration (1.0.0) unstable; urgency=medium * Initial release (Closes: #nnnn) -- Deepin Packages Builder Tue, 08 Nov 2016 15:10:02 +0800 qt5integration-5.5.23/debian/compat000066400000000000000000000000021424734202100172020ustar00rootroot000000000000009 qt5integration-5.5.23/debian/control000066400000000000000000000020151424734202100174050ustar00rootroot00000000000000Source: qt5integration Section: devel Priority: optional Maintainer: Deepin Packages Builder Build-Depends: debhelper (>=9), qt5-qmake, qtbase5-dev, qtbase5-private-dev, libqt5xdg-dev, libdtkgui-dev, libdtkwidget-dev, pkg-config, libqt5x11extras5-dev, libfontconfig1-dev, libfreetype6-dev, libglib2.0-dev, libqt5svg5-dev, libqt5xdgiconloader-dev, libmtdev-dev, libegl1-mesa-dev, libxrender-dev, libgtest-dev Standards-Version: 3.9.8 Package: dde-qt5integration Architecture: any Provides: libqt5deepintheme-plugin Conflicts: libqt5deepintheme-plugin Depends: ${shlibs:Depends}, ${misc:Depends}, dde-qt5xcb-plugin, dde-qt5integration5 Description: Qt platform theme integration plugin choosers for DDE Multiple Qt plugin choosers for DDE is included. Package: dde-qt5integration5 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, dde-qt5xcb-plugin Description: Qt platform theme integration plugins for DDE Multiple Qt plugins to provide better Qt5 integration for DDE is included.qt5integration-5.5.23/debian/copyright000066400000000000000000000017441424734202100177450ustar00rootroot00000000000000Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: qt5integration Source: https://github.com/linuxdeepin/qt5integration Files: * Copyright: 2017 Deepin.Inc 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 program. If not, see . On Debian systems, the complete text of the GNU General Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". qt5integration-5.5.23/debian/dde-qt5integration.install000066400000000000000000000000351424734202100231010ustar00rootroot00000000000000usr/lib/*/qt5/plugins/*/*.so qt5integration-5.5.23/debian/dde-qt5integration5.install000066400000000000000000000000371424734202100231700ustar00rootroot00000000000000usr/lib/*/qt5/plugins/*/*/*.so qt5integration-5.5.23/debian/rules000077500000000000000000000003241424734202100170630ustar00rootroot00000000000000#!/usr/bin/make -f export QT_SELECT = qt5 %: dh $@ override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info override_dh_auto_configure: dh_auto_configure -- BASED_DTK_DIR=based-dtk qt5integration-5.5.23/debian/source/000077500000000000000000000000001424734202100173045ustar00rootroot00000000000000qt5integration-5.5.23/debian/source/format000066400000000000000000000000151424734202100205130ustar00rootroot000000000000003.0 (native) qt5integration-5.5.23/iconengineplugins/000077500000000000000000000000001424734202100203025ustar00rootroot00000000000000qt5integration-5.5.23/iconengineplugins/builtinengine/000077500000000000000000000000001424734202100231365ustar00rootroot00000000000000qt5integration-5.5.23/iconengineplugins/builtinengine/builtinengine.json000066400000000000000000000000511424734202100266610ustar00rootroot00000000000000{ "Keys": [ "DBuiltinIconEngine" ] } qt5integration-5.5.23/iconengineplugins/builtinengine/builtinengine.pro000066400000000000000000000006331424734202100265160ustar00rootroot00000000000000TARGET = dtkbuiltin$${DTK_VERSION} TEMPLATE = lib CONFIG += plugin HEADERS += dbuiltiniconengine.h SOURCES += main.cpp \ dbuiltiniconengine.cpp OTHER_FILES += builtinengine.json QT += gui-private dtkgui$${DTK_VERSION} DESTDIR = $$_PRO_FILE_PWD_/../../bin/plugins/iconengines/$${BASED_DTK_DIR} unix { target.path = $$[QT_INSTALL_PLUGINS]/iconengines/$${BASED_DTK_DIR} INSTALLS += target } qt5integration-5.5.23/iconengineplugins/builtinengine/dbuiltiniconengine.cpp000066400000000000000000000320721424734202100275170ustar00rootroot00000000000000/* * 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include "dbuiltiniconengine.h" #include #include #include #include #include #include #include #include #include #include #define BUILTIN_ICON_PATH ":/icons/deepin/builtin" DGUI_USE_NAMESPACE class ImageEntry : public QIconLoaderEngineEntry { public: enum Type { TextType, // 完全跟随画笔前景色变化 ActionType, // 只在非normal状态下跟随画笔前景色 IconType // 任务状态都不跟随画笔颜色 }; ImageEntry(Type t) : type(t) { } QString pmcKey(const QSize &size, QIcon::Mode mode, QIcon::State state) { return QLatin1String("$qt_icon_") + filename + QLatin1String("_") + QString::number((((((qint64(size.width()) << 11) | size.height()) << 11) | mode) << 4) | state, 16); } void genIconTypeIcon(QPixmap &pm, QIcon::Mode mode) { if (type == IconType && qobject_cast(QCoreApplication::instance())) { const QPixmap generated = QGuiApplicationPrivate::instance()->applyQIconStyleHelper(mode, pm); if (!generated.isNull()) pm = generated; } } QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override { Q_UNUSED(state) QPixmap pm; QString pmckey(pmcKey(size, mode, state)); if (QPixmapCache::find(pmckey, pm)) { genIconTypeIcon(pm, mode); return pm; } // png 会读取前8个 bit 对比,需要关闭重新打开,否则同一个 icon 不同 state/mode 会再次读取时报错导致 pixmap 为空。 // 所以此处只对 DirImageEntry(isdir==true) 进行判断不再重新调用 setFileName if (Q_UNLIKELY(!reader.device()) || !QFileInfo(filename).isDir()) { reader.setFileName(filename); } if (dir.type == QIconDirInfo::Scalable) reader.setScaledSize(size); pm = QPixmap::fromImageReader(&reader); if (!pm.isNull()) QPixmapCache::insert(pmckey, pm); genIconTypeIcon(pm, mode); return pm; } Type type; QImageReader reader; }; class DirImageEntry : public ImageEntry { public: using ImageEntry::ImageEntry; static QString getIconFile(const QString &key, const QDir &dir, const QString &suffix) { if (dir.exists(key + "." + suffix)) { return dir.filePath(key + "." + suffix); } int _index = key.indexOf('_'); if (_index > 0) { const QString &mode = key.left(_index); if (dir.exists(mode + "." + suffix)) { return dir.filePath(mode + "." + suffix); } const QString &state = key.mid(_index); if (dir.exists("normal" + state + "." + suffix)) { return dir.filePath("normal" + state + "." + suffix); } } return dir.filePath("normal." + suffix); } QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override { if (iconFileMap.isEmpty()) { const QString &suffix = QFileInfo(filename).suffix(); QDir dir(filename); iconFileMap[QIcon::Disabled << 8 | QIcon::On] = getIconFile("disabled_on", dir, suffix); iconFileMap[QIcon::Disabled << 8 | QIcon::Off] = getIconFile("disabled_off", dir, suffix); iconFileMap[QIcon::Active << 8 | QIcon::On] = getIconFile("active_on", dir, suffix); iconFileMap[QIcon::Active << 8 | QIcon::Off] = getIconFile("active_off", dir, suffix); iconFileMap[QIcon::Selected << 8 | QIcon::On] = getIconFile("selected_on", dir, suffix); iconFileMap[QIcon::Selected << 8 | QIcon::Off] = getIconFile("selected_off", dir, suffix); iconFileMap[QIcon::Normal << 8 | QIcon::On] = getIconFile("normal_on", dir, suffix); iconFileMap[QIcon::Normal << 8 | QIcon::Off] = getIconFile("normal_off", dir, suffix); } reader.setFileName(iconFileMap.value(mode << 8 | state)); return ImageEntry::pixmap(size, mode, state); } QMap iconFileMap; }; DBuiltinIconEngine::DBuiltinIconEngine(const QString &iconName) : m_iconName(iconName) , m_initialized(false) // 当主题名称中包含'/'时, '/'前面的部分即为指定的图标类型, 此时不需要再 // 跟随系统中的主题类型改变 , m_followSystemTheme(iconName.indexOf('/') < 0) { // 初始化图标类型 m_key = iconName.startsWith("dark/") ? DGuiApplicationHelper::DarkType : DGuiApplicationHelper::LightType; } DBuiltinIconEngine::DBuiltinIconEngine(const DBuiltinIconEngine &other) : QIconEngine(other) , m_iconName(other.m_iconName) , m_key(other.m_key) , m_initialized(other.m_initialized) , m_followSystemTheme(other.m_initialized) { } DBuiltinIconEngine::~DBuiltinIconEngine() { if (!m_info.entries.isEmpty()) qDeleteAll(m_info.entries); } QSize DBuiltinIconEngine::actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) { Q_UNUSED(mode); Q_UNUSED(state); ensureLoaded(); QIconLoaderEngineEntry *entry = QIconLoaderEngine::entryForSize(m_info, size); if (entry) { const QIconDirInfo &dir = entry->dir; if (dir.type == QIconDirInfo::Scalable) { return size; } else { int result = qMin(dir.size, qMin(size.width(), size.height())); return QSize(result, result); } } return QSize(0, 0); } QPixmap DBuiltinIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) { ensureLoaded(); QIconLoaderEngineEntry *entry = QIconLoaderEngine::entryForSize(m_info, size); if (entry) return entry->pixmap(size, mode, state); return QPixmap(); } void DBuiltinIconEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) { ensureLoaded(); QSize pixmapSize = rect.size(); qreal scale = 1; if (painter->device()) scale = painter->device()->devicePixelRatioF(); pixmapSize *= scale; QIconLoaderEngineEntry *entry = QIconLoaderEngine::entryForSize(m_info, pixmapSize); if (!entry) return; // 如果有 background 则绘制背景图先 QString bgFileName = entry->filename + QStringLiteral(".background"); if (QFile::exists(bgFileName)) { QIcon(bgFileName).paint(painter, rect, Qt::AlignCenter, mode, state); } QPixmap pm = entry->pixmap(pixmapSize, mode, state); ImageEntry::Type type = static_cast(entry)->type; if (type == ImageEntry::TextType || (type == ImageEntry::ActionType && mode != QIcon::Normal)) { QPainter pa(&pm); pa.setCompositionMode(QPainter::CompositionMode_SourceIn); pa.fillRect(pm.rect(), painter->pen().brush()); } pm.setDevicePixelRatio(scale); painter->drawPixmap(rect, pm); } QString DBuiltinIconEngine::key() const { return QLatin1String("DBuiltinIconEngine"); } QIconEngine *DBuiltinIconEngine::clone() const { return new DBuiltinIconEngine(*this); } bool DBuiltinIconEngine::read(QDataStream &in) { // QDataStream不支持位数据, 此处先将内容转为正常类型 uint key = m_key; bool followSystemTheme = m_followSystemTheme; in >> m_iconName >> key >> followSystemTheme; m_key = key; m_followSystemTheme = followSystemTheme; return true; } bool DBuiltinIconEngine::write(QDataStream &out) const { out << m_iconName << m_key << m_followSystemTheme; return true; } QString DBuiltinIconEngine::iconName() const { return m_iconName; } QThemeIconInfo DBuiltinIconEngine::loadIcon(const QString &iconName, uint key) { QThemeIconInfo info; info.iconName = iconName; QString theme_name = (key == DGuiApplicationHelper::DarkType ? "dark" : "light"); QStringList iconDirList { QString("%1/%2/texts").arg(BUILTIN_ICON_PATH, theme_name), QString("%1/%2/actions").arg(BUILTIN_ICON_PATH, theme_name), QString("%1/%2/icons").arg(BUILTIN_ICON_PATH, theme_name), QString("%1/texts").arg(BUILTIN_ICON_PATH), QString("%1/actions").arg(BUILTIN_ICON_PATH), QString("%1/icons").arg(BUILTIN_ICON_PATH) }; QDir dir; dir.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot); for (int i = 0; i < iconDirList.count(); ++i) { dir.setPath(iconDirList.at(i)); if (!dir.exists()) { continue; } ImageEntry::Type type = static_cast(i % 3); for (const QFileInfo &icon_file_info : dir.entryInfoList()) { const QString &file_name = icon_file_info.fileName(); // do not load background file if (!file_name.startsWith(iconName) || file_name.endsWith(QStringLiteral(".background"))) continue; // 先找到px所在位置 int size_str_pos = iconName.length() + 1; int px_str_pos = file_name.indexOf("px.", size_str_pos + 1); if (px_str_pos < 0) continue; bool ok = false; int size = file_name.mid(size_str_pos, px_str_pos - size_str_pos).toInt(&ok); if (Q_UNLIKELY(!ok || size <= 0)) { continue; } ImageEntry *entry = icon_file_info.isDir() ? new DirImageEntry(type) : new ImageEntry(type); entry->filename = icon_file_info.absoluteFilePath(); entry->dir.path = icon_file_info.absolutePath(); entry->dir.size = size; entry->dir.type = icon_file_info.suffix().startsWith("svg") ? QIconDirInfo::Scalable : QIconDirInfo::Fixed; info.entries.append(entry); } // 已经找到图标时不再继续 if (!info.entries.isEmpty()) { break; } } return info; } bool DBuiltinIconEngine::hasIcon() const { return !m_info.entries.isEmpty(); } void DBuiltinIconEngine::virtual_hook(int id, void *data) { ensureLoaded(); switch (id) { case QIconEngine::AvailableSizesHook: { QIconEngine::AvailableSizesArgument &arg = *reinterpret_cast(data); const int N = m_info.entries.size(); QList sizes; sizes.reserve(N); // Gets all sizes from the DirectoryInfo entries for (int i = 0; i < N; ++i) { const QIconLoaderEngineEntry *entry = m_info.entries.at(i); int size = entry->dir.size; sizes.append(QSize(size, size)); } arg.sizes.swap(sizes); // commit } break; case QIconEngine::IconNameHook: { QString &name = *reinterpret_cast(data); name = m_info.iconName; } break; case QIconEngine::IsNullHook: { *reinterpret_cast(data) = m_info.entries.isEmpty(); } break; case QIconEngine::ScaledPixmapHook: { QIconEngine::ScaledPixmapArgument &arg = *reinterpret_cast(data); // QIcon::pixmap() multiplies size by the device pixel ratio. const int integerScale = qCeil(arg.scale); QIconLoaderEngineEntry *entry = QIconLoaderEngine::entryForSize(m_info, arg.size / integerScale, integerScale); arg.pixmap = entry ? entry->pixmap(arg.size, arg.mode, arg.state) : QPixmap(); } break; default: QIconEngine::virtual_hook(id, data); } } void DBuiltinIconEngine::ensureLoaded() { if (Q_LIKELY(m_followSystemTheme) && Q_UNLIKELY(DGuiApplicationHelper::instance()->themeType() != m_key)) { m_initialized = false; // 记录当前使用的主题类型 m_key = DGuiApplicationHelper::instance()->themeType(); } if (Q_LIKELY(m_initialized)) { return; } // 标记为已初始化 m_initialized = true; qDeleteAll(m_info.entries); m_info.entries.clear(); m_info.iconName.clear(); Q_ASSERT(m_info.entries.size() == 0); m_info = loadIcon(m_iconName, m_key); } qt5integration-5.5.23/iconengineplugins/builtinengine/dbuiltiniconengine.h000066400000000000000000000042041424734202100271600ustar00rootroot00000000000000/* * 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 DBUILTINICONENGINE_H #define DBUILTINICONENGINE_H #include #include // 内置的主题引擎,会从Qt资源文件中查找图标 class DBuiltinIconEnginePrivate; class DBuiltinIconEngine : public QIconEngine { public: DBuiltinIconEngine(const QString &iconName); ~DBuiltinIconEngine(); void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state); QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state); QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); QString key() const; QIconEngine *clone() const; bool read(QDataStream &in); bool write(QDataStream &out) const; QString iconName() const override; static QThemeIconInfo loadIcon(const QString &iconName, uint key); private: bool hasIcon() const; void ensureLoaded(); void virtual_hook(int id, void *data) override; DBuiltinIconEngine(const DBuiltinIconEngine &other); QThemeIconInfo m_info; QString m_iconName; // 图标的类型(Dark/Light) uint m_key:2; // 记录是否已经初始化 bool m_initialized:1; // 控制是否跟随系统级别的主题色来改变图标类型 bool m_followSystemTheme:1; friend class QIconLoader; }; #endif // DBUILTINICONENGINE_H qt5integration-5.5.23/iconengineplugins/builtinengine/main.cpp000066400000000000000000000027761424734202100246020ustar00rootroot00000000000000/* * 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include #include #include "dbuiltiniconengine.h" #include #include #include QT_BEGIN_NAMESPACE class DBuiltinIconEnginePlugin : public QIconEnginePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "builtinengine.json") public: QStringList keys() const; QIconEngine *create(const QString &iconName = QString()); }; QStringList DBuiltinIconEnginePlugin::keys() const { return {"DBuiltinIconEngine"}; } QIconEngine *DBuiltinIconEnginePlugin::create(const QString &iconName) { DBuiltinIconEngine *engine = new DBuiltinIconEngine(iconName); return engine; } QT_END_NAMESPACE #include "main.moc" qt5integration-5.5.23/iconengineplugins/iconengines.pro000066400000000000000000000001161424734202100233230ustar00rootroot00000000000000TEMPLATE = subdirs SUBDIRS += svgiconengine builtinengine xdgiconproxyengine qt5integration-5.5.23/iconengineplugins/svgiconengine/000077500000000000000000000000001424734202100231405ustar00rootroot00000000000000qt5integration-5.5.23/iconengineplugins/svgiconengine/main.cpp000066400000000000000000000055151424734202100245760ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include #include "qsvgiconengine.h" #include #include #include QT_BEGIN_NAMESPACE class QSvgIconPlugin : public QIconEnginePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "qsvgiconengine.json") public: QStringList keys() const; QIconEngine *create(const QString &filename = QString()); }; QStringList QSvgIconPlugin::keys() const { QStringList keys(QLatin1String("svg")); #ifndef QT_NO_COMPRESS if (Q_LIKELY(!qEnvironmentVariableIsSet("QT_NO_COMPRESS"))) { keys << QLatin1String("svgz") << QLatin1String("svg.gz"); } #endif return keys; } QIconEngine *QSvgIconPlugin::create(const QString &file) { QSvgIconEngine *engine = new QSvgIconEngine; if (!file.isNull()) engine->addFile(file, QSize(), QIcon::Normal, QIcon::Off); return engine; } QT_END_NAMESPACE #include "main.moc" qt5integration-5.5.23/iconengineplugins/svgiconengine/qsvgiconengine.cpp000066400000000000000000000424341424734202100266720ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "qsvgiconengine.h" #ifndef QT_NO_SVGRENDERER #include "qpainter.h" #include "qpixmap.h" #include "qpixmapcache.h" #include "qfileinfo.h" #include #include #include #include "qdebug.h" #include #include #include #include #include #include DGUI_USE_NAMESPACE QT_BEGIN_NAMESPACE #ifdef QT_DEBUG Q_LOGGING_CATEGORY(lcDSvg, "dde.dsvg") #else Q_LOGGING_CATEGORY(lcDSvg, "dde.dsvg", QtInfoMsg) #endif class QSvgIconEnginePrivate : public QSharedData { public: QSvgIconEnginePrivate() : svgBuffers(0), addedPixmaps(0) { stepSerialNum(); } ~QSvgIconEnginePrivate() { delete addedPixmaps; delete svgBuffers; } static inline int hashKey(QIcon::Mode mode, QIcon::State state) { return (((mode)<<4)|state); } inline QString pmcKey(const QSize &size, QIcon::Mode mode, QIcon::State state) { return QLatin1String("$qt_svgicon_") + QString::number(serialNum, 16).append(QLatin1Char('_')) + QString::number((((((qint64(size.width()) << 11) | size.height()) << 11) | mode) << 4) | state, 16); } inline void stepSerialNum() { serialNum = lastSerialNum.fetchAndAddRelaxed(1); } void loadDataForModeAndState(DSvgRenderer *renderer, QIcon::Mode mode, QIcon::State state); QHash svgFiles; QHash *svgBuffers; QHash *addedPixmaps; int serialNum; static QAtomicInt lastSerialNum; }; QAtomicInt QSvgIconEnginePrivate::lastSerialNum; QSvgIconEngine::QSvgIconEngine() : d(new QSvgIconEnginePrivate) { } QSvgIconEngine::QSvgIconEngine(const QSvgIconEngine &other) : QIconEngine(other), d(new QSvgIconEnginePrivate) { d->svgFiles = other.d->svgFiles; if (other.d->svgBuffers) d->svgBuffers = new QHash(*other.d->svgBuffers); if (other.d->addedPixmaps) d->addedPixmaps = new QHash(*other.d->addedPixmaps); } QSvgIconEngine::~QSvgIconEngine() { } QSize QSvgIconEngine::actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) { if (d->addedPixmaps) { QPixmap pm = d->addedPixmaps->value(d->hashKey(mode, state)); if (!pm.isNull() && pm.size() == size) return size; } QPixmap pm = pixmap(size, mode, state); if (pm.isNull()) return QSize(); return pm.size(); } void QSvgIconEnginePrivate::loadDataForModeAndState(DSvgRenderer *renderer, QIcon::Mode mode, QIcon::State state) { QByteArray buf; const QIcon::State oppositeState = state == QIcon::Off ? QIcon::On : QIcon::Off; if (svgBuffers) { buf = svgBuffers->value(hashKey(mode, state)); if (buf.isEmpty()) buf = svgBuffers->value(hashKey(QIcon::Normal, state)); if (buf.isEmpty()) buf = svgBuffers->value(hashKey(QIcon::Normal, oppositeState)); } if (!buf.isEmpty()) { #ifndef QT_NO_COMPRESS if (Q_LIKELY(!qEnvironmentVariableIsSet("QT_NO_COMPRESS"))) { buf = qUncompress(buf); } #endif renderer->load(buf); } else { QString svgFile = svgFiles.value(hashKey(mode, state)); if (svgFile.isEmpty()) svgFile = svgFiles.value(hashKey(QIcon::Normal, state)); if (svgFile.isEmpty()) svgFile = svgFiles.value(hashKey(QIcon::Normal, oppositeState)); if (!svgFile.isEmpty()) renderer->load(svgFile); } } static QString getIconCachePath() { QString path = qgetenv("D_ICON_CACHE_PATH"); if (!qEnvironmentVariableIsSet("D_ICON_CACHE_PATH")) { path = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation).append("/deepin/icons"); } if (path.isEmpty()) { qCInfo(lcDSvg) << "disable svg icon cache of dsvg plugin"; return path; } if (QDir::home().mkpath(path)) return path; qCWarning(lcDSvg) << "can't create a invalid icon cache path:" << path; return QString(); } QPixmap QSvgIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) { QPixmap pm; QString pmckey(d->pmcKey(size, mode, state)); if (Q_LIKELY(QPixmapCache::find(pmckey, &pm))) return pm; if (d->addedPixmaps) { pm = d->addedPixmaps->value(d->hashKey(mode, state)); if (!pm.isNull() && pm.size() == size) return pm; } const QIcon::State oppositeState = state == QIcon::Off ? QIcon::On : QIcon::Off; QString svgFile = d->svgFiles.value(d->hashKey(mode, state)); if (svgFile.isEmpty()) svgFile = d->svgFiles.value(d->hashKey(QIcon::Normal, state)); if (svgFile.isEmpty()) svgFile = d->svgFiles.value(d->hashKey(QIcon::Normal, oppositeState)); QString cacheFile; if (Q_LIKELY(!svgFile.startsWith(":/") && QFile::exists(svgFile))) { static const QString &cachePath = getIconCachePath(); if (Q_LIKELY(!cachePath.isEmpty())) { QByteArray mdst; if (d->svgBuffers && !d->svgBuffers->isEmpty()) mdst = QByteArray::number(d->hashKey(mode, state)).prepend("_"); // svgFiles[-1] 是为了取到额外的cache key,例如会跟随颜色变化的svg图标,将会添加此特殊的标记 const QByteArray extraKey = d->svgFiles.value(-1).isEmpty() ? QByteArrayLiteral("") : d->svgFiles.value(-1).toLocal8Bit() + mdst; const QByteArray cacheKey = svgFile.toLocal8Bit() + extraKey; // add mode state to cachekey const QString &svgFileSha1 = QString::fromLatin1(QCryptographicHash::hash(cacheKey, QCryptographicHash::Sha1).toHex()); cacheFile = QStringLiteral("%1/%2.png").arg(cachePath).arg(svgFileSha1); } } const QFileInfo cacheFileInfo(cacheFile); if (Q_LIKELY(cacheFileInfo.exists())) { const QFileInfo svgFileInfo(svgFile); if (Q_UNLIKELY(svgFileInfo.lastModified() != cacheFileInfo.lastModified())) { // clear invalid cache file QFile::remove(cacheFile); } else { qCDebug(lcDSvg()) << "found cache file:" << cacheFile << ", for:" << svgFile; QImageReader ir(cacheFile); const QSize &cacheSize = ir.size(); if (Q_LIKELY(cacheSize.isValid() && cacheSize.width() >= size.width())) { pm = QPixmap::fromImage(ir.read().scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation)); } else { // 当对同一个图标文件有更大的size要求时,应当继续从源svg文件重新渲染图标并更新缓存文件 qCDebug(lcDSvg()) << "cache image size less then target size, cache size:" << cacheSize << ", request size:" << size; if (Q_UNLIKELY(!ir.canRead())) { qCWarning(lcDSvg()) << "can't read the cache image:" << cacheFile << "file size:" << cacheFileInfo.size() << ", permissions:" << cacheFileInfo.permissions(); QFile::remove(cacheFile); } } } } if (Q_UNLIKELY(pm.isNull())) { DSvgRenderer renderer; d->loadDataForModeAndState(&renderer, mode, state); if (Q_UNLIKELY(!renderer.isValid())) return pm; QSize actualSize = renderer.defaultSize(); if (actualSize.width() < size.width()) actualSize.scale(size, Qt::KeepAspectRatio); if (Q_UNLIKELY(actualSize.isEmpty())) return pm; const QImage image = renderer.toImage(actualSize); if (Q_LIKELY(!image.isNull() && !cacheFile.isEmpty())) { QtConcurrent::run(QThreadPool::globalInstance(), [image, cacheFile, svgFile] { QSaveFile file(cacheFile); // 增加cache文件能被成功保存的概率 file.setDirectWriteFallback(true); if (file.open(QFile::WriteOnly)) { if (image.save(&file, "png", 80) && file.commit()) { QFileInfo svgFileInfo(svgFile); // 不能直接使用QSaveFile改写文件的时间 QFile file(cacheFile); if (!file.open(QFile::ReadWrite) || !file.setFileTime(svgFileInfo.lastModified(), QFileDevice::FileModificationTime)) { qCWarning(lcDSvg()) << "set cache file modified date time failed, error message:" << file.errorString() << ", cache file:" << cacheFile << ", svg file:" << svgFile; } } else { file.cancelWriting(); qCWarning(lcDSvg()) << "save cache image failed, cache file:" << cacheFile << ", svg file:" << svgFile; } } else { qCWarning(lcDSvg()) << "open cache file failed, error message:" << file.errorString() << ", cache file:" << cacheFile << ", svg file:" << svgFile; } }); } // 缩放图标到目标大小 pm = QPixmap::fromImage(image.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation)); } if (Q_LIKELY(qobject_cast(QCoreApplication::instance()))) { const QPixmap generated = QGuiApplicationPrivate::instance()->applyQIconStyleHelper(mode, pm); if (Q_LIKELY(!generated.isNull())) pm = generated; } if (Q_LIKELY(!pm.isNull())) QPixmapCache::insert(pmckey, pm); return pm; } void QSvgIconEngine::addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state) { if (!d->addedPixmaps) d->addedPixmaps = new QHash; d->stepSerialNum(); d->addedPixmaps->insert(d->hashKey(mode, state), pixmap); } enum FileType { OtherFile, SvgFile, CompressedSvgFile }; static FileType fileType(const QFileInfo &fi) { const QString &abs = fi.absoluteFilePath(); if (abs.endsWith(QLatin1String(".svg"), Qt::CaseInsensitive)) return SvgFile; if (abs.endsWith(QLatin1String(".svgz"), Qt::CaseInsensitive) || abs.endsWith(QLatin1String(".svg.gz"), Qt::CaseInsensitive)) { return CompressedSvgFile; } #ifndef QT_NO_MIMETYPE const QString &mimeTypeName = QMimeDatabase().mimeTypeForFile(fi).name(); if (mimeTypeName == QLatin1String("image/svg+xml")) return SvgFile; if (mimeTypeName == QLatin1String("image/svg+xml-compressed")) return CompressedSvgFile; #endif // !QT_NO_MIMETYPE return OtherFile; } void QSvgIconEngine::addFile(const QString &fileName, const QSize &, QIcon::Mode mode, QIcon::State state) { if (!fileName.isEmpty()) { const QFileInfo fi(fileName); const QString abs = fi.absoluteFilePath(); const FileType type = fileType(fi); #ifndef QT_NO_COMPRESS if ((type == SvgFile || type == CompressedSvgFile) && Q_LIKELY(!qEnvironmentVariableIsSet("QT_NO_COMPRESS"))) { #else if (type == SvgFile) { #endif DSvgRenderer renderer(abs); if (renderer.isValid()) { d->stepSerialNum(); d->svgFiles.insert(d->hashKey(mode, state), abs); } } else if (type == OtherFile) { QPixmap pm(abs); if (!pm.isNull()) addPixmap(pm, mode, state); } } } void QSvgIconEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) { QSize pixmapSize = rect.size(); if (painter->device()) pixmapSize *= painter->device()->devicePixelRatioF(); painter->drawPixmap(rect, pixmap(pixmapSize, mode, state)); } QString QSvgIconEngine::key() const { return QLatin1String("svg"); } QIconEngine *QSvgIconEngine::clone() const { return new QSvgIconEngine(*this); } bool QSvgIconEngine::read(QDataStream &in) { d = new QSvgIconEnginePrivate; d->svgBuffers = new QHash; if (in.version() >= QDataStream::Qt_4_4) { int isCompressed; QHash fileNames; // For memoryoptimization later in >> fileNames >> isCompressed >> *d->svgBuffers; #ifndef QT_NO_COMPRESS if (!isCompressed && Q_LIKELY(!qEnvironmentVariableIsSet("QT_NO_COMPRESS"))) { for (auto it = d->svgBuffers->begin(), end = d->svgBuffers->end(); it != end; ++it) it.value() = qCompress(it.value()); } #else if (isCompressed) { qWarning("QSvgIconEngine: Can not decompress SVG data"); d->svgBuffers->clear(); } #endif int hasAddedPixmaps; in >> hasAddedPixmaps; if (hasAddedPixmaps) { d->addedPixmaps = new QHash; in >> *d->addedPixmaps; } d->svgFiles = fileNames; } else { QPixmap pixmap; QByteArray data; uint mode; uint state; int num_entries; in >> data; if (!data.isEmpty()) { #ifndef QT_NO_COMPRESS if (Q_LIKELY(!qEnvironmentVariableIsSet("QT_NO_COMPRESS"))) { data = qUncompress(data); } #endif if (!data.isEmpty()) d->svgBuffers->insert(d->hashKey(QIcon::Normal, QIcon::Off), data); } in >> num_entries; for (int i=0; i> pixmap; in >> mode; in >> state; // The pm list written by 4.3 is buggy and/or useless, so ignore. //addPixmap(pixmap, QIcon::Mode(mode), QIcon::State(state)); } } return true; } bool QSvgIconEngine::write(QDataStream &out) const { if (out.version() >= QDataStream::Qt_4_4) { int isCompressed = 0; #ifndef QT_NO_COMPRESS if (Q_LIKELY(!qEnvironmentVariableIsSet("QT_NO_COMPRESS"))) { isCompressed = 1; } #endif QHash svgBuffers; if (d->svgBuffers) svgBuffers = *d->svgBuffers; for (auto it = d->svgFiles.cbegin(), end = d->svgFiles.cend(); it != end; ++it) { QByteArray buf; QFile f(it.value()); if (f.open(QIODevice::ReadOnly)) buf = f.readAll(); #ifndef QT_NO_COMPRESS if (Q_LIKELY(!qEnvironmentVariableIsSet("QT_NO_COMPRESS"))) { buf = qCompress(buf); } #endif svgBuffers.insert(it.key(), buf); } out << d->svgFiles << isCompressed << svgBuffers; if (d->addedPixmaps) out << (int)1 << *d->addedPixmaps; else out << (int)0; } else { QByteArray buf; if (d->svgBuffers) buf = d->svgBuffers->value(d->hashKey(QIcon::Normal, QIcon::Off)); if (buf.isEmpty()) { QString svgFile = d->svgFiles.value(d->hashKey(QIcon::Normal, QIcon::Off)); if (!svgFile.isEmpty()) { QFile f(svgFile); if (f.open(QIODevice::ReadOnly)) buf = f.readAll(); } } #ifndef QT_NO_COMPRESS if (Q_LIKELY(!qEnvironmentVariableIsSet("QT_NO_COMPRESS"))) { buf = qCompress(buf); } #endif out << buf; // 4.3 has buggy handling of added pixmaps, so don't write any out << (int)0; } return true; } QT_END_NAMESPACE #endif // QT_NO_SVGRENDERER qt5integration-5.5.23/iconengineplugins/svgiconengine/qsvgiconengine.h000066400000000000000000000056251424734202100263400ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSVGICONENGINE_H #define QSVGICONENGINE_H #include #include QT_BEGIN_NAMESPACE class QSvgIconEnginePrivate; class QSvgIconEngine : public QIconEngine { public: QSvgIconEngine(); QSvgIconEngine(const QSvgIconEngine &other); ~QSvgIconEngine(); void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state); QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state); QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state); void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state); QString key() const; QIconEngine *clone() const; bool read(QDataStream &in); bool write(QDataStream &out) const; private: QSharedDataPointer d; }; QT_END_NAMESPACE #endif qt5integration-5.5.23/iconengineplugins/svgiconengine/qsvgiconengine.json000066400000000000000000000000541424734202100270510ustar00rootroot00000000000000{ "Keys": [ "svg", "svgz", "svg.gz" ] } qt5integration-5.5.23/iconengineplugins/svgiconengine/svgiconengine.pro000066400000000000000000000006561424734202100265270ustar00rootroot00000000000000TARGET = dsvgicon$${DTK_VERSION} TEMPLATE = lib CONFIG += plugin HEADERS += qsvgiconengine.h SOURCES += main.cpp \ qsvgiconengine.cpp OTHER_FILES += qsvgiconengine.json CONFIG += c++11 QT += gui-private dtkgui$${DTK_VERSION} concurrent DESTDIR = $$_PRO_FILE_PWD_/../../bin/plugins/iconengines/$${BASED_DTK_DIR} unix { target.path = $$[QT_INSTALL_PLUGINS]/iconengines/$${BASED_DTK_DIR} INSTALLS += target } qt5integration-5.5.23/iconengineplugins/xdgiconproxyengine/000077500000000000000000000000001424734202100242255ustar00rootroot00000000000000qt5integration-5.5.23/iconengineplugins/xdgiconproxyengine/main.cpp000066400000000000000000000026671424734202100256700ustar00rootroot00000000000000/* * 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 . */ #include #include #include "xdgiconproxyengine.h" QT_BEGIN_NAMESPACE class XdgProxyIconPlugin : public QIconEnginePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "xdgproxyiconplugin.json") public: QStringList keys() const; QIconEngine *create(const QString &filename = QString()); }; QStringList XdgProxyIconPlugin::keys() const { return {"XdgProxyIconPlugin"}; } QIconEngine *XdgProxyIconPlugin::create(const QString &iconName) { return new XdgIconProxyEngine(new XdgIconLoaderEngine(iconName)); } QT_END_NAMESPACE #include "main.moc" qt5integration-5.5.23/iconengineplugins/xdgiconproxyengine/xdgiconproxyengine.cpp000066400000000000000000000261251424734202100306620ustar00rootroot00000000000000/* * 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 . */ #include "xdgiconproxyengine.h" #include #include #include #include #include #include #include #include #include #include #include #if XDG_ICON_VERSION_MAR >= 3 #define private public #include #undef private #elif XDG_ICON_VERSION_MAR == 2 //这个版本中的xdgiconloader_p.h定义和qiconloader_p.h有冲突 //只能通过此方式提供创建XdgIconLoaderEngine对象的接口 #include "xdgiconenginecreator.h" #endif #if XDG_ICON_VERSION_MAR >= 3 namespace DEEPIN_QT_THEME { QThreadStorage colorScheme; void (*setFollowColorScheme)(bool); bool (*followColorScheme)(); } // namespace DEEPIN_QT_THEME #endif QT_BEGIN_NAMESPACE XdgIconProxyEngine::XdgIconProxyEngine(XdgIconLoaderEngine *proxy) : engine(proxy) , lastMode(QIcon::Normal) { } XdgIconProxyEngine::~XdgIconProxyEngine() { if (engine) delete engine; } quint64 XdgIconProxyEngine::entryCacheKey(const ScalableEntry *color_entry, const QIcon::Mode mode, const QIcon::State state) { return quint64(color_entry) ^ (quint64(mode) << 56) ^ (quint64(state) << 48); } QPixmap XdgIconProxyEngine::followColorPixmap(ScalableEntry *color_entry, const QSize &size, QIcon::Mode mode, QIcon::State state) { if (mode == QIcon::Selected && mode != lastMode) { // 由非选中状态切换至选中状态,如果颜色值不更新,会按照上一次的状态(非选中时的颜色值) // 从svg图标缓存中寻找异常图标,导致图标异常。 for (int each_mode = QIcon::Normal; each_mode <= QIcon::Selected; ++each_mode) { quint64 each_cache_key = entryCacheKey(color_entry, QIcon::Mode(each_mode), state); entryToColorScheme.remove(each_cache_key); } } lastMode = mode; quint64 cache_key = entryCacheKey(color_entry, mode, state); const QString &cache_color_scheme = entryToColorScheme.value(cache_key); // 当size为1时表示此svg文件不需要处理ColorScheme标签 if (cache_color_scheme.size() == 1) return color_entry->pixmap(size, mode, state); const QString &color_scheme = DEEPIN_QT_THEME::colorScheme.localData(); QPixmap pm = color_scheme == cache_color_scheme ? color_entry->svgIcon.pixmap(size, mode, state) : QPixmap(); // Note: not checking the QIcon::isNull(), because in Qt5.10 the isNull() is not reliable // for svg icons desierialized from stream (see https://codereview.qt-project.org/#/c/216086/) if (pm.isNull()) { // The following lines are adapted and updated from KDE's "kiconloader.cpp" -> // KIconLoaderPrivate::processSvg() and KIconLoaderPrivate::createIconImage(). // They read the SVG color scheme of SVG icons and give images based on the icon mode. QHash svg_buffers; bool invalidBuffers = true; QFile device {color_entry->filename}; if (device.open(QIODevice::ReadOnly)) { // Note: indexes are assembled as in qtsvg (QSvgIconEnginePrivate::hashKey()) QPair style_sheet; style_sheet = qMakePair((mode << 4) | state, QStringLiteral(".ColorScheme-Text{color:%1;}").arg(color_scheme)); QSharedPointer writer(new QXmlStreamWriter {&svg_buffers[style_sheet.first]}); QXmlStreamReader xmlReader(&device); while (!xmlReader.atEnd()) { if (xmlReader.readNext() == QXmlStreamReader::StartElement && xmlReader.qualifiedName() == QLatin1String("style") && xmlReader.attributes().value(QLatin1String("id")) == QLatin1String("current-color-scheme")) { invalidBuffers = false; writer->writeStartElement(QLatin1String("style")); writer->writeAttributes(xmlReader.attributes()); writer->writeCharacters(style_sheet.second); writer->writeEndElement(); while (xmlReader.tokenType() != QXmlStreamReader::EndElement) xmlReader.readNext(); } else if (xmlReader.tokenType() != QXmlStreamReader::Invalid) { writer->writeCurrentToken(xmlReader); } } // duplicate the contents also for opposite state // svg_buffers[(QIcon::Normal<<4)|QIcon::On] = svg_buffers[(QIcon::Normal<<4)|QIcon::Off]; // svg_buffers[(QIcon::Selected<<4)|QIcon::On] = svg_buffers[(QIcon::Selected<<4)|QIcon::Off]; } if (invalidBuffers) { // 此svg图标无ColorScheme标签时不应该再下面的操作,且应该记录下来,避免后续再处理svg文件内容 entryToColorScheme[cache_key] = QStringLiteral("#"); return color_entry->pixmap(size, mode, state); } // use the QSvgIconEngine // - assemble the content as it is done by the operator <<(QDataStream &s, const QIcon &icon) // (the QSvgIconEngine::key() + QSvgIconEngine::write()) // - create the QIcon from the content by usage of the QIcon::operator >>(QDataStream &s, const QIcon &icon) // (icon with the (QSvgIconEngine) will be used) QByteArray icon_arr; QDataStream str {&icon_arr, QIODevice::WriteOnly}; str.setVersion(QDataStream::Qt_4_4); QHash filenames; filenames[0] = color_entry->filename; // Note: filenames are ignored in the QSvgIconEngine::read() filenames[-1] = color_scheme; // 在dsvg插件中会为svg图标做缓存,此处是为其添加额外的缓存文件key标识,避免不同color的svg图标会命中同一个缓存文件 str << QStringLiteral("svg") << filenames << static_cast(0) /*isCompressed*/ << svg_buffers << static_cast(0) /*hasAddedPimaps*/; QDataStream str_read {&icon_arr, QIODevice::ReadOnly}; str_read.setVersion(QDataStream::Qt_4_4); str_read >> color_entry->svgIcon; pm = color_entry->svgIcon.pixmap(size, mode, state); // load the icon directly from file, if still null if (pm.isNull()) { color_entry->svgIcon = QIcon(color_entry->filename); pm = color_entry->svgIcon.pixmap(size, mode, state); } entryToColorScheme[cache_key] = color_scheme; } return pm; } QPixmap XdgIconProxyEngine::pixmapByEntry(QIconLoaderEngineEntry *entry, const QSize &size, QIcon::Mode mode, QIcon::State state) { if (!XdgIcon::followColorScheme()) { DEEPIN_QT_THEME::colorScheme.setLocalData(QString()); return entry->pixmap(size, mode, state); } QPixmap pixmap; char *type_name = abi::__cxa_demangle(typeid(*entry).name(), 0, 0, 0); if (type_name == QByteArrayLiteral("ScalableFollowsColorEntry")) { if (DEEPIN_QT_THEME::colorScheme.localData().isEmpty()) { const QPalette &pal = qApp->palette(); DEEPIN_QT_THEME::colorScheme.setLocalData(mode == QIcon::Selected ? pal.highlightedText().color().name() : pal.windowText().color().name()); } pixmap = followColorPixmap(static_cast(entry), size, mode, state); } else { pixmap = entry->pixmap(size, mode, state); } free(type_name); DEEPIN_QT_THEME::colorScheme.setLocalData(QString()); return pixmap; } void XdgIconProxyEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) { if (painter->device()->devType() == QInternal::Widget && XdgIcon::followColorScheme() && DEEPIN_QT_THEME::colorScheme.localData().isEmpty()) { const QPalette &pal = qvariant_cast(dynamic_cast(painter->device())->property("palette")); DEEPIN_QT_THEME::colorScheme.setLocalData(mode == QIcon::Selected ? pal.highlightedText().color().name() : pal.windowText().color().name()); } const QPixmap pix = pixmap(rect.size(), mode, state); if (pix.isNull()) return; painter->drawPixmap(rect, pix); } QPixmap XdgIconProxyEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) { engine->ensureLoaded(); QIconLoaderEngineEntry *entry = engine->entryForSize(size); if (!entry) { DEEPIN_QT_THEME::colorScheme.setLocalData(QString()); return QPixmap(); } return pixmapByEntry(entry, size, mode, state); } void XdgIconProxyEngine::addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state) { return engine->addPixmap(pixmap, mode, state); } void XdgIconProxyEngine::addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state) { return engine->addFile(fileName, size, mode, state); } QString XdgIconProxyEngine::key() const { return QLatin1String("XdgIconProxyEngine"); } QSize XdgIconProxyEngine::actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) { return engine->actualSize(size, mode, state); } QIconEngine *XdgIconProxyEngine::clone() const { return new XdgIconProxyEngine(static_cast(engine->clone())); } bool XdgIconProxyEngine::read(QDataStream &in) { return engine->read(in); } bool XdgIconProxyEngine::write(QDataStream &out) const { return engine->write(out); } void XdgIconProxyEngine::virtual_hook(int id, void *data) { #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) if (id == QIconEngine::ScaledPixmapHook) { engine->ensureLoaded(); QIconEngine::ScaledPixmapArgument &arg = *reinterpret_cast(data); // QIcon::pixmap() multiplies size by the device pixel ratio. const int integerScale = qCeil(arg.scale); QIconLoaderEngineEntry *entry = engine->entryForSize(arg.size / integerScale, integerScale); // 先禁用缩放,因为此size是已经缩放过的 bool useHighDpiPixmap = qGuiApp->testAttribute(Qt::AA_UseHighDpiPixmaps); qGuiApp->setAttribute(Qt::AA_UseHighDpiPixmaps, false); arg.pixmap = entry ? pixmapByEntry(entry, arg.size, arg.mode, arg.state) : QPixmap(); qGuiApp->setAttribute(Qt::AA_UseHighDpiPixmaps, useHighDpiPixmap); DEEPIN_QT_THEME::colorScheme.setLocalData(QString()); return; } #endif return engine->virtual_hook(id, data); } QT_END_NAMESPACE qt5integration-5.5.23/iconengineplugins/xdgiconproxyengine/xdgiconproxyengine.h000066400000000000000000000052131424734202100303220ustar00rootroot00000000000000/* * 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 . */ #ifndef XDGICONPROXYENGINE_H #define XDGICONPROXYENGINE_H #include #if XDG_ICON_VERSION_MAR >= 3 #define private public #include #undef private #elif XDG_ICON_VERSION_MAR == 2 //这个版本中的xdgiconloader_p.h定义和qiconloader_p.h有冲突 //只能通过此方式提供创建XdgIconLoaderEngine对象的接口 #include "xdgiconenginecreator.h" #endif class ScalableEntry; class QIconLoaderEngineEntry; QT_BEGIN_NAMESPACE #if XDG_ICON_VERSION_MAR >= 3 class XdgIconProxyEngine : public QIconEngine { public: XdgIconProxyEngine(XdgIconLoaderEngine *proxy); virtual ~XdgIconProxyEngine() override; static quint64 entryCacheKey(const ScalableEntry *color_entry, const QIcon::Mode mode, const QIcon::State state); QPixmap followColorPixmap(ScalableEntry *color_entry, const QSize &size, QIcon::Mode mode, QIcon::State state); QPixmap pixmapByEntry(QIconLoaderEngineEntry *entry, const QSize &size, QIcon::Mode mode, QIcon::State state); void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override; QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override; void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state) override; void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state) override; QString key() const override; QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) override; QIconEngine *clone() const override; bool read(QDataStream &in) override; bool write(QDataStream &out) const override; void virtual_hook(int id, void *data) override; private: XdgIconLoaderEngine *engine; QHash entryToColorScheme; QIcon::Mode lastMode; }; #endif QT_END_NAMESPACE #endif // XDGICONPROXYENGINE_H qt5integration-5.5.23/iconengineplugins/xdgiconproxyengine/xdgiconproxyengine.pro000066400000000000000000000015471424734202100307010ustar00rootroot00000000000000QT += gui-private core gui TARGET = xdgicon$${DTK_VERSION} TEMPLATE = lib CONFIG += plugin link_pkgconfig DEFINES += QT_DEPRECATED_WARNINGS PKGCONFIG += mtdev Qt5Xdg x11 Qt5XdgIconLoader PKG_CONFIG = $$pkgConfigExecutable() XDG_ICON_VERSION = $$system($$PKG_CONFIG --modversion Qt5XdgIconLoader) XDG_ICON_VERSION_LIST = $$split(XDG_ICON_VERSION, .) INCLUDEPATH += $$system($$PKG_CONFIG --variable includedir Qt5XdgIconLoader)/qt5xdgiconloader/$$XDG_ICON_VERSION DEFINES += "XDG_ICON_VERSION_MAR=$$first(XDG_ICON_VERSION_LIST)" SOURCES += \ xdgiconproxyengine.cpp \ main.cpp HEADERS += \ xdgiconproxyengine.h \ OTHER_FILES += \ xdgproxyiconplugin.json DESTDIR = $$_PRO_FILE_PWD_/../../bin/plugins/iconengines/$${BASED_DTK_DIR} unix { target.path = $$[QT_INSTALL_PLUGINS]/iconengines/$${BASED_DTK_DIR} INSTALLS += target } qt5integration-5.5.23/iconengineplugins/xdgiconproxyengine/xdgproxyiconplugin.json000066400000000000000000000000511424734202100310700ustar00rootroot00000000000000{ "Keys": [ "XdgIconProxyEngine" ] } qt5integration-5.5.23/imageformatplugins/000077500000000000000000000000001424734202100204575ustar00rootroot00000000000000qt5integration-5.5.23/imageformatplugins/imageformats.pro000066400000000000000000000000421424734202100236530ustar00rootroot00000000000000TEMPLATE = subdirs SUBDIRS += svg qt5integration-5.5.23/imageformatplugins/svg/000077500000000000000000000000001424734202100212565ustar00rootroot00000000000000qt5integration-5.5.23/imageformatplugins/svg/main.cpp000066400000000000000000000062741424734202100227170ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include #if !defined(QT_NO_SVGRENDERER) #include "qsvgiohandler.h" #include #include #include QT_BEGIN_NAMESPACE class QSvgPlugin : public QImageIOPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "svg.json") public: QStringList keys() const; Capabilities capabilities(QIODevice *device, const QByteArray &format) const; QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const; }; QStringList QSvgPlugin::keys() const { return QStringList() << QLatin1String("svg") << QLatin1String("svgz"); } QImageIOPlugin::Capabilities QSvgPlugin::capabilities(QIODevice *device, const QByteArray &format) const { if (format == "svg" || format == "svgz") return Capabilities(CanRead); if (!format.isEmpty()) return 0; Capabilities cap; if (device->isReadable() && QSvgIOHandler::canRead(device)) cap |= CanRead; return cap; } QImageIOHandler *QSvgPlugin::create(QIODevice *device, const QByteArray &format) const { QSvgIOHandler *hand = new QSvgIOHandler(); hand->setDevice(device); hand->setFormat(format); return hand; } QT_END_NAMESPACE #include "main.moc" #endif // !QT_NO_IMAGEFORMATPLUGIN qt5integration-5.5.23/imageformatplugins/svg/qsvgiohandler.cpp000066400000000000000000000166601424734202100246410ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "qsvgiohandler.h" #ifndef QT_NO_SVGRENDERER #include "qimage.h" #include "qpixmap.h" #include "qpainter.h" #include "qvariant.h" #include "qbuffer.h" #include "qdebug.h" #include DGUI_USE_NAMESPACE QT_BEGIN_NAMESPACE #ifndef UT_QSVGIOHANDLERPRIVATE class QSvgIOHandlerPrivate { public: QSvgIOHandlerPrivate(QSvgIOHandler *qq) : q(qq), loaded(false), readDone(false), backColor(Qt::transparent) {} bool load(QIODevice *device); QSvgIOHandler *q; DSvgRenderer r; QSize defaultSize; QRect clipRect; QSize scaledSize; QRect scaledClipRect; bool loaded; bool readDone; QColor backColor; }; #endif bool QSvgIOHandlerPrivate::load(QIODevice *device) { if (!device) return false; if (loaded) return true; if (q->format().isEmpty()) q->canRead(); // # The SVG renderer doesn't handle trailing, unrelated data, so we must // assume that all available data in the device is to be read. bool res = false; QBuffer *buf = qobject_cast(device); if (buf) { const QByteArray &ba = buf->data(); res = r.load(QByteArray::fromRawData(ba.constData() + buf->pos(), ba.size() - buf->pos())); buf->seek(ba.size()); } else if (q->format() == "svgz") { res = r.load(device->readAll()); } else { res = r.load(device->readAll()); } if (res) { defaultSize = QSize(r.viewBox().width(), r.viewBox().height()); loaded = true; } return loaded; } QSvgIOHandler::QSvgIOHandler() : d(new QSvgIOHandlerPrivate(this)) { } QSvgIOHandler::~QSvgIOHandler() { delete d; } bool QSvgIOHandler::canRead() const { if (!device()) return false; if (d->loaded && !d->readDone) return true; // Will happen if we have been asked for the size QByteArray buf = device()->peek(8); if (buf.startsWith("\x1f\x8b")) { setFormat("svgz"); return true; } else if (buf.contains("readDone || d->load(device())) { bool xform = (d->clipRect.isValid() || d->scaledSize.isValid() || d->scaledClipRect.isValid()); QSize finalSize = d->defaultSize; QRectF bounds; if (xform && !d->defaultSize.isEmpty()) { bounds = QRectF(QPointF(0,0), QSizeF(d->defaultSize)); QPoint tr1, tr2; QSizeF sc(1, 1); if (d->clipRect.isValid()) { tr1 = -d->clipRect.topLeft(); finalSize = d->clipRect.size(); } if (d->scaledSize.isValid()) { sc = QSizeF(qreal(d->scaledSize.width()) / finalSize.width(), qreal(d->scaledSize.height()) / finalSize.height()); finalSize = d->scaledSize; } if (d->scaledClipRect.isValid()) { tr2 = -d->scaledClipRect.topLeft(); finalSize = d->scaledClipRect.size(); } QTransform t; t.translate(tr2.x(), tr2.y()); t.scale(sc.width(), sc.height()); t.translate(tr1.x(), tr1.y()); bounds = t.mapRect(bounds); } if (!finalSize.isEmpty()) { if (bounds.isEmpty() && d->backColor.alpha() == 0) { *image = d->r.toImage(finalSize); } else { *image = QImage(finalSize, QImage::Format_ARGB32_Premultiplied); image->fill(d->backColor.rgba()); QPainter p(image); p.setRenderHints(QPainter::SmoothPixmapTransform); d->r.render(&p, bounds); p.end(); } } d->readDone = true; return true; } return false; } QVariant QSvgIOHandler::option(ImageOption option) const { switch(option) { case ImageFormat: return QImage::Format_ARGB32_Premultiplied; break; case Size: d->load(device()); return d->defaultSize; break; case ClipRect: return d->clipRect; break; case ScaledSize: return d->scaledSize; break; case ScaledClipRect: return d->scaledClipRect; break; case BackgroundColor: return d->backColor; break; default: break; } return QVariant(); } void QSvgIOHandler::setOption(ImageOption option, const QVariant & value) { switch(option) { case ClipRect: d->clipRect = value.toRect(); break; case ScaledSize: d->scaledSize = value.toSize(); break; case ScaledClipRect: d->scaledClipRect = value.toRect(); break; case BackgroundColor: d->backColor = value.value(); break; default: break; } } bool QSvgIOHandler::supportsOption(ImageOption option) const { switch(option) { case ImageFormat: case Size: case ClipRect: case ScaledSize: case ScaledClipRect: case BackgroundColor: return true; default: break; } return false; } bool QSvgIOHandler::canRead(QIODevice *device) { QByteArray buf = device->peek(8); return buf.startsWith("\x1f\x8b") || buf.contains(" #ifndef QT_NO_SVGRENDERER QT_BEGIN_NAMESPACE class QImage; class QByteArray; class QIODevice; class QVariant; class QSvgIOHandlerPrivate; class QSvgIOHandler : public QImageIOHandler { public: QSvgIOHandler(); ~QSvgIOHandler(); virtual bool canRead() const; virtual QByteArray name() const; virtual bool read(QImage *image); static bool canRead(QIODevice *device); virtual QVariant option(ImageOption option) const; virtual void setOption(ImageOption option, const QVariant & value); virtual bool supportsOption(ImageOption option) const; private: QSvgIOHandlerPrivate *d; }; QT_END_NAMESPACE #endif // QT_NO_SVGRENDERER #endif // QSVGIOHANDLER_H qt5integration-5.5.23/imageformatplugins/svg/svg.json000066400000000000000000000001101424734202100227400ustar00rootroot00000000000000{ "Keys": [ "svg", "svgz" ], "MimeTypes": [ "image/svg+xml" ] } qt5integration-5.5.23/imageformatplugins/svg/svg.pro000066400000000000000000000006361424734202100226040ustar00rootroot00000000000000TARGET = dsvg$${DTK_VERSION} TEMPLATE = lib CONFIG += plugin HEADERS += qsvgiohandler.h SOURCES += main.cpp \ qsvgiohandler.cpp OTHER_FILES += svg.json CONFIG += c++11 link_pkgconfig PKGCONFIG += dtkgui$${DTK_VERSION} DESTDIR = $$_PRO_FILE_PWD_/../../bin/plugins/imageformats/$${BASED_DTK_DIR} unix { target.path = $$[QT_INSTALL_PLUGINS]/imageformats/$${BASED_DTK_DIR} INSTALLS += target } qt5integration-5.5.23/platformthemeplugin/000077500000000000000000000000001424734202100206505ustar00rootroot00000000000000qt5integration-5.5.23/platformthemeplugin/config.tests/000077500000000000000000000000001424734202100232565ustar00rootroot00000000000000qt5integration-5.5.23/platformthemeplugin/config.tests/dthemed_icon_lookup/000077500000000000000000000000001424734202100272715ustar00rootroot00000000000000qt5integration-5.5.23/platformthemeplugin/config.tests/dthemed_icon_lookup/dthemed_icon_lookup.pro000066400000000000000000000003241424734202100340250ustar00rootroot00000000000000QT += core QT -= gui CONFIG += c++11 TARGET = dthemed_icon_lookup CONFIG += console link_pkgconfig CONFIG -= app_bundle PKGCONFIG += til TEMPLATE = app SOURCES += main.cpp DEFINES += QT_DEPRECATED_WARNINGS qt5integration-5.5.23/platformthemeplugin/config.tests/dthemed_icon_lookup/main.cpp000066400000000000000000000002711424734202100307210ustar00rootroot00000000000000#include using namespace themed_icon_lookup; int main() { auto *r = find_icon("TestIcon", 32, 1); free_cstring(const_cast(r)); return 0; } qt5integration-5.5.23/platformthemeplugin/deepin-theme-plugin.qrc000066400000000000000000000001441424734202100252160ustar00rootroot00000000000000 qtquickcontrols2.conf qt5integration-5.5.23/platformthemeplugin/deepin.json000066400000000000000000000000361424734202100230060ustar00rootroot00000000000000{ "Keys" : [ "deepin" ] } qt5integration-5.5.23/platformthemeplugin/diconengine.cpp000066400000000000000000000030221424734202100236330ustar00rootroot00000000000000#include "diconengine.h" #include #include #include #include DWIDGET_USE_NAMESPACE using namespace themed_icon_lookup; DIconEngine::DIconEngine(const QString &iconName) : QIconEngine() , m_iconName(iconName) { } DIconEngine::~DIconEngine() { } void DIconEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) { const QSize &pixSize = rect.size(); painter->drawPixmap(rect, pixmap(pixSize, mode, state)); } QIconEngine *DIconEngine::clone() const { return nullptr; } QSize DIconEngine::actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) { Q_UNUSED(mode); Q_UNUSED(state); return size; } QString DIconEngine::key() const { return QString(); } QList DIconEngine::availableSizes(QIcon::Mode mode, QIcon::State state) const { Q_UNUSED(mode); Q_UNUSED(state); // just return a invalid size return QList({ QSize() }); } QPixmap DIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) { Q_UNUSED(mode); Q_UNUSED(state); const char *szFilePath = find_icon_with_theme_name("Sea", m_iconName.toStdString().c_str(), size.width(), 1); const QString fpath(szFilePath); free_cstring(const_cast(szFilePath)); if (fpath.isEmpty()) { qWarning() << m_iconName << size; return QPixmap(); } if (fpath.endsWith(".svg")) return DSvgRenderer::render(fpath, size); return QPixmap(fpath); } qt5integration-5.5.23/platformthemeplugin/diconengine.h000066400000000000000000000013241424734202100233030ustar00rootroot00000000000000#ifndef DICONENGINE_H #define DICONENGINE_H #include class DIconEngine : public QIconEngine { public: explicit DIconEngine(const QString &iconName); ~DIconEngine(); void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state); QString key() const; QString iconName() const { return m_iconName; } QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state); QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); QList availableSizes(QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const; QIconEngine *clone() const; private: const QString m_iconName; }; #endif // DICONENGINE_H qt5integration-5.5.23/platformthemeplugin/diconproxyengine.cpp000066400000000000000000000031031424734202100247350ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "diconproxyengine.h" DIconProxyEngine::DIconProxyEngine(const QIcon &proxyIcon) : QIconEngine() , m_proxyIcon(proxyIcon) { } void DIconProxyEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) { m_proxyIcon.paint(painter, rect, Qt::AlignCenter, mode, state); } QPixmap DIconProxyEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) { return m_proxyIcon.pixmap(size, mode, state); } QSize DIconProxyEngine::actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) { return m_proxyIcon.actualSize(size, mode, state); } QIconEngine *DIconProxyEngine::clone() const { return new DIconProxyEngine(m_proxyIcon); } bool DIconProxyEngine::read(QDataStream &in) { in << m_proxyIcon.name(); return true; } bool DIconProxyEngine::write(QDataStream &out) const { Q_UNUSED(out) return false; } qt5integration-5.5.23/platformthemeplugin/diconproxyengine.h000066400000000000000000000025701424734202100244110ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #ifndef DICONPROXYENGINE_H #define DICONPROXYENGINE_H #include class DIconProxyEngine : public QIconEngine { public: explicit DIconProxyEngine(const QIcon &proxyIcon); void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE; QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE; QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE; QIconEngine *clone() const Q_DECL_OVERRIDE; bool read(QDataStream &in) Q_DECL_OVERRIDE; bool write(QDataStream &out) const Q_DECL_OVERRIDE; private: QIcon m_proxyIcon; }; #endif // DICONPROXYENGINE_H qt5integration-5.5.23/platformthemeplugin/dthemesettings.cpp000066400000000000000000000211431424734202100244040ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include "dthemesettings.h" #include #include #include #include #define ICON_THEME_NAME QStringLiteral("IconThemeName") #define F_ICON_THEME_NAME QStringLiteral("FallBackIconThemeName") #define STYLE_NAMES QStringLiteral("StyleNames") #define SYSTEM_FONT QStringLiteral("Font") #define SYSTEM_FIXED_FONT QStringLiteral("MonoFont") #define SYSTEM_FONT_POINT_SIZE QStringLiteral("FontSize") // 在某些情况下,触摸滚动视图的操作可能和其它的touch move行为冲突(例如文件管理器的视图滚动和文件内容多选) // 只能在时间上控制让两个冲突的逻辑错开。此处定义此时间(单位:ms),表示从touch begin到touch move比较在 // 此时间段内完成,否则不应该认为这个一个触摸滚动操作 #define TOUCH_FLICK_BEGIN_MOVE_DELAY QStringLiteral("TouchFlickBeginMoveDelay") #define SCREEN_SCALE_FACTORS QStringLiteral("ScreenScaleFactors") #define SCALE_FACTOR QStringLiteral("ScaleFactor") #define SCALE_LOGICAL_DPI QStringLiteral("ScaleLogicalDpi") // 当窗口从一个屏幕移动到另一个屏幕后,自动根据新的屏幕缩放比例更新窗口实际大小 #define AUTO_SCALE_WINDOW QStringLiteral("AutoScaleWindow") DCORE_USE_NAMESPACE DThemeSettings::DThemeSettings(bool watchFile, QObject *parent) : QObject(parent) , settings(makeSettings()) { if (!watchFile) return; QStringList list; list << settings->fileName(); list << QSettings(QSettings::IniFormat, QSettings::SystemScope, "deepin", "qt-theme").fileName(); DFileWatcherManager *watcher = new DFileWatcherManager(this); for (const QString &path : list) { QFile file(path); if (!file.exists()) { file.open(QFile::WriteOnly); file.close(); } if (QFile::exists(path)) watcher->add(path); } connect(watcher, &DFileWatcherManager::fileModified, this, &DThemeSettings::onConfigChanged); } QSettings * DThemeSettings::makeSettings() { QString saveConfigPath; do { // 需要自定义读取主题相关配置的存储路径,未定义时默认为 ~/.config // 适用于这样的情况:一个使用pkexec使用root权限启动的UI应用,需要跟随启动时的普通 // 用户的字体、缩放等设置,可通过在QCoreApplication构造之前设置此环境变量指定使用 // 某用户的主题配置文件。 static QByteArray theme_config_path = qgetenv("D_QT_THEME_CONFIG_PATH"); if (theme_config_path.isEmpty()) { break; } const QString suffix("/deepin/qt-theme.ini"); QFileInfo info(theme_config_path + suffix); // 忽略不存在的文件或软连接 if (!info.exists() || info.isSymLink()) { break; } // 先创建一个对象,用于获取默认配置文件的路径 QSettings s(QSettings::IniFormat, QSettings::UserScope, "deepin", "qt-theme"); QString file_path = s.fileName(); // 必须以此路径结尾,去除此路径的剩余部分为配置文件路径 if (!file_path.endsWith(suffix)) { break; } saveConfigPath = file_path.left(file_path.size() - suffix.size()); if (saveConfigPath.isEmpty()) { break; } // 设置自定义的主题配置文件存储目录 QSettings::setPath(s.format(), s.scope(), QString::fromLocal8Bit(theme_config_path)); } while (false); QSettings *s = new QSettings(QSettings::IniFormat, QSettings::UserScope, "deepin", "qt-theme"); // 恢复原本的配置目录 if (!saveConfigPath.isEmpty()) { QSettings::setPath(s->format(), s->scope(), saveConfigPath); } s->setIniCodec("utf-8"); s->beginGroup("Theme"); return s; } bool DThemeSettings::contains(const QString &key) const { return settings->contains(key); } QVariant DThemeSettings::value(const QString &key, const QVariant &defaultValue) const { return settings->value(key, defaultValue); } bool DThemeSettings::isSetIconThemeName() const { return contains(ICON_THEME_NAME); } QString DThemeSettings::iconThemeName() const { return value(ICON_THEME_NAME).toString(); } bool DThemeSettings::isSetFallbackIconThemeName() const { return contains(F_ICON_THEME_NAME); } QString DThemeSettings::fallbackIconThemeName() const { return value(F_ICON_THEME_NAME).toString(); } bool DThemeSettings::isSetSystemFont() const { return contains(SYSTEM_FONT); } QString DThemeSettings::systemFont() const { return value(SYSTEM_FONT).toString(); } bool DThemeSettings::isSetStyleNames() const { return contains(STYLE_NAMES); } QStringList DThemeSettings::styleNames() const { return value(STYLE_NAMES).toStringList(); } bool DThemeSettings::isSetSystemFontPixelSize() const { return contains(SYSTEM_FONT_POINT_SIZE); } qreal DThemeSettings::systemFontPointSize() const { return value(SYSTEM_FONT_POINT_SIZE, 9.0).toDouble(); } bool DThemeSettings::isSetSystemFixedFont() const { return contains(SYSTEM_FIXED_FONT); } QString DThemeSettings::systemFixedFont() const { return value(SYSTEM_FIXED_FONT).toString(); } int DThemeSettings::touchFlickBeginMoveDelay() const { return value(TOUCH_FLICK_BEGIN_MOVE_DELAY, 300).toInt(); } qreal DThemeSettings::scaleFactor() const { return value(SCALE_FACTOR).toReal(); } QByteArray DThemeSettings::screenScaleFactors() const { return value(SCREEN_SCALE_FACTORS).toByteArray(); } // 从配置文件中获取dpi相关数据,文件中存储的格式为 ScaleLogicalDpi=x,y // 会被QSettings解析为QStringList,此处需要将其转换为QPair static DDpi takePair(const QVariant &value) { if (!value.isValid()) { return qMakePair(0.0, 0.0); } const QStringList &l = value.toStringList(); if (l.count() < 2) { return qMakePair(0.0, 0.0); } DDpi ret; ret.first = l.first().toDouble(); ret.second = l.at(1).toDouble(); return ret; } DDpi DThemeSettings::scaleLogicalDpi() const { return takePair(value(SCALE_LOGICAL_DPI)); } bool DThemeSettings::autoScaleWindow() const { return value(AUTO_SCALE_WINDOW, true).toBool(); } void DThemeSettings::onConfigChanged() { QVariantMap config; for (const QString &v : settings->allKeys()) { config[v] = settings->value(v); } settings->sync(); for (const QString &v : settings->allKeys()) { const QVariant &old_value = config.value(v); const QVariant &new_value = settings->value(v); if (old_value != new_value) { if (v == ICON_THEME_NAME) emit iconThemeNameChanged(new_value.toString()); else if (v == F_ICON_THEME_NAME) emit fallbackIconThemeNameChanged(new_value.toString()); else if (v == SYSTEM_FONT) emit systemFontChanged(new_value.toString()); else if (v == STYLE_NAMES) emit styleNamesChanged(new_value.toStringList()); else if (v == SYSTEM_FIXED_FONT) emit systemFixedFontChanged(new_value.toString()); else if (v == SYSTEM_FONT_POINT_SIZE) emit systemFontPointSizeChanged(new_value.toInt()); else if (v == TOUCH_FLICK_BEGIN_MOVE_DELAY) emit touchFlickBeginMoveDelayChanged(new_value.toInt()); else if (v == SCREEN_SCALE_FACTORS) emit screenScaleFactorsChanged(new_value.toByteArray()); else if (v == SCALE_FACTOR) emit scaleFactorChanged(new_value.toReal()); else if (v == SCALE_LOGICAL_DPI) emit scaleLogicalDpiChanged(takePair(new_value)); emit valueChanged(v, old_value, new_value); } } } qt5integration-5.5.23/platformthemeplugin/dthemesettings.h000066400000000000000000000073621424734202100240600ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 DTHEMESETTINGS_H #define DTHEMESETTINGS_H #include #include /*! \typedef DDpi \relates DThemeSettings Synonym for QPair. */ typedef QPair DDpi; class DThemeSettings : public QObject { Q_OBJECT Q_PROPERTY(QString iconThemeName READ iconThemeName NOTIFY iconThemeNameChanged) Q_PROPERTY(QString fallbackIconThemeName READ fallbackIconThemeName NOTIFY fallbackIconThemeNameChanged) Q_PROPERTY(QString systemFont READ systemFont NOTIFY systemFontChanged) Q_PROPERTY(QString systemFixedFont READ systemFixedFont NOTIFY systemFixedFontChanged) Q_PROPERTY(qreal systemFontPointSize READ systemFontPointSize NOTIFY systemFontPointSizeChanged) Q_PROPERTY(QStringList styleNames READ styleNames NOTIFY styleNamesChanged) Q_PROPERTY(int touchFlickBeginMoveDelay READ touchFlickBeginMoveDelay NOTIFY touchFlickBeginMoveDelayChanged) Q_PROPERTY(qreal scaleFactor READ scaleFactor NOTIFY scaleFactorChanged) Q_PROPERTY(QByteArray screenScaleFactors READ screenScaleFactors NOTIFY screenScaleFactorsChanged) Q_PROPERTY(DDpi scaleLogicalDpi READ scaleLogicalDpi NOTIFY scaleLogicalDpiChanged) Q_PROPERTY(bool autoScaleWindow READ autoScaleWindow NOTIFY autoScaleWindowChanged) public: explicit DThemeSettings(bool watchFile = true, QObject *parent = 0); static QSettings *makeSettings(); bool contains(const QString &key) const; QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const; bool isSetIconThemeName() const; QString iconThemeName() const; bool isSetFallbackIconThemeName() const; QString fallbackIconThemeName() const; bool isSetSystemFont() const; QString systemFont() const; bool isSetStyleNames() const; QStringList styleNames() const; bool isSetSystemFontPixelSize() const; qreal systemFontPointSize() const; bool isSetSystemFixedFont() const; QString systemFixedFont() const; int touchFlickBeginMoveDelay() const; qreal scaleFactor() const; QByteArray screenScaleFactors() const; DDpi scaleLogicalDpi() const; bool autoScaleWindow() const; signals: void valueChanged(const QString &key, const QVariant &oldValue, const QVariant &newValue); void iconThemeNameChanged(QString iconThemeName); void fallbackIconThemeNameChanged(QString fallbackIconThemeName); void systemFontChanged(QString systemFont); void styleNamesChanged(QStringList styleNames); void systemFixedFontChanged(QString systemFixedFont); void systemFontPointSizeChanged(qreal systemFontPointSize); void touchFlickBeginMoveDelayChanged(int touchFlickBeginMoveDelay); void scaleFactorChanged(const qreal &scaleFactor); void screenScaleFactorsChanged(const QByteArray &screenScaleFactors); void scaleLogicalDpiChanged(const DDpi scaleLogicalDpi); void autoScaleWindowChanged(bool autoScaleWindow); private: QSettings *settings; void onConfigChanged(); }; #endif // DTHEMESETTINGS_H qt5integration-5.5.23/platformthemeplugin/icons/000077500000000000000000000000001424734202100217635ustar00rootroot00000000000000qt5integration-5.5.23/platformthemeplugin/icons/actions/000077500000000000000000000000001424734202100234235ustar00rootroot00000000000000qt5integration-5.5.23/platformthemeplugin/icons/actions/edit-copy_16px.svg000066400000000000000000000023571424734202100267260ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/actions/edit-cut_16px.svg000066400000000000000000000030221424734202100265350ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/actions/edit-delete_16px.svg000066400000000000000000000031551424734202100272130ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/actions/edit-paste_16px.svg000066400000000000000000000065451424734202100270730ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/actions/edit-redo_16px.svg000066400000000000000000000015641424734202100267040ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/actions/edit-select-all_16px.svg000066400000000000000000000027141424734202100277760ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/actions/edit-undo_16px.svg000066400000000000000000000007271424734202100267200ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/deepin-theme-plugin-icons.qrc000066400000000000000000000103271424734202100274460ustar00rootroot00000000000000 texts/caps_lock_16px.svg texts/password_hide_24px.svg texts/password_show_24px.svg texts/edit_12px.svg icons/button_voice_active_30px.svg icons/button_voice_active_press_30px.svg icons/icon_fail_128px.svg icons/icon_success_128px.svg texts/button_add_20px.svg texts/button_reduce_12px.svg texts/combobox_arrow_12px.svg texts/audio-volume-left_24px.svg texts/audio-volume-low_24px.svg texts/audio-volume-medium_24px.svg texts/audio-volume-muted_24px.svg texts/audio-volume-right_24px.svg texts/go-down_12px.svg texts/go-next_12px.svg texts/go-previous_12px.svg texts/go-up_12px.svg texts/media-playback-pause_24px.svg texts/media-playback-start_24px.svg texts/media-skip-backward_24px.svg texts/media-skip-forward_24px.svg texts/mark_indicator_12px.svg texts/fork_indicator_24px.svg texts/lock_indicator_24px.svg texts/selected_indicator_16px.svg texts/selected_checked_indicator_16px.svg texts/selected_indicator_16px.svg.background texts/unlock_indicator_24px.svg texts/unselected_indicator_16px.svg texts/window-close_round_30px.svg texts/search_indicator_36px.svg texts/unchecked_20px.svg texts/checked_20px.svg texts/next_indicator_24px.svg texts/prev_indicator_24px.svg actions/edit-select-all_16px.svg actions/edit-copy_16px.svg actions/edit-cut_16px.svg actions/edit-delete_16px.svg actions/edit-paste_16px.svg actions/edit-redo_16px.svg actions/edit-undo_16px.svg icons/light/edit-clear_30px.svg icons/light/edit-clear_press_30px.svg icons/light/button_voice_30px.svg icons/light/button_voice_press_30px.svg icons/light/list_delete_16px.svg icons/light/list_add_16px.svg icons/light/window-close_round_30px.svg icons/light/window-close_round_press_30px.svg icons/dark/edit-clear_30px.svg icons/dark/edit-clear_press_30px.svg icons/dark/button_voice_30px.svg icons/dark/button_voice_press_30px.svg icons/dark/list_delete_16px.svg icons/dark/list_add_16px.svg icons/dark/window-close_round_30px.svg icons/dark/window-close_round_press_30px.svg qt5integration-5.5.23/platformthemeplugin/icons/icons/000077500000000000000000000000001424734202100230765ustar00rootroot00000000000000qt5integration-5.5.23/platformthemeplugin/icons/icons/button_voice_active_30px.svg000066400000000000000000000033151424734202100305260ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/button_voice_active_press_30px.svg000066400000000000000000000033531424734202100317440ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/dark/000077500000000000000000000000001424734202100240175ustar00rootroot00000000000000qt5integration-5.5.23/platformthemeplugin/icons/icons/dark/button_voice_30px.svg000066400000000000000000000041601424734202100301130ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/dark/button_voice_press_30px.svg000066400000000000000000000042321424734202100313270ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/dark/edit-clear_30px.svg000066400000000000000000000042261424734202100274270ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/dark/edit-clear_press_30px.svg000066400000000000000000000043001424734202100306340ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/dark/list_add_16px.svg000066400000000000000000000005671424734202100272110ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/dark/list_delete_16px.svg000066400000000000000000000003621424734202100277140ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/dark/window-close_round_30px.svg000066400000000000000000000042261424734202100312370ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/dark/window-close_round_press_30px.svg000066400000000000000000000043001424734202100324440ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/dialog-right_30px.svg000066400000000000000000000021511424734202100270420ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/dialog-warning_30px.svg000066400000000000000000000024341424734202100273760ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/icon_fail_128px.svg000066400000000000000000000035001424734202100265020ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/icon_success_128px.svg000066400000000000000000000032641424734202100272460ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/light/000077500000000000000000000000001424734202100242055ustar00rootroot00000000000000qt5integration-5.5.23/platformthemeplugin/icons/icons/light/button_voice_30px.svg000066400000000000000000000035761424734202100303130ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/light/button_voice_press_30px.svg000066400000000000000000000040521424734202100315150ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/light/edit-clear_30px.svg000066400000000000000000000036441424734202100276200ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/light/edit-clear_press_30px.svg000066400000000000000000000056411424734202100310330ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/light/list_add_16px.svg000066400000000000000000000006551424734202100273750ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/light/list_delete_16px.svg000066400000000000000000000003621424734202100301020ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/light/window-close_round_30px.svg000066400000000000000000000036441424734202100314300ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/icons/light/window-close_round_press_30px.svg000066400000000000000000000056411424734202100326430ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/000077500000000000000000000000001424734202100231325ustar00rootroot00000000000000qt5integration-5.5.23/platformthemeplugin/icons/texts/audio-volume-left_24px.svg000066400000000000000000000014141424734202100300660ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/audio-volume-low_24px.svg000066400000000000000000000011521424734202100277340ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/audio-volume-medium_24px.svg000066400000000000000000000021401424734202100304110ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/audio-volume-muted_24px.svg000066400000000000000000000021161424734202100302520ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/audio-volume-right_24px.svg000066400000000000000000000022441424734202100302530ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/button_add_20px.svg000066400000000000000000000004051424734202100266460ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/button_reduce_12px.svg000066400000000000000000000003011424734202100273610ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/caps_lock_16px.svg000066400000000000000000000007061424734202100264720ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/checked_20px.svg000066400000000000000000000032101424734202100261060ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/combobox_arrow_12px.svg000066400000000000000000000002721424734202100275500ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/edit_12px.svg000066400000000000000000000010171424734202100254510ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/fork_indicator_24px.svg000066400000000000000000000005721424734202100275310ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/go-down_12px.svg000066400000000000000000000003371424734202100261020ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/go-next_12px.svg000066400000000000000000000002721424734202100261070ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/go-previous_12px.svg000066400000000000000000000002631424734202100270050ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/go-up_12px.svg000066400000000000000000000003261424734202100255550ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/lock_indicator_24px.svg000066400000000000000000000017351424734202100275220ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/mark_indicator_12px.svg000066400000000000000000000003301424734202100275070ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/media-playback-pause_24px.svg000066400000000000000000000004631424734202100305110ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/media-playback-start_24px.svg000066400000000000000000000005531424734202100305310ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/media-skip-backward_24px.svg000066400000000000000000000015551424734202100303350ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/media-skip-forward_24px.svg000066400000000000000000000015131424734202100302150ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/next_indicator_24px.svg000066400000000000000000000004741424734202100275470ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/password_hide_24px.svg000066400000000000000000000024271424734202100273700ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/password_show_24px.svg000066400000000000000000000014301424734202100274300ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/prev_indicator_24px.svg000066400000000000000000000005511424734202100275410ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/search_indicator_36px.svg000066400000000000000000000013361424734202100300370ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/selected_checked_indicator_16px.svg000066400000000000000000000013071424734202100320240ustar00rootroot00000000000000 selected_foreground qt5integration-5.5.23/platformthemeplugin/icons/texts/selected_indicator_16px.svg000066400000000000000000000013071424734202100303560ustar00rootroot00000000000000 selected_foreground qt5integration-5.5.23/platformthemeplugin/icons/texts/selected_indicator_16px.svg.background000066400000000000000000000010241424734202100324700ustar00rootroot00000000000000 selected_background qt5integration-5.5.23/platformthemeplugin/icons/texts/unchecked_20px.svg000066400000000000000000000013241424734202100264550ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/unlock_indicator_24px.svg000066400000000000000000000020201424734202100300510ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/unselected_indicator_16px.svg000066400000000000000000000007301424734202100307200ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/icons/texts/window-close_round_30px.svg000066400000000000000000000010251424734202100303440ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/main.cpp000066400000000000000000000026611424734202100223050ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include #include "qdeepintheme.h" #include QT_BEGIN_NAMESPACE void updateXdgIconSystemTheme() { XdgIconLoader::instance()->updateSystemTheme(); } class QDeepinThemePlugin : public QPlatformThemePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QPlatformThemeFactoryInterface_iid FILE "deepin.json") public: QPlatformTheme *create(const QString &key, const QStringList ¶ms) Q_DECL_OVERRIDE; }; QPlatformTheme *QDeepinThemePlugin::create(const QString &key, const QStringList ¶ms) { Q_UNUSED(params); if (!key.compare(QLatin1String(QDeepinTheme::name), Qt::CaseInsensitive)) return new QDeepinTheme; return 0; } QT_END_NAMESPACE #include "main.moc" qt5integration-5.5.23/platformthemeplugin/qdeepinfiledialoghelper.cpp000066400000000000000000000376151424734202100262350ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "qdeepinfiledialoghelper.h" #include "qdeepintheme.h" #include "filedialogmanager_interface.h" #include "filedialog_interface.h" #include #include #include #include #include #include #include #include #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) #include #else #include #endif #include #include QT_BEGIN_NAMESPACE #define DIALOG_SERVICE "com.deepin.filemanager.filedialog" #define DIALOG_CALL(Fun) ({if(nativeDialog) nativeDialog->Fun; else if(qtDialog) qtDialog->Fun; else qWarning("ensure dialog failed");}) QList stringList2UrlList(const QStringList &list) { QList urlList; for (const QString str : list) urlList << str; return urlList; } QStringList urlList2StringList(const QList &list) { QStringList stringList; for (const QUrl &url : list) stringList << url.toString(); return stringList; } DFileDialogManager *QDeepinFileDialogHelper::manager = Q_NULLPTR; QDeepinFileDialogHelper::QDeepinFileDialogHelper() { connect(this, &QDeepinFileDialogHelper::accept, this, [this] { if (sourceDialog && nativeDialog) { const QMap &map_lineedit = nativeDialog->allCustomWidgetsValue(LineEditType); const QMap &map_combobox = nativeDialog->allCustomWidgetsValue(ComboBoxType); auto map_eidt_begin = map_lineedit.constBegin(); while (map_eidt_begin != map_lineedit.constEnd()) { sourceDialog->setProperty(QString("_dtk_widget_lineedit_%1_value").arg(map_eidt_begin.key()).toUtf8(), map_eidt_begin.value()); ++map_eidt_begin; } auto map_combobox_begion = map_combobox.constBegin(); while (map_combobox_begion != map_combobox.constEnd()) { sourceDialog->setProperty(QString("_dtk_widget_combobox_%1_value").arg(map_combobox_begion.key()).toUtf8(), map_combobox_begion.value()); ++map_combobox_begion; } } }); } QDeepinFileDialogHelper::~QDeepinFileDialogHelper() { DIALOG_CALL(deleteLater()); if (auxiliaryWindow) auxiliaryWindow->deleteLater(); if (nativeDialog) nativeDialog->QObject::deleteLater(); } void QDeepinFileDialogHelper::onApplicationStateChanged(Qt::ApplicationState state) { if (state == Qt::ApplicationActive && nativeDialog) nativeDialog->activateWindow(); } void QDeepinFileDialogHelper::onWindowActiveChanged() { if (qApp->platformName() != "dxcb" && !qApp->property("_d_isDxcb").toBool()) return; QWindow *focus_window = qApp->focusWindow(); if (!focus_window) return; if (focus_window->type() != Qt::Widget && focus_window->type() != Qt::Window && focus_window->type() != Qt::Dialog) { return; } if (nativeDialog && !nativeDialog->windowActive() && qApp->applicationState() == Qt::ApplicationActive) { nativeDialog->activateWindow(); } } bool QDeepinFileDialogHelper::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) { ensureDialog(); applyOptions(); if (nativeDialog) { if (parent) activeWindow = parent; else activeWindow = QGuiApplication::focusWindow(); nativeDialog->setParent(parent); Qt::WindowFlags nd_flags = static_cast(nativeDialog->windowFlags()); Qt::WindowFlags need_flags = Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowContextHelpButtonHint | Qt::WindowStaysOnTopHint | Qt::WindowTransparentForInput | Qt::WindowDoesNotAcceptFocus | Qt::WindowStaysOnBottomHint | Qt::WindowCloseButtonHint | Qt::BypassWindowManagerHint; if (flags & need_flags) nativeDialog->setWindowFlags(nd_flags | (flags & need_flags)); static bool i_am_dbus_server = iAmFileDialogDBusServer(); if (i_am_dbus_server) { WId native_dialog_winId = nativeDialog->winId(); QWindow *real_native_dialog = nullptr; for (QWindow *window : qGuiApp->topLevelWindows()) { if (window->winId() == native_dialog_winId) { real_native_dialog = window; break; } } if (real_native_dialog) { real_native_dialog->setTransientParent(parent); real_native_dialog->setModality(modality); // call later QMetaObject::invokeMethod(nativeDialog.data(), "show", Qt::QueuedConnection); return true; } } auxiliaryWindow->setParent(parent); auxiliaryWindow->setFlags(flags); auxiliaryWindow->setModality(modality); if (modality != Qt::NonModal) { QGuiApplicationPrivate::showModalWindow(auxiliaryWindow); if (modality == Qt::ApplicationModal) { connect(qApp, &QGuiApplication::applicationStateChanged, this, &QDeepinFileDialogHelper::onApplicationStateChanged); connect(nativeDialog, &DFileDialogHandle::windowActiveChanged, this, &QDeepinFileDialogHelper::onWindowActiveChanged); } } } else { qtDialog->setAttribute(Qt::WA_NativeWindow); if (parent) { if (parent->inherits("QWidgetWindow")) { qtDialog->setParent(static_cast(parent)->widget()); } else { qtDialog->windowHandle()->setParent(parent); } } qtDialog->setWindowModality(modality); qtDialog->setWindowFlags(flags | qtDialog->windowFlags()); } DIALOG_CALL(show()); if (nativeDialog && parent) { // 如果能获取到wayland下的display 应该 XSetTransientForHint(wayland_dispaly // 此处暂时返回,至少不会导致崩溃。。。task-view-31919. if (qApp->platformName() != "dxcb" && !qApp->property("_d_isDxcb").toBool()) return true; XSetTransientForHint(QX11Info::display(), nativeDialog->winId(), parent->winId()); } return true; } void QDeepinFileDialogHelper::exec() { qDebug() << "exec"; ensureDialog(); if (nativeDialog) { // 快速打开关闭多次有一定概率出现没有调用 show 的情况,这里先 show // 保证exec一定会显示出现 DIALOG_CALL(show()); // block input to the window, allow input to other GTK dialogs QEventLoop loop; connect(this, SIGNAL(accept()), &loop, SLOT(quit())); connect(this, SIGNAL(reject()), &loop, SLOT(quit())); loop.exec(); } else { QWindow *modalWindow = qApp->modalWindow(); if (Q_LIKELY(modalWindow->inherits("QWidgetWindow") && qobject_cast(static_cast(modalWindow)->widget()))) { QGuiApplicationPrivate::hideModalWindow(modalWindow); } qtDialog->exec(); } } void QDeepinFileDialogHelper::hide() { qDebug() << "hide"; ensureDialog(); DIALOG_CALL(hide()); if (auxiliaryWindow) { QGuiApplicationPrivate::hideModalWindow(auxiliaryWindow); if (activeWindow) { activeWindow->requestActivate(); activeWindow.clear(); } } } bool QDeepinFileDialogHelper::defaultNameFilterDisables() const { qDebug() << __FUNCTION__; return true; } void QDeepinFileDialogHelper::setDirectory(const QUrl &directory) { if (QDeepinFileDialogHelper::directory() == directory) { return; } qDebug() << __FUNCTION__ << directory; ensureDialog(); DIALOG_CALL(setDirectoryUrl(directory.toString())); } QUrl QDeepinFileDialogHelper::directory() const { qDebug() << __FUNCTION__; ensureDialog(); if (nativeDialog) return QUrl(nativeDialog->directoryUrl()); return qtDialog->directoryUrl(); } void QDeepinFileDialogHelper::selectFile(const QUrl &fileUrl) { qDebug() << __FUNCTION__ << fileUrl; ensureDialog(); if (nativeDialog) nativeDialog->selectUrl(fileUrl.toString()); else qtDialog->selectUrl(fileUrl); } QList QDeepinFileDialogHelper::selectedFiles() const { qDebug() << __FUNCTION__; ensureDialog(); if (nativeDialog) return stringList2UrlList(nativeDialog->selectedUrls()); return qtDialog->selectedUrls(); } void QDeepinFileDialogHelper::setFilter() { qDebug() << __FUNCTION__; ensureDialog(); DIALOG_CALL(setFilter(options()->filter())); } void QDeepinFileDialogHelper::selectNameFilter(const QString &filter) { qDebug() << __FUNCTION__ << filter; ensureDialog(); DIALOG_CALL(selectNameFilter(filter)); } QString QDeepinFileDialogHelper::selectedNameFilter() const { qDebug() << __FUNCTION__; ensureDialog(); if (nativeDialog) return nativeDialog->selectedNameFilter(); return qtDialog->selectedNameFilter(); } void QDeepinFileDialogHelper::initDBusFileDialogManager() { if (manager) return; if (QDBusConnection::sessionBus().interface()->isServiceRegistered(DIALOG_SERVICE).value() || QFile::exists("/usr/bin/dde-desktop")) { manager = new DFileDialogManager(DIALOG_SERVICE, "/com/deepin/filemanager/filedialogmanager", QDBusConnection::sessionBus()); } } bool QDeepinFileDialogHelper::iAmFileDialogDBusServer() { static bool _value = manager->connection().interface()->servicePid(manager->service()) == static_cast(getpid()); return _value; } void QDeepinFileDialogHelper::ensureDialog() const { if (nativeDialog || qtDialog) return; if (manager) { QDBusPendingReply reply = manager->createDialog(QString()); reply.waitForFinished(); const QString &path = reply.value().path(); if (path.isEmpty()) { qWarning("Can not create native dialog, Will be use QFileDialog"); } else { nativeDialog = new DFileDialogHandle(DIALOG_SERVICE, path, QDBusConnection::sessionBus()); auxiliaryWindow = new QWindow(); auxiliaryWindow->setObjectName("QDeepinFileDialogHelper_auxiliaryWindow"); connect(nativeDialog, &QObject::destroyed, auxiliaryWindow, &QWindow::deleteLater); connect(nativeDialog, &QObject::destroyed, nativeDialog, &DFileDialogHandle::deleteLater); connect(nativeDialog, &DFileDialogHandle::accepted, this, &QDeepinFileDialogHelper::accept); connect(nativeDialog, &DFileDialogHandle::rejected, this, &QDeepinFileDialogHelper::reject); connect(nativeDialog, &DFileDialogHandle::destroyed, this, &QDeepinFileDialogHelper::reject); connect(nativeDialog, &DFileDialogHandle::destroyed, this, [this](){ qWarning("filedialog dbus service destroyed."); if (nativeDialog) { nativeDialog->QObject::deleteLater(); nativeDialog = nullptr; } if (auxiliaryWindow && auxiliaryWindow->isModal() && qApp->modalWindow() == auxiliaryWindow) QGuiApplicationPrivate::hideModalWindow(auxiliaryWindow); }); QTimer *heartbeatTimer = new QTimer(nativeDialog); connect(heartbeatTimer, &QTimer::timeout, this, [this, heartbeatTimer] { QDBusPendingReply<> reply = nativeDialog->makeHeartbeat(); reply.waitForFinished(); if (reply.isError()) { qWarning() << "Make heartbeat is failed:" << reply.error(); if (reply.error().type() == QDBusError::UnknownMethod) { qWarning() << "Make heartbeat is't support for current dbus file dialog, Will be stop heartbeat timer."; heartbeatTimer->stop(); return; } nativeDialog->QObject::deleteLater(); const_cast(this)->reject(); } }); int heartbeatInterval = nativeDialog->heartbeatInterval(); heartbeatTimer->setInterval(qMax(1 * 1000, qMin(int(heartbeatInterval / 1.5), heartbeatInterval - 5 * 1000))); heartbeatTimer->start(); } } if (!nativeDialog && qobject_cast(qGuiApp)) { QDeepinTheme::m_usePlatformNativeDialog = false; qtDialog = new QFileDialog(); QDeepinTheme::m_usePlatformNativeDialog = true; connect(qtDialog, &QFileDialog::accepted, this, &QDeepinFileDialogHelper::accept); connect(qtDialog, &QFileDialog::rejected, this, &QDeepinFileDialogHelper::reject); } } void QDeepinFileDialogHelper::applyOptions() { QFileDialogOptions *options = this->options().data(); for (int i = 0; i < QFileDialogOptions::DialogLabelCount; ++i) { if (options->isLabelExplicitlySet((QFileDialogOptions::DialogLabel)i)) { if (nativeDialog) nativeDialog->setLabelText(i, options->labelText((QFileDialogOptions::DialogLabel)i)); else qtDialog->setLabelText((QFileDialog::DialogLabel)i, options->labelText((QFileDialogOptions::DialogLabel)i)); } } DIALOG_CALL(setOptions((QFileDialog::Options)(int)options->options())); DIALOG_CALL(setFilter(options->filter())); DIALOG_CALL(setWindowTitle(options->windowTitle())); DIALOG_CALL(setViewMode((QFileDialog::ViewMode)options->viewMode())); DIALOG_CALL(setFileMode((QFileDialog::FileMode)options->fileMode())); DIALOG_CALL(setAcceptMode((QFileDialog::AcceptMode)options->acceptMode())); DIALOG_CALL(setNameFilters(options->nameFilters())); if (options->initialDirectory().isLocalFile()) setDirectory(options->initialDirectory()); foreach (const QUrl &filename, options->initiallySelectedFiles()) selectFile(filename); selectNameFilter(options->initiallySelectedNameFilter()); if (!sourceDialog) { sourceDialog = reinterpret_cast(qvariant_cast(property("_dtk_widget_QFileDialog"))); if (sourceDialog && nativeDialog) { const QStringList lineedit_list = sourceDialog->property("_dtk_widget_custom_lineedit_list").toStringList(); const QStringList combobox_list = sourceDialog->property("_dtk_widget_custom_combobox_list").toStringList(); nativeDialog->beginAddCustomWidget(); for (const QString &i : lineedit_list) nativeDialog->addCustomWidget(LineEditType, i); for (const QString &i : combobox_list) nativeDialog->addCustomWidget(ComboBoxType, i); nativeDialog->endAddCustomWidget(); const QVariant & mixedSelection = sourceDialog->property("_dtk_widget_filedialog_mixed_selection"); if (mixedSelection.isValid()) { nativeDialog->setAllowMixedSelection(mixedSelection.toBool()); } } } } QT_END_NAMESPACE qt5integration-5.5.23/platformthemeplugin/qdeepinfiledialoghelper.h000066400000000000000000000047751424734202100257030ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #ifndef QDEEPINFILEDIALOGHELPER_H #define QDEEPINFILEDIALOGHELPER_H #include #include QT_BEGIN_NAMESPACE class QFileDialog; class ComDeepinFilemanagerFiledialogInterface; typedef ComDeepinFilemanagerFiledialogInterface DFileDialogHandle; class ComDeepinFilemanagerFiledialogmanagerInterface; typedef ComDeepinFilemanagerFiledialogmanagerInterface DFileDialogManager; class QDeepinFileDialogHelper : public QPlatformFileDialogHelper { public: enum CustomWidgetType { LineEditType = 0, ComboBoxType = 1 }; QDeepinFileDialogHelper(); ~QDeepinFileDialogHelper(); bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) Q_DECL_OVERRIDE; void exec() Q_DECL_OVERRIDE; void hide() Q_DECL_OVERRIDE; bool defaultNameFilterDisables() const Q_DECL_OVERRIDE; void setDirectory(const QUrl &directory) Q_DECL_OVERRIDE; QUrl directory() const Q_DECL_OVERRIDE; void selectFile(const QUrl &filename) Q_DECL_OVERRIDE; QList selectedFiles() const Q_DECL_OVERRIDE; void setFilter() Q_DECL_OVERRIDE; void selectNameFilter(const QString &filter) Q_DECL_OVERRIDE; QString selectedNameFilter() const Q_DECL_OVERRIDE; static void initDBusFileDialogManager(); static bool iAmFileDialogDBusServer(); protected: void onApplicationStateChanged(Qt::ApplicationState state); void onWindowActiveChanged(); private: mutable QPointer nativeDialog; mutable QPointer auxiliaryWindow; mutable QPointer qtDialog; QPointer activeWindow; QPointer sourceDialog; static DFileDialogManager *manager; void ensureDialog() const; void applyOptions(); friend class QDeepinTheme; }; QT_END_NAMESPACE #endif // QDEEPINFILEDIALOGHELPER_H qt5integration-5.5.23/platformthemeplugin/qdeepintheme.cpp000066400000000000000000000616541424734202100240400ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "qdeepintheme.h" #include "qdeepinfiledialoghelper.h" #include "diconproxyengine.h" #include "filedialogmanager_interface.h" #include "dthemesettings.h" #include #include #include #include #include #include #include #define private public #include #undef private #include #include #include #include #include #undef signals #include DGUI_USE_NAMESPACE #if XDG_ICON_VERSION_MAR >= 3 namespace DEEPIN_QT_THEME { QThreadStorage colorScheme; void(*setFollowColorScheme)(bool); bool(*followColorScheme)(); } #endif #define DISABLE_UPDATE_WINDOW_GEOMETRY "D_DISABLE_UPDATE_WINDOW_GEOMETRY_FOR_SCALE" #define DNOT_UPDATE_WINDOW_GEOMETRY "_d_disable_update_geometry_for_scale" #define HOOK_UPDATE_WINDOW_GEOMETRY_OBJECT "_d_hookUpdateGeometryForScaleObject" #define UPDATE_WINDOW_GEOMETRY_ENTRY "_d_updateGeometryForScaleEntry" #define UPDATE_WINDOW_GEOMETRY_GEOMETRY "_d_updateGeometryForScaleGeometry" #define UPDATE_WINDOW_GEOMETRY_EXIT "_d_updateGeometryForScaleExit" QT_BEGIN_NAMESPACE const char *QDeepinTheme::name = "deepin"; bool QDeepinTheme::m_usePlatformNativeDialog = true; QMimeDatabase QDeepinTheme::m_mimeDatabase; DThemeSettings *QDeepinTheme::m_settings = 0; extern void updateXdgIconSystemTheme(); static void onIconThemeSetCallback() { QIconLoader::instance()->updateSystemTheme(); updateXdgIconSystemTheme(); if (qApp->inherits("Dtk::Widget::DApplication")) { // emit the signal: DApplication::iconThemeChanged qApp->metaObject()->invokeMethod(qApp, QT_STRINGIFY(iconThemeChanged)); } // 通知所有窗口重绘制 QEvent update(QEvent::UpdateRequest); for (QWindow *window : qGuiApp->allWindows()) { if (window->type() == Qt::Desktop) continue; qApp->sendEvent(window, &update); } } static void onFontChanged() { // 先清理旧的font对象 if (QGuiApplicationPrivate::app_font) delete QGuiApplicationPrivate::app_font; QGuiApplicationPrivate::app_font = nullptr; QEvent event(QEvent::ApplicationFontChange); qApp->sendEvent(qApp, &event); // 通知所有窗口字体改变了 for (QWindow *window : qGuiApp->allWindows()) { if (window->type() == Qt::Desktop) continue; qApp->sendEvent(window, &event); } qApp->sendEvent(DGuiApplicationHelper::instance(), &event); Q_EMIT qGuiApp->fontChanged(qGuiApp->font()); } static void updateWindowGeometry(QWindow *w) { if (w->type() == Qt::ForeignWindow || w->type() == Qt::Desktop) { return; } if (!w->handle() || !w->isTopLevel()) return; if (w->property(DNOT_UPDATE_WINDOW_GEOMETRY).toBool()) { QWindowSystemInterfacePrivate::GeometryChangeEvent gce(w, QHighDpi::fromNativePixels(w->handle()->geometry(), w) #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) , QRect() #endif ); QGuiApplicationPrivate::processGeometryChangeEvent(&gce); } else {// 通知窗口大小发送改变 const QRect currentGeo = QWindowPrivate::get(w)->geometry; if (!currentGeo.isValid()) return; // 对外提供能hook自动更新窗口大小的方法 QObject *hook_obj = qvariant_cast(w->property(HOOK_UPDATE_WINDOW_GEOMETRY_OBJECT)); if (!hook_obj) { hook_obj = w; } bool accept = true; // 通知窗口即将开始更新其geometry if (hook_obj->metaObject()->indexOfMethod(UPDATE_WINDOW_GEOMETRY_ENTRY "()") >= 0) { QMetaObject::invokeMethod(hook_obj, UPDATE_WINDOW_GEOMETRY_ENTRY, Qt::DirectConnection, Q_RETURN_ARG(bool, accept)); } if (!accept) { // 中断操作 return; } QRect nativeGeo; // 尝试从窗口对象获取新的geometry if (hook_obj->metaObject()->indexOfMethod(UPDATE_WINDOW_GEOMETRY_GEOMETRY "()") >= 0) { QMetaObject::invokeMethod(hook_obj, UPDATE_WINDOW_GEOMETRY_GEOMETRY, Qt::DirectConnection, Q_RETURN_ARG(QRect, nativeGeo)); } if (!nativeGeo.isValid()) { nativeGeo = w->handle()->geometry(); qreal scale = QHighDpiScaling::factor(w); const QPoint &cursor_pos = w->screen()->handle()->cursor()->pos(); // 如果窗口是active的,且鼠标处于窗口内,应当移动窗口位置以保持鼠标相对窗口的位置 if (w->isActive()) { const QMargins &frame_margins = w->handle()->frameMargins(); const QRect &frame_rect = nativeGeo.marginsAdded(frame_margins); if (frame_rect.contains(cursor_pos)) { nativeGeo.moveTopLeft(cursor_pos + (nativeGeo.topLeft() - cursor_pos) * currentGeo.width() * scale / nativeGeo.width()); } } nativeGeo.setSize(currentGeo.size() * scale); } bool positionAutomaticSave = QWindowPrivate::get(w)->positionAutomatic; QWindowPrivate::get(w)->positionAutomatic = false; w->handle()->setGeometry(nativeGeo); QWindowPrivate::get(w)->positionAutomatic = positionAutomaticSave; // 请求重绘 QGuiApplication::sendEvent(w, new QEvent(QEvent::UpdateRequest)); // 通知窗口geometry更新结束 if (hook_obj->metaObject()->indexOfMethod(UPDATE_WINDOW_GEOMETRY_EXIT "()") >= 0) { QMetaObject::invokeMethod(hook_obj, UPDATE_WINDOW_GEOMETRY_EXIT); } } } static void updateAllWindowGeometry() { for (QWindow *w : qGuiApp->allWindows()) { updateWindowGeometry(w); } } // 延迟一段时间更新窗口geometry,防止屏幕缩放比在短时间内连续变化时导致窗口闪动 static void updateAllWindowGeometryDelay(int interval = 500) { static QTimer *t = new QTimer(); t->setSingleShot(true); t->setInterval(interval); t->connect(t, &QTimer::timeout, t, updateAllWindowGeometry, Qt::UniqueConnection); t->start(); } static void notifyScreenScaleUpdated() { for (QScreen *s : qGuiApp->screens()) { Q_EMIT s->geometryChanged(s->geometry()); // 发射信号通知屏幕缩放比发生变化,DApplication中会定义此信号 if (qGuiApp->metaObject()->indexOfSignal("screenDevicePixelRatioChanged(QScreen*)")) { qGuiApp->metaObject()->invokeMethod(qGuiApp, "screenDevicePixelRatioChanged", Q_ARG(QScreen*, s)); } } } static bool updateScaleFactor(qreal value) { if (qIsNull(value)) { value = 1.0; } if (qFuzzyCompare(QHighDpiScaling::m_factor, value)) { return false; } QHighDpiScaling::setGlobalFactor(value); return true; } static void onScaleFactorChanged(qreal value) { if (updateScaleFactor(value)) { notifyScreenScaleUpdated(); updateAllWindowGeometryDelay(); } } // 用于窗口屏幕改变时更新窗口大小 class AutoScaleWindowObject : public QObject { Q_OBJECT public: explicit AutoScaleWindowObject(QObject *parent = nullptr) : QObject(parent) { qGuiApp->installEventFilter(this); } void onScreenChanged(QScreen *s) { Q_UNUSED(s); if (QWindow *w = qobject_cast(sender())) { updateWindowGeometry(w); } } private: bool eventFilter(QObject *watched, QEvent *event) override { if (event->type() != QEvent::PlatformSurface) return false; if (QWindow *w = qobject_cast(watched)) { QPlatformSurfaceEvent *se = static_cast(event); if (se->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) { // 监听窗口屏幕变化信号,自动根据新的屏幕缩放比更新窗口大小 connect(w, &QWindow::screenChanged, this, &AutoScaleWindowObject::onScreenChanged, Qt::DirectConnection); } else { disconnect(w, &QWindow::screenChanged, this, &AutoScaleWindowObject::onScreenChanged); } } return false; } }; // 判断ScreenScaleFactor的值是否应该应用于所有屏幕 static bool isGenericScreenScaleFactors(const QByteArray &value) { for (char ch : value) { if (ch == '=' || ch == ';') return false; } return true; } static void onAutoScaleWindowChanged() { bool on = QDeepinTheme::getSettings()->autoScaleWindow(); if (on) { const QByteArray &multi_scale = QDeepinTheme::getSettings()->screenScaleFactors(); // 只在针对多个屏幕分别设置了缩放比时开启此功能 if (isGenericScreenScaleFactors(multi_scale)) { on = false; } } static AutoScaleWindowObject *event_fileter = nullptr; if (on) { if (event_fileter) return; event_fileter = new AutoScaleWindowObject(qGuiApp); } else { if (!event_fileter) return; event_fileter->deleteLater(); event_fileter = nullptr; } } // 使用 QT_SCREEN_SCALE_FACTORS 为每个屏幕设置不同的缩放比之后,Qt会自动将 dpi 除以主屏的 // 缩放倍数,以此来避免字体被放大。font dpi会影响未设置pixel size的QFont,默认情况下, // QGuiApplication::font() 不会设置pixel size,因此,使用分屏幕设置不同缩放比后,字体却还 // 是缩放前的大小。 // 此处,如果设置了 ScreenScaleFactors,但未指定 ScaleLogcailDpi 时,默认将其重设回主屏 // 的 logicalDpi。 static bool updateScaleLogcailDpi(const QPair &dpi) { bool ok = dpi.first >= 0 && dpi.second >= 0; #if QT_VERSION < QT_VERSION_CHECK(5,14,0) if (dpi.first > 0) { QHighDpiScaling::m_logicalDpi.first = dpi.first; } else if (qIsNull(dpi.first)) { QHighDpiScaling::m_logicalDpi.first = qGuiApp->primaryScreen()->handle()->logicalDpi().first; } if (dpi.second > 0) { QHighDpiScaling::m_logicalDpi.second = dpi.second; } else if (qIsNull(dpi.second)) { QHighDpiScaling::m_logicalDpi.second = qGuiApp->primaryScreen()->handle()->logicalDpi().second; } #else QHighDpiScaling::m_usePixelDensity = false; #endif return ok; } static QByteArray getEnvValueByScreenScaleFactors(const QByteArray &data) { QByteArray envValue; if (!isGenericScreenScaleFactors(data)) { envValue = data; } else if (!data.isEmpty()) { // 这种情况下,在Qt的实现中,只会将值应用给第一个屏幕,因此此处需要给所有屏幕都设置通用的值 int screen_count = qApp->screens().count(); // 为除了最后一个屏幕的其它屏幕添加缩放比 while (--screen_count) { envValue.append(data).append(';'); } // 为最后一个屏幕添加缩放比 envValue.append(data); } return envValue; } static bool updateScreenScaleFactors(DThemeSettings *s, const QByteArray &value, bool unsetenv = false) { const QByteArray &envValue = getEnvValueByScreenScaleFactors(value); if (qgetenv("QT_SCREEN_SCALE_FACTORS") == envValue) return false; if (envValue.isEmpty()) { if (!unsetenv) return false; qunsetenv("QT_SCREEN_SCALE_FACTORS"); } else { qputenv("QT_SCREEN_SCALE_FACTORS", envValue); } QHighDpiScaling::updateHighDpiScaling(); #if QT_VERSION < QT_VERSION_CHECK(5,14,0) qDebug() << QHighDpiScaling::logicalDpi(); #else qDebug() << QHighDpiScaling::logicalDpi(QGuiApplication::primaryScreen()); #endif updateScaleLogcailDpi(s->scaleLogicalDpi()); #if QT_VERSION < QT_VERSION_CHECK(5,14,0) qDebug() << QHighDpiScaling::logicalDpi(); #else qDebug() << QHighDpiScaling::logicalDpi(QGuiApplication::primaryScreen()); #endif return true; } static void onScreenScaleFactorsChanged(const QByteArray &value) { if (updateScreenScaleFactors(QDeepinTheme::getSettings(), value, true)) { notifyScreenScaleUpdated(); updateAllWindowGeometryDelay(); } } static bool enabledRTScreenScale() { // 应用中设置了和屏幕缩放相关的环境变量或启动相关属性后后不开启自动缩放功能 static bool enable = !qEnvironmentVariableIsSet("D_DISABLE_RT_SCREEN_SCALE") && !qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO") && !qEnvironmentVariableIsSet("QT_SCALE_FACTOR") && !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR") && !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS") && !QCoreApplication::testAttribute(Qt::AA_DisableHighDpiScaling) && !QCoreApplication::testAttribute(Qt::AA_EnableHighDpiScaling) && qGuiApp->platformName().endsWith("xcb"); return enable; } QDeepinTheme::QDeepinTheme() { #if XDG_ICON_VERSION_MAR >= 3 // 注意!!!, 此处还没有开始启动事件循环, 很多Qt类无法使用, 例如QTimer DEEPIN_QT_THEME::setFollowColorScheme = XdgIcon::setFollowColorScheme; DEEPIN_QT_THEME::followColorScheme = XdgIcon::followColorScheme; #endif if (enabledRTScreenScale()) { QScopedPointer setting(new DThemeSettings(false)); // 程序启动时初始设置屏幕缩放比 updateScaleFactor(setting->scaleFactor()); if (!updateScreenScaleFactors(setting.data(), setting->screenScaleFactors())) { updateScaleLogcailDpi(setting->scaleLogicalDpi()); } } } QDeepinTheme::~QDeepinTheme() { if (QDeepinFileDialogHelper::manager) { QDeepinFileDialogHelper::manager->deleteLater(); QDeepinFileDialogHelper::manager = Q_NULLPTR; } } bool QDeepinTheme::usePlatformNativeDialog(DialogType type) const { if (type == FileDialog) { if (qgetenv("_d_disableDBusFileDialog") == "true") return false; static bool dbusDialogManagerInitialized = false; if (!dbusDialogManagerInitialized) { dbusDialogManagerInitialized = true; QDeepinFileDialogHelper::initDBusFileDialogManager(); } return m_usePlatformNativeDialog && QDeepinFileDialogHelper::manager && QDeepinFileDialogHelper::manager->isUseFileChooserDialog(); } return QGenericUnixTheme::usePlatformNativeDialog(type); } QPlatformDialogHelper *QDeepinTheme::createPlatformDialogHelper(DialogType type) const { if (type == FileDialog && usePlatformNativeDialog(type)) return new QDeepinFileDialogHelper(); return QGenericUnixTheme::createPlatformDialogHelper(type); } static QIconEnginePlugin *getIconEngineFactory(const QString &key) { static QFactoryLoader loader(QIconEngineFactoryInterface_iid, QLatin1String("/iconengines"), Qt::CaseSensitive); int index = loader.indexOf(key); if (index != -1) { return qobject_cast(loader.instance(index)); } return nullptr; } static QIconEngine *createBuiltinIconEngine(const QString &iconName) { static QIconEnginePlugin *plugin = getIconEngineFactory(QStringLiteral("DBuiltinIconEngine")); return plugin ? plugin->create(iconName) : nullptr; } static QIconEngine *createXdgProxyIconEngine(const QString &iconName) { static QIconEnginePlugin *plugin = getIconEngineFactory(QStringLiteral("XdgIconProxyEngine")); return plugin ? plugin->create(iconName) : nullptr; } QIconEngine *QDeepinTheme::createIconEngine(const QString &iconName) const { #ifdef DTHEMED_ICON_LOOKUP if (iconName.contains("/")) // handle Qt-standard paths. return QGenericUnixTheme::createIconEngine(iconName); else return new DIconEngine(iconName); #elif XDG_ICON_VERSION_MAR < 3 return XdgIconEngineCreator::create(iconName); #else static QSet non_builtin_icon_cache; if (!non_builtin_icon_cache.contains(iconName)) { // 记录下来此种类型的icon为内置图标 // 因此,此处添加的缓存不考虑更新 // 优先使用内置图标 if (QIconEngine *engine = createBuiltinIconEngine(iconName)) { if (engine->isNull()) { non_builtin_icon_cache.insert(iconName); delete engine; } else { return engine; } } else { non_builtin_icon_cache.insert(iconName); } } return createXdgProxyIconEngine(iconName); #endif } QPixmap QDeepinTheme::standardPixmap(QPlatformTheme::StandardPixmap sp, const QSizeF &size) const { return QGenericUnixTheme::standardPixmap(sp, size); } #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) QIcon QDeepinTheme::fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions) const { Q_UNUSED(iconOptions); return XdgIcon::fromTheme(m_mimeDatabase.mimeTypeForFile(fileInfo).iconName()); } #else QPixmap QDeepinTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size, QPlatformTheme::IconOptions iconOptions) const { Q_UNUSED(iconOptions); return XdgIcon::fromTheme(m_mimeDatabase.mimeTypeForFile(fileInfo).iconName()).pixmap(size.toSize()); } #endif static DPlatformTheme *appTheme() { static QPointer theme; if (!theme) { theme = DGuiApplicationHelper::instance()->applicationTheme(); QObject::connect(theme, &DPlatformTheme::iconThemeNameChanged, &onIconThemeSetCallback); QObject::connect(theme, &DPlatformTheme::fontNameChanged, &onFontChanged); QObject::connect(theme, &DPlatformTheme::fontPointSizeChanged, [] { if (theme->fontName().isEmpty()) return; onFontChanged(); }); QObject::connect(theme, &DPlatformTheme::gtkFontNameChanged, [] { if (theme->fontName().isEmpty()) { onFontChanged(); } }); } return theme; } QVariant QDeepinTheme::themeHint(QPlatformTheme::ThemeHint hint) const { switch (hint) { case QPlatformTheme::StyleNames: { return QStringList({"chameleon", "fusion"}); } case QPlatformTheme::SystemIconThemeName: return appTheme()->iconThemeName(); case QPlatformTheme::SystemIconFallbackThemeName: return "bloom"; case QPlatformTheme::IconThemeSearchPaths: return QVariant(QGenericUnixTheme::xdgIconThemePaths() << QDir::homePath() + "/.local/share/icons"); case UseFullScreenForPopupMenu: return true; case ShowShortcutsInContextMenus: return false; default: break; } return QGenericUnixTheme::themeHint(hint); } const QPalette *QDeepinTheme::palette(QPlatformTheme::Palette type) const { if (type != SystemPalette) { return QGenericUnixTheme::palette(type); } static QPalette palette; palette = DGuiApplicationHelper::instance()->applicationPalette(); return &palette; } const QFont *QDeepinTheme::font(QPlatformTheme::Font type) const { if (!qApp->desktopSettingsAware()) return QGenericUnixTheme::font(type); switch (type) { case SystemFont: if (DPlatformTheme *theme = appTheme()) { QByteArray font_name = theme->fontName(); qreal font_size = 0; if (font_name.isEmpty()) { font_name = theme->gtkFontName(); int font_size_index = font_name.lastIndexOf(' '); if (font_size_index <= 0) break; font_size = font_name.mid(font_size_index + 1).toDouble(); font_name = font_name.left(font_size_index); } else { font_size = theme->fontPointSize(); } if (font_size <= 0) { font_size = 10.5; } static QFont font = QFont(QString()); font.setFamily(font_name); font.setPointSizeF(font_size); return &font; } break; case FixedFont: { if (DPlatformTheme *theme = appTheme()) { QByteArray font_name = theme->monoFontName(); if (font_name.isEmpty()) { break; } qreal font_size = theme->fontPointSize(); if (font_size <= 0) { font_size = 10.5; } static QFont font = QFont(QString()); font.setFamily(font_name); font.setPointSizeF(font_size); return &font; } break; } default: break; } return QGenericUnixTheme::font(type); } static void compelledUpdateScaleLogcailDpi() { updateScaleLogcailDpi(QDeepinTheme::getSettings()->scaleLogicalDpi()); } static void onScreenAdded(QScreen *s) { if (QHighDpiScaling::m_screenFactorSet) { auto setting = QDeepinTheme::getSettings(); auto value = setting->screenScaleFactors(); if (!value.isEmpty() && isGenericScreenScaleFactors(value)) { const QByteArray &envValue = getEnvValueByScreenScaleFactors(value); qputenv("QT_SCREEN_SCALE_FACTORS", envValue); bool ok = false; qreal scale = value.toDouble(&ok); // 为新的屏幕设置缩放比 if (ok) QHighDpiScaling::setScreenFactor(s, scale); } } compelledUpdateScaleLogcailDpi(); } DThemeSettings *QDeepinTheme::settings() const { if (!m_settings) { m_settings = new DThemeSettings(); qApp->setProperty("_d_theme_settings_object", (quintptr)m_settings); if (enabledRTScreenScale()) { #ifdef QT_NO_DEBUG if (!qEnvironmentVariableIsSet("D_ENABLE_RT_SCALE")) return m_settings; #endif QObject::connect(m_settings, &DThemeSettings::scaleFactorChanged, m_settings, onScaleFactorChanged, Qt::UniqueConnection); QObject::connect(m_settings, &DThemeSettings::screenScaleFactorsChanged, m_settings, onScreenScaleFactorsChanged, Qt::UniqueConnection); QObject::connect(m_settings, &DThemeSettings::scaleLogicalDpiChanged, m_settings, updateScaleLogcailDpi, Qt::UniqueConnection); // 当屏幕connected时,Qt库中会更新缩放值,导致dpi的设置被覆盖,此处应该再重新设置dpi值。 // TODO(zccrs): 当最后一个屏幕disconnectd时,Qt不会移除它,在这种状态下,插入一个新的 // 屏幕时,Qt只会更新遗留的screen对象的信息,因此不会有screenAdded信号, // 而且同样会更新dpi的值,因为目前无法通过Qt api检测到此状态,所以这种情 // 况下无法自动更新dpi值,将导致应用字体显示大小不受缩放比控制。 // !!! // 针对 dtk 应用,将在dxcb插件中通知应用更新dpi值。 qApp->setProperty("_d_updateScaleLogcailDpi", (quintptr)&compelledUpdateScaleLogcailDpi); QObject::connect(qApp, &QGuiApplication::screenAdded, m_settings, onScreenAdded, Qt::ConnectionType(Qt::QueuedConnection | Qt::UniqueConnection)); if (!qEnvironmentVariableIsSet(DISABLE_UPDATE_WINDOW_GEOMETRY)) { QObject::connect(m_settings, &DThemeSettings::autoScaleWindowChanged, m_settings, onAutoScaleWindowChanged, Qt::UniqueConnection); QObject::connect(m_settings, &DThemeSettings::screenScaleFactorsChanged, m_settings, onAutoScaleWindowChanged, Qt::UniqueConnection); onAutoScaleWindowChanged(); } } } return m_settings; } DThemeSettings *QDeepinTheme::getSettings() { return m_settings; } QT_END_NAMESPACE #include "qdeepintheme.moc" qt5integration-5.5.23/platformthemeplugin/qdeepintheme.h000066400000000000000000000042741424734202100235000ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #ifndef QDEEPINTHEME_H #define QDEEPINTHEME_H #include #include #include #include class DThemeSettings; class QDeepinTheme : public QGenericUnixTheme { public: QDeepinTheme(); ~QDeepinTheme(); bool usePlatformNativeDialog(DialogType type) const Q_DECL_OVERRIDE; QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const Q_DECL_OVERRIDE; QIconEngine *createIconEngine(const QString &iconName) const Q_DECL_OVERRIDE; QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const Q_DECL_OVERRIDE; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions = 0) const Q_DECL_OVERRIDE; #else QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size, QPlatformTheme::IconOptions iconOptions = 0) const Q_DECL_OVERRIDE; #endif QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE; const QPalette *palette(Palette type) const override; const QFont *font(Font type) const Q_DECL_OVERRIDE; DThemeSettings *settings() const; static DThemeSettings *getSettings(); static const char *name; private: static bool m_usePlatformNativeDialog; static QMimeDatabase m_mimeDatabase; static DThemeSettings *m_settings; friend class QDeepinFileDialogHelper; friend class QDeepinPlatformMenu; }; #endif // QDEEPINTHEME_H qt5integration-5.5.23/platformthemeplugin/qt5deepintheme-plugin.pro000066400000000000000000000050731424734202100256140ustar00rootroot00000000000000# load(configure) will clear DTK_VERSION isEmpty(DTK_VERSION) { include(../.qmake.conf) } QT += dbus x11extras dtkgui$${DTK_VERSION} QT += core-private gui-private greaterThan(QT_MAJOR_VERSION, 4) { QT += widgets widgets-private # Qt >= 5.8 greaterThan(QT_MAJOR_VERSION, 5)|greaterThan(QT_MINOR_VERSION, 7): QT += theme_support-private else: QT += platformsupport-private } TARGET = qdeepin$${DTK_VERSION} TEMPLATE = lib CONFIG += plugin link_pkgconfig c++11 # Test using dthemed_icon_lookup load(configure) qtCompileTest(dthemed_icon_lookup) { DEFINES += DTHEMED_ICON_LOOKUP PKGCONFIG += dtkwidget$${DTK_VERSION} til SOURCES += diconengine.cpp HEADERS += diconengine.h } PKGCONFIG += mtdev Qt5Xdg x11 PKG_CONFIG = $$pkgConfigExecutable() XDG_ICON_VERSION = $$system($$PKG_CONFIG --modversion Qt5XdgIconLoader) XDG_ICON_VERSION_LIST = $$split(XDG_ICON_VERSION, .) INCLUDEPATH += $$system($$PKG_CONFIG --variable includedir Qt5XdgIconLoader)/qt5xdgiconloader/$$XDG_ICON_VERSION DEFINES += "XDG_ICON_VERSION_MAR=$$first(XDG_ICON_VERSION_LIST)" PLUGIN_TYPE = platformthemes PLUGIN_EXTENDS = - PLUGIN_CLASS_NAME = QDeepinTheme DESTDIR = $$_PRO_FILE_PWD_/../bin/plugins/platformthemes/$${BASED_DTK_DIR} SOURCES += qdeepintheme.cpp \ main.cpp \ qdeepinfiledialoghelper.cpp \ diconproxyengine.cpp \ dthemesettings.cpp \ xdgiconenginecreator.cpp HEADERS += qdeepintheme.h \ qdeepinfiledialoghelper.h \ diconproxyengine.h \ dthemesettings.h \ xdgiconenginecreator.h DISTFILES += \ deepin.json unix { target.path = $$[QT_INSTALL_PLUGINS]/platformthemes/$${BASED_DTK_DIR} INSTALLS += target } CONFIG(release, debug|release) { DEFINES += QT_NO_DEBUG_OUTPUT } #dbus_interface_filedialogmanager = /usr/share/dbus-1/interfaces/com.deepin.filemanager.filedialogmanager.xml #dbus_interface_filedialog = /usr/share/dbus-1/interfaces/com.deepin.filemanager.filedialog.xml #!exists($$dbus_interface_filedialogmanager) { # warning(Not found $$dbus_interface_filedialogmanager) dbus_interface_filedialogmanager = $$PWD/xmls/com.deepin.filemanager.filedialogmanager.xml #} #message(Will be use $$dbus_interface_filedialogmanager) #!exists($$dbus_interface_filedialog) { # warning(Not found $$dbus_interface_filedialog) dbus_interface_filedialog = $$PWD/xmls/com.deepin.filemanager.filedialog.xml #} #message(Will be use $$dbus_interface_filedialog) DBUS_INTERFACES += $$dbus_interface_filedialogmanager $$dbus_interface_filedialog RESOURCES += \ icons/deepin-theme-plugin-icons.qrc \ deepin-theme-plugin.qrc qt5integration-5.5.23/platformthemeplugin/qtquickcontrols2.conf000066400000000000000000000000321424734202100250410ustar00rootroot00000000000000[Controls] Style=Chameleonqt5integration-5.5.23/platformthemeplugin/xdgiconenginecreator.cpp000066400000000000000000000017251424734202100255620ustar00rootroot00000000000000/* * 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include "xdgiconenginecreator.h" #include QIconEngine * XdgIconEngineCreator::create(const QString &name) { return new XdgIconLoaderEngine(name); } qt5integration-5.5.23/platformthemeplugin/xdgiconenginecreator.h000066400000000000000000000017461424734202100252320ustar00rootroot00000000000000/* * 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 XDGICONENGINECREATOR_H #define XDGICONENGINECREATOR_H #include class XdgIconEngineCreator { public: static QIconEngine *create(const QString &name); }; #endif // XDGICONENGINECREATOR_H qt5integration-5.5.23/platformthemeplugin/xmls/000077500000000000000000000000001424734202100216335ustar00rootroot00000000000000qt5integration-5.5.23/platformthemeplugin/xmls/com.deepin.filemanager.filedialog.xml000066400000000000000000000115671424734202100307570ustar00rootroot00000000000000 qt5integration-5.5.23/platformthemeplugin/xmls/com.deepin.filemanager.filedialogmanager.xml000066400000000000000000000014341424734202100323020ustar00rootroot00000000000000 qt5integration-5.5.23/qt5integration.pro000066400000000000000000000004471424734202100202660ustar00rootroot00000000000000TEMPLATE = subdirs SUBDIRS += \ src \ styleplugins\ platformthemeplugin/qt5deepintheme-plugin.pro \ iconengineplugins/iconengines.pro \ imageformatplugins/imageformats.pro \ tests CONFIG(debug, debug|release) { SUBDIRS += styles styles.depends += styleplugins } qt5integration-5.5.23/rpm/000077500000000000000000000000001424734202100153605ustar00rootroot00000000000000qt5integration-5.5.23/rpm/deepin-qt5integration.spec000066400000000000000000000046231424734202100224600ustar00rootroot00000000000000%global repo qt5integration Name: deepin-qt5integration Version: 5.1.5 Release: 1%{?dist} Summary: Qt platform theme integration plugins for DDE # The entire source code is GPLv3+ except styles/ which is BSD, # styleplugins/dstyleplugin/dstyleanimation* which is LGPL License: GPLv3+ and BSD and LGPLv2+ URL: https://github.com/linuxdeepin/qt5integration Source0: %{url}/archive/%{version}/%{repo}-%{version}.tar.gz BuildRequires: gcc-c++ BuildRequires: pkgconfig(atk) BuildRequires: pkgconfig(dtkcore) BuildRequires: pkgconfig(dtkwidget) >= 2.0.6 BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(gtk+-2.0) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gdk-pixbuf-2.0) BuildRequires: pkgconfig(ice) BuildRequires: pkgconfig(libinput) BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(pango) BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5OpenGL) BuildRequires: pkgconfig(Qt5Svg) BuildRequires: pkgconfig(Qt5Xdg) >= 3.0.0 BuildRequires: pkgconfig(Qt5X11Extras) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(xrender) BuildRequires: pkgconfig(xcb) BuildRequires: pkgconfig(mtdev) BuildRequires: pkgconfig(Qt5Multimedia) BuildRequires: pkgconfig(Qt5MultimediaWidgets) BuildRequires: qt5-qtbase-common # for libQt5ThemeSupport.a BuildRequires: qt5-qtbase-static BuildRequires: qt5-qtbase-private-devel BuildRequires: make %{?_qt5:Requires: %{_qt5}%{?_isa} = %{_qt5_version}} Requires: deepin-qt5dxcb-plugin%{?_isa} %description Multiple Qt plugins to provide better Qt5 integration for DDE is included. %prep %autosetup -p1 -n %{repo}-%{version} %build %qmake_qt5 PREFIX=%{_prefix} BASED_DTK_DIR=based-dtk %make_build %install %make_install INSTALL_ROOT=%{buildroot} %files %doc README.md %license LICENSE # chooser %{_qt5_plugindir}/platformthemes/libqdeepin.so %{_qt5_plugindir}/iconengines/libdsvgicon.so %{_qt5_plugindir}/imageformats/libdsvg.so %{_qt5_plugindir}/iconengines/libdtkbuiltin.so %{_qt5_plugindir}/styles/libchameleon.so # target %{_qt5_plugindir}/platformthemes/based-dtk/libqdeepin.so %{_qt5_plugindir}/iconengines/based-dtk/libdsvgicon.so %{_qt5_plugindir}/imageformats/based-dtk/libdsvg.so %{_qt5_plugindir}/iconengines/based-dtk/libdtkbuiltin.so %{_qt5_plugindir}/styles/based-dtk/libchameleon.so %changelog qt5integration-5.5.23/src/000077500000000000000000000000001424734202100153515ustar00rootroot00000000000000qt5integration-5.5.23/src/chooser.prf000066400000000000000000000005761424734202100175340ustar00rootroot00000000000000TEMPLATE = lib CONFIG += plugin DEFINES += TARGET=\\\"$${TEMPLATE}$${TARGET}\\\" BASED_DTK_DIR=\\\"$${BASED_DTK_DIR}\\\" INCLUDEPATH += $$PWD HEADERS += $$PWD/dpluginloader.h SOURCES += main.cpp DISTFILES += $${JSON_FILE} DESTDIR = $$_PRO_FILE_PWD_/../../../bin/plugins/$${PLUGIN_TYPE}/ unix { target.path = $$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}/ INSTALLS += target } qt5integration-5.5.23/src/dpluginloader.h000066400000000000000000000130371424734202100203570ustar00rootroot00000000000000/* * Copyright (C) 2021 ~ 2022 Deepin Technology Co., Ltd. * * Author: chenke * * Maintainer: chenke * * 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 DPLUGINLOADER_H #define DPLUGINLOADER_H #include #include #include #include #ifdef Q_OS_LINUX #include #endif #include #include #include #include #ifdef QT_DEBUG Q_LOGGING_CATEGORY(lcDPlugin, "dtk.dpluginloader") #else Q_LOGGING_CATEGORY(lcDPlugin, "dtk.dpluginloader", QtInfoMsg) #endif #define VERSION_STR_SYMBOL "dtkVersionString" class DPluginLoader { public: static QString soAbsoluteFilePath() { #ifdef Q_OS_LINUX Dl_info info; int rc = dladdr(reinterpret_cast(DPluginLoader::soAbsoluteFilePath), &info); if (!rc) qFatal("dladdr error: %s", dlerror()); return QString(info.dli_fname); #elif return QString(); #endif } static QFunctionPointer resolve(const char *symbol) { #ifdef Q_OS_LINUX /** * !!不要使用qt_linux_find_symbol_sys函数去获取符号 * * 在龙芯平台上,qt_linux_find_symbol_sys 无法获取部分已加载动态库的符号, * 可能的原因是这个函数对 dlsym 的调用是在 libQt5Core 动态库中,这个库加载的比较早, * 有可能是因此导致无法获取比这个库加载更晚的库中的符号(仅为猜测) */ return QFunctionPointer(dlsym(RTLD_DEFAULT, symbol)); #else // TODO return nullptr; #endif } static QString resolveFromPSM(const QString &moduleName) { QFile f("/proc/self/maps"); if (!f.open(QIODevice::ReadOnly)) qFatal("%s", f.errorString().toLocal8Bit().data()); QString versoinName; QByteArray data = f.readAll(); QTextStream ts(data); while (Q_UNLIKELY(!ts.atEnd())) { const QString line = ts.readLine(); const QStringList &maps = line.split(' ', QString::SplitBehavior::SkipEmptyParts); if (Q_UNLIKELY(maps.size() < 6)) continue; QFileInfo info(maps.value(5)); if (!info.fileName().contains(moduleName)) continue; int idx = info.fileName().indexOf(moduleName) + moduleName.length(); int idx2 = info.fileName().indexOf(QLatin1String(".so")); versoinName = info.fileName().mid(idx, idx2 - idx); break; } return versoinName; } static QString pluginName(const QString &baseName) { QString pluginName = baseName; QFunctionPointer versionStrFunc = resolve(VERSION_STR_SYMBOL); if (versionStrFunc) { QString versionStr = reinterpret_cast(versionStrFunc)(); // 5.5.3.01 ==> 5.5 const QRegularExpression reg(R"(\d+\.\d+)"); QRegularExpressionMatch rem = reg.match(versionStr); if (rem.hasMatch()) pluginName += rem.captured(); else if (!versionStr.isEmpty()) qCDebug(lcDPlugin) << versionStr << "is invalid"; } else { qCDebug(lcDPlugin) << VERSION_STR_SYMBOL << "resolve failed, trying to read self maps"; QString versoinName = resolveFromPSM(QLatin1String("dtkcore")); if (!versoinName.isEmpty()) pluginName += versoinName; else qCDebug(lcDPlugin) << "versoinName is empty"; } qCDebug(lcDPlugin) << "baseName:" << baseName << "pluginName:" << pluginName; return pluginName; } template static FactoryInterface *load(const QString &baseName) { FactoryInterface *infc = nullptr; QFileInfo soInfo(soAbsoluteFilePath()); if (!soInfo.exists()) { qCWarning(lcDPlugin) << soInfo.absoluteFilePath() << " not existed!"; return infc; } QString realTargetPath = soInfo.absolutePath() + QString("/%1/").arg(BASED_DTK_DIR) + pluginName(baseName) + QLatin1String(".so"); QPluginLoader pluginLoader(realTargetPath); QObject *plugin = pluginLoader.instance(); if (plugin) { qCDebug(lcDPlugin) << realTargetPath << "loaded successfully"; infc = qobject_cast(plugin); /* * Unless unload() was called explicitly, the plugin stays in memory * until the application terminates. */ if (!infc) { QString msg = QString("qobject_cast to %1 failed").arg(typeid(FactoryInterface).name()); qCDebug(lcDPlugin) << msg; pluginLoader.unload(); } } else { qCCritical(lcDPlugin) << pluginLoader.errorString() << realTargetPath << "loaded failed"; } return infc; } }; #endif // DPLUGINLOADER_H qt5integration-5.5.23/src/iconengines/000077500000000000000000000000001424734202100176525ustar00rootroot00000000000000qt5integration-5.5.23/src/iconengines/builtinenginechooser/000077500000000000000000000000001424734202100240715ustar00rootroot00000000000000qt5integration-5.5.23/src/iconengines/builtinenginechooser/builtinengine.json000077700000000000000000000000001424734202100425572../../../iconengineplugins/builtinengine/builtinengine.jsonustar00rootroot00000000000000qt5integration-5.5.23/src/iconengines/builtinenginechooser/builtinenginechooser.pro000066400000000000000000000001631424734202100310320ustar00rootroot00000000000000LIBS += -ldl TARGET = dtkbuiltin PLUGIN_TYPE=iconengines JSON_FILE=builtinengine.json include(../../chooser.prf) qt5integration-5.5.23/src/iconengines/builtinenginechooser/main.cpp000066400000000000000000000030721424734202100255230ustar00rootroot00000000000000/* * Copyright (C) 2021 ~ 2022 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include #include "dpluginloader.h" QT_BEGIN_NAMESPACE class DBuiltinIconEnginePlugin : public QIconEnginePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "builtinengine.json") public: DBuiltinIconEnginePlugin(QObject *parent = nullptr); QIconEngine *create(const QString &iconName = QString()); private: QScopedPointer m_pluginProxy; }; DBuiltinIconEnginePlugin::DBuiltinIconEnginePlugin(QObject *parent) : QIconEnginePlugin(parent) { m_pluginProxy.reset(DPluginLoader::load(TARGET)); } QIconEngine *DBuiltinIconEnginePlugin::create(const QString &iconName) { return m_pluginProxy ? m_pluginProxy->create(iconName) : nullptr; } QT_END_NAMESPACE #include "main.moc" qt5integration-5.5.23/src/iconengines/iconengines.pro000066400000000000000000000001421424734202100226720ustar00rootroot00000000000000TEMPLATE = subdirs SUBDIRS += svgiconenginechooser builtinenginechooser xdgiconproxyenginechooser qt5integration-5.5.23/src/iconengines/svgiconenginechooser/000077500000000000000000000000001424734202100240735ustar00rootroot00000000000000qt5integration-5.5.23/src/iconengines/svgiconenginechooser/main.cpp000066400000000000000000000030021424734202100255160ustar00rootroot00000000000000/* * Copyright (C) 2021 ~ 2022 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include #include "dpluginloader.h" QT_BEGIN_NAMESPACE class QSvgIconPlugin : public QIconEnginePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "qsvgiconengine.json") public: QSvgIconPlugin(QObject *parent = nullptr); QIconEngine *create(const QString &filename = QString()); private: QScopedPointer m_pluginProxy; }; QSvgIconPlugin::QSvgIconPlugin(QObject *parent) : QIconEnginePlugin(parent) { m_pluginProxy.reset(DPluginLoader::load(TARGET)); } QIconEngine *QSvgIconPlugin::create(const QString &file) { return m_pluginProxy ? m_pluginProxy->create(file) : nullptr; } QT_END_NAMESPACE #include "main.moc" qt5integration-5.5.23/src/iconengines/svgiconenginechooser/qsvgiconengine.json000077700000000000000000000000001424734202100431312../../../iconengineplugins/svgiconengine/qsvgiconengine.jsonustar00rootroot00000000000000qt5integration-5.5.23/src/iconengines/svgiconenginechooser/svgiconenginechooser.pro000066400000000000000000000001701424734202100310340ustar00rootroot00000000000000LIBS += -ldl TARGET = dsvgicon JSON_FILE=qsvgiconengine.json PLUGIN_TYPE=iconengines include($$PWD/../../chooser.prf) qt5integration-5.5.23/src/iconengines/xdgiconproxyenginechooser/000077500000000000000000000000001424734202100251605ustar00rootroot00000000000000qt5integration-5.5.23/src/iconengines/xdgiconproxyenginechooser/main.cpp000066400000000000000000000030741424734202100266140ustar00rootroot00000000000000/* * 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 . */ #include #include "dpluginloader.h" QT_BEGIN_NAMESPACE class XdgProxyIconPlugin : public QIconEnginePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "xdgiconproxyengine.json") public: XdgProxyIconPlugin(QObject *parent = nullptr); QIconEngine *create(const QString &iconName = QString()); private: QScopedPointer m_pluginProxy; }; XdgProxyIconPlugin::XdgProxyIconPlugin(QObject *parent) : QIconEnginePlugin(parent) { m_pluginProxy.reset(DPluginLoader::load(TARGET)); } QIconEngine *XdgProxyIconPlugin::create(const QString &iconName) { return m_pluginProxy ? m_pluginProxy->create(iconName) : nullptr; } QT_END_NAMESPACE #include "main.moc" qt5integration-5.5.23/src/iconengines/xdgiconproxyenginechooser/xdgiconproxyengine.json000066400000000000000000000000521424734202100317730ustar00rootroot00000000000000{ "Keys" : [ "XdgIconProxyEngine" ] } qt5integration-5.5.23/src/iconengines/xdgiconproxyenginechooser/xdgiconproxyenginechooser.pro000066400000000000000000000001651424734202100332120ustar00rootroot00000000000000LIBS += -ldl TARGET = xdgicon PLUGIN_TYPE=iconengines JSON_FILE=xdgiconproxyengine.json include(../../chooser.prf) qt5integration-5.5.23/src/imageformats/000077500000000000000000000000001424734202100200275ustar00rootroot00000000000000qt5integration-5.5.23/src/imageformats/imageformats.pro000066400000000000000000000000511424734202100232230ustar00rootroot00000000000000TEMPLATE = subdirs SUBDIRS += svgchooser qt5integration-5.5.23/src/imageformats/svgchooser/000077500000000000000000000000001424734202100222115ustar00rootroot00000000000000qt5integration-5.5.23/src/imageformats/svgchooser/dsvg.json000077700000000000000000000000001424734202100330712../../../imageformatplugins/svg/svg.jsonustar00rootroot00000000000000qt5integration-5.5.23/src/imageformats/svgchooser/main.cpp000066400000000000000000000035751424734202100236530ustar00rootroot00000000000000/* * Copyright (C) 2021 ~ 2022 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include #include "dpluginloader.h" #if !defined(QT_NO_SVGRENDERER) QT_BEGIN_NAMESPACE class QSvgPlugin : public QImageIOPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "dsvg.json") public: QSvgPlugin(QObject *parent = nullptr); Capabilities capabilities(QIODevice *device, const QByteArray &format) const; QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const; private: QScopedPointer m_pluginProxy; }; QSvgPlugin::QSvgPlugin(QObject *parent) : QImageIOPlugin(parent) { m_pluginProxy.reset(DPluginLoader::load(TARGET)); } QImageIOPlugin::Capabilities QSvgPlugin::capabilities(QIODevice *device, const QByteArray &format) const { return m_pluginProxy ? m_pluginProxy->capabilities(device, format) : nullptr; } QImageIOHandler *QSvgPlugin::create(QIODevice *device, const QByteArray &format) const { return m_pluginProxy ? m_pluginProxy->create(device, format) : nullptr; } QT_END_NAMESPACE #include "main.moc" #endif // !QT_NO_IMAGEFORMATPLUGIN qt5integration-5.5.23/src/imageformats/svgchooser/svgchooser.pro000066400000000000000000000001531424734202100251140ustar00rootroot00000000000000LIBS += -ldl TARGET = dsvg JSON_FILE=dsvg.json PLUGIN_TYPE=imageformats include($$PWD/../../chooser.prf) qt5integration-5.5.23/src/platformthemes/000077500000000000000000000000001424734202100204035ustar00rootroot00000000000000qt5integration-5.5.23/src/platformthemes/platformthemechooser/000077500000000000000000000000001424734202100246355ustar00rootroot00000000000000qt5integration-5.5.23/src/platformthemes/platformthemechooser/deepin.json000077700000000000000000000000001424734202100360552../../../platformthemeplugin/deepin.jsonustar00rootroot00000000000000qt5integration-5.5.23/src/platformthemes/platformthemechooser/main.cpp000066400000000000000000000031011424734202100262600ustar00rootroot00000000000000/* * Copyright (C) 2021 ~ 2022 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include #include "dpluginloader.h" class QDeepinThemePlugin : public QPlatformThemePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QPlatformThemeFactoryInterface_iid FILE "deepin.json") public: QDeepinThemePlugin(QObject *parent = nullptr); QPlatformTheme *create(const QString &key, const QStringList ¶ms) Q_DECL_OVERRIDE; private: QScopedPointer m_pluginProxy; }; QDeepinThemePlugin::QDeepinThemePlugin(QObject *parent) : QPlatformThemePlugin(parent) { m_pluginProxy.reset(DPluginLoader::load(TARGET)); } QPlatformTheme *QDeepinThemePlugin::create(const QString &key, const QStringList ¶ms) { return m_pluginProxy ? m_pluginProxy->create(key, params) : nullptr; } QT_END_NAMESPACE #include "main.moc" qt5integration-5.5.23/src/platformthemes/platformthemechooser/platformthemechooser.pro000066400000000000000000000004121424734202100316060ustar00rootroot00000000000000greaterThan(QT_MAJOR_VERSION, 4) { QT += widgets widgets-private } LIBS += -ldl TARGET = qdeepin PLUGIN_TYPE = platformthemes PLUGIN_EXTENDS = - PLUGIN_CLASS_NAME = QDeepinTheme PLUGIN_TYPE=platformthemes JSON_FILE=deepin.json include($$PWD/../../chooser.prf) qt5integration-5.5.23/src/platformthemes/platformthemes.pro000066400000000000000000000000631424734202100241560ustar00rootroot00000000000000TEMPLATE = subdirs SUBDIRS += platformthemechooser qt5integration-5.5.23/src/src.pro000066400000000000000000000001461424734202100166630ustar00rootroot00000000000000TEMPLATE = subdirs SUBDIRS += \ styles \ platformthemes \ iconengines \ imageformats qt5integration-5.5.23/src/styles/000077500000000000000000000000001424734202100166745ustar00rootroot00000000000000qt5integration-5.5.23/src/styles/stylechooser/000077500000000000000000000000001424734202100214175ustar00rootroot00000000000000qt5integration-5.5.23/src/styles/stylechooser/chameleon.json000077700000000000000000000000001424734202100344242../../../styleplugins/chameleon/chameleon.jsonustar00rootroot00000000000000qt5integration-5.5.23/src/styles/stylechooser/main.cpp000066400000000000000000000025441424734202100230540ustar00rootroot00000000000000/* * Copyright (C) 2021 ~ 2022 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include #include "dpluginloader.h" class ChameleonStylePlugin : public QStylePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "chameleon.json") public: ChameleonStylePlugin(QObject *parent = nullptr) : QStylePlugin(parent) { m_pluginProxy.reset(DPluginLoader::load(TARGET)); } QStyle *create(const QString &key) override { return m_pluginProxy ? m_pluginProxy->create(key) : nullptr; } private: QScopedPointer m_pluginProxy; }; #include "main.moc" qt5integration-5.5.23/src/styles/stylechooser/stylechooser.pro000066400000000000000000000002071424734202100246630ustar00rootroot00000000000000QT += core gui widgets LIBS += -ldl TARGET = chameleon PLUGIN_TYPE=styles JSON_FILE=chameleon.json include($$PWD/../../chooser.prf) qt5integration-5.5.23/src/styles/styles.pro000066400000000000000000000000531424734202100207370ustar00rootroot00000000000000TEMPLATE = subdirs SUBDIRS += stylechooser qt5integration-5.5.23/styleplugins/000077500000000000000000000000001424734202100173245ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/chameleon/000077500000000000000000000000001424734202100212575ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/chameleon/chameleon.json000066400000000000000000000000371424734202100241050ustar00rootroot00000000000000{ "Keys" : ["chameleon"] } qt5integration-5.5.23/styleplugins/chameleon/chameleon.pro000066400000000000000000000011771424734202100237420ustar00rootroot00000000000000QT += core gui widgets widgets-private core-private gui-private dtkgui$${DTK_VERSION} dtkwidget$${DTK_VERSION} TARGET = chameleon$${DTK_VERSION} TEMPLATE = lib CONFIG += plugin SOURCES += \ $$PWD/main.cpp \ $$PWD/chameleonstyle.cpp \ $$PWD/../dstyleplugin/dstyleanimation.cpp DISTFILES += $${TARGET}.json DESTDIR = $$_PRO_FILE_PWD_/../../bin/plugins/styles/$${BASED_DTK_DIR} unix { target.path = $$[QT_INSTALL_PLUGINS]/styles/$${BASED_DTK_DIR} INSTALLS += target } HEADERS += \ $$PWD/common.h \ $$PWD/chameleonstyle.h \ $$PWD/../dstyleplugin/dstyleanimation.h RESOURCES += \ resources.qrc qt5integration-5.5.23/styleplugins/chameleon/chameleonstyle.cpp000066400000000000000000006077071424734202100250200ustar00rootroot00000000000000/* * 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include "chameleonstyle.h" #include "common.h" #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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../dstyleplugin/dstyleanimation.h" DGUI_USE_NAMESPACE DWIDGET_USE_NAMESPACE namespace chameleon { // 判断是TabBar否为竖直方向 inline static bool verticalTabs(QTabBar::Shape shape) { return shape == QTabBar::RoundedWest || shape == QTabBar::RoundedEast || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast; } static QWidget *getSbarParentWidget(QScrollBar *sbar) { if (!sbar) return nullptr; QWidget *pw = sbar->parentWidget(); if (!pw) return nullptr; bool isContainer = !pw->objectName().compare(QLatin1String("qt_scrollarea_vcontainer")) || !pw->objectName().compare(QLatin1String("qt_scrollarea_hcontainer")) ; return isContainer ? pw->parentWidget() : pw; } ChameleonStyle::ChameleonStyle() : DStyle() { } static QColor getThemTypeColor(QColor lightColor, QColor darkColor) { if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) return lightColor; else return darkColor; } void ChameleonStyle::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const { switch (static_cast(pe)) { case PE_PanelButtonCommand: { // qDebug() << "### pushbutton state " << (int)opt->state; const QMargins &margins = frameExtentMargins(); // checked if (opt->state & State_On) { p->setBrush(getColor(opt, QPalette::Highlight)); } else { drawShadow(p, opt->rect - margins, getColor(opt, QPalette::Shadow)); // 初始化button的渐变背景色 QLinearGradient lg(QPointF(0, opt->rect.top()), QPointF(0, opt->rect.bottom())); lg.setColorAt(0, getColor(opt, QPalette::Light)); lg.setColorAt(1, getColor(opt, QPalette::Dark)); p->setBrush(lg); } p->setPen(Qt::NoPen); p->setRenderHint(QPainter::Antialiasing); int frame_radius = DStyle::pixelMetric(PM_FrameRadius, opt, w); p->drawRoundedRect(opt->rect - margins, frame_radius, frame_radius); // draw border,border应该是完全叠加到按钮的背景上 p->setPen(QPen(getColor(opt, DPalette::FrameBorder, w), Metrics::Painter_PenWidth)); p->setBrush(Qt::NoBrush); const QMarginsF border_margins(Metrics::Painter_PenWidth, Metrics::Painter_PenWidth, Metrics::Painter_PenWidth, Metrics::Painter_PenWidth); p->drawRoundedRect(QRectF(opt->rect) - margins - border_margins / 2.0, frame_radius, frame_radius); return; } case PE_FrameFocusRect: { //设计要求QTreeView选中整行,这里不绘制focus rect if (qobject_cast(w)) { return; } //QListView不需要绘制focus rect if (qobject_cast(w)) { return; } if (w && w->property("_d_dtk_noFocusRect").toBool()) return; //设计要求DDateTimeEdit focus只绘制边缘 if (qobject_cast(w) && qobject_cast(w->parentWidget())) { return; } drawBorder(p, opt, w); return; } case PE_PanelItemViewItem: { if (w && w->objectName() == "qt_calendar_calendarview") { if (opt->state & QStyle::State_Selected) { QRect textRect = opt->rect; textRect.setWidth(textRect.height()); p->setBrush(opt->palette.brush(QPalette::Highlight)); textRect.moveCenter(opt->rect.center()); p->setPen(Qt::NoPen); p->setRenderHint(QPainter::Antialiasing); p->drawEllipse(textRect.adjusted(1, 1, -1, -1)); } return; } //QTreeView的绘制复制了QCommonStyle的代码,添加了圆角的处理,hover的处理 if (qobject_cast(w)) { //如果QTreeView使用的不是默认代理 QStyledItemDelegate,则采取DStyle的默认绘制(备注:这里的QtCreator不会有hover效果和圆角) if (typeid(*qobject_cast(w)->itemDelegate()) != typeid(QStyledItemDelegate)) { break; } if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { QPalette::ColorGroup cg = (w ? w->isEnabled() : (vopt->state & QStyle::State_Enabled)) ? QPalette::Normal : QPalette::Disabled; if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) cg = QPalette::Inactive; int frame_radius = DStyle::pixelMetric(PM_FrameRadius, opt, w); if (vopt->showDecorationSelected && (vopt->state & (QStyle::State_Selected | QStyle::State_MouseOver))) { p->setRenderHint(QPainter::Antialiasing, true); p->setPen(Qt::NoPen); p->setBrush(vopt->palette.brush(cg, (vopt->state & QStyle::State_Selected) ? QPalette::Highlight : QPalette::Midlight)); if ((vopt->state & QStyle::State_Selected) && (vopt->state & QStyle::State_MouseOver)) { p->setBrush(p->brush().color().lighter(120)); } //只对最后一列的item绘制圆角 if (vopt->viewItemPosition == QStyleOptionViewItem::End || vopt->viewItemPosition == QStyleOptionViewItem::OnlyOne) { p->drawRoundedRect(vopt->rect.adjusted(-frame_radius, 0, 0, 0), frame_radius, frame_radius); } else if (vopt->viewItemPosition != QStyleOptionViewItem::Invalid) { p->drawRoundedRect(vopt->rect.adjusted(-frame_radius, 0, frame_radius, 0), frame_radius, frame_radius); } } else { if (vopt->backgroundBrush.style() != Qt::NoBrush) { QPointF oldBO = p->brushOrigin(); p->setBrushOrigin(vopt->rect.topLeft()); p->fillRect(vopt->rect, vopt->backgroundBrush); p->setBrushOrigin(oldBO); } if (vopt->state & QStyle::State_Selected) { QRect textRect = subElementRect(QStyle::SE_ItemViewItemText, opt, w); p->fillRect(textRect, vopt->palette.brush(cg, QPalette::Highlight)); } } } return; } if (drawTableViewItem(pe, opt, p, w)) return; if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { int frame_radius = DStyle::pixelMetric(PM_FrameRadius, opt, w); if (vopt->state & QStyle::State_Selected) { QRect select_rect = opt->rect; if (!vopt->showDecorationSelected) { select_rect = proxy()->subElementRect(QStyle::SE_ItemViewItemText, opt, w); } else { select_rect -= frameExtentMargins(); } p->setPen(Qt::NoPen); p->setBrush(getColor(opt, QPalette::Highlight)); p->setRenderHint(QPainter::Antialiasing); p->drawRoundedRect(select_rect, frame_radius, frame_radius); return; } } break; } case PE_PanelLineEdit: { if (w && w->parentWidget()) { //lineEdit作为子控件时不进行绘制 if (qobject_cast(w->parent())) return; if (auto edit = qobject_cast(w->parentWidget())) { if (edit->calendarPopup()) return; } } if (auto fopt = qstyleoption_cast(opt)) { // Flat时不绘制输入框的背景 if (fopt->features == QStyleOptionFrame::Flat) { if (opt->state.testFlag(QStyle::State_HasFocus)) { proxy()->drawPrimitive(PE_FrameFocusRect, opt, p, w); } return; } if (fopt->lineWidth > 0) { proxy()->drawPrimitive(PE_FrameLineEdit, fopt, p, w); } } // 此处设置painter的行为不应该影响外面的绘制,会导致lineedit光标不对 Bug-20967。 p->save(); if (w && w->property("_d_dtk_lineedit_opacity").toBool()) p->setBrush(getThemTypeColor(QColor(0, 0, 0, 255* 0.08), QColor(255, 255, 255, 255 * 0.15))); else p->setBrush(opt->palette.button()); p->setPen(Qt::NoPen); p->setRenderHints(QPainter::Antialiasing); int frame_radius = DStyle::pixelMetric(PM_FrameRadius, opt, w); if ((w && qobject_cast(w->parentWidget()))) { if (w->parentWidget()->property("_d_dtk_spinBox").toBool()) { DDrawUtils::drawRoundedRect(p, opt->rect, frame_radius, frame_radius, DDrawUtils::TopLeftCorner | DDrawUtils::BottomLeftCorner); } else { p->drawRoundedRect(opt->rect - frameExtentMargins(), frame_radius, frame_radius); } } else { p->drawRoundedRect(opt->rect, frame_radius, frame_radius); } if (opt->state.testFlag(QStyle::State_HasFocus)) { proxy()->drawPrimitive(PE_FrameFocusRect, opt, p, w); } p->restore(); return; } case PE_FrameLineEdit: { // lineedit no frame return; } case PE_IndicatorRadioButton: { QRect standard = opt->rect; p->setRenderHint(QPainter::Antialiasing, true); if (opt->state & State_On) { //Qt::Checked int padding = qCeil(standard.width() / 2.0 / 2.0); QPainterPath path; path.addEllipse(standard); path.addEllipse(standard.adjusted(padding, padding, -padding, -padding)); p->fillPath(path, getColor(opt, DPalette::Highlight)); // 内圈填充 QPainterPath innerCirclePath; innerCirclePath.addEllipse(standard.adjusted(padding, padding, -padding, -padding)); p->fillPath(innerCirclePath, getThemTypeColor(Qt::white, Qt::black)); } else if (opt->state & State_Off) { p->setPen(QPen(getColor(opt, DPalette::WindowText), 1)); p->drawEllipse(standard.adjusted(1, 1, -1, -1)); // 内圈填充 QPainterPath innerCirclePath; innerCirclePath.addEllipse(standard.adjusted(1, 1, -1, -1)); p->fillPath(innerCirclePath, getThemTypeColor(Qt::transparent, QColor(0, 0, 0, qCeil(255 * 0.5)))); } return; } case PE_IndicatorCheckBox: { QRectF standard = opt->rect; if (opt->state & State_NoChange) { //Qt::PartiallyChecked DDrawUtils::drawBorder(p, standard, getColor(opt, DPalette::WindowText), 1, 2); // 内部矩形填充 p->setBrush(getThemTypeColor(Qt::transparent, QColor(0, 0, 0, qCeil(255 * 0.5)))); p->drawRoundedRect(standard.adjusted(1, 1, -1, -1), 2, 2); QRectF lineRect(0, 0, standard.width() / 2.0, 2); lineRect.moveCenter(standard.center()); p->fillRect(lineRect, getColor(opt, DPalette::TextTitle, w)); } else if (opt->state & State_On) { //Qt::Checked // 填充整个矩形 p->setPen(Qt::NoPen); p->setBrush(getThemTypeColor(Qt::transparent, Qt::black)); p->drawRoundedRect(standard.adjusted(1, 1, -1, -1), 2, 2); p->setPen(getColor(opt, DPalette::Highlight)); p->setBrush(Qt::NoBrush); QIcon icon = QIcon::fromTheme("checked"); icon.paint(p, opt->rect.adjusted(-1, -1, 1, 1)); } else { DDrawUtils::drawBorder(p, standard, getColor(opt, DPalette::WindowText), 1, 2); // 内部矩形填充 p->setBrush(getThemTypeColor(Qt::transparent, getThemTypeColor(Qt::transparent, QColor(0, 0, 0, qCeil(255 * 0.5))))); p->drawRoundedRect(standard.adjusted(1, 1, -1, -1), 2, 2); } return; } case PE_IndicatorTabClose: { QIcon icon = DStyle::standardIcon(SP_CloseButton, opt, w); if (DGuiApplicationHelper::isTabletEnvironment()) { // 在平板中点击区域为36px 显示区域22px QRect iconRect(0, 0, TabBar_TabButtonSize, TabBar_TabButtonSize); iconRect.moveCenter(opt->rect.center()); icon.paint(p, iconRect); return; } icon.paint(p, opt->rect); return; } case PE_FrameTabWidget: { p->setPen(QPen(getColor(opt, QPalette::Dark), proxy()->pixelMetric(PM_DefaultFrameWidth, opt, w))); p->setBrush(getColor(opt, QPalette::Window)); p->drawRect(opt->rect); return; } case PE_IndicatorItemViewItemCheck: { QRectF standard = opt->rect; p->setRenderHint(QPainter::Antialiasing, true); QIcon::Mode mode = opt->state & State_Enabled ? QIcon::Normal : QIcon::Disabled; if (opt->state & State_NoChange) { //Qt::PartiallyChecked DStyle::standardIcon(SP_IndicatorChecked, opt, w).paint(p, standard.toRect(), Qt::AlignCenter, mode); } else if (opt->state & State_On) { //Qt::Checked p->setPen(getColor(opt, DPalette::Highlight)); DStyle::standardIcon(SP_IndicatorChecked, opt, w).paint(p, standard.toRect(), Qt::AlignCenter, mode); } else if (opt->state & State_Off) { //Qt::Unchecked if (w && w->property("_d_dtk_UncheckedItemIndicator").toBool()) { DStyle::standardIcon(SP_IndicatorUnchecked, opt, w).paint(p, standard.toRect(), Qt::AlignCenter, mode); } if (w && !w->property("_d_dtk_UncheckedItemIndicator").isValid() && !qobject_cast(w)) { DStyle::standardIcon(SP_IndicatorUnchecked, opt, w).paint(p, standard.toRect(), Qt::AlignCenter, mode); } } return; } case PE_PanelMenu: { if (opt->palette.window().color().isValid() && DWindowManagerHelper::instance()->hasBlurWindow()) { QColor color = opt->palette.window().color(); color.setAlphaF(0.3); p->fillRect(opt->rect, color); } else { p->fillRect(opt->rect, opt->palette.window()); } break; } case PE_Frame: { if (const QStyleOptionFrame *f = qstyleoption_cast(opt)) { if (f->features & QStyleOptionFrame::Rounded) { p->setRenderHint(QPainter::Antialiasing); p->setBrush(p->background()); if (f->lineWidth <= 0) { p->setPen(Qt::NoPen); } int radius = DStyle::pixelMetric(PM_FrameRadius, opt, w); QRectF rect(opt->rect); rect.adjust(f->lineWidth / 2.0, f->lineWidth / 2.0, -f->lineWidth / 2.0, -f->lineWidth / 2.0); p->drawRoundedRect(rect, radius, radius); return; } } break; } case PE_PanelTipLabel: { return; } case PE_FrameGroupBox: { if (auto group_opt = qstyleoption_cast(opt)) { if (group_opt->features & QStyleOptionFrame::Flat) return; } DStyleOptionBackgroundGroup option; option.init(w); option.position = DStyleOptionBackgroundGroup::OnlyOne; static_cast(&option)->operator =(*opt); DStyle::drawPrimitive(PE_ItemBackground, &option, p, w); return; } case PE_IndicatorArrowUp: { QIcon icon = DStyle::standardIcon(SP_ArrowUp, opt, w); icon.paint(p, opt->rect); return; } case PE_IndicatorArrowDown: { QIcon icon = DStyle::standardIcon(SP_ArrowDown, opt, w); QRect r = opt->rect; int size = qMin(r.width(), r.height()); int xOffset = r.x() + (r.width() - size) / 2; int yOffset = r.y() + (r.height() - size) / 2; icon.paint(p, QRect(xOffset, yOffset, size, size)); return; } case PE_IndicatorArrowRight: { QIcon icon = DStyle::standardIcon(SP_ArrowRight, opt, w); icon.paint(p, opt->rect); return; } case PE_IndicatorArrowLeft: { QIcon icon = DStyle::standardIcon(SP_ArrowLeft, opt, w); icon.paint(p, opt->rect); return; } case PE_FrameTabBarBase: return; case PE_IndicatorBranch: { // tree QRect rect = DStyle::subElementRect(SE_HeaderArrow, opt, w); int rect_width = rect.width(); int rect_height = rect.height(); rect.setWidth(rect_width > rect_height ? rect_width : rect_height); rect.setHeight(rect_width > rect_height ? rect_width: rect_height); rect.moveCenter(opt->rect.center()); if (opt->state & State_Children) { if (!(opt->state & State_Open)) { p->save(); //在选中时进行反白处理 if (opt->state & State_Selected) { p->setPen(QColor(Qt::white)); } DStyle::standardIcon(SP_ArrowRight, opt, w).paint(p, rect); p->restore(); return; } p->save(); //在选中时进行反白处理 if (opt->state & State_Selected) { p->setPen(QColor(Qt::white)); } DStyle::standardIcon(SP_ArrowDown, opt, w).paint(p, rect); p->restore(); } return; } case PE_PanelItemViewRow: { // 不绘制选中的item背景,已经绘制了一个圆了 if (w && qobject_cast(w->parentWidget())) { return; } //这里QTreeView的绘制复制了QCommonStyle的代码,添加了圆角的处理,hover的处理 if (qobject_cast(w)) { //如果QTreeView使用的不是默认代理 QStyledItemDelegate,则采取DStyle的默认绘制(备注:这里的QtCreator不会有hover效果和圆角) if (typeid(*qobject_cast(w)->itemDelegate()) != typeid(QStyledItemDelegate)) { break; } if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { QPalette::ColorGroup cg = (w ? w->isEnabled() : (vopt->state & QStyle::State_Enabled)) ? QPalette::Normal : QPalette::Disabled; if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) cg = QPalette::Inactive; int frame_radius = DStyle::pixelMetric(PM_FrameRadius, opt, w); if ((vopt->state & (QStyle::State_Selected | QStyle::State_MouseOver)) && proxy()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, opt, w)) { p->setRenderHint(QPainter::Antialiasing, true); p->setPen(Qt::NoPen); p->setBrush(vopt->palette.brush(cg, (vopt->state & QStyle::State_Selected) ? QPalette::Highlight : QPalette::Midlight)); if ((vopt->state & QStyle::State_Selected) && (vopt->state & QStyle::State_MouseOver)) { p->setBrush(p->brush().color().lighter(120)); } if (vopt->viewItemPosition != QStyleOptionViewItem::End) { p->drawRoundedRect(vopt->rect.adjusted(0, 0, frame_radius, 0), frame_radius, frame_radius); } else if(vopt->viewItemPosition != QStyleOptionViewItem::Invalid){ p->drawRoundedRect(vopt->rect, frame_radius, frame_radius); } } else if (vopt->features & QStyleOptionViewItem::Alternate) { p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::AlternateBase)); } } return; } break; } case PE_FrameStatusBarItem: { return; } case PE_PanelStatusBar: { QColor bgcolor; QColor lineColor; if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType) { bgcolor = DGuiApplicationHelper::adjustColor(getColor(opt, QPalette::Base), 0, 0, -10, 0, 0, 0, 95); lineColor = DGuiApplicationHelper::adjustColor(getColor(opt, QPalette::Button), 0, 0, 0, 0, 0, 0, 5); } else { bgcolor = DGuiApplicationHelper::adjustColor(getColor(opt, QPalette::Base), 0, 0, 0, 0, 0, 0, 70); lineColor = DGuiApplicationHelper::adjustColor(getColor(opt, QPalette::Button), 0, 0, 60, 0, 0, 0, 0); } p->setPen(lineColor); p->setBrush(bgcolor); p->drawLine(opt->rect.topLeft(), opt->rect.topRight()); p->drawRect(opt->rect); return; } default: break; } DStyle::drawPrimitive(pe, opt, p, w); } // 按动画效果渐变隐藏滚动条,返回值为`true`表示隐藏滚动条,`false`表示继续绘制滚动条(改变了透明度) bool ChameleonStyle::hideScrollBarByAnimation(const QStyleOptionSlider *scrollBar, QPainter *p) const { QScrollBar *sbar = qobject_cast(scrollBar->styleObject); if (!sbar) return false; // QScrollBar 可以通过设置属性 _d_slider_always_show 为 true 的方式,使得 Slider 一直显示 // scrollBarObj 获取的即应用界面上 QScrollBar 控件本身的指针值 if (sbar->property("_d_dtk_slider_always_show").toBool()) return false; // ScrollBarAlwaysOn 也可以控制一直显示 QAbstractScrollArea *sa = qobject_cast(getSbarParentWidget(sbar)); if (sa) { const QScrollBar *hsb = sa->horizontalScrollBar(); const bool hsbAlwaysOn = sa->horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOn; if (hsb == sbar && hsbAlwaysOn) return false; const QScrollBar *vsb = sa->verticalScrollBar(); const bool vsbAlwaysOn = sa->verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOn; if (vsb == sbar && vsbAlwaysOn) return false; } auto styleAnimation = qobject_cast(this->animation(sbar)); if (!styleAnimation) { // styleAnimation -> updateTarget --sendEvent--> StyleAnimationUpdate -> repaint styleAnimation = new dstyle::DScrollbarStyleAnimation(dstyle::DScrollbarStyleAnimation::Deactivating, sbar); styleAnimation->setDeletePolicy(QAbstractAnimation::KeepWhenStopped); connect(styleAnimation, &dstyle::DStyleAnimation::destroyed, this, &ChameleonStyle::_q_removeAnimation, Qt::UniqueConnection); animations.insert(styleAnimation->target(), styleAnimation); // 滚动和滚动条大小变化时,重启动画改变显示和隐藏 QObject::connect(sbar, &QAbstractSlider::valueChanged, styleAnimation, &dstyle::DScrollbarStyleAnimation::restart); QObject::connect(sbar, &QAbstractSlider::rangeChanged, styleAnimation, &dstyle::DScrollbarStyleAnimation::restart); } if (!styleAnimation) return false; QAbstractAnimation::State st = styleAnimation->state(); bool isHoveredOrPressed = scrollBar->state & (QStyle::State_MouseOver | QStyle::State_Sunken); // 隐藏动画中鼠标hover上去或者按下时重启动画(计算时间) if (isHoveredOrPressed && st == QAbstractAnimation::Running) { styleAnimation->restart(true); return false; } if (st == QAbstractAnimation::Running) { p->setOpacity(styleAnimation->currentValue()); } // 动画停止时不再绘制滚动条 return st == QAbstractAnimation::Stopped; } // 当scrollbar透明时不关心鼠标消息。 void ChameleonStyle::transScrollbarMouseEvents(QObject *obj, bool on /*= true*/) const { QScrollBar *sbar = qobject_cast(obj); if (!sbar) return; sbar->setProperty("_d_dtk_slider_visible", on); } bool ChameleonStyle::eventFilter(QObject *watched, QEvent *event) { QScrollBar *sbar = qobject_cast(watched); if (!sbar) return false; QContextMenuEvent *cme = dynamic_cast(event); QMouseEvent *me = dynamic_cast(event); if (!cme && !me) return false; bool on = sbar->property("_d_dtk_slider_visible").toBool(); // 有的应用会设置滚动条的 parent QWidget *pp = getSbarParentWidget(sbar); // 对于 QAbstractScrollArea 来说 item 一般在 viewport 上 QAbstractScrollArea *itemView = qobject_cast(pp); pp = itemView ? itemView->viewport() : pp; if (!pp) return false; // (`(!cme && !me)` is True) && (`cme` is False) ==> `me` is True, `me` can't be False. const QPoint viewportPos = pp->mapFromGlobal(cme ? cme->globalPos() : me->globalPos()); QWidget *target = pp; QPoint localPos = viewportPos; if (qobject_cast(itemView)) { if (target = pp->childAt(viewportPos)) { localPos = target->mapFrom(pp, viewportPos); } } // scrollbar right click if (cme) { if (target) { QContextMenuEvent menuEvent(cme->reason(), localPos, cme->globalPos(), cme->modifiers()); return !on ? false : QApplication::sendEvent(target, &menuEvent); } } else { // 仅仅在滚动条显示时过滤鼠标(点击)事件 if (!me || !on) return false; if (target) { QMouseEvent mevent = *me; mevent.setLocalPos(localPos); // 传递鼠标事件到后面的 widget return QApplication::sendEvent(target, &mevent); } } return false; } void ChameleonStyle::drawControl(QStyle::ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w) const { switch (element) { case CE_RadioButton: case CE_CheckBox: if (const QStyleOptionButton *btn = qstyleoption_cast(opt)) { bool isRadio = (element == CE_RadioButton); QStyleOptionButton subopt = *btn; subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator : SE_CheckBoxIndicator, btn, w); proxy()->drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox, &subopt, p, w); subopt.rect = subElementRect(SE_CheckBoxContents, btn, w); proxy()->drawControl(CE_CheckBoxLabel, &subopt, p, w); if (btn->state & State_HasFocus) { QRect rect(subElementRect(isRadio ? SE_RadioButtonFocusRect : SE_CheckBoxFocusRect, btn, w)); if (isRadio) { p->setPen(QPen(getColor(opt, DPalette::Highlight), DStyle::pixelMetric(PM_FocusBorderWidth))); p->drawEllipse(rect.adjusted(1, 1, -1, -1)); } else { DDrawUtils::drawBorder(p, rect, getColor(opt, DPalette::Highlight), DStyle::pixelMetric(PM_FocusBorderWidth), DStyle::pixelMetric(PM_FocusBorderSpacing) + 2); } } } return; case CE_CheckBoxLabel: if (const QStyleOptionButton *btn = qstyleoption_cast(opt)) { int alignment = static_cast(visualAlignment(btn->direction, Qt::AlignLeft | Qt::AlignVCenter)); if (!proxy()->styleHint(SH_UnderlineShortcut, btn, w)) alignment |= Qt::TextHideMnemonic; QPixmap pix; QRect textRect = btn->rect; if (!btn->icon.isNull()) { auto icon_mode_state = toIconModeState(opt); // 与PushButton一致,转换成icon的mode和state. pix = btn->icon.pixmap(w ? w->window()->windowHandle() : nullptr, btn->iconSize, icon_mode_state.first, icon_mode_state.second); proxy()->drawItemPixmap(p, btn->rect, alignment, pix); if (btn->direction == Qt::RightToLeft) textRect.setRight(textRect.right() - btn->iconSize.width() - 4); else textRect.setLeft(textRect.left() + btn->iconSize.width() + 4); } if (!btn->text.isEmpty()) { proxy()->drawItemText(p, textRect, alignment | Qt::TextShowMnemonic, btn->palette, btn->state & State_Enabled, btn->text, QPalette::WindowText); } } return; case CE_ScrollBarSlider: { if (const QStyleOptionSlider* scrollBar = qstyleoption_cast(opt)) { // 非特效不需要动画,只有显示和隐藏 if (!DGuiApplicationHelper::isSpecialEffectsEnvironment()) { bool isHoveredOrPressed = scrollBar->state & (QStyle::State_MouseOver | QStyle::State_Sunken); transScrollbarMouseEvents(scrollBar->styleObject, !isHoveredOrPressed); if (!isHoveredOrPressed) return; } bool hidden = hideScrollBarByAnimation(scrollBar, p); // 不绘制则将鼠标消息转发到 parentwidget transScrollbarMouseEvents(scrollBar->styleObject, hidden); if (hidden) return; p->save(); p->setBrush(getColor(opt, QPalette::Highlight)); p->setPen(Qt::NoPen); p->setRenderHint(QPainter::Antialiasing); QRectF rect = opt->rect; int realRadius = 0; QPoint scrollBarRectCenter; int spacing = DStyle::pixelMetric(DStyle::PM_FocusBorderSpacing); //用于判断滚动条是否被圆角区域遮住或特殊要求(滚动条上下不到顶、末端),使用方法是 在对应的控件的滚动条, 设置添加间隔,其中左、右和上、下每一个都是分开的,且没有遮挡长度的限制; //若是超出滚动条的总长度,则表现无变化(不作处理) //eg: scrollbar->setProperty("_d_slider_leftOrRight_spacing", 100); bool okLeft = false; bool okRight = false; bool okUp = false; bool okDown = false; int spacLeft = 0; int spacRight = 0; int spacUp = 0; int spacDown = 0; if (opt->styleObject->property("_d_slider_spaceLeft").isValid()) spacLeft = opt->styleObject->property("_d_slider_spaceLeft").toInt(&okLeft); if (opt->styleObject->property("_d_slider_spaceRight").isValid()) spacRight = opt->styleObject->property("_d_slider_spaceRight").toInt(&okRight); if (opt->styleObject->property("_d_slider_spaceUp").isValid()) spacUp = opt->styleObject->property("_d_slider_spaceUp").toInt(&okUp); if (opt->styleObject->property("_d_slider_spaceDown").isValid()) spacDown = opt->styleObject->property("_d_slider_spaceDown").toInt(&okDown); if (opt->state & QStyle::State_Horizontal) { rect.setHeight(rect.height() / 2); if ((okLeft && spacLeft > 0) || (okRight && spacRight > 0)) { if ((2 * spacing + spacLeft + spacRight) < rect.width()) { rect = rect.adjusted(spacing + spacLeft, 0, -spacing - spacRight, 0); } } else { rect = rect.adjusted(spacing, 0, -spacing, 0); } if (!(opt->state & QStyle::State_MouseOver)) rect.setHeight(rect.height() - 2); realRadius = rect.height() / 2.0; scrollBarRectCenter.setX(scrollBar->rect.x() + scrollBar->rect.width() / 2); scrollBarRectCenter.setY((scrollBar->rect.y() + scrollBar->rect.height()) / 2); rect.moveCenter(scrollBarRectCenter); rect.moveBottom(scrollBar->rect.bottom() - 2); } else { rect.setWidth(rect.width() / 2); if ((okUp && spacUp > 0) || (okDown && spacDown > 0)) { if ((2 * spacing + spacUp + spacDown) < rect.height()) { rect = rect.adjusted(0, spacing + spacUp, 0, -spacing - spacDown); } } else { rect = rect.adjusted(0, spacing, 0, -spacing); } if (!(opt->state & QStyle::State_MouseOver)) rect.setWidth(rect.width() - 2); realRadius = rect.width() / 2.0; scrollBarRectCenter.setX((scrollBar->rect.x() + scrollBar->rect.width()) / 2); scrollBarRectCenter.setY(scrollBar->rect.y() + scrollBar->rect.height() / 2); rect.moveCenter(scrollBarRectCenter); rect.moveRight(scrollBar->rect.right() - 2); } QColor lineColor(opt->palette.color(QPalette::Base)); if (DGuiApplicationHelper::toColorType(lineColor) == DGuiApplicationHelper::LightType) { // 内侧绘制一个像素的inside border p->setPen(QPen(QColor(0, 0, 0, 0.05 * 255), Metrics::Painter_PenWidth)); // normal状态 p->setBrush(QColor(0, 0, 0, 0.3 * 255)); if (scrollBar->state & QStyle::State_MouseOver) // hover 状态 p->setBrush(QColor(0, 0, 0, 0.6 * 255)); if (scrollBar->state & QStyle::State_Sunken) // active状态 p->setBrush(QColor(0, 0, 0, 0.5 * 255)); } else { // 外侧拓展一个像素的outside border p->setPen(QPen(QColor(0, 0, 0, 0.2 * 255), Metrics::Painter_PenWidth)); p->setBrush(Qt::NoBrush); p->drawRoundedRect(rect.adjusted(-1, -1, 1, 1), realRadius, realRadius); // 内侧绘制一个像素的inside border p->setPen(QPen(QColor(255, 255, 255, 0.05 * 255), Metrics::Painter_PenWidth)); // normal状态 p->setBrush(QColor(96, 96, 96, 0.7 * 255)); if (scrollBar->state & QStyle::State_MouseOver) // hover 状态 p->setBrush(QColor(96, 96, 96, 0.8 * 255)); if (scrollBar->state & QStyle::State_Sunken) // active状态 p->setBrush(QColor(112, 112, 112, 0.8 * 255)); } p->drawRoundedRect(rect, realRadius, realRadius); p->restore(); } break; } case CE_MenuBarItem: { if (const QStyleOptionMenuItem *mbi = qstyleoption_cast(opt)) { p->save(); QRect rect = mbi->rect; drawMenuBarItem(mbi, rect, p, w); p->restore(); return; } } break; case CE_MenuBarEmptyArea: { p->save(); QRect menubarRect = opt->rect; p->setPen(Qt::NoPen); p->setBrush(getColor(opt, QPalette::Window)); p->drawRect(menubarRect); p->restore(); return; } case CE_MenuItem: { if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast(opt)) { p->save(); drawMenuItem(menuItem, p, w); p->restore(); return; } break; } case CE_MenuEmptyArea: { drawMenuItemBackground(opt, p, QStyleOptionMenuItem::EmptyArea); return; } case CE_MenuScroller: { QStyleOption arrowOpt = *opt; arrowOpt.state |= State_Enabled; int minSize = qMin(arrowOpt.rect.width(), arrowOpt.rect.height()); arrowOpt.rect.setWidth(minSize); arrowOpt.rect.setHeight(minSize); arrowOpt.rect.moveCenter(opt->rect.center()); proxy()->drawPrimitive(((opt->state & State_DownArrow) ? PE_IndicatorArrowDown : PE_IndicatorArrowUp), &arrowOpt, p, w); return; } case CE_PushButton: { if (const QStyleOptionButton *btn = qstyleoption_cast(opt)) { proxy()->drawControl(CE_PushButtonBevel, btn, p, w); QStyleOptionButton subopt = *btn; subopt.rect -= frameExtentMargins(); subopt.rect = proxy()->subElementRect(SE_PushButtonContents, &subopt, w); proxy()->drawControl(CE_PushButtonLabel, &subopt, p, w); if (btn->state & State_HasFocus) { QStyleOptionFocusRect fropt; fropt.QStyleOption::operator=(*btn); fropt.rect = proxy()->subElementRect(SE_PushButtonFocusRect, btn, w); proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, w); } return; } break; } case CE_PushButtonBevel: { if (const QStyleOptionButton *btn = qstyleoption_cast(opt)) { QRect br = btn->rect; int dbi = proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, w); if (btn->features & QStyleOptionButton::DefaultButton) proxy()->drawPrimitive(PE_FrameDefaultButton, opt, p, w); if (btn->features & QStyleOptionButton::AutoDefaultButton) br.setCoords(br.left() + dbi, br.top() + dbi, br.right() - dbi, br.bottom() - dbi); if (!(btn->features & (QStyleOptionButton::Flat | QStyleOptionButton::CommandLinkButton)) || btn->state & (State_Sunken | State_On) || (btn->features & QStyleOptionButton::CommandLinkButton && btn->state & State_MouseOver)) { QStyleOptionButton tmpBtn = *btn; tmpBtn.rect = br; proxy()->drawPrimitive(PE_PanelButtonCommand, &tmpBtn, p, w); } } return; } case CE_TabBarTabShape: { if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { if (drawTabBar(p, tab, w)) return; } } break; case CE_TabBarTabLabel: { if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { if (drawTabBarLabel(p, tab, w)) return; } } break; case CE_TabBarTab: { if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { QStyleOptionButton btn; btn.rect = tab->rect; bool type_check = false; if (w) type_check = w->property("_d_dtk_tabbartab_type").toBool(); int leftMarge = 0; int rightMarge = 0; if (!type_check) { leftMarge = TabBar_TabMargin / 2; rightMarge = TabBar_TabMargin / 2; } if (verticalTabs(tab->shape)) { btn.rect.adjust(0, leftMarge, 0, -(rightMarge)); } else { btn.rect.adjust(leftMarge, 0, -(rightMarge), 0); } btn.state = tab->state; if (tab->state & QStyle::State_Selected) { btn.state |= QStyle::State_On; } if (type_check) { QColor inactive; if (btn.state & State_On) { inactive = getColor(opt, QPalette::ToolTipBase); if (DGuiApplicationHelper::instance()->paletteType() == DGuiApplicationHelper::DarkType) { inactive = DGuiApplicationHelper::adjustColor(getColor(opt, QPalette::ToolTipBase), 0, 0, 0, -10, -10, -10, 0); } p->setBrush(inactive); } else { // 初始化 tabbar 的背景色 if (DGuiApplicationHelper::instance()->paletteType() == DGuiApplicationHelper::LightType || (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType && DGuiApplicationHelper::instance()->paletteType() == DGuiApplicationHelper::UnknownType)) { inactive = DGuiApplicationHelper::adjustColor(getColor(opt, QPalette::Light), 0, 0, 0, +20, +20, +20, 0); } else if (DGuiApplicationHelper::instance()->paletteType() == DGuiApplicationHelper::DarkType || (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType && DGuiApplicationHelper::instance()->paletteType() == DGuiApplicationHelper::UnknownType)) { inactive = DGuiApplicationHelper::adjustColor(getColor(opt, QPalette::Light), 0, 0, 0, -57, -57, -57, 0); } else { inactive = DGuiApplicationHelper::adjustColor(getColor(opt, QPalette::Light), 0, 0, 0, +20, +20, +20, 0); } p->setBrush(inactive); // Bug:33899 此处添加update出现重复触发绘图事件 导致cpu占用过高 目前注释未发现问题 // const_cast(w)->update(); } p->setPen(Qt::NoPen); p->setRenderHint(QPainter::Antialiasing); p->drawRect(opt->rect); // 绘制边框线 if (DGuiApplicationHelper::instance()->paletteType() == DGuiApplicationHelper::LightType || (DGuiApplicationHelper::instance()->paletteType() == DGuiApplicationHelper::UnknownType && DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType)) { p->setPen(QPen(getColor(opt, DPalette::FrameBorder, w), Metrics::Painter_PenWidth)); } else if (DGuiApplicationHelper::instance()->paletteType() == DGuiApplicationHelper::DarkType || (DGuiApplicationHelper::instance()->paletteType() == DGuiApplicationHelper::UnknownType && DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType)){ p->setPen(QPen(QColor(0, 0, 0, static_cast(0.05 * 255)), Metrics::Painter_PenWidth)); } else { p->setPen(QPen(getColor(opt, DPalette::FrameBorder, w), Metrics::Painter_PenWidth)); } p->setBrush(Qt::NoBrush); p->drawRect(opt->rect); //对中间的tabbar尾后加一根明显的线 if (QStyleOptionTab::End != tab->position && QStyleOptionTab::OnlyOneTab != tab->position) { const QRect &lintRect = opt->rect; if (verticalTabs(tab->shape)) { p->drawLine(lintRect.bottomLeft(), lintRect.bottomRight()); } else { p->drawLine(lintRect.topRight(), lintRect.bottomRight()); } } } else { DStyle::drawControl(CE_PushButtonBevel, &btn, p, w); } QStyleOptionTab* newTab = const_cast(tab); newTab->rect = btn.rect; proxy()->drawControl(CE_TabBarTabLabel, newTab, p, w); return; } break; } case CE_RubberBand: { if (qstyleoption_cast(opt)) { p->save(); QColor color = opt->palette.highlight().color(); color.setAlphaF(0.1); // draw rectangle p->setRenderHint(QPainter::Antialiasing, false); p->fillRect(opt->rect, color); // draw inner border // 保证border绘制在矩形内部,且不超越了矩形范围 color.setAlphaF(0.2); p->setClipRegion(QRegion(opt->rect) - opt->rect.adjusted(1, 1, -1, -1)); p->fillRect(opt->rect, color); p->restore(); return; } break; } case CE_Header: if (const QStyleOptionHeader *header = qstyleoption_cast(opt)) { QRegion clipRegion = p->clipRegion(); p->setClipRect(opt->rect); proxy()->drawControl(CE_HeaderSection, header, p, w); QStyleOptionHeader subopt = *header; subopt.rect = subElementRect(SE_HeaderLabel, header, w); if (subopt.rect.isValid()) proxy()->drawControl(CE_HeaderLabel, &subopt, p, w); if (header->sortIndicator != QStyleOptionHeader::None) { subopt.rect = subElementRect(SE_HeaderArrow, opt, w); proxy()->drawPrimitive(PE_IndicatorHeaderArrow, &subopt, p, w); } p->setClipRegion(clipRegion); } return; case CE_ShapedFrame: { if (const QStyleOptionFrame *f = qstyleoption_cast(opt)) { int frameShape = f->frameShape; int frameShadow = QFrame::Plain; if (f->state & QStyle::State_Sunken) { frameShadow = QFrame::Sunken; } else if (f->state & QStyle::State_Raised) { frameShadow = QFrame::Raised; } int lw = f->lineWidth; int mlw = f->midLineWidth; QPalette::ColorRole foregroundRole = QPalette::WindowText; if (w) foregroundRole = w->foregroundRole(); switch (frameShape) { case QFrame::Box: if (qobject_cast(const_cast(w)) && DGuiApplicationHelper::isTabletEnvironment()) break; if (frameShadow == QFrame::Plain) { qDrawPlainRect(p, f->rect, f->palette.color(foregroundRole), lw); } else { qDrawShadeRect(p, f->rect, f->palette, frameShadow == QFrame::Sunken, lw, mlw); } break; case QFrame::StyledPanel: //keep the compatibility with Qt 4.4 if there is a proxy style. //be sure to call drawPrimitive(QStyle::PE_Frame) on the proxy style if (w) { w->style()->drawPrimitive(QStyle::PE_Frame, opt, p, w); } else { proxy()->drawPrimitive(QStyle::PE_Frame, opt, p, w); } break; case QFrame::Panel: if (frameShadow == QFrame::Plain) { qDrawPlainRect(p, f->rect, f->palette.color(foregroundRole), lw); } else { qDrawShadePanel(p, f->rect, f->palette, frameShadow == QFrame::Sunken, lw); } break; case QFrame::WinPanel: if (frameShadow == QFrame::Plain) { qDrawPlainRect(p, f->rect, f->palette.color(foregroundRole), lw); } else { qDrawWinPanel(p, f->rect, f->palette, frameShadow == QFrame::Sunken); } break; case QFrame::HLine: case QFrame::VLine: { QPoint p1, p2; if (frameShape == QFrame::HLine) { p1 = QPoint(opt->rect.x(), opt->rect.y() + opt->rect.height() / 2); p2 = QPoint(opt->rect.x() + opt->rect.width(), p1.y()); } else { p1 = QPoint(opt->rect.x() + opt->rect.width() / 2, opt->rect.y()); p2 = QPoint(p1.x(), p1.y() + opt->rect.height()); } if (frameShadow == QFrame::Plain) { QPen oldPen = p->pen(); QColor color = opt->palette.color(foregroundRole); color.setAlphaF(0.1); p->setPen(QPen(color, lw)); p->drawLine(p1, p2); p->setPen(oldPen); } else { qDrawShadeLine(p, p1, p2, f->palette, frameShadow == QFrame::Sunken, lw, mlw); } break; } } return; } break; } case CE_ComboBoxLabel: { if (const QStyleOptionComboBox *cb = qstyleoption_cast(opt)) { if (drawComboBoxLabel(p, cb, w)) return; } break; } case CE_PushButtonLabel: if (const QStyleOptionButton *button = qstyleoption_cast(opt)) { QRect textRect = button->rect; uint tf = Qt::AlignVCenter | Qt::TextShowMnemonic; if (!proxy()->styleHint(SH_UnderlineShortcut, button, w)) tf |= Qt::TextHideMnemonic; const QPalette::ColorRole &text_color_role = opt->state & State_On ? QPalette::HighlightedText : QPalette::ButtonText; QPalette pa = button->palette; if (button->features & DStyleOptionButton::WarningButton) { pa.setBrush(QPalette::ButtonText, getColor(opt, DPalette::TextWarning, w)); } else if (button->features & DStyleOptionButton::SuggestButton) { pa.setBrush(QPalette::ButtonText, getColor(opt, QPalette::HighlightedText)); } else { pa.setBrush(QPalette::ButtonText, getColor(opt, text_color_role)); } // 设置文字和图标的绘制颜色 p->setPen(QPen(pa.buttonText(), 1)); if (!button->icon.isNull()) { //Center both icon and text QRect iconRect; int pixmapWidth = button->iconSize.width(); int pixmapHeight = button->iconSize.height(); int labelWidth = pixmapWidth; int labelHeight = pixmapHeight; int iconSpacing = 4;//### 4 is currently hardcoded in QPushButton::sizeHint() int textWidth = button->fontMetrics.boundingRect(opt->rect, tf, button->text).width(); if (!button->text.isEmpty()) labelWidth += (textWidth + iconSpacing); iconRect = QRect(textRect.x() + (textRect.width() - labelWidth) / 2, textRect.y() + (textRect.height() - labelHeight) / 2, pixmapWidth, pixmapHeight); iconRect = visualRect(button->direction, textRect, iconRect); tf |= Qt::AlignLeft; //left align, we adjust the text-rect instead if (button->direction == Qt::RightToLeft) textRect.setRight(iconRect.left() - iconSpacing); else textRect.setLeft(iconRect.left() + iconRect.width() + iconSpacing); if (button->state & (State_On | State_Sunken)) iconRect.translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, opt, w), proxy()->pixelMetric(PM_ButtonShiftVertical, opt, w)); auto icon_mode_state = toIconModeState(opt); button->icon.paint(p, iconRect, Qt::AlignCenter, icon_mode_state.first, icon_mode_state.second); } else { tf |= Qt::AlignHCenter; } if (button->state & (State_On | State_Sunken)) textRect.translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, opt, w), proxy()->pixelMetric(PM_ButtonShiftVertical, opt, w)); if (button->features & QStyleOptionButton::HasMenu) { QRect rectArrowAndLine = drawButtonDownArrow(opt, nullptr, w); int frameRadius = DStyle::pixelMetric(PM_FrameRadius); drawButtonDownArrow(button, p, w); if (button->direction == Qt::LeftToRight) { textRect.setRight(rectArrowAndLine.left() - frameRadius); } else { textRect.setLeft(rectArrowAndLine.right() + frameRadius); } } proxy()->drawItemText(p, textRect, tf, pa, (button->state & State_Enabled), button->text, QPalette::ButtonText); return; } break; case CE_ProgressBar: { //显示进度区域 if (const QStyleOptionProgressBar *progBar = qstyleoption_cast(opt)) { p->setRenderHint(QPainter::Antialiasing); p->setPen(Qt::NoPen); p->drawRect(opt->rect); QStyleOptionProgressBar progGroove = *progBar; proxy()->drawControl(CE_ProgressBarGroove, &progGroove, p, w); QRect rect = progBar->rect; //滑块区域矩形 int min = progBar->minimum; int max = progBar->maximum; int val = progBar->progress; int drawWidth = 0; if (progBar->orientation == Qt::Horizontal) { drawWidth = (val * 1.0 / (max - min)) * rect.width(); rect = QRect(rect.left(), rect.top(), drawWidth, rect.height()); } else { drawWidth = (val * 1.0 / (max - min)) * rect.height(); rect = QRect(rect.left(), rect.bottom() - drawWidth, rect.width(), drawWidth); } p->setPen(Qt::NoPen); QStyleOptionProgressBar subopt = *progBar; proxy()->drawControl(CE_ProgressBarContents, &subopt, p, w); if (progBar->textVisible && progBar->orientation == Qt::Horizontal) { subopt.rect = proxy()->subElementRect(SE_ProgressBarLabel, progBar, w); proxy()->drawControl(CE_ProgressBarLabel, &subopt, p, w); } } return; } case CE_ProgressBarGroove: { //滑槽显示 if (const QStyleOptionProgressBar *progBar = qstyleoption_cast(opt)) { int frameRadius = DStyle::pixelMetric(PM_FrameRadius, opt, w); int height = progBar->orientation == Qt::Horizontal ? opt->rect.height() : opt->rect.width(); if (frameRadius * 2 >= height) { frameRadius = qMin(height / 2, 4); } p->setBrush(getColor(opt, DPalette::ObviousBackground, w)); p->drawRoundedRect(opt->rect, frameRadius, frameRadius); } return; } case CE_ProgressBarContents: { //进度滑块显示 if (const QStyleOptionProgressBar *progBar = qstyleoption_cast(opt)) { QStyleOptionProgressBar* progBarTemp = const_cast(progBar); progBarTemp->state &= (~State_MouseOver); progBarTemp = nullptr; QRect rect = progBar->rect; //滑块区域矩形 int min = progBar->minimum; int max = progBar->maximum; int val = progBar->progress; int drawWidth = 0; int frameRadius = DStyle::pixelMetric(PM_FrameRadius, opt, w); int height = progBar->orientation == Qt::Horizontal ? rect.height() : rect.width(); if (frameRadius * 2 >= height) { frameRadius = qMin(height / 2, 4); } if (progBar->orientation == Qt::Horizontal) { drawWidth = (val * 1.0 / (max - min)) * rect.width(); rect = QRect(rect.left(), rect.top(), drawWidth, rect.height()); } else { drawWidth = (val * 1.0 / (max - min)) * rect.height(); rect = QRect(rect.left(), rect.bottom() - drawWidth, rect.width(), drawWidth); } QPointF pointStart(rect.left(), rect.center().y()); QPointF pointEnd(rect.right(), rect.center().y()); QLinearGradient linear(pointStart, pointEnd); QColor startColor = getColor(opt, DPalette::Highlight); QColor endColor = DGuiApplicationHelper::adjustColor(startColor, 0, 0, +30, 0, 0, 0, 0); linear.setColorAt(0, startColor); linear.setColorAt(1, endColor); linear.setSpread(QGradient::PadSpread); p->setBrush(QBrush(linear)); if (progBar->textVisible) { QPainterPath pathRect; pathRect.addRect(rect); QPainterPath pathRoundRect; pathRoundRect.addRoundedRect(opt->rect, frameRadius, frameRadius); QPainterPath inter = pathRoundRect.intersected(pathRect); p->drawPath(inter); } else { //进度条高度 <= 8px && 进度条宽度 <= 8px && value有效 if (rect.height() <= ProgressBar_MinimumStyleHeight && rect.width() <= ProgressBar_MinimumStyleHeight && progBar->progress > 0) { QPainterPath path; QRect startRect = rect; startRect.setWidth(rect.height()); startRect.setHeight(rect.height()); path.moveTo(rect.x() + startRect.width() / 2, rect.y()); //绘制进度条最小样式前半圆 path.arcTo(startRect, 90, 180); p->drawPath(path); //绘制进度条最小样式后半圆 if (rect.width() > startRect.width() / 2) { QRect endRect = startRect; int width = rect.width() - startRect.width() / 2; endRect.setX(startRect.x() + startRect.width() / 2 - width); endRect.setWidth(width * 2); QPainterPath path2; path2.moveTo(endRect.x() + endRect.width() / 2, rect.y()); path2.arcTo(endRect, 90, -180); p->drawPath(path2); } } else p->drawRoundedRect(rect, frameRadius, frameRadius); } } return; } case CE_ProgressBarLabel: { if (const QStyleOptionProgressBar *progBar = qstyleoption_cast(opt)) { double val = progBar->progress * 1.0 / (progBar->maximum - progBar->minimum); int radius = DStyle::pixelMetric(PM_FrameRadius); int drawWidth = val * (opt->rect.width() + 2 * radius); QRect rect = progBar->fontMetrics.boundingRect(progBar->rect, progBar->textAlignment, progBar->text); if (rect.left() <= drawWidth && drawWidth <= rect.right()) { double division = (drawWidth - rect.left()) / (rect.width() * 1.0); QPointF pointStart(rect.left(), rect.center().y()); QPointF pointEnd(rect.right(), rect.center().y()); QLinearGradient linear(pointStart, pointEnd); linear.setColorAt(0, getColor(opt, DPalette::HighlightedText)); linear.setColorAt(division, getColor(opt, DPalette::HighlightedText)); linear.setColorAt(division + 0.01, getColor(opt, DPalette::ButtonText)); linear.setColorAt(1, getColor(opt, DPalette::ButtonText)); linear.setSpread(QGradient::PadSpread); p->setPen(QPen(QBrush(linear), 1)); //设置画笔渐变色 } else if (drawWidth < rect.left()) { p->setPen(getColor(opt, DPalette::ButtonText)); } else { p->setPen(getColor(opt, DPalette::HighlightedText)); } p->drawText(progBar->rect, progBar->textAlignment, progBar->text); } return; } case CE_ToolButtonLabel: { if (const QStyleOptionToolButton *toolbutton = qstyleoption_cast(opt)) { QRect rect = toolbutton->rect; int toolButtonAlign = Qt::AlignLeft; if (w) toolButtonAlign = w->property("_d_dtk_toolButtonAlign").toInt(); // 设置tool button的对齐方式 int radius = DStyle::pixelMetric(PM_FrameRadius, opt, w); //在绘画icon和text之前,先绘画一层表示靠近或按下状态 p->setRenderHint(QPainter::Antialiasing); p->setPen(Qt::NoPen); p->setBrush(Qt::NoBrush); if (toolbutton->state & (State_MouseOver | State_Sunken)) //hover状态 、press状态 p->setBrush(getBrush(toolbutton, DPalette::Button)); // Arrow type always overrules and is always shown bool hasArrow = toolbutton->features & QStyleOptionToolButton::Arrow; if (((!hasArrow && toolbutton->icon.isNull()) && !toolbutton->text.isEmpty()) || toolbutton->toolButtonStyle == Qt::ToolButtonTextOnly) { //只显示文字的情景 int alignment = Qt::AlignCenter | Qt::TextShowMnemonic; if (!proxy()->styleHint(SH_UnderlineShortcut, opt, w)) alignment |= Qt::TextHideMnemonic; p->setFont(toolbutton->font); p->drawRoundedRect(rect, radius, radius); if (toolbutton->state & State_On) { p->setPen(getColor(toolbutton, DPalette::Highlight)); } else { p->setPen(getColor(toolbutton, DPalette::ButtonText)); } p->drawText(rect, alignment, toolbutton->text); } else { //只显示文字的情景 的 补集 QIcon icon; QSize pmSize = toolbutton->iconSize; switch (toolbutton->arrowType) { case Qt::UpArrow: icon = DStyle::standardIcon(SP_ArrowUp); break; case Qt::DownArrow: icon = DStyle::standardIcon(SP_ArrowDown); break; case Qt::LeftArrow: icon = DStyle::standardIcon(SP_ArrowLeft); break; case Qt::RightArrow: icon = DStyle::standardIcon(SP_ArrowRight); break; default: icon = toolbutton->icon; break; } int radius = DStyle::pixelMetric(PM_FrameRadius, opt, w); //在绘画icon和text之前,先绘画一层表示靠近或按下状态 p->setRenderHint(QPainter::Antialiasing); p->setPen(Qt::NoPen); p->setBrush(Qt::NoBrush); if (toolbutton->state & (State_MouseOver | State_Sunken)) //hover状态 、press状态 p->setBrush(getBrush(toolbutton, DPalette::Button)); if (toolbutton->state & State_HasFocus) p->setPen(getColor(toolbutton, DPalette::Highlight)); //强制绘制 日历 左右翻页背景 if (w && (w->objectName() == "qt_calendar_prevmonth" || w->objectName() == "qt_calendar_nextmonth")) { p->setBrush(getColor(toolbutton, DPalette::Button)); } if (toolbutton->state & State_Enabled) p->drawRoundedRect(rect, radius, radius); // pr为图标的大小 QRect pr = rect; // tr为文字的大小 QRect tr = rect; pr.setHeight(pmSize.height()); pr.setWidth(pmSize.width()); if (toolbutton->state & State_On) //active状态 p->setPen(getColor(toolbutton, DPalette::Highlight)); else p->setPen(getColor(toolbutton, DPalette::ButtonText)); if (toolbutton->toolButtonStyle != Qt::ToolButtonIconOnly) { //只显示icon 的补集情况 p->setFont(toolbutton->font); int alignment = Qt::TextShowMnemonic; if (!proxy()->styleHint(SH_UnderlineShortcut, opt, w)) alignment |= Qt::TextHideMnemonic; if (toolbutton->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { //文字在图标下面 pr.moveCenter(QPoint(rect.center().x(), rect.center().y() / 2)); tr.adjust(0, pr.height(), 0, 0); drawIcon(toolbutton, p, pr, icon); alignment |= Qt::AlignCenter; } else if (toolbutton->toolButtonStyle == Qt::ToolButtonTextBesideIcon) { if (toolButtonAlign == Qt::AlignCenter) { //toolButton居中对齐 //计算文字宽度 int textWidget = w->fontMetrics().width(toolbutton->text); //图标 spacing 文字的矩形 QRect textIcon = QRect(0, 0, pr.width() + ToolButton_MarginWidth + textWidget, rect.height()); textIcon.moveCenter(rect.center()); pr.moveCenter(rect.center()); //图标padding pr.moveLeft(textIcon.x() > ToolButton_ItemSpacing ? textIcon.x() : ToolButton_ItemSpacing ); //调整text距离 tr.adjust(pr.width() + ToolButton_AlignCenterPadding, 0, 0, 0); drawIcon(toolbutton, p, pr, icon); alignment |= Qt::AlignCenter; } else if (toolButtonAlign == Qt::AlignRight) { //toolButton右对齐 int textWidget = w->fontMetrics().width(toolbutton->text); pr.moveCenter(rect.center()); pr.moveRight(tr.width() - textWidget - ToolButton_AlignLeftPadding - ToolButton_ItemSpacing); tr.adjust(-ToolButton_AlignLeftPadding - pr.width() - ToolButton_MarginWidth, 0, -ToolButton_AlignLeftMargin, 0); drawIcon(toolbutton, p, pr, icon); alignment |= Qt::AlignVCenter | Qt::AlignRight; } else { //toolButton左对齐 pr.moveCenter(rect.center()); pr.moveLeft(ToolButton_AlignRightPadding); tr.adjust(ToolButton_AlignRightPadding + pr.width() + ToolButton_MarginWidth, 0, -ToolButton_ItemSpacing, 0); drawIcon(toolbutton, p, pr, icon); alignment |= Qt::AlignVCenter | Qt::AlignLeft; } } else { //其他几种(文字和icon布局)方式 int radius = DStyle::pixelMetric(PM_FrameRadius); pr.moveCenter(QPoint(rect.left(), rect.center().y())); pr.moveLeft(radius); tr.adjust(pr.width() + radius, 0, 0, 0); drawIcon(toolbutton, p, pr, icon); alignment |= Qt::AlignLeft | Qt::AlignVCenter; } p->drawText(tr, alignment, toolbutton->text); } else { //只显示icon情况 pr.moveCenter(rect.center()); drawIcon(toolbutton, p, pr, icon); } } } return; } case CE_HeaderSection: { const auto headerOption( qstyleoption_cast( opt ) ); if (!headerOption) return; const bool horizontal( headerOption->orientation == Qt::Horizontal ); const bool isLast( headerOption->position == QStyleOptionHeader::End ); // fill background QColor color(opt->palette.color(QPalette::Base)); QColor lineColor(opt->palette.color(QPalette::Button)); // 挑选一个比较接近的基准色 Button,基于此做微调 if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) { color = DGuiApplicationHelper::adjustColor(color, 0, 0, 0, 0, 0, 0, 60); lineColor = DGuiApplicationHelper::adjustColor(lineColor, 0, 0, 0, 0, 0, 0, 10); } else { color = DGuiApplicationHelper::adjustColor(color, 0, 0, -20, 0, 0, 0, 80); lineColor = DGuiApplicationHelper::adjustColor(lineColor, 0, 0, -25, 0, 0, 0, 0); } p->fillRect(opt->rect, QBrush(color)); p->setPen(lineColor); if (horizontal) { if (!isLast) { QPoint unit(0, opt->rect.height() / 5); p->drawLine(opt->rect.topRight() + unit, opt->rect.bottomRight() - unit); } p->drawLine(opt->rect.bottomLeft(), opt->rect.bottomRight()); } else { if (!isLast) { p->drawLine(opt->rect.bottomLeft(), opt->rect.bottomRight()); } p->drawLine(opt->rect.topRight(), opt->rect.bottomRight()); } return; } case CE_SizeGrip: { p->save(); int x, y, w, h; opt->rect.getRect(&x, &y, &w, &h); int sw = qMin(h, w); if (h > w) p->translate(0, h - w); else p->translate(w - h, 0); Qt::Corner corner; if (const QStyleOptionSizeGrip *sgOpt = qstyleoption_cast(opt)) corner = sgOpt->corner; else if (opt->direction == Qt::RightToLeft) corner = Qt::BottomLeftCorner; else corner = Qt::BottomRightCorner; bool ok = false; int radius = DStyle::pixelMetric(PM_FrameRadius, opt) / 2; int _d_radius = 0; if (opt->styleObject->property("_d_radius").isValid()) _d_radius = opt->styleObject->property("_d_radius").toInt(&ok); if (ok && _d_radius >= 0 && _d_radius != radius) radius = _d_radius; p->setRenderHint(QPainter::Antialiasing, true); DGuiApplicationHelper *guiAppHelp = DGuiApplicationHelper::instance(); if (guiAppHelp->themeType() == DGuiApplicationHelper::ColorType::DarkType) { //暗色主题 p->setPen(QPen(QColor(255, 255, 255, 0.2 * 255), 1)); } else { p->setPen(QPen(QColor(0, 0, 0, 0.2 * 255), 1)); } QRectF rectInner(0, 0, 1.4 * sw, 1.4 * sw); // 内侧弧线的外切正方形 QRectF rectExternal(0, 0, 2 * sw, 2 * sw); // 外侧弧线的外切正方形 if (corner == Qt::BottomLeftCorner) { rectExternal.moveBottomLeft(QPointF(opt->rect.bottomLeft().x() + radius, opt->rect.bottomLeft().y() - radius)); rectInner.moveCenter(rectExternal.center()); p->drawArc(rectInner, 205 * 16, 40 * 16); p->drawArc(rectExternal, 200 * 16, 50 * 16); } else if (corner == Qt::BottomRightCorner) { rectExternal.moveBottomRight(QPointF(opt->rect.bottomRight().x() - radius, opt->rect.bottomRight().y() - radius)); rectInner.moveCenter(rectExternal.center()); p->drawArc(rectInner, 295 * 16, 40 * 16); p->drawArc(rectExternal, 290 * 16, 50 * 16); } else if (corner == Qt::TopRightCorner) { rectExternal.moveTopRight(QPointF(opt->rect.topRight().x() - radius, opt->rect.topRight().y() + radius)); rectInner.moveCenter(rectExternal.center()); p->drawArc(rectInner, 25 * 16, 40 * 16); p->drawArc(rectExternal, 25 * 16, 50 * 16); } else if (corner == Qt::TopLeftCorner) { rectExternal.moveTopLeft(QPointF(opt->rect.topLeft().x() + radius, opt->rect.topLeft().y() + radius)); rectInner.moveCenter(rectExternal.center()); p->drawArc(rectInner, 115 * 16, 40 * 16); p->drawArc(rectExternal, 110 * 16, 50 * 16); } p->restore(); return; } case CE_ItemViewItem: { if (w && w->objectName() == "qt_calendar_calendarview") { if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { p->save(); p->setClipRect(opt->rect); //绘制禁用项 if (!(vopt->state & QStyle::State_Enabled)) { p->save(); p->setPen(Qt::NoPen); p->setBrush(getColor(vopt, DPalette::Window)); p->drawRect(vopt->rect); p->restore(); } // 绘制当前选中项 proxy()->drawPrimitive(PE_PanelItemViewItem, opt, p, w); // draw the text if (!vopt->text.isEmpty()) { QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled; if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) cg = QPalette::Inactive; if (vopt->state & QStyle::State_Selected) { p->setPen(vopt->palette.color(cg, QPalette::HighlightedText)); } else { p->setPen(vopt->palette.color(cg, QPalette::Text)); } QCommonStylePrivate *d = reinterpret_cast(qGetPtrHelper(d_ptr)); d->viewItemDrawText(p, vopt, opt->rect); } //绘制日历分割线 if (vopt->index.row() == 0) { p->save(); QColor color = getColor(vopt, DPalette::FrameBorder, w); color.setAlpha(static_cast(255 * 0.05)); QPen pen(color, 2); p->setPen(pen); const QTableView *view = static_cast(w); int margins = DStyle::pixelMetric(proxy(), DStyle::PM_ContentsMargins); if (vopt->index.column() == 0) p->drawLine(vopt->rect.bottomLeft() + QPoint(margins, 0), vopt->rect.bottomRight()); else if (vopt->index.column() == view->model()->columnCount() - 1) { p->drawLine(vopt->rect.bottomLeft(), vopt->rect.bottomRight() - QPoint(margins, 0)); } else { p->drawLine(vopt->rect.bottomLeft(), vopt->rect.bottomRight()); } p->restore(); } // draw the focus rect if (vopt->state & QStyle::State_HasFocus) { QStyleOptionFocusRect o; o.QStyleOption::operator=(*vopt); o.rect = proxy()->subElementRect(SE_ItemViewItemFocusRect, vopt, w); o.state |= QStyle::State_KeyboardFocusChange; o.state |= QStyle::State_Item; QPalette::ColorGroup cg = (vopt->state & QStyle::State_Enabled) ? QPalette::Normal : QPalette::Disabled; o.backgroundColor = vopt->palette.color(cg, (vopt->state & QStyle::State_Selected) ? QPalette::Highlight : QPalette::Window); proxy()->drawPrimitive(QStyle::PE_FrameFocusRect, &o, p, w); } p->restore(); } return; } break; } default: break; } DStyle::drawControl(element, opt, p, w); } bool ChameleonStyle::drawTabBar(QPainter *painter, const QStyleOptionTab *tab, const QWidget *widget) const { const QTabBar *m_tabbar = qobject_cast(widget); if (!m_tabbar) return false; painter->fillRect(tab->rect, getColor(tab, QPalette::Window)); painter->save(); bool isTriangularMode = false; bool rtlHorTabs = (tab->direction == Qt::RightToLeft && (tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedSouth)); bool selected = tab->state & State_Selected && tab->state & State_Enabled; bool lastTab = ((!rtlHorTabs && tab->position == QStyleOptionTab::End) || (rtlHorTabs && tab->position == QStyleOptionTab::Beginning)); bool onlyOne = tab->position == QStyleOptionTab::OnlyOneTab; int tabOverlap = proxy()->pixelMetric(PM_TabBarTabOverlap, tab, widget); QRect rect = tab->rect.adjusted(0, 0, (onlyOne || lastTab) ? 0 : tabOverlap, 0); QRect r2(rect); int x1 = r2.left(); int x2 = r2.right(); int y1 = r2.top(); int y2 = r2.bottom(); QTransform rotMatrix; bool flip = false; painter->setPen(getColor(tab, DPalette::Shadow)); switch (tab->shape) { case QTabBar::TriangularNorth: rect.adjust(0, 0, 0, -tabOverlap); isTriangularMode = true; break; case QTabBar::TriangularSouth: rect.adjust(0, tabOverlap, 0, 0); isTriangularMode = true; break; case QTabBar::TriangularEast: rect.adjust(tabOverlap, 0, 0, 0); isTriangularMode = true; break; case QTabBar::TriangularWest: rect.adjust(0, 0, -tabOverlap, 0); isTriangularMode = true; break; case QTabBar::RoundedNorth: break; case QTabBar::RoundedSouth: rotMatrix.rotate(180); rotMatrix.translate(0, -rect.height() + 1); rotMatrix.scale(-1, 1); painter->setTransform(rotMatrix, true); break; case QTabBar::RoundedWest: rotMatrix.rotate(180 + 90); rotMatrix.scale(-1, 1); flip = true; painter->setTransform(rotMatrix, true); break; case QTabBar::RoundedEast: rotMatrix.rotate(90); rotMatrix.translate(0, - rect.width() + 1); flip = true; painter->setTransform(rotMatrix, true); break; } if (flip) { QRect tmp = rect; rect = QRect(tmp.y(), tmp.x(), tmp.height(), tmp.width()); int temp = x1; x1 = y1; y1 = temp; temp = x2; x2 = y2; y2 = temp; } QColor lineColor = !isTriangularMode || selected ? Qt::transparent : getColor(tab, QPalette::Light); QColor tabFrameColor = selected ? getColor(tab, QPalette::Window) : getColor(tab, QPalette::Button); if (!(tab->features & QStyleOptionTab::HasFrame)) tabFrameColor = getColor(tab, QPalette::Shadow); if (!isTriangularMode) tabFrameColor = selected ? getColor(tab, QPalette::Highlight) : getColor(tab, QPalette::Button); QPen outlinePen(lineColor, proxy()->pixelMetric(PM_DefaultFrameWidth, tab, widget)); QRect drawRect = rect; painter->setPen(outlinePen); painter->setBrush(tabFrameColor); painter->setRenderHint(QPainter::Antialiasing, true); if (!isTriangularMode) { int buttonRadius = DStyle::pixelMetric(PM_FrameRadius, tab, widget); int buttonBorder = DStyle::pixelMetric(PM_FrameMargins, tab, widget); painter->drawRoundedRect(drawRect.adjusted(buttonBorder, buttonBorder, -buttonBorder, -buttonBorder), buttonRadius, buttonRadius); } else { painter->drawRect(drawRect); } painter->restore(); return true; } bool ChameleonStyle::drawTabBarLabel(QPainter *painter, const QStyleOptionTab *tab, const QWidget *widget) const { if (!widget) return false; bool type_check = false; bool selected = tab->state & State_Selected && tab->state & State_Enabled; if (widget) type_check = widget->property("_d_dtk_tabbartab_type").toBool(); bool visible_close_button = selected; if (visible_close_button) { if (const DTabBar *tb = qobject_cast(widget)) { visible_close_button = tb->tabsClosable(); } else { visible_close_button = false; } } QStyleOptionTab newTab = *tab; if (selected) { QPalette::ColorRole role = type_check ? QPalette::Highlight : QPalette::HighlightedText; newTab.palette.setBrush(QPalette::WindowText, adjustColor(getColor(tab, role), 0, 0, 0, 0, 0, 0, 50)); // 拖拽的tab不需要绘制渐变到透明,因为没有关闭按钮。拖拽标签时是生成图片 QPaintDevice 是 QPixMap bool is_moving_tab = painter->device()->devType() != QInternal::Widget; if (visible_close_button && !is_moving_tab) { QRect tr = proxy()->subElementRect(SE_TabBarTabText, tab, widget); QRect text_rect; if (const DTabBar *tabbar = qobject_cast(widget)) { int alignment = tabbar->property("_d_dtk_tabbar_alignment").toInt(); text_rect = tab->fontMetrics.boundingRect(tr, alignment | Qt::TextShowMnemonic, tab->text); } else { text_rect = tab->fontMetrics.boundingRect(tr, Qt::AlignCenter | Qt::TextShowMnemonic, tab->text); } int close_button_width = proxy()->pixelMetric(QStyle::PM_TabCloseIndicatorWidth, tab, widget); // 防止在平板中错误的对文字渐变 if (DGuiApplicationHelper::isTabletEnvironment()) close_button_width = TabBar_TabButtonSize; QBrush brush; //选中状态下文字颜色 if (type_check) { brush = getColor(tab, QPalette::Highlight); } else { brush = newTab.palette.windowText(); } // 小心除以 0 qreal stop = text_rect.width() > 0 ? qreal(tr.right() - close_button_width - text_rect.x() - 5) / text_rect.width() : 1.0; if (stop < 1 && stop > 0 && tr.right() - close_button_width < text_rect.right()) { QLinearGradient lg(0, 0, 1, 0); QGradientStops stops; qreal offset = 5.0 / text_rect.width(); // 接近关闭按钮部分的颜色渐变到透明 stops << QGradientStop{0, brush.color()}; stops << QGradientStop{qMax(0.0, stop - offset), brush.color()}; stops << QGradientStop{stop, QColor(brush.color().red(), brush.color().green(), brush.color().blue(), 100)}; // 保证文字超出最大可显示区域的部分为透明 if (text_rect.right() > tr.right()) stops << QGradientStop{1 - (text_rect.right() - tr.right()) / qreal(text_rect.width()), Qt::transparent}; stops << QGradientStop{1, Qt::transparent}; lg.setCoordinateMode(QLinearGradient::ObjectBoundingMode); lg.setStops(stops); newTab.palette.setBrush(QPalette::WindowText, lg); } else { newTab.palette.setBrush(QPalette::WindowText, brush); } } // 禁止QCommonStyle中绘制默认的焦点颜色 newTab.state &= ~QStyle::State_HasFocus; if (tab->state & QStyle::State_HasFocus) { QStyleOptionFocusRect fropt; fropt.QStyleOption::operator=(*tab); proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); } } else { if (type_check) { newTab.palette.setBrush(QPalette::WindowText, QColor("#798190")); } //靠近边缘的文字渐变 if (const DTabBar *tab = qobject_cast(widget)) { if (!tab->expanding()) { QRect tr = proxy()->subElementRect(SE_TabBarTabText, &newTab, widget); int alignment = tab->property("_d_dtk_tabbar_alignment").toInt(); QRect text_rect = newTab.fontMetrics.boundingRect(tr, alignment | Qt::TextShowMnemonic, newTab.text); QRect tabbar_rect = widget->findChild()->rect(); bool vertTabs = verticalTabs(newTab.shape); int stopx = tabbar_rect.x() + (vertTabs ? tabbar_rect.height() : tabbar_rect.width()); int tabX = (vertTabs ? newTab.rect.y() : text_rect.x()) + (vertTabs ? tabbar_rect.y() : tabbar_rect.x()); int tabWidth = tabX + text_rect.width(); if (text_rect.width() > 0 && tabX < stopx && stopx < tabWidth) { const QBrush &brush = newTab.palette.windowText(); QLinearGradient lg(0, 0, 1, 0); QGradientStops stops; qreal stop = static_cast(tabWidth - stopx) / text_rect.width(); stops << QGradientStop{0, brush.color()}; stops << QGradientStop{qMax(0.0, 1 - stop - 0.2), brush.color()}; stops << QGradientStop{qMax(0.0, 1 - stop), Qt::transparent}; lg.setCoordinateMode(QLinearGradient::ObjectBoundingMode); lg.setStops(stops); newTab.palette.setBrush(QPalette::WindowText, lg); } } } } if (const DTabBar *tb = qobject_cast(widget)) { //Qt源码 QRect tr = tab->rect; bool verticalTabs = tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::RoundedWest || tab->shape == QTabBar::TriangularEast || tab->shape == QTabBar::TriangularWest; int alignment = tb->property("_d_dtk_tabbar_alignment").toInt() | Qt::TextShowMnemonic; if (!proxy()->styleHint(SH_UnderlineShortcut, &newTab, widget)) alignment |= Qt::TextHideMnemonic; if (verticalTabs) { painter->save(); int newX, newY, newRot; if (tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::TriangularEast) { newX = tr.width() + tr.x(); newY = tr.y(); newRot = 90; } else { newX = tr.x(); newY = tr.y() + tr.height(); newRot = -90; } QTransform m = QTransform::fromTranslate(newX, newY); m.rotate(newRot); painter->setTransform(m, true); } QRect iconRect; tabLayout(tab, widget, &tr, &iconRect); tr = proxy()->subElementRect(SE_TabBarTabText, &newTab, widget); if (!tab->icon.isNull()) { QPixmap tabIcon = tab->icon.pixmap(widget ? widget->window()->windowHandle() : 0, tab->iconSize, (tab->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled, (tab->state & State_Selected) ? QIcon::On : QIcon::Off); painter->drawPixmap(iconRect, tabIcon); } proxy()->drawItemText(painter, tr.adjusted(1, 0, 0, 0), alignment, newTab.palette, newTab.state & State_Enabled, newTab.text, QPalette::WindowText); if (verticalTabs) painter->restore(); } else { QCommonStyle::drawControl(CE_TabBarTabLabel, &newTab, painter, widget); } return true; } void ChameleonStyle::tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const { QRect tr = opt->rect; bool verticalTabs = opt->shape == QTabBar::RoundedEast || opt->shape == QTabBar::RoundedWest || opt->shape == QTabBar::TriangularEast || opt->shape == QTabBar::TriangularWest; if (verticalTabs) tr.setRect(0, 0, tr.height(), tr.width()); // 0, 0 as we will have a translate transform int verticalShift = proxy()->pixelMetric(QStyle::PM_TabBarTabShiftVertical, opt, widget); int horizontalShift = proxy()->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, opt, widget); int hpadding = proxy()->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2; int vpadding = proxy()->pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2; if (opt->shape == QTabBar::RoundedSouth || opt->shape == QTabBar::TriangularSouth) verticalShift = -verticalShift; tr.adjust(hpadding, verticalShift - vpadding, horizontalShift - hpadding, vpadding); bool selected = opt->state & QStyle::State_Selected; if (selected) { tr.setTop(tr.top() - verticalShift); tr.setRight(tr.right() - horizontalShift); } // left widget if (!opt->leftButtonSize.isEmpty()) { tr.setLeft(tr.left() + 4 + (verticalTabs ? opt->leftButtonSize.height() : opt->leftButtonSize.width())); } // right widget if (!opt->rightButtonSize.isEmpty()) { tr.setRight(tr.right() - 4 - (verticalTabs ? opt->rightButtonSize.height() : opt->rightButtonSize.width())); } // icon if (!opt->icon.isNull()) { QSize iconSize = opt->iconSize; if (!iconSize.isValid()) { int iconExtent = proxy()->pixelMetric(QStyle::PM_SmallIconSize); iconSize = QSize(iconExtent, iconExtent); } QSize tabIconSize = opt->icon.actualSize(iconSize, (opt->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled, (opt->state & QStyle::State_Selected) ? QIcon::On : QIcon::Off); // High-dpi icons do not need adjustment; make sure tabIconSize is not larger than iconSize tabIconSize = QSize(qMin(tabIconSize.width(), iconSize.width()), qMin(tabIconSize.height(), iconSize.height())); // 由于Qt的历史原因 center 返回的坐标总是比矩形的真是中心坐标少一个像素 导致绘制图标时竖直方向无法对齐 *iconRect = QRect(tr.left(), tr.center().y() - tabIconSize.height() / 2 + 1, tabIconSize.width(), tabIconSize.height()); if (!verticalTabs) *iconRect = proxy()->visualRect(opt->direction, opt->rect, *iconRect); tr.setLeft(tr.left() + tabIconSize.width() + 4); } if (!verticalTabs) tr = proxy()->visualRect(opt->direction, opt->rect, tr); *textRect = tr; } bool ChameleonStyle::drawTableViewItem(QStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const { if(!qobject_cast(w)) return false; const QStyleOptionViewItem *vopt = qstyleoption_cast(opt); if (!vopt) return false; int frame_radius = DStyle::pixelMetric(PM_FrameRadius, opt, w); QRect select_rect = opt->rect; // 设置item的背景颜色 p->setPen(Qt::NoPen); if (vopt->state & QStyle::State_Selected) { if (!vopt->showDecorationSelected) { select_rect = proxy()->subElementRect(QStyle::SE_ItemViewItemText, opt, w); } else { select_rect -= frameExtentMargins(); } p->setBrush(getColor(opt, QPalette::Highlight)); } else { p->setBrush(vopt->backgroundBrush); } // 绘制背景,选中的item圆角由属性来控制 if (w->property("_d_dtk_enable_tableviewitem_radius").toBool()) { p->setRenderHint(QPainter::Antialiasing); p->drawRoundedRect(select_rect, frame_radius, frame_radius); } else { // 所有的item都是非圆角 const_cast(vopt)->palette.setBrush(vopt->palette.currentColorGroup(), QPalette::Highlight, getColor(opt, QPalette::Highlight)); DStyle::drawPrimitive(pe, vopt, p, w); } return true; } bool ChameleonStyle::drawTabBarCloseButton(QPainter *painter, const QStyleOption *tab, const QWidget *widget) const { if (!widget) return false; const QTabBar *tb = qobject_cast(widget->parent()); if (!tb) { if (const QWidget *w = dynamic_cast(painter->device())) widget = w; tb = qobject_cast(widget->parent()); } if (Q_UNLIKELY(!tb)) return false; int index = -1; for (int i = 0; i < tb->count(); ++i) { if (Q_LIKELY(tb->tabButton(i, QTabBar::LeftSide) != widget && tb->tabButton(i, QTabBar::RightSide) != widget)) { continue; } index = i; break; } if (Q_UNLIKELY(index < 0)) return true; QStyleOptionButton buttonOpt; buttonOpt.rect = tab->rect; buttonOpt.state = tab->state; QColor iconColor = getColor(&buttonOpt, QPalette::ButtonText); painter->setPen(QPen(iconColor, 2)); painter->setBrush(getColor(&buttonOpt, QPalette::Button)); DDrawUtils::drawCloseButton(painter, buttonOpt.rect); return true; } bool ChameleonStyle::drawTabBarScrollButton(QPainter *painter, const QStyleOption *opt, const QWidget *buttonWidget) const { const QToolButton *tabButton = qobject_cast(buttonWidget); if (!tabButton) return false; if (tabButton->arrowType() == Qt::NoArrow || !tabButton->icon().isNull()) return false; bool isTriangularMode = false; if (QTabBar *tabBar = qobject_cast(buttonWidget->parent())) { switch (tabBar->shape()) { case QTabBar::TriangularNorth: case QTabBar::TriangularSouth: case QTabBar::TriangularEast: case QTabBar::TriangularWest: isTriangularMode = true; break; default: break; } } QStyleOptionToolButton toolButton(*qstyleoption_cast(opt)); int frameMargin = DStyle::pixelMetric(PM_FrameMargins); toolButton.rect -= QMargins(frameMargin, frameMargin, frameMargin, frameMargin); QPoint center = toolButton.rect.center(); qreal sizeRatio = isTriangularMode ? (4.0 / 7.0) : 1.0; int minBoundWidth = qMin(toolButton.rect.width(), toolButton.rect.height()); toolButton.rect.setWidth(qRound(minBoundWidth * sizeRatio)); toolButton.rect.setHeight(qRound(minBoundWidth * sizeRatio)); toolButton.rect.moveCenter(center); DDrawUtils::Corners corner = static_cast(0xff); int radius = isTriangularMode ? toolButton.rect.width() / 2 : DStyle::pixelMetric(PM_FrameRadius); QLinearGradient lg(QPointF(0, opt->rect.top()), QPointF(0, opt->rect.bottom())); lg.setColorAt(0, getColor(opt, QPalette::Light)); lg.setColorAt(1, getColor(opt, QPalette::Dark)); painter->setPen(QPen(getColor(opt, DPalette::FrameBorder, buttonWidget), Metrics::Painter_PenWidth)); painter->setBrush(lg); painter->setRenderHint(QPainter::Antialiasing); drawShadow(painter, toolButton.rect + frameExtentMargins() * 1.5, getColor(&toolButton, QPalette::Shadow)); DDrawUtils::drawRoundedRect(painter, toolButton.rect, radius, radius, corner); QPoint originCenter = toolButton.rect.center(); qreal buttonSizeRatio = isTriangularMode ? 3.0 / 4.0 : 1.0 / 2.0; toolButton.rect.setWidth(qRound(toolButton.rect.width() * buttonSizeRatio)); toolButton.rect.setHeight(qRound(toolButton.rect.height() * buttonSizeRatio)); toolButton.rect.moveCenter(originCenter); proxy()->drawControl(CE_ToolButtonLabel, &toolButton, painter, buttonWidget); return true; } bool ChameleonStyle::drawComboBox(QPainter *painter, const QStyleOptionComboBox *comboBox, const QWidget *widget) const { QRect rect(comboBox->rect); QStyleOptionComboBox comboBoxCopy = *comboBox; QRect downArrowRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, SC_ComboBoxArrow, widget); if (comboBox->frame && comboBox->subControls & SC_ComboBoxFrame) { int frameRadius = DStyle::pixelMetric(PM_FrameRadius); painter->setPen(Qt::NoPen); painter->setRenderHint(QPainter::Antialiasing); if (comboBox->editable) { if (widget->testAttribute(Qt::WA_SetPalette)) { painter->setBrush(comboBox->palette.button()); } else { const QComboBox *combobox = qobject_cast(widget); if (combobox && combobox->lineEdit()) { if (combobox->lineEdit()->testAttribute(Qt::WA_SetPalette)) { painter->setBrush(combobox->lineEdit()->palette().button()); } else { painter->setBrush(getThemTypeColor(QColor(0, 0, 0, 255 * 0.08), QColor(255, 255, 255, 255 * 0.15))); } } } } else { painter->setBrush(Qt::transparent); } DDrawUtils::drawRoundedRect(painter, comboBoxCopy.rect, frameRadius, frameRadius, DDrawUtils::Corner::TopLeftCorner | DDrawUtils::Corner::TopRightCorner | DDrawUtils::Corner::BottomLeftCorner | DDrawUtils::Corner::BottomRightCorner); } QStyleOptionButton buttonOption; buttonOption.QStyleOption::operator=(*comboBox); if (comboBox->editable) { buttonOption.rect = rect; buttonOption.state = (comboBox->state & (State_Enabled | State_MouseOver | State_HasFocus)) | State_KeyboardFocusChange; // Always show hig if (comboBox->state & State_Sunken) { buttonOption.state |= State_Sunken; buttonOption.state &= ~State_MouseOver; } if (comboBox->direction == Qt::LeftToRight) buttonOption.rect.setLeft(downArrowRect.left()); else buttonOption.rect.setRight(downArrowRect.right()); downArrowRect.moveCenter(buttonOption.rect.center()); proxy()->drawPrimitive(PE_PanelButtonCommand, &buttonOption, painter, widget); } else { buttonOption.rect = rect; buttonOption.state = comboBox->state & (State_Enabled | State_MouseOver | State_HasFocus | State_KeyboardFocusChange); if (comboBox->state & State_Sunken) { buttonOption.state |= State_Sunken; buttonOption.state &= ~State_MouseOver; } downArrowRect.moveCenter(buttonOption.rect.center()); if (comboBox->direction == Qt::LeftToRight) { downArrowRect.moveRight(buttonOption.rect.right()); } else { downArrowRect.moveLeft(buttonOption.rect.left()); } proxy()->drawPrimitive(PE_PanelButtonCommand, &buttonOption, painter, widget); } if (comboBox->subControls & SC_ComboBoxArrow) { QStyleOption arrowOpt = *comboBox; arrowOpt.rect = downArrowRect - frameExtentMargins(); if (comboBox->editable) { arrowOpt.rect.setSize(QSize(qRound(buttonOption.rect.width() / 3.0), qRound(buttonOption.rect.height() / 3.0))); arrowOpt.rect.moveCenter(buttonOption.rect.center()); } else { QPoint center = arrowOpt.rect.center(); arrowOpt.rect.setSize(QSize(qRound(arrowOpt.rect.height() / 2.4), qRound(arrowOpt.rect.height() / 2.4))); arrowOpt.rect.moveCenter(center); int radius = DStyle::pixelMetric(PM_FrameRadius); arrowOpt.rect = arrowOpt.rect.adjusted(-radius, 0, -radius, 0); } painter->setPen(getColor(comboBox, DPalette::ButtonText)); proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget); } if (comboBox->state.testFlag(QStyle::State_HasFocus)) { proxy()->drawPrimitive(PE_FrameFocusRect, comboBox, painter, widget); } return true; } bool ChameleonStyle::drawComboBoxLabel(QPainter *painter, const QStyleOptionComboBox *cb, const QWidget *widget) const { const bool hasText(!cb->currentText.isEmpty()); const bool hasIcon(!cb->currentIcon.isNull()); // const bool enabled(cb->state & QStyle::State_Enabled); const bool sunken(cb->state & (QStyle::State_On | QStyle::State_Sunken)); // const bool mouseOver(cb->state & QStyle::State_MouseOver); // const bool hasFocus(cb->state & QStyle::State_HasFocus); const bool flat(!cb->frame); const bool editable(cb->editable); QRect contentsRect(cb->rect); if (sunken && !flat) contentsRect.translate(1, 1); contentsRect.adjust(Metrics::Layout_ChildMarginWidth, 0, -Metrics::Layout_ChildMarginWidth - DStyle::pixelMetric(PM_FrameRadius), 0); QSize iconSize; if (hasIcon) { iconSize = cb->iconSize; if (!iconSize.isValid() && widget) { const int metric(widget->style()->pixelMetric(QStyle::PM_SmallIconSize, cb, widget)); iconSize = QSize(metric, metric); } } int textFlags(Qt::AlignVCenter | Qt::AlignLeft); const QSize textSize(cb->fontMetrics.size(textFlags, cb->currentText)); if (styleHint(SH_UnderlineShortcut, cb, widget)) textFlags |= Qt::TextShowMnemonic; else textFlags |= Qt::TextHideMnemonic; QRect iconRect; QRect textRect; QRect downArrowRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxArrow, widget); if (hasText && !hasIcon) { textRect = contentsRect; int leftMargin = Metrics::ComboBox_ContentLeftMargin; textRect.adjust(leftMargin, 0, 0, 0); textRect.setWidth(textRect.width() - downArrowRect.width()); } else { const int contentsWidth(iconSize.width() + textSize.width() + Metrics::Button_ItemSpacing); const int contentLeftPadding = flat ? (contentsRect.width() - contentsWidth) / 2 : Metrics::ComboBox_ContentLeftMargin; iconRect = QRect(QPoint(contentsRect.left() + contentLeftPadding, contentsRect.top() + (contentsRect.height() - iconSize.height()) / 2), iconSize); const int availableTextWidth = contentsRect.width() - contentLeftPadding - iconSize.width() - Metrics::Icon_Margins - downArrowRect.width(); textRect = QRect(QPoint(iconRect.right() + Metrics::Icon_Margins + 1, contentsRect.top() + (contentsRect.height() - textSize.height()) / 2), QSize(availableTextWidth, textSize.height())); } // handle right to left if (iconRect.isValid()) iconRect = visualRect(cb->direction, cb->rect, iconRect); if (textRect.isValid()) textRect = visualRect(cb->direction, cb->rect, textRect); // render icon if (hasIcon && iconRect.isValid()) { // icon state and mode cb->currentIcon.paint(painter, iconRect, Qt::AlignLeft); } // render text if (hasText && textRect.isValid() && !editable) { painter->setPen(getColor(cb, QPalette::ButtonText)); QString text = painter->fontMetrics().elidedText(cb->currentText, Qt::ElideRight, textRect.width()); textRect.setWidth(textRect.width() + downArrowRect.width()); painter->drawText(textRect, textFlags, text); } return true; } void ChameleonStyle::drawSliderHandle(const QStyleOptionComplex *opt, QRectF& rectHandle, QPainter *p, const QWidget *w) const { if (const QStyleOptionSlider *slider = qstyleoption_cast(opt)) { const DSlider *dslider = qobject_cast(w); QSlider::TickPosition tickPosition = slider->tickPosition; if (dslider) tickPosition = dslider->tickPosition(); if (tickPosition == QSlider::NoTicks) { p->drawRoundedRect(rectHandle, DStyle::pixelMetric(DStyle::PM_FrameRadius), DStyle::pixelMetric(DStyle::PM_FrameRadius)); } else { qreal radius = DStyle::pixelMetric(DStyle::PM_FrameRadius); QRectF rectRoundedPart(0, 0, 0, 0); if (slider->orientation == Qt::Horizontal) { if (tickPosition == QSlider::TicksAbove) { //尖角朝上 rectRoundedPart = QRectF(rectHandle.left(), rectHandle.bottom() - 2 * radius, rectHandle.width(), 2 * radius); QPointF polygon[5] = { QPointF(rectHandle.left(), rectHandle.bottom() - radius) , QPointF(rectHandle.left(), rectHandle.top() + radius) , QPointF(rectHandle.center().x(), rectHandle.top()) , QPointF(rectHandle.right(), rectHandle.top() + radius) , QPointF(rectHandle.right(), rectHandle.bottom() - radius)}; p->drawPolygon(polygon, 5); } else { //尖角朝下 rectRoundedPart = QRectF(rectHandle.left(), rectHandle.top(), rectHandle.width(), 2 * radius); QPointF polygon[5] = { QPointF(rectHandle.left(), rectHandle.top() + radius) , QPointF(rectHandle.left(), rectHandle.bottom() - radius) , QPointF(rectHandle.center().x(), rectHandle.bottom()) , QPointF(rectHandle.right(), rectHandle.bottom() - radius) , QPointF(rectHandle.right(), rectHandle.top() + radius)}; p->drawPolygon(polygon, 5); } } else { if (tickPosition == QSlider::TicksLeft) { //尖角朝左 rectRoundedPart = QRectF(rectHandle.right() - 2 * radius, rectHandle.top(), 2 * radius, rectHandle.height()); QPointF polygon[5] = { QPointF(rectHandle.right() - radius, rectHandle.top()) , QPointF(rectHandle.left() + radius, rectHandle.top()) , QPointF(rectHandle.left(), rectHandle.center().y()) , QPointF(rectHandle.left() + radius, rectHandle.bottom()) , QPointF(rectHandle.right() - radius, rectHandle.bottom())}; p->drawPolygon(polygon, 5); } else { //尖角朝右 rectRoundedPart = QRectF(rectHandle.left(), rectHandle.top(), 2 * radius, rectHandle.height()); QPointF polygon[5] = { QPointF(rectHandle.left() + radius, rectHandle.top()) , QPointF(rectHandle.right() - radius, rectHandle.top()) , QPointF(rectHandle.right(), rectHandle.center().y()) , QPointF(rectHandle.right() - radius, rectHandle.bottom()) , QPointF(rectHandle.left() + radius, rectHandle.bottom())}; p->drawPolygon(polygon, 5); } } p->drawRoundedRect(rectRoundedPart, DStyle::pixelMetric(DStyle::PM_FrameRadius), DStyle::pixelMetric(DStyle::PM_FrameRadius)); } } } void ChameleonStyle::drawSliderHandleFocus(const QStyleOptionComplex *opt, QRectF &rectHandle, QPainter *p, const QWidget *w) const { if (const QStyleOptionSlider *slider = qstyleoption_cast(opt)) { const DSlider *dslider = qobject_cast(w); QSlider::TickPosition tickPosition = slider->tickPosition; int lineOffset = DStyle::pixelMetric(PM_FocusBorderWidth) / 2; int margin = DStyle::pixelMetric(PM_FocusBorderWidth) + DStyle::pixelMetric(PM_FocusBorderSpacing); int marginRect = DStyle::pixelMetric(PM_FocusBorderSpacing) + lineOffset; if (dslider) tickPosition = dslider->tickPosition(); if (tickPosition == QSlider::NoTicks) { p->drawRoundedRect(rectHandle.adjusted(-marginRect, -marginRect, marginRect, marginRect), DStyle::pixelMetric(DStyle::PM_FrameRadius) + marginRect, DStyle::pixelMetric(DStyle::PM_FrameRadius) + marginRect); } else { qreal radius = DStyle::pixelMetric(DStyle::PM_FrameRadius); QPainterPath focusPath; if (slider->orientation == Qt::Horizontal) { if (tickPosition == QSlider::TicksAbove) { //尖角朝上 focusPath.moveTo(QPointF(rectHandle.left() - marginRect, rectHandle.bottom() - radius)); focusPath.lineTo(QPointF(rectHandle.left() - marginRect, rectHandle.top() + radius - lineOffset)); focusPath.lineTo(QPointF(rectHandle.center().x(), rectHandle.top() - margin)); focusPath.lineTo(QPointF(rectHandle.right() + marginRect, rectHandle.top() + radius - lineOffset)); focusPath.lineTo(QPointF(rectHandle.right() + marginRect, rectHandle.bottom() - radius)); focusPath.arcTo(QRectF(rectHandle.right() - radius -radius - marginRect, rectHandle.bottom() - radius - radius -marginRect, 2 *(radius + marginRect), 2 * (radius + marginRect)), -0, -90); focusPath.lineTo(QPointF(rectHandle.left() + radius, rectHandle.bottom() + marginRect)); focusPath.arcTo(QRectF(rectHandle.left() - marginRect, rectHandle.bottom() - radius -radius -marginRect, 2 * (radius + marginRect), 2 * (radius + marginRect)), -90, -90); } else { //尖角朝下 focusPath.moveTo(QPointF(rectHandle.left() - marginRect, rectHandle.top() + radius)); focusPath.lineTo(QPointF(rectHandle.left() - marginRect, rectHandle.bottom() - radius + lineOffset)); focusPath.lineTo(QPointF(rectHandle.center().x(), rectHandle.bottom() + margin)); focusPath.lineTo(QPointF(rectHandle.right() + marginRect, rectHandle.bottom() - radius + lineOffset)); focusPath.lineTo(QPointF(rectHandle.right() + marginRect, rectHandle.top() + radius)); focusPath.arcTo(QRectF(rectHandle.right() - radius -radius - marginRect, rectHandle.top() - marginRect, 2 *(radius + marginRect), 2 * (radius + marginRect)), 0, 90); focusPath.lineTo(QPointF(rectHandle.left() + radius, rectHandle.top() - marginRect)); focusPath.arcTo(QRectF(rectHandle.left() - marginRect, rectHandle.top() - marginRect, 2 * (radius + marginRect), 2 * (radius + marginRect)), 90, 90); } } else { if (tickPosition == QSlider::TicksLeft) { //尖角朝左 focusPath.moveTo(QPointF(rectHandle.right() - radius, rectHandle.top() - marginRect)); focusPath.lineTo(QPointF(rectHandle.left() + radius - lineOffset, rectHandle.top() - marginRect)); focusPath.lineTo(QPointF(rectHandle.left() - margin, rectHandle.center().y())); focusPath.lineTo(QPointF(rectHandle.left() + radius - lineOffset, rectHandle.bottom() + marginRect)); focusPath.lineTo(QPointF(rectHandle.right() - radius, rectHandle.bottom() + marginRect)); focusPath.arcTo(QRectF(rectHandle.right() - radius - radius - marginRect, rectHandle.bottom() - radius - radius - marginRect, 2 *(radius + marginRect), 2 * (radius + marginRect)), -90, 90); focusPath.lineTo(QPointF(rectHandle.right() + marginRect, rectHandle.top() + radius)); focusPath.arcTo(QRectF(rectHandle.right() - radius - radius - marginRect, rectHandle.top() - marginRect, 2 * (radius + marginRect), 2 * (radius + marginRect)), 0, 90); } else { //尖角朝右 focusPath.moveTo(QPointF(rectHandle.left() + radius, rectHandle.top() - marginRect)); focusPath.lineTo(QPointF(rectHandle.right() - radius + lineOffset, rectHandle.top() - marginRect)); focusPath.lineTo(QPointF(rectHandle.right() + margin, rectHandle.center().y())); focusPath.lineTo(QPointF(rectHandle.right() - radius + lineOffset, rectHandle.bottom() + marginRect)); focusPath.lineTo(QPointF(rectHandle.left() + radius, rectHandle.bottom() + marginRect)); focusPath.arcTo(QRectF(rectHandle.left() - marginRect, rectHandle.bottom() - radius - radius - marginRect, 2 *(radius + marginRect), 2 * (radius + marginRect)), -90, -90); focusPath.lineTo(QPointF(rectHandle.left() - marginRect, rectHandle.top() + radius)); focusPath.arcTo(QRectF(rectHandle.left() - marginRect, rectHandle.top() - marginRect, 2 * (radius + marginRect), 2 * (radius + marginRect)), 180, -90); } } p->drawPath(focusPath); } } } void ChameleonStyle::drawIcon(const QStyleOption *opt, QPainter *p, QRect& rect, const QIcon& icon, bool checked) const { bool enabled = opt->state & State_Enabled; bool selected = opt->state & State_Selected && enabled; QIcon::Mode mode = !enabled ? QIcon::Disabled : (selected ? QIcon::Selected : QIcon::Normal); if (mode == QIcon::Normal && opt->state & State_On) mode = QIcon::Selected; icon.paint(p, rect, Qt::AlignCenter, mode, checked ? QIcon::On : QIcon::Off); } #ifndef QT_NO_ANIMATION dstyle::DStyleAnimation *ChameleonStyle::animation(const QObject *target) const { return animations.value(target, nullptr); } void ChameleonStyle::startAnimation(dstyle::DStyleAnimation *animation, int delay) const { connect(animation, &dstyle::DStyleAnimation::destroyed, this, &ChameleonStyle::_q_removeAnimation, Qt::UniqueConnection); animations.insert(animation->target(), animation); if (delay > 0) { QTimer::singleShot(delay, animation, SLOT(start())); } else { animation->start(); } } void ChameleonStyle::_q_removeAnimation() { QObject* animation = sender(); if (animation) animations.remove(animation->parent()); } #endif bool ChameleonStyle::drawMenuBarItem(const QStyleOptionMenuItem *option, QRect &rect, QPainter *painter, const QWidget *widget) const { bool enabled(option->state & QStyle::State_Enabled); bool mouseOver((option->state & QStyle::State_MouseOver) && enabled); bool sunken((option->state & QStyle::State_Sunken) && enabled); if (mouseOver || sunken) { QBrush background(getColor(option, QPalette::Highlight)); qreal radius = DStyle::pixelMetric(DStyle::PM_FrameRadius); painter->setRenderHint(QPainter::Antialiasing); painter->setPen(Qt::NoPen); painter->setBrush(background); painter->drawRoundedRect(rect, radius, radius); } if (option) { int alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; if (!proxy()->styleHint(SH_UnderlineShortcut, option, widget)) alignment |= Qt::TextHideMnemonic; int iconExtent = proxy()->pixelMetric(PM_SmallIconSize); QPixmap pix = option->icon.pixmap(widget ? widget->window()->windowHandle() : nullptr, QSize(iconExtent, iconExtent), (enabled) ? (mouseOver ? QIcon::Active : QIcon::Normal) : QIcon::Disabled); if (!pix.isNull()) { proxy()->drawItemPixmap(painter, option->rect, alignment, pix); } else { QStyleOptionMenuItem itemOption = *option; if (mouseOver || sunken) itemOption.palette.setBrush(QPalette::ButtonText, itemOption.palette.highlightedText()); proxy()->drawItemText(painter, itemOption.rect, alignment, itemOption.palette, enabled, itemOption.text, QPalette::ButtonText); } } return true; } void ChameleonStyle::drawMenuItemBackground(const QStyleOption *option, QPainter *painter, QStyleOptionMenuItem::MenuItemType type) const { QBrush color; bool selected = (option->state & QStyle::State_Enabled) && option->state & QStyle::State_Selected; if (selected && (DGuiApplicationHelper::isTabletEnvironment() || !DGuiApplicationHelper::isSpecialEffectsEnvironment())) { painter->setPen(Qt::NoPen); painter->setBrush(getColor(option, QPalette::Highlight)); painter->drawRect(option->rect); return; } // 清理旧的阴影 if (option->styleObject) { const QRect shadow = option->styleObject->property("_d_menu_shadow_rect").toRect(); const QRect shadow_base = option->styleObject->property("_d_menu_shadow_base_rect").toRect(); // 如果当前菜单项时已选中的,并且shadow_base不等于当前区域,此时应当清理阴影区域 // 如果当前要绘制的item是触发阴影绘制的那一项,那么,此时应当清空阴影区域 if ((selected && shadow_base != option->rect) || (!selected && shadow_base == option->rect) || (!selected && shadow_base.width() != option->rect.width())) { // 清空阴影区域 option->styleObject->setProperty("_d_menu_shadow_rect", QVariant()); option->styleObject->setProperty("_d_menu_shadow_base_rect", QVariant()); // 确保阴影区域能重绘 if (QWidget *w = qobject_cast(option->styleObject)) { w->update(shadow); } } } if (selected) { color = option->palette.highlight(); // draw shadow if (type == QStyleOptionMenuItem::Normal) { if (option->styleObject) { QRect shadow(0, 0, option->rect.width(), 7); shadow.moveTop(option->rect.bottom() + 1); option->styleObject->setProperty("_d_menu_shadow_rect", shadow); option->styleObject->setProperty("_d_menu_shadow_base_rect", option->rect); // 确保阴影区域能重绘 if (QWidget *w = qobject_cast(option->styleObject)) { w->update(shadow); } } } painter->fillRect(option->rect, color); } else { color = option->palette.background().color(); if (color.color().isValid()) { QColor c = color.color(); // 未开启窗口混成时不应该设置背景色的alpha通道,应当显示纯色背景(设置StyleSheet时,不加载此设置,防止alpha通道等对其造成影响) if (DWindowManagerHelper::instance()->hasComposite() && qobject_cast(option->styleObject) && !qobject_cast(option->styleObject)->testAttribute(Qt::WA_StyleSheet)) { if (DGuiApplicationHelper::toColorType(c) == DGuiApplicationHelper::LightType) { c = Qt::white; c.setAlphaF(0.4); } else { //在深色背景下,为了处理QComboBox的ListView的背景色和menuItem的背景色不一致的问题,加一个判断 if (qobject_cast(option->styleObject)) c = DGuiApplicationHelper::adjustColor(c, 0, 0, -10, 0, 0, 0, 0); c.setAlphaF(0.8); } } color = c; } painter->fillRect(option->rect, color); if (type == QStyleOptionMenuItem::Separator) { QColor colorSeparator; DGuiApplicationHelper *guiAppHelp = DGuiApplicationHelper::instance(); if (guiAppHelp->themeType() == DGuiApplicationHelper::ColorType::DarkType) colorSeparator = QColor(255, 255, 255, 255 * 0.05); else colorSeparator = QColor(0, 0, 0, 255 * 0.1); painter->fillRect(option->rect, colorSeparator); } if (!option->styleObject) return; // 为上一个item绘制阴影 const QRect shadow = option->styleObject->property("_d_menu_shadow_rect").toRect(); // 判断阴影rect是否在自己的区域 if (!option->rect.contains(shadow.center())) return; static QColor shadow_color; static QPixmap shadow_pixmap; if (shadow_color != option->palette.color(QPalette::Active, QPalette::Highlight)) { shadow_color = option->palette.color(QPalette::Active, QPalette::Highlight); QImage image(":/chameleon/menu_shadow.svg"); QPainter pa(&image); pa.setCompositionMode(QPainter::CompositionMode_SourceIn); pa.fillRect(image.rect(), shadow_color); shadow_pixmap = QPixmap::fromImage(image); } if (!shadow_pixmap.isNull()) { if (QMenu *menu = qobject_cast(option->styleObject)) { if (!menu->geometry().contains(QCursor::pos())) return; } painter->drawPixmap(shadow, shadow_pixmap); } } } void ChameleonStyle::drawMenuItemRedPoint(const QStyleOptionMenuItem *option, QPainter *painter, const QWidget *widget) const { if (!(option->state & QStyle::State_Enabled)) return; QAction *action = nullptr; if (const QMenu *menu = qobject_cast(widget)) { action = menu->actionAt(option->rect.center()); } if (!action) return; QObject *obj = action; if (option->menuItemType == QStyleOptionMenuItem::SubMenu) { obj = action->menu(); } if (!obj->property("_d_menu_item_redpoint").toBool()) return; int h = 6, w = 6; // red point size 6x6 #ifdef ENABLE_RED_POINT_TEXT QString text = obj->property("_d_menu_item_info").toString(); QFont f = option->font; f.setPointSize(8); if (!text.isEmpty()) { QFontMetrics fontMetrics(f); h = fontMetrics.height(); w = fontMetrics.horizontalAdvance(text) + Menu_ItemVTextMargin * 2; // margin left/right 4 } #endif QPainterPath path; QRectF rcf(option->rect); rcf.setWidth(w); rcf.setHeight(h); rcf.moveTop(option->rect.top() + (option->rect.height() - h) / 2.0); // vcenter rcf.moveLeft(option->rect.right() - w - 24); // 离右侧24像素 #ifdef ENABLE_RED_POINT_TEXT if (!text.isEmpty()) { path.addRoundRect(rcf, 50, 99); // 0 is angled corners, 99 is maximum roundedness. } else #endif { path.addEllipse(rcf); } painter->save(); painter->setRenderHint(QPainter::Antialiasing); painter->fillPath(path, QColor("#FF3B30")); // color from ui.ds QPen oldpen = painter->pen(); painter->setPen(QColor("#14000000")); // 外描边,边边颜色为8%的黑 hex(255*8/100) painter->drawEllipse(rcf); painter->setPen(oldpen); #ifdef ENABLE_RED_POINT_TEXT if (!text.isEmpty()) { painter->setPen(Qt::white); // 文字白色 painter->setFont(f); painter->drawText(QPointF(rcf.left() + 4, rcf.bottom() - 4), text.left(3)); } #endif painter->restore(); } bool ChameleonStyle::drawMenuItem(const QStyleOptionMenuItem *option, QPainter *painter, const QWidget *widget) const { if (const QStyleOptionMenuItem *menuItem = option) { //绘制背景 QRect menuRect = menuItem->rect; bool enabled = menuItem->state & State_Enabled; bool selected = menuItem->state & State_Selected && enabled; bool checkable = menuItem->checkType != QStyleOptionMenuItem::NotCheckable; bool checked = menuItem->checked; bool sunken = menuItem->state & State_Sunken; //绘制背景 drawMenuItemBackground(option, painter, menuItem->menuItemType); //绘制分段 if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { if (!menuItem->text.isEmpty()) { painter->setFont(menuItem->font); painter->setPen(Qt::NoPen); painter->setBrush(Qt::NoBrush); proxy()->drawItemText(painter, menuRect , menuItem->direction == Qt::LeftToRight ? (Qt::AlignLeft | Qt::AlignVCenter) : (Qt::AlignRight | Qt::AlignVCenter) , menuItem->palette, menuItem->state & State_Enabled, menuItem->text , QPalette::WindowText); } return true; } //绘制选择框 bool ignoreCheckMark = false; int frameRadius = DStyle::pixelMetric(PM_FrameRadius); //打钩矩形的左侧距离item的左边缘; 也是 打钩矩形的右侧距离 图文内容的左边缘 int smallIconSize = proxy()->pixelMetric(PM_ButtonIconSize, option, widget);//打钩的宽度 int realMargins = smallIconSize + 2 * frameRadius; //左侧固定预留的margin,无论是否能够打钩都要预留 if (!ignoreCheckMark) { /*checkRect = visualRect(menuItem->direction, menuItem->rect, checkRect);*/ QRect checkRect(menuItem->rect); if (checkable) { checkRect.setLeft(frameRadius); checkRect.setWidth(smallIconSize); checkRect.setHeight(smallIconSize); checkRect.moveCenter(QPoint(checkRect.left() + smallIconSize / 2, menuItem->rect.center().y())); painter->setRenderHint(QPainter::Antialiasing); if (selected) painter->setPen(getColor(option, QPalette::HighlightedText)); else painter->setPen(getColor(option, QPalette::BrightText)); if (menuItem->checkType & QStyleOptionMenuItem::Exclusive) { //单选框 if (checked || sunken) { QIcon markIcon = DStyle::standardIcon(SP_MarkElement, option, widget); markIcon.paint(painter, checkRect); } } else if (checked) { //复选框 QIcon markIcon = DStyle::standardIcon(SP_MarkElement, option, widget); markIcon.paint(painter, checkRect); } else { } } } else { //ignore checkmark //用于combobox } if (selected) { painter->setPen(getColor(option, QPalette::HighlightedText)); } else { if ((option->state & QStyle::State_Enabled)) { painter->setPen(getColor(option, QPalette::BrightText)); } else { QColor color = option->palette.color(QPalette::Active, QPalette::BrightText); color = DStyle::adjustColor(color, 0, 0, 0, 0, 0, 0, -60); painter->setPen(color); } } QSize iconSize(0, 0); // 绘制图标 if (!menuItem->icon.isNull()) { /*= visualRect(opt->direction, menuItem->rect,QRect(menuItem->rect.x() + checkColHOffset, menuItem->rect.y(),checkcol, menuitem->rect.height()));*/ iconSize.setWidth(smallIconSize); iconSize.setHeight(smallIconSize); #if QT_CONFIG(combobox) if (const QComboBox *combo = qobject_cast(widget)) iconSize = combo->iconSize(); #endif //计算icon的绘制区域(icon需要居中显示) QRect pmr(menuRect.x() + realMargins, menuRect.center().y() - iconSize.height() / 2, iconSize.width(), iconSize.height()); drawIcon(option, painter, pmr, option->icon, checked); } // 绘制文本 int x, y, w, h; menuRect.getRect(&x, &y, &w, &h); int tab = menuItem->tabWidth; int xpos = menuRect.x(); //1.只有文本 2.只有图片加文本 ,xpos为文本的起始坐标 if (iconSize.width() > 0) { xpos += realMargins + smallIconSize + frameRadius + iconSize.width(); } else { xpos += realMargins; } QRect textRect(xpos, y + Menu_ItemHTextMargin, w - xpos - tab, h - 2 * Menu_ItemVTextMargin); QRect vTextRect = textRect /*visualRect(option->direction, menuRect, textRect)*/; // 区分左右方向 QStringRef textRef(&menuItem->text); painter->setBrush(Qt::NoBrush); if (!textRef.isEmpty()) { int tabIndex = textRef.indexOf(QLatin1Char('\t')); int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; if (!styleHint(SH_UnderlineShortcut, menuItem, widget)) text_flags |= Qt::TextHideMnemonic; text_flags |= Qt::AlignLeft; if (tabIndex >= 0) { QPoint vShortcutStartPoint = textRect.topRight(); //快捷键设置显示 vShortcutStartPoint.setX(vShortcutStartPoint.x() - Menu_PanelRightPadding - realMargins); QRect vShortcutRect = QRect(vShortcutStartPoint, QPoint(menuRect.right(), textRect.bottom())); /* = visualRect(option->direction,menuRect,QRect(vShortcutStartPoint, QPoint(menuRect.right(), textRect.bottom())))*/; const QString textToDraw = textRef.mid(tabIndex + 1).toString(); painter->drawText(vShortcutRect, text_flags, textToDraw); textRef = textRef.left(tabIndex); } QFont font = menuItem->font; font.setPointSizeF(QFontInfo(menuItem->font).pointSizeF()); painter->setFont(font); const QString textToDraw = textRef.left(tabIndex).toString(); painter->setBrush(Qt::NoBrush); painter->drawText(vTextRect, text_flags, textToDraw); drawMenuItemRedPoint(option, painter, widget); } // 绘制箭头 if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow int dim = (menuRect.height() - 4) / 2; int xpos = menuRect.left() + menuRect.width() - 3 - dim; QStyleOptionMenuItem newMI = *menuItem; xpos += realMargins + iconSize.width() + frameRadius; QPoint topLeft(menuItem->rect.right() - frameRadius - smallIconSize / 2, menuItem->rect.center().y() - smallIconSize / 3); //箭头rect: Size(smallIconSize, smallIconSize*2/3) QPoint RightButtom(topLeft.x() + smallIconSize / 2, menuItem->rect.center().y() + smallIconSize / 3 ); QRect rectArrow(topLeft, RightButtom); newMI.rect = rectArrow; newMI.state = !enabled ? State_None : State_Enabled; if (selected) newMI.palette.setColor(QPalette::Foreground, newMI.palette.highlightedText().color()); QIcon markIcon = DStyle::standardIcon(SP_ArrowEnter, &newMI, widget); markIcon.paint(painter, newMI.rect); } } return true; } QRect ChameleonStyle::subElementRect(QStyle::SubElement r, const QStyleOption *opt, const QWidget *widget) const { switch (r) { case SE_HeaderArrow:{ QRect rect; int h = opt->rect.height(); int w = opt->rect.width(); int x = opt->rect.x(); int y = opt->rect.y(); int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, opt, widget); if (opt->state & State_Horizontal) { // designer: whatever how big the QHeaderView it is, the arrow size is fixed. // size the same as the arrow in combobox. PM_MenuButtonIndicator int horiz_size = 12; int vert_size = 12; rect.setRect(x + w - margin * 2 - horiz_size, y + (h - vert_size) / 2, horiz_size, vert_size); } else { int horiz_size = 12; int vert_size = 12; rect.setRect(x + (w - horiz_size) / 2, y + h - margin * 2 - vert_size, horiz_size, vert_size); } rect = visualRect(opt->direction, opt->rect, rect); return rect; } case SE_PushButtonFocusRect: case SE_ItemViewItemFocusRect: return opt->rect; case SE_ItemViewItemCheckIndicator: Q_FALLTHROUGH(); case SE_ItemViewItemDecoration: Q_FALLTHROUGH(); case SE_ItemViewItemText: if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { int frame_radius = DStyle::pixelMetric(PM_FrameRadius, opt, widget); QStyleOptionViewItem option(*vopt); option.rect = opt->rect.adjusted(frame_radius, 0, -frame_radius, 0); QStyleOptionViewItem::ViewItemFeatures old_features = option.features; // 默认把checkbox放置在右边,因此使用QCommonStyle的Item布局时先移除HasCheckIndicator标志 option.features &= ~QStyleOptionViewItem::HasCheckIndicator; if (r == SE_ItemViewItemDecoration) { return DStyle::subElementRect(r, &option, widget); } QRect text_rect = DStyle::subElementRect(SE_ItemViewItemText, &option, widget); int indicator_width = proxy()->pixelMetric(PM_IndicatorWidth, &option, widget); int indicator_height = proxy()->pixelMetric(PM_IndicatorHeight, &option, widget); const QRect indicator_rect = alignedRect(opt->direction, Qt::AlignRight | Qt::AlignVCenter, QSize(indicator_width, indicator_height), text_rect); if (old_features.testFlag(QStyleOptionViewItem::HasCheckIndicator)) { int margin = proxy()->pixelMetric(QStyle::PM_FocusFrameHMargin, opt, widget); text_rect.setRight(qMin(text_rect.right(), indicator_rect.left() - margin)); } return r == SE_ItemViewItemText ? text_rect : indicator_rect; } break; case SE_LineEditContents: { int frame_margins = DStyle::pixelMetric(PM_FrameMargins, opt, widget); int left_margins = DStyle::pixelMetric(PM_ContentsMargins, opt, widget); if (widget && qobject_cast(widget->parentWidget())) { return opt->rect.adjusted(frame_margins / 2, 0, -left_margins / 2, 0); } return opt->rect.adjusted(frame_margins + left_margins, 0, -(frame_margins + left_margins), 0); } case SE_RadioButtonFocusRect: case SE_CheckBoxFocusRect: { QRect re; re = subElementRect(SE_CheckBoxIndicator, opt, widget); int margin = DStyle::pixelMetric(PM_FocusBorderWidth) + DStyle::pixelMetric(PM_FocusBorderSpacing); re.adjust(-margin, -margin, margin, margin); return re; } case SE_RadioButtonClickRect: case SE_CheckBoxClickRect: { QRect re = DStyle::subElementRect(SE_CheckBoxIndicator, opt, widget); if (const QStyleOptionButton *btn = qstyleoption_cast(opt)) { int spacing = proxy()->pixelMetric(PM_CheckBoxLabelSpacing, opt, widget); re.setWidth(re.width() + widget->fontMetrics().width(btn->text) + spacing * 2); } return re; } case SE_RadioButtonIndicator: case SE_RadioButtonContents: case SE_CheckBoxContents: case SE_CheckBoxIndicator: if (const QStyleOptionButton *vopt = qstyleoption_cast(opt)) { QStyleOptionButton option(*vopt); int margin = DStyle::pixelMetric(PM_FocusBorderWidth) + DStyle::pixelMetric(PM_FocusBorderSpacing); //来自SE_CheckBoxFocusRect状态时 option.rect.translate(margin, 0); //需往右偏margin数值,FocusRect框显示正常;故对应其size的width也增加margin return DStyle::subElementRect(r, &option, widget); } break; case SE_PushButtonContents: if (const QStyleOptionButton *vopt = qstyleoption_cast(opt)) { QRect buttonContentRect = vopt->rect; int buttonIconMargin = proxy()->pixelMetric(QStyle::PM_ButtonMargin, opt, widget) ; buttonContentRect.adjust(buttonIconMargin, 0, -buttonIconMargin, 0); return buttonContentRect; } break; case SE_TabBarScrollLeftButton: { const bool vertical = opt->rect.width() < opt->rect.height(); const int buttonWidth = proxy()->pixelMetric(PM_TabBarScrollButtonWidth, opt, widget); QRect buttonRect = vertical ? QRect(0, 0, opt->rect.width(), buttonWidth) : QRect(0, 0, buttonWidth, opt->rect.height()); return buttonRect; } case SE_TabBarScrollRightButton: { const bool vertical = opt->rect.width() < opt->rect.height(); const int buttonWidth = proxy()->pixelMetric(PM_TabBarScrollButtonWidth, opt, widget); QRect buttonRect = vertical ? QRect(0, opt->rect.height() - buttonWidth, opt->rect.width(), buttonWidth) : QRect(opt->rect.width() - buttonWidth, 0, buttonWidth, opt->rect.height()); return buttonRect; } case SE_ProgressBarLabel: { int radius = DStyle::pixelMetric(PM_FrameRadius); return opt->rect.marginsRemoved(QMargins(radius, radius, radius, radius)); } case SE_TabBarTearIndicatorLeft: case SE_TabBarTearIndicatorRight: // DTabBar有自己的scroll按钮 if (widget && qobject_cast(widget->parent())) return QRect(0, 0, 0, 0); break; default: break; } return DStyle::subElementRect(r, opt, widget); } void ChameleonStyle::drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w) const { switch (cc) { case CC_SpinBox: { if (const QStyleOptionSpinBox *option = qstyleoption_cast(opt)) { if (drawSpinBox(option, p, w)) return; } break; } case CC_ToolButton: { if (const QStyleOptionToolButton *toolbutton = qstyleoption_cast(opt)) { QRect button, menuarea; button = proxy()->subControlRect(cc, toolbutton, SC_ToolButton, w); menuarea = proxy()->subControlRect(cc, toolbutton, SC_ToolButtonMenu, w); State bflags = toolbutton->state & ~State_Sunken; if (bflags & State_AutoRaise) { if (!(bflags & State_MouseOver) || !(bflags & State_Enabled)) { bflags &= ~State_Raised; } } State mflags = bflags; if (toolbutton->state & State_Sunken) { if (toolbutton->activeSubControls & SC_ToolButton) bflags |= State_Sunken; mflags |= State_Sunken; } QStyleOption tool = *toolbutton; if (toolbutton->subControls & SC_ToolButton) { if (bflags & (State_Sunken | State_On | State_Raised)) { tool.rect = button; tool.state = bflags; //proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, w); } } QStyleOptionToolButton label = *toolbutton; label.state = bflags; int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, w); label.rect = button.adjusted(fw, fw, -fw, -fw); if (w && w->property("_d_calendarToolBtn").toBool()) { label.palette = DGuiApplicationHelper::instance()->applicationPalette(); } proxy()->drawControl(CE_ToolButtonLabel, &label, p, w); if (toolbutton->state & State_HasFocus) { QStyleOptionFocusRect fr; fr.QStyleOption::operator=(*toolbutton); //fr.rect.adjust(3, 3, -3, -3); if (toolbutton->features & QStyleOptionToolButton::MenuButtonPopup) fr.rect.adjust(0, 0, -proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, toolbutton, w), 0); proxy()->drawPrimitive(PE_FrameFocusRect, &fr, p, w); } if (toolbutton->subControls & SC_ToolButtonMenu) { tool.rect = menuarea; tool.state = mflags; if (mflags & (State_Sunken | State_On | State_Raised)) proxy()->drawPrimitive(PE_IndicatorButtonDropDown, &tool, p, w); proxy()->drawPrimitive(PE_IndicatorArrowDown, &tool, p, w); } else if (toolbutton->features & QStyleOptionToolButton::HasMenu) { int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, toolbutton, w); QRect ir = toolbutton->rect; QStyleOptionToolButton newBtn = *toolbutton; newBtn.rect = QRect(ir.right() + 5 - mbi, ir.y() + ir.height() - mbi + 4, mbi - 6, mbi - 6); newBtn.rect = visualRect(toolbutton->direction, button, newBtn.rect); //DelayedPopup 模式,箭头右居中, 加一个日历 月按钮箭头居中 if (toolbutton->features & QStyleOptionToolButton::PopupDelay || (w && w->objectName() == "qt_calendar_monthbutton")) { newBtn.rect = QRect(ir.right() + 5 - mbi, ir.y() + ir.height() / 2, mbi - 4, mbi - 4); newBtn.rect = visualRect(toolbutton->direction, button, newBtn.rect); } proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, w); } //日历 年按钮 特制 if (w && w->objectName() == "qt_calendar_yearbutton") { QStyleOptionToolButton newBtn = *toolbutton; int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, toolbutton, w); QRect ir = toolbutton->rect; newBtn.rect = QRect(ir.right() + 5 - mbi, ir.y() + ir.height() / 2, mbi - 4, mbi - 4); newBtn.rect = visualRect(toolbutton->direction, button, newBtn.rect); proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, w); } } return; } case CC_Slider : { if (const QStyleOptionSlider *slider = qstyleoption_cast(opt)) { const DSlider *dslider = qobject_cast(w); //各个使用的矩形大小和位置 QRectF rect = opt->rect; //Slider控件最大的矩形(包含如下三个) QRectF rectHandle = proxy()->subControlRect(CC_Slider, opt, SC_SliderHandle, w); //滑块矩形 QRectF rectSliderTickmarks = proxy()->subControlRect(CC_Slider, opt, SC_SliderTickmarks, w); //刻度的矩形 QRect rectGroove = proxy()->subControlRect(CC_Slider, opt, SC_SliderGroove, w); //滑槽的矩形 int margin = DStyle::pixelMetric(PM_FocusBorderWidth) + DStyle::pixelMetric(PM_FocusBorderSpacing); // //测试(保留不删) // p->fillRect(rect, Qt::gray); // p->fillRect(rectSliderTickmarks, Qt::blue); // p->fillRect(rectGroove, Qt::red); // p->fillRect(rectHandle, Qt::green); // qDebug()<<"---rect:"<subControls & SC_SliderGroove) { pen.setStyle(Qt::CustomDashLine); pen.setWidth(4); // 默认高亮色滑槽颜色 pen.setBrush((opt->activeSubControls & SC_SliderHandle) ? getColor(opt, QPalette::Highlight) : opt->palette.highlight()); pen.setDashOffset(0); pen.setDashPattern(QVector()<< 0.5 << 0.25); pen.setCapStyle(Qt::FlatCap); p->setPen(pen); p->setRenderHint(QPainter::Antialiasing); QColor color = getColor(opt, DPalette::ObviousBackground, w); //绘画的右侧/上侧的滑槽颜色一定是灰 // 属性启用灰色滑槽 QVariant prop = dslider ? const_cast(dslider)->slider()->property("_d_dtk_sldier_across") : QVariant(); bool hasProperty = prop.isValid(); // 0. dslider 默认没有设置此属性(设置在d->slider上了...) // 1. 设置了属性 true 则灰色滑槽 // 2. 如果设置了 false 高亮 // 3. 没有设置属性时,没有刻度的(圆角) slider 默认高亮色,有刻度(尖角) slider 默认灰色 if (prop.toBool() || (!hasProperty && !isNoticks(slider, p, w))) { pen.setColor(color); p->setPen(pen); } if (slider->orientation == Qt::Horizontal) { // 绘制最左边到滑块的位置的滑槽 qreal rectWidth = rectHandle.width() / 2.0; p->drawLine(QPointF(rectGroove.left() + rectWidth, rectHandle.center().y()), QPointF(rectHandle.center().x(), rectHandle.center().y())); // 绘制滑块到最右的位置的滑槽 pen.setColor(color); p->setPen(pen); p->drawLine(QPointF(rectGroove.right() - rectWidth, rectHandle.center().y()), QPointF(rectHandle.center().x(), rectHandle.center().y())); } else { // 绘制最上边到滑块的位置的滑槽 qreal rectWidth = rectHandle.height() / 2.0; p->drawLine(QPointF(rectGroove.center().x(), rectGroove.bottom() - rectWidth), QPointF(rectGroove.center().x(), rectHandle.center().y())); // 绘制滑块到最下的位置的滑槽 pen.setColor(color); p->setPen(pen); p->drawLine(QPointF(rectGroove.center().x(), rectGroove.top() + rectWidth), QPointF(rectGroove.center().x(), rectHandle.center().y())); } } //绘画 滑块 if (opt->subControls & SC_SliderHandle) { pen.setStyle(Qt::SolidLine); p->setPen(Qt::NoPen); p->setBrush((opt->activeSubControls & SC_SliderHandle) ? getColor(opt, QPalette::Highlight) : opt->palette.highlight()); drawSliderHandle(opt, rectHandle, p, w); // 绘画 滑块焦点 if (slider->state & State_HasFocus) { pen.setColor(getColor(opt, DPalette::Highlight)); pen.setWidth(DStyle::pixelMetric(PM_FocusBorderWidth)); p->setPen(pen); p->setBrush(Qt::NoBrush); drawSliderHandleFocus(opt, rectHandle, p, w); } } //绘画 刻度,绘画方式了参考qfusionstyle.cpp if ((opt->subControls & SC_SliderTickmarks) && slider->tickInterval) { //需要绘画刻度 p->setPen(opt->palette.foreground().color()); int available = proxy()->pixelMetric(PM_SliderSpaceAvailable, slider, w); //可用空间 int interval = slider->tickInterval; //标记间隔 // int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, opt, w); //标记偏移 // int ticks = slider->tickPosition; //标记位置 int v = slider->minimum; int len = proxy()->pixelMetric(PM_SliderLength, slider, w); while (v <= slider->maximum + 1) { //此处不添加+1的话, 会少绘画一根线 const int v_ = qMin(v, slider->maximum); int pos = margin + sliderPositionFromValue(slider->minimum, slider->maximum, v_, available - (2 * margin)) + len / 2; if (slider->orientation == Qt::Horizontal) { if (slider->tickPosition == QSlider::TicksBothSides) { //两侧都会绘画, 总的矩形-中心滑槽滑块最小公共矩形 p->drawLine(pos, rect.top(), pos, rectHandle.top()); p->drawLine(pos, rect.bottom(), pos, rectHandle.bottom()); } else { p->drawLine(pos, rectSliderTickmarks.top(), pos, rectSliderTickmarks.bottom()); } } else { if (slider->tickPosition == QSlider::TicksBothSides) { p->drawLine(rect.left(), pos, rectHandle.left(), pos); p->drawLine(rect.right(), pos, rectHandle.right(), pos); } else { p->drawLine(rectSliderTickmarks.left(), pos, rectSliderTickmarks.right(), pos); } } // in the case where maximum is max int int nextInterval = v + interval; if (nextInterval < v) break; v = nextInterval; } } } break; } case CC_ComboBox: { if (const QStyleOptionComboBox *comboBox = qstyleoption_cast(opt)) { if (drawComboBox(p, comboBox, w)) return; } break; } default: break; } DStyle::drawComplexControl(cc, opt, p, w); } bool ChameleonStyle::drawSpinBox(const QStyleOptionSpinBox *opt, QPainter *painter, const QWidget *widget) const { qreal borderRadius = DStyle::pixelMetric(DStyle::PM_FrameRadius); if (opt->frame && (opt->subControls & SC_SpinBoxFrame)) { QRect frameRect = proxy()->subControlRect(CC_SpinBox, opt, SC_SpinBoxFrame, widget); painter->setRenderHint(QPainter::Antialiasing, true); painter->setPen(Qt::NoPen); painter->setBrush(opt->palette.button()); painter->drawRoundedRect(frameRect, borderRadius, borderRadius); } if (opt->subControls & SC_SpinBoxUp) { bool upIsActive = opt->activeSubControls == SC_SpinBoxUp; bool upIsEnabled = opt->stepEnabled & QAbstractSpinBox::StepUpEnabled && opt->state.testFlag(State_Enabled); QRect subRect = proxy()->subControlRect(CC_SpinBox, opt, SC_SpinBoxUp, widget); QStyleOptionButton buttonOpt; buttonOpt.rect = subRect; buttonOpt.palette = opt->palette; updateSpinBoxButtonState(opt, buttonOpt, upIsActive, upIsEnabled); bool isPlusMinus = opt->buttonSymbols & QAbstractSpinBox::PlusMinus; if (widget && widget->property("_d_dtk_spinBox").toBool()) { painter->setPen(Qt::NoPen); painter->setBrush(buttonOpt.palette.color(QPalette::Button)); DDrawUtils::drawRoundedRect(painter, subRect.adjusted(-2, -1, 0, 0), borderRadius, borderRadius, DDrawUtils::TopRightCorner); painter->setPen(getColor(opt, DPalette::FrameBorder, widget)); painter->drawLine(subRect.x() - 2, subRect.y() - 1, subRect.x() - 2, subRect.y() - 1 + subRect.height()); } else { proxy()->drawControl(CE_PushButton, &buttonOpt, painter, widget); } if (isPlusMinus) { //绘制 "+" 符号 buttonOpt.rect -= frameExtentMargins(); QRectF plusRect = proxy()->subElementRect(SE_PushButtonContents, &buttonOpt, widget); QRectF cent_rect(0, 0, plusRect.width() / 2, plusRect.width() / 2); cent_rect.moveCenter(plusRect.center()); if (opt->activeSubControls == SC_SpinBoxUp) { DDrawUtils::drawPlus(painter, cent_rect, getColor(opt, QPalette::ButtonText), 1); } else { DDrawUtils::drawPlus(painter, cent_rect, DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType ? QColor("#536076") : QColor("#c5cfe0"), 1); } } else { QStyleOptionButton arrowDrawBtn = buttonOpt; if (widget && widget->property("_d_dtk_spinBox").toBool()) { if (opt->activeSubControls == SC_SpinBoxDown) { painter->setPen(buttonOpt.palette.color(QPalette::ButtonText)); } else { painter->setPen(getColor(opt, QPalette::ButtonText)); } arrowDrawBtn.rect = subRect; arrowDrawBtn.rect.setWidth(subRect.width() / 2); arrowDrawBtn.rect.setHeight(subRect.height() / 1.3); arrowDrawBtn.rect.moveCenter(subRect.center()); proxy()->drawPrimitive(PE_IndicatorArrowUp, &arrowDrawBtn, painter, widget); } else { arrowDrawBtn.rect = subRect; arrowDrawBtn.rect.setSize(subRect.size() / 3); arrowDrawBtn.rect.moveCenter(subRect.center()); proxy()->drawPrimitive(PE_IndicatorArrowUp, &arrowDrawBtn, painter, widget); } } } if (opt->subControls & SC_SpinBoxDown) { bool downIsActive = opt->activeSubControls == SC_SpinBoxDown; bool downIsEnabled = opt->stepEnabled & QAbstractSpinBox::StepDownEnabled && opt->state.testFlag(State_Enabled); QRect subRect = proxy()->subControlRect(CC_SpinBox, opt, SC_SpinBoxDown, widget); QStyleOptionButton buttonOpt; buttonOpt.rect = subRect; buttonOpt.palette = opt->palette; updateSpinBoxButtonState(opt, buttonOpt, downIsActive, downIsEnabled); bool isPlusMinus = opt->buttonSymbols & QAbstractSpinBox::PlusMinus; if (widget && widget->property("_d_dtk_spinBox").toBool()) { painter->setPen(Qt::NoPen); painter->setBrush(buttonOpt.palette.color(QPalette::Button)); DDrawUtils::drawRoundedRect(painter, subRect.adjusted(-2, 0, 0, +1), borderRadius, borderRadius, DDrawUtils::BottomRightCorner); painter->setPen(getColor(opt, DPalette::FrameBorder, widget)); painter->drawLine(subRect.x() - 2, subRect.y(), subRect.x() + subRect.width(), subRect.y()); painter->drawLine(subRect.x() - 2, subRect.y(), subRect.x() - 2, subRect.y() + subRect.height() + 1); } else { proxy()->drawControl(CE_PushButton, &buttonOpt, painter, widget); } if (isPlusMinus) { buttonOpt.rect -= frameExtentMargins(); QRectF subtractRect = proxy()->subElementRect(SE_PushButtonContents, &buttonOpt, widget); QRectF cent_rect(0, 0, subtractRect.width() / 2, subtractRect.height() / 2); cent_rect.moveCenter(subtractRect.center()); if (opt->activeSubControls == SC_SpinBoxDown) { DDrawUtils::drawSubtract(painter, cent_rect, getColor(opt, QPalette::ButtonText), 1); } else { DDrawUtils::drawSubtract(painter, cent_rect, DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType ? QColor("#536076") : QColor("#c5cfe0"), 1); } } else { QStyleOptionButton arrowDrawBtn = buttonOpt; if (widget && widget->property("_d_dtk_spinBox").toBool()) { if (opt->activeSubControls == SC_SpinBoxDown) { painter->setPen(getColor(opt, QPalette::ButtonText)); } else { painter->setPen(buttonOpt.palette.color(QPalette::ButtonText)); } arrowDrawBtn.rect = subRect; arrowDrawBtn.rect.setWidth(subRect.width() / 2); arrowDrawBtn.rect.setHeight(subRect.height() / 1.3); arrowDrawBtn.rect.moveCenter(subRect.center()); proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowDrawBtn, painter, widget); } else { //更换了一种绘制箭头方式,使36 *36情况下箭头无瑕疵 arrowDrawBtn.rect = subRect; arrowDrawBtn.rect.setSize(subRect.size() / 3); arrowDrawBtn.rect.moveCenter(subRect.center()); proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowDrawBtn, painter, widget); } } } return true; } void ChameleonStyle::updateSpinBoxButtonState(const QStyleOptionSpinBox *opt, QStyleOptionButton &buttonOpt, bool isActive, bool isEnabled) const { State buttonState = opt->state; if (!isActive) { buttonState &= ~State_MouseOver; buttonState &= ~State_Sunken; buttonState &= ~State_Active; buttonState &= ~State_HasFocus; } if (!isEnabled) { buttonState &= ~State_Enabled; buttonState &= ~State_MouseOver; buttonState &= ~State_Sunken; buttonState &= ~State_On; } if (buttonState & State_Sunken || buttonState & State_MouseOver || buttonState & State_Active) { buttonState &= ~State_HasFocus; } buttonOpt.state = buttonState; } QStyle::SubControl ChameleonStyle::hitTestComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w) const { return DStyle::hitTestComplexControl(cc, opt, pt, w); } QRect ChameleonStyle::subControlRect(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, QStyle::SubControl sc, const QWidget *w) const { switch (cc) { case CC_SpinBox: { if (const QStyleOptionSpinBox *option = qstyleoption_cast(opt)) { switch (sc) { case SC_SpinBoxEditField: { if (option->buttonSymbols == QAbstractSpinBox::NoButtons) return proxy()->subControlRect(CC_SpinBox, opt, SC_SpinBoxFrame, w); int rightBorder = option->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, opt, w) * 2 : 0; int border = w && w->property("_d_dtk_spinBox").toBool() ? 0 : DStyle::pixelMetric(PM_ContentsMargins); QRect spinboxRect = option->rect; QRect dButtonRect = proxy()->subControlRect(CC_SpinBox, opt, SC_SpinBoxUp, w); spinboxRect.setRight(dButtonRect.left() - rightBorder - frameExtentMargins().left() - border); return spinboxRect; } case SC_SpinBoxUp: { if (w && w->property("_d_dtk_spinBox").toBool()) { break; } if (option->buttonSymbols == QAbstractSpinBox::NoButtons) return QRect(); int rectHeight = option->rect.height(); int border = w && w->property("_d_dtk_spinBox").toBool() ? 0 : DStyle::pixelMetric(PM_ContentsMargins); rectHeight -= (option->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, opt, w) * 2 : 0); if (opt->rect.width() < rectHeight * 3) break; QRect uButtonRect = proxy()->subControlRect(CC_SpinBox, opt, SC_SpinBoxDown, w); QRect buttonRect = option->rect; buttonRect.setLeft(uButtonRect.left() - rectHeight - border); buttonRect.setRight(uButtonRect.left()); buttonRect.setSize(QSize(rectHeight, rectHeight)); return buttonRect; } case SC_SpinBoxDown: { if (w && w->property("_d_dtk_spinBox").toBool()) { break; } if (option->buttonSymbols == QAbstractSpinBox::NoButtons) return QRect(); int rectHeight = option->rect.height(); rectHeight -= (option->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, opt, w) * 2 : 0); if (opt->rect.width() < rectHeight * 3) break; QRect buttonRect(option->rect.topLeft(), QSize(rectHeight, rectHeight)); //按高度计算 buttonRect.moveRight(option->rect.right()); return buttonRect; } case SC_SpinBoxFrame: { return option->rect - frameExtentMargins() ; } default: break; } } break; } case CC_Slider: { if (const QStyleOptionSlider *option = qstyleoption_cast(opt)) { int margin = DStyle::pixelMetric(PM_FocusBorderWidth) + DStyle::pixelMetric(PM_FocusBorderSpacing); QRectF rect = option->rect; //Slider控件总的大小矩形 int slider_size = proxy()->pixelMetric(PM_SliderControlThickness, opt, w); //滑块的高度 // int tick_size = proxy()->pixelMetric(PM_SliderTickmarkOffset, opt, w); //刻度的高度 QRectF slider_handle_rect = rect; //滑块和滑漕的的最小公共矩形 (后面被用作临时且被改变的) if (option->orientation == Qt::Horizontal) { slider_handle_rect.setHeight(slider_size); slider_handle_rect.adjust(margin, 0, -margin, 0); if (option->tickPosition == QSlider::TicksAbove) slider_handle_rect.moveBottom(rect.bottom() - margin); if (option->tickPosition == QSlider::TicksBelow) slider_handle_rect.moveTop(rect.top() + margin); if (option->tickPosition == QSlider::TicksBothSides || option->tickPosition == QSlider::NoTicks) slider_handle_rect.moveCenter(rect.center()); } else { slider_handle_rect.setWidth(slider_size); slider_handle_rect.adjust(0, margin, 0, -margin); if (option->tickPosition == QSlider::TicksRight) slider_handle_rect.moveLeft(rect.left() + margin); if (option->tickPosition == QSlider::TicksLeft) slider_handle_rect.moveRight(rect.right() - margin); if (option->tickPosition == QSlider::TicksBothSides || option->tickPosition == QSlider::NoTicks) slider_handle_rect.moveCenter(rect.center()); } QRectF rectStatic = slider_handle_rect; //rectStatic作为 滑块和滑漕的的最小公共矩形(不改变) switch (sc) { case SC_SliderGroove: { //滑漕 qreal groove_size = slider_size / 4.0; QRectF groove_rect; if (option->orientation == Qt::Horizontal) { groove_rect.setWidth(slider_handle_rect.width()); groove_rect.setHeight(groove_size); } else { groove_rect.setWidth(groove_size); groove_rect.setHeight(slider_handle_rect.height()); } groove_rect.moveCenter(slider_handle_rect.center()); return groove_rect.toRect(); } case SC_SliderHandle: { //滑块 int sliderPos = 0; int len = proxy()->pixelMetric(PM_SliderLength, option, w); bool horizontal = option->orientation == Qt::Horizontal; sliderPos = sliderPositionFromValue(option->minimum, option->maximum, option->sliderPosition, (horizontal ? slider_handle_rect.width() : slider_handle_rect.height()) - len, option->upsideDown); if (horizontal) { slider_handle_rect.moveLeft(slider_handle_rect.left() + sliderPos); slider_handle_rect.setWidth(len); slider_handle_rect.moveTop(rectStatic.top()); } else { slider_handle_rect.moveTop(slider_handle_rect.top() + sliderPos); slider_handle_rect.setHeight(len); slider_handle_rect.moveLeft(rectStatic.left()); } return slider_handle_rect.toRect(); } case SC_SliderTickmarks: { //刻度的矩形 if (option->tickPosition & QSlider::NoTicks) return QRect(0, 0, 0, 0); QRectF tick_rect = rect; if (option->orientation == Qt::Horizontal) { tick_rect.setHeight(rect.height() - slider_handle_rect.height() - ( 2 * margin)); tick_rect.adjust(margin, 0, -margin, 0); if (option->tickPosition == QSlider::TicksAbove) { tick_rect.moveTop(rect.top() + margin); } else if (option->tickPosition == QSlider::TicksBelow) { tick_rect.moveBottom(rect.bottom() -margin); } } else { tick_rect.setWidth(rect.width() - slider_handle_rect.width() - (2 *margin)); tick_rect.adjust(0, margin, 0, -margin); if (option->tickPosition == QSlider::TicksLeft) { tick_rect.moveLeft(rect.left() + margin); } else if (option->tickPosition == QSlider::TicksRight) { tick_rect.moveRight(rect.right() - margin); } } return tick_rect.toRect(); } default: break; } } break; } case CC_ComboBox: { if (qstyleoption_cast(opt)) { DStyleHelper dstyle(proxy()); int frameMargins = dstyle.pixelMetric(PM_FrameMargins, opt, w); switch (sc) { case SC_ComboBoxArrow: { QRect rect(0, 0, qMax(static_cast(Metrics::ComboBox_ArrowButtonWidth), opt->rect.height()), opt->rect.height()) ; int boxHeight = qAbs(rect.height()); if (w && qobject_cast(w) && !qobject_cast(w)->isEditable()) break; if (opt->direction == Qt::LeftToRight) rect.moveRight(opt->rect.right()); else rect.moveLeft(opt->rect.left()); int buttonRectSize = boxHeight; rect.setSize(QSize(buttonRectSize, buttonRectSize)); return rect; } case SC_ComboBoxEditField: { QRect rect = opt->rect; const QRect arrow_rect = proxy()->subControlRect(cc, opt, SC_ComboBoxArrow, w); if (opt->direction == Qt::LeftToRight) { rect.setRight(arrow_rect.left()); rect.adjust(frameMargins, 0, 0, 0); } else { rect.setLeft(arrow_rect.right()); rect.adjust(0, 0, -frameMargins, 0); } return rect; } case SC_ComboBoxFrame: { return opt->rect; } case SC_ComboBoxListBoxPopup: { QSize size = proxy()->sizeFromContents(CT_Menu, opt, opt->rect.size(), w); QRect rect = opt->rect; if (auto styopt = static_cast(opt)) { if (auto menuItem = static_cast(styopt)) { if (menuItem->icon.isNull()) { rect.setWidth(size.width() + Menu_CheckMarkWidth); } } } return rect; } default: break; } } break; } default: break; } return DStyle::subControlRect(cc, opt, sc, w); } QSize ChameleonStyle::sizeFromContents(QStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget) const { QSize size = DStyle::sizeFromContents(ct, opt, contentsSize, widget); switch (ct) { case CT_LineEdit: { int button_margin = proxy()->pixelMetric(QStyle::PM_ButtonMargin, opt, widget); size += QSize(button_margin, button_margin); Q_FALLTHROUGH(); } case CT_ComboBox: { if (const QStyleOptionComboBox *cmb = qstyleoption_cast(opt)) { if (cmb->editable) { //这是从lineedit设置margin处拿来 int frame_margins = DStyle::pixelMetric(PM_FrameMargins, opt, widget); int left_margins = DStyle::pixelMetric(PM_ContentsMargins, opt, widget); size.setWidth(size.width() + frame_margins + left_margins); } else { size.setWidth(size.width() + opt->fontMetrics.width("...")); //设置宽度为最小省略号("...")的宽度 } } Q_FALLTHROUGH(); } case CT_TabBarTab: { if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { QStyleOptionButton button; button.QStyleOption::operator =(*opt); button.text = tab->text; size = DStyle::sizeFromContents(QStyle::CT_PushButton, &button, tab->fontMetrics.size(0, tab->text), widget); int frame_radius = DStyle::pixelMetric(PM_FrameRadius, opt, widget); // 获得Icon引起的增量 int iconSizeDelta = 0; if (!tab->icon.isNull()) { iconSizeDelta += tab->iconSize.width(); if (!tab->text.isEmpty()) iconSizeDelta += Icon_Margins; } size.rwidth() += 2 * frame_radius + proxy()->pixelMetric(PM_TabCloseIndicatorWidth, opt, widget) + TabBar_TabMargin; size.rwidth() += iconSizeDelta; // TabBar 竖直方向改变其宽高 if (verticalTabs(tab->shape)) { qSwap(size.rwidth(), size.rheight()); } } Q_FALLTHROUGH(); } case CT_PushButton: { int frame_margins = DStyle::pixelMetric(PM_FrameMargins, opt, widget); size += QSize(frame_margins * 2, frame_margins * 2); if (const QStyleOptionButton *bopt = qstyleoption_cast(opt)) { int frame_radius = DStyle::pixelMetric(PM_FrameRadius, opt, widget); // 为文本添加额外的margin if (!bopt->text.isEmpty()) { size.rwidth() += 2 * frame_radius; } if (bopt->features & QStyleOptionButton::HasMenu) size.rwidth() += frame_margins; //qt源码会在带有menu的btn样式中,添加一个箭头矩形的width } int button_min_size = DStyle::pixelMetric(PM_ButtonMinimizedSize, opt, widget); size = size.expandedTo(QSize(button_min_size, button_min_size)); break; } case CT_ItemViewItem: { if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { const QMargins &item_margins = qvariant_cast(vopt->index.data(Dtk::MarginsRole)); if (!item_margins.isNull()) { //加上Item自定义的margins size = QRect(QPoint(0, 0), size).marginsAdded(item_margins).size(); } size.setWidth(size.width() + opt->fontMetrics.width("xxx")); return size; } break; } case CT_Slider: { if (const QStyleOptionSlider *slider = qstyleoption_cast(opt)) { /*2019-09-19 约定枚举值含义     中文含义 * PM_SliderThickness:      Slider总的高度 = 滑块高度+刻度高度 * PM_SliderControlThickness: 只是滑块的单独高度 * PM_SliderLength: 只是滑块的长度 * PM_SliderTickmarkOffset: 用作slider的刻度线的高度 * PM_SliderSpaceAvailable 暂时未用到 */ int sliderContHeight = proxy()->pixelMetric(PM_SliderControlThickness, opt, widget); int tickMarkHeight = proxy()->pixelMetric(PM_SliderTickmarkOffset, opt, widget); sliderContHeight += tickMarkHeight; if (slider->tickPosition == QSlider::NoTicks) { sliderContHeight -= tickMarkHeight; } else if (slider->tickPosition == QSlider::TicksBothSides) { sliderContHeight += tickMarkHeight; } else { } int margin = DStyle::pixelMetric(PM_FocusBorderWidth) + DStyle::pixelMetric(PM_FocusBorderSpacing); if (slider->orientation == Qt::Horizontal){ size.setHeight(qMax(size.height(), sliderContHeight) + (2 * margin)); size.setWidth(50); } else { size.setWidth(qMax(size.width(), sliderContHeight) + (2 * margin)); } } break; } case CT_MenuBarItem: { int frame_margins = DStyle::pixelMetric(PM_FrameMargins, opt, widget); size += QSize(frame_margins * 2, frame_margins * 2); break; } case CT_MenuItem: { if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast(opt)) { int m_width = size.width(); bool hideShortcutText = false; if (hideShortcutText) { m_width -= menuItem->tabWidth; int tabIndex = menuItem->text.indexOf(QLatin1Char('\t')); if (tabIndex != -1) { int textWidth = menuItem->fontMetrics.width(menuItem->text.mid(tabIndex + 1)); if (menuItem->tabWidth == 0) m_width -= textWidth; } } int frameRadius = DStyle::pixelMetric(PM_FrameRadius); //打钩矩形的左侧距离item的左边缘; 也是 打钩矩形的右侧距离 图文内容的左边缘 int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); //打钩的宽度 int realMargins = smallIconSize + 2 * frameRadius; //左侧固定预留的margin,无论是否能够打钩都要预留 m_width = realMargins; #ifdef ENABLE_RED_POINT_TEXT int redPointWith = opt->fontMetrics.size(Qt::TextSingleLine, QLatin1String("99+")).width(); m_width += redPointWith; #endif int tabSpacing = MenuItem_TabSpacing; if (menuItem->text.contains(QLatin1Char('\t'))) { //若是项有快捷键,文本内容会以'\t'连接快捷键文本 if (!hideShortcutText) m_width += tabSpacing; } else { if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu) { m_width += 2 * Menu_ArrowHMargin; } } int textWidth = opt->fontMetrics.size(Qt::TextSingleLine, menuItem->text).width(); if (!menuItem->text.isEmpty()) m_width += (textWidth + frameRadius); if (!menuItem->icon.isNull()) m_width += (smallIconSize + + frameRadius); m_width += (smallIconSize + frameRadius); size.setWidth(m_width); if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { if (!menuItem->text.isEmpty()) { size.setHeight(menuItem->fontMetrics.height()); } else { size.setHeight(2); } } else if (!menuItem->icon.isNull()) { if (const QComboBox *combo = qobject_cast(widget)) { size.setHeight(qMax(combo->iconSize().height() + 2, size.height())); } } } size.setWidth(qMax(162, size.width())); size.setHeight(size.height() + qMax(Menu_ItemVMargin * 2, 0)); break; } case CT_ScrollBar: { if (size.width() > size.height()) size.setHeight(ScrollBar_SliderWidth); if (size.width() < size.height()) size.setWidth(ScrollBar_SliderWidth); return size; } case CT_RadioButton: case CT_CheckBox: { size.rwidth() += 2 * (DStyle::pixelMetric(PM_FocusBorderWidth) + DStyle::pixelMetric(PM_FocusBorderSpacing)); // fix 当没有文字的时候高度不够绘制焦点圈 auto button = qobject_cast(widget); if (button && button->text().isEmpty()) size.rheight() += 2 * (DStyle::pixelMetric(PM_FocusBorderWidth) + DStyle::pixelMetric(PM_FocusBorderSpacing)); break; } case CT_ToolButton: { qreal radius = DStyle::pixelMetric(DStyle::PM_FrameRadius); return QSize(size.width() + radius, size.height() + radius); } case CT_ProgressBar: { if (const QStyleOptionProgressBar *pbo = qstyleoption_cast(opt)) { int radius = DStyle::pixelMetric(PM_FrameRadius); if (!pbo->textVisible) { size.setWidth(qMax(size.width(), 2 * radius)); size.setHeight(qMax(size.height(), 2 * radius)); } else { QSize text_size = opt->fontMetrics.size(0, pbo->text.isEmpty() ? "%" : pbo->text); size.setWidth(qMax(size.width(), 2 * radius + text_size.width())); size.setHeight(qMax(size.height(), 2 * radius + text_size.height())); } } break; } case CT_SpinBox: if (auto vopt = qstyleoption_cast(opt)) { int spacing = widget && widget->property("_d_dtk_spinBox").toBool() ? 0 : DStyle::pixelMetric(PM_ContentsMargins); const int fw = vopt->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, vopt, widget) : 0; // 增加左右箭头对应的宽和焦点边框的边距,(正方形箭头宽 + 边距 + 箭头控件左右边距, 焦点边框的宽). size += QSize((size.height() + spacing + fw * 2) * 2, LineEdit_FrameWidth); return size; } break; case CT_SizeGrip: { size = QSize(16, 16); break; } default: break; } return size; } int ChameleonStyle::pixelMetric(QStyle::PixelMetric m, const QStyleOption *opt, const QWidget *widget) const { switch (static_cast(m)) { case PM_SpinBoxSliderHeight: return SpinBox_MiniHeight; case PM_SpinBoxFrameWidth: return SpinBox_FrameWidth; case PM_TabCloseIndicatorWidth: case PM_TabCloseIndicatorHeight: // 平板需求 return DGuiApplicationHelper::isTabletEnvironment() ? TabletTabBar_TabButtonSize : TabBar_TabButtonSize; case PM_TabBarTabVSpace: case PM_TabBarTabHSpace : return DStyle::pixelMetric(PM_FrameRadius, opt, widget) * 2; case PM_TabBarTabOverlap: return TabBar_TabOverlap; case PM_TabBarBaseOverlap: return TabBar_BaseOverlap; case PM_TabBarTabShiftHorizontal: case PM_TabBarTabShiftVertical: return 0; case PM_TabBarScrollButtonWidth: // DTabBar有自己的scroll按钮,需要隐藏QTabBar的按钮 if (widget && qobject_cast(widget->parent())) return 0; return DStyle::pixelMetric(PM_ButtonMinimizedSize, opt, widget); case PM_MenuScrollerHeight: return 10 + Metrics::Frame_FrameWidth ; case PM_MenuPanelWidth: //非特效效果则 menu border 为 1 return DWindowManagerHelper::instance()->hasComposite() ? 0 : 1; case PM_SubMenuOverlap: return -1; case PM_ComboBoxFrameWidth: { //这是ComboBox VMargin const QStyleOptionComboBox *comboBoxOption(qstyleoption_cast< const QStyleOptionComboBox *>(opt)); return comboBoxOption && comboBoxOption->editable ? Metrics::ComboBox_FrameWidth : Metrics::LineEdit_FrameWidth ; } case PM_MenuVMargin: return 8; case PM_MenuHMargin: return 0; default: break; } return DStyle::pixelMetric(m, opt, widget); } int ChameleonStyle::styleHint(QStyle::StyleHint sh, const QStyleOption *opt, const QWidget *w, QStyleHintReturn *shret) const { switch (sh) { case SH_ItemView_ShowDecorationSelected: case SH_ScrollBar_Transient: return true; //增加菜单鼠标事件跟踪 case SH_MenuBar_MouseTracking: case SH_Menu_MouseTracking: return true; //增加TabBar超出范围的左右导航按钮 case SH_TabBar_PreferNoArrows: return false; case SH_ComboBox_Popup: return true; case SH_ComboBox_PopupFrameStyle: return true; case SH_Slider_AbsoluteSetButtons: return Qt::LeftButton | Qt::MidButton; case SH_ToolTipLabel_Opacity: return 255; default: break; } return DStyle::styleHint(sh, opt, w, shret); } void ChameleonStyle::resetAttribute(QWidget *w, bool polish) { if (!w) return; bool enableHover = w->testAttribute(Qt::WA_Hover); if (qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w)) { enableHover = polish; } if (auto view = qobject_cast(w)) { enableHover = polish; w = view->viewport(); } // TODO: 是平板环境统一设置所有的控件的 WA_Hover 为 false, // 不过在插入鼠标时还是有问题,现阶段先不考虑,以后 Qt 如果优化了如有更好的方案这里再改掉。 if (DGuiApplicationHelper::isTabletEnvironment()) enableHover = false; w->setAttribute(Qt::WA_Hover, enableHover); if (auto scrollbar = qobject_cast(w)) { if (polish) { scrollbar->installEventFilter(this); } else { scrollbar->removeEventFilter(this); } scrollbar->setAttribute(Qt::WA_OpaquePaintEvent, !polish); } } static void updateWeekendTextFormat(QCalendarWidget *calendar, QColor) { if (!calendar) return ; QTextCharFormat fmt; fmt.setForeground(QBrush(calendar->palette().highlight())); calendar->setWeekdayTextFormat(Qt::Saturday, fmt); calendar->setWeekdayTextFormat(Qt::Sunday, fmt); } void ChameleonStyle::polish(QWidget *w) { DStyle::polish(w); resetAttribute(w, true); if (qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w)) { w->setAttribute(Qt::WA_Hover, true); } if (auto view = qobject_cast(w)) { view->viewport()->setAttribute(Qt::WA_Hover, true); } if (auto listview = qobject_cast(w)) { if (listview->parentWidget() == nullptr) { DPlatformWindowHandle handle(listview); handle.setWindowRadius(DStyle::pixelMetric(PM_FrameRadius)); } } if (w && qobject_cast(w)) { w->setProperty("_d_dtk_lineeditActionWidth", -6); w->setProperty("_d_dtk_lineeditActionMargin", 6); } if (auto container = qobject_cast(w)) { if (DWindowManagerHelper::instance()->hasComposite()) { DPlatformWindowHandle handle(container); handle.setWindowRadius(DStyle::pixelMetric(PM_FrameRadius)); } if (!DGuiApplicationHelper::isTabletEnvironment()) container->setFrameStyle(QFrame::NoFrame); } if (auto calendar = qobject_cast(w)) { int radius = DStyle::pixelMetric(PM_TopLevelWindowRadius); // 只有dtk的应用绘制日历窗口圆角 if (dynamic_cast(QCoreApplication::instance())) { DPlatformWindowHandle handle(calendar); handle.setWindowRadius(radius); } calendar->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader); // 更改日历Saturday Sunday 活动色改变时跟随 DPlatformTheme *theme = DGuiApplicationHelper::instance()->applicationTheme(); updateWeekendTextFormat(calendar, QColor()); connect(theme, &DPlatformTheme::activeColorChanged, calendar, std::bind(&updateWeekendTextFormat, calendar, std::placeholders::_1)); auto topWidget = calendar->findChild("qt_calendar_navigationbar"); topWidget->setBackgroundRole(QPalette::Base); auto layout = qobject_cast(topWidget->layout()); layout->setMargin(radius / 2); } if (w && (w->objectName() == "qt_calendar_yearbutton" || w->objectName() == "qt_calendar_monthbutton")) { w->setProperty("_d_calendarToolBtn", true); DFontSizeManager *fontManager = DFontSizeManager::instance(); fontManager->bind(w, DFontSizeManager::T5, QFont::Normal); } if (w && w->objectName() == "qt_calendar_yearedit") { w->setProperty("_d_dtk_spinBox", true); //直接取用spinBox最大年限 int width = w->fontMetrics().width("9999"); w->setMaximumWidth(width * 3); } if (w && (w->objectName() == "qt_calendar_prevmonth" || w->objectName() == "qt_calendar_nextmonth")) { int btnWidget = DStyle::pixelMetric(DStyle::PM_ButtonMinimizedSize); w->setMinimumSize(btnWidget, btnWidget); } if (w && w->objectName() == "qt_calendar_calendarview") { auto view = qobject_cast(w); view->setItemDelegate(new QStyledItemDelegate); } if (DApplication::isDXcbPlatform() || (qApp->platformName() == "dwayland" || qApp->property("_d_isDwayland").toBool())) { bool is_menu = qobject_cast(w); bool is_tip = w->inherits("QTipLabel"); // 当窗口已经创建对应的native窗口,要判断当前是否已经设置了窗口背景透明 // Bug: https://github.com/linuxdeepin/internal-discussion/issues/323 if (is_menu && w->windowHandle()) { if (const QPlatformWindow *handle = w->windowHandle()->handle()) { if (!w->testAttribute(Qt::WA_TranslucentBackground) && !handle->isExposed()) { // 销毁现有的native窗口,否则设置Qt::WA_TranslucentBackground不会生效 class DQWidget : public QWidget {public: using QWidget::destroy;}; reinterpret_cast(w)->destroy(true, false); } } } // fix qtcreator QDesignerMenu setnotitlebar qmainwindow if (is_menu && w->isWindow()) { DPlatformWindowHandle handle(w); if (DPlatformWindowHandle::isEnabledDXcb(w)) { handle.setEnableBlurWindow(true); // 最大圆角8, 18忒大了,原来默认是8 auto theme = DGuiApplicationHelper::instance()->applicationTheme(); int wradius = theme->windowRadius(); handle.setWindowRadius(qMax(0, qMin(wradius, 8))); w->setAttribute(Qt::WA_TranslucentBackground); connect(DWindowManagerHelper::instance(), SIGNAL(hasCompositeChanged()), w, SLOT(update())); } } else if (is_tip) { if (DWindowManagerHelper::instance()->hasComposite()) { DPlatformWindowHandle handle(w); handle.setWindowRadius(DStyle::pixelMetric(PM_FrameRadius)); } QLabel *label = qobject_cast(w); label->setTextFormat(DStyle::tooltipTextFormat()); } } } void ChameleonStyle::unpolish(QWidget *w) { DStyle::unpolish(w); resetAttribute(w, false); if (w && qobject_cast(w)) { w->setProperty("_d_dtk_lineeditActionWidth", QVariant()); w->setProperty("_d_dtk_lineeditActionMargin", QVariant()); } } void ChameleonStyle::unpolish(QApplication *application) { DStyle::unpolish(application); } void ChameleonStyle::drawShadow(QPainter *p, const QRect &rect, const QColor &color) const { int frame_radius = DStyle::pixelMetric(PM_FrameRadius); int shadow_xoffset = DStyle::pixelMetric(PM_ShadowHOffset); int shadow_yoffset = DStyle::pixelMetric(PM_ShadowVOffset); QRect shadow = rect; QPoint pointOffset(rect.center().x() + shadow_xoffset, rect.center().y() + shadow_yoffset); shadow.moveCenter(pointOffset); p->setBrush(color); p->setPen(Qt::NoPen); p->setRenderHint(QPainter::Antialiasing); p->drawRoundedRect(shadow, frame_radius, frame_radius); } void ChameleonStyle::drawBorder(QPainter *p, const QStyleOption *opt, const QWidget *w) const { const QColor &focus_color = getColor(opt, QPalette::Highlight); if (!focus_color.isValid() || focus_color.alpha() == 0) return; int frame_radius = DStyle::pixelMetric(PM_FrameRadius); int margins = DStyle::pixelMetric(PM_FrameMargins); QRect border = opt->rect.adjusted(margins, margins, -margins, -margins); p->setRenderHint(QPainter::Antialiasing); QPen pen; pen.setWidth(2); pen.setColor(focus_color); p->setPen(pen); p->setBrush(Qt::NoBrush); if (w && w->property("_d_dtk_tabbartab_type").toBool()) { p->drawRect(opt->rect.adjusted(-1, 1, 1, -1)); return; } if (w && w->parentWidget() && w->parentWidget()->property("_d_dtk_spinBox").toBool()) { DDrawUtils::drawRoundedRect(p, opt->rect.adjusted(1, 1, -1, -1), frame_radius, frame_radius, DDrawUtils::TopLeftCorner | DDrawUtils::BottomLeftCorner); return; } bool table = qobject_cast(w) && !w->property("_d_dtk_enable_tableviewitem_radius").toBool(); //QCalendarWidget的QTableView焦点状态与QTableView不同 bool calendar = w && (w->objectName() == "qt_calendar_calendarview"); // DButtonBoxButton在不同位置焦点不同 const DButtonBoxButton *buttonBoxButton = qobject_cast(w); const DStyleOptionButtonBoxButton *btnopt = qstyleoption_cast(opt); pen.setWidth(2); int offset = 1; QRect rect = border.adjusted(offset, offset, -offset, -offset); // 先画内框(黑or白) pen.setColor(getColor(opt, QPalette::Base)); p->setPen(pen); if (calendar) { pen.setWidth(3); p->setPen(pen); offset = 2; drawCalenderEllipse(p, opt->rect, offset); } else if (table) { p->drawRect(rect); } else if (buttonBoxButton && btnopt) { drawButtonBoxButton(btnopt, p, rect, frame_radius); } else { p->drawRoundedRect(rect, frame_radius, frame_radius); } // 再画外框(活动色即焦点) pen.setColor(focus_color); p->setPen(pen); if (calendar) { pen.setWidth(2); p->setPen(pen); offset = 1; drawCalenderEllipse(p, opt->rect, offset); } else if (table) { p->drawRect(border); } else if (buttonBoxButton && btnopt) { drawButtonBoxButton(btnopt, p, border, frame_radius); } else { p->drawRoundedRect(border, frame_radius + margins, frame_radius + margins); } } void ChameleonStyle::drawCalenderEllipse(QPainter *p, const QRect &rect, int offset) const { QRect ellipese = rect; ellipese.setWidth(ellipese.height()); ellipese.moveCenter(rect.center()); p->drawEllipse(ellipese.adjusted(offset, offset, -offset, -offset)); } void ChameleonStyle::drawButtonBoxButton(const DStyleOptionButtonBoxButton *btnopt, QPainter *p, const QRect &rect, int radius) const { if (btnopt->position == DStyleOptionButtonBoxButton::Beginning) { // Begin if (btnopt->orientation == Qt::Horizontal) { DDrawUtils::drawRoundedRect(p, rect, radius, radius, DDrawUtils::TopLeftCorner | DDrawUtils::BottomLeftCorner); } else { DDrawUtils::drawRoundedRect(p, rect, radius, radius, DDrawUtils::TopLeftCorner | DDrawUtils::TopRightCorner); } } else if (btnopt->position == DStyleOptionButtonBoxButton::End) { // End if (btnopt->orientation == Qt::Horizontal) { DDrawUtils::drawRoundedRect(p, rect, radius, radius, DDrawUtils::TopRightCorner | DDrawUtils::BottomRightCorner); } else { DDrawUtils::drawRoundedRect(p, rect, radius, radius, DDrawUtils::BottomLeftCorner | DDrawUtils::BottomRightCorner); } } else if (btnopt->position == DStyleOptionButtonBoxButton::Middle) { // Middle p->drawRect(rect); } else if (btnopt->position == DStyleOptionButtonBoxButton::OnlyOne) { // OnlyOne p->drawRoundedRect(rect, radius, radius); } } bool ChameleonStyle::isNoticks(const QStyleOptionSlider *slider, QPainter *p, const QWidget *w) const { Q_UNUSED(p) if (const DSlider *dslider = qobject_cast(w)) { QSlider::TickPosition tickPosition = slider->tickPosition; if (dslider) tickPosition = dslider->tickPosition(); return tickPosition == QSlider::NoTicks; } return false; } QBrush ChameleonStyle::generatedBrush(StateFlags flags, const QBrush &base, QPalette::ColorGroup cg, QPalette::ColorRole role, const QStyleOption *option) const { return DStyle::generatedBrush(flags, base, cg, role, option); } QBrush ChameleonStyle::generatedBrush(DStyle::StateFlags flags, const QBrush &base, QPalette::ColorGroup cg, DPalette::ColorType type, const QStyleOption *option) const { return DStyle::generatedBrush(flags, base, cg, type, option); } QColor ChameleonStyle::getColor(const QStyleOption *option, QPalette::ColorRole role) const { return DStyle::generatedBrush(option, option->palette.brush(role), option->palette.currentColorGroup(), role).color(); } QColor ChameleonStyle::getColor(const QStyleOption *option, DPalette::ColorType type, const QWidget *widget) const { const DPalette &pa = DApplicationHelper::instance()->palette(widget, option->palette); return DStyle::generatedBrush(option, pa.brush(type), pa.currentColorGroup(), type).color(); } QBrush ChameleonStyle::getBrush(const QStyleOption *option, DPalette::ColorRole type) const { QWidget *widget = qobject_cast(option->styleObject); if (widget && !widget->testAttribute(Qt::WA_Hover) && DGuiApplicationHelper::isTabletEnvironment()) { return QBrush(Qt::NoBrush); } return QBrush(getColor(option, type)); } QMargins ChameleonStyle::frameExtentMargins() const { int margins = DStyle::pixelMetric(PM_FrameMargins); return QMargins(margins, margins, margins, margins); } QRect ChameleonStyle::drawButtonDownArrow(const QStyleOption *opt, QPainter *p, const QWidget *w) const { const QStyleOptionButton *btn = qstyleoption_cast(opt); if (!btn) return QRect(-1, -1, -1, -1); QRect rectOpt = btn->rect; //实际绘画箭头所占的小矩形 int arrowWidth = DStyle::pixelMetric(PM_MenuButtonIndicator, opt, w); int arrowHeight = arrowWidth; QRect rectArrow(0, 0 , arrowWidth, arrowHeight); rectArrow.moveCenter(rectOpt.center()); QStyleOptionButton newBtn = *btn; //绘画箭头的大矩形(不要竖线) QRect &newRect = newBtn.rect; newRect.setHeight(rectOpt.height()); newRect.setWidth(arrowWidth); newRect.moveCenter(rectOpt.center()); if (btn->direction == Qt::LeftToRight) { rectArrow.moveRight(rectOpt.right()); newRect.moveRight(rectOpt.right()); } else { rectArrow.moveLeft(rectOpt.left()); newRect.moveLeft(rectOpt.left()); } if (p == nullptr || w == nullptr) return newRect; QStyleOptionButton arrowDrawBtn = newBtn; arrowDrawBtn.rect = rectArrow; proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowDrawBtn, p, w); return newRect; } } // namespace chameleon qt5integration-5.5.23/styleplugins/chameleon/chameleonstyle.h000066400000000000000000000146751424734202100244610ustar00rootroot00000000000000/* * 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 CHAMELEONSTYLE_H #define CHAMELEONSTYLE_H #include DWIDGET_USE_NAMESPACE namespace dstyle { class DStyleAnimation; } DWIDGET_BEGIN_NAMESPACE class DStyleOptionButtonBoxButton; DWIDGET_END_NAMESPACE namespace chameleon { class ChameleonStyle : public DStyle { public: explicit ChameleonStyle(); void drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const override; void drawControl(QStyle::ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const override; QRect subElementRect(QStyle::SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const override; void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w = nullptr) const override; SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w = nullptr) const override; QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *w = nullptr) const override; QSize sizeFromContents(QStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = 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 = nullptr, const QWidget *w = nullptr, QStyleHintReturn *shret = nullptr) const override; void polish(QWidget *w) override; void unpolish(QWidget *w) override; void unpolish(QApplication *application) override; QBrush generatedBrush(StateFlags flags, const QBrush &base, QPalette::ColorGroup cg, QPalette::ColorRole role, const QStyleOption *option) const; QBrush generatedBrush(StateFlags flags, const QBrush &base, DPalette::ColorGroup cg = DPalette::Normal, DPalette::ColorType type = DPalette::ItemBackground, const QStyleOption *option = nullptr) const; private: void drawShadow(QPainter *p, const QRect &rect, const QColor &color) const; void drawBorder(QPainter *p, const QStyleOption *opt, const QWidget *w) const; void drawCalenderEllipse(QPainter *p, const QRect &rect, int offset) const; void drawButtonBoxButton(const DStyleOptionButtonBoxButton *btnopt, QPainter *p, const QRect &rect, int radius) const; void drawRoundedShadow(QPainter *p, const QRect &rect, const QColor &color,int frame_radius) const; bool isNoticks(const QStyleOptionSlider *slider, QPainter *p, const QWidget *w) const; QColor getColor(const QStyleOption *option, QPalette::ColorRole role) const; QColor getColor(const QStyleOption *option, DPalette::ColorType type, const QWidget *widget) const; QBrush getBrush(const QStyleOption *option, DPalette::ColorRole type) const; QMargins frameExtentMargins() const; QRect drawButtonDownArrow(const QStyleOption *opt, QPainter *p, const QWidget *w) const; bool drawSpinBox(const QStyleOptionSpinBox *opt, QPainter *p, const QWidget *w) const; void updateSpinBoxButtonState(const QStyleOptionSpinBox *opt, QStyleOptionButton& button, bool isActive, bool isEnabled) const; bool drawMenuBarItem(const QStyleOptionMenuItem *option, QRect &rect, QPainter *painter, const QWidget *widget) const; void drawMenuItemBackground(const QStyleOption *option, QPainter *painter, QStyleOptionMenuItem::MenuItemType type) const; bool drawMenuItem(const QStyleOptionMenuItem *option, QPainter *painter, const QWidget *widget) const; bool drawTabBar(QPainter *painter ,const QStyleOptionTab *tab, const QWidget *widget) const; bool drawTabBarLabel(QPainter *painter ,const QStyleOptionTab *tab, const QWidget *widget) const; bool drawTabBarCloseButton(QPainter *painter,const QStyleOption *tab , const QWidget *widget) const; bool drawTabBarScrollButton(QPainter *painter, const QStyleOption *opt, const QWidget *buttonWidget) const; bool drawComboBox(QPainter *painter, const QStyleOptionComboBox *comboBox, const QWidget *widget) const; bool drawComboBoxLabel(QPainter *painter, const QStyleOptionComboBox *comboBox, const QWidget *widget) const; void drawSliderHandle(const QStyleOptionComplex *opt, QRectF& rectHandle, QPainter *p, const QWidget *w) const; void drawSliderHandleFocus(const QStyleOptionComplex *opt, QRectF& rectHandle, QPainter *p, const QWidget *w) const; void drawIcon(const QStyleOption *opt, QPainter *p, QRect &rect, const QIcon &icon, bool checked = false) const; void tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const; bool drawTableViewItem(QStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const; bool hideScrollBarByAnimation(const QStyleOptionSlider *scrollBar, QPainter *p) const; public: #ifndef QT_NO_ANIMATION dstyle::DStyleAnimation *animation(const QObject *target) const; void startAnimation(dstyle::DStyleAnimation *animation, int delay = 0) const; void _q_removeAnimation(); #endif protected: void drawMenuItemRedPoint(const QStyleOptionMenuItem *option, QPainter *painter, const QWidget *widget) const; void resetAttribute(QWidget *w, bool polish); void transScrollbarMouseEvents(QObject *obj, bool on = true) const; private: mutable QHash animations; bool eventFilter(QObject *watched, QEvent *event) override; }; } // namespace chameleon #endif // CHAMELEONSTYLE_H qt5integration-5.5.23/styleplugins/chameleon/common.h000066400000000000000000000124531424734202100227250ustar00rootroot00000000000000/* * 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 COMMON_H #define COMMON_H #include namespace chameleon { enum Metrics { // painter Painter_PenWidth = 1, // frames Frame_FrameWidth = 2, Frame_FrameRadius = 8, Frame_BorderSpacing = 2, // shadow Shadow_Radius = 6, Shadow_XOffset = 0, Shadow_YOffset = 2, // layout Layout_TopLevelMarginWidth = 10, Layout_ChildMarginWidth = 4, Layout_DefaultSpacing = 6, // line editors LineEdit_FrameWidth = 2, LineEdit_LeftMargin = 3, // combobox ComboBox_FrameWidth = 5, ComboBox_ArrowButtonWidth = 40, ComboBox_ContentLeftMargin = 6, // spinbox SpinBox_FrameWidth = 1, SpinBox_ArrowButtonWidth = 20, SpinBox_ButtonIconWidth = 2, SpinBox_MiniHeight = 44, // groupbox title margin GroupBox_TitleMarginWidth = 4, // buttons Button_MinWidth = 80, Button_MarginWidth = 6, Button_ItemSpacing = 4, // tool buttons ToolButton_MarginWidth = 6, ToolButton_ItemSpacing = 4, ToolButton_InlineIndicatorWidth = 12, ToolButton_AlignLeftPadding = 10, ToolButton_AlignCenterPadding = 8, ToolButton_AlignRightPadding = 9, ToolButton_AlignLeftMargin = 7, // checkboxes and radio buttons CheckBox_Size = 20, CheckBox_FocusMarginWidth = 2, CheckBox_ItemSpacing = 4, CheckBox_FrameWidth = 14, // menu Menu_ItemHMargin = 0, Menu_ItemVMargin = -1, Menu_ArrowHMargin = 6, Menu_CheckMarkWidth = 12, Menu_RightBorder = 10, Menu_ItemFrameWidth = 8, Menu_ItemHTextMargin = 3, Menu_ItemVTextMargin = 4, Menu_FrameWidth = 0, Menu_HMargin = 0, Menu_VMargin = 10, Menu_SeparatorItemHMargin = 5, Menu_PanelRightPadding = 10, MenuItem_MarginWidth = 3, MenuItem_ItemSpacing = 4, MenuItem_AcceleratorSpace = 16, MenuItem_TabSpacing = 16, MenuButton_IndicatorMargin = 8, // menu bar MenuBar_ItemSpacing = 6, MenuBarItem_MarginWidth = 10, MenuBarItem_MarginHeight = 6, // scrollbars ScrollBar_Extend = 12, ScrollBar_SliderWidth = 16, ScrollBar_MinSliderHeight = 40, ScrollBar_NoButtonHeight = (ScrollBar_Extend-ScrollBar_SliderWidth)/2, ScrollBar_SingleButtonHeight = ScrollBar_Extend, ScrollBar_DoubleButtonHeight = 2*ScrollBar_Extend, ScrollBar_SliderMinWidget = 36, // toolbars ToolBar_FrameWidth = 2, ToolBar_HandleExtent = 10, ToolBar_HandleWidth = 6, ToolBar_SeparatorWidth = 8, ToolBar_ExtensionWidth = 20, ToolBar_ItemSpacing = 0, // progressbars ProgressBar_BusyIndicatorSize = 14, ProgressBar_ItemSpacing = 4, ProgressBar_MinimumStyleHeight = 8, // mdi title bar TitleBar_MarginWidth = 4, // sliders Slider_TickLength = 20, //滑块的长度 Slider_TickMarginWidth = 6, Slider_GrooveThickness = 2, Slider_ControlThickness = 24, //滑块的高度 Slider_TickmarkOffset = 14, //刻度的高度 // tabbar TabBar_TabMarginHeight = 8, TabBar_TabMarginWidth = 12, TabBar_TabMinWidth = 80, TabBar_TabMinHeight = 20, TabBar_TabItemSpacing = 8, TabBar_TabOverlap = 0, TabBar_BaseOverlap = 0, TabBar_TabMargin = 10, TabBar_TabButtonSize = 22, // 标签页按钮大小 TabletTabBar_TabButtonSize = 36,// 平板环境标签页按钮大小 // tab widget TabWidget_MarginWidth = 4, // toolbox ToolBox_TabMinWidth = 80, ToolBox_TabItemSpacing = 4, ToolBox_TabMarginWidth = 8, // tooltips ToolTip_FrameWidth = 3, // list headers Header_MarginWidth = 6, Header_ItemSpacing = 4, Header_ArrowSize = 12, // tree view ItemView_ArrowSize = 10, ItemView_ItemMarginWidth = 3, SidePanel_ItemMarginWidth = 4, // splitter Splitter_SplitterWidth = 1, // shadow dimensions Shadow_Overlap = 2, // group box GroupBox_TopMargin = 3, // progress bar ProgressBar_BorderWidth = 1, ProgressBar_Radius = 4, // icon Icon_Size = 64, Icon_Margins = 10 }; //* corners enum Corner { CornerTopLeft = 0x1, CornerTopRight = 0x2, CornerBottomLeft = 0x4, CornerBottomRight = 0x8, CornersTop = CornerTopLeft|CornerTopRight, CornersBottom = CornerBottomLeft|CornerBottomRight, CornersLeft = CornerTopLeft|CornerBottomLeft, CornersRight = CornerTopRight|CornerBottomRight, AllCorners = CornerTopLeft|CornerTopRight|CornerBottomLeft|CornerBottomRight }; Q_DECLARE_FLAGS(Corners, Corner) } // namespace chameleon Q_DECLARE_OPERATORS_FOR_FLAGS(chameleon::Corners) #endif // COMMON_H qt5integration-5.5.23/styleplugins/chameleon/main.cpp000066400000000000000000000023111424734202100227040ustar00rootroot00000000000000/* * 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include "chameleonstyle.h" #include class ChameleonStylePlugin : public QStylePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "chameleon.json") public: QStyle* create(const QString &key) override { if (QStringLiteral("chameleon") != key) { return nullptr; } return new chameleon::ChameleonStyle(); } }; #include "main.moc" qt5integration-5.5.23/styleplugins/chameleon/menu_shadow.svg000066400000000000000000000006461424734202100243170ustar00rootroot00000000000000 qt5integration-5.5.23/styleplugins/chameleon/resources.qrc000066400000000000000000000001471424734202100240020ustar00rootroot00000000000000 menu_shadow.svg qt5integration-5.5.23/styleplugins/dstyleplugin/000077500000000000000000000000001424734202100220475ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets.qrc000066400000000000000000000054771424734202100240750ustar00rootroot00000000000000 assets/icons/arrow-down.png assets/icons/arrow-left.png assets/icons/arrow-right.png assets/icons/arrow-up.png assets/icons/button-cancel.png assets/icons/computer.svg assets/icons/dialog-apply.png assets/icons/document-save.png assets/icons/drive-harddisk.png assets/icons/emblem-symbolic-link.png assets/icons/folder-open.svg assets/icons/folder.svg assets/icons/help-faq.png assets/icons/media-optical.png assets/icons/process-stop.png assets/icons/text-x-generic.svg assets/icons/user-home.svg assets/icons/user-trash.svg assets/icons/view-refresh.png assets/icons/window_close_hover_dark.png assets/icons/window_close_hover_light.png assets/icons/window_close_normal_dark.png assets/icons/window_close_normal_light.png assets/icons/window_close_press_dark.png assets/icons/window_close_press_light.png assets/icons/window_max_hover_dark.png assets/icons/window_max_hover_light.png assets/icons/window_max_normal_dark.png assets/icons/window_max_normal_light.png assets/icons/window_max_press_dark.png assets/icons/window_max_press_light.png assets/icons/window_min_hover_dark.png assets/icons/window_min_hover_light.png assets/icons/window_min_normal_dark.png assets/icons/window_min_normal_light.png assets/icons/window_min_press_dark.png assets/icons/window_min_press_light.png assets/icons/window_option_hover_dark.png assets/icons/window_option_hover_light.png assets/icons/window_option_normal_dark.png assets/icons/window_option_normal_light.png assets/icons/window_option_press_dark.png assets/icons/window_option_press_light.png assets/icons/window_unmax_hover_dark.png assets/icons/window_unmax_hover_light.png assets/icons/window_unmax_normal_dark.png assets/icons/window_unmax_normal_light.png assets/icons/window_unmax_press_dark.png assets/icons/window_unmax_press_light.png qt5integration-5.5.23/styleplugins/dstyleplugin/assets/000077500000000000000000000000001424734202100233515ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/README000066400000000000000000000002421424734202100242270ustar00rootroot00000000000000All images under this directory and its subdirectories are made by Wuhan Deepin Technology Co., Ltd. Licensed under GNU GENERAL PUBLIC LICENSE Version 3 or later.qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/000077500000000000000000000000001424734202100242725ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/check_disabled.png000066400000000000000000000003321424734202100277020ustar00rootroot00000000000000PNG  IHDR  gAMA aIDAT} @w@`!SY "R Z`Xvw3$谖2V[huȲF1)"U!T (()Gx!5StNjѫ4L=mo/:-)=.Hj:+h[55QIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/check_normal.png000066400000000000000000000003251424734202100274250ustar00rootroot00000000000000PNG  IHDR  gAMA aIDATc`" %Lxԁ8:>Ob5|D & L @ ـL ȸ&;sA1@$S@\@V1@ m@^iTT M@<Pex@@& .H"xIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/check_selected.png000066400000000000000000000003151424734202100277240ustar00rootroot00000000000000PNG  IHDR  gAMA aIDATc`Ċx@Z3T _@lO2P{ .+rxX&dsE ^ @i@|y@@z1_ኁ@|q1budPBo1#a dC*t/IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/000077500000000000000000000000001424734202100260605ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_checked.png000066400000000000000000000010011424734202100320120ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c` ܿ_DHs160/H9ȷ+r޿†@ݻgvݟ@$jǖ-[$߽{3yda5@0330/9[0!Dv޽JQQH ?kÆ >jr>رٟ>}ZS1 bؼyHzzzTTT&\RRRLFxa֭ZZZKϜ9SR;_K.M;oF 0?$$d޽{MYXXXYYU.\ F1۷ ʁ.x4$׭AAAG5!Q It=z-48NlPXXX #eԂ r&eA ͠dc2L0 ,0E3L,DUzIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_checked@2x.png000066400000000000000000000021371424734202100323770ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WmHQr#+,NHBB$HaZ-4i1d,B%h"BQ:!$E0JCS3w_ݹ|<{{w ſ6&''a伕`jۉw3s/ZQTZW3 &ơva'0b9LVSSSǀ_j@ ir0"beeew`0|Xd7422p9dfu/%MQQQ ёKSSS7Rv9 5o=@{XGRbb (e^d;h w$rI|= `M c' #hpp0 ί35p{bR}ZsL\777DŽ=dxT,6L R(Ѐ>APo- '቞"_I.%nJjYGV>x8y|hxxx5ܜ3inZ %$$2bby={WWWFEE8QJw{ Qy#/R9ƴ8g{ʖ@TߘmeӒ'۽W0Xbbb=']uVu 33k ˟ozl6Gƺ<Lrcc']Qbl ) } ָ,r29~YY,+Sg0~;+l%L\oq(3>$xOO~o@r0 SJlmpIЫOo@-5.Ao#)57e=ʏ0 _ypS)IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_checked_focus.png000066400000000000000000000010331424734202100332160ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c` ܿ_Dv߯F30HЁ&3;0_ q322Z@eqlNjS%%Nد{o"GQQ"4 {ɓ69Hr6.AA@ZZy!P[˿3b *m>|X t=KG;vp"GG@ ytW...͛7;$`GIEEe߿%%%a4[n Zz̙2OOON__9@Zti4hH,@y!!!kk"((T,ʪr…0M4o߾o``Pt{! _n : bLĤѣoͧı03>$lmm=! &Z ȸ= edb\#:3 h[=,sȢ <IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_checked_focus@2x.png000066400000000000000000000022541424734202100335760ustar00rootroot00000000000000PNG  IHDR szzgAMA acIDATX WoL[Uvu@Af$N [Dp7I!;> 1q1uDHAu&LHL@0̚ ,]y)O{}= 6ރ Z7#(v εdKԪ}^e;;;.6/c̒'-zq97E.~ $3z}'vd V.G{$R )}|+w4 .ٜG;滻 ${{'D#) E*b[QQ 0V_ `@[[p(z?Ѿv-3/(_A֠ TkZ-| h\jB 9@ͰSsg4IN044tjɑN; LMUUd2][&777lKaap|+?΀>00ÃMA9w V2j.L*䙙kSSd,tċ-//_uͦF>Q9!h4^*oCeccm6;Ⱦ U \ n?]-,t='9rްSյ$77ڞ{)IfL:ab1rкܜXQ@7-~S9f=Vgˊ4#g߄\k?)6;/5r*mf P<#M6;@kF# NV?̿!NhIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_checked_hover.png000066400000000000000000000011201424734202100332170ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c` pQ|lvJg??C?+%# YgRp6÷O释_?@Heabh/Y"43(w=' 1&fV.>&mά4cՙ,.3~Ύxp . %kjGk~9n+WyVVV֌U1{T140|ubc.F72A,r>u A'@% XwC￘z2[C~6^6N'd=:Fŀ߾gkckAL=ύ=ӀNU1{&AY_M ahgd+rl Y( D `Ct3A9410<qH7]/r-BN "/!&1Pe@.IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_checked_hover@2x.png000066400000000000000000000023701424734202100336010ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WoLU{{k aҮں`V,Eef ctk\ʴ`O&馱j%k17\Qgµ%ƽp9/煔?/ۧvss{^[o$D9n& r`8wݎ3>8ǰo3ŜGHzUU!|P"/jˇ @ 8wb,[;7 aZn*@#/!E3vB]^rRt01cƢbi~8m hpY׺>pJw?&7g:6:ڟLpxt ` ^ a^ 7\.1-7m; e{Xc৙nrl(Yy|\AS Ȩ(YunG^!7A2m?ttCc%rq}]qɍ ~zѧkG}m;x|fAN/BgęFp#3|~)\0s2tOĻ >t0EMe,wxn8"ʳg{ANyy͎a:RUPdQc#Ɖw4Gz^fK{!6ީ4#t+xOnݮݲL퓐)uZkVJs qN,w%qmʄ+1|lYZ(};vNzoK8kh%{ Yu4j;o}Lv{[|V¼>*}#qjĖ9Z*c]?هڷB8plO{R֝/h ű2 5qtOTӚ+cGٜÇŃ(S'AFW?LxpS"e \GrnSD]C@r7̻?^栞$0IENDB`checkbox_checked_insensitive.png000066400000000000000000000007631424734202100343710ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkboxPNG  IHDRagAMA aIDAT8SK`w-]0\M "U򢑗xb7g*x,괈i`bi(8%}~y<\~ߏTl\l 306zt:L&F|>W7bHt:! l~FfbQv ؕrS<7V-IZ|;(R xJ8.b /z~Zz}/Y˲^TwaORf AP}jzUU=G@6e3 rjͯM ǘ.˲^4Mr2DOx0&!Lj#O(H$MӼdžp j%r"piD bA ,察ě>?n@ko/okIENDB`checkbox_checked_insensitive@2x.png000066400000000000000000000020771424734202100347430ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkboxPNG  IHDR szzgAMA aIDATX W[OZA"4PC[5&XjW?ۣ&5X!Hm6( K"J7gqA/&ۙ9k>vss۷ z*L?99 \]J۱/'ƕ+鰑B**D\:,/A]9v&xRzffN'lܳ(P*-VTP3XD(`H[F0ĝ3#Q{s@ pp %DDv!߿f7A!Gާ'AߓqW<'l.6A`@Maf)bǣ@0 HXUJK_KlqL/k?7M`d<15yAūmLPT6X8r^o`$RӭqWt6+ *bV@ 3frA2Q6-6$ŒɨuыxY7[VcbzH:|44>,z+@@IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_checked_press@2x.png000066400000000000000000000027371424734202100336210ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX Wmhe޳sq0XȲ>)*3+2*,+V ѲSF*BAC"(UQ} Yf|<]>{W羯xߝ7Yu.µغ#SFVkKp@sh;Uep\ G9YmЍ9-Q:z+x_+D*gdHJ.؄m(Nc;=u]”R6]ƂڢG Éx ~~FPtc;w}w}X"_:)yFێb=R[oW,J!1gꧩi؊Pm*\&*/F7aP$B`otcd枍G"T!ݍ{NXHL0TNJT.1 ` j#t_wCz@ Vxadʹx()̓}nZ+[Zro6(-3=ΊC !0"t '+`-TXq=H߆iy ~BBƝ?Ua+; 289ppH%~kWD kqEp*Iv 1FO'o *6<7glB)Kvxזs7YY3Wu]qXs 8"FTaڮd}JG]DگVr ^Pɻjw<2]hâA-"1~>glŨbtw%KNC-?6ӁlTaBedô.^lg݉ 8Tb+ ۸cXLBkCl?ܱM[GYM`}Yh#Y XPfFӆ"k~ }CćNwKh!xL*l3'YzȟU$+_|"!ÇCcMY Cc>TI@s@d熠 (y 222+`{(%> RR  "b4 y! - bYLjn `s5'!˽xz>=0qp!,Mʰ@,3\B 6SIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_mixed@2x.png000066400000000000000000000007211424734202100321140ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX W1N@Wvf+bIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_mixed_focus@2x.png000066400000000000000000000010201424734202100333040ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX c`[-my!Z3В\dKsbWt-w:<D-w[|٢ʗjHeKŵZ+Wgdt4 f<@`?0EԠ%Ev302J210 f8(Alϩm9\ Al] 6`Ѵ0jNis8lp>4uhJ]/*ŧ$jjj6< J$4u<{C`!`:Am8Z~v扫 PD̆`$.\j@ 3A-c>lxA]cOwۨ,Ɂ,9\W} 958I -IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_mixed_hover.png000066400000000000000000000004261424734202100327470ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`02PR`2v,` ]g85QI0&00H2142]X @jAzza`$vAX!E{PĀ@b(F @z#(y jz?÷7 n10' fՍ |"w q0635$~31;<< IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_mixed_hover@2x.png000066400000000000000000000010021424734202100333100ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX 헱KQǿwgIbAR ֤ :FH MԐK45$ bw|j.y&qw=z{/( j)Ϗ%v3Ǎi11yD<0 ʀWѲ#~jXf GDr/:(z>P'6vӈθ,6]}IF.DmYdJ))y߹+'E&L)e_CAAcO 9k;il'$I[a'&};Q,W\.zFf%%odvRp!r+|ġԤ6d)(C 6  De.a4E^s4I ^ iἸ KpGg 6ŏ/kVUź j$%5Zp,XQLp-t`̈́֏[R\[2egg৛.MEw~ ~_{/% .=\3ڽ:(KfJdXr-ЩLޔad?8/Ho\$7@MY Q!s`nR'QIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_mixed_press.png000066400000000000000000000006231424734202100327570ustar00rootroot00000000000000PNG  IHDRagAMA aJIDAT8R1N1 78x'P'^ (OHt Xfq6 a;'و|=J$r?L(D3v0&ҦsuÊ~ d6#Q1=`}DMreZށyilrm1-ȁM$D5jkj@}=l^Ol'׳ $$4ű-Id8խoWz"oGhwܪ@qȿeA@EYG΍& ;`UyC3H.Duc{"y/;1srM/3 gyn;f _g[k.IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_mixed_press@2x.png000066400000000000000000000020061424734202100333260ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX 嗽nSAw(R$R PsgH /@::-H@HMqp|og=e=3眙]_;rJpv~}ikBDJL P*Ǜ>mm˹tUCO[g7ͳ:A=^MDɢ)[o`d[:fM4dX~uKJaKAJB}6͡he 2n`\ nϐ^:djkTcӞDǘRo"D4M7D7(@ݷ %4qk yib!ۚw g Zo'XPoe1FCu9NM[n <˃[^z).>WsuB#b|S PT:_YI&jמy z\X<˧ȅiQ!Z.n #P޸0nNta[ sÑz<(ХpBć=s9  zsCD`=;: _x|f@VY[%b[ ̎@zèm〮YmiDh" ɜ .4Z|@$ 񼧽 "⪡x,+hi@<5?dP\ǁS^"Obޗ/ ]? 0|ywiBSď(JA|`Hgh ugVގܸkwM <Zεtn7{Wklq/_b&k$G cO6l; (y 222+`{(%> RR  "b4 y! - bYLjn߀WTCՂ4%I)L0CԲCY IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_unchecked@2x.png000066400000000000000000000006541424734202100327440ustar00rootroot00000000000000PNG  IHDR szzgAMA acIDATX WAN@T;ݙ^x t 2܀. @luцɗtcuљda}o8!cӜmچzi~ 3jXҜGo gEB> P-=w]YUkoY}]j'I\axy)a$`Yȣ(zi4Q E"v1pMܺ75 Ņ .S ^-H8<ӳ8s9@zpS3l.Y @N12;ҫc ([SjZM̲X,#[6&5a/G3yHwI3IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_unchecked_focus.png000066400000000000000000000003771424734202100335730ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`0v߯F30H3#" &aX@AeqlNj3@6O= C#P]%XO&@v DMf:ylLzh,x0= DP0hZp*AɓC@j@jAd 2H?ERnE/:ZoIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_unchecked_focus@2x.png000066400000000000000000000007261424734202100341430ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX c`[-my!Z3В\dKsbWt-w:<D-w[|٢ʗjHeKŵZ+Wgdt4 f<@`?0EԠ%Ev302J210 f8(Alϩm9\ Al] 6`Ѵ0jNis8lp>4uhhh"WP jѪ d3HԀѴ0av@8n K(W 65LPd&3* . '`d狻mnZ@ w_l@.+JAl$%͠ ѩ8IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_unchecked_hover.png000066400000000000000000000003631424734202100335720ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`02PR`2v,` ]g85QI0&00H2142]X @jAzzQF@ɓXV  Qepۏ??qf5ndɍX35+$~31ĺ1rǖIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_unchecked_hover@2x.png000066400000000000000000000007221424734202100341430ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX 헱K@_j0Č UqNn'qrqMpqrp H&PCI+(M^;ŦE%wN:$1.Q >,+*@[{$^.)7MǚERBxAyI)j2߼蝓"S D}T̄3`0 L&I%b:-iowʸl" m9=5K]#6qȟ=T5=xp{DN|' LJ I ʋ1%|i61tF, O*8ؒœ\+nAE{ /K/wyz3IENDB`checkbox_unchecked_insensitive.png000066400000000000000000000003321424734202100347240ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkboxPNG  IHDRagAMA aIDAT8c`0 H1??G ~b xBtt4ˍԀ- G@`AjAz@a^:4" r@= qN4 L:ZH2%IAuYOp@`IENDB`checkbox_unchecked_insensitive@2x.png000066400000000000000000000006151424734202100353020ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkboxPNG  IHDR szzgAMA aDIDATX WK 0LQFgw9z܋{ŕ"XgB,/F֘L|Q߇~( MZ@qօ$s @@W. =L\_8!VX'I2 p* iἸ1ɩ]`XEݳԈC֗5WiO' 0]zGYp4YEQTG,T~ޔad?βlV'"s~"'jN& 1SQ?P IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/checkbox_unchecked_press.png000066400000000000000000000005751424734202100336100ustar00rootroot00000000000000PNG  IHDRagAMA a4IDAT8RAR0 ||ϡ9wz26hFҮi߽}5{W|(c;30X/j"&10 `дw(@zD#f^!76i lc7*@ROۦv@sFZ_4q5QnTt8<3s󧐔5-tm*G"𶁀7R(j@pXDU/O6Еx8~|x5)A*[`⡥(p̑dؙ%/y+ nf ]oqX#(AQGC~@oƙjo;PFm 6 qkyqGJXmMyy 7YD>94_o.(G>>hnmT'<O)bc8|WSx9֦U"MNUZ1 *?bb݀tb8S߁\gm 43_Ƕջ8"|WEí;Ht~_ I*HX ba[G)Z#HZ_'ښHp"l^:NҠԄB"]yD2G6Jp0Q0#&7f4&z22|"'@r!O=6<+gVn9B2?yد`aN΅1YbvMߺgw2[k5& |ubt$)+YlXn!r ^1gYx7FB9Cznn+AreSis!Y5 pEёΘe `#j+48kΘO\A0V) [%in$).\bo#U C+j'?Leɤ'gIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_checked@2x.png000066400000000000000000000017331424734202100317100ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WKAޘJ4JD ^b9K7k{^o-^PHJ R-BI "-3m2ԃ3e] (ס߃ڍzUU4OUnz<6S"ý (tP?F#`Aa:>|h4lG B^O}]4 W0~ 6>\^^222R+p*NlhhhD1p Mcggr78 ;X"dgsIl||i'IlO<$WAFv~~~mR:ԕ2ض-%vmu< l`x5&60a ǣ?J8;+Պm&'''ڍL./-X 5x9 \In l{+ .+L&_McRFJ lT}Π'!uzzy=:B81͛e~0hl6qxxd C?鯝gmM9qq1{(81 b/}'727X]]j.\uVF{Ʉ)+ C pv 3&BǬ&^8sU6ĔyaMrZsG/bRAaZN]FsO5 z3cB㲀ȹI ]]1 aIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_checked_focus.png000066400000000000000000000006631424734202100325360ustar00rootroot00000000000000PNG  IHDRagAMA ajIDAT8c`0_%r*P;@8z3~FփbߎǷZyܛ żJfaL\LY#f4,LX(P@ ɁԀ 9W~(L 4ĚSŨ]&"AΆi644d=}t՝;w΁0 g̚5THH(QAlDʰ) )bPf]PT xF#AɁ FFP<u{n_0 Ƀl0exلN@j@.)$')2l5/IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_checked_focus@2x.png000066400000000000000000000021121424734202100330770ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX W]HTAs׻4EJ5!*H )@ɟL0(ا(I0H4!Bb0Q[]r{;ͷ6w,|3|3\pUIB" *a@f@gDJD/w&NR&tW2B+C_'$Ei$;edǩς$b3sw3=xY'<3tL%T  J} wmLIͼ,Dt WH}Vv]j^KTU7_kn`'RX!nF$Lx̊D\Q24-o"7Wj*npCtm:ˬC>`ߜpl\+X[ 7ǵut6 gxjX}s-V'2Y5`k|LDᩍ]=h>/,G8Wq(#l$Q1 PLh1/HU0Wc b!G9c{\aU6Z $cuֵ(L,gʈ,$Я# Q5pA|$#jlnu?Ԑ GIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_checked_hover.png000066400000000000000000000010761424734202100325410ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8S=H[QˋşhI@CşLV08*8M":t֥&.7]ZhI,TAQS$O6{7Q{9s9Onn(,7Mf:`T\\W}_wc!2+yn V{-A1O@؜_Ɯ}eB+Է}" ~n~L aH3۷*m`lDDr$ˠxWoVwcZn Y’#Y-L:E_c~#^/'``|ssYw| #ǘ'|R}T 9Q>Ygi2مqT|u ??<:Y&1I\zd_ԐA"iIQm7`'{gr-_qae0ǹ,@9P ;N ,JXCWLI,l j? ٲSq,o]pt"ү[dIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_checked_hover@2x.png000066400000000000000000000024751424734202100331170ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX W]hU~4mβHMċNPAa Uqwc(tT!wzVAz!Q\B\if]m.Lq|sr5IZ|cVGs_tF;=mB\DL{4a#X = FK A{9Α~'57Ua_bSᒊ'_Nީa bb\XenPu.s  wĶV9^JaC#Ehb=‹Еjsq[,sj$;}p|aU.>~ { QYBV\q[G{߼t^owd5FTZ D^G`JyN2Sa_6~lrSL 藊jffQ[M.ryk\,x'3 o7jk ׊qFcYF|Ul.^|XPm"'Vk5؎\NU wo5>FmW\DW`R-CY>պj[5mī˜lOVd'xOG__WW>~5iHL 4rS̋@=8B->:+0Rߝ@arƔiBSYv6M󡹮SN<v8~뺖`NN#.#m`pAZ|g&gLGXp=`VeěvIENDB`radio_checked_insensitive@2x.png000066400000000000000000000014761424734202100342550ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkboxPNG  IHDR szzgAMA aIDATX Wn15hRH[!ED/;čΝ $T*KJ9jpm!&7^⩷}7`6MBϨ&IX,>EP_Crxk%UP$3Bl2JFxxoSv?x/V&:`B9(WZ]t<~lĹ@(_Db>%O0naf.w;hZD̚nkݓE8 -sxpzq ըa*jNۏV')d BW!WθQC5k_7ykg_짙'5qU@\rg%(,8KΊ`þ4d IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_checked_press@2x.png000066400000000000000000000026701424734202100331250ustar00rootroot00000000000000PNG  IHDR szzgAMA aoIDATX WMh]Us^SĚ"vUTDTэ. ĕ WRpFԍPRTŠ ԶRkS6i!!$}swkNfo9?ވNdW]~ob<P/_JU2=n&)R)-LLdɏqE^ ոe't}Gy/P0`, Թ/y]찛 ZwAq&'}]zJ\345Y9Ĵ1"'Jlםϣb)%bUN6Ylac K4bIJy":]vvgAX. LIrL3xnY˜|GI@&Lm´R1S7rb4Ln Z@[ـ`r,cYd#[VܺwY}b mt)Je[sp)ZJxw=AS=[D^,2ХrzFd70-%C9-ߛ[_.y&6"4MDO` y*pxh4 J@kahm'!ÉEh[6Kުs!yܰP,O/5kƦН {Z!V'۳\M ؔ"-aN5Mq1W ]!0_G[0&Hm?b̬n.~_8v29U[׮! )Uk2Bd7g,Xm=9#6D-ʥ(@*_/f09zVdVgCTWn1=A hږ 005á00ô4 Ib،û Au#m"⮷uoK| ϼ[BF>3 ?<}͐űPӺK`%(npPx1Zb,@sSxD꥟FbӜ+TGB`FB(.ǩ>!t*u^?{ru_EH!Z1Sh߅ nO]t,-Riu5ܹp.&bAV5O{e畎f.(B%83مFu\߰mKNbn *\rvvԫ/>x'/b@6Ė<̜,#|V5J[ -0B:M̧E@Gw }=cEAmtRtskgGϗ&p112{6m~j+4}6oxM[Ǧ 2!p܊ CxyYIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_mixed.png000066400000000000000000000005351424734202100310550ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`0?PL偘*H?Kb` f)Ǐ._ŋTDFF0{h38 iO9st 00HjB?@O3@Z `/9&@g ]A#wr LgZPejA3`Jj1ĂMɹs^xQcmm=Y AHgg&P#䱉 Z ^%` L@j :JH'e@N̄ r8㫡5 IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_mixed@2x.png000066400000000000000000000014761424734202100314340ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WAkAލ -b4z ҃D{oО,C R 5j-3˨k6!ơ}Դt'\.`C ~ v-pK;B@|? cd!A-`0l6v}h4^Wd2T*u G{"7Fp9_ZoBa08P kZ8N?CL!u0Kp~7drt:?ʺdr^!אV$6mc9Z":Ͷ:2|Z}Cy` W- }Kc8W=VD {s|F=:ë #' *v.m  w᜘ I`߮rmWVvb 0jljcLZ k'j]*ls'*QXLa\\qER:Uu\!#9`;63#[љ; "Ӕ\)ꃩ6 Gg,&ح) tc1_:so6YZ+m4 OkV2,&v9ZQ $c]QnT!,-e$A݈A?&* Af>_x[[ubL~IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_mixed_focus.png000066400000000000000000000010661424734202100322540ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`0bӯ_F_ `yF6_ฅU9?/[} ūxwAp~0E_`@sxz&6NF66KA@pt\ۻ{ג%@E\BJ#ك@j@U_k3@j@jV 'v/> 9'>_s $@ 5Q-`ϝ;|ݧѣ0wY _p{dI~722R p;&K00z#VX!j01片 cQ"RR ҃":_v(%aH H-L3 lm ,d6RnoS@jjS?`qff FFFs/sl$V΍@Ew/E_!&)+CIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_mixed_focus@2x.png000066400000000000000000000023671424734202100326330ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX W]lUwfwf.iSjRh F*>HH!lC61$T1+ Ƥ>ISJ $ -߅X~t?%[ܝ\ϙr%1$ι|s;K]\ IGH[DHFFx*pwu#d9a,6R4%o7L,H,_UVBi#cLDJ$c1#DNF՘T$oOY <ޭ1|TS&N޹qN^>\ږisܒQv"GErW'%t L 8{pP{`tpqaSGcyT1(Yz5BK}D'(RVҎDd[hK'cfX>j,^ԱTpƺ&b`!>O ?߻ZG$K[P 8D''͘hJ`"v$^-8׀7wH昰%b.kE͒Et3!]ĺ8I@cz4FB|4' ~B\ &xKEub\E?<-cNz$ 7E붶"}-XӴ;s+Pu_ @ l|2ľ @#G|r7+ޞʽTRe<9RR`Yhh]˗ .!o |Fkk L940s4gMm9b:4缴U#11 K2S< "!4b`=xwͅ-;NT+WR2`+.~ydB8 _G9u:vß؏ѭW~u r5QLRj@Z(7Bwя3[Fhc ? g]$WI%Y 3+ہ*:8`1gDn;LIq?:4`wE4xd 盧8[׋}z'Թap ./BS*ɈP!YvTZA HFfygKT!#BŢC +%#XyL,U$Wf*B K9d(*p o|rA dkV{rH2Z2"IQ"s5ӯHk1"qv hG`:anMVh'GFܷ D2Ec)T}J Ⱥ C OIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_mixed_hover@2x.png000066400000000000000000000022231424734202100326260ustar00rootroot00000000000000PNG  IHDR szzgAMA aJIDATX WMhcU=/i4Lmb2:NAQtƝTA ;7t7 ,E\t%8t43t: ?L̽F}76Q).cin+WjY28F'Na$A47F,n%Eeu[[(8ΕPwƆ<<13ܓSF#} ?IDMGQ{߼=FWw%'H=8Fb">$"7Ov;(n\.k?L.0 Xah" t(uhv~ACcOY{Ռw\3pZs 䆉?0űͬvӆuͷ K2 =0{9:j6a KղM2et;jnt/Oaffᡱ3dIxH^pe[\⤅{w1`x VuŎ wnqW3-lZ"X3'm i}18zTiծж4#TļeBxkI!a;.SMƠor Ux~rpYp+@5%ӬdB_&,a!.qҬY=J&bvmf/lqKȶ4zl[7s>v "͊ 8l{ąYD9j5 TKɆ#Z"~&@P`NtCV3a&C@S$/\oo\G("RZO<$5-ךfyY3{ATs"TY|_zO>xǾ?DBNr'BxLDyk$ x$lW bk\79n /}E%kV'& :aqLbq5-o~v}[wQ8,@Nޝ >DHʢKF\"0:IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_mixed_insensitive.png000066400000000000000000000005101424734202100334660ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8S@ Z02&|%CǏP)@GcgBMpc| jh♟繆jE <@u1Cg<븮CȎ ?DC>TQ;r)D,r HFILJЧH,9hsmyTX͠mޟĒCvf8^J)eΘeqc>4W+ GZk DzHrM@䧟8&Rw hIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_mixed_insensitive@2x.png000066400000000000000000000013471424734202100340510ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WA1˶vw[a)\*EzT<%=^œE/`Ѳt;,MBf 3:x>d&|Bw:aVŏp_31˅(@R!CJ+@y/t:d2ᛋZvl6/jkq.W4? W Rt XgU7iv6 mM-||~KK K?i"kYnTT6:2 m"l6+ O5F=j~KNPbĆØޞ[Mp8 'OMN\beb4+d0 [r.0 [r :f!6:g'u:v=crGR?n9Xt#-)"؆}AChb\\+b #1 %9lL6b[J.mT0Su]OՀ1UmP'Q^<7iXvbSl0B?q =YK ua)8ߕ *"Fր&"2 0Dτ%lY }IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_mixed_press.png000066400000000000000000000010411424734202100322620ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8R=OTA=36nAH06|X #-\k5;DMtl@ :caavf8gfg٬νs9޷o\f^s+h:g::PDTg-pɌpIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_mixed_press@2x.png000066400000000000000000000026041424734202100326420ustar00rootroot00000000000000PNG  IHDR szzgAMA a;IDATX WMhU>w~^SVkE+.F VFwvw.*EP"EAp*ET Ň"$)67;sϼ=p{ϹLD!?dwμ|$t]=uWk)m9wr9 L dB=}rU5ovL{/O!C`g(c7ʾ_q|Mr߶ғS&5Ylo|Ȝ|RX?Z>{}} 2r)?K&Yl#.9 p@.mH宵`t"y `XL`Z$CM<21wړ51JL譕%W)`y$$Zlc1f7ڳ- +n+yޡ͂fm:t"/kyV_j}tPe+; ~9.j -!TCd:"|{!4MWo.?y+P+ ĺ(nPA.z_pYFa94Z^iJ[*C3c:ÍKƌ[c~]1FD{( Ok":(FS!Ȍgfx2Uk97Nf5,Q@1} 4j M"?ALʙ"*?N#(8D22E"-\k3d)g³Iᣅ؀Z!Wpm'hl_?—2d<ģ"̠7sxd>(;Cɝ=4v;1R' cYk"& G\be,b1m39|xrc|D0'` pĥ b=8zȪ7ǧRT" .`z:ǧ <@(nxԸˍTZ^N@p~1g!ngNdY]sgq 5L@Ȝ\9ybLE'sFwNd髷ڣoWv%`'sG9kxSDk_xgYXrPО1YWwmG<~ˎLt@+MPi2m {-\7X:C~Sa/ٸK8luRκˋ'{?›O_3&ƫ9Y2hRfz7dg\:64u Nbi'"1O{NIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_unchecked.png000066400000000000000000000005521424734202100316770ustar00rootroot00000000000000PNG  IHDRagAMA a!IDAT8J@`Փw"!o!@»_x@l6:?̎FGm{``ik C]EQyA`(:B*t %7Miw,{SP2쭨DT #sO0 _UUU QOvOq#eY⹑\U=*$I20-WV/hnYnV?H]t?QvDcǤQ3^cu$IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_unchecked@2x.png000066400000000000000000000015551424734202100322550ustar00rootroot00000000000000PNG  IHDR szzgAMA a$IDATX WMKQZ4Ѧ.%Bh@\tS.1JU0jlbibKczfI&w͝y}w$鮋j5;OBǠ`3b)¶%mcfBK?@ PZ-D"qN+XZe‚<777 p\Vu!h D+o&?M Be8lmm}^[[;)J ySaD18 fL o1adiiigoojЬ݋FFFF1DULefI\#_8;X,l΁ID$ ^ҿ5_^^ԫsb# pO҇&ްgccc5MT*/x5іuGt[v B'#(q>l8:::s9D=l 0J@0"zR2v7n1J:w@dss6%0@K&ud1WKzQon4A ))Bfp ك?Ƥ~ 1Y+C[[d&+d*[(b-WD"OET h/^UlX Sh[XO59׼J{b0&OcCh N[1O>; eA"j&8b@= qx<縜|,BDTC,X6Mw;W" Pƥ2\%A "Y0sH?wA>TaIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_unchecked_focus.png000066400000000000000000000007171424734202100331010ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`0_%r@ d2eϰQ@d=(߹~|;ީUwϽƩle9B$dClf?  Ha*txfX쟗;[zL 4ĆSٰC]&O?~ ! w-ȻJ@| > $@ ~*`B }3o񥷀bnMரS:&YFC.H=&faj4`>n&vn{`"d(A *gĜ̩h<!*-Ǭ9 'R#,IcO4 5Y/ +3$)ҸYIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_unchecked_focus@2x.png000066400000000000000000000020371424734202100334500ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WkHTAȷYDU&TPB?ATPԏ" J4T0J(BͲ(r]MW՝ιښ[h`9w3\BBDzeBFF)qX6hD6J rw㌱roJ6nYD#%cW);Ur{U" XmKN"̖ uP\@TАO[a / [a=m%#o>uxਦqB|1b^`M),(EHQ@[ 3_PX]wө7n69zsD4& DL/{;c S\ h̬Ϧ6(>2{8?su2y1iG |lv\It^).IuF7kquϵC<=;gmJ \^,@`;\IĆR/p gFDxwΉFD N\%&˼eܹR8 ֢gZL_sLHDXq~[lb B܌:i.l.;![¡4ORN"`Z꫐ڴ<$%ŧ$Ꚗs(ُBd_pr:k6ΞɝIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkbox/radio_unchecked_hover_dark.png000066400000000000000000000010301424734202100340730ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8KKaKČhb+R/ EK]Min RF ]Fj2~g<9gy,?Uy) eMEF"4~>py= GPZCZ&4K@`Nma+7\?mU7OncO,¥ ֦ɨ-ţJGI,B $;bCy4zRk{~'"9\X?hz:s9 >7kO>k^șMZݚ o)G:T<ѯ:F 7d!SMqΨz2˳=B A=E 1Ad6D9|({b IvMZ[,Rivml{.mm B=E&4ذ<\< _aeiVtoNL@!se+J4~͈lL/b/FC%"4fȌh C6#a<1@K8FDj`wf:E2fa|$6plGM[@gx?8SĽxveض %A7N}xmlOkx+|q|u2&|'K,!:xry Ǻ*Ź$NN>pj˼ây1ȫδ4C(ioܸ0!ɬ[Rb&*Omjjv=9DJL)J,{t.-Ωk].E$@+tdo.|'>Pk~LE[-/:sEgnnEEi4>UL 4vCRFwUpϋ=yO\rpywmk8RqXvM&I FQvS4?jCYw,,\Zg7] $q\8ZBwjI Nlc@tDNDVslsL~FbLI](:oAwO O}|[ktcbL}UdQ݂/EE;8um`?y-~-0"g HFDZų?~K,TW/8G@PLGi!A))CMAป Ji[ ~J?憟| QXFX{~vZyt1?tpMB$D`R;XNi<|C\\G{$({ׂE`K#ƒobH@͛.IK 360gn[ ̥j'T|_ hvH ɺ;_?Ss6 u9IENDB`radio_unchecked_insensitive@2x.png000066400000000000000000000013001424734202100346020ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkboxPNG  IHDR szzgAMA awIDATX A@e-uAx)؋x7W?IAh)3d I&ɼ̼Qn1}?4+q/߉R)i 'ADYV[TBȃxY\rc6Ee:j]ufYA\s_,_:G_(<ZV0R>%\qw $GN@*{I/@r$DBN,!D$ʅ32$0 $љ;:u*e*tW:9dbUT0TN̾Mr4QvqPZXESLɏ͢8C R%(~,s`eLU42;9CrBgU!`E[Uf{)5YBó=E< Ӣ̦L>DUfP$I8l{s}֘_|*/Et'q=ovA;kk283uv@jo6vI:çd579l-Ǿs<~&X,XNqvL y^nwh>%m* LFBfYlRC߬ѱaRՔ_.~1FnEx->oK1Bs"O ?\VIENDB`radio_unchecked_press_dark@2x.png000066400000000000000000000026321424734202100344100ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/checkboxPNG  IHDR szzgAMA aQIDATX WMhU>wfkbhB41e AW.\ nܴ]tEpcɦ]QWH S+BĘ[mkZ5i23;sϼDSns9̫uy'2V yxs2~62y񰻈~#7R?˖^FAAl7˗Mnho,"O3 &ԤucIz>~<䮙9s-rW[2Us,&5Of#oY{ɹMN\x՝da]Wdr#%ı:8]* >R7ȗFSjliPh4ae4bLb`|= u)o<.jHQ1"^J\ZP@  x2P ݗ3uN@) t)TEBfJ pyhdI&C`5!, z1&A^ڐEȯ$m|$$+Lj"#T[MA6{S!DmBŗH7IIK[I@8xR ]Y? XL1 |X6D,a˳ zy-I$Z9~E4;n $[`}r@j'(Z xVUf_"mǏ\0Quc:.q/tN{ "$1a5Ww~_2Ov"R3Wƶ{'&Cx8䧩ߏ^g$7FSN : C:#Qy=RCrXpӧFy01sܾ}Wt-w>t_ݎcD`VLODxdl2;XO]~`b51J=I!=c8Cg{z<#i2?\>xAҩEXB LAEp }`ϣ1fιADn[6YL'&CM΍%#ɉV!e}ȳ3.KhhVi@T:, XO8'y+ql#IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/header_arrow_down.svg000066400000000000000000000011461424734202100305060ustar00rootroot00000000000000 down Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/header_arrow_up.svg000066400000000000000000000012721424734202100301630ustar00rootroot00000000000000 up Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/input/000077500000000000000000000000001424734202100254315ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/input/input_clear_hover.svg000066400000000000000000000026601424734202100316660ustar00rootroot00000000000000 input_clear_dark_hover Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/input/input_clear_normal.svg000066400000000000000000000026571424734202100320410ustar00rootroot00000000000000 input_clear_dark_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/input/input_clear_press.svg000066400000000000000000000025511424734202100316760ustar00rootroot00000000000000 input_clear_dark_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/slider/000077500000000000000000000000001424734202100255545ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/slider/slider_handle_focus.svg000077500000000000000000000037131424734202100323000ustar00rootroot00000000000000 slider_handle_focus Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/slider/slider_handle_insensitive.svg000077500000000000000000000037171424734202100335250ustar00rootroot00000000000000 slider_handle_insensitive Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/slider/slider_handle_normal.svg000077500000000000000000000036741424734202100324570ustar00rootroot00000000000000 slider_handle_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/slider/slider_handle_press.svg000077500000000000000000000036601424734202100323160ustar00rootroot00000000000000 slider_handle_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/slider/slider_point_handle.png000066400000000000000000000013471424734202100322750ustar00rootroot00000000000000PNG  IHDRw=sRGBIDATH U;Ql4Km$@ߡf !M( Vi B뢄`o䛽 &gΙ;/,n:w͛l;X,cpCdGm:kFNNsF@(nTѷFg|^t: ^ɤf?íwL@%_d%F] wOTz7 .srhDRl^aT.j-1Ձ]R(FkO\. =G*x{ノh^G-ohTWL ȗXD"n8~ r}V 'GTe-9]ҠP(gYIGkX2Ob:ekTw=H^.7J͡Ѭ@z%QE^7o;WpvF@JQ[~> 8UuLF(ɃuBL=ZE\\IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/slider/slider_point_handle@2x.png000066400000000000000000000034501424734202100326440ustar00rootroot00000000000000PNG  IHDR00WsRGBIDAThYIOdU@l%F;i;(alX1MoVv[ @#b"@hP3qrPē:{ޫ2eѐbE1^YT".-dMttԞ%[XX⃼`rbb`)Ya(<\XaUcn擉)cXy؆:^>>|ɓw>WQQq27ɔ&....899zff/-OE/: BCȱioo{%3U mkC'8VLX9&4zGTV"i!@1p͂} 6aKbu  Y$ g^J\LJ5`*0E9C*1w/SWc {|zi  zD7&Lig~W1I#DG|NF.V::E˅]g2 MQFҿ?cua:It+RP0v 3L]`Pr!q y>HkO19udXiB?v ŌIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/slider/slider_point_handle_focus.png000066400000000000000000000016231424734202100334710ustar00rootroot00000000000000PNG  IHDRw=sRGBMIDATH TKLQ'BcPBpKD++,tэĐ….pcDQnЅ,d݈"i;3:}36M{,D.٤PYӴǙ~dͶ-Ir\ޠ3^n1I4g? :9Ԁ&uV]:i,SX,-OupbWDsΫllt $ε:GM-0pJbޚ =e&jF64(aE)"U(6ő˄p_r!-sOP MCChz:Q@0l KBȉ"*$M1QSL7=@(r? ަZqWYwa `T}$"LKZÂp:Z`X aͿ+{o^_v#,Mo)!s6<1pV1eSˣ#\9J{aM͋\7i'usם u֊MRvѤ)ƀLġWbduis,tRda[_öC}ݯœ4Ȃ˖-3z? ]q1%>mK$ÐAh^*/,Gr q:UgϞ8qGA$CK>9 c#N#"Ur"6}",<~NM !B`8C݃i/$)ALJĒIBLd͕~~s(mܾz%w'`ۅ)H Yw-bF-"h ɛnx 9 #&8i]'=IVcL9Ot]atDXm([W30ҼR ͖ZXv 'H>$K>|M5?u~`Q1$u"I9וCk4-I8eO Oxz< xӎю"׽{#O6 KW^q~`n!JH\'-[S;]`(1BnaI@H B|)^ ]MKpHQL~d\'u$,.)"S "F"Fɹ}}N>XC.Tn/@JZ#o#q޳H^>N5ȅx-U$#9ͥ 3i5N ):!"FRD8$_+ 9Unƅ|*>(B=CN}]tYBM+-.iCS N`]Ns6EӼUv,<jA!d4[Nz.jMWjSJomƿO5i@wЍ>$?Ӕ"鵲<7 ֑znbM`m*^$g-u@IAdC`Zk8qA.Xmk:]pj*[-[!CDa pvqmy.[BPqܯiK򍨼108aTCZD{FFlF]}O_v#SS{4FMK̋ 5ԻeJ#a+{ iؘd*>8;X;簰QDy+֋jXc])|%8x x87d3*EgZ΋ 7K7+zx:G6{߃ M jinQ:kn0d`:`0oR~ ZHn}HҙF˂[֑7n.`)N|jNLs6.Lk;]~R9Jtvyâ{b7r7_D4϶zsqmP^7/\ovME̡ݗ>s]h/j(_dɯ3yM8xPɁf49azOv&@nw'y'` 4= ,P5qZR.Mm* KgDH6 YYF90`$f%4irٚaXF71Rļr^}$`^_C6Zַr ZTjRnt:[ 9Wrw d2i2fNtG L{DwVVVpu_iY6UO)7 fvAxM4"P5N|UzgY9ll󎭻)^U!`0\j1mH|h4~BAkC2EpB'-,k\8/?J rO$)% ~$;KֿTb&`bŋIENDB`slider_point_handle_insensitive@2x.png000066400000000000000000000031701424734202100352040ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/sliderPNG  IHDR00WsRGB2IDAThXJdGn[x 1B0!7gH$o$m//Qjw:NYUtk6T]{ڷmVcYb)}JW7O%եuW>̰2MTy.F,_=Py> PyuOy.k\a###_6۾z^NcCU%𤋮ǂ7WVV7@Z=,0y}aai:_l\vCNĂ-1v~ߚwwww= 3L\paI,#`y*N>2/Z3Nec"24dJC̃AvS,Lik\\f?bhu{8gD:R]`;E ſ}3::|̙3Unu:%q> D\s|¾jCe&A ٧t!l݋uLKrO٨r1Dcʉv1sӫ|k2h_W.Aiթ0!`ٌSE0NFuCc&TĪ7`yq_%V U Y|AiĠ0xi6Pʖb&un͍ & yЁTF<| G +szaA^"v͋GeSnK/lؙ=`@2/&<Y\F,[ @`H'N.//'Sި1̮Bz(r?6WǻɒC@n3MFtmZm=W;<<,#}>@ј%HBƐ[,M (!)\n<ËVDy 8q8.4 cb0Fn~&9:Voup|LN.ump-@7@7lfLiN}} &Ђ\]]= /Cg6:G>,W}tfgg1oColl|dF>n@;^ֵw$-[` mwtTV@ߪ"6QFhEy||| d$gE< 5:~pː.6JV;%P?n t &v7NYuՎ~fJ>}1( #D-?6J ?LktWEqSSS(mtfL'We챐Om`!#)OY)jƞ 7=!9@=ig@h*'$cv²8Su;br`Ę@jOtIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/slider/slider_point_handle_press.png000066400000000000000000000015171424734202100335100ustar00rootroot00000000000000PNG  IHDRw=sRGB IDATH TKQ?Օ]ɯ"?0m§50 ^ W7SJ˰֯Zw{g;̮م;{~ܙ!=HvߑPLgA?D$jp$Q J7 nZx%Bn S%sb .%LÍ DyV^{ҕgcojN &""LVq5]{ug4PYV~G$y>۾CC :1N?;}ĹcESIk΂nܤĞ`#dĮwSa mxXD9Er1vf :5Xw*eG]"fHb\[#0?p| 5nаx9Vՠih9wӾʗg/cѯ{Wڜp hAT,~\@KA0{ćHc̴IƵSI퉷F+gZ.ow4 k4u55M⪖ $D=/δVElٟ^ծ:޼oszrGo) fݢ Ow` ;1~ `1z6~?qy{IFbqYXVVfy X,e*ean}]%r{Nf%O7g-_yə[WW"YPBw0v4^o*YAkR4\4Ag;#ƚ2.XVSa=/x4IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/slider/slider_point_handle_press@2x.png000066400000000000000000000041531424734202100340610ustar00rootroot00000000000000PNG  IHDR00WsRGB%IDAThYoU?glExPD 1'F-! &}0x!T/%bȥ@mi;̷v:3ۢdw3V-]e, ,+7l"/-<^ccq|e(LӺ6ichѽspGu{n8P K\JDaTI$%39BB\ƼE#汓OG0N&V'D78y@d$Au@ڏCTeX( 84^|d*M'3WPJX})WrrM*$.iI1%G\CquN{cKNfgy !KZbh(&beD'!$>’ ݥ`>rv߹XR䑔cӿPAhYZ^*h2b'dn ZU|8 ii @vuf]J-R(O_O%NsЍl¶ҙEԠ{_  '< %5Ò1z&% fuJfeh JW!:4~C-s.>ig5-ix'M`<1W_ GЍNu=u2h6%ϴyƛj>Ҿ-q Aeֽ6[1ՙ$&|jcM6USCgzCPNAwKw,0=Yj}G+ׇ-ityF,/íUō&Ԡ[*&i8Lۛˏ}^C=?i:VsG(n٠ ƕd6`@b'i@&j|([ځ`VLSƘHC'γpK&nMԃ ԅh\7(q憣C7n.`B}g#A1/5|K咵 眰IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/000077500000000000000000000000001424734202100257545ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_down_hover.png000066400000000000000000000002211424734202100331140ustar00rootroot00000000000000PNG  IHDRxUsRGBKIDATc-}FF%@@Ŀ@4L$ ?8,b" * '\'LFCMʆA4HLSIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_down_insensitive.png000066400000000000000000000002461424734202100343400ustar00rootroot00000000000000PNG  IHDRxUsRGB`IDATc|߿?+++f@ݓK2$޽ Jſ0A E?5$O\+@VdIL n߾ 2f6IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_down_normal.png000066400000000000000000000002441424734202100332660ustar00rootroot00000000000000PNG  IHDRxUsRGB^IDATcw^-}%%%@@y@,H(I122&A@v )`Ȋ@b$HLldAb3IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_down_press.png000066400000000000000000000002571424734202100331360ustar00rootroot00000000000000PNG  IHDRxUsRGBiIDATc]?+K@Kg\!#H$ RT?$c)`(%A04$ݕ@\..IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_minus_hover.png000066400000000000000000000001501424734202100333010ustar00rootroot00000000000000PNG  IHDR;֕JsRGB"IDAT(c`C$a06!T!{46gcfIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_minus_insensitive.png000066400000000000000000000001531424734202100345210ustar00rootroot00000000000000PNG  IHDR;֕JsRGB%IDAT(c`C$asNMVQQEHͨ NLUIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_minus_normal.png000066400000000000000000000001541424734202100334520ustar00rootroot00000000000000PNG  IHDR;֕JsRGB&IDAT(c`C$a{ GHixIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_minus_press.png000066400000000000000000000001541424734202100333160ustar00rootroot00000000000000PNG  IHDR;֕JsRGB&IDAT(c`C$aY?MGHF:IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_plus_hover.png000066400000000000000000000001741424734202100331370ustar00rootroot00000000000000PNG  IHDR;֕JsRGB6IDAT(c`?s>IBrCT3#_D32+C4(r6ր rvIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_plus_insensitive.png000066400000000000000000000001771424734202100343570ustar00rootroot00000000000000PNG  IHDR;֕JsRGB9IDAT(c`Ν;iƄO***Xل F]o +IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_plus_normal.png000066400000000000000000000002001424734202100332720ustar00rootroot00000000000000PNG  IHDR;֕JsRGB:IDAT(c`ݻ9 $!!/BSQ؄ FQ >wIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_plus_press.png000066400000000000000000000002001424734202100331360ustar00rootroot00000000000000PNG  IHDR;֕JsRGB:IDAT(c`@gƄOW"9Q؄ FQ YLIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_up_hover.png000066400000000000000000000002101424734202100325670ustar00rootroot00000000000000PNG  IHDRxUsRGBBIDATc`@d$!*H $+@q6## djqE0IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_up_insensitive.png000066400000000000000000000002361424734202100340140ustar00rootroot00000000000000PNG  IHDRxUsRGBXIDATc`@nRdddt "$ ˑ?b"FdIEE ŘA:a jjjV.IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_up_normal.png000066400000000000000000000002371424734202100327450ustar00rootroot00000000000000PNG  IHDRxUsRGBYIDATc`@ d$!$@>#ͨ4$"`@T8(cA1L  @:a ]@X4H 2'IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/spinbox/spinbutton_up_press.png000066400000000000000000000002541424734202100326100ustar00rootroot00000000000000PNG  IHDRxUsRGBfIDATMA 0 Q7=E_Cb+(og8HCA!ȐMahL' ޺Tз&v{0V#IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/000077500000000000000000000000001424734202100255255ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/add_hover.svg000066400000000000000000000013171424734202100302030ustar00rootroot00000000000000 add_hover Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/add_normal.svg000066400000000000000000000013471424734202100303530ustar00rootroot00000000000000 add_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/add_press.svg000066400000000000000000000013171424734202100302140ustar00rootroot00000000000000 add_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/pagedown_hover.svg000066400000000000000000000012011424734202100312470ustar00rootroot00000000000000 pagedown_hover Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/pagedown_insensitive.svg000066400000000000000000000012331424734202100324710ustar00rootroot00000000000000 pagedown_insensitive Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/pagedown_normal.svg000066400000000000000000000012311424734202100314170ustar00rootroot00000000000000 pagedown_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/pagedown_press.svg000066400000000000000000000012011424734202100312600ustar00rootroot00000000000000 pagedown_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/pageup_hover.svg000066400000000000000000000012261424734202100307330ustar00rootroot00000000000000 pageup_hover Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/pageup_insensitive.svg000066400000000000000000000012601424734202100321460ustar00rootroot00000000000000 pageup_insensitive Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/pageup_normal.svg000066400000000000000000000012561424734202100311030ustar00rootroot00000000000000 pageup_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/pageup_press.svg000066400000000000000000000012261424734202100307440ustar00rootroot00000000000000 pageup_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/tab_close_hover.svg000066400000000000000000000025221424734202100314050ustar00rootroot00000000000000 tab_close_hover Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/tab_close_normal.svg000066400000000000000000000026431424734202100315560ustar00rootroot00000000000000 tab_close_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/dark/tabbar/tab_close_press.svg000066400000000000000000000024521424734202100314200ustar00rootroot00000000000000 tab_close_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/000077500000000000000000000000001424734202100244645ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/arrow-down.png000066400000000000000000000011041424734202100272650ustar00rootroot00000000000000PNG  IHDR00WsBIT|d pHYs33o~tEXtSoftwarewww.inkscape.org<IDAThJP@Ͻu6ąe #.**!ݗ? }3_Tt#8PY#ܹh- -2 |g&9'7((a%-(Ug6_f])\/槦 sggqkMdZv |rmE`VN7Q#ݱ#uN)np`)׋rτ0;b'΋ ;*u_m-ΤS~%Jŷ/.~ךƃRSR gGH !%@Iy"!`,!E< Jos|;[$w"'E,ah4ahLaARwKN?.@OD.+̙57y((|D!އIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/arrow-left.png000066400000000000000000000010761424734202100272600ustar00rootroot00000000000000PNG  IHDR00WsBIT|d pHYs33o~tEXtSoftwarewww.inkscape.org<IDATh홱JAEL F&!$AԔj$؇E kF,Jp&$3JSܽy{31Je>efZb D[}׊G QuNSkp,Mw>?ղФo ݳ(zi]&+<CהQ4h /wWOQt0e,Bǐy0BR60d a e i4m4HX3N5b,Y݇7:*uoPWM'H@S<^vrw{xn 5}0~-R W` ͅ+x/2.(7ըb&2Q,.yxw!AIITl61ҁa?tǧS$&m;|ݱ+Ss^~It\TmXȶLL|}(\:jDygg3F 1.SeM4oYOt8UZ^xazRHMk)^ܩ{(f;/9 !8evacoaI$brX}CAzz']M%_-V" Ikm/ħ[˷l~k+x@+s>L1T=,Go'D 6ELtUG[4*͞`. :w}:Pibj9V8Bowa٫cU;fjV=;^)KIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/computer.svg000066400000000000000000000271641424734202100270550ustar00rootroot00000000000000 计算机 Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/dialog-apply.png000066400000000000000000000021541424734202100275560ustar00rootroot00000000000000PNG  IHDR00WsBIT|d pHYs33o~tEXtSoftwarewww.inkscape.org<IDAThMheϻmZBKŪP(F{IOG`xQS1T*iTMAQ/&l4t7 =$a7mtKE[CEgǝٯwja;)x Lμ v0dKٝJX4|yjO3|Ima|)`z*GC~Y"C!TahPkL8Mvv`?- ?p;SOkWX3Rp瀮ΦtV1JpοQ."zU]Un!Y-}OAyo_'m#Aꘕ>=JH;tܹ[n`e5b_JAa ţ 3IfQ= DDcv,䒢]ǕSإSU+3WeBӓg][#mN/{!>y7'8M@=s%z/¸wv~m&JHSb -.r6u#;k֛8JeӾKj}jg+T l !zuط0=1U:fl7T5 'YO-v`GWv^A6G-ZԟLIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/document-save.png000066400000000000000000000012131424734202100277410ustar00rootroot00000000000000PNG  IHDR00WsBIT|d pHYs33o~tEXtSoftwarewww.inkscape.org<IDAThOkPM&*vt*d o/aE[~n ~n*U\Y&qiAuE)Be亰c_gI:A6y!` պVυsA%ȯ=Xq@.HXYy Ly`պ&s17$Dx< e7Be+fP<`+z]6@: Ki)~Բ?蚤 |< 7e(2_%&@7&nr}4}pYa-0tcЍ Ob!D43S46ї_}B˶+ΏU5LXWǷi x0r B1羨= !:`4RdDxj;j15L 0I 1LH);{k 7JolT&*by@!fa~ي43n`ܞ axc6,0IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/drive-harddisk.png000066400000000000000000000022161424734202100300730ustar00rootroot00000000000000PNG  IHDR00WsBIT|d pHYs))"ߌtEXtSoftwarewww.inkscape.org< IDAThYMh\U}oZHE*ZJhۅ FP  T҅v rj SŅЅTsah!ЩmJqԍI"3:Nw: afΜ{߹6L~PZ8c-mQEVE1D p8m4|iqߏ@ H5BJ9(3pD{e=B=ϻ٭]033˝nd^}rpDֺ񉉉3O!u~&`S\\ YZ$@o00 ~ vfU8kJl?RJjR :gsr!]p7ZgC4 `9R:BbʳBϦY&8'q oXD"Ř/dDOy,bQt[،NVq9ElNd#`DfwǦqm\$ɚ.UV5WP0-`*m*Ru󋋋(J(J|]<7tN/Mi_p 38^@kD cLtML1 ɿWRX>99y7OQ,rYzPߌ({* X)u }zcc7֏698INbuٷ>/ *bq͊;.tJ@2Q?7*]JmrY> ຳT*m$InϕROo ӎiG!y}~2K ľϹElqs4}R}r.T(nA໎3L/buŽl&BTZ$ĥR4 t\P(0]?Jdޕ$%)Saf''s%%a/Xm!r(fT<8nذ![Q oǖQ_DڈF. sMQL#^+???l6C/(-M[iiiG|Y,Q}9̂f5l]D eF}.//KrJ!/'VAVyڕgٗLj4:gxo{d@ bw}rhN6N8{RJXx)z^*D? ѩˢ/kɏ8B]H[4.#~FNvMQDv{c#vq##OЏ6.*meB+5Pz՝5k*`| BU0+%fB)bl#+w?"6 aXB~O!pc"$͏ I̭h f")DJ IqDYD ڻD!aG(((o' 6̵tDY2DF}HݲB)5fsuA3$8ER744|/bzӍM'IDZFZ7eSw fQ2`:bWd JDȼ(o+BsȨpܓ[۹8H xs:!unAc}EΣ; uԧg0Ұ }+?KG%*/Rh5x[&wvv>/:`B_ZN$dqJ8RU‡hfUHDmGN folder-open-48px Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/folder.svg000066400000000000000000000056741424734202100264740ustar00rootroot00000000000000 folder Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/help-faq.png000066400000000000000000000017541424734202100266760ustar00rootroot00000000000000PNG  IHDR00WsBIT|d pHYs33o~tEXtSoftwarewww.inkscape.org<iIDAThMh\U羙iS1(+uRL:`i+E%4dTj)Rhqc%;MQB#C~ӢX!vR+E%䣙3mܱ ﷼?yw;RRRRn$Ҏ];6rJb;oVrS˛+=] '7ƾ@wh7*G[YX#>{LV[6ac߹DpKu׺p6[|Pk~沾h`Đ4>3/HI<L7){]:ɸ$u_oU \ b30yfekծ⨹`kTbI^^7H'<Sl\T豮|F9|=4j`uU$X ui?p+#BCC[IXmJեB6 ̗T*pu[z]+afû.ÿ` %Y}a 2=zl)ujle2@Fx5s'lqE_XD'.Ӗ#T(1>y{ ^lZNըFeѫx$hL-fjJI?TʕJZuOG[<$0[8|vbZ*dIn¾ŅnZu7'7wԪ{ f~o Х3V}jj`2:5~{},-mZ ESJt|:))))7mL>pIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/media-optical.png000066400000000000000000000060601424734202100277040ustar00rootroot00000000000000PNG  IHDR00WsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< IDAThYkluΝ.%._(Yʒiq\9v@N&6n@#Hҟu? hiu!XFTȲbݝ{OcgW#rss]ooѻf[E?Ȅ;0 D`:^-NExZqz9Q1:/ o :tf1.GH @o0둢ύ3Ⱦѯ!NHI?# !fVۄ}_hb,}lȥ .f{H FQz;QSےzWvC[?P.KR t[:Y[)Yz^MJO s@zj?#hr7Zϸ/7@@ MRFP20 PpQ*a;Nlx1p0fXǫU\߿ 74]{F {VYA+ %0 b'Damzu ?CTI+"z mIAԖڤD"@ ǶAjg@!s yGLJ8ze!LYk ZXEQo[">*AGΨj ) C1 _en_dxuau8e^ka`DRe*#!Yn>M;4f~ mc9j6Tx+D[زRE` D `aqcc ܎ S7=bត<8OD ;lӫO2504m ZfE8p3$3m8A@қ c޻+b̅J[_(.`罵<ᝣ{=4;^ ԅ EMKSøc'&<σe;== NBF?4 P(++(fH& FSPY22ӨM i*zvk >R iu-^wVo=m0°Un>C{y F(dlo8=j?|0Mu] #)_{O8s6h&H#hmBɲv `@;Xe=s#c4H`k X5Q`Q\l64{=|sӑ#GYYVl<Ӣ(mk`;]/{g!gPD!(BBq`rimlRٲo>Oh øA)%6dYN)%RVflwP P!h[E|.! P4p7w׋R_xUJi- {i:LOO `?Lާ Ib R! rTS[ D'- Bd5=q/WՅW홙'"$RvjmO@y`dr@~ou/ 1WJT> p]i@FQ&(ͼrҒ5::g(t)TV1eclN]N GKg#d^_E^ܟXrVJ\eI3$Xa`kna 0#_ 6.O~44QK)NI膉 @hI()b`K[ kSRoO:Bk Wyߝdž&^e7gbDQ'x0Sg5f^rq5.߈{m߮upOt ++W{'O'{~3g|Y/g"Mu6?0~í&篟{,hX&R\v\:G3f ~>7 n2zh0 Z}~M TByO%>{o}__̀K9Bs'^}{&0I |V8;{O~_#N?%]ѩ_ݶsӆ?b>open?}_$f,3ikc>~_::8X~HIm7H )d0uVj1[a}O|G'7KHJ&$*7 hvO[7؛ߋ?IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/process-stop.png000066400000000000000000000025511424734202100276360ustar00rootroot00000000000000PNG  IHDR00WsBIT|d pHYs33o~tEXtSoftwarewww.inkscape.org<IDAThYMpSU}1Jՙ638CuA$e]X;PWD uZ$-3N5M,\@i$uVhq$^MUsw;:ijM&!nXkrp??!:Dڸ0&dj׮*p0HB~ TD:t* `yppG WQѨ7WzL8B~ ekt;(KR|cnB`.^0#֑L,7=l )^.`l+L"hrpBh5CHǕ9'\BDtd! : GBO0>}t O17 ͫ:y'Pc._L4p\<u9v rJ]#1s"% c* )dɏJ ~R]ZHgx]W60ޗL @᥃h`9޲x+&F04JcPmrZ*8? D%@;[4f,9\zѓg:a2|=~'NL_)~]!HMvyN& aD/6߭%ͭP<lyo1hلeDlrfxijՒy-Vn9aKIY[@s*:@jΡC _X3BJeOdRSM-{\yReT)-ZP%x@R<ɣߴi5kh s/7}g^BZ?kDK4^nN0O:m6R؞D':'a^h`K6&:]%lLt FA5 {ȸ۬Ak@g"J*,dvev}mxfc LT6,,p8V1g1fh#c)zml/CW7s٨OB$w{bDĩUBcXYtɃD|L2G|jrz}d(j|c׽z/}ox3{݊Y㭁Շ; Lh'T+l4_]es ӿTvb xCth7Xk;U0/@WuQGOy*YmIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/text-x-generic.svg000066400000000000000000000146121424734202100300540ustar00rootroot00000000000000 image/svg+xml qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/user-home.svg000066400000000000000000000072161424734202100271170ustar00rootroot00000000000000 folder-home Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/user-trash.svg000066400000000000000000000056671424734202100273200ustar00rootroot00000000000000 Artboard 2 Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/view-refresh.png000066400000000000000000000021421424734202100275770ustar00rootroot00000000000000PNG  IHDR00WsBIT|d pHYs33o~tEXtSoftwarewww.inkscape.org<IDAThk\EǿyimcNV$h&($]EDCE{Ѓ%ԃ֋A`v1xPD Uԃ-C6awvyowm =L}s+ao\F-#x]tl[wnו|rslKZO/-/v:wG $sYEuZ!J$ߩJQ=DJ`lrfqg@u:YWFHsT k7j}leƏ y\T.Z(XpJ⾁! 8U?""Dfv2'HsrA03w{XV|k$mW*əa'/nK8&c3}t@j 90 ~GJ( 3"61ڮ@b:%ղ!o8pnvԶ4PLey4 (ӆ$ <-Z.\eC覹\d6҂bR*g[3"5:V^ \OICRt[ Fi㈥8&V"@[d\9E?472(|މAK5G=ׯojQSz;OWԨ_r!-5;_[|PJo7.ց7+joEeo$-p7;vgI-mwېR#Ǩbχz& 軸ޤm O`)1ɯ?.T;LmwEP^sgoӟ7Ktp6Se 8z'4 l0ߌOg>o m2:$ҹ^ C.G "qK1[o"@hA4|7V \vq ~Bc}.HG~sL5kdo#!{7뷏y 2*;ӧO;$ wIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_close_hover_dark.png000066400000000000000000000006651424734202100321010ustar00rootroot00000000000000PNG  IHDR4.sRGBoIDATH c`c 1 @ f  2` &"9`iYe_[yf|_`cYr~.q5Đ"@Ϙ$}x|@̵2k%,fcaKR @2[qO> sg^dRMP8і4}gm l28=Y9b\>$ G 1ZD}zj*Jb!Bep qęr0(0 DYuTpЇ .E5;G%Ձ,b o BeG`$pB2PG a6}ڄD55zr68RzIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_close_hover_light.png000066400000000000000000000006461424734202100322660ustar00rootroot00000000000000PNG  IHDR4.sRGB`IDATH c`c @1&&&t9b1`Ad= "P [Gfa l>CCU೬OC?7;'DbC#ggjfn!".λߙ@7(˖yrq0Vu =6XpABϮO@3@Ͼ\L?I٥ʞL_f(.hːhKqdq,S:8BN4r &*&٥qK4e8Q|vY2j!N6QS7k#͘ʱg)4ƭb26*IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_close_normal_dark.png000066400000000000000000000004111424734202100322330ustar00rootroot00000000000000PNG  IHDR4.sRGBIDATH A 0EڋI<ྦྷAܸn%/)h:BLw'dҁҁo`m4u_YpwC W#'8]Z@!ܱ`p=ؓVj' `HfT5*:lh$h|Ɉjf:ɾ#sk![$2xiIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_close_normal_light.png000066400000000000000000000005151424734202100324260ustar00rootroot00000000000000PNG  IHDR4.sRGBIDATH c`!0"C_5HHHhx zCC&IIIulrjYXX hp&<"x Pl-8.6Q>{99M//`122:?5. 9fffTw#9R,MT0qԩ@&E^@#~,#0́!P\4і!љ3gN9-H4,@ G#Xl`yL4Y#g- CVVVG&&0Qz4FC#}Es叺IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_close_press_dark.png000066400000000000000000000007161424734202100321070ustar00rootroot00000000000000PNG  IHDR4.sRGBIDATH c`8b@̄EX@lRj| sP6˰h"alY4~? t H~1[](]n%,d AQs24K GcFy潾MPlM6s0|a)$2XMMz0."$IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_min_hover_dark.png000066400000000000000000000003271424734202100315520ustar00rootroot00000000000000PNG  IHDR4.sRGBIDATH c`c 1 @ f  2` &"9`iYF-#+5 `dA*S,b؄VIĈLRz٨(M`l> C!kj a˾EdIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_min_hover_light.png000066400000000000000000000003441424734202100317370ustar00rootroot00000000000000PNG  IHDR4.sRGBIDATH c`c @1&&&t9b1`Ad= "P [Gfa l>CCUeT ,ܹ O 3140)§eFF En٨HI8l0B+>#V9|Bb-Ԥj1z3IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_min_normal_dark.png000066400000000000000000000001721424734202100317150ustar00rootroot00000000000000PNG  IHDR4.sRGB4IDATH c`!0!0$B+?<##c:=JhGd,IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_min_normal_light.png000066400000000000000000000001741424734202100321050ustar00rootroot00000000000000PNG  IHDR4.sRGB6IDATH c`!0!0$B+ R_p…D"Վ*  YcIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_min_press_dark.png000066400000000000000000000003431424734202100315610ustar00rootroot00000000000000PNG  IHDR4.sRGBIDATH c`8b@̄EX@lRj| sP6˰h"al2 ] Ftux.WEİ R0I*ϐq63x&=0ab;c˃Xc Fk:| (IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_min_press_light.png000066400000000000000000000003471424734202100317530ustar00rootroot00000000000000PNG  IHDR4.sRGBIDATH c`c _~'|XYZ2P9Q#dñajG-J`d!>V=%,J qE+L 8)ځ FPŇi$H`3gBaԤj4,*6IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_option_hover_dark.png000066400000000000000000000003541424734202100322770ustar00rootroot00000000000000PNG  IHDR4.sRGBIDATH U 0ѡcӺةm\ HP@Xaڌϐ G+DK&G!0X` |4>HQP|x&l*!KT>×%lԐ>!>IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_unmax_normal_light.png000066400000000000000000000002431424734202100324470ustar00rootroot00000000000000PNG  IHDR4.sRGB]IDATH c`!0"CX_ǧ… Dr3G3e! lg&H+Q˨D | [¡F  NgJ4IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_unmax_press_dark.png000066400000000000000000000003771424734202100321350ustar00rootroot00000000000000PNG  IHDR4.sRGBIDATH UK@@ KҚ++.K5C,Ф^߼W4&I)x0GXEڈ8S.$xՈYuvd t(E{Ԭ˨q5Zkf3MidiM&3&#Q 1G7_}y@a@Ã:B#trVR >; B'IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/icons/window_unmax_press_light.png000066400000000000000000000004101424734202100323070ustar00rootroot00000000000000PNG  IHDR4.sRGBIDATH c`c _~'|XYZ2P9Q#dñajj ])>]aArD[0B9(0K`4Qc3#` tM !=lĀ-`sQk6 FPU|^'`հb)&EV +92AIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/000077500000000000000000000000001424734202100244605ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/arrow-right_disabled.svg000066400000000000000000000012161424734202100312750ustar00rootroot00000000000000 菜单箭头 Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/arrow-right_normal.svg000066400000000000000000000012161424734202100310160ustar00rootroot00000000000000 菜单箭头 Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/arrow-right_selected.svg000066400000000000000000000012321424734202100313140ustar00rootroot00000000000000 菜单箭头选中 Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/check_disabled.svg000066400000000000000000000014621424734202100301100ustar00rootroot00000000000000 select_insensitive Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/check_normal.svg000066400000000000000000000014111424734202100276230ustar00rootroot00000000000000 select Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/check_selected.svg000066400000000000000000000014201424734202100301230ustar00rootroot00000000000000 select_hover Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/000077500000000000000000000000001424734202100262465ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_checked.png000066400000000000000000000007371424734202100322170ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8S=kAZ\c" ",DRډ`g 1BQ^Hm ~@@46r nxKBԀfgnvُtTkͷᳰcX H~r"H۶}oX,7Aܰ0LDP6 ȡd2/Lơ ['~j%F<eá7MUgȦ}  \׍>9$01N URI Llۺp\Brf̀Cd,|^\וn+B|t:bf`@V;a7^?Pb:`Vkx,rY6>${%EnRy<x0&֠.sa0c$.& `pIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_checked@2x.png000066400000000000000000000020311424734202100325560ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WMH[A [ 9HAo *CKK/V^ %Zb[E"z/zkl̓KE?ԟm|MjS;33GQnnBnH-t\\ssBxϳ&XV[ tƅ La1\\:)gSNNNA xT=`b6ucccyj0nJ1^o888xÎA;1==Q@l=8_ZZzl= 8[[[d,+sid]`y_\)/@ЋwdoVCs̯٘}E[Vdw@]#NhAFǽAND6n'1̨~effBn|x-.< g7˩TqpI9QH \ש!+pttDMMM!L& l6zb yZZZ9JgD0F lnnRuu2OmhbbB뉟\UD܁}Z[[S fCUPEE* )) i||Z[[  , j#6pYE~|>Njz{{ť#`IIjC\`! C j[ZZFV ПWq.Zq(// 1CnLc``@ ~‡he¬78U])o_xQ.kB Bna؅oH7MIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_checked_focus.png000066400000000000000000000010061424734202100334040ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8S?Ha c *&5%$Hc VɈFtiqdFc E!h$I2ƹY,p0D"AbQUuL`CqhZP.A:y(Jx8-tfrARaL&PBXx"Nf T{հ;oo97 w=TQD'~Z 1g9cGXُ=6ﵹ?P)9/<v7?TIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_checked_focus@2x.png000066400000000000000000000021331424734202100337600ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX W_HQ?w̜Z(C|LM3|I=HABfjZn0D E-Aa΂!'%5YЛ!J 2ݚ:MoϽwν?8nq/777$?HY-nGt7==c߱ܜC5,%=~;^R뜰.!J)䴴;HG3A~+I+h~g%hq+{ggg'x+0XG}ڼ~$ﯞN(!T褞Fa.:L:ڗ5ͅY'r $&%s­CH@τsTΩ=-{A__[tL ?m\ ```ະҿCO.x awP[[ ĉ~cK0_Z@+@q333(چĄ3ـ<&Ų2^Orr&MMM@Y__ J ͸TRNN<66ơGFF`mmn5p: ?@8TT`0\ONN'%%UB@ @mllr%%%!XEE?l( LG⇦`7jaa!OGww7xJ%oM8H{^^/R5ޖcb>.72~/)QKӿU}@{I'_|U/I%b>mP4_oWӎvζ9OXpJ4j+NXފ6QPds3HAHrrDOd?nPdKsfXXT_ XVT~셿Kgh<IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_checked_hover.png000066400000000000000000000011231424734202100334100ustar00rootroot00000000000000PNG  IHDRagAMA a IDAT8=hQo.w~5QD,-Zh4VZY'Fbi҈"(`?P0h''8{@q`?- +ux +K88փ9DRxr7v4ɍA͞B ?DXbq,K礧cD~*50a2OҸRPZ44[,wG̿7 ,czc7 [yK}(5/շprVzF5h~s2%_}XެE`{10f`-ȅpqQ|-Xw< ǟ8/xQlav[)KnՙMBgNL-KygOBX:sN8.wfm]J 8 >yqHg4a  Y}Ji 9j'"aV^ W)%d;W]+ :BdXbgF9IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_checked_hover@2x.png000066400000000000000000000025301424734202100337650ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WklTUνlBi!V Vb41i4((|G#E 4O13DnдU+mR=;]F'99|͜woۈ+œZ֏jV t9/b1w&F=1(m}xz#S}^N`wD~)[2 thjwn pAJ#ꀺ2 c[hBRJIPt v~M)/|wph^-zZԸ#,+ȇW g GXԮc8DwWFζ&V(*Rv+3YIvl?䌥ujW̖g2y/Tp*Lv Xp8_0軿Wx OޭȒ@}%O;Ӷ!jry_79 %^3#)xY oeM"%I&62ЩpdМwcl",p)eIswdܤ+hQu `BdƣWu_pK08cdg("DiB۔owR4yRKl ^IyFzW.l',nPx`Z7l nXE .m2 mXYtKʫ =`ldAFUń̵)xdžk;kQ(WŰKF^6,'+ 7>qg:ykF*hQ_أ}9p^9WK lW`;M& ClZjA1'?dml' FbKg1 C9B pq>=[Im+A|Y!&)Hvd]@.7Ǔ0{`8_ 8ӧCΊ;`}Ok~$PuʙO>v31I/0@q)s}r^lSbKQ:iD܊GP/Jw4Ї$nBT =Wqqu:\Tg0cI P3pkvl?hESzDv<Na4I#B$23s0D_4 !2£G\YS]6YfIENDB`checkbox_checked_insensitive.png000066400000000000000000000007601424734202100345540ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkboxPNG  IHDRagAMA aIDAT8S1kPRTn-.ƹ8:8(tA \DбH.ִ}|w{#-JQ+1FEta:Db[ I,f/ øm;:A,_`^F1L@l67`𔊼EirZ=p m& 5MA8џzE<`5z*_c>t:d2N8==`@k * HRv*BeYP,CV;s7& Z-0Mq<4 Bn6D\@ v۩+ H8O`{t]\.{ y $X,>EQ|A8f[+򆉥)`+rlB?G̾P;sQ>hIENDB`checkbox_checked_insensitive@2x.png000066400000000000000000000020261424734202100351230ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkboxPNG  IHDR szzgAMA aIDATX WKA$b[h 6xŃ7 * >N"xQQ U"#&c$MOdgvg7;;_Ңn"Hf+Yǜ gXʞAg(n0V777O&V11g2' SbSyy#~QFc@Cz)d6l6LnIIInFFA1Hɶv͍}>{]{<|,8"eb +Ų$I$vVTT<6p8^r[~Vt%%QpdMggg_Z+C@\*i=>y.D#R/..ЂV-g#000@3JƂ; @ނȱyZ[[SCw (Z3ETWWGՊDR|Ӗc"pFqq1KxŴת(SG###.6{ZҔhqttvvvĀN99X;kQcccڈߐ(xq33|xxΛ1UGCCCj"^27ٌK(5esuu%uA6QA=<gUXXYYQ}VVV B ψ/[ q )++KkXW6F9멪*?юæ&T}[ZZT=-tZ[[+crr#"tleQ"@FcR|b~L&X\c{{+(YpۭgEpt~~0m |r+;QsGnHbj _swwn,Ar L '4:LȬf82!+xʬ̩5iaC}a R3 Ő3gO>IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_checked_press.png000066400000000000000000000011361424734202100334250ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8R=hQ޻ۃT("$B $!FAE+R$(h#"%&v$H@v7Wٙy ~zhvzOhPVEw΅Sa*Z__$ rJ\ 2Yt~=憶c}!Gާ'AߓqW<'l.6A`@Maf)bǣ@0 HXUJK_KlqL/k?7M`d<15yAūmLPT6X8r^o`$RӭqWt6+ *bV@ 3frA2Q6-6$ŒɨuыxY7[VcbzH:|44>,z+@@IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_checked_press@2x.png000066400000000000000000000027371424734202100340070ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX Wmhe޳sq0XȲ>)*3+2*,+V ѲSF*BAC"(UQ} Yf|<]>{W羯xߝ7Yu.µغ#SFVkKp@sh;Uep\ G9YmЍ9-Q:z+x_+D*gdHJ.؄m(Nc;=u]”R6]ƂڢG Éx ~~FPtc;w}w}X"_:)yFێb=R[oW,J!1gꧩi؊Pm*\&*/F7aP$B`otcd枍G"T!ݍ{NXHL0TNJT.1 ` j#t_wCz@ Vxadʹx()̓}nZ+[Zro6(-3=ΊC !0"t '+`-TXq=H߆iy ~BBƝ?Ua+; 289ppH%~kWD kqEp*Iv 1FO'o *6<7glB)Kvxזs7YY3Wu]qXs 8"FTaڮd}JG]DگVr ^Pɻjw<2]hâA-"1~>glŨbtw%KNC-?6ӁlTaBedô.^lg݉ 8Tb+ ۸cXLBkCl?ܱM[GYM`}Yh#Y XPfFӆ"k~ }CćNwKh!xL*l3'YzȟU$+_|"!ÇCcMY Cc>TI@s@d熠%/ `ݻ Z.^0ULf @] L`@g @)ZWaԄK 5X/ &jV?k!,0o.&P_Ty{L%ٹryIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_mixed_focus.png000066400000000000000000000004241424734202100331270ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`0v߯F&33?Ll_ 5 =pWxAf = @\ qUiîj`hhWX Q?`L4 ;H<_~98R R (mgC@j@jAz@PƸf =A)hXdIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_mixed_focus@2x.png000066400000000000000000000007611424734202100335050ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX W;N@5cY h (@pЀBr 8\"44,ACnH|Nd+xgA;I*+*>@qZ}Z,iDՆDV(7z _M&qmn]HD-OZ%^d{ ]׈;o tLp7d4VIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_mixed_hover@2x.png000066400000000000000000000015761424734202100335160ustar00rootroot00000000000000PNG  IHDR szzgAMA a5IDATX W1ka}{39cFP !hcMBW!A4B C9Ϡ&:oݹۻ#3;f.tq-ĵ4"ܨEXHs81=õ%"b S\ǻ0[_aUVoEaD_ ONWOFa+6J,QiVwx ,V{6N[ˈL:qĈqQzf<2NA""9r0yݔ`^5|'A"6/K0<dz_1Os7aJ>-xŸ &)7} ?Q)["Vdb}ؠhhSNS,כs%~C' HDq|\FLh8M`\j ˸+cK ?Noo8k)e-(SXf8NJ?VE:$RBhY'}qFe\8Щ1a+y|~ħg@MՌ^ /}q.}t>(_ #",ELe)?(P-m~-h6j؋^+($8O[PqL\̧f"?Κj"p{Kt tp9iw ņI YzR$L`xsSmm˹tUCO[g7ͳ:A=^MDɢ)[o`d[:fM4dX~uKJaKAJB}6͡he 2n`\ nϐ^:djkTcӞDǘRo"D4M7D7(@ݷ %4qk yib!ۚw g Zo'XPoe1FCu9NM[n <˃[^z).>WsuB#b|S PT:_YI&jמy z\X<˧ȅiQ!Z.n #P޸0nNta[ sÑz<(ХpBć=s9  zsCD`=;: _x|f@VY[%b[ ̎@zèm〮YmiDh" ɜ .4Z|@$ 񼧽 "⪡x,+hi@<5?dP\ǁS^"Obޗ/ ]? 0|ywiBSď(JA|`Hgh ugVގܸkwM <Zεtn7{Wklq/_b&k$G cO6l;%/ `ݻ Z.^0ULf @] L`@g @)ZWaԄKXFũ߿uPP$ OHӗcH H-P/(?0P-3 # ySIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/checkbox_unchecked@2x.png000066400000000000000000000006411424734202100331260ustar00rootroot00000000000000PNG  IHDR szzgAMA aXIDATX Oj@Ƨ]h).^Y!r6@ko*HV2twΞmCIENDB`checkbox_unchecked_hover@2x.png000066400000000000000000000015341424734202100342540ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkboxPNG  IHDR szzgAMA aIDATX W1kaܙh&)`6 6;`ge+iCeJP kAēC9π&fnNB#{ff.|4[n%HjH))&$)i 7ԠWI1]|&Lئ%Eݪ䰑f,j W}Pkx@mӴn3&N} **_l7뙖i26L |]/$> !Hsy>&kMy -\$3€3٠?kuNpڢ2Uc, Aq,Ud4=S2e /Ӽ1vp؀)DuF 2\0cӢ8+AEȺυ%݁Y>=/ܛfTu(11rN]8) T*g5pїذa,GPe>D*$2bxh6@ݯYֹc^@>zR/3bՌ"7P#'G34?,?_tyVs* -~G&-s '?*H<(F GK-G{ i<71TPX̷0*a6>|GMPW$'A-&t좇akh+zti h7p Ci{{/>M5X2]2wv'i5lKIENDB`checkbox_unchecked_insensitive.png000066400000000000000000000003461424734202100351170ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkboxPNG  IHDRagAMA aIDAT8c`0B3ii b.P-? .; 5 = 0$A ]s ACՂ 38G ``N<f_@ĽteY&qFoUU22ip"D 9wx8~|x5)A*[`⡥(p̑dؙ%/y+ nf ]oqX#(AQGC~@oƙjo;PFm 6 qkyqGJXmMyy 7YD>94_o.(G>>hnmT'<O)bc8|WSx9֦U"MNUZ1 *?bb݀tb8S߁\gm 43_Ƕջ8"|WEí;Ht~_ I*HX ba[G)Z#HZ_'ښHp"l^:NҠԄB"]yD2G6Jp0Q0#&7f4&z22|"'@r!O=6<+gVn9B2?yد`aN΅1YbvMߺgw2[k5ﭭ-zbx7s31cgMmכ.J{ޟs l_ r"KX,[|lPvwvv/mN7Nfm ؖ-/2G`(Xn_.J`){1h -MOORP D"cΌLm]Đ1DyVSN4lU*95$0eYշ~ YQ4+psnkcR):& +@JlU[ؘ}[Ăp*@*l% ۫ VNllL/qAHR2XUye4^5K)bA%[~}}hpV6LhRPsnE1K@V/}}2$d#MmMĂvnBcx fffhuujQӡ) H$(Ll\.v|kx-ҵ_FGL6s\aLX6S?ZFLrqormkF$ "M+}ZʟV jt0_bXʣ6M.FvL\iT-52IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_checked_focus.png000066400000000000000000000006151424734202100327210ustar00rootroot00000000000000PNG  IHDRagAMA aDIDAT8S-O@8 A9j8U G%A N)(ץo4]H:N߾ۙ [pgVYqLxЋ!,/GUcFCEzc6imlwT '0ʛIj9{x8SG`p-ۉ>'8B&_S j) Cr]r`pL({LTq$]e |b1+s*$y1xEDyZŘ[6MQ異>* =BQA6RV py &/Ozr8IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_checked_focus@2x.png000066400000000000000000000017241424734202100332750ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WKTAFJDIԋX զd7 O)V AB_R`Z>D;VϰWgk >ԁe9w~u,c,1*Kna!k%ԢP|w7Qq#h))ŲJQ98gkhU*uhzwረkف=U`+Kg ~*{JK\m'֑Rfи/o]iB8=Vfp^;o+?}Uy.فDdq=xAp\,Uuen,&)ƹϹ赑0, qW̜%7F=W y%oyn1.X\Ɛi{eۙtÌ!jā\ }\,`bb$LPq՞)ilhhMMM`l544\Q/.P2+ 2 qm1V+8A,ɠA l !/v|3ap!C@#(#idxx& JD6_`>CD6#zUϭ?* 92W?:s5s}tIZO) b.vb9gwnG%^9J4&^^)r07ɮY=Μզ|biNaxK.MTBZ^![A H47)c' +T7G>C,jܡqw+ulDk /_}[y& ү#ݭM#D#AE;ZE%N2oONHIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_checked_hover@2x.png000066400000000000000000000027511424734202100333020ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX VKlUt)tBcy15DlxMM,PDݸbA  FcZ`1,0&"-% G->}f:uʓ=u{u5oexan 6G ͷRWFqa|&YHa~@QgaS)t[5܊WӨAJr`iEE`nsrd`p̢A`dќ^lmF_>" |Wo>Nr@b{C?p)gśؼ~Ensi JT2Z2P)J/S[`$E"'e:܃iR?8b `BN6&۾B5 Kve;Q#ϟXjr e".Ekk-gr L"Coccl㜨ņ:.,0/~rWKiv )ǁvM Ӷ0ҟl2'Ij a'/czB朸t]D63;eRޅG ZL5'0 XVgIV;p:#&J]$1o"?]B(հBLiK V8NpqTÑxDzݡ|ԌMxc4eLLmN1 N"Lr_nEǻdSؿ幇z< h$Is׼$+5홤F< H-ϑH5,C7M".)O3IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_checked_insensitive.png000066400000000000000000000007231424734202100341420ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8Sj`hEJ34]Rtsķ7gWW /G(hPD7R=8E?Ja*ɮI_H!&M2f~8>0ωw+ d2)O$Nj:[,a+\ m_/bn'WP{9'A R.xܳ\._Dip#iۢx:z1: ^RzD"fxx8}xxx\*`X.S0(O1rez\0Bd7P bɽh!Emvvv|hhhLNNiر(YS )7jznLRj+Y__7$"Yx)O?{os8 λ |RCV,ʬ0zAڃ\smłP  Sqo+kK:Yp~ʷ?_@24lNUX熮Sqo+E}pAbNE?0N! #]QW®bfS5 t_vvA9e пPq"ǰ4}O@竫}^U,@B_e՞qN`vvlһ}ZWʮdkLty tMRIIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_checked_press.png000066400000000000000000000011061424734202100327320ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8R1KA}3KN4"Ę$$.PIڥ$),- hZ l 1A XXewfvgw7s2MOjSx,_\/``bG'ӈE++9Ye5ӷ[(u VEܝ_svN)NPY!70q)6!#PϞb@LF 8Ȗ;qaƨbe&?ƀ81q\,6Ltdvi>$3Bl2JFxxoSv?x/V&:`B9(WZ]t<~lĹ@(_Db>%O0naf.w;hZD̚nkݓE8 -sxpzq ըa*jNۏV')d BW!WθQC5k_7ykg_짙'5qU@\rg%(,8KΊ`þ4d IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_checked_press@2x.png000066400000000000000000000026701424734202100333130ustar00rootroot00000000000000PNG  IHDR szzgAMA aoIDATX WMh]Us^SĚ"vUTDTэ. ĕ WRpFԍPRTŠ ԶRkS6i!!$}swkNfo9?ވNdW]~ob<P/_JU2=n&)R)-LLdɏqE^ ոe't}Gy/P0`, Թ/y]찛 ZwAq&'}]zJ\345Y9Ĵ1"'Jlםϣb)%bUN6Ylac K4bIJy":]vvgAX. LIrL3xnY˜|GI@&Lm´R1S7rb4Ln Z@[ـ`r,cYd#[VܺwY}b mt)Je[sp)ZJxw=AS=[D^,2ХrzFd70-%C9-ߛ[_.y&6"4MDO` y*pxh4 J@kahm'!ÉEh[6Kުs!yܰP,O/5kƦН {Z!V'۳\M ؔ"-aN5Mq1W ]!0_G[0&Hm?b̬n.~_8v29U[׮! )Uk2Bd7g,Xm=9#6D-ʥ(@*_/f09zVdVgCTWn1=A hږ 005á00ô4 Ib،û Au#m"⮷uoK| ϼ[BF>3 ?<}͐űPӺK`%(npPx1Zb,@sSxD꥟FbӜ+TGB`FB(.ǩ>!t*u^?{ru_EH!Z1Sh߅ nO]t,-Riu5ܹp.&bAV5O{e畎f.(B%83مFu\߰mKNbn *\rvvԫ/>x'/b@6Ė<̜,#|V5J[ -0B:M̧E@Gw }=cEAmtRtskgGϗ&p112{6m~j+4}6oxM[Ǧ 2!p܊ CxyYIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_mixed.png000066400000000000000000000004431424734202100312410ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`0bbu ʿ7aSܹsǏA+Pj|8H i RR =pr"L!Gn #OBa @= @ȨBIZp @`hhWXCn̝;HPG#$)FRRfDA!;3!CmsWtCIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_mixed@2x.png000066400000000000000000000013341424734202100316130ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WAC [XK$7\a %W@e ʿ䢕9@.zhb(\w|޷/0x U@!~),h;`{  q=r$* JrT*dGTgt:vhd;l~aSs0`r9}us ǒx 8@ cjc]_Uqjo~q?Fr ]~m25u¥&d2uLj\FM"kپgr'~In(X7*ɰ nE 3͹E!NN[ϯ5 n@"x<籺cNsF~303Aj@jAz@0Aζ` pZ ?҄.R d@Z`花j1v.CCCb teʟ.PhZ?/LxFR JXp@) HʰRR ҃"OnB8)r p$I JFcIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_mixed_focus@2x.png000066400000000000000000000015241424734202100330130ustar00rootroot00000000000000PNG  IHDR szzgAMA a IDATX ;OTAgސUcAQCVĄD11])ZSS런(q[I,ĠX 4JF3~agg/r)syw/JIe.<^25s3fL+}(uY7ʬyF/.]ˍ%`d2a6ƜZZMLFf͐etexK8kuV2 /?z1؞/^fiIVU~wJ] L3Yby]{Q4ԷTMnh/5n2[lyyfDjt?ݩ{R_7>yuUko0_y%ɳtQgu2熗]i]/C~ 0p`6Tvp9#wt &5*p{]fh7,^2r9jv &lbY - 95y/9L6}Ykrʤs*l'Bn^%˶ș ^%˶~+˪X,mppPJ}qSE^%-dcM&xi_Bc?aЋ5=cw~F!9Oj sa5Y`&xmr߅MfE=O* ư<6 'Hb%` 'F ILG}ak&KMԒYijJ8ܞr+1i7NwIMLКy+ mXzGIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_mixed_hover.png000066400000000000000000000011341424734202100324420ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8RAKTQ73錠3aD0 ~Dp'HѪMZ%nvU &PԱ4rfIw\gm;}9 f~_F"c8Ũt\Wm#_#. &ПnLJ$R=I㒅.y`=#ܟU(-nbEn/Iu , b9̪|J#u\)+|Ví~URTOBR]q1@rdz.bLPopO3WQ;!CiQ[IGbl<3kӉ?Yd]0ON}K00~꫊_i@-9e;sU">~1m*'"{?7{b0Ã*|/2u@;n+C!<]U{fUGp1=9O%^jB™L,R>1s<#X Q6xjo`t oǧ;^o68=DZ~)yTqL,-tIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_mixed_hover@2x.png000066400000000000000000000026341424734202100330220ustar00rootroot00000000000000PNG  IHDR szzgAMA aSIDATX V]k\U]$$L&1 I!jĀ"ID}"DЧ>hMED,1V҇6iFeL:I&=u3Lon9gnfּ6z\m5y]b7[ŵ]g7i݂m.@ߚā:y&>n-wqn3!qj ;qAU] ƄAmU85ōEi`y-n1 KaۂqV[\ER9-tImq\BP@4 8Yo7HHoQiI֩8 81i3[끖p-,%P"-GLF Dȟ둬0eW2\X~ hw#=Y8GF0A# rU`;MŸ3ԺGb.M'}N˕pEBӢfoXEo9?rb3E@N. ŋmzI؅%b--br=ٗuؿ+M#W9HV"+u $SPOlr]`yf5Y^ }藛4x+=cʫqRa>aK_TR@$r}" =_NwŪ RX/¾'яضp",~L&0"+Tp;1gg9Ë&fy(#:a$nf<]64 v1<܌/hb:@ƋEgzVM;ïL'9gh%11-"8&[L;m3Liwbs-!l>INPF)2.A Cq5$Wܝ5U+8̅:μ8 &%3Wʍآ"GC@.a29.# Y4( ήjUEW!B|QJ.(!3pD,߮]؈bIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_mixed_insensitive.png000066400000000000000000000006401424734202100336600ustar00rootroot00000000000000PNG  IHDRagAMA aWIDAT8SAjP)iЍBJEh7n[>ƍ;.r%J$* -q7@aoޛ9挾L49'ؾjcAx^|QDqDx&sT` IR ϝn=!*ϙٲ0 [:PqTS_.pl6\u{i xҴvt:=@˲y XO&Me+^BMg"ѿ0 S!IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_mixed_insensitive@2x.png000066400000000000000000000014541424734202100342360ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WoA~%\9h8GpHLq?gz!h &ĤQZ) K%K^g|3 u7@_/pWkw:o0>ki3{#R>n"|>3H;^W4NhjM*ʷpHw JS$jx<KghۣcM85 /$2Z>xLbG2+Xdn¤*9d&LrCnInBuHRPH4 S?Ab\/g繋W!NcckߑK59Lg+V_"RXx[=~Ԫ aD<*O c06z^FA}߸TLp \X,,?=^Xy!!{XL$=pr] 4r^3pV 'VʥTWk.Y][ Lp=A. IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_mixed_press.png000066400000000000000000000010411424734202100324500ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8R=OTA=36nAH06|X #-\k5;DMtl@ :caavf8gfg٬νs9޷o\f^s+h:g::PDTg-pɌpIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_mixed_press@2x.png000066400000000000000000000026041424734202100330300ustar00rootroot00000000000000PNG  IHDR szzgAMA a;IDATX WMhU>w~^SVkE+.F VFwvw.*EP"EAp*ET Ň"$)67;sϼ=p{ϹLD!?dwμ|$t]=uWk)m9wr9 L dB=}rU5ovL{/O!C`g(c7ʾ_q|Mr߶ғS&5Ylo|Ȝ|RX?Z>{}} 2r)?K&Yl#.9 p@.mH宵`t"y `XL`Z$CM<21wړ51JL譕%W)`y$$Zlc1f7ڳ- +n+yޡ͂fm:t"/kyV_j}tPe+; ~9.j -!TCd:"|{!4MWo.?y+P+ ĺ(nPA.z_pYFa94Z^iJ[*C3c:ÍKƌ[c~]1FD{( Ok":(FS!Ȍgfx2Uk97Nf5,Q@1} 4j M"?ALʙ"*?N#(8D22E"-\k3d)g³Iᣅ؀Z!Wpm'hl_?—2d<ģ"̠7sxd>(;Cɝ=4v;1R' cYk"& G\be,b1m39|xrc|D0'` pĥ b=8zȪ7ǧRT" .`z:ǧ <@(nxԸˍTZ^N@p~1g!ngNdY]sgq 5L@Ȝ\9ybLE'sFwNd髷ڣoWv%`'sG9kxSDk_xgYXrPО1YWwmG<~ˎLt@+MPi2m {-\7X:C~Sa/ٸK8luRκˋ'{?›O_3&ƫ9Y2hRfz7dg\:64u Nbi'"1O{NIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_unchecked.png000066400000000000000000000005001424734202100320560ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8S1@Dk- c|F;J7H Q;MrԘH*GLHpe73ܠi'0#ga/Pygbaj3UUh Zo8><$EHm"sM!,8M,=9HU,65SE4MOHO4U Øz!.fI\Ȳ"|I&;VGmf]WUzb plD`[svES _lP&+."q*3TW$^w؞!vFT%ФG̐Q=lV _l#JFy gm3ɭ\.P_l tl6{*͔ZVQ :k6RFG:RNC[Gy9 4nγl!1'.cfDIHmNI$Δ03Aa!L ӏ_RL, 1\ZFJ@j0gLbť ]p e~Ft UF6Z`/Uݽ @jakkH qu|( G_ JPT"OLB:%!aMʠ4 *PRr))g`Nκf; ApWfIS5}VIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_unchecked_focus@2x.png000066400000000000000000000016641424734202100336430ustar00rootroot00000000000000PNG  IHDR szzgAMA akIDATX W[OAĠb$EhD" QGOF&hqQڥ9β--P3{v;ߜo ꅦN'*(N^d lS~&ޑzedk"P&iX 0(imPEE=qQv>Ȥ| fSG D\d| 3t4fuSBJH#j='KI1!;+tTg fb1Qgl# ٟ vlp"l×-%75w&Ӳqv ue/ժa;;Ѯ-` OND`.92x5/3i&SKU(rnS1v\h̗=\/ O XT nasjB?61Gl]r1 l0&,d $-,o¶Mr2j*rrpqZ٪oeI3_/| dx40] |6E }$mo!!b[5j? 5nPFM 2[bb[  E}8cn^͆yV`D6Rj0fOիxq((W  !#n AUQ1޻NIAyݒL0TQ*H$1l ^ mY.H`i&NԟfӐK&ic=A=*IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_unchecked_hover.png000066400000000000000000000011331424734202100332640ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8SAOSAfyڂmAbMDxЄx׋'E.^<Ћ!ƅMDH fRDcXhjyoj8vfwlgSybİ; ˝Gd7nWq[-d piJĶ.C|Nd@RhBryROBAY&!=6IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_unchecked_hover@2x.png000066400000000000000000000026561424734202100336510ustar00rootroot00000000000000PNG  IHDR szzgAMA aeIDATX VYlU,Rf:@i(-Y1BB! &#DA 1&Cb0&ꃚW5PhKM|(y`OAҖeweB/{r;bkcp♸ cMƢBgǻqNC&@b݂ ^Kx;> 6ԯքϬ3M 2I\[\N;|ׅ޿wY1$rpTF ?wYGĘ?~Ɨ7c<c'"U5euMTZK?%^Jn8xQVxr$VGRL"'@zMd\OHc.BFKHH-0.cZ&PX]X "  m F$YD$6HXQӁ$riWplfq}ֆ^"xUQoBbGƚ{|V'\kE,iER7Fl>p@~ࡍ%s,٘+^:eoF̨f9Y4 OrLR uVkr%=f e`LhhRI8ҍ A׀9`q,BJd4ljK0p'5Z'G l*4N/At XrM>R"DнC׀7oYkۗ8]_M׃P)ƭ5Y l>Z85% xᨃf|K -PJ&TKl&-WNB'+k-$nרdRfh8Xt_@'٬@! 8f"vF?\6/'x "^.Hi 6OzX1:9ODēоێvmv`k0E5P^ qw*i ~b1 ugxuŒb0R RR~h;upD-ٗ<}lMnPĊ9aaEnmەc("Ly#gh3q<yTh_ -|-Yތ[=CRFjp 9r[>8ev =y~މ$ZI$zGl}10'ԒIa:|E,z9<-0Hlt;b`C:CW+=G.rS1sgo= +6+ \2V= 4D\uc?mӮy\kBd|${"A"u{+Hd G2g$͒RѹIӾLIENDB`radio_unchecked_insensitive.png000066400000000000000000000006111424734202100344220ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkboxPNG  IHDRagAMA a@IDAT8Sj@)i˒KJE^^zx<'॒ A ڠNA6 ~}?3+7 [ | rwkI^]&I7Ms0fxQm5ME"AG0vY%K˔xDkyqi@ V,5yl͹}(oF Nycg ޸\ 0K $7t&f: 5rӷ4jj|?üTe!Cugz,PM Ɵ>]yHLJIENDB`radio_unchecked_insensitive@2x.png000066400000000000000000000014001424734202100347710ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkboxPNG  IHDR szzgAMA aIDATX =Q]TmHƠ5TTj~ %7!h &4&QW<י]@f?`'yso3}{=U79oDpwe _5"]A5_SwB@x_pC`q\._d2{XV$Qf9L>wi:qǎoZi qՊ_~8ύ^7)GE,͒K|>l6ph5LY*^qc^ D؛HEZ JZV{ V,̓` tž`*@cHB˗Cr'Ҋ3RTt4}mMrm-,m평-!k\2%ο IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_unchecked_press.png000066400000000000000000000010541424734202100332770ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8SJ\A=uM&A\I>@r$DBN,!D$ʅ32$0 $љ;:u*e*tW:9dbUT0TN̾Mr4QvqPZXESLɏ͢8C R%(~,s`eLU42;9CrBgU!`E[Uf{)5YBó=E< Ӣ̦L>DUfP$I8l{s}֘_|*/Et'q=ovA;kk283uv@jo6vI:çd579l-Ǿs<~&X,XNqvL y^nwh>%m* LFBfYlRC߬ѱaRՔ_.~1FnEx->oK1Bs"O ?\VIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/checkbox/radio_unchecked_press@2x.png000066400000000000000000000026321424734202100336540ustar00rootroot00000000000000PNG  IHDR szzgAMA aQIDATX WMhU>wfkbhB41e AW.\ nܴ]tEpcɦ]QWH S+BĘ[mkZ5i23;sϼDSns9̫uy'2V yxs2~62y񰻈~#7R?˖^FAAl7˗Mnho,"O3 &ԤucIz>~<䮙9s-rW[2Us,&5Of#oY{ɹMN\x՝da]Wdr#%ı:8]* >R7ȗFSjliPh4ae4bLb`|= u)o<.jHQ1"^J\ZP@  x2P ݗ3uN@) t)TEBfJ pyhdI&C`5!, z1&A^ڐEȯ$m|$$+Lj"#T[MA6{S!DmBŗH7IIK[I@8xR ]Y? XL1 |X6D,a˳ zy-I$Z9~E4;n $[`}r@j'(Z xVUf_"mǏ\0Quc:.q/tN{ "$1a5Ww~_2Ov"R3Wƶ{'&Cx8䧩ߏ^g$7FSN : C:#Qy=RCrXpӧFy01sܾ}Wt-w>t_ݎcD`VLODxdl2;XO]~`b51J=I!=c8Cg{z<#i2?\>xAҩEXB LAEp }`ϣ1fιADn[6YL'&CM΍%#ɉV!e}ȳ3.KhhVi@T:, XO8'y+ql#IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/header_arrow_down.png000066400000000000000000000002561424734202100306620ustar00rootroot00000000000000PNG  IHDR Vu\gAMA aeIDAT(c`FK 1L /(&eʁa @|ܹsK@|@iK5"+a MP`d " 0NIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/header_arrow_up.png000066400000000000000000000002721424734202100303350ustar00rootroot00000000000000PNG  IHDR Vu\gAMA aqIDAT(c`(y]RRR?~ Y bFF$ ҈ hRs- R $))yŋ7A61cbb dĠLx4 &OIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/input/000077500000000000000000000000001424734202100256175ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/input/input_clear_hover.svg000066400000000000000000000026411424734202100320530ustar00rootroot00000000000000 input_clear_hover Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/input/input_clear_normal.svg000066400000000000000000000026051424734202100322200ustar00rootroot00000000000000 input_clear_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/input/input_clear_press.svg000066400000000000000000000026161424734202100320660ustar00rootroot00000000000000 input_clear_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/slider/000077500000000000000000000000001424734202100257425ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/slider/slider_handle_focus.svg000077500000000000000000000050401424734202100324610ustar00rootroot00000000000000 slider_handle_focus Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/slider/slider_handle_insensitive.svg000077500000000000000000000040721424734202100337060ustar00rootroot00000000000000 slider_handle_insensitive Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/slider/slider_handle_normal.svg000077500000000000000000000051701424734202100326360ustar00rootroot00000000000000 slider_handle_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/slider/slider_handle_press.svg000077500000000000000000000052001424734202100324740ustar00rootroot00000000000000 slider_handle_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/slider/slider_point_handle.png000066400000000000000000000011001424734202100324460ustar00rootroot00000000000000PNG  IHDRw=sRGBIDATH Un0LB}qG~jտ|IC 8V%?H[tx#DZC8t:Yg8[_,/|kr(6ۂFd2yIY'rk( r'0րf S:I c0HƜ<% ur6$n 7@V.}{R̛Oa㡐1 0Nd؞ U+rHde^%:R78+Yp轵"3cWA8] DkFyGEq j1?hl+Q3't:f$$Jպ_Vz^4;֨>4~hCoRW=brL`nlAr4{'FamSvvAp\U8e+يg:vȫ@!`riH])M(~4B,QtG44N5B"-zXv~*ϵט'y>0Ti` IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/slider/slider_point_handle@2x.png000066400000000000000000000027541424734202100330400ustar00rootroot00000000000000PNG  IHDR00WsRGBIDAThMO$UQ0 G1~`W`E5jb&nNLL@cFQ$& cnߧR].$ssǽoݪ.w w(EISSUI -"1SLK9_&'w^V/%1Mr9.;32E_\\J%MgwXlW4@.rɝJ= ;0888[9EmEV |RDZ$ĘɺvYŹnڧӀW"߸, @fꌅǣ(͇ji.̒֓>HXCNrS?۰5e[bcoOSj&gy>rmJkXdA#C݋'a +-‚lC#2YO٧,@\'h85x"T +ƫoO'縹&p]f.h@|=Z16u% CzXhhЖ_IYI v\$w*JR iyqENO 4<ys|K݁,i~Dl%X'œ'a&Id38 :9Rqϼ]`[*AS8?$x;tQ`2 TL|4 t~/?87t;/o(j :#((1a@"fQKJ[[[J!D:A(NJ5t\Us+Oo_dN75|.QQy2PjBiii (Q@ 1U.KnZjwTVd'V..+3>R{h\ Es)xH\9IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/slider/slider_point_handle_focus.png000066400000000000000000000011371424734202100336570ustar00rootroot00000000000000PNG  IHDRw=sRGBIDATH c`1`D7?t51?8<6>3# 5W1¦.gG/_|O4pp1Wxf,_Lh1sb`)JcX@Yീf}@4Z@(0AP^t ֕}t = 1 yF.rmoٔc?oAz@zt A*mVoRr Ak}cBVDlXkn^ E0D -rsý?pYzK\prQ'?TJaAD Kش缘3@ ^ % 0ɸ' .z{?aAwSpH 9h]*.F+YJqbAC@jX53|=zD9P7bb?:E1\Ԉpb jyW@AAӠ}IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/slider/slider_point_handle_focus@2x.png000066400000000000000000000026261424734202100342350ustar00rootroot00000000000000PNG  IHDR00WsRGBPIDATh[LUA#AbTM}1ꋩ414M\J-j4jńjl!*PӪڂPiar].;s{;gvg/9aw]K[n׽oѷ &hLkmq`zzZCJT+nPqQP7e=4UT)Ă_}36fMel'4:LEC/T 95<(;pMx0 _zscf&ؖ0 ֤o+z^?tĢ. -W"Q h9S sQ]^9 _SG[?S%p>}f@iCG3TQjY&J1ÈW^S{t%@Ehd_zKbQ%-7hUe^R=aCgJV ƤuX}MP}~-I` Dz+̙;9:J'XFU>NT& aX~Ґ1=&!&deӾϫd6:_2 ȖzoѽL5wGi? /ƃN* `R ;Y/¾7NGkEWۧ-d:t5/x)^L$BKU}ޏ:BiJi* ,C#B~ _0X0NS_q1 ')vJZWc = EX71J8pr;L&g'WvnJ6iL, p]Ȅ*a.'T;P~5S N,\wW^X2pL"Ŗb7z#7J*ltqnD 8[L#fBBL:k/Actd)' į*///OL#i&mæG֞rDnSI2[)fI)<׀86ԧ[gV2 zߘ8 3#{79`dJZ\$dRtDǨfv׻˨ ~FTVMP8Hv +~&^oxFh8G8~GHF u;&$rJ#Q$NMOME< UdAKnx`IENDB`slider_point_handle_insensitive@2x.png000066400000000000000000000023771424734202100354020ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/sliderPNG  IHDR00WsRGBIDAThKOVH)Hl6iK UB(iX A|!EjO M.i%"a a<>t6s;Rhʐۖg񵤹#ǠD#KIA}X`ޑRX,[GgwUQE. @ @dA]|J'''?vttEo\.wvv>iR4o&)PsA0wRlN40' kZ|˔d$-TWh4 V݊ ,ה25YSe.- =],aKQ'uZ0mc¥r+;C B귁;<<<?]]]PNI-x󦦦^V*+]Ug^ quq]P9ȅ.箪?-.ƫhZa]th@A.rJ#wc<. Cq EW`Q{?88x%WTsfff9J%\gszzz9#Wb߲ / qkK|o"݁4VBz*5 R|$QwJWSxlP;+?o~~~"18vwuD:IOpddk-*)Q9V_p|&h<+DJ?:^f'9u[_RO`:0]xx*mmm=xdVss,M-6 \7BCz=,6Je:4~V Ihᩴ|%q=6BRGŹŎդ7_Q ȻGGGN( ALΓ") RI5rlݠߓDXqu^C$hISo{ GՓOoF(3_MlR;Ւ "`IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/slider/slider_point_handle_press.png000066400000000000000000000013361424734202100336750ustar00rootroot00000000000000PNG  IHDRw=sRGBIDATH UkAٺ1%Eǥ^,/  QiXfQШm h06АԦc|AГl1o†\T?a0@Hܯ"qB}857cl^=w; Ap ¢F]ɰ^mH3hxԗeqy̕ҁx\($0R]V: ٠>; lQB]NfR4]~X WWM̼O3W>dx1W9ȕ$Q`Q{yF(g WXF ϗp, csi ޲Y bb9љsȵB6@55a`T%baiFxamb reّl e@1712"YΗjr|(?8;&xxqe!ѺQq5e|a7c{QT=μ dD,/&=u[gGT?D"Iep6:ݣ^ ~4(pAP`Š$R2QuT.Jd4*}+@UJ {۝m8ϽvzEѫM. :{"(/ ES!6S:㽸NejIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/slider/slider_point_handle_press@2x.png000066400000000000000000000033521424734202100342470ustar00rootroot00000000000000PNG  IHDR00WsRGBIDAThY[lU>gʶt[*7E71BLC1R@'@LaA PVE 1**@ {n{sRhwf; ?soߜelT plL2IΤk֖Q |Kޯlِf"Y%%{.= [\"ѬPyƵ)A{VvA~|no+KR˥_#GS2i+z[H1|.oxɻ%;ۦ'2q9,95~M XZ1:mڔ |1@&`UM%鍋b"xNl@zeUTYо4]y`+Qʗ:~V X!1X%psb4gsn=5t0gsn=5t0gsnm-ckPi2zꂕ5+kL܂ l|L@$`rfJaƼ$f_&S|8L+㫙p&!["kC3a}NR\/4}c1X&@QtnHvEXdqPmow-ɟ%O.jw%.%8+,pV~ tŠ幗4zg ki%f̎wMzGsatӿ y1jYa)ELhZ=m?-U xHTQ[e/ULɚT3(hD[בn.E!1%Z0>%]ZAp!%QĄ2ZB\6aЪn]BHQg+* ƕSwTZ*R1'v!:AKҒ ^ j'LQI۹}ԅrjm2-ye-(k- 3r|UzEnpX%=Z @s m`>,ͨ)A6fjLtϥ-/8FsUA6`J`z-^NfC N,E¸ WLMh!AnX%\Q) ?BGd:U'*3 `XI'qBXKStI.Rc%s\\sm,P،q5Ӯo;OKx'Ң_ҺGi|sUM*5z (|HT{"#8pRamE'YSԝW;;$\8P)q畴%*=JT:%:*:r`5{@SA@FB}o_:oYD}k_gc&fIѭ<&u?kmw 1bLa`.}1qte+9ds#'PpCgkRsϒ3ϓN^C88Q<6Bk8\A HJ<)EǿgkP:J$_ (p6=w>~O-}항^]E3"ǦoXݹRMRN&"z`:*V#EupoIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/000077500000000000000000000000001424734202100261425ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_down_hover.png000066400000000000000000000002111424734202100333010ustar00rootroot00000000000000PNG  IHDRxUsRGBCIDATcf``b9 I /( H8 C'P& A&e8 ` k/IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_down_insensitive.png000066400000000000000000000002451424734202100345250ustar00rootroot00000000000000PNG  IHDRxUsRGB_IDATc4666 .f@򌌌L I*L$W&&/ A=yHę3g)bIQ$}}}mdA5# IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_down_normal.png000066400000000000000000000002461424734202100334560ustar00rootroot00000000000000PNG  IHDRxUsRGB`IDATc444eddܹ% HȵcIP &j !#H$ RT~I211MV?P$ G 8YE+3IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_down_press.png000066400000000000000000000002571424734202100333240ustar00rootroot00000000000000PNG  IHDRxUsRGBiIDATc]?+K@Kg\!#H$ RT?$c)`(%A04$ݕ@\..IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_minus_hover.png000066400000000000000000000001461424734202100334740ustar00rootroot00000000000000PNG  IHDR;֕JsRGB IDAT(c`C$MQ^=IENDB`spinbutton_minus_insensitive.png000066400000000000000000000001531424734202100346300ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinboxPNG  IHDR;֕JsRGB%IDAT(c`C$a400H .\EHͨ TIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_minus_normal.png000066400000000000000000000001541424734202100336400ustar00rootroot00000000000000PNG  IHDR;֕JsRGB&IDAT(c`C$a400c/\GHxEơIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_minus_press.png000066400000000000000000000001541424734202100335040ustar00rootroot00000000000000PNG  IHDR;֕JsRGB&IDAT(c`C$aY?MGHF:IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_plus_hover.png000066400000000000000000000001721424734202100333230ustar00rootroot00000000000000PNG  IHDR;֕JsRGB4IDAT(c`?>1$$7D53" o 1I!x FACo}yl=IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_plus_insensitive.png000066400000000000000000000001771424734202100345450ustar00rootroot00000000000000PNG  IHDR;֕JsRGB9IDAT(c` ØIa"80u … Xل F]lXIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_plus_normal.png000066400000000000000000000002001424734202100334600ustar00rootroot00000000000000PNG  IHDR;֕JsRGB:IDAT(c`?>1$$7D53E(p`@ Q؄ FQ9u0 F`IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_plus_press.png000066400000000000000000000002001424734202100333240ustar00rootroot00000000000000PNG  IHDR;֕JsRGB:IDAT(c`@gƄOW"9Q؄ FQ YLIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_up_hover.png000066400000000000000000000002001424734202100327540ustar00rootroot00000000000000PNG  IHDRxUsRGB:IDATc`@!@n2 Ŀ8! a$Al," x(pn N>ۂIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_up_insensitive.png000066400000000000000000000002521424734202100342000ustar00rootroot00000000000000PNG  IHDRxUsRGBdIDATc`@JHB 0HN7 9$33;)bD<{ .d1f111;0IgϞNy4rIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_up_normal.png000066400000000000000000000002541424734202100331320ustar00rootroot00000000000000PNG  IHDRxUsRGBfIDATc`@!@$ $GBB/΁ `@~6PR =9d .1L300``2 @:a ϟ_4)4-vfBLIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/spinbox/spinbutton_up_press.png000066400000000000000000000002541424734202100327760ustar00rootroot00000000000000PNG  IHDRxUsRGBfIDATMA 0 Q7=E_Cb+(og8HCA!ȐMahL' ޺Tз&v{0V#IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/000077500000000000000000000000001424734202100257135ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/add_hover.svg000066400000000000000000000013171424734202100303710ustar00rootroot00000000000000 add_hover Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/add_normal.svg000066400000000000000000000013211424734202100305310ustar00rootroot00000000000000 add_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/add_press.svg000066400000000000000000000013171424734202100304020ustar00rootroot00000000000000 add_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/pagedown_hover.svg000066400000000000000000000012011424734202100314350ustar00rootroot00000000000000 pagedown_hover Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/pagedown_insensitive.svg000066400000000000000000000012431424734202100326600ustar00rootroot00000000000000 pagedown_insensitive Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/pagedown_normal.svg000066400000000000000000000012031424734202100316040ustar00rootroot00000000000000 pagedown_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/pagedown_press.svg000066400000000000000000000012011424734202100314460ustar00rootroot00000000000000 pagedown_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/pageup_hover.svg000066400000000000000000000012261424734202100311210ustar00rootroot00000000000000 pageup_hover Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/pageup_insensitive.svg000066400000000000000000000012701424734202100323350ustar00rootroot00000000000000 pageup_insensitive Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/pageup_normal.svg000066400000000000000000000012301424734202100312610ustar00rootroot00000000000000 pageup_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/pageup_press.svg000066400000000000000000000012261424734202100311320ustar00rootroot00000000000000 pageup_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/tab_close_hover.svg000066400000000000000000000022001424734202100315640ustar00rootroot00000000000000 tab_close_hover Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/tab_close_normal.svg000066400000000000000000000034261424734202100317440ustar00rootroot00000000000000 tab_close_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/light/tabbar/tab_close_press.svg000066400000000000000000000021301424734202100315770ustar00rootroot00000000000000 tab_close_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/000077500000000000000000000000001424734202100251505ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/check_disabled.png000066400000000000000000000003321424734202100305600ustar00rootroot00000000000000PNG  IHDR  gAMA aIDAT} @w@`!SY "R Z`Xvw3$谖2V[huȲF1)"U!T (()Gx!5StNjѫ4L=mo/:-)=.Hj:+h[55QIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/check_normal.png000066400000000000000000000003251424734202100303030ustar00rootroot00000000000000PNG  IHDR  gAMA aIDATc`" %Lxԁ8:>Ob5|D & L @ ـL ȸ&;sA1@$S@\@V1@ m@^iTT M@<Pex@@& .H"xIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/check_selected.png000066400000000000000000000003151424734202100306020ustar00rootroot00000000000000PNG  IHDR  gAMA aIDATc`Ċx@Z3T _@lO2P{ .+rxX&dsE ^ @i@|y@@z1_ኁ@|q1budPBo1#a dC*t/IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/000077500000000000000000000000001424734202100267365ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/checkbox_checked.png000066400000000000000000000010011424734202100326700ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c` ܿ_DHs160/H9ȷ+r޿†@ݻgvݟ@$jǖ-[$߽{3yda5@0330/9[0!Dv޽JQQH ?kÆ >jr>رٟ>}ZS1 bؼyHzzzTTT&\RRRLFxa֭ZZZKϜ9SR;_K.M;oF 0?$$d޽{MYXXXYYU.\ F1۷ ʁ.x4$׭AAAG5!Q It=z-48NlPXXX #eԂ r&eA ͠dc2L0 ,0E3L,DUzIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/checkbox_checked@2x.png000066400000000000000000000021371424734202100332550ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WmHQr#+,NHBB$HaZ-4i1d,B%h"BQ:!$E0JCS3w_ݹ|<{{w ſ6&''a伕`jۉw3s/ZQTZW3 &ơva'0b9LVSSSǀ_j@ ir0"beeew`0|Xd7422p9dfu/%MQQQ ёKSSS7Rv9 5o=@{XGRbb (e^d;h w$rI|= `M c' #hpp0 ί35p{bR}ZsL\777DŽ=dxT,6L R(Ѐ>APo- '቞"_I.%nJjYGV>x8y|hxxx5ܜ3inZ %$$2bby={WWWFEE8QJw{ Qy#/R9ƴ8g{ʖ@TߘmeӒ'۽W0Xbbb=']uVu 33k ˟ozl6Gƺ<Lrcc']Qbl ) } ָ,r29~YY,+Sg0~;+l%L\oq(3>$xOO~o@r0 SJlmpIЫOo@-5.Ao#)57e=ʏ0 _ypS)IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/checkbox_checked_focus.png000066400000000000000000000010331424734202100340740ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c` ܿ_Dv߯F30HЁ&3;0_ q322Z@eqlNjS%%Nد{o"GQQ"4 {ɓ69Hr6.AA@ZZy!P[˿3b *m>|X t=KG;vp"GG@ ytW...͛7;$`GIEEe߿%%%a4[n Zz̙2OOON__9@Zti4hH,@y!!!kk"((T,ʪr…0M4o߾o``Pt{! _n : bLĤѣoͧı03>$lmm=! &Z ȸ= edb\#:3 h[=,sȢ <IENDB`checkbox_checked_focus@2x.png000066400000000000000000000022541424734202100343750ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA acIDATX WoL[Uvu@Af$N [Dp7I!;> 1q1uDHAu&LHL@0̚ ,]y)O{}= 6ރ Z7#(v εdKԪ}^e;;;.6/c̒'-zq97E.~ $3z}'vd V.G{$R )}|+w4 .ٜG;滻 ${{'D#) E*b[QQ 0V_ `@[[p(z?Ѿv-3/(_A֠ TkZ-| h\jB 9@ͰSsg4IN044tjɑN; LMUUd2][&777lKaap|+?΀>00ÃMA9w V2j.L*䙙kSSd,tċ-//_uͦF>Q9!h4^*oCeccm6;Ⱦ U \ n?]-,t='9rްSյ$77ڞ{)IfL:ab1rкܜXQ@7-~S9f=Vgˊ4#g߄\k?)6;/5r*mf P<#M6;@kF# NV?̿!NhIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/checkbox_checked_hover.png000066400000000000000000000011201424734202100340750ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c` pQ|lvJg??C?+%# YgRp6÷O释_?@Heabh/Y"43(w=' 1&fV.>&mά4cՙ,.3~Ύxp . %kjGk~9n+WyVVV֌U1{T140|ubc.F72A,r>u A'@% XwC￘z2[C~6^6N'd=:Fŀ߾gkckAL=ύ=ӀNU1{&AY_M ahgd+rl Y( D `Ct3A9410<qH7]/r-BN "/!&1Pe@.IENDB`checkbox_checked_hover@2x.png000066400000000000000000000023701424734202100344000ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA aIDATX WoLU{{k aҮں`V,Eef ctk\ʴ`O&馱j%k17\Qgµ%ƽp9/煔?/ۧvss{^[o$D9n& r`8wݎ3>8ǰo3ŜGHzUU!|P"/jˇ @ 8wb,[;7 aZn*@#/!E3vB]^rRt01cƢbi~8m hpY׺>pJw?&7g:6:ڟLpxt ` ^ a^ 7\.1-7m; e{Xc৙nrl(Yy|\AS Ȩ(YunG^!7A2m?ttCc%rq}]qɍ ~zѧkG}m;x|fAN/BgęFp#3|~)\0s2tOĻ >t0EMe,wxn8"ʳg{ANyy͎a:RUPdQc#Ɖw4Gz^fK{!6ީ4#t+xOnݮݲL퓐)uZkVJs qN,w%qmʄ+1|lYZ(};vNzoK8kh%{ Yu4j;o}Lv{[|V¼>*}#qjĖ9Z*c]?هڷB8plO{R֝/h ű2 5qtOTӚ+cGٜÇŃ(S'AFW?LxpS"e \GrnSD]C@r7̻?^栞$0IENDB`checkbox_checked_insensitive.png000066400000000000000000000007631424734202100352470ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDRagAMA aIDAT8SK`w-]0\M "U򢑗xb7g*x,괈i`bi(8%}~y<\~ߏTl\l 306zt:L&F|>W7bHt:! l~FfbQv ؕrS<7V-IZ|;(R xJ8.b /z~Zz}/Y˲^TwaORf AP}jzUU=G@6e3 rjͯM ǘ.˲^4Mr2DOx0&!Lj#O(H$MӼdžp j%r"piD bA ,察ě>?n@ko/okIENDB`checkbox_checked_insensitive@2x.png000066400000000000000000000020771424734202100356210ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA aIDATX W[OZA"4PC[5&XjW?ۣ&5X!Hm6( K"J7gqA/&ۙ9k>vss۷ z*L?99 \]J۱/'ƕ+鰑B**D\:,/A]9v&xRzffN'lܳ(P*-VTP3XD(`H[F0ĝ3#Q{s@ pp %DDv!߿f7A!Gާ'AߓqW<'l.6A`@Maf)bǣ@0 HXUJK_KlqL/k?7M`d<15yAūmLPT6X8r^o`$RӭqWt6+ *bV@ 3frA2Q6-6$ŒɨuыxY7[VcbzH:|44>,z+@@IENDB`checkbox_checked_press@2x.png000066400000000000000000000027371424734202100344200ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA aIDATX Wmhe޳sq0XȲ>)*3+2*,+V ѲSF*BAC"(UQ} Yf|<]>{W羯xߝ7Yu.µغ#SFVkKp@sh;Uep\ G9YmЍ9-Q:z+x_+D*gdHJ.؄m(Nc;=u]”R6]ƂڢG Éx ~~FPtc;w}w}X"_:)yFێb=R[oW,J!1gꧩi؊Pm*\&*/F7aP$B`otcd枍G"T!ݍ{NXHL0TNJT.1 ` j#t_wCz@ Vxadʹx()̓}nZ+[Zro6(-3=ΊC !0"t '+`-TXq=H߆iy ~BBƝ?Ua+; 289ppH%~kWD kqEp*Iv 1FO'o *6<7glB)Kvxזs7YY3Wu]qXs 8"FTaڮd}JG]DگVr ^Pɻjw<2]hâA-"1~>glŨbtw%KNC-?6ӁlTaBedô.^lg݉ 8Tb+ ۸cXLBkCl?ܱM[GYM`}Yh#Y XPfFӆ"k~ }CćNwKh!xL*l3'YzȟU$+_|"!ÇCcMY Cc>TI@s@d熠 (y 222+`{(%> RR  "b4 y! - bYLjn `s5'!˽xz>=0qp!,Mʰ@,3\B 6SIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/checkbox_mixed@2x.png000066400000000000000000000007211424734202100327720ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX W1N@Wvf+bIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/checkbox_mixed_focus@2x.png000066400000000000000000000010201424734202100341620ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX c`[-my!Z3В\dKsbWt-w:<D-w[|٢ʗjHeKŵZ+Wgdt4 f<@`?0EԠ%Ev302J210 f8(Alϩm9\ Al] 6`Ѵ0jNis8lp>4uhJ]/*ŧ$jjj6< J$4u<{C`!`:Am8Z~v扫 PD̆`$.\j@ 3A-c>lxA]cOwۨ,Ɂ,9\W} 958I -IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/checkbox_mixed_hover.png000066400000000000000000000004261424734202100336250ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`02PR`2v,` ]g85QI0&00H2142]X @jAzza`$vAX!E{PĀ@b(F @z#(y jz?÷7 n10' fՍ |"w q0635$~31;<< IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/checkbox_mixed_hover@2x.png000066400000000000000000000010021424734202100341660ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX 헱KQǿwgIbAR ֤ :FH MԐK45$ bw|j.y&qw=z{/( j)Ϗ%v3Ǎi11yD<0 ʀWѲ#~jXf GDr/:(z>P'6vӈθ,6]}IF.DmYdJ))y߹+'E&L)e_CAAcO 9k;il'$I[a'&};Q,W\.zFf%%odvRp!r+|ġԤ6d)(C 6  De.a4E^s4I ^ iἸ KpGg 6ŏ/kVUź j$%5Zp,XQLp-t`̈́֏[R\[2egg৛.MEw~ ~_{/% .=\3ڽ:(KfJdXr-ЩLޔad?8/Ho\$7@MY Q!s`nR'QIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/checkbox_mixed_press.png000066400000000000000000000006231424734202100336350ustar00rootroot00000000000000PNG  IHDRagAMA aJIDAT8R1N1 78x'P'^ (OHt Xfq6 a;'و|=J$r?L(D3v0&ҦsuÊ~ d6#Q1=`}DMreZށyilrm1-ȁM$D5jkj@}=l^Ol'׳ $$4ű-Id8խoWz"oGhwܪ@qȿeA@EYG΍& ;`UyC3H.Duc{"y/;1srM/3 gyn;f _g[k.IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/checkbox_mixed_press@2x.png000066400000000000000000000020061424734202100342040ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX 嗽nSAw(R$R PsgH /@::-H@HMqp|og=e=3眙]_;rJpv~}ikBDJL P*Ǜ>mm˹tUCO[g7ͳ:A=^MDɢ)[o`d[:fM4dX~uKJaKAJB}6͡he 2n`\ nϐ^:djkTcӞDǘRo"D4M7D7(@ݷ %4qk yib!ۚw g Zo'XPoe1FCu9NM[n <˃[^z).>WsuB#b|S PT:_YI&jמy z\X<˧ȅiQ!Z.n #P޸0nNta[ sÑz<(ХpBć=s9  zsCD`=;: _x|f@VY[%b[ ̎@zèm〮YmiDh" ɜ .4Z|@$ 񼧽 "⪡x,+hi@<5?dP\ǁS^"Obޗ/ ]? 0|ywiBSď(JA|`Hgh ugVގܸkwM <Zεtn7{Wklq/_b&k$G cO6l; (y 222+`{(%> RR  "b4 y! - bYLjn߀WTCՂ4%I)L0CԲCY IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/checkbox_unchecked@2x.png000066400000000000000000000006541424734202100336220ustar00rootroot00000000000000PNG  IHDR szzgAMA acIDATX WAN@T;ݙ^x t 2܀. @luцɗtcuљda}o8!cӜmچzi~ 3jXҜGo gEB> P-=w]YUkoY}]j'I\axy)a$`Yȣ(zi4Q E"v1pMܺ75 Ņ .S ^-H8<ӳ8s9@zpS3l.Y @N12;ҫc ([SjZM̲X,#[6&5a/G3yHwI3IENDB`checkbox_unchecked_focus.png000066400000000000000000000003771424734202100343720ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDRagAMA aIDAT8c`0v߯F30H3#" &aX@AeqlNj3@6O= C#P]%XO&@v DMf:ylLzh,x0= DP0hZp*AɓC@j@jAd 2H?ERnE/:ZoIENDB`checkbox_unchecked_focus@2x.png000066400000000000000000000007261424734202100347420ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA aIDATX c`[-my!Z3В\dKsbWt-w:<D-w[|٢ʗjHeKŵZ+Wgdt4 f<@`?0EԠ%Ev302J210 f8(Alϩm9\ Al] 6`Ѵ0jNis8lp>4uhhh"WP jѪ d3HԀѴ0av@8n K(W 65LPd&3* . '`d狻mnZ@ w_l@.+JAl$%͠ ѩ8IENDB`checkbox_unchecked_hover.png000066400000000000000000000003631424734202100343710ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDRagAMA aIDAT8c`02PR`2v,` ]g85QI0&00H2142]X @jAzzQF@ɓXV  Qepۏ??qf5ndɍX35+$~31ĺ1rǖIENDB`checkbox_unchecked_hover@2x.png000066400000000000000000000007221424734202100347420ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA aIDATX 헱K@_j0Č UqNn'qrqMpqrp H&PCI+(M^;ŦE%wN:$1.Q >,+*@[{$^.)7MǚERBxAyI)j2߼蝓"S D}T̄3`0 L&I%b:-iowʸl" m9=5K]#6qȟ=T5=xp{DN|' LJ I ʋ1%|i61tF, O*8ؒœ\+nAE{ /K/wyz3IENDB`checkbox_unchecked_insensitive.png000066400000000000000000000003321424734202100356020ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDRagAMA aIDAT8c`0 H1??G ~b xBtt4ˍԀ- G@`AjAz@a^:4" r@= qN4 L:ZH2%IAuYOp@`IENDB`checkbox_unchecked_insensitive@2x.png000066400000000000000000000006151424734202100361600ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA aDIDATX WK 0LQFgw9z܋{ŕ"XgB,/F֘L|Q߇~( MZ@qօ$s @@W. =L\_8!VX'I2 p* iἸ1ɩ]`XEݳԈC֗5WiO' 0]zGYp4YEQTG,T~ޔad?βlV'"s~"'jN& 1SQ?P IENDB`checkbox_unchecked_press.png000066400000000000000000000005751424734202100344070ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDRagAMA a4IDAT8RAR0 ||ϡ9wz26hFҮi߽}5{W|(c;30X/j"&10 `дw(@zD#f^!76i lc7*@ROۦv@sFZ_4q5QnTt8<3s󧐔5-tm*G"𶁀7R(j@pXDU/O6Еx8~|x5)A*[`⡥(p̑dؙ%/y+ nf ]oqX#(AQGC~@oƙjo;PFm 6 qkyqGJXmMyy 7YD>94_o.(G>>hnmT'<O)bc8|WSx9֦U"MNUZ1 *?bb݀tb8S߁\gm 43_Ƕջ8"|WEí;Ht~_ I*HX ba[G)Z#HZ_'ښHp"l^:NҠԄB"]yD2G6Jp0Q0#&7f4&z22|"'@r!O=6<+gVn9B2?yد`aN΅1YbvMߺgw2[k5& |ubt$)+YlXn!r ^1gYx7FB9Cznn+AreSis!Y5 pEёΘe `#j+48kΘO\A0V) [%in$).\bo#U C+j'?Leɤ'gIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_checked@2x.png000066400000000000000000000017331424734202100325660ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WKAޘJ4JD ^b9K7k{^o-^PHJ R-BI "-3m2ԃ3e] (ס߃ڍzUU4OUnz<6S"ý (tP?F#`Aa:>|h4lG B^O}]4 W0~ 6>\^^222R+p*NlhhhD1p Mcggr78 ;X"dgsIl||i'IlO<$WAFv~~~mR:ԕ2ض-%vmu< l`x5&60a ǣ?J8;+Պm&'''ڍL./-X 5x9 \In l{+ .+L&_McRFJ lT}Π'!uzzy=:B81͛e~0hl6qxxd C?鯝gmM9qq1{(81 b/}'727X]]j.\uVF{Ʉ)+ C pv 3&BǬ&^8sU6ĔyaMrZsG/bRAaZN]FsO5 z3cB㲀ȹI ]]1 aIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_checked_focus.png000066400000000000000000000006631424734202100334140ustar00rootroot00000000000000PNG  IHDRagAMA ajIDAT8c`0_%r*P;@8z3~FփbߎǷZyܛ żJfaL\LY#f4,LX(P@ ɁԀ 9W~(L 4ĚSŨ]&"AΆi644d=}t՝;w΁0 g̚5THH(QAlDʰ) )bPf]PT xF#AɁ FFP<u{n_0 Ƀl0exلN@j@.)$')2l5/IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_checked_focus@2x.png000066400000000000000000000021121424734202100337550ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX W]HTAs׻4EJ5!*H )@ɟL0(ا(I0H4!Bb0Q[]r{;ͷ6w,|3|3\pUIB" *a@f@gDJD/w&NR&tW2B+C_'$Ei$;edǩς$b3sw3=xY'<3tL%T  J} wmLIͼ,Dt WH}Vv]j^KTU7_kn`'RX!nF$Lx̊D\Q24-o"7Wj*npCtm:ˬC>`ߜpl\+X[ 7ǵut6 gxjX}s-V'2Y5`k|LDᩍ]=h>/,G8Wq(#l$Q1 PLh1/HU0Wc b!G9c{\aU6Z $cuֵ(L,gʈ,$Я# Q5pA|$#jlnu?Ԑ GIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_checked_hover.png000066400000000000000000000010761424734202100334170ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8S=H[QˋşhI@CşLV08*8M":t֥&.7]ZhI,TAQS$O6{7Q{9s9Onn(,7Mf:`T\\W}_wc!2+yn V{-A1O@؜_Ɯ}eB+Է}" ~n~L aH3۷*m`lDDr$ˠxWoVwcZn Y’#Y-L:E_c~#^/'``|ssYw| #ǘ'|R}T 9Q>Ygi2مqT|u ??<:Y&1I\zd_ԐA"iIQm7`'{gr-_qae0ǹ,@9P ;N ,JXCWLI,l j? ٲSq,o]pt"ү[dIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_checked_hover@2x.png000066400000000000000000000024751424734202100337750ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX W]hU~4mβHMċNPAa Uqwc(tT!wzVAz!Q\B\if]m.Lq|sr5IZ|cVGs_tF;=mB\DL{4a#X = FK A{9Α~'57Ua_bSᒊ'_Nީa bb\XenPu.s  wĶV9^JaC#Ehb=‹Еjsq[,sj$;}p|aU.>~ { QYBV\q[G{߼t^owd5FTZ D^G`JyN2Sa_6~lrSL 藊jffQ[M.ryk\,x'3 o7jk ׊qFcYF|Ul.^|XPm"'Vk5؎\NU wo5>FmW\DW`R-CY>պj[5mī˜lOVd'xOG__WW>~5iHL 4rS̋@=8B->:+0Rߝ@arƔiBSYv6M󡹮SN<v8~뺖`NN#.#m`pAZ|g&gLGXp=`VeěvIENDB`radio_checked_insensitive@2x.png000066400000000000000000000014761424734202100351330ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA aIDATX Wn15hRH[!ED/;čΝ $T*KJ9jpm!&7^⩷}7`6MBϨ&IX,>EP_Crxk%UP$3Bl2JFxxoSv?x/V&:`B9(WZ]t<~lĹ@(_Db>%O0naf.w;hZD̚nkݓE8 -sxpzq ըa*jNۏV')d BW!WθQC5k_7ykg_짙'5qU@\rg%(,8KΊ`þ4d IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_checked_press@2x.png000066400000000000000000000026701424734202100340030ustar00rootroot00000000000000PNG  IHDR szzgAMA aoIDATX WMh]Us^SĚ"vUTDTэ. ĕ WRpFԍPRTŠ ԶRkS6i!!$}swkNfo9?ވNdW]~ob<P/_JU2=n&)R)-LLdɏqE^ ոe't}Gy/P0`, Թ/y]찛 ZwAq&'}]zJ\345Y9Ĵ1"'Jlםϣb)%bUN6Ylac K4bIJy":]vvgAX. LIrL3xnY˜|GI@&Lm´R1S7rb4Ln Z@[ـ`r,cYd#[VܺwY}b mt)Je[sp)ZJxw=AS=[D^,2ХrzFd70-%C9-ߛ[_.y&6"4MDO` y*pxh4 J@kahm'!ÉEh[6Kުs!yܰP,O/5kƦН {Z!V'۳\M ؔ"-aN5Mq1W ]!0_G[0&Hm?b̬n.~_8v29U[׮! )Uk2Bd7g,Xm=9#6D-ʥ(@*_/f09zVdVgCTWn1=A hږ 005á00ô4 Ib،û Au#m"⮷uoK| ϼ[BF>3 ?<}͐űPӺK`%(npPx1Zb,@sSxD꥟FbӜ+TGB`FB(.ǩ>!t*u^?{ru_EH!Z1Sh߅ nO]t,-Riu5ܹp.&bAV5O{e畎f.(B%83مFu\߰mKNbn *\rvvԫ/>x'/b@6Ė<̜,#|V5J[ -0B:M̧E@Gw }=cEAmtRtskgGϗ&p112{6m~j+4}6oxM[Ǧ 2!p܊ CxyYIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_mixed.png000066400000000000000000000005351424734202100317330ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`0?PL偘*H?Kb` f)Ǐ._ŋTDFF0{h38 iO9st 00HjB?@O3@Z `/9&@g ]A#wr LgZPejA3`Jj1ĂMɹs^xQcmm=Y AHgg&P#䱉 Z ^%` L@j :JH'e@N̄ r8㫡5 IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_mixed@2x.png000066400000000000000000000014761424734202100323120ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WAkAލ -b4z ҃D{oО,C R 5j-3˨k6!ơ}Դt'\.`C ~ v-pK;B@|? cd!A-`0l6v}h4^Wd2T*u G{"7Fp9_ZoBa08P kZ8N?CL!u0Kp~7drt:?ʺdr^!אV$6mc9Z":Ͷ:2|Z}Cy` W- }Kc8W=VD {s|F=:ë #' *v.m  w᜘ I`߮rmWVvb 0jljcLZ k'j]*ls'*QXLa\\qER:Uu\!#9`;63#[љ; "Ӕ\)ꃩ6 Gg,&ح) tc1_:so6YZ+m4 OkV2,&v9ZQ $c]QnT!,-e$A݈A?&* Af>_x[[ubL~IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_mixed_focus.png000066400000000000000000000010661424734202100331320ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`0bӯ_F_ `yF6_ฅU9?/[} ūxwAp~0E_`@sxz&6NF66KA@pt\ۻ{ג%@E\BJ#ك@j@U_k3@j@jV 'v/> 9'>_s $@ 5Q-`ϝ;|ݧѣ0wY _p{dI~722R p;&K00z#VX!j01片 cQ"RR ҃":_v(%aH H-L3 lm ,d6RnoS@jjS?`qff FFFs/sl$V΍@Ew/E_!&)+CIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_mixed_focus@2x.png000066400000000000000000000023671424734202100335110ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX W]lUwfwf.iSjRh F*>HH!lC61$T1+ Ƥ>ISJ $ -߅X~t?%[ܝ\ϙr%1$ι|s;K]\ IGH[DHFFx*pwu#d9a,6R4%o7L,H,_UVBi#cLDJ$c1#DNF՘T$oOY <ޭ1|TS&N޹qN^>\ږisܒQv"GErW'%t L 8{pP{`tpqaSGcyT1(Yz5BK}D'(RVҎDd[hK'cfX>j,^ԱTpƺ&b`!>O ?߻ZG$K[P 8D''͘hJ`"v$^-8׀7wH昰%b.kE͒Et3!]ĺ8I@cz4FB|4' ~B\ &xKEub\E?<-cNz$ 7E붶"}-XӴ;s+Pu_ @ l|2ľ @#G|r7+ޞʽTRe<9RR`Yhh]˗ .!o |Fkk L940s4gMm9b:4缴U#11 K2S< "!4b`=xwͅ-;NT+WR2`+.~ydB8 _G9u:vß؏ѭW~u r5QLRj@Z(7Bwя3[Fhc ? g]$WI%Y 3+ہ*:8`1gDn;LIq?:4`wE4xd 盧8[׋}z'Թap ./BS*ɈP!YvTZA HFfygKT!#BŢC +%#XyL,U$Wf*B K9d(*p o|rA dkV{rH2Z2"IQ"s5ӯHk1"qv hG`:anMVh'GFܷ D2Ec)T}J Ⱥ C OIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_mixed_hover@2x.png000066400000000000000000000022231424734202100335040ustar00rootroot00000000000000PNG  IHDR szzgAMA aJIDATX WMhcU=/i4Lmb2:NAQtƝTA ;7t7 ,E\t%8t43t: ?L̽F}76Q).cin+WjY28F'Na$A47F,n%Eeu[[(8ΕPwƆ<<13ܓSF#} ?IDMGQ{߼=FWw%'H=8Fb">$"7Ov;(n\.k?L.0 Xah" t(uhv~ACcOY{Ռw\3pZs 䆉?0űͬvӆuͷ K2 =0{9:j6a KղM2et;jnt/Oaffᡱ3dIxH^pe[\⤅{w1`x VuŎ wnqW3-lZ"X3'm i}18zTiծж4#TļeBxkI!a;.SMƠor Ux~rpYp+@5%ӬdB_&,a!.qҬY=J&bvmf/lqKȶ4zl[7s>v "͊ 8l{ąYD9j5 TKɆ#Z"~&@P`NtCV3a&C@S$/\oo\G("RZO<$5-ךfyY3{ATs"TY|_zO>xǾ?DBNr'BxLDyk$ x$lW bk\79n /}E%kV'& :aqLbq5-o~v}[wQ8,@Nޝ >DHʢKF\"0:IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_mixed_insensitive.png000066400000000000000000000005101424734202100343440ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8S@ Z02&|%CǏP)@GcgBMpc| jh♟繆jE <@u1Cg<븮CȎ ?DC>TQ;r)D,r HFILJЧH,9hsmyTX͠mޟĒCvf8^J)eΘeqc>4W+ GZk DzHrM@䧟8&Rw hIENDB`radio_mixed_insensitive@2x.png000066400000000000000000000013471424734202100346500ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA aIDATX WA1˶vw[a)\*EzT<%=^œE/`Ѳt;,MBf 3:x>d&|Bw:aVŏp_31˅(@R!CJ+@y/t:d2ᛋZvl6/jkq.W4? W Rt XgU7iv6 mM-||~KK K?i"kYnTT6:2 m"l6+ O5F=j~KNPbĆØޞ[Mp8 'OMN\beb4+d0 [r.0 [r :f!6:g'u:v=crGR?n9Xt#-)"؆}AChb\\+b #1 %9lL6b[J.mT0Su]OՀ1UmP'Q^<7iXvbSl0B?q =YK ua)8ߕ *"Fր&"2 0Dτ%lY }IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_mixed_press.png000066400000000000000000000010411424734202100331400ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8R=OTA=36nAH06|X #-\k5;DMtl@ :caavf8gfg٬νs9޷o\f^s+h:g::PDTg-pɌpIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_mixed_press@2x.png000066400000000000000000000026041424734202100335200ustar00rootroot00000000000000PNG  IHDR szzgAMA a;IDATX WMhU>w~^SVkE+.F VFwvw.*EP"EAp*ET Ň"$)67;sϼ=p{ϹLD!?dwμ|$t]=uWk)m9wr9 L dB=}rU5ovL{/O!C`g(c7ʾ_q|Mr߶ғS&5Ylo|Ȝ|RX?Z>{}} 2r)?K&Yl#.9 p@.mH宵`t"y `XL`Z$CM<21wړ51JL譕%W)`y$$Zlc1f7ڳ- +n+yޡ͂fm:t"/kyV_j}tPe+; ~9.j -!TCd:"|{!4MWo.?y+P+ ĺ(nPA.z_pYFa94Z^iJ[*C3c:ÍKƌ[c~]1FD{( Ok":(FS!Ȍgfx2Uk97Nf5,Q@1} 4j M"?ALʙ"*?N#(8D22E"-\k3d)g³Iᣅ؀Z!Wpm'hl_?—2d<ģ"̠7sxd>(;Cɝ=4v;1R' cYk"& G\be,b1m39|xrc|D0'` pĥ b=8zȪ7ǧRT" .`z:ǧ <@(nxԸˍTZ^N@p~1g!ngNdY]sgq 5L@Ȝ\9ybLE'sFwNd髷ڣoWv%`'sG9kxSDk_xgYXrPО1YWwmG<~ˎLt@+MPi2m {-\7X:C~Sa/ٸK8luRκˋ'{?›O_3&ƫ9Y2hRfz7dg\:64u Nbi'"1O{NIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_unchecked.png000066400000000000000000000005521424734202100325550ustar00rootroot00000000000000PNG  IHDRagAMA a!IDAT8J@`Փw"!o!@»_x@l6:?̎FGm{``ik C]EQyA`(:B*t %7Miw,{SP2쭨DT #sO0 _UUU QOvOq#eY⹑\U=*$I20-WV/hnYnV?H]t?QvDcǤQ3^cu$IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_unchecked@2x.png000066400000000000000000000015551424734202100331330ustar00rootroot00000000000000PNG  IHDR szzgAMA a$IDATX WMKQZ4Ѧ.%Bh@\tS.1JU0jlbibKczfI&w͝y}w$鮋j5;OBǠ`3b)¶%mcfBK?@ PZ-D"qN+XZe‚<777 p\Vu!h D+o&?M Be8lmm}^[[;)J ySaD18 fL o1adiiigoojЬ݋FFFF1DULefI\#_8;X,l΁ID$ ^ҿ5_^^ԫsb# pO҇&ްgccc5MT*/x5іuGt[v B'#(q>l8:::s9D=l 0J@0"zR2v7n1J:w@dss6%0@K&ud1WKzQon4A ))Bfp ك?Ƥ~ 1Y+C[[d&+d*[(b-WD"OET h/^UlX Sh[XO59׼J{b0&OcCh N[1O>; eA"j&8b@= qx<縜|,BDTC,X6Mw;W" Pƥ2\%A "Y0sH?wA>TaIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkbox/radio_unchecked_focus.png000066400000000000000000000007171424734202100337570ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`0_%r@ d2eϰQ@d=(߹~|;ީUwϽƩle9B$dClf?  Ha*txfX쟗;[zL 4ĆSٰC]&O?~ ! w-ȻJ@| > $@ ~*`B }3o񥷀bnMரS:&YFC.H=&faj4`>n&vn{`"d(A *gĜ̩h<!*-Ǭ9 'R#,IcO4 5Y/ +3$)ҸYIENDB`radio_unchecked_focus@2x.png000066400000000000000000000020371424734202100342470ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA aIDATX WkHTAȷYDU&TPB?ATPԏ" J4T0J(BͲ(r]MW՝ιښ[h`9w3\BBDzeBFF)qX6hD6J rw㌱roJ6nYD#%cW);Ur{U" XmKN"̖ uP\@TАO[a / [a=m%#o>uxਦqB|1b^`M),(EHQ@[ 3_PX]wө7n69zsD4& DL/{;c S\ h̬Ϧ6(>2{8?su2y1iG |lv\It^).IuF7kquϵC<=;gmJ \^,@`;\IĆR/p gFDxwΉFD N\%&˼eܹR8 ֢gZL_sLHDXq~[lb B܌:i.l.;![¡4ORN"`Z꫐ڴ<$%ŧ$Ꚗs(ُBd_pr:k6ΞɝIENDB`radio_unchecked_hover_dark.png000066400000000000000000000010301424734202100346720ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDRagAMA aIDAT8KKaKČhb+R/ EK]Min RF ]Fj2~g<9gy,?Uy) eMEF"4~>py= GPZCZ&4K@`Nma+7\?mU7OncO,¥ ֦ɨ-ţJGI,B $;bCy4zRk{~'"9\X?hz:s9 >7kO>k^șMZݚ o)G:T<ѯ:F 7d!SMqΨz2˳=B A=E 1Ad6D9|({b IvMZ[,Rivml{.mm B=E&4ذ<\< _aeiVtoNL@!se+J4~͈lL/b/FC%"4fȌh C6#a<1@K8FDj`wf:E2fa|$6plGM[@gx?8SĽxveض %A7N}xmlOkx+|q|u2&|'K,!:xry Ǻ*Ź$NN>pj˼ây1ȫδ4C(ioܸ0!ɬ[Rb&*Omjjv=9DJL)J,{t.-Ωk].E$@+tdo.|'>Pk~LE[-/:sEgnnEEi4>UL 4vCRFwUpϋ=yO\rpywmk8RqXvM&I FQvS4?jCYw,,\Zg7] $q\8ZBwjI Nlc@tDNDVslsL~FbLI](:oAwO O}|[ktcbL}UdQ݂/EE;8um`?y-~-0"g HFDZų?~K,TW/8G@PLGi!A))CMAป Ji[ ~J?憟| QXFX{~vZyt1?tpMB$D`R;XNi<|C\\G{$({ׂE`K#ƒobH@͛.IK 360gn[ ̥j'T|_ hvH ɺ;_?Ss6 u9IENDB`radio_unchecked_insensitive@2x.png000066400000000000000000000013001424734202100354600ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA awIDATX A@e-uAx)؋x7W?IAh)3d I&ɼ̼Qn1}?4+q/߉R)i 'ADYV[TBȃxY\rc6Ee:j]ufYA\s_,_:G_(<ZV0R>%\qw $GN@*{I/@r$DBN,!D$ʅ32$0 $љ;:u*e*tW:9dbUT0TN̾Mr4QvqPZXESLɏ͢8C R%(~,s`eLU42;9CrBgU!`E[Uf{)5YBó=E< Ӣ̦L>DUfP$I8l{s}֘_|*/Et'q=ovA;kk283uv@jo6vI:çd579l-Ǿs<~&X,XNqvL y^nwh>%m* LFBfYlRC߬ѱaRՔ_.~1FnEx->oK1Bs"O ?\VIENDB`radio_unchecked_press_dark@2x.png000066400000000000000000000026321424734202100352660ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/checkboxPNG  IHDR szzgAMA aQIDATX WMhU>wfkbhB41e AW.\ nܴ]tEpcɦ]QWH S+BĘ[mkZ5i23;sϼDSns9̫uy'2V yxs2~62y񰻈~#7R?˖^FAAl7˗Mnho,"O3 &ԤucIz>~<䮙9s-rW[2Us,&5Of#oY{ɹMN\x՝da]Wdr#%ı:8]* >R7ȗFSjliPh4ae4bLb`|= u)o<.jHQ1"^J\ZP@  x2P ݗ3uN@) t)TEBfJ pyhdI&C`5!, z1&A^ڐEȯ$m|$$+Lj"#T[MA6{S!DmBŗH7IIK[I@8xR ]Y? XL1 |X6D,a˳ zy-I$Z9~E4;n $[`}r@j'(Z xVUf_"mǏ\0Quc:.q/tN{ "$1a5Ww~_2Ov"R3Wƶ{'&Cx8䧩ߏ^g$7FSN : C:#Qy=RCrXpӧFy01sܾ}Wt-w>t_ݎcD`VLODxdl2;XO]~`b51J=I!=c8Cg{z<#i2?\>xAҩEXB LAEp }`ϣ1fιADn[6YL'&CM΍%#ɉV!e}ȳ3.KhhVi@T:, XO8'y+ql#IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/header_arrow_down.png000066400000000000000000000002561424734202100313520ustar00rootroot00000000000000PNG  IHDR Vu\gAMA aeIDAT(c`FK 1L /(&eʁa @|ܹsK@|@iK5"+a MP`d " 0NIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/header_arrow_up.png000066400000000000000000000002721424734202100310250ustar00rootroot00000000000000PNG  IHDR Vu\gAMA aqIDAT(c`(y]RRR?~ Y bFF$ ҈ hRs- R $))yŋ7A61cbb dĠLx4 &OIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/slider/000077500000000000000000000000001424734202100264325ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/slider/slider_handle_focus.svg000077500000000000000000000050401424734202100331510ustar00rootroot00000000000000 slider_handle_focus Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/slider/slider_handle_insensitive.svg000077500000000000000000000040721424734202100343760ustar00rootroot00000000000000 slider_handle_insensitive Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/slider/slider_handle_normal.svg000077500000000000000000000051701424734202100333260ustar00rootroot00000000000000 slider_handle_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/slider/slider_handle_press.svg000077500000000000000000000052001424734202100331640ustar00rootroot00000000000000 slider_handle_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/slider/slider_point_handle.png000066400000000000000000000011001424734202100331360ustar00rootroot00000000000000PNG  IHDRw=sRGBIDATH Un0LB}qG~jտ|IC 8V%?H[tx#DZC8t:Yg8[_,/|kr(6ۂFd2yIY'rk( r'0րf S:I c0HƜ<% ur6$n 7@V.}{R̛Oa㡐1 0Nd؞ U+rHde^%:R78+Yp轵"3cWA8] DkFyGEq j1?hl+Q3't:f$$Jպ_Vz^4;֨>4~hCoRW=brL`nlAr4{'FamSvvAp\U8e+يg:vȫ@!`riH])M(~4B,QtG44N5B"-zXv~*ϵט'y>0Ti` IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/slider/slider_point_handle@2x.png000066400000000000000000000027541424734202100335300ustar00rootroot00000000000000PNG  IHDR00WsRGBIDAThMO$UQ0 G1~`W`E5jb&nNLL@cFQ$& cnߧR].$ssǽoݪ.w w(EISSUI -"1SLK9_&'w^V/%1Mr9.;32E_\\J%MgwXlW4@.rɝJ= ;0888[9EmEV |RDZ$ĘɺvYŹnڧӀW"߸, @fꌅǣ(͇ji.̒֓>HXCNrS?۰5e[bcoOSj&gy>rmJkXdA#C݋'a +-‚lC#2YO٧,@\'h85x"T +ƫoO'縹&p]f.h@|=Z16u% CzXhhЖ_IYI v\$w*JR iyqENO 4<ys|K݁,i~Dl%X'œ'a&Id38 :9Rqϼ]`[*AS8?$x;tQ`2 TL|4 t~/?87t;/o(j :#((1a@"fQKJ[[[J!D:A(NJ5t\Us+Oo_dN75|.QQy2PjBiii (Q@ 1U.KnZjwTVd'V..+3>R{h\ Es)xH\9IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/slider/slider_point_handle_focus.png000066400000000000000000000011371424734202100343470ustar00rootroot00000000000000PNG  IHDRw=sRGBIDATH c`1`D7?t51?8<6>3# 5W1¦.gG/_|O4pp1Wxf,_Lh1sb`)JcX@Yീf}@4Z@(0AP^t ֕}t = 1 yF.rmoٔc?oAz@zt A*mVoRr Ak}cBVDlXkn^ E0D -rsý?pYzK\prQ'?TJaAD Kش缘3@ ^ % 0ɸ' .z{?aAwSpH 9h]*.F+YJqbAC@jX53|=zD9P7bb?:E1\Ԉpb jyW@AAӠ}IENDB`slider_point_handle_focus@2x.png000066400000000000000000000026261424734202100346460ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/sliderPNG  IHDR00WsRGBPIDATh[LUA#AbTM}1ꋩ414M\J-j4jńjl!*PӪڂPiar].;s{;gvg/9aw]K[n׽oѷ &hLkmq`zzZCJT+nPqQP7e=4UT)Ă_}36fMel'4:LEC/T 95<(;pMx0 _zscf&ؖ0 ֤o+z^?tĢ. -W"Q h9S sQ]^9 _SG[?S%p>}f@iCG3TQjY&J1ÈW^S{t%@Ehd_zKbQ%-7hUe^R=aCgJV ƤuX}MP}~-I` Dz+̙;9:J'XFU>NT& aX~Ґ1=&!&deӾϫd6:_2 ȖzoѽL5wGi? /ƃN* `R ;Y/¾7NGkEWۧ-d:t5/x)^L$BKU}ޏ:BiJi* ,C#B~ _0X0NS_q1 ')vJZWc = EX71J8pr;L&g'WvnJ6iL, p]Ȅ*a.'T;P~5S N,\wW^X2pL"Ŗb7z#7J*ltqnD 8[L#fBBL:k/Actd)' į*///OL#i&mæG֞rDnSI2[)fI)<׀86ԧ[gV2 zߘ8 3#{79`dJZ\$dRtDǨfv׻˨ ~FTVMP8Hv +~&^oxFh8G8~GHF u;&$rJ#Q$NMOME< UdAKnx`IENDB`slider_point_handle_insensitive@2x.png000066400000000000000000000023771424734202100360720ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/sliderPNG  IHDR00WsRGBIDAThKOVH)Hl6iK UB(iX A|!EjO M.i%"a a<>t6s;Rhʐۖg񵤹#ǠD#KIA}X`ޑRX,[GgwUQE. @ @dA]|J'''?vttEo\.wvv>iR4o&)PsA0wRlN40' kZ|˔d$-TWh4 V݊ ,ה25YSe.- =],aKQ'uZ0mc¥r+;C B귁;<<<?]]]PNI-x󦦦^V*+]Ug^ quq]P9ȅ.箪?-.ƫhZa]th@A.rJ#wc<. Cq EW`Q{?88x%WTsfff9J%\gszzz9#Wb߲ / qkK|o"݁4VBz*5 R|$QwJWSxlP;+?o~~~"18vwuD:IOpddk-*)Q9V_p|&h<+DJ?:^f'9u[_RO`:0]xx*mmm=xdVss,M-6 \7BCz=,6Je:4~V Ihᩴ|%q=6BRGŹŎդ7_Q ȻGGGN( ALΓ") RI5rlݠߓDXqu^C$hISo{ GՓOoF(3_MlR;Ւ "`IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/slider/slider_point_handle_press.png000066400000000000000000000013361424734202100343650ustar00rootroot00000000000000PNG  IHDRw=sRGBIDATH UkAٺ1%Eǥ^,/  QiXfQШm h06АԦc|AГl1o†\T?a0@Hܯ"qB}857cl^=w; Ap ¢F]ɰ^mH3hxԗeqy̕ҁx\($0R]V: ٠>; lQB]NfR4]~X WWM̼O3W>dx1W9ȕ$Q`Q{yF(g WXF ϗp, csi ޲Y bb9љsȵB6@55a`T%baiFxamb reّl e@1712"YΗjr|(?8;&xxqe!ѺQq5e|a7c{QT=μ dD,/&=u[gGT?D"Iep6:ݣ^ ~4(pAP`Š$R2QuT.Jd4*}+@UJ {۝m8ϽvzEѫM. :{"(/ ES!6S:㽸NejIENDB`slider_point_handle_press@2x.png000066400000000000000000000033521424734202100346600ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semidark/sliderPNG  IHDR00WsRGBIDAThY[lU>gʶt[*7E71BLC1R@'@LaA PVE 1**@ {n{sRhwf; ?soߜelT plL2IΤk֖Q |Kޯlِf"Y%%{.= [\"ѬPyƵ)A{VvA~|no+KR˥_#GS2i+z[H1|.oxɻ%;ۦ'2q9,95~M XZ1:mڔ |1@&`UM%鍋b"xNl@zeUTYо4]y`+Qʗ:~V X!1X%psb4gsn=5t0gsn=5t0gsnm-ckPi2zꂕ5+kL܂ l|L@$`rfJaƼ$f_&S|8L+㫙p&!["kC3a}NR\/4}c1X&@QtnHvEXdqPmow-ɟ%O.jw%.%8+,pV~ tŠ幗4zg ki%f̎wMzGsatӿ y1jYa)ELhZ=m?-U xHTQ[e/ULɚT3(hD[בn.E!1%Z0>%]ZAp!%QĄ2ZB\6aЪn]BHQg+* ƕSwTZ*R1'v!:AKҒ ^ j'LQI۹}ԅrjm2-ye-(k- 3r|UzEnpX%=Z @s m`>,ͨ)A6fjLtϥ-/8FsUA6`J`z-^NfC N,E¸ WLMh!AnX%\Q) ?BGd:U'*3 `XI'qBXKStI.Rc%s\\sm,P،q5Ӯo;OKx'Ң_ҺGi|sUM*5z (|HT{"#8pRamE'YSԝW;;$\8P)q畴%*=JT:%:*:r`5{@SA@FB}o_:oYD}k_gc&fIѭ<&u?kmw 1bLa`.}1qte+9ds#'PpCgkRsϒ3ϓN^C88Q<6Bk8\A HJ<)EǿgkP:J$_ (p6=w>~O-}항^]E3"ǦoXݹRMRN&"z`:*V#EupoIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/000077500000000000000000000000001424734202100253365ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/arrow-right_disabled.png000066400000000000000000000003321424734202100321360ustar00rootroot00000000000000PNG  IHDR /3gAMA aIDATc`Pf xXccc  FFk, 6ٳgeee?^ZZ0"k755U33&d &&_ ann./w3ϟ@v?\a*Ap@?IfIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/arrow-right_normal.png000066400000000000000000000003011424734202100316530ustar00rootroot00000000000000PNG  IHDR /3gAMA axIDATc`P6 n߾ Y%%%JHHs  ȹd%$@0􉑑/c066v344tD ~As*?ia4e.}IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/arrow-right_selected.png000066400000000000000000000002461424734202100321630ustar00rootroot00000000000000PNG  IHDR /3gAMA a]IDATc`hdw@"C'Q,0파k:@ܥ &?@,ro@\M Y@al 7NKIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/check_disabled.png000066400000000000000000000004171424734202100307520ustar00rootroot00000000000000PNG  IHDR  gAMA aIDATc`hnnRˆG)##* &233o={s&l&*rdbb:RRä/7OΝ;w &asOcccVO4 Lf:ׯ_5lIII [ϟ? H3?ʺ*@顋m@Xu~IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/check_normal.png000066400000000000000000000004101424734202100304640ustar00rootroot00000000000000PNG  IHDR  gAMA aIDATcf}x1022hTgddkhh p*266Vښh<ˑ#Gރw7.\Srl/_;88;H$hF>M 4̙37Q8@2ՁCΟ?Y \EGBjSaIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/check_selected.png000066400000000000000000000003151424734202100307700ustar00rootroot00000000000000PNG  IHDR  gAMA aIDATc`Ċx@Z3T _@lO2P{ .+rxX&dsE ^ @i@|y@@z1_ኁ@|q1budPBo1#a dC*t/IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/000077500000000000000000000000001424734202100271245ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/checkbox_checked.png000066400000000000000000000007371424734202100330750ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8S=kAZ\c" ",DRډ`g 1BQ^Hm ~@@46r nxKBԀfgnvُtTkͷᳰcX H~r"H۶}oX,7Aܰ0LDP6 ȡd2/Lơ ['~j%F<eá7MUgȦ}  \׍>9$01N URI Llۺp\Brf̀Cd,|^\וn+B|t:bf`@V;a7^?Pb:`Vkx,rY6>${%EnRy<x0&֠.sa0c$.& `pIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/checkbox_checked@2x.png000066400000000000000000000020311424734202100334340ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WMH[A [ 9HAo *CKK/V^ %Zb[E"z/zkl̓KE?ԟm|MjS;33GQnnBnH-t\\ssBxϳ&XV[ tƅ La1\\:)gSNNNA xT=`b6ucccyj0nJ1^o888xÎA;1==Q@l=8_ZZzl= 8[[[d,+sid]`y_\)/@ЋwdoVCs̯٘}E[Vdw@]#NhAFǽAND6n'1̨~effBn|x-.< g7˩TqpI9QH \ש!+pttDMMM!L& l6zb yZZZ9JgD0F lnnRuu2OmhbbB뉟\UD܁}Z[[S fCUPEE* )) i||Z[[  , j#6pYE~|>Njz{{ť#`IIjC\`! C j[ZZFV ПWq.Zq(// 1CnLc``@ ~‡he¬78U])o_xQ.kB Bna؅oH7MIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/checkbox_checked_focus.png000066400000000000000000000010061424734202100342620ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8S?Ha c *&5%$Hc VɈFtiqdFc E!h$I2ƹY,p0D"AbQUuL`CqhZP.A:y(Jx8-tfrARaL&PBXx"Nf T{հ;oo97 w=TQD'~Z 1g9cGXُ=6ﵹ?P)9/<v7?TIENDB`checkbox_checked_focus@2x.png000066400000000000000000000021331424734202100345570ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA aIDATX W_HQ?w̜Z(C|LM3|I=HABfjZn0D E-Aa΂!'%5YЛ!J 2ݚ:MoϽwν?8nq/777$?HY-nGt7==c߱ܜC5,%=~;^R뜰.!J)䴴;HG3A~+I+h~g%hq+{ggg'x+0XG}ڼ~$ﯞN(!T褞Fa.:L:ڗ5ͅY'r $&%s­CH@τsTΩ=-{A__[tL ?m\ ```ະҿCO.x awP[[ ĉ~cK0_Z@+@q333(چĄ3ـ<&Ų2^Orr&MMM@Y__ J ͸TRNN<66ơGFF`mmn5p: ?@8TT`0\ONN'%%UB@ @mllr%%%!XEE?l( LG⇦`7jaa!OGww7xJ%oM8H{^^/R5ޖcb>.72~/)QKӿU}@{I'_|U/I%b>mP4_oWӎvζ9OXpJ4j+NXފ6QPds3HAHrrDOd?nPdKsfXXT_ XVT~셿Kgh<IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/checkbox_checked_hover.png000066400000000000000000000011231424734202100342660ustar00rootroot00000000000000PNG  IHDRagAMA a IDAT8=hQo.w~5QD,-Zh4VZY'Fbi҈"(`?P0h''8{@q`?- +ux +K88փ9DRxr7v4ɍA͞B ?DXbq,K礧cD~*50a2OҸRPZ44[,wG̿7 ,czc7 [yK}(5/շprVzF5h~s2%_}XެE`{10f`-ȅpqQ|-Xw< ǟ8/xQlav[)KnՙMBgNL-KygOBX:sN8.wfm]J 8 >yqHg4a  Y}Ji 9j'"aV^ W)%d;W]+ :BdXbgF9IENDB`checkbox_checked_hover@2x.png000066400000000000000000000025301424734202100345640ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA aIDATX WklTUνlBi!V Vb41i4((|G#E 4O13DnдU+mR=;]F'99|͜woۈ+œZ֏jV t9/b1w&F=1(m}xz#S}^N`wD~)[2 thjwn pAJ#ꀺ2 c[hBRJIPt v~M)/|wph^-zZԸ#,+ȇW g GXԮc8DwWFζ&V(*Rv+3YIvl?䌥ujW̖g2y/Tp*Lv Xp8_0軿Wx OޭȒ@}%O;Ӷ!jry_79 %^3#)xY oeM"%I&62ЩpdМwcl",p)eIswdܤ+hQu `BdƣWu_pK08cdg("DiB۔owR4yRKl ^IyFzW.l',nPx`Z7l nXE .m2 mXYtKʫ =`ldAFUń̵)xdžk;kQ(WŰKF^6,'+ 7>qg:ykF*hQ_أ}9p^9WK lW`;M& ClZjA1'?dml' FbKg1 C9B pq>=[Im+A|Y!&)Hvd]@.7Ǔ0{`8_ 8ӧCΊ;`}Ok~$PuʙO>v31I/0@q)s}r^lSbKQ:iD܊GP/Jw4Ї$nBT =Wqqu:\Tg0cI P3pkvl?hESzDv<Na4I#B$23s0D_4 !2£G\YS]6YfIENDB`checkbox_checked_insensitive.png000066400000000000000000000007601424734202100354320ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDRagAMA aIDAT8S1kPRTn-.ƹ8:8(tA \DбH.ִ}|w{#-JQ+1FEta:Db[ I,f/ øm;:A,_`^F1L@l67`𔊼EirZ=p m& 5MA8џzE<`5z*_c>t:d2N8==`@k * HRv*BeYP,CV;s7& Z-0Mq<4 Bn6D\@ v۩+ H8O`{t]\.{ y $X,>EQ|A8f[+򆉥)`+rlB?G̾P;sQ>hIENDB`checkbox_checked_insensitive@2x.png000066400000000000000000000020261424734202100360010ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA aIDATX WKA$b[h 6xŃ7 * >N"xQQ U"#&c$MOdgvg7;;_Ңn"Hf+Yǜ gXʞAg(n0V777O&V11g2' SbSyy#~QFc@Cz)d6l6LnIIInFFA1Hɶv͍}>{]{<|,8"eb +Ų$I$vVTT<6p8^r[~Vt%%QpdMggg_Z+C@\*i=>y.D#R/..ЂV-g#000@3JƂ; @ނȱyZ[[SCw (Z3ETWWGՊDR|Ӗc"pFqq1KxŴת(SG###.6{ZҔhqttvvvĀN99X;kQcccڈߐ(xq33|xxΛ1UGCCCj"^27ٌK(5esuu%uA6QA=<gUXXYYQ}VVV B ψ/[ q )++KkXW6F9멪*?юæ&T}[ZZT=-tZ[[+crr#"tleQ"@FcR|b~L&X\c{{+(YpۭgEpt~~0m |r+;QsGnHbj _swwn,Ar L '4:LȬf82!+xʬ̩5iaC}a R3 Ő3gO>IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/checkbox_checked_press.png000066400000000000000000000011361424734202100343030ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8R=hQ޻ۃT("$B $!FAE+R$(h#"%&v$H@v7Wٙy ~zhvzOhPVEw΅Sa*Z__$ rJ\ 2Yt~=憶c}!Gާ'AߓqW<'l.6A`@Maf)bǣ@0 HXUJK_KlqL/k?7M`d<15yAūmLPT6X8r^o`$RӭqWt6+ *bV@ 3frA2Q6-6$ŒɨuыxY7[VcbzH:|44>,z+@@IENDB`checkbox_checked_press@2x.png000066400000000000000000000027371424734202100346060ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA aIDATX Wmhe޳sq0XȲ>)*3+2*,+V ѲSF*BAC"(UQ} Yf|<]>{W羯xߝ7Yu.µغ#SFVkKp@sh;Uep\ G9YmЍ9-Q:z+x_+D*gdHJ.؄m(Nc;=u]”R6]ƂڢG Éx ~~FPtc;w}w}X"_:)yFێb=R[oW,J!1gꧩi؊Pm*\&*/F7aP$B`otcd枍G"T!ݍ{NXHL0TNJT.1 ` j#t_wCz@ Vxadʹx()̓}nZ+[Zro6(-3=ΊC !0"t '+`-TXq=H߆iy ~BBƝ?Ua+; 289ppH%~kWD kqEp*Iv 1FO'o *6<7glB)Kvxזs7YY3Wu]qXs 8"FTaڮd}JG]DگVr ^Pɻjw<2]hâA-"1~>glŨbtw%KNC-?6ӁlTaBedô.^lg݉ 8Tb+ ۸cXLBkCl?ܱM[GYM`}Yh#Y XPfFӆ"k~ }CćNwKh!xL*l3'YzȟU$+_|"!ÇCcMY Cc>TI@s@d熠%/ `ݻ Z.^0ULf @] L`@g @)ZWaԄK 5X/ &jV?k!,0o.&P_Ty{L%ٹryIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/checkbox_mixed_focus.png000066400000000000000000000004241424734202100340050ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`0v߯F&33?Ll_ 5 =pWxAf = @\ qUiîj`hhWX Q?`L4 ;H<_~98R R (mgC@j@jAz@PƸf =A)hXdIENDB`checkbox_mixed_focus@2x.png000066400000000000000000000007611424734202100343040ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA aIDATX W;N@5cY h (@pЀBr 8\"44,ACnH|Nd+xgA;I*+*>@qZ}Z,iDՆDV(7z _M&qmn]HD-OZ%^d{ ]׈;o tLp7d4VIENDB`checkbox_mixed_hover@2x.png000066400000000000000000000015761424734202100343150ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA a5IDATX W1ka}{39cFP !hcMBW!A4B C9Ϡ&:oݹۻ#3;f.tq-ĵ4"ܨEXHs81=õ%"b S\ǻ0[_aUVoEaD_ ONWOFa+6J,QiVwx ,V{6N[ˈL:qĈqQzf<2NA""9r0yݔ`^5|'A"6/K0<dz_1Os7aJ>-xŸ &)7} ?Q)["Vdb}ؠhhSNS,כs%~C' HDq|\FLh8M`\j ˸+cK ?Noo8k)e-(SXf8NJ?VE:$RBhY'}qFe\8Щ1a+y|~ħg@MՌ^ /}q.}t>(_ #",ELe)?(P-m~-h6j؋^+($8O[PqL\̧f"?Κj"p{Kt tp9iw ņI YzR$L`xsSmm˹tUCO[g7ͳ:A=^MDɢ)[o`d[:fM4dX~uKJaKAJB}6͡he 2n`\ nϐ^:djkTcӞDǘRo"D4M7D7(@ݷ %4qk yib!ۚw g Zo'XPoe1FCu9NM[n <˃[^z).>WsuB#b|S PT:_YI&jמy z\X<˧ȅiQ!Z.n #P޸0nNta[ sÑz<(ХpBć=s9  zsCD`=;: _x|f@VY[%b[ ̎@zèm〮YmiDh" ɜ .4Z|@$ 񼧽 "⪡x,+hi@<5?dP\ǁS^"Obޗ/ ]? 0|ywiBSď(JA|`Hgh ugVގܸkwM <Zεtn7{Wklq/_b&k$G cO6l;%/ `ݻ Z.^0ULf @] L`@g @)ZWaԄKXFũ߿uPP$ OHӗcH H-P/(?0P-3 # ySIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/checkbox_unchecked@2x.png000066400000000000000000000006411424734202100340040ustar00rootroot00000000000000PNG  IHDR szzgAMA aXIDATX Oj@Ƨ]h).^Y!r6@ko*HV2twΞmCIENDB`checkbox_unchecked_hover@2x.png000066400000000000000000000015341424734202100351320ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA aIDATX W1kaܙh&)`6 6;`ge+iCeJP kAēC9π&fnNB#{ff.|4[n%HjH))&$)i 7ԠWI1]|&Lئ%Eݪ䰑f,j W}Pkx@mӴn3&N} **_l7뙖i26L |]/$> !Hsy>&kMy -\$3€3٠?kuNpڢ2Uc, Aq,Ud4=S2e /Ӽ1vp؀)DuF 2\0cӢ8+AEȺυ%݁Y>=/ܛfTu(11rN]8) T*g5pїذa,GPe>D*$2bxh6@ݯYֹc^@>zR/3bՌ"7P#'G34?,?_tyVs* -~G&-s '?*H<(F GK-G{ i<71TPX̷0*a6>|GMPW$'A-&t좇akh+zti h7p Ci{{/>M5X2]2wv'i5lKIENDB`checkbox_unchecked_insensitive.png000066400000000000000000000003461424734202100357750ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDRagAMA aIDAT8c`0B3ii b.P-? .; 5 = 0$A ]s ACՂ 38G ``N<f_@ĽteY&qFoUU22ip"D 9wx8~|x5)A*[`⡥(p̑dؙ%/y+ nf ]oqX#(AQGC~@oƙjo;PFm 6 qkyqGJXmMyy 7YD>94_o.(G>>hnmT'<O)bc8|WSx9֦U"MNUZ1 *?bb݀tb8S߁\gm 43_Ƕջ8"|WEí;Ht~_ I*HX ba[G)Z#HZ_'ښHp"l^:NҠԄB"]yD2G6Jp0Q0#&7f4&z22|"'@r!O=6<+gVn9B2?yد`aN΅1YbvMߺgw2[k5ﭭ-zbx7s31cgMmכ.J{ޟs l_ r"KX,[|lPvwvv/mN7Nfm ؖ-/2G`(Xn_.J`){1h -MOORP D"cΌLm]Đ1DyVSN4lU*95$0eYշ~ YQ4+psnkcR):& +@JlU[ؘ}[Ăp*@*l% ۫ VNllL/qAHR2XUye4^5K)bA%[~}}hpV6LhRPsnE1K@V/}}2$d#MmMĂvnBcx fffhuujQӡ) H$(Ll\.v|kx-ҵ_FGL6s\aLX6S?ZFLrqormkF$ "M+}ZʟV jt0_bXʣ6M.FvL\iT-52IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_checked_focus.png000066400000000000000000000006151424734202100335770ustar00rootroot00000000000000PNG  IHDRagAMA aDIDAT8S-O@8 A9j8U G%A N)(ץo4]H:N߾ۙ [pgVYqLxЋ!,/GUcFCEzc6imlwT '0ʛIj9{x8SG`p-ۉ>'8B&_S j) Cr]r`pL({LTq$]e |b1+s*$y1xEDyZŘ[6MQ異>* =BQA6RV py &/Ozr8IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_checked_focus@2x.png000066400000000000000000000017241424734202100341530ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WKTAFJDIԋX զd7 O)V AB_R`Z>D;VϰWgk >ԁe9w~u,c,1*Kna!k%ԢP|w7Qq#h))ŲJQ98gkhU*uhzwረkف=U`+Kg ~*{JK\m'֑Rfи/o]iB8=Vfp^;o+?}Uy.فDdq=xAp\,Uuen,&)ƹϹ赑0, qW̜%7F=W y%oyn1.X\Ɛi{eۙtÌ!jā\ }\,`bb$LPq՞)ilhhMMM`l544\Q/.P2+ 2 qm1V+8A,ɠA l !/v|3ap!C@#(#idxx& JD6_`>CD6#zUϭ?* 92W?:s5s}tIZO) b.vb9gwnG%^9J4&^^)r07ɮY=Μզ|biNaxK.MTBZ^![A H47)c' +T7G>C,jܡqw+ulDk /_}[y& ү#ݭM#D#AE;ZE%N2oONHIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_checked_hover@2x.png000066400000000000000000000027511424734202100341600ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX VKlUt)tBcy15DlxMM,PDݸbA  FcZ`1,0&"-% G->}f:uʓ=u{u5oexan 6G ͷRWFqa|&YHa~@QgaS)t[5܊WӨAJr`iEE`nsrd`p̢A`dќ^lmF_>" |Wo>Nr@b{C?p)gśؼ~Ensi JT2Z2P)J/S[`$E"'e:܃iR?8b `BN6&۾B5 Kve;Q#ϟXjr e".Ekk-gr L"Coccl㜨ņ:.,0/~rWKiv )ǁvM Ӷ0ҟl2'Ij a'/czB朸t]D63;eRޅG ZL5'0 XVgIV;p:#&J]$1o"?]B(հBLiK V8NpqTÑxDzݡ|ԌMxc4eLLmN1 N"Lr_nEǻdSؿ幇z< h$Is׼$+5홤F< H-ϑH5,C7M".)O3IENDB`radio_checked_insensitive.png000066400000000000000000000007231424734202100347410ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDRagAMA aIDAT8Sj`hEJ34]Rtsķ7gWW /G(hPD7R=8E?Ja*ɮI_H!&M2f~8>0ωw+ d2)O$Nj:[,a+\ m_/bn'WP{9'A R.xܳ\._Dip#iۢx:z1: ^RzD"fxx8}xxx\*`X.S0(O1rez\0Bd7P bɽh!Emvvv|hhhLNNiر(YS )7jznLRj+Y__7$"Yx)O?{os8 λ |RCV,ʬ0zAڃ\smłP  Sqo+kK:Yp~ʷ?_@24lNUX熮Sqo+E}pAbNE?0N! #]QW®bfS5 t_vvA9e пPq"ǰ4}O@竫}^U,@B_e՞qN`vvlһ}ZWʮdkLty tMRIIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_checked_press.png000066400000000000000000000011061424734202100336100ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8R1KA}3KN4"Ę$$.PIڥ$),- hZ l 1A XXewfvgw7s2MOjSx,_\/``bG'ӈE++9Ye5ӷ[(u VEܝ_svN)NPY!70q)6!#PϞb@LF 8Ȗ;qaƨbe&?ƀ81q\,6Ltdvi>$3Bl2JFxxoSv?x/V&:`B9(WZ]t<~lĹ@(_Db>%O0naf.w;hZD̚nkݓE8 -sxpzq ըa*jNۏV')d BW!WθQC5k_7ykg_짙'5qU@\rg%(,8KΊ`þ4d IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_checked_press@2x.png000066400000000000000000000026701424734202100341710ustar00rootroot00000000000000PNG  IHDR szzgAMA aoIDATX WMh]Us^SĚ"vUTDTэ. ĕ WRpFԍPRTŠ ԶRkS6i!!$}swkNfo9?ވNdW]~ob<P/_JU2=n&)R)-LLdɏqE^ ոe't}Gy/P0`, Թ/y]찛 ZwAq&'}]zJ\345Y9Ĵ1"'Jlםϣb)%bUN6Ylac K4bIJy":]vvgAX. LIrL3xnY˜|GI@&Lm´R1S7rb4Ln Z@[ـ`r,cYd#[VܺwY}b mt)Je[sp)ZJxw=AS=[D^,2ХrzFd70-%C9-ߛ[_.y&6"4MDO` y*pxh4 J@kahm'!ÉEh[6Kުs!yܰP,O/5kƦН {Z!V'۳\M ؔ"-aN5Mq1W ]!0_G[0&Hm?b̬n.~_8v29U[׮! )Uk2Bd7g,Xm=9#6D-ʥ(@*_/f09zVdVgCTWn1=A hږ 005á00ô4 Ib،û Au#m"⮷uoK| ϼ[BF>3 ?<}͐űPӺK`%(npPx1Zb,@sSxD꥟FbӜ+TGB`FB(.ǩ>!t*u^?{ru_EH!Z1Sh߅ nO]t,-Riu5ܹp.&bAV5O{e畎f.(B%83مFu\߰mKNbn *\rvvԫ/>x'/b@6Ė<̜,#|V5J[ -0B:M̧E@Gw }=cEAmtRtskgGϗ&p112{6m~j+4}6oxM[Ǧ 2!p܊ CxyYIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_mixed.png000066400000000000000000000004431424734202100321170ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8c`0bbu ʿ7aSܹsǏA+Pj|8H i RR =pr"L!Gn #OBa @= @ȨBIZp @`hhWXCn̝;HPG#$)FRRfDA!;3!CmsWtCIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_mixed@2x.png000066400000000000000000000013341424734202100324710ustar00rootroot00000000000000PNG  IHDR szzgAMA aIDATX WAC [XK$7\a %W@e ʿ䢕9@.zhb(\w|޷/0x U@!~),h;`{  q=r$* JrT*dGTgt:vhd;l~aSs0`r9}us ǒx 8@ cjc]_Uqjo~q?Fr ]~m25u¥&d2uLj\FM"kپgr'~In(X7*ɰ nE 3͹E!NN[ϯ5 n@"x<籺cNsF~303Aj@jAz@0Aζ` pZ ?҄.R d@Z`花j1v.CCCb teʟ.PhZ?/LxFR JXp@) HʰRR ҃"OnB8)r p$I JFcIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_mixed_focus@2x.png000066400000000000000000000015241424734202100336710ustar00rootroot00000000000000PNG  IHDR szzgAMA a IDATX ;OTAgސUcAQCVĄD11])ZSS런(q[I,ĠX 4JF3~agg/r)syw/JIe.<^25s3fL+}(uY7ʬyF/.]ˍ%`d2a6ƜZZMLFf͐etexK8kuV2 /?z1؞/^fiIVU~wJ] L3Yby]{Q4ԷTMnh/5n2[lyyfDjt?ݩ{R_7>yuUko0_y%ɳtQgu2熗]i]/C~ 0p`6Tvp9#wt &5*p{]fh7,^2r9jv &lbY - 95y/9L6}Ykrʤs*l'Bn^%˶ș ^%˶~+˪X,mppPJ}qSE^%-dcM&xi_Bc?aЋ5=cw~F!9Oj sa5Y`&xmr߅MfE=O* ư<6 'Hb%` 'F ILG}ak&KMԒYijJ8ܞr+1i7NwIMLКy+ mXzGIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_mixed_hover.png000066400000000000000000000011341424734202100333200ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8RAKTQ73錠3aD0 ~Dp'HѪMZ%nvU &PԱ4rfIw\gm;}9 f~_F"c8Ũt\Wm#_#. &ПnLJ$R=I㒅.y`=#ܟU(-nbEn/Iu , b9̪|J#u\)+|Ví~URTOBR]q1@rdz.bLPopO3WQ;!CiQ[IGbl<3kӉ?Yd]0ON}K00~꫊_i@-9e;sU">~1m*'"{?7{b0Ã*|/2u@;n+C!<]U{fUGp1=9O%^jB™L,R>1s<#X Q6xjo`t oǧ;^o68=DZ~)yTqL,-tIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_mixed_hover@2x.png000066400000000000000000000026341424734202100337000ustar00rootroot00000000000000PNG  IHDR szzgAMA aSIDATX V]k\U]$$L&1 I!jĀ"ID}"DЧ>hMED,1V҇6iFeL:I&=u3Lon9gnfּ6z\m5y]b7[ŵ]g7i݂m.@ߚā:y&>n-wqn3!qj ;qAU] ƄAmU85ōEi`y-n1 KaۂqV[\ER9-tImq\BP@4 8Yo7HHoQiI֩8 81i3[끖p-,%P"-GLF Dȟ둬0eW2\X~ hw#=Y8GF0A# rU`;MŸ3ԺGb.M'}N˕pEBӢfoXEo9?rb3E@N. ŋmzI؅%b--br=ٗuؿ+M#W9HV"+u $SPOlr]`yf5Y^ }藛4x+=cʫqRa>aK_TR@$r}" =_NwŪ RX/¾'яضp",~L&0"+Tp;1gg9Ë&fy(#:a$nf<]64 v1<܌/hb:@ƋEgzVM;ïL'9gh%11-"8&[L;m3Liwbs-!l>INPF)2.A Cq5$Wܝ5U+8̅:μ8 &%3Wʍآ"GC@.a29.# Y4( ήjUEW!B|QJ.(!3pD,߮]؈bIENDB`radio_mixed_insensitive.png000066400000000000000000000006401424734202100344570ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDRagAMA aWIDAT8SAjP)iЍBJEh7n[>ƍ;.r%J$* -q7@aoޛ9挾L49'ؾjcAx^|QDqDx&sT` IR ϝn=!*ϙٲ0 [:PqTS_.pl6\u{i xҴvt:=@˲y XO&Me+^BMg"ѿ0 S!IENDB`radio_mixed_insensitive@2x.png000066400000000000000000000014541424734202100350350ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA aIDATX WoA~%\9h8GpHLq?gz!h &ĤQZ) K%K^g|3 u7@_/pWkw:o0>ki3{#R>n"|>3H;^W4NhjM*ʷpHw JS$jx<KghۣcM85 /$2Z>xLbG2+Xdn¤*9d&LrCnInBuHRPH4 S?Ab\/g繋W!NcckߑK59Lg+V_"RXx[=~Ԫ aD<*O c06z^FA}߸TLp \X,,?=^Xy!!{XL$=pr] 4r^3pV 'VʥTWk.Y][ Lp=A. IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_mixed_press.png000066400000000000000000000010411424734202100333260ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8R=OTA=36nAH06|X #-\k5;DMtl@ :caavf8gfg٬νs9޷o\f^s+h:g::PDTg-pɌpIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_mixed_press@2x.png000066400000000000000000000026041424734202100337060ustar00rootroot00000000000000PNG  IHDR szzgAMA a;IDATX WMhU>w~^SVkE+.F VFwvw.*EP"EAp*ET Ň"$)67;sϼ=p{ϹLD!?dwμ|$t]=uWk)m9wr9 L dB=}rU5ovL{/O!C`g(c7ʾ_q|Mr߶ғS&5Ylo|Ȝ|RX?Z>{}} 2r)?K&Yl#.9 p@.mH宵`t"y `XL`Z$CM<21wړ51JL譕%W)`y$$Zlc1f7ڳ- +n+yޡ͂fm:t"/kyV_j}tPe+; ~9.j -!TCd:"|{!4MWo.?y+P+ ĺ(nPA.z_pYFa94Z^iJ[*C3c:ÍKƌ[c~]1FD{( Ok":(FS!Ȍgfx2Uk97Nf5,Q@1} 4j M"?ALʙ"*?N#(8D22E"-\k3d)g³Iᣅ؀Z!Wpm'hl_?—2d<ģ"̠7sxd>(;Cɝ=4v;1R' cYk"& G\be,b1m39|xrc|D0'` pĥ b=8zȪ7ǧRT" .`z:ǧ <@(nxԸˍTZ^N@p~1g!ngNdY]sgq 5L@Ȝ\9ybLE'sFwNd髷ڣoWv%`'sG9kxSDk_xgYXrPО1YWwmG<~ˎLt@+MPi2m {-\7X:C~Sa/ٸK8luRκˋ'{?›O_3&ƫ9Y2hRfz7dg\:64u Nbi'"1O{NIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_unchecked.png000066400000000000000000000005001424734202100327340ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8S1@Dk- c|F;J7H Q;MrԘH*GLHpe73ܠi'0#ga/Pygbaj3UUh Zo8><$EHm"sM!,8M,=9HU,65SE4MOHO4U Øz!.fI\Ȳ"|I&;VGmf]WUzb plD`[svES _lP&+."q*3TW$^w؞!vFT%ФG̐Q=lV _l#JFy gm3ɭ\.P_l tl6{*͔ZVQ :k6RFG:RNC[Gy9 4nγl!1'.cfDIHmNI$Δ03Aa!L ӏ_RL, 1\ZFJ@j0gLbť ]p e~Ft UF6Z`/Uݽ @jakkH qu|( G_ JPT"OLB:%!aMʠ4 *PRr))g`Nκf; ApWfIS5}VIENDB`radio_unchecked_focus@2x.png000066400000000000000000000016641424734202100344420ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA akIDATX W[OAĠb$EhD" QGOF&hqQڥ9β--P3{v;ߜo ꅦN'*(N^d lS~&ޑzedk"P&iX 0(imPEE=qQv>Ȥ| fSG D\d| 3t4fuSBJH#j='KI1!;+tTg fb1Qgl# ٟ vlp"l×-%75w&Ӳqv ue/ժa;;Ѯ-` OND`.92x5/3i&SKU(rnS1v\h̗=\/ O XT nasjB?61Gl]r1 l0&,d $-,o¶Mr2j*rrpqZ٪oeI3_/| dx40] |6E }$mo!!b[5j? 5nPFM 2[bb[  E}8cn^͆yV`D6Rj0fOիxq((W  !#n AUQ1޻NIAyݒL0TQ*H$1l ^ mY.H`i&NԟfӐK&ic=A=*IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_unchecked_hover.png000066400000000000000000000011331424734202100341420ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8SAOSAfyڂmAbMDxЄx׋'E.^<Ћ!ƅMDH fRDcXhjyoj8vfwlgSybİ; ˝Gd7nWq[-d piJĶ.C|Nd@RhBryROBAY&!=6IENDB`radio_unchecked_hover@2x.png000066400000000000000000000026561424734202100344500ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA aeIDATX VYlU,Rf:@i(-Y1BB! &#DA 1&Cb0&ꃚW5PhKM|(y`OAҖeweB/{r;bkcp♸ cMƢBgǻqNC&@b݂ ^Kx;> 6ԯքϬ3M 2I\[\N;|ׅ޿wY1$rpTF ?wYGĘ?~Ɨ7c<c'"U5euMTZK?%^Jn8xQVxr$VGRL"'@zMd\OHc.BFKHH-0.cZ&PX]X "  m F$YD$6HXQӁ$riWplfq}ֆ^"xUQoBbGƚ{|V'\kE,iER7Fl>p@~ࡍ%s,٘+^:eoF̨f9Y4 OrLR uVkr%=f e`LhhRI8ҍ A׀9`q,BJd4ljK0p'5Z'G l*4N/At XrM>R"DнC׀7oYkۗ8]_M׃P)ƭ5Y l>Z85% xᨃf|K -PJ&TKl&-WNB'+k-$nרdRfh8Xt_@'٬@! 8f"vF?\6/'x "^.Hi 6OzX1:9ODēоێvmv`k0E5P^ qw*i ~b1 ugxuŒb0R RR~h;upD-ٗ<}lMnPĊ9aaEnmەc("Ly#gh3q<yTh_ -|-Yތ[=CRFjp 9r[>8ev =y~މ$ZI$zGl}10'ԒIa:|E,z9<-0Hlt;b`C:CW+=G.rS1sgo= +6+ \2V= 4D\uc?mӮy\kBd|${"A"u{+Hd G2g$͒RѹIӾLIENDB`radio_unchecked_insensitive.png000066400000000000000000000006111424734202100353000ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDRagAMA a@IDAT8Sj@)i˒KJE^^zx<'॒ A ڠNA6 ~}?3+7 [ | rwkI^]&I7Ms0fxQm5ME"AG0vY%K˔xDkyqi@ V,5yl͹}(oF Nycg ޸\ 0K $7t&f: 5rӷ4jj|?üTe!Cugz,PM Ɵ>]yHLJIENDB`radio_unchecked_insensitive@2x.png000066400000000000000000000014001424734202100356470ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA aIDATX =Q]TmHƠ5TTj~ %7!h &4&QW<י]@f?`'yso3}{=U79oDpwe _5"]A5_SwB@x_pC`q\._d2{XV$Qf9L>wi:qǎoZi qՊ_~8ύ^7)GE,͒K|>l6ph5LY*^qc^ D؛HEZ JZV{ V,̓` tž`*@cHB˗Cr'Ҋ3RTt4}mMrm-,m평-!k\2%ο IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkbox/radio_unchecked_press.png000066400000000000000000000010541424734202100341550ustar00rootroot00000000000000PNG  IHDRagAMA aIDAT8SJ\A=uM&A\I>@r$DBN,!D$ʅ32$0 $љ;:u*e*tW:9dbUT0TN̾Mr4QvqPZXESLɏ͢8C R%(~,s`eLU42;9CrBgU!`E[Uf{)5YBó=E< Ӣ̦L>DUfP$I8l{s}֘_|*/Et'q=ovA;kk283uv@jo6vI:çd579l-Ǿs<~&X,XNqvL y^nwh>%m* LFBfYlRC߬ѱaRՔ_.~1FnEx->oK1Bs"O ?\VIENDB`radio_unchecked_press@2x.png000066400000000000000000000026321424734202100344530ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/checkboxPNG  IHDR szzgAMA aQIDATX WMhU>wfkbhB41e AW.\ nܴ]tEpcɦ]QWH S+BĘ[mkZ5i23;sϼDSns9̫uy'2V yxs2~62y񰻈~#7R?˖^FAAl7˗Mnho,"O3 &ԤucIz>~<䮙9s-rW[2Us,&5Of#oY{ɹMN\x՝da]Wdr#%ı:8]* >R7ȗFSjliPh4ae4bLb`|= u)o<.jHQ1"^J\ZP@  x2P ݗ3uN@) t)TEBfJ pyhdI&C`5!, z1&A^ڐEȯ$m|$$+Lj"#T[MA6{S!DmBŗH7IIK[I@8xR ]Y? XL1 |X6D,a˳ zy-I$Z9~E4;n $[`}r@j'(Z xVUf_"mǏ\0Quc:.q/tN{ "$1a5Ww~_2Ov"R3Wƶ{'&Cx8䧩ߏ^g$7FSN : C:#Qy=RCrXpӧFy01sܾ}Wt-w>t_ݎcD`VLODxdl2;XO]~`b51J=I!=c8Cg{z<#i2?\>xAҩEXB LAEp }`ϣ1fιADn[6YL'&CM΍%#ɉV!e}ȳ3.KhhVi@T:, XO8'y+ql#IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/header_arrow_down.png000066400000000000000000000002561424734202100315400ustar00rootroot00000000000000PNG  IHDR Vu\gAMA aeIDAT(c`FK 1L /(&eʁa @|ܹsK@|@iK5"+a MP`d " 0NIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/header_arrow_up.png000066400000000000000000000002721424734202100312130ustar00rootroot00000000000000PNG  IHDR Vu\gAMA aqIDAT(c`(y]RRR?~ Y bFF$ ҈ hRs- R $))yŋ7A61cbb dĠLx4 &OIENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/slider/000077500000000000000000000000001424734202100266205ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/slider/slider_handle_focus.svg000077500000000000000000000037131424734202100333440ustar00rootroot00000000000000 slider_handle_focus Created with Sketch. slider_handle_insensitive.svg000077500000000000000000000037171424734202100345120ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/slider slider_handle_insensitive Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/slider/slider_handle_normal.svg000077500000000000000000000036741424734202100335230ustar00rootroot00000000000000 slider_handle_normal Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/slider/slider_handle_press.svg000077500000000000000000000036601424734202100333620ustar00rootroot00000000000000 slider_handle_press Created with Sketch. qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/slider/slider_point_handle.png000066400000000000000000000013471424734202100333410ustar00rootroot00000000000000PNG  IHDRw=sRGBIDATH U;Ql4Km$@ߡf !M( Vi B뢄`o䛽 &gΙ;/,n:w͛l;X,cpCdGm:kFNNsF@(nTѷFg|^t: ^ɤf?íwL@%_d%F] wOTz7 .srhDRl^aT.j-1Ձ]R(FkO\. =G*x{ノh^G-ohTWL ȗXD"n8~ r}V 'GTe-9]ҠP(gYIGkX2Ob:ekTw=H^.7J͡Ѭ@z%QE^7o;WpvF@JQ[~> 8UuLF(ɃuBL=ZE\\IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/slider/slider_point_handle@2x.png000066400000000000000000000034501424734202100337100ustar00rootroot00000000000000PNG  IHDR00WsRGBIDAThYIOdU@l%F;i;(alX1MoVv[ @#b"@hP3qrPē:{ޫ2eѐbE1^YT".-dMttԞ%[XX⃼`rbb`)Ya(<\XaUcn擉)cXy؆:^>>|ɓw>WQQq27ɔ&....899zff/-OE/: BCȱioo{%3U mkC'8VLX9&4zGTV"i!@1p͂} 6aKbu  Y$ g^J\LJ5`*0E9C*1w/SWc {|zi  zD7&Lig~W1I#DG|NF.V::E˅]g2 MQFҿ?cua:It+RP0v 3L]`Pr!q y>HkO19udXiB?v ŌIENDB`slider_point_handle_focus.png000066400000000000000000000016231424734202100344560ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/sliderPNG  IHDRw=sRGBMIDATH TKLQ'BcPBpKD++,tэĐ….pcDQnЅ,d݈"i;3:}36M{,D.٤PYӴǙ~dͶ-Ir\ޠ3^n1I4g? :9Ԁ&uV]:i,SX,-OupbWDsΫllt $ε:GM-0pJbޚ =e&jF64(aE)"U(6ő˄p_r!-sOP MCChz:Q@0l KBȉ"*$M1QSL7=@(r? ަZqWYwa `T}$"LKZÂp:Z`X aͿ+{o^_v#,Mo)!s6<1pV1eSˣ#\9J{aM͋\7i'usם u֊MRvѤ)ƀLġWbduis,tRda[_öC}ݯœ4Ȃ˖-3z? ]q1%>mK$ÐAh^*/,Gr q:UgϞ8qGA$CK>9 c#N#"Ur"6}",<~NM !B`8C݃i/$)ALJĒIBLd͕~~s(mܾz%w'`ۅ)H Yw-bF-"h ɛnx 9 #&8i]'=IVcL9Ot]atDXm([W30ҼR ͖ZXv 'H>$K>|M5?u~`Q1$u"I9וCk4-I8eO Oxz< xӎю"׽{#O6 KW^q~`n!JH\'-[S;]`(1BnaI@H B|)^ ]MKpHQL~d\'u$,.)"S "F"Fɹ}}N>XC.Tn/@JZ#o#q޳H^>N5ȅx-U$#9ͥ 3i5N ):!"FRD8$_+ 9Unƅ|*>(B=CN}]tYBM+-.iCS N`]Ns6EӼUv,<jA!d4[Nz.jMWjSJomƿO5i@wЍ>$?Ӕ"鵲<7 ֑znbM`m*^$g-u@IAdC`Zk8qA.Xmk:]pj*[-[!CDa pvqmy.[BPqܯiK򍨼108aTCZD{FFlF]}O_v#SS{4FMK̋ 5ԻeJ#a+{ iؘd*>8;X;簰QDy+֋jXc])|%8x x87d3*EgZ΋ 7K7+zx:G6{߃ M jinQ:kn0d`:`0oR~ ZHn}HҙF˂[֑7n.`)N|jNLs6.Lk;]~R9Jtvyâ{b7r7_D4϶zsqmP^7/\ovME̡ݗ>s]h/j(_dɯ3yM8xPɁf49azOv&@nw'y'` 4= ,P5qZR.Mm* KgDH6 YYF90`$f%4irٚaXF71Rļr^}$`^_C6Zַr ZTjRnt:[ 9Wrw d2i2fNtG L{DwVVVpu_iY6UO)7 fvAxM4"P5N|UzgY9ll󎭻)^U!`0\j1mH|h4~BAkC2EpB'-,k\8/?J rO$)% ~$;KֿTb&`bŋIENDB`slider_point_handle_insensitive@2x.png000066400000000000000000000031701424734202100362500ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/sliderPNG  IHDR00WsRGB2IDAThXJdGn[x 1B0!7gH$o$m//Qjw:NYUtk6T]{ڷmVcYb)}JW7O%եuW>̰2MTy.F,_=Py> PyuOy.k\a###_6۾z^NcCU%𤋮ǂ7WVV7@Z=,0y}aai:_l\vCNĂ-1v~ߚwwww= 3L\paI,#`y*N>2/Z3Nec"24dJC̃AvS,Lik\\f?bhu{8gD:R]`;E ſ}3::|̙3Unu:%q> D\s|¾jCe&A ٧t!l݋uLKrO٨r1Dcʉv1sӫ|k2h_W.Aiթ0!`ٌSE0NFuCc&TĪ7`yq_%V U Y|AiĠ0xi6Pʖb&un͍ & yЁTF<| G +szaA^"v͋GeSnK/lؙ=`@2/&<Y\F,[ @`H'N.//'Sި1̮Bz(r?6WǻɒC@n3MFtmZm=W;<<,#}>@ј%HBƐ[,M (!)\n<ËVDy 8q8.4 cb0Fn~&9:Voup|LN.ump-@7@7lfLiN}} &Ђ\]]= /Cg6:G>,W}tfgg1oColl|dF>n@;^ֵw$-[` mwtTV@ߪ"6QFhEy||| d$gE< 5:~pː.6JV;%P?n t &v7NYuՎ~fJ>}1( #D-?6J ?LktWEqSSS(mtfL'We챐Om`!#)OY)jƞ 7=!9@=ig@h*'$cv²8Su;br`Ę@jOtIENDB`slider_point_handle_press.png000066400000000000000000000015171424734202100344750ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/sliderPNG  IHDRw=sRGB IDATH TKQ?Օ]ɯ"?0m§50 ^ W7SJ˰֯Zw{g;̮م;{~ܙ!=HvߑPLgA?D$jp$Q J7 nZx%Bn S%sb .%LÍ DyV^{ҕgcojN &""LVq5]{ug4PYV~G$y>۾CC :1N?;}ĹcESIk΂nܤĞ`#dĮwSa mxXD9Er1vf :5Xw*eG]"fHb\[#0?p| 5nаx9Vՠih9wӾʗg/cѯ{Wڜp hAT,~\@KA0{ćHc̴IƵSI퉷F+gZ.ow4 k4u55M⪖ $D=/δVElٟ^ծ:޼oszrGo) fݢ Ow` ;1~ `1z6~?qy{IFbqYXVVfy X,e*ean}]%r{Nf%O7g-_yə[WW"YPBw0v4^o*YAkR4\4Ag;#ƚ2.XVSa=/x4IENDB`slider_point_handle_press@2x.png000066400000000000000000000041531424734202100350460ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/assets/semilight/sliderPNG  IHDR00WsRGB%IDAThYoU?glExPD 1'F-! &}0x!T/%bȥ@mi;̷v:3ۢdw3V-]e, ,+7l"/-<^ccq|e(LӺ6ichѽspGu{n8P K\JDaTI$%39BB\ƼE#汓OG0N&V'D78y@d$Au@ڏCTeX( 84^|d*M'3WPJX})WrrM*$.iI1%G\CquN{cKNfgy !KZbh(&beD'!$>’ ݥ`>rv߹XR䑔cӿPAhYZ^*h2b'dn ZU|8 ii @vuf]J-R(O_O%NsЍl¶ҙEԠ{_  '< %5Ò1z&% fuJfeh JW!:4~C-s.>ig5-ix'M`<1W_ GЍNu=u2h6%ϴyƛj>Ҿ-q Aeֽ6[1ՙ$&|jcM6USCgzCPNAwKw,0=Yj}G+ׇ-ityF,/íUō&Ԡ[*&i8Lۛˏ}^C=?i:VsG(n٠ ƕd6`@b'i@&j|([ځ`VLSƘHC'γpK&nMԃ ԅh\7(q憣C7n.`B}g#A1/5|K咵 眰IENDB`qt5integration-5.5.23/styleplugins/dstyleplugin/assets_dark.qrc000066400000000000000000000163701424734202100250700ustar00rootroot00000000000000 assets/dark/check_disabled.png assets/dark/check_selected.png assets/dark/check_normal.png assets/dark/checkbox/checkbox_checked_insensitive.png assets/dark/checkbox/checkbox_checked_insensitive@2x.png assets/dark/checkbox/checkbox_checked_focus.png assets/dark/checkbox/checkbox_checked_focus@2x.png assets/dark/checkbox/checkbox_mixed_insensitive.png assets/dark/checkbox/checkbox_mixed_insensitive@2x.png assets/dark/checkbox/checkbox_mixed_focus.png assets/dark/checkbox/checkbox_mixed_focus@2x.png assets/dark/checkbox/checkbox_unchecked_insensitive.png assets/dark/checkbox/checkbox_unchecked_insensitive@2x.png assets/dark/checkbox/checkbox_checked.png assets/dark/checkbox/checkbox_checked@2x.png assets/dark/checkbox/checkbox_checked_hover.png assets/dark/checkbox/checkbox_checked_hover@2x.png assets/dark/checkbox/checkbox_checked_press.png assets/dark/checkbox/checkbox_checked_press@2x.png assets/dark/checkbox/checkbox_mixed.png assets/dark/checkbox/checkbox_mixed@2x.png assets/dark/checkbox/checkbox_mixed_hover.png assets/dark/checkbox/checkbox_mixed_hover@2x.png assets/dark/checkbox/checkbox_mixed_press.png assets/dark/checkbox/checkbox_mixed_press@2x.png assets/dark/checkbox/checkbox_unchecked.png assets/dark/checkbox/checkbox_unchecked@2x.png assets/dark/checkbox/checkbox_unchecked_focus.png assets/dark/checkbox/checkbox_unchecked_focus@2x.png assets/dark/checkbox/checkbox_unchecked_hover.png assets/dark/checkbox/checkbox_unchecked_hover@2x.png assets/dark/checkbox/checkbox_unchecked_press.png assets/dark/checkbox/checkbox_unchecked_press@2x.png assets/dark/checkbox/radio_checked_insensitive.png assets/dark/checkbox/radio_checked_insensitive@2x.png assets/dark/checkbox/radio_mixed_insensitive.png assets/dark/checkbox/radio_mixed_insensitive@2x.png assets/dark/checkbox/radio_unchecked_insensitive.png assets/dark/checkbox/radio_unchecked_insensitive@2x.png assets/dark/checkbox/radio_checked.png assets/dark/checkbox/radio_checked@2x.png assets/dark/checkbox/radio_checked_focus.png assets/dark/checkbox/radio_checked_focus@2x.png assets/dark/checkbox/radio_checked_hover.png assets/dark/checkbox/radio_checked_hover@2x.png assets/dark/checkbox/radio_checked_press.png assets/dark/checkbox/radio_checked_press@2x.png assets/dark/checkbox/radio_mixed.png assets/dark/checkbox/radio_mixed@2x.png assets/dark/checkbox/radio_mixed_focus.png assets/dark/checkbox/radio_mixed_focus@2x.png assets/dark/checkbox/radio_mixed_hover.png assets/dark/checkbox/radio_mixed_hover@2x.png assets/dark/checkbox/radio_mixed_press.png assets/dark/checkbox/radio_mixed_press@2x.png assets/dark/checkbox/radio_unchecked.png assets/dark/checkbox/radio_unchecked@2x.png assets/dark/checkbox/radio_unchecked_focus.png assets/dark/checkbox/radio_unchecked_focus@2x.png assets/dark/checkbox/radio_unchecked_hover_dark.png assets/dark/checkbox/radio_unchecked_hover_dark@2x.png assets/dark/checkbox/radio_unchecked_press_dark.png assets/dark/checkbox/radio_unchecked_press_dark@2x.png assets/dark/spinbox/spinbutton_minus_hover.png assets/dark/spinbox/spinbutton_minus_insensitive.png assets/dark/spinbox/spinbutton_minus_normal.png assets/dark/spinbox/spinbutton_minus_press.png assets/dark/spinbox/spinbutton_plus_hover.png assets/dark/spinbox/spinbutton_plus_insensitive.png assets/dark/spinbox/spinbutton_plus_normal.png assets/dark/spinbox/spinbutton_plus_press.png assets/dark/spinbox/spinbutton_down_hover.png assets/dark/spinbox/spinbutton_down_insensitive.png assets/dark/spinbox/spinbutton_down_normal.png assets/dark/spinbox/spinbutton_down_press.png assets/dark/spinbox/spinbutton_up_hover.png assets/dark/spinbox/spinbutton_up_insensitive.png assets/dark/spinbox/spinbutton_up_normal.png assets/dark/spinbox/spinbutton_up_press.png assets/dark/slider/slider_handle_focus.svg assets/dark/slider/slider_handle_insensitive.svg assets/dark/slider/slider_handle_normal.svg assets/dark/slider/slider_handle_press.svg assets/dark/slider/slider_point_handle_focus.png assets/dark/slider/slider_point_handle_focus@2x.png assets/dark/slider/slider_point_handle_insensitive.png assets/dark/slider/slider_point_handle_insensitive@2x.png assets/dark/slider/slider_point_handle_press.png assets/dark/slider/slider_point_handle_press@2x.png assets/dark/slider/slider_point_handle.png assets/dark/slider/slider_point_handle@2x.png assets/dark/tabbar/add_hover.svg assets/dark/tabbar/add_normal.svg assets/dark/tabbar/add_press.svg assets/dark/tabbar/pagedown_hover.svg assets/dark/tabbar/pagedown_insensitive.svg assets/dark/tabbar/pagedown_normal.svg assets/dark/tabbar/pagedown_press.svg assets/dark/tabbar/pageup_hover.svg assets/dark/tabbar/pageup_insensitive.svg assets/dark/tabbar/pageup_normal.svg assets/dark/tabbar/pageup_press.svg assets/dark/tabbar/tab_close_hover.svg assets/dark/tabbar/tab_close_normal.svg assets/dark/tabbar/tab_close_press.svg assets/dark/header_arrow_up.svg assets/dark/header_arrow_down.svg assets/dark/input/input_clear_hover.svg assets/dark/input/input_clear_normal.svg assets/dark/input/input_clear_press.svg qt5integration-5.5.23/styleplugins/dstyleplugin/assets_light.qrc000066400000000000000000000170011424734202100252460ustar00rootroot00000000000000 assets/light/arrow-right_disabled.svg assets/light/arrow-right_selected.svg assets/light/arrow-right_normal.svg assets/light/check_disabled.svg assets/light/check_selected.svg assets/light/check_normal.svg assets/light/checkbox/checkbox_checked_insensitive.png assets/light/checkbox/checkbox_checked_insensitive@2x.png assets/light/checkbox/checkbox_checked_focus.png assets/light/checkbox/checkbox_checked_focus@2x.png assets/light/checkbox/checkbox_mixed_insensitive.png assets/light/checkbox/checkbox_mixed_insensitive@2x.png assets/light/checkbox/checkbox_mixed_focus.png assets/light/checkbox/checkbox_mixed_focus@2x.png assets/light/checkbox/checkbox_unchecked_insensitive.png assets/light/checkbox/checkbox_unchecked_insensitive@2x.png assets/light/checkbox/checkbox_checked.png assets/light/checkbox/checkbox_checked@2x.png assets/light/checkbox/checkbox_checked_hover.png assets/light/checkbox/checkbox_checked_hover@2x.png assets/light/checkbox/checkbox_checked_press.png assets/light/checkbox/checkbox_checked_press@2x.png assets/light/checkbox/checkbox_mixed.png assets/light/checkbox/checkbox_mixed@2x.png assets/light/checkbox/checkbox_mixed_hover.png assets/light/checkbox/checkbox_mixed_hover@2x.png assets/light/checkbox/checkbox_mixed_press.png assets/light/checkbox/checkbox_mixed_press@2x.png assets/light/checkbox/checkbox_unchecked.png assets/light/checkbox/checkbox_unchecked@2x.png assets/light/checkbox/checkbox_unchecked_focus.png assets/light/checkbox/checkbox_unchecked_focus@2x.png assets/light/checkbox/checkbox_unchecked_hover.png assets/light/checkbox/checkbox_unchecked_hover@2x.png assets/light/checkbox/checkbox_unchecked_press.png assets/light/checkbox/checkbox_unchecked_press@2x.png assets/light/checkbox/radio_checked_insensitive.png assets/light/checkbox/radio_checked_insensitive@2x.png assets/light/checkbox/radio_mixed_insensitive.png assets/light/checkbox/radio_mixed_insensitive@2x.png assets/light/checkbox/radio_unchecked_insensitive.png assets/light/checkbox/radio_unchecked_insensitive@2x.png assets/light/checkbox/radio_checked.png assets/light/checkbox/radio_checked@2x.png assets/light/checkbox/radio_checked_focus.png assets/light/checkbox/radio_checked_focus@2x.png assets/light/checkbox/radio_checked_hover.png assets/light/checkbox/radio_checked_hover@2x.png assets/light/checkbox/radio_checked_press.png assets/light/checkbox/radio_checked_press@2x.png assets/light/checkbox/radio_mixed.png assets/light/checkbox/radio_mixed@2x.png assets/light/checkbox/radio_mixed_focus.png assets/light/checkbox/radio_mixed_focus@2x.png assets/light/checkbox/radio_mixed_hover.png assets/light/checkbox/radio_mixed_hover@2x.png assets/light/checkbox/radio_mixed_press.png assets/light/checkbox/radio_mixed_press@2x.png assets/light/checkbox/radio_unchecked.png assets/light/checkbox/radio_unchecked@2x.png assets/light/checkbox/radio_unchecked_focus.png assets/light/checkbox/radio_unchecked_focus@2x.png assets/light/checkbox/radio_unchecked_hover.png assets/light/checkbox/radio_unchecked_hover@2x.png assets/light/checkbox/radio_unchecked_press.png assets/light/checkbox/radio_unchecked_press@2x.png assets/light/header_arrow_down.png assets/light/header_arrow_up.png assets/light/spinbox/spinbutton_minus_hover.png assets/light/spinbox/spinbutton_minus_insensitive.png assets/light/spinbox/spinbutton_minus_normal.png assets/light/spinbox/spinbutton_minus_press.png assets/light/spinbox/spinbutton_plus_hover.png assets/light/spinbox/spinbutton_plus_insensitive.png assets/light/spinbox/spinbutton_plus_normal.png assets/light/spinbox/spinbutton_plus_press.png assets/light/spinbox/spinbutton_down_hover.png assets/light/spinbox/spinbutton_down_insensitive.png assets/light/spinbox/spinbutton_down_normal.png assets/light/spinbox/spinbutton_down_press.png assets/light/spinbox/spinbutton_up_hover.png assets/light/spinbox/spinbutton_up_insensitive.png assets/light/spinbox/spinbutton_up_normal.png assets/light/spinbox/spinbutton_up_press.png assets/light/slider/slider_handle_focus.svg assets/light/slider/slider_handle_insensitive.svg assets/light/slider/slider_handle_normal.svg assets/light/slider/slider_handle_press.svg assets/light/slider/slider_point_handle_focus.png assets/light/slider/slider_point_handle_focus@2x.png assets/light/slider/slider_point_handle_insensitive.png assets/light/slider/slider_point_handle_insensitive@2x.png assets/light/slider/slider_point_handle_press.png assets/light/slider/slider_point_handle_press@2x.png assets/light/slider/slider_point_handle.png assets/light/slider/slider_point_handle@2x.png assets/light/tabbar/add_hover.svg assets/light/tabbar/add_normal.svg assets/light/tabbar/add_press.svg assets/light/tabbar/pagedown_hover.svg assets/light/tabbar/pagedown_insensitive.svg assets/light/tabbar/pagedown_normal.svg assets/light/tabbar/pagedown_press.svg assets/light/tabbar/pageup_hover.svg assets/light/tabbar/pageup_insensitive.svg assets/light/tabbar/pageup_normal.svg assets/light/tabbar/pageup_press.svg assets/light/tabbar/tab_close_hover.svg assets/light/tabbar/tab_close_normal.svg assets/light/tabbar/tab_close_press.svg assets/light/input/input_clear_hover.svg assets/light/input/input_clear_normal.svg assets/light/input/input_clear_press.svg qt5integration-5.5.23/styleplugins/dstyleplugin/assets_semidark.qrc000066400000000000000000000127661424734202100257530ustar00rootroot00000000000000 assets/semidark/check_disabled.png assets/semidark/check_selected.png assets/semidark/check_normal.png assets/semidark/checkbox/checkbox_checked_insensitive.png assets/semidark/checkbox/checkbox_checked_insensitive@2x.png assets/semidark/checkbox/checkbox_checked_focus.png assets/semidark/checkbox/checkbox_checked_focus@2x.png assets/semidark/checkbox/checkbox_mixed_insensitive.png assets/semidark/checkbox/checkbox_mixed_insensitive@2x.png assets/semidark/checkbox/checkbox_mixed_focus.png assets/semidark/checkbox/checkbox_mixed_focus@2x.png assets/semidark/checkbox/checkbox_unchecked_insensitive.png assets/semidark/checkbox/checkbox_unchecked_insensitive@2x.png assets/semidark/checkbox/checkbox_checked.png assets/semidark/checkbox/checkbox_checked@2x.png assets/semidark/checkbox/checkbox_checked_hover.png assets/semidark/checkbox/checkbox_checked_hover@2x.png assets/semidark/checkbox/checkbox_checked_press.png assets/semidark/checkbox/checkbox_checked_press@2x.png assets/semidark/checkbox/checkbox_mixed.png assets/semidark/checkbox/checkbox_mixed@2x.png assets/semidark/checkbox/checkbox_mixed_hover.png assets/semidark/checkbox/checkbox_mixed_hover@2x.png assets/semidark/checkbox/checkbox_mixed_press.png assets/semidark/checkbox/checkbox_mixed_press@2x.png assets/semidark/checkbox/checkbox_unchecked.png assets/semidark/checkbox/checkbox_unchecked@2x.png assets/semidark/checkbox/checkbox_unchecked_focus.png assets/semidark/checkbox/checkbox_unchecked_focus@2x.png assets/semidark/checkbox/checkbox_unchecked_hover.png assets/semidark/checkbox/checkbox_unchecked_hover@2x.png assets/semidark/checkbox/checkbox_unchecked_press.png assets/semidark/checkbox/checkbox_unchecked_press@2x.png assets/semidark/checkbox/radio_checked_insensitive.png assets/semidark/checkbox/radio_checked_insensitive@2x.png assets/semidark/checkbox/radio_mixed_insensitive.png assets/semidark/checkbox/radio_mixed_insensitive@2x.png assets/semidark/checkbox/radio_unchecked_insensitive.png assets/semidark/checkbox/radio_unchecked_insensitive@2x.png assets/semidark/checkbox/radio_checked.png assets/semidark/checkbox/radio_checked@2x.png assets/semidark/checkbox/radio_checked_focus.png assets/semidark/checkbox/radio_checked_focus@2x.png assets/semidark/checkbox/radio_checked_hover.png assets/semidark/checkbox/radio_checked_hover@2x.png assets/semidark/checkbox/radio_checked_press.png assets/semidark/checkbox/radio_checked_press@2x.png assets/semidark/checkbox/radio_mixed.png assets/semidark/checkbox/radio_mixed@2x.png assets/semidark/checkbox/radio_mixed_focus.png assets/semidark/checkbox/radio_mixed_focus@2x.png assets/semidark/checkbox/radio_mixed_hover.png assets/semidark/checkbox/radio_mixed_hover@2x.png assets/semidark/checkbox/radio_mixed_press.png assets/semidark/checkbox/radio_mixed_press@2x.png assets/semidark/checkbox/radio_unchecked.png assets/semidark/checkbox/radio_unchecked@2x.png assets/semidark/checkbox/radio_unchecked_focus.png assets/semidark/checkbox/radio_unchecked_focus@2x.png assets/semidark/checkbox/radio_unchecked_hover_dark.png assets/semidark/checkbox/radio_unchecked_hover_dark@2x.png assets/semidark/checkbox/radio_unchecked_press_dark.png assets/semidark/checkbox/radio_unchecked_press_dark@2x.png assets/semidark/header_arrow_down.png assets/semidark/header_arrow_up.png assets/semidark/slider/slider_handle_focus.svg assets/semidark/slider/slider_handle_insensitive.svg assets/semidark/slider/slider_handle_normal.svg assets/semidark/slider/slider_handle_press.svg assets/semidark/slider/slider_point_handle_focus.png assets/semidark/slider/slider_point_handle_focus@2x.png assets/semidark/slider/slider_point_handle_insensitive.png assets/semidark/slider/slider_point_handle_insensitive@2x.png assets/semidark/slider/slider_point_handle_press.png assets/semidark/slider/slider_point_handle_press@2x.png assets/semidark/slider/slider_point_handle.png assets/semidark/slider/slider_point_handle@2x.png qt5integration-5.5.23/styleplugins/dstyleplugin/assets_semilight.qrc000066400000000000000000000133521424734202100261310ustar00rootroot00000000000000 assets/semilight/arrow-right_disabled.png assets/semilight/arrow-right_selected.png assets/semilight/arrow-right_normal.png assets/semilight/check_disabled.png assets/semilight/check_selected.png assets/semilight/check_normal.png assets/semilight/checkbox/checkbox_checked_insensitive.png assets/semilight/checkbox/checkbox_checked_insensitive@2x.png assets/semilight/checkbox/checkbox_checked_focus.png assets/semilight/checkbox/checkbox_checked_focus@2x.png assets/semilight/checkbox/checkbox_mixed_insensitive.png assets/semilight/checkbox/checkbox_mixed_insensitive@2x.png assets/semilight/checkbox/checkbox_mixed_focus.png assets/semilight/checkbox/checkbox_mixed_focus@2x.png assets/semilight/checkbox/checkbox_unchecked_insensitive.png assets/semilight/checkbox/checkbox_unchecked_insensitive@2x.png assets/semilight/checkbox/checkbox_checked.png assets/semilight/checkbox/checkbox_checked@2x.png assets/semilight/checkbox/checkbox_checked_hover.png assets/semilight/checkbox/checkbox_checked_hover@2x.png assets/semilight/checkbox/checkbox_checked_press.png assets/semilight/checkbox/checkbox_checked_press@2x.png assets/semilight/checkbox/checkbox_mixed.png assets/semilight/checkbox/checkbox_mixed@2x.png assets/semilight/checkbox/checkbox_mixed_hover.png assets/semilight/checkbox/checkbox_mixed_hover@2x.png assets/semilight/checkbox/checkbox_mixed_press.png assets/semilight/checkbox/checkbox_mixed_press@2x.png assets/semilight/checkbox/checkbox_unchecked.png assets/semilight/checkbox/checkbox_unchecked@2x.png assets/semilight/checkbox/checkbox_unchecked_focus.png assets/semilight/checkbox/checkbox_unchecked_focus@2x.png assets/semilight/checkbox/checkbox_unchecked_hover.png assets/semilight/checkbox/checkbox_unchecked_hover@2x.png assets/semilight/checkbox/checkbox_unchecked_press.png assets/semilight/checkbox/checkbox_unchecked_press@2x.png assets/semilight/checkbox/radio_checked_insensitive.png assets/semilight/checkbox/radio_checked_insensitive@2x.png assets/semilight/checkbox/radio_mixed_insensitive.png assets/semilight/checkbox/radio_mixed_insensitive@2x.png assets/semilight/checkbox/radio_unchecked_insensitive.png assets/semilight/checkbox/radio_unchecked_insensitive@2x.png assets/semilight/checkbox/radio_checked.png assets/semilight/checkbox/radio_checked@2x.png assets/semilight/checkbox/radio_checked_focus.png assets/semilight/checkbox/radio_checked_focus@2x.png assets/semilight/checkbox/radio_checked_hover.png assets/semilight/checkbox/radio_checked_hover@2x.png assets/semilight/checkbox/radio_checked_press.png assets/semilight/checkbox/radio_checked_press@2x.png assets/semilight/checkbox/radio_mixed.png assets/semilight/checkbox/radio_mixed@2x.png assets/semilight/checkbox/radio_mixed_focus.png assets/semilight/checkbox/radio_mixed_focus@2x.png assets/semilight/checkbox/radio_mixed_hover.png assets/semilight/checkbox/radio_mixed_hover@2x.png assets/semilight/checkbox/radio_mixed_press.png assets/semilight/checkbox/radio_mixed_press@2x.png assets/semilight/checkbox/radio_unchecked.png assets/semilight/checkbox/radio_unchecked@2x.png assets/semilight/checkbox/radio_unchecked_focus.png assets/semilight/checkbox/radio_unchecked_focus@2x.png assets/semilight/checkbox/radio_unchecked_hover.png assets/semilight/checkbox/radio_unchecked_hover@2x.png assets/semilight/checkbox/radio_unchecked_press.png assets/semilight/checkbox/radio_unchecked_press@2x.png assets/semilight/header_arrow_down.png assets/semilight/header_arrow_up.png assets/semilight/slider/slider_handle_focus.svg assets/semilight/slider/slider_handle_insensitive.svg assets/semilight/slider/slider_handle_normal.svg assets/semilight/slider/slider_handle_press.svg assets/semilight/slider/slider_point_handle_focus.png assets/semilight/slider/slider_point_handle_focus@2x.png assets/semilight/slider/slider_point_handle_insensitive.png assets/semilight/slider/slider_point_handle_insensitive@2x.png assets/semilight/slider/slider_point_handle_press.png assets/semilight/slider/slider_point_handle_press@2x.png assets/semilight/slider/slider_point_handle.png assets/semilight/slider/slider_point_handle@2x.png qt5integration-5.5.23/styleplugins/dstyleplugin/brushchemes.qrc000066400000000000000000000003631424734202100250700ustar00rootroot00000000000000 brushschemes/dlight.css brushschemes/ddark.css brushschemes/dsemidark.css brushschemes/dsemilight.css qt5integration-5.5.23/styleplugins/dstyleplugin/brushschemes/000077500000000000000000000000001424734202100245425ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/brushschemes/ddark.css000066400000000000000000000227021424734202100263440ustar00rootroot00000000000000QPalette { Base: transparent; Text: rgb(255,255,255); Window: "#202020"; WindowText: rgb(255,255,255); Highlight: "#61b5f8"; HighlightedText: rgb(255,255,255); Button: rgba(255, 255, 255, 0.15); ButtonText: "#dcdcdc"; } QPalette:disabled { Text: rgba(255, 255, 255, 0.4); WindowText: rgba(255, 255, 255, 0.4); Highlight: "#8ccfff"; HighlightedText: rgba(255,255,255, 0.4); } Slider { GrooveColor: rgba(255, 255, 255, 0.2); GrooveHighlightColor: "#2ca7f8"; HandleBrush: url(:/assets/dark/slider/slider_handle_normal.svg); VernierHandleBrush: url(:/assets/dark/slider/slider_point_handle.png); HandleBorderColor: transparent; TickmarkColor: rgba(255,255,255,0.6); } Slider:focus { HandleBrush: url(:/assets/dark/slider/slider_handle_focus.svg); VernierHandleBrush: url(:/assets/dark/slider/slider_point_handle_focus.png); HandleBorderColor: "#2ca7f8"; } Slider:disabled { GrooveColor: rgba(255, 255, 255, 0.08); GrooveHighlightColor: "#0d4265"; HandleBrush: url(:/assets/dark/slider/slider_handle_insensitive.svg); VernierHandleBrush: url(:/assets/dark/slider/slider_point_handle_insensitive.png); HandleBorderColor: rgba(0, 0, 0, 0.1); } Slider:pressed { HandleBrush: url(:/assets/dark/slider/slider_handle_press.svg); VernierHandleBrush: url(:/assets/dark/slider/slider_point_handle_press.png); } ProgressBar { GrooveBackground: rgba(255, 255, 255, 0.1); GrooveBorder: transparent; ContentBackground: "#2ca7f8"; ContentBorder: "#378cfa"; } PushButton { BackgroundBrush: rgba(255, 255, 255, 0.15); TextColor: "#dcdcdc"; SuggestTextColor: rgba(0, 132, 255, 1); BorderBrush: transparent; SuggestButtonColor: rgba(0, 132, 255, 0.4); } PushButton:disabled { BackgroundBrush: rgba(255, 255, 255, 0.06); TextColor: "#40dcdcdc"; SuggestTextColor: "#40dcdcdc"; BorderBrush: transparent; SuggestTextColor: transparent; } PushButton:hover { BackgroundBrush: rgba(255, 255, 255, 0.3); TextColor: white; SuggestTextColor: white; BorderBrush: transparent; SuggestTextColor: transparent; } PushButton:pressed { BackgroundBrush: rgba(255,255,255,0.1); TextColor: "#2ca7f8"; SuggestTextColor: "#2ca7f8"; BorderBrush: rgba(0, 0, 0, 0.05); SuggestTextColor: transparent; } PushButton:focus { BorderBrush: "#2ca7f8"; SuggestButtonColor: rgba(0, 132, 255, 0.4); } PushButton:flat { TextColor: "#0082fa"; SuggestTextColor: "#0082fa"; } PushButton:flat:disabled { TextColor: "#0060b9"; SuggestTextColor: "#0060b9"; } PushButton:flat:hover { TextColor: "#16b8ff"; SuggestTextColor: "#16b8ff"; } LineEdit { BackgroundBrush: rgba(255,255,255,0.15); BorderBrush: transparent; AlertBorderBrush: "#FF8F00"; } LineEdit:disabled { BackgroundBrush: rgba(255,255,255,0.04); } LineEdit:focus { BackgroundBrush: rgba(255,255,255,0.05); BorderBrush: rgba(43,167,248,0.6); } ScrollBar { HandleBrush: rgba(255, 255, 255, 0.2); HandleBroderBrush: rgba(255, 255, 255, 0.05); } ScrollBar:hover { HandleBrush: rgba(255, 255, 255, 0.4); HandleBroderBrush: rgba(255, 255, 255, 0.1); } ScrollBar:pressed { HandleBrush: rgba(96, 96, 96, 0.3); HandleBorderBrush: rgba(255, 255, 255, 0.05); } ScrollBar:focus { HandleBroderBrush: "#2ca7f8"; } Menu { BackgroundBrush: "#313131"; SeparatorColor: rgba(255, 255, 255, 0.1); BorderColor: rgba(0, 0, 0, 0.1); } CheckBox { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_unchecked.png); } CheckBox:disabled { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_unchecked_insensitive.png); } CheckBox:focus { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_unchecked_focus.png); } CheckBox:hover { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_unchecked_hover.png); } CheckBox:pressed { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_unchecked_press.png); } CheckBox:checked { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_checked.png); } CheckBox:checked:disabled { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_checked_insensitive.png); } CheckBox:checked:focus { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_checked_focus.png); } CheckBox:checked:hover { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_checked_hover.png); } CheckBox:checked:pressed { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_checked_press.png); } CheckBox:indeterminate { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_mixed.png); } CheckBox:indeterminate:disabled { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_mixed_insensitive.png); } CheckBox:indeterminate:focus { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_mixed_focus.png); } CheckBox:indeterminate:hover { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_mixed_hover.png); } CheckBox:indeterminate:pressed { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_mixed_press.png); } RadioButton { BackgroundBrush: url(:/assets/dark/checkbox/radio_unchecked.png); } RadioButton:disabled { BackgroundBrush: url(:/assets/dark/checkbox/radio_unchecked_insensitive.png); } RadioButton:focus { BackgroundBrush: url(:/assets/dark/checkbox/radio_unchecked_focus.png); } RadioButton:hover { BackgroundBrush: url(:/assets/dark/checkbox/radio_unchecked_hover.png); } RadioButton:pressed { BackgroundBrush: url(:/assets/dark/checkbox/radio_unchecked_press.png); } RadioButton:checked { BackgroundBrush: url(:/assets/dark/checkbox/radio_checked.png); } RadioButton:checked:disabled { BackgroundBrush: url(:/assets/dark/checkbox/radio_checked_insensitive.png); } RadioButton:checked:focus { BackgroundBrush: url(:/assets/dark/checkbox/radio_checked_focus.png); } RadioButton:checked:hover { BackgroundBrush: url(:/assets/dark/checkbox/radio_checked_hover.png); } RadioButton:checked:pressed { BackgroundBrush: url(:/assets/dark/checkbox/radio_checked_press.png); } RadioButton:indeterminate { BackgroundBrush: url(:/assets/dark/checkbox/radio_mixed.png); } RadioButton:indeterminate:disabled { BackgroundBrush: url(:/assets/dark/checkbox/radio_mixed_insensitive.png); } RadioButton:indeterminate:focus { BackgroundBrush: url(:/assets/dark/checkbox/radio_mixed_focus.png); } RadioButton:indeterminate:hover { BackgroundBrush: url(:/assets/dark/checkbox/radio_mixed_hover.png); } RadioButton:indeterminate:pressed { BackgroundBrush: url(:/assets/dark/checkbox/radio_mixed_press.png); } RubberBand { BackgroundBrush: rgba(43, 167, 248, 0.3); BorderBrush: rgba(30, 126, 255, 0.2); } HeaderView { ArrowIndicatorUpIcon: url(:/assets/dark/header_arrow_up.svg); ArrowIndicatorDownIcon: url(:/assets/dark/header_arrow_down.svg); } SpinBox { MinusBrush: url(:/assets/dark/spinbox/spinbutton_minus_normal.png); PlusBrush: url(:/assets/dark/spinbox/spinbutton_plus_normal.png); DownBrush: url(:/assets/dark/spinbox/spinbutton_down_normal.png); UpBrush: url(:/assets/dark/spinbox/spinbutton_up_normal.png); BorderColor: black; } SpinBox:disabled { MinusBrush: url(:/assets/dark/spinbox/spinbutton_minus_insensitive.png); PlusBrush: url(:/assets/dark/spinbox/spinbutton_plus_insensitive.png); DownBrush: url(:/assets/dark/spinbox/spinbutton_down_insensitive.png); UpBrush: url(:/assets/dark/spinbox/spinbutton_up_insensitive.png); BorderColor: black; } SpinBox:focus { BorderColor: rgba(43,167,248,0.6); } SpinBox:pressed { MinusBrush: url(:/assets/dark/spinbox/spinbutton_minus_press.png); PlusBrush: url(:/assets/dark/spinbox/spinbutton_plus_press.png); DownBrush: url(:/assets/dark/spinbox/spinbutton_down_press.png); UpBrush: url(:/assets/dark/spinbox/spinbutton_up_press.png); } SpinBox:hover { MinusBrush: url(:/assets/dark/spinbox/spinbutton_minus_hover.png); PlusBrush: url(:/assets/dark/spinbox/spinbutton_plus_hover.png); DownBrush: url(:/assets/dark/spinbox/spinbutton_down_hover.png); UpBrush: url(:/assets/dark/spinbox/spinbutton_up_hover.png); } TabBarScrollButton { BackgroundBrush: transparent; UpIcon: url(:/assets/dark/tabbar/pageup_normal.svg); DownIcon: url(:/assets/dark/tabbar/pagedown_normal.svg); } TabBarScrollButton:disabled { UpIcon: url(:/assets/dark/tabbar/pageup_insensitive.svg); DownIcon: url(:/assets/dark/tabbar/pagedown_insensitive.svg); } TabBarScrollButton:pressed { UpIcon: url(:/assets/dark/tabbar/pageup_press.svg); DownIcon: url(:/assets/dark/tabbar/pagedown_press.svg); } TabBarScrollButton:hover { UpIcon: url(:/assets/dark/tabbar/pageup_hover.svg); DownIcon: url(:/assets/dark/tabbar/pagedown_hover.svg); } TabBarAddButton { BackgroundBrush: transparent; Icon: url(:/assets/dark/tabbar/add_normal.svg); } TabBarAddButton:pressed { Icon: url(:/assets/dark/tabbar/add_press.svg); } TabBarAddButton:hover { Icon: url(:/assets/dark/tabbar/add_hover.svg); } TabBarTab { TextColor: "#c0c0c0"; BackgroundBrush: transparent; BorderBrush: rgba(0,0,0,0.1); ActiveColor: "#2ca7f8"; CloseIcon: url(:/assets/dark/tabbar/tab_close_normal.svg); CloseIconBackground: "#2a2a2a"; } TabBarTab:disabled { TextColor: "#949494"; } TabBarTab:pressed { CloseIcon: url(:/assets/dark/tabbar/tab_close_press.svg); } TabBarTab:hover { BackgroundBrush: rgba(255, 255, 255, 0.05); CloseIcon: url(:/assets/dark/tabbar/tab_close_hover.svg); } TabBarTab:selected { TextColor: "#2ca7f8"; } qt5integration-5.5.23/styleplugins/dstyleplugin/brushschemes/dlight.css000066400000000000000000000234271424734202100265370ustar00rootroot00000000000000QPalette { Base: transparent; Text: rgb(25,25,25); Window: rgb(255,255,255); WindowText: rgb(25,25,25); Highlight: "#2ca7f8"; HighlightedText: rgb(255,255,255); Button: qlineargradient(x1:0, y1:0 x2:0, y2:1, stop:0 "#fff", stop:1 "#fdfdfd"); ButtonText: "#000"; } QPalette:disabled { Text: rgba(0, 0, 0, 0.4); WindowText: rgba(0, 0, 0, 0.4); Highlight: rgba(44, 167, 248, 0.4); HighlightedText: rgba(255,255,255, 0.4); } Slider { GrooveColor: "#a4a4a4"; GrooveHighlightColor: "#2ca7f8"; HandleBrush: url(:/assets/light/slider/slider_handle_normal.svg); VernierHandleBrush: url(:/assets/light/slider/slider_point_handle.png); HandleBorderColor: lightgray; TickmarkColor: rgba(0,0,0,0.6); } Slider:focus { HandleBrush: url(:/assets/light/slider/slider_handle_focus.svg); VernierHandleBrush: url(:/assets/light/slider/slider_point_handle_focus.png); HandleBorderColor: "#2ca7f8"; } Slider:disabled { GrooveColor: rgba(163, 163, 163, 0.4); GrooveHighlightColor: "#aedfff"; HandleBrush: url(:/assets/light/slider/slider_handle_insensitive.svg); VernierHandleBrush: url(:/assets/light/slider/slider_point_handle_insensitive.png); HandleBorderColor: rgba(0, 0, 0, 0.1); } Slider:pressed { HandleBrush: url(:/assets/light/slider/slider_handle_press.svg); VernierHandleBrush: url(:/assets/light/slider/slider_point_handle_press.png); } ProgressBar { GrooveBackground: rgba(0, 0, 0, 0.05); GrooveBorder: rgba(255, 255, 255, 0.05); ContentBackground: "#2ca7f8"; ContentBorder: "#378cfa"; } PushButton { BackgroundBrush: qlineargradient(x1:0, y1:0 x2:0, y2:1, stop:0 "#fff", stop:1 "#fdfdfd"); TextColor: "#000"; SuggestTextColor: rgba(0, 132, 255, 1); BorderBrush: rgba(0,0,0,0.1); SuggestButtonColor: rgba(0, 132, 255, 0.4); } PushButton:disabled { BackgroundBrush: qlineargradient(x1: 0, y1: 0 x2: 0, y2: 1, stop:0 rgba(255, 255, 255, 0.4), stop:1 rgba(253, 253, 253, 0.4)); TextColor: "#AEAEAE"; SuggestTextColor: "#AEAEAE"; BorderBrush: rgba(0,0,0,0.04); SuggestButtonColor: rgba(0,0,0,0.04); } PushButton:hover { BackgroundBrush: qlineargradient(x1: 0, y1: 0 x2: 0, y2: 1, stop:0 "#8ccfff", stop:1 "#4bb8ff"); TextColor: "#fff"; SuggestTextColor: "#fff"; BorderBrush: rgba(0, 117, 243, 0.2); SuggestButtonColor: rgba(0, 117, 243, 0.2); } PushButton:pressed { BackgroundBrush: qlineargradient(x1: 0, y1: 0 x2: 0, y2: 1, stop:0 "#0b8cff", stop:1 "#0aa1ff"); TextColor: "#fff"; SuggestTextColor: "#fff"; BorderBrush: rgba(0, 0, 0, 0.05); SuggestButtonColor: rgba(29, 129, 255, 0.3); } PushButton:focus { BorderBrush: "#2ca7f8"; SuggestButtonColor: rgba(0, 132, 255, 0.4); } PushButton:flat { TextColor: "#0082fa"; SuggestTextColor: "#0082fa"; } PushButton:flat:disabled { TextColor: "#0060b9"; SuggestTextColor: "#0060b9"; } PushButton:flat:hover { TextColor: "#16b8ff"; SuggestTextColor: "#16b8ff"; } PushButton:flat:pressed { TextColor: "#0082fa"; SuggestTextColor: "#0082fa"; } LineEdit { BackgroundBrush: rgb(255,255,255); BorderBrush: rgba(0,0,0,0.1); AlertBorderBrush: "#FF8F00"; } LineEdit:disabled { BackgroundBrush: rgb(255,255,255); BorderBrush: rgba(0,0,0,0.04); } LineEdit:focus { BackgroundBrush: rgb(255,255,255); BorderBrush: rgb(44,167,248); } ScrollBar { HandleBrush: rgba(16, 16, 16, 0.5); } ScrollBar:hover { HandleBrush: rgba(16, 16, 16, 0.5); } ScrollBar:pressed { HandleBrush: rgba(16, 16, 16, 0.55); } ScrollBar:focus { HandleBorderBrush: "#2ca7f8"; } Menu { SeparatorColor: rgba(0, 0, 0, 0.1); BorderColor: rgba(0, 0, 0, 0.1); BackgroundBrush: rgb(255,255,255); } CheckBox { BackgroundBrush: url(:/assets/light/checkbox/checkbox_unchecked.png); } CheckBox:disabled { BackgroundBrush: url(:/assets/light/checkbox/checkbox_unchecked_insensitive.png); } CheckBox:focus { BackgroundBrush: url(:/assets/light/checkbox/checkbox_unchecked_focus.png); } CheckBox:hover { BackgroundBrush: url(:/assets/light/checkbox/checkbox_unchecked_hover.png); } CheckBox:pressed { BackgroundBrush: url(:/assets/light/checkbox/checkbox_unchecked_press.png); } CheckBox:checked { BackgroundBrush: url(:/assets/light/checkbox/checkbox_checked.png); } CheckBox:checked:disabled { BackgroundBrush: url(:/assets/light/checkbox/checkbox_checked_insensitive.png); } CheckBox:checked:focus { BackgroundBrush: url(:/assets/light/checkbox/checkbox_checked_focus.png); } CheckBox:checked:hover { BackgroundBrush: url(:/assets/light/checkbox/checkbox_checked_hover.png); } CheckBox:checked:pressed { BackgroundBrush: url(:/assets/light/checkbox/checkbox_checked_press.png); } CheckBox:indeterminate { BackgroundBrush: url(:/assets/light/checkbox/checkbox_mixed.png); } CheckBox:indeterminate:disabled { BackgroundBrush: url(:/assets/light/checkbox/checkbox_mixed_insensitive.png); } CheckBox:indeterminate:focus { BackgroundBrush: url(:/assets/light/checkbox/checkbox_mixed_focus.png); } CheckBox:indeterminate:hover { BackgroundBrush: url(:/assets/light/checkbox/checkbox_mixed_hover.png); } CheckBox:indeterminate:pressed { BackgroundBrush: url(:/assets/light/checkbox/checkbox_mixed_press.png); } RadioButton { BackgroundBrush: url(:/assets/light/checkbox/radio_unchecked.png); } RadioButton:disabled { BackgroundBrush: url(:/assets/light/checkbox/radio_unchecked_insensitive.png); } RadioButton:focus { BackgroundBrush: url(:/assets/light/checkbox/radio_unchecked_focus.png); } RadioButton:hover { BackgroundBrush: url(:/assets/light/checkbox/radio_unchecked_hover.png); } RadioButton:pressed { BackgroundBrush: url(:/assets/light/checkbox/radio_unchecked_press.png); } RadioButton:checked { BackgroundBrush: url(:/assets/light/checkbox/radio_checked.png); } RadioButton:checked:disabled { BackgroundBrush: url(:/assets/light/checkbox/radio_checked_insensitive.png); } RadioButton:checked:focus { BackgroundBrush: url(:/assets/light/checkbox/radio_checked_focus.png); } RadioButton:checked:hover { BackgroundBrush: url(:/assets/light/checkbox/radio_checked_hover.png); } RadioButton:checked:pressed { BackgroundBrush: url(:/assets/light/checkbox/radio_checked_press.png); } RadioButton:indeterminate { BackgroundBrush: url(:/assets/light/checkbox/radio_mixed.png); } RadioButton:indeterminate:disabled { BackgroundBrush: url(:/assets/light/checkbox/radio_mixed_insensitive.png); } RadioButton:indeterminate:focus { BackgroundBrush: url(:/assets/light/checkbox/radio_mixed_focus.png); } RadioButton:indeterminate:hover { BackgroundBrush: url(:/assets/light/checkbox/radio_mixed_hover.png); } RadioButton:indeterminate:pressed { BackgroundBrush: url(:/assets/light/checkbox/radio_mixed_press.png); } RubberBand { BackgroundBrush: rgba(43, 167, 248, 0.3); BorderBrush: rgba(30, 126, 255, 0.2); } HeaderView { ArrowIndicatorUpIcon: url(:/assets/light/header_arrow_up.png); ArrowIndicatorDownIcon: url(:/assets/light/header_arrow_down.png); } SpinBox { MinusBrush: url(:/assets/light/spinbox/spinbutton_minus_normal.png); PlusBrush: url(:/assets/light/spinbox/spinbutton_plus_normal.png); DownBrush: url(:/assets/light/spinbox/spinbutton_down_normal.png); UpBrush: url(:/assets/light/spinbox/spinbutton_up_normal.png); BorderColor: rgba(0,0,0,0.1); } SpinBox:disabled { MinusBrush: url(:/assets/light/spinbox/spinbutton_minus_insensitive.png); PlusBrush: url(:/assets/light/spinbox/spinbutton_plus_insensitive.png); DownBrush: url(:/assets/light/spinbox/spinbutton_down_insensitive.png); UpBrush: url(:/assets/light/spinbox/spinbutton_up_insensitive.png); BorderColor: rgba(0,0,0,0.04); } SpinBox:focus { BorderColor: rgb(44,167,248); } SpinBox:pressed { MinusBrush: url(:/assets/light/spinbox/spinbutton_minus_press.png); PlusBrush: url(:/assets/light/spinbox/spinbutton_plus_press.png); DownBrush: url(:/assets/light/spinbox/spinbutton_down_press.png); UpBrush: url(:/assets/light/spinbox/spinbutton_up_press.png); } SpinBox:hover { MinusBrush: url(:/assets/light/spinbox/spinbutton_minus_hover.png); PlusBrush: url(:/assets/light/spinbox/spinbutton_plus_hover.png); DownBrush: url(:/assets/light/spinbox/spinbutton_down_hover.png); UpBrush: url(:/assets/light/spinbox/spinbutton_up_hover.png); } TabBarScrollButton { BackgroundBrush: transparent; UpIcon: url(:/assets/light/tabbar/pageup_normal.svg); DownIcon: url(:/assets/light/tabbar/pagedown_normal.svg); } TabBarScrollButton:disabled { UpIcon: url(:/assets/light/tabbar/pageup_insensitive.svg); DownIcon: url(:/assets/light/tabbar/pagedown_insensitive.svg); } TabBarScrollButton:pressed { UpIcon: url(:/assets/light/tabbar/pageup_press.svg); DownIcon: url(:/assets/light/tabbar/pagedown_press.svg); } TabBarScrollButton:hover { UpIcon: url(:/assets/light/tabbar/pageup_hover.svg); DownIcon: url(:/assets/light/tabbar/pagedown_hover.svg); } TabBarAddButton { BackgroundBrush: transparent; Icon: url(:/assets/light/tabbar/add_normal.svg); } TabBarAddButton:pressed { Icon: url(:/assets/light/tabbar/add_press.svg); } TabBarAddButton:hover { Icon: url(:/assets/light/tabbar/add_hover.svg); } TabBarTab { BackgroundBrush: transparent; BorderBrush: rgba(0,0,0,0.1); TextColor: black; ActiveColor: "#2ca7f8"; CloseIcon: url(:/assets/light/tabbar/tab_close_normal.svg); CloseIconBackground: "#f3f3f3"; } TabBarTab:disabled { TextColor: "#949494"; } TabBarTab:pressed { CloseIcon: url(:/assets/light/tabbar/tab_close_press.svg); } TabBarTab:hover { BackgroundBrush: rgba(0, 0, 0, 0.05); CloseIcon: url(:/assets/light/tabbar/tab_close_hover.svg); } TabBarTab:selected { TextColor: "#2ca7f8"; } qt5integration-5.5.23/styleplugins/dstyleplugin/brushschemes/dsemidark.css000066400000000000000000000226521424734202100272260ustar00rootroot00000000000000QPalette { Base: transparent; Text: rgb(255,255,255); Window: "#202020"; WindowText: rgb(255,255,255); Highlight: rgba(44, 167, 248, 0.8); HighlightedText: rgba(255,255,255, 0.8); Button: rgba(255, 255, 255, 0.15); ButtonText: "#dcdcdc"; } QPalette:disabled { Text: rgba(255,255,255, 0.4); WindowText: rgba(255,255,255, 0.4); Highlight: rgba(44, 167, 248, 0.4); HighlightedText: rgba(255,255,255, 0.4); } Slider { GrooveColor: rgba(255, 255, 255, 0.2); GrooveHighlightColor: white; HandleBrush: url(:/assets/semidark/slider/slider_handle_normal.svg); VernierHandleBrush: url(:/assets/semidark/slider/slider_point_handle.png); HandleBorderColor: transparent; TickmarkColor: rgba(255,255,255,0.6); } Slider:focus { HandleBrush: url(:/assets/semidark/slider/slider_handle_focus.svg); VernierHandleBrush: url(:/assets/semidark/slider/slider_point_handle_focus.png); HandleBorderColor: "#2ca7f8"; } Slider:disabled { GrooveColor: rgba(255, 255, 255, 0.08); GrooveHighlightColor: "#0d4265"; HandleBrush: url(:/assets/semidark/slider/slider_handle_insensitive.svg); VernierHandleBrush: url(:/assets/semidark/slider/slider_point_handle_insensitive.png); HandleBorderColor: rgba(0, 0, 0, 0.1); } Slider:pressed { HandleBrush: url(:/assets/semidark/slider/slider_handle_press.svg); VernierHandleBrush: url(:/assets/semidark/slider/slider_point_handle_press.png); } ProgressBar { GrooveBackground: rgba(255, 255, 255, 0.1); GrooveBorder: transparent; ContentBackground: "#2ca7f8"; ContentBorder: "#378cfa"; } PushButton { BackgroundBrush: rgba(255, 255, 255, 0.15); TextColor: "white"; SuggestTextColor: rgba(0, 132, 255, 1); BorderBrush: transparent; SuggestButtonColor: rgba(0, 132, 255, 0.4); } PushButton:disabled { BackgroundBrush: rgba(255, 255, 255, 0.06); TextColor: "#40dcdcdc"; SuggestTextColor: "#40dcdcdc"; BorderBrush: transparent; SuggestButtonColor: transparent; } PushButton:hover { BackgroundBrush: rgba(255, 255, 255, 0.3); TextColor: white; SuggestTextColor: white; BorderBrush: transparent; SuggestButtonColor: transparent; } PushButton:pressed { BackgroundBrush: rgba(255,255,255,0.1); TextColor: "#2ca7f8"; SuggestTextColor: "#2ca7f8"; BorderBrush: rgba(0, 0, 0, 0.05); SuggestButtonColor: transparent; } PushButton:focus { BorderBrush: "#2ca7f8"; SuggestButtonColor: rgba(0, 132, 255, 0.4); } PushButton:flat { TextColor: "#0082fa"; SuggestTextColor: "#0082fa"; } PushButton:flat:disabled { TextColor: "#0060b9"; SuggestTextColor: "#0060b9"; } PushButton:flat:hover { TextColor: "#16b8ff"; SuggestTextColor: "#16b8ff"; } LineEdit { BackgroundBrush: rgba(255,255,255,0.15); BorderBrush: transparent; AlertBorderBrush: "#FF8F00"; } LineEdit:disabled { BackgroundBrush: rgba(255,255,255,0.04); } LineEdit:focus { BackgroundBrush: rgba(255,255,255,0.05); BorderBrush: rgba(43,167,248,0.6); } ScrollBar { HandleBrush: rgba(255, 255, 255, 0.2); HandleBroderBrush: rgba(255, 255, 255, 0.05); } ScrollBar:hover { HandleBrush: rgba(255, 255, 255, 0.4); HandleBroderBrush: rgba(255, 255, 255, 0.1); } ScrollBar:pressed { HandleBrush: rgba(96, 96, 96, 0.3); HandleBorderBrush: rgba(255, 255, 255, 0.05); } ScrollBar:focus { HandleBroderBrush: "#2ca7f8"; } Menu { BackgroundBrush: "#313131"; SeparatorColor: rgba(255, 255, 255, 0.1); BorderColor: rgba(0, 0, 0, 0.1); } CheckBox { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_unchecked.png); } CheckBox:disabled { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_unchecked_insensitive.png); } CheckBox:focus { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_unchecked_focus.png); } CheckBox:hover { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_unchecked_hover.png); } CheckBox:pressed { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_unchecked_press.png); } CheckBox:checked { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_checked.png); } CheckBox:checked:disabled { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_checked_insensitive.png); } CheckBox:checked:focus { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_checked_focus.png); } CheckBox:checked:hover { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_checked_hover.png); } CheckBox:checked:pressed { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_checked_press.png); } CheckBox:indeterminate { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_mixed.png); } CheckBox:indeterminate:disabled { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_mixed_insensitive.png); } CheckBox:indeterminate:focus { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_mixed_focus.png); } CheckBox:indeterminate:hover { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_mixed_hover.png); } CheckBox:indeterminate:pressed { BackgroundBrush: url(:/assets/dark/checkbox/checkbox_mixed_press.png); } RadioButton { BackgroundBrush: url(:/assets/dark/checkbox/radio_unchecked.png); } RadioButton:disabled { BackgroundBrush: url(:/assets/dark/checkbox/radio_unchecked_insensitive.png); } RadioButton:focus { BackgroundBrush: url(:/assets/dark/checkbox/radio_unchecked_focus.png); } RadioButton:hover { BackgroundBrush: url(:/assets/dark/checkbox/radio_unchecked_hover.png); } RadioButton:pressed { BackgroundBrush: url(:/assets/dark/checkbox/radio_unchecked_press.png); } RadioButton:checked { BackgroundBrush: url(:/assets/dark/checkbox/radio_checked.png); } RadioButton:checked:disabled { BackgroundBrush: url(:/assets/dark/checkbox/radio_checked_insensitive.png); } RadioButton:checked:focus { BackgroundBrush: url(:/assets/dark/checkbox/radio_checked_focus.png); } RadioButton:checked:hover { BackgroundBrush: url(:/assets/dark/checkbox/radio_checked_hover.png); } RadioButton:checked:pressed { BackgroundBrush: url(:/assets/dark/checkbox/radio_checked_press.png); } RadioButton:indeterminate { BackgroundBrush: url(:/assets/dark/checkbox/radio_mixed.png); } RadioButton:indeterminate:disabled { BackgroundBrush: url(:/assets/dark/checkbox/radio_mixed_insensitive.png); } RadioButton:indeterminate:focus { BackgroundBrush: url(:/assets/dark/checkbox/radio_mixed_focus.png); } RadioButton:indeterminate:hover { BackgroundBrush: url(:/assets/dark/checkbox/radio_mixed_hover.png); } RadioButton:indeterminate:pressed { BackgroundBrush: url(:/assets/dark/checkbox/radio_mixed_press.png); } RubberBand { BackgroundBrush: rgba(43, 167, 248, 0.3); BorderBrush: rgba(30, 126, 255, 0.2); } HeaderView { ArrowIndicatorUpIcon: url(:/assets/dark/header_arrow_up.png); ArrowIndicatorDownIcon: url(:/assets/dark/header_arrow_down.png); } SpinBox { MinusBrush: url(:/assets/dark/spinbox/spinbutton_minus_normal.png); PlusBrush: url(:/assets/dark/spinbox/spinbutton_plus_normal.png); DownBrush: url(:/assets/dark/spinbox/spinbutton_down_normal.png); UpBrush: url(:/assets/dark/spinbox/spinbutton_up_normal.png); BorderColor: black; } SpinBox:disabled { MinusBrush: url(:/assets/dark/spinbox/spinbutton_minus_insensitive.png); PlusBrush: url(:/assets/dark/spinbox/spinbutton_plus_insensitive.png); DownBrush: url(:/assets/dark/spinbox/spinbutton_down_insensitive.png); UpBrush: url(:/assets/dark/spinbox/spinbutton_up_insensitive.png); BorderColor: black; } SpinBox:focus { BorderColor: rgba(43,167,248,0.6); } SpinBox:pressed { MinusBrush: url(:/assets/dark/spinbox/spinbutton_minus_press.png); PlusBrush: url(:/assets/dark/spinbox/spinbutton_plus_press.png); DownBrush: url(:/assets/dark/spinbox/spinbutton_down_press.png); UpBrush: url(:/assets/dark/spinbox/spinbutton_up_press.png); } SpinBox:hover { MinusBrush: url(:/assets/dark/spinbox/spinbutton_minus_hover.png); PlusBrush: url(:/assets/dark/spinbox/spinbutton_plus_hover.png); DownBrush: url(:/assets/dark/spinbox/spinbutton_down_hover.png); UpBrush: url(:/assets/dark/spinbox/spinbutton_up_hover.png); } TabBarScrollButton { BackgroundBrush: transparent; UpIcon: url(:/assets/dark/tabbar/pageup_normal.svg); DownIcon: url(:/assets/dark/tabbar/pagedown_normal.svg); } TabBarScrollButton:disabled { UpIcon: url(:/assets/dark/tabbar/pageup_insensitive.svg); DownIcon: url(:/assets/dark/tabbar/pagedown_insensitive.svg); } TabBarScrollButton:pressed { UpIcon: url(:/assets/dark/tabbar/pageup_press.svg); DownIcon: url(:/assets/dark/tabbar/pagedown_press.svg); } TabBarScrollButton:hover { UpIcon: url(:/assets/dark/tabbar/pageup_hover.svg); DownIcon: url(:/assets/dark/tabbar/pagedown_hover.svg); } TabBarAddButton { BackgroundBrush: transparent; Icon: url(:/assets/dark/tabbar/add_normal.svg); } TabBarAddButton:pressed { Icon: url(:/assets/dark/tabbar/add_press.svg); } TabBarAddButton:hover { Icon: url(:/assets/dark/tabbar/add_hover.svg); } TabBarTab { TextColor: "#c0c0c0"; BackgroundBrush: transparent; BorderBrush: rgba(0,0,0,0.1); ActiveColor: "#2ca7f8"; CloseIcon: url(:/assets/dark/tabbar/tab_close_normal.svg); } TabBarTab:disabled { TextColor: "#949494"; } TabBarTab:pressed { CloseIcon: url(:/assets/dark/tabbar/tab_close_press.svg); } TabBarTab:hover { BackgroundBrush: rgba(255, 255, 255, 0.05); CloseIcon: url(:/assets/dark/tabbar/tab_close_hover.svg); } qt5integration-5.5.23/styleplugins/dstyleplugin/brushschemes/dsemilight.css000066400000000000000000000233201424734202100274050ustar00rootroot00000000000000QPalette { Base: transparent; Text: rgb(25,25,25); Window: rgb(255,255,255); WindowText: rgb(25,25,25); Highlight: rgba(44, 167, 248, 0.8); HighlightedText: rgba(255,255,255, 0.8); Button: qlineargradient(x1:0, y1:0 x2:0, y2:1, stop:0 "#fff", stop:1 "#fdfdfd"); ButtonText: "#000"; } QPalette:disabled { Text: rgba(0, 0, 0, 0.4); WindowText: rgba(0, 0, 0, 0.4); Highlight: rgba(44, 167, 248, 0.4); HighlightedText: rgba(255, 255, 255, 0.4); } Slider { GrooveColor: "#a4a4a4"; GrooveHighlightColor: "#2ca7f8"; HandleBrush: url(:/assets/semilight/slider/slider_handle_normal.svg); VernierHandleBrush: url(:/assets/semilight/slider/slider_point_handle.png); HandleBorderColor: lightgray; TickmarkColor: rgba(0,0,0,0.6); } Slider:focus { HandleBrush: url(:/assets/semilight/slider/slider_handle_focus.svg); VernierHandleBrush: url(:/assets/semilight/slider/slider_point_handle_focus.png); HandleBorderColor: "#2ca7f8"; } Slider:disabled { GrooveColor: rgba(163, 163, 163, 0.4); GrooveHighlightColor: "#aedfff"; HandleBrush: url(:/assets/semilight/slider/slider_handle_insensitive.svg); VernierHandleBrush: url(:/assets/semilight/slider/slider_point_handle_insensitive.png); HandleBorderColor: rgba(0, 0, 0, 0.1); } Slider:pressed { HandleBrush: url(:/assets/semilight/slider/slider_handle_press.svg); VernierHandleBrush: url(:/assets/semilight/slider/slider_point_handle_press.png); } ProgressBar { GrooveBackground: rgba(0, 0, 0, 0.05); GrooveBorder: rgba(255, 255, 255, 0.05); ContentBackground: "#2ca7f8"; ContentBorder: "#378cfa"; } PushButton { BackgroundBrush: qlineargradient(x1:0, y1:0 x2:0, y2:1, stop:0 "#fff", stop:1 "#fdfdfd"); TextColor: "#000"; SuggestTextColor: rgba(0, 132, 255, 1); BorderBrush: rgba(0,0,0,0.1); SuggestButtonColor: rgba(0, 132, 255, 0.4); } PushButton:disabled { BackgroundBrush: qlineargradient(x1: 0, y1: 0 x2: 0, y2: 1, stop:0 rgba(255, 255, 255, 0.4), stop:1 rgba(253, 253, 253, 0.4)); TextColor: "#AEAEAE"; SuggestTextColor: "#AEAEAE"; BorderBrush: rgba(0,0,0,0.04); SuggestButtonColor: rgba(0,0,0,0.04); } PushButton:hover { BackgroundBrush: qlineargradient(x1: 0, y1: 0 x2: 0, y2: 1, stop:0 "#8ccfff", stop:1 "#4bb8ff"); TextColor: "#fff"; SuggestTextColor: "#fff"; BorderBrush: rgba(0, 117, 243, 0.2); SuggestButtonColor: rgba(0, 117, 243, 0.2); } PushButton:pressed { BackgroundBrush: qlineargradient(x1: 0, y1: 0 x2: 0, y2: 1, stop:0 "#0b8cff", stop:1 "#0aa1ff"); TextColor: "#fff"; SuggestTextColor: "#fff"; BorderBrush: rgba(0, 0, 0, 0.05); SuggestButtonColor: rgba(29, 129, 255, 0.3); } PushButton:focus { BorderBrush: "#2ca7f8"; SuggestButtonColor: rgba(0, 132, 255, 0.4); } PushButton:flat { TextColor: "#0082fa"; SuggestTextColor: "#0082fa"; } PushButton:flat:disabled { TextColor: "#0060b9"; SuggestTextColor: "#0060b9"; } PushButton:flat:hover { TextColor: "#16b8ff"; SuggestTextColor: "#16b8ff"; } PushButton:flat:pressed { TextColor: "#0082fa"; SuggestTextColor: "#0082fa"; } LineEdit { BackgroundBrush: rgb(255,255,255); BorderBrush: rgba(0,0,0,0.1); AlertBorderBrush: "#FF8F00"; } LineEdit:disabled { BackgroundBrush: rgb(255,255,255); BorderBrush: rgba(0,0,0,0.04); } LineEdit:focus { BackgroundBrush: rgb(255,255,255); BorderBrush: rgb(44,167,248); } ScrollBar { HandleBrush: rgba(16, 16, 16, 0.5); } ScrollBar:hover { HandleBrush: rgba(16, 16, 16, 0.5); } ScrollBar:pressed { HandleBrush: rgba(16, 16, 16, 0.55); } ScrollBar:focus { HandleBorderBrush: "#2ca7f8"; } Menu { SeparatorColor: rgba(0, 0, 0, 0.1); BorderColor: rgba(0, 0, 0, 0.1); } CheckBox { BackgroundBrush: url(:/assets/light/checkbox/checkbox_unchecked.png); } CheckBox:disabled { BackgroundBrush: url(:/assets/light/checkbox/checkbox_unchecked_insensitive.png); } CheckBox:focus { BackgroundBrush: url(:/assets/light/checkbox/checkbox_unchecked_focus.png); } CheckBox:hover { BackgroundBrush: url(:/assets/light/checkbox/checkbox_unchecked_hover.png); } CheckBox:pressed { BackgroundBrush: url(:/assets/light/checkbox/checkbox_unchecked_press.png); } CheckBox:checked { BackgroundBrush: url(:/assets/light/checkbox/checkbox_checked.png); } CheckBox:checked:disabled { BackgroundBrush: url(:/assets/light/checkbox/checkbox_checked_insensitive.png); } CheckBox:checked:focus { BackgroundBrush: url(:/assets/light/checkbox/checkbox_checked_focus.png); } CheckBox:checked:hover { BackgroundBrush: url(:/assets/light/checkbox/checkbox_checked_hover.png); } CheckBox:checked:pressed { BackgroundBrush: url(:/assets/light/checkbox/checkbox_checked_press.png); } CheckBox:indeterminate { BackgroundBrush: url(:/assets/light/checkbox/checkbox_mixed.png); } CheckBox:indeterminate:disabled { BackgroundBrush: url(:/assets/light/checkbox/checkbox_mixed_insensitive.png); } CheckBox:indeterminate:focus { BackgroundBrush: url(:/assets/light/checkbox/checkbox_mixed_focus.png); } CheckBox:indeterminate:hover { BackgroundBrush: url(:/assets/light/checkbox/checkbox_mixed_hover.png); } CheckBox:indeterminate:pressed { BackgroundBrush: url(:/assets/light/checkbox/checkbox_mixed_press.png); } RadioButton { BackgroundBrush: url(:/assets/light/checkbox/radio_unchecked.png); } RadioButton:disabled { BackgroundBrush: url(:/assets/light/checkbox/radio_unchecked_insensitive.png); } RadioButton:focus { BackgroundBrush: url(:/assets/light/checkbox/radio_unchecked_focus.png); } RadioButton:hover { BackgroundBrush: url(:/assets/light/checkbox/radio_unchecked_hover.png); } RadioButton:pressed { BackgroundBrush: url(:/assets/light/checkbox/radio_unchecked_press.png); } RadioButton:checked { BackgroundBrush: url(:/assets/light/checkbox/radio_checked.png); } RadioButton:checked:disabled { BackgroundBrush: url(:/assets/light/checkbox/radio_checked_insensitive.png); } RadioButton:checked:focus { BackgroundBrush: url(:/assets/light/checkbox/radio_checked_focus.png); } RadioButton:checked:hover { BackgroundBrush: url(:/assets/light/checkbox/radio_checked_hover.png); } RadioButton:checked:pressed { BackgroundBrush: url(:/assets/light/checkbox/radio_checked_press.png); } RadioButton:indeterminate { BackgroundBrush: url(:/assets/light/checkbox/radio_mixed.png); } RadioButton:indeterminate:disabled { BackgroundBrush: url(:/assets/light/checkbox/radio_mixed_insensitive.png); } RadioButton:indeterminate:focus { BackgroundBrush: url(:/assets/light/checkbox/radio_mixed_focus.png); } RadioButton:indeterminate:hover { BackgroundBrush: url(:/assets/light/checkbox/radio_mixed_hover.png); } RadioButton:indeterminate:pressed { BackgroundBrush: url(:/assets/light/checkbox/radio_mixed_press.png); } RubberBand { BackgroundBrush: rgba(43, 167, 248, 0.3); BorderBrush: rgba(30, 126, 255, 0.2); } HeaderView { ArrowIndicatorUpIcon: url(:/assets/light/header_arrow_up.png); ArrowIndicatorDownIcon: url(:/assets/light/header_arrow_down.png); } SpinBox { MinusBrush: url(:/assets/light/spinbox/spinbutton_minus_normal.png); PlusBrush: url(:/assets/light/spinbox/spinbutton_plus_normal.png); DownBrush: url(:/assets/light/spinbox/spinbutton_down_normal.png); UpBrush: url(:/assets/light/spinbox/spinbutton_up_normal.png); BorderColor: rgba(0,0,0,0.1); } SpinBox:disabled { MinusBrush: url(:/assets/light/spinbox/spinbutton_minus_insensitive.png); PlusBrush: url(:/assets/light/spinbox/spinbutton_plus_insensitive.png); DownBrush: url(:/assets/light/spinbox/spinbutton_down_insensitive.png); UpBrush: url(:/assets/light/spinbox/spinbutton_up_insensitive.png); BorderColor: rgba(0,0,0,0.04); } SpinBox:focus { BorderColor: rgb(44,167,248); } SpinBox:pressed { MinusBrush: url(:/assets/light/spinbox/spinbutton_minus_press.png); PlusBrush: url(:/assets/light/spinbox/spinbutton_plus_press.png); DownBrush: url(:/assets/light/spinbox/spinbutton_down_press.png); UpBrush: url(:/assets/light/spinbox/spinbutton_up_press.png); } SpinBox:hover { MinusBrush: url(:/assets/light/spinbox/spinbutton_minus_hover.png); PlusBrush: url(:/assets/light/spinbox/spinbutton_plus_hover.png); DownBrush: url(:/assets/light/spinbox/spinbutton_down_hover.png); UpBrush: url(:/assets/light/spinbox/spinbutton_up_hover.png); } TabBarScrollButton { BackgroundBrush: transparent; UpIcon: url(:/assets/light/tabbar/pageup_normal.svg); DownIcon: url(:/assets/light/tabbar/pagedown_normal.svg); } TabBarScrollButton:disabled { UpIcon: url(:/assets/light/tabbar/pageup_insensitive.svg); DownIcon: url(:/assets/light/tabbar/pagedown_insensitive.svg); } TabBarScrollButton:pressed { UpIcon: url(:/assets/light/tabbar/pageup_press.svg); DownIcon: url(:/assets/light/tabbar/pagedown_press.svg); } TabBarScrollButton:hover { UpIcon: url(:/assets/light/tabbar/pageup_hover.svg); DownIcon: url(:/assets/light/tabbar/pagedown_hover.svg); } TabBarAddButton { BackgroundBrush: transparent; Icon: url(:/assets/light/tabbar/add_normal.svg); } TabBarAddButton:pressed { Icon: url(:/assets/light/tabbar/add_press.svg); } TabBarAddButton:hover { Icon: url(:/assets/light/tabbar/add_hover.svg); } TabBarTab { BackgroundBrush: transparent; BorderBrush: rgba(0,0,0,0.1); TextColor: black; ActiveColor: "#2ca7f8"; CloseIcon: url(:/assets/light/tabbar/tab_close_normal.svg); } TabBarTab:disabled { TextColor: "#949494"; } TabBarTab:pressed { CloseIcon: url(:/assets/light/tabbar/tab_close_press.svg); } TabBarTab:hover { BackgroundBrush: rgba(0, 0, 0, 0.05); CloseIcon: url(:/assets/light/tabbar/tab_close_hover.svg); } qt5integration-5.5.23/styleplugins/dstyleplugin/checkboxhelper.cpp000066400000000000000000000020661424734202100255450ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "style.h" #include "paletteextended.h" #include #include #include namespace dstyle { bool Style::drawIndicatorCheckBoxPrimitive(const QStyleOption *opt, QPainter *p, const QWidget *widget) const { Q_UNUSED(widget) fillBrush(p, opt->rect, m_palette->brush(PaletteExtended::CheckBox_BackgroundBrush, opt)); return true; } } qt5integration-5.5.23/styleplugins/dstyleplugin/colorutils.cpp000066400000000000000000000016571424734202100247630ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include "colorutils.h" namespace dstyle { QColor ColorUtils::alphaColor(QColor color, qreal alpha) { if( alpha >= 0 && alpha < 1.0 ) { color.setAlphaF( alpha*color.alphaF() ); } return color; } } // end namespace dstyle. qt5integration-5.5.23/styleplugins/dstyleplugin/colorutils.h000066400000000000000000000016551424734202100244260ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #ifndef COLORUTILS_H #define COLORUTILS_H #include namespace dstyle { class ColorUtils { public: //* add alpha channel multiplier to color static QColor alphaColor( QColor color, qreal alpha ); }; } #endif // COLORUTILS_H qt5integration-5.5.23/styleplugins/dstyleplugin/comboboxhelper.cpp000066400000000000000000000215731424734202100255730ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include "style.h" #include #include #include #include #include #include "paletteextended.h" #include "geometryutils.h" namespace dstyle { extern PaletteExtended::PseudoClassType lineEditStateToPseudoClassType(QStyle::State state); void Style::drawComboBoxPopupFramePrimitive(const QStyleOption *option, QPainter *painter) const { const QRect rect( option->rect ); painter->setRenderHints(painter->renderHints() | QPainter::Antialiasing); painter->setPen(m_palette->brush(PaletteExtended::Menu_BorderColor).color()); painter->setBrush(option->palette.brush(QPalette::Background)); painter->drawRoundedRect(rect, 4, 4); } bool Style::drawComboBox(const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const { // cast option and check const QStyleOptionComboBox* comboBoxOption( qstyleoption_cast( option ) ); if( !comboBoxOption ) return true; // rect and palette const QRect& rect( option->rect ); const QPalette& palette( option->palette ); Q_UNUSED(palette) // state const bool editable( comboBoxOption->editable ); bool flat( !comboBoxOption->frame ); // frame if( option->subControls & SC_ComboBoxFrame ) { if( editable ) { /*flat |= ( rect.height() <= 2*Metrics::Frame_FrameWidth + Metrics::MenuButton_IndicatorWidth ); if ( flat ) { const QColor background( palette.color( QPalette::Base ) ); painter->setBrush( background ); painter->setPen( Qt::NoPen ); painter->drawRect( rect ); } else*/ { proxy()->drawPrimitive( PE_FrameLineEdit, option, painter, widget ); } } else { if( flat ) { } else { // TODO(hualet): update button color from palette in case button is default const QColor shadow( Qt::transparent ); const QBrush outline(m_palette->brush(PaletteExtended::PushButton_BorderBrush, option)); const QBrush background(m_palette->brush(PaletteExtended::PushButton_BackgroundBrush, option)); // render drawPushButtonFrame(painter, rect, QBrush(background), QBrush(outline), shadow); } } } if (option->subControls & SC_ComboBoxArrow) { QBrush brush = m_palette->brush(PaletteExtended::HeaderView_ArrowIndicatorDownIcon); if (brush.style() != Qt::TexturePattern) return false; // arrow rect QRect arrowRect( proxy()->subControlRect( CC_ComboBox, option, SC_ComboBoxArrow, widget ) ); fillBrush(painter, arrowRect, brush); if (editable) { painter->setPen(QPen(m_palette->brush(PaletteExtended::LineEdit_BorderBrush, lineEditStateToPseudoClassType(option->state)), 1)); painter->drawLine(arrowRect.topLeft() - QPoint(1, 1), arrowRect.bottomLeft() + QPoint(-1, 1)); } } return option->subControls & (SC_ComboBoxFrame | SC_ComboBoxArrow); } QRect Style::comboBoxSubControlRect(const QStyleOptionComplex *opt, QStyle::SubControl sc, const QWidget *widget) const { Q_UNUSED(widget); if (const QStyleOptionComboBox *cb = qstyleoption_cast(opt)) { QRect ret; int x = cb->rect.x(), y = cb->rect.y(), wi = cb->rect.width(), he = cb->rect.height(); int xpos = x; int margin = cb->frame ? 3 : 0; int bmarg = cb->frame ? 2 : 0; xpos += wi - bmarg - 16; switch (sc) { case SC_ComboBoxFrame: ret = cb->rect; break; case SC_ComboBoxArrow: ret.setRect(xpos, y + bmarg, 16, he - 2*bmarg); break; case SC_ComboBoxEditField: ret.setRect(x + margin, y + margin, wi - 2 * margin - 16, he - 2 * margin); break; case SC_ComboBoxListBoxPopup: ret = cb->rect; break; default: break; } return visualRect(cb->direction, cb->rect, ret); } return opt->rect; } bool Style::drawComboBoxLabelControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { // cast option and check const QStyleOptionComboBox* cb( qstyleoption_cast( option ) ); if( !cb ) return false; // copy rect and palette const QRect& rect( option->rect.adjusted(0, 0, -20, 0) ); // state const QStyle::State& state( option->state ); const bool enabled( state & QStyle::State_Enabled ); const bool sunken( state & (QStyle::State_On | QStyle::State_Sunken) ); const bool mouseOver(option->state & QStyle::State_MouseOver); const bool hasFocus(option->state & QStyle::State_HasFocus); const bool flat(!cb->frame); const bool editable(cb->editable); // content const bool hasText( !cb->currentText.isEmpty() ); const bool hasIcon( !cb->currentIcon.isNull() ); // contents QRect contentsRect( rect ); if( sunken && !flat ) contentsRect.translate( 1, 1 ); contentsRect.adjust(Metrics::Layout_ChildMarginWidth, 0, -Metrics::Layout_ChildMarginWidth, 0); // icon size QSize iconSize; if( hasIcon ) { iconSize = cb->iconSize; if( !iconSize.isValid() ) { const int metric( widget->style()->pixelMetric( QStyle::PM_SmallIconSize, option, widget ) ); iconSize = QSize( metric, metric ); } } // text size int textFlags( Qt::AlignVCenter | Qt::AlignLeft ); const QSize textSize( option->fontMetrics.size( textFlags, cb->currentText ) ); if (styleHint(SH_UnderlineShortcut, cb, widget)) textFlags |= Qt::TextShowMnemonic; else textFlags |= Qt::TextHideMnemonic; // adjust text and icon rect based on options QRect iconRect; QRect textRect; if( hasText && !hasIcon ) textRect = contentsRect; else if( hasIcon && !hasText ) iconRect = contentsRect; else { const int contentsWidth( iconSize.width() + textSize.width() + Metrics::Button_ItemSpacing ); const int contentLeftPadding = flat ? (contentsRect.width() - contentsWidth )/2 : 0; iconRect = QRect( QPoint( contentsRect.left() + contentLeftPadding, contentsRect.top() + (contentsRect.height() - iconSize.height())/2 ), iconSize ); textRect = QRect( QPoint( iconRect.right() + Metrics::Button_ItemSpacing + 1, contentsRect.top() + (contentsRect.height() - textSize.height())/2 ), textSize ); } // handle right to left if( iconRect.isValid() ) iconRect = widget->style()->visualRect( option->direction, option->rect, iconRect ); if( textRect.isValid() ) textRect = widget->style()->visualRect( option->direction, option->rect, textRect ); // make sure there is enough room for icon if( iconRect.isValid() ) iconRect = GeometryUtils::centerRect( iconRect, iconSize ); // render icon if( hasIcon && iconRect.isValid() ) { // icon state and mode const QIcon::State iconState( sunken ? QIcon::On : QIcon::Off ); QIcon::Mode iconMode; if( !enabled ) iconMode = QIcon::Disabled; else if( !flat && hasFocus ) iconMode = QIcon::Selected; else if( mouseOver && flat ) iconMode = QIcon::Active; else iconMode = QIcon::Normal; const QPixmap pixmap = cb->currentIcon.pixmap( iconSize, iconMode, iconState ); widget->style()->drawItemPixmap( painter, iconRect, Qt::AlignCenter, pixmap ); } // render text if( hasText && textRect.isValid() && !editable) { painter->setPen(m_palette->brush(PaletteExtended::PushButton_TextColor, option).color()); painter->drawText(textRect, textFlags, cb->currentText); } return true; } bool Style::widgetIsComboBoxPopupFramePrimitive(const QWidget *w) { if (!w) return false; // combo box drop-list. // line edit completer drop-list return w->inherits("QComboBoxListView") || w->inherits("QComboBoxPrivateContainer") || (w->inherits("QAbstractItemView") && w->isTopLevel()); } } qt5integration-5.5.23/styleplugins/dstyleplugin/common.h000066400000000000000000000106721424734202100235160ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #ifndef COMMON_H #define COMMON_H #include namespace dstyle { enum StyleType { StyleDark, StyleLight, StyleSemiDark, StyleSemiLight }; enum Metrics { // painter Painter_PenWidth = 1, // frames Frame_FrameWidth = 2, Frame_FrameRadius = 4, // layout Layout_TopLevelMarginWidth = 10, Layout_ChildMarginWidth = 4, Layout_DefaultSpacing = 6, // line editors LineEdit_FrameWidth = 2, LineEdit_LeftMargin = 3, // combobox ComboBox_FrameWidth = 6, // spinbox SpinBox_FrameWidth = LineEdit_FrameWidth, SpinBox_ArrowButtonWidth = 20, // groupbox title margin GroupBox_TitleMarginWidth = 4, // buttons Button_MinWidth = 80, Button_MarginWidth = 6, Button_ItemSpacing = 4, // tool buttons ToolButton_MarginWidth = 6, ToolButton_ItemSpacing = 4, ToolButton_InlineIndicatorWidth = 12, // checkboxes and radio buttons CheckBox_Size = 20, CheckBox_FocusMarginWidth = 2, CheckBox_ItemSpacing = 4, // menu Menu_ItemHMargin = 0, Menu_ItemVMargin = -1, Menu_ArrowHMargin = 6, Menu_CheckMarkWidth = 12, Menu_RightBorder = 10, Menu_ItemFrameWidth = 2, Menu_ItemHTextMargin = 3, Menu_ItemVTextMargin = 8, Menu_FrameWidth = 0, Menu_HMargin = 0, Menu_VMargin = 4, Menu_SeparatorItemHMargin = 5, Menu_PanelRightPadding = 10, MenuItem_MarginWidth = 3, MenuItem_ItemSpacing = 4, MenuItem_AcceleratorSpace = 16, MenuButton_IndicatorWidth = 20, // menu bar MenuBar_ItemSpacing = 6, MenuBarItem_MarginWidth = 10, MenuBarItem_MarginHeight = 6, // scrollbars ScrollBar_Extend = 12, ScrollBar_SliderWidth = 15, ScrollBar_MinSliderHeight = 40, ScrollBar_NoButtonHeight = (ScrollBar_Extend-ScrollBar_SliderWidth)/2, ScrollBar_SingleButtonHeight = ScrollBar_Extend, ScrollBar_DoubleButtonHeight = 2*ScrollBar_Extend, // toolbars ToolBar_FrameWidth = 2, ToolBar_HandleExtent = 10, ToolBar_HandleWidth = 6, ToolBar_SeparatorWidth = 8, ToolBar_ExtensionWidth = 20, ToolBar_ItemSpacing = 0, // progressbars ProgressBar_BusyIndicatorSize = 14, ProgressBar_ItemSpacing = 4, // mdi title bar TitleBar_MarginWidth = 4, // sliders Slider_TickLength = 10, Slider_TickMarginWidth = 6, Slider_GrooveThickness = 2, Slider_ControlThickness = 24, // tabbar TabBar_TabMarginHeight = 4, TabBar_TabMarginWidth = 8, TabBar_TabMinWidth = 80, TabBar_TabMinHeight = 28, TabBar_TabItemSpacing = 8, TabBar_TabOverlap = 1, TabBar_BaseOverlap = 2, // tab widget TabWidget_MarginWidth = 4, // toolbox ToolBox_TabMinWidth = 80, ToolBox_TabItemSpacing = 4, ToolBox_TabMarginWidth = 8, // tooltips ToolTip_FrameWidth = 3, // list headers Header_MarginWidth = 6, Header_ItemSpacing = 4, Header_ArrowSize = 12, // tree view ItemView_ArrowSize = 10, ItemView_ItemMarginWidth = 3, SidePanel_ItemMarginWidth = 4, // splitter Splitter_SplitterWidth = 1, // shadow dimensions Shadow_Overlap = 2, // group box GroupBox_TopMargin = 3, // progress bar ProgressBar_BorderWidth = 1, ProgressBar_Radius = 4 }; //* corners enum Corner { CornerTopLeft = 0x1, CornerTopRight = 0x2, CornerBottomLeft = 0x4, CornerBottomRight = 0x8, CornersTop = CornerTopLeft|CornerTopRight, CornersBottom = CornerBottomLeft|CornerBottomRight, CornersLeft = CornerTopLeft|CornerBottomLeft, CornersRight = CornerTopRight|CornerBottomRight, AllCorners = CornerTopLeft|CornerTopRight|CornerBottomLeft|CornerBottomRight }; Q_DECLARE_FLAGS(Corners, Corner) } Q_DECLARE_OPERATORS_FOR_FLAGS(dstyle::Corners) #endif // COMMON_H qt5integration-5.5.23/styleplugins/dstyleplugin/commonhelper.cpp000066400000000000000000000053061424734202100252470ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include #include #include #include "style.h" #include "commonhelper.h" #include "geometryutils.h" namespace dstyle { void CommonHelper::renderFrame(QPainter *painter, const QRect &rect, const QBrush &brush, const QBrush &outline) { painter->setRenderHint( QPainter::Antialiasing ); QRectF frameRect( rect ); qreal radius( GeometryUtils::frameRadius() ); // set pen if( outline.style() != Qt::NoBrush ) { painter->setPen( QPen(outline, Metrics::Painter_PenWidth) ); } else { painter->setPen( Qt::NoPen ); } // set brush painter->setBrush( brush ); // render painter->drawRoundedRect( frameRect.adjusted(0.5, 0.5, -0.5, -0.5), radius, radius ); } Style *CommonHelper::widgetStyle(const QWidget *widget) { if (!widget) return Q_NULLPTR; Style *style (Q_NULLPTR); style = qobject_cast(widget->style()); if (!style) { // FIXME(hualet): why qobject_cast won't work and cause the whole plugin // to stop loading. if (widget->style()->metaObject()->className() != QLatin1String("QStyleSheetStyle")) return Q_NULLPTR; QStyleSheetStyle * sstyle = static_cast(widget->style()); // FIXME(hualet): don't know why QStyleSheetStyle::base can be empty sometime, // and also don't know why QStyleSheetStyle::baseStyle is not exported or something, // causing the program to crash if I use baseStyle() instead of base directly here. // Basically below 9 lines are copied from QStyleSheetStyle::baseStyle implementation. QStyle *base ( Q_NULLPTR ); if (sstyle->base) { base = sstyle->base; } else if (qApp->style()->metaObject()->className() == QLatin1String("QStyleSheetStyle")) { base = static_cast(qApp->style())->base; } else { base = qApp->style(); } style = qobject_cast(base); } return style; } } qt5integration-5.5.23/styleplugins/dstyleplugin/commonhelper.h000066400000000000000000000020021424734202100247020ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #ifndef COMMONHELPER_H #define COMMONHELPER_H #include namespace dstyle { class Style; class CommonHelper { public: static void renderFrame(QPainter* painter, const QRect& rect, const QBrush &brush, const QBrush &outline); static Style *widgetStyle(const QWidget *widget); }; } #endif // COMMONHELPER_H qt5integration-5.5.23/styleplugins/dstyleplugin/config.tests/000077500000000000000000000000001424734202100244555ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/config.tests/dtkwidget/000077500000000000000000000000001424734202100264435ustar00rootroot00000000000000qt5integration-5.5.23/styleplugins/dstyleplugin/config.tests/dtkwidget/dtkwidget.pro000066400000000000000000000001161424734202100311510ustar00rootroot00000000000000CONFIG += qt c++11 link_pkgconfig PKGCONFIG += dtkwidget SOURCES += main.cpp qt5integration-5.5.23/styleplugins/dstyleplugin/config.tests/dtkwidget/main.cpp000066400000000000000000000016231424734202100300750ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include #include int main() { QWindow *w = new QWindow(); Dtk::Widget::DPlatformWindowHandle handle((QWidget *)w); handle.setEnableBlurWindow(true); return 0; } qt5integration-5.5.23/styleplugins/dstyleplugin/dstyleanimation.cpp000066400000000000000000000222211424734202100257560ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "dstyleanimation.h" #ifndef QT_NO_ANIMATION #include #include #include namespace dstyle { static const qreal ScrollBarFadeOutDuration = 1500.0; static const qreal ScrollBarFadeOutDelay = 450.0; DStyleAnimation::DStyleAnimation(QObject *target) : QAbstractAnimation(target), _delay(0), _duration(-1), _startTime(QTime::currentTime()), _fps(ThirtyFps), _skip(0) { } DStyleAnimation::~DStyleAnimation() { } QObject *DStyleAnimation::target() const { return parent(); } int DStyleAnimation::duration() const { return _duration; } void DStyleAnimation::setDuration(int duration) { _duration = duration; } int DStyleAnimation::delay() const { return _delay; } void DStyleAnimation::setDelay(int delay) { _delay = delay; } QTime DStyleAnimation::startTime() const { return _startTime; } void DStyleAnimation::setStartTime(const QTime &time) { _startTime = time; } QAbstractAnimation::DeletionPolicy DStyleAnimation::deletePolicy() const { return QAbstractAnimation::DeletionPolicy(_policy); } // policy will be applied the next time start() is called. void DStyleAnimation::setDeletePolicy(QAbstractAnimation::DeletionPolicy policy) { if (_policy == policy) return; _policy = policy; } DStyleAnimation::FrameRate DStyleAnimation::frameRate() const { return _fps; } void DStyleAnimation::setFrameRate(FrameRate fps) { _fps = fps; } void DStyleAnimation::updateTarget() { QEvent event(QEvent::StyleAnimationUpdate); event.setAccepted(false); QCoreApplication::sendEvent(target(), &event); if (!event.isAccepted()) stop(); } void DStyleAnimation::start() { _skip = 0; QAbstractAnimation::start(deletePolicy()); } bool DStyleAnimation::isUpdateNeeded() const { return currentTime() > _delay; } void DStyleAnimation::updateCurrentTime(int) { if (++_skip >= _fps) { _skip = 0; if (target() && isUpdateNeeded()) updateTarget(); } } DProgressStyleAnimation::DProgressStyleAnimation(int speed, QObject *target) : DStyleAnimation(target), _speed(speed), _step(-1) { } int DProgressStyleAnimation::animationStep() const { return currentTime() / (1000.0 / _speed); } int DProgressStyleAnimation::progressStep(int width) const { int step = animationStep(); int progress = (step * width / _speed) % width; if (((step * width / _speed) % (2 * width)) >= width) progress = width - progress; return progress; } int DProgressStyleAnimation::speed() const { return _speed; } void DProgressStyleAnimation::setSpeed(int speed) { _speed = speed; } bool DProgressStyleAnimation::isUpdateNeeded() const { if (DStyleAnimation::isUpdateNeeded()) { int current = animationStep(); if (_step == -1 || _step != current) { _step = current; return true; } } return false; } DNumberStyleAnimation::DNumberStyleAnimation(QObject *target) : DStyleAnimation(target), _start(0.0), _end(1.0), _prev(0.0) { setDuration(250); } qreal DNumberStyleAnimation::startValue() const { return _start; } void DNumberStyleAnimation::setStartValue(qreal value) { _start = value; } qreal DNumberStyleAnimation::endValue() const { return _end; } void DNumberStyleAnimation::setEndValue(qreal value) { _end = value; } qreal DNumberStyleAnimation::currentValue() const { qreal step = qreal(currentTime() - delay()) / (duration() - delay()); return _start + qMax(qreal(0), step) * (_end - _start); } bool DNumberStyleAnimation::isUpdateNeeded() const { if (DStyleAnimation::isUpdateNeeded()) { qreal current = currentValue(); if (!qFuzzyCompare(_prev, current)) { _prev = current; return true; } } return false; } DBlendStyleAnimation::DBlendStyleAnimation(Type type, QObject *target) : DStyleAnimation(target), _type(type) { setDuration(250); } QImage DBlendStyleAnimation::startImage() const { return _start; } void DBlendStyleAnimation::setStartImage(const QImage& image) { _start = image; } QImage DBlendStyleAnimation::endImage() const { return _end; } void DBlendStyleAnimation::setEndImage(const QImage& image) { _end = image; } QImage DBlendStyleAnimation::currentImage() const { return _current; } /*! \internal A helper function to blend two images. The result consists of ((alpha)*startImage) + ((1-alpha)*endImage) */ static QImage blendedImage(const QImage &start, const QImage &end, float alpha) { if (start.isNull() || end.isNull()) return QImage(); QImage blended; const int a = qRound(alpha*256); const int ia = 256 - a; const int sw = start.width(); const int sh = start.height(); const int bpl = start.bytesPerLine(); switch (start.depth()) { case 32: { blended = QImage(sw, sh, start.format()); blended.setDevicePixelRatio(start.devicePixelRatio()); uchar *mixed_data = blended.bits(); const uchar *back_data = start.bits(); const uchar *front_data = end.bits(); for (int sy = 0; sy < sh; sy++) { quint32* mixed = (quint32*)mixed_data; const quint32* back = (const quint32*)back_data; const quint32* front = (const quint32*)front_data; for (int sx = 0; sx < sw; sx++) { quint32 bp = back[sx]; quint32 fp = front[sx]; mixed[sx] = qRgba ((qRed(bp)*ia + qRed(fp)*a)>>8, (qGreen(bp)*ia + qGreen(fp)*a)>>8, (qBlue(bp)*ia + qBlue(fp)*a)>>8, (qAlpha(bp)*ia + qAlpha(fp)*a)>>8); } mixed_data += bpl; back_data += bpl; front_data += bpl; } } default: break; } return blended; } void DBlendStyleAnimation::updateCurrentTime(int time) { DStyleAnimation::updateCurrentTime(time); float alpha = 1.0; if (duration() > 0) { if (_type == Pulse) { time = time % duration() * 2; if (time > duration()) time = duration() * 2 - time; } alpha = time / static_cast(duration()); if (_type == Transition && time > duration()) { alpha = 1.0; stop(); } } else if (time > 0) { stop(); } _current = blendedImage(_start, _end, alpha); } DScrollbarStyleAnimation::DScrollbarStyleAnimation(Mode mode, QObject *target) : DNumberStyleAnimation(target), _mode(mode), _active(false) { switch (mode) { case Activating: setDuration(ScrollBarFadeOutDuration); setStartValue(0.0); setEndValue(1.0); break; case Deactivating: setDuration(ScrollBarFadeOutDelay + ScrollBarFadeOutDuration); setDelay(ScrollBarFadeOutDelay); setStartValue(1.0); setEndValue(0.0); break; } } DScrollbarStyleAnimation::Mode DScrollbarStyleAnimation::mode() const { return _mode; } void DScrollbarStyleAnimation::restart(bool blocksig/* = false*/) { if (signalsBlocked() != blocksig) { blockSignals(blocksig); } if (blocksig) blockSignals(true); if (state() == Running) stop(); start(); if (blocksig) blockSignals(false); } bool DScrollbarStyleAnimation::wasActive() const { return _active; } void DScrollbarStyleAnimation::setActive(bool active) { _active = active; } } // end namespace dstyle #endif //QT_NO_ANIMATION qt5integration-5.5.23/styleplugins/dstyleplugin/dstyleanimation.h000066400000000000000000000113001424734202100254170ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSTYLEANIMATION #define QSTYLEANIMATION #include "qabstractanimation.h" #include "qdatetime.h" #include "qimage.h" namespace dstyle { #ifndef QT_NO_ANIMATION // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience of // qcommonstyle.cpp. This header file may change from version to version // without notice, or even be removed. // // We mean it. // class DStyleAnimation : public QAbstractAnimation { Q_OBJECT public: DStyleAnimation(QObject *target); virtual ~DStyleAnimation(); QObject *target() const; int duration() const Q_DECL_OVERRIDE; void setDuration(int duration); int delay() const; void setDelay(int delay); QTime startTime() const; void setStartTime(const QTime &time); QAbstractAnimation::DeletionPolicy deletePolicy() const ; void setDeletePolicy(QAbstractAnimation::DeletionPolicy policy); enum FrameRate { DefaultFps, SixtyFps, ThirtyFps, TwentyFps }; FrameRate frameRate() const; void setFrameRate(FrameRate fps); void updateTarget(); public Q_SLOTS: void start(); protected: virtual bool isUpdateNeeded() const; virtual void updateCurrentTime(int time) Q_DECL_OVERRIDE; private: int _delay; int _duration; QTime _startTime; FrameRate _fps; int _skip; int _policy = QAbstractAnimation::DeletionPolicy::DeleteWhenStopped; }; class DProgressStyleAnimation : public DStyleAnimation { Q_OBJECT public: DProgressStyleAnimation(int speed, QObject *target); int animationStep() const; int progressStep(int width) const; int speed() const; void setSpeed(int speed); protected: bool isUpdateNeeded() const Q_DECL_OVERRIDE; private: int _speed; mutable int _step; }; class DNumberStyleAnimation : public DStyleAnimation { Q_OBJECT public: DNumberStyleAnimation(QObject *target); qreal startValue() const; void setStartValue(qreal value); qreal endValue() const; void setEndValue(qreal value); qreal currentValue() const; protected: bool isUpdateNeeded() const Q_DECL_OVERRIDE; private: qreal _start; qreal _end; mutable qreal _prev; }; class DBlendStyleAnimation : public DStyleAnimation { Q_OBJECT public: enum Type { Transition, Pulse }; DBlendStyleAnimation(Type type, QObject *target); QImage startImage() const; void setStartImage(const QImage& image); QImage endImage() const; void setEndImage(const QImage& image); QImage currentImage() const; protected: virtual void updateCurrentTime(int time) Q_DECL_OVERRIDE; private: Type _type; QImage _start; QImage _end; QImage _current; }; class DScrollbarStyleAnimation : public DNumberStyleAnimation { Q_OBJECT public: enum Mode { Activating, Deactivating }; DScrollbarStyleAnimation(Mode mode, QObject *target); Mode mode() const; void restart(bool blocksig = false); bool wasActive() const; void setActive(bool active); private: Mode _mode; bool _active; }; #endif // QT_NO_ANIMATION } // end namespace dstyle #endif // QSTYLEANIMATION_P qt5integration-5.5.23/styleplugins/dstyleplugin/dstyleplugin.cpp000066400000000000000000000025201424734202100252750ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include "dstyleplugin.h" #include "style.h" DStylePlugin::DStylePlugin(QObject *parent) : QStylePlugin(parent) { } QStyle *DStylePlugin::create(const QString &key) { if (key == "ddark") { return new dstyle::Style(dstyle::StyleDark); } else if (key == "dlight") { return new dstyle::Style(dstyle::StyleLight); } else if (key == "dsemidark") { return new dstyle::Style(dstyle::StyleSemiDark); } else if (key == "dsemilight") { return new dstyle::Style(dstyle::StyleSemiLight); } return nullptr; } #if QT_VERSION < 0x050000 Q_EXPORT_PLUGIN2(DStylePlugin, DStylePlugin) #endif // QT_VERSION < 0x050000 qt5integration-5.5.23/styleplugins/dstyleplugin/dstyleplugin.h000066400000000000000000000021331424734202100247420ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #ifndef DStylePlugin_H #define DStylePlugin_H #include class DStylePlugin : public QStylePlugin { Q_OBJECT #if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "dstyleplugin.json") #endif // QT_VERSION >= 0x050000 public: DStylePlugin(QObject *parent = 0); QStyle* create(const QString &key) Q_DECL_OVERRIDE; }; #endif // DStylePlugin_H qt5integration-5.5.23/styleplugins/dstyleplugin/dstyleplugin.json000066400000000000000000000001001424734202100254540ustar00rootroot00000000000000{ "Keys" : ["ddark", "dlight", "dsemidark", "dsemilight"] } qt5integration-5.5.23/styleplugins/dstyleplugin/dstyleplugin.pro000066400000000000000000000033461424734202100253220ustar00rootroot00000000000000#------------------------------------------------- # # Project created by QtCreator 2016-10-18T17:21:21 # #------------------------------------------------- QT += core gui widgets widgets-private core-private gui-private CONFIG += link_pkgconfig c++11 PKGCONFIG += dtkwidget$${DTK_VERSION} TARGET = dstyleplugin$${DTK_VERSION} TEMPLATE = lib CONFIG += plugin SOURCES += dstyleplugin.cpp \ style.cpp \ sliderhelper.cpp \ colorutils.cpp \ geometryutils.cpp \ paletteextended.cpp \ pushbuttonhelper.cpp \ framehelper.cpp \ lineedithelper.cpp \ commonhelper.cpp \ scrollbarhelper.cpp \ painterhelper.cpp \ menuhelper.cpp \ dstyleanimation.cpp \ progressbarhelper.cpp \ checkboxhelper.cpp \ rubberbandhelper.cpp \ headerviewhelper.cpp \ comboboxhelper.cpp \ toolbuttonhelper.cpp \ tabwidgethelper.cpp \ spinboxhelper.cpp \ hidpihelper.cpp \ tabbarhelper.cpp HEADERS += dstyleplugin.h \ style.h \ common.h \ colorutils.h \ geometryutils.h \ paletteextended.h \ commonhelper.h \ painterhelper.h \ dstyleanimation.h \ hidpihelper.h DISTFILES += dstyleplugin.json DESTDIR = $$_PRO_FILE_PWD_/../../bin/plugins/styles/$${BASED_DTK_DIR} unix { target.path = $$[QT_INSTALL_PLUGINS]/styles/$${BASED_DTK_DIR} INSTALLS += target } RESOURCES += \ brushchemes.qrc \ assets_light.qrc \ assets_dark.qrc \ assets_semidark.qrc \ assets_semilight.qrc \ assets.qrc load(configure) qtCompileTest(dtkwidget$${DTK_VERSION}) { DEFINES += DTK_SUPPORT_BLUR_WINDOW message(The libdtkwidget$${DTK_VERSION} support blur window) } else { warning(The libdtkwidget$${DTK_VERSION} can not support blur window) } qt5integration-5.5.23/styleplugins/dstyleplugin/framehelper.cpp000066400000000000000000000030241424734202100250440ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include "style.h" #include #include #include namespace dstyle { bool Style::drawFramePrimitive(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { // combo box drop-list. // line edit completer drop-list if (widgetIsComboBoxPopupFramePrimitive(widget)) { drawComboBoxPopupFramePrimitive(option, painter); return true; } return true; } bool Style::drawFrameFocusRectPrimitive(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { Q_UNUSED(option) Q_UNUSED(painter) Q_UNUSED(widget) // draw nothing return true; } bool Style::drawShapedFrameControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { Q_UNUSED(option) Q_UNUSED(painter) Q_UNUSED(widget) return false; } } qt5integration-5.5.23/styleplugins/dstyleplugin/geometryutils.cpp000066400000000000000000000025601424734202100254720ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include "geometryutils.h" namespace dstyle { QRect GeometryUtils::centerRect(const QRect &rect, const QSize &size) { return centerRect( rect, size.width(), size.height() ); } QRect GeometryUtils::centerRect(const QRect &rect, int width, int height) { QRect newRect = rect; newRect.setWidth(width); newRect.setHeight(height); newRect.moveCenter(rect.center()); return newRect; } QRect GeometryUtils::insideMargin(const QRect &r, int margin) { return insideMargin( r, margin, margin ); } QRect GeometryUtils::insideMargin(const QRect &r, int marginWidth, int marginHeight) { return r.adjusted( marginWidth, marginHeight, -marginWidth, -marginHeight ); } } qt5integration-5.5.23/styleplugins/dstyleplugin/geometryutils.h000066400000000000000000000025771424734202100251470ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #ifndef GEOMETRYUTILS_H #define GEOMETRYUTILS_H #include #include "common.h" namespace dstyle { class GeometryUtils { public: static QRect centerRect(const QRect &rect, const QSize& size ); static QRect centerRect(const QRect &rect, int width, int height); static QRect insideMargin( const QRect& r, int margin ); static QRect insideMargin( const QRect& r, int marginWidth, int marginHeight ); static qreal frameRadius( qreal bias = 0 ) { return qMax( qreal( Metrics::Frame_FrameRadius ) - 0.5 + bias, 0.0 ); } static QRectF shadowRect( const QRectF& rect ) { return rect.adjusted( 0.5, 0.5, -0.5, -0.5 ).translated( 0.5, 0.5 ); } }; } #endif // GEOMETRYUTILS_H qt5integration-5.5.23/styleplugins/dstyleplugin/headerviewhelper.cpp000066400000000000000000000043461424734202100261050ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "style.h" #include "paletteextended.h" namespace dstyle { bool Style::drawIndicatorHeaderArrowPrimitive(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { Q_UNUSED(widget) if (const QStyleOptionHeader *header = qstyleoption_cast(option)) { QBrush brush; if (header->sortIndicator & QStyleOptionHeader::SortUp) { brush = m_palette->brush(PaletteExtended::HeaderView_ArrowIndicatorDownIcon); } else if (header->sortIndicator & QStyleOptionHeader::SortDown) { brush = m_palette->brush(PaletteExtended::HeaderView_ArrowIndicatorUpIcon); } if (brush.style() != Qt::TexturePattern) return false; fillBrush(painter, option->rect, brush); } return true; } QRect Style::headerArrowRect(const QStyleOption *opt, const QWidget *widget) const { QRect r; int h = opt->rect.height(); int w = opt->rect.width(); int x = opt->rect.x(); int y = opt->rect.y(); int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, opt, widget); if (opt->state & State_Horizontal) { int horiz_size = Metrics::Header_ArrowSize; r.setRect(x + w - margin * 2 - horiz_size, y + (h - horiz_size) / 2, horiz_size, horiz_size); } else { int vert_size = Metrics::Header_ArrowSize; r.setRect(x + (w - vert_size) / 2, y + h - margin * 2 - vert_size, vert_size, vert_size); } r = visualRect(opt->direction, opt->rect, r); return r; } } qt5integration-5.5.23/styleplugins/dstyleplugin/hidpihelper.cpp000066400000000000000000000015571424734202100250600ustar00rootroot00000000000000#include "hidpihelper.h" #include #include #include namespace dstyle { QPixmap HiDPIHelper::loadPixmap(const QString &fileName, qreal devicePixelRatio) { if (qFuzzyCompare(devicePixelRatio, 0)) devicePixelRatio = qGuiApp->devicePixelRatio(); qreal sourceDevicePixelRatio = 1.0; QPixmap pixmap; if (!qFuzzyCompare(sourceDevicePixelRatio, devicePixelRatio)) { QImageReader reader; reader.setFileName(qt_findAtNxFile(fileName, devicePixelRatio, &sourceDevicePixelRatio)); if (reader.canRead()) { reader.setScaledSize(reader.size() * (devicePixelRatio / sourceDevicePixelRatio)); pixmap = QPixmap::fromImage(reader.read()); pixmap.setDevicePixelRatio(devicePixelRatio); } } else { pixmap.load(fileName); } return pixmap; } } qt5integration-5.5.23/styleplugins/dstyleplugin/hidpihelper.h000066400000000000000000000003441424734202100245160ustar00rootroot00000000000000#ifndef HIDPIHELPER_H #define HIDPIHELPER_H #include namespace dstyle { class HiDPIHelper { public: static QPixmap loadPixmap(const QString &fileName, qreal devicePixelRatio = 0); }; } #endif // HIDPIHELPER_H qt5integration-5.5.23/styleplugins/dstyleplugin/lineedithelper.cpp000066400000000000000000000056001424734202100255510ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include "commonhelper.h" #include "common.h" #include "style.h" #include "paletteextended.h" #include #ifdef DTKWIDGET_CLASS_DStyleOptionLineEdit #include #include DWIDGET_USE_NAMESPACE #endif #include namespace dstyle { PaletteExtended::PseudoClassType lineEditStateToPseudoClassType(QStyle::State state) { if (!state.testFlag(QStyle::State_Enabled)) { return PaletteExtended::PseudoClass_Disabled; } if (state.testFlag(QStyle::State_ReadOnly)) { return PaletteExtended::PseudoClass_ReadOnly; } if (state.testFlag(QStyle::State_HasFocus)) { return PaletteExtended::PseudoClass_Focus; } return PaletteExtended::PseudoClass_Unspecified; } bool Style::drawFrameLineEditPrimitive(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { Q_UNUSED(widget) const QRect& rect( option->rect ); // render const QBrush background(m_palette->brush(PaletteExtended::LineEdit_BackgroundBrush, lineEditStateToPseudoClassType(option->state)) ); QBrush outline(m_palette->brush(PaletteExtended::LineEdit_BorderBrush, lineEditStateToPseudoClassType(option->state)) ); #ifdef DTKWIDGET_CLASS_DLineEdit if (const DLineEdit *edit = qobject_cast(widget)) { DStyleOptionLineEdit edit_option; edit_option.init(const_cast(edit)); if (edit_option.features.testFlag(DStyleOptionLineEdit::Alert)) outline = m_palette->brush(PaletteExtended::LineEdit_AlertBorderBrush, option, PaletteExtended::PseudoClass_Unknown, outline); CommonHelper::renderFrame( painter, rect, background, outline ); if (edit_option.features.testFlag(DStyleOptionLineEdit::IconButton)) { painter->save(); painter->setPen(QPen(outline, Metrics::Painter_PenWidth)); painter->drawLine(QPointF(edit_option.iconButtonRect.topLeft()) - QPointF(0.5, 0), QPointF(edit_option.iconButtonRect.bottomLeft()) + QPoint(-0.5, 1)); painter->restore(); } } else #endif { CommonHelper::renderFrame( painter, rect, background, outline ); } return true; } }// end namespace dstyle qt5integration-5.5.23/styleplugins/dstyleplugin/menuhelper.cpp000066400000000000000000000347001424734202100247230ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "style.h" #include "commonhelper.h" #include "paletteextended.h" #include #include #include #include #include #include #include #include DWIDGET_USE_NAMESPACE namespace dstyle { bool Style::isVisibleMenuShortText() const { DApplication *app = qobject_cast(qApp); if (!app) { return true; } const QVariant propertyValue = app->property("visibleMenuShortcutText").toBool(); return propertyValue.isValid() ? propertyValue.toBool() : false; } bool Style::isVisibleMenuCheckBox() const { DApplication *app = qobject_cast(qApp); if (!app) { return true; } const QVariant propertyValue = app->property("visibleMenuCheckboxWidget").toBool(); return propertyValue.isValid() ? propertyValue.toBool() : false; } bool Style::isVisibleMenuIcon() const { DApplication *app = qobject_cast(qApp); if (!app) { return true; } const QVariant propertyValue = app->property("visibleMenuIcon").toBool(); return propertyValue.isValid() ? propertyValue.toBool() : false; } bool isEdit(const QWidget *widget) { return qobject_cast(widget) || qobject_cast(widget) || qobject_cast(widget); } bool Style::drawMenuItemControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { Q_D(const Style); painter->save(); // Draws one item in a popup menu. if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast(option)) { // QColor highlightOutline = d->highlightedOutline(option->palette); QColor highlight = option->palette.highlight().color(); if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { int w = 0; if (!menuItem->text.isEmpty()) { painter->setFont(menuItem->font); proxy()->drawItemText(painter, menuItem->rect.adjusted(Menu_SeparatorItemHMargin, 0, -Menu_SeparatorItemHMargin, 0), Qt::AlignLeft | Qt::AlignVCenter, menuItem->palette, menuItem->state & State_Enabled, menuItem->text, QPalette::Text); w = menuItem->fontMetrics.width(menuItem->text) + Menu_SeparatorItemHMargin; } painter->setPen(m_palette->brush(PaletteExtended::Menu_SeparatorColor, option).color()); bool reverse = menuItem->direction == Qt::RightToLeft; painter->drawLine(menuItem->rect.left() + Menu_SeparatorItemHMargin + (reverse ? 0 : w), menuItem->rect.center().y(), menuItem->rect.right() - Menu_SeparatorItemHMargin - (reverse ? w : 0), menuItem->rect.center().y()); painter->restore(); return true; } bool selected = menuItem->state & State_Selected && menuItem->state & State_Enabled; if (selected) { QRect r = option->rect; painter->fillRect(r, highlight); // painter->setPen(QPen(highlightOutline)); // painter->drawRect(QRectF(r)); } bool checkable = menuItem->checkType != QStyleOptionMenuItem::NotCheckable; bool checked = menuItem->checked; // bool sunken = menuItem->state & State_Sunken; // bool enabled = menuItem->state & State_Enabled; bool ignoreCheckMark = false; int checkcol = qMax(menuItem->maxIconWidth, 20); QRect iconRect; if (qobject_cast(widget) || (option->styleObject && option->styleObject->property("_q_isComboBoxPopupItem").toBool())) ignoreCheckMark = true; //ignore the checkmarks provided by the QComboMenuDelegate if (!ignoreCheckMark) { // Check QRect checkRect(option->rect.left() + 10, option->rect.center().y() - 4, 14, 14); checkRect = visualRect(menuItem->direction, menuItem->rect, checkRect); if (checkable) { if (!isVisibleMenuCheckBox() || (menuItem->checkType & QStyleOptionMenuItem::Exclusive)) { // Radio button if (checked/* || sunken*/) { QStyleOptionMenuItem newMI = *menuItem; newMI.rect = checkRect; drawDeepinStyleIcon("check", &newMI, painter, widget); } } else { // Check box if (menuItem->icon.isNull()) { QStyleOptionButton box; box.QStyleOption::operator=(*option); box.rect = checkRect; if (checked) box.state |= State_On; proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); } } } // draw check label if (checkable) { if (!menuItem->icon.isNull()) { checkcol = qMax(menuItem->maxIconWidth * 2, 20); } else { checkcol = qMax(menuItem->maxIconWidth, 20); } QRect vCheckRect = visualRect(option->direction, menuItem->rect, QRect(menuItem->rect.x() + 4, menuItem->rect.y(), checkcol, menuItem->rect.height())); iconRect = QRect(vCheckRect.x() + vCheckRect.width() / 2, vCheckRect.y(), vCheckRect.width() / 2, vCheckRect.height()); } else { checkcol = qMax(menuItem->maxIconWidth, 20); iconRect = visualRect(option->direction, menuItem->rect, QRect(menuItem->rect.x() + 4, menuItem->rect.y(), checkcol, menuItem->rect.height())); } } else { //ignore checkmark if (menuItem->icon.isNull()) checkcol = 0; else checkcol = menuItem->maxIconWidth; } // Text and icon, ripped from windows style bool dis = !(menuItem->state & State_Enabled); bool act = menuItem->state & State_Selected; const QStyleOption *opt = option; const QStyleOptionMenuItem *menuitem = menuItem; QPainter *p = painter; // NOTE: If widget is QLineEdit and qApp is DApplication, will hide menu icon if (!menuItem->icon.isNull() && (!isEdit(widget) || isVisibleMenuIcon())) { QIcon::Mode mode = dis ? QIcon::Disabled : QIcon::Normal; if (act && !dis) mode = QIcon::Active; QPixmap pixmap; int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize, option, widget); QSize iconSize(smallIconSize, smallIconSize); if (const QComboBox *combo = qobject_cast(widget)) iconSize = combo->iconSize(); if (checked) pixmap = menuItem->icon.pixmap(iconSize, mode, QIcon::On); else pixmap = menuItem->icon.pixmap(iconSize, mode); const int pixw = pixmap.width() / pixmap.devicePixelRatio(); const int pixh = pixmap.height() / pixmap.devicePixelRatio(); QRect pmr(0, 0, pixw, pixh); pmr.moveCenter(iconRect.center()); painter->setPen(menuItem->palette.text().color()); // if (!ignoreCheckMark && checkable && checked) { // QStyleOption opt = *option; // if (act) { // QColor activeColor = mergedColors(option->palette.background().color(), // option->palette.highlight().color()); // opt.palette.setBrush(QPalette::Button, activeColor); // } // opt.state |= State_Sunken; // opt.rect = vCheckRect; // proxy()->drawPrimitive(PE_PanelButtonCommand, &opt, painter, widget); // } painter->drawPixmap(pmr.topLeft(), pixmap); } if (selected) { painter->setPen(menuItem->palette.highlightedText().color()); } else { painter->setPen(menuItem->palette.text().color()); } int x, y, w, h; menuitem->rect.getRect(&x, &y, &w, &h); int tab = menuitem->tabWidth; QColor discol; if (dis) { discol = menuitem->palette.brush(QPalette::Disabled, QPalette::Text).color(); p->setPen(discol); } int xm = Menu_ItemFrameWidth + checkcol + Menu_ItemHTextMargin + 2; int xpos = menuitem->rect.x() + xm; QRect textRect(xpos, y + Menu_ItemVTextMargin, w - xm - Menu_PanelRightPadding - tab + 1, h - 2 * Menu_ItemVTextMargin); QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect); QString s = menuitem->text; if (!s.isEmpty()) { // draw text p->save(); QFont font = menuitem->font; // font may not have any "hard" flags set. We override // the point size so that when it is resolved against the device, this font will win. // This is mainly to handle cases where someone sets the font on the window // and then the combo inherits it and passes it onward. At that point the resolve mask // is very, very weak. This makes it stonger. font.setPointSizeF(QFontInfo(menuItem->font).pointSizeF()); if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem) font.setBold(true); p->setFont(font); int t = s.indexOf(QLatin1Char('\t')); int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; if (!styleHint(SH_UnderlineShortcut, menuitem, widget)) text_flags |= Qt::TextHideMnemonic; text_flags |= Qt::AlignLeft; // NOTE: hide short text if (t >= 0 && isVisibleMenuShortText()) { QRect vShortcutRect = visualRect(opt->direction, menuitem->rect, QRect(textRect.topRight(), QPoint(menuitem->rect.right(), textRect.bottom()))); if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, option, widget)) { p->setPen(menuitem->palette.light().color()); p->drawText(vShortcutRect.adjusted(1, 1, 1, 1), text_flags, s.mid(t + 1)); p->setPen(discol); } p->drawText(vShortcutRect, text_flags, s.mid(t + 1)); s = s.left(t); } if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, option, widget)) { p->setPen(menuitem->palette.light().color()); p->drawText(vTextRect.adjusted(1, 1, 1, 1), text_flags, s.left(t)); p->setPen(discol); } p->drawText(vTextRect, text_flags, s.left(t)); p->restore(); } // Arrow if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow int dim = (menuItem->rect.height() - 4) / 2; // PrimitiveElement arrow; // arrow = option->direction == Qt::RightToLeft ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight; int xpos = menuItem->rect.left() + menuItem->rect.width() - 3 - dim; QRect vSubMenuRect = visualRect(option->direction, menuItem->rect, QRect(xpos, menuItem->rect.top() + menuItem->rect.height() / 2 - dim / 2, dim, dim)); QStyleOptionMenuItem newMI = *menuItem; newMI.rect = vSubMenuRect; if (selected) newMI.palette.setColor(QPalette::Foreground, newMI.palette.highlightedText().color()); drawDeepinStyleIcon("arrow-right", &newMI, painter, widget); } } painter->restore(); return true; } bool Style::drawMenuBarItemControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { Style *style = CommonHelper::widgetStyle(widget); if (!style) return false; const bool enabled(option->state & QStyle::State_Enabled); const bool mouseOver(option->state & QStyle::State_MouseOver); const bool sunken((option->state | QStyle::State_Sunken) == option->state); if (mouseOver || sunken) { const QColor shadow( Qt::transparent ); const QBrush outline(style->m_palette->brush(PaletteExtended::PushButton_BorderBrush, option)); const QBrush background(style->m_palette->brush(PaletteExtended::PushButton_BackgroundBrush, option)); // render drawPushButtonFrame(painter, option->rect, background, outline, shadow ); } if (const QStyleOptionMenuItem *mbi = qstyleoption_cast(option)) { uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget)) alignment |= Qt::TextHideMnemonic; int iconExtent = proxy()->pixelMetric(PM_SmallIconSize); QPixmap pix = mbi->icon.pixmap(qt_getWindow(widget), QSize(iconExtent, iconExtent), (enabled) ? (mouseOver ? QIcon::Active : QIcon::Normal) : QIcon::Disabled); if (!pix.isNull()) proxy()->drawItemPixmap(painter, mbi->rect, alignment, pix); else proxy()->drawItemText(painter, mbi->rect, alignment, mbi->palette, enabled, mbi->text, QPalette::ButtonText); } return true; } } // end namespace dstyle qt5integration-5.5.23/styleplugins/dstyleplugin/painterhelper.cpp000066400000000000000000000101711424734202100254150ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "painterhelper.h" #include #include #include namespace dstyle { namespace PainterHelper { void drawRect(QPainter *painter, const QRectF &rect, const QBrush &background, qreal borderWidth, const QBrush &border) { painter->fillRect(rect, background); if (qFuzzyIsNull(borderWidth) || background == border) return; painter->save(); painter->setBrush(background); painter->setPen(QPen(border, borderWidth)); painter->drawRect(rect.adjusted(0, 0, -1, -1)); painter->restore(); } void drawRoundedRect(QPainter *painter, const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode, const QBrush &background, qreal borderWidth, const QBrush &border) { QPainterPath path; path.addRoundedRect(rect, xRadius, yRadius, mode); drawPath(painter, path, background, borderWidth, border); } void drawEllipse(QPainter *painter, const QRectF &rect, const QBrush &background, qreal borderWidth, const QBrush &border) { QPainterPath path; path.addEllipse(rect); drawPath(painter, path, background, borderWidth, border); } void drawPath(QPainter *painter, const QPainterPath &path, const QBrush &background, qreal borderWidth, const QBrush &border) { painter->fillPath(path, background); if (qFuzzyIsNull(borderWidth) || border == Qt::transparent) return; painter->save(); painter->setPen(QPen(border, borderWidth)); painter->drawPath(path); painter->restore(); } QPainterPath roundedPath(const QRectF &rect, Corners corners, qreal radius) { QPainterPath path; // simple cases if( corners == 0 ) { path.addRect( rect ); return path; } if( corners == AllCorners ) { path.addRoundedRect( rect, radius, radius ); return path; } const QSizeF cornerSize( 2*radius, 2*radius ); // rotate counterclockwise // top left corner if( corners & CornerTopLeft ) { path.moveTo( rect.topLeft() + QPointF( radius, 0 ) ); path.arcTo( QRectF( rect.topLeft(), cornerSize ), 90, 90 ); } else path.moveTo( rect.topLeft() ); // bottom left corner if( corners & CornerBottomLeft ) { path.lineTo( rect.bottomLeft() - QPointF( 0, radius ) ); path.arcTo( QRectF( rect.bottomLeft() - QPointF( 0, 2*radius ), cornerSize ), 180, 90 ); } else path.lineTo( rect.bottomLeft() ); // bottom right corner if( corners & CornerBottomRight ) { path.lineTo( rect.bottomRight() - QPointF( radius, 0 ) ); path.arcTo( QRectF( rect.bottomRight() - QPointF( 2*radius, 2*radius ), cornerSize ), 270, 90 ); } else path.lineTo( rect.bottomRight() ); // top right corner if( corners & CornerTopRight ) { path.lineTo( rect.topRight() + QPointF( 0, radius ) ); path.arcTo( QRectF( rect.topRight() - QPointF( 2*radius, 0 ), cornerSize ), 0, 90 ); } else path.lineTo( rect.topRight() ); path.closeSubpath(); return path; } QColor colorBlend(const QColor &color1, const QColor &color2) { QColor c2 = color2.toRgb(); if (c2.alpha() >= 255) return c2; QColor c1 = color1.toRgb(); qreal c1_weight = 1 - c2.alphaF(); int r = c1_weight * c1.red() + c2.alphaF() * c2.red(); int g = c1_weight * c1.green() + c2.alphaF() * c2.green(); int b = c1_weight * c1.blue() + c2.alphaF() * c2.blue(); return QColor(r, g, b); } } // end namespace PainterHelper } // end namespace dtyle qt5integration-5.5.23/styleplugins/dstyleplugin/painterhelper.h000066400000000000000000000034111424734202100250610ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #ifndef PAINTERHELPER_H #define PAINTERHELPER_H #include #include "common.h" QT_BEGIN_NAMESPACE class QPainter; class QPainterPath; QT_END_NAMESPACE namespace dstyle { namespace PainterHelper { void drawRect(QPainter *painter, const QRectF &rect, const QBrush &background, qreal borderWidth = 0, const QBrush &border = Qt::NoBrush); void drawRoundedRect(QPainter *painter, const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode, const QBrush &background, qreal borderWidth = 0, const QBrush &border = Qt::NoBrush); void drawEllipse(QPainter *painter, const QRectF &rect, const QBrush &background, qreal borderWidth = 0, const QBrush &border = Qt::NoBrush); void drawPath(QPainter *painter, const QPainterPath &path, const QBrush &background, qreal borderWidth = 0, const QBrush &border = Qt::NoBrush); QPainterPath roundedPath( const QRectF& rect, Corners corners, qreal radius ); QColor colorBlend(const QColor &color1, const QColor &color2); } // end namespace PainterHelper } // end namespace dtyle #endif // PAINTERHELPER_H qt5integration-5.5.23/styleplugins/dstyleplugin/paletteextended.cpp000066400000000000000000000246241424734202100257420ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include "paletteextended.h" #include #include #include #include #include #include #include #include #include #include #include "hidpihelper.h" QT_BEGIN_NAMESPACE QDebug operator<<(QDebug deg, const QCss::Value &value) { deg << value.toString(); return deg; } QDebug operator<<(QDebug deg, const QCss::Selector &selector) { deg << "specificity:" << selector.specificity() << ", pseudoClass:"<< selector.pseudoClass() << ", pseudoElement:" << selector.pseudoElement(); return deg; } QT_END_NAMESPACE namespace dstyle { QList PaletteExtended::styleTypeToPaletteList; PaletteExtended::PaletteExtended(StyleType type, QObject *parent) : QObject(parent) , m_brushScheme(new QCss::StyleSheet) { init(type); } PaletteExtended *PaletteExtended::instance(StyleType type) { foreach (PaletteExtended *p, styleTypeToPaletteList) { if (p->m_type == type) return p; } PaletteExtended *p = new PaletteExtended(type); styleTypeToPaletteList << p; return p; } PaletteExtended::~PaletteExtended() { delete m_brushScheme; styleTypeToPaletteList.removeOne(this); } static quint64 preprocessClass(qint64 classs) { if (classs & PaletteExtended::PseudoClass_On) classs |= PaletteExtended::PseudoClass_Checked; if (classs & PaletteExtended::PseudoClass_Checked) classs |= PaletteExtended::PseudoClass_On; if (classs & PaletteExtended::PseudoClass_Off) classs |= PaletteExtended::PseudoClass_Unchecked; if (classs & PaletteExtended::PseudoClass_Unchecked) classs |= PaletteExtended::PseudoClass_Off; if (!(classs & PaletteExtended::PseudoClass_Horizontal)) classs |= PaletteExtended::PseudoClass_Vertical; // if (!(classs & PaletteExtended::PseudoClass_Open)) // classs |= PaletteExtended::PseudoClass_Closed; if (!(classs & PaletteExtended::PseudoClass_Disabled)) classs |= PaletteExtended::PseudoClass_Enabled; return classs; } QBrush PaletteExtended::brush(const QWidget *widget, PaletteExtended::BrushName name, quint64 type, const QBrush &defaultBrush) const { const QPair &key = qMakePair(name, type); if (m_brushCache.contains(key)) return m_brushCache.value(key); #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) QMetaEnum metaEnum = metaObject()->enumerator(0); #else QMetaEnum metaEnum = QMetaEnum::fromType(); #endif QString colorName = metaEnum.valueToKey(name); const QStringList &path = colorName.split("_"); foreach (const QCss::StyleRule &rule, m_brushScheme->nameIndex.values(path.first())) { bool eligible = false; QList pseudoClassList; for (int i = 0; i < rule.selectors.count(); ++i) { const QCss::Selector &selector = rule.selectors.at(i); quint64 pseudoClass = selector.pseudoClass(); pseudoClassList.append(pseudoClass); if (preprocessClass(pseudoClass) == type || pseudoClass == type) { eligible = true; break; } } if (!eligible) { for (int i = pseudoClassList.count() - 1; i >= 0; --i) { quint64 pseudoClass = pseudoClassList.at(i); if ((pseudoClass | type) == type) { eligible = true; break; } } } if (!eligible) continue; foreach (const QCss::Declaration &declaration, rule.declarations) { if (declaration.d->property == path.last()) { QBrush brush = declaration.brushValue(); if (brush.style() == Qt::NoBrush) { const QString &uri = declaration.uriValue(); if (!uri.isEmpty()) { brush.setTexture(HiDPIHelper::loadPixmap(uri, widget ? widget->devicePixelRatioF() : 0)); } } m_brushCache[key] = brush; return brush; } } } m_brushCache[key] = defaultBrush; return defaultBrush; } static quint64 pseudoClass(QStyle::State state) { quint64 pc = 0; if (state & QStyle::State_Enabled) { pc |= PaletteExtended::PseudoClass_Enabled; } // if (state & QStyle::State_Active) // pc |= PaletteExtended::PseudoClass_Active; if (state & QStyle::State_Window) pc |= PaletteExtended::PseudoClass_Window; if (state & QStyle::State_On) pc |= (PaletteExtended::PseudoClass_On | PaletteExtended::PseudoClass_Checked); if (state & QStyle::State_Off) pc |= (PaletteExtended::PseudoClass_Off | PaletteExtended::PseudoClass_Unchecked); if (state & QStyle::State_NoChange) pc |= PaletteExtended::PseudoClass_Indeterminate; if (state & QStyle::State_Selected) pc |= PaletteExtended::PseudoClass_Selected; if (state & QStyle::State_Horizontal) pc |= PaletteExtended::PseudoClass_Horizontal; else pc |= PaletteExtended::PseudoClass_Vertical; // if (state & (QStyle::State_Open | QStyle::State_On | QStyle::State_Sunken)) // pc |= PaletteExtended::PseudoClass_Open; // else // pc |= PaletteExtended::PseudoClass_Closed; if (state & QStyle::State_Children) pc |= PaletteExtended::PseudoClass_Children; if (state & QStyle::State_Sibling) pc |= PaletteExtended::PseudoClass_Sibling; if (state & QStyle::State_ReadOnly) pc |= PaletteExtended::PseudoClass_ReadOnly; if (state & QStyle::State_Item) pc |= PaletteExtended::PseudoClass_Item; #ifdef QT_KEYPAD_NAVIGATION if (state & QStyle::State_HasEditFocus) pc |= PaletteExtended::PseudoClass_EditFocus; #endif return pc; } #define RETURN_BRUSH(Type) {\ const QBrush &d = brush(widget, name, PseudoClass_##Type, normal);\ return extraTypes ? brush(widget, name, PseudoClass_##Type | extraTypes, d) : d;\ } QBrush PaletteExtended::brush(const QWidget *widget, PaletteExtended::BrushName name, const QStyleOption *option, quint64 extraTypes, const QBrush &defaultBrush) const { QBrush normal = brush(widget, name, PseudoClass_Unspecified, defaultBrush); if (extraTypes) normal = brush(widget, name, extraTypes, normal); extraTypes |= pseudoClass(option->state); if (const QStyleOptionButton* buttonOption = qstyleoption_cast(option)) { if (buttonOption->features & QStyleOptionButton::Flat) extraTypes |= PseudoClass_Flat; if (buttonOption->features & QStyleOptionButton::DefaultButton) extraTypes |= PseudoClass_Default; } if (extraTypes) normal = brush(widget, name, extraTypes, normal); if (!(option->state & QStyle::State_Enabled)) RETURN_BRUSH(Disabled) else if (option->state & QStyle::State_Sunken) RETURN_BRUSH(Pressed) else if (option->state & QStyle::State_MouseOver) RETURN_BRUSH(Hover) else if (option->state & QStyle::State_HasFocus) RETURN_BRUSH(Focus) return normal; } QBrush PaletteExtended::brush(PaletteExtended::BrushName name, quint64 type, const QBrush &defaultBrush) const { return brush(0, name, type, defaultBrush); } QBrush PaletteExtended::brush(PaletteExtended::BrushName name, const QStyleOption *option, quint64 extraTypes, const QBrush &defaultBrush) const { return brush(0, name, option, extraTypes, defaultBrush); } void PaletteExtended::polish(QPalette &p) { p.setBrush(QPalette::Base, brush(QPalette_Base)); p.setBrush(QPalette::Text, brush(QPalette_Text)); p.setBrush(QPalette::Window, brush(QPalette_Window)); p.setBrush(QPalette::WindowText, brush(QPalette_WindowText)); p.setBrush(QPalette::Highlight, brush(QPalette_Highlight)); p.setBrush(QPalette::HighlightedText, brush(QPalette_HighlightedText)); p.setBrush(QPalette::Button, brush(QPalette_Button)); p.setBrush(QPalette::ButtonText, brush(QPalette_ButtonText)); p.setBrush(QPalette::Disabled, QPalette::Base, brush(QPalette_Base, PseudoClass_Disabled, p.brush(QPalette::Base))); p.setBrush(QPalette::Disabled, QPalette::Text, brush(QPalette_Text, PseudoClass_Disabled, p.brush(QPalette::Text))); p.setBrush(QPalette::Disabled, QPalette::Window, brush(QPalette_Window, PseudoClass_Disabled, p.brush(QPalette::Window))); p.setBrush(QPalette::Disabled, QPalette::WindowText, brush(QPalette_WindowText, PseudoClass_Disabled, p.brush(QPalette::WindowText))); p.setBrush(QPalette::Disabled, QPalette::Highlight, brush(QPalette_Highlight, PseudoClass_Disabled, p.brush(QPalette::Highlight))); p.setBrush(QPalette::Disabled, QPalette::HighlightedText, brush(QPalette_HighlightedText, PseudoClass_Disabled, p.brush(QPalette::HighlightedText))); p.setBrush(QPalette::Disabled, QPalette::Button, brush(QPalette_Button, PseudoClass_Disabled, p.brush(QPalette::Button))); p.setBrush(QPalette::Disabled, QPalette::ButtonText, brush(QPalette_ButtonText, PseudoClass_Disabled, p.brush(QPalette::ButtonText))); } void PaletteExtended::init(StyleType type) { m_type = type; QFile file; if (type == StyleType::StyleDark) { file.setFileName(":/brushschemes/ddark.css"); } else if (type == StyleType::StyleLight) { file.setFileName(":/brushschemes/dlight.css"); } else if (type == StyleType::StyleSemiDark) { file.setFileName(":/brushschemes/dsemidark.css"); } else if (type == StyleType::StyleSemiLight) { file.setFileName(":/brushschemes/dsemilight.css"); } if (!file.open(QIODevice::ReadOnly)) return; QCss::Parser parser(QString::fromLocal8Bit(file.readAll())); parser.parse(m_brushScheme); } } qt5integration-5.5.23/styleplugins/dstyleplugin/paletteextended.h000066400000000000000000000164701424734202100254070ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #ifndef PALETTEEXTENDED_H #define PALETTEEXTENDED_H #include #include #include #include #include "common.h" QT_BEGIN_NAMESPACE class QStyleOption; QT_END_NAMESPACE namespace QCss { struct StyleSheet; } namespace dstyle { class PaletteExtended : public QObject { Q_OBJECT public: static PaletteExtended *instance(StyleType type); ~PaletteExtended(); enum BrushName { //TODO(hualet): Color Group support. QPalette_Base, QPalette_Text, QPalette_Window, QPalette_WindowText, QPalette_Highlight, QPalette_HighlightedText, QPalette_Button, QPalette_ButtonText, ScrollBar_HandleBrush, ScrollBar_HandleBorderBrush, Slider_GrooveColor, Slider_GrooveHighlightColor, Slider_HandleBrush, Slider_VernierHandleBrush, Slider_HandleBorderColor, Slider_TickmarkColor, ProgressBar_GrooveBackground, ProgressBar_GrooveBorder, ProgressBar_ContentBackground, ProgressBar_ContentBorder, PushButton_BackgroundBrush, PushButton_TextColor, PushButton_BorderBrush, PushButton_SuggestButtonColor, PushButton_SuggestTextColor, LineEdit_BorderBrush, LineEdit_AlertBorderBrush, LineEdit_BackgroundBrush, Menu_SeparatorColor, Menu_BorderColor, Menu_BackgroundBrush, CheckBox_BackgroundBrush, RadioButton_BackgroundBrush, RubberBand_BackgroundBrush, RubberBand_BorderBrush, HeaderView_ArrowIndicatorUpIcon, HeaderView_ArrowIndicatorDownIcon, SpinBox_MinusBrush, SpinBox_PlusBrush, SpinBox_DownBrush, SpinBox_UpBrush, SpinBox_BorderColor, TabBar_BackgroundBrush, TabBar_BorderBrush, TabBarTab_BackgroundBrush, TabBarTab_BorderBrush, TabBarTab_TextColor, TabBarTab_ActiveColor, TabBarTab_CloseIcon, TabBarTab_CloseIconBackground, TabBarScrollButton_BackgroundBrush, TabBarScrollButton_UpIcon, TabBarScrollButton_DownIcon, TabBarAddButton_BackgroundBrush, TabBarAddButton_Icon }; #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) Q_ENUMS(BrushName) #else Q_ENUM(BrushName) #endif enum PseudoClassType { PseudoClass_Unknown = Q_UINT64_C(0x0000000000000000), PseudoClass_Enabled = Q_UINT64_C(0x0000000000000001), PseudoClass_Disabled = Q_UINT64_C(0x0000000000000002), PseudoClass_Pressed = Q_UINT64_C(0x0000000000000004), PseudoClass_Focus = Q_UINT64_C(0x0000000000000008), PseudoClass_Hover = Q_UINT64_C(0x0000000000000010), PseudoClass_Checked = Q_UINT64_C(0x0000000000000020), PseudoClass_Unchecked = Q_UINT64_C(0x0000000000000040), PseudoClass_Indeterminate = Q_UINT64_C(0x0000000000000080), PseudoClass_Unspecified = Q_UINT64_C(0x0000000000000100), PseudoClass_Selected = Q_UINT64_C(0x0000000000000200), PseudoClass_Horizontal = Q_UINT64_C(0x0000000000000400), PseudoClass_Vertical = Q_UINT64_C(0x0000000000000800), PseudoClass_Window = Q_UINT64_C(0x0000000000001000), PseudoClass_Children = Q_UINT64_C(0x0000000000002000), PseudoClass_Sibling = Q_UINT64_C(0x0000000000004000), PseudoClass_Default = Q_UINT64_C(0x0000000000008000), PseudoClass_First = Q_UINT64_C(0x0000000000010000), PseudoClass_Last = Q_UINT64_C(0x0000000000020000), PseudoClass_Middle = Q_UINT64_C(0x0000000000040000), PseudoClass_OnlyOne = Q_UINT64_C(0x0000000000080000), PseudoClass_PreviousSelected = Q_UINT64_C(0x0000000000100000), PseudoClass_NextSelected = Q_UINT64_C(0x0000000000200000), PseudoClass_Flat = Q_UINT64_C(0x0000000000400000), PseudoClass_Left = Q_UINT64_C(0x0000000000800000), PseudoClass_Right = Q_UINT64_C(0x0000000001000000), PseudoClass_Top = Q_UINT64_C(0x0000000002000000), PseudoClass_Bottom = Q_UINT64_C(0x0000000004000000), PseudoClass_Exclusive = Q_UINT64_C(0x0000000008000000), PseudoClass_NonExclusive = Q_UINT64_C(0x0000000010000000), PseudoClass_Frameless = Q_UINT64_C(0x0000000020000000), PseudoClass_ReadOnly = Q_UINT64_C(0x0000000040000000), PseudoClass_Active = Q_UINT64_C(0x0000000080000000), PseudoClass_Closable = Q_UINT64_C(0x0000000100000000), PseudoClass_Movable = Q_UINT64_C(0x0000000200000000), PseudoClass_Floatable = Q_UINT64_C(0x0000000400000000), PseudoClass_Minimized = Q_UINT64_C(0x0000000800000000), PseudoClass_Maximized = Q_UINT64_C(0x0000001000000000), PseudoClass_On = Q_UINT64_C(0x0000002000000000), PseudoClass_Off = Q_UINT64_C(0x0000004000000000), PseudoClass_Editable = Q_UINT64_C(0x0000008000000000), PseudoClass_Item = Q_UINT64_C(0x0000010000000000), PseudoClass_Closed = Q_UINT64_C(0x0000020000000000), PseudoClass_Open = Q_UINT64_C(0x0000040000000000), PseudoClass_EditFocus = Q_UINT64_C(0x0000080000000000), PseudoClass_Alternate = Q_UINT64_C(0x0000100000000000), // The Any specifier is never generated, but can be used as a wildcard in searches. PseudoClass_Any = Q_UINT64_C(0x0000ffffffffffff) }; QBrush brush(const QWidget *widget, BrushName name, quint64 type = PseudoClass_Unspecified, const QBrush &defaultBrush = Qt::NoBrush) const; QBrush brush(const QWidget *widget, BrushName name, const QStyleOption *option, quint64 extraTypes = PseudoClass_Unknown, const QBrush &defaultBrush = Qt::NoBrush) const; QBrush brush(BrushName name, quint64 type = PseudoClass_Unspecified, const QBrush &defaultBrush = Qt::NoBrush) const; QBrush brush(BrushName name, const QStyleOption *option, quint64 extraTypes = PseudoClass_Unknown, const QBrush &defaultBrush = Qt::NoBrush) const; void polish(QPalette &p); private: void init(StyleType type); PaletteExtended(StyleType type, QObject *parent = 0); StyleType m_type; QCss::StyleSheet *m_brushScheme; mutable QHash, QBrush> m_brushCache; static QList styleTypeToPaletteList; }; } #endif // PALETTEEXTENDED_H qt5integration-5.5.23/styleplugins/dstyleplugin/progressbarhelper.cpp000066400000000000000000000235071424734202100263130ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include "style.h" #include #include #include #include #include #include "geometryutils.h" #include "paletteextended.h" namespace dstyle { bool Style::drawProgressBarControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { const QStyleOptionProgressBar* progressBarOption( qstyleoption_cast( option ) ); if( !progressBarOption ) return false; // render groove QStyleOptionProgressBar progressBarOption2 = *progressBarOption; progressBarOption2.rect = subElementRect( SE_ProgressBarGroove, progressBarOption, widget ); drawControl( CE_ProgressBarGroove, &progressBarOption2, painter, widget ); // render contents progressBarOption2.rect = subElementRect( SE_ProgressBarContents, progressBarOption, widget ); drawControl( CE_ProgressBarContents, &progressBarOption2, painter, widget ); // render text const bool textVisible( progressBarOption->textVisible ); const bool busy( progressBarOption->minimum == 0 && progressBarOption->maximum == 0 ); if( textVisible && !busy ) { progressBarOption2.rect = subElementRect( SE_ProgressBarLabel, progressBarOption, widget ); drawControl( CE_ProgressBarLabel, &progressBarOption2, painter, widget ); } return true; } bool Style::drawProgressBarContentsControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { // QStyleSheetStyle won't draw progress bar groove which is necessary for us. if (widget && widget->style() && widget->style()->metaObject() && widget->style()->metaObject()->className() == QLatin1String("QStyleSheetStyle")) { drawProgressBarGrooveControl(option, painter, widget); } const QStyleOptionProgressBar* progressBarOption( qstyleoption_cast( option ) ); if( !progressBarOption ) return false; const bool horizontal( !progressBarOption || progressBarOption->orientation == Qt::Horizontal ); // copy rect and palette const qreal radius( ProgressBar_Radius ); // get progress and steps const qreal progress( progressBarOption->progress - progressBarOption->minimum ); const int steps( qMax( progressBarOption->maximum - progressBarOption->minimum, 1 ) ); //Calculate width fraction const qreal widthFrac = qMin( qreal(1), progress/steps ); QRect rect( option->rect); // convert the pixel width const int indicatorSize( widthFrac*( horizontal ? rect.width():rect.height() ) ); rect.setWidth(indicatorSize); QPainterPath path; path.addRoundedRect(rect, radius, radius); painter->save(); painter->setRenderHints(painter->renderHints() | QPainter::Antialiasing); painter->setClipPath(path); painter->fillRect(rect, m_palette->brush(PaletteExtended::ProgressBar_ContentBackground, option)); painter->strokePath(path, QPen(m_palette->brush(PaletteExtended::ProgressBar_ContentBorder), ProgressBar_BorderWidth)); painter->restore(); return true; } bool Style::drawProgressBarGrooveControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { Q_UNUSED(widget) const QRect rect( option->rect ); const PaletteExtended *plExt = m_palette; const QBrush brush( plExt->brush(PaletteExtended::ProgressBar_GrooveBackground, option) ); QPainterPath path; path.addRoundedRect(rect, ProgressBar_Radius, ProgressBar_Radius); painter->save(); painter->setRenderHints(painter->renderHints() | QPainter::Antialiasing); painter->setClipPath(path); painter->fillRect(rect, brush); painter->strokePath(path, QPen(plExt->brush(PaletteExtended::ProgressBar_GrooveBorder), ProgressBar_BorderWidth)); painter->restore(); return true; } bool Style::drawProgressBarLabelControl(const QStyleOption *option, QPainter *painter, const QWidget *) const { // cast option and check const QStyleOptionProgressBar* progressBarOption( qstyleoption_cast( option ) ); if( !progressBarOption ) return true; // get direction and check const QStyleOptionProgressBar *progressBarOption2(qstyleoption_cast(option)); const bool horizontal = !progressBarOption2 || progressBarOption2->orientation == Qt::Horizontal; if( !horizontal ) return true; // store rect and palette const QRect& rect( option->rect ); const QPalette& palette( option->palette ); // store state and direction const State& state( option->state ); const bool enabled( state & State_Enabled ); // define text rect Qt::Alignment hAlign( ( progressBarOption->textAlignment == Qt::AlignLeft ) ? Qt::AlignHCenter : progressBarOption->textAlignment ); drawItemText( painter, rect, Qt::AlignVCenter | hAlign, palette, enabled, progressBarOption->text, QPalette::WindowText ); return true; } QRect Style::progressBarGrooveRect(const QStyleOption *option, const QWidget *widget) const { // cast option and check const QStyleOptionProgressBar* progressBarOption( qstyleoption_cast( option ) ); if( !progressBarOption ) return option->rect; // get flags and orientation const bool textVisible( progressBarOption->textVisible ); const bool busy( progressBarOption->minimum == 0 && progressBarOption->maximum == 0 ); const QStyleOptionProgressBar *progressBarOption2(qstyleoption_cast(option)); const bool horizontal( !progressBarOption2 || progressBarOption2->orientation == Qt::Horizontal ); // copy rectangle and adjust QRect rect( option->rect ); const int frameWidth( pixelMetric( PM_DefaultFrameWidth, option, widget ) ); if( horizontal ) rect = GeometryUtils::insideMargin( rect, frameWidth, 0 ); else rect = GeometryUtils::insideMargin( rect, 0, frameWidth ); if( textVisible && !busy && horizontal ) { QRect textRect( subElementRect( SE_ProgressBarLabel, option, widget ) ); textRect = visualRect( option->direction, option->rect, textRect ); rect = visualRect( option->direction, option->rect, rect ); } return rect; } QRect Style::progressBarContentsRect(const QStyleOption *option, const QWidget *widget) const { // cast option and check const QStyleOptionProgressBar* progressBarOption( qstyleoption_cast( option ) ); if( !progressBarOption ) return QRect(); // get groove rect const QRect rect( progressBarGrooveRect( option, widget ) ); // in busy mode, grooveRect is used const bool busy( progressBarOption->minimum == 0 && progressBarOption->maximum == 0 ); if( busy ) return rect; // get orientation const QStyleOptionProgressBar *progressBarOption2(qstyleoption_cast(option)); const bool horizontal( !progressBarOption2 || progressBarOption2->orientation == Qt::Horizontal ); // check inverted appearance const bool inverted( progressBarOption2 ? progressBarOption2->invertedAppearance : false ); // get progress and steps const qreal progress( progressBarOption->progress - progressBarOption->minimum ); const int steps( qMax( progressBarOption->maximum - progressBarOption->minimum, 1 ) ); //Calculate width fraction const qreal widthFrac = qMin( qreal(1), progress/steps ); // convert the pixel width const int indicatorSize( widthFrac*( horizontal ? rect.width():rect.height() ) ); QRect indicatorRect; if( horizontal ) { indicatorRect = QRect( inverted ? ( rect.right() - indicatorSize + 1):rect.left(), rect.y(), indicatorSize, rect.height() ); indicatorRect = visualRect( option->direction, rect, indicatorRect ); } else indicatorRect = QRect( rect.x(), inverted ? rect.top() : (rect.bottom() - indicatorSize + 1), rect.width(), indicatorSize ); return indicatorRect; } QRect Style::progressBarLabelRect(const QStyleOption *option, const QWidget *) const { // cast option and check const QStyleOptionProgressBar* progressBarOption( qstyleoption_cast( option ) ); if( !progressBarOption ) return QRect(); // get flags and check const bool textVisible( progressBarOption->textVisible ); const bool busy( progressBarOption->minimum == 0 && progressBarOption->maximum == 0 ); if( !textVisible || busy ) return QRect(); // get direction and check const QStyleOptionProgressBar *progressBarOption2(qstyleoption_cast(option)); const bool horizontal( !progressBarOption2 || progressBarOption2->orientation == Qt::Horizontal ); if( !horizontal ) return QRect(); int textWidth = qMax( option->fontMetrics.size( Qt::TextHideMnemonic, progressBarOption->text ).width(), option->fontMetrics.size( Qt::TextHideMnemonic, QStringLiteral( "100%" ) ).width() ); int textHeight = option->fontMetrics.size( Qt::TextHideMnemonic, QStringLiteral( "100%" ) ).height(); QRect rect( GeometryUtils::insideMargin( option->rect, Metrics::Frame_FrameWidth, 0 ) ); return GeometryUtils::centerRect(rect, QSize(textWidth, textHeight)); } } qt5integration-5.5.23/styleplugins/dstyleplugin/pushbuttonhelper.cpp000066400000000000000000000221651424734202100261740ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include "common.h" #include "geometryutils.h" #include "style.h" #include "commonhelper.h" #include "painterhelper.h" #include "paletteextended.h" #include #ifdef DTKWIDGET_CLASS_DSuggestButton #include #include #endif #include #include #include DWIDGET_USE_NAMESPACE namespace dstyle { bool Style::drawPushButtonBevel(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { // cast option and check const QStyleOptionButton* buttonOption( qstyleoption_cast< const QStyleOptionButton* >( option ) ); if( !buttonOption ) return true; // rect and palette const QRect& rect( option->rect ); // button state const bool flat( buttonOption->features & QStyleOptionButton::Flat ); // update animation state // mouse over takes precedence over focus if( flat ) { // just draw text on flat button. // const QColor color( getFlatButtonColor(enabled, mouseOver, hasFocus, sunken) ); // drawFlatButtonFrame( painter, rect, color, sunken ); } else { // TODO(hualet): update button color from palette in case button is default const QColor shadow( Qt::transparent ); const QBrush outline( #ifdef DTKWIDGET_CLASS_DSuggestButton (buttonOption->features & DStyleOptionButton::SuggestButton) ? m_palette->brush(PaletteExtended::PushButton_SuggestButtonColor, option) : m_palette->brush(PaletteExtended::PushButton_BorderBrush, option) #else m_palette->brush(PaletteExtended::PushButton_BorderBrush, option) #endif ); const QBrush background(m_palette->brush(PaletteExtended::PushButton_BackgroundBrush, option)); // render drawPushButtonFrame(painter, rect, background, outline, shadow, widget); } if (buttonOption->features & QStyleOptionButton::HasMenu) { int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, buttonOption, widget); QRect ir = buttonOption->rect; QStyleOptionButton newBtn = *buttonOption; newBtn.rect = QRect(ir.right() - mbi + 2, ir.height()/2 - mbi/2 + 3, mbi - 6, mbi - 6); proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget); } return true; } bool Style::drawPushButtonLabel(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { // cast option and check const QStyleOptionButton* buttonOption( qstyleoption_cast( option ) ); if( !buttonOption ) return true; // copy rect and palette const QRect& rect( option->rect ); // state const QStyle::State& state( option->state ); const bool enabled( state & QStyle::State_Enabled ); const bool sunken( state & (QStyle::State_On | QStyle::State_Sunken) ); const bool mouseOver(option->state & QStyle::State_MouseOver); const bool hasFocus(option->state & QStyle::State_HasFocus); const bool flat( buttonOption->features & QStyleOptionButton::Flat ); const bool suggest( #ifdef DTKWIDGET_CLASS_DSuggestButton buttonOption->features & DStyleOptionButton::SuggestButton #else false #endif ); // content const bool hasText( !buttonOption->text.isEmpty() ); const bool hasIcon( ( flat || !hasText ) && !buttonOption->icon.isNull() ); // contents QRect contentsRect( rect ); // menu arrow /* if( buttonOption->features & QStyleOptionButton::HasMenu ) { // define rect QRect arrowRect( contentsRect ); arrowRect.setLeft( contentsRect.right() - Metrics::MenuButton_IndicatorWidth + 1 ); arrowRect = GeometryUtils::centerRect( arrowRect, Metrics::MenuButton_IndicatorWidth, Metrics::MenuButton_IndicatorWidth ); contentsRect.setRight( arrowRect.left() - Metrics::Button_ItemSpacing - 1 ); contentsRect.adjust( Metrics::Button_MarginWidth, 0, 0, 0 ); arrowRect = widget->style()->visualRect( option->direction, option->rect, arrowRect ); // define color const QColor arrowColor( _helper->arrowColor( palette, textRole ) ); _helper->renderArrow( painter, arrowRect, arrowColor, ArrowDown ); } */ // icon size QSize iconSize; if( hasIcon ) { iconSize = buttonOption->iconSize; if( !iconSize.isValid() ) { const int metric( proxy()->pixelMetric( QStyle::PM_SmallIconSize, option, widget ) ); iconSize = QSize( metric, metric ); } } // text size int textFlags( Qt::AlignCenter ); const QSize textSize( option->fontMetrics.size( textFlags, buttonOption->text ) ); if (styleHint(SH_UnderlineShortcut, buttonOption, widget)) textFlags |= Qt::TextShowMnemonic; else textFlags |= Qt::TextHideMnemonic; // adjust text and icon rect based on options QRect iconRect; QRect textRect; if( hasText && !hasIcon ) textRect = contentsRect; else if( hasIcon && !hasText ) iconRect = contentsRect; else { const int contentsWidth( iconSize.width() + textSize.width() + Metrics::Button_ItemSpacing ); iconRect = QRect( QPoint( contentsRect.left() + (contentsRect.width() - contentsWidth )/2, contentsRect.top() + (contentsRect.height() - iconSize.height())/2 ), iconSize ); textRect = QRect( QPoint( iconRect.right() + Metrics::ToolButton_ItemSpacing + 1, contentsRect.top() + (contentsRect.height() - textSize.height())/2 ), textSize ); } // handle right to left if( iconRect.isValid() ) iconRect = proxy()->visualRect( option->direction, option->rect, iconRect ); if( textRect.isValid() ) textRect = proxy()->visualRect( option->direction, option->rect, textRect ); // make sure there is enough room for icon if( iconRect.isValid() ) iconRect = GeometryUtils::centerRect( iconRect, iconSize ); // render icon if( hasIcon && iconRect.isValid() ) { // icon state and mode const QIcon::State iconState( sunken ? QIcon::On : QIcon::Off ); QIcon::Mode iconMode; if( !enabled ) iconMode = QIcon::Disabled; else if( !flat && hasFocus ) iconMode = QIcon::Selected; else if( mouseOver && flat ) iconMode = QIcon::Active; else iconMode = QIcon::Normal; buttonOption->icon.paint(painter, iconRect, Qt::AlignCenter, iconMode, iconState); } // render text if( hasText && textRect.isValid() ) { if (suggest) { painter->setPen(m_palette->brush(PaletteExtended::PushButton_SuggestTextColor, option).color()); } else { painter->setPen(m_palette->brush(PaletteExtended::PushButton_TextColor, option).color()); } if (buttonOption->features & QStyleOptionButton::HasMenu) textRect = textRect.adjusted(0, 0, -proxy()->pixelMetric(PM_MenuButtonIndicator, buttonOption, widget), 0); painter->drawText(textRect, textFlags, buttonOption->text); } return true; } bool Style::drawPushButtonFrame(QPainter* painter, const QRect& rect, const QBrush& brush, const QBrush& outline, const QColor& shadow, const QWidget *widget) const { Q_UNUSED(shadow) // setup painter painter->setRenderHint( QPainter::Antialiasing, true ); const qreal radius( GeometryUtils::frameRadius() ); const QMarginsF margins(0.5, 0.5, 0.5, 0.5); QPainterPath path; path.addRoundedRect(QRectF(rect).marginsRemoved(margins), radius, radius); // ButtonTuples are QPushButton groups that needs to be taken care of, // the right corners of the LeftButton are not rounded, and the left // corners of the RightButton are not rounded either. if (widget) { const QString className = widget->metaObject()->className(); const QRectF rf = QRectF(rect); if (className == "dcc::widgets::LeftButton") { QPainterPath rightHalf; rightHalf.addRect(rf.right() - radius, rf.y() + margins.top(), radius, rf.height() - margins.top() - margins.bottom()); path = path.united(rightHalf); } else if (className == "dcc::widgets::RightButton") { QPainterPath leftHalf; leftHalf.addRect(rf.left(), rf.y() + margins.top(), radius, rf.height() - margins.top() - margins.bottom()); path = path.united(leftHalf); } } PainterHelper::drawPath(painter, path, brush, Metrics::Painter_PenWidth, outline); return true; } }// end namespace dstyle qt5integration-5.5.23/styleplugins/dstyleplugin/rubberbandhelper.cpp000066400000000000000000000024671424734202100260720ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "style.h" #include "painterhelper.h" #include "paletteextended.h" #include "common.h" namespace dstyle { bool Style::drawRubberBandControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { Q_UNUSED(widget) const QBrush &backgroundBrush = m_palette->brush(PaletteExtended::RubberBand_BackgroundBrush, option); const QBrush &borderBrush = m_palette->brush(PaletteExtended::RubberBand_BorderBrush, option); PainterHelper::drawRect(painter, option->rect.adjusted(1, 1, -1, -1), backgroundBrush, Metrics::Painter_PenWidth, borderBrush); return true; } } qt5integration-5.5.23/styleplugins/dstyleplugin/scrollbarhelper.cpp000066400000000000000000000243171424734202100257450ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "commonhelper.h" #include "paletteextended.h" #include "style.h" #include "painterhelper.h" #include "geometryutils.h" #include "dstyleanimation.h" #include #include #include #include namespace dstyle { QRect Style::scrollbarSubControlRect(const QStyleOptionComplex *opt, QStyle::SubControl sc, const QWidget *widget) const { QRect ret(0, 0, 0, 0); if (const QStyleOptionSlider *scrollbar = qstyleoption_cast(opt)) { const bool enabled(opt->state & QStyle::State_Enabled); const bool mouseOver(opt->state & QStyle::State_MouseOver); const QRect scrollBarRect = scrollbar->rect; int sbextent = 0; if (!proxy()->styleHint(SH_ScrollBar_Transient, scrollbar, widget)) sbextent = proxy()->pixelMetric(PM_ScrollBarExtent, scrollbar, widget); int maxlen = ((scrollbar->orientation == Qt::Horizontal) ? scrollBarRect.width() : scrollBarRect.height()); int sliderlen; // calculate slider length if (scrollbar->maximum != scrollbar->minimum) { uint range = scrollbar->maximum - scrollbar->minimum; sliderlen = (qint64(scrollbar->pageStep) * maxlen) / (range + scrollbar->pageStep); int slidermin = proxy()->pixelMetric(PM_ScrollBarSliderMin, scrollbar, widget); if (sliderlen < slidermin || range > INT_MAX / 2) sliderlen = slidermin; if (sliderlen > maxlen) sliderlen = maxlen; } else { sliderlen = maxlen; } int sliderstart = sliderPositionFromValue(scrollbar->minimum, scrollbar->maximum, scrollbar->sliderPosition, maxlen - sliderlen, scrollbar->upsideDown); switch (sc) { case SC_ScrollBarSubLine: // top/left button if (scrollbar->orientation == Qt::Horizontal) { int buttonWidth = qMin(scrollBarRect.width() / 2, sbextent); ret.setRect(0, 0, buttonWidth, scrollBarRect.height()); } else { int buttonHeight = qMin(scrollBarRect.height() / 2, sbextent); ret.setRect(0, 0, scrollBarRect.width(), buttonHeight); } break; case SC_ScrollBarAddLine: // bottom/right button if (scrollbar->orientation == Qt::Horizontal) { int buttonWidth = qMin(scrollBarRect.width()/2, sbextent); ret.setRect(scrollBarRect.width() - buttonWidth, 0, buttonWidth, scrollBarRect.height()); } else { int buttonHeight = qMin(scrollBarRect.height()/2, sbextent); ret.setRect(0, scrollBarRect.height() - buttonHeight, scrollBarRect.width(), buttonHeight); } break; case SC_ScrollBarSubPage: // between top/left button and slider if (scrollbar->orientation == Qt::Horizontal) ret.setRect(sbextent, 0, sliderstart - sbextent, scrollBarRect.height()); else ret.setRect(0, sbextent, scrollBarRect.width(), sliderstart - sbextent); break; case SC_ScrollBarAddPage: // between bottom/right button and slider if (scrollbar->orientation == Qt::Horizontal) ret.setRect(sliderstart + sliderlen, 0, maxlen - sliderstart - sliderlen + sbextent, scrollBarRect.height()); else ret.setRect(0, sliderstart + sliderlen, scrollBarRect.width(), maxlen - sliderstart - sliderlen + sbextent); break; case SC_ScrollBarGroove: if (scrollbar->orientation == Qt::Horizontal) ret.setRect(sbextent, 0, scrollBarRect.width() - sbextent * 2, scrollBarRect.height()); else ret.setRect(0, sbextent, scrollBarRect.width(), scrollBarRect.height() - sbextent * 2); break; case SC_ScrollBarSlider: if (scrollbar->orientation == Qt::Horizontal) { if (mouseOver && enabled) ret.setRect(sliderstart, 2, sliderlen, scrollBarRect.height() - 4); else ret.setRect(sliderstart, scrollBarRect.height() / 3, sliderlen, scrollBarRect.height() / 3); } else { if (mouseOver && enabled) ret.setRect(2, sliderstart, scrollBarRect.width() - 4, sliderlen); else ret.setRect(scrollBarRect.width() / 3, sliderstart, scrollBarRect.width() / 3, sliderlen); } break; default: break; } ret = visualRect(scrollbar->direction, scrollBarRect, ret); } return ret; } bool Style::drawScrollBarSliderControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { const QStyleOptionSlider *scrollBar = qstyleoption_cast(option); QObject *styleObject = option->styleObject; bool wasActive = false; if (styleObject && styleObject && proxy()->styleHint(SH_ScrollBar_Transient, option, widget)) { Q_D(const Style); qreal opacity = 0.0; bool shouldExpand = false; int oldPos = styleObject->property("_q_stylepos").toInt(); int oldMin = styleObject->property("_q_stylemin").toInt(); int oldMax = styleObject->property("_q_stylemax").toInt(); QRect oldRect = styleObject->property("_q_stylerect").toRect(); int oldState = styleObject->property("_q_stylestate").toInt(); uint oldActiveControls = styleObject->property("_q_stylecontrols").toUInt(); // a scrollbar is transient when the the scrollbar itself and // its sibling are both inactive (ie. not pressed/hovered/moved) bool transient = !scrollBar->activeSubControls && !(option->state & State_On); if (!transient || oldPos != scrollBar->sliderPosition || oldMin != scrollBar->minimum || oldMax != scrollBar->maximum || oldRect != scrollBar->rect || oldState != static_cast(scrollBar->state) || oldActiveControls != scrollBar->activeSubControls) { // if the scrollbar is transient or its attributes, geometry or // state has changed, the opacity is reset back to 100% opaque opacity = 1.0; styleObject->setProperty("_q_stylepos", scrollBar->sliderPosition); styleObject->setProperty("_q_stylemin", scrollBar->minimum); styleObject->setProperty("_q_stylemax", scrollBar->maximum); styleObject->setProperty("_q_stylerect", scrollBar->rect); styleObject->setProperty("_q_stylestate", static_cast(scrollBar->state)); styleObject->setProperty("_q_stylecontrols", static_cast(scrollBar->activeSubControls)); #ifndef QT_NO_ANIMATION DScrollbarStyleAnimation *anim = qobject_cast(d->animation(styleObject)); if (transient) { if (!anim) { anim = new DScrollbarStyleAnimation(DScrollbarStyleAnimation::Deactivating, styleObject); d->startAnimation(anim); } else if (anim->mode() == DScrollbarStyleAnimation::Deactivating) { // the scrollbar was already fading out while the // state changed -> restart the fade out animation anim->setCurrentTime(0); } } else if (anim && anim->mode() == DScrollbarStyleAnimation::Deactivating) { d->stopAnimation(styleObject); } #endif // !QT_NO_ANIMATION } #ifndef QT_NO_ANIMATION DScrollbarStyleAnimation *anim = qobject_cast(d->animation(styleObject)); if (anim && anim->mode() == DScrollbarStyleAnimation::Deactivating) { // once a scrollbar was active (hovered/pressed), it retains // the active look even if it's no longer active while fading out if (oldActiveControls) anim->setActive(true); wasActive = anim->wasActive(); opacity = anim->currentValue(); } shouldExpand = (scrollBar->activeSubControls || wasActive); if (shouldExpand) { if (!anim && !oldActiveControls) { // Start expand animation only once and when entering anim = new DScrollbarStyleAnimation(DScrollbarStyleAnimation::Activating, styleObject); d->startAnimation(anim); } } painter->setOpacity(opacity); #endif // !QT_NO_ANIMATION } if (qFuzzyIsNull(painter->opacity())) return true; painter->setRenderHint(QPainter::Antialiasing); QRectF rect = option->rect; const QBrush &background = m_palette->brush(PaletteExtended::ScrollBar_HandleBrush, option, 0, Qt::lightGray); const QBrush &border = m_palette->brush(PaletteExtended::ScrollBar_HandleBorderBrush, option, 0, Qt::transparent); qreal radius = scrollBar->orientation == Qt::Horizontal ? rect.height() / 2.0 : rect.width() / 2.0; PainterHelper::drawRoundedRect(painter, rect, radius, radius, Qt::AbsoluteSize, background, Metrics::Painter_PenWidth, border); return true; } }// end namespace dstyle qt5integration-5.5.23/styleplugins/dstyleplugin/sliderhelper.cpp000066400000000000000000000271421424734202100252430ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include "style.h" #include "common.h" #include "colorutils.h" #include "geometryutils.h" #include "paletteextended.h" #include "commonhelper.h" #include "painterhelper.h" #include #include #include namespace dstyle { static const char *SliderTickmarkPositionsProp = "tickmarkPositions"; #define SliderHandleTypeNormal "Normal" #define SliderHandleTypeVernier "Vernier" #define SliderHandleTypeNone "None" QRect Style::sliderSubControlRect(const QStyleOptionComplex *option, QStyle::SubControl subControl, const QWidget *widget) const { // cast option and check const QStyleOptionSlider* sliderOption( qstyleoption_cast( option ) ); if( !sliderOption ) return QCommonStyle::subControlRect( CC_Slider, option, subControl, widget ); switch( subControl ) { case SC_SliderGroove: { // direction const bool horizontal( sliderOption->orientation == Qt::Horizontal ); // get base class rect QRect grooveRect( QCommonStyle::subControlRect( CC_Slider, option, subControl, widget ) ); grooveRect = GeometryUtils::insideMargin( grooveRect, pixelMetric( PM_DefaultFrameWidth, option, widget ) ); // centering if( horizontal ) { grooveRect = GeometryUtils::centerRect( grooveRect, grooveRect.width(), Metrics::Slider_GrooveThickness ); } else { grooveRect = GeometryUtils::centerRect( grooveRect, Metrics::Slider_GrooveThickness, grooveRect.height() ); } return grooveRect; } default: return QCommonStyle::subControlRect( CC_Slider, option, subControl, widget ); } } bool Style::drawSlider(const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const { // cast option and check const QStyleOptionSlider *sliderOption( qstyleoption_cast( option ) ); if( !sliderOption ) return true; const PaletteExtended *plExt = m_palette; // copy rect and palette const QRect& rect( option->rect ); // const QPalette& palette( option->palette ); // copy state const QStyle::State& state( option->state ); const bool enabled( state & QStyle::State_Enabled ); // const bool mouseOver( enabled && ( state & QStyle::State_MouseOver ) ); // const bool hasFocus( enabled && ( state & QStyle::State_HasFocus ) ); // direction const bool horizontal( sliderOption->orientation == Qt::Horizontal ); // tickmarks if( sliderOption->subControls & QStyle::SC_SliderTickmarks ) { const bool upsideDown( sliderOption->upsideDown ); const int tickPosition( sliderOption->tickPosition ); const int available( pixelMetric( QStyle::PM_SliderSpaceAvailable, option, widget ) ); int interval = sliderOption->tickInterval; if( interval < 1 ) interval = sliderOption->pageStep; if( interval >= 1 ) { const int fudge( pixelMetric( QStyle::PM_SliderLength, option, widget ) / 2 ); int current( sliderOption->minimum ); // store tick lines const QRect grooveRect( subControlRect( QStyle::CC_Slider, sliderOption, QStyle::SC_SliderGroove, widget ) ); QList tickLines; if( horizontal ) { if( tickPosition & QSlider::TicksAbove ) tickLines.append( QLine( rect.left(), grooveRect.top() - Metrics::Slider_TickMarginWidth, rect.left(), grooveRect.top() - Metrics::Slider_TickMarginWidth - Metrics::Slider_TickLength ) ); if( tickPosition & QSlider::TicksBelow ) tickLines.append( QLine( rect.left(), grooveRect.bottom() + Metrics::Slider_TickMarginWidth, rect.left(), grooveRect.bottom() + Metrics::Slider_TickMarginWidth + Metrics::Slider_TickLength ) ); } else { if( tickPosition & QSlider::TicksAbove ) tickLines.append( QLine( grooveRect.left() - Metrics::Slider_TickMarginWidth, rect.top(), grooveRect.left() - Metrics::Slider_TickMarginWidth - Metrics::Slider_TickLength, rect.top() ) ); if( tickPosition & QSlider::TicksBelow ) tickLines.append( QLine( grooveRect.right() + Metrics::Slider_TickMarginWidth, rect.top(), grooveRect.right() + Metrics::Slider_TickMarginWidth + Metrics::Slider_TickLength, rect.top() ) ); } QList tickmarkPositions; while( current <= sliderOption->maximum ) { // adjust pen painter->setPen( QPen(plExt->brush(PaletteExtended::Slider_TickmarkColor), Metrics::Painter_PenWidth) ); // calculate positions and draw lines int position( sliderPositionFromValue( sliderOption->minimum, sliderOption->maximum, current, available ) + fudge ); tickmarkPositions.append(position); foreach( const QLine& tickLine, tickLines ) { if( horizontal ) painter->drawLine( tickLine.translated( upsideDown ? (rect.width() - position) : position, 0 ) ); else painter->drawLine( tickLine.translated( 0, upsideDown ? (rect.height() - position):position ) ); } // go to next position current += interval; } QWidget *volatileWidget = const_cast(widget); // Tickmark positions are valuable to both drawing annotations and tickmark magnetic, // so we record it here to its properties. volatileWidget->setProperty(SliderTickmarkPositionsProp, tickmarkPositions); } } // groove if( sliderOption->subControls & QStyle::SC_SliderGroove ) { // retrieve groove rect QRect grooveRect( subControlRect( QStyle::CC_Slider, sliderOption, QStyle::SC_SliderGroove, widget ) ); // NOTE(hualet): adjust(cut) the grooveRect here, so later groove drawing will not // result in groove both ends are extended too far from the minimum tickmark and the maximum tickmark. const float adjustSize = pixelMetric(PM_SliderLength) / 2.0 * 0.5; if (sliderOption->orientation == Qt::Horizontal) grooveRect.adjust(adjustSize, 0, -adjustSize, 0); else grooveRect.adjust(0, adjustSize, 0, -adjustSize); // base brush const QBrush grooveBrush( plExt->brush(PaletteExtended::Slider_GrooveColor) ); if( !enabled ) drawSliderGroove( painter, grooveRect, grooveBrush ); else { const bool upsideDown( sliderOption->upsideDown ); // handle rect QRect handleRect( subControlRect( QStyle::CC_Slider, sliderOption, QStyle::SC_SliderHandle, widget ) ); // highlight brush const QBrush highlight( plExt->brush(PaletteExtended::Slider_GrooveHighlightColor) ); if( sliderOption->orientation == Qt::Horizontal ) { QRect leftRect( grooveRect ); leftRect.setRight( handleRect.right() - Metrics::Slider_ControlThickness/2 ); drawSliderGroove( painter, leftRect, upsideDown ? grooveBrush:highlight ); QRect rightRect( grooveRect ); rightRect.setLeft( handleRect.left() + Metrics::Slider_ControlThickness/2 ); drawSliderGroove( painter, rightRect, upsideDown ? highlight:grooveBrush ); } else { QRect topRect( grooveRect ); topRect.setBottom( handleRect.bottom() - Metrics::Slider_ControlThickness/2 ); drawSliderGroove( painter, topRect, upsideDown ? grooveBrush:highlight ); QRect bottomRect( grooveRect ); bottomRect.setTop( handleRect.top() + Metrics::Slider_ControlThickness/2 ); drawSliderGroove( painter, bottomRect, upsideDown ? highlight:grooveBrush ); } } } // handle if( sliderOption->subControls & QStyle::SC_SliderHandle ) { // get rect and center QRect handleRect( subControlRect( QStyle::CC_Slider, sliderOption, QStyle::SC_SliderHandle, widget ) ); // render const QString handleType = widget->property("handleType").toString(); drawSliderHandle( painter, sliderOption, handleRect, handleType); } return true; } void Style::drawSliderGroove(QPainter *painter, const QRect &rect, const QBrush &brush) const { // setup painter painter->setRenderHint( QPainter::Antialiasing, true ); const QRectF baseRect( rect ); const qreal radius( 0.5*Metrics::Slider_GrooveThickness ); // content if( brush.style() != Qt::NoBrush ) { painter->setPen( Qt::NoPen ); painter->setBrush( brush ); painter->drawRoundedRect( baseRect, radius, radius ); } return; } void Style::drawSliderHandle(QPainter* painter, const QStyleOptionSlider *option, const QRect& rect, const QString &type) const { // setup painter painter->setRenderHint( QPainter::Antialiasing, true ); // copy rect // QRectF frameRect( rect ); // frameRect.adjust( 1, 1, -1, -1 ); // shadow // if( shadow.isValid() && !sunken ) // { // painter->setPen( QPen( shadow, 2 ) ); // painter->setBrush( Qt::NoBrush ); // painter->drawEllipse( frameRect ); // } if (type == SliderHandleTypeNone) { return; // draw no handle } else if (type == SliderHandleTypeVernier) { // draw vernier handle fillBrush(painter, rect, m_palette->brush(PaletteExtended::Slider_VernierHandleBrush, option)); } else { // draw circle handle fillBrush(painter, rect, m_palette->brush(PaletteExtended::Slider_HandleBrush, option)); } } bool Style::drawSliderTickmarkLabels(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { QRect rect( option->rect ); QVariantList labels = widget->property("tickmarkLabels").toList(); if (labels.length() == 0) return false; QWidget *parent = widget->parentWidget(); if (parent && parent->inherits("dcc::widgets::DCCSliderAnnotated")) { QSlider *slider = parent->findChild(); if (slider) { QList positions = slider->property(SliderTickmarkPositionsProp).toList(); PaletteExtended *plExt = m_palette; painter->setPen(QPen(plExt->brush(PaletteExtended::Slider_TickmarkColor), Metrics::Painter_PenWidth)); for (int i = 0; i < positions.length() && i < labels.length(); i++) { const QString text = labels.at(i).toString(); const int rWidth = option->fontMetrics.width(text); const int deltaX = slider->x() - widget->x(); const int x = positions.at(i).toInt() + deltaX; const int rX = qMax(0.0, qMin(rect.width() - rWidth / 1.0, x - rWidth / 2.0)); QRect r ( rX, rect.y(), rWidth, rect.height() ); painter->drawText(r, Qt::AlignTop, text); } } } return true; } } // end namespace dstyle qt5integration-5.5.23/styleplugins/dstyleplugin/spinboxhelper.cpp000066400000000000000000000142201424734202100254340ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "style.h" #include "paletteextended.h" #include #include #include namespace dstyle { extern PaletteExtended::PseudoClassType lineEditStateToPseudoClassType(QStyle::State state); bool Style::drawSpinBoxComplexControl( const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget ) const { const QStyleOptionSpinBox *sb( qstyleoption_cast( option ) ); if( !sb ) return true; // store palette and rect const QPalette& palette( option->palette ); const QRect& rect( option->rect ); if( option->subControls & SC_SpinBoxFrame ) { // detect flat spinboxes bool flat( !sb->frame ); flat |= ( rect.height() < 2*Metrics::Frame_FrameWidth + Metrics::SpinBox_ArrowButtonWidth ); if( flat ) { const QColor background( palette.color( QPalette::Base ) ); painter->setBrush( background ); painter->setPen( Qt::NoPen ); painter->drawRect( rect ); } else { drawPrimitive( PE_FrameLineEdit, option, painter, widget ); } } QStyleOptionSpinBox copy = *sb; PrimitiveElement pe; // int fw = -Metrics::Painter_PenWidth; if (sb->subControls & SC_SpinBoxUp) { copy.subControls = SC_SpinBoxUp; if (!(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled)) { copy.state &= ~State_Enabled; } if (sb->activeSubControls == SC_SpinBoxUp && (sb->state & State_Sunken)) { copy.state |= State_On; copy.state |= State_Sunken; } else { copy.state |= State_Raised; copy.state &= ~State_Sunken; } pe = (sb->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinPlus : PE_IndicatorSpinUp); copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget); // copy.rect.adjust(0, -fw, 0, fw); // fillBrush(painter, copy.rect, m_palette->brush(PaletteExtended::SpinBox_PlusBrush, ©)); // painter->setPen(QPen(m_palette->brush(PaletteExtended::SpinBox_BorderColor, option), Metrics::Painter_PenWidth)); // painter->drawLine(copy.rect.topLeft(), copy.rect.bottomLeft()); proxy()->drawPrimitive(pe, ©, painter, widget); } if (sb->subControls & SC_SpinBoxDown) { copy.subControls = SC_SpinBoxDown; copy.state = sb->state; QPalette pal2 = sb->palette; if (!(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled)) { pal2.setCurrentColorGroup(QPalette::Disabled); copy.state &= ~State_Enabled; } copy.palette = pal2; if (sb->activeSubControls == SC_SpinBoxDown && (sb->state & State_Sunken)) { copy.state |= State_On; copy.state |= State_Sunken; } else { copy.state |= State_Raised; copy.state &= ~State_Sunken; } pe = (sb->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinMinus : PE_IndicatorSpinDown); copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget); // copy.rect.adjust(0, -fw, 0, fw); // fillBrush(painter, copy.rect, m_palette->brush(PaletteExtended::SpinBox_MinusBrush, ©)); // painter->setPen(QPen(m_palette->brush(PaletteExtended::SpinBox_BorderColor, option), Metrics::Painter_PenWidth)); // painter->drawLine(copy.rect.topLeft(), copy.rect.bottomLeft()); proxy()->drawPrimitive(pe, ©, painter, widget); } painter->setPen(QPen(m_palette->brush(PaletteExtended::SpinBox_BorderColor, lineEditStateToPseudoClassType(option->state)), Metrics::Painter_PenWidth)); QRect lineEditRect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxEditField, widget).adjusted(0, -1, 0, 1); painter->drawLine(lineEditRect.topRight(), lineEditRect.bottomRight()); return true; } QRect Style::spinboxSubControlRect(const QStyleOptionComplex *opt, QStyle::SubControl sc, const QWidget *widget) const { Q_UNUSED(widget) QRect ret; if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast(opt)) { QSize bs; int fw = 0; bs.setHeight(spinbox->rect.height() - 2 * fw); // 1.6 -approximate golden mean bs.setWidth(bs.height()); bs = bs.expandedTo(QApplication::globalStrut()); int y = fw; int x, lx, rx; x = spinbox->rect.right() - fw - bs.width(); lx = fw; rx = x - fw - bs.width(); switch (sc) { case SC_SpinBoxUp: if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) return QRect(); ret = QRect(x, y, bs.width(), bs.height()); break; case SC_SpinBoxDown: if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) return QRect(); ret = QRect(x - bs.width(), y, bs.width(), bs.height()); break; case SC_SpinBoxEditField: if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) { ret = QRect(lx, fw, spinbox->rect.width() - 2*fw, spinbox->rect.height() - 2*fw); } else { ret = QRect(lx, fw, rx, spinbox->rect.height() - 2*fw); } break; case SC_SpinBoxFrame: ret = spinbox->rect; default: break; } ret = visualRect(spinbox->direction, spinbox->rect, ret); } return ret; } } qt5integration-5.5.23/styleplugins/dstyleplugin/style.cpp000066400000000000000000001532251424734202100237230ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #include "style.h" #include "common.h" #include "geometryutils.h" #include "paletteextended.h" #include "commonhelper.h" #include "dstyleanimation.h" #include "hidpihelper.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef DTKWIDGET_CLASS_DTabBar #include #endif DWIDGET_USE_NAMESPACE namespace dstyle { QColor StylePrivate::outline(const QPalette &pal) const { if (pal.window().style() == Qt::TexturePattern) return QColor(0, 0, 0, 160); return pal.background().color().darker(140); } QColor StylePrivate::buttonColor(const QPalette &pal) const { QColor buttonColor = pal.button().color(); int val = qGray(buttonColor.rgb()); buttonColor = buttonColor.lighter(100 + qMax(1, (180 - val)/6)); buttonColor.setHsv(buttonColor.hue(), buttonColor.saturation() * 0.75, buttonColor.value()); return buttonColor; } QColor StylePrivate::highlight(const QPalette &pal) const { return pal.color(QPalette::Highlight); } QColor StylePrivate::highlightedOutline(const QPalette &pal) const { QColor highlightedOutline = highlight(pal).darker(125); if (highlightedOutline.value() > 160) highlightedOutline.setHsl(highlightedOutline.hue(), highlightedOutline.saturation(), 160); return highlightedOutline; } QColor StylePrivate::backgroundColor(const QPalette &pal, const QWidget *widget) const { if (qobject_cast(widget) && widget->parent() && qobject_cast(widget->parent()->parent())) return widget->parentWidget()->parentWidget()->palette().color(QPalette::Base); return pal.color(QPalette::Base); } #ifndef QT_NO_ANIMATION DStyleAnimation *StylePrivate::animation(const QObject *target) const { return animations.value(target); } void StylePrivate::startAnimation(DStyleAnimation *animation) const { Q_Q(const Style); stopAnimation(animation->target()); q->connect(animation, SIGNAL(destroyed()), SLOT(_q_removeAnimation()), Qt::UniqueConnection); animations.insert(animation->target(), animation); animation->start(); } void dstyle::StylePrivate::stopAnimation(const QObject *target) const { DStyleAnimation *animation = animations.take(target); if (animation) { animation->stop(); delete animation; } } void StylePrivate::_q_removeAnimation() { Q_Q(Style); QObject *animation = q->sender(); if (animation) animations.remove(animation->parent()); } #endif void StylePrivate::_q_updateAppFont() { if (qApp->desktopSettingsAware()) { qApp->setFont(QGuiApplication::font()); for (QWidget *w : qApp->allWidgets()) { if (!w->isWindow() && w->testAttribute(Qt::WA_StyleSheet)) { QEvent e(QEvent::ApplicationFontChange); qApp->sendEvent(w, &e); } } } } Style::Style(StyleType style) : QCommonStyle(*new StylePrivate()) , m_type(style) { m_palette = PaletteExtended::instance(style); } Style::~Style() { } void Style::polish(QPalette &p) { QCommonStyle::polish(p); m_palette->polish(p); } void Style::polish(QWidget *w) { QCommonStyle::polish(w); if (qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || isTabBarToolButton(w)) w->setAttribute(Qt::WA_Hover, true); if (qobject_cast(w)) { w->setAttribute(Qt::WA_OpaquePaintEvent, false); } if (w->inherits("dcc::widgets::SliderAnnotation")) { QFont font = w->font(); font.setPointSizeF(qApp->font().pointSizeF() - 1); w->setFont(font); } if (DApplication::isDXcbPlatform()) { bool is_menu = qobject_cast(w); bool is_tip = w->inherits("QTipLabel"); // 当窗口已经创建对应的native窗口,要判断当前是否已经设置了窗口背景透明 // Bug: https://github.com/linuxdeepin/internal-discussion/issues/323 if ((is_menu || is_tip) && w->windowHandle()) { if (const QPlatformWindow *handle = w->windowHandle()->handle()) { if (!w->testAttribute(Qt::WA_TranslucentBackground) && !handle->isExposed()) { // 销毁现有的native窗口,否则设置Qt::WA_TranslucentBackground不会生效 class DQWidget : public QWidget {public: using QWidget::destroy;}; reinterpret_cast(w)->destroy(true, false); } } } if (is_menu) { DPlatformWindowHandle handle(w); if (DPlatformWindowHandle::isEnabledDXcb(w)) { const QColor &color = m_palette->brush(PaletteExtended::Menu_BorderColor).color(); if (color.isValid()) handle.setBorderColor(color); handle.setShadowOffset(QPoint(0, 4)); handle.setShadowRadius(15); handle.setShadowColor(QColor(0, 0, 0, 100)); #ifdef DTK_SUPPORT_BLUR_WINDOW handle.setEnableBlurWindow(true); #endif handle.setTranslucentBackground(true); w->setAttribute(Qt::WA_TranslucentBackground); } } else if (is_tip) { DPlatformWindowHandle handle(w); if (DPlatformWindowHandle::isEnabledDXcb(w)) { handle.setShadowOffset(QPoint(0, 2)); handle.setShadowRadius(4); w->setAttribute(Qt::WA_TranslucentBackground); } } } // NOTE(lxz): QLineEdit not refresh style after theme changed if (QLineEdit *edit = qobject_cast(w)) { bool clear_button_visible = edit->isClearButtonEnabled(); if (clear_button_visible) { const QList &actions = edit->findChildren("_q_qlineeditclearaction"); if (!actions.isEmpty()) { actions.first()->setIcon(standardIcon(QStyle::SP_LineEditClearButton, nullptr, w)); } } } QPalette palette = w->palette(); if (w->testAttribute(Qt::WA_SetStyle)) { polish(palette); } // combo box drop-list. // line edit completer drop-list if (widgetIsComboBoxPopupFramePrimitive(w)) { polish(palette); palette.setBrush(QPalette::Background, m_palette->brush(PaletteExtended::Menu_BackgroundBrush, PaletteExtended::PseudoClass_Unspecified, palette.brush(QPalette::Background))); } // TODO(zccrs): 临时解决方案,用于支持应用程序中自定义DTabBar的被选中Tab的文本颜色 DTabBar *tabBar = qobject_cast(w); if (tabBar) { if (!tabBar->testAttribute(Qt::WA_SetPalette)) palette.setBrush(QPalette::Active, QPalette::Text, m_palette->brush(PaletteExtended::TabBarTab_TextColor, PaletteExtended::PseudoClass_Selected)); } w->setPalette(palette); } static QObject *themeSettings() { return reinterpret_cast(qvariant_cast(qApp->property("_d_theme_settings_object"))); } void Style::polish(QApplication *app) { if (QObject *obj = themeSettings()) { connect(obj, SIGNAL(systemFontChanged(QString)), this, SLOT(_q_updateAppFont())); connect(obj, SIGNAL(systemFontPointSizeChanged(qreal)), this, SLOT(_q_updateAppFont())); } QCommonStyle::polish(app); } void Style::unpolish(QWidget *w) { if (qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || qobject_cast(w) || isTabBarToolButton(w)) w->setAttribute(Qt::WA_Hover, false); if (qobject_cast(w)) { w->setAttribute(Qt::WA_OpaquePaintEvent, true); } if (w->inherits("dcc::widgets::SliderAnnotation")) { QFont font = w->font(); font.setPointSizeF(qApp->font().pointSizeF()); w->setFont(font); w->setAttribute(Qt::WA_SetFont, false); } } void Style::unpolish(QApplication *app) { if (QObject *obj = themeSettings()) { disconnect(obj, SIGNAL(systemFontChanged(QString)), this, SLOT(_q_updateAppFont())); disconnect(obj, SIGNAL(systemFontPointSizeChanged(qreal)), this, SLOT(_q_updateAppFont())); } QCommonStyle::unpolish(app); } int Style::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, const QWidget *widget) const { // handle special cases switch( metric ) { // frame width case PM_DefaultFrameWidth: { if( qobject_cast( widget ) ) return Metrics::Menu_FrameWidth; if( qobject_cast( widget ) ) return Metrics::LineEdit_FrameWidth; // fallback return Metrics::Frame_FrameWidth; } case PM_ComboBoxFrameWidth: { const QStyleOptionComboBox* comboBoxOption( qstyleoption_cast< const QStyleOptionComboBox*>( option ) ); return comboBoxOption && comboBoxOption->editable ? Metrics::LineEdit_FrameWidth : Metrics::ComboBox_FrameWidth; } case PM_SpinBoxFrameWidth: return Metrics::SpinBox_FrameWidth; case PM_ToolBarFrameWidth: return Metrics::ToolBar_FrameWidth; case PM_ToolTipLabelFrameWidth: return Metrics::ToolTip_FrameWidth; case PM_LayoutHorizontalSpacing: return Metrics::Layout_DefaultSpacing; case PM_LayoutVerticalSpacing: return Metrics::Layout_DefaultSpacing; // buttons case PM_ButtonMargin: { // needs special case for kcalc buttons, to prevent the application to set too small margins if( widget && widget->inherits( "KCalcButton" ) ) return Metrics::Button_MarginWidth + 4; else return Metrics::Button_MarginWidth; } case PM_ButtonDefaultIndicator: return 0; case PM_ButtonShiftHorizontal: return 0; case PM_ButtonShiftVertical: return 0; //menu case PM_MenuHMargin: return Menu_HMargin; case PM_MenuVMargin: return Menu_VMargin; // menubars case PM_MenuBarPanelWidth: return 0; case PM_MenuBarHMargin: return 0; case PM_MenuBarVMargin: return 0; case PM_MenuBarItemSpacing: return Metrics::MenuBar_ItemSpacing; case PM_MenuDesktopFrameWidth: return 0; // menu buttons case PM_MenuButtonIndicator: return Metrics::MenuButton_IndicatorWidth; // toolbars case PM_ToolBarHandleExtent: return Metrics::ToolBar_HandleExtent; case PM_ToolBarSeparatorExtent: return Metrics::ToolBar_SeparatorWidth; case PM_ToolBarExtensionExtent: return pixelMetric( PM_SmallIconSize, option, widget ) + 2*Metrics::ToolButton_MarginWidth; case PM_ToolBarItemMargin: return 0; case PM_ToolBarItemSpacing: return Metrics::ToolBar_ItemSpacing; // tabbars case PM_TabBarTabShiftVertical: return 0; case PM_TabBarTabShiftHorizontal: return 0; case PM_TabBarTabOverlap: return Metrics::TabBar_TabOverlap; case PM_TabBarBaseOverlap: return Metrics::TabBar_BaseOverlap; case PM_TabBarTabHSpace: return 2*Metrics::TabBar_TabMarginWidth; case PM_TabBarTabVSpace: return 2*Metrics::TabBar_TabMarginHeight; case PM_TabCloseIndicatorWidth: case PM_TabCloseIndicatorHeight: return pixelMetric( PM_SmallIconSize, option, widget ); // scrollbars case PM_ScrollBarExtent: return Metrics::ScrollBar_Extend; case PM_ScrollBarSliderMin: return Metrics::ScrollBar_MinSliderHeight; // title bar case PM_TitleBarHeight: return 2*Metrics::TitleBar_MarginWidth + pixelMetric( PM_SmallIconSize, option, widget ); // sliders case PM_SliderThickness: return Metrics::Slider_ControlThickness; case PM_SliderControlThickness: return Metrics::Slider_ControlThickness; case PM_SliderLength: return Metrics::Slider_ControlThickness; // checkboxes and radio buttons case PM_IndicatorWidth: return Metrics::CheckBox_Size; case PM_IndicatorHeight: return Metrics::CheckBox_Size; case PM_ExclusiveIndicatorWidth: return Metrics::CheckBox_Size; case PM_ExclusiveIndicatorHeight: return Metrics::CheckBox_Size; // list heaaders case PM_HeaderMarkSize: return Metrics::Header_ArrowSize; case PM_HeaderMargin: return Metrics::Header_MarginWidth; // dock widget // return 0 here, since frame is handled directly in polish case PM_DockWidgetFrameWidth: return 0; case PM_DockWidgetTitleMargin: return Metrics::Frame_FrameWidth; case PM_DockWidgetTitleBarButtonMargin: return Metrics::ToolButton_MarginWidth; case PM_SplitterWidth: return Metrics::Splitter_SplitterWidth; case PM_DockWidgetSeparatorExtent: return Metrics::Splitter_SplitterWidth; #ifdef DTKWIDGET_CLASS_DTabBar case PM_TabBarScrollButtonWidth: { if (qobject_cast(widget->parent())) { return 0; } break; } #endif // fallback default: break; } return QCommonStyle::pixelMetric(metric, option, widget); } QRect Style::subControlRect(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, QStyle::SubControl sc, const QWidget *w) const { // SubControlRectFunc fn = nullptr; switch (cc) { case CC_Slider: return sliderSubControlRect(opt, sc, w); case CC_ScrollBar: return scrollbarSubControlRect(opt, sc, w); #ifndef QT_NO_COMBOBOX case CC_ComboBox: return comboBoxSubControlRect(opt, sc, w); #endif // case CC_SpinBox: return spinboxSubControlRect(opt, sc, w); default: break; } // if (fn) { // QRect rect = fn(opt, sc, w); // if (!rect.isEmpty()) { // return rect; // } // } return QCommonStyle::subControlRect(cc, opt, sc, w); } QRect Style::subElementRect(QStyle::SubElement r, const QStyleOption *opt, const QWidget *widget) const { switch (r) { case SE_ProgressBarGroove: // deliberate case SE_ProgressBarContents: return progressBarGrooveRect( opt, widget ); case SE_ProgressBarLabel: return progressBarLabelRect( opt, widget ); case SE_HeaderArrow: return headerArrowRect( opt, widget ); case SE_LineEditContents: return QCommonStyle::subElementRect(r, opt, widget).adjusted(LineEdit_LeftMargin, 0, 0, 0); default: break; } return QCommonStyle::subElementRect(r, opt, widget); } void Style::drawControl(QStyle::ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const { DrawControlFunc fcn(Q_NULLPTR); quint64 type = static_cast(element); switch (type) { case CE_PushButtonBevel: fcn = &Style::drawPushButtonBevel; break; case CE_PushButtonLabel: fcn = &Style::drawPushButtonLabel; break; // case CE_CheckBoxLabel: fcn = &Style::drawCheckBoxLabelControl; break; // case CE_RadioButtonLabel: fcn = &Style::drawCheckBoxLabelControl; break; case CE_ToolButtonLabel: fcn = &Style::drawToolButtonLabelControl; break; case CE_ComboBoxLabel: fcn = &Style::drawComboBoxLabelControl; break; case CE_MenuBarEmptyArea: return; case CE_MenuBarItem: fcn = &Style::drawMenuBarItemControl; break; case CE_MenuItem: fcn = &Style::drawMenuItemControl; break; // case CE_ToolBar: fcn = &Style::emptyControl; break; case CE_ProgressBar: fcn = &Style::drawProgressBarControl; break; case CE_ProgressBarContents: fcn = &Style::drawProgressBarContentsControl; break; case CE_ProgressBarGroove: fcn = &Style::drawProgressBarGrooveControl; break; case CE_ProgressBarLabel: fcn = &Style::drawProgressBarLabelControl; break; case CE_ScrollBarSlider: fcn = &Style::drawScrollBarSliderControl; break; // case CE_ScrollBarAddLine: fcn = &Style::drawScrollBarAddLineControl; break; // case CE_ScrollBarSubLine: fcn = &Style::drawScrollBarSubLineControl; break; // case CE_ScrollBarAddPage: fcn = &Style::emptyControl; break; // case CE_ScrollBarSubPage: fcn = &Style::emptyControl; break; case CE_ShapedFrame: fcn = &Style::drawShapedFrameControl; break; case CE_RubberBand: fcn = &Style::drawRubberBandControl; break; // case CE_SizeGrip: fcn = &Style::emptyControl; break; // case CE_HeaderSection: fcn = &Style::drawHeaderSectionControl; break; // case CE_HeaderEmptyArea: fcn = &Style::drawHeaderEmptyAreaControl; break; case CE_TabBarTabLabel: fcn = &Style::drawTabBarTabLabelControl; break; case CE_TabBarTabShape: fcn = &Style::drawTabBarTabShapeControl; break; case CE_CustomBase + 1: fcn = &Style::drawTabBarAddButtonControl; break; // case CE_ToolBoxTabLabel: fcn = &Style::drawToolBoxTabLabelControl; break; // case CE_ToolBoxTabShape: fcn = &Style::drawToolBoxTabShapeControl; break; // case CE_DockWidgetTitle: fcn = &Style::drawDockWidgetTitleControl; break; // case CE_CapacityBar: fcn = &Style::drawProgressBarControl; break; // fallback default: { // TODO: move this bare number comparison to some more human friendly form. if (static_cast(element) == QStyle::CE_CustomBase + 1024) { fcn = &Style::drawSliderTickmarkLabels; } } } painter->save(); // call function if implemented if( !( fcn && (this->*fcn)( option, painter, widget ) ) ) { QCommonStyle::drawControl( element, option, painter, widget ); } painter->restore(); } void Style::drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w) const { DrawComplexControlFunc fn = nullptr; switch (cc) { case CC_Slider: fn = &Style::drawSlider; break; #ifndef QT_NO_COMBOBOX case CC_ComboBox: fn = &Style::drawComboBox; break; #endif case CC_SpinBox: fn = &Style::drawSpinBoxComplexControl; break; default: break; } if (fn && (this->*fn)(opt, p, w)) { return; } return QCommonStyle::drawComplexControl(cc, opt, p, w); } void Style::drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const { DrawPrimitiveFunc fcn( nullptr ); switch( element ) { // case PE_PanelButtonCommand: fcn = &Style::drawPanelButtonCommandPrimitive; break; case PE_PanelButtonTool: fcn = &Style::drawPanelButtonToolPrimitive; break; // case PE_PanelScrollAreaCorner: fcn = &Style::drawPanelScrollAreaCornerPrimitive; break; case PE_PanelMenu: { QBrush menu_background_brush = m_palette->brush(PaletteExtended::Menu_BackgroundBrush, PaletteExtended::PseudoClass_Unspecified, option->palette.brush(QPalette::Background)); #ifdef DTK_SUPPORT_BLUR_WINDOW QColor menu_background_color = menu_background_brush.color(); if (DPlatformWindowHandle::isEnabledDXcb(widget) && menu_background_color.isValid()) { DPlatformWindowHandle handle(const_cast(widget)); if (handle.enableBlurWindow()) { menu_background_color.setAlphaF(DWindowManagerHelper::instance()->hasBlurWindow() ? 0.6 : menu_background_color.alphaF()); } menu_background_brush.setColor(menu_background_color); } #endif return painter->fillRect(option->rect, menu_background_brush); } case PE_PanelTipLabel: /*fcn = &Style::drawPanelTipLabelPrimitive; break;*/ { painter->fillRect(option->rect, Qt::white); return; } // case PE_PanelItemViewItem: fcn = &Style::drawPanelItemViewItemPrimitive; break; case PE_IndicatorCheckBox: fcn = &Style::drawIndicatorCheckBoxPrimitive; break; case PE_IndicatorRadioButton: fillBrush(painter, option->rect, m_palette->brush(PaletteExtended::RadioButton_BackgroundBrush, option)); return; // case PE_IndicatorButtonDropDown: fcn = &Style::drawIndicatorButtonDropDownPrimitive; break; case PE_IndicatorTabClose: fcn = &Style::drawIndicatorTabClosePrimitive; break; // case PE_IndicatorTabTear: fcn = &Style::drawIndicatorTabTearPrimitive; break; case PE_IndicatorArrowDown: if (isTabBarToolButton(widget)) { QStyleOptionToolButton sotb; sotb.QStyleOption::operator =(*option); sotb.arrowType = Qt::DownArrow; if (Q_LIKELY(drawScrollButtonLabelControl(&sotb, painter, widget))) return; } return drawStandardIcon(QStyle::SP_ArrowDown, option, painter, widget); case PE_IndicatorArrowLeft: if (isTabBarToolButton(widget)) { QStyleOptionToolButton sotb; sotb.QStyleOption::operator =(*option); sotb.arrowType = Qt::LeftArrow; if (Q_LIKELY(drawScrollButtonLabelControl(&sotb, painter, widget))) return; } return drawStandardIcon(QStyle::SP_ArrowLeft, option, painter, widget); case PE_IndicatorArrowRight: if (isTabBarToolButton(widget)) { QStyleOptionToolButton sotb; sotb.QStyleOption::operator =(*option); sotb.arrowType = Qt::RightArrow; if (Q_LIKELY(drawScrollButtonLabelControl(&sotb, painter, widget))) return; } return drawStandardIcon(QStyle::SP_ArrowRight, option, painter, widget); case PE_IndicatorArrowUp: if (isTabBarToolButton(widget)) { QStyleOptionToolButton sotb; sotb.QStyleOption::operator =(*option); sotb.arrowType = Qt::UpArrow; if (Q_LIKELY(drawScrollButtonLabelControl(&sotb, painter, widget))) return; } return drawStandardIcon(QStyle::SP_ArrowUp, option, painter, widget); case PE_IndicatorHeaderArrow: fcn = &Style::drawIndicatorHeaderArrowPrimitive; break; case PE_IndicatorSpinDown: case PE_IndicatorSpinMinus: fillBrush(painter, option->rect, m_palette->brush(PaletteExtended::SpinBox_DownBrush, option)); return; case PE_IndicatorSpinPlus: case PE_IndicatorSpinUp: fillBrush(painter, option->rect, m_palette->brush(PaletteExtended::SpinBox_UpBrush, option)); return; // case PE_IndicatorToolBarHandle: fcn = &Style::drawIndicatorToolBarHandlePrimitive; break; // case PE_IndicatorToolBarSeparator: fcn = &Style::drawIndicatorToolBarSeparatorPrimitive; break; // case PE_IndicatorBranch: fcn = &Style::drawIndicatorBranchPrimitive; break; // case PE_FrameStatusBar: fcn = &Style::emptyPrimitive; break; case PE_Frame: fcn = &Style::drawFramePrimitive; break; // case PE_FrameMenu: fcn = &Style::drawFrameMenuPrimitive; break; case PE_FrameLineEdit: fcn = &Style::drawFrameLineEditPrimitive; break; // case PE_FrameGroupBox: fcn = &Style::drawFrameGroupBoxPrimitive; break; case PE_FrameTabWidget: fcn = &Style::drawFrameTabWidgetPrimitive; break; case PE_FrameTabBarBase: fcn = &Style::drawFrameTabBarBasePrimitive; break; // case PE_FrameWindow: fcn = &Style::drawFrameWindowPrimitive; break; case PE_FrameFocusRect: fcn = &Style::drawFrameFocusRectPrimitive; break; // fallback default: break; } painter->save(); // call function if implemented if( !( fcn && (this->*fcn)( option, painter, widget ) ) ) { QCommonStyle::drawPrimitive( element, option, painter, widget ); } painter->restore(); } int Style::styleHint(QStyle::StyleHint sh, const QStyleOption *opt, const QWidget *w, QStyleHintReturn *shret) const { switch (sh) { case SH_ScrollBar_Transient: return true; case SH_ComboBox_ListMouseTracking: return true; case SH_MenuBar_MouseTracking: return true; case SH_Menu_MouseTracking: return true; case SH_Menu_SubMenuPopupDelay: return 100; case QStyle::SH_Menu_Scrollable: return true; case SH_Menu_SloppySubMenus: return true; #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) case SH_Menu_SubMenuUniDirection: return 1000; #endif case SH_Slider_AbsoluteSetButtons: return Qt::LeftButton; case SH_Slider_PageSetButtons: return Qt::MidButton; #if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) case SH_Widget_Animate: return true; #endif case QStyle::SH_ItemView_ShowDecorationSelected: return true; case SH_RubberBand_Mask: return 0; case SH_ComboBox_Popup: return true; default: break; } return QCommonStyle::styleHint(sh, opt, w, shret); } QSize Style::sizeFromContents(QStyle::ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const { QSize newSize = QCommonStyle::sizeFromContents(type, option, size, widget); switch (type) { case CT_PushButton: if (const QStyleOptionButton *btn = qstyleoption_cast(option)) { const bool flat = btn->features & QStyleOptionButton::Flat; const bool semiTransparent = m_type == StyleSemiDark || m_type == StyleSemiLight; if (!btn->text.isEmpty() && !flat) { if (newSize.width() < 80) newSize.setWidth(80); // QPushButton should be set a minimum height 36 in d-semi-transparent style. if (semiTransparent && newSize.height() < 36) newSize.setHeight(36); } if (!btn->icon.isNull() && btn->iconSize.height() > 16) newSize -= QSize(0, 2); } break; case CT_GroupBox: if (option) { int topMargin = qMax(pixelMetric(PM_ExclusiveIndicatorHeight), option->fontMetrics.height()) + GroupBox_TopMargin; newSize += QSize(10, topMargin); // Add some space below the groupbox } break; case CT_RadioButton: case CT_CheckBox: newSize += QSize(0, 1); break; case CT_ToolButton: newSize += QSize(2, 2); break; case CT_SpinBox: newSize += QSize(0, -3); break; case CT_ComboBox: newSize += QSize(0, -6); break; case CT_LineEdit: newSize += QSize(0, 4); break; case CT_MenuBarItem: newSize += QSize(8, 5); break; case CT_MenuItem: if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast(option)) { int w = newSize.width(); bool hideShortcutText = !isVisibleMenuShortText(); if (hideShortcutText) { w -= menuItem->tabWidth; int t = menuItem->text.indexOf(QLatin1Char('\t')); if (t != -1) { int textWidth = option->fontMetrics.width(menuItem->text.mid(t + 1)); if (menuItem->tabWidth == 0) w -= textWidth; } } int maxpmw = menuItem->maxIconWidth; int tabSpacing = 20; if (menuItem->text.contains(QLatin1Char('\t'))) { if (!hideShortcutText) w += tabSpacing; } else { if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu) { w += 2 * Menu_ArrowHMargin; } else if (menuItem->menuItemType == QStyleOptionMenuItem::DefaultItem) { QFontMetrics fm(menuItem->font); QFont fontBold = menuItem->font; fontBold.setBold(true); QFontMetrics fmBold(fontBold); w += fmBold.width(menuItem->text) - fm.width(menuItem->text); } } int checkcol = qMax(maxpmw, Menu_CheckMarkWidth); // Windows always shows a check column w += checkcol; w += Menu_RightBorder + 10; newSize.setWidth(w); if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { if (!menuItem->text.isEmpty()) { newSize.setHeight(menuItem->fontMetrics.height()); } else { newSize.setHeight(newSize.height() + 4); } } else if (!menuItem->icon.isNull()) { if (const QComboBox *combo = qobject_cast(widget)) { newSize.setHeight(qMax(combo->iconSize().height() + 2, newSize.height())); } } newSize.setWidth(newSize.width() + 12); newSize.setWidth(qMax(newSize.width(), 100)); } newSize.setWidth(newSize.width() + Menu_ItemHMargin * 2); newSize.setHeight(newSize.height() + Menu_ItemVMargin * 2 + 1); break; case CT_SizeGrip: newSize += QSize(4, 4); break; case CT_MdiControls: if (const QStyleOptionComplex *styleOpt = qstyleoption_cast(option)) { int width = 0; if (styleOpt->subControls & SC_MdiMinButton) width += 19 + 1; if (styleOpt->subControls & SC_MdiNormalButton) width += 19 + 1; if (styleOpt->subControls & SC_MdiCloseButton) width += 19 + 1; newSize = QSize(width, 19); } else { newSize = QSize(60, 19); } break; default: break; } return newSize; } QIcon Style::standardIcon(QStyle::StandardPixmap standardIcon, const QStyleOption *opt, const QWidget *widget) const { QIcon icon; const bool rtl = (opt && opt->direction == Qt::RightToLeft) || (!opt && QApplication::isRightToLeft()); QString themeType = m_type == StyleLight ? "light" : "dark"; if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty() && false) { switch (standardIcon) { case SP_DirHomeIcon: icon = QIcon::fromTheme(QLatin1String("user-home")); break; case SP_MessageBoxInformation: icon = QIcon::fromTheme(QLatin1String("dialog-information")); break; case SP_MessageBoxWarning: icon = QIcon::fromTheme(QLatin1String("dialog-warning")); break; case SP_MessageBoxCritical: icon = QIcon::fromTheme(QLatin1String("dialog-error")); break; case SP_MessageBoxQuestion: icon = QIcon::fromTheme(QLatin1String("dialog-question")); break; case SP_DialogOpenButton: case SP_DirOpenIcon: icon = QIcon::fromTheme(QLatin1String("folder-open")); break; case SP_DialogSaveButton: icon = QIcon::fromTheme(QLatin1String("document-save")); break; case SP_DialogApplyButton: icon = QIcon::fromTheme(QLatin1String("dialog-ok-apply")); break; case SP_DialogYesButton: case SP_DialogOkButton: icon = QIcon::fromTheme(QLatin1String("dialog-ok")); break; case SP_DialogDiscardButton: icon = QIcon::fromTheme(QLatin1String("edit-delete")); break; case SP_DialogResetButton: icon = QIcon::fromTheme(QLatin1String("edit-clear")); break; case SP_DialogHelpButton: icon = QIcon::fromTheme(QLatin1String("help-contents")); break; case SP_FileIcon: icon = QIcon::fromTheme(QLatin1String("text-x-generic")); break; case SP_DirClosedIcon: case SP_DirIcon: icon = QIcon::fromTheme(QLatin1String("folder")); break; case SP_DriveFDIcon: icon = QIcon::fromTheme(QLatin1String("floppy_unmount")); break; case SP_ComputerIcon: icon = QIcon::fromTheme(QLatin1String("computer"), QIcon::fromTheme(QLatin1String("system"))); break; case SP_DesktopIcon: icon = QIcon::fromTheme(QLatin1String("user-desktop")); break; case SP_TrashIcon: icon = QIcon::fromTheme(QLatin1String("user-trash")); break; case SP_DriveCDIcon: case SP_DriveDVDIcon: icon = QIcon::fromTheme(QLatin1String("media-optical")); break; case SP_DriveHDIcon: icon = QIcon::fromTheme(QLatin1String("drive-harddisk")); break; case SP_FileDialogToParent: icon = QIcon::fromTheme(QLatin1String("go-up")); break; case SP_FileDialogNewFolder: icon = QIcon::fromTheme(QLatin1String("folder-new")); break; case SP_ArrowUp: icon = QIcon::fromTheme(QLatin1String("go-up")); break; case SP_ArrowDown: icon = QIcon::fromTheme(QLatin1String("go-down")); break; case SP_ArrowRight: icon = QIcon::fromTheme(QLatin1String("go-next")); break; case SP_ArrowLeft: icon = QIcon::fromTheme(QLatin1String("go-previous")); break; case SP_DialogCancelButton: icon = QIcon::fromTheme(QLatin1String("dialog-cancel"), QIcon::fromTheme(QLatin1String("process-stop"))); break; case SP_DialogCloseButton: icon = QIcon::fromTheme(QLatin1String("window-close")); break; case SP_FileDialogDetailedView: icon = QIcon::fromTheme(QLatin1String("view-list-details")); break; case SP_FileDialogListView: icon = QIcon::fromTheme(QLatin1String("view-list-icons")); break; case SP_BrowserReload: icon = QIcon::fromTheme(QLatin1String("view-refresh")); break; case SP_BrowserStop: icon = QIcon::fromTheme(QLatin1String("process-stop")); break; case SP_MediaPlay: icon = QIcon::fromTheme(QLatin1String("media-playback-start")); break; case SP_MediaPause: icon = QIcon::fromTheme(QLatin1String("media-playback-pause")); break; case SP_MediaStop: icon = QIcon::fromTheme(QLatin1String("media-playback-stop")); break; case SP_MediaSeekForward: icon = QIcon::fromTheme(QLatin1String("media-seek-forward")); break; case SP_MediaSeekBackward: icon = QIcon::fromTheme(QLatin1String("media-seek-backward")); break; case SP_MediaSkipForward: icon = QIcon::fromTheme(QLatin1String("media-skip-forward")); break; case SP_MediaSkipBackward: icon = QIcon::fromTheme(QLatin1String("media-skip-backward")); break; case SP_MediaVolume: icon = QIcon::fromTheme(QLatin1String("audio-volume-medium")); break; case SP_MediaVolumeMuted: icon = QIcon::fromTheme(QLatin1String("audio-volume-muted")); break; case SP_ArrowForward: if (rtl) return Style::standardIcon(SP_ArrowLeft, opt, widget); return Style::standardIcon(SP_ArrowRight, opt, widget); case SP_ArrowBack: if (rtl) return Style::standardIcon(SP_ArrowRight, opt, widget); return Style::standardIcon(SP_ArrowLeft, opt, widget); case SP_FileLinkIcon: { QIcon linkIcon = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")); if (!linkIcon.isNull()) { QIcon baseIcon = Style::standardIcon(SP_FileIcon, opt, widget); const QList sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off); for (int i = 0 ; i < sizes.size() ; ++i) { int size = sizes[i].width(); QPixmap basePixmap = baseIcon.pixmap(qt_getWindow(widget), QSize(size, size)); QPixmap linkPixmap = linkIcon.pixmap(qt_getWindow(widget), QSize(size / 2, size / 2)); QPainter painter(&basePixmap); painter.drawPixmap(size/2, size/2, linkPixmap); icon.addPixmap(basePixmap); } } } break; case SP_DirLinkIcon: { QIcon linkIcon = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")); if (!linkIcon.isNull()) { QIcon baseIcon = Style::standardIcon(SP_DirIcon, opt, widget); const QList sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off); for (int i = 0 ; i < sizes.size() ; ++i) { int size = sizes[i].width(); QPixmap basePixmap = baseIcon.pixmap(qt_getWindow(widget), QSize(size, size)); QPixmap linkPixmap = linkIcon.pixmap(qt_getWindow(widget), QSize(size / 2, size / 2)); QPainter painter(&basePixmap); painter.drawPixmap(size/2, size/2, linkPixmap); icon.addPixmap(basePixmap); } } } break; default: break; } } // if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) if (!icon.isNull()) return icon; switch (standardIcon) { case SP_FileDialogNewFolder: break; case SP_FileDialogBack: return Style::standardIcon(SP_ArrowBack, opt, widget); case SP_FileDialogToParent: return Style::standardIcon(SP_ArrowUp, opt, widget); case SP_FileDialogDetailedView: break; case SP_FileDialogInfoView: break; case SP_FileDialogContentsView: break; case SP_FileDialogListView: break; case SP_DialogOkButton: case SP_DialogYesButton: icon.addFile(QLatin1String(":/assets/icons/dialog-apply.png")); break; case SP_DialogCancelButton: case SP_DialogNoButton: icon.addFile(QLatin1String(":/assets/icons/button-cancel.png")); break; case SP_DialogHelpButton: icon.addFile(QLatin1String(":/assets/icons/help-faq.png")); break; case SP_DialogOpenButton: break; case SP_DialogSaveButton: break; case SP_DialogCloseButton: return Style::standardIcon(SP_TitleBarCloseButton, opt, widget); case SP_DialogApplyButton: icon.addFile(QLatin1String(":/assets/icons/dialog-apply.png")); break; case SP_DialogResetButton: break; case SP_DialogDiscardButton: break; case SP_ArrowForward: if (rtl) return Style::standardIcon(SP_ArrowLeft, opt, widget); return Style::standardIcon(SP_ArrowRight, opt, widget); case SP_ArrowBack: if (rtl) return Style::standardIcon(SP_ArrowRight, opt, widget); return Style::standardIcon(SP_ArrowLeft, opt, widget); case SP_ArrowLeft: icon.addFile(QLatin1String(":/assets/icons/arrow-left.png")); break; case SP_ArrowRight: icon.addFile(QLatin1String(":/assets/icons/arrow-right.png")); break; case SP_ArrowUp: icon.addFile(QLatin1String(":/assets/icons/arrow-up.png")); break; case SP_ArrowDown: icon.addFile(QLatin1String(":/assets/icons/arrow-down.png")); break; case SP_DirHomeIcon: icon.addFile(QLatin1String(":/assets/icons/user-home.svg")); break; case SP_DirIcon: icon.addFile(QLatin1String(":/assets/icons/folder.svg")); break; case SP_DirOpenIcon: icon.addFile(QLatin1String(":/assets/icons/folder-open.svg")); break; case SP_DirLinkIcon: { QIcon linkIcon(":/assets/icons/emblem-symbolic-link.png"); QIcon baseIcon = Style::standardIcon(SP_DirIcon, opt, widget); QList sizes; sizes << QSize(128, 128); for (int i = 0 ; i < sizes.size() ; ++i) { int size = sizes[i].width(); QPixmap basePixmap = baseIcon.pixmap(qt_getWindow(widget), QSize(size, size)); QPixmap linkPixmap = linkIcon.pixmap(qt_getWindow(widget), QSize(size / 2, size / 2)); QPainter painter(&basePixmap); painter.drawPixmap(size/1.5, size/1.5, linkPixmap); icon.addPixmap(basePixmap); } break; } case SP_DirLinkOpenIcon: { QIcon linkIcon(":/assets/icons/emblem-symbolic-link.png"); QIcon baseIcon = Style::standardIcon(SP_DirOpenIcon, opt, widget); QList sizes; sizes << QSize(128, 128); for (int i = 0 ; i < sizes.size() ; ++i) { int size = sizes[i].width(); QPixmap basePixmap = baseIcon.pixmap(qt_getWindow(widget), QSize(size, size)); QPixmap linkPixmap = linkIcon.pixmap(qt_getWindow(widget), QSize(size / 2, size / 2)); QPainter painter(&basePixmap); painter.drawPixmap(size/1.5, size/1.5, linkPixmap); icon.addPixmap(basePixmap); } break; } case SP_DriveCDIcon: case SP_DriveDVDIcon: icon.addFile(QLatin1String(":/assets/icons/media-optical.png")); break; case SP_DriveHDIcon: icon.addFile(QLatin1String(":/assets/icons/drive-harddisk.png")); break; case SP_FileIcon: icon.addFile(QLatin1String(":/assets/icons/text-x-generic.svg")); break; case SP_FileLinkIcon: { QIcon linkIcon(":/assets/icons/emblem-symbolic-link.png"); QIcon baseIcon = Style::standardIcon(SP_FileIcon, opt, widget); QList sizes; sizes << QSize(128, 128); for (int i = 0 ; i < sizes.size() ; ++i) { int size = sizes[i].width(); QPixmap basePixmap = baseIcon.pixmap(qt_getWindow(widget), QSize(size, size)); QPixmap linkPixmap = linkIcon.pixmap(qt_getWindow(widget), QSize(size / 2, size / 2)); QPainter painter(&basePixmap); painter.drawPixmap(size/1.5, size/1.5, linkPixmap); icon.addPixmap(basePixmap); } break; } case SP_TrashIcon: icon.addFile(QLatin1String(":/assets/icons/user-trash.svg")); break; case SP_BrowserReload: icon.addFile(QLatin1String(":/assets/icons/view-refresh.png")); break; case SP_BrowserStop: icon.addFile(QLatin1String(":/assets/icons/process-stop.png")); break; case SP_MediaPlay: break; case SP_MediaPause: break; case SP_MediaStop: break; case SP_MediaSeekForward: break; case SP_MediaSeekBackward: break; case SP_MediaSkipForward: break; case SP_MediaSkipBackward: break; case SP_MediaVolume: break; case SP_MediaVolumeMuted: break; case SP_DockWidgetCloseButton: case SP_TitleBarCloseButton: icon.addFile(QString(":/assets/icons/window_close_normal_%1.png").arg(themeType)); icon.addFile(QString(":/assets/icons/window_close_hover_%1.png").arg(themeType), QSize(), QIcon::Active); icon.addFile(QString(":/assets/icons/window_close_press_%1.png").arg(themeType), QSize(), QIcon::Active, QIcon::On); break; case SP_TitleBarMaxButton: icon.addFile(QString(":/assets/icons/window_max_normal_%1.png").arg(themeType)); icon.addFile(QString(":/assets/icons/window_max_hover_%1.png").arg(themeType), QSize(), QIcon::Active); icon.addFile(QString(":/assets/icons/window_max_press_%1.png").arg(themeType), QSize(), QIcon::Active, QIcon::On); break; case SP_TitleBarNormalButton: icon.addFile(QString(":/assets/icons/window_unmax_normal_%1.png").arg(themeType)); icon.addFile(QString(":/assets/icons/window_unmax_hover_%1.png").arg(themeType), QSize(), QIcon::Active); icon.addFile(QString(":/assets/icons/window_unmax_press_%1.png").arg(themeType), QSize(), QIcon::Active, QIcon::On); break; case SP_TitleBarMinButton: icon.addFile(QString(":/assets/icons/window_min_normal_%1.png").arg(themeType)); icon.addFile(QString(":/assets/icons/window_min_hover_%1.png").arg(themeType), QSize(), QIcon::Active); icon.addFile(QString(":/assets/icons/window_min_press_%1.png").arg(themeType), QSize(), QIcon::Active, QIcon::On); break; case SP_TitleBarMenuButton: icon.addFile(QString(":/assets/icons/window_option_normal_%1.png").arg(themeType)); icon.addFile(QString(":/assets/icons/window_option_hover_%1.png").arg(themeType), QSize(), QIcon::Active); icon.addFile(QString(":/assets/icons/window_option_press_%1.png").arg(themeType), QSize(), QIcon::Active, QIcon::On); break; case SP_LineEditClearButton: icon.addFile(QString(":/assets/%1/input/input_clear_normal.svg").arg(themeType), QSize(), QIcon::Normal); icon.addFile(QString(":/assets/%1/input/input_clear_hover.svg").arg(themeType), QSize(), QIcon::Active); icon.addFile(QString(":/assets/%1/input/input_clear_press.svg").arg(themeType), QSize(), QIcon::Selected); break; default: break; } if (!icon.isNull()) return icon; return QCommonStyle::standardIcon(standardIcon, opt, widget); } void Style::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const { if (!qFuzzyCompare(pixmap.devicePixelRatio(), 1.0)) { if (!painter->testRenderHint(QPainter::SmoothPixmapTransform)) { painter->setRenderHint(QPainter::SmoothPixmapTransform); QCommonStyle::drawItemPixmap(painter, rect, alignment, pixmap); painter->setRenderHint(QPainter::SmoothPixmapTransform, false); return; } } QCommonStyle::drawItemPixmap(painter, rect, alignment, pixmap); } bool Style::isTabBarToolButton(const QWidget *button) const { if (Q_UNLIKELY(!button)) return false; if (Q_UNLIKELY(qobject_cast(button->parent()) #ifdef DTKWIDGET_CLASS_DTabBar || qobject_cast(button->parent()) #endif )) { if (auto *b = qobject_cast(button)) { if (b->arrowType() != Qt::NoArrow && b->icon().isNull()) return true; #ifdef DTKWIDGET_CLASS_DTabBar if (qobject_cast(button->parent()) && button->objectName() == "AddButton") return true; #endif } } return false; } void Style::drawStandardIcon(QStyle::StandardPixmap sp, const QStyleOption *opt, QPainter *p, const QWidget *widget) const { if (opt->rect.width() <= 1 || opt->rect.height() <= 1) return; QRect r = opt->rect; int size = qMin(r.height(), r.width()); const bool enabled(opt->state & QStyle::State_Enabled); const bool mouseOver(opt->state & QStyle::State_MouseOver); const bool hasFocus((opt->state & QStyle::State_HasFocus ) && !( widget && widget->focusProxy())); const bool sunken((opt->state | QStyle::State_Sunken) == opt->state); QIcon::Mode mode = QIcon::Normal; if (!enabled) mode = QIcon::Disabled; else if (mouseOver) mode = QIcon::Active; else if (hasFocus) mode = QIcon::Selected; QPixmap pixmap = standardIcon(sp, opt, widget).pixmap(widget ? widget->window()->windowHandle() : 0, QSize(size, size), mode, sunken ? QIcon::On : QIcon::Off); int xOffset = r.x() + (r.width() - size)/2; int yOffset = r.y() + (r.height() - size)/2; p->drawPixmap(xOffset, yOffset, pixmap); } void Style::drawDeepinStyleIcon(const QString &name, const QStyleOption *opt, QPainter *p, const QWidget *widget) const { if (opt->rect.width() <= 1 || opt->rect.height() <= 1) return; QRect r = opt->rect; int size = qMin(r.height(), r.width()); const bool enabled(opt->state & QStyle::State_Enabled); const bool mouseOver(opt->state & QStyle::State_MouseOver); const bool hasFocus((opt->state & QStyle::State_HasFocus ) && !( widget && widget->focusProxy())); const bool selected(opt->state & QStyle::State_Selected); QString icon_state = "_normal"; if (!enabled) icon_state = "_disabled"; else if (mouseOver) icon_state = "_hover"; else if (selected) icon_state = "_selected"; else if (hasFocus) icon_state = "_active"; QString style_name = "light"; if (m_type == StyleDark) style_name = "dark"; else if (m_type == StyleSemiDark) style_name = "semidark"; else if (m_type == StyleSemiLight) style_name = "semilight"; const QStringList formatList = QStringList() << "png" << "svg"; QPixmap pixmap; foreach (const QString &format, formatList) { pixmap = HiDPIHelper::loadPixmap(":/assets/" + style_name + "/" + name + icon_state + "." + format); if (!pixmap.isNull()) break; pixmap = HiDPIHelper::loadPixmap(":/assets/" + style_name + "/" + name + "_normal." + format); if (!pixmap.isNull()) break; } if (pixmap.isNull()) return; int xOffset = r.x() + (r.width() - size)/2; int yOffset = r.y() + (r.height() - size)/2; p->drawPixmap(xOffset, yOffset, pixmap); } QWindow *Style::qt_getWindow(const QWidget *widget) { return widget ? widget->window()->windowHandle() : 0; } QColor Style::mergedColors(const QColor &colorA, const QColor &colorB, int factor) { const int maxFactor = 100; QColor tmp = colorA; tmp.setRed((tmp.red() * factor) / maxFactor + (colorB.red() * (maxFactor - factor)) / maxFactor); tmp.setGreen((tmp.green() * factor) / maxFactor + (colorB.green() * (maxFactor - factor)) / maxFactor); tmp.setBlue((tmp.blue() * factor) / maxFactor + (colorB.blue() * (maxFactor - factor)) / maxFactor); return tmp; } QPixmap Style::colorizedImage(const QString &fileName, const QColor &color, int rotation) { QString pixmapName = QLatin1String("$qt_ia-") % fileName % HexString(color.rgba()) % QString::number(rotation); QPixmap pixmap; if (!QPixmapCache::find(pixmapName, pixmap)) { QImage image(fileName); if (image.format() != QImage::Format_ARGB32_Premultiplied) image = image.convertToFormat( QImage::Format_ARGB32_Premultiplied); int width = image.width(); int height = image.height(); int source = color.rgba(); unsigned char sourceRed = qRed(source); unsigned char sourceGreen = qGreen(source); unsigned char sourceBlue = qBlue(source); for (int y = 0; y < height; ++y) { QRgb *data = (QRgb*) image.scanLine(y); for (int x = 0 ; x < width ; x++) { QRgb col = data[x]; unsigned int colorDiff = (qBlue(col) - qRed(col)); unsigned char gray = qGreen(col); unsigned char red = gray + qt_div_255(sourceRed * colorDiff); unsigned char green = gray + qt_div_255(sourceGreen * colorDiff); unsigned char blue = gray + qt_div_255(sourceBlue * colorDiff); unsigned char alpha = qt_div_255(qAlpha(col) * qAlpha(source)); data[x] = qRgba(std::min(alpha, red), std::min(alpha, green), std::min(alpha, blue), alpha); } } if (rotation != 0) { QTransform transform; transform.translate(-image.width()/2, -image.height()/2); transform.rotate(rotation); transform.translate(image.width()/2, image.height()/2); image = image.transformed(transform); } pixmap = QPixmap::fromImage(image); QPixmapCache::insert(pixmapName, pixmap); } return pixmap; } void Style::fillBrush(QPainter *p, const QRect &rect, const QBrush &brush, qreal rotate) { if (brush.style() == Qt::TexturePattern) { QPixmap pixmap = brush.texture(); qreal device_ratio = pixmap.devicePixelRatio(); if (!qFuzzyCompare(rotate, 0)) { pixmap = pixmap.transformed(QTransform().rotate(rotate)); pixmap.setDevicePixelRatio(device_ratio); } QRectF r = rect; QSizeF pixmap_size = QSizeF(pixmap.size()); if (pixmap_size.width() > rect.width() * device_ratio || pixmap_size.height() > rect.height() * device_ratio) { p->setRenderHint(QPainter::SmoothPixmapTransform); pixmap_size.scale(rect.size() * device_ratio, Qt::KeepAspectRatio); } r.setSize(pixmap_size / device_ratio); r.moveCenter(QRectF(rect).center()); p->drawPixmap(r, pixmap, QRectF(QPointF(0, 0), pixmap.size())); } else { p->fillRect(rect, brush); } } } #include "moc_style.cpp" qt5integration-5.5.23/styleplugins/dstyleplugin/style.h000066400000000000000000000237531424734202100233720ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 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 . */ #ifndef STYLE_H #define STYLE_H #include #include #include "common.h" namespace dstyle { class PaletteExtended; class StylePrivate; class Style : public QCommonStyle { Q_OBJECT public: explicit Style(StyleType type); ~Style(); void polish(QPalette &p) Q_DECL_OVERRIDE; void polish(QWidget *w) Q_DECL_OVERRIDE; void polish(QApplication *app) Q_DECL_OVERRIDE; void unpolish(QWidget *w) Q_DECL_OVERRIDE; void unpolish(QApplication *app) Q_DECL_OVERRIDE; int pixelMetric(PixelMetric m, const QStyleOption *opt = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE; QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *w) const Q_DECL_OVERRIDE; QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget) const Q_DECL_OVERRIDE; void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w) const Q_DECL_OVERRIDE; void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w) const Q_DECL_OVERRIDE; void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const Q_DECL_OVERRIDE; int styleHint(StyleHint sh, const QStyleOption *opt = Q_NULLPTR, const QWidget *w = Q_NULLPTR, QStyleHintReturn *shret = Q_NULLPTR) const Q_DECL_OVERRIDE; QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const Q_DECL_OVERRIDE; QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt, const QWidget *widget) const Q_DECL_OVERRIDE; void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const Q_DECL_OVERRIDE; // some function type alias. // using SubControlRectFunc = QRect(*)(const QStyleOptionComplex *opt, SubControl sc, const QWidget *w); using DrawComplexControlFunc = bool(Style::*)(const QStyleOptionComplex *, QPainter *, const QWidget *) const; using DrawPrimitiveFunc = bool(Style::*)(const QStyleOption*, QPainter*, const QWidget* ) const; using DrawControlFunc = bool(Style::*)(const QStyleOption*, QPainter*, const QWidget*) const; private: bool isTabBarToolButton(const QWidget *button) const; // frame bool drawFramePrimitive(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; bool drawFrameFocusRectPrimitive(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; bool drawShapedFrameControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; // push button bool drawPushButtonBevel(const QStyleOption*, QPainter*, const QWidget*) const; bool drawPushButtonLabel(const QStyleOption *, QPainter *, const QWidget *) const; bool drawPushButtonFrame(QPainter* painter, const QRect& rect, const QBrush &color, const QBrush &outline, const QColor& shadow, const QWidget *widget = nullptr) const; // scroll bar QRect scrollbarSubControlRect(const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget ) const; bool drawScrollBarSliderControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; // menu bool drawMenuItemControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; bool isVisibleMenuShortText() const; bool isVisibleMenuIcon() const; bool isVisibleMenuCheckBox() const; // menu bar bool drawMenuBarItemControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; // slider QRect sliderSubControlRect(const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget ) const; bool drawSlider(const QStyleOptionComplex *opt, QPainter *p, const QWidget *w) const; void drawSliderGroove(QPainter*, const QRect&, const QBrush & brush) const; void drawSliderHandle(QPainter* painter, const QStyleOptionSlider *option, const QRect& rect, const QString &type) const; bool drawSliderTickmarkLabels(const QStyleOption*, QPainter*, const QWidget*) const; // check box bool drawIndicatorCheckBoxPrimitive(const QStyleOption*, QPainter*, const QWidget*widget) const; // line edit bool drawFrameLineEditPrimitive(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; // indicator void drawStandardIcon(QStyle::StandardPixmap sp, const QStyleOption *opt, QPainter *p, const QWidget *widget) const; void drawDeepinStyleIcon(const QString &name, const QStyleOption *opt, QPainter *p, const QWidget *widget) const; static QWindow *qt_getWindow(const QWidget *widget); static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50); static QPixmap colorizedImage(const QString &fileName, const QColor &color, int rotation = 0); static void fillBrush(QPainter *p, const QRect &rect, const QBrush &brush, qreal rotate = 0); // progress bar bool drawProgressBarControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; bool drawProgressBarContentsControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; bool drawProgressBarGrooveControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; bool drawProgressBarLabelControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; QRect progressBarLabelRect(const QStyleOption *opt, const QWidget *widget) const; QRect progressBarGrooveRect(const QStyleOption *opt, const QWidget *widget) const; QRect progressBarContentsRect(const QStyleOption *opt, const QWidget *widget) const; // rubber band bool drawRubberBandControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; // header view bool drawIndicatorHeaderArrowPrimitive(const QStyleOption *option, QPainter *painter, const QWidget *widget) const; QRect headerArrowRect(const QStyleOption *opt, const QWidget *widget) const; // combobox void drawComboBoxPopupFramePrimitive(const QStyleOption *option, QPainter *painter) const; bool drawComboBox(const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const; QRect comboBoxSubControlRect(const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget ) const; bool drawComboBoxLabelControl(const QStyleOption *option, QPainter *painter, const QWidget *) const; static bool widgetIsComboBoxPopupFramePrimitive(const QWidget *w); // tool button bool drawToolButtonLabelControl( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const; bool drawPanelButtonToolPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const; // tab widget bool drawFrameTabWidgetPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const; // tab bar bool drawFrameTabBarBasePrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const; bool drawTabBarTabLabelControl(const QStyleOption* option, QPainter* p, const QWidget* widget) const; bool drawTabBarTabShapeControl(const QStyleOption* option, QPainter* painter, const QWidget* widget) const; bool drawTabBarAddButtonControl(const QStyleOption* option, QPainter* painter, const QWidget* widget) const; bool drawIndicatorTabClosePrimitive(const QStyleOption *opt, QPainter *p, const QWidget *widget) const; bool drawScrollButtonPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const; bool drawScrollButtonLabelControl( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const; // spin box bool drawSpinBoxComplexControl( const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget ) const; QRect spinboxSubControlRect(const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const; StyleType m_type; PaletteExtended *m_palette = Q_NULLPTR; friend class SliderHelper; friend class PushButtonHelper; friend class LineEditHelper; friend class FrameHelper; friend class ScrollBarHelper; Q_PRIVATE_SLOT(d_func(), void _q_removeAnimation()) Q_PRIVATE_SLOT(d_func(), void _q_updateAppFont()) Q_DECLARE_PRIVATE(Style) }; class DStyleAnimation; class StylePrivate : public QCommonStylePrivate { public: QColor outline(const QPalette &pal) const; QColor buttonColor(const QPalette &pal) const; QColor highlight(const QPalette &pal) const; QColor highlightedOutline(const QPalette &pal) const; QColor backgroundColor(const QPalette &pal, const QWidget* widget) const; inline QColor innerContrastLine() const { return QColor(255, 255, 255, 30); } inline QColor lightShade() const { return QColor(255, 255, 255, 90); } inline QColor darkShade() const { return QColor(0, 0, 0, 60); } #ifndef QT_NO_ANIMATION DStyleAnimation *animation(const QObject *target) const; void startAnimation(DStyleAnimation *animation) const; void stopAnimation(const QObject *target) const; void _q_removeAnimation(); #endif void _q_updateAppFont(); Q_DECLARE_PUBLIC(Style) private: mutable QHash animations; }; } #endif // STYLE_H qt5integration-5.5.23/styleplugins/dstyleplugin/tabbarhelper.cpp000066400000000000000000000454201424734202100252130ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY 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 . */ #include "style.h" #include "paletteextended.h" #include "painterhelper.h" #include #ifdef DTKWIDGET_CLASS_DTabBar #include DWIDGET_USE_NAMESPACE #endif #include #include #include #include #include #include #include #include namespace dstyle { static void tabLayout(const QStyle *proxyStyle, const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) { Q_ASSERT(textRect); Q_ASSERT(iconRect); QRect tr = opt->rect; bool verticalTabs = opt->shape == QTabBar::RoundedEast || opt->shape == QTabBar::RoundedWest || opt->shape == QTabBar::TriangularEast || opt->shape == QTabBar::TriangularWest; if (verticalTabs) tr.setRect(0, 0, tr.height(), tr.width()); //0, 0 as we will have a translate transform int verticalShift = proxyStyle->pixelMetric(QStyle::PM_TabBarTabShiftVertical, opt, widget); int horizontalShift = proxyStyle->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, opt, widget); int hpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2; int vpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2; if (opt->shape == QTabBar::RoundedSouth || opt->shape == QTabBar::TriangularSouth) verticalShift = -verticalShift; tr.adjust(hpadding, verticalShift - vpadding, horizontalShift - hpadding, vpadding); bool selected = opt->state & QStyle::State_Selected; if (selected) { tr.setTop(tr.top() - verticalShift); tr.setRight(tr.right() - horizontalShift); } // left widget if (!opt->leftButtonSize.isEmpty()) { tr.setLeft(tr.left() + 4 + (verticalTabs ? opt->leftButtonSize.height() : opt->leftButtonSize.width())); } // right widget if (!opt->rightButtonSize.isEmpty()) { tr.setRight(tr.right() - 4 - (verticalTabs ? opt->rightButtonSize.height() : opt->rightButtonSize.width())); } // icon if (!opt->icon.isNull()) { QSize iconSize = opt->iconSize; if (!iconSize.isValid()) { int iconExtent = proxyStyle->pixelMetric(QStyle::PM_SmallIconSize); iconSize = QSize(iconExtent, iconExtent); } QSize tabIconSize = opt->icon.actualSize(iconSize, (opt->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled, (opt->state & QStyle::State_Selected) ? QIcon::On : QIcon::Off ); // High-dpi icons do not need adjustmet; make sure tabIconSize is not larger than iconSize tabIconSize = QSize(qMin(tabIconSize.width(), iconSize.width()), qMin(tabIconSize.height(), iconSize.height())); *iconRect = QRect(tr.left(), tr.center().y() - tabIconSize.height() / 2, tabIconSize.width(), tabIconSize .height()); if (!verticalTabs) *iconRect = proxyStyle->visualRect(opt->direction, opt->rect, *iconRect); tr.setLeft(tr.left() + tabIconSize.width() + 4); } if (!verticalTabs) tr = proxyStyle->visualRect(opt->direction, opt->rect, tr); *textRect = tr; } bool Style::drawFrameTabBarBasePrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const { Q_UNUSED(widget) auto opt = static_cast(option); PainterHelper::drawRect(painter, opt->tabBarRect, m_palette->brush(PaletteExtended::TabBar_BackgroundBrush, option), 1, m_palette->brush(PaletteExtended::TabBar_BorderBrush, option)); return true; } const QWidget *findDTabBar(const QWidget *widget) { do { if (qobject_cast(widget)) return widget; widget = widget->parentWidget(); } while(widget); return nullptr; } bool Style::drawTabBarTabLabelControl(const QStyleOption *opt, QPainter *p, const QWidget *widget) const { auto tab = static_cast(opt); QRect tr = tab->rect; bool verticalTabs = tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::RoundedWest || tab->shape == QTabBar::TriangularEast || tab->shape == QTabBar::TriangularWest; int alignment = Qt::AlignCenter | Qt::TextShowMnemonic; if (!proxy()->styleHint(SH_UnderlineShortcut, opt, widget)) alignment |= Qt::TextHideMnemonic; if (verticalTabs) { p->save(); int newX, newY, newRot; if (tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::TriangularEast) { newX = tr.width() + tr.x(); newY = tr.y(); newRot = 90; } else { newX = tr.x(); newY = tr.y() + tr.height(); newRot = -90; } QTransform m = QTransform::fromTranslate(newX, newY); m.rotate(newRot); p->setTransform(m, true); } QRect iconRect; tabLayout(proxy(), tab, widget, &tr, &iconRect); tr = proxy()->subElementRect(SE_TabBarTabText, opt, widget); //we compute tr twice because the style may override subElementRect if (!tab->icon.isNull()) { QPixmap tabIcon = tab->icon.pixmap(qt_getWindow(widget), tab->iconSize, (tab->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled, (tab->state & State_Selected) ? QIcon::On : QIcon::Off); p->drawPixmap(iconRect.x(), iconRect.y(), tabIcon); } bool visible_close_button = false; if (const QTabBar *tb = qobject_cast(widget)) { visible_close_button = tb->tabsClosable(); } #ifdef DTKWIDGET_CLASS_DTabBar if (const DTabBar *tb = qobject_cast(widget)) { visible_close_button = tb->tabsClosable(); } visible_close_button = visible_close_button && (opt->state & QStyle::State_MouseOver); #endif QBrush text_brush; // TODO(zccrs): 临时解决方案,用于支持应用程序中自定义DTabBar的被选中Tab的文本颜色 const QWidget *tab_bar = findDTabBar(widget); if (opt->state.testFlag(QStyle::State_Selected) && tab_bar) { text_brush = tab_bar->palette().brush(QPalette::Active, QPalette::Text); } else { text_brush = m_palette->brush(PaletteExtended::TabBarTab_TextColor, opt); } if (visible_close_button) { QRect text_rect = opt->fontMetrics.boundingRect(tr, alignment, tab->text); const QBrush &brush = text_brush; QLinearGradient lg(0, 0, 1, 0); QGradientStops stops; qreal stop = qreal(tr.right() - 35 - text_rect.x()) / text_rect.width(); stops << QGradientStop{0, brush.color()}; stops << QGradientStop{stop, brush.color()}; stops << QGradientStop{stop, QColor(brush.color().red(), brush.color().green(), brush.color().blue(), 200)}; stops << QGradientStop{1, Qt::transparent}; lg.setCoordinateMode(QLinearGradient::ObjectBoundingMode); lg.setStops(stops); p->setPen(QPen(QBrush(lg), 1)); } else { p->setPen(QPen(text_brush, 1)); } p->drawText(tr, alignment, tab->text); if (verticalTabs) p->restore(); if (tab->state & State_HasFocus) { const int OFFSET = 1 + pixelMetric(PM_DefaultFrameWidth); int x1, x2; x1 = tab->rect.left(); x2 = tab->rect.right() - 1; QStyleOptionFocusRect fropt; fropt.QStyleOption::operator=(*tab); fropt.rect.setRect(x1 + 1 + OFFSET, tab->rect.y() + OFFSET, x2 - x1 - 2*OFFSET, tab->rect.height() - 2*OFFSET); drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); } return true; } bool Style::drawTabBarTabShapeControl(const QStyleOption *opt, QPainter *p, const QWidget *widget) const { auto tab = static_cast(opt); p->save(); QRect rect(tab->rect); bool selected = tab->state & State_Selected; bool onlyOne = tab->position == QStyleOptionTab::OnlyOneTab; int tabOverlap = onlyOne ? 0 : proxy()->pixelMetric(PM_TabBarTabOverlap, opt, widget); if (!selected) { switch (tab->shape) { case QTabBar::TriangularNorth: rect.adjust(1, 1, -1, -tabOverlap); break; case QTabBar::TriangularSouth: rect.adjust(1, tabOverlap, -1, -1); break; case QTabBar::TriangularEast: rect.adjust(tabOverlap, 1, -1, -1); break; case QTabBar::TriangularWest: rect.adjust(1, 1, -tabOverlap, -1); break; default: break; } } p->setPen(QPen(m_palette->brush(PaletteExtended::TabBarTab_BorderBrush, opt), 0)); p->setBrush(m_palette->brush(PaletteExtended::TabBarTab_BackgroundBrush, opt)); // if (selected) { // p->setBrush(tab->palette.base()); // } else { // if (widget && widget->parentWidget()) // p->setBrush(widget->parentWidget()->palette().background()); // else // p->setBrush(tab->palette.background()); // } int y; int x; QPolygon a(10); switch (tab->shape) { case QTabBar::TriangularNorth: case QTabBar::TriangularSouth: { a.setPoint(0, 0, -1); a.setPoint(1, 0, 0); y = rect.height() - 2; x = y / 3; a.setPoint(2, x++, y - 1); ++x; a.setPoint(3, x++, y++); a.setPoint(4, x, y); int i; int right = rect.width() - 1; for (i = 0; i < 5; ++i) a.setPoint(9 - i, right - a.point(i).x(), a.point(i).y()); if (tab->shape == QTabBar::TriangularNorth) for (i = 0; i < 10; ++i) a.setPoint(i, a.point(i).x(), rect.height() - 1 - a.point(i).y()); a.translate(rect.left(), rect.top()); p->setRenderHint(QPainter::Antialiasing); p->translate(0, 0.5); QPainterPath path; path.addPolygon(a); p->drawPath(path); break; } case QTabBar::TriangularEast: case QTabBar::TriangularWest: { a.setPoint(0, -1, 0); a.setPoint(1, 0, 0); x = rect.width() - 2; y = x / 3; a.setPoint(2, x - 1, y++); ++y; a.setPoint(3, x++, y++); a.setPoint(4, x, y); int i; int bottom = rect.height() - 1; for (i = 0; i < 5; ++i) a.setPoint(9 - i, a.point(i).x(), bottom - a.point(i).y()); if (tab->shape == QTabBar::TriangularWest) for (i = 0; i < 10; ++i) a.setPoint(i, rect.width() - 1 - a.point(i).x(), a.point(i).y()); a.translate(rect.left(), rect.top()); p->setRenderHint(QPainter::Antialiasing); p->translate(0.5, 0); QPainterPath path; path.addPolygon(a); p->drawPath(path); break; } case QTabBar::RoundedNorth: case QTabBar::RoundedSouth: { const QRect &border_rect = tab->rect.adjusted(0, 0, 1, 1); p->fillRect(tab->rect, p->brush()); if (tab->position != QStyleOptionTab::Beginning && tab->position != QStyleOptionTab::OnlyOneTab) { p->drawLine(border_rect.topLeft(), border_rect.bottomLeft()); } if (Q_UNLIKELY(selected)) { QRect active_rect = tab->rect; if (Q_LIKELY(tab->shape == QTabBar::RoundedNorth)) { active_rect.setTop(active_rect.bottom() - qMin(3, active_rect.height() / 10) + 1); } else { active_rect.setBottom(active_rect.top() + qMin(3, active_rect.height() / 10) + 1); } // TODO(zccrs): 临时解决方案,用于支持应用程序中自定义DTabBar的被选中Tab的文本颜色 if (const QWidget *tab_bar = findDTabBar(widget)) p->fillRect(active_rect, tab_bar->palette().brush(QPalette::Active, QPalette::Text)); else p->fillRect(active_rect, m_palette->brush(PaletteExtended::TabBarTab_ActiveColor, opt)); } break; } case QTabBar::RoundedEast: case QTabBar::RoundedWest: { const QRect &border_rect = tab->rect.adjusted(0, 0, 1, 1); p->fillRect(tab->rect, p->brush()); if (tab->position != QStyleOptionTab::Beginning && tab->position != QStyleOptionTab::OnlyOneTab) { p->drawLine(border_rect.topLeft(), border_rect.topRight()); } if (Q_UNLIKELY(selected)) { QRect active_rect = tab->rect; if (Q_LIKELY(tab->shape == QTabBar::RoundedWest)) { active_rect.setLeft(active_rect.right() - qMin(3, active_rect.width() / 10) + 1); } else { active_rect.setRight(active_rect.left() + qMin(3, active_rect.width() / 10) + 1); } // TODO(zccrs): 临时解决方案,用于支持应用程序中自定义DTabBar的被选中Tab的文本颜色 if (const QWidget *tab_bar = findDTabBar(widget)) p->fillRect(active_rect, tab_bar->palette().brush(QPalette::Active, QPalette::Text)); else p->fillRect(active_rect, m_palette->brush(PaletteExtended::TabBarTab_ActiveColor, opt)); } break; } } p->restore(); return true; } bool Style::drawTabBarAddButtonControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { painter->fillRect(option->rect, m_palette->brush(PaletteExtended::TabBarAddButton_BackgroundBrush, option)); fillBrush(painter, option->rect, m_palette->brush(widget, PaletteExtended::TabBarAddButton_Icon, option)); #ifdef DTKWIDGET_CLASS_DTabBar if (const DTabBar *tb = qobject_cast(widget->parent())) { painter->setPen(QPen(m_palette->brush(PaletteExtended::TabBarTab_BorderBrush, option), 1)); QRectF rect = QRectF(option->rect).adjusted(0.5, 0.5, 1, 1); switch (tb->shape()) { case QTabBar::RoundedNorth: case QTabBar::RoundedSouth: painter->drawLine(rect.topLeft(), rect.bottomLeft()); break; case QTabBar::RoundedEast: case QTabBar::RoundedWest: painter->drawLine(rect.topLeft(), rect.topRight()); break; default: break; } } #endif return true; } class DQTabBar : public QTabBar { friend class Style; }; bool Style::drawIndicatorTabClosePrimitive(const QStyleOption *opt, QPainter *p, const QWidget *widget) const { const QTabBar *tb = qobject_cast(widget->parent()); if (!tb) { if (const QWidget *w = dynamic_cast(p->device())) widget = w; tb = qobject_cast(widget->parent()); } if (Q_UNLIKELY(!tb)) return false; int index = -1; for (int i = 0; i < tb->count(); ++i) { if (Q_LIKELY(tb->tabButton(i, QTabBar::LeftSide) != widget && tb->tabButton(i, QTabBar::RightSide) != widget)) { continue; } index = i; break; } if (Q_UNLIKELY(index < 0)) return true; QStyleOptionTab tab; static_cast(tb)->initStyleOption(&tab, index); if (Q_LIKELY((tab.state | QStyle::State_MouseOver) != tab.state // 关闭标签时标签栏会重新布局,此时鼠标没有移动,但是标签item相对于鼠标的位置发生了变化 // 如果鼠标落在了标签页关闭按钮右边位置,则这个标签页的state中不会包含MouseOver状态 && !tb->tabRect(index).contains(tb->mapFromGlobal(QCursor::pos())))) { return true; } fillBrush(p, opt->rect, m_palette->brush(PaletteExtended::TabBarTab_CloseIcon, opt)); return true; } bool Style::drawScrollButtonPrimitive(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { fillBrush(painter, option->rect, m_palette->brush(PaletteExtended::TabBarScrollButton_BackgroundBrush, option)); #ifdef DTKWIDGET_CLASS_DTabBar if (const DTabBar *tb = qobject_cast(widget->parent())) { if (const QToolButton *button = qobject_cast(widget)) { if (button->arrowType() == Qt::LeftArrow || button->arrowType() == Qt::UpArrow) return true; } else { return true; } painter->setPen(QPen(m_palette->brush(PaletteExtended::TabBarTab_BorderBrush, option), 1)); QRectF rect = QRectF(option->rect).adjusted(0.5, 0.5, 0, 0); switch (tb->shape()) { case QTabBar::RoundedNorth: case QTabBar::RoundedSouth: painter->drawLine(rect.topRight(), rect.bottomRight()); break; case QTabBar::RoundedEast: case QTabBar::RoundedWest: painter->drawLine(rect.bottomLeft(), rect.bottomRight()); break; default: break; } } #endif return true; } bool Style::drawScrollButtonLabelControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { const QStyleOptionToolButton* toolButtonOption( qstyleoption_cast(option) ); switch( toolButtonOption->arrowType ) { case Qt::LeftArrow: fillBrush(painter, option->rect, m_palette->brush(widget, PaletteExtended::TabBarScrollButton_UpIcon, option)); break; case Qt::RightArrow: fillBrush(painter, option->rect, m_palette->brush(widget, PaletteExtended::TabBarScrollButton_DownIcon, option)); break; case Qt::UpArrow: fillBrush(painter, option->rect, m_palette->brush(widget, PaletteExtended::TabBarScrollButton_UpIcon, option), 90); break; case Qt::DownArrow: fillBrush(painter, option->rect, m_palette->brush(widget, PaletteExtended::TabBarScrollButton_DownIcon, option), 90); break; default: break; } return true; } } qt5integration-5.5.23/styleplugins/dstyleplugin/tabwidgethelper.cpp000066400000000000000000000130111424734202100257210ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "style.h" #include "geometryutils.h" #include "painterhelper.h" #include #include #include #include namespace dstyle { bool Style::drawFrameTabWidgetPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const { Q_UNUSED(widget) // cast option and check const QStyleOptionTabWidgetFrame *tabOption(qstyleoption_cast(option)); if( !tabOption ) return true; // do nothing if tabbar is hidden const bool isQtQuickControl( false ); if( tabOption->tabBarSize.isEmpty() && !isQtQuickControl ) return true; // adjust rect to handle overlaps QRect rect( option->rect ); const QRect tabBarRect( tabOption->tabBarRect ); const QSize tabBarSize( tabOption->tabBarSize ); Corners corners = AllCorners; // adjust corners to deal with oversized tabbars switch( tabOption->shape ) { case QTabBar::RoundedNorth: case QTabBar::TriangularNorth: if( isQtQuickControl ) rect.adjust( -1, -1, 1, 0 ); if( tabBarSize.width() >= rect.width() - 2*Metrics::Frame_FrameRadius ) corners &= ~CornersTop; if( tabBarRect.left() < rect.left() + Metrics::Frame_FrameRadius ) corners &= ~CornerTopLeft; if( tabBarRect.right() > rect.right() - Metrics::Frame_FrameRadius ) corners &= ~CornerTopRight; break; case QTabBar::RoundedSouth: case QTabBar::TriangularSouth: if( isQtQuickControl ) rect.adjust( -1, 0, 1, 1 ); if( tabBarSize.width() >= rect.width()-2*Metrics::Frame_FrameRadius ) corners &= ~CornersBottom; if( tabBarRect.left() < rect.left() + Metrics::Frame_FrameRadius ) corners &= ~CornerBottomLeft; if( tabBarRect.right() > rect.right() - Metrics::Frame_FrameRadius ) corners &= ~CornerBottomRight; break; case QTabBar::RoundedWest: case QTabBar::TriangularWest: if( isQtQuickControl ) rect.adjust( -1, 0, 0, 0 ); if( tabBarSize.height() >= rect.height()-2*Metrics::Frame_FrameRadius ) corners &= ~CornersLeft; if( tabBarRect.top() < rect.top() + Metrics::Frame_FrameRadius ) corners &= ~CornerTopLeft; if( tabBarRect.bottom() > rect.bottom() - Metrics::Frame_FrameRadius ) corners &= ~CornerBottomLeft; break; case QTabBar::RoundedEast: case QTabBar::TriangularEast: if( isQtQuickControl ) rect.adjust( 0, 0, 1, 0 ); if( tabBarSize.height() >= rect.height()-2*Metrics::Frame_FrameRadius ) corners &= ~CornersRight; if( tabBarRect.top() < rect.top() + Metrics::Frame_FrameRadius ) corners &= ~CornerTopRight; if( tabBarRect.bottom() > rect.bottom() - Metrics::Frame_FrameRadius ) corners &= ~CornerBottomRight; break; default: break; } // define colors // const QPalette& palette( option->palette ); const QColor background; const QColor outline( Qt::gray ); painter->setRenderHint( QPainter::Antialiasing ); QRectF frameRect( rect.adjusted( 1, 1, -1, -1 ) ); qreal radius( GeometryUtils::frameRadius() ); // set pen if( outline.isValid() ) { painter->setPen( outline ); frameRect.adjust( 0.5, 0.5, -0.5, -0.5 ); radius = qMax( radius-1, qreal( 0.0 ) ); } else painter->setPen( Qt::NoPen ); // set brush if( background.isValid() ) painter->setBrush( background ); else painter->setBrush( Qt::NoBrush ); // render QPainterPath path( PainterHelper::roundedPath( frameRect, corners, radius ) ); QWidget *current_widget = qobject_cast(widget)->currentWidget(); QColor fill_color = painter->pen().color(); fill_color.setAlphaF(0.2); fill_color = PainterHelper::colorBlend(option->palette.color(QPalette::Window), fill_color); if (current_widget) { painter->fillPath(path, fill_color); QPainterPath inside_path; QRectF rect = current_widget->parentWidget()->geometry(); inside_path.addRoundedRect(rect.adjusted(5.5, 5.5, -5.5, -5.5), radius, radius); painter->fillPath(inside_path, option->palette.color(QPalette::Window)); painter->drawPath(inside_path); } QRectF selectedTabRect = QRectF(tabOption->selectedTabRect).adjusted(1.5, 0.5, -0.5, -0.5); QPainterPath selectedtabBarButtonPath(PainterHelper::roundedPath(selectedTabRect, CornerTopLeft | CornerTopRight, radius)); QPainterPath tabBarButtonPath; tabBarButtonPath.addRoundedRect(tabOption->tabBarRect.adjusted(1, 0, -1, 0), radius, radius); painter->fillPath(tabBarButtonPath, Qt::gray); painter->drawPath( path ); painter->fillPath(selectedtabBarButtonPath, fill_color); painter->drawPath(selectedtabBarButtonPath); painter->setPen(fill_color); selectedTabRect.adjust(1, 0, -1, 0); painter->drawLine(selectedTabRect.bottomLeft(), selectedTabRect.bottomRight()); return true; } } qt5integration-5.5.23/styleplugins/dstyleplugin/toolbuttonhelper.cpp000066400000000000000000000166771424734202100262050ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 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 . */ #include "style.h" #include "paletteextended.h" #include #include namespace dstyle { //* centering QRect centerRect(const QRect &rect, int width, int height) { return QRect(rect.left() + (rect.width() - width)/2, rect.top() + (rect.height() - height)/2, width, height); } QRect centerRect(const QRect &rect, const QSize& size ) { return centerRect( rect, size.width(), size.height() ); } bool Style::drawToolButtonLabelControl( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const { if (isTabBarToolButton(widget)) { return drawScrollButtonLabelControl(option, painter, widget); } // cast option and check const QStyleOptionToolButton* toolButtonOption( qstyleoption_cast(option) ); // copy rect and palette const QRect& rect = option->rect; const QPalette& palette = option->palette; // state const State& state( option->state ); const bool enabled( state & State_Enabled ); const bool sunken( state & (State_On | State_Sunken) ); const bool mouseOver( enabled && (option->state & State_MouseOver) ); const bool flat( state & State_AutoRaise ); // focus flag is set to match the background color in either renderButtonFrame or renderToolButtonFrame bool hasFocus( false ); if( flat ) hasFocus = enabled && !mouseOver && (option->state & State_HasFocus); else hasFocus = enabled && !mouseOver && (option->state & (State_HasFocus|State_Sunken) ); const bool hasArrow( toolButtonOption->features & QStyleOptionToolButton::Arrow ); const bool hasIcon( !( hasArrow || toolButtonOption->icon.isNull() ) ); const bool hasText( !toolButtonOption->text.isEmpty() ); // contents QRect contentsRect( rect ); if( sunken && !flat ) contentsRect.translate( 1, 1 ); // icon size const QSize iconSize( toolButtonOption->iconSize ); // text size int textFlags( Qt::TextHideMnemonic ); const QSize textSize( option->fontMetrics.size( textFlags, toolButtonOption->text ) ); // adjust text and icon rect based on options QRect iconRect; QRect textRect; if( hasText && ( !(hasArrow||hasIcon) || toolButtonOption->toolButtonStyle == Qt::ToolButtonTextOnly ) ) { // text only textRect = contentsRect; textFlags |= Qt::AlignCenter; } else if( (hasArrow||hasIcon) && (!hasText || toolButtonOption->toolButtonStyle == Qt::ToolButtonIconOnly ) ) { // icon only iconRect = contentsRect; } else if( toolButtonOption->toolButtonStyle == Qt::ToolButtonTextUnderIcon ) { const int contentsHeight( iconSize.height() + textSize.height() + Metrics::ToolButton_ItemSpacing ); iconRect = QRect( QPoint( contentsRect.left() + (contentsRect.width() - iconSize.width())/2, contentsRect.top() + (contentsRect.height() - contentsHeight)/2 ), iconSize ); textRect = QRect( QPoint( contentsRect.left() + (contentsRect.width() - textSize.width())/2, iconRect.bottom() + Metrics::ToolButton_ItemSpacing + 1 ), textSize ); textFlags |= Qt::AlignCenter; } else { const int contentsWidth( iconSize.width() + textSize.width() + Metrics::ToolButton_ItemSpacing ); iconRect = QRect( QPoint( contentsRect.left() + (contentsRect.width() - contentsWidth )/2, contentsRect.top() + (contentsRect.height() - iconSize.height())/2 ), iconSize ); textRect = QRect( QPoint( iconRect.right() + Metrics::ToolButton_ItemSpacing + 1, contentsRect.top() + (contentsRect.height() - textSize.height())/2 ), textSize ); // handle right to left layouts iconRect = visualRect( option->direction, option->rect, iconRect ); textRect = visualRect( option->direction, option->rect, textRect ); textFlags |= Qt::AlignLeft | Qt::AlignVCenter; } // make sure there is enough room for icon if( iconRect.isValid() ) iconRect = centerRect( iconRect, iconSize ); // render arrow or icon if( hasArrow && iconRect.isValid() ) { QStyleOptionToolButton copy( *toolButtonOption ); copy.rect = iconRect; switch( toolButtonOption->arrowType ) { case Qt::LeftArrow: drawPrimitive( PE_IndicatorArrowLeft, ©, painter, widget ); break; case Qt::RightArrow: drawPrimitive( PE_IndicatorArrowRight, ©, painter, widget ); break; case Qt::UpArrow: drawPrimitive( PE_IndicatorArrowUp, ©, painter, widget ); break; case Qt::DownArrow: drawPrimitive( PE_IndicatorArrowDown, ©, painter, widget ); break; default: break; } } else if( hasIcon && iconRect.isValid() ) { // icon state and mode const QIcon::State iconState( sunken ? QIcon::On : QIcon::Off ); QIcon::Mode iconMode; if( !enabled ) iconMode = QIcon::Disabled; else if( !flat && hasFocus ) iconMode = QIcon::Selected; else if( mouseOver && flat ) iconMode = QIcon::Active; else iconMode = QIcon::Normal; const QPixmap pixmap = toolButtonOption->icon.pixmap( iconSize, iconMode, iconState ); drawItemPixmap( painter, iconRect, Qt::AlignCenter, pixmap ); } // render text if( hasText && textRect.isValid() ) { QPalette::ColorRole textRole( QPalette::ButtonText ); if( flat ) textRole = (hasFocus&&sunken&&!mouseOver) ? QPalette::HighlightedText: QPalette::WindowText; else if( mouseOver ) textRole = QPalette::HighlightedText; painter->setFont(toolButtonOption->font); drawItemText( painter, textRect, textFlags, palette, enabled, toolButtonOption->text, textRole ); } return true; } bool Style::drawPanelButtonToolPrimitive(const QStyleOption *option, QPainter *painter, const QWidget *widget) const { if (isTabBarToolButton(widget)) { return drawScrollButtonPrimitive(option, painter, widget); } // rect and palette const QRect& rect( option->rect ); // update animation state // mouse over takes precedence over focus // TODO(hualet): update button color from palette in case button is default const QColor shadow( Qt::transparent ); const QBrush outline(m_palette->brush(PaletteExtended::PushButton_BorderBrush, option)); const QBrush background(m_palette->brush(PaletteExtended::PushButton_BackgroundBrush, option)); // render drawPushButtonFrame(painter, rect, background, outline, shadow, widget); // if (buttonOption->features & QStyleOptionButton::HasMenu) { // int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, buttonOption, widget); // QRect ir = buttonOption->rect; // QStyleOption newBtn = *option; // newBtn.rect = QRect(ir.right() - mbi + 2, ir.height()/2 - mbi/2 + 3, mbi - 6, mbi - 6); // proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget); // } return true; } } qt5integration-5.5.23/styleplugins/styleplugins.pro000066400000000000000000000001351424734202100226070ustar00rootroot00000000000000TEMPLATE = subdirs SUBDIRS += chameleon !isEmpty(ENABLE_OLD_STYLE): SUBDIRS += dstyleplugin qt5integration-5.5.23/styles/000077500000000000000000000000001424734202100161055ustar00rootroot00000000000000qt5integration-5.5.23/styles/images/000077500000000000000000000000001424734202100173525ustar00rootroot00000000000000qt5integration-5.5.23/styles/images/woodbackground.png000066400000000000000000000170131424734202100230720ustar00rootroot00000000000000PNG  IHDR``F pHYsHHFk>PLTEVDbDfdaKfLgdhZJ4P\Z8_Ob@gLhWjŸGtlߴC7Lɡ*rKEwmI3Ȳr J6]f;i{^BO*"]T v^*g$L,imJmfbi0!?ǰ a^߬ =!+$1a2:pQw6M QAqY`:u=o8 lTy#WP|0:k"锲cę׻,*P҉T c&rW)V*Fm4A˃,$#rJy#g~LJgd"JoJ\25+e@;W[ i 0i0dž8J|ܴ0¤>3Ÿ>,rB1Ef$+7ƪkTp/V/I< `VmCMccc5G; N# 8f vQsr(\@bj|}0C:X0a(B:E !nvhQ ~s\퍆2".:EAg0v)b}nwdTRMdzRnVlSKh:-pxV{]f/?e2ɔ:lػv? 9^6+DZ:Fl_˲N7_{5 5]36yq,B7#̀%i:9~t]#q!aͺEAd{0ggrq"nNF_W#dP'9mss1m?i;z2kX%/_>jCb0U: .yyx>3|ZۣA8FGUwMhh,F BմB ˽{頜WHv/T&&SG:aڿݘ5r¢|*SOٟHŋY;.Gi}{39b-O*,Y&޷7fkjg< {@lnx}EEذawGwAT*i|U'IkhnzǷ(T碦 zC/YxSo5"XumCwn{(.H8mFҗ3#[j8V;: v=3Й0f˗yZo=ѻ&`ڜjG/$Kˣ/9  *Y/ xz^QcϨ@E v޸tBlqϞLpv@ m*)8~q7ralo$Ⱦf0U:/`ޙ>7O6_ٱ^d01Nep}y=u0ħJt`lrL}]^anM"t0#u&ioׇCW+jc{ OLFSJ|9v;s&Q/Ub8VoO?3jl :2tǯ힒*&[RybѥJvB?'e]sܡGRl!̦Xvjeks15lsF]+3i._~X+HNgx񏽭J!i/is9r Qq (?&f%W ?P1nHS+϶ ojJ&A+o"CUhG3jڷk)~0B*o0XHDj_6?}HD|KZC} ywZ'JYQCt$ed'vl$n윀Sß@ߢu)8N9ഭR*_qk_8䍓?cgo3qzHp2h,GMIfpF' w?ةM`! @@::k.Rݫ0[[(GǙEU>KC=9qbxW}ܷ̆w]NObyˑʳ^8 UpgHc)aӳe!9il=hɅ/ؽ,~'z[aܡi /͕nj@\ [97f$3= fԸbW?XՃ ^= c ÑMY%?( Q `qת4DV|UklFx^;\Wn-c1_'7ڧQFIc;Bv Z+E< ƭ08g=Қu7md9j*?Qh'>_ֳN?$~e`V[%RHmH;Nj\||;/ރ {8c "KGsG_ޓzX&C;ήJ˪*vZ#9zPJݘBʹ3=?WY,g~?&EY)в$a ƇZ(.A`*.+pЁT)9Ecg>!},G%oE%<~w)/EO)"{R^[i[6S[w+! mAR#8Sw r7nhj&ܥEm7TOP1N]?xv0gH˓c%0®UeǮm v|ܹ7.B&!!\1҈ue{Ftz? ~xK$@__uWT( E EhV4z]m״1u_:Re%d~_<,?(9ycWv`U2k]۵yG4sLm`a:kb[ar.jhɃ-*rZ]|=qNaPV[Lʠ{K#fɭ:7#L Ic};vLMc1P7Rs|p`[=rO@; "~e(JnL~}:O3/i]tygWW-652[<3[[5B FGFW"=x;jݎudL+Ϋn!Ci/D|@Th{j L6F*U,(#/:)kŰPVL_0r*dn_܋1[SO+eiq&IN];wv*ݤdT-;?kEb1G0C3=g*Ԅ{xtv=f N+U6JTT.\M2\E_qWT+yHMh cT[dsvVvBJ~dny5*p-I(=QqI[8]O]fCns;8"28?}zlXV[4]N;T|ً?;EKK#{8Ўh8f޻w I7%:&q2(^ٶ"(_l}b8ٳov_kZd~?~㷼&̺`tsVۍlĥWTEjwS%-UkߔOK_y KefV^;?F*~*!Gk`ɺ&c&(M!~t:.2ؾy^w<.EfUY'8~*볫t篯n a+.փy 3Yݠݿ/a(+(˖ӯ.6]~ywdF7dPgџwdHu Rŵ]h8o_j1TE~^A우'δr+"ps]y>,9ilqo$|Qoy?&w{w݃p³If:$ψk0/@yR ĵ,ȧ,jBJn#rh߿%HXqcɮ0ܡKͯ߰ouA* ЅnRV51!9yO:P,0tE߇s39 _1R5:d},~(}ISN8>#XU׎vH+ʪ1:߈=gݹ@gmYdOpla_6=Y)r]сQτ/_Plg0$aSy?mr#If`{~zsavTeyJFܘc(.ZFhnʫՕb5O׽eU@AVQuAhW\o=":{+Ha LƓ[&7)`+>#C rvIoBY]p^kM:]i ؃5,Wt Ly {_ik*e, m+ raHyNqcMa5Fy\Zwgn[@m׹?1;WOQ2G:;[RYGƯ4VC;(|t[x{fHtYc4(DY˿o,ǶWvW %2N]zJ*@[yBE+,&ق73Q=>p,'"M{;ޘgI)|Tߕ3R+x0_}dZ3<8e)y5UJ!t+z!A/̃Ng\M 9${ ['^{u @;WEY]aJiF%m0G'Sh "60SU9Ab̚HEm^} `@E%(7$xz($^Ih sE,BǮUF}.Y?@^ï+I% OMA|DV07‡<./ۋ"z d gEk;vDB/| gCrz/5e WhSi ? r[h'N&uq Qc5AZ~(?A2#ݕ0"BrcGy3Wď?dzYttyfad-ڍyY[u6~p4y4#/FPUֆ:涠f~B,y6IENDB`qt5integration-5.5.23/styles/images/woodbutton.png000066400000000000000000000170111424734202100222640ustar00rootroot00000000000000PNG  IHDR``F pHYsHHFk>PLTEC+NKR+MIN0S?T124EGH3P$R;T0X@Z ^b_#aCk09?3DMM!R+R6[9_*bCk.s>uKm:iF<CF1KKKNP6Q-R"THY,Z7a^` `RaEb!e/e:i kCl:p.t"uHy6K ^-GN(EIDATߏ$IboDFdUwOWWUVedVfVwL,]z{l |@X~'$̃@$d #9A6|vfw5w;=3#2#z2#2χ<ӷ?rx; Ξ^w_^ڤ;;\)G+۳{sq)C͆rj5 \ 7b!tMW_a>T@\Va dZƷJe5; [F3k!pIZ@S}@@NS,J; T{OІo-rjFl⭝|2q2sdcVȽj淭O+q{$WF7>Μ @: @ @r3KiTsog],dx|y00h^]FeԬ+>H%S:eU{!{ '{@nssw>hWf}xPUwq4+1 HTPjЖz U;="8p ueVAbrBK$m8hTJf4@+lnj<[OXrzus0ъhR'GgVmܾ0@`9}o0CdeI.He!1{> ղJMu:'KtN'GAj_Í~uҴb@|`A,hu 'μBcBIlփܐ",qLr=ިP1 ,+OWhP9 7MzBm> {-3 BgX/'JMc"/b<׍qM:}yȔv קѕY*g<<Rqh deaU{jYS:8mcKAv>-b3* ^/GWLʗ[|ߚ=zrfuzMYЊ~kƠ5v`0f鍦x_GڣqB@ ȝ7)p'q"@'o:C3t*`~)6;]$xq.ʝ je  Љ%%b'lD27.T@<7B'_Gxjȼ̻ho;\eeQ7L!Aԭ:|*؆[9ž2PXRc7Xd%c#PDFs=')g.m|[9vR`Hl>2Qjj^9^y<pmUm]JW2v)sO;9oS2vg=L7ȳRW=& @1kw@;s-fvPa=Pփyt.Vh=q ~1Óf6R+E.}nqtȀIDi #I#A1:^e&`(m. 3F -AgR[C1tE p7Թ)=j\>W<g~A8_$jBԑ{IA8f`ĵWT#;k+|nLg|1<b-Rcx|?_@n7[&p0}dF?"(The^t.}cam;tLfP!_eK'+P.ǗV+ѱwz4?J[-.5C[O;gJCN[oG<_TDO*!UKj1M>M=e'$|+D+ǧ5 s+ܢ-d7pus`Wf@5Sda0ѣyJv@ȅoW Z"wɨD/Zcy*? Sdv o9xt:F!02(|8uoRn;u<`H" F]o@˚2o fyRC[8܁/{ҚCڹ o;!Zs `t\n9eԄN^tEZ#VGjXޠ/`nb| m(* ɘXrINkx1( ~5iI[&@藫֒OyŹ XbK*>#!B <KT8״۷1>  (`g"NOmwbDP^! ^ df?O&zzSyQu>Ab{[|`Y%|#Ѫ{\j~Jo/mMo։\ Վ N?WNqTNZ)RQ (^%H^ ܐ-0w "ܧ\XyKuʦ5 w1+9n[k5X FCS5 68ʎ jqҳ8:(ٯlۯ! 6w%< G4mL'8+ŀLpܶ)peN20A+:|ܧr-ޡO>:8$?㵪&7LwxxV;/_?|պ*n^bl[j17/7˧>y:sV<ԚYz,o{7ɕc~YxV8`3rWFzy9]0C1 yu]v2@L))@6nP`5H@ H|**TM.|y3\ʊ*P*=U`]s@-`0 ?DC*pp5/ 0w1_w\r s@u3` BՋWOnWՀod97YR8yҮ-Ptq4ȤW6aA-ƣˁ~|z̕k5&n@br^ab6` OH0G:XEEfɒ*iHP}_E`8}nP(:C00~D0hJ!00lQI)x+͒@ X>8KLZ_X?@W~9P_/& wO疽t.-+SuZݙg_T ϖw@Ygx_C,HUFr(3dT#%nzF7@#huj+{^f?p{街`R :oǧב{6_(p=N}gYp{{Ozs^uXA;ϗymbTJ q/ \C!)hub}>)7?bj9XUTY%蓯A` @*80@G'FJ2ihqAm >Rh@ĺ3 x?}9/\Q;7>2]\/T2x+mp^] rQк1>FJ*SVpܚh^"sB"ە@j)P.Zΰ}@/ҷn8:Հ_%! 栶9sۣޏP>4޳Mo 88߼v~;6={>sD|_L&xՌ?5 nI0ʧFܴF>w9o# `o冁<&4@:;f''-?hi} xY4aѳl`QeJ !PƈKlB֘GDotր,! !n/,6{u)5=P<$ A<8^,RsvQk[5Ɓb 1tu01t^f-weU441Lͱ#vhkjrUZق@qoT ^ xހS3cX"X%Jzl:@aP\yeHT]l"3b=&ZXm1N5 QI}`L1ƹ͂EWO v4w_aOz_f[_m^Sey˹z}M;!yl{Sd_gƳl s$Kjw/h fG(P[ʀDgЙ\V@P3 QHk 9ָiS#  sRYE(2NFXƺU`cb Hqdh=@`ig84ztHɌemP`]`aKAʚh`&$^nvâqϬ***F"٘m1:y6_녨:)7ʐs1Xk{K|4`oO> XQqS[* \9f,~ɓ9_fuH P&̤#OL k>IprѪ^w?ydH)$bi;iߏs?OYX+?]t3V4C,=c׮#g{?|aɽ +k#C'Қ^P+B˘Ĩ4nS`UmʭT b.3 4@ a&t/mcgwyxIJZŐߩHTr =6( i^*&Q#@a=O|$H))[A@{@z\1`0^jٔO@Аr-{кA&d`,.-a])Q33PL~ѷ :*9V +Y9/.4YzݑTWt1@cƩ1X$B:# dRH7+m !#EtE&,&l(yI@ESxjL$I5S+ojhԡ^[uZ;aGV҅5wO;ۉY 54 ")`Xݏ2Y?5,i%~wȺp=ÿƝb#eOVs/~bEgtkY[P`퓓tDoZ,LڐB'iH{7[jcQpPo ^ae 2-AsA ,o_A59+e2椉46he{ ZgS<3+8#|q,kuibQ!ak?fx$$pYn#IF͉. Jwg[!!o а@LZP-3UXh~ta|5N>4hcpehʡ˄RҌ~=. yj6jqc' T@I~6RYv@/kA\k}WVۨ6Fa Q >Z!Wnd$gxPVUbK+t ̳8;R<;m[d.7d[J!#dXӻlq(fD Mנ*0Va8}9ƻYUOkmbNIo<w@`ZJ8,ѲCgIENDB`qt5integration-5.5.23/styles/main.cpp000066400000000000000000000046041424734202100175410ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of The Qt Company Ltd nor the names of its ** contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include #include #include "widgetgallery.h" int main(int argc, char *argv[]) { Q_INIT_RESOURCE(styles); // qputenv("QT_DEBUG_PLUGINS", "1"); QStringList paths = QApplication::libraryPaths(); paths.prepend(QFileInfo(QString::fromUtf8(argv[0])).path() + "/plugins"); QApplication::setLibraryPaths(paths); QApplication app(argc, argv); WidgetGallery gallery; gallery.show(); return app.exec(); } qt5integration-5.5.23/styles/norwegianwoodstyle.cpp000066400000000000000000000254061424734202100225630ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of The Qt Company Ltd nor the names of its ** contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include "norwegianwoodstyle.h" NorwegianWoodStyle::NorwegianWoodStyle() : QProxyStyle(QStyleFactory::create("windows")) { } //! [0] void NorwegianWoodStyle::polish(QPalette &palette) { QColor brown(212, 140, 95); QColor beige(236, 182, 120); QColor slightlyOpaqueBlack(0, 0, 0, 63); QPixmap backgroundImage(":/images/woodbackground.png"); QPixmap buttonImage(":/images/woodbutton.png"); QPixmap midImage = buttonImage; QPainter painter; painter.begin(&midImage); painter.setPen(Qt::NoPen); painter.fillRect(midImage.rect(), slightlyOpaqueBlack); painter.end(); //! [0] //! [1] palette = QPalette(brown); palette.setBrush(QPalette::BrightText, Qt::white); palette.setBrush(QPalette::Base, beige); palette.setBrush(QPalette::Highlight, Qt::darkGreen); setTexture(palette, QPalette::Button, buttonImage); setTexture(palette, QPalette::Mid, midImage); setTexture(palette, QPalette::Window, backgroundImage); QBrush brush = palette.background(); brush.setColor(brush.color().dark()); palette.setBrush(QPalette::Disabled, QPalette::WindowText, brush); palette.setBrush(QPalette::Disabled, QPalette::Text, brush); palette.setBrush(QPalette::Disabled, QPalette::ButtonText, brush); palette.setBrush(QPalette::Disabled, QPalette::Base, brush); palette.setBrush(QPalette::Disabled, QPalette::Button, brush); palette.setBrush(QPalette::Disabled, QPalette::Mid, brush); } //! [1] //! [3] void NorwegianWoodStyle::polish(QWidget *widget) //! [3] //! [4] { if (qobject_cast(widget) || qobject_cast(widget)) widget->setAttribute(Qt::WA_Hover, true); } //! [4] //! [5] void NorwegianWoodStyle::unpolish(QWidget *widget) //! [5] //! [6] { if (qobject_cast(widget) || qobject_cast(widget)) widget->setAttribute(Qt::WA_Hover, false); } //! [6] //! [7] int NorwegianWoodStyle::pixelMetric(PixelMetric metric, //! [7] //! [8] const QStyleOption *option, const QWidget *widget) const { switch (metric) { case PM_ComboBoxFrameWidth: return 8; case PM_ScrollBarExtent: return QProxyStyle::pixelMetric(metric, option, widget) + 4; default: return QProxyStyle::pixelMetric(metric, option, widget); } } //! [8] //! [9] int NorwegianWoodStyle::styleHint(StyleHint hint, const QStyleOption *option, //! [9] //! [10] const QWidget *widget, QStyleHintReturn *returnData) const { switch (hint) { case SH_DitherDisabledText: return int(false); case SH_EtchDisabledText: return int(true); default: return QProxyStyle::styleHint(hint, option, widget, returnData); } } //! [10] //! [11] void NorwegianWoodStyle::drawPrimitive(PrimitiveElement element, //! [11] //! [12] const QStyleOption *option, QPainter *painter, const QWidget *widget) const { switch (element) { case PE_PanelButtonCommand: { int delta = (option->state & State_MouseOver) ? 64 : 0; QColor slightlyOpaqueBlack(0, 0, 0, 63); QColor semiTransparentWhite(255, 255, 255, 127 + delta); QColor semiTransparentBlack(0, 0, 0, 127 - delta); int x, y, width, height; option->rect.getRect(&x, &y, &width, &height); //! [12] //! [13] QPainterPath roundRect = roundRectPath(option->rect); //! [13] //! [14] int radius = qMin(width, height) / 2; //! [14] //! [15] QBrush brush; //! [15] //! [16] bool darker; const QStyleOptionButton *buttonOption = qstyleoption_cast(option); if (buttonOption && (buttonOption->features & QStyleOptionButton::Flat)) { brush = option->palette.background(); darker = (option->state & (State_Sunken | State_On)); } else { if (option->state & (State_Sunken | State_On)) { brush = option->palette.mid(); darker = !(option->state & State_Sunken); } else { brush = option->palette.button(); darker = false; //! [16] //! [17] } //! [17] //! [18] } //! [18] //! [19] painter->save(); //! [19] //! [20] painter->setRenderHint(QPainter::Antialiasing, true); //! [20] //! [21] painter->fillPath(roundRect, brush); //! [21] //! [22] if (darker) //! [22] //! [23] painter->fillPath(roundRect, slightlyOpaqueBlack); //! [23] //! [24] int penWidth; //! [24] //! [25] if (radius < 10) penWidth = 3; else if (radius < 20) penWidth = 5; else penWidth = 7; QPen topPen(semiTransparentWhite, penWidth); QPen bottomPen(semiTransparentBlack, penWidth); if (option->state & (State_Sunken | State_On)) qSwap(topPen, bottomPen); //! [25] //! [26] int x1 = x; int x2 = x + radius; int x3 = x + width - radius; int x4 = x + width; if (option->direction == Qt::RightToLeft) { qSwap(x1, x4); qSwap(x2, x3); } QPolygon topHalf; topHalf << QPoint(x1, y) << QPoint(x4, y) << QPoint(x3, y + radius) << QPoint(x2, y + height - radius) << QPoint(x1, y + height); painter->setClipPath(roundRect); painter->setClipRegion(topHalf, Qt::IntersectClip); painter->setPen(topPen); painter->drawPath(roundRect); //! [26] //! [32] QPolygon bottomHalf = topHalf; bottomHalf[0] = QPoint(x4, y + height); painter->setClipPath(roundRect); painter->setClipRegion(bottomHalf, Qt::IntersectClip); painter->setPen(bottomPen); painter->drawPath(roundRect); painter->setPen(option->palette.foreground().color()); painter->setClipping(false); painter->drawPath(roundRect); painter->restore(); } break; //! [32] //! [33] default: //! [33] //! [34] QProxyStyle::drawPrimitive(element, option, painter, widget); } } //! [34] //! [35] void NorwegianWoodStyle::drawControl(ControlElement element, //! [35] //! [36] const QStyleOption *option, QPainter *painter, const QWidget *widget) const { switch (element) { case CE_PushButtonLabel: { QStyleOptionButton myButtonOption; const QStyleOptionButton *buttonOption = qstyleoption_cast(option); if (buttonOption) { myButtonOption = *buttonOption; if (myButtonOption.palette.currentColorGroup() != QPalette::Disabled) { if (myButtonOption.state & (State_Sunken | State_On)) { myButtonOption.palette.setBrush(QPalette::ButtonText, myButtonOption.palette.brightText()); } } } QProxyStyle::drawControl(element, &myButtonOption, painter, widget); } break; default: QProxyStyle::drawControl(element, option, painter, widget); } } //! [36] //! [37] void NorwegianWoodStyle::setTexture(QPalette &palette, QPalette::ColorRole role, //! [37] //! [38] const QPixmap &pixmap) { for (int i = 0; i < QPalette::NColorGroups; ++i) { QColor color = palette.brush(QPalette::ColorGroup(i), role).color(); palette.setBrush(QPalette::ColorGroup(i), role, QBrush(color, pixmap)); } } //! [38] //! [39] QPainterPath NorwegianWoodStyle::roundRectPath(const QRect &rect) //! [39] //! [40] { int radius = qMin(rect.width(), rect.height()) / 2; int diam = 2 * radius; int x1, y1, x2, y2; rect.getCoords(&x1, &y1, &x2, &y2); QPainterPath path; path.moveTo(x2, y1 + radius); path.arcTo(QRect(x2 - diam, y1, diam, diam), 0.0, +90.0); path.lineTo(x1 + radius, y1); path.arcTo(QRect(x1, y1, diam, diam), 90.0, +90.0); path.lineTo(x1, y2 - radius); path.arcTo(QRect(x1, y2 - diam, diam, diam), 180.0, +90.0); path.lineTo(x1 + radius, y2); path.arcTo(QRect(x2 - diam, y2 - diam, diam, diam), 270.0, +90.0); path.closeSubpath(); return path; } //! [40] qt5integration-5.5.23/styles/norwegianwoodstyle.h000066400000000000000000000061771424734202100222340ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of The Qt Company Ltd nor the names of its ** contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef NORWEGIANWOODSTYLE_H #define NORWEGIANWOODSTYLE_H #include #include QT_BEGIN_NAMESPACE class QPainterPath; QT_END_NAMESPACE //! [0] class NorwegianWoodStyle : public QProxyStyle { Q_OBJECT public: NorwegianWoodStyle(); void polish(QPalette &palette) Q_DECL_OVERRIDE; void polish(QWidget *widget) Q_DECL_OVERRIDE; void unpolish(QWidget *widget) Q_DECL_OVERRIDE; int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE; int styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const Q_DECL_OVERRIDE; void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; void drawControl(ControlElement control, const QStyleOption *option, QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; private: static void setTexture(QPalette &palette, QPalette::ColorRole role, const QPixmap &pixmap); static QPainterPath roundRectPath(const QRect &rect); }; //! [0] #endif qt5integration-5.5.23/styles/styles.pro000066400000000000000000000006041424734202100201520ustar00rootroot00000000000000QT += widgets dtkwidget$${DTK_VERSION} HEADERS = norwegianwoodstyle.h \ widgetgallery.h SOURCES = main.cpp \ norwegianwoodstyle.cpp \ widgetgallery.cpp RESOURCES = styles.qrc DESTDIR = $$_PRO_FILE_PWD_/../bin/ CONFIG += c++11 # install # target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/styles # INSTALLS += target qt5integration-5.5.23/styles/styles.qrc000066400000000000000000000002241424734202100201350ustar00rootroot00000000000000 images/woodbutton.png images/woodbackground.png qt5integration-5.5.23/styles/widgetgallery.cpp000066400000000000000000000347711424734202100214700ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of The Qt Company Ltd nor the names of its ** contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include #include #include "norwegianwoodstyle.h" #include "widgetgallery.h" //! [0] WidgetGallery::WidgetGallery(QWidget *parent) : QMainWindow(parent) { originalPalette = QApplication::palette(); styleComboBox = new QComboBox; styleComboBox->addItem("NorwegianWood"); styleComboBox->addItems(QStyleFactory::keys()); styleComboBox->setToolTip("Hello"); styleLabel = new QLabel(tr("&Style:")); styleLabel->setBuddy(styleComboBox); useStylePaletteCheckBox = new QCheckBox(tr("&Use style's standard palette")); useStylePaletteCheckBox->setChecked(false); disableWidgetsCheckBox = new QCheckBox(tr("&Disable widgets")); changeStyle("chameleon"); createTopLeftGroupBox(); createTopRightGroupBox(); createBottomLeftTabWidget(); createBottomRightGroupBox(); createProgressBar(); //! [0] //! [1] connect(styleComboBox, SIGNAL(activated(QString)), //! [1] //! [2] this, SLOT(changeStyle(QString))); connect(useStylePaletteCheckBox, SIGNAL(toggled(bool)), this, SLOT(changePalette())); connect(disableWidgetsCheckBox, SIGNAL(toggled(bool)), topLeftGroupBox, SLOT(setDisabled(bool))); connect(disableWidgetsCheckBox, SIGNAL(toggled(bool)), topRightGroupBox, SLOT(setDisabled(bool))); connect(disableWidgetsCheckBox, SIGNAL(toggled(bool)), bottomLeftTabWidget, SLOT(setDisabled(bool))); connect(disableWidgetsCheckBox, SIGNAL(toggled(bool)), bottomRightGroupBox, SLOT(setDisabled(bool))); //! [2] //! [3] QWidget *mainWidget = new QWidget(); QHBoxLayout *topLayout = new QHBoxLayout; //! [3] //! [4] topLayout->addWidget(styleLabel); topLayout->addWidget(styleComboBox); topLayout->addStretch(1); topLayout->addWidget(useStylePaletteCheckBox); topLayout->addWidget(disableWidgetsCheckBox); QGridLayout *mainLayout = new QGridLayout(mainWidget); mainLayout->addLayout(topLayout, 0, 0, 1, 2); mainLayout->addWidget(topLeftGroupBox, 1, 0); mainLayout->addWidget(topRightGroupBox, 1, 1); mainLayout->addWidget(bottomLeftTabWidget, 2, 0); mainLayout->addWidget(bottomRightGroupBox, 2, 1); mainLayout->addWidget(progressBar, 3, 0, 1, 2); mainLayout->setRowStretch(1, 1); mainLayout->setRowStretch(2, 1); mainLayout->setColumnStretch(0, 1); mainLayout->setColumnStretch(1, 1); setWindowTitle(tr("Styles")); setCentralWidget(mainWidget); QMenu *firstLayer = new QMenu("first"); menuBar()->addAction("chameleon")->setMenu(firstLayer); firstLayer->addAction("menu 1")->setIcon(QIcon::fromTheme("document-open")); firstLayer->addAction("menu 2")->setEnabled(false); firstLayer->addSection("Section"); firstLayer->addAction("menu 3")->setCheckable(true); firstLayer->addSeparator(); QMenu *secondLayer = new QMenu("second"); firstLayer->addMenu(secondLayer); QActionGroup *group = new QActionGroup(this); group->setExclusive(true); QAction *sa1 = new QAction("submenu 1"); sa1->setCheckable(true); group->addAction(sa1); QAction *sa2 = new QAction("submenu 2"); sa2->setCheckable(true); sa2->setIcon(QIcon::fromTheme("application-exit")); group->addAction(sa2); QAction *sa3 = new QAction("submenu 3"); sa3->setCheckable(true); sa3->setShortcut(QKeySequence::New); group->addAction(sa3); secondLayer->addActions(group->actions()); secondLayer->setLayoutDirection(Qt::RightToLeft); menuBar()->addAction("dlight"); menuBar()->addAction("ddark"); menuBar()->addAction("dsemidark"); menuBar()->addAction("dsemilight"); connect(menuBar(), &QMenuBar::triggered, this, [this](const QAction * action) { changeStyle(action->text()); }); } //! [4] //! [5] void WidgetGallery::changeStyle(const QString &styleName) //! [5] //! [6] { if (styleName == "NorwegianWood") { QApplication::setStyle(new NorwegianWoodStyle); } else { QApplication::setStyle(QStyleFactory::create(styleName)); } changePalette(); } //! [6] //! [7] void WidgetGallery::changePalette() //! [7] //! [8] { if (useStylePaletteCheckBox->isChecked()) { QApplication::setPalette(QApplication::style()->standardPalette()); } else { // QApplication::setPalette(originalPalette); QApplication::setAttribute(Qt::AA_SetPalette, false); } } //! [8] //! [9] void WidgetGallery::advanceProgressBar() //! [9] //! [10] { int curVal = progressBar->value(); int maxVal = progressBar->maximum(); progressBar->setValue(curVal + (maxVal - curVal) / 100); } //! [10] //! [11] void WidgetGallery::createTopLeftGroupBox() //! [11] //! [12] { topLeftGroupBox = new QGroupBox(tr("Group 1")); radioButton1 = new QRadioButton(tr("Radio button 1")); radioButton2 = new QRadioButton(tr("Radio button 2")); radioButton3 = new QRadioButton(tr("Radio button 3")); radioButton1->setChecked(true); checkBox = new QCheckBox(tr("Tri-state check box")); checkBox->setTristate(true); checkBox->setCheckState(Qt::PartiallyChecked); connect(radioButton1, &QRadioButton::clicked, this, [&] { bottomLeftTabWidget->setDocumentMode(!bottomLeftTabWidget->documentMode()); }); connect(radioButton2, &QRadioButton::clicked, this, [&] { bottomLeftTabWidget->setTabShape(QTabWidget::Rounded); bottomLeftTabWidget->update(); }); connect(radioButton3, &QRadioButton::clicked, this, [&] { bottomLeftTabWidget->setTabShape(QTabWidget::Triangular); bottomLeftTabWidget->update(); }); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(radioButton1); layout->addWidget(radioButton2); layout->addWidget(radioButton3); layout->addWidget(checkBox); layout->addStretch(1); topLeftGroupBox->setLayout(layout); } //! [12] void WidgetGallery::createTopRightGroupBox() { topRightGroupBox = new QGroupBox(tr("Group 2")); defaultPushButton = new QPushButton(tr("Default Push Button")); defaultPushButton->setDefault(true); togglePushButton = new QPushButton(tr("Toggle Push Button")); togglePushButton->setCheckable(true); togglePushButton->setChecked(true); flatPushButton = new QPushButton(tr("Flat Push Button")); flatPushButton->setFlat(true); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(defaultPushButton); layout->addWidget(togglePushButton); layout->addWidget(flatPushButton); layout->addStretch(1); topRightGroupBox->setLayout(layout); } void WidgetGallery::createBottomLeftTabWidget() { bottomLeftTabWidget = new QTabWidget; bottomLeftTabWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored); bottomLeftTabWidget->setTabsClosable(true); bottomLeftTabWidget->setTabShape(QTabWidget::Triangular); QWidget *tab1 = new QWidget; tableWidget = new QTableWidget(10, 10); tableWidget->setAlternatingRowColors(true); QHBoxLayout *tab1hbox = new QHBoxLayout; tab1hbox->setMargin(5); tab1hbox->addWidget(tableWidget); tab1->setLayout(tab1hbox); QWidget *tab2 = new QWidget; textEdit = new QTextEdit; textEdit->setPlainText(tr("Twinkle, twinkle, little star,\n" "How I wonder what you are.\n" "Up above the world so high,\n" "Like a diamond in the sky.\n" "Twinkle, twinkle, little star,\n" "How I wonder what you are!\n")); QHBoxLayout *tab2hbox = new QHBoxLayout; tab2hbox->setMargin(5); tab2hbox->addWidget(textEdit); tab2->setLayout(tab2hbox); bottomLeftTabWidget->addTab(tab1, tr("&Table")); bottomLeftTabWidget->addTab(tab2, tr("Text &Edit")); QWidget *pTreeViewWidget = new QWidget; QFileSystemModel *model = new QFileSystemModel(this); model->setRootPath(QDir::currentPath()); QHBoxLayout *pTabLayout = new QHBoxLayout; pTabLayout->setMargin(0); pTabLayout->setMargin(0); pTreeViewWidget->setLayout(pTabLayout); QTreeView *tree = new QTreeView; tree->setModel(model); pTabLayout->addWidget(tree); QWidget *pListViewWidget = new QWidget; QHBoxLayout *pListLayout = new QHBoxLayout; QStandardItemModel *listModel = new QStandardItemModel(this); pListLayout->setMargin(0); pListViewWidget->setLayout(pListLayout); QListView *lv = new QListView; lv->setDragEnabled(true); lv->setDragDropMode(QListView::DragDrop); lv->setDefaultDropAction(Qt::CopyAction); lv->setModel(listModel); pListLayout->addWidget(lv); for (uint8_t i = 0; i < 10; ++i) { QStandardItem *item = new QStandardItem; item->setIcon(this->style() ? this->style()->standardIcon(QStyle::StandardPixmap(QStyle::SP_DirIcon + i)) : QIcon()); item->setText(QStringLiteral("Row %1...............").arg(i + 1)); item->setEnabled(i % 2); item->setCheckable(true); item->setCheckState(Qt::Checked); item->setDragEnabled(true); listModel->appendRow(item); } bottomLeftTabWidget->addTab(pTreeViewWidget, "&TreeView"); bottomLeftTabWidget->addTab(pListViewWidget, "&ListView"); bottomLeftTabWidget->addTab(new QWidget(), "tab 2"); bottomLeftTabWidget->addTab(new QWidget(), "tab 3"); bottomLeftTabWidget->addTab(new QWidget(), "tab 4"); } void WidgetGallery::createBottomRightGroupBox() { bottomRightGroupBox = new QGroupBox(tr("Group 3")); bottomRightGroupBox->setCheckable(true); bottomRightGroupBox->setChecked(true); lineEdit = new QLineEdit("s3cRe7"); lineEdit->setEchoMode(QLineEdit::Password); lineEdit->setClearButtonEnabled(true); lineEdit->setFrame(false); QMenu *menu = lineEdit->createStandardContextMenu(); menu->setParent(lineEdit); QAction *testActoin = new QAction("b"); testActoin->setCheckable(true); testActoin->setProperty("_d_menu_item_redpoint", true); QMenu *subMenu = new QMenu("just test red point sub menu", menu); subMenu->setProperty("_d_menu_item_redpoint", true); subMenu->setProperty("_d_menu_item_info", "new"); subMenu->addAction("111"); subMenu->addAction("222"); QAction *a3 = new QAction("a3"); a3->setProperty("_d_menu_item_redpoint", true); subMenu->addAction(a3); menu->addMenu(subMenu); testActoin->setProperty("_d_menu_item_info", "99+"); QObject::connect(testActoin, &QAction::triggered, testActoin, [testActoin](bool checked) { testActoin->setProperty("_d_menu_item_redpoint", checked); }); menu->addAction(testActoin); QObject::connect(lineEdit, &QLineEdit::textChanged, lineEdit, [menu]() { menu->popup(QCursor::pos()); }); spinBox = new QSpinBox(bottomRightGroupBox); spinBox->setValue(50); spinBox->setButtonSymbols(QAbstractSpinBox::PlusMinus); spinBox->setPrefix(" Prefix "); spinBox->setSuffix(" Suffix "); spinBox->setAlignment(Qt::AlignCenter); spinBox->setFrame(false); dateTimeEdit = new QDateTimeEdit(bottomRightGroupBox); dateTimeEdit->setDateTime(QDateTime::currentDateTime()); comboBoxEdit = new QComboBox(bottomRightGroupBox); comboBoxEdit->addItem(QIcon::fromTheme("dde-file-manager"), "dde-file-manager"); comboBoxEdit->addItem(QIcon::fromTheme("dde-introduction"), "dde-introduction"); comboBoxEdit->addItem(QIcon::fromTheme("deepin-deb-installer"), "deepin-deb-installer"); comboBoxEdit->setEditable(true); slider = new QSlider(Qt::Horizontal, bottomRightGroupBox); slider->setRange(0, 100); slider->setTickInterval(10); slider->setTickPosition(QSlider::TicksBelow); slider->setValue(40); scrollBar = new QScrollBar(Qt::Horizontal, bottomRightGroupBox); scrollBar->setValue(60); scrollBar->setProperty("_d_dtk_slider_always_show", true); dial = new QDial(bottomRightGroupBox); dial->setValue(30); dial->setNotchesVisible(true); QGridLayout *layout = new QGridLayout; layout->addWidget(lineEdit, 0, 0, 1, 2); layout->addWidget(spinBox, 1, 0, 1, 2); layout->addWidget(dateTimeEdit, 2, 0, 1, 2); layout->addWidget(comboBoxEdit, 3, 0, 1, 2); layout->addWidget(slider, 4, 0); layout->addWidget(scrollBar, 5, 0); layout->addWidget(dial, 4, 1, 2, 1); layout->setRowStretch(6, 1); bottomRightGroupBox->setLayout(layout); } //! [13] void WidgetGallery::createProgressBar() { progressBar = new QProgressBar; progressBar->setRange(0, 10000); progressBar->setValue(0); QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(advanceProgressBar())); timer->start(1000); } //! [13] qt5integration-5.5.23/styles/widgetgallery.h000066400000000000000000000070121424734202100211210ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of The Qt Company Ltd nor the names of its ** contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef WIDGETGALLERY_H #define WIDGETGALLERY_H #include QT_BEGIN_NAMESPACE class QCheckBox; class QComboBox; class QDateTimeEdit; class QDial; class QGroupBox; class QLabel; class QLineEdit; class QProgressBar; class QPushButton; class QRadioButton; class QScrollBar; class QSlider; class QSpinBox; class QTabWidget; class QTableWidget; class QTextEdit; QT_END_NAMESPACE //! [0] class WidgetGallery : public QMainWindow { Q_OBJECT public: WidgetGallery(QWidget *parent = 0); private slots: void changeStyle(const QString &styleName); void changePalette(); void advanceProgressBar(); private: void createTopLeftGroupBox(); void createTopRightGroupBox(); void createBottomLeftTabWidget(); void createBottomRightGroupBox(); void createProgressBar(); QPalette originalPalette; QLabel *styleLabel; QComboBox *styleComboBox; QCheckBox *useStylePaletteCheckBox; QCheckBox *disableWidgetsCheckBox; //! [0] QGroupBox *topLeftGroupBox; QRadioButton *radioButton1; QRadioButton *radioButton2; QRadioButton *radioButton3; QCheckBox *checkBox; QGroupBox *topRightGroupBox; QPushButton *defaultPushButton; QPushButton *togglePushButton; QPushButton *flatPushButton; QTabWidget *bottomLeftTabWidget; QTableWidget *tableWidget; QTextEdit *textEdit; QGroupBox *bottomRightGroupBox; QLineEdit *lineEdit; QSpinBox *spinBox; QDateTimeEdit *dateTimeEdit; QComboBox *comboBoxEdit; QSlider *slider; QScrollBar *scrollBar; QDial *dial; QProgressBar *progressBar; //! [1] }; //! [1] #endif qt5integration-5.5.23/tests/000077500000000000000000000000001424734202100157245ustar00rootroot00000000000000qt5integration-5.5.23/tests/iconengines/000077500000000000000000000000001424734202100202255ustar00rootroot00000000000000qt5integration-5.5.23/tests/iconengines/builtinengine/000077500000000000000000000000001424734202100230615ustar00rootroot00000000000000qt5integration-5.5.23/tests/iconengines/builtinengine/builtinengine.pri000066400000000000000000000002351424734202100264310ustar00rootroot00000000000000INCLUDEPATH += $$PWD/../../../iconengineplugins/builtinengine/ SOURCES += \ $$PWD/ut_builtinengine.cpp RESOURCES += \ $$PWD/icons/theme-icons.qrc qt5integration-5.5.23/tests/iconengines/builtinengine/icons/000077500000000000000000000000001424734202100241745ustar00rootroot00000000000000qt5integration-5.5.23/tests/iconengines/builtinengine/icons/actions/000077500000000000000000000000001424734202100256345ustar00rootroot00000000000000qt5integration-5.5.23/tests/iconengines/builtinengine/icons/actions/icon_Layout_16px.svg000066400000000000000000000024241424734202100315220ustar00rootroot00000000000000 icon_Layout/normal qt5integration-5.5.23/tests/iconengines/builtinengine/icons/theme-icons.qrc000066400000000000000000000001771424734202100271230ustar00rootroot00000000000000 actions/icon_Layout_16px.svg qt5integration-5.5.23/tests/iconengines/builtinengine/ut_builtinengine.cpp000066400000000000000000000121351424734202100271330ustar00rootroot00000000000000#include #include #include #include #include "dbuiltiniconengine.h" DGUI_USE_NAMESPACE #define ICONNAME "icon_Layout" #define ICONSIZE 16 class ut_DBuiltinIconEngine : public testing::Test { protected: void SetUp() override; void TearDown() override; DBuiltinIconEngine *mIconEngine; }; void ut_DBuiltinIconEngine::SetUp() { mIconEngine = new DBuiltinIconEngine(ICONNAME); } void ut_DBuiltinIconEngine::TearDown() { delete mIconEngine; } TEST_F(ut_DBuiltinIconEngine, loadIcon) { const QThemeIconInfo &themeInfo = mIconEngine->loadIcon(ICONNAME, DGuiApplicationHelper::instance()->themeType()); ASSERT_EQ(themeInfo.iconName, ICONNAME); QIconLoaderEngineEntry *entry = themeInfo.entries.first(); QString builtinActionPath = ":/icons/deepin/builtin/actions"; ASSERT_TRUE(entry->filename.contains(ICONNAME)); ASSERT_EQ(entry->dir.path, builtinActionPath); ASSERT_EQ(entry->dir.size, ICONSIZE); ASSERT_EQ(entry->dir.type, QIconDirInfo::Scalable); ASSERT_FALSE(entry->pixmap(QSize(ICONSIZE, ICONSIZE), QIcon::Normal, QIcon::On).isNull()); for (auto item : themeInfo.entries) { delete item; } } TEST_F(ut_DBuiltinIconEngine, actualSize) { QSize size(ICONSIZE, ICONSIZE); QSize iconSize = mIconEngine->actualSize(size, QIcon::Normal, QIcon::On); ASSERT_FALSE(iconSize.isEmpty()); if (mIconEngine->m_info.entries.first()->dir.type == QIconDirInfo::Scalable) { ASSERT_EQ(iconSize, size); } else { bool isTrue = (iconSize.width() <= qMin(iconSize.width(), iconSize.height())) && (iconSize.height() <= qMin(iconSize.width(), iconSize.height())); ASSERT_TRUE(isTrue); } } TEST_F(ut_DBuiltinIconEngine, pixmap) { QPixmap iconenginePixmap = mIconEngine->pixmap(QSize(ICONSIZE, ICONSIZE), QIcon::Normal, QIcon::On); ASSERT_FALSE(iconenginePixmap.isNull()); } TEST_F(ut_DBuiltinIconEngine, paint) { QImage iconImage(QSize(ICONSIZE, ICONSIZE), QImage::Format_ARGB32); QPainter iconPainter(&iconImage); mIconEngine->paint(&iconPainter, QRect({0, 0}, iconImage.size()), QIcon::Normal, QIcon::On); ASSERT_FALSE(iconImage.isNull()); } TEST_F(ut_DBuiltinIconEngine, key) { ASSERT_EQ(mIconEngine->key(), "DBuiltinIconEngine"); } TEST_F(ut_DBuiltinIconEngine, clone) { auto clone = mIconEngine->clone(); ASSERT_FALSE(!clone); delete clone; } TEST_F(ut_DBuiltinIconEngine, read) { QByteArray data; uint key = 1; bool followSystemTheme = true; QString iconName = ICONNAME; QDataStream out(&data, QIODevice::WriteOnly); out << iconName << key << followSystemTheme; QDataStream in(&data, QIODevice::ReadOnly); mIconEngine->read(in); ASSERT_EQ(mIconEngine->m_iconName, iconName); ASSERT_EQ(mIconEngine->m_key, key); ASSERT_EQ(mIconEngine->m_followSystemTheme, followSystemTheme); } TEST_F(ut_DBuiltinIconEngine, write) { QByteArray data; QDataStream out(&data, QIODevice::WriteOnly); mIconEngine->write(out); uint key = 0; bool followSystemTheme = false; QString iconName; QDataStream in(&data, QIODevice::ReadOnly); in >> iconName >> key >> followSystemTheme; ASSERT_EQ(mIconEngine->m_iconName, iconName); ASSERT_EQ(mIconEngine->m_key, key); ASSERT_EQ(mIconEngine->m_followSystemTheme, followSystemTheme); } TEST_F(ut_DBuiltinIconEngine, iconName) { ASSERT_EQ(mIconEngine->iconName(), ICONNAME); } TEST_F(ut_DBuiltinIconEngine, ensureLoaded) { mIconEngine->ensureLoaded(); ASSERT_EQ(mIconEngine->m_key, DGuiApplicationHelper::instance()->themeType()); ASSERT_TRUE(mIconEngine->m_initialized); ASSERT_EQ(mIconEngine->m_info.iconName, ICONNAME); QIconLoaderEngineEntry *entry = mIconEngine->m_info.entries.first(); QString builtinActionPath = ":/icons/deepin/builtin/actions"; ASSERT_TRUE(entry->filename.contains(ICONNAME)); ASSERT_EQ(entry->dir.path, builtinActionPath); ASSERT_EQ(entry->dir.size, ICONSIZE); ASSERT_EQ(entry->dir.type, QIconDirInfo::Scalable); } TEST_F(ut_DBuiltinIconEngine, hasIcon) { mIconEngine->ensureLoaded(); ASSERT_TRUE(mIconEngine->hasIcon()); } TEST_F(ut_DBuiltinIconEngine, virtual_hook) { QIconEngine::AvailableSizesArgument data; void *arg = reinterpret_cast(&data); mIconEngine->virtual_hook(QIconEngine::AvailableSizesHook, arg); ASSERT_FALSE(data.sizes.isEmpty()); QString icon_name; arg = reinterpret_cast(&icon_name); mIconEngine->virtual_hook(QIconEngine::IconNameHook, arg); ASSERT_EQ(icon_name, ICONNAME); bool isNull = true; arg = reinterpret_cast(&isNull); mIconEngine->virtual_hook(QIconEngine::IsNullHook, arg); ASSERT_FALSE(isNull); QIconEngine::ScaledPixmapArgument pixmapData; // 参数值会在函数内部进行判断,需要初始化后传入 并判断函数是否执行成功 pixmapData.size = QSize(ICONSIZE, ICONSIZE); pixmapData.scale = 1; arg = reinterpret_cast(&pixmapData); mIconEngine->virtual_hook(QIconEngine::ScaledPixmapHook, arg); ASSERT_FALSE(pixmapData.pixmap.isNull()); } qt5integration-5.5.23/tests/iconengines/iconengines.pri000066400000000000000000000001371424734202100232430ustar00rootroot00000000000000include($$PWD/builtinengine/builtinengine.pri) include($$PWD/svgiconengine/svgiconengine.pri) qt5integration-5.5.23/tests/iconengines/svgiconengine/000077500000000000000000000000001424734202100230635ustar00rootroot00000000000000qt5integration-5.5.23/tests/iconengines/svgiconengine/icon_window_16px.svg000066400000000000000000000016201424734202100270000ustar00rootroot00000000000000 icon_Window/normal qt5integration-5.5.23/tests/iconengines/svgiconengine/icons.qrc000066400000000000000000000001431424734202100247030ustar00rootroot00000000000000 icon_window_16px.svg qt5integration-5.5.23/tests/iconengines/svgiconengine/svgiconengine.pri000066400000000000000000000003101424734202100264270ustar00rootroot00000000000000CONFIG(debug, debug|release) { DEFINES += NDEBUG } INCLUDEPATH += $$PWD/../../../iconengineplugins/svgiconengine SOURCES += \ $$PWD/ut_qsvgiconengine.cpp RESOURCES += \ $$PWD/icons.qrc qt5integration-5.5.23/tests/iconengines/svgiconengine/ut_qsvgiconengine.cpp000066400000000000000000000125371424734202100273260ustar00rootroot00000000000000#include #include #include #include #include #include #include "qsvgiconengine.h" #define ICONNAME ":/icon_window_16px.svg" DGUI_USE_NAMESPACE class ut_QSvgIconEngine : public testing::Test { protected: void SetUp() override; void TearDown() override; QSvgIconEngine *m_IconEngine = nullptr; bool canUseRender = true; }; void ut_QSvgIconEngine::SetUp() { // 排除没有rsvg环境时测试的干扰 DSvgRenderer render(QString(ICONNAME)); if (!render.isValid()) canUseRender = false; m_IconEngine = new QSvgIconEngine; QString fileName = ICONNAME; m_IconEngine->addFile(fileName, {}, QIcon::Normal, QIcon::Off); } void ut_QSvgIconEngine::TearDown() { delete m_IconEngine; } TEST_F(ut_QSvgIconEngine, QSvgIconEngine) { // 测试构造是否成功 ASSERT_TRUE(m_IconEngine); } TEST_F(ut_QSvgIconEngine, paint) { // 测试添加完原始数据后paint函数能够成功绘制数据 QImage svgImage(QSize(16, 16), QImage::Format_ARGB32); QPainter imgPainter(&svgImage); m_IconEngine->paint(&imgPainter, QRect(QPoint(0, 0), QSize(16, 16)), QIcon::Normal, QIcon::Off); ASSERT_FALSE(svgImage.isNull()); } TEST_F(ut_QSvgIconEngine, actualSize) { // 测试icon的大小是否存在 没有rsvg环境时忽略 QSize iconSize = m_IconEngine->actualSize(QSize(16, 16), QIcon::Normal, QIcon::Off); if (canUseRender) { ASSERT_FALSE(iconSize.isEmpty()); } else { ASSERT_TRUE(iconSize.isEmpty()); } } TEST_F(ut_QSvgIconEngine, pixmap) { // 测试添加完数据后pixmap函数能够成功拿到数据 QPixmap iconPixmap = m_IconEngine->pixmap(QSize(16, 16), QIcon::Normal, QIcon::Off); if (canUseRender) { ASSERT_FALSE(iconPixmap.isNull()); } else { ASSERT_TRUE(iconPixmap.isNull()); } } TEST_F(ut_QSvgIconEngine, key) { ASSERT_FALSE(m_IconEngine->key().isEmpty()); } TEST_F(ut_QSvgIconEngine, clone) { auto clone = m_IconEngine->clone(); ASSERT_TRUE(clone); delete clone; } TEST_F(ut_QSvgIconEngine, readAndWrite) { // 测试读写函数是否正常,读写会返回正常的数值 进行比较 QByteArray data; QDataStream inData(&data, QIODevice::WriteOnly); inData.setVersion(QDataStream::Qt_4_4); // 是否写入成功 ASSERT_TRUE(m_IconEngine->write(inData)); // 写入数据后 原始容器是否存在数据 ASSERT_FALSE(data.isEmpty()); QHash svgBuffers; QHash svgFiles; int isCompressed = -1; QDataStream out(&data, QIODevice::ReadOnly); out.setVersion(QDataStream::Qt_4_4); out >> svgFiles >> isCompressed >> svgBuffers; if (canUseRender) { // 获取写出的数据是否存在 ASSERT_FALSE(svgFiles.isEmpty()); ASSERT_NE(isCompressed, -1); ASSERT_FALSE(svgBuffers.isEmpty()); } svgFiles[-1] = QColor(Qt::red).name(); data.clear(); QDataStream inStream(&data, QIODevice::WriteOnly); inStream.setVersion(QDataStream::Qt_4_4); inStream << svgFiles << isCompressed << svgBuffers; QDataStream readSteam(&data, QIODevice::ReadOnly); readSteam.setVersion(QDataStream::Qt_4_4); // 测试读入数据是否成功 ASSERT_TRUE(m_IconEngine->read(readSteam)); } void testForAddFile(int *ret) { *ret = -1; #ifdef NDEBUG auto iconEngine = QSharedPointer(new QSvgIconEngine); QString fileName = ICONNAME; // 死亡测试 优先进行 测试是否存在崩溃等问题 ASSERT_DEBUG_DEATH(iconEngine->addFile(fileName, QSize(), QIcon::Normal, QIcon::Off), ""); #endif *ret = 0; } TEST(addFileDeathTest, addFile) { testing::FLAGS_gtest_death_test_style = "threadsafe"; int ret = -1; testForAddFile(&ret); // 如果函数崩溃 这里就不会等于0 ASSERT_EQ(ret, 0); } struct TestPixmapType_Param { TestPixmapType_Param(const QPixmap &p, QIcon::Mode m, QIcon::State s) : pixmap(p) , mode(m) , state(s) { } QPixmap pixmap; QIcon::Mode mode; QIcon::State state; }; class AddPixmapParamTest : public ::testing::TestWithParam { protected: void SetUp() override; void TearDown() override; QSvgIconEngine *engine; }; INSTANTIATE_TEST_CASE_P(QSvgIconEngine, AddPixmapParamTest, ::testing::Values(TestPixmapType_Param(QPixmap(ICONNAME), QIcon::Disabled, QIcon::On), TestPixmapType_Param(QPixmap(ICONNAME), QIcon::Active, QIcon::On), TestPixmapType_Param(QPixmap(ICONNAME), QIcon::Normal, QIcon::On), TestPixmapType_Param(QPixmap(ICONNAME), QIcon::Selected, QIcon::On), TestPixmapType_Param(QPixmap(ICONNAME), QIcon::Disabled, QIcon::Off), TestPixmapType_Param(QPixmap(ICONNAME), QIcon::Active, QIcon::Off), TestPixmapType_Param(QPixmap(ICONNAME), QIcon::Normal, QIcon::Off), TestPixmapType_Param(QPixmap(ICONNAME), QIcon::Selected, QIcon::Off))); TEST_P(AddPixmapParamTest, addPixmap) { // 参数设置 批量进行不同参数 判断返回数据是否一致 TestPixmapType_Param param = GetParam(); engine->addPixmap(param.pixmap, param.mode, param.state); ASSERT_EQ(param.pixmap.toImage(), engine->pixmap({16, 16}, param.mode, param.state).toImage()); } void AddPixmapParamTest::SetUp() { engine = new QSvgIconEngine; } void AddPixmapParamTest::TearDown() { delete engine; } qt5integration-5.5.23/tests/imageformats/000077500000000000000000000000001424734202100204025ustar00rootroot00000000000000qt5integration-5.5.23/tests/imageformats/imageformats.pri000066400000000000000000000000331424734202100235700ustar00rootroot00000000000000include($$PWD/svg/svg.pri) qt5integration-5.5.23/tests/imageformats/svg/000077500000000000000000000000001424734202100212015ustar00rootroot00000000000000qt5integration-5.5.23/tests/imageformats/svg/svg.pri000066400000000000000000000001421424734202100225110ustar00rootroot00000000000000INCLUDEPATH += $$PWD/../../../imageformatplugins/svg SOURCES += \ $$PWD/ut_qsvgiohandler.cpp qt5integration-5.5.23/tests/imageformats/svg/ut_qsvgiohandler.cpp000066400000000000000000000150341424734202100252660ustar00rootroot00000000000000/* * Copyright (C) 2021 Uniontech Software 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 . */ #include "qsvgiohandler.h" #include #include #include #include #include #include #include #include #ifndef UT_QSVGIOHANDLERPRIVATE #define UT_QSVGIOHANDLERPRIVATE DGUI_USE_NAMESPACE class QSvgIOHandlerPrivate { public: QSvgIOHandlerPrivate(QSvgIOHandler *qq); bool load(QIODevice *device); QSvgIOHandler *q; DSvgRenderer r; QSize defaultSize; QRect clipRect; QSize scaledSize; QRect scaledClipRect; bool loaded; bool readDone; QColor backColor; }; #endif class ut_QSvgIOHandler : public testing::Test { protected: void SetUp(); void TearDown(); QSvgIOHandler *handler; }; void ut_QSvgIOHandler::SetUp() { handler = new QSvgIOHandler(); } void ut_QSvgIOHandler::TearDown() { delete handler; } TEST_F(ut_QSvgIOHandler, testForPrivatePtr) { ASSERT_TRUE(handler->d); ASSERT_FALSE(handler->d->loaded); ASSERT_FALSE(handler->d->readDone); ASSERT_EQ(handler->d->backColor, Qt::transparent); } static const char *testTmpFile = "/tmp/tmpSvg.svg"; static const char *testSvgContent = "" "" "logo icon" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""; TEST_F(ut_QSvgIOHandler, testForLoad) { QImage image(QSize(20, 20), QImage::Format_RGB32); // 填充一个底色用于判断颜色是否被覆盖 image.fill(Qt::green); ASSERT_FALSE(handler->read(&image)); QFile tmpFile(testTmpFile); ASSERT_TRUE(tmpFile.open(QFile::WriteOnly)); tmpFile.write(testSvgContent); tmpFile.close(); ASSERT_TRUE(tmpFile.open(QFile::ReadWrite)); ASSERT_TRUE(handler->canRead(&tmpFile)); QRect clipRect(0, 0, 10, 10); handler->setOption(QSvgIOHandler::ClipRect, clipRect); ASSERT_EQ(handler->option(QSvgIOHandler::ClipRect), clipRect); QSize scaleSize(20, 20); handler->setOption(QSvgIOHandler::ScaledSize, scaleSize); ASSERT_EQ(handler->option(QSvgIOHandler::ScaledSize), scaleSize); QRect scaledClipRect(2, 2, 5, 5); handler->setOption(QSvgIOHandler::ScaledClipRect, scaledClipRect); ASSERT_EQ(handler->option(QSvgIOHandler::ScaledClipRect), scaledClipRect); QColor backgroundColor(Qt::blue); handler->setOption(QSvgIOHandler::BackgroundColor, backgroundColor); ASSERT_EQ(handler->option(QSvgIOHandler::BackgroundColor), backgroundColor); ASSERT_TRUE(handler->option(QSvgIOHandler::Size).isValid()); handler->setDevice(&tmpFile); handler->read(&image); tmpFile.close(); tmpFile.remove(); } TEST_F(ut_QSvgIOHandler, testFunction) { ASSERT_STREQ(handler->name(), "svg"); ASSERT_TRUE(handler->supportsOption(QSvgIOHandler::ImageFormat)); ASSERT_TRUE(handler->supportsOption(QSvgIOHandler::Size)); ASSERT_TRUE(handler->supportsOption(QSvgIOHandler::ClipRect)); ASSERT_TRUE(handler->supportsOption(QSvgIOHandler::ScaledSize)); ASSERT_TRUE(handler->supportsOption(QSvgIOHandler::ScaledClipRect)); ASSERT_TRUE(handler->supportsOption(QSvgIOHandler::BackgroundColor)); ASSERT_FALSE(handler->supportsOption(QSvgIOHandler::ImageTransformation)); } qt5integration-5.5.23/tests/main.cpp000066400000000000000000000016201424734202100173530ustar00rootroot00000000000000#include #include #ifdef QT_DEBUG #include #endif int main(int argc, char *argv[]) { // gerrit编译时没有显示器,需要指定环境变量 qputenv("QT_QPA_PLATFORM", "offscreen"); // 风格插件需要添加平台主题,用于创建图标引擎 QByteArray platformThemePath; #ifdef UT_PLATFORMPLUGIN_PATH platformThemePath = UT_PLATFORMPLUGIN_PATH; QApplication::setLibraryPaths(QApplication::libraryPaths() << QString(UT_PLATFORMPLUGIN_PATH).append("../")); #endif if (!platformThemePath.isEmpty()) qputenv("QT_QPA_PLATFORM_PLUGIN_PATH", platformThemePath); qputenv("QT_QPA_PLATFORMTHEME", "deepin"); 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; } qt5integration-5.5.23/tests/styleplugins/000077500000000000000000000000001424734202100204665ustar00rootroot00000000000000qt5integration-5.5.23/tests/styleplugins/chameleon/000077500000000000000000000000001424734202100224215ustar00rootroot00000000000000qt5integration-5.5.23/tests/styleplugins/chameleon/chameleon.pri000066400000000000000000000004611424734202100250710ustar00rootroot00000000000000QMAKE_RPATHDIR += $$PWD/../../../bin/plugins/styles/$${BASED_DTK_DIR} unix:LIBS += -L$$PWD/../../../bin/plugins/styles/$${BASED_DTK_DIR} -lchameleon$${DTK_VERSION} INCLUDEPATH += $$PWD/../../../styleplugins/chameleon !contains(QMAKE_HOST.arch, mips.*) { SOURCES += \ $$PWD/ut_chameleonstyle.cpp \ } qt5integration-5.5.23/tests/styleplugins/chameleon/ut_chameleonstyle.cpp000066400000000000000000002412371424734202100266620ustar00rootroot00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "chameleonstyle.h" DWIDGET_USE_NAMESPACE; using namespace chameleon; class TestForStyleHintParam : public ::testing::TestWithParam { protected: void SetUp() override; void TearDown() override; ChameleonStyle *style; QWidget *testWidget; }; void TestForStyleHintParam::SetUp() { style = new ChameleonStyle; testWidget = new QWidget; } void TestForStyleHintParam::TearDown() { delete style; delete testWidget; } INSTANTIATE_TEST_CASE_P(ChameleonStyle, TestForStyleHintParam, ::testing::Range(int(ChameleonStyle::SH_EtchDisabledText), int(ChameleonStyle::SH_SpinBox_ButtonsInsideFrame))); TEST_P(TestForStyleHintParam, styleHint) { QStyleOption opt; opt.init(testWidget); testWidget->setStyle(style); int param = GetParam(); // 测试在调用默认参数时是否会崩溃 style->styleHint(ChameleonStyle::StyleHint(param)); // 测试调用有参时是否会崩溃 style->styleHint(ChameleonStyle::StyleHint(param), &opt, testWidget); } class TestForPixelMetricParam : public ::testing::TestWithParam { protected: void SetUp() override; void TearDown() override; ChameleonStyle *style; QWidget *testWidget; }; void TestForPixelMetricParam::SetUp() { style = new ChameleonStyle; testWidget = new QWidget; } void TestForPixelMetricParam::TearDown() { delete style; delete testWidget; } INSTANTIATE_TEST_CASE_P(ChameleonStyle, TestForPixelMetricParam, ::testing::Range(quint64(ChameleonStyle::PM_FocusBorderWidth), quint64(ChameleonStyle::PM_ButtonMinimizedSize))); TEST_P(TestForPixelMetricParam, pixelMetric) { QStyleOption opt; opt.init(testWidget); testWidget->setStyle(style); quint64 param = GetParam(); // 测试在调用默认参数时是否有潜在崩溃风险 style->pixelMetric(QStyle::PixelMetric(param)); // 测试调用有参时是否有潜在崩溃风险 style->pixelMetric(QStyle::PixelMetric(param), &opt, testWidget); } class TestForQtDrawControlParam : public ::testing::TestWithParam { protected: void SetUp() override; void TearDown() override; ChameleonStyle *style; QWidget *testWidget; }; INSTANTIATE_TEST_CASE_P(ChameleonStyle, TestForQtDrawControlParam, ::testing::Range(int(QStyle::CE_PushButton), int(QStyle::CE_ShapedFrame))); TEST_P(TestForQtDrawControlParam, drawControl) { QStyleOption opt; opt.init(testWidget); // 测试Qt原生drawControl参数调用时是否有潜在崩溃风险 QPixmap surface(QSize(200, 200)); QPainter painter(&surface); int param = GetParam(); // DStyle中存在的元素值在DTKWIDGET中使用 这里不再测试调用 style->drawControl(QStyle::ControlElement(param), &opt, &painter); } void TestForQtDrawControlParam::SetUp() { style = new ChameleonStyle; testWidget = new QWidget; } void TestForQtDrawControlParam::TearDown() { delete style; delete testWidget; } struct DrawComplexControl_Param { explicit DrawComplexControl_Param(QStyle::ComplexControl cc, QStyleOptionComplex *opt) : cc(cc) , opt(opt) { } void releaseOption() { switch (cc) { case QStyle::CC_SpinBox: delete qstyleoption_cast(opt); break; case QStyle::CC_ToolButton: delete qstyleoption_cast(opt); break; case QStyle::CC_Slider: delete qstyleoption_cast(opt); break; case QStyle::CC_ComboBox: delete qstyleoption_cast(opt); break; default: delete opt; } opt = nullptr; } QStyle::ComplexControl cc; QStyleOptionComplex *opt; }; class TestForQtDrawComplexControlParam : public ::testing::TestWithParam { protected: void SetUp() override; void TearDown() override; ChameleonStyle *style; QWidget *testWidget; }; INSTANTIATE_TEST_CASE_P(ChameleonStyle, TestForQtDrawComplexControlParam, ::testing::Values(DrawComplexControl_Param(QStyle::CC_SpinBox, new QStyleOptionSpinBox), DrawComplexControl_Param(QStyle::CC_ToolButton, new QStyleOptionToolButton), DrawComplexControl_Param(QStyle::CC_Slider, new QStyleOptionSlider), DrawComplexControl_Param(QStyle::CC_ComboBox, new QStyleOptionComboBox))); TEST_P(TestForQtDrawComplexControlParam, drawComplexControl) { DrawComplexControl_Param param = GetParam(); QPixmap surface(QSize(200, 200)); QPainter p(&surface); param.opt->init(testWidget); // 测试调用默认参数时函数是否会崩溃 style->drawComplexControl(param.cc, param.opt, &p); param.releaseOption(); } void TestForQtDrawComplexControlParam::SetUp() { style = new ChameleonStyle; testWidget = new QWidget; } void TestForQtDrawComplexControlParam::TearDown() { delete style; delete testWidget; } class TestForQtStandardPixmapParam : public ::testing::TestWithParam { }; INSTANTIATE_TEST_CASE_P(ChameleonStyle, TestForQtStandardPixmapParam, ::testing::Range(int(QStyle::SP_TitleBarMenuButton), int(QStyle::SP_LineEditClearButton))); TEST_P(TestForQtStandardPixmapParam, StandardPixmap) { ChameleonStyle *style = new ChameleonStyle; int param = GetParam(); qDebug() << "QStyle::standardIcon:" << param << " isNull: " << (style->standardIcon(QStyle::StandardPixmap(param)).isNull()); qDebug() << "QStyle::standardPixmap:" << param << " isNull: " << (style->standardPixmap(QStyle::StandardPixmap(param)).isNull()); if (param < int(QStyle::CC_MdiControls)) qDebug() << "DStyle::hitTestComplexControl" << param << style->hitTestComplexControl(QStyle::ComplexControl(param), nullptr, {0, 0}); delete style; } #define ASSERT_DrawFuncHasData(DrawFunc) \ painter->begin(&pixmap); \ DrawFunc(); \ painter->end(); \ ASSERT_FALSE(pixmap.isNull()); \ ASSERT_TRUE(testPixmapHasData()); \ pixmap.fill(Qt::green) #define ASSERT_DrawFuncNoData(DrawFunc) \ painter->begin(&pixmap); \ DrawFunc(); \ painter->end(); \ ASSERT_FALSE(pixmap.isNull()); \ ASSERT_FALSE(testPixmapHasData()); \ pixmap.fill(Qt::green) #define INIT_TESTWIDGET(ClassName) \ if (testWidget) \ delete testWidget; \ testWidget = new ClassName; \ testWidget->setGeometry(0, 0, 100, 100) class TestDrawUtilIntegration; class TestForDrawUtil : public ::testing::Test { friend TestDrawUtilIntegration; protected: void SetUp(); void TearDown(); bool testPixmapHasData(); ChameleonStyle *style; QWidget *testWidget = nullptr; QPixmap pixmap; QPainter *painter; }; class TestDrawUtilIntegration { public: TestDrawUtilIntegration(TestForDrawUtil *parent) : m_parent(parent) { } protected: inline QPainter *painter() const { return m_parent->painter; } inline QWidget *testWidget() const { return m_parent->testWidget; } inline ChameleonStyle *style() const { return m_parent->style; } TestForDrawUtil *m_parent; }; void TestForDrawUtil::SetUp() { style = new ChameleonStyle; pixmap = QPixmap(QSize(200, 200)); painter = new QPainter; // 以异色作为初始颜色防止默认随机颜色的干扰 pixmap.fill(Qt::green); } void TestForDrawUtil::TearDown() { delete style; delete painter; delete testWidget; } bool TestForDrawUtil::testPixmapHasData() { QImage image = pixmap.toImage(); image.reinterpretAsFormat(QImage::Format_RGB32); const QRgb *bits = reinterpret_cast(image.constBits()); const QRgb *end = bits + image.byteCount() / sizeof(QRgb); return !std::all_of(bits, end, [](QRgb r) { return r == QColor(Qt::green).rgb(); }); } TEST_F(TestForDrawUtil, drawShadow) { auto drawShaowFunc = [&]() { style->drawShadow(painter, QRect(0, 0, 20, 20), Qt::black); }; ASSERT_DrawFuncHasData(drawShaowFunc); } TEST_F(TestForDrawUtil, drawBorder) { auto drawBorderFunc = [&]() { QStyleOption opt; opt.init(testWidget); // 测试调用是否存在异常崩溃并且测试函数的绘制操作是否有效 style->drawBorder(painter, &opt, testWidget); }; INIT_TESTWIDGET(QWidget); ASSERT_DrawFuncHasData(drawBorderFunc); } TEST_F(TestForDrawUtil, drawCalenderEllipse) { auto drawCalenderEllipseFunc = [&]() { // 测试绘制操作是否存在数据 style->drawCalenderEllipse(painter, QRect(0, 0, 50, 50), 5); }; INIT_TESTWIDGET(QWidget); ASSERT_DrawFuncHasData(drawCalenderEllipseFunc); } TEST_F(TestForDrawUtil, drawButtonBoxButton) { class TestButtonBoxButtonDrawFunc : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawButtonBoxButonBeginning() { DStyleOptionButtonBoxButton button; button.init(testWidget()); button.orientation = Qt::Horizontal; button.position = DStyleOptionButtonBoxButton::Beginning; style()->drawButtonBoxButton(&button, painter(), m_DefaultRect, m_radius); } void testDrawButtonBoxButtonMiddle() { DStyleOptionButtonBoxButton button; button.init(testWidget()); button.orientation = Qt::Horizontal; button.position = DStyleOptionButtonBoxButton::Middle; style()->drawButtonBoxButton(&button, painter(), m_DefaultRect, m_radius); } void testDrawButtonBoxButtonEnd() { DStyleOptionButtonBoxButton button; button.init(testWidget()); button.orientation = Qt::Horizontal; button.position = DStyleOptionButtonBoxButton::End; style()->drawButtonBoxButton(&button, painter(), m_DefaultRect, m_radius); } void testDrawButtonBoxButtonOnlyOne() { DStyleOptionButtonBoxButton button; button.init(testWidget()); button.orientation = Qt::Horizontal; button.position = DStyleOptionButtonBoxButton::OnlyOne; style()->drawButtonBoxButton(&button, painter(), m_DefaultRect, m_radius); } void testDrawButtonBoxButtonVerticalBeginning() { DStyleOptionButtonBoxButton button; button.init(testWidget()); button.orientation = Qt::Vertical; button.position = DStyleOptionButtonBoxButton::Beginning; style()->drawButtonBoxButton(&button, painter(), m_DefaultRect, m_radius); } private: QRect m_DefaultRect = {0, 0, 50, 50}; int m_radius = 5; }; INIT_TESTWIDGET(QWidget); TestButtonBoxButtonDrawFunc drawFuncInstance(this); // 多场景触发绘制 测试数据是否存在 并 异于初始数据 ASSERT_DrawFuncHasData(drawFuncInstance.testDrawButtonBoxButonBeginning); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawButtonBoxButtonMiddle); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawButtonBoxButtonEnd); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawButtonBoxButtonOnlyOne); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawButtonBoxButtonVerticalBeginning); } TEST_F(TestForDrawUtil, drawButtonDownArrow) { auto drawButtonDownArrowFunc = [&]() { QStyleOptionButton opt; opt.init(testWidget); style->drawButtonDownArrow(&opt, painter, testWidget); }; INIT_TESTWIDGET(QWidget); ASSERT_DrawFuncHasData(drawButtonDownArrowFunc); } TEST_F(TestForDrawUtil, drawSpinBox) { auto drawSpinBoxPlusMinusFunc = [&]() { QStyleOptionSpinBox opt; opt.init(testWidget); opt.buttonSymbols = QAbstractSpinBox::PlusMinus; style->drawSpinBox(&opt, painter, testWidget); }; auto drawSpinBoxUpDownArrows = [&]() { QStyleOptionSpinBox opt; opt.init(testWidget); opt.buttonSymbols = QAbstractSpinBox::UpDownArrows; style->drawSpinBox(&opt, painter, testWidget); }; INIT_TESTWIDGET(QWidget); testWidget->setProperty("_d_dtk_spinBox", true); ASSERT_DrawFuncHasData(drawSpinBoxPlusMinusFunc); ASSERT_DrawFuncHasData(drawSpinBoxUpDownArrows); } TEST_F(TestForDrawUtil, drawMenuBarItem) { auto drawMenuBarItemMarginAndExclusive = [&]() { QStyleOptionMenuItem opt; opt.init(testWidget); opt.menuItemType = QStyleOptionMenuItem::Margin; opt.checkType = QStyleOptionMenuItem::Exclusive; opt.text = "测试1"; opt.icon = style->standardIcon(QStyle::SP_DirIcon); opt.menuRect = QRect(20, 20, 60, 40); opt.maxIconWidth = 20; opt.tabWidth = 2; QRect ret; style->drawMenuBarItem(&opt, ret, painter, testWidget); }; auto drawMenuBarItemNormalAndExclusive = [&]() { QStyleOptionMenuItem opt; opt.init(testWidget); opt.menuItemType = QStyleOptionMenuItem::Normal; opt.checkType = QStyleOptionMenuItem::Exclusive; opt.text = "测试2"; opt.icon = style->standardIcon(QStyle::SP_DirIcon); opt.menuRect = QRect(20, 20, 60, 40); opt.maxIconWidth = 20; opt.tabWidth = 2; opt.state |= QStyle::State_MouseOver; QRect ret; style->drawMenuBarItem(&opt, ret, painter, testWidget); }; INIT_TESTWIDGET(QWidget); ASSERT_DrawFuncHasData(drawMenuBarItemMarginAndExclusive); ASSERT_DrawFuncHasData(drawMenuBarItemNormalAndExclusive); } TEST_F(TestForDrawUtil, drawMenuItemBackground) { class TestMenuItemBackgroundDrawFunc : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawNormalBackground() { QStyleOption opt; opt.init(testWidget()); opt.state |= QStyle::State_Selected; style()->drawMenuItemBackground(&opt, painter(), QStyleOptionMenuItem::Normal); } void testDrawDefaultItemBackground() { QStyleOption opt; opt.init(testWidget()); opt.state |= QStyle::State_MouseOver; style()->drawMenuItemBackground(&opt, painter(), QStyleOptionMenuItem::DefaultItem); } void testDrawSunMenuBackground() { QStyleOption opt; opt.init(testWidget()); opt.state |= QStyle::State_Sunken; style()->drawMenuItemBackground(&opt, painter(), QStyleOptionMenuItem::SubMenu); } }; INIT_TESTWIDGET(QWidget); TestMenuItemBackgroundDrawFunc drawFuncInstance(this); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawNormalBackground); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawDefaultItemBackground); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawSunMenuBackground); } TEST_F(TestForDrawUtil, drawMenuItem) { class TestMenuItemDrawFunc : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawNorMenuItem() { QStyleOptionMenuItem opt; opt.init(testWidget()); opt.menuItemType = QStyleOptionMenuItem::Normal; style()->drawMenuItem(&opt, painter(), testWidget()); } void testDrawSeparatorMenuItem() { QStyleOptionMenuItem opt; opt.init(testWidget()); opt.menuItemType = QStyleOptionMenuItem::Separator; style()->drawMenuItem(&opt, painter(), testWidget()); } void testDrawSubMenuItem() { QStyleOptionMenuItem opt2; opt2.init(testWidget()); opt2.menuItemType = QStyleOptionMenuItem::SubMenu; style()->drawMenuItem(&opt2, painter(), testWidget()); } }; INIT_TESTWIDGET(QWidget); TestMenuItemDrawFunc drawFuncInstance(this); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawNorMenuItem); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawSeparatorMenuItem); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawSubMenuItem); } TEST_F(TestForDrawUtil, drawTabBar) { class TestTabBarDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawRoundedEstOnlyOneTab() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= (QStyle::State_Selected | QStyle::State_Enabled); tab.shape = QTabBar::RoundedEast; tab.position = QStyleOptionTab::OnlyOneTab; tab.selectedPosition = QStyleOptionTab::NotAdjacent; tab.cornerWidgets = QStyleOptionTab::NoCornerWidgets; tab.text = "test 1"; style()->drawTabBar(painter(), &tab, testWidget()); } void testDrawTriangularNorthMiddleTab() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= QStyle::State_Enabled; tab.shape = QTabBar::TriangularNorth; tab.position = QStyleOptionTab::Middle; tab.selectedPosition = QStyleOptionTab::NextIsSelected; tab.cornerWidgets = QStyleOptionTab::RightCornerWidget; tab.text = "test 2"; tab.icon = style()->standardIcon(QStyle::SP_DirIcon); tab.iconSize = QSize(16, 16); style()->drawTabBar(painter(), &tab, testWidget()); } void testDrawRoundedWestBeginningTab() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= QStyle::State_Enabled; tab.shape = QTabBar::RoundedWest; tab.position = QStyleOptionTab::Beginning; tab.selectedPosition = QStyleOptionTab::PreviousIsSelected; tab.cornerWidgets = QStyleOptionTab::NoCornerWidgets; tab.text = "test 3"; tab.icon = style()->standardIcon(QStyle::SP_DirIcon); tab.iconSize = QSize(16, 16); style()->drawTabBar(painter(), &tab, testWidget()); } }; INIT_TESTWIDGET(QTabBar); TestTabBarDrawUtil tabbarDrawInstance(this); ASSERT_DrawFuncHasData(tabbarDrawInstance.testDrawRoundedEstOnlyOneTab); ASSERT_DrawFuncHasData(tabbarDrawInstance.testDrawTriangularNorthMiddleTab); ASSERT_DrawFuncHasData(tabbarDrawInstance.testDrawRoundedWestBeginningTab); } TEST_F(TestForDrawUtil, drawTabBarLabel) { class TestTabBarLabelDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawRoundedEastOnlyOneTabLabel() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= (QStyle::State_Selected | QStyle::State_Enabled); tab.shape = QTabBar::RoundedEast; tab.position = QStyleOptionTab::OnlyOneTab; tab.selectedPosition = QStyleOptionTab::NotAdjacent; tab.cornerWidgets = QStyleOptionTab::NoCornerWidgets; tab.text = "test 1"; style()->drawTabBarLabel(painter(), &tab, testWidget()); } void testDrawTriangularNorthTabLabel() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= QStyle::State_Enabled; tab.shape = QTabBar::TriangularNorth; tab.text = "test 2"; style()->drawTabBarLabel(painter(), &tab, testWidget()); } void testDrawTriangularNorthOnlyOneTabLabel() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= (QStyle::State_Selected | QStyle::State_Enabled); tab.shape = QTabBar::TriangularNorth; tab.position = QStyleOptionTab::OnlyOneTab; tab.selectedPosition = QStyleOptionTab::NotAdjacent; tab.cornerWidgets = QStyleOptionTab::NoCornerWidgets; tab.text = "test 3"; style()->drawTabBarLabel(painter(), &tab, testWidget()); } void testDrawTriangularWestOnlyOneTabLabel() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= (QStyle::State_Selected | QStyle::State_Enabled); tab.shape = QTabBar::TriangularWest; tab.position = QStyleOptionTab::OnlyOneTab; tab.selectedPosition = QStyleOptionTab::NotAdjacent; tab.cornerWidgets = QStyleOptionTab::NoCornerWidgets; tab.text = "test 4"; style()->drawTabBarLabel(painter(), &tab, testWidget()); } }; INIT_TESTWIDGET(DTabBar); TestTabBarLabelDrawUtil drawFuncInstance(this); testWidget->setProperty("_d_dtk_tabbartab_type", true); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawRoundedEastOnlyOneTabLabel); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawTriangularNorthTabLabel); testWidget->setProperty("_d_dtk_tabbar_alignment", 0); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawTriangularNorthOnlyOneTabLabel); testWidget->setProperty("_d_dtk_tabbar_alignment", 1); ASSERT_DrawFuncHasData(drawFuncInstance.testDrawTriangularWestOnlyOneTabLabel); } TEST_F(TestForDrawUtil, drawTabBarCloseButton) { INIT_TESTWIDGET(QTabBar); QTabBar *tabbar = qobject_cast(testWidget); ASSERT_TRUE(tabbar); tabbar->addTab("测试1"); tabbar->addTab("测试2"); tabbar->addTab("测试3"); auto drawEnableAndSelectedCloseButton = [&]() { QWidget *btn1 = new QWidget(tabbar); btn1->resize(20, 20); tabbar->setTabButton(0, QTabBar::LeftSide, btn1); QStyleOption opt; opt.init(btn1); opt.state = QStyle::State_Enabled | QStyle::State_Selected; style->drawTabBarCloseButton(painter, &opt, btn1); }; auto drawNormalCloseButton = [&]() { QWidget *btn2 = new QWidget(tabbar); btn2->resize(20, 20); tabbar->setTabButton(1, QTabBar::RightSide, btn2); QStyleOption opt; opt.init(btn2); style->drawTabBarCloseButton(painter, &opt, btn2); }; ASSERT_DrawFuncHasData(drawEnableAndSelectedCloseButton); ASSERT_DrawFuncHasData(drawNormalCloseButton); } TEST_F(TestForDrawUtil, drawTabBarScrollButton) { class TestTabBarScrollButtonDrawUtil : public TestDrawUtilIntegration { public: TestTabBarScrollButtonDrawUtil(TestForDrawUtil *parent) : TestDrawUtilIntegration(parent) { tabbar = qobject_cast(testWidget()); toolButton = new QToolButton(tabbar); } void testDownArrowDrawUtil() { toolButton->setArrowType(Qt::DownArrow); QStyleOptionToolButton opt; opt.init(toolButton); opt.text = "test 1"; opt.arrowType = Qt::DownArrow; style()->drawTabBarScrollButton(painter(), &opt, toolButton); } void testUpArrowDrawUtil() { toolButton->setArrowType(Qt::UpArrow); QStyleOptionToolButton opt; opt.init(toolButton); opt.text = "test 2"; opt.arrowType = Qt::UpArrow; ASSERT_TRUE(tabbar); tabbar->setShape(QTabBar::TriangularEast); style()->drawTabBarScrollButton(painter(), &opt, toolButton); } void testLeftArrowDrawUtil() { toolButton->setArrowType(Qt::LeftArrow); QStyleOptionToolButton opt; opt.init(toolButton); opt.text = "test 3"; opt.arrowType = Qt::LeftArrow; ASSERT_TRUE(tabbar); tabbar->setShape(QTabBar::TriangularEast); style()->drawTabBarScrollButton(painter(), &opt, toolButton); } void testRightArrowDrawUtil() { toolButton->setArrowType(Qt::RightArrow); QStyleOptionToolButton opt; opt.init(toolButton); opt.text = "test 4"; opt.arrowType = Qt::RightArrow; tabbar->setShape(QTabBar::TriangularEast); style()->drawTabBarScrollButton(painter(), &opt, toolButton); } private: QToolButton *toolButton; QTabBar *tabbar; }; INIT_TESTWIDGET(QTabBar); TestTabBarScrollButtonDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDownArrowDrawUtil); ASSERT_DrawFuncHasData(drawUtilInstance.testUpArrowDrawUtil); ASSERT_DrawFuncHasData(drawUtilInstance.testLeftArrowDrawUtil); ASSERT_DrawFuncHasData(drawUtilInstance.testRightArrowDrawUtil); } TEST_F(TestForDrawUtil, drawComboBox) { class TestComboBoxDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawNormalComboBox() { QStyleOptionComboBox opt; opt.init(testWidget()); opt.editable = true; opt.popupRect = QRect(0, 0, 30, 30); opt.frame = true; opt.currentText = "test 1"; opt.currentIcon = style()->standardIcon(QStyle::SP_DirIcon); opt.iconSize = QSize(16, 16); opt.state = QStyle::State_Enabled | QStyle::State_MouseOver; style()->drawComboBox(painter(), &opt, testWidget()); } void testDrawArrowFrameEditAndPopupComboBox() { QStyleOptionComboBox opt; opt.init(testWidget()); opt.editable = false; opt.frame = false; opt.currentText = "test 2"; opt.currentIcon = style()->standardIcon(QStyle::SP_DirIcon); opt.iconSize = QSize(16, 16); opt.subControls |= QStyle::SC_ComboBoxArrow | QStyle::SC_ComboBoxFrame | QStyle::SC_ComboBoxEditField | QStyle::SC_ComboBoxListBoxPopup; style()->drawComboBox(painter(), &opt, testWidget()); } void testDrawArrowFrameComboBox() { QStyleOptionComboBox opt; opt.init(testWidget()); opt.editable = false; opt.frame = false; opt.currentText = "test 3"; opt.currentIcon = style()->standardIcon(QStyle::SP_DirIcon); opt.iconSize = QSize(16, 16); opt.subControls |= QStyle::SC_ComboBoxArrow | QStyle::SC_ComboBoxFrame; style()->drawComboBox(painter(), &opt, testWidget()); } void testDrawEditPopupFocusComboBox() { QStyleOptionComboBox opt; opt.init(testWidget()); opt.currentText = "test 4"; opt.currentIcon = style()->standardIcon(QStyle::SP_DirIcon); opt.iconSize = QSize(16, 16); opt.state = QStyle::State_Enabled | QStyle::State_Selected | QStyle::State_HasFocus; opt.subControls |= QStyle::SC_ComboBoxEditField | QStyle::SC_ComboBoxListBoxPopup; style()->drawComboBox(painter(), &opt, testWidget()); } }; INIT_TESTWIDGET(QWidget); TestComboBoxDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawNormalComboBox); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawArrowFrameEditAndPopupComboBox); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawArrowFrameComboBox); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawEditPopupFocusComboBox); } TEST_F(TestForDrawUtil, drawComboBoxLabel) { class TestComboBoxLabelDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawEnableAndHoverComboBoxLabel() { QStyleOptionComboBox opt; opt.init(testWidget()); opt.editable = true; opt.popupRect = QRect(0, 0, 30, 30); opt.frame = true; opt.currentText = "test 1"; opt.currentIcon = style()->standardIcon(QStyle::SP_DirIcon); opt.iconSize = QSize(16, 16); opt.state = QStyle::State_Enabled | QStyle::State_MouseOver; style()->drawComboBoxLabel(painter(), &opt, testWidget()); } void testDrawArrowFrameEditComboBoxLabel() { QStyleOptionComboBox opt; opt.init(testWidget()); opt.editable = false; opt.popupRect = QRect(0, 0, 30, 30); opt.frame = false; opt.currentText = "test 2"; opt.currentIcon = style()->standardIcon(QStyle::SP_DirIcon); opt.iconSize = QSize(16, 16); opt.subControls |= QStyle::SC_ComboBoxArrow | QStyle::SC_ComboBoxFrame | QStyle::SC_ComboBoxEditField | QStyle::SC_ComboBoxListBoxPopup; style()->drawComboBoxLabel(painter(), &opt, testWidget()); } void testDrawArrowFrameSunkenComboBoxLabel() { QStyleOptionComboBox opt; opt.init(testWidget()); opt.rect = QRect(20, 20, 100, 50); opt.currentText = "test 3"; opt.currentIcon = {}; opt.iconSize = {}; opt.subControls |= QStyle::SC_ComboBoxArrow | QStyle::SC_ComboBoxFrame; opt.state = QStyle::State_Enabled | QStyle::State_Sunken; style()->drawComboBoxLabel(painter(), &opt, testWidget()); } void testDrawFocusAndSelectComboBoxLabel() { QStyleOptionComboBox opt; opt.init(testWidget()); opt.currentText = "测试3"; opt.currentIcon = style()->standardIcon(QStyle::SP_DirIcon); opt.iconSize = QSize(16, 16); opt.state = QStyle::State_Enabled | QStyle::State_Selected | QStyle::State_HasFocus; opt.subControls |= QStyle::SC_ComboBoxEditField | QStyle::SC_ComboBoxListBoxPopup; style()->drawComboBoxLabel(painter(), &opt, testWidget()); } }; INIT_TESTWIDGET(QWidget); TestComboBoxLabelDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawEnableAndHoverComboBoxLabel); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawArrowFrameEditComboBoxLabel); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawArrowFrameSunkenComboBoxLabel); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawFocusAndSelectComboBoxLabel); } TEST_F(TestForDrawUtil, drawSliderHandle) { class TestSliderHandleDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawNoTicksSliderHandle() { QStyleOptionSlider slider; slider.init(testWidget()); slider.tickPosition = QSlider::NoTicks; style()->drawSliderHandle(&slider, defaultRect, painter(), testWidget()); } void testDrawHorizontalLeftTicksSliderHandle() { QStyleOptionSlider slider; slider.init(testWidget()); slider.orientation = Qt::Horizontal; slider.tickPosition = QSlider::TicksLeft; style()->drawSliderHandle(&slider, defaultRect, painter(), testWidget()); } void testDrawHorizontalRightTicksSliderHandle() { QStyleOptionSlider slider; slider.init(testWidget()); slider.orientation = Qt::Horizontal; slider.tickPosition = QSlider::TicksRight; style()->drawSliderHandle(&slider, defaultRect, painter(), testWidget()); } void testDrawVerticalLeftTicksSliderHandle() { QStyleOptionSlider slider; slider.init(testWidget()); slider.orientation = Qt::Vertical; slider.tickPosition = QSlider::TicksLeft; style()->drawSliderHandle(&slider, defaultRect, painter(), testWidget()); } void testDrawVerticalRightTicksSliderHandle() { QStyleOptionSlider slider; slider.init(testWidget()); slider.orientation = Qt::Vertical; slider.tickPosition = QSlider::TicksRight; style()->drawSliderHandle(&slider, defaultRect, painter(), testWidget()); } private: QRectF defaultRect = QRectF(0, 0, 50, 50); }; INIT_TESTWIDGET(QWidget); TestSliderHandleDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawNoTicksSliderHandle); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawHorizontalLeftTicksSliderHandle); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawHorizontalRightTicksSliderHandle); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawVerticalLeftTicksSliderHandle); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawVerticalRightTicksSliderHandle); } TEST_F(TestForDrawUtil, drawSliderHandleFocus) { class TestSliderHandleFocusDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawHorizontalNoticksSliderHandleFocus() { QStyleOptionSlider opt; opt.init(testWidget()); opt.orientation = Qt::Horizontal; opt.tickPosition = QSlider::NoTicks; opt.minimum = 0; opt.maximum = 100; style()->drawSliderHandleFocus(&opt, defaultRect, painter(), nullptr); } void testDrawHorizontalLeftTicksSliderHandleFocus() { QStyleOptionSlider opt; opt.init(testWidget()); opt.orientation = Qt::Horizontal; opt.tickPosition = QSlider::TicksLeft; opt.minimum = 0; opt.maximum = 100; style()->drawSliderHandleFocus(&opt, defaultRect, painter(), nullptr); } void testDrawHorizontalRightTicksSliderHandleFocus() { QStyleOptionSlider opt; opt.init(testWidget()); opt.orientation = Qt::Horizontal; opt.tickPosition = QSlider::TicksRight; opt.minimum = 0; opt.maximum = 100; style()->drawSliderHandleFocus(&opt, defaultRect, painter(), nullptr); } void testDrawVerticalLeftTicksSliderHandleFocus() { QStyleOptionSlider opt; opt.init(testWidget()); opt.orientation = Qt::Vertical; opt.tickPosition = QSlider::TicksLeft; opt.minimum = 0; opt.maximum = 100; style()->drawSliderHandleFocus(&opt, defaultRect, painter(), nullptr); } void testDrawVerticalRightTicksSliderHandleFocus() { QStyleOptionSlider opt; opt.init(testWidget()); opt.orientation = Qt::Vertical; opt.tickPosition = QSlider::TicksRight; opt.minimum = 0; opt.maximum = 100; style()->drawSliderHandleFocus(&opt, defaultRect, painter(), nullptr); } private: QRectF defaultRect = QRect(0, 0, 20, 20); }; INIT_TESTWIDGET(QWidget); TestSliderHandleFocusDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawHorizontalNoticksSliderHandleFocus); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawHorizontalLeftTicksSliderHandleFocus); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawHorizontalRightTicksSliderHandleFocus); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawVerticalLeftTicksSliderHandleFocus); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawVerticalRightTicksSliderHandleFocus); } TEST_F(TestForDrawUtil, drawIcon) { auto drawIconUtil = [&]() { QStyleOption opt; opt.state |= QStyle::State_Enabled; opt.state |= QStyle::State_Selected; QRect rect(0, 0, 10, 10); style->drawIcon(&opt, painter, rect, style->standardIcon(QStyle::SP_DirIcon), true); }; ASSERT_DrawFuncHasData(drawIconUtil); } TEST_F(TestForDrawUtil, tabLayout) { INIT_TESTWIDGET(QWidget); QStyleOptionTab tab; tab.init(testWidget); tab.iconSize = QSize(32, 32); tab.shape = QTabBar::RoundedEast; tab.icon = style->standardIcon(QStyle::SP_DirIcon); QRect textRect, iconRect; style->tabLayout(&tab, testWidget, &textRect, &iconRect); ASSERT_TRUE(textRect.isValid()); ASSERT_TRUE(iconRect.isValid()); } TEST_F(TestForDrawUtil, drawTableViewItem) { auto drawNormalTableViewItem = [&]() { QStyleOptionViewItem opt; opt.init(testWidget); opt.backgroundBrush = Qt::darkCyan; style->drawTableViewItem(QStyle::PE_PanelItemViewItem, &opt, painter, testWidget); }; auto drawEnableItemRadiusTableView = [&]() { QStyleOptionViewItem opt; opt.init(testWidget); opt.backgroundBrush = Qt::darkCyan; opt.state |= QStyle::State_Selected; opt.showDecorationSelected = true; testWidget->setProperty("_d_dtk_enable_tableviewitem_radius", true); style->drawTableViewItem(QStyle::PE_PanelItemViewItem, &opt, painter, testWidget); }; INIT_TESTWIDGET(QTableView); ASSERT_DrawFuncHasData(drawNormalTableViewItem); ASSERT_DrawFuncHasData(drawEnableItemRadiusTableView); } TEST_F(TestForDrawUtil, drawMenuItemRedPoint) { INIT_TESTWIDGET(QMenu); QMenu *menu = qobject_cast(testWidget); ASSERT_TRUE(menu); auto drawNormalMenuItemRedPoint = [&]() { QAction *action = new QAction(menu); action->setText("test 1"); action->setProperty("_d_menu_item_redpoint", true); menu->addAction(action); QStyleOptionMenuItem opt; opt.init(menu); opt.menuItemType = QStyleOptionMenuItem::Normal; opt.rect = menu->actionGeometry(action); style->drawMenuItemRedPoint(&opt, painter, menu); }; auto drawSubMenuRedPoint = [&]() { QAction *actionMenu = new QAction(menu); QMenu *submenu = new QMenu("test menu"); submenu->setProperty("_d_menu_item_redpoint", true); actionMenu->setMenu(submenu); menu->addAction(actionMenu); QStyleOptionMenuItem opt; opt.init(menu); opt.menuItemType = QStyleOptionMenuItem::Normal; opt.menuItemType = QStyleOptionMenuItem::SubMenu; opt.rect = menu->actionGeometry(actionMenu); style->drawMenuItemRedPoint(&opt, painter, menu); }; ASSERT_DrawFuncHasData(drawNormalMenuItemRedPoint); ASSERT_DrawFuncHasData(drawSubMenuRedPoint); } TEST_F(TestForDrawUtil, drawPrimitivePanelItemViewItem) { class TestPanelItemPrimitiveDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawSelectedViewItemPanel() { QStyleOption opt; opt.initFrom(testWidget()); opt.state |= QStyle::State_Selected; style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter(), testWidget()->findChild("qt_calendar_calendarview")); } void testDrawHoverAndSelectedViewItemBeginningPanel() { QStyleOptionViewItem tableviewOption; tableviewOption.initFrom(testWidget()); tableviewOption.showDecorationSelected = true; tableviewOption.state |= (QStyle::State_Selected | QStyle::State_MouseOver); tableviewOption.viewItemPosition = QStyleOptionViewItem::Beginning; style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &tableviewOption, painter(), testWidget()); } void testDrawEndItemViewPanel() { QStyleOptionViewItem tableviewOption; tableviewOption.initFrom(testWidget()); tableviewOption.showDecorationSelected = true; tableviewOption.state |= (QStyle::State_Selected | QStyle::State_MouseOver); tableviewOption.viewItemPosition = QStyleOptionViewItem::End; style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &tableviewOption, painter(), testWidget()); } void testDrawNoDecorationViemItemPanel() { QStyleOptionViewItem tableviewOption; tableviewOption.initFrom(testWidget()); tableviewOption.state |= (QStyle::State_Selected | QStyle::State_MouseOver); tableviewOption.viewItemPosition = QStyleOptionViewItem::End; tableviewOption.showDecorationSelected = false; tableviewOption.backgroundBrush = Qt::darkRed; style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &tableviewOption, painter(), testWidget()); } void testDrawSelectedDecorationListViewItemPanel() { QStyleOptionViewItem listViewOption; listViewOption.initFrom(testWidget()); listViewOption.state |= QStyle::State_Selected; listViewOption.showDecorationSelected = true; style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &listViewOption, painter(), testWidget()); } }; INIT_TESTWIDGET(QCalendarWidget); TestPanelItemPrimitiveDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawSelectedViewItemPanel); INIT_TESTWIDGET(QTreeView); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawHoverAndSelectedViewItemBeginningPanel); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawEndItemViewPanel); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawNoDecorationViemItemPanel); INIT_TESTWIDGET(QListView); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawSelectedDecorationListViewItemPanel); } TEST_F(TestForDrawUtil, drawPrimitivePanelLineEdit) { class TestPanelLineEditDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawFlatFocusLineEdit() { QStyleOptionFrame frameOption; frameOption.initFrom(testWidget()); frameOption.features |= QStyleOptionFrame::Flat; frameOption.state |= QStyle::State_HasFocus; style()->drawPrimitive(QStyle::PE_PanelLineEdit, &frameOption, painter(), testWidget()); } void testDrawRoundedLineEdit() { QStyleOptionFrame frameOption; frameOption.initFrom(testWidget()); frameOption.state |= QStyle::State_HasFocus; frameOption.features |= QStyleOptionFrame::Rounded; frameOption.lineWidth = 5; style()->drawPrimitive(QStyle::PE_PanelLineEdit, &frameOption, painter(), testWidget()); } void testDrawHasOpacityLineEdit() { QStyleOption option; option.initFrom(testWidget()); testWidget()->setProperty("_d_dtk_lineedit_opacity", true); style()->drawPrimitive(QStyle::PE_PanelLineEdit, &option, painter(), testWidget()); } void testDrawHasParentAndOpacityLineEdit() { DSpinBox spinbox; spinbox.resize(200, 200); spinbox.setProperty("_d_dtk_lineedit_opacity", true); testWidget()->setParent(&spinbox); QStyleOption option; option.initFrom(testWidget()); style()->drawPrimitive(QStyle::PE_PanelLineEdit, &option, painter(), testWidget()); testWidget()->setParent(nullptr); } }; INIT_TESTWIDGET(QLineEdit); TestPanelLineEditDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawFlatFocusLineEdit); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawRoundedLineEdit); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawHasOpacityLineEdit); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawHasParentAndOpacityLineEdit); } TEST_F(TestForDrawUtil, drawPrimitiveIndicatorRadioButton) { auto drawNormalRadioButton = [&]() { QStyleOption radioButtonOption; radioButtonOption.initFrom(testWidget); radioButtonOption.state |= QStyle::State_On; style->drawPrimitive(QStyle::PE_IndicatorRadioButton, &radioButtonOption, painter, testWidget); }; auto drawOffStateRadioButton = [&]() { QStyleOption radioButtonOption; radioButtonOption.initFrom(testWidget); radioButtonOption.state |= QStyle::State_Off; style->drawPrimitive(QStyle::PE_IndicatorRadioButton, &radioButtonOption, painter, testWidget); }; INIT_TESTWIDGET(QRadioButton); ASSERT_DrawFuncHasData(drawNormalRadioButton); ASSERT_DrawFuncHasData(drawOffStateRadioButton); } TEST_F(TestForDrawUtil, drawPrimitiveIndicatorCheckBox) { class TestIndicatorCheckBoxDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawNoChangeStateIndicatorCheckBox() { QStyleOption checkBoxOption; checkBoxOption.initFrom(testWidget()); checkBoxOption.state |= QStyle::State_NoChange; style()->drawPrimitive(QStyle::PE_IndicatorCheckBox, &checkBoxOption, painter(), testWidget()); } void testDrawStateOnIndicatorCheckBox() { QStyleOption checkBoxOption; checkBoxOption.initFrom(testWidget()); checkBoxOption.state |= QStyle::State_On; style()->drawPrimitive(QStyle::PE_IndicatorCheckBox, &checkBoxOption, painter(), testWidget()); } void testDrawNormalIndicatorCheckBox() { QStyleOption checkBoxOption; checkBoxOption.initFrom(testWidget()); style()->drawPrimitive(QStyle::PE_IndicatorCheckBox, &checkBoxOption, painter(), testWidget()); } }; INIT_TESTWIDGET(QCheckBox); TestIndicatorCheckBoxDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawNoChangeStateIndicatorCheckBox); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawStateOnIndicatorCheckBox); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawNormalIndicatorCheckBox); } TEST_F(TestForDrawUtil, drawPrimitiveIndicatorTabClose) { auto drawIndicatorTabClose = [&]() { QStyleOption opt; opt.initFrom(testWidget); style->drawPrimitive(QStyle::PE_IndicatorTabClose, &opt, painter, testWidget); }; INIT_TESTWIDGET(QWidget); ASSERT_DrawFuncHasData(drawIndicatorTabClose); } TEST_F(TestForDrawUtil, drawPrimitiveFrameTabWidget) { auto drawFrameTabWidget = [&]() { QStyleOption opt; opt.initFrom(testWidget); style->drawPrimitive(QStyle::PE_FrameTabWidget, &opt, painter, testWidget); }; INIT_TESTWIDGET(QWidget); ASSERT_DrawFuncHasData(drawFrameTabWidget); } TEST_F(TestForDrawUtil, drawPrimitiveIndicatorItemViewItemCheck) { class TestIndicatorItemViewItemCheckDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawNoChangeStateItemViewItemCheck() { QStyleOption option; option.initFrom(testWidget()); option.state |= QStyle::State_NoChange; style()->drawPrimitive(QStyle::PE_IndicatorItemViewItemCheck, &option, painter(), testWidget()); } void testDrawOnStateItemViewItemCheck() { QStyleOption option; option.initFrom(testWidget()); option.state |= (QStyle::State_On | QStyle::State_Enabled); style()->drawPrimitive(QStyle::PE_IndicatorItemViewItemCheck, &option, painter(), testWidget()); } void testDrawOffStateAndNoUncheckedItemViewItemCheck() { QStyleOption option; option.initFrom(testWidget()); option.state |= QStyle::State_Off; option.state &= ~QStyle::State_On; style()->drawPrimitive(QStyle::PE_IndicatorItemViewItemCheck, &option, painter(), testWidget()); } void testDrawOffStateAndHasUncheckedItemViewItemCheck() { QStyleOption option; option.initFrom(testWidget()); option.state |= QStyle::State_Off; option.state &= ~QStyle::State_On; testWidget()->setProperty("_d_dtk_UncheckedItemIndicator", true); style()->drawPrimitive(QStyle::PE_IndicatorItemViewItemCheck, &option, painter(), testWidget()); } }; INIT_TESTWIDGET(QWidget); TestIndicatorItemViewItemCheckDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawNoChangeStateItemViewItemCheck); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawOnStateItemViewItemCheck); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawOffStateAndNoUncheckedItemViewItemCheck); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawOffStateAndHasUncheckedItemViewItemCheck); } TEST_F(TestForDrawUtil, drawPrimitivePanelMenu) { auto drawPanelMenuUtilWithValidWindowColor = [&]() { QStyleOption option; option.initFrom(testWidget); ASSERT_TRUE(option.palette.window().color().isValid()); style->drawPrimitive(QStyle::PE_PanelMenu, &option, painter, testWidget); }; INIT_TESTWIDGET(QWidget); ASSERT_DrawFuncHasData(drawPanelMenuUtilWithValidWindowColor); } TEST_F(TestForDrawUtil, drawPrimitiveFrame) { auto drawFrameUtil = [&]() { QStyleOptionFrame option; option.initFrom(testWidget); option.features |= QStyleOptionFrame::Rounded; option.lineWidth = 1; style->drawPrimitive(QStyle::PE_Frame, &option, painter, testWidget); }; auto drawFrameUtilWithNoLine = [&]() { QStyleOptionFrame option; option.initFrom(testWidget); option.features |= QStyleOptionFrame::Rounded; option.lineWidth = 0; painter->setBackground(option.palette.background()); style->drawPrimitive(QStyle::PE_Frame, &option, painter, testWidget); }; INIT_TESTWIDGET(QFrame); ASSERT_DrawFuncHasData(drawFrameUtil); ASSERT_DrawFuncHasData(drawFrameUtilWithNoLine); } TEST_F(TestForDrawUtil, drawPrimitivePanelTipLabel) { // PE_PanelTipLabel return directly. auto drawPanelTipLabel = [&]() { style->drawPrimitive(QStyle::PE_PanelTipLabel, nullptr, nullptr, nullptr); }; ASSERT_DrawFuncNoData(drawPanelTipLabel); } TEST_F(TestForDrawUtil, drawPrimitiveFrameGroupBox) { auto drawFrameGroupBoxFlatFeature = [&]() { QStyleOptionFrame option; option.initFrom(testWidget); option.features |= QStyleOptionFrame::Flat; // Flat feature return directly. style->drawPrimitive(QStyle::PE_FrameGroupBox, &option, painter, testWidget); }; auto drawFrameNormalFrameGroupBox = [&]() { QStyleOption option; option.initFrom(testWidget); style->drawPrimitive(QStyle::PE_FrameGroupBox, &option, painter, testWidget); }; INIT_TESTWIDGET(QFrame); ASSERT_DrawFuncNoData(drawFrameGroupBoxFlatFeature); INIT_TESTWIDGET(QGroupBox); ASSERT_DrawFuncHasData(drawFrameNormalFrameGroupBox); } TEST_F(TestForDrawUtil, drawPrimitiveIndicatorArrowRightAndLeft) { auto drawIndicatorArrowRightUtil = [&]() { QStyleOption option; option.initFrom(testWidget); style->drawPrimitive(QStyle::PE_IndicatorArrowRight, &option, painter, testWidget); }; auto drawIndicatorArrowLeftUtil = [&]() { QStyleOption option; option.initFrom(testWidget); style->drawPrimitive(QStyle::PE_IndicatorArrowLeft, &option, painter, testWidget); }; INIT_TESTWIDGET(QWidget); ASSERT_DrawFuncHasData(drawIndicatorArrowRightUtil); ASSERT_DrawFuncHasData(drawIndicatorArrowLeftUtil); } TEST_F(TestForDrawUtil, drawPrimitiveFrameTabBarBase) { auto drawFrameTabBarBaseUtil = [&]() { // Only return directly. style->drawPrimitive(QStyle::PE_FrameTabBarBase, nullptr, nullptr, nullptr); }; ASSERT_DrawFuncNoData(drawFrameTabBarBaseUtil); } TEST_F(TestForDrawUtil, drawPrimitiveIndicatorBranch) { class TestIndicatorBranchDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawChildrenSelectedStateUtil() { QStyleOption option; option.initFrom(testWidget()); option.state |= QStyle::State_Children | QStyle::State_Selected; option.state &= ~QStyle::State_Open; style()->drawPrimitive(QStyle::PE_IndicatorBranch, &option, painter(), testWidget()); } void testDrawChildrenStateUtil() { QStyleOption option; option.initFrom(testWidget()); option.state |= QStyle::State_Children; option.state &= ~QStyle::State_Open; style()->drawPrimitive(QStyle::PE_IndicatorBranch, &option, painter(), testWidget()); } void testDrawChildrenOpenSelectedStateUtil() { QStyleOption option; option.initFrom(testWidget()); option.state |= QStyle::State_Children | QStyle::State_Open | QStyle::State_Selected; style()->drawPrimitive(QStyle::PE_IndicatorBranch, &option, painter(), testWidget()); } void testDrawChildrenOpenStateUtil() { QStyleOption option; option.initFrom(testWidget()); option.state |= QStyle::State_Children | QStyle::State_Open; style()->drawPrimitive(QStyle::PE_IndicatorBranch, &option, painter(), testWidget()); } }; INIT_TESTWIDGET(QTreeView); TestIndicatorBranchDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawChildrenSelectedStateUtil); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawChildrenStateUtil); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawChildrenOpenSelectedStateUtil); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawChildrenOpenStateUtil); } TEST_F(TestForDrawUtil, drawPrimitivePanelItemViewRow) { class TestPanelItemViewRowDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawPanelItemViewInQCalendarWidget() { QWidget *tableView = testWidget()->findChild("qt_calendar_calendarview"); ASSERT_TRUE(tableView); QStyleOption option; option.initFrom(tableView); style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &option, painter(), tableView); } void testDrawPanelItemViewActiveQTreeView() { QTreeView *treeView = qobject_cast(testWidget()); ASSERT_TRUE(treeView); QStyleOptionViewItem option; option.initFrom(treeView); option.state |= QStyle::State_Enabled | QStyle::State_Active; style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &option, painter(), treeView); } void testDrawPanelItemViewInactiveEndQTreeView() { QTreeView *treeView = qobject_cast(testWidget()); ASSERT_TRUE(treeView); QStyleOptionViewItem option; option.initFrom(treeView); option.state |= (QStyle::State_Enabled | QStyle::State_Selected | QStyle::State_MouseOver); option.state &= ~QStyle::State_Active; option.viewItemPosition = QStyleOptionViewItem::End; style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &option, painter(), treeView); } void testDrawPanelItemViewInactiveValidQTreeView() { QTreeView *treeView = qobject_cast(testWidget()); ASSERT_TRUE(treeView); QStyleOptionViewItem option; option.initFrom(treeView); option.state |= (QStyle::State_Enabled | QStyle::State_Selected | QStyle::State_MouseOver); option.state &= ~QStyle::State_Active; option.viewItemPosition = QStyleOptionViewItem::Middle; style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &option, painter(), treeView); } void testDrawPanelItemViewInactiveAlternateQTreeView() { QTreeView *treeView = qobject_cast(testWidget()); ASSERT_TRUE(treeView); QStyleOptionViewItem option; option.initFrom(treeView); option.state |= QStyle::State_Enabled; option.state &= ~QStyle::State_Active; option.features |= QStyleOptionViewItem::Alternate; option.viewItemPosition = QStyleOptionViewItem::Middle; style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &option, painter(), treeView); } void testDrawQListViewPanelItemRow() { QListView *listView = qobject_cast(testWidget()); ASSERT_TRUE(listView); QStyleOptionViewItem option; option.initFrom(listView); option.state |= QStyle::State_Enabled; option.features |= QStyleOptionViewItem::Alternate; option.viewItemPosition = QStyleOptionViewItem::Middle; style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &option, painter(), listView); } }; INIT_TESTWIDGET(QCalendarWidget); TestPanelItemViewRowDrawUtil drawUtilInstance(this); ASSERT_DrawFuncNoData(drawUtilInstance.testDrawPanelItemViewInQCalendarWidget); INIT_TESTWIDGET(QTreeView); ASSERT_DrawFuncNoData(drawUtilInstance.testDrawPanelItemViewActiveQTreeView); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawPanelItemViewInactiveEndQTreeView); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawPanelItemViewInactiveValidQTreeView); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawPanelItemViewInactiveAlternateQTreeView); INIT_TESTWIDGET(QListView); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawQListViewPanelItemRow); } TEST_F(TestForDrawUtil, drawPrimitiveFrameStatusBarItem) { auto drawStatusbarItemUtil = [&]() { // return directly style->drawPrimitive(QStyle::PE_FrameStatusBarItem, nullptr, nullptr, nullptr); }; ASSERT_DrawFuncNoData(drawStatusbarItemUtil); } TEST_F(TestForDrawUtil, drawPrimitivePanelStatusBar) { auto drawPanelStatusBarUtil = [&]() { QStyleOption option; option.initFrom(testWidget); style->drawPrimitive(QStyle::PE_PanelStatusBar, &option, painter, testWidget); }; INIT_TESTWIDGET(QStatusBar); ASSERT_DrawFuncHasData(drawPanelStatusBarUtil); } TEST_F(TestForDrawUtil, drawControlCheckBoxAndRadioButton) { class TestCheckBoxAndRadioButtonDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawCheckBoxUtil() { QStyleOptionButton option; option.initFrom(testWidget()); option.state |= QStyle::State_HasFocus; option.text = "test 1"; option.features |= QStyleOptionButton::DefaultButton; style()->drawControl(QStyle::CE_CheckBox, &option, painter(), testWidget()); } void testDrawRadioButtonUtil() { QStyleOptionButton option; option.initFrom(testWidget()); option.state |= QStyle::State_HasFocus; option.text = "test 1"; style()->drawControl(QStyle::CE_RadioButton, &option, painter(), testWidget()); } }; TestCheckBoxAndRadioButtonDrawUtil drawUtilInstance(this); INIT_TESTWIDGET(QCheckBox); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawCheckBoxUtil); INIT_TESTWIDGET(QRadioButton); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawRadioButtonUtil); } TEST_F(TestForDrawUtil, drawControlScrollBarSlider) { class TestScrollBarSliderDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawNormalScrollBarSlider() { QStyleOptionSlider option; option.initFrom(testWidget()); option.state |= QStyle::State_Horizontal | QStyle::State_MouseOver; option.state |= QStyle::QStyle::State_MouseOver; style()->drawControl(QStyle::CE_ScrollBarSlider, &option, painter(), testWidget()); } void testDrawNormalVerticalScrollBarSlider() { QStyleOptionSlider option; option.initFrom(testWidget()); option.state |= QStyle::QStyle::State_MouseOver; style()->drawControl(QStyle::CE_ScrollBarSlider, &option, painter(), testWidget()); } void testDrawHorizontalSliderWithSpaceProperty() { QStyleOptionSlider option; option.initFrom(testWidget()); option.state |= QStyle::State_Horizontal; option.state |= QStyle::QStyle::State_MouseOver; testWidget()->setProperty("_d_slider_spaceLeft", 10); testWidget()->setProperty("_d_slider_spaceRight", 10); testWidget()->setProperty("_d_slider_spaceUp", 10); testWidget()->setProperty("_d_slider_spaceDown", 10); style()->drawControl(QStyle::CE_ScrollBarSlider, &option, painter(), testWidget()); } void testDrawVerticalSliderWithSpaceProperty() { QStyleOptionSlider option; option.initFrom(testWidget()); option.state |= (QStyle::State_MouseOver | QStyle::State_Sunken); style()->drawControl(QStyle::CE_ScrollBarSlider, &option, painter(), testWidget()); } }; INIT_TESTWIDGET(QScrollBar); TestScrollBarSliderDrawUtil drawUtilInstance(this); QScrollBar *bar = qobject_cast (drawUtilInstance.testWidget()); bar->setProperty("_d_dtk_slider_always_show", true); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawNormalScrollBarSlider); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawNormalVerticalScrollBarSlider); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawHorizontalSliderWithSpaceProperty); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawVerticalSliderWithSpaceProperty); } TEST_F(TestForDrawUtil, drawControlMenuBarItem) { auto drawMenuBarItemUtil = [&]() { QStyleOptionMenuItem option; option.initFrom(testWidget); option.menuItemType = QStyleOptionMenuItem::Margin; option.checkType = QStyleOptionMenuItem::Exclusive; option.text = "test 1"; option.icon = style->standardIcon(QStyle::SP_DirIcon); option.menuRect = QRect(20, 20, 60, 40); option.maxIconWidth = 20; option.tabWidth = 2; style->drawControl(QStyle::CE_MenuBarItem, &option, painter, testWidget); }; INIT_TESTWIDGET(QWidget); ASSERT_DrawFuncHasData(drawMenuBarItemUtil); } TEST_F(TestForDrawUtil, drawControlMenuItem) { auto drawNormalMenuItemUtil = [&]() { QStyleOptionMenuItem opt; opt.init(testWidget); opt.menuItemType = QStyleOptionMenuItem::Normal; style->drawControl(QStyle::CE_MenuItem, &opt, painter, testWidget); }; INIT_TESTWIDGET(QWidget); ASSERT_DrawFuncHasData(drawNormalMenuItemUtil); } TEST_F(TestForDrawUtil, drawControlPushButtonAndBevel) { class TestPushButtonAndBevelUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawFocusPushButtonUtil() { QStyleOptionButton option; option.initFrom(testWidget()); option.state |= QStyle::State_HasFocus; option.text = "test 1"; style()->drawControl(QStyle::CE_PushButton, &option, painter(), testWidget()); } void testDrawPushButtonBevelDefaultButton() { QStyleOptionButton option; option.initFrom(testWidget()); option.features |= QStyleOptionButton::DefaultButton; option.text = "test 2"; style()->drawControl(QStyle::CE_PushButtonBevel, &option, painter(), testWidget()); } void testDrawPushButtonBevelAutoDefaultButton() { QStyleOptionButton option; option.initFrom(testWidget()); option.features |= QStyleOptionButton::AutoDefaultButton; option.text = "test 3"; style()->drawControl(QStyle::CE_PushButtonBevel, &option, painter(), testWidget()); } }; INIT_TESTWIDGET(QPushButton); TestPushButtonAndBevelUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawFocusPushButtonUtil); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawPushButtonBevelDefaultButton); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawPushButtonBevelAutoDefaultButton); } TEST_F(TestForDrawUtil, drawControlTabBarTab) { class TestTabBarTabDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawTabBarTabShapeUtil() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= (QStyle::State_Selected | QStyle::State_Enabled); tab.shape = QTabBar::RoundedEast; tab.position = QStyleOptionTab::OnlyOneTab; tab.selectedPosition = QStyleOptionTab::NotAdjacent; tab.cornerWidgets = QStyleOptionTab::NoCornerWidgets; tab.text = "test 1"; style()->drawControl(QStyle::CE_TabBarTabShape, &tab, painter(), testWidget()); } void testDrawTabBarTabLabelUtil() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= (QStyle::State_Selected | QStyle::State_Enabled); tab.shape = QTabBar::RoundedEast; tab.position = QStyleOptionTab::Beginning; tab.selectedPosition = QStyleOptionTab::NotAdjacent; tab.cornerWidgets = QStyleOptionTab::NoCornerWidgets; tab.text = "test 2"; style()->drawControl(QStyle::CE_TabBarTabLabel, &tab, painter(), testWidget()); } void testDrawTabBarTabHorizontalSelectedUtil() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= (QStyle::State_Selected | QStyle::State_Enabled); tab.shape = QTabBar::RoundedNorth; tab.position = QStyleOptionTab::Middle; tab.selectedPosition = QStyleOptionTab::NotAdjacent; tab.cornerWidgets = QStyleOptionTab::NoCornerWidgets; tab.text = "test 3"; style()->drawControl(QStyle::CE_TabBarTab, &tab, painter(), testWidget()); } void testDrawTabBarTabVerticalCheckedUtil() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= (QStyle::State_Selected | QStyle::State_Enabled); tab.shape = QTabBar::TriangularWest; tab.position = QStyleOptionTab::Beginning; tab.selectedPosition = QStyleOptionTab::NotAdjacent; tab.cornerWidgets = QStyleOptionTab::NoCornerWidgets; tab.text = "test 4"; testWidget()->setProperty("_d_dtk_tabbartab_type", true); style()->drawControl(QStyle::CE_TabBarTab, &tab, painter(), testWidget()); } void testDrawTabBarTabVerticalCheckedAndOffStateUtil() { QStyleOptionTab tab; tab.init(testWidget()); tab.state |= QStyle::State_Enabled; tab.shape = QTabBar::RoundedSouth; tab.position = QStyleOptionTab::Beginning; tab.selectedPosition = QStyleOptionTab::NotAdjacent; tab.cornerWidgets = QStyleOptionTab::NoCornerWidgets; tab.text = "test 4"; testWidget()->setProperty("_d_dtk_tabbartab_type", true); style()->drawControl(QStyle::CE_TabBarTab, &tab, painter(), testWidget()); } }; INIT_TESTWIDGET(QTabBar); TestTabBarTabDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawTabBarTabShapeUtil); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawTabBarTabLabelUtil); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawTabBarTabHorizontalSelectedUtil); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawTabBarTabVerticalCheckedUtil); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawTabBarTabVerticalCheckedAndOffStateUtil); } TEST_F(TestForDrawUtil, drawControlRubberBand) { auto drawRunnerBandUtil = [&]() { QStyleOptionRubberBand option; option.initFrom(testWidget); style->drawControl(QStyle::CE_RubberBand, &option, painter, testWidget); }; INIT_TESTWIDGET(QWidget); ASSERT_DrawFuncHasData(drawRunnerBandUtil); } TEST_F(TestForDrawUtil, drawControlHeader) { auto drawHeaderUtil = [&]() { QStyleOptionHeader header; header.initFrom(testWidget); header.sortIndicator = QStyleOptionHeader::SortUp; style->drawControl(QStyle::CE_Header, &header, painter, testWidget); }; INIT_TESTWIDGET(QHeaderView(Qt::Horizontal)); ASSERT_DrawFuncHasData(drawHeaderUtil); } TEST_F(TestForDrawUtil, drawShapedFrameUtil) { class TestShapedFrameDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testBoxPlainShapedFrame() { QStyleOptionFrame option; option.initFrom(testWidget()); option.frameShape = QFrame::Box; option.lineWidth = 3; option.midLineWidth = 2; style()->drawControl(QStyle::CE_ShapedFrame, &option, painter(), testWidget()); } void testBoxSunkenShapedFrame() { QStyleOptionFrame option; option.initFrom(testWidget()); option.state = QStyle::State_Sunken; option.frameShape = QFrame::Box; option.lineWidth = 2; option.midLineWidth = 3; style()->drawControl(QStyle::CE_ShapedFrame, &option, painter(), testWidget()); } void testBoxRaisedShapedFrame() { QStyleOptionFrame option; option.initFrom(testWidget()); option.state = QStyle::State_Raised; option.frameShape = QFrame::Box; option.lineWidth = 2; option.midLineWidth = 3; style()->drawControl(QStyle::CE_ShapedFrame, &option, painter(), testWidget()); } void testStyledPanelShapedFrame() { QStyleOptionFrame option; option.initFrom(testWidget()); option.frameShape = QFrame::StyledPanel; option.lineWidth = 2; option.midLineWidth = 3; style()->drawControl(QStyle::CE_ShapedFrame, &option, painter(), testWidget()); } void testStyledPanelSunkenFrame() { QStyleOptionFrame option; option.initFrom(testWidget()); option.state = QStyle::State_Sunken; option.frameShape = QFrame::StyledPanel; option.lineWidth = 2; option.midLineWidth = 3; style()->drawControl(QStyle::CE_ShapedFrame, &option, painter(), nullptr); } void testPanelPlainFrame() { QStyleOptionFrame option; option.initFrom(testWidget()); option.frameShape = QFrame::Panel; option.lineWidth = 2; option.midLineWidth = 3; style()->drawControl(QStyle::CE_ShapedFrame, &option, painter(), testWidget()); } void testPanelSunkenFrame() { QStyleOptionFrame option; option.initFrom(testWidget()); option.state = QStyle::State_Sunken; option.frameShape = QFrame::Panel; option.lineWidth = 2; option.midLineWidth = 3; style()->drawControl(QStyle::CE_ShapedFrame, &option, painter(), testWidget()); } void testWinPanelSunkenFrame() { QStyleOptionFrame option; option.initFrom(testWidget()); option.state = QStyle::State_Sunken; option.frameShape = QFrame::WinPanel; option.lineWidth = 2; option.midLineWidth = 3; style()->drawControl(QStyle::CE_ShapedFrame, &option, painter(), testWidget()); } void testWinPanelPlainFrame() { QStyleOptionFrame option; option.initFrom(testWidget()); option.frameShape = QFrame::WinPanel; option.lineWidth = 2; option.midLineWidth = 3; style()->drawControl(QStyle::CE_ShapedFrame, &option, painter(), testWidget()); } void testHLinePlainFrame() { QStyleOptionFrame option; option.initFrom(testWidget()); option.frameShape = QFrame::HLine; option.lineWidth = 2; option.midLineWidth = 3; style()->drawControl(QStyle::CE_ShapedFrame, &option, painter(), testWidget()); } void testVLineSunkenFrame() { QStyleOptionFrame option; option.initFrom(testWidget()); option.state = QStyle::State_Sunken; option.frameShape = QFrame::VLine; option.lineWidth = 2; option.midLineWidth = 3; style()->drawControl(QStyle::CE_ShapedFrame, &option, painter(), testWidget()); } }; INIT_TESTWIDGET(QFrame); TestShapedFrameDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testBoxPlainShapedFrame); ASSERT_DrawFuncHasData(drawUtilInstance.testBoxSunkenShapedFrame); ASSERT_DrawFuncHasData(drawUtilInstance.testBoxRaisedShapedFrame); ASSERT_DrawFuncHasData(drawUtilInstance.testStyledPanelShapedFrame); ASSERT_DrawFuncHasData(drawUtilInstance.testStyledPanelSunkenFrame); ASSERT_DrawFuncHasData(drawUtilInstance.testPanelPlainFrame); ASSERT_DrawFuncHasData(drawUtilInstance.testPanelSunkenFrame); ASSERT_DrawFuncHasData(drawUtilInstance.testWinPanelSunkenFrame); ASSERT_DrawFuncHasData(drawUtilInstance.testWinPanelPlainFrame); ASSERT_DrawFuncHasData(drawUtilInstance.testHLinePlainFrame); ASSERT_DrawFuncHasData(drawUtilInstance.testVLineSunkenFrame); } TEST_F(TestForDrawUtil, drawControlComboBoxLabel) { auto drawComboBoxLabelUtil = [&]() { QStyleOptionComboBox option; option.initFrom(testWidget); option.currentText = "test 1"; style->drawControl(QStyle::CE_ComboBoxLabel, &option, painter, testWidget); }; INIT_TESTWIDGET(QComboBox); ASSERT_DrawFuncHasData(drawComboBoxLabelUtil); } TEST_F(TestForDrawUtil, drawControlPushButtonLabel) { class TestPushButtonLabelDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawWarningButtonLabel() { QStyleOptionButton option; option.initFrom(testWidget()); option.features |= QStyleOptionButton::ButtonFeature(DStyleOptionButton::WarningButton); option.text = "test 1"; option.icon = style()->standardIcon(QStyle::SP_FileIcon); option.direction = Qt::RightToLeft; option.state |= QStyle::State_On | QStyle::State_Sunken; option.features |= QStyleOptionButton::HasMenu; style()->drawControl(QStyle::CE_PushButtonLabel, &option, painter(), testWidget()); } void testDrawSuggestButtonLabel() { QStyleOptionButton option; option.initFrom(testWidget()); option.features |= QStyleOptionButton::ButtonFeature(DStyleOptionButton::SuggestButton); option.text = "test 1"; option.icon = style()->standardIcon(QStyle::SP_FileIcon); option.direction = Qt::LeftToRight; option.state |= QStyle::State_On | QStyle::State_Sunken; option.features |= QStyleOptionButton::HasMenu; style()->drawControl(QStyle::CE_PushButtonLabel, &option, painter(), testWidget()); } }; INIT_TESTWIDGET(QPushButton); TestPushButtonLabelDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawWarningButtonLabel); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawSuggestButtonLabel); } TEST_F(TestForDrawUtil, drawControlProgressBar) { class TestProgressBarDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawHorizontalProgressBar() { QStyleOptionProgressBar option; option.initFrom(testWidget()); option.orientation = Qt::Horizontal; option.progress = 80; option.minimum = 0; option.maximum = 100; style()->drawControl(QStyle::CE_ProgressBar, &option, painter(), testWidget()); } void testVerticalProgressBar() { QStyleOptionProgressBar option; option.initFrom(testWidget()); option.orientation = Qt::Vertical; option.progress = 50; option.minimum = 0; option.maximum = 100; style()->drawControl(QStyle::CE_ProgressBar, &option, painter(), testWidget()); } }; INIT_TESTWIDGET(QProgressBar); TestProgressBarDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawHorizontalProgressBar); ASSERT_DrawFuncHasData(drawUtilInstance.testVerticalProgressBar); } TEST_F(TestForDrawUtil, drawControlProgressBarGroove) { class TestProgressBarGrooveDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testProgressBarGrooveUtil() { QStyleOptionProgressBar option; option.initFrom(testWidget()); option.orientation = Qt::Horizontal; option.progress = 50; option.minimum = 0; option.maximum = 100; style()->drawControl(QStyle::CE_ProgressBarGroove, &option, painter(), testWidget()); } }; INIT_TESTWIDGET(QProgressBar); TestProgressBarGrooveDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testProgressBarGrooveUtil); } TEST_F(TestForDrawUtil, drawControlProgressBarContents) { class TestProgressBarContentsDrawUtil : public TestDrawUtilIntegration { public: using TestDrawUtilIntegration::TestDrawUtilIntegration; void testDrawProgressBarTextVisibleUtl() { QStyleOptionProgressBar option; option.initFrom(testWidget()); option.orientation = Qt::Horizontal; option.progress = 50; option.minimum = 0; option.maximum = 100; option.textVisible = true; option.text = "test 1"; style()->drawControl(QStyle::CE_ProgressBarContents, &option, painter(), testWidget()); } void testDrawProgressBarUtl() { QStyleOptionProgressBar option; option.initFrom(testWidget()); option.orientation = Qt::Horizontal; option.progress = 100; option.minimum = 0; option.maximum = 100; option.rect = QRect(0, 0, 6, 4); style()->drawControl(QStyle::CE_ProgressBarContents, &option, painter(), testWidget()); } void testDrawCenterProgressBarLabel() { QStyleOptionProgressBar option; option.initFrom(testWidget()); option.orientation = Qt::Horizontal; option.progress = 50; option.minimum = 0; option.maximum = 100; option.rect = QRect(0, 0, 80, 40); option.text = "test 2"; option.fontMetrics = testWidget()->fontMetrics(); option.textAlignment = Qt::AlignCenter; style()->drawControl(QStyle::CE_ProgressBarLabel, &option, painter(), testWidget()); } void testDrawRightProgressBarLabel() { QStyleOptionProgressBar option; option.initFrom(testWidget()); option.orientation = Qt::Horizontal; option.progress = 10; option.minimum = 0; option.maximum = 100; option.rect = QRect(0, 0, 80, 40); option.text = "test 3"; option.textAlignment = Qt::AlignRight; style()->drawControl(QStyle::CE_ProgressBarLabel, &option, painter(), testWidget()); } void testDrawLeftProgressBarLabel() { QStyleOptionProgressBar option; option.initFrom(testWidget()); option.orientation = Qt::Horizontal; option.progress = 90; option.minimum = 0; option.maximum = 100; option.rect = QRect(0, 0, 80, 40); option.text = "test 4"; option.textAlignment = Qt::AlignLeft; style()->drawControl(QStyle::CE_ProgressBarLabel, &option, painter(), testWidget()); } }; INIT_TESTWIDGET(QProgressBar); TestProgressBarContentsDrawUtil drawUtilInstance(this); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawProgressBarTextVisibleUtl); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawProgressBarUtl); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawCenterProgressBarLabel); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawRightProgressBarLabel); ASSERT_DrawFuncHasData(drawUtilInstance.testDrawLeftProgressBarLabel); } qt5integration-5.5.23/tests/styleplugins/styleplugins.pri000066400000000000000000000000471424734202100237450ustar00rootroot00000000000000include($$PWD/chameleon/chameleon.pri) qt5integration-5.5.23/tests/test-recoverage-qmake.sh000077500000000000000000000017401424734202100224600ustar00rootroot00000000000000#!/bin/bash set -e BUILD_DIR=`pwd`/../build-ut HTML_DIR=${BUILD_DIR}/html XML_DIR=${BUILD_DIR}/report cd ../ rm -rf $BUILD_DIR mkdir $BUILD_DIR cd $BUILD_DIR qmake ../ CONFIG+=debug BASED_DTK_DIR=based-dtk make -j$(nproc) cd ../tests/ rm -rf $BUILD_DIR mkdir $BUILD_DIR cd $BUILD_DIR qmake ../ CONFIG+=debug BASED_DTK_DIR=based-dtk export ASAN_OPTIONS=halt_on_error=0 TESTARGS="--gtest_output=xml:${XML_DIR}/report_qt5integration.xml" make check -j$(nproc) lcov -d ./ -c -o coverage_all.info #lcov --extract coverage_all.info $EXTRACT_ARGS --output-file coverage.info lcov --remove coverage_all.info "*/tests/*" "*/usr/include*" "*build-ut/src*" --output-file coverage.info cd .. genhtml -o $HTML_DIR $BUILD_DIR/coverage.info && mv ${BUILD_DIR}/html/index.html ${BUILD_DIR}/html/cov_qt5integration.html test -e ${BUILD_DIR}/asan.log* && mv ${BUILD_DIR}/asan.log* ${BUILD_DIR}/asan_qt5integration.log || touch ${BUILD_DIR}/asan_qt5integration.log #rm -rf $BUILD_DIR #rm -rf ../$BUILD_DIR qt5integration-5.5.23/tests/tests.pro000066400000000000000000000026271424734202100176170ustar00rootroot00000000000000TEMPLATE = app QT += dtkgui$${DTK_VERSION} concurrent dtkwidget$${DTK_VERSION} CONFIG -= app_bundle unix:LIBS += -lgtest QMAKE_CXXFLAGS += -fno-access-control QMAKE_LFLAGS += -fno-access-control CONFIG(debug, debug|release) { LIBS += -lgtest -lgmock 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 } include($$PWD/iconengines/iconengines.pri) include($$PWD/styleplugins/styleplugins.pri) include($$PWD/imageformats/imageformats.pri) DEFINES += UT_PLATFORMPLUGIN_PATH=\\\"$${PWD}/../bin/plugins/platformthemes/\\\" export(UT_PLATFORMPLUGIN_PATH) HEADERS += \ $$PWD/../iconengineplugins/builtinengine/dbuiltiniconengine.h \ $$PWD/../iconengineplugins/svgiconengine/qsvgiconengine.h \ $$PWD/../imageformatplugins/svg/qsvgiohandler.h \ $$PWD/../styleplugins/chameleon/chameleonstyle.h \ $$PWD/../styleplugins/chameleon/common.h \ SOURCES += \ $$PWD/../iconengineplugins/builtinengine/dbuiltiniconengine.cpp \ $$PWD/../iconengineplugins/svgiconengine/qsvgiconengine.cpp \ $$PWD/../imageformatplugins/svg/qsvgiohandler.cpp \ $$PWD/../styleplugins/chameleon/chameleonstyle.cpp \ SOURCES += \ $$PWD/main.cpp load(dtk_testcase)