diff -Nru dtkdeclarative-5.6.3/archlinux/PKGBUILD dtkdeclarative-5.6.10/archlinux/PKGBUILD --- dtkdeclarative-5.6.3/archlinux/PKGBUILD 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/archlinux/PKGBUILD 2023-04-17 09:55:26.000000000 +0000 @@ -2,29 +2,38 @@ pkgname=dtkdeclarative-git pkgver=1.0.0 pkgrel=1 +sourcename=dtkdeclarative +sourcetars=("$sourcename"_"$pkgver".tar.xz) +sourcedir="$sourcename" pkgdesc='Deepin Toolkit, declarative module for DDE look and feel' arch=('x86_64' 'aarch64') url="https://github.com/linuxdeepin/dtkdeclarative" license=('LGPL3') -depends=('dtkgui-git' 'qt5-declarative' 'qt5-quickcontrols2') -makedepends=('git' 'qt5-tools' 'dtkcommon-git' 'dtkcore-git' 'dtkgui-git' 'qt5-declarative' 'qt5-quickcontrols2' 'gtest' 'gmock') +depends=('qt5-declarative' 'qt5-quickcontrols2' 'dtkcommon-git' 'dtkcore-git' 'dtkgui-git') +makedepends=('git' 'qt5-tools' 'gtest' 'cmake' 'ninja' 'doxygen') conflicts=('dtkdeclarative') provides=('dtkdeclarative') groups=('deepin-git') -source=('source.tar.gz') +source=("${sourcetars[@]}") sha512sums=('SKIP') prepare() { - cd $deepin_source_name + cd $sourcedir } build() { - cd $deepin_source_name - qmake-qt5 PREFIX=/usr DTK_VERSION=$pkgver LIB_INSTALL_DIR=/usr/lib - make + cd $sourcedir + cmake -GNinja \ + -DMKSPECS_INSTALL_DIR=lib/qt/mkspecs/modules/\ + -DBUILD_DOCS=ON \ + -DBUILD_EXAMPLES=OFF \ + -DQCH_INSTALL_DESTINATION=share/doc/qt \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release } package() { - cd $deepin_source_name - make INSTALL_ROOT="$pkgdir" install + cd $sourcedir + DESTDIR="$pkgdir" ninja install } diff -Nru dtkdeclarative-5.6.3/chameleon/chameleon.pro dtkdeclarative-5.6.10/chameleon/chameleon.pro --- dtkdeclarative-5.6.3/chameleon/chameleon.pro 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/chameleon/chameleon.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -TEMPLATE = lib -# qtquickcompiler 是为qrc中的qml文件自动生成qmlc -CONFIG += plugin qtquickcompiler - -TARGET = qtquickcontrols2chameleonstyleplugin -TARGETPATH = QtQuick/Controls.2/Chameleon -DESTDIR = $$PWD/imports/Chameleon - -QT += qml quick quick-private dtkgui -qtHaveModule(quickcontrols2-private) { - QT += quickcontrols2-private - DEFINES += USE_QQuickStylePlugin -} - -unix: LIBS += -L$$OUT_PWD/../src -ldtkdeclarative - -CONFIG(debug, debug|release) { - unix: QMAKE_RPATHDIR += $$OUT_PWD/../src -} -INCLUDEPATH += $$PWD/../src - -include($$PWD/src/src.pri) -include($$PWD/imports/Chameleon/qml.pri) - -# Install *.so and qml files -unix { - target.path = $$[QT_INSTALL_QML]/$$TARGETPATH - - # Qmldir file and qml files - qmlfiles.base = $$_PRO_FILE_PWD_/imports/Chameleon - qmlfiles.files = $$JS_FILES $$QML_FILES - qmlfiles.path = $${target.path} - - qmldir.input += $${qmlfiles.base}/qmldir.in - # 改名回qmldir,本地的qmldir主要是用于examples项目直接加载本地chameleon主题,不要将它安装到系统中 - qmldir.output = $$OUT_PWD/qmldir - QMAKE_SUBSTITUTES += qmldir - qmlfiles.files += $$OUT_PWD/qmldir - - INSTALLS += target qmlfiles - OTHER_FILES += $${qmlfiles.base}/qmldir.in -} - -# 自动生成qmlc文件 -static { - message("QML cache generation ahead of time is not supported in static builds") - return() -} - -qtPrepareTool(QML_CACHEGEN, qmlcachegen, _ARCH_CHECK) - -isEmpty(TARGETPATH): error("Must set TARGETPATH (QML import name) for ahead-of-time QML cache generation") -# 将qmlc文件跟qml文件放到同一个路径下 -QMLCACHE_DESTDIR = ./ - -CACHEGEN_FILES= -qmlcacheinst.files = -for(qmlf, QML_FILES) { - contains(qmlf,.*\\.js$)|contains(qmlf,.*\\.qml$) { - CACHEGEN_FILES += $$absolute_path($$qmlf, $$_PRO_FILE_PWD_) - qmlcacheinst.files += $$QMLCACHE_DESTDIR/$$relative_path($$qmlf, $$_PRO_FILE_PWD_)c - } -} - -defineReplace(qmlCacheOutputFileName) { - return($$relative_path($$QMLCACHE_DESTDIR/$$relative_path($$1, $$_PRO_FILE_PWD_)c, $$OUT_PWD)) -} - -qmlcacheinst.base = $$QMLCACHE_DESTDIR -qmlcacheinst.path = $$[QT_INSTALL_QML]/$$TARGETPATH -qmlcacheinst.CONFIG = no_check_exist - -qmlcachegen.input = CACHEGEN_FILES -qmlcachegen.output = ${QMAKE_FUNC_FILE_IN_qmlCacheOutputFileName} -qmlcachegen.CONFIG = no_link target_predeps -qmlcachegen.commands = $$QML_CACHEGEN -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} -qmlcachegen.name = Generate QML Cache ${QMAKE_FILE_IN} -qmlcachegen.variable_out = GENERATED_FILES - -!debug_and_release|!build_all|CONFIG(release, debug|release) { - QMAKE_EXTRA_COMPILERS += qmlcachegen - INSTALLS += qmlcacheinst -} diff -Nru dtkdeclarative-5.6.3/chameleon/CMakeLists.txt dtkdeclarative-5.6.10/chameleon/CMakeLists.txt --- dtkdeclarative-5.6.3/chameleon/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/chameleon/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,68 @@ +set(PLUGIN_NAME qtquickcontrols2chameleonstyleplugin) +set(TARGETPATH "QtQuick/Controls.2/Chameleon") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/plugins/Chameleon") +set(PLUGIN_INSTALL_DIR "${QML_INSTALL_DIR}/${TARGETPATH}") + +find_package(DtkGui REQUIRED) +find_package(Qt5 COMPONENTS + Qml + QuickCompiler + Quick + QuickControls2 REQUIRED +) + +file(GLOB QML_FILES "imports/Chameleon/*.qml") +file(GLOB JS_FILES "imports/Chameleon/*.js") +file(GLOB SRC_FILES "src/*.h" "src/*.cpp") + +qtquick_compiler_add_resources(RESOURCES ${CMAKE_CURRENT_LIST_DIR}/imports/Chameleon/qml.qrc) + +add_library(${PLUGIN_NAME} SHARED + ${SRC_FILES} + ${RESOURCES} # imports/Chameleon/qml.qrc + ${QML_DIR} +) + +target_link_libraries(${PLUGIN_NAME} PRIVATE + Qt5::Qml + Qt5::Quick + Qt5::QuickControls2 +) + +if(USE_QQuickStylePluginPrivate) + target_link_libraries(${PLUGIN_NAME} PRIVATE + Qt5::QuickControls2Private + ) +endif() + +set(COMPILER "${_qt5Core_install_prefix}/bin/qmlcachegen") # Consider not to use Qt private variable +set(QMLC_FILES) +foreach(QML_FILE ${QML_FILES}) + get_filename_component(EXTENSION ${QML_FILE} EXT) + if(EXTENSION STREQUAL ".qml" OR EXTENSION STREQUAL ".js" OR EXTENSION STREQUAL ".ui.qml") + set(OUTPUT_FILE "${QML_FILE}c") + execute_process(COMMAND ${COMPILER} ${QML_FILE} -o ${OUTPUT_FILE}) + list(APPEND QMLC_FILES ${OUTPUT_FILE}) + endif() +endforeach() + +set(QML_DIR "${CMAKE_CURRENT_BINARY_DIR}/qmldir") +configure_file("${CMAKE_CURRENT_LIST_DIR}/imports/Chameleon/qmldir.in" "${QML_DIR}" @ONLY) +set(OUT_QML_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/qmldir") +# copy qmldir +add_custom_command(TARGET ${PLUGIN_NAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E + copy_if_different + "${QML_DIR}" #in-file + "${OUT_QML_DIR}" #out-file +) + +install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR}) +install(FILES + ${QML_DIR} + ${JS_FILES} + ${QML_FILES} + ${QMLC_FILES} + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff -Nru dtkdeclarative-5.6.3/chameleon/imports/Chameleon/qmldir.in dtkdeclarative-5.6.10/chameleon/imports/Chameleon/qmldir.in --- dtkdeclarative-5.6.3/chameleon/imports/Chameleon/qmldir.in 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/chameleon/imports/Chameleon/qmldir.in 2023-04-17 09:55:26.000000000 +0000 @@ -1,4 +1,4 @@ module QtQuick.Controls.Chameleon -plugin $${TARGET} +plugin @PLUGIN_NAME@ classname QtQuickControls2ChameleonStylePlugin -depends QtQuick.Controls 2.4 \ No newline at end of file +depends QtQuick.Controls 2.4 diff -Nru dtkdeclarative-5.6.3/chameleon/imports/Chameleon/qml.pri dtkdeclarative-5.6.10/chameleon/imports/Chameleon/qml.pri --- dtkdeclarative-5.6.3/chameleon/imports/Chameleon/qml.pri 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/chameleon/imports/Chameleon/qml.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -JS_FILES += \ - $$PWD/PixelMetric.js - -QML_FILES += \ - $$PWD/ScrollBar.qml \ - $$PWD/BusyIndicator.qml \ - $$PWD/CheckBox.qml \ - $$PWD/RadioButton.qml \ - $$PWD/Switch.qml \ - $$PWD/Slider.qml \ - $$PWD/ToolTip.qml \ - $$PWD/ProgressBar.qml \ - $$PWD/PageIndicator.qml \ - $$PWD/ItemDelegate.qml \ - $$PWD/StackView.qml \ - $$PWD/ComboBox.qml \ - $$PWD/RoundButton.qml \ - $$PWD/GroupBox.qml \ - $$PWD/Frame.qml \ - $$PWD/MenuSeparator.qml \ - $$PWD/MenuItem.qml \ - $$PWD/Menu.qml \ - $$PWD/ApplicationWindow.qml \ - $$PWD/Button.qml \ - $$PWD/CheckDelegate.qml \ - $$PWD/DelayButton.qml \ - $$PWD/Dial.qml \ - $$PWD/DialogButtonBox.qml \ - $$PWD/TextField.qml \ - $$PWD/TextArea.qml \ - $$PWD/SpinBox.qml \ - $$PWD/Control.qml \ - $$PWD/ScrollIndicator.qml \ - $$PWD/Popup.qml \ - $$PWD/Pane.qml \ diff -Nru dtkdeclarative-5.6.3/chameleon/imports/Chameleon/qml.qrc dtkdeclarative-5.6.10/chameleon/imports/Chameleon/qml.qrc --- dtkdeclarative-5.6.3/chameleon/imports/Chameleon/qml.qrc 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/chameleon/imports/Chameleon/qml.qrc 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,36 @@ + + + ApplicationWindow.qml + BusyIndicator.qml + Button.qml + CheckBox.qml + CheckDelegate.qml + ComboBox.qml + Control.qml + DelayButton.qml + DialogButtonBox.qml + Dial.qml + Frame.qml + GroupBox.qml + ItemDelegate.qml + MenuItem.qml + Menu.qml + MenuSeparator.qml + PageIndicator.qml + Pane.qml + Popup.qml + ProgressBar.qml + RadioButton.qml + RoundButton.qml + ScrollBar.qml + ScrollIndicator.qml + Slider.qml + SpinBox.qml + StackView.qml + Switch.qml + TextArea.qml + TextField.qml + ToolTip.qml + PixelMetric.js + + diff -Nru dtkdeclarative-5.6.3/chameleon/src/dquickpalette.cpp dtkdeclarative-5.6.10/chameleon/src/dquickpalette.cpp --- dtkdeclarative-5.6.3/chameleon/src/dquickpalette.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/chameleon/src/dquickpalette.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,521 +0,0 @@ -// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -#include "dquickpalette_p.h" -#include "private/dquicksystempalette_p.h" - -#include -#include - -#include - -DGUI_USE_NAMESPACE -DQUICK_BEGIN_NAMESPACE - -QColor DQuickPalette::alternateBase() const -{ - return v.color(QPalette::AlternateBase); -} - -void DQuickPalette::setAlternateBase(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::AlternateBase, color); -} - -void DQuickPalette::resetAlternateBase() -{ - v.resolve(v.resolve() & ~(1 << QPalette::AlternateBase)); -} - -QColor DQuickPalette::base() const -{ - return v.color(QPalette::Base); -} - -void DQuickPalette::setBase(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::Base, color); -} - -void DQuickPalette::resetBase() -{ - v.resolve(v.resolve() & ~(1 << QPalette::Base)); -} - -QColor DQuickPalette::brightText() const -{ - return v.color(QPalette::BrightText); -} - -void DQuickPalette::setBrightText(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::BrightText, color); -} - -void DQuickPalette::resetBrightText() -{ - v.resolve(v.resolve() & ~(1 << QPalette::BrightText)); -} - -QColor DQuickPalette::button() const -{ - return v.color(QPalette::Button); -} - -void DQuickPalette::setButton(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::Button, color); -} - -void DQuickPalette::resetButton() -{ - v.resolve(v.resolve() & ~(1 << QPalette::Button)); -} - -QColor DQuickPalette::buttonText() const -{ - return v.color(QPalette::ButtonText); -} - -void DQuickPalette::setButtonText(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::ButtonText, color); -} - -void DQuickPalette::resetButtonText() -{ - v.resolve(v.resolve() & ~(1 << QPalette::ButtonText)); -} - -QColor DQuickPalette::dark() const -{ - return v.color(QPalette::Dark); -} - -void DQuickPalette::setDark(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::Dark, color); -} - -void DQuickPalette::resetDark() -{ - v.resolve(v.resolve() & ~(1 << QPalette::Dark)); -} - -QColor DQuickPalette::highlight() const -{ - return v.color(QPalette::Highlight); -} - -void DQuickPalette::setHighlight(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::Highlight, color); -} - -void DQuickPalette::resetHighlight() -{ - v.resolve(v.resolve() & ~(1 << QPalette::Highlight)); -} - -QColor DQuickPalette::highlightedText() const -{ - return v.color(QPalette::HighlightedText); -} - -void DQuickPalette::setHighlightedText(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::HighlightedText, color); -} - -void DQuickPalette::resetHighlightedText() -{ - v.resolve(v.resolve() & ~(1 << QPalette::HighlightedText)); -} - -QColor DQuickPalette::light() const -{ - return v.color(QPalette::Light); -} - -void DQuickPalette::setLight(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::Light, color); -} - -void DQuickPalette::resetLight() -{ - v.resolve(v.resolve() & ~(1 << QPalette::Light)); -} - -QColor DQuickPalette::link() const -{ - return v.color(QPalette::Link); -} - -void DQuickPalette::setLink(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::Link, color); -} - -void DQuickPalette::resetLink() -{ - v.resolve(v.resolve() & ~(1 << QPalette::Link)); -} - -QColor DQuickPalette::linkVisited() const -{ - return v.color(QPalette::LinkVisited); -} - -void DQuickPalette::setLinkVisited(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::LinkVisited, color); -} - -void DQuickPalette::resetLinkVisited() -{ - v.resolve(v.resolve() & ~(1 << QPalette::LinkVisited)); -} - -QColor DQuickPalette::mid() const -{ - return v.color(QPalette::Mid); -} - -void DQuickPalette::setMid(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::Mid, color); -} - -void DQuickPalette::resetMid() -{ - v.resolve(v.resolve() & ~(1 << QPalette::Mid)); -} - -QColor DQuickPalette::midlight() const -{ - return v.color(QPalette::Midlight); -} - -void DQuickPalette::setMidlight(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::Midlight, color); -} - -void DQuickPalette::resetMidlight() -{ - v.resolve(v.resolve() & ~(1 << QPalette::Midlight)); -} - -QColor DQuickPalette::shadow() const -{ - return v.color(QPalette::Shadow); -} - -void DQuickPalette::setShadow(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::Shadow, color); -} - -void DQuickPalette::resetShadow() -{ - v.resolve(v.resolve() & ~(1 << QPalette::Shadow)); -} - -QColor DQuickPalette::text() const -{ - return v.color(QPalette::Text); -} - -void DQuickPalette::setText(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::Text, color); -} - -void DQuickPalette::resetText() -{ - v.resolve(v.resolve() & ~(1 << QPalette::Text)); -} - -QColor DQuickPalette::toolTipBase() const -{ - return v.color(QPalette::ToolTipBase); -} - -void DQuickPalette::setToolTipBase(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::ToolTipBase, color); -} - -void DQuickPalette::resetToolTipBase() -{ - v.resolve(v.resolve() & ~(1 << QPalette::ToolTipBase)); -} - -QColor DQuickPalette::toolTipText() const -{ - return v.color(QPalette::ToolTipText); -} - -void DQuickPalette::setToolTipText(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::ToolTipText, color); -} - -void DQuickPalette::resetToolTipText() -{ - v.resolve(v.resolve() & ~(1 << QPalette::ToolTipText)); -} - -QColor DQuickPalette::window() const -{ - return v.color(QPalette::Window); -} - -void DQuickPalette::setWindow(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::Window, color); -} - -void DQuickPalette::resetWindow() -{ - v.resolve(v.resolve() & ~(1 << QPalette::Window)); -} - -QColor DQuickPalette::windowText() const -{ - return v.color(QPalette::WindowText); -} - -void DQuickPalette::setWindowText(const QColor &color) -{ - v.setColor(QPalette::All, QPalette::WindowText, color); -} - -void DQuickPalette::resetWindowText() -{ - v.resolve(v.resolve() & ~(1 << QPalette::WindowText)); -} - -// 用来存储DPalette的颜色数据, 需要注意的是, 此处不可存放指针, 否则可能会导致内存泄露. -// 此对象会存储到QPalette的d指针中, 确保能在QPalette销毁时自动销毁 -struct DPaletteData -{ -public: - // 用来记录某个颜色值是否被设置 - qint32 resolve_mask = 0; - QColor br[DPalette::NColorTypes]; -}; - -// 返回DPalette中的颜色数据 -static inline DPaletteData *getDPalette(QPalette &palette, bool autoCreate = false) -{ - Q_UNUSED(palette) - - if (Q_UNLIKELY(autoCreate)) { - qWarning() << "Not support set color for DPalette"; - } - - // TODO(zccrs): 暂时没有必要实现DPalette中扩展的几个颜色类型的写操作 - // 目前只需要能从qml中读取即可 - return nullptr; -} - -inline static const QColor &getDColor(const QPalette &palette, DPalette::ColorType type) { - auto dpalette = getDPalette(const_cast(palette)); - if (Q_UNLIKELY(dpalette && dpalette->resolve_mask & (1 << type))) - return dpalette->br[type]; - - auto colorType = DGuiApplicationHelper::toColorType(palette); - // 否则应当从程序全局中获取数据 - if (Q_LIKELY(colorType == DGuiApplicationHelper::instance()->themeType())) { - static DQuickSystemPalette *global = new DQuickSystemPalette(); - return global->palette().color(palette.currentColorGroup(), type); - } - - return DGuiApplicationHelper::standardPalette(colorType).color(palette.currentColorGroup(), type); -} - -inline static void setDColor(QPalette &palette, DPalette::ColorType type, const QColor &color) { - auto dpalette = getDPalette(palette, true); - Q_ASSERT(dpalette); - - dpalette->br[type] = color; - dpalette->resolve_mask |= (1 << type); - palette.setColor(QPalette::NoRole, QColor(QRgb(dpalette->resolve_mask))); -} - -inline static void resetDColor(QPalette &palette, DPalette::ColorType type) { - if (auto dpalette = getDPalette(palette)) { - dpalette->resolve_mask &= ~(1 << type); - palette.setColor(QPalette::NoRole, QColor(QRgb(dpalette->resolve_mask))); - } -} - -QColor DQuickPalette::itemBackground() const -{ - return getDColor(v, DPalette::ItemBackground); -} - -void DQuickPalette::setItemBackground(const QColor &ItemBackground) -{ - setDColor(v, DPalette::ItemBackground, ItemBackground); -} - -void DQuickPalette::resetItemBackground() -{ - resetDColor(v, DPalette::ItemBackground); -} - -QColor DQuickPalette::textTitle() const -{ - return getDColor(v, DPalette::TextTitle); -} - -void DQuickPalette::setTextTitle(const QColor &textTitle) -{ - setDColor(v, DPalette::TextTitle, textTitle); -} - -void DQuickPalette::resetTextTitle() -{ - resetDColor(v, DPalette::TextTitle); -} - -QColor DQuickPalette::textTips() const -{ - return getDColor(v, DPalette::TextTips); -} - -void DQuickPalette::setTextTips(const QColor &textTips) -{ - setDColor(v, DPalette::TextTips, textTips); -} - -void DQuickPalette::resetTextTips() -{ - resetDColor(v, DPalette::TextTips); -} - -QColor DQuickPalette::textWarning() const -{ - return getDColor(v, DPalette::TextWarning); -} - -void DQuickPalette::setTextWarning(const QColor &textWarning) -{ - setDColor(v, DPalette::TextWarning, textWarning); -} - -void DQuickPalette::resetTextWarning() -{ - resetDColor(v, DPalette::TextWarning); -} - -QColor DQuickPalette::textLively() const -{ - return getDColor(v, DPalette::TextLively); -} - -void DQuickPalette::setTextLively(const QColor &textLively) -{ - setDColor(v, DPalette::TextLively, textLively); -} - -void DQuickPalette::resetTextLively() -{ - resetDColor(v, DPalette::TextLively); -} - -QColor DQuickPalette::lightLively() const -{ - return getDColor(v, DPalette::LightLively); -} - -void DQuickPalette::setLightLively(const QColor &lightLively) -{ - setDColor(v, DPalette::LightLively, lightLively); -} - -void DQuickPalette::resetLightLively() -{ - resetDColor(v, DPalette::LightLively); -} - -QColor DQuickPalette::darkLively() const -{ - return getDColor(v, DPalette::DarkLively); -} - -void DQuickPalette::setDarkLively(const QColor &darkLively) -{ - setDColor(v, DPalette::DarkLively, darkLively); -} - -void DQuickPalette::resetDarkLively() -{ - resetDColor(v, DPalette::DarkLively); -} - -QColor DQuickPalette::frameBorder() const -{ - return getDColor(v, DPalette::FrameBorder); -} - -void DQuickPalette::setFrameBorder(const QColor &frameBorder) -{ - setDColor(v, DPalette::FrameBorder, frameBorder); -} - -void DQuickPalette::resetFrameBorder() -{ - resetDColor(v, DPalette::FrameBorder); -} - -QColor DQuickPalette::placeholderText() const -{ - return getDColor(v, DPalette::PlaceholderText); -} - -void DQuickPalette::setPlaceholderText(const QColor &placeholderText) -{ - setDColor(v, DPalette::PlaceholderText, placeholderText); -} - -void DQuickPalette::resetPlaceholderText() -{ - resetDColor(v, DPalette::PlaceholderText); -} - -QColor DQuickPalette::frameShadowBorder() const -{ - return getDColor(v, DPalette::FrameShadowBorder); -} - -void DQuickPalette::setFrameShadowBorder(const QColor &frameShadowBorder) -{ - setDColor(v, DPalette::FrameShadowBorder, frameShadowBorder); -} - -void DQuickPalette::resetFrameShadowBorder() -{ - resetDColor(v, DPalette::FrameShadowBorder); -} - -QColor DQuickPalette::obviousBackground() const -{ - return getDColor(v, DPalette::ObviousBackground); -} - -void DQuickPalette::setObviousBackground(const QColor &obviousBackground) -{ - setDColor(v, DPalette::ObviousBackground, obviousBackground); -} - -void DQuickPalette::resetObviousBackground() -{ - resetDColor(v, DPalette::ObviousBackground); -} - -DQUICK_END_NAMESPACE diff -Nru dtkdeclarative-5.6.3/chameleon/src/dquickpalette_p.h dtkdeclarative-5.6.10/chameleon/src/dquickpalette_p.h --- dtkdeclarative-5.6.3/chameleon/src/dquickpalette_p.h 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/chameleon/src/dquickpalette_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -#ifndef DQUICKPALETTE_H -#define DQUICKPALETTE_H - -#include -#define private public -#include -#undef private - -DQUICK_BEGIN_NAMESPACE - -class DQuickPalette -{ - Q_GADGET - - // QPalette - Q_PROPERTY(QColor alternateBase READ alternateBase WRITE setAlternateBase RESET resetAlternateBase FINAL) - Q_PROPERTY(QColor base READ base WRITE setBase RESET resetBase FINAL) - Q_PROPERTY(QColor brightText READ brightText WRITE setBrightText RESET resetBrightText FINAL) - Q_PROPERTY(QColor button READ button WRITE setButton RESET resetButton FINAL) - Q_PROPERTY(QColor buttonText READ buttonText WRITE setButtonText RESET resetButtonText FINAL) - Q_PROPERTY(QColor dark READ dark WRITE setDark RESET resetDark FINAL) - Q_PROPERTY(QColor highlight READ highlight WRITE setHighlight RESET resetHighlight FINAL) - Q_PROPERTY(QColor highlightedText READ highlightedText WRITE setHighlightedText RESET resetHighlightedText FINAL) - Q_PROPERTY(QColor light READ light WRITE setLight RESET resetLight FINAL) - Q_PROPERTY(QColor link READ link WRITE setLink RESET resetLink FINAL) - Q_PROPERTY(QColor linkVisited READ linkVisited WRITE setLinkVisited RESET resetLinkVisited FINAL) - Q_PROPERTY(QColor mid READ mid WRITE setMid RESET resetMid FINAL) - Q_PROPERTY(QColor midlight READ midlight WRITE setMidlight RESET resetMidlight FINAL) - Q_PROPERTY(QColor shadow READ shadow WRITE setShadow RESET resetShadow FINAL) - Q_PROPERTY(QColor text READ text WRITE setText RESET resetText FINAL) - Q_PROPERTY(QColor toolTipBase READ toolTipBase WRITE setToolTipBase RESET resetToolTipBase FINAL) - Q_PROPERTY(QColor toolTipText READ toolTipText WRITE setToolTipText RESET resetToolTipText FINAL) - Q_PROPERTY(QColor window READ window WRITE setWindow RESET resetWindow FINAL) - Q_PROPERTY(QColor windowText READ windowText WRITE setWindowText RESET resetWindowText FINAL) - - // DPalette - Q_PROPERTY(QColor itemBackground READ itemBackground WRITE setItemBackground RESET resetItemBackground FINAL) - Q_PROPERTY(QColor textTitle READ textTitle WRITE setTextTitle RESET resetTextTitle FINAL) - Q_PROPERTY(QColor textTips READ textTips WRITE setTextTips RESET resetTextTips FINAL) - Q_PROPERTY(QColor textWarning READ textWarning WRITE setTextWarning RESET resetTextWarning FINAL) - Q_PROPERTY(QColor textLively READ textLively WRITE setTextLively RESET resetTextLively FINAL) - Q_PROPERTY(QColor lightLively READ lightLively WRITE setLightLively RESET resetLightLively FINAL) - Q_PROPERTY(QColor darkLively READ darkLively WRITE setLightLively RESET resetLightLively FINAL) - Q_PROPERTY(QColor frameBorder READ frameBorder WRITE setFrameBorder RESET resetFrameBorder FINAL) - Q_PROPERTY(QColor placeholderText READ placeholderText WRITE setPlaceholderText RESET resetPlaceholderText FINAL) - Q_PROPERTY(QColor frameShadowBorder READ frameShadowBorder WRITE setFrameShadowBorder RESET resetFrameShadowBorder FINAL) - Q_PROPERTY(QColor obviousBackground READ obviousBackground WRITE setObviousBackground RESET resetObviousBackground FINAL) - -public: - QColor alternateBase() const; - void setAlternateBase(const QColor &color); - void resetAlternateBase(); - - QColor base() const; - void setBase(const QColor &color); - void resetBase(); - - QColor brightText() const; - void setBrightText(const QColor &color); - void resetBrightText(); - - QColor button() const; - void setButton(const QColor &color); - void resetButton(); - - QColor buttonText() const; - void setButtonText(const QColor &color); - void resetButtonText(); - - QColor dark() const; - void setDark(const QColor &color); - void resetDark(); - - QColor highlight() const; - void setHighlight(const QColor &color); - void resetHighlight(); - - QColor highlightedText() const; - void setHighlightedText(const QColor &color); - void resetHighlightedText(); - - QColor light() const; - void setLight(const QColor &color); - void resetLight(); - - QColor link() const; - void setLink(const QColor &color); - void resetLink(); - - QColor linkVisited() const; - void setLinkVisited(const QColor &color); - void resetLinkVisited(); - - QColor mid() const; - void setMid(const QColor &color); - void resetMid(); - - QColor midlight() const; - void setMidlight(const QColor &color); - void resetMidlight(); - - QColor shadow() const; - void setShadow(const QColor &color); - void resetShadow(); - - QColor text() const; - void setText(const QColor &color); - void resetText(); - - QColor toolTipBase() const; - void setToolTipBase(const QColor &color); - void resetToolTipBase(); - - QColor toolTipText() const; - void setToolTipText(const QColor &color); - void resetToolTipText(); - - QColor window() const; - void setWindow(const QColor &color); - void resetWindow(); - - QColor windowText() const; - void setWindowText(const QColor &color); - void resetWindowText(); - - // DPalette - QColor itemBackground() const; - void setItemBackground(const QColor &itemBackground); - void resetItemBackground(); - - QColor textTitle() const; - void setTextTitle(const QColor &textTitle); - void resetTextTitle(); - - QColor textTips() const; - void setTextTips(const QColor &textTips); - void resetTextTips(); - - QColor textWarning() const; - void setTextWarning(const QColor &textWarning); - void resetTextWarning(); - - QColor textLively() const; - void setTextLively(const QColor &textLively); - void resetTextLively(); - - QColor lightLively() const; - void setLightLively(const QColor &lightLively); - void resetLightLively(); - - QColor darkLively() const; - void setDarkLively(const QColor &darkLively); - void resetDarkLively(); - - QColor frameBorder() const; - void setFrameBorder(const QColor &frameBorder); - void resetFrameBorder(); - - QColor placeholderText() const; - void setPlaceholderText(const QColor &placeholderText); - void resetPlaceholderText(); - - QColor frameShadowBorder() const; - void setFrameShadowBorder(const QColor &frameShadowBorder); - void resetFrameShadowBorder(); - - QColor obviousBackground() const; - void setObviousBackground(const QColor &obviousBackground); - void resetObviousBackground(); - -private: - QPalette v; -}; - -DQUICK_END_NAMESPACE - -#endif // DQUICKPALETTE_H diff -Nru dtkdeclarative-5.6.3/chameleon/src/dquickpaletteprovider.cpp dtkdeclarative-5.6.10/chameleon/src/dquickpaletteprovider.cpp --- dtkdeclarative-5.6.3/chameleon/src/dquickpaletteprovider.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/chameleon/src/dquickpaletteprovider.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,146 +0,0 @@ -// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -#include "dquickpaletteprovider_p.h" -#include "dquickpalette_p.h" - -#include - -#include - -DGUI_USE_NAMESPACE -DQUICK_BEGIN_NAMESPACE - -static QQmlValueTypeProvider *instance() -{ - static DQuickPaletteProvider provider; - return &provider; -} - -void DQuickPaletteProvider::init() -{ - QQml_addValueTypeProvider(instance()); -} - -void DQuickPaletteProvider::cleanup() -{ - QQml_removeValueTypeProvider(instance()); -} - -#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) - #define ASSERT_VALID_SIZE(size, min) Q_UNUSED(size) -#else - #define ASSERT_VALID_SIZE(size, min) Q_ASSERT(size >= min) -#endif - -const QMetaObject *DQuickPaletteProvider::getMetaObjectForMetaType(int type) -{ - switch (type) { - case QMetaType::QPalette: - return &DQuickPalette::staticMetaObject; - default: - break; - } - - return nullptr; -} - -bool DQuickPaletteProvider::init(int type, QVariant& dst) -{ - switch (type) { - case QMetaType::QPalette: - dst.setValue(QPalette()); - return true; - default: break; - } - - return false; -} - -template -bool typedEqual(const void *lhs, const QVariant& rhs) -{ - return (*(reinterpret_cast(lhs)) == rhs.value()); -} - -bool DQuickPaletteProvider::equal(int type, const void *lhs, const QVariant &rhs) -{ - switch (type) { - case QMetaType::QPalette: - return typedEqual(lhs, rhs); - default: break; - } - - return false; -} - -template -bool typedStore(const void *src, void *dst, size_t dstSize) -{ - ASSERT_VALID_SIZE(dstSize, sizeof(T)); - const T *srcT = reinterpret_cast(src); - T *dstT = reinterpret_cast(dst); - new (dstT) T(*srcT); - return true; -} - -bool DQuickPaletteProvider::store(int type, const void *src, void *dst, size_t dstSize) -{ - switch (type) { - case QMetaType::QPalette: - return typedStore(src, dst, dstSize); - default: break; - } - - return false; -} - -template -bool typedRead(const QVariant& src, int dstType, void *dst) -{ - T *dstT = reinterpret_cast(dst); - if (src.type() == static_cast(dstType)) { - *dstT = src.value(); - } else { - *dstT = T(); - } - return true; -} - -bool DQuickPaletteProvider::read(const QVariant &src, void *dst, int dstType) -{ - switch (dstType) { - case QMetaType::QPalette: - return typedRead(src, dstType, dst); - default: break; - } - - return false; -} - -template -bool typedWrite(const void *src, QVariant& dst) -{ - const T *srcT = reinterpret_cast(src); - if (dst.value() != *srcT) { - dst = *srcT; - return true; - } - return false; -} - -bool DQuickPaletteProvider::write(int type, const void *src, QVariant& dst) -{ - switch (type) { - case QMetaType::QPalette: - return typedWrite(src, dst); - default: break; - } - - return false; -} - -#undef ASSERT_VALID_SIZE - -DQUICK_END_NAMESPACE diff -Nru dtkdeclarative-5.6.3/chameleon/src/dquickpaletteprovider_p.h dtkdeclarative-5.6.10/chameleon/src/dquickpaletteprovider_p.h --- dtkdeclarative-5.6.3/chameleon/src/dquickpaletteprovider_p.h 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/chameleon/src/dquickpaletteprovider_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -#ifndef DQUICKPALETTEPROVIDER_P_H -#define DQUICKPALETTEPROVIDER_P_H - -#include -#include - -DQUICK_BEGIN_NAMESPACE - -class DQuickPaletteProvider : public QQmlValueTypeProvider -{ -public: - static void init(); - static void cleanup(); - - const QMetaObject *getMetaObjectForMetaType(int type) override; - bool init(int type, QVariant& dst) override; - bool equal(int type, const void *lhs, const QVariant &rhs) override; - bool store(int type, const void *src, void *dst, size_t dstSize) override; - bool read(const QVariant &src, void *dst, int dstType) override; - bool write(int type, const void *src, QVariant& dst) override; -}; - -DQUICK_END_NAMESPACE - -#endif // DQUICKPALETTEPROVIDER_P_H diff -Nru dtkdeclarative-5.6.3/chameleon/src/src.pri dtkdeclarative-5.6.10/chameleon/src/src.pri --- dtkdeclarative-5.6.3/chameleon/src/src.pri 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/chameleon/src/src.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -HEADERS += \ - $$PWD/qtquickcontrols2chameleonstyleplugin.h \ -# $$PWD/dquickpalette_p.h \ -# $$PWD/dquickpaletteprovider_p.h - -SOURCES += \ - $$PWD/qtquickcontrols2chameleonstyleplugin.cpp \ -# $$PWD/dquickpalette.cpp \ -# $$PWD/dquickpaletteprovider.cpp diff -Nru dtkdeclarative-5.6.3/cmake/DtkBuildConfig.cmake dtkdeclarative-5.6.10/cmake/DtkBuildConfig.cmake --- dtkdeclarative-5.6.3/cmake/DtkBuildConfig.cmake 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/cmake/DtkBuildConfig.cmake 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,84 @@ +# This cmake file is used to deploy files that dconfig's meta and override configure. + +include(CMakeParseArguments) + +# generate dtk moudule config header file. +# +# MODULE_NAME - module name. ${MODULE_NAME}_config.h +# DEST_DIR - used to get header file dest path, if it's empty, ${CMAKE_CURRENT_SOURCE_DIR} is used. +# HEADERS - header files without .h extension. +# EXT_CONTENTS - extra contents strings. +# +# e.g: +# set(VERSION_DEC "#define DTK_VERSION_MAJOR 5" +# "#define DTK_VERSION_MINOR 5" +# "#define DTK_VERSION_PATCH 23" +# "#define DTK_VERSION_BUILD 0" +# "#define DTK_VERSION_STR \"5.5.23\"\n") +# set(HEADERS ./DConfig ./DConfigFile ./DLog ./DObject) +# gen_dtk_config_header(MODULE_NAME dtkcore +# DEST_DIR include/global +# HEADERS ${HEADERS} +# EXT_CONTENTS ${VERSION_DEC}) +# +# filename: ${CMAKE_CURRENT_SOURCE_DIR}/include/global/dtkcore_config.h +# ==== file content begin ==== +# // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +# // +# // SPDX-License-Identifier: LGPL-3.0-or-later +# +# #define DTK_VERSION_MAJOR 5 +# #define DTK_VERSION_MINOR 5 +# #define DTK_VERSION_PATCH 23 +# #define DTK_VERSION_BUILD 0 +# #define DTK_VERSION_STR "5.5.23" +# +# #define DTKCORE_CLASS_DConfig +# #define DTKCORE_CLASS_DConfigFile +# #define DTKCORE_CLASS_DLog +# #define DTKCORE_CLASS_DObject +# ==== file content end ==== +# +function(GEN_DTK_CONFIG_HEADER) + set(oneValueArgs MODULE_NAME DEST_DIR) + set(multiValueArgs HEADERS EXT_CONTENTS) + + cmake_parse_arguments(_CONFIG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if (DEFINED _CONFIG_MSG) + message("MODULE_NAME: ${_CONFIG_MODULE_NAME}\n" + "DEST_DIR: ${_CONFIG_DEST_DIR}\n" + "HEADERS: ${_CONFIG_HEADERS}\n") + endif() + + set(config_file_path ${CMAKE_CURRENT_SOURCE_DIR}) + if (DEFINED _CONFIG_DEST_DIR) + set(config_file_path ${_CONFIG_DEST_DIR}) + endif() + + if (DEFINED _CONFIG_MODULE_NAME) + string(APPEND config_file_path /${_CONFIG_MODULE_NAME}_config.h) + message("generate file path:" ${config_file_path}) + else() + message(FATAL_ERROR \"MODULE_NAME needs to be defined when calling gen_dtk_config_header\") + endif() + + set(LICENSE_DEC + "// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.\n" + "//\n" + "// SPDX-License-Identifier: LGPL-3.0-or-later\n" + "\n") + + file(WRITE ${config_file_path} ${LICENSE_DEC}) + + foreach(_ext_content ${_CONFIG_EXT_CONTENTS}) + file(APPEND ${config_file_path} "${_ext_content}\n") + endforeach() + + foreach(_head_file ${_CONFIG_HEADERS}) + get_filename_component(classname ${_head_file} NAME) + string(TOUPPER ${_CONFIG_MODULE_NAME} _UP_MODULE_NAME) + file(APPEND ${config_file_path} "#define ${_UP_MODULE_NAME}_CLASS_${classname}\n") + endforeach() + +endfunction() diff -Nru dtkdeclarative-5.6.3/CMakeLists.txt dtkdeclarative-5.6.10/CMakeLists.txt --- dtkdeclarative-5.6.3/CMakeLists.txt 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -1,16 +1,89 @@ -cmake_minimum_required (VERSION 3.10) +cmake_minimum_required(VERSION 3.10) -project (DtkDeclarative - VERSION "${DTK_REPO_MODULE_VERSION}" - DESCRIPTION "DTK Declarative module" - HOMEPAGE_URL "" - LANGUAGES CXX C +set(VERSION "5.6.8" CACHE STRING "Define project version") + +project(DtkDeclarative + VERSION "${VERSION}" + DESCRIPTION "DTK Declarative module" + HOMEPAGE_URL "https://github.com/linuxdeepin/dtkdeclarative" + LANGUAGES CXX ) +set(LIB_NAME dtkdeclarative) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) +set(BUILD_DOCS ON CACHE BOOL "Generate doxygen-based documentation") -find_package (Qt5 CONFIG REQUIRED COMPONENTS DBus Xml) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX /usr) +endif() +set(LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE STRING "Library install path") +set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/dtk${PROJECT_VERSION_MAJOR}/DDeclarative" CACHE STRING "Headers install path") +set(TEMPLATE_INSTALL_DIR "share/qtcreator/templates/wizards/projects/qml-app-template" CACHE STRING "Directory to install QtCreator template") +set(CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/DtkDeclarative" CACHE STRING "CMake config file install directory") +set(PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig" CACHE STRING "Directory to install pkg-config file") +set(MKSPECS_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/qt5/mkspecs/modules" CACHE STRING "Qt pri module install directory") +set(QML_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/qt5/qml" CACHE STRING "Qml plugin install directory") -set (BUILD_DOCS ON CACHE BOOL "Generate doxygen-based documentation") +set(USE_QQuickStylePluginPrivate OFF) +find_package(Qt5QuickControls2) +if(TARGET Qt5::QuickControls2 AND TARGET Qt5::QuickControls2Private) + add_definitions(-DUSE_QQuickStylePlugin) + set(USE_QQuickStylePluginPrivate ON) +endif() -if (BUILD_DOCS) - add_subdirectory(docs) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wextra") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed") +if (CMAKE_BUILD_TYPE STREQUAL "Debug") + # 加上 ASAN 检查后可能会导致 DEBUG 应用启动后退出。可以加上 ASAN_OPTIONS 环境变量来防止应用退出 + # ASAN_OPTIONS="halt_on_error=0" ASAN_OPTIONS="new_delete_type_mismatch=0" + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -fno-omit-frame-pointer") + set(BUILD_TESTING ON) +else () + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast") endif () + +add_subdirectory(src) +add_subdirectory(chameleon) +add_subdirectory(qmlplugin) +add_subdirectory(examples) + +if(BUILD_DOCS) + add_subdirectory(docs) +endif() + +if(BUILD_TESTING) + add_subdirectory(tests) + add_dependencies(unit-test dtkdeclarativeplugin) +endif() + +# Install wizards template +install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/misc/qml-app-template/" DESTINATION "${TEMPLATE_INSTALL_DIR}") + +configure_package_config_file( + "${CMAKE_CURRENT_LIST_DIR}/misc/DtkDeclarativeConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/DtkDeclarativeConfig.cmake" + INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}" +) +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/DtkDeclarativeConfigVersion.cmake" + VERSION ${VERSION} + COMPATIBILITY SameMajorVersion +) +# Install cmake config file +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/DtkDeclarativeConfig.cmake" DESTINATION "${CONFIG_INSTALL_DIR}") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/DtkDeclarativeConfigVersion.cmake" DESTINATION "${CONFIG_INSTALL_DIR}") +# Install pkg-config file +configure_file("${PROJECT_SOURCE_DIR}/misc/dtkdeclarative.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/dtkdeclarative.pc" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dtkdeclarative.pc" DESTINATION "${PKGCONFIG_INSTALL_DIR}") +# Install qmake module config file +configure_file("${CMAKE_CURRENT_LIST_DIR}/misc/qt_lib_dtkdeclarative.pri.in" "${CMAKE_CURRENT_BINARY_DIR}/qt_lib_dtkdeclarative.pri" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt_lib_dtkdeclarative.pri" DESTINATION "${MKSPECS_INSTALL_DIR}") diff -Nru dtkdeclarative-5.6.3/debian/changelog dtkdeclarative-5.6.10/debian/changelog --- dtkdeclarative-5.6.3/debian/changelog 2023-01-08 13:23:14.000000000 +0000 +++ dtkdeclarative-5.6.10/debian/changelog 2023-05-02 21:23:12.000000000 +0000 @@ -1,8 +1,40 @@ -dtkdeclarative (5.6.3-1) lunar; urgency=medium +dtkdeclarative (5.6.10-1) lunar; urgency=medium - * New upstream release 5.6.3 + * New upstream release. - -- Ananta Mishra Sun, 08 Jan 2023 19:08:14 +0545 + -- Arun Kumar Pariyar Wed, 03 May 2023 03:08:12 +0545 + +dtkdeclarative (5.6.10) unstable; urgency=medium + + * Release 5.6.10 + * FIX dtk#43 dtk#47 dtk#48 dtk#49 + + -- Deepin Packages Builder Mon, 17 Apr 2023 17:01:17 +0800 + +dtkdeclarative (5.6.9) unstable; urgency=medium + + * Release 5.6.9 + * Fix #85 + * Fix Crashed when reset static property + * Fix #117 + + -- Deepin Packages Builder Tue, 04 Apr 2023 17:06:37 +0800 + +dtkdeclarative (5.6.8) unstable; urgency=medium + + * Allow custom QML plugin install path + * Modify AboutDialog's style + * Fix application crashed when WindowButton unload + * Change docs from qdoc to doxygen and update docs + * Change project manager tool from qmake to cmake + + -- Deepin Packages Builder Wed, 22 Feb 2023 16:06:59 +0800 + +dtkdeclarative (5.6.3) unstable; urgency=medium + + * Release 5.6.3 + + -- Deepin Packages Builder Tue, 20 Dec 2022 11:36:24 +0800 dtkdeclarative (0.0.1) unstable; urgency=medium diff -Nru dtkdeclarative-5.6.3/debian/control dtkdeclarative-5.6.10/debian/control --- dtkdeclarative-5.6.3/debian/control 2023-01-08 13:23:14.000000000 +0000 +++ dtkdeclarative-5.6.10/debian/control 2023-05-02 21:20:50.000000000 +0000 @@ -1,36 +1,35 @@ Source: dtkdeclarative Section: libs Priority: optional -Maintainer: Ananta Mishra -XSBC-Original-Maintainer: Deepin Packages Builder -Build-Depends: debhelper-compat (= 13), - libdtkcore-dev, - libdtkgui-dev, - libgtest-dev, - libqt5core5a, - pkg-kde-tools, - qtbase5-dev, - qtbase5-dev-tools, - qtbase5-private-dev, - qtdeclarative5-dev, - qtdeclarative5-private-dev, - qtquickcontrols2-5-dev, - qttools5-dev-tools -Standards-Version: 4.6.2 +Maintainer: Deepin Packages Builder +Build-Depends: + debhelper-compat ( =12), + cmake, + qtdeclarative5-dev, + qtbase5-dev-tools, + qtquickcontrols2-5-dev, + libdtkgui-dev, + libdtkcore-dev, + qtdeclarative5-private-dev, + qtbase5-private-dev, + pkg-kde-tools, + libgtest-dev, + doxygen, + qttools5-dev-tools, + qttools5-dev, +Standards-Version: 3.9.8 Homepage: http://www.deepin.org Package: qml-module-qtquick-controls2-styles-chameleon Architecture: any -Depends: libdtkdeclarative5( =${binary:Version}), - qml-module-qtquick-shapes (>= 5.11.3), - ${misc:Depends}, - ${shlibs:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, qml-module-qtquick-shapes (>= 5.11.3), + libdtkdeclarative5( =${binary:Version}) Description: Deepin Tool Kit Qt Quick Controls 2 QML module Dtkdeclarative is base library of Deepin Qt/QtQuick applications. Package: libdtkdeclarative5 Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} Multi-Arch: same Description: Deepin Tool Kit Gui library Dtkdeclarative is base library of Deepin Qt/QtQuick applications. @@ -39,20 +38,22 @@ Package: libdtkdeclarative-dev Architecture: any -Depends: libdtkdeclarative5( =${binary:Version}), - ${misc:Depends}, - ${shlibs:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, libdtkdeclarative5( =${binary:Version}) Description: Deepin Tool Kit Gui Devel library Dtkdeclarative is base library of Deepin Qt/QtQuick applications. . This package contains the header files and shared libraries of DtkDeclarative +Package: libdtkdeclarative-doc +Architecture: any +Depends: ${misc:Depends} +Description: Deepin Tool Kit Gui Devel library (Document) + Dtkdeclarative is base library of Deepin Qt/QtQuick applications. + Package: dtk-exhibition Architecture: any -Depends: libdtkdeclarative5( =${binary:Version}), - qml-module-qtquick-controls2-styles-chameleon( =${binary:Version}), - ${misc:Depends}, - ${shlibs:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, + libdtkdeclarative5( =${binary:Version}), + qml-module-qtquick-controls2-styles-chameleon( =${binary:Version}) Description: Deepin Tool Kit QML Controls example. - . This package contains a applicatioin. diff -Nru dtkdeclarative-5.6.3/debian/copyright dtkdeclarative-5.6.10/debian/copyright --- dtkdeclarative-5.6.3/debian/copyright 2023-01-08 13:20:07.000000000 +0000 +++ dtkdeclarative-5.6.10/debian/copyright 2023-05-02 21:20:50.000000000 +0000 @@ -3,5 +3,20 @@ Source: https://github.com/linuxdeepin/dtkdeclarative Files: * -Copyright: UnionTech Software Technology Co., Ltd. +Copyright: 2022-2023 UnionTech Software Technology Co., Ltd. License: LGPL-3.0-or-later + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published 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 Lesser General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU Lesser General + Public License version 3 can be found in "/usr/share/common-licenses/LGPL-3". diff -Nru dtkdeclarative-5.6.3/debian/libdtkdeclarative-dev.install dtkdeclarative-5.6.10/debian/libdtkdeclarative-dev.install --- dtkdeclarative-5.6.3/debian/libdtkdeclarative-dev.install 2023-01-08 13:23:14.000000000 +0000 +++ dtkdeclarative-5.6.10/debian/libdtkdeclarative-dev.install 2023-05-02 21:20:50.000000000 +0000 @@ -1,6 +1,6 @@ -usr/include -usr/lib/*/cmake/*/*.cmake usr/lib/*/lib*.so +usr/include usr/lib/*/pkgconfig/*.pc +usr/lib/*/cmake/*/*.cmake usr/lib/*/qt5/mkspecs/* usr/share/qtcreator/* diff -Nru dtkdeclarative-5.6.3/debian/libdtkdeclarative-doc.install dtkdeclarative-5.6.10/debian/libdtkdeclarative-doc.install --- dtkdeclarative-5.6.3/debian/libdtkdeclarative-doc.install 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/debian/libdtkdeclarative-doc.install 2023-05-02 21:20:50.000000000 +0000 @@ -0,0 +1 @@ +usr/share/qt5/doc/* diff -Nru dtkdeclarative-5.6.3/debian/rules dtkdeclarative-5.6.10/debian/rules --- dtkdeclarative-5.6.3/debian/rules 2023-01-08 13:23:14.000000000 +0000 +++ dtkdeclarative-5.6.10/debian/rules 2023-05-02 21:20:50.000000000 +0000 @@ -3,25 +3,15 @@ include /usr/share/dpkg/default.mk export QT_SELECT = qt5 -export DEB_BUILD_MAINT_OPTIONS=optimize=-lto - DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) -ifneq (,$(wildcard .git/config)) - CONFIG_VERSION= -else VERSION = $(DEB_VERSION_UPSTREAM) -_PACK_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}') -_BUILD_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0-9]//g') -ifeq ($(_BUILD_VER),) - CONFIG_VERSION = $(_PACK_VER) -else - CONFIG_VERSION = $(_PACK_VER).$(_BUILD_VER) -endif -endif +PACK_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}') +# Fix: invalid digit "8" in octal constant. e.g. u008 ==> 008 ==> 8 +BUILD_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0-9]//g' | awk '{print int($$1)}') %: - dh $@ --buildsystem=qmake --no-parallel --with qmlcdeps + dh $@ override_dh_auto_configure: - dh_auto_configure -- LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) VERSION=$(CONFIG_VERSION) DTK_QML_APP_PLUGIN_PATH=/usr/lib/$(DEB_HOST_MULTIARCH)/dtkdeclarative/qml-app + dh_auto_configure -- -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=ON -DBUILD_VERSION=$(BUILD_VER) -DVERSION=$(PACK_VER) Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/AboutDialog.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/AboutDialog.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ActionButton.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ActionButton.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/AlertToolTip_EditExam.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/AlertToolTip_EditExam.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/AlertToolTip.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/AlertToolTip.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ApplicationWindowNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ApplicationWindowNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ApplicationWindowUseDWindow.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ApplicationWindowUseDWindow.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ArrowListView.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ArrowListView.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/behindwindowblur.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/behindwindowblur.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxInsetShadowExample1.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxInsetShadowExample1.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxInsetShadowExample2.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxInsetShadowExample2.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxInsetShadowExample3.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxInsetShadowExample3.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxInsetShadowExample4.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxInsetShadowExample4.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxInsetShadowExample5.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxInsetShadowExample5.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxPanelExample1.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxPanelExample1.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxPanelExample2.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxPanelExample2.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxPanelExample3.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxPanelExample3.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxShadowExample1.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxShadowExample1.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxShadowExampleBlur10.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxShadowExampleBlur10.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxShadowExampleBlur2.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxShadowExampleBlur2.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxShadowExampleBlur40.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxShadowExampleBlur40.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxShadowExampleNoHollow.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxShadowExampleNoHollow.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxShadowExampleSpread10.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxShadowExampleSpread10.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxShadowExampleSpread2.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxShadowExampleSpread2.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxShadowExampleSpread5.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxShadowExampleSpread5.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BoxShadowExampleWithHollow.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BoxShadowExampleWithHollow.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BusyIndicatorFlat.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BusyIndicatorFlat.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/BusyIndicator.gif and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/BusyIndicator.gif differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ButtonBoxExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ButtonBoxExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ButtonColorFamily.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ButtonColorFamily.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ButtonCrystalCompare.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ButtonCrystalCompare.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ButtonExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ButtonExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ButtonIndicatorForButton.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ButtonIndicatorForButton.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ButtonIndicatorForToolButton.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ButtonIndicatorForToolButton.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/CheckBoxCheckedHovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/CheckBoxCheckedHovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/CheckBoxCheckedNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/CheckBoxCheckedNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/CheckBoxCheckedPressed.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/CheckBoxCheckedPressed.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/CheckBoxPartiallyCheckedHovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/CheckBoxPartiallyCheckedHovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/CheckBoxPartiallyCheckedNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/CheckBoxPartiallyCheckedNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/CheckBoxPartiallyCheckedPressed.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/CheckBoxPartiallyCheckedPressed.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/CheckBoxUnCheckedHovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/CheckBoxUnCheckedHovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/CheckBoxUnCheckedNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/CheckBoxUnCheckedNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/CheckBoxUnCheckedPressed.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/CheckBoxUnCheckedPressed.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/CheckDelegate.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/CheckDelegate.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/coloroverlay_imageOverlay.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/coloroverlay_imageOverlay.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/coloroverlay_imageSouce.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/coloroverlay_imageSouce.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/coloroverlay_Spinner.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/coloroverlay_Spinner.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ComboBoxAlert.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ComboBoxAlert.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ComboBoxEditable.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ComboBoxEditable.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ComboBoxNotEdit.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ComboBoxNotEdit.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ComboBoxPopup.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ComboBoxPopup.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/dciicon-layers.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/dciicon-layers.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/dtk-gloweffect.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/dtk-gloweffect.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/dtk-spinner-blue.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/dtk-spinner-blue.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/FloatingMessage.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/FloatingMessage.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/FloatingPanelExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/FloatingPanelExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/FocusBoxBorder.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/FocusBoxBorder.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/IconButtonExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/IconButtonExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/IconLabel.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/IconLabel.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/InsideBoxBorderExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/InsideBoxBorderExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/introduction.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/introduction.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/inwindowblur.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/inwindowblur.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/IPV4EditExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/IPV4EditExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/itemViewport_clip_radius.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/itemViewport_clip_radius.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/layoutUseAnchors.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/layoutUseAnchors.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/layoutUseCustomLayout.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/layoutUseCustomLayout.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/layutFromDtkwidget.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/layutFromDtkwidget.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/LineEditExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/LineEditExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/musicvoice.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/musicvoice.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/opacityMask_effectExample.jpg and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/opacityMask_effectExample.jpg differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/opacityMask_MaskExample.jpg and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/opacityMask_MaskExample.jpg differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/opacityMask_sourceExample.jpg and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/opacityMask_sourceExample.jpg differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/OutsideBoxBorderExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/OutsideBoxBorderExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/PasswordEdit.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/PasswordEdit.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/PlusMinusSpinBox.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/PlusMinusSpinBox.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ProgressBarFormatText.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ProgressBarFormatText.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ProgressBarIn.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ProgressBarIn.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ProgressBarText.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ProgressBarText.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/RadioButtonCheckedHovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/RadioButtonCheckedHovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/RatioButtonNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/RatioButtonNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/RatioButtonUncheckedHovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/RatioButtonUncheckedHovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/RatioButtonUncheckedNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/RatioButtonUncheckedNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/RecommandButtonExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/RecommandButtonExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/RectangularShadowExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/RectangularShadowExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/renderRedRect.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/renderRedRect.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/RoundRectangleExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/RoundRectangleExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SeachEditNoFocus.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SeachEditNoFocus.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SearchEditFocus.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SearchEditFocus.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SearchEditRunning.gif and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SearchEditRunning.gif differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SettingCheckBox.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SettingCheckBox.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SettingComboBox.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SettingComboBox.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SettingLineEdit.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SettingLineEdit.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SettingOptionCustionWidget.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SettingOptionCustionWidget.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SettingsDialog.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SettingsDialog.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SliderDashOffsetCompare.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SliderDashOffsetCompare.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SliderDashOffsetCompareWithPattern.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SliderDashOffsetCompareWithPattern.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SliderDashOffset.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SliderDashOffset.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SliderDashPattern.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SliderDashPattern.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SliderHighlighted.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SliderHighlighted.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SliderNormalHor.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SliderNormalHor.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SliderNormalVer.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SliderNormalVer.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SpinBoxAlert.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SpinBoxAlert.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SpinBoxEdit.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SpinBoxEdit.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SpinBoxExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SpinBoxExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/SwitchButton.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/SwitchButton.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/TextFieldDisabled.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/TextFieldDisabled.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/TextFieldFocus.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/TextFieldFocus.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/TextFieldNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/TextFieldNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ThemeMenuExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ThemeMenuExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/TicksSllider_Highlight.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/TicksSllider_Highlight.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/TipsSliderDefault.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/TipsSliderDefault.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ToolButtonFloatingPanel.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ToolButtonFloatingPanel.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ToolButtonIconLabel.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ToolButtonIconLabel.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/ToolButtonNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/ToolButtonNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/WarningButtonExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/WarningButtonExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/WaterProgressBar.gif and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/WaterProgressBar.gif differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/WindowButton_hovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/WindowButton_hovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/WindowButton_normal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/WindowButton_normal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/doc/chinese/images/WindowButton_pressed.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/doc/chinese/images/WindowButton_pressed.png differ diff -Nru dtkdeclarative-5.6.3/doc/chinese/includes/ddciiconpalette.qdocinc dtkdeclarative-5.6.10/doc/chinese/includes/ddciiconpalette.qdocinc --- dtkdeclarative-5.6.3/doc/chinese/includes/ddciiconpalette.qdocinc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/includes/ddciiconpalette.qdocinc 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -//! [grouped-properties] -\table -\header - \li Name - \li Description -\row - \li foreground - \li 该属性用于设置图标的前景色颜色 - - 适用于图标的前景色颜色,当图标的颜色需要和其背景颜色 - 不一致时,需要设置该图标的前景色颜色。例如侧边栏或工 - 具栏中使用的图标 - - \note 其对应于 QPalette 中的 WindowText 调色板颜色 - -\row - \li background - \li 该属性用于设置图标的背景色颜色 - - 背景色通常在图标调色板中使用场景较少,当图标的颜色需要和背景保持一致时, - 可以设置该图标调色板的背景色颜色。 - - \note 其对应于 QPalette 中的 Window 调色板颜色 -\row - \li highlight - \li 该属性用于设置图标的高亮色颜色 - - 高亮色颜色通常用于指定某些需要跟随高亮色改变的图标,例如 CheckBox 控件 Checked - 状态下的颜色。通常高亮色能够跟随系统高亮色的变化而发生改变。 - - \note 其对应于 QPalette 中的 Highlight 调色板颜色 -\row - \li highlightForeground - \li 该属性用于设置调色板高亮前景色的颜色 - - 高亮前景色又可被称为活动色上的前景色,主要用于运行在活动色的背景下,前景部分需要显示的颜色 - 目前系统上的高亮前景色基本都是白色。例如圆形高亮状态下的图标,其颜色可以用高亮前景色指定。 - - \note 其对应于 QPalette 中的 HightlightText 调色板颜色 - -\endtable -//! [grouped-properties] diff -Nru dtkdeclarative-5.6.3/doc/chinese/snippets/dtkdeclarative_boxinsetshadow.qml dtkdeclarative-5.6.10/doc/chinese/snippets/dtkdeclarative_boxinsetshadow.qml --- dtkdeclarative-5.6.3/doc/chinese/snippets/dtkdeclarative_boxinsetshadow.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/snippets/dtkdeclarative_boxinsetshadow.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -//! [0] -Rectangle { - id: backgroundRect - - color: Qt.rgba(1, 0, 0, 0.4) - width: 200 - height: 200 - radius: 8 -} - -BoxInsetShadow { - anchors.fill: backgroundRect - z: DTK.AboveOrder - shadowBlur: 2 - spread: 1 - shadowColor: Qt.rgba(0, 0, 0) - cornerRadius: backgroundRect.radius -} -//! [0] -//! [1] -Rectangle { - id: backgroundRect - - color: Qt.rgba(1, 0, 0, 0.4) - width: 200 - height: 200 - radius: 8 -} - -BoxInsetShadow { - anchors.fill: backgroundRect - z: DTK.AboveOrder - shadowBlur: 20 - spread: 1 - shadowColor: Qt.rgba(0, 0, 0) - cornerRadius: backgroundRect.radius -} -//! [1] -//! [2] -Rectangle { - id: backgroundRect - - color: Qt.rgba(1, 0, 0, 0.4) - width: 200 - height: 200 - radius: 8 -} - -BoxInsetShadow { - anchors.fill: backgroundRect - z: DTK.AboveOrder - shadowBlur: 40 - spread: 1 - shadowColor: Qt.rgba(0, 0, 0) - cornerRadius: backgroundRect.radius -} -//! [2] -//! [3] -Rectangle { - id: backgroundRect - - color: Qt.rgba(1, 0, 0, 0.4) - width: 200 - height: 200 - radius: 8 -} - -BoxInsetShadow { - anchors.fill: backgroundRect - z: DTK.AboveOrder - shadowBlur: 2 - spread: 10 - shadowColor: Qt.rgba(0, 0, 0) - cornerRadius: backgroundRect.radius -} -//! [3] -//! [4] -Rectangle { - id: backgroundRect - - color: Qt.rgba(1, 0, 0, 0.4) - width: 200 - height: 200 - radius: 8 -} - -BoxInsetShadow { - anchors.fill: backgroundRect - z: DTK.AboveOrder - shadowBlur: 2 - spread: 20 - shadowColor: Qt.rgba(0, 0, 0) - cornerRadius: backgroundRect.radius -} -//! [4] diff -Nru dtkdeclarative-5.6.3/doc/chinese/snippets/dtkdeclarative_example.cpp dtkdeclarative-5.6.10/doc/chinese/snippets/dtkdeclarative_example.cpp --- dtkdeclarative-5.6.3/doc/chinese/snippets/dtkdeclarative_example.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/snippets/dtkdeclarative_example.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -//! [0] -class Rectangle : public QWidget -{ -protected: - void paintEvent(QPaintEvent *) override { - QPainter pa(this); - pa.fillRect(0, 0, 100, 100, Qt::red); - } -}; -//! [0] -//! [1] -int main(int argc, char *argv[]) { - QApplication app(argc, argv); - - QWidget mainWidget; - mainWidget.resize(200, 200); - QHBoxLayout layout1(&mainWidget); - QPushButton btn1("Button 1"); - layout1.addWidget(&btn1); - QVBoxLayout layout2; - QPushButton btn2("Button 2"); - QLineEdit lineEdit; - layout2.addWidget(&btn2); - layout2.addWidget(&lineEdit); - layout1.addLayout(&layout2); - mainWidget.show(); - - return app.exec(); -} -//! [1] -//! [2] -int main(int argc, char *argv[]) { - QApplication app(argc, argv); - - QWidget widget; - widget.resize(300, 300); - QPushButton btn("Button", &widget); - btn.move(50, 50); - QObject::connect(&btn, &QPushButton::clicked, []() { - qDebug() << "Button Clicked..."; - }); - widget.show(); -} -//! [2] diff -Nru dtkdeclarative-5.6.3/doc/chinese/snippets/dtkdeclarative_qmlexample.qml dtkdeclarative-5.6.10/doc/chinese/snippets/dtkdeclarative_qmlexample.qml --- dtkdeclarative-5.6.3/doc/chinese/snippets/dtkdeclarative_qmlexample.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/snippets/dtkdeclarative_qmlexample.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -//! [0] -Rectangle { - width: 100 - height: 100 - color: "red" -} -//! [0] -//! [1] -Rectangle { - width: 400 - height: 200 - color: "blue" - - Button { - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - text: "Button 1" - } - - Button { - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - text: "Button 2" - } - - Label { - text: "Center" - color: "white" - anchors.centerIn: parent - } -} -//! [1] -//! [2] -RowLayout { - spacing: 20 - Button { - text: "Button 1" - // 设置Layout的附加属性 - Layout.fillWidth: true - Layout.minimumWidth: 50 - Layout.preferredWidth: 100 - Layout.maximumWidth: 300 - Layout.minimumHeight: 150 - } - - Label { - text: "Center" - } - - Button { - text: "Button 2" - // 设置Layout的附加属性 - Layout.fillWidth: true - Layout.minimumWidth: 100 - Layout.preferredWidth: 200 - Layout.preferredHeight: 100 - } -} -//! [2] -//! [3] -Button { - anchors.centerIn: parent - text: "Button" - // on 进行信号槽连接 - onClicked: { - console.log("Button clicked....."); - } -} -//! [3] diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/AboutActionDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/AboutActionDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/AboutActionDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/AboutActionDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/*! - \qmltype AboutAction - \inherits Action - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 一个用于显示在菜单界面的“关于”动作. - - 这是一个简单的关于动作,它与默认的菜单界面深度适配,用户能够通过点击菜单中的关于按键唤醒 - “关于”对话框,以便获取应用程序的相关信息。一般情况下,开发着无需重新实现该类型,只需进行 - 简单使用即可。 - - */ - -/*! - \qmlproperty Component org.deepin.dtk::AboutAction::aboutDialog - - 该属性用于表示关于对话框的组件,当需要自定义关于对话框时,该组件非常有效。 - 通常情况下,只需要将对应的对话框设置进该属性即可,例如以下代码: - \qml - import org.deepin.dtk 1.0 - - AbountAction { - aboutDialog: AboutDialog { - windowTitle: "example" - } - } - \endqml - - \sa AboutDialog - */ - diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/AboutDialogDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/AboutDialogDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/AboutDialogDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/AboutDialogDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -/*! - \qmltype AboutDialog - \inherits DialogWindow - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 一个用于显示应用程序关于界面的对话框. - - AboutDialog 是一个 DTK 风格的关于对话框,其被用于显示应用程序统一的关于界面,包括应用名称、描述、图标、版本等等。 - AboutDialog 具备 DialogWindow 的所有属性,也能够使用 DTK 中的 DWindow 来修改窗口的特殊信息。但这些应用程序 - 通常无需关心,DTK 的内部实现中已经完成。 - - 其设计效果如下图所示: - \image images/AboutDialog.png - - 其使用方式如下代码所示: - \qml - AboutDialog { - modality: Qt.NonModal - version: qsTr(String("Version: %1").arg(appVersion)) - productName: qsTr("dde-control-center") - productIcon: "action_setting" - companyLogo: "file://" + DTK.deepinDistributionOrgLogo - websiteName: DTK.deepinWebsiteName - websiteLink: DTK.deepinWebsiteLink - license: appLicense === "" ? "" : qsTr(String("%1 is released under %2").arg(appProductName).arg(appLicense)) - } - \endqml - */ - -/*! - \qmlproperty string org.deepin.dtk::AboutDialog::windowTitle - - windowTitle 属性用于控制 AboutDialog 的标题区域文本。 - */ - -/*! - \qmlproperty string org.deepin.dtk::AboutDialog::productName - - productName 属性用于控制 AboutDialog 的应用程序名称。 - */ - -/*! - \qmlproperty string org.deepin.dtk::AboutDialog::productIcon - - productIcon 属性用于控制 AboutDialog 的应用程序图标。其能够接受 DciIcon 和 QtIcon 的图标,但使用时请遵循图标主题规范来指定图标名称,否则可能出现 - 无法正确找到图标的情况。 - */ - -/*! - \qmlproperty string org.deepin.dtk::AboutDialog::version - - version 属性用于控制 AboutDialog 的应用程序版本信息。 - */ - -/*! - \qmlproperty string org.deepin.dtk::AboutDialog::description - - description 属性用于控制 AboutDialog 的应用程序内容描述。 - */ - -/*! - \qmlproperty string org.deepin.dtk::AboutDialog::license - - license 属性用于控制 AboutDialog 的应用程序许可证信息。 - */ - -/*! - \qmlproperty string org.deepin.dtk::AboutDialog::companyLogo - - companyLogo 属性用于控制 AboutDialog 的公司 LOGO,通常情况下,只需要使用 DTK.deepinDistributionOrgLogo 即可获取到 Logo 路径。 - 该 Logo 会根据系统信息自动变化,即 UOS 或 Deepin。 - */ - -/*! - \qmlproperty string org.deepin.dtk::AboutDialog::websiteName - - websiteName 属性用于控制 AboutDialog 的公司网站名称. - 通常情况下,只需要使用 DTK.deepinWebsiteName 即可自动根据系统版本信息,选择合适的网站。。 - */ - -/*! - \qmlproperty string org.deepin.dtk::AboutDialog::websiteLink - - websiteLink 属性用于控制 AboutDialog 的应用程序网站链接。 - 使用 DTK.deepinWebsiteLink 即可自动获取网站链接 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ActionButtonDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ActionButtonDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ActionButtonDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ActionButtonDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -/*! - \qmltype ActionButton - \inherits Button - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 一个仅用于显示 Action 的按钮. - - 这是一个用于显示附属在 Item 中用于展示动作的按钮。与传统的按钮不同的是,它不提供任何背景;不响应 Hover 动画;不实现任何阴影和模糊特效。 - 但它同样能够做出风格的视觉效果,这种效果是由 DciIcon 提供的。借助 DciIcon 丰富的视觉效果,ActionButton 能够实现下沉式阴影。 - 但由于 ActionButton 不提供任何背景,因此无法改变显示在其内部的图标颜色,因此放置在 ActionButton 中的 - 图标一般情况下都是固定颜色的图标,其效果如下图所示: - - \image images/ActionButton.png - - ActionButton 继承于 Button 因此可以使用 Button 中的所有属性,其也能够使用 ColorSelector 进行控件的颜色控制。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::ActionButton::textColor - - 该属性用于指定 ActionButton 中 DciIcon 中的前景色调色板,其类型为 Palette,能够根据 ActionButton 控件的 - 状态变化自动更新记录在其内部的颜色。 - 但请注意,修改此颜色仅针对 DciIcon 使用前景色调色板的图标有效果,对于不使用 - 任何调色板的图标或 Qt 的图标,将不存在任何效果。 - */ - diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/AlertToolTipDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/AlertToolTipDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/AlertToolTipDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/AlertToolTipDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/*! - \qmltype AlertToolTip - \inherits ToolTip - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 一个用于显示在编辑框控件中的警告提示信息类. - - AlertToolTip 是一个用于显示在 EditPanel 控件中的警告提示信息类,EditPanel 是 DTK 风格控件中所有编辑框区域的背景控件 - 因此,DTK已经实现了将 AlertToolTip 嵌套进编辑框的操作,使用其内置属性即可。 - - AlertToolTip 仅作为用于显示警告信息的浮动提示框,其文字会呈现出用于警告的红色字体。如下图所示: - \image images/AlertToolTip.png - - AlertToolTip 不会在显示后不会进行自动消失,可以通过时设置 visible 属性来手动控制其隐藏和显示,也可通过控制 timeout 属性动态控制超时时间后的隐藏。 - 该状态最好通过控件的某一属性控制实现特定情况的显示。 - - 目前 AlertToolTip 已经实现了在所有输入框控件的适配,如下图所示: - \image images/AlertToolTip_EditExam.png - - 对于该控件的进一步封装,可通过如下方式控制: - \table - \header - \li 属性 - \li AlertToolTip 属性 - \li 描述 - \row - \li alertText - \li AlertToolTip.text - \li 警告信息的文本 - \row - \li alertDuration - \li AlertToolTip.timeout - \li 警告信息显示的时长 - \row - \li showAlert - \li AlertToolTip.visible - \li 是否显示警告信息,该属性会在 timeout 结束后自动设置为false - \endtable - 需要强调的是,上述属性已经在所有编辑框控件中添加。 - */ - -/*! - \qmlproperty Item org.deepin.dtk::AlertToolTip::target - - \c target 属性用于控制 AlertToolTip 被附属的目标对象。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ApplicationWIndowDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ApplicationWIndowDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ApplicationWIndowDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ApplicationWIndowDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -/*! - \qmltype ApplicationWindow(FlowStyle) - \inherits ApplicationWindow - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief QML 应用程序的主程序窗口. - - 这是 DTK 继承 Qt Quick Control2 实现的程序主窗口控件,该控件添加了行云设计风格的调色板属性,DTK 的字体 - 绑定属性和窗口的标准颜色等。但请注意,该窗口并未自动做无标题和圆角等属性的处理,如需设置该窗口效果,请使用 - DWindow 附加属性。 - - 当未指定无标题和圆角等属性时,ApplicationWindow 的效果如下图所示: - \image images/ApplicationWindowNormal.png - - 如下代码: - \qml - import org.deepin.dtk 1.0 - - ApplicationWindow { - title: "qml-demo" - visible: true - width: 800 - height: 600 - } - \endqml - - 当指定窗口特效后, ApplicationWindow 的效果如下: - \image images/ApplicationWindowUseDWindow.png - 如下代码: - \qml - import org.deepin.dtk 1.0 - - ApplicationWindow { - title: "qml-demo" - visible: true - width: 800 - height: 600 - - DWindow.enabled: true - DWindow.windowRadius: 16 - } - \endqml - - ApplicationWindow 能够使用 DWindow 附加属性中的全部属性并能得到效果,下表列出了 DWindow 中存在的属性: - \table - \header - \li 属性名 - \li 描述 - \row - \li enabled - \li 开启窗口特效 - - \row - \li window - \li 当前所在的窗口实例 - - \row - \li windowRadius - \li 窗口圆角大小 - - \row - \li borderWidth - \li 窗口边框宽度 - - \row - \li borderColor - \li 窗口边框颜色 - - \row - \li shadowRadius - \li 窗口阴影半径 - - \row - \li shadowOffset - \li 窗口阴影的偏移距离,包含水平偏移和竖直偏移 - - \row - \li shadowColor - \li 窗口阴影颜色 - - \row - \li translucentBackground - \li 窗口背景透明 - - \row - \li enableSystemResize - \li 开启窗口更改大小功能 - - \row - \li enableSystemMove - \li 开启窗口移动功能 - - \row - \li enableBlurWindow - \li 开启窗口模糊功能 - - \row - \li alphaBufferSize - \li 窗口的 alpha 缓冲大小 - - \row - \li clipPath - \li 窗口的剪切路径 - - \row - \li wmWindowTypes - \li 窗管控制下的窗口类型 - - \row - \li motifFunctions - \li 窗管控制下的窗口功能函数 - - \row - \li overlayExited - \li Preload 加速框架中的加载完成退出动画 - - \row - \li loadingOverlay - \li Preload 正在加载中的自定义等待控件 - - \row - \li appLoader - \li Preload 框架中的主组件实例 - \endtable - */ - diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ArrowListViewDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ArrowListViewDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ArrowListViewDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ArrowListViewDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/*! - \qmltype ArrowListView - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 自带向上和向下箭头的 ListView 控件. - - ArrowListView 控件是对 ListView 控件的拓展, ArrowListView 控件自带 - 向上和向下箭头,支持当当鼠标放在向上和向下箭头时列表内容自动滚动的交互。 该控件 - 被广泛应用在 Menu 和 ComboBox 控件中。其效果如下图所示: - - \image images/ArrowListView.png - */ - -/*! - \qmlproperty int org.deepin.dtk::ArrowListView::maxVisibleItems - - ArrowListView 控件的最大可视项的数量。默认情况下,该值为 16。当超过该数量 - 时,ArrowListView 的高度不会再根据内容发生变化,形成滚动区域,并显示向上和 - 向下按钮。当可视项数量不足该值时,向上和向下按钮将不会显示。 - */ - -/*! - \qmlproperty int org.deepin.dtk::ArrowListView::itemHeight - - ArrowListView 中项的高度。由于 ArrowListView 无法获取每一项的高度,因此使用 - maxVisibleItems 时需要手动指定每一项的高度。默认情况下该高度为 30 - */ - -/*! - \qmlproperty Item org.deepin.dtk::ArrowListView::view - - ArrowListView 内部使用的 ListView 实例,访问 view 属性能够访问到内部 ListView - 中的全部熟悉。 - \sa ListView - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/BoxInsetShadowDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/BoxInsetShadowDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/BoxInsetShadowDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/BoxInsetShadowDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -/*! - \qmltype BoxInsetShadow - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种内阴影控件. - - BoxInsetShadow 是一种用于实现控件的内阴影特效的实现,内阴影不会占用控件之外的区域 - ,当内阴影的颜色存在透明度时,会根据阴影效果渐变填充。 - - 内阴影推荐使用 anchors 进行锚布局填充,手动指定宽度和高度为固定值可能无法跟随宿主控件 - 的款高变化发生改变。 - - 内阴影和外阴影一致,可以控制:圆角系数、模糊大小、偏移量大小、扩散大小和阴影颜色等属性。 - 其使用方式如下所示: - \snippet snippets/dtkdeclarative_boxinsetshadow.qml 0 - - 效果如下所示: - \image images/BoxInsetShadowExample1.png - - 圆角系数当不指定时默认为直角效果。 - 模糊大小越大,其模糊范围越广,模糊程度越高,例如下表效果比较: - \table - \header - \li 模糊系数 - \li 代码 - \li 效果展示 - \row - \li 2 - \li \snippet snippets/dtkdeclarative_boxinsetshadow.qml 0 - \li \image images/BoxInsetShadowExample1.png - \row - \li 20 - \li \snippet snippets/dtkdeclarative_boxinsetshadow.qml 1 - \li \image images/BoxInsetShadowExample2.png - \row - \li 40 - \li \snippet snippets/dtkdeclarative_boxinsetshadow.qml 2 - \li \image images/BoxInsetShadowExample3.png - \endtable - 扩散大小越大,阴影范围越广,如下表效果比较: - \table - \header - \li 扩散系数 - \li 代码 - \li 效果展示 - \row - \li 1 - \li \snippet snippets/dtkdeclarative_boxinsetshadow.qml 1 - \li \image images/BoxInsetShadowExample1.png - \row - \li 10 - \li \snippet snippets/dtkdeclarative_boxinsetshadow.qml 3 - \li \image images/BoxInsetShadowExample4.png - \row - \li 20 - \li \snippet snippets/dtkdeclarative_boxinsetshadow.qml 4 - \li \image images/BoxInsetShadowExample5.png - \endtable - */ - -/*! - \qmlproperty real org.deepin.dtk::BoxInsetShadow::cornerRadius - - cornerRadius 属性表示内阴影控件的圆角大小,当内阴影控件的宿主控件是一个具有圆角的 - 控件时,该属性能够和宿主控件的圆角大小保持一致。 - */ - -/*! - \qmlproperty real org.deepin.dtk::BoxInsetShadow::shadowBlur - - shadowBlur 系数表示内阴影控件的模糊系数,该值越大表示边界区域的模糊大小越大。默认值为 10。 - */ - -/*! - \qmlproperty real org.deepin.dtk::BoxInsetShadow::shadowOffsetX - - shadowOffsetX 属性表示内阴影控件的 X 轴偏移量。默认值为 0 - */ - -/*! - \qmlproperty real org.deepin.dtk::BoxInsetShadow::shadowOffsetY - - shadowOffsetY 属性表示内阴影控件的 Y 轴偏移量。默认值为 0 - */ - -/*! - \qmlproperty color org.deepin.dtk::BoxInsetShadow::shadowColor - - shadowColor 属性表示内阴影控件的阴影颜色,默认为 "black" - */ - -/*! - \qmlproperty real org.deepin.dtk::BoxInsetShadow::spread - - spread 属性表示内阴影控件的扩散大小,该值越大表示扩散距离越深。 - */ - diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/BoxPanelDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/BoxPanelDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/BoxPanelDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/BoxPanelDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -/*! - \qmltype BoxPanel - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一个盒子面板控件. - - BoxPanel 提供一个通用的盒子面板控件,它自带了内置的内外阴影特效,被 - 使用在 Button 和 ButtonBox 控件中作为基础控件使用。 BoxPanel 通常 - 被用作控件的背景,默认情况下,该控件在亮色主题下的效果如下图所示: - - \image images/BoxPanelExample1.png - - 通过更改 BoxPanel 的属性,可以改变 BoxPanel 的圆角大小、背景颜色、阴影颜色、模糊系数等等。 - 例如下述代码,可以将 BoxPanel 的颜色修改为渐变色: - - \qml - BoxPanel { - width: 200 - height: 200 - - radius: width / 2 - color1: D.Palette { - normal: "#228B22" - } - color2: D.Palette { - normal: "#00CED1" - } - } - \endqml - - 效果如下图所示: - \image images/BoxPanelExample2.png - - 当然如果不满足阴影和边框的效果,也可以通过控制阴影的大小实现自定义阴影, - 如下述代码所示: - \qml - BoxPanel { - width: 200 - height: 200 - - radius: width / 2 - color1: Palette { - normal: "#228B22" - } - color2: Palette { - normal: "#00CED1" - } - - outsideBorderColor: Palette { - normal: "#008B8B" - } - - dropShadowColor: Palette { - normal: "#008080" - } - - innerShadowColor1: Palette { - normal: "#006400" - } - - innerShadowColor2: Palette { - normal: "#87CEFA" - } - - boxShadowBlur: 10 - innerShadowOffsetY1: -2 - } - \endqml - - 效果如下图所示: - \image images/BoxPanelExample3.png - */ - -/*! - \qmlproperty int org.deepin.dtk::BoxPanel::radius - - \c radius 盒子面板的圆角大小。默认情况下, radius 的值跟系统风格中的圆角值保持一致。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::BoxPanel::color1 - - \c color1 属性代表 BoxPanel 控件背景的渐变色1, 当 color1 属性和 color2 属性相同时, - BoxPanel 的背景为一个纯色背景。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::BoxPanel::color2 - - \c color2 属性和 color1 属性类似,表示 BoxPanel 控件的第二背景色,当 color2 的颜色与 color1 - 不同时,表示该背景色为渐变色。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::BoxPanel::outsideBorderColor - - \c outsideBorderColor 属性表示 BoxPanel 控件的外边框颜色 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::BoxPanel::dropShadowColor - - \c dropShadowColor 属性表示 BoxPanel 控件的阴影颜色 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::BoxPanel::innerShadowColor1 - - \c innerShadowColor1 属性表示 BoxPanel 控件的第一内阴影色, BoxPanel 共有两种 - 内阴影,innerShadowColor1 是可以变化内阴影,可通过控制 innerShadowOffsetY1 属性 - 调整第一内阴影的 y 坐标偏移量。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::BoxPanel::innerShadowColor2 - - \c innerShadowColor2 属性表示 BoxPanel 控件的第二内阴影色,第二内阴影为固定的内阴影 - 其位置固定在 BoxPanel 控件内,阴影效果除阴影颜色外不允许外部改变。 - */ - -/*! - \qmlproperty int org.deepin.dtk::BoxPanel::boxShadowBlur - - \c boxShadowBlur 属性表示 BoxPanel 控件的阴影模糊系数,默认情况下该系数大小为 6。 - 扩大和缩小该系数能够增加和缩小阴影的模糊范围。 - */ - -/*! - \qmlproperty int org.deepin.dtk::BoxPanel::boxShadowOffsetY - - \c boxShadowOffsetY 属性表示 BoxPanel 控件的阴影 y 坐标偏移量。默认情况下,该偏移量的值 - 为 BoxPanel 的阴影会向下偏移 4 个像素的大小。 - */ - -/*! - \qmlproperty int org.deepin.dtk::BoxPanel::innerShadowOffsetY1 - - \c innerShadowOffsetY1 属性表示 BoxPanel 控件第一内阴影的 y 坐标偏移量。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/BoxShadowDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/BoxShadowDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/BoxShadowDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/BoxShadowDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,167 +0,0 @@ -/*! - \qmltype BoxShadow - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种盒子阴影控件. - - BoxShadow 是 DTK 提供的一种兼容软件渲染和硬件渲染的盒子阴影控件。无论应用处在哪种环境(软件和硬件) - 应用所表现出来的效果一致。 - - BoxShadow 控件通常使用 anchors 对目标控件进行填充。根据内部的模糊系数、阴影颜色等等,作用在 - 目标控件中。当然由于 QML 绘制项的层级关系,应当将 BoxShadow 放在目标控件之前创建,或手动修改 - BoxShadow 的 z 属性,以便保证 BoxShadow 控件在目标控件的底部,防止目标控件被阴影控件覆盖。 - - BoxShadow 的简单用法如下所示: - \qml - BoxShadow { - anchors.fill: boxShadowSource - shadowBlur : 20 - shadowColor : Qt.rgba(0, 0, 0, 0.5) - shadowOffsetX : 0 - shadowOffsetY : 0 - cornerRadius: boxShadowSource.radius - } - - Rectangle { - id: boxShadowSource - width: 200 - height: 200 - color: "#D2691E" - radius: 20 - } - \endqml - - 效果如下图所示: - \image images/BoxShadowExample1.png - - 当目标控件是一个带有不透明颜色的控件时,通常我们需要打开 hollow 属性,是为了带有透明 - 部分的目标控件所在区域和底部的 BoxShadow 区域颜色混合的情况,例如以下代码: - \qml - BoxShadow { - anchors.fill: boxShadowSource - shadowBlur : 20 - shadowColor : Qt.rgba(0, 0, 0, 0.5) - shadowOffsetX : 0 - shadowOffsetY : 0 - cornerRadius: boxShadowSource.radius - hollow: true - } - - Rectangle { - id: boxShadowSource - width: 200 - height: 200 - color: Qt.rgba(0.82, 0.71, 0, 0.6) - radius: 20 - } - \endqml - - 控件使用 hollow 属性和未使用 hollow 属性的效果对比如下: - - \table - \header - \li hollow - \li 效果 - \row - \li false - \li \image images/BoxShadowExampleNoHollow.png - \row - \li true - \li \image images/BoxShadowExampleWithHollow.png - \endtable - */ - -/*! - \qmlproperty real org.deepin.dtk::BoxShadow::cornerRadius - - \c cornerRadius 属性表示 BoxShadow 的圆角大小。通常情况下,该大小需要与 - 目标控件的圆角大小保持一致。 - */ - -/*! - \qmlproperty real org.deepin.dtk::BoxShadow::shadowBlur - - \c shadowBlur 属性表示 BoxShadow 的阴影模糊系数,模糊系数越大,阴影的模糊程度越高。 - 默认情况下,该属性的值为 10。 - - 例如下述效果展示,其他属性保持一致的情况下,只修改 shadowBlur 值的大小,会发现 BoxShaow - 的阴影大小会随之增加。 - - \table - \header - \li shadowBlur 系数 - \li 效果 - - \row - \li 2 - \li \image images/BoxShadowExampleBlur2.png - - \row - \li 10 - \li \image images/BoxShadowExampleBlur10.png - - \row - \li 20 - \li \image images/BoxShadowExample1.png - - \row - \li 40 - \li \image images/BoxShadowExampleBlur40.png - - \endtable - */ - - -/*! - \qmlproperty real org.deepin.dtk::BoxShadow::shadowOffsetX - - \c shadowOffsetX 属性表示 BoxShadow 的 x 坐标偏移大小。 默认情况下,该值为 0 - */ - -/*! - \qmlproperty real org.deepin.dtk::BoxShadow::shadowOffsetY - - \c shadowOffsetY 属性表示 BoxShadow 的 y 坐标偏移大小。 默认情况下,该值为 0 - */ - -/*! - \qmlproperty color org.deepin.dtk::BoxShadow::shadowColor - - \c shadowColor 属性表示 BoxShadow 的阴影颜色。默认情况下,该颜色为 "black" - */ - -/*! - \qmlproperty real org.deepin.dtk::BoxShadow::spread - - \c spread 属性表示 BoxShadow 的阴影扩散系数,扩散系数越大,表示阴影越 - 能向外扩散,通常情况下,spread 的值为 0。 - - 扩散距离的效果展示如下表所示: - \table - \header - \li spread 系数 - \li 效果 - - \row - \li 0 - \li \image images/BoxShadowExample1.png - \row - \li 2 - \li \image images/BoxShadowExampleSpread2.png - \row - \li 5 - \li \image images/BoxShadowExampleSpread5.png - \row - \li 10 - \li \image images/BoxShadowExampleSpread10.png - - \endtable - */ - -/*! - \qmlproperty bool org.deepin.dtk::BoxShadow::hollow - - \c hollow 属性表示 BoxShadow 是否指定为空洞属性,当 hollow 属性为 true 时 - BoxShadow 会去掉和目标控件重合的部分。默认情况下,该值为 false. - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/BusyIndicatorDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/BusyIndicatorDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/BusyIndicatorDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/BusyIndicatorDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/*! - \qmltype BusyIndicator(FlowStyle) - \inherits BusyIndicator - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种趣味交互的等待控件. - - \l {BusyIndicator(FlowStyle)}{BusyIndicator} 控件是 DTK 重新实现 QML 风格 - 以适配行云设计风格的控件。它用于进行用户界面等待时的界面交互,提示用户需要进行等待 - 才能继续操作。 - Qt5.11 版本下,当用户逻辑阻塞 GUI 线程导致卡顿时,\l {BusyIndicator(FlowStyle)}{BusyIndicator} 控件也会卡顿。 - Qt5.15 版本后,Qt 新增在其他线程渲染 GUI 和动画极大的改善了这个问题。 - - \l {BusyIndicator(FlowStyle)}{BusyIndicator} 的效果如下图所示: - \image images/BusyIndicator.gif - */ - -/*! - \qmlproperty Palette org.deepin.dtk::BusyIndicator(FlowStyle)::fillColor - - fillColor 属性可填充 BusyIndicator 控件的前景。默认情况下,使用调色板中的活动色填充该属性。 - 可通过自定义颜色来控制不同的颜色。 - - 也可以通过将 BusyIndicator 放置在带背景的控件中,混合成一种控件,增加视觉效果,例如下述代码: - \qml - Rectangle { - width: 200 - height: 200 - - color: "#8a8a8a" - BusyIndicator { - anchors.fill: parent - running: true - fillColor: Palette { - normal: "#ffffff" - } - } - } - \endqml - 效果如下图所示: - \image images/BusyIndicatorFlat.png -*/ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ButtonBoxDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ButtonBoxDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ButtonBoxDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ButtonBoxDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/*! - \qmltype ButtonBox - \inherits Control - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 一种按钮样式的组合控件,可用于放置多个按钮形成组合按钮. - - ButtonBox 控件提供一种按钮的组合控件,其内部用于存放多个按钮,在同一个 ButtonBox 下的 - 不同按钮,其内部只能存在一种 checked 状态的按钮,且 checked 状态下的按钮呈现高亮的状态。 - - 例如以下样式: - \image images/ButtonBoxExample.png - - 在 ButtonBox 中,使用 ToolButton 控件最妥当,是因为 ToolButton 更容易使用特殊的 - 图标和文字的排列方式,放置在 ButtonBox 中更加灵活。 - - 其使用方式如下代码所示: - \qml - ButtonBox { - anchors.centerIn: parent - - ToolButton { - text: "Button1" - checked: true - } - - ToolButton { - text: "Button2" - } - } - \endqml -*/ - - -/*! - \qmlproperty list org.deepin.dtk::ButtonBox::buttons - \default - - \c buttons 属性为默认属性,因此,使用时无需强制指定该属性,其内部的子控件 - 默认会全部添加到该属性中。 - - \c buttons 属性用于存储 ButtonBox 控件中放置的按钮。 - */ - -/*! - \qmlproperty alias org.deepin.dtk::ButtonBox::group - - \c group 属性表示 ButtonBox 内部使用的 ButtonGroup 对象。 \c ButtonGroup - 的作用为,仅将其内部选中的 Button 对象作为 checked 状态的对象,即其内部只存在一个 - checked 对象。 当然,可以通过 \c group 中的 exclusive 属性来禁用该特性。 - - 外部可以通过 group 中的 ButtonGroup::addButton 和 ButtonGroup::removeButton 函数 - 动态操作其内部的元素。 - - \sa ButtonGroup - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ButtonDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ButtonDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ButtonDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ButtonDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/*! - \qmltype Button(FlowStyle) - \inherits Button - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 Button 控件. - - \l {Button(FlowStyle)}{Button} 控件提供行云设计风格的按钮控件。其风格旨在提供 - 一种简约、友好和生命力的效果。设计中,\l {Button(FlowStyle)}{Button} 使用了大量的内外阴影、渐变和内外边框。 - 同时,针对按钮不同状态的颜色调整也做了统一整合,添加了鼠标悬浮时的进入进出动画等等。 - - 同时,针对 \l {Button(FlowStyle)}{Button} 控件衍生的各个其他风格的按钮控件,例如 ActionButton、RecommandButton、WarningButton - 等等也很好的进行展示。 - - \l {Button(FlowStyle)}{Button} 控件能够使用 QtIcon 和 DciIcon 两种,在使用上,二者没有太大的差异。 - 都只需要指定名称和大小, \l {Button(FlowStyle)}{Button} 也支持添加 indicator 控件,一般情况下, - indicator 的位置在 \l {Button(FlowStyle)}{Button} 的最右侧。 - - \l {Button(FlowStyle)}{Button} 控件在不同状态时的效果展示如下图所示: - \image images/ButtonExample.png - - 除此之外,Button 还支持 Common 和 Crystal 两种不同的 \l {Palette color family}{颜色族}, 通常 - 情况下,使用 Button 不需要考虑颜色族的场景,其内部会在不同场景进行适配。 - Common 和 Crystal 颜色族的效果如下: - - \image images/ButtonColorFamily.png - - Crystal 颜色族下的 Button 取消了 hover 动画和部分阴影效果,但其使用了一种透明效果, - 目的是可以很清晰的看到其背后的控件内容,例如下述效果展示: - - \image images/ButtonCrystalCompare.png -*/ - -/*! - \qmlproperty Palette org.deepin.dtk::Button(FlowStyle)::textColor - - textColor 属性为文字颜色所表示的属性值, 默认情况下 textColor 会根据 Button - 的状态发生改变,例如 checked; highlight等等。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ButtonIndicatorDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ButtonIndicatorDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ButtonIndicatorDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ButtonIndicatorDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/*! - \qmltype ButtonIndicator - \inherits Rectangle - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供 Button 控件内部使用的按钮指示器. - - - ButtonIndicator 作为 \l {Button(FlowStyle)}{Button} 控件中的 - 内部控件,其目的是作为一个按钮指示器。在功能上没有任何增加,仅是对控件 - 效果进行了轻微调整。 - - 其使用方式如下代码所示: - \qml - ToolButton { - icon.name: "action_newfolder" - indicator: ButtonIndicator { } - } - \endqml - 或者 - \qml - Button { - icon.name: "action_compress" - text: "压缩方式" - indicator: ButtonIndicator { } - } - \endqml - - 其效果分别为: - \image images/ButtonIndicatorForToolButton.png - 和 - \image images/ButtonIndicatorForButton.png - */ - -/*! - \qmlproperty Palette org.deepin.dtk::ButtonIndicator::backgroundColor - - \c backgroundColor 用来控制 ButtonIndicator 控件中的背景颜色。\c backgroundColor - 作为 Palette 类型能够自动适配深浅主题。 - 通常情况下,\c backgroundColor 属性已经被设置过,使用时无需关心,当需要自定义颜色时 - 可以通过重新定义该值来完成。 - */ - diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ButtonPanelDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ButtonPanelDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ButtonPanelDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ButtonPanelDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -/*! - \qmltype ButtonPanel - \inherits BoxPanel - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 统一的按钮背景面板. - - ButtonPanel 是所有 Button 控件的背景面板。其作为按钮控件的 - 统一背景进行展示,内部根据按钮控件的各种状态进行了颜色的自动调整。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/CheckBoxDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/CheckBoxDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/CheckBoxDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/CheckBoxDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/*! - \qmltype CheckBox(FlowStyle) - \inherits CheckBox - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 CheckBox 控件. - - \l {CheckBox(FlowStyle)}{CheckBox} 兼容 CheckBox 的所有属性和接口, 其 - 针对行云设计风格,进行了整体的样式修改。分为三种 Check 状态,分别为 Qt.Unchecked; - Qt.PartiallyChecked 和 Qt.Checked 这三种状态由三种不同的样式组成。 - - 其展示效果如下图所示: - \table - \header - \li 状态 - \li 模式 - \li 效果 - \row - \li {1, 3} Qt.Unchecked - \li normal - \li \image images/CheckBoxUnCheckedNormal.png - \row - \li hovered - \li \image images/CheckBoxUnCheckedHovered.png - \row - \li pressed - \li \image images/CheckBoxUnCheckedPressed.png - \row - \li {1, 3} Qt.PartiallyChecked - \li normal - \li \image images/CheckBoxPartiallyCheckedNormal.png - \row - \li hovered - \li \image images/CheckBoxPartiallyCheckedHovered.png - \row - \li pressed - \li \image images/CheckBoxPartiallyCheckedPressed.png - \row - \li {1, 3} Qt.Checked - \li normal - \li \image images/CheckBoxCheckedNormal.png - \row - \li hovered - \li \image images/CheckBoxCheckedHovered.png - \row - \li pressed - \li \image images/CheckBoxCheckedPressed.png - \endtable - - \note \l {CheckBox(FlowStyle)}{CheckBox} 控件的效果由 DciIcon 提供。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/CheckDelegateDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/CheckDelegateDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/CheckDelegateDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/CheckDelegateDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/*! - \qmltype CheckDelegate(FlowStyle) - \inherits CheckDelegate - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 CheckDelegate 控件. - - \l {CheckDelegate(FlowStyle)}{CheckDelegate} 控件是 ListView 控件中用于多选 - 的代理控件。其功能在于对列表中的多个列表项进行框选和高亮。 - - CheckDelegate(FlowStyle) 兼容 CheckDelegate 中的所有接口,同时也提供了 - 其他属性用于自定义化。例如 CheckDelegate 兼容了 DciIcon 图标类型,能够友好 - 的使用 DciIcon 进行图标绘制,另外 CheckDelegate 可通过外部接口修改背景色, - 文字控件等等。 - - CheckDelegate(FlowStyle) 的效果如下图所示: - \image images/CheckDelegate.png - - 所使用的代码如下: - \qml - ListView { - implicitHeight: contentHeight - width: 160 - model: 4 - spacing: 10 - - delegate: DheckDelegate { - text: "标题" - icon.name: "action_setting" - checked: index === ListView.view.count - 1 - } - } - \endqml - */ - -/*! - \qmlproperty Component org.deepin.dtk::CheckDelegate(FlowStyle)::content - - \c content 属性用于指定 CheckDelegate(FlowStyle) 控件的内容控件,默认情况下,它 - 为一个 Label 控件,用于存放 CheckDelegate(FlowStyle) 中设置过的 \c text 属性。 - - 当重新实现 \c content 时,需要自己实现对 \c text 属性的支持。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::CheckDelegate(FlowStyle)::backgroundColor - - \c backgroundColor 属性用于控制 CheckDelegate(FlowStyle) 的背景颜色。 \c backgroundColor - 的属性为 Palette 类型。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ComboBoxDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ComboBoxDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ComboBoxDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ComboBoxDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -/*! - \qmltype ComboBox(FlowStyle) - \inherits ComboBox - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 ComboBox 控件. - - - \l {ComboBox(FlowStyle)}{ComboBox} 控件提供了行云设计风格的组合框控件, - 其背景使用跟按钮相似的背景,弹出框使用 Popup 控件实现,相比于默认的 ComboBox - 控件,行云设计风格的 \l {ComboBox(FlowStyle)}{ComboBox} 实现了自定义图标, - 并且在编辑和非编辑状态下,能够不同的风格展现。 - - \l {ComboBox(FlowStyle)}{ComboBox} 的效果如下图所示: - \table - \row - \li 编辑状态 - \li \image images/ComboBoxEditable.png - \row - \li 非编辑状态 - \li \image images/ComboBoxNotEdit.png - \row - \li 弹出状态 - \li \image images/ComboBoxPopup.png - \endtable - - \l {ComboBox(FlowStyle)}{ComboBox} 默认的文字添加方式可以通过正常的 model 进行添加, - 如下代码所示: - \qml - ComboBox { - anchors.centerIn: parent - model: ["Banana", "Apple", "Coconut"] - } - \endqml - - 如果想要在每项上添加图标进行展示,可以通过 ListModel 实现,如下代码所示: - \target CombobBox icon usage - \qml - ComboBox { - textRole: "text" - iconNameRole: "icon" - - model: ListModel { - ListElement { text: "Banana"; icon: "action_setting" } - ListElement { text: "Apple"; icon: "action_newfolder" } - ListElement { text: "Coconut"; icon: "action_share" } - } - } - \endqml - */ - -/*! - \qmlproperty string org.deepin.dtk::ComboBox(FlowStyle)::iconNameRole - - \c iconNameRole 属性用于控制图标名称。由于默认的 ComboBox 只支持使用文字,而不支持添加图标,因此这里为 - 了进行 ComboBox 的拓展,方便程序使用 ComboBox 时能够快速的添加图标。 - \warning 请注意,该属性需要配合 ListModel 中进行使用 - \l {CombobBox icon usage} {ComboBox Icon 的用法} - */ - -/*! - \qmlproperty string org.deepin.dtk::ComboBox(FlowStyle)::alertText - - \c alertText 属性用于表示 ComboBox 提示的警告信息。用于提示用户输入的信息有误。 - - 请注意,当 ComboBox 的 editable 属性打开时, alertText 属性才能生效。而在非编辑 - 状态下,该属性无效。 - - 其用法如下所示: - \qml - ComboBox { - anchors.centerIn: parent - textRole: "text" - iconNameRole: "icon" - alertText: "Only for strings." - showAlert: true - editable: true - - model: ListModel { - ListElement { text: "Banana"; icon: "action_setting" } - ListElement { text: "Apple"; icon: "action_newfolder" } - ListElement { text: "Coconut"; icon: "action_share" } - } - } - \endqml - - 效果如下图所示: - \image images/ComboBoxAlert.png - */ - -/*! - \qmlproperty int org.deepin.dtk::ComboBox(FlowStyle)::alertDuration - - \c alertDuration 属性表示警告信息的提示时长。默认情况下,如果不设置时长,将会一致显示。 - \c alertDuration 的单位是 毫秒(ms)。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::ComboBox(FlowStyle)::showAlert - - \c showAlert 属性用于决定是否显示警告信息。一般情况下,显示警告信息的条件需要满足错误的输入情况。 - 当 \c alertDuration 属性的时间结束时, showAlert 将自动更改为 false否则,\c showAlert 属 - 性需要手动控制为 false。 - */ - -/*! - \qmlproperty int org.deepin.dtk::ComboBox(FlowStyle)::maxVisibleItems - - \c maxVisibleItems 属性用于控制 Popup 窗口显示的最大条目数。默认情况下,该最大值为 16,当超过 - 该值时,Popup 窗口开始变成滚动状态,访问其余项需要通过滚动完成。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::ComboBox(FlowStyle)::separatorColor - - \c separatorColor 属性用于控制 \l {ComboBox(FlowStyle)}{ComboBox} 在编辑状态下,左侧输入框和 - 右侧下拉按钮中间分隔部分的颜色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dcoloroverlay.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dcoloroverlay.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dcoloroverlay.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dcoloroverlay.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -/*! - \qmltype ColorOverlay - \inherits Item - \inqmlmodule org.deepin.dtk - \keyword DColorOverlay - \brief 一个同时支持软件和硬件渲染的颜色覆盖控件. - - 这是一种同时支持软件渲染和硬件渲染的颜色覆盖控件,其作用是为源控件 - 覆盖用户想要的自定义颜色。其同时支持软件渲染和硬件渲染两种模式,在 - 硬件渲染下,其和 Qt Graphical Effects 模块的 ColorOverlay 用法 - 一致,软件渲染模式下,其只能做到对单一颜色的覆盖,无法做到 alpha 的 - 像素点混合这种效果。 - - ColorOverlay 在 DTK 中被用在 BusyIndicator 的颜色覆盖上,如自定义 - 不同颜色的 BusyIndicator,应用使用该控件控制例如需要被高亮色进行颜色 - 覆盖的场景。 - - \image images/coloroverlay_Spinner.png - - 它可以对一般控件进行颜色覆盖,其使用方式如下所示: - \qml - import org.deepin.dtk 1.0 - - Rectangle { - id: rect - - width: 100 - height: 100 - color: "gray" - visible: false - } - - ColorOverlay { - anchors.fill: rect - source: rect - color: "red" - } - \endqml - 其效果如下: - \image images/renderRedRect.png - - 也可以对图片进行颜色覆盖,其使用方式如下所示: - \qml - import org.deepin.dtk 1.0 - - Image { - id: img - sourceSize { - width: 100 - height: 100 - } - source: "/path/to/image.png" - visible: false - } - - ColorOverlay { - anchors.fill: img - source: img - color: "red" - } - \endqml - - 其效果如下: - \table - \header - \li 原图 - \li 对比图 - \row - \li \image images/coloroverlay_imageSouce.png - \li \image images/coloroverlay_imageOverlay.png - \endtable - */ - -/*! - \qmlproperty bool org.deepin.dtk::ColorOverlay::cached - - 该属性用于指定是否启用缓存,当源数据的状态不会发生动态改变时,开启缓存 - 能够大幅提高渲染性能。该属性在硬件渲染(GPU渲染)模式下默认为 false, - 在软件渲染(CPU渲染)模式下为 true. - */ - -/*! - \qmlproperty color org.deepin.dtk::ColorOverlay::color - - 该属性用于指定覆盖的颜色,未指定即表示不覆盖任何颜色。 - - 在硬件渲染(GPU渲染)模式下,\c color 能够跟每个像素点的颜色进行 - alpha通道混合,保证每个像素点在混合后的多样化。软件渲染模式下,该 - 颜色混合通常使用 Qt 的混合模式进行混合。 - */ - -/*! - \qmlproperty color org.deepin.dtk::ColorOverlay::source - - 该属性用于指定颜色覆盖的源,它可以是一个一般控件,也可以是图片等资源数据. - 但不支持将自身作为源进行眼哦色覆盖. - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dconfigwrapper.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dconfigwrapper.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dconfigwrapper.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dconfigwrapper.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/*! - \qmltype Config - \inherits QtObject - \inqmlmodule org.deepin.dtk - \keyword DConfigWrapper - \brief 一个 DTK 配置项中的配置信息类. - - Config 用于提供专门为 DSG配置管理的统一的读写函数,其主要用于更方便的在 SettingsDialog 中进行配置项的实时更新,当然 - SettingDialog 是作为用于前端配置信息展示的窗口,为了提供自定义配置,该类允许放置在自定义的控件上。 - - 该类会读取 name 中指定的文件名的文件中存在的属性,当其控件内部存在该配置文件中同名的属性时,对该属性上的所有修改,都将 - 在文件内对应的同名配置项中生效。 - - 例如以下代码: - - \qml - import org.deepin.dtk 1.0 - - Config { - name: "example" - property string key : "key default" - } - \endqml - - 同样地,当配置文件中名为 "key" 的配置项发生了数据改变,该 Config 的 key 属性也会触发 changed 信号。 - - 需要注意的是,当 Config 中添加了配置文件中不存在的配置项属性,该配置文件不会检测并添加一个新的配置项,其属性的改变也不会对 - 配置文件造成任何修改。同样地,当配置文件中存在配置项,而 Config 中并未添加同名属性时,该配置项的改变不会触发 Config 中任 - 何属性的变化。 - */ - -/*! - \qmlproperty string org.deepin.dtk::Config::name - - 指定配置文件名称。 - */ - -/*! - \qmlmethod Config::value(string key, variant fallback) - - 获取配置文件中对应 \a key 下的值,当 \a key 获取不到时返回 \a fallback 的值。 - 该函数除了可以访问在 Config 中添加了同名属性的配置项外,也能获取为设置属性的额外 - 配置项。 - */ - -/*! - \qmlmethod Config::setValue(string key, variant value) - - 设置 \a key 下的 \a value 值,该函数只能设置配置文件中 \a key 对应的值,对于 - \a key 是一个不存在或非法值,该函数无法正确设置。 - */ - -/*! - \qmlmethod Config::keyList() - - 获取该 Config 项下的所有键值列表。 - */ - -/*! - \qmlmethod Config::isValid() - - 判断当前 Config 是否有效。如果有效返回 \c true 否则返回 \c false。 - */ - -/*! - \qmlsignal Config::valueChanged(string key) - - 该信号在 \a key 对应的配置项内容发生改变时发出,通常情况下,如果 Config 中存在一个同名的 - 配置项属性时,无需在使用该信号检测配置项的改变。而直接使用属性槽函数绑定的形式进行。但对于 - 没创建对应属性的配置项,可以通过该信号检测到 \a key 对应的配置项值的变化。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/DialogTitleBarDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/DialogTitleBarDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/DialogTitleBarDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/DialogTitleBarDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/*! - \qmltype DialogTitleBar - \inherits Control - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief DialogWindow 中的标题栏控件. - - DialogTitleBar 是 DialogWindow 中的标题栏控件,相比默认的标题栏,只有图标,标题和简单的关闭按钮。 - 但和默认的标题栏也有相似之处:都能进行窗口模糊设置;都可以添加自定义内容。 - - 通常情况下,使用 DialogWindow 时无需重新创建 DialogTitleBar ,默认提供的标题栏会满足大多数的使用场景,当无法满足时, - 可以通过继承它重新实现。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::DialogTitleBar::content - - \c content content 属性作为 DialogTitleBar 中一个自定义标题栏部分,可以添加应用程序自定义的控件 - \c content 属性的类型为 Component, 因此该控件的创建和管理有 DialogTitleBar 控制。 - */ - -/*! - \qmlproperty DciIcon org.deepin.dtk::DialogTitleBar::icon - - \c icon 属性表示 DialogWindow 的窗口图标。 - \sa DciIcon - */ - -/*! - \qmlproperty string org.deepin.dtk::DialogTitleBar::title - - \c title 属性表示 DialogWindow 的窗口标题。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::DialogTitleBar::enableInWindowBlendBlur - - \c enableInWindowBlendBlur 属性用于控制是否开启窗口内混合模糊模式,当开启该模式后,如果标题栏上经过了其他 - 窗口控件(例如 ScrollView),其背景会呈现出模糊的效果。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/DialogWindowDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/DialogWindowDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/DialogWindowDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/DialogWindowDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/*! - \qmltype DialogWindow - \inherits Window - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief DTK 提供的一种基本对话框窗口. - - DialogWindow 是基础的自定义对话框窗口,除窗口内容外,其余部分 DTK 完成实现并提供。 - 应用可直接在 DialogWindow 中添加需要展示的内容,通过布局的方式对内容进行属性控制。 - - DialogWindow 继承自 Window 控件,相比于 PopupWindow 窗口,DialogWindow 是 - 一个独立的窗口。 - DialogWindow 实现了 DTK 样式中的无标题,背景模糊的等样式。直接使用 Window 时,这些样式都需要 - 自定义实现。 - */ - -/*! - \qmlproperty int org.deepin.dtk::DialogWindow::maxContentHeight - \readonly - - \c maxContentHeight 属性是一个只读属性,它表示内容区域的最大高度。 - */ - -/*! - \qmlproperty Compnent org.deepin.dtk::DialogWindow::header - - \c header 属性用于存储 DialogTitleBar 控件,当需要自定义 DialogTitleBar 时, - 可通过 header: DialogTitleBar {} 来实现。 - */ - -/*! - \qmlproperty string org.deepin.dtk::DialogWindow::icon - - \c icon 属性用于存储 DialogWindow 中的图标名称。 - */ - -/*! - \qmlproperty list org.deepin.dtk::DialogWindow::content - \default - - 属性表示 DialogWindow 中内容控件,它是 DialogWindow 中的默认控件,使用时无需强制指定 content 属性。 - 其使用方式如下代码: - \qml - DialogWindow { - width: 200 - icon: "music" - ColumnLayout { - width: parent.width - Label { - Layout.alignment: Qt.AlignHCenter - font: DTK.fontManager.t5 - text: "名称“XXX”已被占用,请使用其他名称" - } - Button { - Layout.alignment: Qt.AlignBottom | Qt.AlignHCenter - Layout.bottomMargin: 10 - Layout.fillWidth: true - text: "确定" - } - } - } - \endqml - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dopacitymask.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dopacitymask.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dopacitymask.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dopacitymask.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -/*! - \qmltype OpacityMask - \inherits Item - \inqmlmodule org.deepin.dtk - \keyword DOpacityMask - \brief 一个同时支持软件和硬件渲染的不透明度遮罩控件. - - 能够同时支持软件渲染和硬件渲染,其能够为源材质提供一种不透明度遮罩。 - 使源材质能够作用做遮罩中。其硬件渲染(GPU渲染)模式和 Qt Graphical Effects - 保持一致。软件模式下无法针对每个源材质的像素点进行遮罩处理,软件模式 - 使用 Qt 的混合模式实现。 - - 其用法可用如下示例表示: - - \qml - import org.deepin.dtk 1.0 - - Item { - width: 300 - height: 300 - - Image { - id: bug - source: "images/bug.jpg" - sourceSize: Qt.size(parent.width, parent.height) - smooth: true - visible: false - } - - Image { - id: mask - source: "images/butterfly.png" - sourceSize: Qt.size(parent.width, parent.height) - smooth: true - visible: false - } - - OpacityMask { - anchors.fill: bug - source: bug - maskSource: mask - } - } - \endqml - - 其效果如下所示: - \table - \header - \li 源材质 - \li 遮罩材质 - \li 应用效果 - \row - \li \image images/opacityMask_sourceExample.jpg - \li \image images/opacityMask_MaskExample.jpg - \li \image images/opacityMask_effectExample.jpg - \endtable - */ - -/*! - \qmlproperty bool org.deepin.dtk::OpacityMask::cached - - 该属性用于提升性能,开启缓存后效果仅会在源材质和遮罩发生改变时修改,其他方式进行 - 的更新都无法更新应用效果。默认情况下该属性为 false. - */ - -/*! - \qmlproperty bool org.deepin.dtk::OpacityMask::invert - - 该属性用于控制应用效果的 alpha 值,当 \c invert 设置为true 时,效果的 - alpha 值为源材质乘以遮罩的倒数,如 As * (1 - Am),设置为 false 是,效果 - 为源材质乘以遮罩,如 As * Am。默认情况下,改值为 false。 - */ - -/*! - \qmlproperty var org.deepin.dtk::OpacityMask::maskSource - - 该属性用于指定遮罩材质的数据,遮罩被渲染到目标中被用于确定形状和alpha值。 - */ - -/*! - \qmlproperty var org.deepin.dtk::OpacityMask::source - - 该属性用于指定源材质的数据,源材质用于指定最终效果的内容,其alpha通道会和 - 遮罩材质进行混合。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dqmlglobalobject.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dqmlglobalobject.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dqmlglobalobject.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dqmlglobalobject.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,702 +0,0 @@ -/*! - \qmltype Color - \inqmlmodule org.deepin.dtk - \brief \c DTK 项目中统一的颜色类型. - - Color 是 \c DTK 中为了适配 QPalette 部分颜色角色枚举,适配 Qt 的基础的颜色以及所有 - 的 RGB 的颜色值。除此之外,该类能很好的兼容 \c ColorSelector 的取色系统和 \c Palette - 取色器调色板。 - - 构造 \c Color 对象有两种方式,一种是通过 QColor 对象,QColor 能够兼容使用字符串、Qt枚举 - 等等方式,因此使用 QColor 构造 \c DTK 的 \c Color 同样能兼容上述方式。另外一种是通过 QPalette - 的部分枚举值,目前仅支持使用 \c Highlight 和 \c HighlightText 这两种枚举值。该枚举在 \c Color - 对象的 \c Type 枚举中有定义。 - - \section2 Color.Type - Type 枚举定义了颜色是什么类别,其与 QPalette::ColorRole 枚举描述一致,当需要使用一个抽象的颜色角色时, - 可以通过指定该类别,其颜色最终根据其控件的对应调色板颜色。 - - \table - \row - \li Color.Invalid - \li 无效 Type。此类枚举表示该类型是一个无效类型或者为具体颜色类型,非调色板数据类型。 - - \row - \li Color.Highlight - \li 高亮色,对应于 QPalette::Highlight ,并且其颜色也从其所处控件的 Highlight 调色板中获取 - - \row - \li Color.HighlightedText - \li 高亮文本色,对应于 QPalette::HighlightedText,其使用场景在高亮的背景下文本或者前景需要展示 - 的颜色。 - - \endtable - */ - -/*! - \qmlmethod bool Color::isValid() - \return 判断当前颜色值是否有效,有效则返回 true, 否则返回 false。 - */ - -/*! - \qmlmethod bool Color::isTypedColor() - 判断当前颜色是否是一种已标记颜色(或称调色板颜色)。 \return 是调色板颜色则返回 true,否则返回 false。 - 通过 \c Color.Type 构造的颜色都是类型颜色,而通过 QColor 构造的颜色不是类型颜色。 - 类型颜色不是一个具体的颜色值,它需要一个具体的 QPalette 对象才能获取具体颜色。 - */ - -/*! - \qmlmethod color Color::toColor(var palette) - 转换 \c Color 类型的颜色为 \c QColor 类型的颜色,该函数能够将 \c Color 类型转化成 - 一个具体的 QColor 颜色类型。通过判断 \c Color.Type 类型的颜色值,从 \a palette - 参数中获取 \c Color 使用的调色板对应的具体颜色值。 - - \return 返回对应调色板数据的 QColor 颜色值。 - */ - -/*! - \qmlmethod color Color::color() - 将 \c Color 类型转换成 QColor 类型,当 \c Color 指定了 \c lightness 或 \c opacity 属性时,该颜色 - 会将这两种属性设置到输出的颜色中。 - - \return 将转换后的 QColor 类型。 - \note 该函数不适用 Typed 颜色类型 - */ - -/*! - \qmlmethod Color Color::lightness(int floatValue) - 将自身的 \c Color 提高/降低 \a floatValue 大小的亮度,并返回。 - - \return 返回调整亮度后的 Color 类型颜色。 - */ - -/*! - \qmlmethod Color Color::opacity(int floatValue) - 将自身的 \c Color 提高/降低 \a floatValue 大小的不透明度,并返回。 - - \return 返回调整不透明度后的 Color 类型颜色。 - */ - -/*! - \qmltype DTK - \inqmlmodule org.deepin.dtk - \keyword DQMLGlobalObject - \brief 提供一个全局的 \c DTK 对象,保证QML中能够获取 \c DTK 的相关枚举和函数. - - DTK 对象可以更方便地在QML中使用,它提供了一些统一的函数、属性以及枚举值,它能够更快捷的 - 访问一些系统信息和图形化配置,下述代码简单展示了其使用方式: - - \qml - import org.deepin.dtk 1.0 - - Text { - color: DTK.selectorColor(palette.window, "black", "white") - text: "WindowManager: " + DTK.windowManagerNameString() - } - \endqml - - \section1 枚举 - \c DTK 将一些通用的枚举类型封装起来,当做控件的枚举统一进行使用。在使用DTK封装的控件中, - 能够很容易看到他们的使用场景。例如,你可以设置控件Z轴坐标,来控制控件的层级关系,使用 - \c DTK.BottomOrder 来设置最底层控件,使用 \c DTK.TopOrder 设置最顶层控件坐标。 - - \section2 DTK.ControlState - \c Control 控件的状态,\c Control 控件或继承于 \c Control 控件都有多种状态,如:hover、 - press、disabled等等,该枚举能够在 DTK 的其他控件中使用进行统一,例如在 \c ColorSelector - 中可以通过该枚举控制控件的状态, \c DciIcon 中可以通过设置值指定图标的状态等等。 - - \table - \row - \li \c DTK.NormalState - \li - Control 控件的 normal 状态,是控件最原始的状态,控件在未处理任何事件且可用时的 - 一种状态。 - - \row - \li \c DTK.HoveredState - \li - Control 控件当鼠标放置到控件时的状态。 - - \row - \li \c DTK.PressedState - \li - Control 控件当鼠标按压时的控件状态。 - - \row - \li \c DTK.DisabledState - \li - Control 控件在禁用时的状态,当控件的 enable 属性设置为 false 状态时,就是该种状态。 - 这种状态下,无法接受任何鼠标事件。 - - \row - \li \c DTK.InactiveState - \li - Control 控件在未激活下的状态,当窗口处于非焦点状态下,该窗口下的所有控件都是未激活状态。 - - \endtable - - \section2 DTK.ZOrder - Control 的 z 属性表示的控件的层级堆叠关系,当某个控件的 z 值比其他所有控件的 z 值都低时, - 表示该控件在最低层显示,可以被其他控件覆盖。 \c DTK 提供了一种便捷方式设置该属性,就是这个 - 枚举值。 - - \table - \row - \li \c DTK.BottomOrder - \li - 最底层控件,其层级关系是所有控件中最低的。 - - \row - \li \c DTK.BelowOrder - \li - 下层控件,这个层级关系比 \c DTK.BottomOrder 高,它能够覆盖 \c DTK.BottomOrder 层 - 的控件。 - - \row - \li \c DTK.NormalOrder - \li - 常规控件,当控件不设置 z 属性时默认就是该值,这是大多数控件的层级大小,它比 \c DTK.BelowOrder - 和 \c DTK.BottomOrder 都高。 - - \row - \li \c DTK.AboveOrder - \li - 普通上层控件,该层级大小大于 \c DTK.NormalOrder 的层级大小。 - - \row - \li \c DTK.TopOrder - \li - 顶层控件,顶层控件显示在所有控件之上,能够遮盖住其他枚举状态的所有控件。目前如 \c TitleBar 等 - 控件正在使用这种层级堆叠枚举。 - - \endtable - - \section2 DTK.PopupMode - Popup 控件窗口弹出模式(Menu 等继承于 Popup 的控件也适用), 默认情况下所有的 Popup 控件类型 - 为 DTK.AutoMode 模式。 - - \table - \row - \li \c DTK.AutoMode - \li - 自动模式,能够根据 “D_POPUP_MODE” 环境变量的值指定,如果该变量被设置为 “embed”,则为嵌入式弹出 - 窗口类型,否则为独立式窗口类型。 - - \row - \li \c DTK.WindowMode - \li - 独立式窗口模式,该模式下窗口能够独立于其他窗口显示,作为一个单独的窗口,类似于 dtkwidget 的 Menu 窗口 - 类似。 - - \row - \li \c DTK.EmbedMode - \li - 嵌入式窗口模式,默认的 qtdeclarative 项目风格的 Menu 和 Popup 控件为该类型,此模式将 Popup 窗口嵌入 - 其父窗口内部,其显示无法超出父窗口的大小,并且会根据父窗口的位置和大小而发生适应性变化。 - - \endtable - - \section2 DTK.ArrowDirection - 箭头方向枚举,如 \c Slider 控件中箭头滑块, 当 \c Slider 控件需要有上下左右的标签时,需要指定 \c Slider - 滑块的方向。 - - \table - \row - \li \c DTK.UpArrow - \li - 上箭头 - - \row - \li \c DTK.DownArrow - \li - 下箭头 - - \row - \li \c DTK.LeftArrow - \li - 左箭头 - - \row - \li \c DTK.RightArrow - \li - 右箭头 - - \endtable - - \section1 函数 - 使用DTK中提供的函数能够更好的兼容DTK控件的使用方式,能快捷的适配DTK控件的特殊使用场景。 - 例如,一些标准的窗口信息函数,可以获取到窗管的无标题和混成模式等等信息;DTK 通用颜色可以 - 通过函数进行颜色混合、颜色调整以及特殊颜色的创建。以下将从几个方面展开描述 DTK 提供的一些 - 基本通用函数: - - \section2 窗管信息 - QML中能够快速通过这些函数快速获取到当前窗管的一些属性,其中包含获取窗管是否支持模糊,是否支持混成, - 是否处于无标题以及是否是软件渲染的状态。 - - \list - \li \l{DTK::hasBlurWindow}{bool DTK.hasBlurWindow()} - \li \l{DTK::hasComposite}{bool DTK.hasComposite()} - \li \l{DTK::hasNoTitlebar}{bool DTK.hasNoTitlebar()} - \li \l{DTK::isSoftwareRender}{bool DTK.isSoftwareRender()} - \li \l{DTK::windowManagerName}{int DTK.windowManagerName()} - \li \l{DTK::windowManagerNameString}{string DTK.windowManagerNameString()} - \endlist - - \section2 主题相关 - DTK程序默认都适配明/暗主题,DTK程序在某些情况下需要获取明暗主题相关的接口,或者获取平台主题和应用主题 - 的相关配置时,可以调用这些接口信息。 - - \list - \li \l{DTK::themeType}{int DTK.themeType()} - \li \l{DTK::platformTheme}{Object DTK.platformTheme()} - \li \l{DTK::toColorType()}{int DTK.toColorType()} - \li \l{DTK::selectColor()}{color DTK.selectColor()} - \endlist - - \section2 消息通知 - DTK能够使用全局对象的方式发送消息,以下函数提供了一种便捷的发送窗口内通知的快捷方式。 - \list - \li \l{DSendMessageFromContent}{DTK.sendMessage()} - \li \l{DSendMessageFromComponent}{DTK.sendMessage(Object)} - \li \l{DCloseMessageFromMessageObject}{DTK.closeMessage(Container)} - \li \l{DCloseMessageFromMessageId}{DTK.closeMessage(Object)} - \endlist - - \section2 颜色相关 - DTK提供了相关函数能够更方便的调整颜色,获取调色板信息。 - \list - \li \l{DTK::palette}{DTK.palette()} - \li \l{DTK::inactivePalette}{DTK.inactivePalette()} - \li \l{DTK::blendColor()}{color DTK.blendColor()} - \li \l{DTK::makeColor(Color::Type type)}{DTK.makeColor(type)} - \li \l{DTK::makeColor(color)}{DTK.makeColor(color)} - \endlist - - \section2 图标相关 - DCI图标相关的统一接口,例如兼容QIcon和DciIcon的附加属性、将QPalette属性设置到IconPalette中等等。 - \list - \li \l{DTK::makeIcon()}{DTK.makeIcon()} - \li \l{DTK::makeIconPalette()}{DTK.makeIconPalette()} - \endlist - - \section2 其他函数 - 其它未汇总的函数,例如一些系统信息,字体管理,以及弹出菜单的嵌入模式等等 - \list - \li \l{DTK::fontManager}{DTK.fontManager()} - \li \l{DTK::makeShadowImageUrl()}{DTK.makeShadowImageUrl()} - \li \l{DTK::deepinWebsiteName}{DTK.deepinWebsiteName()} - \li \l{DTK::deepinWebsiteLink}{DTK.deepinWebsiteLink()} - \li \l{DTK::deepinDistributionOrgLogo}{DTK.deepinDistributionOrgLogo()} - \li \l{DTK::cursorPosition}{DTK.cursorPosition()} - \li \l{DTK::setPopupMode()}{DTK.setPopupMode()} - \endlist - */ - -/*! - \qmlproperty bool DTK::hasBlurWindow - \readonly - - 如果当前窗口管理器支持窗口背景模糊特效则返回 true,否则返回 false - */ - -/*! - \qmlproperty bool DTK::hasComposite - \readonly - - 如果当前窗口管理器支持混成则返回 true,否则返回 false - */ - -/*! - \qmlproperty bool DTK::hasNoTitlebar - \readonly - - 如果窗口管理器当前支持设置隐藏窗口标题栏则返回 true,否则返回 false - */ - -/*! - \qmlproperty bool DTK::isSoftwareRender - \readonly - - 如果当前窗口渲染模式为软件,则返回 true,否则返回 false - */ - -/*! - \qmlproperty string DTK::windowManagerNameString - \readonly - - 当前使用的窗口管理器名称 - */ - -/*! - \qmlproperty int DTK::themeType - \readonly - - 程序的主题类型. - - 当themeType为UnknownType时, 将自动根据 - GuiApplication::palette的QPalette::background颜色计算主题 - 类型, 否则与 paletteType 的值一致. 程序中应当使用此值作为 - 暗色/亮色主题类型的判断. - */ - -/*! - \qmlproperty int DTK::windowManagerName - \readonly - - 窗口管理器名称枚举. - - 目前包含 DeepinWM, KWinWM 和其他窗口管理器。 - */ - -/*! - \qmlproperty Object DTK::platformTheme - \readonly - - 返回应用程序的平台主题实例. - - 平台主题能够获取到一些系统级的主题配置,如图标主题,铃声主题,窗口圆角, - 调色板颜色信息等等相关配置。 - */ - -/*! - \qmlproperty FontManager DTK::fontManager - \readonly - - 应用程序的字体管理器实例实例. - - 字体管理器通过使用 t1 - t10 的字体字号进行 - 统一管理,同时也能设置一些自定义的特殊字号。 - */ - -/*! - \qmlproperty qpalette DTK::palette - \readonly - - 返回应用程序默认的调色板主题 - */ - -/*! - \qmlproperty qpalette DTK::inactivePalette - \readonly - - 应用程序默认的未激活状态的调色板主题 - */ - -/*! - \qmlmethod color DTK::blendColor(color substrate, color superstratum) - 将 \a substrate 和 \a superstratum 颜色进行混合,形成一种新的颜色。 - 该颜色通过 alpha 通道的权重值进行混合运算,新的颜色值中 RGB 等于 \a substrate 的 RGB - 值 * (1 - \a superstratum 的 alpha 值) 加上 \a superstratum 的 RGB 值 * superstratum - 的 alpha 值, 新颜色的 alpha 值和底色的 alpha值一致。 - - \return 返回调整后的颜色值 - */ - -/*! - \qmlmethod Color DTK::makeColor(Color::Type type) - 根据 \a type 类型创建出 Color 实例,目前 type 包含 - Highlight 和 HighlightedText 两种。 - - \return 返回转换后的 Color 类型的颜色值。 - */ - -/*! - \qmlmethod Color DTK::makeColor(color c) - 将 \a c 转换成 Color 并返回。 Color 能够兼容 QColor 和 type - 两种模式。 - - \return 返回转换后的 Color 类型的颜色值。 - */ - -/*! - \qmlmethod url DTK::makeShadowImageUrl() - 内部DTK接口,用于创建 shadow image 的url链接,其实现方式是将其内部属性 - 全部都添加到一个URL中,用于最后渲染Image时获取对应属性。 - - \return 返回阴影的 Url 用于解析获取。 - */ - -/*! - \qmlmethod int DTK::toColorType(color c) - 用于根据一个指定的颜色 \a c ,返回在该颜色下对应的系统主题。 - 最常用的方式是通过传入 \c Control 中调色板属性中的 window - 颜色来判断主题类型。 - - \return 亮色主题颜色返回 ApplicationHelper.LightType, 暗色主题 - 返回 ApplicationHelper.DarkType - */ - -/*! - \qmlmethod color DTK::selectColor(color windowColor, color light, color dark) - 用于根据一个指定的颜色 \a windowColor ,判断当前程序正在使用的 - 系统主题,并根据不同主题返回对应的 \a light 和 \a dark 颜色。 - - \return 当 LightType 时返回 \a light , 当 DarkType 时返回 \a dark 。 - */ - -/*! - \qmlproperty string DTK::deepinWebsiteName - \readonly - - Deepin 网站名称。 - */ - -/*! - \qmlproperty string DTK::deepinWebsiteLink - \readonly - - Deepin 网站链接。 - */ - -/*! - \qmlproperty string DTK::deepinDistributionOrgLogo - \readonly - - Deepin 组织 Logo 路径。 - */ - -/*! - \qmlproperty point DTK::cursorPosition - readonly - - 鼠标当前位置的属性。 - Qt 中返回鼠标位置只能通过 MouseArea 控件,但当多个该控件一起 - 就存在覆盖而无法正确接受事件的可能,因此 DTK 提供一个可以直接 - 访问鼠标位置的接口,方便QML程序获取并使用。 - */ - -/*! - \qmlmethod DciIcon DTK::makeIcon(QtIcon, DciIconAttached) - 兼容 \a QtIcon 的属性,将 DciIcon 附加属性值和 \a QtIcon 的属性值添加到 - DciIcon 实例中。这种方式大多在控件图标为 \a QtIcon 时使用,在添加 \a QtIcon - 的属性后,可以通过添加 DciIcon 附加属性,将其进行整合,例如 Button 控件。 - - \qml - import org.deepin.dtk 1.0 - - Button { - width: 50 - height: 50 - - icon.name: "apple" - icon.width: 24 - icon.height: 24 - DciIcon.palette.foreground: "red" - DciIcon.mode: DTK.HoveredState - DciIcon.theme: ApplicationHelper.DarkType - } - \endqml - 上述方式这样实现是由于,Button 的属性 icon 为 QtIcon, 而其内部的图标控件是 DciIcon, - 因此为了保持兼容,在使用方式上不存在差别,才衍生出该函数进行整合。Button 中使用该函数进行 - QtIcon 和 DciIcon 附加属性进行绑定的场景如下: - - \qml - import org.deepin.dtk 1.0 - - Button { - id: control - contentItem: IconLabel { - icon: DTK.makeIcon(control.icon, control.DciIcon) - } - } - \endqml - - \return 返回兼容后的 DciIcon 图标实例。 - */ - -/*! - \qmlmethod DciIcon::Palette DTK::makeIconPalette(qpalette) - 根据 \a qpalette 创建图标的调色板属性。 图标调色板和控件调色板是分开的 - 图标调色板分为 Foreground Background HighlightForeground 和 Hightlight 四种 - 某些图标的图层会使用该类调色板进行着色,当控件使用 \c QPalette 时,可以将 \c QPalette - 和 DDciIconPalette 兼容。 - 例如以下使用场景: - \qml - import org.deepin.dtk 1.0 - - Control { - property alias icon: _icon - DciIcon { - id: _icon - anchors.centerIn: parent - sourceSize { - width: 50 - height: 50 - } - - palette: DTK.makeIconPalette(parent.palette) - } - - } - \endqml - - \return 返回转化后的 DciIcon 中的 palette 属性,返回后的实例可直接应用在 DciIcon - 的属性中进行属性绑定。 - */ - -/*! - \qmlmethod bool DTK::sendMessage(object target, string content, string iconName, int duration, string msgId) - \keyword DSendMessageFromContent - - DTK 提供一种能在全局发送应用内通知的方式,目前有两种方式:一种是提供所有的通知信息,DTK 进行托管显示,并设置关闭或手动关闭。 - 一种是提供消息的 Component 组件,DTK 负责布局和管理,组件自身提供样式和关闭策略。 - - 以下函数代表的第一种情况, \a target 可以使用目标对象或者目标对象所处的 \c window 。 \a content 为需要显示的文本信息 - \a iconName 为可选参数,当需要显示图标时,可传入图标名称。 \a duration 为可选参数,代表消息显示的时长,默认时间为 4 秒, - 当 \a duration 参数为 -1 时,表示该显示为常驻消息,关闭需要手动点击关闭按钮才行。 \a msgId 为可选参数,当 \a msgId 未 - 指定时,显示的消息将都为不同类消息,当多个消息的 \a msgId 一致时,后面的消息会替换同类型的前面的消息。 - - 其使用方法如下展示: - \qml - import org.deepin.dtk 1.0 - - Button { - text: "FloatingMessage" - property int count: 0 - onClicked: { - DTK.sendMessage(control, "message" + count) - DTK.sendMessage(Window.window, "message" + count, "music", 4000, "type1") - DTK.sendMessage(Window.window, "message" + count, "video", -1) - count++ - } - } - \endqml - */ - -/*! - \qmlmethod bool DTK::sendMessage(object target, component delegate, var message, int duration, string msgId) - \keyword DSendMessageFromComponent - - 这种方式跟 \l {DSendMessageFromContent}{DTK.sendMessage()} 类似,不同的是, - 它可以使用自定义创建的 \c FloatingMessage 和 \c FloatingMessageContainer 组件进行指定。 - \a target 可以使用目标对象或者目标对象所处的 \c window 。 \a delegate 为消息显示的代理组件,可以使用 \c DTK 封装好的 - \c FloatingMessage 添加自定义文本或者策略进行显示,也可以自己封装 \c FloatingMessageContainer 实现自定义的消息组件,当然 - 后面这种方式的成本更高。 \a message 参数指定 \a delegate 组件封装时需要用的额外参数,例如“content”,“iconName”等内容,由于 - \c Component 存在作用域的问题,问了更方便的获取到这些数据对象,防止出现属性绑定失败的情况,DTK 消息推荐将数据对象传入到 \a message - 参数中, \a message 接收一个 JSON 的键值对类型,数据通过键值对进行访问,例如下述示例: - - \qml - import org.deepin.dtk 1.0 - - Button { - text: "FloatingMessage" - onClicked: { - DTK.sendMessage(control, floatingMsgCom, {content: "message....", iconName: "music"}, -1) - } - - Component { - id: floatingMsgCom - FloatingMessage { - } - } - } - \endqml - - 上述代码中 \a message 变量传入了“{content: "message....", iconName: "music"}”参数,值得注意的是, FloatingMessage 中自带了两个 - 默认的 “key”,如上面参数展示,其分别是 “content” 和 “iconName”,分别对应的是文本内容和图标名称。对于一些自定义的键值对,可以使用如下方式 - 添加: - - \qml - import org.deepin.dtk 1.0 - - Button { - text: "FloatingMessage" - onClicked: { - DTK.sendMessage(control, floatingMsgCom, {text: "message....", iconName: "music"}, -1) - } - - Component { - id: floatingMsgCom - FloatingMessage { - id: floatMsg - contentItem: RowLayout { - anchors.fill: parent - spacing: 0 - - Label { - Layout.fillHeight: true - Layout.fillWidth: true - text: floatMsg.message.text - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignLeft - Layout.alignment: Qt.AlignVCenter - font: DTK.fontManager.t6 - wrapMode: Text.Wrap - elide: Text.ElideRight - maximumLineCount: 1 - } - - Button { - text: "reload" - font: DTK.fontManager.t5 - Layout.alignment: Qt.AlignVCenter - } - } - } - } - } - \endqml - - \a duration 为可选参数,代表消息显示的时长,默认时间为 4 秒,当 \c duration 参数为 -1 时,表示该显示为常驻消息,关闭需要手动点击关闭按钮才行。 - \a msgId 为可选参数,当 \a msgId 未指定时,显示的消息将都为不同类消息,当多个消息的 \a msgId 一致时,后面的消息会替换同类型的前面的消息。 - */ - -/*! - \qmlmethod void DTK::closeMessage(object message) - \keyword DCloseMessageFromMessageObject - - 关闭浮动消息的统一接口,当使用 \l {DSendMessageFromComponent}{DTK.sendMessage(Object)} 接口时, - 当自己重新定义 \c Component \a message 后,如果重载了其内部属性,就需要手动处理关闭该消息的动作。否则需要等待 duration 结束才能关闭,该种使用场 - 景可以通过下述方式描述: - - \qml - import org.deepin.dtk 1.0 - - Button { - text: "FloatingMessage" - onClicked: { - DTK.sendMessage(control, floatingMsgCom, {content: "message...."}, -1) - } - Component { - id: floatingMsgCom - FloatingMessage { - id: floatMsg - button: Button { - text: "close" - onClicked: { - console.log("close clicked") - DTK.closeMessage(floatMsg) - } - } - } - } - } - \endqml - */ - -/*! - \qmlmethod void DTK::closeMessage(object target, string msgId) - \keyword DCloseMessageFromMessageId - - 通过 \a msgId 关闭浮动消息,其中 \a target 表示浮动消息所在的 Item 或 Window 控件。 - 当控件中存在 \a msgId 指定的消息时,通过该接口可直接将该消息关闭。\a msgId 与 sendMessage() - 接口中的 \a msgId 相对应。 - */ - -/*! - \qmlmethod void DTK::setPopupMode(int mode) - - 设置 Popup 类型窗口的弹出方式,目前 \a mode 可以设置为 嵌入式弹出窗口( EmbedMode )或者 独立式弹出窗口( WindowMode )两种模式 - ,其默认值为 AutoMode, 该模式会根据窗口情况进行自动选择。除此之外,还能通过修改环境变量的方式: - - 可以在 main 函数开头添加如下代码: - \code - int main(int argc, char **argv) - { - qputenv("D_POPUP_MODE", "embed"); - ... - return a.exec(); - } - \endcode - 当 “D_POPUP_MODE” 的值为非 “embed” 表示为独立式窗口。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dquickbehindwindowblur.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dquickbehindwindowblur.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dquickbehindwindowblur.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dquickbehindwindowblur.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,280 +0,0 @@ -/*! - \qmltype BehindWindowBlur - \inherits Item - \inqmlmodule org.deepin.dtk - \keyword DQuickBehindWindowBlur - \brief 提供一个能使窗口背景模糊的控件. - - DTK 中窗口可以实现模糊特效,当设置该特效后,窗口的特定区域将会对窗口后面的背景进行模糊填充。使用模糊特效能够丰富窗口的视觉内容 - ,使窗口更加具备层次感和立体感。 BehindWindowBlur 控件能够很容易的实现该效果,其效果与 dtkwidget 中 DBlurEffectWidget 类 - 的效果类似,但在实现方式上有很大不同,在 QML 中使用 BehindWindowBlur 将更加灵活可控,例如 BehindWindowBlur 可以指定特殊区域 - 模糊,而另外的区域不模糊, 且模糊背景的颜色能与特定的颜色进行混色显示。 - - BehindWindowBlur 在使用方式上非常简单,它能够直接用在 Window 控件上,例如下述代码,其属性的设置和添加都更加方便和简单: - - \qml - import QtQuick.Window 2.11 - import org.deepin.dtk 1.0 - - Window { - id: root - DWindow.enabled: true // 开启 DTK 中窗口的圆角和无边框等特殊属性 - DWindow.alphaBufferSize: 8 // 设置 DTK 窗口 alpha 通道的缓冲区大小 - - BehindWindowBlur { - control: root - anchors.fill: parent - blendColor: Qt.rgba(1, 0, 0, 0.3) - ] - } - \endqml - - 其最终的效果如下图所示: - \image images/behindwindowblur.png - - 模糊特效分为窗口内模糊和窗口外模糊,窗口内模糊即对窗口内部控件所使用到的背景进行模糊;窗口外模糊即对窗口外部背景进行模糊。当前类进行 - 的模糊操作为窗口外模糊,其大多数情况下使用在窗口控件,对窗口的背景进行模糊渲染,并填充到窗口中。 BehindWindowBlur 类对模糊进行了 - 基本封装,可用于更灵活的场景中,例如一些特殊的混合填充色, StyledBehindWindowBlur 类同样也能对窗口进行模糊,但不同的是该类针对 - 行云设计中的模糊背景色对混合填充色进行了具体设置。用户在使用 StyledBehindWindowBlur 类时无需关心需要混合那种颜色。 - */ - -/*! - \qmlproperty real org.deepin.dtk::BehindWindowBlur::cornerRadius - - 该属性表示模糊矩形的半径大小。模糊区域作为一个矩形大小的控件进行展示,因此该属性被用于指定矩形的圆角大小。 - */ - -/*! - \qmlproperty color org.deepin.dtk::BehindWindowBlur::blendColor - - 该属性表示与目标区域混合的颜色,当不指定颜色时,该背景模糊后直接展示到控件上;当指定颜色时,会将颜色与模糊背景进行混合,使模糊背景的色 - 调呈现出与混合颜色相似的色调。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::BehindWindowBlur::valid - - 该属性为只读属性,用于判断当前窗口状态是否支持窗口外模糊。如果支持窗口外模糊,返回 true,否则返回 false。 - 该属性在窗口管理器层访问其是否支持模糊效果。 - */ - -/*! - \qmltype StyledBehindWindowBlur - \inherits org.deepin.dtk::BehindWindowBlur - \inqmlmodule org.deepin.dtk - \brief 提供一个 DTK 统一的窗口外模糊控件. - - StyledBehindWindowBlur 控件继承于 BehindWindowBlur 控件, 其在 BehindWindowBlur 控件的基础上指定了特定的 - 混色渲染颜色。 当应用进行 DTK 程序开发时,推荐使用 StyledBehindWindowBlur 控件,能够保证应用模糊的混色颜色一致。 - - 通常情况下,其混色颜色如下表所示: - \table - \header - \li 模式 - \li 颜色 - \row - \li 亮色-支持模糊 - \li rgba(235, 235, 235, 0.6) - \row - \li 亮色-不支持模糊 - \li rgba(235, 235, 235, 1.0) - \row - \li 暗色-支持模糊 - \li rgba(0, 0, 0, 0.3) - \row - \li 暗色-不支持模糊 - \li Qt.rgba(35, 35, 35, 1.0) - \endtable - */ - -/*! - \qmlproperty var org.deepin.dtk::StyledBehindWindowBlur::control - - 该属性用于指定 StyledBehindWindowBlur 控件作用于那个控件之上,其目的用户获取该控件的调色板颜色值 - 用于判定当前处于那种主题下,用于选择合适的混合填充色。 - - 该属性使用 Control 和 ApplicationWindow 都符合要求。 - */ - -/*! - \qmltype InWindowBlur - \inherits Item - \inqmlmodule org.deepin.dtk - \keyword DQuickInWindowBlur - \brief 提供一个使目标控件在窗口内模糊的特效控件. - - 该控件用于在窗口内对某些控件背景进行模糊操作,例如一个 ListView 的背景如果是一个图片,如果其 Item 需要 - 进行模糊处理,对 ListView 的背景进行模糊处理,就能够用 InWindowBlur 控件对 delegate 进行模糊处理。 - 例如以下代码 - - \qml - import org.deepin.dtk - - Item { - Image { - anchors.fill: parent - source: "file:///usr/share/wallpapers/deepin/desktop.jpg" - } - - ListView { - id: testView - - model: 10 - spacing: 30 - clip: true - anchors { - fill: parent - margins: 10 - } - - delegate: Item { - height: 50 - width: 300 - anchors.horizontalCenter: parent.horizontalCenter - - InWindowBlur { - id: blur - anchors.fill: parent - radius: 20 - offscreen: true - } - - ItemViewport { - id: roundBlur - anchors.fill: blur - fixed: true - sourceItem: blur - radius: blur.radius - hideSource: false - } - - Rectangle { - radius: roundBlur.radius - anchors.fill: roundBlur - color: Qt.rgba(1, 0, 0, 0.2) - } - - Text { - anchors.centerIn: parent - text: "InWindowBlur" + index - color: "white" - font.pixelSize: 22 - } - } - } - } - \endqml - - 其效果展示如下: - \image images/inwindowblur.png - - 如上述示例代码, InWindowBlur 控件需要配合 ItemViewport 控件才能完成与 BehindWindowBlur 控件 - 类似的混色效果。 其中 ItemViewport 主要完成圆角效果和混色填充的功能。 由于 InWindowBlur 控件本身 - 不支持圆角功能,因此在使用 ItemViewport 是需要隐藏其非圆角的效果, offscreen 属性就需要设置为 true 状 - 态,让 ItemViewport 能够展示 InWindowBlur 控件的内容但不现实 InWindowBlur 本身,该功能与 ItemViewport - 中的 hideSource 类似,但该属性与 InWindowBlur 控件的绘制发生冲突,无法正确渲染其模糊图像,因此建议使用 - InWindowBlur 控件的 offscreen 属性而非 ItemViewport 控件的 hideSource 属性。 - */ - -/*! - \qmlproperty real org.deepin.dtk::InWindowBlur::radius - - 该属性用于指定窗口内模糊程度系数大小,其并非控件的圆角大小。当模糊程度超过了背景的渲染程度时,其模糊效果会 - 呈现出一个黑色。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::InWindowBlur::offscreen - - 该属性用于指定其模糊特效是否需要渲染在屏幕之外,即离屏渲染,该属性默认为 false,当 InWindowBlur 控件与 - ItemViewport 控件配合使用时,多数情况下会将其设置为 true。 - */ - -/*! - \qmltype ArrowShapeBlur - \inherits org.deepin.dtk::InWindowBlur - \inqmlmodule org.deepin.dtk - \brief 提供一个带模糊效果的箭头窗口控件. - - 该控件在 InWindowBlur 的基础上,增加了可以自定义上下左右四种方向的箭头圆角矩形。该控件 - 放置在应用程序内部,而非一个独立窗口。通常用于应用程序内特殊的箭头控件,如音乐中的音乐调 - 节控件,如下图所示: - \image images/musicvoice.png - - ArrowShapeBlur 控件作为 InWindowBlur 类的拓展,在属性和功能上也有部分新增,除基础的 - 箭头宽度 \c arrowWidth 箭头高度 \c arrowHeight 箭头位置 \c arrowPosition 以及 - 箭头方向 \c arrowDirection 之外,在模糊方面其增加了与 BehindWindowBlur 控件类似的 - 混合填充色的属性 \c blendColor ,和边框圆角以及边框颜色等等,用于提供更加丰富的属性设置。 - */ - -/*! - \qmlproperty color org.deepin.dtk::ArrowShapeBlur::blendColor - - 该属性用于指定箭头模糊窗口的混合填充色,混合后的模糊窗口,其色调会偏向于给定的混合填充色 - 的颜色。当不指定该颜色时,窗口呈现出全黑色。 - */ - -/*! - \qmlproperty color org.deepin.dtk::ArrowShapeBlur::borderColor - - 该属性用于指定箭头模糊窗口的边框颜色,未指定时使用全黑色。 - */ - -/*! - \qmlproperty real org.deepin.dtk::ArrowShapeBlur::borderWidth - - 该属性用于指定箭头模糊窗口的边框宽度,默认的边框宽度为1。 - */ - -/*! - \qmlproperty real org.deepin.dtk::ArrowShapeBlur::roundJoinRadius - - 该属性用于指定箭头模糊窗口的箭头连接处圆角大小。 - */ - -/*! - \qmlproperty real org.deepin.dtk::ArrowShapeBlur::arrowWidth - - 该属性用于指定箭头模糊窗口的箭头宽度 - */ - -/*! - \qmlproperty real org.deepin.dtk::ArrowShapeBlur::arrowHeight - - 该属性用于指定箭头模糊窗口的箭头高度 - */ - -/*! - \qmlproperty point org.deepin.dtk::ArrowShapeBlur::arrowPosition - - 该属性用于指定箭头模糊窗口的箭头位置 - */ - -/*! - \qmlproperty int org.deepin.dtk::ArrowShapeBlur::arrowDirection - - 该属性用于指定箭头模糊窗口的箭头方向枚举。方向分为上、下、左、右四种,如下表所示: - \table - \header - \li 方向 - \li 枚举 - \row - \li 上 - \li DTK.UpArrow - \row - \li 下 - \li DTK.DownArrow - \row - \li 左 - \li DTK.LeftArrow - \row - \li 右 - \li DTK.RightArrow - \endtable - */ - -/*! - \qmlproperty color org.deepin.dtk::ArrowShapeBlur::shadowColor - - 该属性用于指定箭头模糊窗口的阴影颜色 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dquickbusyindicator.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dquickbusyindicator.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dquickbusyindicator.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dquickbusyindicator.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/*! - \qmltype BusyIndicator - \inherits Control - \inqmlmodule org.deepin.dtk - \keyword DQuickBusyIndicator - \brief 一个用于在用户界面显示用于需要等待的控件. - - DTK 程序统一的等待控件,展示在用户需要等待的地方,例如系统还原界面等待时、开机启动 - 等待时。没有具体的等待时间,不知道进度可能很快也可能很慢时。 - - 该控件可自由设置控件大小来控制需要等待显示的大小,用于不同场景中,如下述代码所示: - - \qml - import org.deepin.dtk 1.0 - - BusyIndicator { - running: true - width: 32 - height: 32 - } - \endqml - - \image images/dtk-spinner-blue.png - */ - -/*! - \qmlproperty color org.deepin.dtk::BusyIndicator::fillColor - - 用于填充 BusyIndicator 控件的具体颜色,默认是透明色,颜色可根据属性动态变化, - 一般情况下可使用高脸色。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::BusyIndicator::running - - 该属性用于控制动画是否进行,默认不自动进行。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dquickcontrolpalette.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dquickcontrolpalette.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dquickcontrolpalette.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dquickcontrolpalette.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,819 +0,0 @@ -/*! - \qmltype Palette - \inherits QtObject - \inqmlmodule org.deepin.dtk - \keyword DQuickControlPalette - \brief DTK 中用于取色器(ColorSelector)使用的统一调色板对象. - - DTK 程序统一的调色板对象,其作为 ColorSelector 进行颜色选择的载体,通常情况下 - 具备“Normal”,“Hovered”,“Pressed”和“Disabled”四种不同的状态,但并所有的状 - 态都需要指定颜色,可根据控件情况自由选择需要的状态。其使用方式如下述代码所示: - \qml - import org.deepin.dtk - - Palette { - normal: "red" - hovered: "green" - pressed: "blue" - disabled: "black" - } - \endqml - 当未找到对应控件调色板下的指定状态时,取色器(ColorSelector)会选择 “normal” 状态 - 的颜色进行代替。 - - 调色板拥有一些其他的额外属性,下面按照分类的方式展示: - - \section1 主题适配 - 调色板的状态颜色值并非一个固定值,有的时候控件的某种颜色在系统的不同主题下,存在不一致的情况,有的 - 能够使用公式进行关联,而有的差异千差万别,这样就无法关联在一起。Palette 控件通过不同属性值来控制 - 亮色和暗色主题的颜色。具体为在各个状态的名称中添加了 “Dark” 关键字,例如“normalDark”。通常情况 - 下,当控件的深浅主题调色版颜色一致时,不需要指定“Dark”状态的颜色,而在控件深浅主题颜色不通用时指定。 - 例如下述代码: - \qml - import org.deepin.dtk - - Palette { - normal: "red" - normalDark: "black" - hovered: "green" - hoveredDark: "yellow" - } - \endqml - - \section1 禁用与启用 - 调色板可控制其状态属于禁用或者启用,这在需要动态调整调色板的使用时非常有用。取色器(ColorSelector) - 会忽略禁用的属性并向上寻找其父类的该同名调色板。其使用方式如下所示: - \qml - import org.deepin.dtk - - Palette { - normal: "red" - enabled: false - } - \endqml - - \section1 颜色族 - \target Palette color family - 颜色族(family),默认的颜色族为“common”,当取色器(ColorSelector)修改其当前颜色族时,会将其使用 - 的所有调色板颜色进行重新选择,选择出对应的颜色族。目前可以使用的颜色族有两种,分别是"common"和"crystal" - 颜色族。基础的控件颜色都需要定义在"common"颜色族中,而"crystal"颜色族用于指定类似“水晶”效果(即能够透过 - 控件本身颜色看透其背后控件的类似效果)的颜色值。如"TransparentButton"控件。 - - \table - \header - \li 颜色族 - \li 描述 - \row - \li \c common - \li 基础颜色族,未指定时默认初始化该数据,用于基础的控件颜色。 - \row - \li \c crystal - \li 水晶颜色族,用于特殊情况下的控件需要出现类似“水晶”效果时,指定的颜色 - 例如,Dialog 中的内部控件,如按钮等,其背景和默认的按钮背景不一致。 - \endtable - - 下述使用方式展示了如何在调色 - 版中使用颜色族: - \qml - import org.deepin.dtk - - Palette { - normal { - common: "#f0f0f0" - crystal: Qt.rgba(0.20, 0.2, 0.2, 0.1) - } - hovered: "#d2d2d2" // common family - pressed.crystal: "#cdd6e0" // crystal family - } - \endqml - - \section1 QPalette 调色板适配 - DTK 调色板能够适配 Qt 调色板的部分颜色属性,如高亮色和高亮文本色,具体使用方式如下: - \qml - Palette { - normal: DTK.makeColor(Color.Highlight) - hovered: DTK.makeColor(Color.Highlight).lightness(+10) - pressed: DTK.makeColor(Color.Highlight).opacity(-10) - } - \endqml - QPalette 调色板属性进行颜色微调。如上述代码,调整其亮度和不透明度等属性。除此之外 - 可修改饱和度 (saturation) 和 色调 (hue),颜色的取值范围为[100, +100] - */ - -/*! - \qmlproperty bool org.deepin.dtk::Palette::enabled - - 调色板对象是否启用,取色器会寻找其父类中最近一个同名的调色板对象,并取其颜色值。 - 默认情况下,该属性为 true - */ - -/*! - \qmlpropertygroup org.deepin.dtk:::Palette::normal - \qmlproperty Color org.deepin.dtk::Palette::normal.common - \qmlproperty Color org.deepin.dtk::Palette::normal.crystal - - 控件 “Normal” 状态下的颜色,“Normal”状态对应于控件最基本的状态,是每个控件都 - 存在的状态,取色器根据控件是否处于 normal 状态来控制其选择调色板颜色。 - */ - -/*! - \qmlpropertygroup org.deepin.dtk::Palette::normalDark - \qmlproperty Color org.deepin.dtk::Palette::normalDark.common - \qmlproperty Color org.deepin.dtk::Palette::normalDark.crystal - - 控件 “Normal” 状态下暗色主题下的颜色,该属性只在暗色主题下生效,当控件不对 - 主题色敏感时,取色器只会选取 normal 属性的颜色。 - */ - -/*! - \qmlpropertygroup org.deepin.dtk::Palette::hovered - \qmlproperty Color org.deepin.dtk::Palette::hovered.common - \qmlproperty Color org.deepin.dtk::Palette::hovered.crystal - - 控件 “Hovered” 状态下的调色板颜色,“Hovered” 属性表示控件被鼠标悬浮是的状态, - 一些控件,如“Button”、“LineEdit”、“ComboBox”等都有这种状态。和 normal 状态 - 类似,当控件处于 hovered 状态时,取色器会自动选择该属性颜色。 - */ - -/*! - \qmlpropertygroup org.deepin.dtk::Palette::hoveredDark - \qmlproperty Color org.deepin.dtk::Palette::hoveredDark.common - \qmlproperty Color org.deepin.dtk::Palette::hoveredDark.crystal - - 控件 hovered 状态时的暗色主题颜色。 - */ - -/*! - \qmlpropertygroup org.deepin.dtk::Palette::pressed - \qmlproperty Color org.deepin.dtk::Palette::pressed.common - \qmlproperty Color org.deepin.dtk::Palette::pressed.crystal - - 控件 “Pressed” 状态时的调色板颜色, “Pressed” 状态对应于鼠标按压后的控件 - 状态,并非所有的控件都需要响应此状态,如“Button”、“CheckBox”存在该状态, - “Label”,“Edit”不存在该状态。 - */ - -/*! - \qmlpropertygroup org.deepin.dtk::Palette::pressedDark - \qmlproperty Color org.deepin.dtk::Palette::pressedDark.common - \qmlproperty Color org.deepin.dtk::Palette::pressedDark.crystal - - 控件 “Pressed” 状态暗色主题下对应的调色板颜色。 - */ - -/*! - \qmlpropertygroup org.deepin.dtk::Palette::disabled - \qmlproperty Color org.deepin.dtk::Palette::disabled.common - \qmlproperty Color org.deepin.dtk::Palette::disabled.crystal - - 控件 “disabled” 状态下的调色板颜色,控件的 “Disabled” 状态对应于控件的禁用 - 状态,每个控件都具备禁用状态,如未指定时,默认使用“Normal”状态下的颜色代替。 - */ - -/*! - \qmlpropertygroup org.deepin.dtk::Palette::disabledDark - \qmlproperty Color org.deepin.dtk::Palette::disabledDark.common - \qmlproperty Color org.deepin.dtk::Palette::disabledDark.crystal - - 控件 “disabled” 状态暗色主题下对应的调色板颜色 - */ - -/*! - \qmltype ColorSelector - \inherits QtObject - \inqmlmodule org.deepin.dtk - \keyword DQuickControlColorSelector - \brief DTK 用于指定控件颜色的统一取色辅助器. - - 取色器作为一个能够自动获取控件不同状态,并根据该状态选择合适的颜色的角色而存在。目的是用于 - 简便控件状态的使用,自动并高效的指定控件颜色。使用取色器作用在控件上时,处理颜色的过程更加 - 简单,只需要在控件中指定对应属性的调色板信息,在需要使用的地方,使用取色器直接使用就能达到 - 跟随状态自动改变的效果。 - - 由于需要在控件中指定不同的调色板颜色属性,因此外部可以通过更改该属性而达到修改取色器颜色值 - 进行颜色替换的效果,每个控件中都具备相同类型的属性,如 “backgroundColor” 背景颜色属性, - “textColor” 文字颜色属性等等。除此之外,取色器能够高级的只监听某一种控件状态,如 - “Button” 的 “hovered” 或 “Pressed” 状态。同时取色器能够根据系统主题信息,自动选择 - 对应主题下的调色板属性。 - - 颜色控制系统可以分为三个层次:调色板、控件属性和取色器。取色器作为监听者,能够监听这二者的变 - 化,除此之外,取色器会根据当前绑定的控件状态、控件对象等等信息自动更改颜色。下面给出一个简单 - 的示例代码: - - \qml - import org.deepin.dtk 1.0 - - Control { - id: control - width: 500 - height: 50 - - property Palette backgroundColor: Palette { - normal: "black" - } - property Palette textColor: Palette { - normal: "white" - } - - contentItem: Text { - text: "Test......." - color: control.ColorSelector.textColor - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - } - - background: Rectangle { - width: 250 - height: 50 - color: control.ColorSelector.backgroundColor - } - } - \endqml - - \note 当控件类型继承于 Control 或者控件存在调色板数据时,该控件的 ColorSelector 附加属性才会被创建。 - \note 如果当前控件非继承于 Control类型,且具备创建 ColorSelector 的条件,该 ColorSelector 将寻找其最 - 上层父类的 Control 控件,并进行调色板和控件状态的更新绑定。 - \note ColorSelector 仅会监听当前控件和离它最近的父类 Control控件的调色板属性。其中间父类不论是否存在 - ColorSelector 对象,都不会读取和绑定。 - - ColorSelector 在下述变化的场景中,同样能够跟随控件发生变化。 - \section2 ColorSelector 可跟随控件状态发生变化 - 当 Control 开启 hoverEnabled 属性后,ColorSelector 能够监听控件状态的变化过程,并跟随发生属性的颜色变化 - \qml - import org.deepin.dtk 1.0 - - Control { - id: control - width: 50 - height: 50 - hoverEnabled: true - property Palette backgroundColor: Palette { - normal: "red" - hovered: "green" - } - - background: Rectangle { - anchors.fill: parent - color: control.ColorSelector.backgroundColor - } - } - \endqml - - \section1 ColorSelector 的颜色属性 - \section2 ColorSelector 跟随手动修改后的调色板颜色而变化 - 可通过直接修改调色板的在某个状态额颜色值,而直接更新 ColorSelecotor 读取出来的调色板 - 属性颜色,如下述代码所示: - \qml - import org.deepin.dtk 1.0 - - Control { - id: control - width: 50 - height: 50 - hoverEnabled: true - - background: Rectangle { - id: rect - property Palette backgroundColor: Palette { - normal: "red" - hovered: "green" - } - color: ColorSelector.backgroundColor - anchors.fill: parent - - MouseArea { - anchors.fill: parent - onClicked: { - rect.backgroundColor.hovered = "yellow" - } - } - } - } - \endqml - 可通过直接赋值的方式,替换 ColorSelector 记录的整个调色板数据,如下述 - 代码所示: - \qml - import org.deepin.dtk 1.0 - - Control { - id: control - width: 50 - height: 50 - hoverEnabled: true - - background: Rectangle { - id: rect - property Palette backgroundColor: Palette { - normal: "red" - hovered: "green" - } - anchors.fill: parent - color: ColorSelector.backgroundColor - - MouseArea { - Palette { - id: otherPalette - normal: "black" - hovered: "gray" - } - anchors.fill: parent - onClicked: { - rect.backgroundColor = otherPalette - } - } - } - } - \endqml - - \section2 ColorSelector 响应自身属性值的变化 - 上述替换调色板属性,同样也可通过 ColorSelector 进行替换。如下述代码所示: - \qml - import org.deepin.dtk 1.0 - - Control { - id: control - width: 50 - height: 50 - hoverEnabled: true - - background: Rectangle { - id: rect - property Palette backgroundColor: Palette { - normal: "red" - hovered: "green" - } - anchors.fill: parent - color: ColorSelector.backgroundColor - - MouseArea { - anchors.fill: parent - onClicked: { - Palette { - id: otherOPalette - normal: "black" - hovered: "gray" - } - rect.ColorSelector.backgroundColor = otherPalette - } - } - } - } - \endqml - 替换后的属性值,可通过赋值为 undefined 进行复原,如下述代码所示: - \qml - import org.deepin.dtk 1.0 - - Control { - id: control - width: 50 - height: 50 - hoverEnabled: true - - background: Rectangle { - id: rect - property Palette backgroundColor: Palette { - normal: "red" - hovered: "green" - } - anchors.fill: parent - color: ColorSelector.backgroundColor - - MouseArea { - anchors.fill: parent - onClicked: { - Palette { - id: otherPalette - normal: "black" - hovered: "gray" - } - rect.ColorSelector.backgroundColor = otherPalette - } - onDoubleClicked: { - // 复原 - rect.ColorSelector.backgroundColor = undefined - } - } - } - } - \endqml - - \section2 ColorSelector 对于自身没有的调色板属性,会从上层 Control 寻找 - ColorSelector 属性能够获取其自身对象以及其最近的 Control 控件的调色板属性,并监听 Control 控件的状态变化, - 进行颜色属性的自动更新。如下述代码所示: - \qml - import org.deepin.dtk 1.0 - - Control { - id: control - width: 200 - height: 200 - hoverEnabled: true - property Palette backgroundColor: Palette { - normal: "red" - hovered: "green" - } - - background: Rectangle { - property Palette borderColor: Palette { - normal: "blue" - hovered: "yellow" - } - // 获取 Control 类中的 backgroundColor 调色板属性 - color: ColorSelector.backgroundColor - border.width: 2 - // 获取自身的 borderColor 调色板属性 - border.color: ColorSelector.borderColor - } - } - \endqml - \warning 需要注意的是, Control 控件的子控件,如果其自身不存在任何调色板属性,将不会 - 为它创建 ColorSelector 对象。因此上述方式只能作用于 子控件存在调色板属性的场景。 - - \section2 ColorSelector 能够监听控件的父类,当父类发生变化时,会跟随更新其使用父类的所有调色板颜色。 - - \section2 已封装好的控件使用颜色覆盖的形式 - 如想要替换 Button 中的文本颜色时,可用如下代码: - \qml - Button { - text: "Push Button" - textColor: Palette { - normal: "red" - hovered: "blue" - } - } - \endqml - - \section1 ColorSelctor 进行状态过滤 - ColorSelector 可以进行控件单一状态(hovered、pressed、disabled、inactived)的设置。默认情况下,各 - 个状态都是处于未设置的状态,即不针对某一状态进行单独处理而默认接受所有状态的改变。 - - \list - \li 将控件的某个状态作为其标准状态 - 例如控件需要将其“Hovered”状态作为其标准状态时,可使用如下代码: - \qml - Rectangle { - width: 200 - height: 300 - - Button { - anchors.centerIn: parent - text: "Hovered state" - // 仅处理 hovered 状态 - ColorSelector.hovered: true - } - } - \endqml - \li 控件禁用某一状态 - 例如当控件需要禁用“Hovered”状态时,可使用如下代码: - \qml - Rectangle { - width: 200 - height: 300 - - Button { - anchors.centerIn: parent - text: "Can't Hovered" - ColorSelector.hovered: false - } - } - \endqml - \li 多种状态的叠加 - 当禁用状态和启用状态同时使用时,例如除“Hovered”状态外,其他状态都处于禁用状态,可用如下代码: - \qml - Rectangle { - width: 200 - height: 300 - - Button { - anchors.centerIn: parent - text: "Only Hovered" - ColorSelector.hovered: true - ColorSelector.pressed: false - ColorSelector.disabled: false - } - } - \endqml - 上述代码的效果为,仅展示 Hovered 状态,禁用其他所有状态。 - \endlist - - \note 状态控制仅接受真实bool值的设置,不针对属性绑定 - \note 推荐控件只有一种状态被启用。当多个状态都处于启用状态时,标准状态将按照不同控件情况而定。 - - \section1 标准控件的 Palette 属性对照 - 下表列出基础控件可被替换修改的调色板颜色属性值(按字母顺序排序): - \table - \header - \li 控件 - \li 属性 - \li 描述 - \row - \li ActionButton - \li textColor - \li 按钮的文本和图标的颜色 - \row - \li {1, 7} BoxPanel - \li color1 - \li Box 或 Button 控件的背景渐变色1 - \row - \li color2 - \li Box 或 Button 控件的背景渐变色2 - \row - \li insideBorderColor - \li Box 或 Button 控件的内描边颜色 - \row - \li outsideBorderColor - \li Box 或 Button 控件的外描边颜色 - \row - \li dropShadowColor - \li Box 或 Button 控件的外阴影颜色 - \row - \li innerShadowColor1 - \li Box 或 Button 控件的内阴影渐变颜色1 - \row - \li innerShadowColor2 - \li Box 或 Button 控件的内阴影颜色2 - \row - \li BusyIndicator - \li fillColor - \li BusyIndicator 的填充色 - \row - \li Button - \li textColor - \li 按钮控件中的文本和图标颜色 - \row - \li ButtonIndicator - \li backgroundColor - \li ButtonIndicator 的背景颜色 - \row - \li ButtonPanel - \li 继承于 BoxPanel - \li 能使用 BoxPanel 中的所有调色板颜色 - \row - \li CheckDelegate - \li backgroundColor - \li \l CheckDelegate 控件的背景色 - \row - \li ComboBox - \li separatorColor - \li ComboBox 在编辑状态下的分隔符颜色 - \row - \li {1, 2} EditPanel - \li backgroundColor - \li 所有的编辑框背景色 - \row - \li alertBackgroundColor - \li 所有编辑框在显示警告信息时的背景颜色 - \row - \li {1, 2} EmbeddedProgressBar - \li backgroundColor - \li 嵌入式进度条的背景颜色 - \row - \li progressBackgroundColor - \li 嵌入式进度条的进度背景色 - \row - \li FloatingButton - \li 继承于 Button - \row - \li {1, 3} FloatingPanel - \li backgroundColor - \li FloatingPanel 控件的背景颜色 - \row - \li dropShadowColor - \li FloatingPanel 的外阴影颜色 - \row - \li borderColor - \li FloatingPanel 的边框颜色 - \row - \li {1, 3} HighlightPanel - \li backgroundColor - \li HighlightPanel 的背景颜色 - \row - \li outerShadowColor - \li HighlightPanel 的外阴影颜色 - \row - \li innerShadowColor - \li HighlightPanel 的内阴影颜色 - \row - \li IpV4LineEdit - \li backgroundColor - \li IpV4LineEdit 的背景框颜色 - \row - \li ItemDelegate - \li checkedTextColor - \li ItemDelegate 在选中时的文本颜色 - \row - \li {1, 2} KeySequenceEdit - \li backgroundColor - \li KeySequenceEdit 控件的背景颜色 - \row - \li placeholderTextColor - \li KeySequenceEdit 的占位文本颜色 - \row - \li {1, 2} MenuItem - \li subMenuBackgroundColor - \li 子菜单的背景色 - \row - \li itemColor - \li 文字和图标 Hovered 状态下的颜色 - \row - \li Slider - \li grooveColor - \li Slider 控件的滑槽背景颜色 - \row - \li {1, 2} SliderTipItem - \li tickColor - \li Slider 控件标签的背景颜色 - \row - \li textColor - \li Slider 控件标签的文本颜色 - \row - \li SpinBoxIndicator - \li inactiveBackgroundColor - \li SpinBox 右侧指示按钮在未激活状态时的背景颜色 - \row - \li {1, 2} Switch - \li backgroundColor - \li Switch 按钮的背景颜色 - \row - \li handleColor - \li Switch 按钮的滑槽颜色 - \row - \li TextField - \li backgroundColor - \li TextField 控件的背景颜色 - \row - \li TitleBar - \li textColor - \li TitleBar 控件的文本和图标颜色 - \row - \li ToolButton - \li textColor - \li ToolButton 控件的文本和图标颜色 - \row - \li WarningButton - \li 继承于 Button - \li 能使用 Button 控件中的所有调色板颜色 - \row - \li {1, 5} WaterProgressBar - \li backgroundColor1 - \li WaterProgressBar 的背景渐变色1 - \row - \li backgroundColor2 - \li WaterProgressBar 的背景渐变色2 - \row - \li dropShadowColor - \li WaterProgressBar 的外阴影颜色 - \row - \li popBackgroundColor - \li WaterProgressBar 的内置小气泡背景颜色 - \row - \li textColor - \li WaterProgressBar 的文本颜色 - \row - \li WindowButton - \li textColor - \li WindowButton 控件的文本和图标颜色 - \row - \li WindowButtonGroup - \li textColor - \li WindowButtonGroup 内所有 WindowButton 控件的文本和图标颜色 - \endtable - */ - -/*! - \qmlproperty Item org.deepin.dtk::ColorSelector::control - \readonly - - 需要绑定的 Control 对象。绑定后 ColorSelector 会根据当前 control 的状态 - 选择对应的颜色值。通常情况下该属性不需要手动设置,当使用 ColorSelector 的 - 附加属性时,ColorSelector 会自动寻找最接近其的父类 Control 控件,并自动将 - 该控件当做需要监听的对象,因此一个父类 Control,其所有的子类的 ColorSelector - 属性都将按照它的状态发生颜色变化。 - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::ColorSelector::controlTheme - \readonly - - control 控件的当前主题,只读属性,通常情况下 ColorSelector 会监听控件的主题状态。 - 用于选择亮色或暗色的状态颜色。 - 枚举对应于 ApplicationHelper 中的主题色枚举,如下表所示: - - \table - \header - \li 枚举值 - \li 名称 - - \row - \li ApplicationHelper.LightType - \li 亮色主题类型 - \row - \li ApplicationHelper.DarkType - \li 暗色主题类型 - \row - \li ApplicationHelper.UnknowType - \li 未知主题类型 - \endtable - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::ColorSelector::controlState - \readonly - - 控件状态,只读属性。该属性是 ColorSelector 根据当前 control 的状态自动生成。 - 其枚举值如下表所示: - - \table - \header - \li 枚举值 - \li 名称 - \row - \li DTK.NormalState - \li normal 状态 - \row - \li DTK.HoveredState - \li Hovered 状态 - \row - \li DTK.PressedState - \li Pressed 状态 - \row - \li DTK.DisabledState - \li 控件被禁用状态 - \row - \li DTK.InactiveState - \li 控件未激活状态 - \endtable - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::ColorSelector::family - - 调色板额颜色族,指定 ColorSelector 需要设置的颜色族。不同的颜色族提供的颜色 - 不一致,目前有两种颜色族可以定义: - - \table - \header - \li 枚举值 - \li 名称 - \row - \li Palette.CommonColor - \li 基本颜色族。默认的颜色族,不额外指定时,控件为该颜色族。存储控件默认场景下的颜色。 - - \row - \li Palette.CrystalColor - \li 水晶颜色族。当控件的背景为透明模糊时,使用该颜色族。 - \endtable - - 其使用方式如下代码所示: - \qml - import org.deepin.dtk 1.0 - FloatingPanel { - width: 200 - height: 200 - backgroundColor: Palette { - normal { - common: "#f0f0f0" - crystal: Qt.rgba(0.20, 0.2, 0.2, 0.1) - } - hovered: "#d2d2d2" // common family - pressed.crystal: "#cdd6e0" // crystal family - } - - ColorSelector.family: Palette.CrystalColor - contentItem: ListView { - model: 6 - delegate: MenuItem { text: "菜单项" + modelData } - } - } - \endqml - */ - -/*! - \qmlproperty bool org.deepin.dtk::ColorSelector::hovered - - 启用或者禁用 hovered 状态。当处于禁用状态时,控件对鼠标的悬浮状态不敏感。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::ColorSelector::pressed - - 启用或者禁用 pressed 状态。当处于禁用状态时,控件对鼠标的点击状态不敏感。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::ColorSelector::disabled - - 启用或者禁用 disabled 状态。当处于禁用状态时,控件对其 disabled 状态不敏感。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::ColorSelector::inactived - - 启用或者禁用 inactived 状态。当处于禁用状态时,控件对其 inactived 状态不敏感。 - */ - -/*! - \qmlsignal void org.deepin.dtk::ColorSelector::colorPropertyChanged(string name) - - 当 ColorSelector 内存储的颜色属性发生变化时,触发该信号。 \a name 为发生改变的颜色属性名称 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dquickdciicon.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dquickdciicon.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dquickdciicon.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dquickdciicon.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,264 +0,0 @@ -/*! - \qmltype DciIcon - \inherits Item - \inqmlmodule org.deepin.dtk - \keyword DQuickDciIcon - \brief 提供一个兼容多种场景的DTK图标控件. - - DCI 图标控件是一个提供多模式、多主题、多大小的整合型控件,该控件可能包含多个图标文件,在上述 - 场景下进行动态切换。例如,当某个图标文件在鼠标的不同状态下需要发生前景色甚至整个图标的变化时, - 常规图标需要在不同状态时切换不同图标,代码繁琐且难维护DCI 图标为了解决这种多场景的问题,帮助 - 在 QML 中能够快速实现图标跟随不同场景的变化。 - - \section1 多模式 - DCI 图标可以包含多种不同的模式下的图标,DCI 图标分为五种状态, - 其分别为:NormalState、HoveredState、PressedState、 - DisabledState 和 InactiveState 。这五种状态和 \l{DTK}{DQMLGlobalObject} - 中的 DTK.ControlState 枚举一致,能够直接兼容该枚举进行使用。 - - 这个状态用于表示控件的不同状态,并不是每个控件都有每种不同的状态,如 Rectangle 控件 - ,就只有NormalState、DisabledState 和 InactiveState。而 Button 控件,就有上述 - 的所有状态。当控件使用的 DCI 图标文件中有某个状态下的单独图标时,会优先显示该状态下的 - 图标文件,否则显示 NormalState 状态下的图标文件。如果一个图标文件中不存在 NormalState - 状态下的图标,则讲该图标视为一个无效图标。 - - \section1 多主题 - DCI 图标适配了多主题下的图标不一致问题。设计中可能会存在 DCI 图标在不同的主题下图标不一致 - 的情况,目前的实现只能保证图标的前景配色跟随主题发生改变。DCI整合多主题的问题,使同一个图标 - 在不同主题下的不一致,仍能用一个图标进行表示,并能根据不同主题的情况,发生图标的适应性变化。 - 目前多主题分为:深色主题和浅色主题两种。 - - \section1 多缩放比、多大小 - DCI 图标能够适配不同的缩放比和大小。例如控件的大小和设备的缩放比,当控件需要通过 DCI 图标进 - 行高级合成时(如 Switch 控件的 Handle),控件可能在不同的场景下大小不同,这时图标就需要根 - 据这种不同的大小场景动态选择出合适大小的图标进行展示。设备缩放比同样如此,目前 DCI 图标的策略 - 是,优先将图标中较大的大小和缩放比进行缩放显示。 - - \section1 使用图层进行布局 - DCI 图标使用图层布局每种状态下的图标,QML 下的图标文件大多数都存在阴影特效,这类特效并不是 - 应用程序在渲染绘制时添加的,而是 DCI 图标本身存在的阴影大小,而在某些情况下,可能存在阴影不 - 占用控件大小或者阴影不跟随图标前景色发生变化的情况。因此,为了区别同一个图标的不同变化问题, - DCI 图标的内部渲染使用图层概念,每个图标的内部都由不同的图层组成,每个图层都代表不同的部件, - 如 Switch控件的 Handle 控件中,中心滑块是一个图层,外阴影是一个图层,内阴影也是一个图层。 - 这些不同图层通过不同顺序的堆叠形成最终效果。 - - \image images/dciicon-layers.png - - \section1 图标调色板 - 每个图标都有一个调色板,其包含四种类型的颜色:前景色、背景色、高亮前景色、高亮色,这四种调色板 - 分别对应不同的情形,每个图层文件都包含一个调色板数据,而每个图标文件可能存在多个图层文件,因此, - 每个图标可能有多个调色板,如一个图标的背景色如果存在变化的情况,则其背景图层会标记为背景色调色板; - 而对于需要高亮显示的部分,其图层指定的调色板数据则为高亮色。当用户在使用 DCI 图标时,如果该图标 - 需要调色板数据,则需要显示指定该调色板颜色值,如下述代码所示: - - \qml - import org.deepin.dtk 1.0 - - DciIcon { - name: "test-icon" - sourceSize { - width: 50 - height: 50 - } - - // 设置调色板数据 - palette.foreground: "red" - palette.background: "black" - palette.highlight: "blue" - palette.hightlightForeground: "white" - } - \endqml - - 对于能够继承 QPalette 的控件,在控件的颜色对应正常的情况下,可以直接使用控件的调色板指定,如下代码: - - \qml - import org.deepin.dtk 1.0 - - Control { - id: control - width: 100 - height: 100 - - background: Rectangle { - color: control.palette.background - } - - contentItem: DciIcon { - name: "test-icon" - sourceSize { - width: 50 - height: 50 - } - - palette: DTK.makeIconPalette(control.palette) - } - } - \endqml - - \section1 附加属性 - DciIcon 控件存在附加属性,附加属性为了保持和 QtIcon 的兼容,为了更方便的操作使用 QtIcon 的控件,如 Button ComboBox - 等等。 DciIcon 的附加属性和其内部属性一致,目的时为了设置 QtIcon 中不存在的图标属性,如 mode theme palette 等等。 - 其用法可用下述代码表示: - - \qml - import org.deepin.dtk 1.0 - - Button { - icon { - name: "test" - width: 50 - height: 50 - } - - DciIcon.mode: DTK.HoveredState - DciIcon.theme: ApplicationHelper.LightType - DciIcon.palette { - foreground: "red" - } - DciIcon.fallbackToQIcon: true - } - \endqml - - 其附加属性如下列表: - - \table - \row - \li mode - \li 与 \l {mode}{DciIcon::mode} 功能保持一致 - - \row - \li theme - \li 与 \l {theme}{DciIcon::theme} 功能保持一致 - - \row - \li palette - \li 与 \l {palette}{DciIcon::palette} 功能保持一致 - - \row - \li fallbackToQIcon - \li 与 \l {fallbackToQIcon}{DciIcon::fallbackToQIcon} 功能保持一致 - \endtable - */ - -/*! - \qmlproperty string org.deepin.dtk::DciIcon::name - - name 属性用于设置 DciIcon 的名称,一般情况下,该名称需要对应图标主题下的图标名称,而不需要将资源路径或绝 - 对路径下的全名称设置进去。例如 “/usr/share/dsg/icons/bloom”目录下存在一个名称为 “test.dci” 的文 - 件。在使用时可直接用下述情况进行展示: - - \qml - import org.deepin.dtk 1.0 - - DciIcon { - name: "test" - } - \endqml - - 图标主题的存在是为了更方便的将一类图标进行统一管理与更换,同时也能更好的配置一些图标替换操作,例如使用图标主题能够帮助 - DTK 内部管理和控制图标的替换。例如上述的“test”图标,其所属的图标主题名为“bloom”。更多的图标主题规范内容,请见 - DCI 图标主题规范。 - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::DciIcon::mode - - mode 属性用于设置 DciIcon 的图标模式,不同的 mode 其对应的图标文件可能会不一样,其枚举值如下述表示: - - \value DTK.NormalState 控件的normal状态 - \value DTK.HoveredState 控件鼠标悬浮时的状态 - \value DTK.PressedState 控件的pressed状态 - \value DTK.DisabledState 控件的禁用状态 - \value DTK.InactiveState 控件的未激活状态 - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::DciIcon::theme - - theme 属性用于设置 DciIcon 的图标主题,目前分为深色主题和浅色主题两种。不同主题下的图标可能会不一样。 - - \value ApplicationHelper.UnknownType 未知主题 - \value ApplicationHelper.LightType 亮色主题 - \value ApplicationHelper.DarkType 暗色主题 - */ - -/*! - \qmlpropertygroup org.deepin.dtk::DciIcon::palette - \qmlproperty color org.deepin.dtk:::DciIcon::palette.foreground - \qmlproperty color org.deepin.dtk:::DciIcon::palette.background - \qmlproperty color org.deepin.dtk:::DciIcon::palette.highlight - \qmlproperty color org.deepin.dtk:::DciIcon::palette.highlightForeground - - 该属性用于设置 DciIcon 的图标调色板。 - - \include ddciiconpalette.qdocinc grouped-properties - */ - -/*! - \qmlproperty size org.deepin.dtk::DciIcon::sourceSize - - sourceSize 属性用于指定 DciIcon 控件的大小,一般情况下,在未指定其图标大小时, - 会读取出图标的默认大小,但由于控件本身未设置大小,因此该该控件本身并不占用任何大小。 - 除非手动指定了 width height 属性。 - - 当 sourceSize 被指定时,DciIcon 控件被设置了与 sourceSize 大小一致的隐式宽高, - 当图标存在外阴影时,其阴影部分不占用 sourceSize 的大小。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::DciIcon::mirror - - mirror 属性决定 DciIcon 控件是否需要水平翻转显示。 - - 该属性默认是 false. - \sa {Image::mirror} - */ - -/*! - \qmlproperty bool org.deepin.dtk::DciIcon::fallbackToQIcon - - fallbackToQIcon 属性决定当 DciIcon 无法在当前主题下找到对应 name 的 - 图标文件时,其是否需要从 QtIcon 中继续寻找。当控件使用 Qt 的图标加载方 - 式时,将该属性打开能够兼容 Qt 的图标控件进行显示。 - - 该属性默认时 false. - */ - -/*! - \qmlattachedproperty enumeration org.deepin.dtk::DciIcon::mode - - 该属性用于附加一个图标 mode 状态值。其使用方式如下 - \qml - Button { - DciIcon.mode: DTK.HoveredState - } - \endqml - */ - -/*! - \qmlattachedproperty enumeration org.deepin.dtk::DciIcon::theme - - 该属性用于附加一个图标亮暗色主题枚举。其使用方式如下 - \qml - Button { - DciIcon.theme: ApplicationHelper.DarkTheme - } - \endqml - */ - -/*! - \qmlattachedproperty group org.deepin.dtk::DciIcon::palette - - 该属性用于附加一个图标调色板。其使用方式如下 - \qml - Button { - DciIcon.palette.foreground: "red" - } - \endqml - */ - -/*! - \qmlattachedproperty bool org.deepin.dtk::DciIcon::fallbackToQIcon - - 指定附加一个当无法找到 Dci Icon 时是否回滚到 QIcon 中。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dquickglow.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dquickglow.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dquickglow.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dquickglow.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/*! - \qmltype GlowEffect - \inherits Item - \inqmlmodule org.deepin.dtk - \brief DTK 中一种光晕特效控件. - - GlowEffect 是一种在 DTK 中用于作用在控件上的光晕特效。该特效使用 - OpenGL 中特殊的阴影材质着色器实现,目前仅支持硬件软件模式,不支持软 - 件渲染。如需使用支持全模式的阴影效果,请使用控件 BoxShadow. - 光晕特效通常呗作用在矩形中,用于矩形的阴影效果。例如 DTK 根据 GlowEffect - 开发出的 RectangularShadow 控件。 GlowEffect 的使用场景更加抽象,其属性 - 更难控制,对于简单场景,请使用 RectangularShadow 控件。 - - 如下示例代码: - \qml - import org.deepin.dtk 1.0 - GlowEffect { - anchors.centerIn: parent - width: 100 - height: 100 - glowRadius: 50 - color: "black" - spread: 0.01 - relativeSizeX: 0.5 - relativeSizeY: 0.5 - } - \endqml - - 其效果为: - \image images/dtk-gloweffect.png - - \sa RectangularShadow - */ - -/*! - \qmlproperty qreal org.deepin.dtk::GlowEffect::glowRadius - - 该属性用于表示光晕半径,当 fill 属性为 true 时,该属性将不会生效。发光半径 - 表示从 (0,0) 点到矩形的中心点的距离,当发光半径等于矩形宽高的一半时,表示对 - 矩形的全部填充。 - */ - -/*! - \qmlproperty color org.deepin.dtk::GlowEffect::color - - 该属性用于表示光晕特效的填充颜色。 - */ - -/*! - \qmlproperty qreal org.deepin.dtk::GlowEffect::spread - - 该属性用于表示发光的扩散系数。该系数越小,表示扩散程度越大。 - */ - -/*! - \qmlproperty qreal org.deepin.dtk::GlowEffect::relativeSizeX - - 该属性用于表示光晕相对大小的 X 坐标。其取值范围为[0,1]。0表示无相对大小。 - 1表示完全相对。 - */ - -/*! - \qmlproperty qreal org.deepin.dtk::GlowEffect::relativeSizeY - - 该属性用于表示光晕相对大小的 Y 坐标。其取值范围为[0,1]。0表示无相对大小。 - 1表示完全相对。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::GlowEffect::fill - - 该属性表示是否填充整个光晕区域。当设置为填充时,光晕颜色将完全覆盖矩形大小。 - 当扩散系数未覆盖区域时,显示出颜色的纯色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dquickiconimage.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dquickiconimage.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dquickiconimage.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dquickiconimage.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -/*! - \qmltype QtIcon - \inherits Item - \inqmlmodule org.deepin.dtk - \keyword DQuickIconImage - \brief 提供一种使用 Qt 方式加在图标的控件 - - QtIcon 作为 DTK 程序访问和插件 Qt 图标的控件,虽然 DTK Quick 极力推荐 - 应用在大多数的场景下使用 Qt 图标,但是不乏存在应用能需要使用 Qt 图标的情况。 - 因此 DTK 提供 QtIcon 来访问和获取 Qt 图标。 其使用方式如下所示代码: - - \qml - QtIcon { - name: "button-add" - sourceSize { - width: 128 - height: 128 - } - - mode: QtIcon.Selected - color: "gray" - state: QtIcon.On - } - \endqml - */ - -/*! - \qmlproperty string org.deepin.dtk::QtIcon::name - - name 属性用于设置 QtIcon 的图标名称,该名称通过图标主题的方式查找提供。 - DTK环境下实现的图标主题在 dtkgui 中,通过 Built-in 图标隐藏和 Xdg 图标 - 引擎提供。 - - 当 name 图标无法找到时,请先设置好 fallbackSource 属性,用于 fallback 到 - 该路径下的图标中。 - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::QtIcon::state - state 属性描述 QtIcon 中图标的当前状态。 state 属性于 QIcon 中的 - State 枚举一致,不同的图标可能存在不同的状态。状态可以使用以下枚举: - - \table - \header - \li 枚举值 - \li 名称 - \row - \li QtIcon.On - \li 类似于 QIcon::On 即图标的开启状态 - \row - \li QtIcon.Off - \li 类似于 QIcon::Off 即图标的关闭状态 - \endtable - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::QtIcon::mode - mode 属性描述 QtIcon 中的模式,不同模式下的图标,可能展示的效果 - 不同,目前可以使用的模式枚举值为: - - \table - \header - \li 枚举值 - \li 名称 - \row - \li QtIcon.Invalid - \li 无效状态 - \row - \li QtIcon.Normal - \li normal 状态,图标的标准状态。 - \row - \li QtIcon.Disabled - \li Disabled 状态,类似于控件的 Disabled 状态。 - \row - \li QtIcon.Active - \li Active 状态,激活状态,类似于控件的 Hover 状态 - \row - \li QtIcon.Selected - \li Selected 状态,选中状态,类似于 MenuItem 的选中状态 - \endtable - */ - -/*! - \qmlproperty color org.deepin.dtk::QtIcon::color - - color 属性描述图标填充的前景色颜色。与 Qt 提供的 Icon 控件效果一致, - 当需要进行颜色填充时,请使用该属性。 - */ - -/*! - \qmlproperty url org.deepin.dtk::QtIcon::fallbackSource - - 用于当 name 属性无法获取到图标时, fallbackSource 能够提供次选方案。 - 如果两种方式都无法找到图标,应用程序将出现一些警告信息。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dquickiconlabel.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dquickiconlabel.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dquickiconlabel.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dquickiconlabel.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -/*! - \qmltype IconLabel - \inherits Item - \inqmlmodule org.deepin.dtk - \keyword DQuickIconLabel - \brief 提供一种带图标和文字的组合控件类型 - - Qt Quick Control 2 中提供了类似控件,但 IconLabel 与它不同的是, - IconLabel 兼容了 DciIcon 的支持,提供了图标和文字的组合方式等等,使 - 该控件的使用更加灵活。 - - 该控件的场景效果如下图所示: - \image images/IconLabel.png - - 使用代码示例如下所示: - \qml - IconLabel { - icon.name: "action_setting" - spacing: 10 - icon.width: 48 - icon.height: 48 - display: D.IconLabel.TextBesideIcon - text: "Text Beside Icon" - } - \endqml - - \warning 请注意这是一个内部控件,并不作为 DTK 的外部控件提供。 - \warning IconLabel 控件使用的图标类型为 DciIcon ,而非 QtIcon 和 Icon. - */ - -/*! - \qmlpropertygroup org.deepin.dtk::IconLabel::icon - \qmlproperty string org.deepin.dtk:::IconLabel::icon.name - \qmlproperty real org.deepin.dtk:::IconLabel::icon.width - \qmlproperty real org.deepin.dtk:::IconLabel::icon.height - \qmlproperty enumeration org.deepin.dtk:::IconLabel::icon.mode - \qmlproperty enumeration org.deepin.dtk:::IconLabel::icon.theme - \qmlproperty string org.deepin.dtk:::IconLabel::icon.source - - icon 属性表示 IconLabel 中使用的图标, 其与 DciIcon 中控件的属性一致,但又有不同 - 之处,其子属性如下表列举所示: - - \table - \row - \li icon.name - \li dci 图标名称,从图标主题中获取,其用法于 DciIcon::name 一致。 - \row - \li icon.width - \li 图标宽度,请确保在使用图标的时候给定一个具体宽度。 - \row - \li icon.height - \li 图标高度,请确保在使用图标的时候给定一个具体高度。 - \row - \li icon.mode - \li 图标的状态,与 DciIcon 中图标状态枚举一致。 - \row - \li icon.theme - \li 图标主题,与 DciIcon 中图标主题枚举一致。 - \row - \li icon.source - \li Dci 图标 fallback 到 Qt 图标时的路径,该路径应该是 - Qt 图标的 source 属性。一般情况下,应用无需关心该属性值, - \l{DTK::makeIcon()}{DTK.makeIcon()} 函数中已经将该属性于 Qt 图标进行绑定。 - \endtable - */ - -/*! - \qmlproperty string org.deepin.dtk:::IconLabel::text - - text 属性描述 IconLabel 控件中的文本文字内容,暂只支持静态文本。 - */ - -/*! - \qmlproperty font org.deepin.dtk:::IconLabel::font - - font 属性描述 text 所使用的字体。 - - 对于更多可以使用的 Qml 字体属性列表,请参阅 \l {Qml 字体属性类型} {https://doc.qt.io/qt-5/qml-font.html} - */ - -/*! - \qmlproperty color org.deepin.dtk:::IconLabel::color - - color 属性表示 text 的文字颜色。 - */ - -/*! - \qmlproperty enumeration org.deepin.dtk:::IconLabel::display - - display 属性表示文字和图标的排列方式,IconLabel 控件提供了5种不同的图标展示方式, - 具体请看下表: - - \table - \row - \li IconLabel.IconOnly - \li 仅展示图标 - \row - \li IconLabel.TextOnly - \li 仅展示文字 - \row - \li IconLabel.TextBesideIcon - \li 文字置于图标之后 - \row - \li IconLabel.TextUnderIcon - \li 文字置于图标之下 - \row - \li IconLabel.IconBesideText - \li 图标置于文字之后 - \endtable - */ - -/*! - \qmlproperty real org.deepin.dtk::IconLabel::spacing - - spacing 属性描述文字和图标之间的间距值。当仅有图标或者仅有文字时 - 该属性将不会生效。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::IconLabel::mirrored - - 镜像属性,一般情况下无需操作该属性。不同国家和地区可能阅读方式不一样, - 默认情况下的控件为从左到右排列,当需要控件进行从右向左展示时,该接口 - 可以很好的解决次问题。 - - \warning 请注意,该属性的读取接口为 isMirrored . - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::IconLabel::alignment - - 该属性用于控制文字和图标的对其方式,默认的对其方式为左对齐,其枚举值如下: - \table - \row - \li Qt.AlignLeft - \li 左对齐 - \row - \li Qt.AlignRight - \li 右对齐 - \row - \li Qt.AlignHCenter - \li 水平居中对齐 - \row - \li Qt.AlignVCenter - \li 竖直居中对齐 - \row - \li Qt.AlignCenter - \li 居中对齐 - \endtable - */ - -/*! - \qmlproperty real org.deepin.dtk::IconLabel::topPadding - \qmlproperty real org.deepin.dtk::IconLabel::leftPadding - \qmlproperty real org.deepin.dtk::IconLabel::rightPadding - \qmlproperty real org.deepin.dtk::IconLabel::bottomPadding - - 该属性用于描述 IconLabel 的各个 padding 大小。是控件大小距离 contentWidth - 和 contentHeight 的预留区域大小, - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dquickitemviewport.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dquickitemviewport.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dquickitemviewport.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dquickitemviewport.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -/*! - \qmltype ItemViewport - \inherits Item - \inqmlmodule org.deepin.dtk - \keyword DQuickItemViewport - \brief 一种提供了操作其源对象 Item 的高级视图控件 - - ItemViewport 提供了能够操作其 sourceItem 对象的高级视图控件。 - ItemViewport 的用法很广泛,能够对各种 Item 类型进行圆角化处理, - 能够帮助 InWindowBlur 控件对背景进行窗口内模糊特效等等。 - - ItemViewport 不仅支持 GPU 渲染,其也适配了 CPU 模式。使用 DTK - 环境时,在 ItemViewport 控件能够处理的控件范围内,请尽量使用它,而非 - Qt 控件,因为 Qt 控件可能仅支持 CPU 或 GPU 两种中的一种。 - - 对于 ItemViewport 的使用场景,可以使用如下示例代码: - - \section3 特殊的圆角处理 - 某些特殊的场景下,当我们只需要 Button 控件四个角中的某一个圆角时,如下图所示,会发现 - 传统的控件无法达到要求,但可以使用 ItemViewport . - - \image images/itemViewport_clip_radius.png - - 其实现代码如下图所示: - \qml - import org.deepin.dtk 1.0 - - Item { - anchors.centerIn: parent - width: 100 - height: 100 - Item { - id: btnBackground - width: 120 - height: 120 - - Button { - id: btn - anchors { - right: parent.right - top: parent.top - } - width: 64 - height: 64 - icon { - name: "arrow_ordinary_up" - width: 48 - height: 48 - } - background: Rectangle { - color: "#AA00FF" - radius: 0 - } - } - } - - ItemViewport { - id: viewport - sourceItem: btnBackground - radius: 20 - fixed: true - width: btnBackground.width - height: btnBackground.height - anchors { - right: parent.right - top: parent.top - } - hideSource: true - } - } - \endqml - - \section3 配合 InWindowBlur 实现窗口内模糊 - - 窗口内模糊指控件所处的窗口内,其背景颜色的模糊, DTK 中使用 InWindowBlur 控件 - 实现。当然仅通过该控件还无法达到最终效果,需要配合 ItemViewport 进行组合使用。 - - \qml - import org.deepin.dtk - - Item { - Image { - anchors.fill: parent - source: "file:///usr/share/wallpapers/deepin/desktop.jpg" - } - - ListView { - id: testView - - model: 10 - spacing: 30 - clip: true - anchors { - fill: parent - margins: 10 - } - - delegate: Item { - height: 50 - width: 300 - anchors.horizontalCenter: parent.horizontalCenter - - InWindowBlur { - id: blur - anchors.fill: parent - radius: 20 - offscreen: true - } - - ItemViewport { - id: roundBlur - anchors.fill: blur - fixed: true - sourceItem: blur - radius: blur.radius - hideSource: false - } - - Rectangle { - radius: roundBlur.radius - anchors.fill: roundBlur - color: Qt.rgba(1, 0, 0, 0.2) - } - - Text { - anchors.centerIn: parent - text: "InWindowBlur" + index - color: "white" - font.pixelSize: 22 - } - } - } - } - \endqml - - 其效果展示如下: - \image images/inwindowblur.png - - ItemViewport 的实现原理是将源控件的内容作为材质输出到 ItemViewport 中,通过 - ItemViewport 设置的属性值和特定的功能,进行效果呈现并输出。当源控件更新状态时, - ItemViewport 会监测到这种状态更新,并进行实时同步更新。 - */ - -/*! - \qmlproperty Item org.deepin.dtk::ItemViewport::sourceItem - - sourceItem 用于指定源控件, sourceItem 不局限于 Item 控件,可以传入 - 任何继承自 Item 的控件。当 sourceItem 属性发生改变时,Itemviewport 会 - 进行实时更新。 - */ - -/*! - \qmlproperty Item org.deepin.dtk::ItemViewport::sourceRect - - sourceRect 用于指定源大小,当不指定时,源大小为 sourceItem 的大小。 - 大多数的使用场景下可以无需指定 sourceRect - */ - -/*! - \qmlproperty real org.deepin.dtk::ItemViewport::radius - - radius 用于指定 Rect 的圆角大小,例如上述示例中,可通过指定 radius 属性 - 对某个边进行圆角处理。 - */ - -/*! - \qmlproperty real org.deepin.dtk::ItemViewport::fixed - - fixed 属性用于指定 ItemViewport 是否启用预加载, 当 fixed 为 true 时 - 将不起用任何预加载。fixed 默认为 false - */ - -/*! - \qmlproperty bool org.deepin.dtk::ItemViewport::hideSource - - hideSource 属性用于指定是否决定隐藏源控件(sourceItem),根据 ItemViewport - 的实现原理,ItemViewport 已经将 sourceItem 画面和自身属性混合后输出。因此, - ItemViewport 在多数情况下已经实现了目标效果,将 hideSource 属性指定为 true 后 - 则表示隐藏 sourceItem 的内容,即隐藏源控件的样式,展示 ItemViewport 的内容,即加工 - 后的内容。默认情况下,该属性为 false. - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dquickkeylistener.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dquickkeylistener.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dquickkeylistener.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dquickkeylistener.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/*! - \qmltype KeySequenceListener - \inherits QObject - \inqmlmodule org.deepin.dtk - \keyword DQuickKeyListener - \brief DTK 提供的一种快捷键监听器 - - KeySequenceListener 控件作为一个快捷键辅助监听器,其继承于 QObject 类型,而非 - 继承于 Item,因此它无法独立存在,需要跟随 Item 辅助存在。 - - KeySequenceListener 被用于 KeySequenceEdit 控件中进行快捷键的监听, KeySequenceEdit - 控件为 DTK 封装的快捷键输入框。如对快捷键有监听需要,请优先使用 KeySequenceEdit 控件代替。 - - KeySequenceListener 仅作为辅助类存在,因此需要手动指定被监听的 Item 对象,并且 KeySequenceListener - 的作用范围也仅会在其被监听的 Item 控件内。 - - \warning \b 请注意,该控件仅作为快捷键的输入管理,而非所有键位的监听。 - */ - -/*! - \qmlproperty Item org.deepin.dtk::KeySequenceListener::target - - \c target 属性表示被监听的目标控件。 KeySequenceListener 会在 \c target 的 - 范围内监听快捷键的输入 - */ - -/*! - \qmlproperty list org.deepin.dtk::KeySequenceListener::keys - - \c keys 属性表示被监听的目标控件输入的快捷键文本,当用于在目标控件焦点状态下按下了特 - 定的快捷键时,其会跟随用户输入发生改变。同时,可以用过设置接口传递该属性的默认值。 - - 当传入一个格式不正确的键位字符串时,其结果是未定义地。 - */ - -/*! - \qmlproperty int org.deepin.dtk::KeySequenceListener::maxKeyCount - - \c maxKeyCount 属性表示监听的最大键位数量。默认值为 4,即表示最大能监听四种不同的 - 快捷键键位,例如 "Ctrol" "Alt" "Shift" "A" 键位。 - */ - -/*! - \qmlmethod void org.deepin.dtk::KeySequenceListener::learKeys() - - 该函数用于清空 \c keys 属性存储的当前键位。例如当用户取消键入,或状态改变需要清空 - \c keys 属性的值时,该函数能够发挥很大作用。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dquickrectangle.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dquickrectangle.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dquickrectangle.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dquickrectangle.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -/*! - \qmltype RoundRectangle - \inherits Item - \inqmlmodule org.deepin.dtk - \keyword DQuickRectangle - \brief DTK 提供的一种支持不同圆角功能的矩形控件 - - 能够支持某一边或者多边圆角,而其他边保持无圆角状态的控件。该控件 - 是对 Qt 提供的 Rectangle 控件进行的升级。其包含了原本 Color 的 - 大部分属性外,同时能够支持对固定角进行圆角操作。但其不包含对边框和 - 边框颜色的控制。 - - 例如一下示例代码,可以构造一个左上角和右下角的特殊矩形: - - \qml - import org.deein.dtk 1.0 - - RoundRectangle { - width: 100 - height: 100 - color: "blue" - radius: 20 - antialiasing: true - corners: (RoundRectangle.TopLeftCorner | RoundRectangle.BottomRightCorner) - } - \endqml - - 其示例效果如下: - \image images/RoundRectangleExample.png - */ - -/*! - \qmlproperty color org.deepin.dtk::RoundRectangle::color - - 该属性用于指定圆角矩形填充的颜色值。和 Rectangle 控件类似,其会 - 根据圆角矩形的形状自由填充。 - */ - -/*! - \qmlproperty real org.deepin.dtk::RoundRectangle::radius - - 该属性用于指定圆角矩形的圆角大小。和 Rectangle 中该属性保持一致,其 - 只会作用在设置了 corners 的部分。 - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::RoundRectangle::corners - - 该属性用于控制圆角矩形的圆角位置,支持圆角位置的叠加,例如上述示例代码。 - 该属性枚举包含以下值: - - \table - \header - \li 枚举值 - \li 描述 - \row - \li RoundRectangle.NoneCorner - \li 无圆角,即直角矩形。 - \row - \li RoundRectangle.TopLeftCorner - \li 指定左上角为圆角。 - \row - \li RoundRectangle.TopRightCorner - \li 指定右上角为圆角。 - \row - \li RoundRectangle.BottomLeftCorner - \li 指定左下角为圆角。 - \row - \li RoundRectangle.BottomRightCorner - \li 指定右下角为圆角。 - \row - \li RoundRectangle.TopCorner - \li 指定矩形上部分为圆角,即左上角和右上角。 - \row - \li RoundRectangle.BottomCorner - \li 指定矩形下部分为圆角,即左下角和右下角。 - \row - \li RoundRectangle.LeftCorner - \li 指定矩形左边部分为圆角,即左上角和左下角。 - \row - \li RoundRectangle.RightCorner - \li 指定矩形右边部分为圆角,即右上角和右下角。 - \row - \li RoundRectangle.AllCorner - \li 指定矩形为全圆角矩形。 - \endtable - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/dquicksettingcontainer.qdoc dtkdeclarative-5.6.10/doc/chinese/src/dquicksettingcontainer.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/dquicksettingcontainer.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/dquicksettingcontainer.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,575 +0,0 @@ -/*! - \qmltype SettingsContainer - \inherits QtObject - \inqmlmodule org.deepin.dtk.settings - \keyword DSettingsContainer - \brief SettingDialog 中存放各个设置项的容器 - - SettingContainer 作为 SettingDialog 中放置设置信息的容器,其目的 - 是对配置项的数据展示和数据更新。该控件作为自定义 SettingDialog 的属 - 性存在,一般情况下无需自定义该类型。其内部存在多个用于控制 Config 设置 - 项的相关属性,能够对内部的控件样式进行调整。 - */ - -/*! - \qmlproperty Config org.deepin.dtk.settings::SettingsContainer::config - - 配置信息实例,该配置信息中的属性会直接更新到 SettingContainer 中进行数据 - 展示。一般情况下,该属性会被赋值为 SettingDialog 中的 \c config 属性。 - - \sa SettingDialog Config - */ - -/*! - \qmlproperty list org.deepin.dtk.settings::SettingsContainer::groups - \default - - 配置项设置组,在 SettingContainer 中,其内部的配置属性有多个不同的设置组组成,而 - 设置组内部又可以存放不同的设置项和设置组,组成了一个设置树。 SettingContainer 中 - 该属性用于存储默认的全局设置组,内部子组和子项会展示在其子类中,其作为根元素进行展示。 - */ - -/*! - \qmlproperty Component org.deepin.dtk.settings::SettingsContainer::contentTitle - - 设置项的标题组件,即每个设置项中展示在内容区域的标题组件。默认的标题组件为 ContentTitle - 其会设置项的级别,自动设置字号大小。可根据自定义场景,对该内容进行自定义样式控制。 - */ - -/*! - \qmlproperty Component org.deepin.dtk.settings::SettingsContainer::navigationTitle - - 导航栏的标题组件,即 SettingDialog 中导航栏的标题组件。 默认的标题栏为 NavigationTitle 组件。 - 具有高亮背景和自动根据滚动区域的位置进行高亮等功能。 - */ - -/*! - \qmlproperty Component org.deepin.dtk.settings::SettingsContainer::contentBackground - - SettingDialog 中整体内容的背景组件,默认的背景组件为 ContentBackground 组件,该组件在默认的 - SettingDialog 中没做背景和颜色的实现,应用可根据场景自行覆盖。需要注意的是,当 \c contentBackground - 属性设置后,其内部的子 SettingOption 及其父类的所有 SettingOption 或 SettingsGroup 都未指定 - \c background 属性时,会自动 fallBack 回该 \c contentBackground 属性。 - */ - -/*! - \qmlmethod void org.deepin.dtk.settings::SettingsContainer::setGroupVisible(string key, bool visible) - - 通过 \c key 设置 SettingsGroup 是否可见。 \c key 对应于 SettingsGroup 中的 \c key 属性。 - \c visible 参数表示是否可见,true 为可见;false 为不可见。 - */ - -/*! - \qmlmethod bool org.deepin.dtk.settings::SettingsContainer::groupVisible(string key) - - 判断 \c key 对应的 SettingsGroup 是否可见. - \return 返回 true 表示可见, false 表示不可见。 - */ - -/*! - \qmlmethod void org.deepin.dtk.settings::SettingsContainer::resetSettings() - - 重置所有设置项。重置后设置项的值将对应于 Config 中的 \c resetValue 字段。 - */ - -/*! - \qmltype SettingsOption - \inherits QtObject - \inqmlmodule org.deepin.dtk.settings - \keyword DSettingsOption - \brief SettingDialog 中存放的设置项对象 - - SettingDialog 存放每个设置项的对象,其内部有 delegate 属性用于添加设置 - 项的自定义控件。除此之外,其内部存储的 \c key 属性指定该设置项对应于 Config - 中的属性信息,当配置文件中该 \c key 对应的 value 发生改变时,此设置项中的值 - 会根据配置文件发生改变。 - - 每个 SettingsGroup 可以存储多个 SettingOption, SettingDialog 中的每个 - 设置项最终由 SettingOption 展示可控制。 - - 存放在 SettingOption 内部的 Item 可以通过附加属性的方式获取当其最上层的 - SettingOption 对象,如下代码所示: - \qml - SettingOption { - key: "key1" - name: "Name" - - CheckBox { - Component.onComplete { - console.log(SettingOption.name) - } - } - } - \endqml - */ - -/*! - \qmlproperty string org.deepin.dtk.settings::SettingsOption::key - - \c key 将作为设置项的唯一标识,SettingDialog 中 config 对应的配置项的 - \c key 应与该值保持一致。绑定后的属性其配置发生变化后, SettingOption 的 - value 会自动发生变化。 - */ - -/*! - \qmlproperty string org.deepin.dtk.settings::SettingsOption::name - - \c name 为设置项的名称,默认情况下对应于设置项的左侧,用于指示该设置项的作用。 - */ - -/*! - \qmlproperty string org.deepin.dtk.settings::SettingsOption::value - - \c value 为设置项对应的 Config 中的属性值,其与配置文件中的值相对应。当配置文件中 - \c key 对应的 \c value 发生变化后,该值会自动跟随发生变化。 - */ - -/*! - \qmlproperty Component org.deepin.dtk.settings::SettingsOption::delegate - \default - - 默认属性, \c delegate 属性用于指定需要显示次配置项的控件。例如 ComboBox、LineEdit、 - RadioButton等等。 - - SettingDialog 提供几种默认的可以根据 SettingOption 的值自动发生变化的控件。如下表 - 所示: - \table - \header - \li 控件名称 - \li 控件描述 - - \row - \li \l {CheckBox(Settings)}{CheckBox} - \li 类似与 CheckBox 控件,自带名称,其值会根据配置项的值发生自动改变。 - \li \l {ComboBox(Settings)}{ComboBox} - \li 类似与 ComboBox 控件,自带名称,其值会根据配置项的值发生自动改变。 - \li \l {LineEdit(Settings)}{LineEdit} - \li 类似与 LineEdit 控件,自带名称,其值会根据配置项的值发生自动改变。 - \endtable - */ - -/*! - \qmltype SettingsGroup - \inherits QtObject - \inqmlmodule org.deepin.dtk.settings - \keyword DSettingsGroup - \brief SettingDialog 中存放的多个设置项的设置组 - - SettingsGroup 用于存放多个 SettingOption 的设置组。每个SettingsGroup - 都有在 SettingDialog 的导航栏中显示,根据 SettingsGroup 的层级关系,自 - 动为其设置 \c level ,其 \c level 值对应于每个 SettingsGroup 的 \c name - 字号以及缩进的大小。而这些样式的设置都是在 NavigationTitle 中完成样式的自动 - 调整。当需要进行自定义样式时,可通过调整 NavigationTitle 来达到目标效果。 - - SettingsGroup 可自定义背景风格,默认情况下 SettingsGroup 未指定背景, - 如以下代码: - \qml - SettingsGroup { - key: "group1" - name: "group1" - visible: true - background: ContentBackground { - border.color: "red" - radius: 8 - } - SettingsOption { - key: "key2" - name: "ComboBox" - ComboBox { - model: ["first", "sceond", "third"] - } - } - } - \endqml - - SettingsGroup 存在附加属性,可在其子类中使用该附加属性获取到当前 - 的 SettingsGroup 对象,如下代码: - \qml - SettingsGroup { - key: "group" - name: "group" - visible: true - SettingsOption { - key: "key1" - name: "CheckBox" - CheckBox { - text: "CheckBox" - Component.onComplete: { - console.log(SettingsGroup.name) - } - } - } - } - \endqml - - \sa NavigationTitle SettingsDialog SettingsOption - */ - -/*! - \qmlproperty string org.deepin.dtk.settings::SettingsGroup::key - - \c key 属性用于标识每个 SettingsGroup,该属性与 SettingOption 中的不同, - 仅作为控件的标识,可通过 SettingContainer 中的 \l {SettingsContainer::setGroupVisible}{setGroupVisible} - 函数控制 \c key 对应的 SettingsGroup 是否可见。 - */ - -/*! - \qmlproperty string org.deepin.dtk.settings::SettingsGroup::name - - \c name 属性被充当 SettingDialog 中导航栏标题,以及内容区域用于标识每个 - group 的标题。其标题字号和缩进根据 SettingsGroup 的层级关系自动调整。 - */ - -/*! - \qmlproperty int org.deepin.dtk.settings::SettingsGroup::level - \readonly - - \c level 属性为只读属性,当 SettingsGroup 的层级关系指定完成后,SettingContainer - 会根据其层级自动指定 \c level 。通常情况下应用无需关心 \c level , 其值将对 - SettingsGroup 的标题字号和缩进产生影响。 - */ - -/*! - \qmlproperty bool org.deepin.dtk.settings::SettingsGroup::visible - - \c visible 属性表示 SettingsGroup 是否可见。当 \c visible 指定为 false - 时,其下的所有子类都会隐藏。也可通过 SettingContainer 中的 - \l {SettingsContainer::setGroupVisible}{setGroupVisible} - 接口 通过 \c key 值指定是否可见。 - */ - -/*! - \qmlproperty int org.deepin.dtk.settings::SettingsGroup::index - \readonly - - \c index 属性作为 SettingsGroup 添加进 SettingDialog 中导航栏和内容 - 中 ListView 的索引,是一个只读属性。 - */ - -/*! - \qmlproperty list org.deepin.dtk.settings::SettingsGroup::options - \default - - \c options 为默认属性,其用于存储其子类的所有 SettingOption 对象,并作为 - 统一层级进行显示。同一层级下的 SettingOption 将被 SettingsGroup 管理,如 - \c level 将和其父类保持一致;当 SettingsGroup 隐藏时,其子类所有 SettingOption - 将被隐藏。 - */ - -/*! - \qmlproperty list org.deepin.dtk.settings::SettingsGroup::children - - \c children 属性保存 SettingsGroup 中的所有子 SettingsGroup,其子 SettingsGroup - 的 level 会比当前 SettingsGroup 小一层级。 SettingsGroup 可通过指定 children 的 - 方式嵌套多个 SetingGroup。 - */ - -/*! - \qmltype ContentBackground - \inherits Rectangle - \inqmlmodule org.deepin.dtk.settings - \brief SettingDialog 中通用的内容背景框. - - ContentBackground 是 SettingDialog 中提供的专门用于控制 SettingContainer - 或者 SettingsGroup 背景的控件。在设计中,SettingsGroup 默认未指定背景色,但为了 - 对 SettingDialog 配置项中的设置添加的更加灵活,可通过控制该对象的属性,来控制想 - 要实现的效果。 - - 例如,自定义 SettingContainer 的背景颜色可通过如下代码: - \qml - SettingDialog { - height: 400 - width: 680 - config: settingsConfig // 特殊的 Config 对象 - - container.contentBackground: ContentBackground { - color: "red" - } - } - \endqml - - 自定义 SettingsGroup 的背景可用如下代码: - \qml - SettingsGroup { - key: "group" - name: "group" - SettingsOption { - key: "key1" - name: "CheckBox" - CheckBox { - text: "CheckBox" - } - } - - background: ContentBackground { - border.color: "red" - radius: 8 - } - } - \endqml - - \sa SettingDialog ContentTitle - */ - -/*! - \qmltype ContentTitle - \inherits Label - \inqmlmodule org.deepin.dtk.settings - \brief SettingDialog 中通用的设置项文字控件. - - SettingDialog 被用于指定在 SettingContainer 中的内容标题控件。其会根据 SettingDialog 中 - SettingsGroup 的层级关系,自动为每个 SettingsGroup 设置字体。默认情况下无需自定义,当存在对 - 字体有特殊需求时,可以通过继承 ContentTitle 类来实现。 - - SettingDialog 中控制 ContentTitle 样式可用如下代码: - \qml - SettingDialog { - height: 400 - width: 680 - config: settingsConfig // 特殊的 Config 对象 - - container.contentTitle: ContentTitle { - color: "blue" - } - } - \endqml - */ - -/*! - \qmltype NavigationTitle - \inherits Control - \inqmlmodule org.deepin.dtk.settings - \brief SettingDialog 中导航栏处的标题控件 - - NavigationTitle 在 SettingDialog 中被用于展示 SettingsGroup 的 \c name 属性。 - 其会根据 SettingsGroup 的层级关系自动选择合适字号和缩进的文本进行展示。除此之外,它 - 能够根据滚动窗口当前所显示的 SettingsGroup 高亮其对应的标题。除 Control 自带的属性 - 外, NavigationTitle 拓展了几种属性用于默认设置或进行自定义样式。例如可通过如下代码 - 自定义 NavigationTitle. - - \qml - import org.deepin.dtk 1.0 - import org.deepin.dtk.settings 1.0 as Setting - - Setting.SettingDialog { - height: 400 - width: 680 - config: settingsConfig // 特殊的 Config 对象 - - container.navigationTitle: Setting.NavigationTitle { - backgroundColor: Palette { - normal: "red" - } - - checkedTextColor: Palette { - normal: "green" - } - } - } - \endqml - */ - -/*! - \qmlproperty bool org.deepin.dtk.settings::NavigationTitle::checked - - \c checked 状态指定 NavigationTitle 是否处于选中状态。一般情况下,其值会根据 - 当前 NavigationTitle 所处的 SettingsGroup 是否为当前可视状态而自动设置。 - 默认情况下,该值为 false. - */ - -/*! - \qmlproperty Palette org.deepin.dtk.settings::NavigationTitle::backgroundColor - - \c backgroundColor 属性用于指定 NavigationTitle 的背景颜色,其类型为 Palette 类型,可 - 同时指定 light 和 dark 两种类型,以及 normal 和 hover 两种状态。 backgroundColor 颜色 - 仅会在 checked 为 true 是显示。默认情况下无颜色。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk.settings::NavigationTitle::checkedTextColor - - \c checkedTextColor 属性当 NavigationTitle 被选中时,文本的调色板颜色。与 backgroundColor 类似 - 其存在 light 和 dark 两种类型。默认情况下,该颜色为白色。 - */ - -/*! - \qmlsignal void org.deepin.dtk.settings::NavigationTitle::clicked() - - \c clicked 信号当 NavigationTitle 被点击时发出。 - */ - -/*! - \qmltype CheckBox(Settings) - \inherits OptionDelegate - \inqmlmodule org.deepin.dtk.settings - \brief SettingDialog 中自定义实现的 CheckBox 控件 - - SettingDialog 中自定义实现的 CheckBox 控件,自带了文本标题区域和 CheckBox 控件区域,是 DTK 专门 - 用于封装给 SettingDialog 使用的控件。其效果如下图所示: - - \image images/SettingCheckBox.png - - 其控件的添加必须在一个 SettingOption 内部,当 leftVisible 设置为 true 时,会将 SettingOption 中的 - name 字段作为左侧标题描述进行显示。 - - 其使用如下所示: - \qml - import org.deepin.dtk as Settings - - Settings.SettingsOption { - key: "canExit" - name: "CheckBox" - Settings.CheckBox { - leftVisible: true - } - } - \endqml - */ - -/*! - \qmltype ComboBox(Settings) - \inherits OptionDelegate - \inqmlmodule org.deepin.dtk.settings - \brief SettingDialog 中自定义实现的 ComboBox 控件 - - SettingDialog 中自定义实现的 ComboBox 控件,其自带左侧标题部分和右侧 ComboBox 控件部分,当开启 leftVisible 属性时, - 左侧标题部分将显示。当手动切换 ComboBox 中的当前项时,其对应的 SettingOption 的属性值将跟随自动发生变化,不需要应用程序 - 管理这些情况。 - - ComboBox 能够接受外部提供的 model 数据,当提供的 model 存在自定义的 roleName 时,可通过定义 valueRole 来达到绑定 - 该 role 的行为。 - - \image images/SettingComboBox.png - - 其使用如下所示: - - \qml - import org.deepin.dtk as Settings - - Settings.SettingsOption { - key: "key2" - name: "ComboBox" - Settings.ComboBox { - model: ["first", "sceond", "third"] - } - } - \endqml - */ - -/*! - \qmlproperty ComboBox org.deepin.dtk.settings::ComboBox(Settings)::impl - - \c impl 属性为 \l {ComboBox(Settings)}{ComoBox} 控件真实的内部 ComboBox. 当需要手动设置 Combox 的属性时,\c impl - 能够很好的解决该问题。 - */ - -/*! - \qmlproperty string org.deepin.dtk.settings::ComboBox(Settings)::valueRole - - \c valueRole 属性表示 \l {ComboBox(Settings)}{ComoBox} 中 model 的特殊 RoleName。 当 model 设置了特殊 - 的 RoleName 后(例如 model 是 ListModel 时),可通过该属性获取到绑定在该 RoleName 中的自定义属性,同样也能 - 跟随 SettingOption 的值自动发生变化。 - */ - -/*! - \qmlproperty Model org.deepin.dtk.settings::ComboBox(Settings)::model - - \c model 属性为 ComboBox 中对应的 model, 可通过该属性设置 impl 中的数据模型。 - */ - -/*! - \qmltype LineEdit(Settings) - \inherits OptionDelegate - \inqmlmodule org.deepin.dtk.settings - \brief SettingDialog 中自定义实现的 LineEdit 控件 - - SettingDialog 中自定义实现的 LineEdit 控件,左侧自带标题部分,右侧 LineEdit 部分,可通过设置 leftVisible - 属性来控制左侧标题区域的显示和隐藏。当 LineEdit 完成输入后(按回车键或离开焦点),其绑定的 SettingOption 的属性 - 将自动跟随 LineEdit 中的值发生自动变化。 - - \image images/SettingLineEdit.png - - 其使用如下所示: - - \qml - import org.deepin.dtk as Settings - - Settings.SettingsOption { - key: "key3" - name: "LineEdit" - Settings.LineEdit { - text: "test" - } - } - \endqml - */ - -/*! - \qmltype OptionDelegate - \inherits RowLayout - \inqmlmodule org.deepin.dtk.settings - \brief SettingDialog 中用于添加自定义控件的委托控件 - - OptionDelegate 是用于包装自定义应用到 SettingDialog 中的委托控件。其包含两个部分,左侧标题部分和右侧控件 - 内容部分。标题部分会自动选择 SettingOption 中的 name 进行填充,其 leftVisible 属性控制标题部分是否显示。 - 右侧控件为自定义添加到 SettingDialog 中的控件,该控件的键值的响应需要自己实现,OptionDelegate 无法感知。 - - 例如实现一个自定义的按钮: - \qml - Settings.SettingsOption { - key: "Key2" - Settings.OptionDelegate { - leftVisible: false - Button { - Layout.fillWidth: true - text: "Custom Button" - } - } - } - \endqml - - 实现一个文本和 Switch 控件的组合控件: - \qml - Settings.SettingsOption { - key: "Key3" - Settings.OptionDelegate { - leftVisible: false - Label { - text: "Switch Button" - horizontalAlignment: Qt.AlignLeft - Layout.fillWidth: true - } - - Switch { - - } - } - } - \endqml - - 实现一个带“加减”符号的输入框控件: - \qml - Settings.SettingsOption { - key: "Key6" - name: "Font Size" - Settings.OptionDelegate { - PlusMinusSpinBox { - spinBox.value: 12 - Layout.alignment: Qt.AlignRight - Layout.preferredWidth: 200 - } - } - } - \endqml - - 预览效果如下图所示: - \image images/SettingOptionCustionWidget.png - */ - -/*! - \qmlproperty bool org.deepin.dtk.settings::OptionDelegate::leftVisible - - \c leftVisible 属性用于表示左侧标题区域是否可见,当 \c leftVisible 为 false 时,表示仅显示右侧控件;当 \c leftVisible 为 true - 时,标题区域和控件区域的间距为 20 px。 - */ - diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/EmbeddedProgressBarDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/EmbeddedProgressBarDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/EmbeddedProgressBarDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/EmbeddedProgressBarDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/*! - \qmltype EmbeddedProgressBar - \inherits ProgressBar - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种嵌入到控件内部的进度条控件. - - EmbeddedProgressBar 是一种能够嵌入到控件内部显示进入的进度条控件,它作为一种轻量的进度条控件, - 没有默认进度条的渐变和阴影等效果。它用于指示用户控件的加载情况,如放置在图标内,用于指示应用的启 - 动速度或者应用的下载速度等等。 - - EmbeddedProgressBar 的效果如下图所示: - - - */ - -/*! - \qmlproperty Palette org.deepin.dtk::EmbeddedProgressBar::backgroundColor - - \c backgroundColor 属性表示 EmbeddedProgressBar 控件的背景颜色,通过控制 backgroundColor 属性 - 能够很容易的修改进度条的背景色。 - - 例如下述代码能够将进度条的背景色在亮色主题下修改为红色,在暗色主题下修改会蓝色: - - \qml - EmbeddedProgressBar { - width: 48 - height: 6 - - from: 0 - to: 100 - value: 58 - - backgroundColor: Palette { - normal: "red" - normalDark: "blue" - } - } - \endqml - */ - -/*! - \qmlproperty Palette org.deepin.dtk::EmbeddedProgressBar::progressBackgroundColor - - \c progressBackgroundColor 属性用于表示进度条背景颜色,和 backgroundColor 类似,都为 Palette 类型, - 外部可以通过修改该属性值,调整背景在不同状态下的颜色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/FloatingButtonDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/FloatingButtonDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/FloatingButtonDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/FloatingButtonDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -/*! - \qmltype FloatingButton - \inherits Button - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种浮动按钮控件. - - FloatingButton 继承自 \l {Button(FlowStyle)}{Button} 控件,其 UI 效果与 Button 截然不同, FloatingButton - 通常情况下呈现一种圆形按钮,被用于浮动显示在工具栏中。 - - 其效果如下图所示: - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/FloatingMessageDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/FloatingMessageDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/FloatingMessageDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/FloatingMessageDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -/*! - \qmltype FloatingMessage - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种窗口内浮动效果的消息控件. - - FloatingMessage 控件用于显示在窗口内的提示消息,是消息的基础类型。其使用 FloatingPanel 作为背景,用于增加它的浮动效果,是使用外部定义 - 的文本和图标作为消息内容。 - - FloatingMessage 能进行常驻显示也能进行短暂显示,当消息短暂显示时会在持续时间结束后自动消失,而常驻消息会一致保留在程序中,除非用户 - 手动进行关闭。 - - FloatingMessage 支持高度定制化,当消息效果不满足实际应用需求时,通过重写控件属性,能够修改控件的样式。 - 下图展示了 FloatingMessage 的效果: - - \image images/FloatingMessage.png - - MessageManager 控制 FloatingMessage 的消息容量、样式风格、布局方式等等,也可用过 MessageManager 直接发送 - 消息通知。 MessageManager 作为全局的方式控制 FloatingMessage 的风格和功能,它和 FloatingMessage 的关系为: MessageManager - 是控制者,FloatingMessage 是控制元素。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::FloatingMessage::contentItem - - \c contentItem 属性是 FloatingMessage 的内容部分,例如其内部可以放置文本。contentItem 的内容不包含图标部分。当需要自定义 - 中心部分时,可以重新实现该属性。默认情况下 contentItem 属性只存在消息的文本。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::FloatingMessage::button - - \c button 属性存放 FloatingMessage 中的关闭按钮。默认情况下, \c button 属性是一个提供关闭按钮的 ActionButton。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::FloatingMessage::duration - - \c duration 属性用于表示 FloatingMessage 持续的时间。默认情况下, \c duration 的值为 4 秒,超过该时间,消息自动关闭。当将该 - 属性的值修改为 -1 时,表示 FloatingMessage 是一个常驻消息,除非用户手动关闭,否则将无法消失。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::FloatingMessage::panel - - \c panel 属性用于表示 FloatingMessage 控件的背景面板,FloatingMessage 的浮动效果最终由 \c panel 属性提供。一般情况无需手动实现 - 该控件的内容。当需要手动实现时,请实现 重新对图标、文本(contentItem)、关闭按钮(button) 进行重新布局。 - */ - -/*! - -/*! - \qmlpropertygroup org.deepin.dtk::FloatingMessage::message - \qmlproperty string org.deepin.dtk:::FloatingMessage::message.iconName - \qmlproperty color org.deepin.dtk:::FloatingMessage::palette.content - - \c message 属性是一个复合属性,默认情况下 message 提供了 iconName 和 content 两个属性名。 \c iconName 表示图标名称 \c content 表示文字内容。 - \l {DSendMessageFromContent}{DTK.sendMessage()} 接口中可以添加自定义的子属性名,但需要自定义 content 组件进行自适配。 - - \l {DSendMessageFromContent}{DTK.sendMessage()} - */ - -/*! - \qmltype MessageManager - \inherits QtObject - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 一种控制 FloatingMessage 的附加对象. - - MessageManager 是一个附加对象,它无法独立的创建。它有多种用于控制 FloatingMessage 的全局效果的属性。 - 通常情况下,再构造 Window 时就可指定全局的 FloatingMessage 属性。例如以下代码: - - \qml - MessageManager.layout: Column { - anchors { - bottom: parent.bottom - right: parent.right - } - } - MessageManager.capacity: 6 - MessageManager.delegate: FloatingMessage { - id: floatingMsg - contentItem: Label { - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignLeft - text: floatingMsg.message.content - elide: Text.ElideRight - maximumLineCount: 1 - wrapMode: Text.Wrap - } - - duration: 3000 - } - \endqml - */ - -/*! - \qmlattachedproperty Component org.deepin.dtk::MessageManager::delegate - - \c delegate 属性控制全局情况下的 FloatingMessage 样式风格。默认情况下无需重新实现该风格,当需要添加自定义内容时, - 可修改其内容达到目标效果。 - */ - -/*! - \qmlattachedproperty Item org.deepin.dtk::MessageManager::layout - - \c layout 属性控制不同消息之间的排列方式。默认情况下,多个消息使用纵向布局的方式进行排列。 - 例如,还能自定义为横向布局、流布局等等。 - */ - -/*! - \qmlattachedproperty int org.deepin.dtk::MessageManager::capacity - - \c capacity 属性用于控制消息最大存储的容量。默认情况下, \c capacity 的值为 3,即最大能同时容纳 3 条消息进行显示。 - */ - -/*! - \qmlattachedproperty int org.deepin.dtk::MessageManager::count - \readonly - - \c count 属性表示当前消息的个数。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/FloatingPanelDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/FloatingPanelDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/FloatingPanelDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/FloatingPanelDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/*! - \qmltype FloatingPanel - \inherits Control - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种浮动效果的背景面板. - - FloatingPanel 是浮动消息(FloatingMessage)、浮动工具栏、内嵌菜单(Menu)等等控件的通用背景。 - FloatingPanel 自带浮动的效果,能够使其内部控件呈现出浮动在应用内部的效果。 - - FloatingPanel 支持颜色和效果的控制,即它能够在外部控制背景颜色、边框颜色、圆角大小和模糊系数等等。 - 其使用方式如下代码: - \qml - FloatingPanel { - contentItem: RowLayout { - spacing: 20 - - DciIcon { name: "entry_voice"; sourceSize: Qt.size(16, 16)} - DciIcon { name: "entry_voice"; sourceSize: Qt.size(16, 16)} - DciIcon { name: "entry_voice"; sourceSize: Qt.size(16, 16)} - - RowLayout { - spacing: 12 - Slider { - id: toolBarSlider - property int totalValue: 7*60 + 56 - property int currentValue: 3 * 60 + 25 - - Layout.preferredWidth: 230 - highlightedPassedGroove: true - handleType: Slider.HandleType.NoArrowHorizontal - from: 0 - to: msToValue(totalValue) - value: msToValue(currentValue) - stepSize: 1 - function msToValue(ms) { return ms} - function msToText(ms) { - return String("%1:%2").arg(Math.floor(ms / 60)).arg(ms % 60) - } - } - Text { - Layout.preferredWidth: 50 - text: String("%1/%2").arg(toolBarSlider.msToText(toolBarSlider.value)).arg(toolBarSlider.msToText(toolBarSlider.to)) - } - } - - DciIcon { name: "entry_voice"; sourceSize: Qt.size(16, 16)} - DciIcon { name: "entry_voice"; sourceSize: Qt.size(16, 16)} - } - } - \endqml - - 效果如下图所示: - \image images/FloatingPanelExample.png - */ - -/*! - \qmlproperty Palette org.deepin.dtk::FloatingPanel::backgroundColor - - \c backgroundColor 属性用于控制背景颜色。 - \sa Palette - */ - -/*! - \qmlproperty Palette org.deepin.dtk::FloatingPanel::dropShadowColor - - \c dropShadowColor 属性用于控制阴影部分的颜色。 - \sa Palette - */ - -/*! - \qmlproperty Palette org.deepin.dtk::FloatingPanel::borderColor - - \c borderColor 属性用于控制边框的颜色。 - \sa Palette - */ - -/*! - \qmlproperty Palette org.deepin.dtk::FloatingPanel::radius - - \c radius 属性控制 FloatingPanel 背景的圆角大小,默认情况下为该值为 14。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::FloatingPanel::blurRadius - - \c blurRadius 属性控制 FloatingPanel 的模糊系数,默认情况下为该值为 14。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/FocusBoxBorderDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/FocusBoxBorderDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/FocusBoxBorderDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/FocusBoxBorderDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/*! - \qmltype FocusBoxBorder - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种通用的控件焦点边框. - - FocusBoxBorder 控件主要用于绘制控件的焦点边框。当控件支持焦点策略时,使用 Tab 键或者使用鼠标点击,控件周围会环绕 - 高亮色的边框效果。FocusBoxBorder 用于提供该效果。目前 DTK 提供的一些支持焦点的控件都实现了焦点框的绘制。 - - FocusBoxBorder 效果如下图所示: - \image images/FocusBoxBorder.png - - 其使用方式如下代码所示: - \qml - Control { - // 实现的自定义控件 - id: control - focusPolicy: Qt.StrongFocus - - contentItem: Text { - text: "A custom control." - verticalAlignment: Text.AlignVCenter - } - - background: Rectangle { - implicitWidth: 200 - implicitHeight: 80 - radius: 8 - - color: "darkGreen" - - FocusBoxBorder { - anchors.fill: parent - radius: 8 - color: control.palette.highlight - visible: control.visualFocus - } - } - } - \endqml - */ - -/*! - \qmlproperty color org.deepin.dtk::FocusBoxBorder::color - - \c color 属性应用控制焦点边框的颜色。默认情况下,该颜色是 "transparent"。 - */ - -/*! - \qmlproperty int org.deepin.dtk::FocusBoxBorder::borderWidth - - \c borderWidth 属性表示焦点边框的宽度。默认情况下该值为 2 - */ - -/*! - \qmlproperty int org.deepin.dtk::FocusBoxBorder::radius - - \c radius 属性用于控制边框的圆角大小。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/HighlightPanelDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/HighlightPanelDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/HighlightPanelDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/HighlightPanelDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/*! - \qmltype HighlightPanel - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种高亮显示背景面板. - - HighlightPanel 属性控制高亮显示的背景面板,它被广泛用于 ListView 或 MenuItem 中当做鼠标选中时的高亮背景。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::HighlightPanel::backgroundColor - - \c backgroundColor 属性用于控制 HighlightPanel 的背景颜色。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::HighlightPanel::outerShadowColor - - \c outerShadowColor 属性用于控制 HighlightPanel 的外阴影颜色。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::HighlightPanel::innerShadowColor - - \c backgroundColor 属性用于控制 HighlightPanel 的内阴影颜色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/IconButtonDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/IconButtonDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/IconButtonDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/IconButtonDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -/*! - \qmltype IconButton - \inherits Button - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种图标类按钮控件. - - IconButton 继承自 \l{Button(FlowStyle)}{Button} 控件,但它只允许设置 icon 等属性,无法设置 text 添加文本。 - IconButton 已支持使用 DciIcon 和 QtIcon 两种。 - - IconButton 的效果如下图所示: - \image images/IconButtonExample.png - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/InsideBoxBorderDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/InsideBoxBorderDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/InsideBoxBorderDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/InsideBoxBorderDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/*! - \qmltype InsideBoxBorder - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种内边框控件. - - InsideBoxBorder 控件提供一种内边框,作为一种修饰性的控件存在, InsideBoxBorder 控件 - 和 OutsideBoxBorder 控件类似,都用来提供控件的边框。好的控件设计,离不开丰富的描边绘制。 - - InsideBoxBorder 的用法如下所示: - \qml - Rectangle { - width: 180 - height: 180 - color: "darkCyan" - radius: 8 - - InsideBoxBorder { - anchors.fill: parent - color: "darkGreen" - borderWidth: 2 - radius: 8 - } - } - \endqml - - 其效果如下图所示: - \image images/InsideBoxBorderExample.png - */ - -/*! - \qmlproperty real org.deepin.dtk::InsideBoxBorder::borderWidth - - \c borderWidth 属性用于表示 InsideBoxBorder 控件的边框大小。 默认情况下, - 该值是 1。 - */ - -/*! - \qmlproperty color org.deepin.dtk::InsideBoxBorder::color - - \c color 属性表示内边框的颜色值。默认情况下,该值是 "white" - */ - -/*! - \qmlproperty int org.deepin.dtk::InsideBoxBorder::radius - - \c radius 属性表示内边框的圆角大小,默认情况下,该大小为 0。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/Ipv4EditDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/Ipv4EditDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/Ipv4EditDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/Ipv4EditDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/*! - \qmltype IpV4LineEdit - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种用于输入 IPV4 的特殊输入框. - - IpV4LineEdit 是一个专门用于输入 IPV4 地址的输入框控件。它兼容了传统的输入方式, - 重新适配对 IPV4 的输入,目的是更友好的支持输入这种特殊格式的文本。 IpV4LineEdit - 控件兼容了使用 Tab 键切换当前输入框的方式,当当前输入框输入完成后,可唤起 Tab 键 - 调整位置输入,同时 IpV4LineEdit 自带的特殊的 clear button 能够一键清除用户的 - 所有输入。 - - IpV4LineEdit 也支持现实特殊的警告信息,当用户输入方式有误时,IpV4LineEdit 提供 - 属性可唤起提示信息,告知用户输入方式的问题。 - - IpV4LineEdit 的效果如下图所示: - - \image images/IPV4EditExample.png - */ - - -/*! - \qmlproperty string org.deepin.dtk::IpV4LineEdit::text - - \c text 属性表示当前属于 IpV4 的字符文本,会自动拼接 "." 字符,例如当用户输入 - 的字符是 "127.0.0.1"。当用户未进行任何输入,或者任意输入框都是空时,\c text 将 - 返回空字符。 - - \c text 属性在用户输入的发生任何字符变化时,都会触发修改。 - */ - -/*! - \qmlproperty string org.deepin.dtk::IpV4LineEdit::alertText - - \c alertText 属性表示 IpV4LineEdit 用于显示警告信息的警告文本。 - \c alertText 属性可普通的 Edit 一样,都用于控制警告文本的输入。 - \sa LineEdit - */ - -/*! - \qmlproperty string org.deepin.dtk::IpV4LineEdit::alertDuration - - \c alertDuration 属性表示 IpV4LineEdit 用于显示警告信息的持续时长。 - \c 当 alertDuration 结束后,警告信息将自动消失。 - \sa LineEdit - */ - -/*! - \qmlproperty bool org.deepin.dtk::IpV4LineEdit::showAlert - - \c showAlert 属性用于控制 IpV4LineEdit 的警告信息的现实和隐藏。当 showAlert 为 - true 时,警告信息会在 alertDuration 属性的持续时长完成或自动消失。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::IpV4LineEdit::backgroundColor - - \c backgroundColor 属性用于控制 IpV4LineEdit 的背景颜色。默认情况下,该值 - 会根据当前风格自动设置。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ItemDelegateDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ItemDelegateDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ItemDelegateDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ItemDelegateDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -/*! - \qmltype ItemDelegate(FlowStyle) - \inherits ItemDelegate - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供行云设计风格的 ItemDelegate 控件. - - \l {ItemDelegate(FlowStyle)}{ItemDelegate} 是一个多被用于 ListView 中 - 当作视图项绘制的控件。在 QML 中 \l {ItemDelegate(FlowStyle)}{ItemDelegate} - 不再担任绘制的工作,它是一个基础控件,他的创建和释放;显示和隐藏都由 ListView 控制。 - 行云设计中, \l {ItemDelegate(FlowStyle)}{ItemDelegate} 不仅兼容其原有的接口, - 还添加了用于自定义的额外属性,这些属性在非行云设计的其他风格上可能无法正常使用。 - - \l {ItemDelegate(FlowStyle)}{ItemDelegate} 的使用方式如下: - \qml - ListView { - implicitHeight: contentHeight - width: 200 - model: 4 - delegate: ItemDelegate { - text: "Nth " + index - checked: index === ListView.view.count - 1 - backgroundVisible: index % 2 === 0 - } - } - \endqml - */ - -/*! - \qmlproperty bool org.deepin.dtk::ItemDelegate(FlowStyle)::indicatorVisible - - \c indicatorVisible 用于控制 \l {ItemDelegate(FlowStyle)}{ItemDelegate} 中的 - indicator 是否显示,默认为 false。 - - \l {ItemDelegate(FlowStyle)}{ItemDelegate} 中的 indicator 是用于展示视图项被 - 选中时的“已选中”图标样式。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::ItemDelegate(FlowStyle)::backgroundVisible - - \c backgroundVisible 用于控制 \l {ItemDelegate(FlowStyle)}{ItemDelegate} 中的 - 背景是否可见,默认情况下,该值是 true。 - - 当需要某种情况下,显示视图项背景,其他情况不显示视图项背景时,可以使用该属性控制。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::ItemDelegate(FlowStyle)::cascadeSelected - - \c cascadeSelected 属性用于控制 \l {ItemDelegate(FlowStyle)}{ItemDelegate} 是否 - 进行多选。默认情况下 cascadeSelected 为 false,即只能进行单选。当 \c cascadeSelected - 属性为 true 时,被多选的视图项无法显示高亮背景。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::ItemDelegate(FlowStyle)::contentFlow - - \c contentFlow 属性用于控制 \c content 属性的填充方式,当 \c content 存在且需要让其 - 全部填充整个视图项时,将该属性设置为 true 是一个不错的选择。默认情况下, \c contentFlow - 为 false。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::ItemDelegate(FlowStyle)::content - - \c content 属性用于控制 \l {ItemDelegate(FlowStyle)}{ItemDelegate} 的自定义部件。 - \c content 是除左侧图标和文本之外的,额外的自定义部件区域。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::ItemDelegate(FlowStyle)::checkedTextColor - - \c checkedTextColor 属性用于控制 \l {ItemDelegate(FlowStyle)}{ItemDelegate} 选中文字 - 的颜色调色板。默认情况下,该属性会根据其所处场景自动发生变化。 - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::ItemDelegate(FlowStyle)::corners - - \c corners 属性用于控制 \l {ItemDelegate(FlowStyle)}{ItemDelegate} 背景的圆角方式。 - - \c corners 可从以下枚举取值,也能混合取值。 - \table - \header - \li 枚举值 - \li 描述 - \row - \li RoundRectangle.NoneCorner - \li 无圆角,即直角矩形。 - \row - \li RoundRectangle.TopLeftCorner - \li 指定左上角为圆角。 - \row - \li RoundRectangle.TopRightCorner - \li 指定右上角为圆角。 - \row - \li RoundRectangle.BottomLeftCorner - \li 指定左下角为圆角。 - \row - \li RoundRectangle.BottomRightCorner - \li 指定右下角为圆角。 - \row - \li RoundRectangle.TopCorner - \li 指定矩形上部分为圆角,即左上角和右上角。 - \row - \li RoundRectangle.BottomCorner - \li 指定矩形下部分为圆角,即左下角和右下角。 - \row - \li RoundRectangle.LeftCorner - \li 指定矩形左边部分为圆角,即左上角和左下角。 - \row - \li RoundRectangle.RightCorner - \li 指定矩形右边部分为圆角,即右上角和右下角。 - \row - \li RoundRectangle.AllCorner - \li 指定矩形为全圆角矩形。 - \endtable - \sa RoundRectangle - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/KeySequenceEditDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/KeySequenceEditDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/KeySequenceEditDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/KeySequenceEditDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/*! - \qmltype KeySequenceEdit - \inherits Control - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种快捷键监听的输入框控件. - - KeySequenceEdit 控件是一种用于监听快捷键事件的输入框控件。 KeySequenceEdit 提供了 - 默认的描述文本区域,可通过属性直接设置其快捷键类型。同时,也提供了用于隐式提示的文本字段。 - - KeySequenceEdit 只能用于监听应用内的快捷键,当 KeySequenceEdit 与系统快捷键发生冲突 - 时,可能无法正常工作。 - - KeySequenceEdit 的效果如下图所示: - - KeySequenceEdit 支持默认的快捷键设置,可用于界面初始化的显示,用户通过点击指定区域,触发 - KeySequenceEdit 快捷键监听机制,一旦触发,符合快捷键定义的任何键位都会被记录。 - - KeySequenceEdit 的使用方式如下代码: - \qml - KeySequenceEdit { - width: 504 - height: 36 - text: "关闭窗口" - placeholderText: "请重新输入快捷键" - keys: ["ALT", "F4"] - } - \endqml - */ - -/*! - \qmlproperty string org.deepin.dtk::KeySequenceEdit::text - - \c text 属性用于控制该快捷键的显示文本。一般用于指定该快捷键代表哪一操作。 - */ - -/*! - \qmlproperty string org.deepin.dtk::KeySequenceEdit::placeholderText - - \c placeholderText 属性用于表示用户清空键位,或键位为空时,隐式提示的文本。 - */ - -/*! - \qmlproperty list org.deepin.dtk::KeySequenceEdit::keys - - \c keys 属性用于表示用户输入的键位,初始化时,可以通过控制该属性指定默认键位。当用户 - 输入后,该键位会跟随用户输入的值发生变化。 \c keys 属性不会检查该键位是否正常。请在手动 - 传递时确保键位正常。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::KeySequenceEdit::backgroundColor - - \c backgroundColor 属性用于 KeySequenceEdit 控制背景颜色。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::KeySequenceEdit::placeholderTextColor - - \c placeholderTextColor 属性用于 KeySequenceEdit 控制隐式提示的字体颜色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/LineEditDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/LineEditDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/LineEditDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/LineEditDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/*! - \qmltype LineEdit - \inherits TextField - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种自带清除按钮的输入框控件. - - LineEdit 提供了一种单行输入控件。与 Qt 的 TextField 控件不同的是 - LineEdit 自带了一个可以清除所有输入的 ActionButton,方便用于在输 - 入后进行一件清除的快捷操作,其他属性和方法都和 TextField 空间保持 - 一致。 - - LineEdit 控件的效果如下图所示: - - \image images/LineEditExample.png - - LineEdit 将清除按钮暴露出来,使用时可以更方便地在清除按钮周围添加自定义 - 控件。 - */ - - -/*! - \qmlproperty Item org.deepin.dtk::LineEdit::clearButton - - \c clearButton 属性获取 LineEdit 中的清除按钮。 clearButton 属性 - 能够更方便的操作 LineEdit,在 LineEdit 周围添加自定义按钮和空间。 - 例如以下代码: - - \qml - LineEdit { - width: 200 - text: "~/.ssh/ssh_keygen.key" - ActionButton { - anchors { - right: parent.clearButton.left - rightMargin: 5 - verticalCenter: parent.verticalCenter - } - icon.name: "entry_loadfile" - } - } - \endqml - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/MenuDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/MenuDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/MenuDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/MenuDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,127 +0,0 @@ -/*! - \qmltype Menu(FlowStyle) - \inherits Menu - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 Menu 控件. - - Menu 控件大多被用于应用菜单,例如功能菜单、右键菜单等。 DTK 实现的菜单 - 比原有样式的菜单更流畅;更定制化,它能够兼容 Menu 的所有接口,并且能够做 - 到内部的 MenuItem 自动适配菜单的宽高。 - - 除此之外,Menu 还支持添加头部控件和尾部控件,当需要添加自定义搜索内容时, - 头部控件可以添加 SearchEdit 来实现。 - Menu 的最大项目个数在 DTK 的设计中是 16,当超过该数值时,Menu 会出现 - 滚动选项,同时 菜单的上部和下部会出现上下移动的按钮,鼠标放置时可自动进行 - 移动。 - - Menu 的基本用于如下代码所示: - \qml - Menu { - MenuItem { text: qsTr("打开") } - MenuItem { text: qsTr("在新窗口打开") } - MenuItem { text: qsTr("在新标签中打开") } - MenuItem { text: qsTr("以管理员身份打开") } - MenuSeparator {} - MenuItem { text: qsTr("复制") } - MenuSeparator {} - MenuItem { text: qsTr("共享文件夹")} - MenuItem { text: qsTr("创建链接")} - MenuItem { text: qsTr("发送到桌面")} - MenuItem { text: qsTr("在终端中打开")} - Menu { title: qsTr("自定义")} - MenuItem { text: qsTr("压缩")} - MenuItem { text: qsTr("属性")} - } - \endqml - 如上代码, Menu 内部控件需要使用 Menu、MenuItem 或者 MenuSeparator,其中 MenuItem 用 - 来显示实际的菜单项,包含图表和文本, MenuSeparator 用来显示菜单中的分隔符。在菜单中内部的 - 子菜单,可以使用 Menu 叠加的方式完成。 - - 对于自定义头部控件,这里使用一个 SearchEdit 的示例表示: - \qml - Menu { - id: searchAndArrowMenu - width: 160 - header: SearchEdit { - placeholder: qsTr("搜索") - onTextChanged: { - proxyModel.filterText = text - proxyModel.update() - } - } - - model: ObjectModelProxy { - id: proxyModel - property string filterText - filterAcceptsItem: function(item) { - return item.text.includes(filterText) - } - sourceModel: searchAndArrowMenu.contentModel - } - - maxVisibleItems: 10 - MenuItem { text: qsTr("Greek(cp869)") } - MenuItem { text: qsTr("Cyrillic (ISO 8859-5)") } - MenuItem { text: qsTr("Cyrillic(KOI8-R)") } - MenuItem { text: qsTr("Devanagari(x-mac-davanagari)") } - MenuItem { text: qsTr("Gurmukhi(x-mac-gurmukhi)") } - MenuItem { text: qsTr("Thai (ISO 8859-11)") } - MenuItem { text: qsTr("Simplified Chinese(x-mac-sim-chinese)") } - MenuItem { text: qsTr("Chinese(GBK)"); checked: true} - MenuItem { text: qsTr("Chinese(GB 18030)") } - MenuItem { text: qsTr("Chinese(ISO 2022-CN)") } - MenuItem { text: qsTr("Simplified Chinese (GB2312)") } - MenuItem { text: qsTr("Tibetan (x-mac-tibetan)") } - MenuItem { text: qsTr("Central European(ISO Latin 2)") } - MenuItem { text: qsTr("Central Eu 188 opx(ISO Latin 4)") } - MenuItem { text: qsTr("Baltic (ISO Latin 7)") } - } - \endqml - */ - -/*! - \qmlproperty int org.deepin.dtk::Menu(FlowStyle)::maxVisibleItems - - \c maxVisibleItems 用于控制菜单中的最大项数,默认情况下,该值是 16。当 Menu - 中的项数超过最大可视项目数量,其他的菜单项会处于滚动显示的状态。并且在菜单的头部 - 和尾部会添加向上和向下滚动的按钮,当鼠标放置在上面时,菜单自动滚动。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::Menu(FlowStyle)::backgroundColor - - \c backgroundColor 属性控制 Menu 的背景颜色。 - */ - -/*! - \qmlproperty var org.deepin.dtk::Menu(FlowStyle)::model - - \c model 属性是 Menu 的模型, \c model 用于控制菜单的数据添加和删除,动态进行 - 数据创建等等。 一般情况下, Menu 只需要手动添加 MenuItem 而不需要指定 \c model - ,当需要对 \c model 的数据进行过滤时,可以使用 ObjectModelProxy 包装该模型。 - 一般可用于控制 MenuItem 的显示和隐藏,创建和删除。手动控制 MenuItem 中 visible - 属性会在 Menu 中留下一个视觉上的空位,因此不推荐直接使用 visible 属性控制 MenuItem - 的隐藏。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::Menu(FlowStyle)::header - - \c header 属性可指定 Menu 的自定义的头部组件。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::Menu(FlowStyle)::footer - - \c footer 属性可指定 Menu 的自定义的底部组件。 - - */ - - -/*! - \qmlproperty bool org.deepin.dtk::Menu(FlowStyle)::existsChecked - \readonly - - \c existsChecked 属性可判断当前的 Menu 中是否存在已经选中的 MenuItem,如果存在则返回 true , 否则返回 false。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/MenuItemDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/MenuItemDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/MenuItemDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/MenuItemDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/*! - \qmltype MenuItem(FlowStyle) - \inherits MenuItem - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 MenuItem 控件. - - \l {MenuItem(FlowStyle)}{MenuItem} 控件是 \l {Menu(FlowStyle)}{Menu} 中的基础 - 菜单项控件。 \l {MenuItem(FlowStyle)}{MenuItem} 可以实现添加文字,图标,子菜单等等。 - 并且,MenuItem 目前实现了对 QtIcon 和 DciIcon 的兼容。 - - DTK 实现的 \l {MenuItem(FlowStyle)}{MenuItem} 能够使用原始的所有接口,为了更加兼容 - 行云设计风格,DTK 也为其提供了自定义开发属性,用于更加自定义的控制控件的状态。 - - 其使用方式,可以参考 \l {Menu(FlowStyle)}{Menu} 中的示例。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::MenuItem(FlowStyle)::useIndicatorPadding - - \c useIndicatorPadding 属性控制 indicator 的 padding 属性, 当 \c useIndicatorPadding 属性 - 开启时,选中情况下会默认对 indicator 添加 padding。默认情况下,该属性会根据当前 MenuItem 的状态自动 - 发生变化。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::MenuItem(FlowStyle)::textColor - - \c textColor 属性控制 \l {MenuItem(FlowStyle)}{MenuItem} 控件的前景颜色。包含文字和图标的 - 颜色。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::MenuItem(FlowStyle)::subMenuBackgroundColor - - \c subMenuBackgroundColor 属性控制 \l {MenuItem(FlowStyle)}{MenuItem} 控件子菜单的背景 - 颜色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/MenuSeparatorDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/MenuSeparatorDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/MenuSeparatorDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/MenuSeparatorDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/*! - \qmltype MenuSeparator(FlowStyle) - \inherits MenuSeparator - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 MenuSeparator 控件. - - \l {MenuSeparator(FlowStyle)}{MenuSeparator} 控件被用做 Menu 控件的菜单分隔符控件。 - 行云设计提供的 \l {MenuSeparator(FlowStyle)}{MenuSeparator} 控件不光能够作为分隔符, - 还能够添加自定义文本当作分隔描述。 - - 例如,可以使用如下方式添加自定义文本的菜单分隔符: - \qml - Menu { - MenuSeparator { text: qsTr("单曲")} // 创建带文本的菜单分隔符 - MenuItem { icon.name: "folder-music-symbolic"; text: qsTr("Tomorrow-Fly By Midnight") } - MenuItem { icon.name: "folder-music-symbolic"; text: qsTr("Tomorrow With You (EN]ABA)- Senpai Kondor") } - MenuItem { icon.name: "folder-music-symbolic"; text: qsTr("Tomorrow will be fine. - Sodagreen") } - MenuItem { icon.name: "folder-music-symbolic"; text: qsTr("CROWN - TOMORROW X TOGETHER") } - MenuSeparator { text: qsTr("歌手")} - MenuItem { icon.name: "music"; text: qsTr("Tomorrow - Fly By Midnight") } - MenuSeparator { text: qsTr("专辑")} - MenuItem { icon.name: "music"; text: qsTr("DTK-Menu-Menuitem-ICON-Right-Light") } - MenuItem { icon.name: "music"; text: qsTr("CROWN - TOMORROW X TOGETHER") } - } - \endqml - */ - -/*! - \qmlproperty string org.deepin.dtk::MenuSeparator(FlowStyle)::text - - \c text 属性控制 \l {MenuSeparator(FlowStyle)}{MenuSeparator} 是否带文本, - 如果未添加 \c text 属性, \l {MenuSeparator(FlowStyle)}{MenuSeparator} 只是一个带 - 水平线的菜单项。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::MenuSeparator(FlowStyle)::textColor - - \c textColor 属性用于控制文本和水平线的颜色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/navigation/dtkdeclarative.qdoc dtkdeclarative-5.6.10/doc/chinese/src/navigation/dtkdeclarative.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/navigation/dtkdeclarative.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/navigation/dtkdeclarative.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,497 +0,0 @@ -/*! - \title DtkDeclarative Reference Documentation - \page index.html - - \brief DtkDeclarative 提供一个用于快速开发出符合 DTK/行云设计 应用程序的开发库。 - - dtkdeclarative 是基于 QtQuick 及 QtQml 实现的开发控件库,它是用于代替已有的 dtkwidget - 所开发的全新的 DTK 模块,其代码以 qtdeclarative 为基础进行开发,实现了对QML已有控件的覆盖 - (包含Qt Quick Controls 2中的所有控件),增加了大量在 DTK 环境下友好显示的视觉特效和颜 - 色风格。该模块通过Qt插件的形式新增了名为“Chameleon”的样式插件,安装在 - /usr/lib/x86_64-linux-gnu/qt5/qml/QtQuick/Controls.2/Chameleon 目录 - (由qml-module-qtquick-controls2-styles-chameleon包提供)。 - 此外,与dtkwidget类似,dtkdeclarative也提供了一些QtQuick中所没有的功能,此类功能都以 - QML 接口的形式提供,包含在 org.deepin.dtk 1.0 中,安装在 /usr/lib/x86_64-linux-gnu/qt5/qml/org/deepin/dtk/ - 目录(由libdtkdeclarative5包提供)。使用 dtkdeclarative 在 DTK 环境下编程具备一下特点: - - \list - \li 原始的 Qt 和 Qml 代码风格 - \li 适配传统 Qml 的所有 API - \li 简单快速的界面开发接口 - \li 统一的控件主题风格 - \li 丰富的特效和色彩 - \endlist - - \image images/introduction.png - - \section1 与 dtkwidget 的区别 - dtkwidget 基于 QtWidgets 模块开发,其与 dtkdeclarative 的区别主要体现在 QtWidgets 和 QtQuick/QtQml 的差异。 - - QtWidgets 使用 C++ 语言开发,其控件都继承于 QWidget 并进行拓展,通过 QPainter 在风格插件中进行样式的统一绘制。 - 由于 C++ 语言的特殊性,其信号基于回调函数的方式实现,其事件处理基于多态的特性实现。因此在代码复杂度和冗余度上都有明显的劣势。 - - QtQuick/QtQml 基于 Qml 语言开发,其特点是通过树状模型来指定父子类别,通过属性绑定来响应变化。除此之外,它能兼容 JavaScript - 和 C++ 语言的特性,保证开发过程的高效和快速,减少 QtWidget 编程中信号槽链接的繁琐程度。 - - 在使用 dtkdeclarative 之前,应当先熟悉 QtQuick 的开发模式,其最大的特点是使用“声明式语言(QML)”来描述UI的状态,而不用关心 - UI 具体的渲染过程。下面是一些小例子: - \section2 渲染方式上的区别 - \table - \header - \li 方式 - \li 描述 - \li 实现 - \li 效果 - \row - \li dtkwidget - \li 渲染一个 100x100 大小的红色矩形 - \li \snippet snippets/dtkdeclarative_example.cpp 0 - \li {1, 2} \image images/renderRedRect.png - \row - \li dtkdeclarative - \li 显示一个 100x100 大小的红色矩形 - \li \snippet snippets/dtkdeclarative_qmlexample.qml 0 - \endtable - - \section2 布局方式上的区别 - \table - \header - \li 方式 - \li 描述 - \li 实现 - \li 效果 - \row - \li dtkwidget - \li 通过布局控件实现 - \li \snippet snippets/dtkdeclarative_example.cpp 1 - \li \image images/layutFromDtkwidget.png - \row - \li {1, 2} dtkdeclarative - \li 通过锚布局实现 - \li \snippet snippets/dtkdeclarative_qmlexample.qml 1 - \li \image images/layoutUseAnchors.png - \row - \li 使用布局器实现 - \li \snippet snippets/dtkdeclarative_qmlexample.qml 2 - \li \image images/layoutUseCustomLayout.png - \endtable - - \section2 信号槽连接上的区别 - \table - \header - \li 方式 - \li 描述 - \li 实现 - \row - \li dtkwidget - \li 使用 QObject::connection 方式连接 - \li \snippet snippets/dtkdeclarative_example.cpp 2 - \row - \li dtkdeclarative - \li 使用on的方式连接 - \li \snippet snippets/dtkdeclarative_qmlexample.qml 3 - \endtable - - \section1 QML 模块分类 - dtkdeclarative 项目内部将不同模块进行划分,以便不同开发者在不同的场景进行使用。 - dtkdeclarative 提供了分为内部和外部使用的不同模块,具体划分如下表所示: - - \table - \header - \li 名称 - \li 版本 - \li 介绍 - \li 使用对象 - - \row - \li \l {org.deepin.dtk 模块}{org.deepin.dtk} - \li 1.0 - \li dtk 统一对外模块,包含所有子模块内容 - \li 外部 - \row - \li org.deepin.dtk.impl - \li 1.0 - \li 基础的c++实现 - \li 内部 - \row - \li org.deepin.dtk.controls - \li 1.0 - \li 自定义控件、重写 Qt 基础控件 - \li 内部 - \row - \li org.deepin.dtk.style - \li 1.0 - \li 控件风格,默认为行云设计风格 - \li 内部 - \row - \li \l {org.deepin.dtk.settings 模块}{org.deepin.dtk.settings} - \li 1.0 - \li SettingsDialog 控件相关接口 - \li 外部 - \endtable - \warning \l {org.deepin.dtk 模块}{org.deepin.dtk} 作为dtk对外提供的统一模块,能够访问大部分模块中的子项, - 但无法访问 org.deepin.dtk.settings 模块下的子项。如需访问请手动导入该项。 - - \section1 QML 类型集合 - \generatelist {qmltypesbymodule org.deepin.dtk} - - \section1 Setting 相关类型集合 - \generatelist {qmltypesbymodule org.deepin.dtk.settings} - \noautolist - */ - -/*! - \qmlmodule org.deepin.dtk 1.0 - \title org.deepin.dtk 模块 - \brief org.deepin.dtk 提供了 dtkdeclarative 项目的主模块. - - \l {org.deepin.dtk 模块}{org.deepin.dtk} 作为 dtkdeclarative 项目的主模块,包含了例如 QML 模块、 C++ 模块、风格模块等等几种不同的子模块。 - 作为主模块,当使用任意子模块的控件时,都能正确访问和使用。除此之外,\l {org.deepin.dtk 模块}{org.deepin.dtk} 模块也将 Qt 中一些常用的 QtQuick - 模块导入进来。因此通常情况下, \l {org.deepin.dtk 模块}{org.deepin.dtk} 模块能够满足应用的大部分控件需求,而不需要导入其他模块。 - - \l {org.deepin.dtk 模块}{org.deepin.dtk} 模块包含了下表所示的子模块: - \table - \header - \li 名称 - \li 版本 - \li 介绍 - \li 使用对象 - - \row - \li \l {org.deepin.dtk 模块}{org.deepin.dtk} - \li 1.0 - \li dtk 统一对外模块,包含所有子模块内容 - \li 外部 - \row - \li org.deepin.dtk.impl - \li 1.0 - \li 基础的c++实现 - \li 内部 - \row - \li org.deepin.dtk.controls - \li 1.0 - \li 自定义控件、重写 Qt 基础控件 - \li 内部 - \row - \li org.deepin.dtk.style - \li 1.0 - \li 控件风格,默认为行云设计风格 - \li 内部 - \row - \li org.deepin.dtk.settings - \li 1.0 - \li SettingsDialog 控件相关接口 - \li 外部 - \endtable - - \section1 QML 类型集合 - \generatelist {qmltypesbymodule org.deepin.dtk} - \noautolist - - \section1 重写或实现的 QML 类型 - \annotatedlist QML_TYPES - */ - -/*! - \qmlmodule org.deepin.dtk.settings 1.0 - \title org.deepin.dtk.settings 模块 - \brief org.deepin.dtk.settings 提供了 dtkdeclarative 项目设置相关模块. - - dtkdeclarative适配了配置策略中所有的内容,为了更方便的对接配置策略,将配置策略和qml语法相结合, - dtkdeclarative设计实现了一套全新的Settings框架。 - - \section1 Config 配置 - - 关于配置策略相关指南,请参见配置策略使用说明,dtkdeclarative封装了C++中的配置策略属性实例,通过“Config”项指定,例如以下代码: - \qml - Config { - name: "example" // 必须指定 - property int key1 : 1 - property string key2 : "key2 default" - } - \endqml - - subpath属性用于指定文件查找路径,默认情况可以不指定,将直接从“appid”和“name”获取对应的路径进行查找。 - - Config 项可以直接通过QML属性的形式指定基础的键值类型,例如上述实例代码,该属性也能直接在控件的槽函数中进行绑定,例如以下代码: - \qml - Config { - id: config - name: "example" // 必须指定 - property int key1 : 1 - property string key2 : "key2 default" - - onKey2Changed: { - console.info("Config") - } - } - - LineEdit { - text: config.key2 - } - \endqml - 对于外部修改的配置项值,Config能够接受其变化并发出对应属性修改的信号,QML中能够监听该信号,并进行文本的实时绑定,监听的方式有两种,如下代码所示: - \qml - Config { - id: config - name: "example" // 必须指定 - property int key1 : 1 - property string key2 : "key2 default" - - onKey2Changed: { - console.info("Config Value changed...") - } - } - - // 1. 直接进行属性绑定 - Label { - text: "property binding key3:" + exampleConfig.key3 - } - - // 2. Qt.binding 进行属性绑定 - Label { - text: "config.key2" - Component.onCompleted: { - text = Qt.binding(function(){ return config.key2 }) - } - } - \endqml - \b {需要注意的是,} Config 中声明的属性,在对应的配置文件中需要有对应的键值,对于Config中新增的属性,不会直接生效到配置文件去; - 相反对于配置文件中有的键值,Config中没有对应属性时,若该值发生变化,将触发Config中valueChanged的信号,控件可以通过使用Connection - 或者 槽函数绑定的形式动态获取,例如以下代码: - \qml - Config { - id: config - name: "example" // 必须指定 - property int key1 : 1 - property string key2 : "key2 default" - - // 1. 直接通过信号槽进行连接 - onValueChanged: { - console.info("Config Key:", key, "Config Value:", config.value(key)) - } - - // 2. 通过Connection进行连接 - Connection { - target: config - // 5.11 的写法 - onValueChanged: { - console.info("Config Key:", key, "Config Value:", config.value(key)) - } - // 5.15推荐写法 - function onValueChanged(key) { - console.info("Config Key:", key, "Config Value:", config.value(key)) - } - } - } - \endqml - - \section1 SettingsDialog 相关 - dtkdeclarative中的SettingsDialog能够更加方便的使用QML语法,更方便的控制布局和样式,同时还能够完成与配置策略的关联。 - - dtkwidget中的SettingsDialog通过解析Json文件,完成布局和控件的添加。这种方式存在一些局限性,例如布局的局限性,导致一些高级组合控件无法正常显示; - 界面的改动能够导致各个控件都出现相应的影响等等。 - - 为了解决与QML的融合,能够使用树状代码结构的形式创建控件,摒弃Json的繁琐性和不易阅读性,并方便配置的统一管理,SettingsDialog有一套统一的控件模板。 - 以下展示一个简单的SettingsDialog示例代码: - \qml - import org.deepin.dtk.settings 1.0 as Settings - - Config { // 创建配置项 用于关联到SettingsDialog中 - id: config - name: "example" - property string key : "key default" // 配置文件中需要有同名键 - } - - Settings.SettingsDialog { - height: 600 - width: 680 - config: config - - groups: [ // 创建配置组,管理配置子组和Options - Settings.SettingsGroup { - key: "group1" - name: "group1" - Settings.SettingsOption { - key: "key" // Option中的键可以直接绑定到config中同名的属性值 - name: "ComboBox" - Settings.ComboBox { // Settings封装的基础控件类型 - model: ["first", "sceond", "three"] - } - } - Settings.SettingsOption { - key: "key2" - name: "LineEdit" - Settings.LineEdit {} - } - Settings.SettingsOption { - key: "canExit" - name: "CheckBox" - Settings.CheckBox {} - } - } - ] - } - \endqml - 上述示例简单的展示了一个 SettingsDialog 整体树构建过程,对于其中的细节和控件,以下将进行重点介绍: - - \section2 SettingsGroup 和 SettingsOption - SettingsDialog的子项通过groups属性管理和维护,在窗口组件添加完毕后,它会获取到所有的groups项目树, - 并根据其父子关系进行左侧标题栏的生成和右侧内容页的展示。SettingsGroup就是添加进groups属性的数组子项。 - - \b {SettingsGroup:} 其内部用于管理Options,也可以添加子Group,当group存在多个子group时,需要指定其为children对象: - \qml - Settings.SettingsDialog { - height: 600 - width: 680 - - groups: [ // 创建配置组,管理配置子组和Options - Settings.SettingsGroup { - key: "group1" - name: "group1" - - children: [ - Settings.SettingsGroup { - key: "group2" - name: "group2" - - Settings.SettingsOption { - key: "key" // Option中的键可以直接绑定到config中同名的属性值 - name: "ComboBox" - Settings.ComboBox { // Settings封装的基础控件类型 - model: ["first", "sceond", "three"] - } - } - }, - Settings.SettingsGroup { - key: "group2" - name: "group2" - - Settings.SettingsOption { - key: "key2" - name: "LineEdit" - Settings.LineEdit {} - } - } - ] - } - } - \endqml - \b {SettingsOption:} SettingsGroup的子项,其内部用于添加控件,进行用户操作。和SettingsGroup一致的是它们都有 key - 和、name以及visible 三个属性,但不同的是,SettingsOption中的“key”直接对应与 Config 中对应名称属性,而无需进行手动绑定; - SettingsGroup 中的“key”通常用于进行以下过滤操作,例如通过单一的“key”过滤出对应的group并控制它们的显示与隐藏。 - - \b {附加属性:} SettingsGroup和SettingsOption都有附加属性,对于SettingsGroup和SettingsOption中子控件想要获取他们属性时, - 可以通过附加属性进行获取。不论是SettingsGroup还是SettingsOption,他们的附加属性返回的对象为距离其最近的父类SettingsGroup/SettingsOption对象。 - - \section2 Settings 封装的控件 - settings 封装的控件与自定义控件不同,它能够获取对应SettingsOption中的“name”属性并自动添加左右布局的标题描述,同时其属性的改动无需绑定即可自动生效 - 到配置文件中,例如ComboBox效果图如下图所示: - \image images/SettingComboBox.png - - 目前被Settings封装好的控件如下表所示(默认添加别名): - \table - \header - \li 控件名称 - \li Settings控件名称 - \row - \li CheckBox - \li \l {CheckBox(Settings)}{Settings.CheckBox} - \row - \li ComboBox - \li \l {ComboBox(Settings)}{Settings.ComboBox} - \row - \li LineEdit - \li \l {LineEdit(Settings)}{Settings.LineEdit} - \endtable - - 添加到SettingsOption中的自定义控件,也能实现上述封装控件的样子,SettingsDialog封装了OptionDelegate控件,对于需要左侧显示名称右侧显示控件的设计需求, - 可以直接将自定义控件放到OptionDelegate中,如下代码所示: - \qml - Settings.SettingsGroup { - key: "group2" - name: "group2" - - Settings.SettingsOption { - key: "option1" - name: "group2.group1.option1" - Settings.OptionDelegate { - LineEdit { - text: Settings.SettingsOption.name // Option中的附加属性获取距离最上层的Option对象的name属性 - onEditingFinished: { // 需要手动更新配置项的value属性 - Settings.SettingsOption.value = text // Option中的附加属性获取距离最上层的Option对象的value属性 - } - } - } - ] - } - \endqml - 需要注意的是,对于此类自定义控件,其Option中对应的value值需要自定义控件进行手动绑定。 - - \section2 其他属性 - - 下表列出了SettingsDialog中的其他属性,并简单介绍: - \table - \header - \li 属性名 - \li 子属性 - \li 描述 - \row - \li groups - \li 无 - \li 配置项列表,用于添加 SettingsGroup/SettingsOption 配置项 - \row - \li config - \li 无 - \li 配置策略 - \row - \li {1,5} container - \li config - \li 配置策略 - \row - \li navigationTitle - \li 导航栏标题,可重载,默认使用Settings.NavigationTitle - \row - \li contentTitle - \li 内容页标题,可重载,默认使用Settings.ContentTitle - \row - \li contentBackground - \li 内容页背景,可重载,默认使用Settings.ContentBackground - \row - \li groups - \li 配置项列表 - \row - \li navigationView - \li ListView 中的子属性 - \li 导航列表 - \row - \li contentView - \li ListView中的子属性 - \li 内容页列表 - \endtable - - \section1 Setting 相关控件 - \generatelist {qmltypesbymodule org.deepin.dtk.settings} - \noautolist -*/ - -/*! - \page dtkdeclarative-index.html - \title Dtk Declarative QML Types - \brief Dtk Declarative 是一个在 UOS 平台创建出符合行云设计风格的开发库 - - Dtk Declarative 提供了众多 QML 类型,用于更好的兼容 QtQuick 的基础控件,提供 - 更加便捷快速的开发途径。导入 Dtk Declarative 的类型,可以通过下述 QML 代码: - \qml - import org.deepin.dtk 1.0 - \endqml - - 实现行云设计风格,只需要像其他 QML 代码一样进行特定声明即可。Dtk Declarative 提供的所有 - 类型、控件和效果,都是一个独立的 QML 类,下面将从以下几种不同的类别出发,列出所有的 QML 类型。 - - \section1 QML 类型集合 - \generatelist {qmltypesbymodule org.deepin.dtk} - - \section1 Setting 相关类型集合 - \generatelist {qmltypesbymodule org.deepin.dtk.settings} -*/ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/OutsideBoxBorderDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/OutsideBoxBorderDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/OutsideBoxBorderDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/OutsideBoxBorderDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/*! - \qmltype OutsideBoxBorder - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种外边框控件. - - OutsideBoxBorder 控件是一种修饰宿主控件的外边框(外描边)控件,与 InsideBoxBorder 控件相对应, - 在设计和美化界面时,离不开好的描边来使宿主控件显得更有层次,更加丰满。 - - OutsideBoxBorder 的用法如下所示: - \qml - Rectangle { - width: 200 - height: 200 - color: "darkBlue" - radius: 8 - - OutsideBoxBorder { - anchors.fill: parent - color: "darkCyan" - radius: 8 - borderWidth: 2 - } - } - \endqml - - 其效果如下图所示: - \image images/OutsideBoxBorderExample.png - */ - -/*! - \qmlproperty real org.deepin.dtk::OutsideBoxBorder::borderWidth - - \c borderWidth 属性用于表示 OutsideBoxBorder 控件的边框大小。 默认情况下, - 该值是 1。 - */ - -/*! - \qmlproperty color org.deepin.dtk::OutsideBoxBorder::color - - \c color 属性表示外边框的颜色值。默认情况下,该值是 "white" - */ - -/*! - \qmlproperty real org.deepin.dtk::OutsideBoxBorder::radius - - \c radius 属性表示内边框的圆角大小,默认情况下,该大小为 0。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/PasswordEditDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/PasswordEditDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/PasswordEditDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/PasswordEditDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/*! - \qmltype PasswordEdit - \inherits Item - \inqmlmodule LineEdit - \ingroup QML_TYPES - \brief 提供一种用于密码输入的输入框控件. - - PasswordEdit 控件专门用于进行密码的输入,它自动适配了密码显示和隐藏按钮,提供了 - 快捷的密码输入方式。 - - PasswordEdit 的效果如下图所示: - \image images/PasswordEdit.png - */ - -/*! - \qmlproperty bool org.deepin.dtk::PasswordEdit::isEchoMode - - \c isEchoMode 属性表示当前是否为密码输入模式,当处于密码输入模式时,密码输入框 - 会将输入的文本进行密文展示。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::PasswordEdit::echoButtonVisible - - \c echoButtonVisible 属性用于控制密码显示和隐藏按钮的可视化属性。默认情况下, - 该属性为 true 。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/PlusMinusSpinBoxDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/PlusMinusSpinBoxDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/PlusMinusSpinBoxDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/PlusMinusSpinBoxDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/*! - \qmltype PlusMinusSpinBox - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 一种加减按钮样式的数字轮选框控件. - - PlusMinusSpinBox 控件是基于基础的 SpinBox 控件进行调整的特殊样式控件, - PlusMinusSpinBox 将 SpinBox 内部调整数值的按钮从上下箭头修改为特殊的加减 - 号按钮和还原按钮,默认情况下还原按钮不作显示,可通过属性控制该按钮的显示和隐藏。 - - PlusMinusSpinBox 主要用于特殊场景、特殊样式下的独特的 SpinBox 控件,应用可 - 根据实际场景选择使用 SpinBox 控件还是 PlusMinusSpinBox 控件。 - - PlusMinusSpinBox 的效果如下图所示: - \image images/PlusMinusSpinBox.png - - PlusMinusSpinBox 提供了控制 SpinBox 的属性,例如输入方式、警告信息等等。因此 - PlusMinusSpinBox 具备 SpinBox 的所有特性。 - */ - -/*! - \qmlproperty Item org.deepin.dtk::PlusMinusSpinBox::spinBox - - \c spinBox 属性是控制 PlusMinusSpinBox 内部的 SpinBox 的统一属性。 - 例如,可以通过控制 SpinBox 的 alertText 等属性调整其警告信息,如下代码所示: - \qml - PlusMinusSpinBox { - spinBox.editable: true - spinBox.alertText: "只能输入数字" - spinBox.showAlert: true - } - \endqml - */ - -/*! - \qmlproperty bool org.deepin.dtk::PlusMinusSpinBox::upButtonVisible - - \c upButtonVisible 属性控制 “+” 号按钮的显示和隐藏。默认情况下, \c upButtonVisible - 为 true。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::PlusMinusSpinBox::downButtonVisible - - \c downButtonVisible 属性控制 “-” 号按钮的显示和隐藏。默认情况下, \c downButtonVisible - 为 true。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::PlusMinusSpinBox::resetButtonVisible - - \c resetButtonVisible 属性控制还原按钮的显示和隐藏。默认情况下, \c resetButtonVisible - 为 false。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/PopupWindowDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/PopupWindowDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/PopupWindowDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/PopupWindowDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -/*! - \qmltype PopupWindow - \inherits Window - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种 Popup 类型的窗口控件. - - PopupWindow 控件是一个独立的窗口,和 Window 控件一致,都能够作为相对于主窗口外的 - 独立窗口进行显示。 PopupWindow 是一种提供 Popup 属性的窗口,他不具备正常的 Dialog - 或者 ApplicationWindow 通用的 TitleBar 控件,它可被用于弹出式窗口,即弹即回的样式。 - - PopupWindow 除正常的用于 Window 的属性外,由于其 Popup 的特性,它还拥有特殊的窗口 - 背景模糊的效果,窗口背景的混成和默认的主题风格保持一致。 - */ - -/*! - \qmlproperty Item org.deepin.dtk::PopupWindow::blurControl - - \c blurControl 属性是模糊背景的宿主控件,主要用于保持跟宿主控件相同的调色板信息。 - 用于获取宿主控件的调色版某种角色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ProgressBarDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ProgressBarDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ProgressBarDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ProgressBarDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/*! - \qmltype ProgressBar(FlowStyle) - \inherits ProgressBar - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的进度条控件. - - \l {ProgressBar(FlowStyle)}{ProgressBar} 控件提供行云设计风格的进度条控件。 - 根据使用场景不同,\l {ProgressBar(FlowStyle)}{ProgressBar} 的样式也会跟随 - 发生变化。 - - \l {ProgressBar(FlowStyle)}{ProgressBar} 根据 \c indeterminate 属性的不同 - 样式也跟随不同。 \c indeterminate 属性为 true 时,进度条被设置成“无进度”模式, - 即无法确定当前进去情况下的进度条样式。 - - 例如以下效果: - \image images/ProgressBarIn.png - - 同样的, \l {ProgressBar(FlowStyle)}{ProgressBar} 在设置文本和未设置文本时样式 - 也不一样,未设置文本时, \l {ProgressBar(FlowStyle)}{ProgressBar}处于无法控制的 - 状态,其背景会呈现出淡灰色样式,而在设置文本属性后,背景变成可以操作的按钮样式,即指示 - 用于当前的 \l {ProgressBar(FlowStyle)}{ProgressBar} 是可以进行操作暂停或者停止 - 的。 - - 例如以下效果: - \image images/ProgressBarText.png - */ - -/*! - \qmlproperty string org.deepin.dtk::ProgressBar(FlowStyle)::formatText - - \c formatText 属性控制 \l {ProgressBar(FlowStyle)}{ProgressBar} 是否使用 - 格式化文本添加当前进度,例如下图的场景: - - \image images/ProgressBarFormatText.png - */ - -/*! - \qmlproperty bool org.deepin.dtk::ProgressBar(FlowStyle)::animationStop - - \c animationStop 属性控制 \l {ProgressBar(FlowStyle)}{ProgressBar} 正在进行的 - 进度动画是否停止,默认情况在为 false。 - - \warning 请注意,该属性只在 \c indeterminate 属性为 true 时才有效。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/RatioButtonDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/RatioButtonDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/RatioButtonDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/RatioButtonDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/*! - \qmltype RadioButton(FlowStyle) - \inherits RadioButton - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 RadioButton 控件. - - \l {RadioButton(FlowStyle)}{RadioButton} 提供了一种“选中”和“未选中”状态的功能 - 按钮。当同时存在多个 \l {RadioButton(FlowStyle)}{RadioButton} 时,只会一个作为 - 当前选中的 \l {RadioButton(FlowStyle)}{RadioButton}。 - - DTK 风格的 \l {RadioButton(FlowStyle)}{RadioButton} 继承了原始的所有 API,能够 - 同时添加文本和图标当作其内容。默认情况下 autoExclusive 属性是 true,因此多个 \l {RadioButton(FlowStyle)}{RadioButton} - 存在的情况下,只会独占一个按钮。 - - DTK 风格的 \l {RadioButton(FlowStyle)}{RadioButton} 使用 DciIcon 作为其内部 - 使用的图标样式,在不同状态切换时,有不同的特殊效果,例如下图所示: - \table - \header - \li 状态 - \li 模式 - \li 效果 - - \row - \li {1, 2} checked - \li Normal - \li \image images/RatioButtonNormal.png - \row - \li Hovered - \li \image images/RadioButtonCheckedHovered.png - \row - \li {1, 2} unchecked - \li Normal - \li \image images/RatioButtonUncheckedNormal.png - \row - \li Hovered - \li \image images/RatioButtonUncheckedHovered.png - \endtable - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/RecommandButtonDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/RecommandButtonDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/RecommandButtonDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/RecommandButtonDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -/*! - \qmltype RecommandButton - \inherits Button - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 一种用于提示的推荐型按钮. - - RecommandButton 控件与基本的 \l {Button(FlowStyle)}{Button} 按钮样式类似。 - 但 RecommandButton 作为推荐按钮,其作用场景通常为推荐用户选择(或点击)的一类按钮, - 在样式设计上,它的默认样式显得更突出,背景使用渐变的高亮背景进行控制。 - 例如以下样式: - \image images/RecommandButtonExample.png - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/RectangularShadowDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/RectangularShadowDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/RectangularShadowDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/RectangularShadowDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/*! - \qmltype RectangularShadow - \inherits Item - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 一种只支持硬件渲染模式的矩形阴影控件. - - RectangularShadow 是 GlowEffect 应用形态,它重新整理了 GlowEffect 的各个属性,并将其修饰为 - 更容易理解的属性名称。 RectangularShadow 相对于 GlowEffect 更容易使用。 - - 但 RectangularShadow 和 GlowEffect 都有同样的缺点:暂不支持使用软件渲染。因此使用这两种效果时 - 需要注意对不同渲染模式的适配。如果在使用中更倾向于软硬件的兼容,请使用: BoxShadow 效果。 - - RectangularShadow 和 GlowEffect 一样,都提供一种矩形阴影效果。RectangularShadow的 - 使用方式如下所示: - \qml - RectangularShadow { - anchors.fill: shadowSource - glowRadius: 20 - spread: 0 - color: "black" - cornerRadius: shadowSource.radius - } - - Rectangle { - id: shadowSource - width: 120 - height: 120 - radius: 16 - color: "red" - } - \endqml - - 其效果如下图所示: - \image images/RectangularShadowExample.png - */ - -/*! - \qmlproperty real org.deepin.dtk::RectangularShadow::offsetX - - \c offsetX 属性定义阴影在x轴方向上的偏移,默认是0。 - */ - -/*! - \qmlproperty real org.deepin.dtk::RectangularShadow::offsetY - - \c offsetY 属性定义阴影在y轴方向上的偏移,默认是0。 - */ - -/*! - \qmlproperty real org.deepin.dtk::RectangularShadow::glowRadius - - \c glowRadius 属性定义阴影到达项目区域外部(或内部)的像素数,默认是 0。 - */ - -/*! - \qmlproperty real org.deepin.dtk::RectangularShadow::spread - - \c spread 属性定义在源四周区域的阴影颜色的增强程度,默认是0 - */ - -/*! - \qmlproperty color org.deepin.dtk::RectangularShadow::color - - \c color 属性定义阴影颜色。 - */ - -/*! - \qmlproperty real org.deepin.dtk::RectangularShadow::cornerRadius - - \c cornerRadius 属性定义绘制阴影的控件的圆角大小。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::RectangularShadow::fill - - \c fill 属性定义阴影是否填充整个区域。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/SearchEditDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/SearchEditDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/SearchEditDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/SearchEditDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/*! - \qmltype SearchEdit - \inherits LineEdit - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种带搜索的输入框控件. - - SearchEdit 控件是一种用于搜索的输入框控件, SearchEdit 自带了搜索图标,并且在搜索和 - 未搜索时具有动画过渡效果。 - - SearchEdit 继承自 LineEdit ,具备 LineEdit 的几乎所有特性。SearchEdit 除了可以被 - 使用在主窗口的任何位置,同样也能被使用在 Menu, PopupWindow 等控件上,当作复合控件存在。 - - SearchEdit 的效果如下图所示: - \image images/SeachEditNoFocus.png - - SearchedEdit 在焦点状态下的效果如下图所示: - \image images/SearchEditFocus.png - - SearchedEdit 的整体运行效果如下: - \image images/SearchEditRunning.gif - */ - -/*! - \qmlproperty string org.deepin.dtk::SearchEdit::placeholder - - \c placeholder 属性是当 SearchEdit 处于未搜索状态时,用于显示提示的文本。默认情况下, - 该文本为翻译后的“搜索”字符串。可通过重新设置该属性调整显示文本。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::SearchEdit::editting - \readonly - - \c editting 属性用于判断当前控件是否处于正在编辑的状态。 SearchEdit 存在两种状态:正在编辑 - 的状态和非编辑状态。 当处于正在编辑的状态时,用于可直接键入文本。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/SettingDialog.qdoc dtkdeclarative-5.6.10/doc/chinese/src/SettingDialog.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/SettingDialog.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/SettingDialog.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ -/*! - \qmltype SettingsDialog - \inherits WindowDialog - \inqmlmodule org.deepin.dtk.settings - \brief DTK 应用统一的应用设置对话框. - - SettingsDialog 是 DTK 应用用于存储和设置应用信息的对话框。 SettingsDialog - 中当设置项发生改变时,应用程序会收到此变化,并发生响应。通常情况下, SettingsDialog - 用于存储应用的界面信息、配置信息和用户自定义信息等等。 虽然 SettingsDialog 的整体 - 样式保持和 DTK 风格一致,但仍提供了高度自由的接口,用于设置自定义风格的设置属性对话框。 - - \image images/SettingsDialog.png - - \section1 DConfig 兼容 - 您需要了解 Config 的使用和配置,SettingsDialog 中存储的配置信息,将全部使用 Config - 保存,根据 Config 中的已有属性,自动更新设置。同时,当用户修改 SettingsDialog 中的属性 - 后, Config 能够受到变化并修改内部的配置文件。这也是应用响应 SettingsDialog 中的属性 - 信息发生变化的方式。例如下述代码: - - \qml - import org.deepin.dtk - - Config { - name: "example" // 存储配置文件的名称 - - property string setting1: "Setting1" // 配置文件中设置项的具体内容。 - property int setting2: 0 - } - \endqml - - SettingsDialog 中必须指定 Config 才能对配置项进行生效和存储,当 Config 无效时,SettingsDialog - 同样也不会生效任何设置。DConfig 中的具体细节,可查阅 dtkcore 项目中的文档。 - - \section1 SettingsGroup, SettingsOption - SettingsDialog 中设置项有内部的多个 SettingsGroup 构成,而 SettingsGroup 可以嵌套其子 SettingsGroup - 和 SettingsOption,形成一个配置树,同一层级的配置,表现为同一字体和缩进大小。不同的层级,具备父子关系的 - 不同层级,所属关系跟随父子关系。例如一下代码示例: - \qml - import QtQuick 2.0 - import org.deepin.dtk 1.0 - import org.deepin.dtk.settings 1.0 as Settings - - Settings.SettingsDialog { - id: SettingsDialog - - width: 800 - height: 600 - - config: Config { - name: "example" // 请确保配置文件存在 - property string setting1: "Setting1" // 请确保配置文件存在该属性 - } - - groups: [ // 配置根 SettingsGroup 组,其包含多个并列的 SettingsGroup 对应关系为,根节点下的多个设置项 - Settings.SettingsGroup { - key: "rootKey1" - name: "Basic Settings" - - children: [ // 配置该组下的子 SettingGroup - Settings.SettingsGroup { - key: "group1" - name: "Custom Widget" - - Settings.SettingOption { - key: "setting1" // 对应 Config 中的属性名 - Settings.ComboBox { // Settings封装的基础控件类型 - model: ["first", "sceond", "three"] - } - } - } - ] - } - - ] - } - \endqml - - \section1 自定义属性 - SettingsDialog 中提供了多个可自定义的组件,在实现风格统一的同时,也能够帮助用户高度定制内部组件。 - 可定制的区域,包括 SettingsContainer(主界面容器); 导航界面视图; 内容界面视图。 - SettingsContainer 中也存在可自定义的子属性: NavigationTitle(导航栏标题); ContentTitle(内容区域标题); - ContentBackground(内容区域背景)。 - - 自定义方式如下代码所示: - \qml - import QtQuick 2.0 - import org.deepin.dtk 1.0 - import org.deepin.dtk.settings 1.0 as Settings - - Settings.SettingsDialog { - id: SettingsDialog - - width: 800 - height: 600 - - config: Config { - name: "example" // 请确保配置文件存在 - property string setting1: "Setting1" // 请确保配置文件存在该属性 - } - - groups: [ // 配置根 SettingsGroup 组,其包含多个并列的 SettingsGroup 对应关系为,根节点下的多个设置项 - Settings.SettingsGroup { - key: "rootKey1" - name: "Basic Settings" - - container.contentBackground: Settings.ContentBackground { - border.color: "red" // 将对话框的内容区域部分添加边框 - } - - children: [ // 配置该组下的子 SettingGroup - Settings.SettingsGroup { - key: "group1" - name: "Custom Widget" - background: Settings.ContentBackground { - boder.color: "blue" // 特殊组的边框可自定义 - radius: 18 - } - - Settings.SettingOption { - key: "setting1" // 对应 Config 中的属性名 - Settings.ComboBox { // Settings封装的基础控件类型 - model: ["first", "sceond", "three"] - } - } - } - ] - } - - ] - } - \endqml - */ - -/*! - \qmlproperty list org.deepin.dtk.settings::SettingsDialog::groups - - SettingsDialog 中的根设置组。根设置组使用 FontManager 中 t1 号字体区分。并且其缩进保持最小。 - 其可保存多个 SettingsGroup 或 SettingsOption。 - */ - -/*! - \qmlproperty Config org.deepin.dtk.settings::SettingsDialog::config - - config 属性存储 SettingsDialog 用于读写的配置文件,每个配置文件中的配置属性,都需要 - 和 SettingsDialog 中的设置项对应,才能保证当用户修改了 SettingsDialog 的属性后 - 配置文件能够跟随发生变化,也确保了外部通过修改配置文件中配置属性的值时,界面中的配置项 - 能够跟随配置文件的改变发生变化。 - */ - -/*! - \qmlproperty SettingsContainer org.deepin.dtk.settings::SettingsDialog::container - - container 属性存储 SettingDialog 中的主界面容器。默认情况下,SettingsDialog 会提供一个默认的 - 基于 DTK 风格的主界面容器,当应用程序需要自定义界面时,可通过设置该属性进行改变。 - */ - -/*! - \qmlproperty Item org.deepin.dtk.settings::SettingsDialog::navigationView - - navigationView 属性存储导航视图界面的控件。默认情况下,DTK 会提供一个自适应设置项层级的导航视图。 - 当自定义该属性时,需要考虑滚动区域和点击单项标题时内容区域的跳转问题。 - */ - -/*! - \qmlproperty Item org.deepin.dtk.settings::SettingsDialog::contentView - - contentView 内容视图存储用于放置设置项内容区域的视图控件。默认情况下,SettingsDialog 提供了一个 - 根据 SettingsOption 的层级关系,自动列举的视图控件。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/SliderDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/SliderDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/SliderDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/SliderDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -/*! - \qmltype Slider(FlowStyle) - \inherits Slider - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的滑动条控件. - - Slider 控件被用于通过控制滑块选择指定值或者代表某一进度。 - Slider 在行云设计中增加了许多用于额外控制的方式和布局,例如增加了用于指示进度的提示文本; - 提供了上下左右四个方向的滑块; - - Slider 的用法如下代码所示: - \qml - Slider { - width: parent.width - handleType: Slider.HandleType.ArrowBottom - } - \endqml - - Slider 的效果如下图所示: - \table - \header - \li 方向 - \li 效果 - \row - \li 横向 - \li 无滑块方向: \image images/SliderNormalHor.png - \row - \li 纵向 - \li 滑块朝下: \image images/SliderNormalVer.png - \endtable - */ - -/*! - \qmlproperty Palette org.deepin.dtk::Slider(FlowStyle)::grooveColor - - \c grooveColor 属性控制滑槽的颜色, \c grooveColor 并非控制滑槽划过区域的颜色, - 而是整个滑槽的默认颜色。 - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::Slider(FlowStyle)::handleType - - \c handleType 属性表示滑块的方向,默认情况下,滑块无任何方向。 - handleType 可供使用的枚举为: - \table - \header - \li 枚举 - \li 含义 - - \row - \li Slider.NoArrowHorizontal - \li 水平无方向。请注意,水平无方向和竖直无方向,在滑动条的水平和数值方向时,滑块的图标 - 也不一样,水平无方向时,滑块宽度高于高度,显得更加扁平,竖直无方向时,滑块高度高于宽度, - 显得更加修长。 - \row - \li Slider.NoArrowVertical - \li 竖直无方向。 - \row - \li Slider.ArrowUp - \li 滑块箭头朝上,一般用于滑动条为水平方向时。 - \row - \li Slider.ArrowLeft - \li 滑块箭头朝左,一般用于滑动条为竖直方向时。 - \row - \li Slider.ArrowBottom - \li 滑块箭头朝下,一般用于滑动条为水平方向时。 - \row - \li Slider.ArrowRight - \li 滑块箭头朝右,一般用于滑动条为竖直方向时。 - \endtable - */ - -/*! - \qmlproperty real org.deepin.dtk::Slider(FlowStyle)::dashOffset - - \c dashOffset 属性是绘制滑块时,画笔的起始位置偏移量。 - \image images/SliderDashOffset.png - - 如上图所示,当 \c dashOffset 不为0时,绘制滑槽的位置将根据绘制位置发生 - 偏移,例如下述示例,\c dashOffset 为 0 和 dashOffset 为 20 的比较。 - \image images/SliderDashOffsetCompare.png - - 上图中,上层 Slider 调整了 dashOffset 而 Slider 未调整,但从上图可以看出 - 并不是 Slider 设置 dashOffset 值,绘制就会在偏移 dashOffset 大小后开始,它 - 还受绘制的间距影响,例如下图所示: - \image images/SliderDashOffsetCompareWithPattern.png - */ - -/*! - \qmlproperty var org.deepin.dtk::Slider(FlowStyle)::dashPattern - - \c dashPattern 表示绘制点和间距的距离,默认值为[0.5, 0.25],即可以理解为,每绘制 - 0.5 像素的滑条样式,就绘制 0.25 像素的间距。将其中值变大,会起到其代表的那一部分的区域 - 变大的效果。 - - 例如以下代码: - \qml - Slider { - dashPattern: [0.5, 5] // 每绘制0.5像素的滑块,就绘制5像素的间距 - width: 200 - } - \endqml - 效果如下图所示: - \image images/SliderDashPattern.png - */ - -/*! - \qmlproperty bool org.deepin.dtk::Slider(FlowStyle)::highlightedPassedGroove - - \c highlightedPassedGroove 属性控制是否高亮滑块移动过的区域,默认情况下 highlightedPassedGroove - 为 false。 - - 效果如下所示: - \table - \header - \li highlightedPassedGroove - \li 效果 - \row - \li false - \li \image images/SliderNormalHor.png - \row - \li true - \li \image images/SliderHighlighted.png - \endtable - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/SliderTipItemDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/SliderTipItemDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/SliderTipItemDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/SliderTipItemDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/*! - \qmltype SliderTipItem - \inherits Control - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 被用于放置在 TipsSlider 控件中的滑块标签. - - SliderTipItem 是被用于放置在 TipsSlider 中的滑块标签控件。 SliderTipItem 可以添加特殊 - 的文本,用于指示滑动条的位置信息,文本可以是数字;特殊标签等等。 - - SliderTipItem 的使用方式如下: - \qml - TipsSlider { - id: sliderTickTip - readonly property var tips: [qsTr("Fast"), qsTr("Slow")] - width: 200 - tickDirection: TipsSlider.TickDirection.Back - slider.handleType: Slider.HandleType.ArrowBottom - - ticks: [ - SliderTipItem { - text: sliderTickTip.tips[0] - }, - SliderTipItem { - text: sliderTickTip.tips[1] - } - ] - } - \endqml - - \sa TipsSlider - */ - -/*! - \qmlproperty string org.deepin.dtk::SliderTipItem::text - - \c text 属性用于控制 SliderTipItem 当前显示的文本。 - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::SliderTipItem::textHorizontalAlignment - - \c textHorizontalAlignment 属性用于控制 SliderTipItem 文本水平布局,默认情况下为 水平居中(Text.AlignHCenter)。 - 可使用以下枚举: Text.AlignLeft, Text.AlignRight, Text.AlignHCenter - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::SliderTipItem::direction - \readonly - - \c direction 属性和其所属的 Slider 的 direction 属性保持一致。 - \sa Slider::direction - */ - -/*! - \qmlproperty bool org.deepin.dtk::SliderTipItem::horizontal - \readonly - - \c horizontal 属性和其所属的 Slider 的 horizontal 属性保持一致。 - \sa Slider::horizontal - */ - -/*! - \qmlproperty bool org.deepin.dtk::SliderTipItem::highlight - - \c highlight 属性控制 SliderTipItem 中背景是否需要高亮,默认情况下为 false。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::SliderTipItem::tickColor - - \c tickColor 属性控制 SliderTipItem 中控制滑块标签指示的颜色(一般用于连接文字和滑动条的水平 - 或竖直线条)。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::SliderTipItem::textColor - - \c textColor 属性控制 SliderTipItem 中文本颜色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/SortFilterModelDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/SortFilterModelDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/SortFilterModelDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/SortFilterModelDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -/*! - \qmltype SortFilterModel - \inherits DelegateModel - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种自带过滤和排序的 DelegateModel. - - SortFilterModel 提供自带过滤和排序的 DelegateModel,SortFilterModel 中的特定函数控制了 - 其中列表中每个项的显示和隐藏,通常和控件中的搜索功能绑定。 - - 一般的 SortFilterModel 用法如下: - \qml - Rectangle { - width: 200; height: 100 - - SortFilterModel { - id: visualModel - model: ListModel { - ListElement { name: "Apple" } - ListElement { name: "Orange" } - } - delegate: Rectangle { - height: 25 - width: 100 - Text { text: "Name: " + name} - } - } - - ListView { - anchors.fill: parent - model: visualModel - } - } - \endqml - - 上述示例不带任何排序和过滤,对上述代码修改可实现特定情况的过滤,例如下述代码过滤 type 1 类型的元素。 - \qml - Rectangle { - width: 200; height: 100 - - SortFilterModel { - id: visualModel - model: ListModel { - ListElement { type: 1; name: "Apple" } - ListElement { type: 2; name: "Orange" } - } - delegate: Rectangle { - height: 25 - width: 100 - Text { text: "Name: " + name} - } - - filterAcceptsItem: function(item) { - return item.type === 1 - } - } - - ListView { - anchors.fill: parent - model: visualModel - } - } - \endqml - - 对于多个 type == 1 的元素时,可以通过 lessThan 函数对过滤出的元素进行排序,如下代码: - \qml - Rectangle { - width: 200; height: 100 - - SortFilterModel { - id: visualModel - model: ListModel { - ListElement { type: 1; prior: 2; name: "Apple" } - ListElement { type: 2; prior: 1; name: "Coconut" } - ListElement { type: 2; prior: 1; name: "Orange" } - } - delegate: Rectangle { - height: 25 - width: 100 - Text { text: "Name: " + name} - } - - filterAcceptsItem: function(item) { - return item.type === 1 - } - - lessThan: function(item1, item2) { - return item1.prior < item2.prior - } - } - - ListView { - anchors.fill: parent - model: visualModel - } - } - \endqml - */ - -/*! - \qmlproperty var org.deepin.dtk::SortFilterModel::lessThan - - \c lessThan 函数用于排序。 - */ - -/*! - \qmlproperty var org.deepin.dtk::SortFilterModel::filterAcceptsItem - - \c filterAcceptsItem 函数用于进行视图项的过滤。 - */ - -/*! - \qmlproperty var org.deepin.dtk::SortFilterModel::visibleGroup - - \c visibleGroup 为当前可视的 DelegateModelGroup 。 - \sa DelegateModelGroup - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/SpinBoxDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/SpinBoxDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/SpinBoxDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/SpinBoxDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/*! - \qmltype SpinBox(FlowStyle) - \inherits SpinBox - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 SpinBox 控件. - - \l {SpinBox(FlowStyle)}{SpinBox} 控件一种行云设计风格的数字轮选框控件。 - \l {SpinBox(FlowStyle)}{SpinBox} 提供了视图组件和编辑组件 2 种,当处于 - 视图组件时, \l {SpinBox(FlowStyle)}{SpinBox}控件的轮选器变成平面的可视化 - 形状,当处于编辑组件时,\l {SpinBox(FlowStyle)}{SpinBox}将轮选器修改为类似 - 于按钮的形状。 - - 除此之外, \l {SpinBox(FlowStyle)}{SpinBox} 提供了水平带“+”,“-”符号的数字轮选框 - ,可查看 PlusMinusSpinBox 控件。 - - \l {SpinBox(FlowStyle)}{SpinBox} 的使用方式如下所示: - \qml - SpinBox { - from: 0 - to: 23 - value: 8 - } - \endqml - - \l {SpinBox(FlowStyle)}{SpinBox} 在视图组件下的效果如下图所示: - \image images/SpinBoxExample.png - \l {SpinBox(FlowStyle)}{SpinBox} 在编辑组件下的效果如下图所示: - \image images/SpinBoxEdit.png - */ - -/*! - \qmlproperty string org.deepin.dtk::SpinBox(FlowStyle)::alertText - - \c alertText 属性表示 \l {SpinBox(FlowStyle)}{SpinBox} 的警告文本。 - 默认情况下,不显示任何警告提示。 - - \l {SpinBox(FlowStyle)}{SpinBox} 显示警告的效果如下图所示: - \image images/SpinBoxAlert.png - */ - -/*! - \qmlproperty int org.deepin.dtk::SpinBox(FlowStyle)::alertDuration - - \c alertDuration 属性表示 \l {SpinBox(FlowStyle)}{SpinBox} 的警告时常, - 警告信息会在警告时常结束后自动隐藏,当 alertDuration 为 -1 或不设置时,警告信息 - 会根据 \c showAlert 属性进行显示和隐藏。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::SpinBox(FlowStyle)::showAlert - - \c showAlert 属性控制警告信息的显示和隐藏,当 \c showAlert 为 true 时, - 警告信息会在 \c alertDuration 结束后,\c showAlert 会自动置为 false。 - */ - diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/SwitchDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/SwitchDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/SwitchDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/SwitchDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/*! - \qmltype Switch(FlowStyle) - \inherits Switch - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 Switch 控件. - - \l {Switch(FlowStyle)}{Switch} 控件是一个用于切换的开关按钮,\l {Switch(FlowStyle)}{Switch} - 一般情况下不需要使用文本修饰,但它可以额外添加文本。 - - \l {Switch(FlowStyle)}{Switch} 控件使用 DciIcon 完成,具有丰富的阴影和动画效果。 - - \l {Switch(FlowStyle)}{Switch} 的效果如下图所示: - \image images/SwitchButton.png - - \l {Switch(FlowStyle)}{Switch} 的用法如下所示: - \qml - ColumnLayout { - Switch { - text: qsTr("Wi-Fi") - } - Switch { - text: qsTr("Bluetooth") - } - } - \endqml - */ - -/*! - \qmlproperty Palette org.deepin.dtk::Switch(FlowStyle)::backgroundColor - - \c backgroundColor 属性用于控制 \l {Switch(FlowStyle)}{Switch} 控件的背景颜色。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::Switch(FlowStyle)::handleColor - - \c handleColor 属性用于控制 \l {Switch(FlowStyle)}{Switch} 控件的滑块的颜色。 - 是 \l {Switch(FlowStyle)}{Switch} 在非 checked 状态下的颜色,如需修改 checked 状态下 - 颜色,请尝试修改 palette.highlight 调色板。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/TextFieldDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/TextFieldDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/TextFieldDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/TextFieldDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/*! - \qmltype TextField(FlowStyle) - \inherits TextField - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 TextField 控件. - - \l {TextField(FlowStyle)}{TextField} 是一个单行文本输入框。\l {TextField(FlowStyle)}{TextField} - 拓展了原生的 TextField 控件,增加了部分自定义属性用于提高拓展性。例如,适配了警告提示;调整了风格样式。 - 但 \l {TextField(FlowStyle)}{TextField} 和 LineEdit 相比, \l {TextField(FlowStyle)}{TextField} - 未添加文本清除按钮。 - - \l {TextField(FlowStyle)}{TextField} 的样式如下所示: - \table - \row - \li \image images/TextFieldNormal.png - \li Normal 状态 - \row - \li \image images/TextFieldFocus.png - \li Focus 状态 - \row - \li \image images/TextFieldDisabled.png - \li Disabled 状态 - \endtable - */ - -/*! - \qmlproperty Palette org.deepin.dtk::TextField(FlowStyle)::backgroundColor - - \c backgroundColor 属性控制 \l {TextField(FlowStyle)}{TextField} 的背景颜色。 - */ - -/*! - \qmlproperty string org.deepin.dtk::TextField(FlowStyle)::alertText - - \c backgroundColor 属性控制警告信息的文本。 - */ - -/*! - \qmlproperty int org.deepin.dtk::TextField(FlowStyle)::alertDuration - - \c alertDuration 属性控制警告信息的显示时常,默认情况下,不设置显示时常警告信息会 - 在 \c showAlert 属性为 false 时隐藏,设置后会在 \c alertDuration 结束后隐藏, - \c alertDuration 为 -1 时,表示一直显示。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::TextField(FlowStyle)::showAlert - - \c showAlert 属性控制警告信息是否显示, \c showAlert 为 true 时,警告信息 - 会在 \c alertDuration 结束后自动隐藏,\c showAlert 会跟随变为 false,否则 - 需要手动控制 \c showAlert 属性隐藏。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ThemeMenuDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ThemeMenuDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ThemeMenuDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ThemeMenuDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -/*! - \qmltype ThemeMenu - \inherits Menu(FlowStyle) - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供默认主题菜单. - - ThemeMenu 控件用于提供默认的主题菜单,自带亮色主题、暗色主题和系统主题三种主题菜单。 - 其效果如下图所示: - \image images/ThemeMenuExample.png - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/TipsSliderDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/TipsSliderDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/TipsSliderDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/TipsSliderDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -/*! - \qmltype TipsSlider - \inherits Control - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种带标签文本的滑动条控件. - - TipsSlider 是一种带标签文本的滑动条。根据使用场景不同,可以控制 - 标签的种类。 - - \section2 TipsSlider 添加默认空标签 - \qml - TipsSlider { - width: 200 - tickDirection: TipsSlider.TickDirection.Back - slider.highlightedPassedGroove: true - slider.handleType: Slider.HandleType.ArrowBottom - - ticks: [SliderTipItem { - }, - SliderTipItem { - }, - SliderTipItem { - }, - SliderTipItem { - }] - } - \endqml - - 效果如下图所示: - \image images/TipsSliderDefault.png - - \section2 TipsSlider 添加字符标签 - \qml - TipsSlider { - id: slider - readonly property var tips: [qsTr("1m"), qsTr("30m"), qsTr("Never")] - width: 180 - tickDirection: TipsSlider.TickDirection.Back - slider.handleType: Slider.HandleType.ArrowBottom - slider.stepSize: 10 - slider.from: 0 - slider.to: 20 - slider.value: 10 - - ticks: [ - SliderTipItem { - text: slider.tips[0] - textHorizontalAlignment: Text.AlignLeft - }, - SliderTipItem { - highlight: true - text: slider.tips[1] - }, - SliderTipItem { - text: slider.tips[2] - textHorizontalAlignment: Text.AlignRight - } - ] - } - \endqml - - 效果如下图所示: - \image images/TicksSllider_Highlight.png - - TipsSlider 同样适配不同方向,不同位置的标签,通过 tickDirection 和 slider.orientation - 属性控制。 - */ - -/*! - \qmlproperty Item org.deepin.dtk::TipsSlider::slider - - \c slider 属性获取 TipsSlider 的内部 Slider 控件。 - */ - -/*! - \qmlproperty list org.deepin.dtk::TipsSlider::ticks - - \c ticks 属性设置 TipsSlider 中的所有标签。 - */ - -/*! - \qmlproperty enumeration org.deepin.dtk::TipsSlider::tickDirection - - \c tickDirection 是 TipsSlider 提供标签方向属性的枚举。 - 目前提供了 TipsSlider.Front 和 TipsSlider.Back 两个枚举。 - Front 枚举代表标签在 TipsSlider 的前部,TipsSlider 水平方向时为上部,竖直方向时 - 为前部。 - Back 枚举代表标签在 TipsSlider 的后部,TipsSlider 水平方向时为下部,竖直方向时 - 为后部。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/TitleBarDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/TitleBarDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/TitleBarDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/TitleBarDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,251 +0,0 @@ -/*! - \qmltype TitleBar - \inherits Control - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种统一样式风格的标题栏控件. - - TitleBar 控件用于标准样式风格的 TitleBar 控件,与 DialogTitleBar - 不同, TitleBar 只被用于 ApplicationWindow 中的标题栏。通常情况下, - 标题栏适配 ApplicationWindow 的布局,需要放置在 header 属性中,例如 - 以下代码: - - \qml - import org.deepin.dtk 1.0 - - ApplicationWindow { - id: root - - flags: Qt.Window | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint - header: TitleBar {} - } - \endqml - - TitleBar 主要用于 DTK 中适配的无标题窗口,在去除系统标题栏后, DTK 应用需要 - 添加一个应用内的 TitleBar 控件,当作应用统一的标题栏。这在 UOS/Deepin 操作 - 系统中非常友好,例如以下代码: - - \qml - import org.deepin.dtk 1.0 - - ApplicationWindow { - id: root - - header: TitleBar {} - DWindow.enabled: true - DWindow.windowRadius: 16 - } - \endqml - - TitleBar 默认是最顶层控件,其他所有控件无法越过 TitleBar ,并且 TitleBar 中提供了 - 通用标题栏的默认布局,如应用图标,应用标题,菜单按钮,最大化最小化关闭按钮等等。TitleBar - 还支持添加额外的自定义内容,这取决于应用想要实现的样式,例如以下代码: - - 添加中心区域的代码如下: - \qml - import org.deepin.dtk 1.0 - - ApplicationWindow { - id: root - - header: TitleBar { - content: Item { - SearchEdit { - anchors.centerIn: parent - width: 300 - placeholder: "搜索" - } - } - } - DWindow.enabled: true - DWindow.windowRadius: 16 - } - \endqml - - 添加左侧区域的代码如下: - \qml - import org.deepin.dtk 1.0 - - ApplicationWindow { - id: root - - header: TitleBar { - leftContent: ActionButton { - icon.name: "window_sidebar" - } - } - DWindow.enabled: true - DWindow.windowRadius: 16 - } - \endqml - - Titlebar 适配的 ApplicationWindow 中的 flags 属性。 WindowMinMaxButtonsHint 属性 - 控制标题栏的最大化最小化按钮 WindowCloseButtonHint 属性控制关闭按钮;WindowTitleHint 属性 - 控制在标题文本属性;在xcb环境下,还能够通过修改 MotifDecoration 来控制窗口的标题,其中 DECOR_MINIMIZE - 表示最小化按钮, DECOR_MAXIMIZE 表示最大化按钮 DECOR_TITLE 表示窗口标题。 - */ - -/*! - \qmlproperty string org.deepin.dtk::TitleBar::title - - \c title 属性用于控制标题栏的标题文本 - */ - -/*! - \qmlproperty DciIcon org.deepin.dtk::TitleBar::icon - - \c icon 属性用于控制标题栏的图标, \c icon 的类型是 DciIcon,能同时 - 兼容 QtIcon 和 DciIcon。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::TitleBar::leftContent - - \c leftContent 属性用于添加标题左侧区域的组件,例如添加侧边栏按钮等等。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::TitleBar::content - - \c content 属性用于添加标题中心区域的组件,当存在多个组件时,可以使用 - 布局进行排列。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::TitleBar::menu - - \c menu 属性用于控制 Option 按钮的弹出菜单。默认情况下 TitleBar 会提供 - 一个默认的菜单,当需要自定义菜单时,菜单项需要进行手动调整。 - 例如以下代码: - \qml - import org.deepin.dtk 1.0 - - ApplicationWindow { - id: root - - ButtonGroup { - id: activeColorSelector - onCheckedButtonChanged: { - root.palette.highlight = checkedButton.color - } - } - - header: TitleBar { - menu: Menu { - Action { - text: "Light Theme" - } - Action { - text: "Dark Theme" - } - MenuItem { - contentItem: Item { - Row { - anchors.centerIn: parent - Repeater { - model: ["#d8316c", "#ff5d00", "#f8cb00", "#23c400", "#00a48a", "#0081ff", "#3c02d7", "#8c00d4"] - delegate: ColorButton { - color: modelData - Component.onCompleted: { - activeColorSelector.addButton(this) - } - } - } - } - } - } - } - DWindow.enabled: true - DWindow.windowRadius: 16 - } - \endqml - */ - -/*! - \qmlproperty bool org.deepin.dtk::TitleBar::menuDisabled - - \c menuDisabled 属性可以将 menu 属性设置禁用或者启用,默认情况下为 false。 - */ - -/*! - \qmlproperty Component org.deepin.dtk::TitleBar::aboutDialog - - \c aboutDialog 属性控制应用的关于对话框。其使用方式如下所示: - \qml - import org.deepin.dtk 1.0 - - ApplicationWindow { - id: root - DWindow.enabled: true - DWindow.windowRadius: 16 - - header: TitleBar { - aboutDialog: AboutDialog { - modality: Qt.NonModal - version: qsTr(String("Version: %1").arg(Qt.application.version)) - productName: qsTr(appProductName) - companyLogo: "file://" + DTK.deepinDistributionOrgLogo - websiteName: DTK.deepinWebsiteName - websiteLink: DTK.deepinWebsiteLink - license: appLicense === "" ? "" : qsTr(String("%1 is released under %2").arg(appProductName).arg(appLicense)) - } - } - } - \endqml - - \sa AboutDialog - */ - -/*! - \qmlproperty bool org.deepin.dtk::TitleBar::fullScreenButtonVisible - - \c fullScreenButtonVisible 属性控制 TitleBar 在全屏时按钮是否可见。默认情况下, - 该值是 true。 - */ - -/*! - \qmlsignal org.deepin.dtk::TitleBar::toggleWindowState() - - \c toggleWindowState 信号当窗口状态发生变化时触发。例如双击最大化等操作时。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::TitleBar::windowButtonGroup - - \c windowButtonGroup 是默认的窗口按钮组,包含最小化、最大化、关闭按钮。 - 默认情况下,该属性已经由 TitleBar 提供。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::TitleBar::autoHideOnFullscreen - - \c autoHideOnFullscreen 属性表示是否在全屏时自动关闭标题栏。默认情况下,该 - 值为 false。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::TitleBar::embedMode - - \c embedMode 属性表示是否属于嵌入模式,当 DWindow.enabled 属性为 - false 时, embedMode 为 true, 否则为 false。 嵌入模式下的标题栏 - 上的 WindowButtonGroup 上的按钮均有系统标题栏提供。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::TitleBar::separatorVisible - - \c separatorVisible 属性控制分隔符是否可见。默认情况下,该值为 true。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::TitleBar::enableInWindowBlendBlur - - \c enableInWindowBlendBlur 属性表示是否开启窗口内模糊,默认情况下为 false。 - \sa InWindowBlur - */ - -/*! - \qmlproperty Palette org.deepin.dtk::TitleBar::textColor - - \c textColor 属性控制文本和图标等颜色,即前景色相关颜色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/ToolButtonDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/ToolButtonDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/ToolButtonDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/ToolButtonDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/*! - \qmltype ToolButton(FlowStyle) - \inherits ToolButton - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种行云设计风格的 ToolButton 控件. - - \l {ToolButton(FlowStyle)}{ToolButton} 是一种工具型按钮,其经常被放置于 - ToolBar 这类工具栏中,\l {ToolButton(FlowStyle)}{ToolButton}支持图标和 - 文字的高级排列,也具备普通 Button 的所有特性。 - - 可以是普通的按钮,如下效果: - \image images/ToolButtonNormal.png - - 可以是复杂的文字和图标排列按钮,如下效果: - \image images/oolButtonIconLabel.png - - 它也能被放置于 FloatingPanel 或者 ButtonBox 中,如下效果: - \image images/ToolButtonFloatingPanel.png - - 其使用代码如下所示: - \qml - ButtonBox { - ToolButton { icon.name: "action_newfolder"; text: "文件夹";} - ToolButton { icon.name: "action_copy"; text: "复制" } - ToolButton { icon.name: "action_share"; text: "分享" } - ToolButton { icon.name: "action_compress"; text: "压缩" } - } - \endqml - */ - -/*! - \qmlproperty Palette org.deepin.dtk::ToolButton(FlowStyle)::textColor - - \c textColor 控制 \l {ToolButton(FlowStyle)}{ToolButton} 的前景颜色,如图标和 - 文本的颜色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/WarningButtonDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/WarningButtonDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/WarningButtonDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/WarningButtonDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -/*! - \qmltype WarningButton - \inherits Button(FlowStyle) - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种用于警告的按钮控件. - - WarningButton 是一个专门用于提示警告的按钮控件,其文本呈现出警告 - 的红色,用于出现警告提示的地方,效果如下所示: - \image images/WarningButtonExample.png - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/WaterProgressBarDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/WaterProgressBarDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/WaterProgressBarDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/WaterProgressBarDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/*! - \qmltype WaterProgressBar - \inherits Control - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供一种水波纹类型的进度条控件. - - WaterProgressBar 提供一种趣味的水波纹进度条控件。WaterProgressBar有 - 特殊的水波纹动画,能够将进度条的形式修改为水涨的效果。 - - 例如下述代码: - \image images/WaterProgressBar.gif - - WaterProgressBar 的使用方式如下所示: - \qml - WaterProgressBar { - NumberAnimation on value { - loops: Animation.Infinite - from: 0 - to: 100 - duration: 10000 - } - } - \endqml - */ - -/*! - \qmlproperty int org.deepin.dtk::WaterProgressBar::value - - \c value 属性表示 WaterProgressBar 进度值,其取值范围为[0, 100],请注意 - 不要超过该范围。当 \c value > 0 时 WaterProgressBar 开始水波动画。当 - \c value > 30 时 WaterProgressBar 开始气泡动画 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::WaterProgressBar::backgroundColor1 - - \c backgroundColor1 属性表示 WaterProgressBar 的第一背景颜色值。 WaterProgressBar - 的默认背景为渐变背景。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::WaterProgressBar::backgroundColor2 - - \c backgroundColor2 属性表示 WaterProgressBar 的第二背景颜色值。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::WaterProgressBar::dropShadowColor - - \c dropShadowColor 属性表示 WaterProgressBar 的阴影颜色值。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::WaterProgressBar::popBackgroundColor - - \c popBackgroundColor 属性表示 WaterProgressBar 的弹出气泡的背景颜色。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::WaterProgressBar::textColor - - \c textColor 属性表示 WaterProgressBar 的前景颜色,即文字的颜色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/WindowButtonDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/WindowButtonDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/WindowButtonDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/WindowButtonDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/*! - \qmltype WindowButton - \inherits Control - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 一种专门用于 TitleBar 上的窗口按钮. - - WindowButton 是专门用于 TitleBar 上窗口按钮,是 TitleBar 和 DialogTitleBar - 的通用窗口按钮,通常情况下 WindowButton 被添加到 WindowButtonGroup 中, - 包含最大化、最小化、关闭按钮。菜单按钮默认不添加到 WindowButtonGroup 中。 - - TitleBar 中默认就添加了上述窗口,因此 WindowButton 在需要自定义标题栏 - 按钮时才会被使用。 - - WindowButton 的默认样式如下所示: - \image images/WindowButton_normal.png - - WindowButton 的 Hovered 样式如下所示: - \image images/WindowButton_hovered.png - - WindowButton 的 Pressed 样式如下所示: - \image images/WindowButton_pressed.png - */ - -/*! - \qmlproperty DciIcon org.deepin.dtk::WindowButton::icon - - \c icon 属性控制 WindowButton 的图标。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::WindowButton::pressed - - \c pressed 属性表示 WindowButton 是否处于按下的状态。 - */ - -/*! - \qmlsignal org.deepin.dtk::WindowButton::clicked() - - \c clicked 信号当 WindowButton 点击后发送。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::WindowButton::textColor - - \c textColor 属性控制 WindowButton 的前景色颜色,包含图标和文本的颜色。 - */ - -/*! - \qmlproperty Palette org.deepin.dtk::WindowButton::backgroundColor - - \c textColor 属性控制 WindowButton 的背景色颜色。 - */ diff -Nru dtkdeclarative-5.6.3/doc/chinese/src/WindowButtonGroupDoc.qdoc dtkdeclarative-5.6.10/doc/chinese/src/WindowButtonGroupDoc.qdoc --- dtkdeclarative-5.6.3/doc/chinese/src/WindowButtonGroupDoc.qdoc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/chinese/src/WindowButtonGroupDoc.qdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/*! - \qmltype WindowButtonGroup - \inherits RowLayout - \inqmlmodule org.deepin.dtk - \ingroup QML_TYPES - \brief 提供用于放置在 Titlebar 中的窗口按钮组. - - WindowButtonGroup 被用于添加到 Titlebar 中作为 - 通用的窗口按钮组 - - 默认情况下, WindowButtonGroup 包含了 最大化按钮; - 最小化按钮;还原按钮;全屏按钮;退出全屏按钮;关闭按钮等等。 - - 如果需要添加新的按钮可以直接在 WindowButtonGroup 进行 - 添加,被添加的组件需要使用 Layout 进行布局排列。 - - 例如下述代码: - \qml - WindowButtonGroup { - WindowButton { - icon.name: "action_add" - } - } - \endqml - */ - -/*! - \qmlproperty Palette org.deepin.dtk::WindowButtonGroup::textColor - - \c textColor 属性控制组内所有 WindowButton 的前景色,如文本和图标的颜色。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::WindowButtonGroup::fullScreenButtonVisible - - \c fullScreenButtonVisible 属性控制是否在全屏下对按钮仍可见。默认为 true。 - */ - -/*! - \qmlproperty bool org.deepin.dtk::WindowButtonGroup::embedMode - - \c embedMode 属性控制是否处于嵌入模式下,嵌入模式下的按钮将按照系统标题栏 - 进行控制。默认该属性跟随是否启用 DWindow.enabled 开启。 - - \sa DWindow - */ diff -Nru dtkdeclarative-5.6.3/doc/doc.pro dtkdeclarative-5.6.10/doc/doc.pro --- dtkdeclarative-5.6.3/doc/doc.pro 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/doc.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -TEMPLATE = aux -QMAKE_DOCS = $$PWD/dtkdeclarative.qdocconf - -qtver.name = QT_VERSION -qtver.value = $$QT_VERSION -isEmpty(qtver.value): error("No version for documentation specified.") -qtmver.name = QT_VER -qtmver.value = $$replace(qtver.value, ^(\\d+\\.\\d+).*$, \\1) -qtvertag.name = QT_VERSION_TAG -qtvertag.value = $$replace(qtver.value, \.,) -qtdocs.name = QT_INSTALL_DOCS -qtdocs.value = $$[QT_INSTALL_DOCS/src] -builddir.name = BUILDDIR -builddir.value = $$OUT_PWD -QT_TOOL_ENV = qtver qtmver qtvertag qtdocs builddir -qtPrepareTool(QDOC, qdoc) -qtPrepareTool(QHELPGENERATOR, qhelpgenerator) -QT_TOOL_ENV = - -QMAKE_DOCS_BASE_OUTDIR = $$OUT_PWD -QMAKE_DOCS_TARGET = $$replace(QMAKE_DOCS, ^(.*/)?(.*)\\.qdocconf$, \\2) -isEmpty(QMAKE_DOCS_TARGETDIR): QMAKE_DOCS_TARGETDIR = $$QMAKE_DOCS_TARGET -QMAKE_DOCS_OUTPUTDIR = $$QMAKE_DOCS_BASE_OUTDIR/$$QMAKE_DOCS_TARGETDIR - -QDOC += -outputdir $$shell_quote($$QMAKE_DOCS_OUTPUTDIR) -DOC_INDEXES = -indexdir $$[QT_INSTALL_DOCS] - -doc_command = $$QDOC $$QMAKE_DOCS -generate_docs.commands += $$doc_command -generate $$DOC_INDEXES -qch_docs.commands = $$QHELPGENERATOR $$shell_quote($$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp) -o $$shell_quote($$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch) - -QMAKE_EXTRA_TARGETS += generate_docs qch_docs install_generate_docs install_qch_docs -docs.commands = $(MAKE) -f $(MAKEFILE) generate_docs && $(MAKE) -f $(MAKEFILE) qch_docs -QMAKE_EXTRA_TARGETS += docs - -#TODO: Make docs can automatically update the file of install -install_generate_docs.files = $$QMAKE_DOCS_OUTPUTDIR -install_generate_docs.path = $$[QT_INSTALL_DOCS] -install_generate_docs.CONFIG += directory no_build -install_generate_docs.depends = docs -INSTALLS += install_generate_docs - -install_qch_docs.files = $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch -install_qch_docs.path = $$[QT_INSTALL_DOCS] -install_qch_docs.CONFIG += no_build -install_qch_docs.depends = docs -INSTALLS += install_qch_docs - -OTHER_FILES += \ - $$files($$PWD/chinese/src/*.qdoc) \ - $$files($$PWD/chinese/src/navigation/*.qdoc) \ diff -Nru dtkdeclarative-5.6.3/doc/dtkdeclarative.qdocconf dtkdeclarative-5.6.10/doc/dtkdeclarative.qdocconf --- dtkdeclarative-5.6.3/doc/dtkdeclarative.qdocconf 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/doc/dtkdeclarative.qdocconf 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) - -project = DtkDeclarative -description = Dtk QML Reference Documentation -version = 1.0.0 - -outputformats = HTML - -qhp.projects = dtkdeclarative - -qhp.dtkdeclarative.file = dtkdeclarative.qhp -qhp.dtkdeclarative.namespace = org.dtk.deepin.dtkdeclarative.$QT_VERSION_TAG -qhp.dtkdeclarative.virtualFolder = dtkdeclarative -qhp.dtkdeclarative.indexTitle = Dtk Declarative Documentation -qhp.dtkdeclarative.indexRoot = - -qhp.dtkdeclarative.filterAttributes = dtkdeclarative $QT_VERSION qtrefdoc -qhp.dtkdeclarative.customFilters.Qt.name = DtkDeclarative $QT_VERSION -qhp.dtkdeclarative.customFilters.Qt.filterAttributes = dtkdeclarative $QT_VERSION - -qhp.dtkdeclarative.subprojects = qmltypes -qhp.dtkdeclarative.subprojects.qmltypes.title = QML Types -qhp.dtkdeclarative.subprojects.qmltypes.indexTitle = QML Types -qhp.dtkdeclarative.subprojects.qmltypes.selectors = qmlclass -qhp.dtkdeclarative.subprojects.qmltypes.sortPages = true - -depends = qtcore qtgui qtqml qtquick qtquickcontrols qtlabscalendar qtlabsplatform - -headerdirs += chinese \ - -sourcedirs += \ - chinese \ - chinese/src \ - chinese/src/navigation - -exampledirs += \ - chinese - -imagedirs += chinese \ - -navigation.landingpage = "DtkDeclarative Reference Documentation" -navigation.qmltypespage = "Dtk Declarative QML Types" diff -Nru dtkdeclarative-5.6.3/docs/CMakeLists.txt dtkdeclarative-5.6.10/docs/CMakeLists.txt --- dtkdeclarative-5.6.3/docs/CMakeLists.txt 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -2,12 +2,14 @@ find_package (Doxygen REQUIRED) -set (QCH_INSTALL_DESTINATION ${CMAKE_INSTALLL_PREFIX}/share/DDE/dtk CACHE STRING "QCH install location") +set (QCH_INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/qt5/doc CACHE STRING "QCH install location") -set (DOXYGEN_GENERATE_HTML "NO" CACHE STRING "Doxygen HTML output") -set (DOXYGEN_GENERATE_XML "NO" CACHE STRING "Doxygen XML output") +set (DOXYGEN_GENERATE_HTML "YES" CACHE STRING "Doxygen HTML output") +set (DOXYGEN_GENERATE_XML "YES" CACHE STRING "Doxygen XML output") set (DOXYGEN_GENERATE_QHP "YES" CACHE STRING "Doxygen QHP output") -set (DOXYGEN_FILE_PATTERNS *.cpp *.h *.zh_CN.md *.zh_CN.dox CACHE STRING "Doxygen File Patterns") +set (DOXYGEN_FILTER_PATTERNS *.qml=doxyqml CACHE STRING "Extra filter patterns") +set (DOXYGEN_FILE_PATTERNS *.cpp *.h *.zh_CN.md *.zh_CN.dox *.qml CACHE STRING "Doxygen File Patterns") +set (DOXYGEN_EXTENSION_MAPPING qml=C++ CACHE STRING "Extra extension mapping") set (DOXYGEN_PROJECT_NUMBER ${CMAKE_PROJECT_VERSION} CACHE STRING "") # Should be the same as this project is using. set (DOXYGEN_EXTRACT_STATIC YES) set (DOXYGEN_OUTPUT_LANGUAGE "Chinese" CACHE STRING "Doxygen Output Language") @@ -18,20 +20,22 @@ set (DOXYGEN_QHP_VIRTUAL_FOLDER "dtkdeclarative") set (DOXYGEN_HTML_EXTRA_STYLESHEET "" CACHE STRING "Doxygen custom stylesheet for HTML output") set (DOXYGEN_TAGFILES "qtcore.tags=qthelp://org.qt-project.qtcore/qtcore/" CACHE STRING "Doxygen tag files") +set (DOXYGEM_ALIASES "signal=@typedef") +set (DOXYGEN_EXAMPLE_PATH ${CMAKE_CURRENT_LIST_DIR}/snippets/) set (DOXYGEN_PREDEFINED "D_DECL_DEPRECATED_X(x)=" - "\"DCORE_BEGIN_NAMESPACE=namespace Dtk { namespace Core {\"" - "\"DCORE_END_NAMESPACE=}}\"" - "\"DCORE_USE_NAMESPACE=using namespace Dtk::Core\;\"" - "\"DQUICK_BEGIN_NAMESPACE=namespace Dtk { namespace Quick {\"" - "\"DQUICK_END_NAMESPACE=}}\"" - "\"DQUICK_USE_NAMESPACE=using namespace Dtk::Quick\;\"" + "DCORE_BEGIN_NAMESPACE=namespace Dtk { namespace Core {" + "DCORE_END_NAMESPACE=}}" + "DCORE_USE_NAMESPACE=using namespace Dtk::Core;" + "DQUICK_BEGIN_NAMESPACE=namespace Dtk { namespace Quick {" + "DQUICK_END_NAMESPACE=}}" + "DQUICK_USE_NAMESPACE=using namespace Dtk::Quick\;" ) set (DOXYGEN_MACRO_EXPANSION "YES") set (DOXYGEN_EXPAND_ONLY_PREDEF "YES") -doxygen_add_docs (doxygen +doxygen_add_docs(doxygen ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/docs ALL @@ -39,4 +43,4 @@ COMMENT "Generate documentation via Doxygen" ) -install (FILES ${PROJECT_BINARY_DIR}/docs/html/dtkdeclarative.qch DESTINATION ${QCH_INSTALL_DESTINATION}) +install(FILES ${PROJECT_BINARY_DIR}/docs/html/dtkdeclarative.qch DESTINATION ${QCH_INSTALL_DESTINATION}) diff -Nru dtkdeclarative-5.6.3/docs/DevSpecification.zh_CN.md dtkdeclarative-5.6.10/docs/DevSpecification.zh_CN.md --- dtkdeclarative-5.6.3/docs/DevSpecification.zh_CN.md 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/DevSpecification.zh_CN.md 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,1110 @@ +@page DevSpecification 开发规范 + +# 开发规范 + +## 字体绑定 + +为了能够保持和dtkwidget字体属性保持一致的相关接口,能够更方便的通过QML结构和属性绑定原理进行实现,dtkdeclarative中提供了一种便捷的绑定方式如下代码所示,当字体被修改时,所有使用到此字体的控件都会发生改变。 + +```qml +import org.deepin.dtk 1.0 +Text { + font: DTK.fontManager.t6 +} +``` + +与 dtkwidget不同的是,这种字体绑定属性需要处理的代码量更少,阅读性较高。以下代码是 dtkwidget 进行字体绑定的操作: + +```cpp +QWidget widget; +DFontSizeManager::instance()->bind(&widget, DFontSizeManager::T1); +``` + +目前dtkdeclarative中提供的一些标准控件都已经添加了默认的字体属性绑定,如ApplicationWindow控件其字体默认绑定为 t6 号。当需要修改字体大小或者添加自定义控件的字体属性时,则手动绑定指定字号即可。 + +## 应用图标 + +DCI图标是dtkdeclarative设计实现的一种新的图标格式,设计该格式主要为了解决QIcon在显示中的局限性,解决图标模式单一、种类繁多以及拓展性不强的问题。DCI图标相关文档在dtkcore和dtkgui也存在。 + +DCI图标文件整合了控件的各个状态、缩放比以及图标大小为一体,在控件的对应状态,程序的对应缩放比下自动选择合适的图标进行显示。另外,DCI图标能够跟随控件的调色板信息进行颜色调整,因此当前的DCI图标控件并非仅仅作为图标进行显示,更能够作为控件以及组合控件用于界面。例如,当前实现的控件中,Switch控件中的开关样式,Slider控件中的滑块样式等等。 + +DCI图标也拥有一些隐藏特性,如某些DCI图标存在一个图标边距值(具体内容需要参见设计文档)的属性,这个间距值隐藏在图标内部外部无需关心,但需要了解的是,当图标存在阴影效果时,该边距值就会体现在图标大小不包含阴影上,换句话说,拥有阴影的图标,其阴影不包含在组件的大小中。 + +图标控件的图标跟随其状态切换,当控件状态或系统主题发生改变时,图标控件会根据设定参数重新绘制指定的图标,由DCI相关类型进行统一查找、解析、绘制。文件大小、图标种类、缩放比、颜色调整、图标状态及图标叠加等等数据归档到了DCI文件内部。 + +![DCI图标介绍](images/DS0.png) + +### DCI图标需要手动设置的属性 + +1. sourceSize + + 需要手动指定DCI图标控件的大小,该大小等价于最后显示在应用中的大小。当设计给出的图标中不包含相对应的大小时,DCI图标在绘制时会进行自适应缩放,以保证与此大小一致, + +2. name + + 需要指定的图标名称,该名称在图标主题规范下定义,默认优先从系统图标主题中寻找,其次在资源文件中寻找,最后在默认的Fallback路径下寻找。一些系统也有的图标文件放置在“/usr/share/dsg/icons”目录下。应用资源文件的图标主题目录分为两种,带主题的图标文件和内嵌图标文件,区别在于带主题的图标文件在不同的图标主题下图标文件不同,而内嵌图标文件对图标主题不敏感,是最终的搜索路径。更多的图标主题细节可以在**图标主题规范**的相关文档中寻找。 + + **因此,应用程序的图标目录需要严格遵循图标主题规范进行放置,否则DciIcon控件将无法正确找到图标文件** + +3. mode + + mode对应于控件的当前状态,对于Control控件,其状态包含 “Normal”,"Hovered","Pressed","Disabled"四种,如果图标在多种状态下显示的效果不同,该图标需要指定对应的mode来区分当前需要显示状态。由于颜色选择器(ColorSelector)会记录控件的状态,因此如果该控件有颜色选择器,可以通过将颜色选择器的控件状态指定给DciIcon控件,这是一种简便方式;如果控件无法指定颜色选择器,则只能手动进行控件状态的属性绑定。对于颜色选择器的内容,颜色控制中将详细描述。 + +4. palette + + palette为DciIcon的专有调色板,与Qt调色板不同的是该调色板目前仅有四种类型,Foreground(前景色)、Background(背景色)、HighlightForeground(高亮前景色)和Highlight(高亮色)。其分别对应与Qt调色板中的WindowText、Window、HighlightedText以及Highlight。由于其一致性,DTK的专有接口中可以直接将这两种调色板类型进行转换,具体函数为 `DTK.makeIconPalette()`。 + + 调色板的主要用途在于:一些场景中某些图标需要在特定情况下发生颜色变化,例如标题栏中的最大化、最小化、关闭按钮以及列表项视图中的图标跟随选中状态进行颜色变化等等。 + 一个图标不仅仅只包含一个调色板,可能需要多个调色板数据,当某一调色板数据未获取到时,图标中的某一图层或整个图标(若图标只有一个图层或各个图层调色板颜色一致)将不会发生颜色变化。 + 对应的调色板具体颜色值与设计师所提供的颜色值保持一致,并非一定和控件调色板一一对应,如果仅需要指定某一调色板颜色也可手动指定,例如:`palette.foreground: "red"` 或 `palette.background: control.palette.window`。 + + dci图标能够根据不同系统主题(深浅主题)选择不同的图标文件,该属性的设置是可选的,如需手动指定其特殊主题显示,则可进行单独设置。 + + 4.1 例如下 DciIcon 控件示例: + + ```qml + Control { + id: control + DciIcon { + sourceSize.width: 32 //对应大小的图标 + sourceSize.height: 32 + name: "window_menu" // 图标名称 + mode: control.ColorSelector.controlState //对应状态下的图标 + palette: DTK.makeIconPalette(control.palette) //调整图标颜色,Qt调色板转为dci调色板 + theme: DTK.themeType //对应主题下的主题 + } + } + ``` + +
+
注解
+
图标控件主要是对.dci文件进行查找、参数解析和组合绘制,本身没有做过多的特例化。

+
图标未达到所需的效果,可能是控件属性设置错误,也可能是原始的dci图标本身就达不到所需效果。

+
绘制的图标为正方形,即宽高相等。

+
+ +### DciIcon的附加属性 + +dtkdeclarative中几乎所有的控件都已经适配了dciicon,例如:Button, MenuItem以及各种自定义控件。但某些控件由于被qtquick-controls2定义了QIcon的相关接口,因此对于这类控件,可以使用DciIcon的附加属性来设置除QIcon外包含的信息。例如以下示例,由于Button的默认icon接口是Qicon类别,对于DDciIcon的相关属性可以通过以下方式设置: + +```qml +Button { + icon.name: "window_menu" + icon.width: 36 + icon.height: 36 + DciIcon.mode: DTK.ControlState.HoveredState + DciIcon.palette { + foreground: "red" + background: "green" + highlightForeground: "white" + highlight: "black" + } +} +``` + +### Dtkdeclarative 中默认的 Dci 图标 + +下述图标只列列举标准状态,即无调色板时的默认状态。仅提供形状,不代表实际场景效果。 + +| 图标名称 | 效果 | +|:-----------------------:|:------------------------:| +| action_add | ![图片](images/DS1.png) | +| action_compress | ![图片](images/DS2.png) | +| action_copy | ![图片](images/DS3.png) | +| action_cut | ![图片](images/DS4.png) | +| action_decompress | ![图片](images/DS5.png) | +| action_delete | ![图片](images/DS6.png) | +| action_edit | ![图片](images/DS7.png) | +| action_newfolder | ![图片](images/DS8.png) | +| action_open | ![图片](images/DS9.png) | +| action_paste | ![图片](images/DS10.png) | +| action_power | ![图片](images/DS11.png) | +| action_redo | ![图片](images/DS12.png) | +| action_reduce | ![图片](images/DS13.png) | +| action_reset | ![图片](images/DS14.png) | +| action_search | ![图片](images/DS15.png) | +| action_selectall | ![图片](images/DS16.png) | +| action_setting | ![图片](images/DS17.png) | +| action_share | ![图片](images/DS18.png) | +| arrow_ordinary_down | ![图片](images/DS19.png) | +| arrow_ordinary_left | | +| arrow_ordinary_right | | +| arrow_ordinary_up | | +| entry_clear | ![图片](images/DS20.png) | +| entry_loadfile | ![图片](images/DS21.png) | +| entry_option_arrow_down | ![图片](images/DS22.png) | +| entry_password_hide | ![图片](images/DS23.png) | +| entry_voice | ![图片](images/DS24.png) | +| list_add | ![图片](images/DS25.png) | +| list_delete | ![图片](images/DS26.png) | +| menu_arrow | ![图片](images/DS27.png) | +| menu_select | ![图片](images/DS28.png) | +| window_close | ![图片](images/DS29.png) | +| window_maximize | ![图片](images/DS30.png) | +| window_menu | ![图片](images/DS31.png) | +| window_minimize | ![图片](images/DS32.png) | +| window_quit_full | ![图片](images/DS33.png) | +| window_restore | ![图片](images/DS34.png) | +| window_sidebar | ![图片](images/DS35.png) | + +## 颜色控制 + +![颜色控制器架构图](images/DS36.png) + +颜色控制器(颜色选择器、ColorSelector)是dtkdeclarative项目中专门用于替代QPalette而实现的一套取色系统。该系统能够根据控件状态自由选择颜色,但其又并非完全摒弃QPalette,某些调色板信息仍可以在dtkdeclarative中进行使用,如高亮色以及高亮前景色。dtkdeclarative推荐使用ColorSelector进行颜色绑定,其优点将会在下述描述中列出。 + +对于QPalette,其缺点在于颜色类型过于单调,调色板颜色数据仅仅只有一套,当出现控件有多个状态时,如果颜色差异较大,只能选择用不同的颜色类型进行替代。这样的编码方式在qml中显得冗杂且局限。为了能够更方便的使用 Qml 的属性绑定特性,创建每个控件独有的颜色调色板,然后根据每个控件的状态选择其调色板数据中对应状态的颜色作用在控件上。颜色控制器的大致实现原理就是如此。 + +颜色控制系统可以分为三个层次:调色板、控件属性和取色器。取色器作为监听者,能够监听这二者的变化,除此之外,取色器会根据当前绑定的控件状态、控件对象等等信息自动更改颜色。下面给出一个简单的示例代码: + +```qml +Control { + id: control + width: 500 + height: 50 + + property Palette backgroundColor: Palette { + normal: "black" + } + property Palette textColor: Palette { + normal: "white" + } + + contentItem: Text { + text: "Test......." + color: control.ColorSelector.textColor + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + } + + background: Rectangle { + width: 250 + height: 50 + color: control.ColorSelector.backgroundColor + } +} +``` + +
+
注解
+
当控件类型继承于 Control 或者控件存在调色板数据时,该控件的ColorSelector 附加属性才会被创建。

+
如果当前控件非继承于Control类型,且具备创建ColorSelector的条件,该ColorSelector将寻找其最上层父类的Control控件,并进行调色板和控件状态的更新绑定。

+
ColorSelector仅会监听当前控件和离它最近的父类Control控件的调色板属性。其中间父类不论是否存在ColorSelector对象,都不会读取和绑定。
+
+ +### Palette + +DTK设计实现的调色板数据类,它作为ColorSelector进行颜色选择的载体,通常情况下具有“Normal”,“Hovered”,“Pressed”以及“Disabled”四种类别,与控件的这四种类型一一对应。例如一下代码: + +```qml +Palette { + id: palette + normal: "red" + hovered: "green" + pressed: "blue" + disabled: "black" +} +``` + +如果开发某一控件仅具备某一种或多种状态,不存在的状态颜色值可以不必指定。相反,如果控件具备某种状态,但该种状态的颜色值并未指定,则ColorSelector将使用“Normal”状态下的颜色来替代。 + * 暗色主题 +调色板类型区分了暗色主题下的情况。相对于一般情况,暗色主题在各个状态中添加了“Dark”关键字,例如 “normalDark”、“hoveredDark”、“pressedDark”以及“diabledDark”等。例如以下代码: + +```qml +Palette { + id: palette + normal: "red" + normalDark: "black" + hovered: "green" + hoveredDark: "yellow" +} +``` + +* 是否可用(enabled) + + 默认情况下,该属性为启用状态,当该属性设置为false时,取色器将忽略该属性再向上进行查找。例如一下代码: + + ```qml + Palette { + id: palette + normal: "red" + enabled: false + } + ``` + +* 颜色族(family) + + 调色板具备颜色族的属性,目前可供使用的颜色族有两种:“Common”和“Crystal”。调色板默认的颜色族为“Common”,即当调色板未指定颜色族时其默认的颜色族就是“Common”,例如上述示例代码。同样的,可以通过指定不同颜色族来指定其独立的颜色属性,例如以下代码: + + ```qml + Palette { + normal { + common: "#f0f0f0" + crystal: Qt.rgba(0.20, 0.2, 0.2, 0.1) + } + hovered: "#d2d2d2" // common family + pressed.crystal: "#cdd6e0" // crystal family + } + ``` + + 颜色族的属性可以在ColorSelector中进行切换并在控件颜色变化中进行展示,当一个控件的窗口背景(这里指其所在的窗口而非应用窗口)在如下场景中,且其调色板颜色都为同一颜色时,这个控件才可以只提供 "common" 颜色族,否则这两种颜色族的颜色都应该被正确指定。 + + 1. 窗口背景是纯色背景 + 2. 窗口背景是一个图片 + 3. 窗口背景是透明模糊背景 + + 当控件被指定了两种颜色族时,ColorSelector 会根据其所在的 Control 父控件所使用的颜色族,使用适合当前场景的颜色。 + + 如可通过如下代码手动修改控件的当前颜色族: + + ```qml + Button { + ColorSelector.family: Palette.CrystalColor + text: "Button" + } + ``` + + 目前在 dtkclarative 提供的控件中,当控件处于 DialogWindow 中时,自动会使用其 CrystalColor 颜色族,而在 ApplicationWindow 中时,其颜色族为 CommonColor。 + +* QPalette适配 + + 上述介绍到调色板能够适配高亮色(Highlight)以及高亮文本色(HighlightText)的调色板信息,目前dtkdeclarative适配的只有这两种类型。对于这种类型的使用方式如下示例代码: + + ```c++ + Palette { + normal: DTK.makeColor(Color.Highlight) + hovered: DTK.makeColor(Color.Highlight).lightness(+10) + pressed: DTK.makeColor(Color.Highlight).opacity(-10) + } + ``` + + 调色板类型在创建颜色时,能够进行颜色微调。由于目前的使用场景中,仅在亮度(lightness)和不透明度(opacity)的调整居多,因此颜色值中只保留了对这两个颜色属性的调整。该颜色调整取值范围为[-100, +100],每调整10个单位数值就等于调整10%的对应属性。 + +### QPalette + +QPalette 在 QML 中的角色是一系列不同颜色类型的集合,如背景色、前景色、高亮色以及高亮文本色等等。和 QWidget 中的 QPalette 不同的是,它没有 QPalette 表示不同状态时的颜色,其配色方案只有一套,如需修改就必须手动调整该调色板的值。当控件使用的颜色不会跟随控件的状态发生较多的变化,或控件使用的颜色是一种通用情况下的颜色(与具体控件无关)时,可以直接使用 QPalette 对应的颜色角色,下表列出 QPalette 能够使用的颜色角色: + +| **角色名** | **描述** | +| :------------ | :------------------- | +| window | 通用的背景色 | +| windowText | 通用的前景色 | +| highlight | 高亮色 | +| highlightText | 高亮背景下的文本颜色 | + +除此之外,**其他调色板颜色在 dtkdeclarative 开发中不宜出现**,当自定义控件时需要出现与控件相绑定的特殊颜色时,请使用 ColorSelector 。 + +### ColorSelector + +#### ColorSelector 跟随颜色变化 + + 上述简述简单提及了颜色控制器的简单用法,下面描述一下颜色控制器跟随颜色变化的使用场景和高级用法。 + +1. 颜色控制器能根据控件状态发生颜色变化 + + ```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 50 + height: 50 + hoverEnabled: true // 开启 Hover 属性 + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + + Rectangle { + anchors.fill: parent + color: control.ColorSelector.backgroundColor + } + } + ``` + + 上述代码描述了Control控件在hovered状态下颜色从“red”向“green”自动变化的过程。值得注意的是,对于其子类Rectangle而言,由于没有独立的Palette属性,因此无法直接使用其ColorSelector附加属性,只能获取其Control父类的ColorSelector对象进行使用。如果上述代码成为以下形式,则可以使用自身的ColorSelector对象: + + ```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 50 + height: 50 + hoverEnabled: true // 开启 Hover 属性 + + Rectangle { + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + anchors.fill: parent + color: ColorSelector.backgroundColor + } + } + ``` + +2. 手动调整调色板的颜色值,控件颜色会跟随变化 + + 将上述示例修改为如下形式,可以看出:手动修改调色板颜色值,ColorSelecor能够跟随更新。 + + ```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 50 + height: 50 + hoverEnabled: true // 开启 Hover 属性 + + Rectangle { + id: rect + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + anchors.fill: parent + color: ColorSelector.backgroundColor + + MouseArea { + anchors.fill: parent + onClicked: { // 鼠标单击改变颜色 + rect.backgroundColor.hovered = "yellow" + } + } + } + } + ``` + + ColorSelector能够支持调色板属性在重新赋值时的颜色更新,上述示例修改后的代码如下: + + ```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 50 + height: 50 + hoverEnabled: true // 开启 Hover 属性 + + Rectangle { + id: rect + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + anchors.fill: parent + color: ColorSelector.backgroundColor + + MouseArea { + Palette { + id: otherPalette + normal: "black" + hovered: "gray" + } + anchors.fill: parent + onClicked: { // 鼠标单击改变颜色 + rect.backgroundColor = otherPalette + } + } + } + } + ``` + +3. 修改ColorSelector的颜色属性,控件颜色跟随修改 + 不光针对属性的修改能够生效,当直接修改ColorSelector对应的颜色属性时,同样能够更新所有使用到该颜色属性的控件,上述代码可以修改为如下形式: + + ```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 50 + height: 50 + hoverEnabled: true // 开启 Hover 属性 + + Rectangle { + id: rect + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + anchors.fill: parent + color: ColorSelector.backgroundColor + + MouseArea { + anchors.fill: parent + onClicked: { // 鼠标单击改变调色板 + Palette { + id: otherOPalette + normal: "black" + hovered: "gray" + } + rect.ColorSelector.backgroundColor = otherPalette + } + } + } + } + ``` + + 使用ColorSelector修改调色板属性时,一般都能进行复原,常规做法是赋值为 “undefined”,例如以下代码: + + ```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 50 + height: 50 + hoverEnabled: true // 开启 Hover 属性 + + Rectangle { + id: rect + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + anchors.fill: parent + color: ColorSelector.backgroundColor + + MouseArea { + anchors.fill: parent + onClicked: { // 单击修改调色板 + Palette { + id: otherPalette + normal: "black" + hovered: "gray" + } + rect.ColorSelector.backgroundColor = otherPalette + } + onDoubleClicked: { // 双击恢复为默认值 + rect.ColorSelector.backgroundColor = undefined + } + } + } + } + ``` + +4. 子控件能通过其自身的ColorSelector获取到Control控件的调色板颜色 + + 上述描述中已经提及,ColorSelector属性能够获取其自身对象以及其最近的Control控件的调色板属性,并监听Control控件的状态变化,进行颜色属性的自动更新。以下示例展示了控件获取Control控件的调色板代码: + + ```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 200 + height: 200 + hoverEnabled: true // 开启 Hover 属性 + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + + background: Rectangle { + property Palette borderColor: Palette { + normal: "blue" + hovered: "yellow" + } + color: ColorSelector.backgroundColor // 继承Control类中的backgroundColor调色板属性 + border.width: 2 + border.color: ColorSelector.borderColor // 获取自身的borderColor调色板属性 + } + } + ``` + +5. 控件父类发生变化后,ColorSelector绑定的颜色属性同样自动发生变化 + + 由于ColorSelector的状态变化根据其父类Control控件,并且能获取到对应控件的Palette调色板数据,因此当Control父类控件发生变化时,控件的Palette属性也会发生。ColorSelector会自动检测这种变化并作用到正在显示的颜色属性中,如果ColorSelector发现改变后的父类仍保存相同名称的颜色调色板,ColorSelector的颜色属性会自动变化成该颜色,当发现改变后的父类没有相同名称的颜色调色板,ColorSelector会将颜色置空(即变成黑色),例如以下示例代码。 + + ```qml + import org.deepin.dtk 1.0 + + Rectangle { + // 父类矩形中包含两个子类Control控件 +     width: 500 +     height: 50 + +     Control { + // Control控件中包含Rectangle子控件,演示父类转换 +         id: control1 +         width: 220 +         height: 50 +         anchors.left: parent.left +         anchors.top: parent.top + // Control控件的背景色调色板属性被应用到矩形子控件的颜色中 +         property Palette backgroundColor: Palette { +             normal: "gray" +         } + +         Rectangle { +             property Palette borderColor: Palette { +                 normal: "red" +             } +             id: reparentRect1 +             width: 50 +             height: 50 +             color: ColorSelector.backgroundColor +             border.width: 2 +             border.color: ColorSelector.borderColor + +             MouseArea { +                 anchors.fill: parent +                 onClicked: { // 点击切换reparentRect1的父类 +                     if (reparentRect1.parent == control1) +                         reparentRect1.state = "reparent2" +                     else +                         reparentRect1.state = "reparent1" +                 } +             } + + // 父类发生改变时,ColorSelector自动检测到父类Control的变化调整背景色颜色值 +             states: [ // 使用状态属性添加添加父类转换的两种不同属性 +                 State { +                     name: "reparent1" +                     ParentChange { +                         target: reparentRect1 +                         parent: control1 +                         x: 0 +                         y: 0 +                     } +                 }, +                 State { +                     name: "reparent2" +                     ParentChange { +                         target: reparentRect1 +                         parent: control2 +                         x: 60 +                         y: 0 +                     } +                 } +             ] +         } +     } + +     Control { +         id: control2 +         width: 220 +         height: 50 +         anchors.left: control1.right +         anchors.leftMargin: 10 +         anchors.top: parent.top + + // ColorSelector会在父类Control变化后自动检测backgroundColor的颜色值 +         property Palette backgroundColor: Palette { + // 该颜色和Control1控件不同进行颜色区分 +             normal: "red" +         } + +         Rectangle { + // 自身存在调色板属性其自身才会创建ColorSelector对象,并寻找Control父类的变化 +             property Palette borderColor: Palette { +                 normal: "gray" +             } +             id: reparentRect2 +             width: 50 +             height: 50 +             color: ColorSelector.backgroundColor +             border.width: 2 +             border.color: ColorSelector.borderColor + +             MouseArea { +                 anchors.fill: parent +                 onClicked: { // 点击切换reparentRect2的父类 +                     if (reparentRect2.parent == control1) +                         reparentRect2.state = "reparent2" +                     else +                         reparentRect2.state = "reparent1" +                 } +             } + +             states: [ +                 State { +                     name: "reparent1" +                     ParentChange { +                         target: reparentRect2 +                         parent: control1 +                         x: 60 +                         y: 0 +                     } +                 }, +                 State { +                     name: "reparent2" +                     ParentChange { +                         target: reparentRect2 +                         parent: control2 +                         x: 0 +                         y: 0 +                     } +                 } +             ] +         } +     } + } + ``` + +6. 已封装好的控件不推荐创建相同调色板属性,而推荐直接进行颜色覆盖 + + 当使用ColorSelector封装好某一自定义控件时,外部无需创建和控件内封装一致的调色板属性,当需要自定义的颜色替换时可直接进行属性替换。例如以下代码: + + 创建 TestControl.qml 文件并写入以下代码: + + ```qml + import org.deepin.dtk 1.0 + + Control { + id: control + hoverEnabled: true // 开启 Hover 属性 + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + + background: Rectangle { + property Palette borderColor: Palette { + normal: "blue" + hovered: "yellow" + } + + id: rect + color: ColorSelector.backgroundColor + border.width: 2 + border.color: ColorSelector.borderColor + } + } + ``` + + 在新的测试文件中使用这个封装好的自定义控件: + + ```qml + Row { + width: 200 + height: 100 + + TestControl { + width: 50 + height: 50 + + // Correctly + backgroundColor: Palette { + normal: "cyan" + hovered: "magenta" + } + } + + TestControl { + width: 50 + height: 50 + + // Wrongful 这种方式将无法进行属性替换 + property Palette backgroundColor: Palette { + normal: "gray" + hovered: "black" + } + } + } + ``` + +上述代码的场景应用于某个控件在不同情况下可能有颜色属性不一致的情况,对于已有的调色板属性可以直接进行属性替换,其内部的ColorSelector对象会检测到该种变化并处理。 + +#### ColorSelector 状态设置 + + ColorSelector 可以进行控件单一状态(hovered、pressed、disabled、inactived)的设置。默认情况下,各个状态都是处于未设置的状态,即不针对某一状态进行单独处理而默认接受所有状态的改变。 + +1. 将控件的某一状态作为标准状态 + + 例如当有将控件的“hovered”作为其显示的标准状态时,可以将代码写成如下形式: + + ```qml + Rectangle { + width: 200 + height: 300 + + Button { + anchors.centerIn: parent + text: "Hovered state" + ColorSelector.hovered: true + } + } + ``` + +2. 控件禁用某一状态 + + 例如如果需要禁用控件的“hovered”状态时 + + ```qml + Rectangle { + width: 200 + height: 300 + + Button { + anchors.centerIn: parent + text: "Can't Hovered" + ColorSelector.hovered: false + } + } + ``` + +3. 多种状态的叠加 + + 禁用状态和启用状态可以同时使用,例如如下示例代码: + + ```qml + Rectangle { + width: 200 + height: 300 + + Button { + anchors.centerIn: parent + text: "Only Hovered" + ColorSelector.hovered: true + ColorSelector.pressed: false + ColorSelector.disabled: false + } + } + ``` + +上述代码中将“hovered”状态设置为标准状态,且禁用了“pressed”和“disabled”状态,因此示例中的按钮将展示“hovered”状态且不接受按钮的其他状态。 +
+
注解
+
状态控制仅接受真实bool值的设置,不针对属性绑定

+
推荐某个控件只有一种状态被启用,当多个状态启用的情况下,标准状态修改哪种按照控件的情况而定。
+
+ +### 标准控件的 Palette 属性对照 + +dtkclarative 提供的标准控件中,能够通过替换其 Palette 属性来控制控件的自定义颜色。例如一个 Button 控件的文字颜色可用如下方式修改: + +```qml +import org.deepin.dtk 1.0 +Button { + textColor: Palette { + normal: "red" + hovered: "blue" + } +} + +// 或 + +import org.deepin.dtk 1.0 +Button { + palette.windowText: "green" +} +``` + +如 HighlightPanel 控件修改背景色的方式如下: + +```qml +import org.deepin.dtk 1.0 +HighlightPanel { + backgroundColor: Palette { + normal: "red" + } +} +``` + +下表列出基础控件可被替换修改的调色板颜色属性值(按字母顺序排序): + +| **控件** | **属性** | **描述** | +| :------------------ | :---------------------- | :------------------------------------------------------ | +| ActionButton | textColor | 按钮的文本和图标的颜色 | +| BoxPanel | color1 | Box 或 Button 控件的背景渐变色1 | +| | color2 | Box 或 Button 控件的背景渐变色2 | +| | insideBorderColor | Box 或 Button 控件的内描边颜色 | +| | outsideBorderColor | Box 或 Button 控件的外描边颜色 | +| | dropShadowColor | Box 或 Button 控件的外阴影颜色 | +| | innerShadowColor1 | Box 或 Button 控件的内阴影渐变颜色1 | +| | innerShadowColor2 | Box 或 Button 控件的内阴影颜色2 | +| BusyIndicator | fillColor | BusyIndicator 的填充色 | +| Button | textColor | 按钮控件中的文本和图标颜色 | +| ButtonIndicator | backgroundColor | ButtonIndicator的背景颜色 | +| ButtonPanel | 继承于 BoxPanel | 能使用 BoxPanel 中的所有调色板颜色 | +| CheckDelegate | backgroundColor | CheckDelegate控件的背景色 | +| ComboBox | separatorColor | ComboBox在编辑状态下的分隔符颜色 | +| EditPanel | backgroundColor | 所有的编辑框背景色 | +| | alertBackgroundColor | 所有编辑框在显示警告信息时的背景颜色 | +| EmbeddedProgressBar | backgroundColor | 嵌入式进度条的背景颜色 | +| | progressBackgroundColor | 嵌入式进度条的进度背景色 | +| FloatingButton | 继承于 Button | 能使用 Button 控件中的所有调色板颜色 | +| FloatingPanel | backgroundColor | FloatingPanel控件的背景颜色 | +| | dropShadowColor | FloatingPanel的外阴影颜色 | +| | borderColor | FloatingPanel的边框颜色 | +| HighlightPanel | backgroundColor | HighlightPanel的背景颜色 | +| | outerShadowColor | HighlightPanel的外阴影颜色 | +| | innerShadowColor | HighlightPanel的内阴影颜色 | +| IpV4LineEdit | backgroundColor | IpV4LineEdit的背景框颜色 | +| ItemDelegate | checkedTextColor | ItemDelegate在选中时的文本颜色 | +| KeySequenceEdit | backgroundColor | KeySequenceEdit控件的背景颜色 | +| | placeholderTextColor | KeySequenceEdit的占位文本颜色 | +| MenuItem | subMenuBackgroundColor | 子菜单的背景色 | +| | itemColor | 文字和图标Hovered状态下的颜色 | +| Slider | grooveColor | Slider控件的滑槽背景颜色 | +| SliderTipItem | tickColor | Slider控件标签的背景颜色 | +| | textColor | Slider控件标签的文本颜色 | +| SpinBoxIndicator | inactiveBackgroundColor | SpinBox右侧指示按钮在未激活状态时的背景颜色 | +| Switch | backgroundColor | Switch按钮的背景颜色 | +| | handleColor | Switch按钮的滑槽颜色 | +| TextField | backgroundColor | TextField控件的背景颜色 | +| TitleBar | textColor | TitleBar控件的文本和图标颜色 | +| ToolButton | textColor | ToolButton控件的文本和图标颜色 | +| WarningButton | 继承于 Button | 能使用 Button 控件中的所有调色板颜色 | +| WaterProgressBar | backgroundColor1 | WaterProgressBar的背景渐变色1 | +| | backgroundColor2 | WaterProgressBar的背景渐变色2 | +| | dropShadowColor | WaterProgressBar的外阴影颜色 | +| | popBackgroundColor | WaterProgressBar的内置小气泡背景颜色 | +| | textColor | WaterProgressBar的文本颜色 | +| WindowButton | textColor | WindowButton控件的文本和图标颜色 | +| WindowButtonGroup | textColor | WindowButtonGroup内所有WindowButton控件的文本和图标颜色 | + +## Settings + +dtkdeclarative适配了配置策略中所有的内容,为了更方便的对接配置策略,将配置策略和qml语法相结合,dtkdeclarative设计实现了一套全新的Settings框架。 + +### Config 配置 + +关于配置策略相关指南,请参见[配置策略使用说明](\)TODO:(此链接暂时无效,待文档开放后修复) ,dtkdeclarative封装了C++中的配置策略属性实例,通过“Config”项指定,例如以下代码: + +```qml +Config { + name: "example" // 必须指定 + property int key1 : 1 + property string key2 : "key2 default" +} +``` + +subpath属性用于指定文件查找路径,默认情况可以不指定,将直接从“appid”和“name”获取对应的路径进行查找。 +Config 项可以直接通过QML属性的形式指定基础的键值类型,例如上述实例代码,该属性也能直接在控件的槽函数中进行绑定,例如以下代码: + +```qml +Config { + id: config + name: "example" // 必须指定 + property int key1 : 1 + property string key2 : "key2 default" + + onKey2Changed: { + console.info("Config") + } +} + +LineEdit { + text: config.key2 +} +``` + +对于外部修改的配置项值,Config能够接受其变化并发出对应属性修改的信号,QML中能够监听该信号,并进行文本的实时绑定,监听的方式有两种,如下代码所示: + +```qml +Config { + id: config + name: "example" // 必须指定 + property int key1 : 1 + property string key2 : "key2 default" + + onKey2Changed: { + console.info("Config Value changed...") + } +} + +// 1. 直接进行属性绑定 +Label { + text: "property binding key3:" + exampleConfig.key3 +} + +// 2. Qt.binding 进行属性绑定 +Label { + text: "config.key2" + Component.onCompleted: { + text = Qt.binding(function(){ return config.key2 }) + } +} +``` +
+
注意
+
Config 中声明的属性,在对应的配置文件中需要有对应的键值,对于Config中新增的属性,不会直接生效到配置文件去;相反对于配置文件中有的键值,Config中没有对应属性时,若该值发生变化,将触发Config中valueChanged的信号,控件可以通过使用Connection 或者 槽函数绑定的形式动态获取,例如以下代码:

+
+ +```qml +Config { + id: config + name: "example" // 必须指定 + property int key1 : 1 + property string key2 : "key2 default" + + // 1. 直接通过信号槽进行连接 + onValueChanged: { + console.info("Config Key:", key, "Config Value:", config.value(key)) + } + + // 2. 通过Connection进行连接 + Connection { + target: config + // 5.11 的写法 + onValueChanged: { + console.info("Config Key:", key, "Config Value:", config.value(key)) + } + // 5.15推荐写法 + function onValueChanged(key) { + console.info("Config Key:", key, "Config Value:", config.value(key)) + } + } +} +``` + +### SettingDialog 相关 + +dtkdeclarative中的SettingDialog能够更加方便的使用QML语法,更方便的控制布局和样式,同时还能够完成与配置策略的关联。 + +dtkwidget中的SettingDialog通过解析Json文件,完成布局和控件的添加。这种方式存在一些局限性,例如布局的局限性,导致一些高级组合控件无法正常显示;界面的改动能够导致各个控件都出现相应的影响等等。 + +为了解决与QML的融合,能够使用树状代码结构的形式创建控件,摒弃Json的繁琐性和不易阅读性,并方便配置的统一管理,SettingDialog有一套统一的控件模板。 + +以下展示一个简单的SettingDialog示例代码: + +```qml +import org.deepin.dtk.settings 1.0 as Settings + +Config { // 创建配置项 用于关联到SettingDialog中 + id: config + name: "example" + property string key : "key default" // 配置文件中需要有同名键 +} + +Settings.SettingsDialog { + height: 600 + width: 680 + config: config + + groups: [ // 创建配置组,管理配置子组和Options + Settings.SettingsGroup { + key: "group1" + name: "group1" + Settings.SettingsOption { + key: "key" // Option中的键可以直接绑定到config中同名的属性值 + name: "ComboBox" + Settings.ComboBox { // Settings封装的基础控件类型 + model: ["first", "sceond", "three"] + } + } + Settings.SettingsOption { + key: "key2" + name: "LineEdit" + Settings.LineEdit {} + } + Settings.SettingsOption { + key: "canExit" + name: "CheckBox" + Settings.CheckBox {} + } + } + ] +} +``` + +上述示例简单的展示了一个 SettingDialog 整体树构建过程,对于其中的细节和控件,以下将进行重点介绍: + +#### SettingsGroup和SettingsOption + +SettingsDialog的子项通过groups属性管理和维护,在窗口组件添加完毕后,它会获取到所有的groups项目树,并根据其父子关系进行左侧标题栏的生成和右侧内容页的展示。SettingsGroup就是添加进groups属性的数组子项。 + +**SettingsGroup:** 其内部用于管理Options,也可以添加子Group,当group存在多个子group时,需要指定其为children对象: + +```bash +Settings.SettingsDialog { + height: 600 + width: 680 + + groups: [ // 创建配置组,管理配置子组和Options + Settings.SettingsGroup { + key: "group1" + name: "group1" + + children: [ + Settings.SettingsGroup { + key: "group2" + name: "group2" + + Settings.SettingsOption { + key: "key" // Option中的键可以直接绑定到config中同名的属性值 + name: "ComboBox" + Settings.ComboBox { // Settings封装的基础控件类型 + model: ["first", "sceond", "three"] + } + } + }, + Settings.SettingsGroup { + key: "group2" + name: "group2" + + Settings.SettingsOption { + key: "key2" + name: "LineEdit" + Settings.LineEdit {} + } + } + ] + } +} +``` + +**SettingsOption:**SettingsGroup的子项,其内部用于添加控件,进行用户操作。和SettingsGroup一致的是它们都有 key 和、name以及visible 三个属性,但不同的是,SettingsOption中的“key”直接对应与 Config 中对应名称属性,而无需进行手动绑定;SettingsGroup 中的“key”通常用于进行以下过滤操作,例如通过单一的“key”过滤出对应的group并控制它们的显示与隐藏。 +**附加属性:**SettingsGroup和SettingsOption都有附加属性,对于SettingsGroup和SettingsOption中子控件想要获取他们属性时,可以通过附加属性进行获取。不论是SettingsGroup还是SettingsOption,他们的附加属性返回的对象为距离其最近的父类SettingsGroup/SettingsOption对象。 + +#### Settings封装的控件 + +settings 封装的控件与自定义控件不同,它能够获取对应SettingsOption中的“name”属性并自动添加左右布局的标题描述,同时其属性的改动无需绑定即可自动生效到配置文件中,例如ComboBox效果图如下图所示: + +![图片](images/DS37.png) + + +目前被Settings封装好的控件如下表所示(*默认添加别名*): + +| 控件名称 | Settings控件名称 | +| :------- | :---------------- | +| CheckBox | Settings.CheckBox | +| ComboBox | Settings.ComboBox | +| LineEdit | Settings.LineEdit | + +添加到SettingsOption中的自定义控件,也能实现上述封装控件的样子,SettingDialog封装了OptionDelegate控件,对于需要左侧显示名称右侧显示控件的设计需求,可以直接将自定义控件放到OptionDelegate中,如下代码所示: + +```qml +Settings.SettingsGroup { + key: "group2" + name: "group2" + + Settings.SettingsOption { + key: "option1" + name: "group2.group1.option1" + Settings.OptionDelegate { + LineEdit { + text: Settings.SettingsOption.name // Option中的附加属性获取距离最上层的Option对象的name属性 + onEditingFinished: { // 需要手动更新配置项的value属性 + Settings.SettingsOption.value = text // Option中的附加属性获取距离最上层的Option对象的value属性 + } + } + } + ] +} +``` + +
+
注意
+
需要注意的是,对于此类自定义控件,其Option中对应的value值需要自定义控件进行手动绑定。
+
+ + +#### 其他属性 + +下表列出了SettingDialog中的其他属性,并简单介绍: + +| 属性名 | 子属性 | 描述 | +| :------------- | :----------------- | :----------------------------------------------------- | +| groups | 无 | 配置项列表,用于添加SettingsGroup/SettingsOption配置项 | +| config | 无 | 配置策略 | +| container | config | 配置策略 | +| | navigationTitle | 导航栏标题,可重载,默认使用Settings.NavigationTitle | +| | contentTitle | 内容页标题,可重载,默认使用Settings.ContentTitle | +| | contentBackground | 内容页背景,可重载,默认使用Settings.ContentBackground | +| | groups | 配置项列表 | +| navigationView | ListView中的子属性 | 导航列表 | +| contentView | ListView中的子属性 | 内容页列表 | Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/AboutDialog.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/AboutDialog.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ActionButton.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ActionButton.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/AlertToolTip_EditExam.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/AlertToolTip_EditExam.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/AlertToolTip.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/AlertToolTip.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ApplicationWindowNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ApplicationWindowNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ApplicationWindowUseDWindow.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ApplicationWindowUseDWindow.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ArrowListView.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ArrowListView.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/behindwindowblur.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/behindwindowblur.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxInsetShadowExample1.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxInsetShadowExample1.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxInsetShadowExample2.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxInsetShadowExample2.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxInsetShadowExample3.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxInsetShadowExample3.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxInsetShadowExample4.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxInsetShadowExample4.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxInsetShadowExample5.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxInsetShadowExample5.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxPanelExample1.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxPanelExample1.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxPanelExample2.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxPanelExample2.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxPanelExample3.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxPanelExample3.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxShadowExample1.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxShadowExample1.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxShadowExampleBlur10.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxShadowExampleBlur10.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxShadowExampleBlur2.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxShadowExampleBlur2.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxShadowExampleBlur40.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxShadowExampleBlur40.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxShadowExampleNoHollow.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxShadowExampleNoHollow.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxShadowExampleSpread10.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxShadowExampleSpread10.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxShadowExampleSpread2.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxShadowExampleSpread2.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxShadowExampleSpread5.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxShadowExampleSpread5.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BoxShadowExampleWithHollow.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BoxShadowExampleWithHollow.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BusyIndicatorFlat.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BusyIndicatorFlat.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/BusyIndicator.gif and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/BusyIndicator.gif differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ButtonBoxExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ButtonBoxExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ButtonColorFamily.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ButtonColorFamily.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ButtonCrystalCompare.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ButtonCrystalCompare.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ButtonExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ButtonExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ButtonIndicatorForButton.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ButtonIndicatorForButton.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ButtonIndicatorForToolButton.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ButtonIndicatorForToolButton.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/CheckBoxCheckedHovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/CheckBoxCheckedHovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/CheckBoxCheckedNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/CheckBoxCheckedNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/CheckBoxCheckedPressed.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/CheckBoxCheckedPressed.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/CheckBoxPartiallyCheckedHovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/CheckBoxPartiallyCheckedHovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/CheckBoxPartiallyCheckedNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/CheckBoxPartiallyCheckedNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/CheckBoxPartiallyCheckedPressed.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/CheckBoxPartiallyCheckedPressed.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/CheckBoxUnCheckedHovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/CheckBoxUnCheckedHovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/CheckBoxUnCheckedNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/CheckBoxUnCheckedNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/CheckBoxUnCheckedPressed.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/CheckBoxUnCheckedPressed.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/CheckDelegate.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/CheckDelegate.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/coloroverlay_imageOverlay.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/coloroverlay_imageOverlay.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/coloroverlay_imageSouce.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/coloroverlay_imageSouce.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/coloroverlay_Spinner.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/coloroverlay_Spinner.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ComboBoxAlert.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ComboBoxAlert.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ComboBoxEditable.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ComboBoxEditable.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ComboBoxNotEdit.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ComboBoxNotEdit.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ComboBoxPopup.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ComboBoxPopup.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/dciicon-layers.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/dciicon-layers.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS0.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS0.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS10.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS10.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS11.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS11.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS12.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS12.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS13.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS13.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS14.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS14.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS15.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS15.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS16.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS16.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS17.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS17.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS18.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS18.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS19.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS19.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS1.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS1.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS20.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS20.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS21.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS21.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS22.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS22.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS23.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS23.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS24.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS24.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS25.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS25.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS26.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS26.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS27.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS27.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS28.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS28.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS29.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS29.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS2.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS2.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS30.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS30.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS31.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS31.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS32.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS32.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS33.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS33.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS34.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS34.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS35.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS35.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS36.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS36.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS37.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS37.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS3.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS3.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS4.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS4.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS5.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS5.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS6.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS6.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS7.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS7.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS8.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS8.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/DS9.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/DS9.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/dtk-gloweffect.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/dtk-gloweffect.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/dtk-spinner-blue.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/dtk-spinner-blue.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/FloatingButtonExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/FloatingButtonExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/FloatingMessage.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/FloatingMessage.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/FloatingPanelExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/FloatingPanelExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/FocusBoxBorder.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/FocusBoxBorder.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/IconButtonExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/IconButtonExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/IconLabel.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/IconLabel.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/init1.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/init1.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/init2.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/init2.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/init3.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/init3.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/InsideBoxBorderExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/InsideBoxBorderExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/introduction.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/introduction.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/inwindowblur.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/inwindowblur.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/IPV4EditExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/IPV4EditExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/itemViewport_clip_radius.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/itemViewport_clip_radius.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/KeySequenceEditExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/KeySequenceEditExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/layoutUseAnchors.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/layoutUseAnchors.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/layoutUseCustomLayout.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/layoutUseCustomLayout.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/layutFromDtkwidget.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/layutFromDtkwidget.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/LineEditExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/LineEditExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/musicvoice.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/musicvoice.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/opacityMask_effectExample.jpg and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/opacityMask_effectExample.jpg differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/opacityMask_MaskExample.jpg and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/opacityMask_MaskExample.jpg differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/opacityMask_sourceExample.jpg and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/opacityMask_sourceExample.jpg differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/OutsideBoxBorderExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/OutsideBoxBorderExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/PasswordEdit.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/PasswordEdit.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/PlusMinusSpinBox.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/PlusMinusSpinBox.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ProgressBarFormatText.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ProgressBarFormatText.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ProgressBarIn.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ProgressBarIn.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ProgressBarText.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ProgressBarText.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/RadioButtonCheckedHovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/RadioButtonCheckedHovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/RatioButtonNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/RatioButtonNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/RatioButtonUncheckedHovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/RatioButtonUncheckedHovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/RatioButtonUncheckedNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/RatioButtonUncheckedNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/RecommandButtonExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/RecommandButtonExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/RectangularShadowExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/RectangularShadowExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/renderRedRect.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/renderRedRect.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/RoundRectangleExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/RoundRectangleExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SeachEditNoFocus.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SeachEditNoFocus.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SearchEditFocus.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SearchEditFocus.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SearchEditRunning.gif and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SearchEditRunning.gif differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SettingCheckBox.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SettingCheckBox.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SettingComboBox.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SettingComboBox.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SettingLineEdit.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SettingLineEdit.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SettingOptionCustionWidget.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SettingOptionCustionWidget.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SettingsDialog.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SettingsDialog.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SliderDashOffsetCompare.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SliderDashOffsetCompare.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SliderDashOffsetCompareWithPattern.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SliderDashOffsetCompareWithPattern.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SliderDashOffset.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SliderDashOffset.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SliderDashPattern.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SliderDashPattern.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SliderHighlighted.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SliderHighlighted.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SliderNormalHor.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SliderNormalHor.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SliderNormalVer.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SliderNormalVer.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SpinBoxAlert.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SpinBoxAlert.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SpinBoxEdit.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SpinBoxEdit.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SpinBoxExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SpinBoxExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/SwitchButton.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/SwitchButton.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/TextAreaExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/TextAreaExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/TextFieldDisabled.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/TextFieldDisabled.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/TextFieldFocus.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/TextFieldFocus.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/TextFieldNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/TextFieldNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ThemeMenuExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ThemeMenuExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/TicksSllider_Highlight.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/TicksSllider_Highlight.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/TipsSliderDefault.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/TipsSliderDefault.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ToolButtonFloatingPanel.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ToolButtonFloatingPanel.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ToolButtonIconLabel.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ToolButtonIconLabel.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ToolButtonNormal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ToolButtonNormal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/ToolTipExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/ToolTipExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/WarningButtonExample.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/WarningButtonExample.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/WaterProgressBar.gif and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/WaterProgressBar.gif differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/WindowButton_hovered.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/WindowButton_hovered.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/WindowButton_normal.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/WindowButton_normal.png differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/images/WindowButton_pressed.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/images/WindowButton_pressed.png differ diff -Nru dtkdeclarative-5.6.3/docs/index.zh_CN.md dtkdeclarative-5.6.10/docs/index.zh_CN.md --- dtkdeclarative-5.6.3/docs/index.zh_CN.md 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/index.zh_CN.md 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,350 @@ +@mainpage + +# dtkdeclarative + +## 简介 + +dtkdeclarative 是基于 QtQuick及QtQml实现的开发控件库,它是用于代替已有的dtkwidget所开发的全新的DTK模块,其代码以 qtdeclarative 为基础进行开发,实现了对QML已有控件的覆盖(包含Qt Quick Controls 2中的所有控件),增加了大量在 DTK 环境下友好显示的视觉特效和颜色风格。该模块通过Qt插件的形式新增了名为“Chameleon”的样式插件,安装在 `/usr/lib/x86_64-linux-gnu/qt5/qml/QtQuick/Controls.2/Chameleon` 目录(由qml-module-qtquick-controls2-styles-chameleon包提供)。此外,与dtkwidget类似,dtkdeclarative也提供了一些QtQuick中所没有的功能,此类功能都以QML接口的形式提供,包含在 org.deepin.dtk 1.0 中,安装在 `/usr/lib/x86_64-linux-gnu/qt5/qml/org/deepin/dtk/` 目录(由libdtkdeclarative5包提供)。使用 dtkdeclarative 在 DTK 环境下编程具备一下特点: + +1. 原始的 Qt 和 Qml 代码风格 +2. 适配传统 Qml 的所有 API +3. 简单快速的界面开发接口 +4. 统一的控件主题风格 +5. 丰富的特效和色彩 + +dtkdeclative 设计图如下:
+![introduction](images/introduction.png) + +## 与dtkwidget的区别 + +dtkwidget基于QtWidgets模块开发,其与dtkdeclarative的区别主要体现在QtWidgets和QtQuick/QtQml的差异。 +QtWidget使用 C++ 语言开发,其控件都继承于 QWidget 并进行拓展,通过QPainter 在风格插件中进行样式的统一绘制。由于 C++ 语言的特殊性,其信号基于回调函数的方式实现,其事件处理基于多态的特性实现。因此在代码复杂度和冗余度上都有明显的劣势。 +QtQuick/QtQml基于Qml语言开发,其特点是通过树状模型来指定父子类别,通过属性绑定来响应变化。除此之外,它能兼容JavaScript和C++语言的特性,保证开发过程的高效和快速,减少QtWidget编程中信号槽链接的繁琐程度。
+在使用dtkdeclarative之前,应当先熟悉QtQuick的开发模式,其最大的特点是使用“声明式语言(QML)”来描述UI的状态,而不用关心UI具体的渲染过程。下面是一些小例子:
+ +### 渲染方式的区别 + + 1. 使用dtkwidget显示一个100x100大小的红色矩形 +```cpp + class Rectangle : public QWidget + { + private: + void paintEvent(QPaintEvent *) override { + QPainter pa(this); + pa.fillRect(0, 0, 100, 100, Qt::red); + } + }; +``` + + 2.使用dtkdeclarative显示一个100x100大小的红色矩形 + +```qml + Rectangle { + width: 100 + height: 100 + color: "red" + } + +``` + +### 布局方式上的区别 + +1. 使用dtkwidget可以通过布局控件实现 + + ```cpp + int main(int argc, char *argv[]) { + QApplication app(argc, argv); + + QWidget mainWidget; + mainWidget.resize(200, 200); + QHBoxLayout layout1(&mainWidget); + QPushButton btn1("Button 1"); + layout1.addWidget(&btn1); + QVBoxLayout layout2; + QPushButton btn2("Button 2"); + QLineEdit lineEdit; + layout2.addWidget(&btn2); + layout2.addWidget(&lineEdit); + layout1.addLayout(&layout2); + mainWidget.show(); + + return app.exec(); + } + ``` + +2. 使用dtkdeclarative通过锚布局或布局器 + + 2.1. 使用锚布局 + + ```qml + Rectangle { + width: 400 + + height: 200 + color: "blue" + + Button { + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + text: "Button 1" + } + + Button { + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + text: "Button 2" + } + + Label { + text: "Center" + color: "white" + anchors.centerIn: parent + } + } + ``` + + 2.2. 使用布局器 + + ```qml + + RowLayout { + spacing: 20 + Button { + text: "Button 1" + // 设置Layout的附加属性 + Layout.fillWidth: true + Layout.minimumWidth: 50 + Layout.preferredWidth: 100 + Layout.maximumWidth: 300 + Layout.minimumHeight: 150 + } + + Label { + text: "Center" + } + + Button { + text: "Button 2" + // 设置Layout的附加属性 + Layout.fillWidth: true + Layout.minimumWidth: 100 + Layout.preferredWidth: 200 + Layout.preferredHeight: 100 + } + } + ``` + +### 信号槽连接上的区别 + +1. dtkwidget使用`QObject::connection`方式连接 + + ```cpp + int main(int argc, char *argv[]) { + QApplication app(argc, argv); + + QWidget widget; + widget.resize(300, 300); + QPushButton btn("Button", &widget); + btn.move(50, 50); + QObject::connect(&btn, &QPushButton::clicked, []() { + qDebug() << "Button Clicked..."; + }); + widget.show(); + } + ``` + +2. dtkdeclarative使用function或Connections实现 + + 使用`on`的方式连接 + + ```qml + Button { + anchors.centerIn: parent + text: "Button" + // on 进行信号槽连接 + onClicked: { + console.log("Button clicked....."); + } + } + ``` + + 使用Connections 方式连接 + 该种方式应用于同一个信号链接到多个槽函数或者链接作用域不一样的多个组件。 + + ```qml + Button { + id: btn + anchors.centerIn: parent + text: "Button" + } + + // 5.15以下版本使用 + Connections { + target: btn + onClicked: { + console.log("Button clicked...") + } + } + // 5.15以上版本使用 + Connections { + target: btn + function onClicked() { + console.log("Button clicked...") + } + } + ``` + +## 入门资料 + +[QtQml和QtQuick的最佳编程方式](https://doc.qt.io/qt-5/qtquick-bestpractices.html) + +本质上dtkdeclarative就是对于qt的qml模块的扩展,使用qt的资料学习qml再对照本文档进行开发是一种行之有效的手段 + +同时我们提供了对应的开发规范,详细介绍了对于DCI图标,调色板和DConfig的使用,以方便开发者开发: +@ref DevSpecification + +## 依赖关系 + +dtkdeclarative项目依赖于dtk的部分项目以及qtqml的相关依赖。项目中使用到dtkdeclarative项目时,构建运行环境是项目迁移的开始。 + +由于 dtkdeclarative 被用于替代 dtkwidget 而实现的快速高效的UI编程开发,因此它并不依赖于 dtkwidget 而依赖于 dtkcommon、dtkcore以及dtkgui项目, +这是构建dtkdeclarative时所必需的依赖项,对于DTK的无标题以及圆角窗口等属性,在程序运行和显示时需要依赖 qt5platform-plugins 项目内容,用于深度适配 DTK 开发工具。 + +除此之外,dtkdeclarative需要依赖 QtQml以及QtQuick 相关内容,如 qtdeclarative 和 qtquickcontrols2 。 +对于某些运行依赖,即某些qml控件插件,dtkdeclarative也需要依赖安装,如qml-module-qtquick-shape和qml-module-qtgraphicaleffects。 + +下表列出dtkdeclarative项目所依赖大部分的库文件: +| 组件 | 依赖项 | +|-----------|-------------------------------| +| dtkcommon | libdtkcommon-dev | +| dtkcore | libdtkcore-dev | +| dtkcore | libdtkcore5 | +| dtkcore | libqt5dbus5 | +| dtkcore | libqt5xml5 | +| dtkgui | libdtkgui5 | +| dtkgui | libdtkgui-dev | +| dtkgui | libqt5gui5 | +| dtkgui | libqt5dbus5 | +| dtkgui | libqt5xml5 | +| dtkgui | qt5-image-formats-plugins | +| Qt | qtbase5-dev | +| Qt | qtdeclarative5-dev | +| Qt | libqt5quickcontrols2-5 | +| | qt5-platform-plugins | +| | qml-module-qtgraphicaleffects | +| | qml-module-qtquick-shapes | + +## 使用教程 + +dtkdeclarative和Chameleon均为Qt的插件,所以都是动态加载的,不需要进行链接,只需考虑在运行时使Qt引擎能够找到并加载插件。 + +* 工程文件:不需要引用dtkdeclarative库信息。 +* 风格适配:当成功配置dtk环境后,除非手动指定其他风格,否则所使用的控件风格将全部自动使用行云设计风格。 +* 控件中导入dtk相关组件,应确保在最后引入,**可取别名以防被Qt原生同名控件覆盖**,例如: + +```qml +import org.deepin.dtk 1.0 +``` + +```qml +import org.deepin.dtk 1.0 as D +``` + +引用dtk控件,例如: 使用Button控件和dtk提供的字体绑定。 + +```qml + +Button { + font: D.DTK.fontManager.t6 +} +``` + +### 简单的qml项目创建方式: + +(由于qt官方已经从QMake切换到CMake,且在完成文档之前,dtk项目组已经完成了向CMake项目的迁移,故不提供QMake项目的创建的方式) +(因为版本缘故 下列截图可能存在风格主题以及其他差异请以你安装的qtcreator为准) + +1. QtCreator新建qml项目 + ![新建项目](images/init1.png) + + 需要选择构建系统为CMake + + ![选择cmake](images/init2.png) + + 然后qt会自动给你创建一个例子 + + 如果出现例子不能运行的情况,显示qtquick not found 则需要检查 qml-module-qtquick-window2 是否被正确安装 + +2. 指定风格控件 + + 在cmake中添加和修改: + + ```cmake + find_package(Qt5QuickControls2) # 添加 + + # 修改连接库 + target_link_libraries(untitled1 + PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::QuickControls2) + + ``` + + 在main函数中手动指定: + + ```cpp + #include + #include + #include //添加 + + #include + + int main(int argc, char *argv[]) + { + #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + #endif + QGuiApplication app(argc, argv); + auto pt = Dtk::Gui::DGuiApplicationHelper::instance()->applicationPalette(); //添加 + QQuickStyle::setStyle("Chameleon"); + QQmlApplicationEngine engine; + const QUrl url(QStringLiteral("qrc:/main.qml")); + QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, + &app, [url](QObject *obj, const QUrl &objUrl) { + if (!obj && url == objUrl) + QCoreApplication::exit(-1); + }, Qt::QueuedConnection); + engine.load(url); + + return app.exec(); + } + + ``` + + +然后在QML中导入dtk库(前提:dtk组件被正确安装),并开启dtk窗口圆角特性 + +main.qml: +```qml +import QtQuick 2.15 +import QtQuick.Window 2.15 +import org.deepin.dtk 1.0 + +ApplicationWindow { + width: 640 + height: 480 + visible: true + title: qsTr("Hello World") + + flags: Qt.Window | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint + header: TitleBar { + + } +} +``` +得到效果如下: + +![](images/init3.png) + +实际效果可能和这个效果会有差异(因为在测试多系统的兼容性,此代码是在debian sid + gnome + dtk上运行) + +@weakgroup org.deepin.dtk +@brief dtk的qml模块 Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/docs/introduce.png and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/docs/introduce.png differ diff -Nru dtkdeclarative-5.6.3/docs/private/dmessagemanager.zh_CN.dox dtkdeclarative-5.6.10/docs/private/dmessagemanager.zh_CN.dox --- dtkdeclarative-5.6.3/docs/private/dmessagemanager.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/private/dmessagemanager.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,51 @@ +/** +@~chinese +@class DMessageManager +@ingroup QtObject + +@ingroup QML_TYPES +@brief 一种控制 FloatingMessage 的附加对象. + + MessageManager 是一个附加对象,它无法独立的创建。它有多种用于控制 FloatingMessage 的全局效果的属性。 + 通常情况下,再构造 Window 时就可指定全局的 FloatingMessage 属性。例如以下代码: + +```qml + MessageManager.layout: Column { + anchors { + bottom: parent.bottom + right: parent.right + } + } + MessageManager.capacity: 6 + MessageManager.delegate: FloatingMessage { + id: floatingMsg + contentItem: Label { + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft + text: floatingMsg.message.content + elide: Text.ElideRight + maximumLineCount: 1 + wrapMode: Text.Wrap + } + + duration: 3000 + } +``` + +@attachedproperty Component MessageManager::delegate +@brief delegate 属性控制全局情况下的 FloatingMessage 样式风格。 +@details 默认情况下无需重新实现该风格,当需要添加自定义内容时,可修改其内容达到目标效果。 + +@attachedproperty Item MessageManager::layout +@brief layout 属性控制不同消息之间的排列方式。 +@details 默认情况下,多个消息使用纵向布局的方式进行排列。例如,还能自定义为横向布局、流布局等等。 + +@attachedproperty int MessageManager::capacity +@brief capacity 属性用于控制消息最大存储的容量。 +@details 默认情况下,`capacity`的值为 3,即最大能同时容纳 3 条消息进行显示。 + +@attachedproperty int MessageManager::count +@note 该属性只读 +@brief count 属性表示当前消息的个数。 + +*/ \ No newline at end of file diff -Nru dtkdeclarative-5.6.3/docs/qml/AboutAction.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/AboutAction.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/AboutAction.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/AboutAction.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,27 @@ +/** +@~chinese +@class AboutAction +@ingroup Action +@ingroup QML_TYPES +@brief 一个用于显示在菜单界面的“关于”动作. +@details + 这是一个简单的关于动作,它与默认的菜单界面深度适配,用户能够通过点击菜单中的关于按键唤醒 + “关于”对话框,以便获取应用程序的相关信息。一般情况下,开发着无需重新实现该类型,只需进行 + 简单使用即可。 + +@property Component AboutAction::aboutDialog +@details + 该属性用于表示关于对话框的组件,当需要自定义关于对话框时,该组件非常有效。 + 通常情况下,只需要将对应的对话框设置进该属性即可,例如以下代码: +```qml + import org.deepin.dtk 1.0 + + AbountAction { + aboutDialog: AboutDialog { + windowTitle: "example" + } + } +``` +@sa AboutDialog + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/AboutDialog.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/AboutDialog.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/AboutDialog.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/AboutDialog.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,57 @@ +/** +@~chinese +@class AboutDialog +@ingroup DialogWindow +@ingroup org.deepin.dtk +@ingroup QML_TYPES +@brief 一个用于显示应用程序关于界面的对话框. +@details + AboutDialog 是一个 DTK 风格的关于对话框,其被用于显示应用程序统一的关于界面,包括应用名称、描述、图标、版本等等。
+ AboutDialog 具备 DialogWindow 的所有属性,也能够使用 DTK 中的 DWindow 来修改窗口的特殊信息。但这些应用程序通常无需关心,DTK 的内部实现中已经完成。
+ 其设计效果如下图所示:
+@image html AboutDialog.png + +其使用方式如下代码所示: +```qml + AboutDialog { + version: qsTr(String("Version: %1").arg(appVersion)) + productName: qsTr("dde-control-center") + productIcon: "action_setting" + companyLogo: "file://" + DTK.deepinDistributionOrgLogo + websiteName: DTK.deepinWebsiteName + websiteLink: DTK.deepinWebsiteLink + } +``` + +@property string AboutDialog::windowTitle +@brief windowTitle 属性用于控制 AboutDialog 的标题区域文本。 + +@property string AboutDialog::productName +@brief productName 属性用于控制 AboutDialog 的应用程序名称。 + +@property string AboutDialog::productIcon +@brief productIcon 属性用于控制 AboutDialog 的应用程序图标 +@details 其能够接受 DciIcon 和 QtIcon 的图标,但使用时请遵循图标主题规范来指定图标名称,否则可能出现无法正确找到图标的情况。 + +@property string AboutDialog::version +@brief version 属性用于控制 AboutDialog 的应用程序版本信息。 + +@property string AboutDialog::description +@brief description 属性用于控制 AboutDialog 的应用程序内容描述。 + +@property string AboutDialog::license +@brief license 属性用于控制 AboutDialog 的应用程序许可证信息。 + +@property string AboutDialog::companyLogo +@brief companyLogo 属性用于控制 AboutDialog 的公司 LOGO +@details 通常情况下,只需要使用 DTK.deepinDistributionOrgLogo 即可获取到 Logo 路径。该 Logo 会根据系统信息自动变化,即 UOS 或 Deepin。 + +@property string AboutDialog::websiteName +@brief websiteName 属性用于控制 AboutDialog 的公司网站名称. +@details 通常情况下,只需要使用 DTK.deepinWebsiteName 即可自动根据系统版本信息,选择合适的网站。。 + +@property string AboutDialog::websiteLink +@brief websiteLink 属性用于控制 AboutDialog 的应用程序网站链接。 +@details 使用 DTK.deepinWebsiteLink 即可自动获取网站链接 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ActionButton.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ActionButton.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ActionButton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ActionButton.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,21 @@ +/** +@~chinese +@class ActionButton +@ingroup Button +@ingroup QML_TYPES +@brief 一个仅用于显示 Action 的按钮. +@details + 这是一个用于显示附属在 Item 中用于展示动作的按钮。 + 与传统的按钮不同的是,它不提供任何背景;不响应 Hover 动画;不实现任何阴影和模糊特效。 + 但它同样能够做出风格的视觉效果,这种效果是由 DciIcon 提供的。借助 DciIcon 丰富的视觉效果,ActionButton 能够实现下沉式阴影。
+ 但由于 ActionButton 不提供任何背景,因此无法改变显示在其内部的图标颜色,因此放置在 ActionButton 中的
+ 图标一般情况下都是固定颜色的图标,其效果如下图所示: +@image html ActionButton.png + ActionButton 继承于 Button 因此可以使用 Button 中的所有属性,其也能够使用 ColorSelector 进行控件的颜色控制。 + +@property Palette ActionButton::textColor +@brief 该属性用于指定 ActionButton 中 DciIcon 中的前景色调色板 +@details 其类型为 Palette,能够根据 ActionButton 控件的状态变化自动更新记录在其内部的颜色。 +@note 请注意,修改此颜色仅针对 DciIcon 使用前景色调色板的图标有效果,对于不使用任何调色板的图标或 Qt 的图标,将不存在任何效果。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/AlertToolTip.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/AlertToolTip.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/AlertToolTip.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/AlertToolTip.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,28 @@ + +/** +@~chinese +@class AlertToolTip +@ingroup ToolTip +@ingroup QML_TYPES +@brief 一个用于显示在编辑框控件中的警告提示信息类. +@details + AlertToolTip 是一个用于显示在 EditPanel 控件中的警告提示信息类,EditPanel 是 DTK 风格控件中所有编辑框区域的背景控件
+ 因此,DTK已经实现了将 AlertToolTip 嵌套进编辑框的操作,使用其内置属性即可。
+ AlertToolTip 仅作为用于显示警告信息的浮动提示框,其文字会呈现出用于警告的红色字体。如下图所示:
+@image html AlertToolTip.png + AlertToolTip 不会在显示后不会进行自动消失,可以通过时设置 visible 属性来手动控制其隐藏和显示,也可通过控制 timeout 属性动态控制超时时间后的隐藏。
+ 该状态最好通过控件的某一属性控制实现特定情况的显示。
+ 目前 AlertToolTip 已经实现了在所有输入框控件的适配,如下图所示:
+@image html AlertToolTip_EditExam.png + 对于该控件的进一步封装,可通过如下方式控制: +| **属性** | **AlertToolTip 属性** | **描述** | +|---------------|----------------------|--------------------------------------| +| alertText | AlertToolTip.text | 警告信息的文本 | +| alertDuration | AlertToolTip.timeout | 警告信息显示的时长 | +| showAlert | AlertToolTip.visible | 是否显示警告信息,该属性会在 timeout 结束后自动设置为false | +需要强调的是,上述属性已经在所有编辑框控件中添加。 + +@property Item AlertToolTip::target +@details `target` 属性用于控制 `AlertToolTip` 被附属的目标对象。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ApplicationWIndow.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ApplicationWIndow.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ApplicationWIndow.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ApplicationWIndow.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,58 @@ +/**@~chinese +@class ApplicationWindow(FlowStyle) +@ingroup ApplicationWindow +@ingroup QML_TYPES +@brief QML 应用程序的主程序窗口. +@details + 这是 DTK 继承 Qt Quick Control2 实现的程序主窗口控件,该控件添加了行云设计风格的调色板属性,DTK 的字体绑定属性和窗口的标准颜色等。
+ 但请注意,该窗口并未自动做无标题和圆角等属性的处理,如需设置该窗口效果,请使用DWindow 附加属性。
+ 当未指定无标题和圆角等属性时,ApplicationWindow 的效果如下图所示:
+@image html ApplicationWindowNormal.png + 如下代码: +```qml + import org.deepin.dtk 1.0 + ApplicationWindow { + title: "qml-demo" + visible: true + width: 800 + height: 600 + } +``` + 当指定窗口特效后, ApplicationWindow 的效果如下: +@image html ApplicationWindowUseDWindow.png + 如下代码: +```qml + import org.deepin.dtk 1.0 + ApplicationWindow { + title: "qml-demo" + visible: true + width: 800 + height: 600 + DWindow.enabled: true + DWindow.windowRadius: 16 + } +``` + ApplicationWindow 能够使用 DWindow 附加属性中的全部属性并能得到效果,下表列出了 DWindow 中存在的属性: +| **属性名** | **描述** | +|-----------------------|------------------------| +| enabled | 开启窗口特效 | +| window | 当前所在的窗口实例 | +| windowRadius | 窗口圆角大小 | +| borderWidth | 窗口边框宽度 | +| borderColor | 窗口边框颜色 | +| shadowRadius | 窗口阴影半径 | +| shadowOffset | 窗口阴影的偏移距离,包含水平偏移和竖直偏移 | +| shadowColor | 窗口阴影颜色 | +| translucentBackground | 窗口背景透明 | +| enableSystemResize | 开启窗口更改大小功能 | +| enableSystemMove | 开启窗口移动功能 | +| enableBlurWindow | 开启窗口模糊功能 | +| alphaBufferSize | 窗口的 alpha 缓冲大小 | +| clipPath | 窗口的剪切路径 | +| wmWindowTypes | 窗管控制下的窗口类型 | +| motifFunctions | 窗管控制下的窗口功能函数 | +| overlayExited | Preload 加速框架中的加载完成退出动画 | +| loadingOverlay | Preload 正在加载中的自定义等待控件 | +| appLoader | Preload 框架中的主组件实例 | + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ArrowListView.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ArrowListView.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ArrowListView.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ArrowListView.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,32 @@ + +/** +@~chinese +@class ArrowListView +@ingroup Item +@ingroup QML_TYPES +@brief 自带向上和向下箭头的 ListView 控件. +@details + ArrowListView 控件是对 ListView 控件的拓展, ArrowListView 控件自带 + 向上和向下箭头,支持当鼠标放在向上和向下箭头时列表内容自动滚动的交互。
+ 该控件被广泛应用在 Menu 和 ComboBox 控件中。其效果如下图所示: +@image html ArrowListView.png + +@property int ArrowListView::maxVisibleItems +@details + ArrowListView 控件的最大可视项的数量。默认情况下,该值为 16。当超过该数量 + 时,ArrowListView 的高度不会再根据内容发生变化,形成滚动区域,并显示向上和 + 向下按钮。当可视项数量不足该值时,向上和向下按钮将不会显示。 + +@property int ArrowListView::itemHeight +@brief ArrowListView 中项的高度。 +@details + 由于 ArrowListView 无法获取每一项的高度,因此使用 + `maxVisibleItems` 时需要手动指定每一项的高度。默认情况下该高度为 30 + +@property Item ArrowListView::view +@details + ArrowListView 内部使用的 ListView 实例,访问 view 属性能够访问到内部 ListView + 中的全部属性。 +@sa ListView + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ArrowShapePopupWindow.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ArrowShapePopupWindow.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ArrowShapePopupWindow.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ArrowShapePopupWindow.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ArrowShapePopup.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ArrowShapePopup.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ArrowShapePopup.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ArrowShapePopup.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/BoxInsetShadow.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/BoxInsetShadow.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/BoxInsetShadow.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/BoxInsetShadow.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,51 @@ +/**@~chinese +@class BoxInsetShadow +@ingroup Item +@ingroup QML_TYPES +@brief 提供一种内阴影控件. +@details + BoxInsetShadow 是一种用于实现控件的内阴影特效的实现,内阴影不会占用控件之外的区域,当内阴影的颜色存在透明度时,会根据阴影效果渐变填充。
+ 内阴影推荐使用 anchors 进行锚布局填充,手动指定宽度和高度为固定值可能无法跟随宿主控件的款高变化发生改变。 + 内阴影和外阴影一致,可以控制:圆角系数、模糊大小、偏移量大小、扩散大小和阴影颜色等属性。 + 其使用方式如下所示: + \snippet snippets/dtkdeclarative_boxinsetshadow.qml 0 + 效果如下所示: +@image html BoxInsetShadowExample1.png + 圆角系数当不指定时默认为直角效果。 + 模糊大小越大,其模糊范围越广,模糊程度越高,例如下表效果比较: +| **模糊系数** | **代码** | **效果展示** | +|----------|-------------------------------------------------------|------------------------------------------| +| 2 | @snippet snippets/dtkdeclarative_boxinsetshadow.qml 0 | @image html BoxInsetShadowExample1.png | +| 20 | @snippet snippets/dtkdeclarative_boxinsetshadow.qml 1 | @image html BoxInsetShadowExample2.png | +| 40 | @snippet snippets/dtkdeclarative_boxinsetshadow.qml 2 | @image html BoxInsetShadowExample3.png | + + 扩散大小越大,阴影范围越广,如下表效果比较: +| **扩散系数** | **代码** | **效果展示** | +|----------|-------------------------------------------------------|------------------------------------------| +| 1 | @snippet snippets/dtkdeclarative_boxinsetshadow.qml 1 | @image html BoxInsetShadowExample1.png | +| 10 | @snippet snippets/dtkdeclarative_boxinsetshadow.qml 3 | @image html BoxInsetShadowExample4.png | +| 20 | @snippet snippets/dtkdeclarative_boxinsetshadow.qml 4 | @image html BoxInsetShadowExample5.png | + + +@property real BoxInsetShadow::cornerRadius +@brief cornerRadius 属性表示内阴影控件的圆角大小 +@details + 当内阴影控件的宿主控件是一个具有圆角的 + 控件时,该属性能够和宿主控件的圆角大小保持一致。 + +@property real BoxInsetShadow::shadowBlur +@brief shadowBlur 系数表示内阴影控件的模糊系数 +@details + 该值越大表示边界区域的模糊大小越大。默认值为 10。 + +@property real BoxInsetShadow::shadowOffsetX +@brief shadowOffsetX 属性表示内阴影控件的 X 轴偏移量。默认值为 0 + +@property real BoxInsetShadow::shadowOffsetY +@brief shadowOffsetY 属性表示内阴影控件的 Y 轴偏移量。默认值为 0 + +@property color BoxInsetShadow::shadowColor +@brief shadowColor 属性表示内阴影控件的阴影颜色,默认为 "black"@property real BoxInsetShadow::spread +@brief spread 属性表示内阴影控件的扩散大小,该值越大表示扩散距离越深。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/BoxPanel.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/BoxPanel.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/BoxPanel.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/BoxPanel.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,109 @@ + +/** +@~chinese +@class BoxPanel +@ingroup Item + +@ingroup QML_TYPES +@brief 提供一个盒子面板控件. +@details + BoxPanel 提供一个通用的盒子面板控件,它自带了内置的内外阴影特效,被 + 使用在 Button 和 ButtonBox 控件中作为基础控件使用。 BoxPanel 通常 + 被用作控件的背景,默认情况下,该控件在亮色主题下的效果如下图所示: +@image html BoxPanelExample1.png + 通过更改 BoxPanel 的属性,可以改变 BoxPanel 的圆角大小、背景颜色、阴影颜色、模糊系数等等。 + 例如下述代码,可以将 BoxPanel 的颜色修改为渐变色: +```qml + BoxPanel { + width: 200 + height: 200 + radius: width / 2 + color1: D.Palette { + normal: "#228B22" + } + color2: D.Palette { + normal: "#00CED1" + } + } +``` + 效果如下图所示: +@image html BoxPanelExample2.png + 当然如果不满足阴影和边框的效果,也可以通过控制阴影的大小实现自定义阴影, + 如下述代码所示: +```qml + BoxPanel { + width: 200 + height: 200 + radius: width / 2 + color1: Palette { + normal: "#228B22" + } + + color2: Palette { + normal: "#00CED1" + } + + outsideBorderColor: Palette { + normal: "#008B8B" + } + + dropShadowColor: Palette { + normal: "#008080" + } + + innerShadowColor1: Palette { + normal: "#006400" + } + + innerShadowColor2: Palette { + normal: "#87CEFA" + } + + boxShadowBlur: 10 + innerShadowOffsetY1: -2 + } +``` + 效果如下图所示: +@image html BoxPanelExample3.png + +@property int BoxPanel::radius +@brief radius 盒子面板的圆角大小。默认情况下, radius 的值跟系统风格中的圆角值保持一致。 + +@property Palette BoxPanel::color1 +@brief color1 属性代表 BoxPanel 控件背景的渐变色1 +@details 当 color1 属性和 color2 属性相同时,BoxPanel 的背景为一个纯色背景。 + +@property Palette BoxPanel::color2 +@brief color2 属性和 color1 属性类似,表示 BoxPanel 控件的第二背景色 +@details 当 color2 的颜色与 color1不同时,表示该背景色为渐变色。 + +@property Palette BoxPanel::insideBorderColor +@brief insideBorderColor 属性表示 BoxPanel 控件的内边框颜色 + +@property Palette BoxPanel::outsideBorderColor +@brief outsideBorderColor 属性表示 BoxPanel 控件的外边框颜色 + +@property Palette BoxPanel::dropShadowColor +@brief dropShadowColor 属性表示 BoxPanel 控件的阴影颜色 + +@property Palette BoxPanel::innerShadowColor1 +@brief innerShadowColor1 属性表示 BoxPanel 控件的第一内阴影色 +@details BoxPanel 共有两种内阴影,innerShadowColor1 是可以变化内阴影,可通过控制 innerShadowOffsetY1 属性 + 调整第一内阴影的 y 坐标偏移量。 + +@property Palette BoxPanel::innerShadowColor2 +@brief innerShadowColor2 属性表示 BoxPanel 控件的第二内阴影色 +@details 第二内阴影为固定的内阴影,其位置固定在 BoxPanel 控件内,阴影效果除阴影颜色外不允许外部改变。 + +@property int BoxPanel::boxShadowBlur +@brief boxShadowBlur 属性表示 BoxPanel 控件的阴影模糊系数 +@details 默认情况下该系数大小为 6,扩大和缩小该系数能够增加和缩小阴影的模糊范围。 + +@property int BoxPanel::boxShadowOffsetY +@brief boxShadowOffsetY 属性表示 BoxPanel 控件的阴影 y 坐标偏移量 +@details 默认情况下,该偏移量的值为 BoxPanel 的阴影会向下偏移 4 个像素的大小。 + +@property int BoxPanel::innerShadowOffsetY1 +@brief innerShadowOffsetY1 属性表示 BoxPanel 控件第一内阴影的 y 坐标偏移量。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/BoxShadow.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/BoxShadow.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/BoxShadow.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/BoxShadow.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,110 @@ + +/** +@~chinese +@class BoxShadow +@ingroup Item +@ingroup QML_TYPES +@brief 提供一种盒子阴影控件. +@details + BoxShadow 是 DTK 提供的一种兼容软件渲染和硬件渲染的盒子阴影控件。无论应用处在哪种环境(软件和硬件) + 应用所表现出来的效果一致。 + + BoxShadow 控件通常使用 anchors 对目标控件进行填充。根据内部的模糊系数、阴影颜色等等,作用在 + 目标控件中。当然由于 QML 绘制项的层级关系,应当将 BoxShadow 放在目标控件之前创建,或手动修改 + BoxShadow 的 z 属性,以便保证 BoxShadow 控件在目标控件的底部,防止目标控件被阴影控件覆盖。 + + BoxShadow 的简单用法如下所示: +```qml + BoxShadow { + anchors.fill: boxShadowSource + shadowBlur : 20 + shadowColor : Qt.rgba(0, 0, 0, 0.5) + shadowOffsetX : 0 + shadowOffsetY : 0 + cornerRadius: boxShadowSource.radius + } + + Rectangle { + id: boxShadowSource + width: 200 + height: 200 + color: "#D2691E" + radius: 20 + } +``` + + 效果如下图所示: +@image html BoxShadowExample1.png + + 当目标控件是一个带有不透明颜色的控件时,通常我们需要打开 hollow 属性,是为了带有透明 + 部分的目标控件所在区域和底部的 BoxShadow 区域颜色混合的情况,例如以下代码: +```qml + BoxShadow { + anchors.fill: boxShadowSource + shadowBlur : 20 + shadowColor : Qt.rgba(0, 0, 0, 0.5) + shadowOffsetX : 0 + shadowOffsetY : 0 + cornerRadius: boxShadowSource.radius + hollow: true + } + + Rectangle { + id: boxShadowSource + width: 200 + height: 200 + color: Qt.rgba(0.82, 0.71, 0, 0.6) + radius: 20 + } +``` + + 控件使用 hollow 属性和未使用 hollow 属性的效果对比如下: +| **hollow** | **效果** | +|------------|----------------------------------------------| +| false | @image html BoxShadowExampleNoHollow.png | +| true | @image html BoxShadowExampleWithHollow.png | + +@property real BoxShadow::cornerRadius +@brief cornerRadius 属性表示 BoxShadow 的圆角大小 +@details 通常情况下,该大小需要与目标控件的圆角大小保持一致。 + +@property real BoxShadow::shadowBlur +@brief shadowBlur 属性表示 BoxShadow 的阴影模糊系数,模糊系数越大,阴影的模糊程度越高。 +@details + 默认情况下,该属性的值为 10。 + + 例如下述效果展示,其他属性保持一致的情况下,只修改 shadowBlur 值的大小,会发现 BoxShaow + 的阴影大小会随之增加。 +| **shadowBlur系数** | **效果** | +|------------------|------------------------------------------| +| 2 | @image html BoxShadowExampleBlur2.png | +| 10 | @image html BoxShadowExampleBlur10.png | +| 20 | @image html BoxShadowExample1.png | +| 40 | @image html BoxShadowExampleBlur40.png | + + +@property real BoxShadow::shadowOffsetX +@brief shadowOffsetX 属性表示 BoxShadow 的 x 坐标偏移大小。 默认情况下,该值为 0 + +@property real BoxShadow::shadowOffsetY +@brief shadowOffsetY 属性表示 BoxShadow 的 y 坐标偏移大小。 默认情况下,该值为 0 + +@property color BoxShadow::shadowColor +@brief shadowColor 属性表示 BoxShadow 的阴影颜色。默认情况下,该颜色为 "black" + +@property real BoxShadow::spread +@brief spread 属性表示 BoxShadow 的阴影扩散系数,扩散系数越大,表示阴影越 + 能向外扩散,通常情况下,spread 的值为 0。 + 扩散距离的效果展示如下表所示: +| **spread系数** | **效果** | +|--------------|------------------------------------------| +| 0 | @image html BoxShadowExample1.png | +| 2 | @image html BoxShadowExampleSpread2.png | +| 5 | @image html BoxShadowExampleSpread5.png | +| 10 | @image html BoxShadowExampleSpread10.png | + +@property bool BoxShadow::hollow +@brief hollow 属性表示 BoxShadow 是否指定为空洞属性 +@details 当 hollow 属性为 true 时BoxShadow 会去掉和目标控件重合的部分。默认情况下,该值为 false. + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/BusyIndicator.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/BusyIndicator.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/BusyIndicator.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/BusyIndicator.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,37 @@ + +/** +@~chinese +@class BusyIndicator +@ingroup BusyIndicator +@ingroup QML_TYPES +@brief 提供一种趣味交互的等待控件. +@details + BusyIndicator 控件是 DTK 重新实现 QML 风格以适配行云设计风格的控件。 + 它用于进行用户界面等待时的界面交互,提示用户需要进行等待才能继续操作。 + Qt5.11 版本下,当用户逻辑阻塞 GUI 线程导致卡顿时,BusyIndicator 控件也会卡顿。 + Qt5.15 版本后,Qt 新增在其他线程渲染 GUI 和动画极大的改善了这个问题。 + BusyIndicator 的效果如下图所示: +@image html BusyIndicator.gif + +@property Palette BusyIndicator::fillColor + fillColor 属性可填充 BusyIndicator 控件的前景。默认情况下,使用调色板中的活动色填充该属性。 + 可通过自定义颜色来控制不同的颜色。 + 也可以通过将 BusyIndicator 放置在带背景的控件中,混合成一种控件,增加视觉效果,例如下述代码: +```qml + Rectangle { + width: 200 + height: 200 + + color: "#8a8a8a" + BusyIndicator { + anchors.fill: parent + running: true + fillColor: Palette { + normal: "#ffffff" + } + } + } +``` + 效果如下图所示: +@image html BusyIndicatorFlat.png +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ButtonBox.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ButtonBox.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ButtonBox.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ButtonBox.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,44 @@ + +/** +@~chinese +@class ButtonBox +@ingroup Control +@ingroup QML_TYPES +@brief 一种按钮样式的组合控件,可用于放置多个按钮形成组合按钮. +@details + ButtonBox 控件提供一种按钮的组合控件,其内部用于存放多个按钮,在同一个 ButtonBox 下的
+ 不同按钮,其内部只能存在一种 checked 状态的按钮,且 checked 状态下的按钮呈现高亮的状态。
+ 例如以下样式:
+@image html ButtonBoxExample.png + 在 ButtonBox 中,使用 ToolButton 控件最妥当,是因为 ToolButton 更容易使用特殊的
+ 图标和文字的排列方式,放置在 ButtonBox 中更加灵活。
+ 其使用方式如下代码所示:
+```qml + ButtonBox { + anchors.centerIn: parent + + ToolButton { + text: "Button1" + checked: true + } + + ToolButton { + text: "Button2" + } + } +``` + +@property list ButtonBox::buttons +@brief buttons 属性为默认属性,因此,使用时无需强制指定该属性,其内部的子控件默认会全部添加到该属性中。 +@brief buttons 属性用于存储 ButtonBox 控件中放置的按钮。 + +@property alias ButtonBox::group +@brief group 属性表示 ButtonBox 内部使用的 ButtonGroup 对象。 +@details + ButtonGroup的作用为,仅将其内部选中的 Button 对象作为 checked 状态的对象,
+ 即其内部只存在一个checked 对象。 当然,可以通过 \c group 中的 exclusive 属性来禁用该特性。
+ 外部可以通过 group 中的 ButtonGroup::addButton 和 ButtonGroup::removeButton 函数
+ 动态操作其内部的元素。
+@sa ButtonGroup + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ButtonIndicator.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ButtonIndicator.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ButtonIndicator.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ButtonIndicator.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,38 @@ + +/** +@~chinese +@class ButtonIndicator +@ingroup Rectangle +@ingroup QML_TYPES +@brief 提供 Button 控件内部使用的按钮指示器. +@details + ButtonIndicator 作为 Button 控件中的 + 内部控件,其目的是作为一个按钮指示器。在功能上没有任何增加,仅是对控件 + 效果进行了轻微调整。 + 其使用方式如下代码所示: +```qml + ToolButton { + icon.name: "action_newfolder" + indicator: ButtonIndicator { } + } +``` + 或者 +```qml + Button { + icon.name: "action_compress" + text: "压缩方式" + indicator: ButtonIndicator { } + } +``` + 其效果分别为: +@image html ButtonIndicatorForToolButton.png + 和 +@image html ButtonIndicatorForButton.png + +@property Palette ButtonIndicator::backgroundColor +@brief backgroundColor 用来控制 ButtonIndicator 控件中的背景颜色。\c backgroundColor + 作为 Palette 类型能够自动适配深浅主题。 + 通常情况下,\c backgroundColor 属性已经被设置过,使用时无需关心,当需要自定义颜色时 + 可以通过重新定义该值来完成。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ButtonPanel.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ButtonPanel.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ButtonPanel.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ButtonPanel.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,12 @@ +/** +@~chinese +@class ButtonPanel +@ingroup BoxPanel + +@ingroup QML_TYPES +@brief 统一的按钮背景面板. +@details + ButtonPanel 是所有 Button 控件的背景面板。其作为按钮控件的 + 统一背景进行展示,内部根据按钮控件的各种状态进行了颜色的自动调整。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/Button.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/Button.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/Button.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/Button.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,31 @@ + +/** +@~chinese +@class Button +@ingroup Button +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 Button 控件. +@details + Button控件提供行云设计风格的按钮控件。其风格旨在提供一种简约、友好和生命力的效果。
+ 设计中,Button使用了大量的内外阴影、渐变和内外边框。
+ 同时,针对按钮不同状态的颜色调整也做了统一整合,添加了鼠标悬浮时的进入进出动画等等。
+ 同时,针对 Button控件衍生的各个其他风格的按钮控件, + 例如 ActionButton、RecommandButton、WarningButton等等也很好的进行展示。
+ Button控件能够使用 QtIcon 和 DciIcon 两种,在使用上,二者没有太大的差异。
+ 都只需要指定名称和大小, Button也支持添加 indicator 控件,一般情况下,
+ indicator 的位置在 Button的最右侧。
+ Button控件在不同状态时的效果展示如下图所示:
+@image html ButtonExample.png + 除此之外,Button 还支持 Common 和 Crystal 两种不同的 \l {Palette color family}{颜色族},
+ 通常情况下,使用 Button 不需要考虑颜色族的场景,其内部会在不同场景进行适配。
+ Common 和 Crystal 颜色族的效果如下: +@image html ButtonColorFamily.png + Crystal 颜色族下的 Button 取消了 hover 动画和部分阴影效果,但其使用了一种透明效果,
+ 目的是可以很清晰的看到其背后的控件内容,例如下述效果展示:
+@image html ButtonCrystalCompare.png + +@property Palette Button::textColor +@brief textColor 属性为文字颜色所表示的属性值 +@details 默认情况下 textColor 会根据Button的状态发生改变,例如 checked; highlight等等。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/CheckBox.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/CheckBox.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/CheckBox.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/CheckBox.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,28 @@ + +/** +@~chinese +@class CheckBox +@ingroup CheckBox + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 CheckBox 控件. +@details + CheckBox 兼容 CheckBox 的所有属性和接口, 其针对行云设计风格,进行了整体的样式修改。分为三种 Check 状态,分别为 Qt.Unchecked; + Qt.PartiallyChecked 和 Qt.Checked 这三种状态由三种不同的样式组成。 + + 其展示效果如下图所示: +| **状态** | **模式** | **效果** | +|----------------------------|----------|-------------------------------------------------| +| {1, 3} Qt.Unchecked | normal | @image html CheckBoxUnCheckedNormal.png | +| | hovered | @image html CheckBoxUnCheckedHovered.png | +| | pressed | @image html CheckBoxUnCheckedPressed.png | +| {1, 3} Qt.PartiallyChecked | normal | @image html CheckBoxPartiallyCheckedNormal.png | +| | hovered | @image html CheckBoxPartiallyCheckedHovered.png | +| | pressed | @image html CheckBoxPartiallyCheckedPressed.png | +| {1, 3} Qt.Checked | normal | @image html CheckBoxCheckedNormal.png | +| | hovered | @image html CheckBoxCheckedHovered.png | +| | pressed | @image html CheckBoxCheckedPressed.png | + +@note CheckBox 控件的效果由 DciIcon 提供。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/CheckDelegate.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/CheckDelegate.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/CheckDelegate.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/CheckDelegate.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,44 @@ +/** +@~chinese +@class CheckDelegate +@ingroup CheckDelegate + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 CheckDelegate 控件. +@details + CheckDelegate 控件是 ListView 控件中用于多选 + 的代理控件。其功能在于对列表中的多个列表项进行框选和高亮。 + + CheckDelegate(FlowStyle) 兼容 CheckDelegate 中的所有接口,同时也提供了 + 其他属性用于自定义化。例如 CheckDelegate 兼容了 DciIcon 图标类型,能够友好 + 的使用 DciIcon 进行图标绘制,另外 CheckDelegate 可通过外部接口修改背景色, + 文字控件等等。 + + CheckDelegate(FlowStyle) 的效果如下图所示: +@image html CheckDelegate.png + + 所使用的代码如下: +```qml + ListView { + implicitHeight: contentHeight + width: 160 + model: 4 + spacing: 10 + + delegate: DheckDelegate { + text: "标题" + icon.name: "action_setting" + checked: index === ListView.view.count - 1 + } + } +``` + +@property Component CheckDelegate(FlowStyle)::content +@brief content 属性用于指定 CheckDelegate(FlowStyle) 控件的内容控件 +@details 默认情况下,它为一个 Label 控件,用于存放 CheckDelegate(FlowStyle) 中设置过的 \c text 属性。当重新实现 \c content 时,需要自己实现对 \c text 属性的支持。 + +@property Palette CheckDelegate(FlowStyle)::backgroundColor +@brief backgroundColor 属性用于控制 CheckDelegate(FlowStyle) 的背景颜色。 +@details backgroundColor的属性为 Palette 类型。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ComboBox.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ComboBox.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ComboBox.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ComboBox.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,92 @@ + +/** +@~chinese +@class ComboBox +@ingroup ComboBox + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 ComboBox 控件. +@details + ComboBox 控件提供了行云设计风格的组合框控件,
+ 其背景使用跟按钮相似的背景,弹出框使用 Popup 控件实现,相比于默认的 ComboBox控件,
+ 行云设计风格的 ComboBox 实现了自定义图标,
+ 并且在编辑和非编辑状态下,能够不同的风格展现。
+ ComboBox 的效果如下图所示:
+| **状态** | **效果** | +|--------|----------------------------------| +| 编辑状态 | @image html ComboBoxEditable.png | +| 非编辑状态 | @image html ComboBoxNotEdit.png | +| 弹出状态 | 弹出状态 | + + ComboBox默认的文字添加方式可以通过正常的 model 进行添加,
+ 如下代码所示:
+```qml + ComboBox { + anchors.centerIn: parent + model: ["Banana", "Apple", "Coconut"] + } +``` + 如果想要在每项上添加图标进行展示,可以通过 ListModel 实现,如下代码所示: +```qml + ComboBox { + textRole: "text" + iconNameRole: "icon" + + model: ListModel { + ListElement { text: "Banana"; icon: "action_setting" } + ListElement { text: "Apple"; icon: "action_newfolder" } + ListElement { text: "Coconut"; icon: "action_share" } + } + } +``` + +@property string ComboBox::iconNameRole +@brief iconNameRole 属性用于控制图标名称。 +@details + 由于默认的 ComboBox 只支持使用文字,而不支持添加图标,因此这里为了进行 ComboBox 的拓展,方便程序使用 ComboBox 时能够快速的添加图标。
+@note 请注意,该属性需要配合 ListModel 中进行使用\l {CombobBox icon usage} {ComboBox Icon 的用法} + +@property string ComboBox::alertText +@brief alertText 属性用于表示 ComboBox 提示的警告信息。用于提示用户输入的信息有误。 +@note请注意,当 ComboBox 的 editable 属性打开时, alertText 属性才能生效。而在非编辑状态下,该属性无效。 +@details + 其用法如下所示: +```qml + ComboBox { + anchors.centerIn: parent + textRole: "text" + iconNameRole: "icon" + alertText: "Only for strings." + showAlert: true + editable: true + + model: ListModel { + ListElement { text: "Banana"; icon: "action_setting" } + ListElement { text: "Apple"; icon: "action_newfolder" } + ListElement { text: "Coconut"; icon: "action_share" } + } + } +``` +效果如下图所示: +@image html ComboBoxAlert.png + +@property int ComboBox::alertDuration +@brief alertDuration 属性表示警告信息的提示时长。 +@details 默认情况下,如果不设置时长,将会一致显示。@brief alertDuration 的单位是 毫秒(ms)。 + +@property bool ComboBox::showAlert +@brief showAlert 属性用于决定是否显示警告信息。 +@details + 一般情况下,显示警告信息的条件需要满足错误的输入情况。 + 当 `alertDuration` 属性的时间结束时, showAlert 将自动更改为 false否则,`showAlert` 属 + 性需要手动控制为 false。 + +@property int ComboBox::maxVisibleItems +@brief maxVisibleItems 属性用于控制 Popup 窗口显示的最大条目数。 +@details 默认情况下,该最大值为 16,当超过该值时,Popup 窗口开始变成滚动状态,访问其余项需要通过滚动完成。 + +@property Palette ComboBox::separatorColor +@brief separatorColor 属性用于控制ComboBox在编辑状态下,左侧输入框和 + 右侧下拉按钮中间分隔部分的颜色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ControlBackground.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ControlBackground.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ControlBackground.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ControlBackground.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,15 @@ +/** +@~chinese +@class ControlBackground +@ingroup Background + +@ingroup QML_TYPES +@brief ControlBackground 控件:可以用作组合控件 button、edit 等的背景颜色以及焦点框的显示。 + +@property int ControlBackground::focusBorderSpace +@brief 设置焦点框边距边距 + +@property ControlBackground::focusBorder +@brief 设置焦点边框宽度 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/DelayButton.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/DelayButton.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/DelayButton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/DelayButton.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/DialogTitleBar.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/DialogTitleBar.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/DialogTitleBar.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/DialogTitleBar.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,29 @@ + +/** +@~chinese +@class DialogTitleBar +@ingroup Control + +@ingroup QML_TYPES +@brief DialogWindow 中的标题栏控件. +@details + DialogTitleBar 是 DialogWindow 中的标题栏控件,相比默认的标题栏,只有图标,标题和简单的关闭按钮。 + 但和默认的标题栏也有相似之处:都能进行窗口模糊设置;都可以添加自定义内容。 + 通常情况下,使用 DialogWindow 时无需重新创建 DialogTitleBar ,默认提供的标题栏会满足大多数的使用场景,当无法满足时, + 可以通过继承它重新实现。 + +@property Component DialogTitleBar::content +@brief content content 属性作为 DialogTitleBar 中一个自定义标题栏部分,可以添加应用程序自定义的控件 @brief content 属性的类型为 Component, 因此该控件的创建和管理有 DialogTitleBar 控制。 + +@property DciIcon DialogTitleBar::icon +@brief icon 属性表示 DialogWindow 的窗口图标。 +@sa DciIcon + +@property string DialogTitleBar::title +@brief title 属性表示 DialogWindow 的窗口标题。 + +@property bool DialogTitleBar::enableInWindowBlendBlur +@brief enableInWindowBlendBlur 属性用于控制是否开启窗口内混合模糊模式 +@details 当开启该模式后,如果标题栏上经过了其他窗口控件(例如 ScrollView),其背景会呈现出模糊的效果。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/DialogWindow.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/DialogWindow.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/DialogWindow.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/DialogWindow.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,54 @@ + +/** +@~chinese +@class DialogWindow +@ingroup Window + +@ingroup QML_TYPES +@brief DTK 提供的一种基本对话框窗口. +@details + DialogWindow 是基础的自定义对话框窗口,除窗口内容外,其余部分 DTK 完成实现并提供。 + 应用可直接在 DialogWindow 中添加需要展示的内容,通过布局的方式对内容进行属性控制。 + DialogWindow 继承自 Window 控件,相比于 PopupWindow 窗口,DialogWindow 是 + 一个独立的窗口。 + DialogWindow 实现了 DTK 样式中的无标题,背景模糊的等样式。直接使用 Window 时,这些样式都需要 + 自定义实现。 + +@property int DialogWindow::maxContentHeight +@note 该属性为只读属性 +@brief maxContentHeight 属性是一个只读属性,它表示内容区域的最大高度。 + +@property Compnent DialogWindow::header +@brief header 属性用于存储 DialogTitleBar 控件,当需要自定义 DialogTitleBar 时, + 可通过 header: DialogTitleBar {} 来实现。 + +@property string DialogWindow::icon +@brief icon 属性用于存储 DialogWindow 中的图标名称。 + +@property list DialogWindow::content +@brief 属性表示 DialogWindow 中内容控件 +@details + 它是 DialogWindow 中的默认控件,使用时无需强制指定 content 属性。 + 其使用方式如下代码: +```qml + DialogWindow { + width: 200 + icon: "music" + ColumnLayout { + width: parent.width + Label { + Layout.alignment: Qt.AlignHCenter + font: DTK.fontManager.t5 + text: "名称“XXX”已被占用,请使用其他名称" + } + Button { + Layout.alignment: Qt.AlignBottom | Qt.AlignHCenter + Layout.bottomMargin: 10 + Layout.fillWidth: true + text: "确定" + } + } + } +``` + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/Dial.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/Dial.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/Dial.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/Dial.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/EditPanel.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/EditPanel.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/EditPanel.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/EditPanel.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/EmbeddedProgressBar.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/EmbeddedProgressBar.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/EmbeddedProgressBar.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/EmbeddedProgressBar.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,41 @@ + +/** +@~chinese +@class EmbeddedProgressBar +@ingroup ProgressBar + +@ingroup QML_TYPES +@brief 提供一种嵌入到控件内部的进度条控件. + + EmbeddedProgressBar 是一种能够嵌入到控件内部显示进入的进度条控件,它作为一种轻量的进度条控件, + 没有默认进度条的渐变和阴影等效果。它用于指示用户控件的加载情况,如放置在图标内,用于指示应用的启 + 动速度或者应用的下载速度等等。 + EmbeddedProgressBar 的效果如下图所示: + TODO:缺少图片 + +@property Palette EmbeddedProgressBar::backgroundColor +@brief backgroundColor 属性表示 EmbeddedProgressBar 控件的背景颜色,通过控制 backgroundColor 属性 + 能够很容易的修改进度条的背景色。 + 例如下述代码能够将进度条的背景色在亮色主题下修改为红色,在暗色主题下修改会蓝色: + +```qml + EmbeddedProgressBar { + width: 48 + height: 6 + + from: 0 + to: 100 + value: 58 + + backgroundColor: Palette { + normal: "red" + normalDark: "blue" + } + } +``` + +@property Palette EmbeddedProgressBar::progressBackgroundColor +@brief progressBackgroundColor 属性用于表示进度条背景颜色,和 backgroundColor 类似,都为 Palette 类型, + 外部可以通过修改该属性值,调整背景在不同状态下的颜色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/FloatingButton.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/FloatingButton.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/FloatingButton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/FloatingButton.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,15 @@ + +/** +@~chinese +@class FloatingButton +@ingroup Button + +@ingroup QML_TYPES +@brief 提供一种浮动按钮控件. +@details + FloatingButton 继承自 Button 控件,其 UI 效果与 Button 截然不同, FloatingButton + 通常情况下呈现一种圆形按钮,被用于浮动显示在工具栏中。 + 其效果如下图所示: +@image html FloatingButtonExample.png + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/FloatingMessage.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/FloatingMessage.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/FloatingMessage.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/FloatingMessage.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,98 @@ + +/** +@~chinese +@class FloatingMessage +@ingroup Item +@ingroup QML_TYPES +@brief 提供一种窗口内浮动效果的消息控件. +@details + FloatingMessage 控件用于显示在窗口内的提示消息,是消息的基础类型。其使用 FloatingPanel 作为背景,用于增加它的浮动效果,是使用外部定义 + 的文本和图标作为消息内容。
+ FloatingMessage 能进行常驻显示也能进行短暂显示,当消息短暂显示时会在持续时间结束后自动消失,而常驻消息会一致保留在程序中,除非用户 + 手动进行关闭。
+ FloatingMessage 支持高度定制化,当消息效果不满足实际应用需求时,通过重写控件属性,能够修改控件的样式。 + 下图展示了 FloatingMessage 的效果: +@image html FloatingMessage.png + MessageManager 控制 FloatingMessage 的消息容量、样式风格、布局方式等等,也可用过 MessageManager 直接发送 + 消息通知。 MessageManager 作为全局的方式控制 FloatingMessage 的风格和功能,它和 FloatingMessage 的关系为: MessageManager + 是控制者,FloatingMessage 是控制元素。 + +@property Component FloatingMessage::contentItem +@brief contentItem 属性是 FloatingMessage 的内容部分,例如其内部可以放置文本。contentItem 的内容不包含图标部分。当需要自定义 + 中心部分时,可以重新实现该属性。默认情况下 contentItem 属性只存在消息的文本。 + +@property Component FloatingMessage::button +@brief button 属性存放 FloatingMessage 中的关闭按钮。默认情况下, \c button 属性是一个提供关闭按钮的 ActionButton。 + +@property Component FloatingMessage::duration +@brief duration 属性用于表示 FloatingMessage 持续的时间。默认情况下, \c duration 的值为 4 秒,超过该时间,消息自动关闭。当将该 + 属性的值修改为 -1 时,表示 FloatingMessage 是一个常驻消息,除非用户手动关闭,否则将无法消失。 + +@property Component FloatingMessage::panel +@brief panel 属性用于表示 FloatingMessage 控件的背景面板,FloatingMessage 的浮动效果最终由 \c panel 属性提供。一般情况无需手动实现 + 该控件的内容。当需要手动实现时,请实现 重新对图标、文本(contentItem)、关闭按钮(button) 进行重新布局。 + +@propertygroup FloatingMessage::message + +@property string :FloatingMessage::message.iconName +@brief iconName 属性用于表示 FloatingMessage 中的图标名称。默认情况下, \c iconName 属性的值为 \c "dialog-information"。 + +@property color :FloatingMessage::palette.content +@brief message 属性是一个复合属性,默认情况下 message 提供了 iconName 和 content 两个属性名。 \c iconName 表示图标名称 \c content 表示文字内容。 + \l {DSendMessageFromContent}{DTK.sendMessage()} 接口中可以添加自定义的子属性名,但需要自定义 content 组件进行自适配。 + + \l {DSendMessageFromContent}{DTK.sendMessage()} + + + +/** +@~chinese +@class MessageManager +@ingroup QtObject + +@ingroup QML_TYPES +@brief 一种控制 FloatingMessage 的附加对象. + + MessageManager 是一个附加对象,它无法独立的创建。它有多种用于控制 FloatingMessage 的全局效果的属性。 + 通常情况下,再构造 Window 时就可指定全局的 FloatingMessage 属性。例如以下代码: + +```qml + MessageManager.layout: Column { + anchors { + bottom: parent.bottom + right: parent.right + } + } + MessageManager.capacity: 6 + MessageManager.delegate: FloatingMessage { + id: floatingMsg + contentItem: Label { + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft + text: floatingMsg.message.content + elide: Text.ElideRight + maximumLineCount: 1 + wrapMode: Text.Wrap + } + + duration: 3000 + } +``` + +@attachedproperty Component MessageManager::delegate +@brief delegate 属性控制全局情况下的 FloatingMessage 样式风格。 +@details 默认情况下无需重新实现该风格,当需要添加自定义内容时,可修改其内容达到目标效果。 + +@attachedproperty Item MessageManager::layout +@brief layout 属性控制不同消息之间的排列方式。 +@details 默认情况下,多个消息使用纵向布局的方式进行排列。例如,还能自定义为横向布局、流布局等等。 + +@attachedproperty int MessageManager::capacity +@brief capacity 属性用于控制消息最大存储的容量。 +@details 默认情况下,`capacity`的值为 3,即最大能同时容纳 3 条消息进行显示。 + +@attachedproperty int MessageManager::count +@note 该属性只读 +@brief count 属性表示当前消息的个数。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/FloatingPanel.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/FloatingPanel.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/FloatingPanel.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/FloatingPanel.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,74 @@ + +/** +@~chinese +@class FloatingPanel +@ingroup Control + +@ingroup QML_TYPES +@brief 提供一种浮动效果的背景面板. +@details + FloatingPanel 是浮动消息(FloatingMessage)、浮动工具栏、内嵌菜单(Menu)等等控件的通用背景。 + FloatingPanel 自带浮动的效果,能够使其内部控件呈现出浮动在应用内部的效果。 + FloatingPanel 支持颜色和效果的控制,即它能够在外部控制背景颜色、边框颜色、圆角大小和模糊系数等等。 + 其使用方式如下代码: +```qml + FloatingPanel { + contentItem: RowLayout { + spacing: 20 + + DciIcon { name: "entry_voice"; sourceSize: Qt.size(16, 16)} + DciIcon { name: "entry_voice"; sourceSize: Qt.size(16, 16)} + DciIcon { name: "entry_voice"; sourceSize: Qt.size(16, 16)} + + RowLayout { + spacing: 12 + Slider { + id: toolBarSlider + property int totalValue: 7*60 + 56 + property int currentValue: 3 * 60 + 25 + + Layout.preferredWidth: 230 + highlightedPassedGroove: true + handleType: Slider.HandleType.NoArrowHorizontal + from: 0 + to: msToValue(totalValue) + value: msToValue(currentValue) + stepSize: 1 + function msToValue(ms) { return ms} + function msToText(ms) { + return String("%1:%2").arg(Math.floor(ms / 60)).arg(ms % 60) + } + } + Text { + Layout.preferredWidth: 50 + text: String("%1/%2").arg(toolBarSlider.msToText(toolBarSlider.value)).arg(toolBarSlider.msToText(toolBarSlider.to)) + } + } + + DciIcon { name: "entry_voice"; sourceSize: Qt.size(16, 16)} + DciIcon { name: "entry_voice"; sourceSize: Qt.size(16, 16)} + } + } +``` + 效果如下图所示: +@image html FloatingPanelExample.png + +@property Palette FloatingPanel::backgroundColor +@brief backgroundColor 属性用于控制背景颜色。 +@sa Palette + +@property Palette FloatingPanel::dropShadowColor +@brief dropShadowColor 属性用于控制阴影部分的颜色。 +@sa Palette + +@property Palette FloatingPanel::borderColor +@brief borderColor 属性用于控制边框的颜色。 +@sa Palette + +@property Palette FloatingPanel::radius +@brief radius 属性控制 FloatingPanel 背景的圆角大小,默认情况下为该值为 14。 + +@property Palette FloatingPanel::blurRadius +@brief blurRadius 属性控制 FloatingPanel 的模糊系数,默认情况下为该值为 14。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/FlowStyle.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/FlowStyle.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/FlowStyle.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/FlowStyle.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/FocusBoxBorder.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/FocusBoxBorder.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/FocusBoxBorder.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/FocusBoxBorder.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,52 @@ + +/** +@~chinese +@class FocusBoxBorder +@ingroup Item + +@ingroup QML_TYPES +@brief 提供一种通用的控件焦点边框. +@details + FocusBoxBorder 控件主要用于绘制控件的焦点边框。当控件支持焦点策略时,使用 Tab 键或者使用鼠标点击,控件周围会环绕 + 高亮色的边框效果。FocusBoxBorder 用于提供该效果。目前 DTK 提供的一些支持焦点的控件都实现了焦点框的绘制。 + FocusBoxBorder 效果如下图所示: +@image html FocusBoxBorder.png + 其使用方式如下代码所示: +```qml + Control { + // 实现的自定义控件 + id: control + focusPolicy: Qt.StrongFocus + + contentItem: Text { + text: "A custom control." + verticalAlignment: Text.AlignVCenter + } + + background: Rectangle { + implicitWidth: 200 + implicitHeight: 80 + radius: 8 + + color: "darkGreen" + + FocusBoxBorder { + anchors.fill: parent + radius: 8 + color: control.palette.highlight + visible: control.visualFocus + } + } + } +``` + +@property color FocusBoxBorder::color +@brief color 属性应用控制焦点边框的颜色。默认情况下,该颜色是 "transparent"。 + +@property int FocusBoxBorder::borderWidth +@brief borderWidth 属性表示焦点边框的宽度。默认情况下该值为 2 + +@property int FocusBoxBorder::radius +@brief radius 属性用于控制边框的圆角大小。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/Frame.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/Frame.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/Frame.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/Frame.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/GroupBox.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/GroupBox.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/GroupBox.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/GroupBox.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/HighlightPanel.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/HighlightPanel.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/HighlightPanel.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/HighlightPanel.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,21 @@ + +/** +@~chinese +@class HighlightPanel +@ingroup Item + +@ingroup QML_TYPES +@brief 提供一种高亮显示背景面板. +@details HighlightPanel 属性控制高亮显示的背景面板,它被广泛用于 ListView 或 MenuItem 中当做鼠标选中时的高亮背景。 +TODO:补充图片和示例 + +@property Palette HighlightPanel::backgroundColor +@brief backgroundColor 属性用于控制 HighlightPanel 的背景颜色。 + +@property Palette HighlightPanel::outerShadowColor +@brief outerShadowColor 属性用于控制 HighlightPanel 的外阴影颜色。 + +@property Palette HighlightPanel::innerShadowColor +@brief backgroundColor 属性用于控制 HighlightPanel 的内阴影颜色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/IconButton.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/IconButton.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/IconButton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/IconButton.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,15 @@ + +/** +@~chinese +@class IconButton +@ingroup Button + +@ingroup QML_TYPES +@brief 提供一种图标类按钮控件. + + IconButton 继承自 \l{Button(FlowStyle)}{Button} 控件,但它只允许设置 icon 等属性,无法设置 text 添加文本。 + IconButton 已支持使用 DciIcon 和 QtIcon 两种。 + + IconButton 的效果如下图所示: +@image html IconButtonExample.png + diff -Nru dtkdeclarative-5.6.3/docs/qml/index.zh_CN.md dtkdeclarative-5.6.10/docs/qml/index.zh_CN.md --- dtkdeclarative-5.6.3/docs/qml/index.zh_CN.md 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/index.zh_CN.md 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,16 @@ +@page qml qml + +# QML + + + +@defgroup QML_TYPES QML类型模块 +@brief 用于处理QML类型的模块 + +@defgroup Action QML动作模块 +@brief 用于处理动作的模块 + + +@defgroup DialogWindow QML对话框模块 +@brief 用于处理对话框的模块 + diff -Nru dtkdeclarative-5.6.3/docs/qml/InsideBoxBorder.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/InsideBoxBorder.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/InsideBoxBorder.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/InsideBoxBorder.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,43 @@ + +/** +@~chinese +@class InsideBoxBorder +@ingroup Item + +@ingroup QML_TYPES +@brief 提供一种内边框控件. +@brief + InsideBoxBorder 控件提供一种内边框,作为一种修饰性的控件存在, InsideBoxBorder 控件 + 和 OutsideBoxBorder 控件类似,都用来提供控件的边框。好的控件设计,离不开丰富的描边绘制。 + + InsideBoxBorder 的用法如下所示: +```qml + Rectangle { + width: 180 + height: 180 + color: "darkCyan" + radius: 8 + + InsideBoxBorder { + anchors.fill: parent + color: "darkGreen" + borderWidth: 2 + radius: 8 + } + } +``` + + 其效果如下图所示: +@image html InsideBoxBorderExample.png + +@property real InsideBoxBorder::borderWidth +@brief borderWidth 属性用于表示 InsideBoxBorder 控件的边框大小。 默认情况下, + 该值是 1。 + +@property color InsideBoxBorder::color +@brief color 属性表示内边框的颜色值。默认情况下,该值是 "white" + +@property int InsideBoxBorder::radius +@brief radius 属性表示内边框的圆角大小,默认情况下,该大小为 0。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/Ipv4Edit.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/Ipv4Edit.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/Ipv4Edit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/Ipv4Edit.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,43 @@ + +/** +@~chinese +@class IpV4LineEdit +@ingroup Item + +@ingroup QML_TYPES +@brief 提供一种用于输入 IPV4 的特殊输入框. +@details + IpV4LineEdit 是一个专门用于输入 IPV4 地址的输入框控件。它兼容了传统的输入方式, + 重新适配对 IPV4 的输入,目的是更友好的支持输入这种特殊格式的文本。 IpV4LineEdit + 控件兼容了使用 Tab 键切换当前输入框的方式,当当前输入框输入完成后,可唤起 Tab 键 + 调整位置输入,同时 IpV4LineEdit 自带的特殊的 clear button 能够一键清除用户的 + 所有输入。 + IpV4LineEdit 也支持现实特殊的警告信息,当用户输入方式有误时,IpV4LineEdit 提供 + 属性可唤起提示信息,告知用户输入方式的问题。 + IpV4LineEdit 的效果如下图所示: + +@image html IPV4EditExample.png + +@property string IpV4LineEdit::text +@brief text 属性表示当前属于 IpV4 的字符文本,会自动拼接 "." 字符,例如当用户输入 + 的字符是 "127.0.0.1"。当用户未进行任何输入,或者任意输入框都是空时,\c text 将 + 返回空字符。 +@brief text 属性在用户输入的发生任何字符变化时,都会触发修改。 + +@property string IpV4LineEdit::alertText +@brief alertText 属性表示 IpV4LineEdit 用于显示警告信息的警告文本。@brief alertText 属性可普通的 Edit 一样,都用于控制警告文本的输入。 +@sa LineEdit + +@property string IpV4LineEdit::alertDuration +@brief alertDuration 属性表示 IpV4LineEdit 用于显示警告信息的持续时长。@brief 当 alertDuration 结束后,警告信息将自动消失。 +@sa LineEdit + +@property bool IpV4LineEdit::showAlert +@brief showAlert 属性用于控制 IpV4LineEdit 的警告信息的现实和隐藏。 +@details 当 showAlert 为true 时,警告信息会在 alertDuration 属性的持续时长完成或自动消失。 + +@property Palette IpV4LineEdit::backgroundColor +@brief backgroundColor 属性用于控制 IpV4LineEdit 的背景颜色。 +@details 默认情况下,该值会根据当前风格自动设置。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ItemDelegate.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ItemDelegate.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ItemDelegate.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ItemDelegate.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,108 @@ + +/** +@~chinese +@class ItemDelegate +@ingroup ItemDelegate + +@ingroup QML_TYPES +@brief 提供行云设计风格的 ItemDelegate 控件. +@details + ItemDelegate 是一个多被用于 ListView 中 + 当作视图项绘制的控件。在 QML 中 ItemDelegate + 不再担任绘制的工作,它是一个基础控件,他的创建和释放;显示和隐藏都由 ListView 控制。 + 行云设计中, ItemDelegate 不仅兼容其原有的接口, + 还添加了用于自定义的额外属性,这些属性在非行云设计的其他风格上可能无法正常使用。 + + ItemDelegate 的使用方式如下: +```qml + ListView { + implicitHeight: contentHeight + width: 200 + model: 4 + delegate: ItemDelegate { + text: "Nth " + index + checked: index === ListView.view.count - 1 + backgroundVisible: index % 2 === 0 + } + } +``` + +@property bool ItemDelegate::indicatorVisible +@brief indicatorVisible 用于控制 ItemDelegate 中的 + indicator 是否显示,默认为 false。 + + ItemDelegate 中的 indicator 是用于展示视图项被 + 选中时的“已选中”图标样式。 + +@property bool ItemDelegate::backgroundVisible +@brief backgroundVisible 用于控制 ItemDelegate 中的 + 背景是否可见,默认情况下,该值是 true。 + + 当需要某种情况下,显示视图项背景,其他情况不显示视图项背景时,可以使用该属性控制。 + + + +@property bool ItemDelegate::cascadeSelected +@brief cascadeSelected 属性用于控制 ItemDelegate 是否 + 进行多选。默认情况下 cascadeSelected 为 false,即只能进行单选。当 \c cascadeSelected + 属性为 true 时,被多选的视图项无法显示高亮背景。 + + + +@property bool ItemDelegate::contentFlow +@brief contentFlow 属性用于控制 \c content 属性的填充方式,当 \c content 存在且需要让其 + 全部填充整个视图项时,将该属性设置为 true 是一个不错的选择。默认情况下, \c contentFlow + 为 false。 + + + +@property Component ItemDelegate::content +@brief content 属性用于控制 ItemDelegate 的自定义部件。@brief content 是除左侧图标和文本之外的,额外的自定义部件区域。 + + + +@property Palette ItemDelegate::checkedTextColor +@brief checkedTextColor 属性用于控制 ItemDelegate 选中文字 + 的颜色调色板。默认情况下,该属性会根据其所处场景自动发生变化。 + + + +@property enumeration ItemDelegate::corners +@brief corners 属性用于控制 ItemDelegate 背景的圆角方式。 +@brief corners 可从以下枚举取值,也能混合取值。 + \table + \header + \li 枚举值 + \li 描述 + \row + \li RoundRectangle.NoneCorner + \li 无圆角,即直角矩形。 + \row + \li RoundRectangle.TopLeftCorner + \li 指定左上角为圆角。 + \row + \li RoundRectangle.TopRightCorner + \li 指定右上角为圆角。 + \row + \li RoundRectangle.BottomLeftCorner + \li 指定左下角为圆角。 + \row + \li RoundRectangle.BottomRightCorner + \li 指定右下角为圆角。 + \row + \li RoundRectangle.TopCorner + \li 指定矩形上部分为圆角,即左上角和右上角。 + \row + \li RoundRectangle.BottomCorner + \li 指定矩形下部分为圆角,即左下角和右下角。 + \row + \li RoundRectangle.LeftCorner + \li 指定矩形左边部分为圆角,即左上角和左下角。 + \row + \li RoundRectangle.RightCorner + \li 指定矩形右边部分为圆角,即右上角和右下角。 + \row + \li RoundRectangle.AllCorner + \li 指定矩形为全圆角矩形。 + \endtable + \sa RoundRectangle diff -Nru dtkdeclarative-5.6.3/docs/qml/KeySequenceEdit.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/KeySequenceEdit.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/KeySequenceEdit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/KeySequenceEdit.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,46 @@ + +/** +@~chinese +@class KeySequenceEdit +@ingroup Control + +@ingroup QML_TYPES +@brief 提供一种快捷键监听的输入框控件. +@details + KeySequenceEdit 控件是一种用于监听快捷键事件的输入框控件。 KeySequenceEdit 提供了 + 默认的描述文本区域,可通过属性直接设置其快捷键类型。同时,也提供了用于隐式提示的文本字段。 + KeySequenceEdit 只能用于监听应用内的快捷键,当 KeySequenceEdit 与系统快捷键发生冲突 + 时,可能无法正常工作。 + KeySequenceEdit 的效果如下图所示: +@image html KeySequenceEditExample.png + KeySequenceEdit 支持默认的快捷键设置,可用于界面初始化的显示,用户通过点击指定区域,触发 + KeySequenceEdit 快捷键监听机制,一旦触发,符合快捷键定义的任何键位都会被记录。 + KeySequenceEdit 的使用方式如下代码: +```qml + KeySequenceEdit { + width: 504 + height: 36 + text: "关闭窗口" + placeholderText: "请重新输入快捷键" + keys: ["ALT", "F4"] //此快捷键见上图所示,为默认显示的快捷键 + } +``` + +@property string KeySequenceEdit::text +@brief text 属性用于控制该快捷键的显示文本。一般用于指定该快捷键代表哪一操作。 + +@property string KeySequenceEdit::placeholderText +@brief placeholderText 属性用于表示用户清空键位,或键位为空时,隐式提示的文本。 + +@property list KeySequenceEdit::keys +@brief keys 属性用于表示用户输入的键位 +@details 初始化时,可以通过控制该属性指定默认键位。当用户输入后,该键位会跟随用户输入的值发生变化。 + `keys`属性不会检查该键位是否正常。请在手动传递时确保键位正常。 + +@property Palette KeySequenceEdit::backgroundColor +@brief backgroundColor 属性用于 KeySequenceEdit 控制背景颜色。 + +@property Palette KeySequenceEdit::placeholderTextColor +@brief placeholderTextColor 属性用于 KeySequenceEdit 控制隐式提示的字体颜色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/LineEdit.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/LineEdit.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/LineEdit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/LineEdit.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,35 @@ + +/** +@~chinese +@class LineEdit +@ingroup TextField + +@ingroup QML_TYPES +@brief 提供一种自带清除按钮的输入框控件. +@details + LineEdit 提供了一种单行输入控件。与 Qt 的 TextField 控件不同的是LineEdit 自带了一个可以清除所有输入的 ActionButton,方便用于在输 + 入后进行一件清除的快捷操作,其他属性和方法都和 TextField 空间保持一致。
+ LineEdit 控件的效果如下图所示: +@image html LineEditExample.png + LineEdit 将清除按钮暴露出来,使用时可以更方便地在清除按钮周围添加自定义控件。 + +@property Item LineEdit::clearButton +@brief clearButton 属性获取 LineEdit 中的清除按钮。 clearButton 属性 + 能够更方便的操作 LineEdit,在 LineEdit 周围添加自定义按钮和空间。 + 例如以下代码: +```qml + LineEdit { + width: 200 + text: "~/.ssh/ssh_keygen.key" + ActionButton { + anchors { + right: parent.clearButton.left + rightMargin: 5 + verticalCenter: parent.verticalCenter + } + icon.name: "entry_loadfile" + } + } +``` + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/MenuItem.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/MenuItem.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/MenuItem.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/MenuItem.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,28 @@ + +/** +@~chinese +@class MenuItem +@ingroup MenuItem + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 MenuItem 控件. +@details + MenuItem 控件是Menu中的基础 + 菜单项控件。 MenuItem 可以实现添加文字,图标,子菜单等等。 + 并且,MenuItem 目前实现了对 QtIcon 和 DciIcon 的兼容。 + DTK 实现的 MenuItem 能够使用原始的所有接口,为了更加兼容 + 行云设计风格,DTK 也为其提供了自定义开发属性,用于更加自定义的控制控件的状态。 + 其使用方式,可以参考Menu中的示例。 + +@property bool MenuItem::useIndicatorPadding +@brief useIndicatorPadding 属性控制 indicator 的 padding 属性 +@details 当`useIndicatorPadding`属性开启时,选中情况下会默认对 indicator 添加 padding。默认情况下, + 该属性会根据当前 MenuItem 的状态自动发生变化。 + +@property Palette MenuItem::textColor +@brief textColor 属性控制 MenuItem 控件的前景颜色。包含文字和图标的颜色。 + +@property Palette MenuItem::subMenuBackgroundColor +@brief subMenuBackgroundColor 属性控制 MenuItem 控件子菜单的背景颜色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/MenuSeparator.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/MenuSeparator.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/MenuSeparator.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/MenuSeparator.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,36 @@ + +/** +@~chinese +@class MenuSeparator +@ingroup MenuSeparator + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 MenuSeparator 控件. +@details + MenuSeparator 控件被用做 Menu 控件的菜单分隔符控件。 + 行云设计提供的 MenuSeparator 控件不光能够作为分隔符, + 还能够添加自定义文本当作分隔描述。
+ 例如,可以使用如下方式添加自定义文本的菜单分隔符: +```qml + Menu { + MenuSeparator { text: qsTr("单曲")} // 创建带文本的菜单分隔符 + MenuItem { icon.name: "folder-music-symbolic"; text: qsTr("Tomorrow-Fly By Midnight") } + MenuItem { icon.name: "folder-music-symbolic"; text: qsTr("Tomorrow With You (EN]ABA)- Senpai Kondor") } + MenuItem { icon.name: "folder-music-symbolic"; text: qsTr("Tomorrow will be fine. - Sodagreen") } + MenuItem { icon.name: "folder-music-symbolic"; text: qsTr("CROWN - TOMORROW X TOGETHER") } + MenuSeparator { text: qsTr("歌手")} + MenuItem { icon.name: "music"; text: qsTr("Tomorrow - Fly By Midnight") } + MenuSeparator { text: qsTr("专辑")} + MenuItem { icon.name: "music"; text: qsTr("DTK-Menu-Menuitem-ICON-Right-Light") } + MenuItem { icon.name: "music"; text: qsTr("CROWN - TOMORROW X TOGETHER") } + } +``` + +@property string MenuSeparator::text +@brief text 属性控制 MenuSeparator 是否带文本, +@details 如果未添加`text` 属性,MenuSeparator 只是一个带水平线的菜单项。 + +@property Palette MenuSeparator::textColor +@brief textColor 属性用于控制文本和水平线的颜色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/Menu.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/Menu.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/Menu.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/Menu.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,106 @@ + +/** +@~chinese +@class Menu +@ingroup Menu + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 Menu 控件. +@details + Menu 控件大多被用于应用菜单,例如功能菜单、右键菜单等。 DTK 实现的菜单 + 比原有样式的菜单更流畅;更定制化,它能够兼容 Menu 的所有接口,并且能够做 + 到内部的 MenuItem 自动适配菜单的宽高。
+ 除此之外,Menu 还支持添加头部控件和尾部控件,当需要添加自定义搜索内容时, + 头部控件可以添加 SearchEdit 来实现。
+ Menu 的最大项目个数在 DTK 的设计中是 16,当超过该数值时,Menu 会出现 + 滚动选项,同时 菜单的上部和下部会出现上下移动的按钮,鼠标放置时可自动进行移动。
+ Menu 的基本用于如下代码所示:
+```qml + Menu { + MenuItem { text: qsTr("打开") } + MenuItem { text: qsTr("在新窗口打开") } + MenuItem { text: qsTr("在新标签中打开") } + MenuItem { text: qsTr("以管理员身份打开") } + MenuSeparator {} + MenuItem { text: qsTr("复制") } + MenuSeparator {} + MenuItem { text: qsTr("共享文件夹")} + MenuItem { text: qsTr("创建链接")} + MenuItem { text: qsTr("发送到桌面")} + MenuItem { text: qsTr("在终端中打开")} + Menu { title: qsTr("自定义")} + MenuItem { text: qsTr("压缩")} + MenuItem { text: qsTr("属性")} + } +``` + 如上代码, Menu 内部控件需要使用 Menu、MenuItem 或者 MenuSeparator,其中 MenuItem 用 + 来显示实际的菜单项,包含图表和文本, MenuSeparator 用来显示菜单中的分隔符。在菜单中内部的 + 子菜单,可以使用 Menu 叠加的方式完成。
+ 对于自定义头部控件,这里使用一个 SearchEdit 的示例表示:
+```qml + Menu { + id: searchAndArrowMenu + width: 160 + header: SearchEdit { + placeholder: qsTr("搜索") + onTextChanged: { + proxyModel.filterText = text + proxyModel.update() + } + } + model: ObjectModelProxy { + id: proxyModel + property string filterText + filterAcceptsItem: function(item) { + return item.text.includes(filterText) + } + sourceModel: searchAndArrowMenu.contentModel + } + + maxVisibleItems: 10 + MenuItem { text: qsTr("Greek(cp869)") } + MenuItem { text: qsTr("Cyrillic (ISO 8859-5)") } + MenuItem { text: qsTr("Cyrillic(KOI8-R)") } + MenuItem { text: qsTr("Devanagari(x-mac-davanagari)") } + MenuItem { text: qsTr("Gurmukhi(x-mac-gurmukhi)") } + MenuItem { text: qsTr("Thai (ISO 8859-11)") } + MenuItem { text: qsTr("Simplified Chinese(x-mac-sim-chinese)") } + MenuItem { text: qsTr("Chinese(GBK)"); checked: true} + MenuItem { text: qsTr("Chinese(GB 18030)") } + MenuItem { text: qsTr("Chinese(ISO 2022-CN)") } + MenuItem { text: qsTr("Simplified Chinese (GB2312)") } + MenuItem { text: qsTr("Tibetan (x-mac-tibetan)") } + MenuItem { text: qsTr("Central European(ISO Latin 2)") } + MenuItem { text: qsTr("Central Eu 188 opx(ISO Latin 4)") } + MenuItem { text: qsTr("Baltic (ISO Latin 7)") } + } +``` + +@property int Menu::maxVisibleItems +@brief maxVisibleItems 用于控制菜单中的最大项数 +@details 默认情况下,该值是 16。当 Menu中的项数超过最大可视项目数量,其他的菜单项会处于滚动显示的状态。
+ 并且在菜单的头部和尾部会添加向上和向下滚动的按钮,当鼠标放置在上面时,菜单自动滚动。 + +@property Palette Menu::backgroundColor +@brief backgroundColor 属性控制 Menu 的背景颜色。 + +@property var Menu::model +@brief `model` 属性是 Menu 的模型,`model`用于控制菜单的数据添加和删除,动态进行数据创建等等。 +@details + 一般情况下, Menu 只需要手动添加 MenuItem 而不需要指定`model`, + 当需要对`model`的数据进行过滤时,可以使用 ObjectModelProxy 包装该模型。 + 一般可用于控制 MenuItem 的显示和隐藏,创建和删除。手动控制 MenuItem 中 visible + 属性会在 Menu 中留下一个视觉上的空位,因此不推荐直接使用 visible 属性控制 MenuItem + 的隐藏。 + +@property Component Menu::header +@brief header 属性可指定 Menu 的自定义的头部组件。 + +@property Component Menu::footer +@brief footer 属性可指定 Menu 的自定义的底部组件。 + +@property bool Menu::existsChecked +@note 此属性为只读属性 +@brief existsChecked 属性可判断当前的 Menu 中是否存在已经选中的 MenuItem,如果存在则返回 true , 否则返回 false。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dcoloroverlay.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dcoloroverlay.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dcoloroverlay.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dcoloroverlay.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,86 @@ + +/** +@~chinese +@class ColorOverlay +@ingroup Item +@brief 一个同时支持软件和硬件渲染的颜色覆盖控件. +@details + 这是一种同时支持软件渲染和硬件渲染的颜色覆盖控件,其作用是为源控件覆盖用户想要的自定义颜色。 + 其同时支持软件渲染和硬件渲染两种模式,在硬件渲染下,其和 Qt Graphical Effects 模块的 ColorOverlay 用法 + 一致,软件渲染模式下,其只能做到对单一颜色的覆盖,无法做到 alpha 的像素点混合这种效果。 + + ColorOverlay 在 DTK 中被用在 BusyIndicator 的颜色覆盖上,如自定义 + 不同颜色的 BusyIndicator,应用使用该控件控制例如需要被高亮色进行颜色 + 覆盖的场景。 +@image html coloroverlay_Spinner.png + 它可以对一般控件进行颜色覆盖,其使用方式如下所示: +```qml + import org.deepin.dtk 1.0 + + Rectangle { + id: rect + + width: 100 + height: 100 + color: "gray" + visible: false + } + + ColorOverlay { + anchors.fill: rect + source: rect + color: "red" + } +``` + 其效果如下: +@image html renderRedRect.png + 也可以对图片进行颜色覆盖,其使用方式如下所示: +```qml + import org.deepin.dtk 1.0 + + Image { + id: img + sourceSize { + width: 100 + height: 100 + } + source: "/path/to/image.png" + visible: false + } + + ColorOverlay { + anchors.fill: img + source: img + color: "red" + } +``` + 其效果如下: + \table + \header + \li 原图 + \li 对比图 + \row + \li @image html coloroverlay_imageSouce.png + \li @image html coloroverlay_imageOverlay.png + \endtable + +@property bool ColorOverlay::cached +@brief 该属性用于指定是否启用缓存 +@details + 当源数据的状态不会发生动态改变时,开启缓存 + 能够大幅提高渲染性能。该属性在硬件渲染(GPU渲染)模式下默认为 false, + 在软件渲染(CPU渲染)模式下为 true. + +@property color ColorOverlay::color +@brief 该属性用于指定覆盖的颜色,未指定即表示不覆盖任何颜色。 +@details + 在硬件渲染(GPU渲染)模式下,\c color 能够跟每个像素点的颜色进行 + alpha通道混合,保证每个像素点在混合后的多样化。软件渲染模式下,该 + 颜色混合通常使用 Qt 的混合模式进行混合。 + +@property color ColorOverlay::source +@details + 该属性用于指定颜色覆盖的源,它可以是一个一般控件,也可以是图片等资源数据. + 但不支持将自身作为源进行眼哦色覆盖. + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dconfigwrapper.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dconfigwrapper.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dconfigwrapper.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dconfigwrapper.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,48 @@ + +/** +@~chinese +@class Config +@ingroup QtObject +@brief 一个 DTK 配置项中的配置信息类. +@details + Config 用于提供专门为 DSG配置管理的统一的读写函数,其主要用于更方便的在 SettingsDialog 中进行配置项的实时更新,当然 + SettingDialog 是作为用于前端配置信息展示的窗口,为了提供自定义配置,该类允许放置在自定义的控件上。 + 该类会读取 name 中指定的文件名的文件中存在的属性,当其控件内部存在该配置文件中同名的属性时,对该属性上的所有修改,都将 + 在文件内对应的同名配置项中生效。 + 例如以下代码: +```qml + import org.deepin.dtk 1.0 + + Config { + name: "example" + property string key : "key default" + } +``` + 同样地,当配置文件中名为 "key" 的配置项发生了数据改变,该 Config 的 key 属性也会触发 changed 信号。 + 需要注意的是,当 Config 中添加了配置文件中不存在的配置项属性,该配置文件不会检测并添加一个新的配置项,其属性的改变也不会对 + 配置文件造成任何修改。同样地,当配置文件中存在配置项,而 Config 中并未添加同名属性时,该配置项的改变不会触发 Config 中任 + 何属性的变化。 + +@property string Config::name +@brief 指定配置文件名称。 + +@fn Config::value(string key, variant fallback) +@brief 获取配置文件中对应 \a key 下的值,当 \a key 获取不到时返回 \a fallback 的值。 +@details 该函数除了可以访问在 Config 中添加了同名属性的配置项外,也能获取为设置属性的额外配置项。 + +@fn Config::setValue(string key, variant value) +@brief 设置`key`下的`value`值 +@details 该函数只能设置配置文件中 `key`对应的值,对于`key`是一个不存在或非法值,该函数无法正确设置。 + +@fn Config::keyList() +@brief 获取该 Config 项下的所有键值列表。 + +@fn Config::isValid() +@brief 判断当前 Config 是否有效。如果有效返回 \c true 否则返回 \c false。 + +@signal Config::valueChanged(string key) +@brief 该信号在`key`对应的配置项内容发生改变时发出 +@details 通常情况下,如果 Config 中存在一个同名的配置项属性时,无需在使用该信号检测配置项的改变。 + 而直接使用属性槽函数绑定的形式进行。但对于没创建对应属性的配置项,可以通过该信号检测到`key`对应的配置项值的变化。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dopacitymask.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dopacitymask.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dopacitymask.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dopacitymask.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,74 @@ + +/** +@~chinese +@class OpacityMask +@ingroup Item + + \keyword DOpacityMask +@brief 一个同时支持软件和硬件渲染的不透明度遮罩控件. +@details + 能够同时支持软件渲染和硬件渲染,其能够为源材质提供一种不透明度遮罩。 + 使源材质能够作用做遮罩中。其硬件渲染(GPU渲染)模式和 Qt Graphical Effects + 保持一致。软件模式下无法针对每个源材质的像素点进行遮罩处理,软件模式 + 使用 Qt 的混合模式实现。 + 其用法可用如下示例表示: +```qml + import org.deepin.dtk 1.0 + + Item { + width: 300 + height: 300 + + Image { + id: bug + source: "html bug.jpg" + sourceSize: Qt.size(parent.width, parent.height) + smooth: true + visible: false + } + + Image { + id: mask + source: "html butterfly.png" + sourceSize: Qt.size(parent.width, parent.height) + smooth: true + visible: false + } + + OpacityMask { + anchors.fill: bug + source: bug + maskSource: mask + } + } +``` + 其效果如下所示: + \table + \header + \li 源材质 + \li 遮罩材质 + \li 应用效果 + \row + \li @image html opacityMask_sourceExample.jpg + \li @image html opacityMask_MaskExample.jpg + \li @image html opacityMask_effectExample.jpg + \endtable + +@property bool OpacityMask::cached +@details + 该属性用于提升性能,开启缓存后效果仅会在源材质和遮罩发生改变时修改,其他方式进行 + 的更新都无法更新应用效果。默认情况下该属性为 false. + +@property bool OpacityMask::invert +@details + 该属性用于控制应用效果的 alpha 值,当 \c invert 设置为true 时,效果的 + alpha 值为源材质乘以遮罩的倒数,如 As * (1 - Am),设置为 false 是,效果 + 为源材质乘以遮罩,如 As * Am。默认情况下,改值为 false。 + +@property var OpacityMask::maskSource +@details 该属性用于指定遮罩材质的数据,遮罩被渲染到目标中被用于确定形状和alpha值。 + +@property var OpacityMask::source +@details 该属性用于指定源材质的数据,源材质用于指定最终效果的内容,其alpha通道会和遮罩材质进行混合。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dqmlglobalobject.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dqmlglobalobject.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dqmlglobalobject.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dqmlglobalobject.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,616 @@ + +/** +@~chinese +@class Color + +@brief`DTK 项目中统一的颜色类型. +@details + Color 是`DTK 中为了适配 QPalette 部分颜色角色枚举,适配 Qt 的基础的颜色以及所有 + 的 RGB 的颜色值。除此之外,该类能很好的兼容`ColorSelector 的取色系统和`Palette + 取色器调色板。 + 构造`Color 对象有两种方式,一种是通过 QColor 对象,QColor 能够兼容使用字符串、Qt枚举 + 等等方式,因此使用 QColor 构造`DTK 的`Color 同样能兼容上述方式。另外一种是通过 QPalette + 的部分枚举值,目前仅支持使用`Highlight 和`HighlightText 这两种枚举值。该枚举在`Color + 对象的`Type 枚举中有定义。 + + \section2 Color.Type + Type 枚举定义了颜色是什么类别,其与 QPalette::ColorRole 枚举描述一致,当需要使用一个抽象的颜色角色时, + 可以通过指定该类别,其颜色最终根据其控件的对应调色板颜色。 + + \table + \row + \li Color.Invalid + \li 无效 Type。此类枚举表示该类型是一个无效类型或者为具体颜色类型,非调色板数据类型。 + + \row + \li Color.Highlight + \li 高亮色,对应于 QPalette::Highlight ,并且其颜色也从其所处控件的 Highlight 调色板中获取 + + \row + \li Color.HighlightedText + \li 高亮文本色,对应于 QPalette::HighlightedText,其使用场景在高亮的背景下文本或者前景需要展示 + 的颜色。 + + \endtable + +@fn bool Color::isValid() +@return 判断当前颜色值是否有效,有效则返回 true, 否则返回 false。 + +@fn bool Color::isTypedColor() +@brief 判断当前颜色是否是一种已标记颜色(或称调色板颜色)。 +@return 是调色板颜色则返回 true,否则返回 false。 +@details + 通过`Color.Type`构造的颜色都是类型颜色,而通过 QColor 构造的颜色不是类型颜色。 + 类型颜色不是一个具体的颜色值,它需要一个具体的 QPalette 对象才能获取具体颜色。 + +@fn color Color::toColor(var palette) +@brief 转换`Color` 类型的颜色为`QColor 类型的颜色 +@details 该函数能够将`Color 类型转化成一个具体的 QColor 颜色类型。 + 通过判断`Color.Type 类型的颜色值,从`palette` + 参数中获取`Color 使用的调色板对应的具体颜色值。 +@return 返回对应调色板数据的 QColor 颜色值。 + +@fn color Color::color() + 将`Color 类型转换成 QColor 类型,当`Color 指定了`lightness 或`opacity 属性时,该颜色 + 会将这两种属性设置到输出的颜色中。 +@return 将转换后的 QColor 类型。 +@note 该函数不适用 Typed 颜色类型 + +@fn Color Color::lightness(int floatValue) + 将自身的`Color 提高/降低 \a floatValue 大小的亮度,并返回。 + +@return 返回调整亮度后的 Color 类型颜色。 + +@fn Color Color::opacity(int floatValue) + 将自身的`Color 提高/降低 \a floatValue 大小的不透明度,并返回。 + +@return 返回调整不透明度后的 Color 类型颜色。 + +/** +@~chinese +@class DTK +@brief 提供一个全局的`DTK 对象,保证QML中能够获取`DTK 的相关枚举和函数. +@details + DTK 对象可以更方便地在QML中使用,它提供了一些统一的函数、属性以及枚举值,它能够更快捷的 + 访问一些系统信息和图形化配置,下述代码简单展示了其使用方式: +```qml + import org.deepin.dtk 1.0 + + Text { + color: DTK.selectorColor(palette.window, "black", "white") + text: "WindowManager: " + DTK.windowManagerNameString() + } +``` + \section1 枚举 DTK 将一些通用的枚举类型封装起来,当做控件的枚举统一进行使用。在使用DTK封装的控件中, + 能够很容易看到他们的使用场景。例如,你可以设置控件Z轴坐标,来控制控件的层级关系,使用 DTK.BottomOrder 来设置最底层控件,使用`DTK.TopOrder 设置最顶层控件坐标。 + + \section2 DTK.ControlState@brief Control 控件的状态,\c Control 控件或继承于`Control 控件都有多种状态,如:hover、 + press、disabled等等,该枚举能够在 DTK 的其他控件中使用进行统一,例如在`ColorSelector + 中可以通过该枚举控制控件的状态,`DciIcon 中可以通过设置值指定图标的状态等等。 + + \table + \row + \li`DTK.NormalState + \li + Control 控件的 normal 状态,是控件最原始的状态,控件在未处理任何事件且可用时的 + 一种状态。 + + \row + \li`DTK.HoveredState + \li + Control 控件当鼠标放置到控件时的状态。 + + \row + \li`DTK.PressedState + \li + Control 控件当鼠标按压时的控件状态。 + + \row + \li`DTK.DisabledState + \li + Control 控件在禁用时的状态,当控件的 enable 属性设置为 false 状态时,就是该种状态。 + 这种状态下,无法接受任何鼠标事件。 + + \row + \li`DTK.InactiveState + \li + Control 控件在未激活下的状态,当窗口处于非焦点状态下,该窗口下的所有控件都是未激活状态。 + + \endtable + + \section2 DTK.ZOrder + Control 的 z 属性表示的控件的层级堆叠关系,当某个控件的 z 值比其他所有控件的 z 值都低时, + 表示该控件在最低层显示,可以被其他控件覆盖。`DTK 提供了一种便捷方式设置该属性,就是这个 + 枚举值。 + + \table + \row + \li`DTK.BottomOrder + \li + 最底层控件,其层级关系是所有控件中最低的。 + + \row + \li`DTK.BelowOrder + \li + 下层控件,这个层级关系比`DTK.BottomOrder 高,它能够覆盖`DTK.BottomOrder 层 + 的控件。 + + \row + \li`DTK.NormalOrder + \li + 常规控件,当控件不设置 z 属性时默认就是该值,这是大多数控件的层级大小,它比`DTK.BelowOrder + 和`DTK.BottomOrder 都高。 + + \row + \li`DTK.AboveOrder + \li + 普通上层控件,该层级大小大于`DTK.NormalOrder 的层级大小。 + + \row + \li`DTK.TopOrder + \li + 顶层控件,顶层控件显示在所有控件之上,能够遮盖住其他枚举状态的所有控件。目前如`TitleBar 等 + 控件正在使用这种层级堆叠枚举。 + + \endtable + + \section2 DTK.PopupMode + Popup 控件窗口弹出模式(Menu 等继承于 Popup 的控件也适用), 默认情况下所有的 Popup 控件类型 + 为 DTK.AutoMode 模式。 + + \table + \row + \li`DTK.AutoMode + \li + 自动模式,能够根据 “D_POPUP_MODE” 环境变量的值指定,如果该变量被设置为 “embed”,则为嵌入式弹出 + 窗口类型,否则为独立式窗口类型。 + + \row + \li`DTK.WindowMode + \li + 独立式窗口模式,该模式下窗口能够独立于其他窗口显示,作为一个单独的窗口,类似于 dtkwidget 的 Menu 窗口 + 类似。 + + \row + \li`DTK.EmbedMode + \li + 嵌入式窗口模式,默认的 qtdeclarative 项目风格的 Menu 和 Popup 控件为该类型,此模式将 Popup 窗口嵌入 + 其父窗口内部,其显示无法超出父窗口的大小,并且会根据父窗口的位置和大小而发生适应性变化。 + + \endtable + + \section2 DTK.ArrowDirection + 箭头方向枚举,如`Slider 控件中箭头滑块, 当`Slider 控件需要有上下左右的标签时,需要指定`Slider + 滑块的方向。 + + \table + \row + \li`DTK.UpArrow + \li + 上箭头 + + \row + \li`DTK.DownArrow + \li + 下箭头 + + \row + \li`DTK.LeftArrow + \li + 左箭头 + + \row + \li`DTK.RightArrow + \li + 右箭头 + + \endtable + + \section1 函数 + 使用DTK中提供的函数能够更好的兼容DTK控件的使用方式,能快捷的适配DTK控件的特殊使用场景。 + 例如,一些标准的窗口信息函数,可以获取到窗管的无标题和混成模式等等信息;DTK 通用颜色可以 + 通过函数进行颜色混合、颜色调整以及特殊颜色的创建。以下将从几个方面展开描述 DTK 提供的一些 + 基本通用函数: + + \section2 窗管信息 + QML中能够快速通过这些函数快速获取到当前窗管的一些属性,其中包含获取窗管是否支持模糊,是否支持混成, + 是否处于无标题以及是否是软件渲染的状态。 + + \list + \li \l{DTK::hasBlurWindow}{bool DTK.hasBlurWindow()} + \li \l{DTK::hasComposite}{bool DTK.hasComposite()} + \li \l{DTK::hasNoTitlebar}{bool DTK.hasNoTitlebar()} + \li \l{DTK::isSoftwareRender}{bool DTK.isSoftwareRender()} + \li \l{DTK::windowManagerName}{int DTK.windowManagerName()} + \li \l{DTK::windowManagerNameString}{string DTK.windowManagerNameString()} + \endlist + + \section2 主题相关 + DTK程序默认都适配明/暗主题,DTK程序在某些情况下需要获取明暗主题相关的接口,或者获取平台主题和应用主题 + 的相关配置时,可以调用这些接口信息。 + + \list + \li \l{DTK::themeType}{int DTK.themeType()} + \li \l{DTK::platformTheme}{Object DTK.platformTheme()} + \li \l{DTK::toColorType()}{int DTK.toColorType()} + \li \l{DTK::selectColor()}{color DTK.selectColor()} + \endlist + + \section2 消息通知 + DTK能够使用全局对象的方式发送消息,以下函数提供了一种便捷的发送窗口内通知的快捷方式。 + \list + \li \l{DSendMessageFromContent}{DTK.sendMessage()} + \li \l{DSendMessageFromComponent}{DTK.sendMessage(Object)} + \li \l{DCloseMessageFromMessageObject}{DTK.closeMessage(Container)} + \li \l{DCloseMessageFromMessageId}{DTK.closeMessage(Object)} + \endlist + + \section2 颜色相关 + DTK提供了相关函数能够更方便的调整颜色,获取调色板信息。 + \list + \li \l{DTK::palette}{DTK.palette()} + \li \l{DTK::inactivePalette}{DTK.inactivePalette()} + \li \l{DTK::blendColor()}{color DTK.blendColor()} + \li \l{DTK::makeColor(Color::Type type)}{DTK.makeColor(type)} + \li \l{DTK::makeColor(color)}{DTK.makeColor(color)} + \endlist + + \section2 图标相关 + DCI图标相关的统一接口,例如兼容QIcon和DciIcon的附加属性、将QPalette属性设置到IconPalette中等等。 + \list + \li \l{DTK::makeIcon()}{DTK.makeIcon()} + \li \l{DTK::makeIconPalette()}{DTK.makeIconPalette()} + \endlist + + \section2 其他函数 + 其它未汇总的函数,例如一些系统信息,字体管理,以及弹出菜单的嵌入模式等等 + \list + \li \l{DTK::fontManager}{DTK.fontManager()} + \li \l{DTK::makeShadowImageUrl()}{DTK.makeShadowImageUrl()} + \li \l{DTK::deepinWebsiteName}{DTK.deepinWebsiteName()} + \li \l{DTK::deepinWebsiteLink}{DTK.deepinWebsiteLink()} + \li \l{DTK::deepinDistributionOrgLogo}{DTK.deepinDistributionOrgLogo()} + \li \l{DTK::cursorPosition}{DTK.cursorPosition()} + \li \l{DTK::setPopupMode()}{DTK.setPopupMode()} + \endlist\m + +@property bool DTK::hasBlurWindow +@note 此属性为只读属性 + + 如果当前窗口管理器支持窗口背景模糊特效则返回 true,否则返回 false + +@property bool DTK::hasComposite +@note 此属性为只读属性 + + 如果当前窗口管理器支持混成则返回 true,否则返回 false + +@property bool DTK::hasNoTitlebar +@note 此属性为只读属性 + + 如果窗口管理器当前支持设置隐藏窗口标题栏则返回 true,否则返回 false + +@property bool DTK::isSoftwareRender +@note 此属性为只读属性 + + 如果当前窗口渲染模式为软件,则返回 true,否则返回 false + +@property string DTK::windowManagerNameString +@note 此属性为只读属性 + + 当前使用的窗口管理器名称 + +@property int DTK::themeType +@note 此属性为只读属性 +@brief 程序的主题类型. +@details + 当themeType为UnknownType时, 将自动根据 + GuiApplication::palette的QPalette::background颜色计算主题 + 类型, 否则与 paletteType 的值一致. 程序中应当使用此值作为 + 暗色/亮色主题类型的判断. + +@property int DTK::windowManagerName +@note 此属性为只读属性 +@brief 窗口管理器名称枚举. + + 目前包含 deepinWM, KWinWM 和其他窗口管理器。 + +@property Object DTK::platformTheme +@note 此属性为只读属性 +@brief + 返回应用程序的平台主题实例. + + 平台主题能够获取到一些系统级的主题配置,如图标主题,铃声主题,窗口圆角, + 调色板颜色信息等等相关配置。 + +@property FontManager DTK::fontManager +@note 此属性为只读属性 +@brief + 应用程序的字体管理器实例实例. + + 字体管理器通过使用 t1 - t10 的字体字号进行 + 统一管理,同时也能设置一些自定义的特殊字号。 + +@property qpalette DTK::palette +@note 此属性为只读属性 +@brief + 返回应用程序默认的调色板主题 + +@property qpalette DTK::inactivePalette +@note 此属性为只读属性 +@brief + 应用程序默认的未激活状态的调色板主题 + +@fn color DTK::blendColor(color substrate, color superstratum) +@brief 将 \a substrate 和 \a superstratum 颜色进行混合,形成一种新的颜色。 + 该颜色通过 alpha 通道的权重值进行混合运算,新的颜色值中 RGB 等于 \a substrate 的 RGB + 值 * (1 - \a superstratum 的 alpha 值) 加上 \a superstratum 的 RGB 值 * superstratum + 的 alpha 值, 新颜色的 alpha 值和底色的 alpha值一致。 +@return 返回调整后的颜色值 + +@fn Color DTK::makeColor(Color::Type type) +@brief 根据 \a type 类型创建出 Color 实例,目前 type 包含 + Highlight 和 HighlightedText 两种。 +@return 返回转换后的 Color 类型的颜色值。 + +@fn Color DTK::makeColor(color c) +@brief 将 \a c 转换成 Color 并返回。 Color 能够兼容 QColor 和 type + 两种模式。 +@return 返回转换后的 Color 类型的颜色值。 + +@fn url DTK::makeShadowImageUrl() +@brief 内部DTK接口,用于创建 shadow image 的url链接,其实现方式是将其内部属性 + 全部都添加到一个URL中,用于最后渲染Image时获取对应属性。 +@return 返回阴影的 Url 用于解析获取。 + +@fn int DTK::toColorType(color c) + 用于根据一个指定的颜色 \a c ,返回在该颜色下对应的系统主题。 + 最常用的方式是通过传入`Control 中调色板属性中的 window + 颜色来判断主题类型。 + +@return 亮色主题颜色返回 ApplicationHelper.LightType, 暗色主题 + 返回 ApplicationHelper.DarkType + +@fn color DTK::selectColor(color windowColor, color light, color dark) + 用于根据一个指定的颜色 \a windowColor ,判断当前程序正在使用的 + 系统主题,并根据不同主题返回对应的 \a light 和 \a dark 颜色。 + +@return 当 LightType 时返回 \a light , 当 DarkType 时返回 \a dark 。 + +@property string DTK::deepinWebsiteName +@note 此属性为只读属性 +@brief deepin 网站名称。 + +@property string DTK::deepinWebsiteLink +@note 此属性为只读属性 +@brief deepin 网站链接。 + +@property string DTK::deepinDistributionOrgLogo +@note 此属性为只读属性 +@brief deepin 组织 Logo 路径。 + +@property point DTK::cursorPosition +@note 此属性为只读属性 +@brief 鼠标当前位置的属性。 + Qt 中返回鼠标位置只能通过 MouseArea 控件,但当多个该控件一起 + 就存在覆盖而无法正确接受事件的可能,因此 DTK 提供一个可以直接 + 访问鼠标位置的接口,方便QML程序获取并使用。 + +@fn DciIcon DTK::makeIcon(QtIcon, DciIconAttached) +@brief + 兼容 \a QtIcon 的属性,将 DciIcon 附加属性值和 \a QtIcon 的属性值添加到 + DciIcon 实例中。这种方式大多在控件图标为 \a QtIcon 时使用,在添加 \a QtIcon + 的属性后,可以通过添加 DciIcon 附加属性,将其进行整合,例如 Button 控件。 +```qml + import org.deepin.dtk 1.0 + + Button { + width: 50 + height: 50 + + icon.name: "apple" + icon.width: 24 + icon.height: 24 + DciIcon.palette.foreground: "red" + DciIcon.mode: DTK.HoveredState + DciIcon.theme: ApplicationHelper.DarkType + } +``` + 上述方式这样实现是由于,Button 的属性 icon 为 QtIcon, 而其内部的图标控件是 DciIcon, + 因此为了保持兼容,在使用方式上不存在差别,才衍生出该函数进行整合。Button 中使用该函数进行 + QtIcon 和 DciIcon 附加属性进行绑定的场景如下: +```qml + import org.deepin.dtk 1.0 + + Button { + id: control + contentItem: IconLabel { + icon: DTK.makeIcon(control.icon, control.DciIcon) + } + } +``` +@return 返回兼容后的 DciIcon 图标实例。 + +@fn DciIcon::Palette DTK::makeIconPalette(qpalette) +@brief + 根据 \a qpalette 创建图标的调色板属性。 图标调色板和控件调色板是分开的 + 图标调色板分为 Foreground Background HighlightForeground 和 Hightlight 四种 + 某些图标的图层会使用该类调色板进行着色,当控件使用`QPalette 时,可以将`QPalette + 和 DDciIconPalette 兼容。 + 例如以下使用场景: +```qml + import org.deepin.dtk 1.0 + + Control { + property alias icon: _icon + DciIcon { + id: _icon + anchors.centerIn: parent + sourceSize { + width: 50 + height: 50 + } + + palette: DTK.makeIconPalette(parent.palette) + } + + } +``` +@return 返回转化后的 DciIcon 中的 palette 属性,返回后的实例可直接应用在 DciIcon + 的属性中进行属性绑定。 + +@fn bool DTK::sendMessage(object target, string content, string iconName, int duration, string msgId) + \keyword DSendMessageFromContent +@brief + DTK 提供一种能在全局发送应用内通知的方式,目前有两种方式:一种是提供所有的通知信息,DTK 进行托管显示,并设置关闭或手动关闭。 + 一种是提供消息的 Component 组件,DTK 负责布局和管理,组件自身提供样式和关闭策略。 + + 以下函数代表的第一种情况, \a target 可以使用目标对象或者目标对象所处的`window 。 \a content 为需要显示的文本信息 + \a iconName 为可选参数,当需要显示图标时,可传入图标名称。 \a duration 为可选参数,代表消息显示的时长,默认时间为 4 秒, + 当 \a duration 参数为 -1 时,表示该显示为常驻消息,关闭需要手动点击关闭按钮才行。 \a msgId 为可选参数,当 \a msgId 未 + 指定时,显示的消息将都为不同类消息,当多个消息的 \a msgId 一致时,后面的消息会替换同类型的前面的消息。 + + 其使用方法如下展示: +```qml + import org.deepin.dtk 1.0 + + Button { + text: "FloatingMessage" + property int count: 0 + onClicked: { + DTK.sendMessage(control, "message" + count) + DTK.sendMessage(Window.window, "message" + count, "music", 4000, "type1") + DTK.sendMessage(Window.window, "message" + count, "video", -1) + count++ + } + } +``` + +@fn bool DTK::sendMessage(object target, component delegate, var message, int duration, string msgId) + \keyword DSendMessageFromComponent + + 这种方式跟 \l {DSendMessageFromContent}{DTK.sendMessage()} 类似,不同的是, + 它可以使用自定义创建的`FloatingMessage 和`FloatingMessageContainer 组件进行指定。 + \a target 可以使用目标对象或者目标对象所处的`window 。 \a delegate 为消息显示的代理组件,可以使用`DTK 封装好的@brief FloatingMessage 添加自定义文本或者策略进行显示,也可以自己封装`FloatingMessageContainer 实现自定义的消息组件,当然 + 后面这种方式的成本更高。 \a message 参数指定 \a delegate 组件封装时需要用的额外参数,例如“content”,“iconName”等内容,由于@brief Component 存在作用域的问题,问了更方便的获取到这些数据对象,防止出现属性绑定失败的情况,DTK 消息推荐将数据对象传入到 \a message + 参数中, \a message 接收一个 JSON 的键值对类型,数据通过键值对进行访问,例如下述示例: +```qml + import org.deepin.dtk 1.0 + + Button { + text: "FloatingMessage" + onClicked: { + DTK.sendMessage(control, floatingMsgCom, {content: "message....", iconName: "music"}, -1) + } + + Component { + id: floatingMsgCom + FloatingMessage { + } + } + } +``` + + 上述代码中 \a message 变量传入了“{content: "message....", iconName: "music"}”参数,值得注意的是, FloatingMessage 中自带了两个 + 默认的 “key”,如上面参数展示,其分别是 “content” 和 “iconName”,分别对应的是文本内容和图标名称。对于一些自定义的键值对,可以使用如下方式 + 添加: + +@ + import org.deepin.dtk 1.0 + + Button { + text: "FloatingMessage" + onClicked: { + DTK.sendMessage(control, floatingMsgCom, {text: "message....", iconName: "music"}, -1) + } + + Component { + id: floatingMsgCom + FloatingMessage { + id: floatMsg + contentItem: RowLayout { + anchors.fill: parent + spacing: 0 + + Label { + Layout.fillHeight: true + Layout.fillWidth: true + text: floatMsg.message.text + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft + Layout.alignment: Qt.AlignVCenter + font: DTK.fontManager.t6 + wrapMode: Text.Wrap + elide: Text.ElideRight + maximumLineCount: 1 + } + + Button { + text: "reload" + font: DTK.fontManager.t5 + Layout.alignment: Qt.AlignVCenter + } + } + } + } + } +``` + + \a duration 为可选参数,代表消息显示的时长,默认时间为 4 秒,当`duration 参数为 -1 时,表示该显示为常驻消息,关闭需要手动点击关闭按钮才行。 + \a msgId 为可选参数,当 \a msgId 未指定时,显示的消息将都为不同类消息,当多个消息的 \a msgId 一致时,后面的消息会替换同类型的前面的消息。 + +@fn void DTK::closeMessage(object message) + \keyword DCloseMessageFromMessageObject + + 关闭浮动消息的统一接口,当使用 \l {DSendMessageFromComponent}{DTK.sendMessage(Object)} 接口时, + 当自己重新定义`Component \a message 后,如果重载了其内部属性,就需要手动处理关闭该消息的动作。否则需要等待 duration 结束才能关闭,该种使用场 + 景可以通过下述方式描述: + +```qml + import org.deepin.dtk 1.0 + + Button { + text: "FloatingMessage" + onClicked: { + DTK.sendMessage(control, floatingMsgCom, {content: "message...."}, -1) + } + Component { + id: floatingMsgCom + FloatingMessage { + id: floatMsg + button: Button { + text: "close" + onClicked: { + console.log("close clicked") + DTK.closeMessage(floatMsg) + } + } + } + } + } +``` + +@fn void DTK::closeMessage(object target, string msgId) + \keyword DCloseMessageFromMessageId + + 通过 \a msgId 关闭浮动消息,其中 \a target 表示浮动消息所在的 Item 或 Window 控件。 + 当控件中存在 \a msgId 指定的消息时,通过该接口可直接将该消息关闭。\a msgId 与 sendMessage() + 接口中的 \a msgId 相对应。 + +@fn void DTK::setPopupMode(int mode) + + 设置 Popup 类型窗口的弹出方式,目前 \a mode 可以设置为 嵌入式弹出窗口( EmbedMode )或者 独立式弹出窗口( WindowMode )两种模式 + ,其默认值为 AutoMode, 该模式会根据窗口情况进行自动选择。除此之外,还能通过修改环境变量的方式: + + 可以在 main 函数开头添加如下代码: +```qml + int main(int argc, char **argv) + { + qputenv("D_POPUP_MODE", "embed"); + ... + return a.exec(); + } +``` + 当 “D_POPUP_MODE” 的值为非 “embed” 表示为独立式窗口。 +TODO:这个文档需要仔细确定 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dquickbehindwindowblur.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dquickbehindwindowblur.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dquickbehindwindowblur.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dquickbehindwindowblur.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,51 @@ + +/** +@~chinese +@class BehindWindowBlur +@ingroup Item + + \keyword DQuickBehindWindowBlur +@brief 提供一个能使窗口背景模糊的控件. +@details + DTK 中窗口可以实现模糊特效,当设置该特效后,窗口的特定区域将会对窗口后面的背景进行模糊填充。使用模糊特效能够丰富窗口的视觉内容 + ,使窗口更加具备层次感和立体感。 BehindWindowBlur 控件能够很容易的实现该效果,其效果与 dtkwidget 中 DBlurEffectWidget 类 + 的效果类似,但在实现方式上有很大不同,在 QML 中使用 BehindWindowBlur 将更加灵活可控,例如 BehindWindowBlur 可以指定特殊区域 + 模糊,而另外的区域不模糊, 且模糊背景的颜色能与特定的颜色进行混色显示。 + BehindWindowBlur 在使用方式上非常简单,它能够直接用在 Window 控件上,例如下述代码,其属性的设置和添加都更加方便和简单: +```qml + import QtQuick.Window 2.11 + import org.deepin.dtk 1.0 + + Window { + id: root + DWindow.enabled: true // 开启 DTK 中窗口的圆角和无边框等特殊属性 + DWindow.alphaBufferSize: 8 // 设置 DTK 窗口 alpha 通道的缓冲区大小 + + BehindWindowBlur { + control: root + anchors.fill: parent + blendColor: Qt.rgba(1, 0, 0, 0.3) + } + } +``` + 其最终的效果如下图所示: +@image html behindwindowblur.png + 模糊特效分为窗口内模糊和窗口外模糊,窗口内模糊即对窗口内部控件所使用到的背景进行模糊;窗口外模糊即对窗口外部背景进行模糊。当前类进行 + 的模糊操作为窗口外模糊,其大多数情况下使用在窗口控件,对窗口的背景进行模糊渲染,并填充到窗口中。 BehindWindowBlur 类对模糊进行了 + 基本封装,可用于更灵活的场景中,例如一些特殊的混合填充色, StyledBehindWindowBlur 类同样也能对窗口进行模糊,但不同的是该类针对 + 行云设计中的模糊背景色对混合填充色进行了具体设置。用户在使用 StyledBehindWindowBlur 类时无需关心需要混合那种颜色。 + +@property real BehindWindowBlur::cornerRadius +@brief 该属性表示模糊矩形的半径大小。 +@details 模糊区域作为一个矩形大小的控件进行展示,因此该属性被用于指定矩形的圆角大小。 + +@property color BehindWindowBlur::blendColor +@brief 该属性表示与目标区域混合的颜色 +@details 当不指定颜色时,该背景模糊后直接展示到控件上;当指定颜色时,会将颜色与模糊背景进行混合,使模糊背景的色调呈现出与混合颜色相似的色调。 + +@property bool BehindWindowBlur::valid +@note 该属性为只读属性 +@brief 用于判断当前窗口状态是否支持窗口外模糊。 +@details 如果支持窗口外模糊,返回 true,否则返回 false。该属性在窗口管理器层访问其是否支持模糊效果。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dquickbusyindicator.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dquickbusyindicator.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dquickbusyindicator.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dquickbusyindicator.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,39 @@ + +/** +@~chinese +@class BusyIndicator +@ingroup Control + + \keyword DQuickBusyIndicator +@brief 一个用于在用户界面显示用于需要等待的控件. + + DTK 程序统一的等待控件,展示在用户需要等待的地方,例如系统还原界面等待时、开机启动 + 等待时。没有具体的等待时间,不知道进度可能很快也可能很慢时。 + + 该控件可自由设置控件大小来控制需要等待显示的大小,用于不同场景中,如下述代码所示: + +@ + import org.deepin.dtk 1.0 + + BusyIndicator { + running: true + width: 32 + height: 32 + } +``` + +@image html dtk-spinner-blue.png + + + +@property color BusyIndicator::fillColor + + 用于填充 BusyIndicator 控件的具体颜色,默认是透明色,颜色可根据属性动态变化, + 一般情况下可使用高脸色。 + + + +@property bool BusyIndicator::running + + 该属性用于控制动画是否进行,默认不自动进行。 + diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dquickcontrolpalette.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dquickcontrolpalette.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dquickcontrolpalette.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dquickcontrolpalette.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,778 @@ + +/** +@~chinese +@class Palette +@ingroup QtObject + + \keyword DQuickControlPalette +@brief DTK 中用于取色器(ColorSelector)使用的统一调色板对象. +@details + DTK 程序统一的调色板对象,其作为 ColorSelector 进行颜色选择的载体,通常情况下 + 具备“Normal”,“Hovered”,“Pressed”和“Disabled”四种不同的状态,但并所有的状 + 态都需要指定颜色,可根据控件情况自由选择需要的状态。其使用方式如下述代码所示: +```qml + import org.deepin.dtk + + Palette { + normal: "red" + hovered: "green" + pressed: "blue" + disabled: "black" + } +``` + 当未找到对应控件调色板下的指定状态时,取色器(ColorSelector)会选择 “normal” 状态 + 的颜色进行代替。 + 调色板拥有一些其他的额外属性,下面按照分类的方式展示: + \section1 主题适配 + 调色板的状态颜色值并非一个固定值,有的时候控件的某种颜色在系统的不同主题下,存在不一致的情况,有的 + 能够使用公式进行关联,而有的差异千差万别,这样就无法关联在一起。Palette 控件通过不同属性值来控制 + 亮色和暗色主题的颜色。具体为在各个状态的名称中添加了 “Dark” 关键字,例如“normalDark”。通常情况 + 下,当控件的深浅主题调色版颜色一致时,不需要指定“Dark”状态的颜色,而在控件深浅主题颜色不通用时指定。 + 例如下述代码: +```qml + import org.deepin.dtk + + Palette { + normal: "red" + normalDark: "black" + hovered: "green" + hoveredDark: "yellow" + } +``` + + \section1 禁用与启用 + 调色板可控制其状态属于禁用或者启用,这在需要动态调整调色板的使用时非常有用。取色器(ColorSelector) + 会忽略禁用的属性并向上寻找其父类的该同名调色板。其使用方式如下所示: +```qml + import org.deepin.dtk + + Palette { + normal: "red" + enabled: false + } +``` + + \section1 颜色族 + \target Palette color family + 颜色族(family),默认的颜色族为“common”,当取色器(ColorSelector)修改其当前颜色族时,会将其使用 + 的所有调色板颜色进行重新选择,选择出对应的颜色族。目前可以使用的颜色族有两种,分别是"common"和"crystal" + 颜色族。基础的控件颜色都需要定义在"common"颜色族中,而"crystal"颜色族用于指定类似“水晶”效果(即能够透过 + 控件本身颜色看透其背后控件的类似效果)的颜色值。如"TransparentButton"控件。 + + \table + \header + \li 颜色族 + \li 描述 + \row + \li \c common + \li 基础颜色族,未指定时默认初始化该数据,用于基础的控件颜色。 + \row + \li \c crystal + \li 水晶颜色族,用于特殊情况下的控件需要出现类似“水晶”效果时,指定的颜色 + 例如,Dialog 中的内部控件,如按钮等,其背景和默认的按钮背景不一致。 + \endtable + + 下述使用方式展示了如何在调色 + 版中使用颜色族: +```qml + import org.deepin.dtk + + Palette { + normal { + common: "#f0f0f0" + crystal: Qt.rgba(0.20, 0.2, 0.2, 0.1) + } + hovered: "#d2d2d2" // common family + pressed.crystal: "#cdd6e0" // crystal family + } +``` + + \section1 QPalette 调色板适配 + DTK 调色板能够适配 Qt 调色板的部分颜色属性,如高亮色和高亮文本色,具体使用方式如下: +```qml + Palette { + normal: DTK.makeColor(Color.Highlight) + hovered: DTK.makeColor(Color.Highlight).lightness(+10) + pressed: DTK.makeColor(Color.Highlight).opacity(-10) + } +``` + QPalette 调色板属性进行颜色微调。如上述代码,调整其亮度和不透明度等属性。除此之外 + 可修改饱和度 (saturation) 和 色调 (hue),颜色的取值范围为[100, +100] + +@property bool Palette::enabled +@brief 调色板对象是否启用 +@details 取色器会寻找其父类中最近一个同名的调色板对象,并取其颜色值。默认情况下,该属性为 true + +@propertygroup :Palette::normal +@property Color Palette::normal.common +@property Color Palette::normal.crystal + + 控件 “Normal” 状态下的颜色,“Normal”状态对应于控件最基本的状态,是每个控件都 + 存在的状态,取色器根据控件是否处于 normal 状态来控制其选择调色板颜色。 + +@propertygroup Palette::normalDark +@property Color Palette::normalDark.common +@property Color Palette::normalDark.crystal + + 控件 “Normal” 状态下暗色主题下的颜色,该属性只在暗色主题下生效,当控件不对 + 主题色敏感时,取色器只会选取 normal 属性的颜色。 + +@propertygroup Palette::hovered +@property Color Palette::hovered.common +@property Color Palette::hovered.crystal + + 控件 “Hovered” 状态下的调色板颜色,“Hovered” 属性表示控件被鼠标悬浮是的状态, + 一些控件,如“Button”、“LineEdit”、“ComboBox”等都有这种状态。和 normal 状态 + 类似,当控件处于 hovered 状态时,取色器会自动选择该属性颜色。 + +@propertygroup Palette::hoveredDark +@property Color Palette::hoveredDark.common +@property Color Palette::hoveredDark.crystal + + 控件 hovered 状态时的暗色主题颜色。 + +@propertygroup Palette::pressed +@property Color Palette::pressed.common +@property Color Palette::pressed.crystal + + 控件 “Pressed” 状态时的调色板颜色, “Pressed” 状态对应于鼠标按压后的控件 + 状态,并非所有的控件都需要响应此状态,如“Button”、“CheckBox”存在该状态, + “Label”,“Edit”不存在该状态。 + +@propertygroup Palette::pressedDark +@property Color Palette::pressedDark.common +@property Color Palette::pressedDark.crystal + + 控件 “Pressed” 状态暗色主题下对应的调色板颜色。 + +@propertygroup Palette::disabled +@property Color Palette::disabled.common +@property Color Palette::disabled.crystal + + 控件 “disabled” 状态下的调色板颜色,控件的 “Disabled” 状态对应于控件的禁用 + 状态,每个控件都具备禁用状态,如未指定时,默认使用“Normal”状态下的颜色代替。 + +@propertygroup Palette::disabledDark +@property Color Palette::disabledDark.common +@property Color Palette::disabledDark.crystal + + 控件 “disabled” 状态暗色主题下对应的调色板颜色 + +/** +@~chinese +@class ColorSelector +@ingroup QtObject + + \keyword DQuickControlColorSelector +@brief DTK 用于指定控件颜色的统一取色辅助器. + + 取色器作为一个能够自动获取控件不同状态,并根据该状态选择合适的颜色的角色而存在。目的是用于 + 简便控件状态的使用,自动并高效的指定控件颜色。使用取色器作用在控件上时,处理颜色的过程更加 + 简单,只需要在控件中指定对应属性的调色板信息,在需要使用的地方,使用取色器直接使用就能达到 + 跟随状态自动改变的效果。 + + 由于需要在控件中指定不同的调色板颜色属性,因此外部可以通过更改该属性而达到修改取色器颜色值 + 进行颜色替换的效果,每个控件中都具备相同类型的属性,如 “backgroundColor” 背景颜色属性, + “textColor” 文字颜色属性等等。除此之外,取色器能够高级的只监听某一种控件状态,如 + “Button” 的 “hovered” 或 “Pressed” 状态。同时取色器能够根据系统主题信息,自动选择 + 对应主题下的调色板属性。 + + 颜色控制系统可以分为三个层次:调色板、控件属性和取色器。取色器作为监听者,能够监听这二者的变 + 化,除此之外,取色器会根据当前绑定的控件状态、控件对象等等信息自动更改颜色。下面给出一个简单 + 的示例代码: + +```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 500 + height: 50 + + property Palette backgroundColor: Palette { + normal: "black" + } + property Palette textColor: Palette { + normal: "white" + } + + contentItem: Text { + text: "Test......." + color: control.ColorSelector.textColor + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + } + + background: Rectangle { + width: 250 + height: 50 + color: control.ColorSelector.backgroundColor + } + } +``` + + \note 当控件类型继承于 Control 或者控件存在调色板数据时,该控件的 ColorSelector 附加属性才会被创建。 + \note 如果当前控件非继承于 Control类型,且具备创建 ColorSelector 的条件,该 ColorSelector 将寻找其最 + 上层父类的 Control 控件,并进行调色板和控件状态的更新绑定。 + \note ColorSelector 仅会监听当前控件和离它最近的父类 Control控件的调色板属性。其中间父类不论是否存在 + ColorSelector 对象,都不会读取和绑定。 + + ColorSelector 在下述变化的场景中,同样能够跟随控件发生变化。 + \section2 ColorSelector 可跟随控件状态发生变化 + 当 Control 开启 hoverEnabled 属性后,ColorSelector 能够监听控件状态的变化过程,并跟随发生属性的颜色变化 +```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 50 + height: 50 + hoverEnabled: true + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + + background: Rectangle { + anchors.fill: parent + color: control.ColorSelector.backgroundColor + } + } +``` + + \section1 ColorSelector 的颜色属性 + \section2 ColorSelector 跟随手动修改后的调色板颜色而变化 + 可通过直接修改调色板的在某个状态额颜色值,而直接更新 ColorSelecotor 读取出来的调色板 + 属性颜色,如下述代码所示: +```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 50 + height: 50 + hoverEnabled: true + + background: Rectangle { + id: rect + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + color: ColorSelector.backgroundColor + anchors.fill: parent + + MouseArea { + anchors.fill: parent + onClicked: { + rect.backgroundColor.hovered = "yellow" + } + } + } + } +``` + 可通过直接赋值的方式,替换 ColorSelector 记录的整个调色板数据,如下述 + 代码所示: +```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 50 + height: 50 + hoverEnabled: true + + background: Rectangle { + id: rect + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + anchors.fill: parent + color: ColorSelector.backgroundColor + + MouseArea { + Palette { + id: otherPalette + normal: "black" + hovered: "gray" + } + anchors.fill: parent + onClicked: { + rect.backgroundColor = otherPalette + } + } + } + } +``` + + \section2 ColorSelector 响应自身属性值的变化 + 上述替换调色板属性,同样也可通过 ColorSelector 进行替换。如下述代码所示: +```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 50 + height: 50 + hoverEnabled: true + + background: Rectangle { + id: rect + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + anchors.fill: parent + color: ColorSelector.backgroundColor + + MouseArea { + anchors.fill: parent + onClicked: { + Palette { + id: otherOPalette + normal: "black" + hovered: "gray" + } + rect.ColorSelector.backgroundColor = otherPalette + } + } + } + } +``` + 替换后的属性值,可通过赋值为 undefined 进行复原,如下述代码所示: +```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 50 + height: 50 + hoverEnabled: true + + background: Rectangle { + id: rect + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + anchors.fill: parent + color: ColorSelector.backgroundColor + + MouseArea { + anchors.fill: parent + onClicked: { + Palette { + id: otherPalette + normal: "black" + hovered: "gray" + } + rect.ColorSelector.backgroundColor = otherPalette + } + onDoubleClicked: { + // 复原 + rect.ColorSelector.backgroundColor = undefined + } + } + } + } +``` + + \section2 ColorSelector 对于自身没有的调色板属性,会从上层 Control 寻找 + ColorSelector 属性能够获取其自身对象以及其最近的 Control 控件的调色板属性,并监听 Control 控件的状态变化, + 进行颜色属性的自动更新。如下述代码所示: +```qml + import org.deepin.dtk 1.0 + + Control { + id: control + width: 200 + height: 200 + hoverEnabled: true + property Palette backgroundColor: Palette { + normal: "red" + hovered: "green" + } + + background: Rectangle { + property Palette borderColor: Palette { + normal: "blue" + hovered: "yellow" + } + // 获取 Control 类中的 backgroundColor 调色板属性 + color: ColorSelector.backgroundColor + border.width: 2 + // 获取自身的 borderColor 调色板属性 + border.color: ColorSelector.borderColor + } + } +``` + \warning 需要注意的是, Control 控件的子控件,如果其自身不存在任何调色板属性,将不会 + 为它创建 ColorSelector 对象。因此上述方式只能作用于 子控件存在调色板属性的场景。 + + \section2 ColorSelector 能够监听控件的父类,当父类发生变化时,会跟随更新其使用父类的所有调色板颜色。 + + \section2 已封装好的控件使用颜色覆盖的形式 + 如想要替换 Button 中的文本颜色时,可用如下代码: +```qml + Button { + text: "Push Button" + textColor: Palette { + normal: "red" + hovered: "blue" + } + } +``` + \section1 ColorSelctor 进行状态过滤 + ColorSelector 可以进行控件单一状态(hovered、pressed、disabled、inactived)的设置。默认情况下,各 + 个状态都是处于未设置的状态,即不针对某一状态进行单独处理而默认接受所有状态的改变。 + + \list + \li 将控件的某个状态作为其标准状态 + 例如控件需要将其“Hovered”状态作为其标准状态时,可使用如下代码: +```qml + Rectangle { + width: 200 + height: 300 + + Button { + anchors.centerIn: parent + text: "Hovered state" + // 仅处理 hovered 状态 + ColorSelector.hovered: true + } + } +``` + \li 控件禁用某一状态 + 例如当控件需要禁用“Hovered”状态时,可使用如下代码: +```qml + Rectangle { + width: 200 + height: 300 + + Button { + anchors.centerIn: parent + text: "Can't Hovered" + ColorSelector.hovered: false + } + } +``` + \li 多种状态的叠加 + 当禁用状态和启用状态同时使用时,例如除“Hovered”状态外,其他状态都处于禁用状态,可用如下代码: +```qml + Rectangle { + width: 200 + height: 300 + + Button { + anchors.centerIn: parent + text: "Only Hovered" + ColorSelector.hovered: true + ColorSelector.pressed: false + ColorSelector.disabled: false + } + } +``` + 上述代码的效果为,仅展示 Hovered 状态,禁用其他所有状态。 + \endlist + + \note 状态控制仅接受真实bool值的设置,不针对属性绑定 + \note 推荐控件只有一种状态被启用。当多个状态都处于启用状态时,标准状态将按照不同控件情况而定。 + + \section1 标准控件的 Palette 属性对照 + 下表列出基础控件可被替换修改的调色板颜色属性值(按字母顺序排序): + \table + \header + \li 控件 + \li 属性 + \li 描述 + \row + \li ActionButton + \li textColor + \li 按钮的文本和图标的颜色 + \row + \li {1, 7} BoxPanel + \li color1 + \li Box 或 Button 控件的背景渐变色1 + \row + \li color2 + \li Box 或 Button 控件的背景渐变色2 + \row + \li insideBorderColor + \li Box 或 Button 控件的内描边颜色 + \row + \li outsideBorderColor + \li Box 或 Button 控件的外描边颜色 + \row + \li dropShadowColor + \li Box 或 Button 控件的外阴影颜色 + \row + \li innerShadowColor1 + \li Box 或 Button 控件的内阴影渐变颜色1 + \row + \li innerShadowColor2 + \li Box 或 Button 控件的内阴影颜色2 + \row + \li BusyIndicator + \li fillColor + \li BusyIndicator 的填充色 + \row + \li Button + \li textColor + \li 按钮控件中的文本和图标颜色 + \row + \li ButtonIndicator + \li backgroundColor + \li ButtonIndicator 的背景颜色 + \row + \li ButtonPanel + \li 继承于 BoxPanel + \li 能使用 BoxPanel 中的所有调色板颜色 + \row + \li CheckDelegate + \li backgroundColor + \li \l CheckDelegate 控件的背景色 + \row + \li ComboBox + \li separatorColor + \li ComboBox 在编辑状态下的分隔符颜色 + \row + \li {1, 2} EditPanel + \li backgroundColor + \li 所有的编辑框背景色 + \row + \li alertBackgroundColor + \li 所有编辑框在显示警告信息时的背景颜色 + \row + \li {1, 2} EmbeddedProgressBar + \li backgroundColor + \li 嵌入式进度条的背景颜色 + \row + \li progressBackgroundColor + \li 嵌入式进度条的进度背景色 + \row + \li FloatingButton + \li 继承于 Button + \row + \li {1, 3} FloatingPanel + \li backgroundColor + \li FloatingPanel 控件的背景颜色 + \row + \li dropShadowColor + \li FloatingPanel 的外阴影颜色 + \row + \li borderColor + \li FloatingPanel 的边框颜色 + \row + \li {1, 3} HighlightPanel + \li backgroundColor + \li HighlightPanel 的背景颜色 + \row + \li outerShadowColor + \li HighlightPanel 的外阴影颜色 + \row + \li innerShadowColor + \li HighlightPanel 的内阴影颜色 + \row + \li IpV4LineEdit + \li backgroundColor + \li IpV4LineEdit 的背景框颜色 + \row + \li ItemDelegate + \li checkedTextColor + \li ItemDelegate 在选中时的文本颜色 + \row + \li {1, 2} KeySequenceEdit + \li backgroundColor + \li KeySequenceEdit 控件的背景颜色 + \row + \li placeholderTextColor + \li KeySequenceEdit 的占位文本颜色 + \row + \li {1, 2} MenuItem + \li subMenuBackgroundColor + \li 子菜单的背景色 + \row + \li itemColor + \li 文字和图标 Hovered 状态下的颜色 + \row + \li Slider + \li grooveColor + \li Slider 控件的滑槽背景颜色 + \row + \li {1, 2} SliderTipItem + \li tickColor + \li Slider 控件标签的背景颜色 + \row + \li textColor + \li Slider 控件标签的文本颜色 + \row + \li SpinBoxIndicator + \li inactiveBackgroundColor + \li SpinBox 右侧指示按钮在未激活状态时的背景颜色 + \row + \li {1, 2} Switch + \li backgroundColor + \li Switch 按钮的背景颜色 + \row + \li handleColor + \li Switch 按钮的滑槽颜色 + \row + \li TextField + \li backgroundColor + \li TextField 控件的背景颜色 + \row + \li TitleBar + \li textColor + \li TitleBar 控件的文本和图标颜色 + \row + \li ToolButton + \li textColor + \li ToolButton 控件的文本和图标颜色 + \row + \li WarningButton + \li 继承于 Button + \li 能使用 Button 控件中的所有调色板颜色 + \row + \li {1, 5} WaterProgressBar + \li backgroundColor1 + \li WaterProgressBar 的背景渐变色1 + \row + \li backgroundColor2 + \li WaterProgressBar 的背景渐变色2 + \row + \li dropShadowColor + \li WaterProgressBar 的外阴影颜色 + \row + \li popBackgroundColor + \li WaterProgressBar 的内置小气泡背景颜色 + \row + \li textColor + \li WaterProgressBar 的文本颜色 + \row + \li WindowButton + \li textColor + \li WindowButton 控件的文本和图标颜色 + \row + \li WindowButtonGroup + \li textColor + \li WindowButtonGroup 内所有 WindowButton 控件的文本和图标颜色 + \endtable + +@property Item ColorSelector::control +@note 该属性为只读属性 +@details + 需要绑定的 Control 对象。绑定后 ColorSelector 会根据当前 control 的状态 + 选择对应的颜色值。通常情况下该属性不需要手动设置,当使用 ColorSelector 的 + 附加属性时,ColorSelector 会自动寻找最接近其的父类 Control 控件,并自动将 + 该控件当做需要监听的对象,因此一个父类 Control,其所有的子类的 ColorSelector + 属性都将按照它的状态发生颜色变化。 + +@property enumeration ColorSelector::controlTheme +@note 该属性为只读属性 +@details + control 控件的当前主题,只读属性,通常情况下 ColorSelector 会监听控件的主题状态。 + 用于选择亮色或暗色的状态颜色。 + 枚举对应于 ApplicationHelper 中的主题色枚举,如下表所示: + + \table + \header + \li 枚举值 + \li 名称 + + \row + \li ApplicationHelper.LightType + \li 亮色主题类型 + \row + \li ApplicationHelper.DarkType + \li 暗色主题类型 + \row + \li ApplicationHelper.UnknowType + \li 未知主题类型 + \endtable + +@property enumeration ColorSelector::controlState +@note 该属性为只读属性 +@details + 控件状态,只读属性。该属性是 ColorSelector 根据当前 control 的状态自动生成。 + 其枚举值如下表所示: + + \table + \header + \li 枚举值 + \li 名称 + \row + \li DTK.NormalState + \li normal 状态 + \row + \li DTK.HoveredState + \li Hovered 状态 + \row + \li DTK.PressedState + \li Pressed 状态 + \row + \li DTK.DisabledState + \li 控件被禁用状态 + \row + \li DTK.InactiveState + \li 控件未激活状态 + \endtable + +@property enumeration ColorSelector::family + + 调色板额颜色族,指定 ColorSelector 需要设置的颜色族。不同的颜色族提供的颜色 + 不一致,目前有两种颜色族可以定义: + + \table + \header + \li 枚举值 + \li 名称 + \row + \li Palette.CommonColor + \li 基本颜色族。默认的颜色族,不额外指定时,控件为该颜色族。存储控件默认场景下的颜色。 + + \row + \li Palette.CrystalColor + \li 水晶颜色族。当控件的背景为透明模糊时,使用该颜色族。 + \endtable + + 其使用方式如下代码所示: +```qml + import org.deepin.dtk 1.0 + FloatingPanel { + width: 200 + height: 200 + backgroundColor: Palette { + normal { + common: "#f0f0f0" + crystal: Qt.rgba(0.20, 0.2, 0.2, 0.1) + } + hovered: "#d2d2d2" // common family + pressed.crystal: "#cdd6e0" // crystal family + } + + ColorSelector.family: Palette.CrystalColor + contentItem: ListView { + model: 6 + delegate: MenuItem { text: "菜单项" + modelData } + } + } +``` + +@property bool ColorSelector::hovered +@brief 启用或者禁用 hovered 状态。当处于禁用状态时,控件对鼠标的悬浮状态不敏感。 + +@property bool ColorSelector::pressed +@brief 启用或者禁用 pressed 状态。当处于禁用状态时,控件对鼠标的点击状态不敏感。 + +@property bool ColorSelector::disabled +@brief 启用或者禁用 disabled 状态。当处于禁用状态时,控件对其 disabled 状态不敏感。 + +@property bool ColorSelector::inactived +@brief 启用或者禁用 inactived 状态。当处于禁用状态时,控件对其 inactived 状态不敏感。 + +@signal void ColorSelector::colorPropertyChanged(string name) +@brief ColorSelector 内存储的颜色属性发生变化时,触发该信号。 \a name 为发生改变的颜色属性名称 + +FIXME:此文件存疑 后期处理 +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dquickdciicon.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dquickdciicon.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dquickdciicon.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dquickdciicon.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,266 @@ + +/** +@~chinese +@class DciIcon +@ingroup Item + + \keyword DQuickDciIcon +@brief 提供一个兼容多种场景的DTK图标控件. + + DCI 图标控件是一个提供多模式、多主题、多大小的整合型控件,该控件可能包含多个图标文件,在上述 + 场景下进行动态切换。例如,当某个图标文件在鼠标的不同状态下需要发生前景色甚至整个图标的变化时, + 常规图标需要在不同状态时切换不同图标,代码繁琐且难维护DCI 图标为了解决这种多场景的问题,帮助 + 在 QML 中能够快速实现图标跟随不同场景的变化。 + + \section1 多模式 + DCI 图标可以包含多种不同的模式下的图标,DCI 图标分为五种状态, + 其分别为:NormalState、HoveredState、PressedState、 + DisabledState 和 InactiveState 。这五种状态和 \l{DTK}{DQMLGlobalObject} + 中的 DTK.ControlState 枚举一致,能够直接兼容该枚举进行使用。 + + 这个状态用于表示控件的不同状态,并不是每个控件都有每种不同的状态,如 Rectangle 控件 + ,就只有NormalState、DisabledState 和 InactiveState。而 Button 控件,就有上述 + 的所有状态。当控件使用的 DCI 图标文件中有某个状态下的单独图标时,会优先显示该状态下的 + 图标文件,否则显示 NormalState 状态下的图标文件。如果一个图标文件中不存在 NormalState + 状态下的图标,则讲该图标视为一个无效图标。 + + \section1 多主题 + DCI 图标适配了多主题下的图标不一致问题。设计中可能会存在 DCI 图标在不同的主题下图标不一致 + 的情况,目前的实现只能保证图标的前景配色跟随主题发生改变。DCI整合多主题的问题,使同一个图标 + 在不同主题下的不一致,仍能用一个图标进行表示,并能根据不同主题的情况,发生图标的适应性变化。 + 目前多主题分为:深色主题和浅色主题两种。 + + \section1 多缩放比、多大小 + DCI 图标能够适配不同的缩放比和大小。例如控件的大小和设备的缩放比,当控件需要通过 DCI 图标进 + 行高级合成时(如 Switch 控件的 Handle),控件可能在不同的场景下大小不同,这时图标就需要根 + 据这种不同的大小场景动态选择出合适大小的图标进行展示。设备缩放比同样如此,目前 DCI 图标的策略 + 是,优先将图标中较大的大小和缩放比进行缩放显示。 + + \section1 使用图层进行布局 + DCI 图标使用图层布局每种状态下的图标,QML 下的图标文件大多数都存在阴影特效,这类特效并不是 + 应用程序在渲染绘制时添加的,而是 DCI 图标本身存在的阴影大小,而在某些情况下,可能存在阴影不 + 占用控件大小或者阴影不跟随图标前景色发生变化的情况。因此,为了区别同一个图标的不同变化问题, + DCI 图标的内部渲染使用图层概念,每个图标的内部都由不同的图层组成,每个图层都代表不同的部件, + 如 Switch控件的 Handle 控件中,中心滑块是一个图层,外阴影是一个图层,内阴影也是一个图层。 + 这些不同图层通过不同顺序的堆叠形成最终效果。 + +@image html dciicon-layers.png + + \section1 图标调色板 + 每个图标都有一个调色板,其包含四种类型的颜色:前景色、背景色、高亮前景色、高亮色,这四种调色板 + 分别对应不同的情形,每个图层文件都包含一个调色板数据,而每个图标文件可能存在多个图层文件,因此, + 每个图标可能有多个调色板,如一个图标的背景色如果存在变化的情况,则其背景图层会标记为背景色调色板; + 而对于需要高亮显示的部分,其图层指定的调色板数据则为高亮色。当用户在使用 DCI 图标时,如果该图标 + 需要调色板数据,则需要显示指定该调色板颜色值,如下述代码所示: + +@ + import org.deepin.dtk 1.0 + + DciIcon { + name: "test-icon" + sourceSize { + width: 50 + height: 50 + } + + // 设置调色板数据 + palette.foreground: "red" + palette.background: "black" + palette.highlight: "blue" + palette.hightlightForeground: "white" + } +``` + + 对于能够继承 QPalette 的控件,在控件的颜色对应正常的情况下,可以直接使用控件的调色板指定,如下代码: + +@ + import org.deepin.dtk 1.0 + + Control { + id: control + width: 100 + height: 100 + + background: Rectangle { + color: control.palette.background + } + + contentItem: DciIcon { + name: "test-icon" + sourceSize { + width: 50 + height: 50 + } + + palette: DTK.makeIconPalette(control.palette) + } + } +``` + + \section1 附加属性 + DciIcon 控件存在附加属性,附加属性为了保持和 QtIcon 的兼容,为了更方便的操作使用 QtIcon 的控件,如 Button ComboBox + 等等。 DciIcon 的附加属性和其内部属性一致,目的时为了设置 QtIcon 中不存在的图标属性,如 mode theme palette 等等。 + 其用法可用下述代码表示: + +@ + import org.deepin.dtk 1.0 + + Button { + icon { + name: "test" + width: 50 + height: 50 + } + + DciIcon.mode: DTK.HoveredState + DciIcon.theme: ApplicationHelper.LightType + DciIcon.palette { + foreground: "red" + } + DciIcon.fallbackToQIcon: true + } +``` + + 其附加属性如下列表: + + \table + \row + \li mode + \li 与 \l {mode}{DciIcon::mode} 功能保持一致 + + \row + \li theme + \li 与 \l {theme}{DciIcon::theme} 功能保持一致 + + \row + \li palette + \li 与 \l {palette}{DciIcon::palette} 功能保持一致 + + \row + \li fallbackToQIcon + \li 与 \l {fallbackToQIcon}{DciIcon::fallbackToQIcon} 功能保持一致 + \endtable + + + +@property string DciIcon::name + + name 属性用于设置 DciIcon 的名称,一般情况下,该名称需要对应图标主题下的图标名称,而不需要将资源路径或绝 + 对路径下的全名称设置进去。例如 “/usr/share/dsg/icons/bloom”目录下存在一个名称为 “test.dci” 的文 + 件。在使用时可直接用下述情况进行展示: + +@ + import org.deepin.dtk 1.0 + + DciIcon { + name: "test" + } +``` + + 图标主题的存在是为了更方便的将一类图标进行统一管理与更换,同时也能更好的配置一些图标替换操作,例如使用图标主题能够帮助 + DTK 内部管理和控制图标的替换。例如上述的“test”图标,其所属的图标主题名为“bloom”。更多的图标主题规范内容,请见 + DCI 图标主题规范。 + + + +@property enumeration DciIcon::mode + + mode 属性用于设置 DciIcon 的图标模式,不同的 mode 其对应的图标文件可能会不一样,其枚举值如下述表示: + + \value DTK.NormalState 控件的normal状态 + \value DTK.HoveredState 控件鼠标悬浮时的状态 + \value DTK.PressedState 控件的pressed状态 + \value DTK.DisabledState 控件的禁用状态 + \value DTK.InactiveState 控件的未激活状态 + + + +@property enumeration DciIcon::theme + + theme 属性用于设置 DciIcon 的图标主题,目前分为深色主题和浅色主题两种。不同主题下的图标可能会不一样。 + + \value ApplicationHelper.UnknownType 未知主题 + \value ApplicationHelper.LightType 亮色主题 + \value ApplicationHelper.DarkType 暗色主题 + + + +@propertygroup DciIcon::palette +@property color :DciIcon::palette.foreground +@property color :DciIcon::palette.background +@property color :DciIcon::palette.highlight +@property color :DciIcon::palette.highlightForeground + + 该属性用于设置 DciIcon 的图标调色板。 + + \include ddciiconpalette.qdocinc grouped-properties + + + +@property size DciIcon::sourceSize + + sourceSize 属性用于指定 DciIcon 控件的大小,一般情况下,在未指定其图标大小时, + 会读取出图标的默认大小,但由于控件本身未设置大小,因此该该控件本身并不占用任何大小。 + 除非手动指定了 width height 属性。 + + 当 sourceSize 被指定时,DciIcon 控件被设置了与 sourceSize 大小一致的隐式宽高, + 当图标存在外阴影时,其阴影部分不占用 sourceSize 的大小。 + + + +@property bool DciIcon::mirror + + mirror 属性决定 DciIcon 控件是否需要水平翻转显示。 + + 该属性默认是 false. + \sa {Image::mirror} + + + +@property bool DciIcon::fallbackToQIcon + + fallbackToQIcon 属性决定当 DciIcon 无法在当前主题下找到对应 name 的 + 图标文件时,其是否需要从 QtIcon 中继续寻找。当控件使用 Qt 的图标加载方 + 式时,将该属性打开能够兼容 Qt 的图标控件进行显示。 + + 该属性默认时 false. + + + +@attachedproperty enumeration DciIcon::mode + + 该属性用于附加一个图标 mode 状态值。其使用方式如下 +@ + Button { + DciIcon.mode: DTK.HoveredState + } +``` + + + +@attachedproperty enumeration DciIcon::theme + + 该属性用于附加一个图标亮暗色主题枚举。其使用方式如下 +@ + Button { + DciIcon.theme: ApplicationHelper.DarkTheme + } +``` + + + +@attachedproperty group DciIcon::palette + + 该属性用于附加一个图标调色板。其使用方式如下 +@ + Button { + DciIcon.palette.foreground: "red" + } +``` + + + +@attachedproperty bool DciIcon::fallbackToQIcon + + 指定附加一个当无法找到 Dci Icon 时是否回滚到 QIcon 中。 + diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dquickglow.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dquickglow.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dquickglow.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dquickglow.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,76 @@ + +/** +@~chinese +@class GlowEffect +@ingroup Item + +@brief DTK 中一种光晕特效控件. + + GlowEffect 是一种在 DTK 中用于作用在控件上的光晕特效。该特效使用 + OpenGL 中特殊的阴影材质着色器实现,目前仅支持硬件软件模式,不支持软 + 件渲染。如需使用支持全模式的阴影效果,请使用控件 BoxShadow. + 光晕特效通常呗作用在矩形中,用于矩形的阴影效果。例如 DTK 根据 GlowEffect + 开发出的 RectangularShadow 控件。 GlowEffect 的使用场景更加抽象,其属性 + 更难控制,对于简单场景,请使用 RectangularShadow 控件。 + + 如下示例代码: +@ + import org.deepin.dtk 1.0 + GlowEffect { + anchors.centerIn: parent + width: 100 + height: 100 + glowRadius: 50 + color: "black" + spread: 0.01 + relativeSizeX: 0.5 + relativeSizeY: 0.5 + } +``` + + 其效果为: +@image html dtk-gloweffect.png + + \sa RectangularShadow + + + +@property qreal GlowEffect::glowRadius + + 该属性用于表示光晕半径,当 fill 属性为 true 时,该属性将不会生效。发光半径 + 表示从 (0,0) 点到矩形的中心点的距离,当发光半径等于矩形宽高的一半时,表示对 + 矩形的全部填充。 + + + +@property color GlowEffect::color + + 该属性用于表示光晕特效的填充颜色。 + + + +@property qreal GlowEffect::spread + + 该属性用于表示发光的扩散系数。该系数越小,表示扩散程度越大。 + + + +@property qreal GlowEffect::relativeSizeX + + 该属性用于表示光晕相对大小的 X 坐标。其取值范围为[0,1]。0表示无相对大小。 + 1表示完全相对。 + + + +@property qreal GlowEffect::relativeSizeY + + 该属性用于表示光晕相对大小的 Y 坐标。其取值范围为[0,1]。0表示无相对大小。 + 1表示完全相对。 + + + +@property bool GlowEffect::fill + + 该属性表示是否填充整个光晕区域。当设置为填充时,光晕颜色将完全覆盖矩形大小。 + 当扩散系数未覆盖区域时,显示出颜色的纯色。 + diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dquickiconimage.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dquickiconimage.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dquickiconimage.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dquickiconimage.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,97 @@ + +/** +@~chinese +@class QtIcon +@ingroup Item + + \keyword DQuickIconImage +@brief 提供一种使用 Qt 方式加在图标的控件 + + QtIcon 作为 DTK 程序访问和插件 Qt 图标的控件,虽然 DTK Quick 极力推荐 + 应用在大多数的场景下使用 Qt 图标,但是不乏存在应用能需要使用 Qt 图标的情况。 + 因此 DTK 提供 QtIcon 来访问和获取 Qt 图标。 其使用方式如下所示代码: + +@ + QtIcon { + name: "button-add" + sourceSize { + width: 128 + height: 128 + } + + mode: QtIcon.Selected + color: "gray" + state: QtIcon.On + } +``` + + + +@property string QtIcon::name + + name 属性用于设置 QtIcon 的图标名称,该名称通过图标主题的方式查找提供。 + DTK环境下实现的图标主题在 dtkgui 中,通过 Built-in 图标隐藏和 Xdg 图标 + 引擎提供。 + + 当 name 图标无法找到时,请先设置好 fallbackSource 属性,用于 fallback 到 + 该路径下的图标中。 + + + +@property enumeration QtIcon::state + state 属性描述 QtIcon 中图标的当前状态。 state 属性于 QIcon 中的 + State 枚举一致,不同的图标可能存在不同的状态。状态可以使用以下枚举: + + \table + \header + \li 枚举值 + \li 名称 + \row + \li QtIcon.On + \li 类似于 QIcon::On 即图标的开启状态 + \row + \li QtIcon.Off + \li 类似于 QIcon::Off 即图标的关闭状态 + \endtable + + + +@property enumeration QtIcon::mode + mode 属性描述 QtIcon 中的模式,不同模式下的图标,可能展示的效果 + 不同,目前可以使用的模式枚举值为: + + \table + \header + \li 枚举值 + \li 名称 + \row + \li QtIcon.Invalid + \li 无效状态 + \row + \li QtIcon.Normal + \li normal 状态,图标的标准状态。 + \row + \li QtIcon.Disabled + \li Disabled 状态,类似于控件的 Disabled 状态。 + \row + \li QtIcon.Active + \li Active 状态,激活状态,类似于控件的 Hover 状态 + \row + \li QtIcon.Selected + \li Selected 状态,选中状态,类似于 MenuItem 的选中状态 + \endtable + + + +@property color QtIcon::color + + color 属性描述图标填充的前景色颜色。与 Qt 提供的 Icon 控件效果一致, + 当需要进行颜色填充时,请使用该属性。 + + + +@property url QtIcon::fallbackSource + + 用于当 name 属性无法获取到图标时, fallbackSource 能够提供次选方案。 + 如果两种方式都无法找到图标,应用程序将出现一些警告信息。 + diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dquickiconlabel.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dquickiconlabel.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dquickiconlabel.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dquickiconlabel.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,162 @@ + +/** +@~chinese +@class IconLabel +@ingroup Item + + \keyword DQuickIconLabel +@brief 提供一种带图标和文字的组合控件类型 + + Qt Quick Control 2 中提供了类似控件,但 IconLabel 与它不同的是, + IconLabel 兼容了 DciIcon 的支持,提供了图标和文字的组合方式等等,使 + 该控件的使用更加灵活。 + + 该控件的场景效果如下图所示: +@image html IconLabel.png + + 使用代码示例如下所示: +@ + IconLabel { + icon.name: "action_setting" + spacing: 10 + icon.width: 48 + icon.height: 48 + display: D.IconLabel.TextBesideIcon + text: "Text Beside Icon" + } +``` + + \warning 请注意这是一个内部控件,并不作为 DTK 的外部控件提供。 + \warning IconLabel 控件使用的图标类型为 DciIcon ,而非 QtIcon 和 Icon. + + + +@propertygroup IconLabel::icon +@property string :IconLabel::icon.name +@property real :IconLabel::icon.width +@property real :IconLabel::icon.height +@property enumeration :IconLabel::icon.mode +@property enumeration :IconLabel::icon.theme +@property string :IconLabel::icon.source + + icon 属性表示 IconLabel 中使用的图标, 其与 DciIcon 中控件的属性一致,但又有不同 + 之处,其子属性如下表列举所示: + + \table + \row + \li icon.name + \li dci 图标名称,从图标主题中获取,其用法于 DciIcon::name 一致。 + \row + \li icon.width + \li 图标宽度,请确保在使用图标的时候给定一个具体宽度。 + \row + \li icon.height + \li 图标高度,请确保在使用图标的时候给定一个具体高度。 + \row + \li icon.mode + \li 图标的状态,与 DciIcon 中图标状态枚举一致。 + \row + \li icon.theme + \li 图标主题,与 DciIcon 中图标主题枚举一致。 + \row + \li icon.source + \li Dci 图标 fallback 到 Qt 图标时的路径,该路径应该是 + Qt 图标的 source 属性。一般情况下,应用无需关心该属性值, + \l{DTK::makeIcon()}{DTK.makeIcon()} 函数中已经将该属性于 Qt 图标进行绑定。 + \endtable + + + +@property string :IconLabel::text + + text 属性描述 IconLabel 控件中的文本文字内容,暂只支持静态文本。 + + + +@property font :IconLabel::font + + font 属性描述 text 所使用的字体。 + + 对于更多可以使用的 Qml 字体属性列表,请参阅 \l {Qml 字体属性类型} {https://doc.qt.io/qt-5/qml-font.html} + + + +@property color :IconLabel::color + + color 属性表示 text 的文字颜色。 + + + +@property enumeration :IconLabel::display + + display 属性表示文字和图标的排列方式,IconLabel 控件提供了5种不同的图标展示方式, + 具体请看下表: + + \table + \row + \li IconLabel.IconOnly + \li 仅展示图标 + \row + \li IconLabel.TextOnly + \li 仅展示文字 + \row + \li IconLabel.TextBesideIcon + \li 文字置于图标之后 + \row + \li IconLabel.TextUnderIcon + \li 文字置于图标之下 + \row + \li IconLabel.IconBesideText + \li 图标置于文字之后 + \endtable + + + +@property real IconLabel::spacing + + spacing 属性描述文字和图标之间的间距值。当仅有图标或者仅有文字时 + 该属性将不会生效。 + + + +@property bool IconLabel::mirrored + + 镜像属性,一般情况下无需操作该属性。不同国家和地区可能阅读方式不一样, + 默认情况下的控件为从左到右排列,当需要控件进行从右向左展示时,该接口 + 可以很好的解决次问题。 + + \warning 请注意,该属性的读取接口为 isMirrored . + + + +@property enumeration IconLabel::alignment + + 该属性用于控制文字和图标的对其方式,默认的对其方式为左对齐,其枚举值如下: + \table + \row + \li Qt.AlignLeft + \li 左对齐 + \row + \li Qt.AlignRight + \li 右对齐 + \row + \li Qt.AlignHCenter + \li 水平居中对齐 + \row + \li Qt.AlignVCenter + \li 竖直居中对齐 + \row + \li Qt.AlignCenter + \li 居中对齐 + \endtable + + + +@property real IconLabel::topPadding +@property real IconLabel::leftPadding +@property real IconLabel::rightPadding +@property real IconLabel::bottomPadding + + 该属性用于描述 IconLabel 的各个 padding 大小。是控件大小距离 contentWidth + 和 contentHeight 的预留区域大小, + diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dquickitemviewport.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dquickitemviewport.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dquickitemviewport.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dquickitemviewport.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,181 @@ + +/** +@~chinese +@class ItemViewport +@ingroup Item + + \keyword DQuickItemViewport +@brief 一种提供了操作其源对象 Item 的高级视图控件 + + ItemViewport 提供了能够操作其 sourceItem 对象的高级视图控件。 + ItemViewport 的用法很广泛,能够对各种 Item 类型进行圆角化处理, + 能够帮助 InWindowBlur 控件对背景进行窗口内模糊特效等等。 + + ItemViewport 不仅支持 GPU 渲染,其也适配了 CPU 模式。使用 DTK + 环境时,在 ItemViewport 控件能够处理的控件范围内,请尽量使用它,而非 + Qt 控件,因为 Qt 控件可能仅支持 CPU 或 GPU 两种中的一种。 + + 对于 ItemViewport 的使用场景,可以使用如下示例代码: + + \section3 特殊的圆角处理 + 某些特殊的场景下,当我们只需要 Button 控件四个角中的某一个圆角时,如下图所示,会发现 + 传统的控件无法达到要求,但可以使用 ItemViewport . +@image html itemViewport_clip_radius.png + 其实现代码如下图所示: +```qml + import org.deepin.dtk 1.0 + + Item { + anchors.centerIn: parent + width: 100 + height: 100 + Item { + id: btnBackground + width: 120 + height: 120 + + Button { + id: btn + anchors { + right: parent.right + top: parent.top + } + width: 64 + height: 64 + icon { + name: "arrow_ordinary_up" + width: 48 + height: 48 + } + background: Rectangle { + color: "#AA00FF" + radius: 0 + } + } + } + + ItemViewport { + id: viewport + sourceItem: btnBackground + radius: 20 + fixed: true + width: btnBackground.width + height: btnBackground.height + anchors { + right: parent.right + top: parent.top + } + hideSource: true + } + } +``` + + \section3 配合 InWindowBlur 实现窗口内模糊 + + 窗口内模糊指控件所处的窗口内,其背景颜色的模糊, DTK 中使用 InWindowBlur 控件 + 实现。当然仅通过该控件还无法达到最终效果,需要配合 ItemViewport 进行组合使用。 + +@ + import org.deepin.dtk + + Item { + Image { + anchors.fill: parent + source: "file:///usr/share/wallpapers/deepin/desktop.jpg" + } + + ListView { + id: testView + + model: 10 + spacing: 30 + clip: true + anchors { + fill: parent + margins: 10 + } + + delegate: Item { + height: 50 + width: 300 + anchors.horizontalCenter: parent.horizontalCenter + + InWindowBlur { + id: blur + anchors.fill: parent + radius: 20 + offscreen: true + } + + ItemViewport { + id: roundBlur + anchors.fill: blur + fixed: true + sourceItem: blur + radius: blur.radius + hideSource: false + } + + Rectangle { + radius: roundBlur.radius + anchors.fill: roundBlur + color: Qt.rgba(1, 0, 0, 0.2) + } + + Text { + anchors.centerIn: parent + text: "InWindowBlur" + index + color: "white" + font.pixelSize: 22 + } + } + } + } +``` + + 其效果展示如下: +@image html inwindowblur.png + + ItemViewport 的实现原理是将源控件的内容作为材质输出到 ItemViewport 中,通过 + ItemViewport 设置的属性值和特定的功能,进行效果呈现并输出。当源控件更新状态时, + ItemViewport 会监测到这种状态更新,并进行实时同步更新。 + + + +@property Item ItemViewport::sourceItem + + sourceItem 用于指定源控件, sourceItem 不局限于 Item 控件,可以传入 + 任何继承自 Item 的控件。当 sourceItem 属性发生改变时,Itemviewport 会 + 进行实时更新。 + + + +@property Item ItemViewport::sourceRect + + sourceRect 用于指定源大小,当不指定时,源大小为 sourceItem 的大小。 + 大多数的使用场景下可以无需指定 sourceRect + + + +@property real ItemViewport::radius + + radius 用于指定 Rect 的圆角大小,例如上述示例中,可通过指定 radius 属性 + 对某个边进行圆角处理。 + + + +@property real ItemViewport::fixed + + fixed 属性用于指定 ItemViewport 是否启用预加载, 当 fixed 为 true 时 + 将不起用任何预加载。fixed 默认为 false + + + +@property bool ItemViewport::hideSource + + hideSource 属性用于指定是否决定隐藏源控件(sourceItem),根据 ItemViewport + 的实现原理,ItemViewport 已经将 sourceItem 画面和自身属性混合后输出。因此, + ItemViewport 在多数情况下已经实现了目标效果,将 hideSource 属性指定为 true 后 + 则表示隐藏 sourceItem 的内容,即隐藏源控件的样式,展示 ItemViewport 的内容,即加工 + 后的内容。默认情况下,该属性为 false. + diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dquickkeylistener.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dquickkeylistener.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dquickkeylistener.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dquickkeylistener.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,46 @@ + +/** +@~chinese +@class KeySequenceListener +@ingroup QObject + + \keyword DQuickKeyListener +@brief DTK 提供的一种快捷键监听器 + + KeySequenceListener 控件作为一个快捷键辅助监听器,其继承于 QObject 类型,而非 + 继承于 Item,因此它无法独立存在,需要跟随 Item 辅助存在。 + + KeySequenceListener 被用于 KeySequenceEdit 控件中进行快捷键的监听, KeySequenceEdit + 控件为 DTK 封装的快捷键输入框。如对快捷键有监听需要,请优先使用 KeySequenceEdit 控件代替。 + + KeySequenceListener 仅作为辅助类存在,因此需要手动指定被监听的 Item 对象,并且 KeySequenceListener + 的作用范围也仅会在其被监听的 Item 控件内。 + + \warning \b 请注意,该控件仅作为快捷键的输入管理,而非所有键位的监听。 + + + +@property Item KeySequenceListener::target +@brief target 属性表示被监听的目标控件。 KeySequenceListener 会在 \c target 的 + 范围内监听快捷键的输入 + + + +@property list KeySequenceListener::keys +@brief keys 属性表示被监听的目标控件输入的快捷键文本,当用于在目标控件焦点状态下按下了特 + 定的快捷键时,其会跟随用户输入发生改变。同时,可以用过设置接口传递该属性的默认值。 + + 当传入一个格式不正确的键位字符串时,其结果是未定义地。 + + + +@property int KeySequenceListener::maxKeyCount +@brief maxKeyCount 属性表示监听的最大键位数量。默认值为 4,即表示最大能监听四种不同的 + 快捷键键位,例如 "Ctrol" "Alt" "Shift" "A" 键位。 + + + +@fn void KeySequenceListener::learKeys() + + 该函数用于清空 \c keys 属性存储的当前键位。例如当用户取消键入,或状态改变需要清空@brief keys 属性的值时,该函数能够发挥很大作用。 + diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dquickrectangle.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dquickrectangle.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dquickrectangle.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dquickrectangle.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,89 @@ + +/** +@~chinese +@class RoundRectangle +@ingroup Item + + \keyword DQuickRectangle +@brief DTK 提供的一种支持不同圆角功能的矩形控件 + + 能够支持某一边或者多边圆角,而其他边保持无圆角状态的控件。该控件 + 是对 Qt 提供的 Rectangle 控件进行的升级。其包含了原本 Color 的 + 大部分属性外,同时能够支持对固定角进行圆角操作。但其不包含对边框和 + 边框颜色的控制。 + + 例如一下示例代码,可以构造一个左上角和右下角的特殊矩形: + +@ + import org.deein.dtk 1.0 + + RoundRectangle { + width: 100 + height: 100 + color: "blue" + radius: 20 + antialiasing: true + corners: (RoundRectangle.TopLeftCorner | RoundRectangle.BottomRightCorner) + } +``` + + 其示例效果如下: +@image html RoundRectangleExample.png + + + +@property color RoundRectangle::color + + 该属性用于指定圆角矩形填充的颜色值。和 Rectangle 控件类似,其会 + 根据圆角矩形的形状自由填充。 + + + +@property real RoundRectangle::radius + + 该属性用于指定圆角矩形的圆角大小。和 Rectangle 中该属性保持一致,其 + 只会作用在设置了 corners 的部分。 + + + +@property enumeration RoundRectangle::corners + + 该属性用于控制圆角矩形的圆角位置,支持圆角位置的叠加,例如上述示例代码。 + 该属性枚举包含以下值: + + \table + \header + \li 枚举值 + \li 描述 + \row + \li RoundRectangle.NoneCorner + \li 无圆角,即直角矩形。 + \row + \li RoundRectangle.TopLeftCorner + \li 指定左上角为圆角。 + \row + \li RoundRectangle.TopRightCorner + \li 指定右上角为圆角。 + \row + \li RoundRectangle.BottomLeftCorner + \li 指定左下角为圆角。 + \row + \li RoundRectangle.BottomRightCorner + \li 指定右下角为圆角。 + \row + \li RoundRectangle.TopCorner + \li 指定矩形上部分为圆角,即左上角和右上角。 + \row + \li RoundRectangle.BottomCorner + \li 指定矩形下部分为圆角,即左下角和右下角。 + \row + \li RoundRectangle.LeftCorner + \li 指定矩形左边部分为圆角,即左上角和左下角。 + \row + \li RoundRectangle.RightCorner + \li 指定矩形右边部分为圆角,即右上角和右下角。 + \row + \li RoundRectangle.AllCorner + \li 指定矩形为全圆角矩形。 + \endtable + diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/dquicksettingcontainer.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/dquicksettingcontainer.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/dquicksettingcontainer.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/dquicksettingcontainer.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,572 @@ + +/** +@~chinese +@class SettingsContainer +@ingroup QtObject +.settings + \keyword DSettingsContainer +@brief SettingDialog 中存放各个设置项的容器 + + SettingContainer 作为 SettingDialog 中放置设置信息的容器,其目的 + 是对配置项的数据展示和数据更新。该控件作为自定义 SettingDialog 的属 + 性存在,一般情况下无需自定义该类型。其内部存在多个用于控制 Config 设置 + 项的相关属性,能够对内部的控件样式进行调整。 + + + +@property Config org.deepin.dtk.settings::SettingsContainer::config + + 配置信息实例,该配置信息中的属性会直接更新到 SettingContainer 中进行数据 + 展示。一般情况下,该属性会被赋值为 SettingDialog 中的 \c config 属性。 + + \sa SettingDialog Config + + + +@property list org.deepin.dtk.settings::SettingsContainer::groups + \default + + 配置项设置组,在 SettingContainer 中,其内部的配置属性有多个不同的设置组组成,而 + 设置组内部又可以存放不同的设置项和设置组,组成了一个设置树。 SettingContainer 中 + 该属性用于存储默认的全局设置组,内部子组和子项会展示在其子类中,其作为根元素进行展示。 + + + +@property Component org.deepin.dtk.settings::SettingsContainer::contentTitle + + 设置项的标题组件,即每个设置项中展示在内容区域的标题组件。默认的标题组件为 ContentTitle + 其会设置项的级别,自动设置字号大小。可根据自定义场景,对该内容进行自定义样式控制。 + + + +@property Component org.deepin.dtk.settings::SettingsContainer::navigationTitle + + 导航栏的标题组件,即 SettingDialog 中导航栏的标题组件。 默认的标题栏为 NavigationTitle 组件。 + 具有高亮背景和自动根据滚动区域的位置进行高亮等功能。 + + + +@property Component org.deepin.dtk.settings::SettingsContainer::contentBackground + + SettingDialog 中整体内容的背景组件,默认的背景组件为 ContentBackground 组件,该组件在默认的 + SettingDialog 中没做背景和颜色的实现,应用可根据场景自行覆盖。需要注意的是,当 \c contentBackground + 属性设置后,其内部的子 SettingOption 及其父类的所有 SettingOption 或 SettingsGroup 都未指定@brief background 属性时,会自动 fallBack 回该 \c contentBackground 属性。 + + + +@fn void org.deepin.dtk.settings::SettingsContainer::setGroupVisible(string key, bool visible) + + 通过 \c key 设置 SettingsGroup 是否可见。 \c key 对应于 SettingsGroup 中的 \c key 属性。@brief visible 参数表示是否可见,true 为可见;false 为不可见。 + + + +@fn bool org.deepin.dtk.settings::SettingsContainer::groupVisible(string key) + + 判断 \c key 对应的 SettingsGroup 是否可见. + \return 返回 true 表示可见, false 表示不可见。 + + + +@fn void org.deepin.dtk.settings::SettingsContainer::resetSettings() + + 重置所有设置项。重置后设置项的值将对应于 Config 中的 \c resetValue 字段。 + + + +/** +@~chinese +@class SettingsOption +@ingroup QtObject +.settings + \keyword DSettingsOption +@brief SettingDialog 中存放的设置项对象 + + SettingDialog 存放每个设置项的对象,其内部有 delegate 属性用于添加设置 + 项的自定义控件。除此之外,其内部存储的 \c key 属性指定该设置项对应于 Config + 中的属性信息,当配置文件中该 \c key 对应的 value 发生改变时,此设置项中的值 + 会根据配置文件发生改变。 + + 每个 SettingsGroup 可以存储多个 SettingOption, SettingDialog 中的每个 + 设置项最终由 SettingOption 展示可控制。 + + 存放在 SettingOption 内部的 Item 可以通过附加属性的方式获取当其最上层的 + SettingOption 对象,如下代码所示: +@ + SettingOption { + key: "key1" + name: "Name" + + CheckBox { + Component.onComplete { + console.log(SettingOption.name) + } + } + } +``` + + + +@property string org.deepin.dtk.settings::SettingsOption::key +@brief key 将作为设置项的唯一标识,SettingDialog 中 config 对应的配置项的@brief key 应与该值保持一致。绑定后的属性其配置发生变化后, SettingOption 的 + value 会自动发生变化。 + + + +@property string org.deepin.dtk.settings::SettingsOption::name +@brief name 为设置项的名称,默认情况下对应于设置项的左侧,用于指示该设置项的作用。 + + + +@property string org.deepin.dtk.settings::SettingsOption::value +@brief value 为设置项对应的 Config 中的属性值,其与配置文件中的值相对应。当配置文件中@brief key 对应的 \c value 发生变化后,该值会自动跟随发生变化。 + + + +@property Component org.deepin.dtk.settings::SettingsOption::delegate + \default + + 默认属性, \c delegate 属性用于指定需要显示次配置项的控件。例如 ComboBox、LineEdit、 + RadioButton等等。 + + SettingDialog 提供几种默认的可以根据 SettingOption 的值自动发生变化的控件。如下表 + 所示: + \table + \header + \li 控件名称 + \li 控件描述 + + \row + \li \l {CheckBox(Settings)}{CheckBox} + \li 类似与 CheckBox 控件,自带名称,其值会根据配置项的值发生自动改变。 + \li \l {ComboBox(Settings)}{ComboBox} + \li 类似与 ComboBox 控件,自带名称,其值会根据配置项的值发生自动改变。 + \li \l {LineEdit(Settings)}{LineEdit} + \li 类似与 LineEdit 控件,自带名称,其值会根据配置项的值发生自动改变。 + \endtable + + + +/** +@~chinese +@class SettingsGroup +@ingroup QtObject +.settings + \keyword DSettingsGroup +@brief SettingDialog 中存放的多个设置项的设置组 + + SettingsGroup 用于存放多个 SettingOption 的设置组。每个SettingsGroup + 都有在 SettingDialog 的导航栏中显示,根据 SettingsGroup 的层级关系,自 + 动为其设置 \c level ,其 \c level 值对应于每个 SettingsGroup 的 \c name + 字号以及缩进的大小。而这些样式的设置都是在 NavigationTitle 中完成样式的自动 + 调整。当需要进行自定义样式时,可通过调整 NavigationTitle 来达到目标效果。 + + SettingsGroup 可自定义背景风格,默认情况下 SettingsGroup 未指定背景, + 如以下代码: +@ + SettingsGroup { + key: "group1" + name: "group1" + visible: true + background: ContentBackground { + border.color: "red" + radius: 8 + } + SettingsOption { + key: "key2" + name: "ComboBox" + ComboBox { + model: ["first", "sceond", "third"] + } + } + } +``` + + SettingsGroup 存在附加属性,可在其子类中使用该附加属性获取到当前 + 的 SettingsGroup 对象,如下代码: +@ + SettingsGroup { + key: "group" + name: "group" + visible: true + SettingsOption { + key: "key1" + name: "CheckBox" + CheckBox { + text: "CheckBox" + Component.onComplete: { + console.log(SettingsGroup.name) + } + } + } + } +``` + + \sa NavigationTitle SettingsDialog SettingsOption + + + +@property string org.deepin.dtk.settings::SettingsGroup::key +@brief key 属性用于标识每个 SettingsGroup,该属性与 SettingOption 中的不同, + 仅作为控件的标识,可通过 SettingContainer 中的 \l {SettingsContainer::setGroupVisible}{setGroupVisible} + 函数控制 \c key 对应的 SettingsGroup 是否可见。 + + + +@property string org.deepin.dtk.settings::SettingsGroup::name +@brief name 属性被充当 SettingDialog 中导航栏标题,以及内容区域用于标识每个 + group 的标题。其标题字号和缩进根据 SettingsGroup 的层级关系自动调整。 + + + +@property int org.deepin.dtk.settings::SettingsGroup::level + \readonly +@brief level 属性为只读属性,当 SettingsGroup 的层级关系指定完成后,SettingContainer + 会根据其层级自动指定 \c level 。通常情况下应用无需关心 \c level , 其值将对 + SettingsGroup 的标题字号和缩进产生影响。 + + + +@property bool org.deepin.dtk.settings::SettingsGroup::visible +@brief visible 属性表示 SettingsGroup 是否可见。当 \c visible 指定为 false + 时,其下的所有子类都会隐藏。也可通过 SettingContainer 中的 + \l {SettingsContainer::setGroupVisible}{setGroupVisible} + 接口 通过 \c key 值指定是否可见。 + + + +@property int org.deepin.dtk.settings::SettingsGroup::index + \readonly +@brief index 属性作为 SettingsGroup 添加进 SettingDialog 中导航栏和内容 + 中 ListView 的索引,是一个只读属性。 + + + +@property list org.deepin.dtk.settings::SettingsGroup::options + \default +@brief options 为默认属性,其用于存储其子类的所有 SettingOption 对象,并作为 + 统一层级进行显示。同一层级下的 SettingOption 将被 SettingsGroup 管理,如@brief level 将和其父类保持一致;当 SettingsGroup 隐藏时,其子类所有 SettingOption + 将被隐藏。 + + + +@property list org.deepin.dtk.settings::SettingsGroup::children +@brief children 属性保存 SettingsGroup 中的所有子 SettingsGroup,其子 SettingsGroup + 的 level 会比当前 SettingsGroup 小一层级。 SettingsGroup 可通过指定 children 的 + 方式嵌套多个 SetingGroup。 + + + +/** +@~chinese +@class ContentBackground +@ingroup Rectangle +.settings +@brief SettingDialog 中通用的内容背景框. + + ContentBackground 是 SettingDialog 中提供的专门用于控制 SettingContainer + 或者 SettingsGroup 背景的控件。在设计中,SettingsGroup 默认未指定背景色,但为了 + 对 SettingDialog 配置项中的设置添加的更加灵活,可通过控制该对象的属性,来控制想 + 要实现的效果。 + + 例如,自定义 SettingContainer 的背景颜色可通过如下代码: +@ + SettingDialog { + height: 400 + width: 680 + config: settingsConfig // 特殊的 Config 对象 + + container.contentBackground: ContentBackground { + color: "red" + } + } +``` + + 自定义 SettingsGroup 的背景可用如下代码: +@ + SettingsGroup { + key: "group" + name: "group" + SettingsOption { + key: "key1" + name: "CheckBox" + CheckBox { + text: "CheckBox" + } + } + + background: ContentBackground { + border.color: "red" + radius: 8 + } + } +``` + + \sa SettingDialog ContentTitle + + + +/** +@~chinese +@class ContentTitle +@ingroup Label +.settings +@brief SettingDialog 中通用的设置项文字控件. + + SettingDialog 被用于指定在 SettingContainer 中的内容标题控件。其会根据 SettingDialog 中 + SettingsGroup 的层级关系,自动为每个 SettingsGroup 设置字体。默认情况下无需自定义,当存在对 + 字体有特殊需求时,可以通过继承 ContentTitle 类来实现。 + + SettingDialog 中控制 ContentTitle 样式可用如下代码: +@ + SettingDialog { + height: 400 + width: 680 + config: settingsConfig // 特殊的 Config 对象 + + container.contentTitle: ContentTitle { + color: "blue" + } + } +``` + + + +/** +@~chinese +@class NavigationTitle +@ingroup Control +.settings +@brief SettingDialog 中导航栏处的标题控件 + + NavigationTitle 在 SettingDialog 中被用于展示 SettingsGroup 的 \c name 属性。 + 其会根据 SettingsGroup 的层级关系自动选择合适字号和缩进的文本进行展示。除此之外,它 + 能够根据滚动窗口当前所显示的 SettingsGroup 高亮其对应的标题。除 Control 自带的属性 + 外, NavigationTitle 拓展了几种属性用于默认设置或进行自定义样式。例如可通过如下代码 + 自定义 NavigationTitle. + +@ + import org.deepin.dtk 1.0 + import org.deepin.dtk.settings 1.0 as Setting + + Setting.SettingDialog { + height: 400 + width: 680 + config: settingsConfig // 特殊的 Config 对象 + + container.navigationTitle: Setting.NavigationTitle { + backgroundColor: Palette { + normal: "red" + } + + checkedTextColor: Palette { + normal: "green" + } + } + } +``` + + + +@property bool org.deepin.dtk.settings::NavigationTitle::checked +@brief checked 状态指定 NavigationTitle 是否处于选中状态。一般情况下,其值会根据 + 当前 NavigationTitle 所处的 SettingsGroup 是否为当前可视状态而自动设置。 + 默认情况下,该值为 false. + + + +@property Palette org.deepin.dtk.settings::NavigationTitle::backgroundColor +@brief backgroundColor 属性用于指定 NavigationTitle 的背景颜色,其类型为 Palette 类型,可 + 同时指定 light 和 dark 两种类型,以及 normal 和 hover 两种状态。 backgroundColor 颜色 + 仅会在 checked 为 true 是显示。默认情况下无颜色。 + + + +@property Palette org.deepin.dtk.settings::NavigationTitle::checkedTextColor +@brief checkedTextColor 属性当 NavigationTitle 被选中时,文本的调色板颜色。与 backgroundColor 类似 + 其存在 light 和 dark 两种类型。默认情况下,该颜色为白色。 + + + +@signal void org.deepin.dtk.settings::NavigationTitle::clicked() +@brief clicked 信号当 NavigationTitle 被点击时发出。 + + + +/** +@~chinese +@class CheckBox(Settings) +@ingroup OptionDelegate +.settings +@brief SettingDialog 中自定义实现的 CheckBox 控件 + + SettingDialog 中自定义实现的 CheckBox 控件,自带了文本标题区域和 CheckBox 控件区域,是 DTK 专门 + 用于封装给 SettingDialog 使用的控件。其效果如下图所示: + +@image html SettingCheckBox.png + + 其控件的添加必须在一个 SettingOption 内部,当 leftVisible 设置为 true 时,会将 SettingOption 中的 + name 字段作为左侧标题描述进行显示。 + + 其使用如下所示: +@ + import org.deepin.dtk as Settings + + Settings.SettingsOption { + key: "canExit" + name: "CheckBox" + Settings.CheckBox { + leftVisible: true + } + } +``` + + + +/** +@~chinese +@class ComboBox(Settings) +@ingroup OptionDelegate +.settings +@brief SettingDialog 中自定义实现的 ComboBox 控件 + + SettingDialog 中自定义实现的 ComboBox 控件,其自带左侧标题部分和右侧 ComboBox 控件部分,当开启 leftVisible 属性时, + 左侧标题部分将显示。当手动切换 ComboBox 中的当前项时,其对应的 SettingOption 的属性值将跟随自动发生变化,不需要应用程序 + 管理这些情况。 + + ComboBox 能够接受外部提供的 model 数据,当提供的 model 存在自定义的 roleName 时,可通过定义 valueRole 来达到绑定 + 该 role 的行为。 + +@image html SettingComboBox.png + + 其使用如下所示: + +@ + import org.deepin.dtk as Settings + + Settings.SettingsOption { + key: "key2" + name: "ComboBox" + Settings.ComboBox { + model: ["first", "sceond", "third"] + } + } +``` + + + +@property ComboBox org.deepin.dtk.settings::ComboBox(Settings)::impl +@brief impl 属性为 \l {ComboBox(Settings)}{ComoBox} 控件真实的内部 ComboBox. 当需要手动设置 Combox 的属性时,\c impl + 能够很好的解决该问题。 + + + +@property string org.deepin.dtk.settings::ComboBox(Settings)::valueRole +@brief valueRole 属性表示 \l {ComboBox(Settings)}{ComoBox} 中 model 的特殊 RoleName。 当 model 设置了特殊 + 的 RoleName 后(例如 model 是 ListModel 时),可通过该属性获取到绑定在该 RoleName 中的自定义属性,同样也能 + 跟随 SettingOption 的值自动发生变化。 + + + +@property Model org.deepin.dtk.settings::ComboBox(Settings)::model +@brief model 属性为 ComboBox 中对应的 model, 可通过该属性设置 impl 中的数据模型。 + + + +/** +@~chinese +@class LineEdit(Settings) +@ingroup OptionDelegate +.settings +@brief SettingDialog 中自定义实现的 LineEdit 控件 + + SettingDialog 中自定义实现的 LineEdit 控件,左侧自带标题部分,右侧 LineEdit 部分,可通过设置 leftVisible + 属性来控制左侧标题区域的显示和隐藏。当 LineEdit 完成输入后(按回车键或离开焦点),其绑定的 SettingOption 的属性 + 将自动跟随 LineEdit 中的值发生自动变化。 + +@image html SettingLineEdit.png + + 其使用如下所示: + +@ + import org.deepin.dtk as Settings + + Settings.SettingsOption { + key: "key3" + name: "LineEdit" + Settings.LineEdit { + text: "test" + } + } +``` + + + +/** +@~chinese +@class OptionDelegate +@ingroup RowLayout +.settings +@brief SettingDialog 中用于添加自定义控件的委托控件 + + OptionDelegate 是用于包装自定义应用到 SettingDialog 中的委托控件。其包含两个部分,左侧标题部分和右侧控件 + 内容部分。标题部分会自动选择 SettingOption 中的 name 进行填充,其 leftVisible 属性控制标题部分是否显示。 + 右侧控件为自定义添加到 SettingDialog 中的控件,该控件的键值的响应需要自己实现,OptionDelegate 无法感知。 + + 例如实现一个自定义的按钮: +@ + Settings.SettingsOption { + key: "Key2" + Settings.OptionDelegate { + leftVisible: false + Button { + Layout.fillWidth: true + text: "Custom Button" + } + } + } +``` + + 实现一个文本和 Switch 控件的组合控件: +@ + Settings.SettingsOption { + key: "Key3" + Settings.OptionDelegate { + leftVisible: false + Label { + text: "Switch Button" + horizontalAlignment: Qt.AlignLeft + Layout.fillWidth: true + } + + Switch { + + } + } + } +``` + + 实现一个带“加减”符号的输入框控件: +@ + Settings.SettingsOption { + key: "Key6" + name: "Font Size" + Settings.OptionDelegate { + PlusMinusSpinBox { + spinBox.value: 12 + Layout.alignment: Qt.AlignRight + Layout.preferredWidth: 200 + } + } + } +``` + + 预览效果如下图所示: +@image html SettingOptionCustionWidget.png + + + +@property bool org.deepin.dtk.settings::OptionDelegate::leftVisible +@brief leftVisible 属性用于表示左侧标题区域是否可见,当 \c leftVisible 为 false 时,表示仅显示右侧控件;当 \c leftVisible 为 true + 时,标题区域和控件区域的间距为 20 px。 + + diff -Nru dtkdeclarative-5.6.3/docs/qml/noqml/InWindowBlur.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/noqml/InWindowBlur.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/noqml/InWindowBlur.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/noqml/InWindowBlur.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,94 @@ +/** +@~chinese +@class InWindowBlur +@ingroup Item + + \keyword DQuickInWindowBlur +@brief 提供一个使目标控件在窗口内模糊的特效控件. + + 该控件用于在窗口内对某些控件背景进行模糊操作,例如一个 ListView 的背景如果是一个图片,如果其 Item 需要 + 进行模糊处理,对 ListView 的背景进行模糊处理,就能够用 InWindowBlur 控件对 delegate 进行模糊处理。 + 例如以下代码 + +```qml + import org.deepin.dtk + + Item { + Image { + anchors.fill: parent + source: "file:///usr/share/wallpapers/deepin/desktop.jpg" + } + + ListView { + id: testView + + model: 10 + spacing: 30 + clip: true + anchors { + fill: parent + margins: 10 + } + + delegate: Item { + height: 50 + width: 300 + anchors.horizontalCenter: parent.horizontalCenter + + InWindowBlur { + id: blur + anchors.fill: parent + radius: 20 + offscreen: true + } + + ItemViewport { + id: roundBlur + anchors.fill: blur + fixed: true + sourceItem: blur + radius: blur.radius + hideSource: false + } + + Rectangle { + radius: roundBlur.radius + anchors.fill: roundBlur + color: Qt.rgba(1, 0, 0, 0.2) + } + + Text { + anchors.centerIn: parent + text: "InWindowBlur" + index + color: "white" + font.pixelSize: 22 + } + } + } + } +``` + + 其效果展示如下: +@image html inwindowblur.png + + 如上述示例代码, InWindowBlur 控件需要配合 ItemViewport 控件才能完成与 BehindWindowBlur 控件 + 类似的混色效果。 其中 ItemViewport 主要完成圆角效果和混色填充的功能。 由于 InWindowBlur 控件本身 + 不支持圆角功能,因此在使用 ItemViewport 是需要隐藏其非圆角的效果, offscreen 属性就需要设置为 true 状 + 态,让 ItemViewport 能够展示 InWindowBlur 控件的内容但不现实 InWindowBlur 本身,该功能与 ItemViewport + 中的 hideSource 类似,但该属性与 InWindowBlur 控件的绘制发生冲突,无法正确渲染其模糊图像,因此建议使用 + InWindowBlur 控件的 offscreen 属性而非 ItemViewport 控件的 hideSource 属性。 + + + +@property real InWindowBlur::radius + + 该属性用于指定窗口内模糊程度系数大小,其并非控件的圆角大小。当模糊程度超过了背景的渲染程度时,其模糊效果会 + 呈现出一个黑色。 + + + +@property bool InWindowBlur::offscreen + + 该属性用于指定其模糊特效是否需要渲染在屏幕之外,即离屏渲染,该属性默认为 false,当 InWindowBlur 控件与 + ItemViewport 控件配合使用时,多数情况下会将其设置为 true。 +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/OutsideBoxBorder.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/OutsideBoxBorder.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/OutsideBoxBorder.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/OutsideBoxBorder.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,39 @@ +/** +@~chinese +@class OutsideBoxBorder +@ingroup Item + +@ingroup QML_TYPES +@brief 提供一种外边框控件. +@details + OutsideBoxBorder 控件是一种修饰宿主控件的外边框(外描边)控件,与 InsideBoxBorder 控件相对应, + 在设计和美化界面时,离不开好的描边来使宿主控件显得更有层次,更加丰满。
+ OutsideBoxBorder 的用法如下所示: +```qml + Rectangle { + width: 200 + height: 200 + color: "darkBlue" + radius: 8 + + OutsideBoxBorder { + anchors.fill: parent + color: "darkCyan" + radius: 8 + borderWidth: 2 + } + } +``` + 其效果如下图所示: +@image html OutsideBoxBorderExample.png + +@property real OutsideBoxBorder::borderWidth +@brief borderWidth 属性用于表示 OutsideBoxBorder 控件的边框大小。 默认情况下,该值是 1。 + +@property color OutsideBoxBorder::color +@brief color 属性表示外边框的颜色值。默认情况下,该值是 "white" + +@property real OutsideBoxBorder::radius +@brief radius 属性表示内边框的圆角大小,默认情况下,该大小为 0。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/PageIndicator.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/PageIndicator.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/PageIndicator.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/PageIndicator.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ \ No newline at end of file diff -Nru dtkdeclarative-5.6.3/docs/qml/PasswordEdit.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/PasswordEdit.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/PasswordEdit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/PasswordEdit.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,23 @@ + +/** +@~chinese +@class PasswordEdit +@ingroup Item + \inqmlmodule LineEdit +@ingroup QML_TYPES +@brief 提供一种用于密码输入的输入框控件. +@details + PasswordEdit 控件专门用于进行密码的输入,它自动适配了密码显示和隐藏按钮,提供了 + 快捷的密码输入方式。 + PasswordEdit 的效果如下图所示: +@image html PasswordEdit.png + +@property bool PasswordEdit::isEchoMode +@brief isEchoMode 属性表示当前是否为密码输入模式 +@details 当处于密码输入模式时,密码输入框会将输入的文本进行密文展示。 + +@property bool PasswordEdit::echoButtonVisible +@brief echoButtonVisible 属性用于控制密码显示和隐藏按钮的可视化属性。 +@details 默认情况下,该属性为 true 。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/PlusMinusSpinBox.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/PlusMinusSpinBox.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/PlusMinusSpinBox.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/PlusMinusSpinBox.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,43 @@ + +/** +@~chinese +@class PlusMinusSpinBox +@ingroup Item + +@ingroup QML_TYPES +@brief 一种加减按钮样式的数字轮选框控件. +@details + PlusMinusSpinBox 控件是基于基础的 SpinBox 控件进行调整的特殊样式控件, + PlusMinusSpinBox 将 SpinBox 内部调整数值的按钮从上下箭头修改为特殊的加减号按钮和还原按钮,
+ 默认情况下还原按钮不作显示,可通过属性控制该按钮的显示和隐藏。
+ PlusMinusSpinBox 主要用于特殊场景、特殊样式下的独特的 SpinBox 控件,
+ 应用可根据实际场景选择使用 SpinBox 控件还是 PlusMinusSpinBox 控件。
+ PlusMinusSpinBox 的效果如下图所示:
+@image html PlusMinusSpinBox.png + PlusMinusSpinBox 提供了控制 SpinBox 的属性,例如输入方式、警告信息等等。
+ 因此PlusMinusSpinBox 具备 SpinBox 的所有特性。
+ +@property Item PlusMinusSpinBox::spinBox +@brief spinBox 属性是控制 PlusMinusSpinBox 内部的 SpinBox 的统一属性。 +@details 例如,可以通过控制 SpinBox 的 alertText 等属性调整其警告信息,如下代码所示: +```qml + PlusMinusSpinBox { + spinBox.editable: true + spinBox.alertText: "只能输入数字" + spinBox.showAlert: true + } +``` + +@property bool PlusMinusSpinBox::upButtonVisible +@brief upButtonVisible 属性控制 “+” 号按钮的显示和隐藏。 +@details 默认情况下,`upButtonVisible为`true。 + +@property bool PlusMinusSpinBox::downButtonVisible +@brief downButtonVisible 属性控制 “-” 号按钮的显示和隐藏。 +@details 默认情况下,`downButtonVisible`为 true。 + +@property bool PlusMinusSpinBox::resetButtonVisible +@brief resetButtonVisible 属性控制还原按钮的显示和隐藏。 +@details 默认情况下,`resetButtonVisible`为 false。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/PopupWindow.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/PopupWindow.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/PopupWindow.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/PopupWindow.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,20 @@ + +/** +@~chinese +@class PopupWindow +@ingroup Window + +@ingroup QML_TYPES +@brief 提供一种 Popup 类型的窗口控件. +@details + PopupWindow 控件是一个独立的窗口,和 Window 控件一致,都能够作为相对于主窗口外的 + 独立窗口进行显示。 PopupWindow 是一种提供 Popup 属性的窗口,他不具备正常的 Dialog + 或者 ApplicationWindow 通用的 TitleBar 控件,它可被用于弹出式窗口,即弹即回的样式。 + PopupWindow 除正常的用于 Window 的属性外,由于其 Popup 的特性,它还拥有特殊的窗口 + 背景模糊的效果,窗口背景的混成和默认的主题风格保持一致。 + +@property Item PopupWindow::blurControl +@brief blurControl 属性是模糊背景的宿主控件,主要用于保持跟宿主控件相同的调色板信息。 + 用于获取宿主控件的调色版某种角色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/Popup.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/Popup.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/Popup.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/Popup.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ \ No newline at end of file diff -Nru dtkdeclarative-5.6.3/docs/qml/ProgressBar.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ProgressBar.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ProgressBar.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ProgressBar.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,33 @@ + +/** +@~chinese +@class ProgressBar +@ingroup ProgressBar + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的进度条控件. + + ProgressBar 控件提供行云设计风格的进度条控件。根据使用场景不同,ProgressBar 的样式也会跟随发生变化。 + ProgressBar 根据 \c indeterminate 属性的不同样式也跟随不同。 \c indeterminate 属性为 true 时,进度条被设置成“无进度”模式, + 即无法确定当前进去情况下的进度条样式。 + 例如以下效果: +@image html ProgressBarIn.png + 同样的, ProgressBar 在设置文本和未设置文本时样式 + 也不一样,未设置文本时, ProgressBar 处于无法控制的 + 状态,其背景会呈现出淡灰色样式,而在设置文本属性后,背景变成可以操作的按钮样式,即指示 + 用于当前的 ProgressBar 是可以进行操作暂停或者停止的。 + + 例如以下效果: +@image html ProgressBarText.png + +@property string ProgressBar::formatText +@brief formatText 属性控制 ProgressBar 是否使用 +@details 格式化文本添加当前进度,例如下图的场景: +@image html ProgressBarFormatText.png + +@property bool ProgressBar::animationStop +@brief animationStop 属性控制 ProgressBar 正在进行的 + 进度动画是否停止,默认情况在为 false。 +@note 请注意,该属性只在`indeterminate`属性为 true 时才有效。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/RatioButton.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/RatioButton.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/RatioButton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/RatioButton.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,27 @@ + +/** +@~chinese +@class RadioButton +@ingroup RadioButton + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 RadioButton 控件. + + RadioButton 提供了一种“选中”和“未选中”状态的功能 + 按钮。当同时存在多个RadioButton 时,只会一个作为 + 当前选中的RadioButton。 + + DTK 风格的RadioButton 继承了原始的所有 API,能够 + 同时添加文本和图标当作其内容。默认情况下 autoExclusive 属性是 true,因此多个RadioButton + 存在的情况下,只会独占一个按钮。 + + DTK 风格的RadioButton 使用 DciIcon 作为其内部 + 使用的图标样式,在不同状态切换时,有不同的特殊效果,例如下图所示: +| **状态** | **模式** | **效果** | +|------------------|---------|---------------------------------------------| +| {1, 2} checked | Normal | @image html RatioButtonNormal.png | +| | Hovered | @image html RadioButtonCheckedHovered.png | +| {1, 2} unchecked | Normal | @image html RatioButtonUncheckedNormal.png | +| | Hovered | @image html RatioButtonUncheckedHovered.png | + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/RecommandButton.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/RecommandButton.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/RecommandButton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/RecommandButton.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,16 @@ + +/** +@~chinese +@class RecommandButton +@ingroup Button + +@ingroup QML_TYPES +@brief 一种用于提示的推荐型按钮. +@details + RecommandButton 控件与基本的Button按钮样式类似。 + 但 RecommandButton 作为推荐按钮,其作用场景通常为推荐用户选择(或点击)的一类按钮, + 在样式设计上,它的默认样式显得更突出,背景使用渐变的高亮背景进行控制。
+ 例如以下样式: +@image html RecommandButtonExample.png + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/RectangularShadow.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/RectangularShadow.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/RectangularShadow.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/RectangularShadow.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,58 @@ + +/** +@~chinese +@class RectangularShadow +@ingroup Item + +@ingroup QML_TYPES +@brief 一种只支持硬件渲染模式的矩形阴影控件. +@details + RectangularShadow 是 GlowEffect 应用形态,它重新整理了 GlowEffect 的各个属性,并将其修饰为 + 更容易理解的属性名称。 RectangularShadow 相对于 GlowEffect 更容易使用。 + 但 RectangularShadow 和 GlowEffect 都有同样的缺点:暂不支持使用软件渲染。因此使用这两种效果时 + 需要注意对不同渲染模式的适配。如果在使用中更倾向于软硬件的兼容,请使用: BoxShadow 效果。 + RectangularShadow 和 GlowEffect 一样,都提供一种矩形阴影效果。RectangularShadow的 + 使用方式如下所示: +```qml + RectangularShadow { + anchors.fill: shadowSource + glowRadius: 20 + spread: 0 + color: "black" + cornerRadius: shadowSource.radius + } + + Rectangle { + id: shadowSource + width: 120 + height: 120 + radius: 16 + color: "red" + } +``` + 其效果如下图所示: +@image html RectangularShadowExample.png + +@property real RectangularShadow::offsetX +@brief offsetX 属性定义阴影在x轴方向上的偏移,默认是0。 + +@property real RectangularShadow::offsetY +@brief offsetY 属性定义阴影在y轴方向上的偏移,默认是0。 + +@property real RectangularShadow::glowRadius +@brief glowRadius 属性定义阴影到达项目区域外部(或内部)的像素数,默认是 0。 + +@property real RectangularShadow::spread +@brief spread 属性定义在源四周区域的阴影颜色的增强程度,默认是0 + +@property color RectangularShadow::color +@brief color 属性定义阴影颜色。 + +@property real RectangularShadow::cornerRadius +@brief cornerRadius 属性定义绘制阴影的控件的圆角大小。 + + +@property bool RectangularShadow::fill +@brief fill 属性定义阴影是否填充整个区域。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/RoundButton.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/RoundButton.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/RoundButton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/RoundButton.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ \ No newline at end of file diff -Nru dtkdeclarative-5.6.3/docs/qml/ScrollBar.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ScrollBar.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ScrollBar.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ScrollBar.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ \ No newline at end of file diff -Nru dtkdeclarative-5.6.3/docs/qml/SearchEdit.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/SearchEdit.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/SearchEdit.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/SearchEdit.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,27 @@ +/** +@~chinese +@class SearchEdit +@ingroup LineEdit + +@ingroup QML_TYPES +@brief 提供一种带搜索的输入框控件. +@details + SearchEdit 控件是一种用于搜索的输入框控件, SearchEdit 自带了搜索图标,并且在搜索和 + 未搜索时具有动画过渡效果。 + SearchEdit 继承自 LineEdit ,具备 LineEdit 的几乎所有特性。SearchEdit 除了可以被 + 使用在主窗口的任何位置,同样也能被使用在 Menu, PopupWindow 等控件上,当作复合控件存在。 + SearchEdit 的效果如下图所示: +@image html SeachEditNoFocus.png + SearchedEdit 在焦点状态下的效果如下图所示: +@image html SearchEditFocus.png + SearchedEdit 的整体运行效果如下: +@image html SearchEditRunning.gif + +@property string SearchEdit::placeholder +@brief placeholder 属性是当 SearchEdit 处于未搜索状态时,用于显示提示的文本。 +@details 默认情况下,该文本为翻译后的“搜索”字符串。可通过重新设置该属性调整显示文本。 + +@property bool SearchEdit::editting +@note 此属性为只读属性 +@brief editting 属性用于判断当前控件是否处于正在编辑的状态。 +@details SearchEdit 存在两种状态:正在编辑的状态和非编辑状态。 当处于正在编辑的状态时,用于可直接键入文本。 diff -Nru dtkdeclarative-5.6.3/docs/qml/settings/SettingDialog.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/settings/SettingDialog.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/settings/SettingDialog.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/settings/SettingDialog.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,171 @@ + +/** +@~chinese +@class SettingsDialog +@ingroup WindowDialog +.settings +@brief DTK 应用统一的应用设置对话框. + + SettingsDialog 是 DTK 应用用于存储和设置应用信息的对话框。 SettingsDialog + 中当设置项发生改变时,应用程序会收到此变化,并发生响应。通常情况下, SettingsDialog + 用于存储应用的界面信息、配置信息和用户自定义信息等等。 虽然 SettingsDialog 的整体 + 样式保持和 DTK 风格一致,但仍提供了高度自由的接口,用于设置自定义风格的设置属性对话框。 + +@image html SettingsDialog.png + + \section1 DConfig 兼容 + 您需要了解 Config 的使用和配置,SettingsDialog 中存储的配置信息,将全部使用 Config + 保存,根据 Config 中的已有属性,自动更新设置。同时,当用户修改 SettingsDialog 中的属性 + 后, Config 能够受到变化并修改内部的配置文件。这也是应用响应 SettingsDialog 中的属性 + 信息发生变化的方式。例如下述代码: + +```qml + import org.deepin.dtk + + Config { + name: "example" // 存储配置文件的名称 + + property string setting1: "Setting1" // 配置文件中设置项的具体内容。 + property int setting2: 0 + } +``` + + SettingsDialog 中必须指定 Config 才能对配置项进行生效和存储,当 Config 无效时,SettingsDialog + 同样也不会生效任何设置。DConfig 中的具体细节,可查阅 dtkcore 项目中的文档。 + + \section1 SettingsGroup, SettingsOption + SettingsDialog 中设置项有内部的多个 SettingsGroup 构成,而 SettingsGroup 可以嵌套其子 SettingsGroup + 和 SettingsOption,形成一个配置树,同一层级的配置,表现为同一字体和缩进大小。不同的层级,具备父子关系的 + 不同层级,所属关系跟随父子关系。例如一下代码示例: +```qml + import QtQuick 2.0 + import org.deepin.dtk 1.0 + import org.deepin.dtk.settings 1.0 as Settings + + Settings.SettingsDialog { + id: SettingsDialog + + width: 800 + height: 600 + + config: Config { + name: "example" // 请确保配置文件存在 + property string setting1: "Setting1" // 请确保配置文件存在该属性 + } + + groups: [ // 配置根 SettingsGroup 组,其包含多个并列的 SettingsGroup 对应关系为,根节点下的多个设置项 + Settings.SettingsGroup { + key: "rootKey1" + name: "Basic Settings" + + children: [ // 配置该组下的子 SettingGroup + Settings.SettingsGroup { + key: "group1" + name: "Custom Widget" + + Settings.SettingOption { + key: "setting1" // 对应 Config 中的属性名 + Settings.ComboBox { // Settings封装的基础控件类型 + model: ["first", "sceond", "three"] + } + } + } + ] + } + + ] + } +``` + + \section1 自定义属性 + SettingsDialog 中提供了多个可自定义的组件,在实现风格统一的同时,也能够帮助用户高度定制内部组件。 + 可定制的区域,包括 SettingsContainer(主界面容器); 导航界面视图; 内容界面视图。 + SettingsContainer 中也存在可自定义的子属性: NavigationTitle(导航栏标题); ContentTitle(内容区域标题); + ContentBackground(内容区域背景)。 + + 自定义方式如下代码所示: +```qml + import QtQuick 2.0 + import org.deepin.dtk 1.0 + import org.deepin.dtk.settings 1.0 as Settings + + Settings.SettingsDialog { + id: SettingsDialog + + width: 800 + height: 600 + + config: Config { + name: "example" // 请确保配置文件存在 + property string setting1: "Setting1" // 请确保配置文件存在该属性 + } + + groups: [ // 配置根 SettingsGroup 组,其包含多个并列的 SettingsGroup 对应关系为,根节点下的多个设置项 + Settings.SettingsGroup { + key: "rootKey1" + name: "Basic Settings" + + container.contentBackground: Settings.ContentBackground { + border.color: "red" // 将对话框的内容区域部分添加边框 + } + + children: [ // 配置该组下的子 SettingGroup + Settings.SettingsGroup { + key: "group1" + name: "Custom Widget" + background: Settings.ContentBackground { + boder.color: "blue" // 特殊组的边框可自定义 + radius: 18 + } + + Settings.SettingOption { + key: "setting1" // 对应 Config 中的属性名 + Settings.ComboBox { // Settings封装的基础控件类型 + model: ["first", "sceond", "three"] + } + } + } + ] + } + + ] + } +``` + + + +@property list org.deepin.dtk.settings::SettingsDialog::groups + + SettingsDialog 中的根设置组。根设置组使用 FontManager 中 t1 号字体区分。并且其缩进保持最小。 + 其可保存多个 SettingsGroup 或 SettingsOption。 + + + +@property Config org.deepin.dtk.settings::SettingsDialog::config + + config 属性存储 SettingsDialog 用于读写的配置文件,每个配置文件中的配置属性,都需要 + 和 SettingsDialog 中的设置项对应,才能保证当用户修改了 SettingsDialog 的属性后 + 配置文件能够跟随发生变化,也确保了外部通过修改配置文件中配置属性的值时,界面中的配置项 + 能够跟随配置文件的改变发生变化。 + + + +@property SettingsContainer org.deepin.dtk.settings::SettingsDialog::container + + container 属性存储 SettingDialog 中的主界面容器。默认情况下,SettingsDialog 会提供一个默认的 + 基于 DTK 风格的主界面容器,当应用程序需要自定义界面时,可通过设置该属性进行改变。 + + + +@property Item org.deepin.dtk.settings::SettingsDialog::navigationView + + navigationView 属性存储导航视图界面的控件。默认情况下,DTK 会提供一个自适应设置项层级的导航视图。 + 当自定义该属性时,需要考虑滚动区域和点击单项标题时内容区域的跳转问题。 + + + +@property Item org.deepin.dtk.settings::SettingsDialog::contentView + + contentView 内容视图存储用于放置设置项内容区域的视图控件。默认情况下,SettingsDialog 提供了一个 + 根据 SettingsOption 的层级关系,自动列举的视图控件。 + diff -Nru dtkdeclarative-5.6.3/docs/qml/SliderTipItem.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/SliderTipItem.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/SliderTipItem.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/SliderTipItem.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,59 @@ +/** +@~chinese +@class SliderTipItem +@ingroup Control + +@ingroup QML_TYPES +@brief 被用于放置在 TipsSlider 控件中的滑块标签. +@details + SliderTipItem 是被用于放置在 TipsSlider 中的滑块标签控件。 SliderTipItem 可以添加特殊 + 的文本,用于指示滑动条的位置信息,文本可以是数字;特殊标签等等。 + SliderTipItem 的使用方式如下: +```qml + TipsSlider { + id: sliderTickTip + readonly property var tips: [qsTr("Fast"), qsTr("Slow")] + width: 200 + tickDirection: TipsSlider.TickDirection.Back + slider.handleType: Slider.HandleType.ArrowBottom + + ticks: [ + SliderTipItem { + text: sliderTickTip.tips[0] + }, + SliderTipItem { + text: sliderTickTip.tips[1] + } + ] + } +``` +@sa TipsSlider + +@property string SliderTipItem::text +@brief text 属性用于控制 SliderTipItem 当前显示的文本。 + +@property enumeration SliderTipItem::textHorizontalAlignment +@brief textHorizontalAlignment 属性用于控制 SliderTipItem 文本水平布局,默认情况下为 水平居中(Text.AlignHCenter)。 + 可使用以下枚举: Text.AlignLeft, Text.AlignRight, Text.AlignHCenter + +@property enumeration SliderTipItem::direction +@note 只读属性 +@brief direction 属性和其所属的 Slider 的 direction 属性保持一致。 +@sa Slider::direction + +@property bool SliderTipItem::horizontal +@note 只读属性 +@brief horizontal 属性和其所属的 Slider 的 horizontal 属性保持一致。 +@sa Slider::horizontal + +@property bool SliderTipItem::highlight +@brief highlight 属性控制 SliderTipItem 中背景是否需要高亮,默认情况下为 false。 + +@property Palette SliderTipItem::tickColor +@brief tickColor 属性控制 SliderTipItem 中控制滑块标签指示的颜色(一般用于连接文字和滑动条的水平 + 或竖直线条)。 + +@property Palette SliderTipItem::textColor +@brief textColor 属性控制 SliderTipItem 中文本颜色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/Slider.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/Slider.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/Slider.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/Slider.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,86 @@ +/** +@~chinese +@class Slider(FlowStyle) +@ingroup Slider + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的滑动条控件. +@details + Slider 控件被用于通过控制滑块选择指定值或者代表某一进度。
+ Slider 在行云设计中增加了许多用于额外控制的方式和布局,例如增加了用于指示进度的提示文本;
+ 提供了上下左右四个方向的滑块;
+ Slider 的用法如下代码所示:
+```qml + Slider { + width: parent.width + handleType: Slider.HandleType.ArrowBottom + } +``` + Slider 的效果如下图所示:
+| **方向** | **滑块方向** | **效果** | +|--------|----------|---------------------------------| +| 横向 | 无滑块方向 | @image html SliderNormalHor.png | +| 纵向 | 滑块朝下 | @image html SliderNormalVer.png | + + +@property Palette Slider(FlowStyle)::grooveColor +@brief grooveColor 属性控制滑槽的颜色, \c grooveColor 并非控制滑槽划过区域的颜色, + 而是整个滑槽的默认颜色。 + + + +@property enumeration Slider(FlowStyle)::handleType +@brief handleType 属性表示滑块的方向,默认情况下,滑块无任何方向。 +@details +handleType 可供使用的枚举为:
+| **枚举** | **含义** | +|:------------------------:|:------------------------:| +| Slider.NoArrowHorizontal | 水平无方向 | +| Slider.NoArrowVertical | 竖直无方向 | +| Slider.ArrowUp | 滑块箭头朝上,一般用于滑动条为水平方向时 | +| Slider.ArrowLeft | 滑块箭头朝左,一般用于滑动条为竖直方向时 | +| Slider.ArrowBottom | 滑块箭头朝下,一般用于滑动条为水平方向时 | +| Slider.ArrowRight | 滑块箭头朝右,一般用于滑动条为竖直方向时 | + +@note 注意,水平无方向和竖直无方向,在滑动条的水平和数值方向时,滑块的图标也不一样, + 水平无方向时,滑块宽度高于高度,显得更加扁平,竖直无方向时,滑块高度高于宽度,显得更加修长。 + + +@property real Slider(FlowStyle)::dashOffset +@brief dashOffset 属性是绘制滑块时,画笔的起始位置偏移量。 +@image html SliderDashOffset.png + + 如上图所示,当 \c dashOffset 不为0时,绘制滑槽的位置将根据绘制位置发生 + 偏移,例如下述示例,\c dashOffset 为 0 和 dashOffset 为 20 的比较。 +@image html SliderDashOffsetCompare.png + + 上图中,上层 Slider 调整了 dashOffset 而 Slider 未调整,但从上图可以看出 + 并不是 Slider 设置 dashOffset 值,绘制就会在偏移 dashOffset 大小后开始,它 + 还受绘制的间距影响,例如下图所示: +@image html SliderDashOffsetCompareWithPattern.png + + + +@property var Slider(FlowStyle)::dashPattern +@brief dashPattern 表示绘制点和间距的距离,默认值为[0.5, 0.25] +@details 即可以理解为,每绘制0.5 像素的滑条样式,就绘制 0.25 像素的间距。将其中值变大,会起到其代表的那一部分的区域变大的效果。 + 例如以下代码: +```qml + Slider { + dashPattern: [0.5, 5] // 每绘制0.5像素的滑块,就绘制5像素的间距 + width: 200 + } +``` + 效果如下图所示: +@image html SliderDashPattern.png + +@property bool Slider(FlowStyle)::highlightedPassedGroove +@brief highlightedPassedGroove 属性控制是否高亮滑块移动过的区域, +@details 默认情况下 highlightedPassedGroove为 false。
+效果如下所示: +| **highlightedPassedGroove** | **效果** | +|:---------------------------:|:---------------------------------:| +| false | @image html SliderNormalHor.png | +| true | @image html SliderHighlighted.png | + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/SortFilterModel.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/SortFilterModel.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/SortFilterModel.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/SortFilterModel.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,108 @@ +/** +@~chinese +@class SortFilterModel +@ingroup DelegateModel + +@ingroup QML_TYPES +@brief 提供一种自带过滤和排序的 DelegateModel. +@details + SortFilterModel 提供自带过滤和排序的 DelegateModel,SortFilterModel 中的特定函数控制了
+ 其中列表中每个项的显示和隐藏,通常和控件中的搜索功能绑定。
+ 一般的 SortFilterModel 用法如下:
+```qml + Rectangle { + width: 200; height: 100 + + SortFilterModel { + id: visualModel + model: ListModel { + ListElement { name: "Apple" } + ListElement { name: "Orange" } + } + delegate: Rectangle { + height: 25 + width: 100 + Text { text: "Name: " + name} + } + } + + ListView { + anchors.fill: parent + model: visualModel + } + } +``` + + 上述示例不带任何排序和过滤,对上述代码修改可实现特定情况的过滤,例如下述代码过滤 type 1 类型的元素。 +```qml + Rectangle { + width: 200; height: 100 + + SortFilterModel { + id: visualModel + model: ListModel { + ListElement { type: 1; name: "Apple" } + ListElement { type: 2; name: "Orange" } + } + delegate: Rectangle { + height: 25 + width: 100 + Text { text: "Name: " + name} + } + + filterAcceptsItem: function(item) { + return item.type === 1 + } + } + + ListView { + anchors.fill: parent + model: visualModel + } + } +``` + 对于多个 type == 1 的元素时,可以通过 lessThan 函数对过滤出的元素进行排序,如下代码: +```qml + Rectangle { + width: 200; height: 100 + + SortFilterModel { + id: visualModel + model: ListModel { + ListElement { type: 1; prior: 2; name: "Apple" } + ListElement { type: 2; prior: 1; name: "Coconut" } + ListElement { type: 2; prior: 1; name: "Orange" } + } + delegate: Rectangle { + height: 25 + width: 100 + Text { text: "Name: " + name} + } + + filterAcceptsItem: function(item) { + return item.type === 1 + } + + lessThan: function(item1, item2) { + return item1.prior < item2.prior + } + } + + ListView { + anchors.fill: parent + model: visualModel + } + } +``` + +@property var SortFilterModel::lessThan +@brief lessThan 函数用于排序。 + +@property var SortFilterModel::filterAcceptsItem +@brief filterAcceptsItem 函数用于进行视图项的过滤。 + +@property var SortFilterModel::visibleGroup +@brief visibleGroup 为当前可视的 DelegateModelGroup 。 +@sa DelegateModelGroup + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/SpinBoxIndicator.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/SpinBoxIndicator.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/SpinBoxIndicator.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/SpinBoxIndicator.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ \ No newline at end of file diff -Nru dtkdeclarative-5.6.3/docs/qml/SpinBox.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/SpinBox.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/SpinBox.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/SpinBox.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,41 @@ + +/** +@~chinese +@class SpinBox +@ingroup SpinBox + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 SpinBox 控件. +@details + SpinBox控件一种行云设计风格的数字轮选框控件。SpinBox提供了视图组件和编辑组件 2 种,当处于视图组件时, + SpinBox控件的轮选器变成平面的可视化形状,当处于编辑组件时,SpinBox将轮选器修改为类似于按钮的形状。 + 除此之外,SpinBox提供了水平带“+”,“-”符号的数字轮选框,可查看 PlusMinusSpinBox 控件。 + SpinBox的使用方式如下所示: +```qml + SpinBox { + from: 0 + to: 23 + value: 8 + } +``` + SpinBox在视图组件下的效果如下图所示: +@image html SpinBoxExample.png + SpinBox在编辑组件下的效果如下图所示: +@image html SpinBoxEdit.png + +@property string SpinBox::alertText +@brief alertText 属性表示SpinBox的警告文本。 +@details + 默认情况下,不显示任何警告提示。
+ SpinBox显示警告的效果如下图所示: +@image html SpinBoxAlert.png + +@property int SpinBox::alertDuration +@brief alertDuration 属性表示SpinBox的警告时长 +@details 警告信息会在警告时常结束后自动隐藏,当 alertDuration 为 -1 或不设置时,警告信息会根据 \c showAlert 属性进行显示和隐藏。 + +@property bool SpinBox::showAlert +@brief showAlert 属性控制警告信息的显示和隐藏 +@details 当`showAlert` 为 true 时,警告信息会在 `alertDuration` 结束后,`showAlert` 会自动置为 false。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/StackView.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/StackView.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/StackView.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/StackView.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ \ No newline at end of file diff -Nru dtkdeclarative-5.6.3/docs/qml/StyledArrowShapeWindow.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/StyledArrowShapeWindow.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/StyledArrowShapeWindow.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/StyledArrowShapeWindow.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,3 @@ +/** +TODO:补全文档 +*/ \ No newline at end of file diff -Nru dtkdeclarative-5.6.3/docs/qml/StyledBehindWindowBlur.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/StyledBehindWindowBlur.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/StyledBehindWindowBlur.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/StyledBehindWindowBlur.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,23 @@ +/** +@~chinese +@class StyledBehindWindowBlur +@ingroup BehindWindowBlur + +@brief 提供一个 DTK 统一的窗口外模糊控件. +@details + StyledBehindWindowBlur 控件继承于 BehindWindowBlur 控件, 其在 BehindWindowBlur 控件的基础上指定了特定的 + 混色渲染颜色。 当应用进行 DTK 程序开发时,推荐使用 StyledBehindWindowBlur 控件,能够保证应用模糊的混色颜色一致。
+ 通常情况下,其混色颜色如下表所示: +| **模式** | **颜色** | +|:--------:|:------------------------:| +| 亮色-支持模糊 | rgba(235, 235, 235, 0.6) | +| 亮色-不支持模糊 | rgba(235, 235, 235, 1.0) | +| 暗色-支持模糊 | rgba(0, 0, 0, 0.3) | +| 暗色-不支持模糊 | rgba(35, 35, 35, 1.0) | + +@property var StyledBehindWindowBlur::control +@brief 该属性用于指定 StyledBehindWindowBlur 控件作用于那个控件之上 +@details 其目的用户获取该控件的调色板颜色值用于判定当前处于那种主题下,用于选择合适的混合填充色。 + 该属性使用 Control 和 ApplicationWindow 都符合要求。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/Switch.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/Switch.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/Switch.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/Switch.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,35 @@ + +/** +@~chinese +@class Switch +@ingroup Switch + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 Switch 控件. +@details + Switch 控件是一个用于切换的开关按钮,Switch + 一般情况下不需要使用文本修饰,但它可以额外添加文本。 + Switch 控件使用 DciIcon 完成,具有丰富的阴影和动画效果。 + Switch 的效果如下图所示: +@image html SwitchButton.png + + Switch 的用法如下所示: +```qml + ColumnLayout { + Switch { + text: qsTr("Wi-Fi") + } + Switch { + text: qsTr("Bluetooth") + } + } +``` + +@property Palette Switch::backgroundColor +@brief backgroundColor 属性用于控制 Switch 控件的背景颜色。 + +@property Palette Switch::handleColor +@brief handleColor 属性用于控制 Switch 控件的滑块的颜色。 +@details Switch 在非 checked 状态下的颜色,如需修改 checked 状态下颜色,请尝试修改 palette.highlight 调色板。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/TextArea.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/TextArea.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/TextArea.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/TextArea.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,26 @@ +/** +@~chinese +@class TextArea(FlowStyle) +@ingroup TextArea + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 TextArea 控件. +@details + {TextArea(FlowStyle)}{TextArea}是一个文本输入区域控件, 其支持多行输入。 + 效果如下: +@image html TextAreaExample.png + +``qml + + TextArea { + text: "你好,这里是多行输入框" + width: 100 + height: 100 + } + +``` + +@property Palette TextArea(FlowStyle)::placeholderTextColor +@brief placeholderTextColor 控制{TextArea(FlowStyle)}{TextArea}的占位文本颜色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/TextField.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/TextField.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/TextField.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/TextField.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,34 @@ +/** +@~chinese +@class TextField +@ingroup TextField +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 TextField 控件. +@details + TextField 是一个单行文本输入框。TextField + 拓展了原生的 TextField 控件,增加了部分自定义属性用于提高拓展性。例如,适配了警告提示;调整了风格样式。 + 但 TextField 和 LineEdit 相比, TextField + 未添加文本清除按钮。 + TextField 的样式如下所示: +| **状态** | **图片** | +|:--------:|:---------------------------------:| +| Normal | @image html TextFieldNormal.png | +| Focus | @image html TextFieldFocus.png | +| Disabled | @image html TextFieldDisabled.png | + +@property Palette TextField::backgroundColor +@brief backgroundColor 属性控制 TextField 的背景颜色。 + +@property string TextField::alertText +@brief backgroundColor 属性控制警告信息的文本。 + +@property int TextField::alertDuration +@brief alertDuration 属性控制警告信息的显示时长 +@details 默认情况下,不设置显示时常警告信息会在`showAlert`属性为`false`时隐藏,设置后会在`alertDuration`结束后隐藏, + `alertDuration`为 -1 时,表示一直显示。 + +@property bool TextField::showAlert +@brief showAlert 属性控制警告信息是否显示 +@details `showAlert` 为 true 时,警告信息会在`alertDuration`结束后自动隐藏,`showAlert` 会跟随变为`false`,否则需要手动控制`showAlert`属性隐藏。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ThemeMenu.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ThemeMenu.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ThemeMenu.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ThemeMenu.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,13 @@ +/** +@~chinese +@class ThemeMenu +@ingroup Menu(FlowStyle) + +@ingroup QML_TYPES +@brief 提供默认主题菜单. +@details + ThemeMenu 控件用于提供默认的主题菜单,自带亮色主题、暗色主题和系统主题三种主题菜单。 + 其效果如下图所示: +@image images/ThemeMenuExample.png + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/TipsSlider.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/TipsSlider.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/TipsSlider.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/TipsSlider.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,81 @@ +/** +@~chinese +@class TipsSlider +@ingroup Control + +@ingroup QML_TYPES +@brief 提供一种带标签文本的滑动条控件. +@details + TipsSlider 是一种带标签文本的滑动条。根据使用场景不同,可以控制 + 标签的种类。 + TipsSlider 添加默认空标签 +```qml + TipsSlider { + width: 200 + tickDirection: TipsSlider.TickDirection.Back + slider.highlightedPassedGroove: true + slider.handleType: Slider.HandleType.ArrowBottom + + ticks: [SliderTipItem { + }, + SliderTipItem { + }, + SliderTipItem { + }, + SliderTipItem { + }] + } +``` + 效果如下图所示: +@image html TipsSliderDefault.png +TipsSlider 添加字符标签 +```qml + TipsSlider { + id: slider + readonly property var tips: [qsTr("1m"), qsTr("30m"), qsTr("Never")] + width: 180 + tickDirection: TipsSlider.TickDirection.Back + slider.handleType: Slider.HandleType.ArrowBottom + slider.stepSize: 10 + slider.from: 0 + slider.to: 20 + slider.value: 10 + + ticks: [ + SliderTipItem { + text: slider.tips[0] + textHorizontalAlignment: Text.AlignLeft + }, + SliderTipItem { + highlight: true + text: slider.tips[1] + }, + SliderTipItem { + text: slider.tips[2] + textHorizontalAlignment: Text.AlignRight + } + ] + } +``` + 效果如下图所示: +@image html TicksSllider_Highlight.png + + TipsSlider 同样适配不同方向,不同位置的标签,通过 tickDirection 和 slider.orientation + 属性控制。 + +@property Item TipsSlider::slider +@brief slider 属性获取 TipsSlider 的内部 Slider 控件。 + +@property list TipsSlider::ticks +@brief ticks 属性设置 TipsSlider 中的所有标签。 + +@property enumeration TipsSlider::tickDirection +@brief tickDirection 是 TipsSlider 提供标签方向属性的枚举。 +@details + 目前提供了 TipsSlider.Front 和 TipsSlider.Back 两个枚举。 + Front 枚举代表标签在 TipsSlider 的前部,TipsSlider 水平方向时为上部,竖直方向时 + 为前部。 + Back 枚举代表标签在 TipsSlider 的后部,TipsSlider 水平方向时为下部,竖直方向时 + 为后部。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/TitleBar.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/TitleBar.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/TitleBar.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/TitleBar.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,200 @@ + +/** +@~chinese +@class TitleBar +@ingroup Control + +@ingroup QML_TYPES +@brief 提供一种统一样式风格的标题栏控件. +@details + TitleBar 控件用于标准样式风格的 TitleBar 控件,与 DialogTitleBar不同, TitleBar 只被用于 ApplicationWindow 中的标题栏。
+ 通常情况下,标题栏适配 ApplicationWindow 的布局,需要放置在 header 属性中,例如以下代码:
+```qml + import org.deepin.dtk 1.0 + + ApplicationWindow { + id: root + + flags: Qt.Window | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint + header: TitleBar {} + } +``` + TitleBar 主要用于 DTK 中适配的无标题窗口,在去除系统标题栏后, DTK 应用需要 + 添加一个应用内的 TitleBar 控件,当作应用统一的标题栏。这在 UOS/Deepin 操作 + 系统中非常友好,例如以下代码: +```qml + import org.deepin.dtk 1.0 + + ApplicationWindow { + id: root + + header: TitleBar {} + DWindow.enabled: true + DWindow.windowRadius: 16 + } +``` + TitleBar 默认是最顶层控件,其他所有控件无法越过 TitleBar ,并且 TitleBar 中提供了 + 通用标题栏的默认布局,如应用图标,应用标题,菜单按钮,最大化最小化关闭按钮等等。TitleBar + 还支持添加额外的自定义内容,这取决于应用想要实现的样式,例如以下代码: + 添加中心区域的代码如下: +```qml + import org.deepin.dtk 1.0 + + ApplicationWindow { + id: root + + header: TitleBar { + content: Item { + SearchEdit { + anchors.centerIn: parent + width: 300 + placeholder: "搜索" + } + } + } + DWindow.enabled: true + DWindow.windowRadius: 16 + } +``` + 添加左侧区域的代码如下: +``` + import org.deepin.dtk 1.0 + + ApplicationWindow { + id: root + + header: TitleBar { + leftContent: ActionButton { + icon.name: "window_sidebar" + } + } + DWindow.enabled: true + DWindow.windowRadius: 16 + } +``` + Titlebar 适配的 ApplicationWindow 中的 flags 属性。 WindowMinMaxButtonsHint 属性 + 控制标题栏的最大化最小化按钮 WindowCloseButtonHint 属性控制关闭按钮;WindowTitleHint 属性 + 控制在标题文本属性;在xcb环境下,还能够通过修改 MotifDecoration 来控制窗口的标题,其中 DECOR_MINIMIZE + 表示最小化按钮, DECOR_MAXIMIZE 表示最大化按钮 DECOR_TITLE 表示窗口标题。 + +@property string TitleBar::title +@brief title 属性用于控制标题栏的标题文本 + +@property DciIcon TitleBar::icon +@brief icon 属性用于控制标题栏的图标, \c icon 的类型是 DciIcon,能同时 + 兼容 QtIcon 和 DciIcon。 + +@property Component TitleBar::leftContent +@brief leftContent 属性用于添加标题左侧区域的组件,例如添加侧边栏按钮等等。 + +@property Component TitleBar::content +@brief content 属性用于添加标题中心区域的组件,当存在多个组件时,可以使用 + 布局进行排列。 + +@property Component TitleBar::menu +@brief menu 属性用于控制 Option 按钮的弹出菜单。默认情况下 TitleBar 会提供 + 一个默认的菜单,当需要自定义菜单时,菜单项需要进行手动调整。 + 例如以下代码: +```qml + import org.deepin.dtk 1.0 + + ApplicationWindow { + id: root + + ButtonGroup { + id: activeColorSelector + onCheckedButtonChanged: { + root.palette.highlight = checkedButton.color + } + } + + header: TitleBar { + menu: Menu { + Action { + text: "Light Theme" + } + Action { + text: "Dark Theme" + } + MenuItem { + contentItem: Item { + Row { + anchors.centerIn: parent + Repeater { + model: ["#d8316c", "#ff5d00", "#f8cb00", "#23c400", "#00a48a", "#0081ff", "#3c02d7", "#8c00d4"] + delegate: ColorButton { + color: modelData + Component.onCompleted: { + activeColorSelector.addButton(this) + } + } + } + } + } + } + } + DWindow.enabled: true + DWindow.windowRadius: 16 + } +``` + +@property bool TitleBar::menuDisabled +@brief menuDisabled 属性可以将 menu 属性设置禁用或者启用,默认情况下为 false。 + + + +@property Component TitleBar::aboutDialog +@brief aboutDialog 属性控制应用的关于对话框。其使用方式如下所示: +```qml + import org.deepin.dtk 1.0 + + ApplicationWindow { + id: root + DWindow.enabled: true + DWindow.windowRadius: 16 + + header: TitleBar { + aboutDialog: AboutDialog { + modality: Qt.NonModal + version: qsTr(String("Version: %1").arg(Qt.application.version)) + productName: qsTr(appProductName) + companyLogo: "file://" + DTK.deepinDistributionOrgLogo + websiteName: DTK.deepinWebsiteName + websiteLink: DTK.deepinWebsiteLink + license: appLicense === "" ? "" : qsTr(String("%1 is released under %2").arg(appProductName).arg(appLicense)) + } + } + } +``` +@sa AboutDialog + +@property bool TitleBar::fullScreenButtonVisible +@brief fullScreenButtonVisible 属性控制 TitleBar 在全屏时按钮是否可见。 +@details 默认情况下,该值是 true。 + +@signal TitleBar::toggleWindowState() +@brief toggleWindowState 信号当窗口状态发生变化时触发。例如双击最大化等操作时。 + +@property bool TitleBar::windowButtonGroup +@brief windowButtonGroup 是默认的窗口按钮组 +@details 包含最小化、最大化、关闭按钮。默认情况下,该属性已经由 TitleBar 提供。 + +@property bool TitleBar::autoHideOnFullscreen +@brief autoHideOnFullscreen 属性表示是否在全屏时自动关闭标题栏 +@details 默认情况下,该值为 false。 + +@property bool TitleBar::embedMode +@brief embedMode 属性表示是否属于嵌入模式 +@details 当`DWindow.enabled`属性为false 时, embedMode 为 true, 否则为 false。 +@details 嵌入模式下的标题栏上的`WindowButtonGroup`上的按钮均有系统标题栏提供。 + +@property bool TitleBar::separatorVisible +@brief separatorVisible 属性控制分隔符是否可见。默认情况下,该值为 true。 + +@property bool TitleBar::enableInWindowBlendBlur +@brief enableInWindowBlendBlur 属性表示是否开启窗口内模糊,默认情况下为 false。 +@sa InWindowBlur + +@property Palette TitleBar::textColor +@brief textColor 属性控制文本和图标等颜色,即前景色相关颜色。 + diff -Nru dtkdeclarative-5.6.3/docs/qml/ToolButton.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ToolButton.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ToolButton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ToolButton.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,30 @@ + +/** +@~chinese +@class ToolButton(FlowStyle) +@ingroup ToolButton + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 ToolButton 控件. +@details + {ToolButton(FlowStyle)}{ToolButton} 是一种工具型按钮,其经常被放置于ToolBar 这类工具栏中,{ToolButton(FlowStyle)}{ToolButton}支持图标和文字的高级排列,也具备普通 Button 的所有特性。 + 可以是普通的按钮,如下效果: +@image html ToolButtonNormal.png + 可以是复杂的文字和图标排列按钮,如下效果: +@image html ToolButtonIconLabel.png + 它也能被放置于 FloatingPanel 或者 ButtonBox 中,如下效果: +@image html ToolButtonFloatingPanel.png + 其使用代码如下所示: +```qml + ButtonBox { + ToolButton { icon.name: "action_newfolder"; text: "文件夹";} + ToolButton { icon.name: "action_copy"; text: "复制" } + ToolButton { icon.name: "action_share"; text: "分享" } + ToolButton { icon.name: "action_compress"; text: "压缩" } + } +``` + +@property Palette ToolButton(FlowStyle)::textColor +@brief textColor 控制 {ToolButton(FlowStyle)}{ToolButton} 的前景颜色,如图标和文本的颜色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/ToolTip.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/ToolTip.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/ToolTip.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/ToolTip.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,30 @@ +/** +@~chinese +@class ToolTip(FlowStyle) +@ingroup ToolTip + +@ingroup QML_TYPES +@brief 提供一种行云设计风格的 ToolTip 控件. +@details + {ToolTip(FlowStyle)}{ToolTip} 是一个控件的提示, 其作用是通知用户控件的功能. + 具体效果如下: +@image html ToolTipExample.png + +其使用代码如下所示: +```qml + ScrollBar { + id: vbar + hoverEnabled: true + active: hovered || pressed + orientation: Qt.Horizontal + size: frame.width / content.width + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + ToolTip.visible: hovered + ToolTip.delay: 1000 + ToolTip.timeout: 5000 + ToolTip.text: "This is a ScrollBar!!!" + } +``` +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/WarningButton.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/WarningButton.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/WarningButton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/WarningButton.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,14 @@ + +/** +@~chinese +@class WarningButton +@ingroup Button(FlowStyle) + +@ingroup QML_TYPES +@brief 提供一种用于警告的按钮控件. +@details + WarningButton 是一个专门用于提示警告的按钮控件,其文本呈现出警告 + 的红色,用于出现警告提示的地方,效果如下所示: +@image html WarningButtonExample.png + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/WaterProgressBar.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/WaterProgressBar.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/WaterProgressBar.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/WaterProgressBar.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,45 @@ + +/** +@~chinese +@class WaterProgressBar +@ingroup Control +@ingroup QML_TYPES +@brief 提供一种水波纹类型的进度条控件. +@details + WaterProgressBar 提供一种趣味的水波纹进度条控件。WaterProgressBar有特殊的水波纹动画,能够将进度条的形式修改为水涨的效果。
+ 例如下述代码:
+@image html WaterProgressBar.gif + + WaterProgressBar 的使用方式如下所示: +```qml + WaterProgressBar { + NumberAnimation on value { + loops: Animation.Infinite + from: 0 + to: 100 + duration: 10000 + } + } +``` + +@property int WaterProgressBar::value +@brief value 属性表示 WaterProgressBar 进度值,其取值范围为[0, 100] +@note 请注意不要超过该范围。当 `value` > 0 时 WaterProgressBar 开始水波动画。当 `value` > 30 时 WaterProgressBar 开始气泡动画 + +@property Palette WaterProgressBar::backgroundColor1 +@brief backgroundColor1 属性表示 WaterProgressBar 的第一背景颜色值。 +@details WaterProgressBar 的默认背景为渐变背景。 + +@property Palette WaterProgressBar::backgroundColor2 +@brief backgroundColor2 属性表示 WaterProgressBar 的第二背景颜色值。 + +@property Palette WaterProgressBar::dropShadowColor +@brief dropShadowColor 属性表示 WaterProgressBar 的阴影颜色值。 + +@property Palette WaterProgressBar::popBackgroundColor +@brief popBackgroundColor 属性表示 WaterProgressBar 的弹出气泡的背景颜色。 + +@property Palette WaterProgressBar::textColor +@brief textColor 属性表示 WaterProgressBar 的前景颜色,即文字的颜色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/WindowButtonGroup.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/WindowButtonGroup.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/WindowButtonGroup.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/WindowButtonGroup.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,32 @@ + +/** +@~chinese +@class WindowButtonGroup +@ingroup RowLayout +@ingroup QML_TYPES +@brief 提供用于放置在 Titlebar 中的窗口按钮组. +@details + WindowButtonGroup 被用于添加到 Titlebar 中作为通用的窗口按钮组
+ 默认情况下, WindowButtonGroup 包含了 最大化按钮;最小化按钮;还原按钮;全屏按钮;退出全屏按钮;关闭按钮等等。
+ 如果需要添加新的按钮可以直接在 WindowButtonGroup 进行添加,被添加的组件需要使用 Layout 进行布局排列。
+ 例如下述代码: +```qml + WindowButtonGroup { + WindowButton { + icon.name: "action_add" + } + } +``` + +@property Palette WindowButtonGroup::textColor +@brief textColor 属性控制组内所有 WindowButton 的前景色,如文本和图标的颜色。 + +@property bool WindowButtonGroup::fullScreenButtonVisible +@brief fullScreenButtonVisible 属性控制是否在全屏下对按钮仍可见。默认为 true。 + +@property bool WindowButtonGroup::embedMode +@brief embedMode 属性控制是否处于嵌入模式下 +@details 嵌入模式下的按钮将按照系统标题栏进行控制。默认该属性跟随是否启用 DWindow.enabled 开启。 +@sa DWindow + +*/ diff -Nru dtkdeclarative-5.6.3/docs/qml/WindowButton.zh_CN.dox dtkdeclarative-5.6.10/docs/qml/WindowButton.zh_CN.dox --- dtkdeclarative-5.6.3/docs/qml/WindowButton.zh_CN.dox 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/qml/WindowButton.zh_CN.dox 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,35 @@ + +/** +@~chinese +@class WindowButton +@ingroup Control + +@ingroup QML_TYPES +@brief 一种专门用于 TitleBar 上的窗口按钮. +@details + WindowButton 是专门用于 TitleBar 上窗口按钮,是 TitleBar 和 DialogTitleBar的通用窗口按钮,通常情况下 WindowButton 被添加到 WindowButtonGroup 中, + 包含最大化、最小化、关闭按钮。菜单按钮默认不添加到 WindowButtonGroup 中。
+ TitleBar 中默认就添加了上述窗口,因此 WindowButton 在需要自定义标题栏按钮时才会被使用。
+ WindowButton 的默认样式如下所示:
+@image html WindowButton_normal.png + WindowButton 的 Hovered 样式如下所示: +@image html images/WindowButton_hovered.png + WindowButton 的 Pressed 样式如下所示: +@image html WindowButton_pressed.png + +@property DciIcon WindowButton::icon +@brief icon 属性控制 WindowButton 的图标。 + +@property bool WindowButton::pressed +@brief pressed 属性表示 WindowButton 是否处于按下的状态。 + +@signal WindowButton::clicked() +@brief clicked 信号当 WindowButton 点击后发送。 + +@property Palette WindowButton::textColor +@brief textColor 属性控制 WindowButton 的前景色颜色,包含图标和文本的颜色。 + +@property Palette WindowButton::backgroundColor +@brief textColor 属性控制 WindowButton 的背景色颜色。 + +*/ diff -Nru dtkdeclarative-5.6.3/docs/snippets/dtkdeclarative_boxinsetshadow.qml dtkdeclarative-5.6.10/docs/snippets/dtkdeclarative_boxinsetshadow.qml --- dtkdeclarative-5.6.3/docs/snippets/dtkdeclarative_boxinsetshadow.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/docs/snippets/dtkdeclarative_boxinsetshadow.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,99 @@ +Item { + +//! [0] +Rectangle { + id: backgroundRect + + color: Qt.rgba(1, 0, 0, 0.4) + width: 200 + height: 200 + radius: 8 +} + +BoxInsetShadow { + anchors.fill: backgroundRect + z: DTK.AboveOrder + shadowBlur: 2 + spread: 1 + shadowColor: Qt.rgba(0, 0, 0) + cornerRadius: backgroundRect.radius +} +//! [0] +//! [1] +Rectangle { + id: backgroundRect + + color: Qt.rgba(1, 0, 0, 0.4) + width: 200 + height: 200 + radius: 8 +} + +BoxInsetShadow { + anchors.fill: backgroundRect + z: DTK.AboveOrder + shadowBlur: 20 + spread: 1 + shadowColor: Qt.rgba(0, 0, 0) + cornerRadius: backgroundRect.radius +} +//! [1] +//! [2] +Rectangle { + id: backgroundRect + + color: Qt.rgba(1, 0, 0, 0.4) + width: 200 + height: 200 + radius: 8 +} + +BoxInsetShadow { + anchors.fill: backgroundRect + z: DTK.AboveOrder + shadowBlur: 40 + spread: 1 + shadowColor: Qt.rgba(0, 0, 0) + cornerRadius: backgroundRect.radius +} +//! [2] +//! [3] +Rectangle { + id: backgroundRect + + color: Qt.rgba(1, 0, 0, 0.4) + width: 200 + height: 200 + radius: 8 +} + +BoxInsetShadow { + anchors.fill: backgroundRect + z: DTK.AboveOrder + shadowBlur: 2 + spread: 10 + shadowColor: Qt.rgba(0, 0, 0) + cornerRadius: backgroundRect.radius +} +//! [3] +//! [4] +Rectangle { + id: backgroundRect + + color: Qt.rgba(1, 0, 0, 0.4) + width: 200 + height: 200 + radius: 8 +} + +BoxInsetShadow { + anchors.fill: backgroundRect + z: DTK.AboveOrder + shadowBlur: 2 + spread: 20 + shadowColor: Qt.rgba(0, 0, 0) + cornerRadius: backgroundRect.radius +} +//! [4] + +} \ No newline at end of file diff -Nru dtkdeclarative-5.6.3/dtkdeclarative.pro dtkdeclarative-5.6.10/dtkdeclarative.pro --- dtkdeclarative-5.6.3/dtkdeclarative.pro 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/dtkdeclarative.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += \ - chameleon \ - src \ - qmlplugin \ - tests \ - doc \ - -SUBDIRS += examples -examples.depends += chameleon src qmlplugin - -qmlplugin.depends += src -chameleon.depends += src diff -Nru dtkdeclarative-5.6.3/examples/CMakeLists.txt dtkdeclarative-5.6.10/examples/CMakeLists.txt --- dtkdeclarative-5.6.3/examples/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,7 @@ +set(CHAMELEON_PATH "${PROJECT_BINARY_DIR}/plugins") +add_definitions( + -DCHAMELEON_PATH="${CHAMELEON_PATH}" + -DQT_DEPRECATED_WARNINGS +) +add_subdirectory(exhibition) +add_subdirectory(qml-inspect) Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/examples/debug/built-in-icons/action_add.dci and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/examples/debug/built-in-icons/action_add.dci differ diff -Nru dtkdeclarative-5.6.3/examples/debug/dciicons.qrc dtkdeclarative-5.6.10/examples/debug/dciicons.qrc --- dtkdeclarative-5.6.3/examples/debug/dciicons.qrc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/dciicons.qrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ - - - icons/bloom/org.deepin.Example/action_add.dci - built-in-icons/action_add.dci - - diff -Nru dtkdeclarative-5.6.3/examples/debug/debug.pro dtkdeclarative-5.6.10/examples/debug/debug.pro --- dtkdeclarative-5.6.3/examples/debug/debug.pro 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/debug.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -QT += quick quickcontrols2 dtkgui quick-private -CONFIG += c++11 -CHAMELEON_PATH = $$_PRO_FILE_PWD_/../../chameleon/imports - -unix* { - LIBS += -L$$OUT_PWD/../../src -ldtkdeclarative -} - -INCLUDEPATH += $$PWD/../../src - -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Refer to the documentation for the -# deprecated API to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS -DEFINES += CHAMELEON_PATH=\\\"$$CHAMELEON_PATH\\\" - -# You can also make your code fail to compile if it uses deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -SOURCES += \ - main.cpp - -RESOURCES += qml.qrc \ - dciicons.qrc - -# Additional import path used to resolve QML modules in Qt Creator's code model -QML_IMPORT_PATH = - -# Additional import path used to resolve QML modules just for Qt Quick Designer -QML_DESIGNER_IMPORT_PATH = - -CONFIG(debug, debug|release) { - unix:QMAKE_RPATHDIR += $$OUT_PWD/../../src -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_1.qml dtkdeclarative-5.6.10/examples/debug/Example_1.qml --- dtkdeclarative-5.6.3/examples/debug/Example_1.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_1.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,505 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.11 -import org.deepin.dtk 1.0 - -Rectangle { - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: { - if (mouse.button === Qt.RightButton) - contextMenu.popup() - } - onPressAndHold: { - if (mouse.source === Qt.MouseEventNotSynthesized) - contextMenu.popup() - } - - Menu { - id: contextMenu - MenuItem { - text: "Cut" - icon.name: "edit-cut" - display: AbstractButton.TextBesideIcon - } - MenuItem { - text: "Copy" - icon.name: "edit-copy" - display: IconLabel.IconBesideText - } - MenuItem { - text: "Paste" - checkable: true - checked: true - } - MenuSeparator { } - Menu { - title: "Find/Replace" - Action { text: "Find Next" } - Action { text: "Find Previous" } - Action { text: "Replace" } - } - MenuItem { text: "Exit" } - } - } - - Label { - id: btnLabel - anchors.leftMargin: 20 - anchors.top: parent.top - anchors.topMargin: 20 - height: btn.height - text: qsTr("Button:") - verticalAlignment: Text.AlignVCenter - } - - Button { - id: btn - anchors.left: btnLabel.right - anchors.leftMargin: 20 - anchors.top: parent.top - anchors.topMargin: 20 - text: "Button" - } - - WarningButton { - id: warningBtn - anchors.top: parent.top // @disable-check M16 - anchors.topMargin: 20 // @disable-check M16 - anchors.left: btn.right // @disable-check M16 - anchors.leftMargin: 20 // @disable-check M16 - text: "Warning" // @disable-check M16 - onPressed: console.log("WarningButton pressed") // @disable-check M16 - } - - RecommandButton { - id: highlightedionBtn - anchors.left: warningBtn.right // @disable-check M16 - anchors.leftMargin: 20 // @disable-check M16 - anchors.top: parent.top // @disable-check M16 - anchors.topMargin: 20 // @disable-check M16 - text: "Recommand" // @disable-check M16 - } - - ToolButton { - id: toolButton - anchors.left: highlightedionBtn.right // @disable-check M16 - anchors.leftMargin: 20 // @disable-check M16 - anchors.top: parent.top // @disable-check M16 - anchors.topMargin: 20 // @disable-check M16 - } - - IconButton { - id: iconButton - width: 36 // @disable-check M16 - anchors.left: toolButton.right // @disable-check M16 - anchors.leftMargin: 20 // @disable-check M16 - anchors.top: parent.top // @disable-check M16 - anchors.topMargin: 20 // @disable-check M16 - icon.name: "org.deepin.Example/test/action_add" - } - - IconButton { - id: iconButton1 - width: 36 // @disable-check M16 - anchors.left: iconButton.right // @disable-check M16 - anchors.leftMargin: 20 // @disable-check M16 - anchors.top: parent.top // @disable-check M16 - anchors.topMargin: 20 // @disable-check M16 - icon.name: "test/action_add" // @disable-check M16 - } - - IconButton { - id: iconButton2 - width: 36 // @disable-check M16 - anchors.left: iconButton1.right // @disable-check M16 - anchors.leftMargin: 20 // @disable-check M16 - anchors.top: parent.top // @disable-check M16 - anchors.topMargin: 20 // @disable-check M16 - flat: true // @disable-check M16 - icon.name: "action_add" // @disable-check M16 - } - - FloatingButton { - id: floatingButton - width: 36 // @disable-check M16 - anchors.left: iconButton2.right // @disable-check M16 - anchors.leftMargin: 20 // @disable-check M16 - anchors.top: parent.top // @disable-check M16 - anchors.topMargin: 20 // @disable-check M16 - icon.name: "action_add" - } - - DelayButton { - id: dlyBtn - anchors.left: floatingButton.right - anchors.leftMargin: 20 - anchors.top: parent.top - anchors.topMargin: 20 - text: "DelayButton" - - NumberAnimation on progress { - from: 0 - to: 1.0 - duration: 4000 - loops: Animation.Infinite - } - } - - RoundButton { - id: roundButton; - anchors.top: parent.top - anchors.left: dlyBtn.right - anchors.leftMargin: 20 - anchors.topMargin: 20 - - icon.name: "action_add" - } - - ButtonBox { - id: buttonBox - anchors.left: roundButton.right // @disable-check M16 - anchors.leftMargin: 20 // @disable-check M16 - anchors.top: parent.top // @disable-check M16 - anchors.topMargin: 20 // @disable-check M16 - - ToolButton { - checkable: true; icon.name: "go-previous"; checked: true // @disable-check M16 - } - ToolButton { - checkable: true; icon.name: "go-down" // @disable-check M16 - } - ToolButton { - checkable: true; icon.name: "go-next" // @disable-check M16 - } - } - - LineEdit { - id: lineEdit - anchors.left: parent.left - anchors.top: btnLabel.bottom - anchors.topMargin: 20 - text: "Testing the alert message in line edit." - - alertText: qsTr("This is a long sentence.") - alertDuration: 2000 // millisecond - showAlert: focus - } - - SearchEdit { - id: searcherEdit - anchors.left: lineEdit.right - anchors.top: lineEdit.top - anchors.leftMargin: 20 - } - - SpinBox { - id: spinBox - anchors.left: searcherEdit.right - anchors.top: searcherEdit.top - anchors.leftMargin: 20 - editable: true - alertText: qsTr("This is a long sentence.") - alertDuration: 2000 // millisecond - showAlert: focus - } - - SpinBox { - id: customSpinBox - anchors.left: spinBox.right - anchors.top: spinBox.bottom - anchors.leftMargin: 20 - editable: true - value: 1 - - up.indicator: Rectangle { - border.color: "green" - anchors.right: customSpinBox.right - anchors.rightMargin: 5 - width: 20 - height: 15 - } - } - - PlusMinusSpinBox { - id: plusMinusSpinBox - anchors.left: spinBox.right - anchors.top: spinBox.top - anchors.leftMargin: 20 - spinBox.editable: true - spinBox.alertText: qsTr("Only numbers can be entered.") - spinBox.alertDuration: 2000 // millisecond - spinBox.showAlert: focus - } - - ListView { - model: 5 - implicitHeight: 250 - - delegate: CheckDelegate { - text: index; - - icon.name: "action_add" - } - - anchors.top: btnLabel.bottom - anchors.left: plusMinusSpinBox.right - anchors.topMargin: 20 - anchors.leftMargin: 20 - } - - Row { - id: sliderRow - anchors { - top: lineEdit.bottom - topMargin: 20 - } - - spacing: 10 - height: 350 - - Slider { - highlightedPassedGroove: true - orientation: Qt.Vertical - height: parent.height - handleType: Slider.HandleType.NoArrowVertical - } - - Slider { - height: parent.height - orientation: Qt.Vertical - handleType: Slider.HandleType.ArrowLeft - } - - Slider { - height: parent.height - highlightedPassedGroove: true - orientation: Qt.Vertical - handleType: Slider.HandleType.ArrowRight - } - } - - Column { - id: sliderColum - anchors { - top: lineEdit.bottom - topMargin: 40 - left: sliderRow.right - leftMargin: 60 - } - spacing: 10 - width: 400 - - Slider { - highlightedPassedGroove: true - width: parent.width - } - - Slider { - width: parent.width - handleType: Slider.HandleType.ArrowBottom - } - - Slider { - width: parent.width - highlightedPassedGroove: true - handleType: Slider.HandleType.ArrowUp - } - - TipsSlider { - width: parent.width - tickDirection: TipsSlider.TickDirection.Back - slider.highlightedPassedGroove: true - slider.handleType: Slider.HandleType.ArrowBottom - - ticks: [SliderTipItem { - }, - SliderTipItem { - }, - SliderTipItem { - }, - SliderTipItem { - }] - } - - TipsSlider { - id: sliderTickTip2 - readonly property var tips: [qsTr("Fast"), qsTr("Slow")] - width: parent.width - tickDirection: TipsSlider.TickDirection.Back - slider.handleType: Slider.HandleType.ArrowBottom - - ticks: [SliderTipItem { - text: sliderTickTip2.tips[0] - }, - SliderTipItem { - text: sliderTickTip2.tips[1] - }] - - // test highlight Text - HighlightPanel { - id: __highlight - readonly property real highlightMargin: 20 - anchors.bottom: parent.bottom - x: parent.slider.value * (parent.width - parent.slider.handle.width) - width / 2 - + parent.slider.handle.width / 2 - width: __text.implicitWidth - height: __text.implicitHeight - Text { - id: __text - text: sliderTickTip2.tips[0] - color: palette.highlightedText - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - } - } - } - - TipsSlider { - id: sliderTickTip3 - readonly property var tips: [qsTr("1m"), qsTr("5m"), qsTr("10m"), qsTr("15m"), qsTr("30m"), qsTr("1h"), qsTr("Never")] - width: parent.width - tickDirection: TipsSlider.TickDirection.Back - slider.handleType: Slider.HandleType.ArrowBottom - slider.stepSize: 10 - slider.from: 0 - slider.to: 60 - - ticks: [SliderTipItem { - text: sliderTickTip3.tips[0] - textHorizontalAlignment: Text.AlignLeft - }, - SliderTipItem { - text: sliderTickTip3.tips[1] - }, - SliderTipItem { - text: sliderTickTip3.tips[2] - }, - SliderTipItem { - text: sliderTickTip3.tips[3] - }, - SliderTipItem { - text: sliderTickTip3.tips[4] - }, - SliderTipItem { - text: sliderTickTip3.tips[5] - }, - SliderTipItem { - text: sliderTickTip3.tips[6] - textHorizontalAlignment: Text.AlignRight - }] - - // test end Indicator - Rectangle { - width: 30 - height: 30 - color: "blue" - anchors { - left: parent.right - leftMargin: 20 - verticalCenter: parent.slider.verticalCenter - } - - Text { - anchors.centerIn: parent - text: sliderTickTip3.slider.value.toFixed(1) - color: "white" - } - } - - // test start Indicator - Rectangle { - width: 30 - height: 30 - color: "red" - anchors { - right: parent.left - rightMargin: 20 - verticalCenter: parent.slider.verticalCenter - } - - Text { - anchors.centerIn: parent - text: "S" - color: "white" - } - } - } - } - - Row { - id: switchBtnRow - anchors { - top: sliderColum.bottom - left: sliderRow.right - topMargin: 30 - leftMargin: 40 - } - spacing: 10 - Switch { - checked: true - } - - Switch { - } - - Switch { - checked: true - enabled: false - } - - Switch { - enabled: false - } - } - - Row { - anchors { - top: sliderColum.bottom - left: switchBtnRow.right - topMargin: 30 - leftMargin: 20 - } - - spacing: 10 - - ComboBox { - id: nonEditComboBox - model: ["Banana", "Apple", "Coconut"] - } - - ComboBox { - id: editableComboBox - editable: true - model: ["Banana", "Apple", "Coconut"] - } - - ComboBox { - id: nonEditComboBoxWithIcon - textRole: "text" - iconNameRole: "icon" - - model: ListModel { - ListElement { text: "Banana"; icon: "go-previous" } - ListElement { text: "Apple"; icon: "go-down" } - ListElement { text: "Coconut"; icon: "go-next" } - } - } - - ComboBox { - id: editableComboBoxWithIcon - editable: true - textRole: "text" - iconNameRole: "icon" - - model: ListModel { - ListElement { text: "Banana"; icon: "go-previous" } - ListElement { text: "Apple"; icon: "go-down" } - ListElement { text: "Coconut"; icon: "go-next" } - } - } - } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_2.qml dtkdeclarative-5.6.10/examples/debug/Example_2.qml --- dtkdeclarative-5.6.3/examples/debug/Example_2.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_2.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,275 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import org.deepin.dtk 1.0 - -Rectangle { - - RowLayout { - id:row_layout_1 - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - - QtIcon { - name: "button_voice" - sourceSize: Qt.size(50, 50) - } - QtIcon { - name: "search_indicator" - color: "red" - - MouseArea { - anchors.fill: parent - onClicked: { - if (Qt.colorEqual(parent.color, "red")) { - parent.color = "blue" - } else { - parent.color = "red" - } - } - } - } - - BusyIndicator { - running: true - } - BusyIndicator { - running: true - } - - RoundButton { - id:roundbutton - width: 28 - height: 28 - } - - Dial {} - - Rectangle { - id: frame - clip: true - width: 160 - height: 160 - border.color: "black" - - Text { - id: content - text: "HELLO WORLD" - font.pixelSize: 160 - x: -hbar.position * width - y: -vbar.position * height - } - - ScrollBar { - id: vbar - hoverEnabled: true - active: hovered || pressed - orientation: Qt.Vertical - size: frame.height / content.height - anchors.top: parent.top - anchors.right: parent.right - anchors.bottom: parent.bottom - - ToolTip.visible: hovered - ToolTip.delay: 1000 - ToolTip.timeout: 5000 - ToolTip.text: "This is a ScrollBar!!!" - } - - ScrollBar { - id: hbar - hoverEnabled: true - active: hovered || pressed - orientation: Qt.Horizontal - size: frame.width / content.width - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - } - } - - - StackView { - id: stackview_1 - width: 150 - height: 150 - - Component { - id: page - Rectangle { - property real hue: Math.random() - color: Qt.hsla(hue, 0.5, 0.8, 0.6) - border.color: Qt.hsla(hue, 0.5, 0.5, 0.9) - StackView.visible: true - } - } - - initialItem: page - - MouseArea { - id:area - anchors.fill: parent - onClicked: { - stackview_1.push(page) - } - } - } - - } - - - RectangularShadow { - anchors.fill: shadowSource - glowRadius: 20 - spread: 0 - color: "black" - cornerRadius: shadowSource.radius - } - - Rectangle { - id: shadowSource - - width: 300 - height: 150 - anchors { - left: parent.left - leftMargin: 50 - bottom: parent.bottom - bottomMargin: 200 - } - radius: 30 - color: "red" - } - - // test like DropShadow - BoxShadow { - anchors.fill: boxShadowSource - - shadowBlur : 20 - shadowColor : Qt.rgba(0, 0, 0, 0.9) - shadowOffsetX : 0 - shadowOffsetY : 0 - cornerRadius: boxShadowSource.radius - hollow: true - } - - Rectangle { - id: boxShadowSource - - width: 200 - height: 200 - anchors { - left: shadowSource.right - leftMargin: 50 - bottom: shadowSource.bottom - } - color: "red" - radius: 20 - } - - // test like InnerShadow - BoxInsetShadow { - anchors.fill: boxShadowSource - - shadowBlur : 20 - shadowColor : Qt.rgba(0, 0, 0, 0.6) - shadowOffsetX : 0 - shadowOffsetY : 0 - cornerRadius: boxShadowSource.radius - } - - ListView { - spacing: 10 - anchors { - left: boxShadowSource.right - leftMargin: 50 - verticalCenter: boxShadowSource.verticalCenter - } - width: 200 - height: 280 - - model: ListModel { - ListElement { - cornor: 1 - } - ListElement { - cornor: 2 - } - ListElement { - cornor: 4 - } - ListElement { - cornor: 8 - } - ListElement { - cornor: 3 - } - ListElement { - cornor: 5 - } - ListElement { - cornor: 10 - } - ListElement { - cornor: 12 - } - } - delegate: RoundRectangle { - width: 200 - height: 60 - color: "blue" - radius: 20 - antialiasing: true - corners: cornor - } - } - - Rectangle { - id:swipe_view - - width: 300 - height: 150 - anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter - - SwipeView { - id: view - - currentIndex: 1 - anchors.fill: parent - - Rectangle { - color: "red" - width: swipe_view.width - height: swipe_view.height - } - - Rectangle { - color: "green" - width: swipe_view.width - height: swipe_view.height - } - - Rectangle { - color: "blue" - width: swipe_view.width - height: swipe_view.height - } - } - - PageIndicator { - id: indicator - - count: view.count - currentIndex: view.currentIndex - - anchors.bottom: view.bottom - anchors.horizontalCenter: parent.horizontalCenter - } - } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_3.qml dtkdeclarative-5.6.10/examples/debug/Example_3.qml --- dtkdeclarative-5.6.3/examples/debug/Example_3.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_3.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.0 -import org.deepin.dtk 1.0 - -Item { - Image { - id: back - anchors.fill: parent - source: "file:///usr/share/wallpapers/deepin/desktop.jpg" - } - - Rectangle { - id: source - y: 50 - x: 50 - width: 200 - height: 200 - radius: 30 - color: "red" - visible: false - } - - Item { - id: maskSource - anchors.fill: source - visible: false - Rectangle { - anchors.centerIn: parent - width: 100 - height: 100 - radius: 40 - color: "blue" - } - } - - OpacityMask { - anchors.fill: source - source: source - maskSource: maskSource - invert: true - } - - ListView { - id: testView - - property color foreground: "#55ffffff" - model: 1 - spacing: 30 - clip: true - anchors { - fill: parent - margins: 10 - } - - delegate: Item { - property ListView view: ListView.view - - height: 50 - width: 300 - anchors.horizontalCenter: parent.horizontalCenter - - InWindowBlur { - id: blur - anchors.fill: parent - radius: 20 - offscreen: true - } - - ItemViewport { - id: roundBlur - anchors.fill: blur - fixed: true - sourceItem: blur - radius: 20 - hideSource: false - } - - Rectangle { - radius: roundBlur.radius - anchors.fill: roundBlur - color: view.foreground - } - - Text { - anchors.centerIn: parent - text: "InWindowBlur" + index - color: "white" - font.pixelSize: 22 - } - } - } - - Button { - text: "深浅切换" - onClicked: { - if (testView.foreground == "#55000000") - testView.foreground = "#55ffffff" - else - testView.foreground = "#55000000" - } - } - -// StyledArrowShapeBlur { -// anchors.centerIn: parent -// width: 100 -// height: 200 -// roundJoinRadius: 20 -// } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_colorselector.qml dtkdeclarative-5.6.10/examples/debug/Example_colorselector.qml --- dtkdeclarative-5.6.3/examples/debug/Example_colorselector.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_colorselector.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,451 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.11 -import org.deepin.dtk 1.0 - -Rectangle { - Label { - id: changePaletteLabel - anchors.left: parent.left - anchors.top: parent.top - anchors.topMargin: 20 - text: "Change Palette By object property" - font.pointSize: 14 - font.bold: true - } - - Control { - id: control1 - anchors.left: parent.left - anchors.top: changePaletteLabel.bottom - anchors.topMargin: 20 - width: 500 - height: 50 - - property Palette backgroundColor: Palette { - normal: "black" - } - property Palette backgroundColorClicked: Palette { - normal: "blue" - } - - property Palette textColorClicked: Palette { - normal: "yellow" - } - - Rectangle { - property Palette borderColor: Palette { - normal: "red" - } - id: rect1 - anchors.left: parent.left - anchors.top: control1.top - width: 250 - height: 50 - color: ColorSelector.backgroundColor - border.width: 1 - border.color: ColorSelector.borderColor - - Text { - property Palette textColor: Palette { - normal: "white" - } - - id: rect1Text - anchors.fill: parent - text: "Use it's control parent's palette.\n(Click to change.)" - color: ColorSelector.textColor - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - - MouseArea { - anchors.fill: parent - - onClicked: { - control1.backgroundColor.normal = "red" - rect1Text.textColor.normal = "black" - } - } - } - } - - Rectangle { - id: rect2 - property Palette borderColor: Palette { - normal: "red" - } - property Palette backgroundColor: Palette { - normal: "black" - } - property Palette backgroundColorClicked: Palette { - normal: "magenta" - } - - anchors.left: rect1.right - anchors.leftMargin: 20 - anchors.top: control1.top - width: 250 - height: 50 - color: ColorSelector.backgroundColor - border.width: 1 - border.color: ColorSelector.borderColor - - Text { - id: rect2Text - property Palette textColor: Palette { - normal: "yellow" - } - - property Palette textColorClicked: Palette { - normal: "blue" - } - - anchors.fill: parent - text: "Overwrite it's control parent palette.\n(Click to change.)" - color: ColorSelector.textColor - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - - MouseArea { - anchors.fill: parent - Palette { - id: otherBackgroundColor - normal: "darkRed" - } - Palette { - id: othertextColor - normal: "darkBlue" - } - - onClicked: { - rect2.backgroundColor = otherBackgroundColor - rect2Text.textColor = othertextColor - } - } - } - } - } - - Label { - id: changeObjectLabel - anchors.left: parent.left - anchors.top: control1.bottom - anchors.topMargin: 20 - text: "Change Palette By color selector" - font.pointSize: 14 - font.bold: true - } - - Control { - id: control2 - anchors.left: parent.left - anchors.top: changeObjectLabel.bottom - anchors.topMargin: 20 - width: 500 - height: 50 - - property Palette backgroundColor: Palette { - normal: "black" - } - property Palette backgroundColorClicked: Palette { - normal: "blue" - } - - property Palette textColorClicked: Palette { - normal: "cyan" - } - - Rectangle { - property Palette borderColor: Palette { - normal: "red" - } - id: rect3 - anchors.left: parent.left - anchors.top: control2.top - width: 250 - height: 50 - color: ColorSelector.backgroundColor - border.width: 1 - border.color: ColorSelector.borderColor - - Text { - property Palette textColor: Palette { - normal: "white" - } - id: rect3Text - anchors.fill: parent - text: "Use it's color seletor to change palette.\n(Click to change, double click restore)" - color: ColorSelector.textColor - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - - MouseArea { - anchors.fill: parent - - onClicked: { - rect3.ColorSelector.backgroundColor = control2.backgroundColorClicked - rect3Text.ColorSelector.textColor = control2.textColorClicked - } - - onDoubleClicked: { - rect3.ColorSelector.backgroundColor = undefined - rect3Text.ColorSelector.textColor = undefined - } - } - } - } - - Rectangle { - id: rect4 - anchors.left: rect3.right - anchors.top: control2.top - anchors.leftMargin: 20 - width: 250 - height: 50 - color: ColorSelector.backgroundColor - property Palette backgroundColor: Palette { - normal: "black" - } - property Palette backgroundColorClicked: Palette { - normal: "magenta" - } - - Text { - id: rect4Text - property Palette textColor: Palette { - normal: "yellow" - } - - property Palette textColorClicked: Palette { - normal: "blue" - } - - anchors.fill: parent - text: "Use CS to replace it's own palette.\n(Click to change, double click restore)" - color: ColorSelector.textColor - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - - MouseArea { - anchors.fill: parent - - onClicked: { - rect4.ColorSelector.backgroundColor = rect4.backgroundColorClicked - rect4Text.ColorSelector.textColor = control2 .textColorClicked - } - - onDoubleClicked: { - rect4.ColorSelector.backgroundColor = undefined - rect4Text.ColorSelector.textColor = undefined - } - } - } - } - - Label { - id: changeParentLabel - anchors.left: parent.left - anchors.top: control2.bottom - anchors.topMargin: 20 - text: "Change palette when parent changed" - font.pointSize: 14 - font.bold: true - } - - Rectangle { - id: changeParentRect - anchors.left: parent.left - anchors.top: changeParentLabel.bottom - anchors.topMargin: 20 - width: 500 - height: 50 - - Control { - id: control3 - width: 220 - height: 50 - anchors.left: parent.left - anchors.top: parent.top - property Palette backgroundColor: Palette { - normal: "gray" - } - - Rectangle { - property Palette borderColor: Palette { - normal: "red" - } - id: reparentRect1 - width: 50 - height: 50 - color: ColorSelector.backgroundColor - border.width: 1 - border.color: ColorSelector.borderColor - - Text { - property Palette textColor: Palette { - normal: "blue" - } - anchors.fill: parent - text: "Rect1" - color: ColorSelector.textColor - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - - MouseArea { - anchors.fill: parent - onClicked: { - if (reparentRect1.parent == control3) - reparentRect1.state = "reparent2" - else - reparentRect1.state = "reparent1" - } - } - } - - states: [ - State { - name: "reparent1" - ParentChange { - target: reparentRect1 - parent: control3 - x: 0 - y: 0 - } - }, - State { - name: "reparent2" - ParentChange { - target: reparentRect1 - parent: control4 - x: 60 - y: 0 - } - } - ] - } - } - - Control { - id: control4 - width: 220 - height: 50 - anchors.left: control3.right - anchors.leftMargin: 10 - anchors.top: parent.top - - property Palette backgroundColor: Palette { - normal: "red" - } - - Rectangle { - property Palette borderColor: Palette { - normal: "gray" - } - id: reparentRect2 - width: 50 - height: 50 - color: ColorSelector.backgroundColor - border.width: 1 - border.color: ColorSelector.borderColor - - Text { - property Palette textColor: Palette { - normal: "yellow" - } - anchors.fill: parent - text: "Rect2" - color: ColorSelector.textColor - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - - MouseArea { - anchors.fill: parent - onClicked: { - if (reparentRect2.parent == control3) - reparentRect2.state = "reparent2" - else - reparentRect2.state = "reparent1" - } - } - } - - states: [ - State { - name: "reparent1" - ParentChange { - target: reparentRect2 - parent: control3 - x: 60 - y: 0 - } - }, - State { - name: "reparent2" - ParentChange { - target: reparentRect2 - parent: control4 - x: 0 - y: 0 - } - } - ] - } - } - } - - Label { - id: customControlLabel - anchors.left: parent.left - anchors.top: changeParentRect.bottom - anchors.topMargin: 20 - text: "Custom control which used the color selector" - font.pointSize: 14 - font.bold: true - } - - Row { - id: dontOverwriteControls - width: parent.width - height: 50 - anchors.left: parent.left - anchors.top: customControlLabel.bottom - anchors.topMargin: 20 - spacing: 5 - - Repeater { - model: 5 - Example_customcontrolforcs { - width: 50 - height: 50 - text: modelData - } - } - } - - Row { - id: overwriteControls - width: parent.width - height: 50 - anchors.left: parent.left - anchors.top: dontOverwriteControls.bottom - anchors.topMargin: 20 - spacing: 5 - - Repeater { - model: 5 - Example_customcontrolforcs { - backgroundColor: Palette { - normal: Qt.hsla(Math.random(), 0.6, 0.6, 0.9) - hovered: Qt.hsla(Math.random(), 0.2, 0.2, 0.9) - } - - width: 50 - height: 50 - text: modelData - } - } - } - } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_config.qml dtkdeclarative-5.6.10/examples/debug/Example_config.qml --- dtkdeclarative-5.6.3/examples/debug/Example_config.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_config.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.0 -import org.deepin.dtk 1.0 - -Item { - - Config { - id: exampleConfig - name: "example" - subpath: "" - property int key2 : 1 - property string key3 : "key3 default" - onKey3Changed: { - key3Text.text = exampleConfig.key3 - console.info("Config key3Changed"); - } - } - Column { - id: config - spacing: 10 - Button{ - text: "generic function" - onClicked: { - console.info("configBtn pressed") - console.info(exampleConfig.isValid()) - console.info(exampleConfig.value("key3", "ddd")) - console.info(exampleConfig.value("key3")) - console.info(exampleConfig.keyList()) - console.info(exampleConfig.name) - console.info(exampleConfig.subpath) - - exampleConfig.setValue("key3", (new Date).getTime().toString()) - console.info(exampleConfig.value("key3", "ddd")) - } - } - - Row { - spacing: 10 - - Button{ - text: "write" - onClicked: { - exampleConfig.key3 = (new Date).getTime().toString() - } - } - - Label { - text: "property binding key3:" + exampleConfig.key3 - } - - Label { - text: "js binding key3:" - } - Label { - text: "exampleConfig.key3" - Component.onCompleted: { - text = Qt.binding(function(){return exampleConfig.key3}) - } - } - } - - Row { - spacing: 10 - - Button{ - text: "read" - onClicked: { - console.info("key3", exampleConfig.key3) - readKey3Text.text = exampleConfig.key3 - } - } - Label { - text: "key3:" - } - Label { - id: readKey3Text - } - - } - - Row { - spacing: 10 - - Label { - text: "Connections valueChanged:" - } - Label { - text: "key3:" - } - Label { - id: key3Text - text: "key3:" - } - Connections{ - target: exampleConfig - onKey3Changed: { - key3Text.text = exampleConfig.key3 - console.info("Connections key3Changed"); - } - } - } - - } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_customcontrolforcs.qml dtkdeclarative-5.6.10/examples/debug/Example_customcontrolforcs.qml --- dtkdeclarative-5.6.3/examples/debug/Example_customcontrolforcs.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_customcontrolforcs.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.0 -import org.deepin.dtk 1.0 - -Control { - id: control - hoverEnabled: true - property Palette backgroundColor: Palette { - normal: Qt.hsla(Math.random(), 0.2, 0.5, 0.9) - hovered: Qt.hsla(Math.random(), 0.1, 0.1, 0.9) - } - property Palette textColor: Palette { - normal: Qt.hsla(Math.random(), 0.5, 0.2, 0.4) - hovered: Qt.hsla(Math.random(), 0.6, 0.6, 0.9) - } - - property string text - - background: Rectangle { - color: control.ColorSelector.backgroundColor - Behavior on color { - ColorAnimation { - duration: 300 - } - } - } - - contentItem: Text { - id: textItem - anchors.fill: parent - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - text: control.text - color: control.ColorSelector.textColor - - Behavior on color { - ColorAnimation { - duration: 300 - } - } - } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_Flickable.qml dtkdeclarative-5.6.10/examples/debug/Example_Flickable.qml --- dtkdeclarative-5.6.3/examples/debug/Example_Flickable.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_Flickable.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,218 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.0 -import QtQuick.Layouts 1.11 -import org.deepin.dtk 1.0 - -Flow { - id: control - Row { - spacing: 20 - ScrollView { - id: scrollView - width: 200 - height: 400 - clip: true - ListView { - model: 20 - delegate: Button { - text: "index" + String(modelData) - } - } - background: Rectangle { - border.color: "green" - } - } - - Column { - Row { - spacing: 20 - ProgressBar { - from: 0 - to: 100 - formatText: ("已下载" + (value / to * 100).toFixed() + "%(点击暂停)") - NumberAnimation on value { - from: 0 - to: 100 - duration: 1000 - loops: Animation.Infinite - } - } - - ProgressBar { - from: 0 - to: 100 - height: 8 - - NumberAnimation on value { - from: 0 - to: 100 - duration: 1000 - loops: Animation.Infinite - } - } - - EmbeddedProgressBar { - from: 0 - to: 100 - NumberAnimation on value { - from: 0 - to: 100 - duration: 1000 - loops: Animation.Infinite - } - } - - WaterProgressBar { - NumberAnimation on value { - loops: Animation.Infinite - from: 0 - to: 100 - duration: 10000 - } - } - } - - Row { - spacing: 20 - ProgressBar { - from: 0 - to: 100 - height: 18 - indeterminate: true - } - - ProgressBar { - from: 0 - to: 100 - indeterminate: true - formatText: "正在准备(点击终止)" - - MouseArea { - anchors.fill: parent - onClicked: { - parent.animationStop = !parent.animationStop - } - } - } - } - - Column { - spacing: 10 - IpV4LineEdit { - - } - IpV4LineEdit { - width: 300 - height: 40 - showAlert: focus - alertText: "alert tips" - } - IpV4LineEdit { - width: 300 - height: 40 - text: "10.20.52.57" - } - - Row { - spacing: 10 - IpV4LineEdit { - id: idLineEditSetValueByText - width: 300 - height: 40 - } - - Button { - text: "set IP by Text" - onClicked: idLineEditSetValueByText.text = "10.20.52.57" - } - Text { - text: idLineEditSetValueByText.text - } - } - } - } - } - - Column { - width: 340 - height: 280 - - RowLayout { - TextField { - id: nameFilter - placeholderText: qsTr("Search by name...") - Layout.fillWidth: true - onTextChanged: sortFilterModel.update() - } - - Column { - RadioButton { - id: sortByName - checked: true - text: qsTr("Sort by name") - onCheckedChanged: sortFilterModel.update() - } - RadioButton { - text: qsTr("Sort by team") - onCheckedChanged: sortFilterModel.update() - } - } - } - - SortFilterModel { - id: sortFilterModel - model: ListModel { - ListElement { name: "Alice"; team: "Crypto" } - ListElement { name: "Bob"; team: "Crypto" } - ListElement { name: "Jane"; team: "QA" } - ListElement { name: "Victor"; team: "QA" } - ListElement { name: "Wendy"; team: "Graphics" } - } - delegate: Text { - text: name + " (" + team + ")" - } - filterAcceptsItem: function(item) { - return item.name.includes(nameFilter.text) - } - lessThan: function(left, right) { - var leftVal = sortByName.checked ? left.name : left.team; - var rightVal = sortByName.checked ? right.name : right.team; - return leftVal < rightVal ? -1 : 1; - } - } - - ListView { - height: 100 - width: parent.width - model: sortFilterModel - } - } - - Column { - KeySequenceEdit { - width: 504 - height: 36 - text: "切换键盘布局" - placeholderText: "请重新输入快捷键" - keys: ["CTRL", "SHIFT"] - } - - KeySequenceEdit { - width: 504 - height: 36 - text: "关闭窗口" - placeholderText: "请重新输入快捷键" - keys: ["ALT", "F4"] - } - - KeySequenceEdit { - width: 504 - height: 36 - text: "关闭窗口" - placeholderText: "请重新输入快捷键" - } - } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_Menu.qml dtkdeclarative-5.6.10/examples/debug/Example_Menu.qml --- dtkdeclarative-5.6.3/examples/debug/Example_Menu.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_Menu.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.0 -import QtQuick.Layouts 1.11 -import org.deepin.dtk 1.0 - -Column { - id: control - - Row{ - Button { - text: "Normal" - onClicked: normalMenu.popup(control, Qt.point(x, height)) - } - Button { - text: "Action checkd" - onClicked: { - var action = normalMenu.actionAt(4) - action.checked = !action.checked - } - } - Button { - text: "MenuItem checkd" - onClicked: { - var item = normalMenu.itemAt(1) - item.checked = !item.checked - } - } - Button { - text: "MenuItem Add" - onClicked: { - normalMenu.addItem(menuItem.createObject(normalMenu)) - } - - Component { - id: menuItem - MenuItem { - text: "Long long text menu" - } - } - } - } - Row { - SearchEdit { - id: filterSearchEdit - placeholder: qsTr("搜索") - onTextChanged: { - objectModelFilter.update() - } - } - Button { - text: "open menu" - onClicked: searchAndArrowMenu.popup() - } - } - - Menu { - id: normalMenu -// width: 300 - header: SearchEdit { - placeholder: qsTr("搜索") - } - maxVisibleItems: 4 - MenuItem { - icon.name: "music" - text: "icon" - onTriggered: console.log("trigger", text) - } - MenuItem { - icon.name: "music" - text: "Checked" - checked: true - } - - MenuSeparator { text: "文本" } - - MenuItem { - icon.name: "music" - text: "icon right" - display: IconLabel.IconBesideText - } - Action { text: "Action" ; /*checkable: true;*/ /*checked: true*/} - - MenuSeparator { } - - Menu { - title: "ShortText menu" - Action { text: "Find Next" /*; checked: true*/} - Action { text: "Find Previous" } - Action { text: "Replace" } - Menu { - title: "three" - Action { text: "Find Next" } - Action { text: "Find Previous" } - Action { text: "Replace" } - } - } - Menu { - title: "LongText menu" - Action { text: "Find Next" } - Action { text: "Find Previous" } - Action { text: "Replace" } - } - } - - Menu { - id: searchAndArrowMenu - closePolicy: Popup.NoAutoClose - model: ObjectModelProxy { - id: objectModelFilter - filterAcceptsItem: function(item) { - return item.text.includes(filterSearchEdit.text) - } - sourceModel: searchAndArrowMenu.contentModel - } - MenuItem { text: qsTr("Greek(cp869)") } - MenuItem { text: qsTr("Cyrillic (ISO 8859-5)") } - MenuItem { text: qsTr("Cyrillic(KOI8-R)") } - MenuItem { text: qsTr("Devanagari(x-mac-davanagari)") } - MenuItem { text: qsTr("Gurmukhi(x-mac-gurmukhi)") } - MenuItem { text: qsTr("Thai (ISO 8859-11)") } - } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_Notify.qml dtkdeclarative-5.6.10/examples/debug/Example_Notify.qml --- dtkdeclarative-5.6.3/examples/debug/Example_Notify.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_Notify.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.0 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import org.deepin.dtk 1.0 - -Column { - id: control - - property string longMessage: "Copyright 2014-2019 Adobe (http://www.adobe.com/), with Reserved FontName 'Source'. Source is a trademark of Adobe in the United States and/or other countries." - property string shortMessage: "short message" - - Button { - text: "FloatingMessage" - property int count: 0 - onClicked: { - if (count % 2) { - DTK.sendMessage(control, "message" + count) - DTK.sendMessage(Window.window, "message" + count, "music", 4000, "type1") - DTK.sendMessage(Window.window, "message" + count, "video", -1) - } else { - DTK.sendMessage(control, floatingMsgCom, {content: shortMessage}, -1) - DTK.sendMessage(Window.window, floatingMsgCom, {content: longMessage, iconName: "music"}, -1) - } - count++ - } - } - - Component { - id: floatingMsgCom - FloatingMessage { - id: floatMsg - contentItem: RowLayout { - spacing: 0 - - Label { - Layout.fillHeight: true - Layout.fillWidth: true - text: floatMsg.message.content - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignLeft - Layout.alignment: Qt.AlignVCenter - font: DTK.fontManager.t6 - wrapMode: Text.Wrap - elide: Text.ElideRight - maximumLineCount: 1 - } - - Button { - text: "reload" - font: DTK.fontManager.t5 - Layout.alignment: Qt.AlignVCenter - } - } -// button: Button { -// text: "close" -// onClicked: { -// console.log("close clicked") -// DTK.closeMessage(floatMsg) -// } -// } - } - } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_Popup.qml dtkdeclarative-5.6.10/examples/debug/Example_Popup.qml --- dtkdeclarative-5.6.3/examples/debug/Example_Popup.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_Popup.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.0 -import QtQuick.Layouts 1.11 -import QtQuick.Window 2.11 -import QtQuick.Shapes 1.10 -import org.deepin.dtk 1.0 - -Column { - id: control - - Row { - Button { - text: "popup window" - onClicked: { - // popup.x = (Screen.desktopAvailableWidth - Window.window.width) / 2 - // popup.y = (Screen.desktopAvailableHeight - Window.window.height) / 2 - - // popupWindow.width = 400 - popupWindow.open() - // popupWindow.PopupWindow.window.hide() - // Window.window.hide() - // popup.PopupWindow.window.show() - // popupWindow.PopupWindow.close() - } - // Component.onCompleted: popupWindow.open() - } - Button { - text: "change x" - onClicked: { - popupWindow.x = 500 - popupWindow.open() - } - } - Button { - text: "change width" - onClicked: { - popupWindow.width = 400 - popupWindow.open() - } - } - - Button { - text: "popup control" - onClicked: { - // popupWindow.x = (Screen.desktopAvailableWidth - Window.window.width) / 2 - // popupWindow.y = (Screen.desktopAvailableHeight - Window.window.height) / 2 - - popup.open() - } - } - } - - Row { - Button { - text: "menu control" - onClicked: { - menu.open() - } - } - - Button { - text: "menu popupWindow" - onClicked: { - menuPopup.open() - } - } - } - Button { - text: "handle forceWindowMode" - onClicked: { - popupWindow.PopupHandle.forceWindowMode = !popupWindow.PopupHandle.forceWindowMode - } - } - - Popup { - id: popupWindow; objectName: "pupup window" - visible: false - x: 100 - y: 20 -// width: 200 -// height: 100 -// width: 300 -// height: 300 -// margins: 100 - PopupHandle.forceWindowMode: true - PopupHandle.delegate: PopupWindow { - blurControl: popupWindow - } - contentItem: Column { - spacing: 10 - Text { - text: "蓝牙" - anchors.horizontalCenter: parent.horizontalCenter - } - Button { - text: "打印机" - anchors.horizontalCenter: parent.horizontalCenter - } - } - } - Popup { - id: popup; objectName: "pupup" - x: 100 - y: 20 -// margins: 100 - contentItem: Column { - spacing: 10 - Text { - text: "蓝牙" - anchors.horizontalCenter: parent.horizontalCenter - } - Button { - text: "打印机" - anchors.horizontalCenter: parent.horizontalCenter - } - } - } - Menu { - id: menu - MenuItem { text: "Text" } - } - Menu { - id: menuPopup - MenuItem { text: "Text" } - - PopupHandle.forceWindowMode: true - } - ArrowShapePopup { - id: arrow - x: 50 - y: 50 - width: 100 - height: 100 - } - - Row { - Button { - text: "Up" - onClicked: { - arrow.arrowDirection = ArrowBoxPath.Up - arrow.arrowX = arrow.width / 2 + 10 - arrow.arrowY = 10 - arrow.open() - } - } - Button { - text: "Down" - onClicked: { - arrow.arrowDirection = ArrowBoxPath.Down - arrow.arrowX = arrow.width / 2 + 10 - arrow.arrowY = arrow.height - 10 - arrow.open() - } - } - Button { - text: "Left" - onClicked: { - arrow.arrowDirection = ArrowBoxPath.Left - arrow.arrowX = 10 - arrow.arrowY = arrow.height / 2 + 10 - arrow.open() - } - } - Button { - text: "Right" - onClicked: { - arrow.arrowDirection = ArrowBoxPath.Right - arrow.arrowX = arrow.width - 10 - arrow.arrowY = arrow.height / 2 + 10 - arrow.open() - } - } - } -// Shape { -// x: 20 -// y: 20 -// ShapePath { -// fillColor: "red" -// strokeColor: "transparent" -// ArrowBoxPath { -// id: arrow -// width: 60 -// height: 150 -// arrowX: 0 -// arrowY: 0 -// arrowWidth: 50 -// arrowHeight: 30 -// roundedRadius: 8 -// spread: -5 -// } -// } -// } - -// Shape { -// x: 20 -// y: 20 -//// visible: false -// ShapePath { -// fillColor: "green" -// strokeColor: "transparent" -// ArrowBoxPath { -// width: arrow.width -// height: arrow.height -// arrowDirection: arrow.arrowDirection -// arrowX: arrow.arrowX -// arrowY: arrow.arrowY -// arrowWidth: arrow.arrowWidth -// arrowHeight: arrow.arrowHeight -// roundedRadius: arrow.roundedRadius -//// spread: 15 -// } -// } -// } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_settingsdialog.qml dtkdeclarative-5.6.10/examples/debug/Example_settingsdialog.qml --- dtkdeclarative-5.6.3/examples/debug/Example_settingsdialog.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_settingsdialog.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,200 +0,0 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.0 -import org.deepin.dtk 1.0 -import org.deepin.dtk.settings 1.0 as Settings - -Rectangle { - border.color: "blue" - - property list __groups: [ - Settings.SettingsGroup { - key: "group1" - name: "group1" - Settings.SettingsOption { - key: "option1" - name: "option1" - Label { - text: Settings.SettingsOption.name - } - } - } - ] - - Settings.SettingsDialog { - id: settingsDialog - height: 400 - width: 680 - visible: false - config: settingsConfig - - // container.groups: [ - // Settings.SettingsGroup { - // key: "group1" - // name: "group1" - // visible: true - // Settings.SettingsOption { - // key: "option1" - // name: "option1" - // Label { - // text: Settings.SettingsOption.name - // } - // } - // } - // ] - - // container: Settings.SettingsContainer { - // id: settingsContainer - // config: settingsConfig - // navigationTitle: NavigationTitle {} - // contentTitle: ContentTitle {} - // Settings.ContentBackground: Settings.ContentBackground {} - // groups: __groups - // } - container.contentBackground: Settings.ContentBackground { - border.color: "blue" - } - - groups: [ - Settings.SettingsGroup { - key: "group1" - name: "group1" - visible: true - background: Settings.ContentBackground { - border.color: "green" - radius: 8 - } - - children: [ - Settings.SettingsGroup { - key: "group1" - name: "group1" - visible: true - background: Settings.ContentBackground { - border.color: "red" - radius: 8 - } - Settings.SettingsOption { - key: "key2" - name: "ComboBox" - Settings.ComboBox { - model: ["first", "sceond", "three"] - } - } - Settings.SettingsOption { - key: "key3" - name: "LineEdit" - Settings.LineEdit {} - } - Settings.SettingsOption { - key: "canExit" - name: "CheckBox" - Settings.CheckBox {} - } - }, - Settings.SettingsGroup { - key: "group2" - name: "group2" - children: [ - Settings.SettingsGroup { - key: "group3" - name: "group1.group2.group3" - visible: true - - Settings.SettingsOption { - key: "option1" - name: "group2.group1.option1" - Settings.OptionDelegate { - LineEdit { - text: Settings.SettingsOption.name - onEditingFinished: { - Settings.SettingsOption.value = text - } - } - } - } - } - ] - } - ] - }, - Settings.SettingsGroup { - key: "group2" - name: "group2" - children: [ - Settings.SettingsGroup { - key: "group1" - name: "group1" - visible: true - Settings.SettingsOption { - key: "option1" - name: "option1" - Label { - text: Settings.SettingsOption.name - } - } - Settings.SettingsOption { - key: "option2" - name: "option2" - LineEdit { - text: Settings.SettingsOption.name - } - } - Settings.SettingsOption { - key: "option1" - name: "option1" - ComboBox { - model: ["first", "sceond", "three"] - } - } - } - ] - }, - Settings.SettingsGroup { - key: "group3" - name: "group3" - }, - Settings.SettingsGroup { - key: "group4" - name: "group4" - } - ] - } - - Column { - width: parent.width - anchors.leftMargin: 20 - anchors.top: parent.top - anchors.topMargin: 20 - Button { - text: "showSettingsDialog" - onClicked: { - settingsDialog.show() - } - } - - Row { - ComboBox { - id: groups - model: ["group1", "group1.group1", "group2.group1"] - } - Button { - property string groupKey: groups.currentText - text: groupKey - onClicked: { - settingsDialog.container.setGroupVisible(groupKey, !settingsDialog.container.groupVisible(groupKey)) - } - } - } - } - - // Config should be loaded first - Config { - id: settingsConfig - name: "example" - subpath: "" - property string key3 : "key3 default" - } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/Example_TitleBar.qml dtkdeclarative-5.6.10/examples/debug/Example_TitleBar.qml --- dtkdeclarative-5.6.3/examples/debug/Example_TitleBar.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/Example_TitleBar.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.0 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import org.deepin.dtk 1.0 - -TitleBar { - id: titleBar - icon.name: "music" - title: "title custom" - - property string appProductName: Qt.application.displayName - property string appLicense - -// menu: Menu { -// delegate: MenuItem { -// icon.name: "emblem-checked" -// icon.color: palette.highlight -// } -// ThemeMenu {} - -// MenuSeparator { -// contentItem: Rectangle { -// implicitHeight: 1 -// color: "black" -// } -// } -// HelpAction {} -// AboutAction {} -// QuitAction {} - -// Action { -// text: qsTr("custom action") -// } -// MenuItem { -// text: qsTr("Window State") -// onTriggered: toggleWindowState() -// } -// } - aboutDialog: AboutDialog { - modality: Qt.NonModal - version: qsTr(String("Version: %1").arg(Qt.application.version)) - productName: qsTr(appProductName) - companyLogo: "file://" + DTK.deepinDistributionOrgLogo - websiteName: DTK.deepinWebsiteName - websiteLink: DTK.deepinWebsiteLink - license: appLicense === "" ? "" : qsTr(String("%1 is released under %2").arg(appProductName).arg(appLicense)) - } - - embedMode: false -// separatorVisible: false - autoHideOnFullscreen: true -// menuDisabled: true - -// content: RowLayout { -// LineEdit { -// text: "label2" -// } -// LineEdit { -// text: "center" -// Layout.alignment: Qt.AlignCenter -// } -// Button { -// text: "center custom" -// Layout.alignment: Qt.AlignRight -// } -// } - - focus: true - Keys.onSpacePressed: Window.window.visibility = Window.FullScreen -} Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/examples/debug/icons/bloom/org.deepin.Example/action_add.dci and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/examples/debug/icons/bloom/org.deepin.Example/action_add.dci differ diff -Nru dtkdeclarative-5.6.3/examples/debug/main.cpp dtkdeclarative-5.6.10/examples/debug/main.cpp --- dtkdeclarative-5.6.3/examples/debug/main.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/main.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -#include -#include -#include -#include - -int main(int argc, char *argv[]) -{ - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - - QGuiApplication app(argc, argv); - app.setOrganizationName("deepin"); - app.setApplicationName("Example"); - - QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon"); - QQmlApplicationEngine engine; -// qputenv("D_POPUP_MODE", "embed"); - -// QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software); - engine.addImportPath(CHAMELEON_PATH); - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - if (engine.rootObjects().isEmpty()) - return -1; - - return app.exec(); -} diff -Nru dtkdeclarative-5.6.3/examples/debug/main.qml dtkdeclarative-5.6.10/examples/debug/main.qml --- dtkdeclarative-5.6.3/examples/debug/main.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/main.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,188 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Controls 2.4 as V2 -import QtQuick.Layouts 1.11 -import org.deepin.dtk 1.0 as D - -D.ApplicationWindow { - id: root - visible: true - width: 1200 - height: 700 - title: qsTr("dtkdeclarative") - x:(Screen.desktopAvailableWidth - width) / 2 - y:(Screen.desktopAvailableHeight - height) / 2 -// D.DWindow.wmWindowTypes: D.WindowManagerHelper.DesktopType - header: Example_TitleBar{} - flags: Qt.Window | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint -// D.DWindow.motifFunctions: D.DWindow.motifFunctions & ~D.WindowManagerHelper.FUNC_MINIMIZE - - // 测试D.DWindow的属性 - D.DWindow.enabled: true - D.DWindow.windowRadius: 16 - D.DWindow.borderColor: palette.highlight - D.DWindow.borderWidth: 1 - D.DWindow.alphaBufferSize: 8 - - D.FontManager { - id: font_manager - baseFont: font_manager.get(13, Qt.application.font) - onFontChanged: { - console.log("font_manager fontChanged .........."); - } - } - -// D.MessageManager.layout: Column { -// anchors { -// bottom: parent.bottom -// right: parent.right -// } -// } -// D.MessageManager.capacity: 6 -// D.MessageManager.delegate: D.FloatingMessage { -// id: floatingMsg -// iconName: "error" -// type: D.FloatingMessage.TransientType -// contentItem: V2.Label { -// verticalAlignment: Text.AlignVCenter -// horizontalAlignment: Text.AlignLeft -// text: floatingMsg.content -// elide: Text.ElideRight -// maximumLineCount: 1 -// wrapMode: Text.Wrap -// } - -// duration: 3000 -// } - - Component.onCompleted: { - console.log(D.DWindow.wmWindowTypes) - console.log(D.DWindow.enabled ? "DPlatformHandle有效" : "DPlatformHandle无效!!!!"); - console.log("hasBlurWindow : ", D.DTK.hasBlurWindow ? "true" : "false"); - console.log("windowManagerNameString : ", D.DTK.windowManagerNameString); - - // 测试系统亮暗色(枚举类型) - if (D.DTK.themeType === D.ApplicationHelper.LightType) { - console.log("themeType : Light Theme"); - } else if (D.DTK.themeType === D.ApplicationHelper.DarkType) { - console.log("themeType : Dark Theme"); - } else { - console.log("themeType : Unknown Theme"); - } - D.DTK.themeTypeChanged.connect(function() { - console.log("themeNameChanged : ", D.DTK.themeType); - }); - - if (D.DTK.windowManagerName === D.WindowManagerHelper.DeepinWM) { - console.log("windowManagerName : DeepinWM"); - } else if (D.DTK.windowManagerName === D.WindowManagerHelper.KWinWM) { - console.log("windowManagerName : KWinWM"); - } else { - console.log("windowManagerName : OtherWM"); - } - - console.log("test platformTheme info : " , D.DTK.platformTheme.window, D.DTK.platformTheme.themeName); - - //测试DPlatformThemeProxy信号传递(控制中心切换主题测试) - D.DTK.platformTheme.themeNameChanged.connect(function(themeName) { - console.log("platformTheme themeNameChanged : ", themeName); - }); - - //在控制中心修改字体大小可以看到打印输出 - D.DTK.fontManager.fontChanged.connect(function() { - console.log("base font changed ....", D.DTK.fontManager.baseFont); - }); - console.log("fontManager t1 字体信息", D.DTK.fontManager.t1); - - // 测试 D.Palette 值 - console.log("D.Palette window value: ", root.palette.window) - console.log("D.Palette windowText value: ", root.palette.windowText) - console.log("D.Palette base value: ", root.palette.base) - console.log("D.Palette itemBackground value: ", root.palette.itemBackground) - console.log("D.Palette textTitle value: ", root.palette.textTitle) - console.log("D.Palette textTips value: ", root.palette.textTips) - } - - V2.TabBar { - id: tabBar - anchors.top: root.bottom - V2.TabButton { - text: qsTr("Example_1") - } - V2.TabButton { - text: qsTr("Example_2") - } - V2.TabButton { - text: qsTr("ItemViewport") - } - V2.TabButton { - text: qsTr("Config") - } - V2.TabButton { - text: qsTr("SettingsDialog") - } - V2.TabButton { - text: qsTr("Notify") - } - V2.TabButton { - text: qsTr("ColorSelector") - } - V2.TabButton { - text: qsTr("Menu") - } - V2.TabButton { - text: qsTr("Popup") - } - V2.TabButton { - text: qsTr("Flickable") - } - } - StackLayout { - anchors.left: parent.left - anchors.right: parent.right - anchors.top: tabBar.bottom - anchors.bottom: parent.bottom - anchors.margins: 4 - - currentIndex: tabBar.currentIndex - Example_1 {} - Example_2 {} - Example_3 {} - Example_config {} - Example_settingsdialog {} - Example_Notify {} - Example_colorselector {} - Example_Menu {} - Example_Popup {} - Example_Flickable {} - } - - D.BehindWindowBlur { - anchors { - fill: parent - topMargin: parent.height - 100 - } - blendColor: Qt.rgba(1, 0, 0, 0.3) - } - - D.StyledBehindWindowBlur { - control: root - anchors { - right: parent.right - rightMargin: 100 - bottom: parent.bottom - bottomMargin: 160 - } - width: 200 - height: 200 - cornerRadius: 30 - V2.Label { - anchors.centerIn: parent - text: qsTr("WMBlur") - } - } -} diff -Nru dtkdeclarative-5.6.3/examples/debug/qml.qrc dtkdeclarative-5.6.10/examples/debug/qml.qrc --- dtkdeclarative-5.6.3/examples/debug/qml.qrc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/debug/qml.qrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ - - - main.qml - Example_1.qml - Example_2.qml - Example_3.qml - Example_config.qml - Example_TitleBar.qml - Example_settingsdialog.qml - Example_Notify.qml - Example_colorselector.qml - Example_customcontrolforcs.qml - Example_Menu.qml - Example_Popup.qml - Example_Flickable.qml - - diff -Nru dtkdeclarative-5.6.3/examples/examples.pro dtkdeclarative-5.6.10/examples/examples.pro --- dtkdeclarative-5.6.3/examples/examples.pro 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/examples.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += exhibition - -CONFIG(debug, debug|release) { - SUBDIRS += debug -} diff -Nru dtkdeclarative-5.6.3/examples/exhibition/CMakeLists.txt dtkdeclarative-5.6.10/examples/exhibition/CMakeLists.txt --- dtkdeclarative-5.6.3/examples/exhibition/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/exhibition/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,25 @@ +set(BIN_NAME dtk-exhibition) + +find_package(Qt5 REQUIRED COMPONENTS Quick QuickControls2) +find_package(Dtk REQUIRED COMPONENTS Core Gui) + +set(CMAKE_EXE_LINKER_FLAGS "-z relro -z now -z noexecstack -pie -Wl,--as-needed") + +add_executable(${BIN_NAME} + ${CMAKE_CURRENT_LIST_DIR}/main.cpp + ${CMAKE_CURRENT_LIST_DIR}/assets.qrc + ${CMAKE_CURRENT_LIST_DIR}/qml.qrc +) + +target_compile_options(${BIN_NAME} PRIVATE "-fpic") + +target_link_libraries(${BIN_NAME} PRIVATE + Qt5::Quick + Qt5::QuickControls2 + Dtk::Core + Dtk::Gui + ${LIB_NAME} +) + +install(TARGETS ${BIN_NAME} DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(FILES ${CMAKE_CURRENT_LIST_DIR}/dtk-exhibition.desktop DESTINATION "${CMAKE_INSTALL_DATADIR}/applications") diff -Nru dtkdeclarative-5.6.3/examples/exhibition/dtk-exhibition.desktop dtkdeclarative-5.6.10/examples/exhibition/dtk-exhibition.desktop --- dtkdeclarative-5.6.3/examples/exhibition/dtk-exhibition.desktop 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/exhibition/dtk-exhibition.desktop 2023-04-17 09:55:26.000000000 +0000 @@ -2,4 +2,5 @@ Name=DTK Exhibition Exec=dtk-exhibition Type=Application +Icon=example Categories=DTK;Development; diff -Nru dtkdeclarative-5.6.3/examples/exhibition/exhibition.pro dtkdeclarative-5.6.10/examples/exhibition/exhibition.pro --- dtkdeclarative-5.6.3/examples/exhibition/exhibition.pro 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/exhibition/exhibition.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -TARGET = dtk-exhibition -QT += quick quickcontrols2 dtkgui -CONFIG += c++11 -CHAMELEON_PATH = $$_PRO_FILE_PWD_/../../chameleon/imports - -unix* { - LIBS += -L$$OUT_PWD/../../src -ldtkdeclarative -} - -INCLUDEPATH += $$PWD/../../src/ - -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Refer to the documentation for the -# deprecated API to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS -DEFINES += CHAMELEON_PATH=\\\"$$CHAMELEON_PATH\\\" - -# You can also make your code fail to compile if it uses deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -CONFIG(debug, debug|release) { - unix:QMAKE_RPATHDIR += $$OUT_PWD/../../src/ -} - -SOURCES += \ - main.cpp - -RESOURCES += \ - qml.qrc \ - assets.qrc - -target.path = /usr/bin -desktop.files += $$PWD/dtk-exhibition.desktop -desktop.path = /usr/share/applications - -INSTALLS += target desktop diff -Nru dtkdeclarative-5.6.3/examples/exhibition/main.cpp dtkdeclarative-5.6.10/examples/exhibition/main.cpp --- dtkdeclarative-5.6.3/examples/exhibition/main.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/exhibition/main.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -11,9 +11,12 @@ #include #include #include +#include +#include class Object : public QObject { Q_OBJECT + public: Q_INVOKABLE QByteArray readFile(const QUrl &url) const { QFile file(url.isLocalFile() ? url.toLocalFile() : (":" + url.path())); @@ -27,6 +30,29 @@ QQmlEngine::setObjectOwnership(oldItem, QQmlEngine::CppOwnership); oldItem->deleteLater(); } + + Q_INVOKABLE QString sceneGraphBackend(QQuickWindow *window) const { + const QString &backend = window->sceneGraphBackend(); + if (!backend.isEmpty()) + return backend; + + switch (window->rendererInterface()->graphicsApi()) { + case QSGRendererInterface::Unknown: return "Unknown"; + case QSGRendererInterface::Software: return "Software"; + case QSGRendererInterface::OpenGL: return "OpenGL"; + case QSGRendererInterface::Direct3D12: return "Direct3D12"; + case QSGRendererInterface::OpenVG: return "OpenVG"; + case QSGRendererInterface::OpenGLRhi: return "OpenGLRhi"; + case QSGRendererInterface::Direct3D11Rhi: return "Direct3D11Rhi"; + case QSGRendererInterface::VulkanRhi: return "VulkanRhi"; + case QSGRendererInterface::MetalRhi: return "MetalRhi"; + case QSGRendererInterface::NullRhi: return "NullRhi"; + default: + break; + } + + return "None"; + } }; int main(int argc, char **argv) @@ -42,6 +68,7 @@ QQuickStyle::setStyle("Chameleon"); #else QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon"); + qInfo() << "QQuickStyle:" << CHAMELEON_PATH"/Chameleon"; #endif QQmlApplicationEngine engine; diff -Nru dtkdeclarative-5.6.3/examples/exhibition/main.qml dtkdeclarative-5.6.10/examples/exhibition/main.qml --- dtkdeclarative-5.6.3/examples/exhibition/main.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/exhibition/main.qml 2023-04-17 09:55:26.000000000 +0000 @@ -13,7 +13,7 @@ visible: true width: Math.max(contentList.contentWidth + navigation.width, 1500) height: 800 - title: qsTr("DTK Exhibition") + title: qsTr("DTK Exhibition(Scene Graph Backend: %1)").arg(globalObject.sceneGraphBackend(root)) // 开启“圆角窗口&无系统标题栏”模式 DWindow.enabled: true diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/CMakeLists.txt dtkdeclarative-5.6.10/examples/qml-app-template/CMakeLists.txt --- dtkdeclarative-5.6.3/examples/qml-app-template/CMakeLists.txt 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 3.1) - -project(%{ProjectName} LANGUAGES CXX) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -find_package(DtkDeclarative REQUIRED) - -# Application -add_subdirectory(src) diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/debian/changelog dtkdeclarative-5.6.10/examples/qml-app-template/debian/changelog --- dtkdeclarative-5.6.3/examples/qml-app-template/debian/changelog 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/debian/changelog 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -%{ProjectName} (0.0.1) unstable; urgency=medium - - * Initial release. - - -- Deepin Packages Builder Wed, 01 Jul 2020 14:14:35 +0800 diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/debian/compat dtkdeclarative-5.6.10/examples/qml-app-template/debian/compat --- dtkdeclarative-5.6.3/examples/qml-app-template/debian/compat 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/debian/control dtkdeclarative-5.6.10/examples/qml-app-template/debian/control --- dtkdeclarative-5.6.3/examples/qml-app-template/debian/control 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/debian/control 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -Source: %{ProjectName} -Section: admin -Priority: optional -Maintainer: Deepin Packages Builder -Build-Depends: - debhelper (>= 9), - cmake, - pkg-config, - qtdeclarative5-dev, - libdtkdeclarative-dev -Standards-Version: 3.9.8 -Homepage: http://www.deepin.org - -Package: %{ProjectName} -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Simple description - A detailed description. - diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/debian/copyright dtkdeclarative-5.6.10/examples/qml-app-template/debian/copyright --- dtkdeclarative-5.6.3/examples/qml-app-template/debian/copyright 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/debian/copyright 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: %{ProjectName} -Source: https://github.com/linuxdeepin/%{ProjectName} - -Files: * -Copyright: UnionTech Software Technology Co., Ltd. -License: LGPL-3.0-or-later diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/debian/rules dtkdeclarative-5.6.10/examples/qml-app-template/debian/rules --- dtkdeclarative-5.6.3/examples/qml-app-template/debian/rules 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/debian/rules 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#!/usr/bin/%{DtkQmlAppMake} -f -DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/default.mk -export QT_SELECT = qt5 - -ifneq (,$(wildcard .git/config)) - CONFIG_VERSION= -else -VERSION = $(DEB_VERSION_UPSTREAM) -_PACK_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}') -_BUILD_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0-9]//g') -ifeq ($(_BUILD_VER),) - CONFIG_VERSION = $(_PACK_VER) -else - CONFIG_VERSION = $(_PACK_VER).$(_BUILD_VER) -endif -endif - -%: - dh $@ --parallel - -override_dh_auto_configure: - dh_auto_configure -- LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) VERSION=$(CONFIG_VERSION) diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/debian/source/format dtkdeclarative-5.6.10/examples/qml-app-template/debian/source/format --- dtkdeclarative-5.6.3/examples/qml-app-template/debian/source/format 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/debian/source/format 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -3.0 (native) diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/CMakeLists.txt dtkdeclarative-5.6.10/examples/qml-app-template/src/CMakeLists.txt --- dtkdeclarative-5.6.3/examples/qml-app-template/src/CMakeLists.txt 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.1) - -# 同时生成 一个 exe 和 两个 lib 三个文件 -# lib 文件包含 Preload 插件和 MainComponent 插件 -# (1) Preload 插件保证程序启动的入口。 -# (2) MainCompnent 会在加载完毕自动添加到 Preload 中 - -# Application -if (NOT CMAKE_BUILD_TYPE STREQUAL "Release") - set(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/lib") - add_definitions(-DPLUGINPATH="${LIBRARY_OUTPUT_PATH}") -endif() - -add_subdirectory(main) -add_subdirectory(preloadplugin) -add_subdirectory(maincomponentplugin) diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/main/CMakeLists.txt dtkdeclarative-5.6.10/examples/qml-app-template/src/main/CMakeLists.txt --- dtkdeclarative-5.6.3/examples/qml-app-template/src/main/CMakeLists.txt 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/main/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -cmake_minimum_required(VERSION 3.1) - -set(APP_BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin/) -set(APP_NAME ${CMAKE_PROJECT_NAME}) -add_definitions(-DAPP_NAME="${APP_NAME}") - -###! main目录创建出二进制可执行文件,但启动方式由 DAppLoader -###! 中提供, 请不要在 main 中实现额外内容,请将需要实现的部分 -###! 移动到 preload 插件和 maincomponent 插件中。 - -# Set sources -set(SRC - main.cpp - ) - -# Find the Qt5Quick library -find_package(Qt5Quick CONFIG REQUIRED) - -# Add EXE -add_executable(${APP_NAME} ${SRC}) - -# 由于 EXE 只是作为启动程序加载 LIB 使用,一般来说,只需链接 ${LIB_NAME} 既可。 -target_link_libraries(${APP_NAME} - Qt5::Quick - ${DtkDeclarative_LIBRARIES} - ) - -add_definitions(-DAPP_PLUGIN_PATH=\"${DTK_QML_APP_PLUGIN_PATH}\") - -set_target_properties(${APP_NAME} PROPERTIES INSTALL_RPATH ${DTK_QML_APP_PLUGIN_PATH}) -install(TARGETS ${APP_NAME} DESTINATION ${APP_BIN_INSTALL_DIR}) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../${CMAKE_PROJECT_NAME}.desktop" DESTINATION share/applications) diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/main/main.cpp dtkdeclarative-5.6.10/examples/qml-app-template/src/main/main.cpp --- dtkdeclarative-5.6.3/examples/qml-app-template/src/main/main.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/main/main.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -#include -#include - -DQUICK_USE_NAMESPACE - -int main(int argc, char *argv[]) -{ - DAppLoader appLoader("org.deepin.%{ProjectName}"); -#ifdef PLUGINPATH - appLoader.addPluginPath(PLUGINPATH); -#endif -#ifdef APP_PLUGIN_PATH - appLoader.addPluginPath(APP_PLUGIN_PATH); -#endif - return appLoader.exec(argc, argv); -} diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/maincomponentplugin/CMakeLists.txt dtkdeclarative-5.6.10/examples/qml-app-template/src/maincomponentplugin/CMakeLists.txt --- dtkdeclarative-5.6.3/examples/qml-app-template/src/maincomponentplugin/CMakeLists.txt 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/maincomponentplugin/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -cmake_minimum_required(VERSION 3.1) - -set(MAINCOMPONENT_LIB_NAME ${CMAKE_PROJECT_NAME}-main) - -###! maincomponent 中可以添加应用的第三方依赖、注册 -###! 应用的c++和qml类型、进行耗时计算和加载等等。 -###! 但为了最大程度的启动(创建)组件,请保证在 main.qml -###! 中 AppLoader 结构的正确性,将互相独立的组件独立成 -###! 不同的 Component 进行并发加载。 - -# Set sources -set(MAINCOMPONENNT_SRC - maincomponentplugin.cpp - ) - -# Find the Qt5Quick library -find_package(Qt5Quick CONFIG REQUIRED) -find_package(Qt5QuickCompiler REQUIRED) - -qtquick_compiler_add_resources(MAINCOMPONENT_RCC_SOURCES maincomponent.qrc) - -# 保证 maincomponentplugin 目录下头文件全局可见 -include_directories(src/maincomponentplugin) - -# Add LIB -add_library(${MAINCOMPONENT_LIB_NAME} SHARED - ${MAINCOMPONENNT_SRC} - ${MAINCOMPONENT_RCC_SOURCES} - ) - -# 由于 LIB 程序为本项目的功能实现部分,需要用到的第三方库都需要在此处添加。 -target_link_libraries(${MAINCOMPONENT_LIB_NAME} - Qt5::Quick - ${DtkDeclarative_LIBRARIES} - ) - -# Add install rule -install(TARGETS ${MAINCOMPONENT_LIB_NAME} DESTINATION ${DTK_QML_APP_PLUGIN_PATH}) diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/maincomponentplugin/maincomponentplugin.cpp dtkdeclarative-5.6.10/examples/qml-app-template/src/maincomponentplugin/maincomponentplugin.cpp --- dtkdeclarative-5.6.3/examples/qml-app-template/src/maincomponentplugin/maincomponentplugin.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/maincomponentplugin/maincomponentplugin.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -#include "maincomponentplugin.h" - -#include - -DQUICK_USE_NAMESPACE - -MainComponentPlugin::MainComponentPlugin(QObject *parent) - : QObject(parent) -{ - -} - -MainComponentPlugin::~MainComponentPlugin() -{ - -} - -QUrl MainComponentPlugin::mainComponentPath() const -{ - // 返回程序的主控件部分 qml 文件,请确保该文件存在 - return QUrl("qrc:///main.qml"); -} diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/maincomponentplugin/maincomponentplugin.h dtkdeclarative-5.6.10/examples/qml-app-template/src/maincomponentplugin/maincomponentplugin.h --- dtkdeclarative-5.6.3/examples/qml-app-template/src/maincomponentplugin/maincomponentplugin.h 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/maincomponentplugin/maincomponentplugin.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -#ifndef MAINCOMPONENTPLUGIN_H -#define MAINCOMPONENTPLUGIN_H - -#include - -class QQmlComponent; -class MainComponentPlugin : public QObject, public DTK_QUICK_NAMESPACE::DQmlAppMainWindowInterface -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID DQmlAppMainWindowInterface_iid FILE "plugin.json") - Q_INTERFACES(DTK_QUICK_NAMESPACE::DQmlAppMainWindowInterface) -public: - MainComponentPlugin(QObject *parent = nullptr); - ~MainComponentPlugin() override; - - QUrl mainComponentPath() const override; -}; - -#endif // MAINCOMPONENTPLUGIN_H diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/maincomponentplugin/maincomponent.qrc dtkdeclarative-5.6.10/examples/qml-app-template/src/maincomponentplugin/maincomponent.qrc --- dtkdeclarative-5.6.3/examples/qml-app-template/src/maincomponentplugin/maincomponent.qrc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/maincomponentplugin/maincomponent.qrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ - - - main.qml - - diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/maincomponentplugin/main.qml dtkdeclarative-5.6.10/examples/qml-app-template/src/maincomponentplugin/main.qml --- dtkdeclarative-5.6.3/examples/qml-app-template/src/maincomponentplugin/main.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/maincomponentplugin/main.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import org.deepin.dtk 1.0 - -/** - AppLoader 用于动态创建组件,它在 Preaload 创建显示 - 出来后再进行创建操作,并将创建出来的组件放置在 Preload 的 - 窗口内部。开发过程过不需要处理 AppLoader 的处理过程,对于 - 需要使用到 Window 属性的情况,请使用其属性 AppLoader.window。 - - AppLoader 中请将相互独立的组件放置在不同 Component - 中,将相互引用的组件放在在一个 Component 内,将全局属性或 - 者创建逻辑不需要太复杂的控件放置在 AppLoader 的全局区域。 - - AppLoader 能够配合 Loader 等动态创建的控件一起使用, - 在使用时,Loader 的 active 属性可以配合 AppLoader 的 - loaded 属性达到控件加载先后顺序的效果。 - */ -AppLoader { - Component { - Row { - anchors.top: parent.top - anchors.topMargin: 20 - anchors.horizontalCenter: parent.horizontalCenter - width: 500 - height: 50 - spacing: 5 - - Repeater { - id: repeater - model: 10 - Rectangle { - color: (index == 0 || index == repeater.count - 1) ? "blue" : "cyan" - width: 50 - height: 50 - radius: Style.control.radius - } - } - } - } - - Component { - Button { - anchors.centerIn: parent - text: qsTr("Button") - } - } - - Component { - Row { - anchors.bottom: parent.bottom - anchors.bottomMargin: 20 - anchors.horizontalCenter: parent.horizontalCenter - width: 500 - height: 50 - spacing: 5 - - Repeater { - id: repeater - model: 10 - Rectangle { - color: (index == 0 || index == repeater.count - 1) ? "red" : "cyan" - width: 50 - height: 50 - radius: Style.control.radius - } - } - } - } -} diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/preloadplugin/CMakeLists.txt dtkdeclarative-5.6.10/examples/qml-app-template/src/preloadplugin/CMakeLists.txt --- dtkdeclarative-5.6.3/examples/qml-app-template/src/preloadplugin/CMakeLists.txt 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/preloadplugin/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -cmake_minimum_required(VERSION 3.1) - -set(PRELOAD_LIB_NAME ${CMAKE_PROJECT_NAME}-preload) - -###! 请确保 preloadplugin 下仅依赖最少的三方内容, -###! 且不做额外的复杂操作,将第三方库和自定义类型放在 -###! maincomponentplugin 中,保证程序能够快速启动。 -# Set sources -set(PRELOAD_SRC - preloadplugin.cpp - ) - -# Find the Qt5Quick library -find_package(Qt5Quick CONFIG REQUIRED) -find_package(Qt5QuickCompiler REQUIRED) - -qtquick_compiler_add_resources(PRELOAD_RCC_SOURCES preload.qrc) - -# 保证 preloadplugin 目录下头文件全局可见 -include_directories(src/preloadplugin) - -# Add LIB -add_library(${PRELOAD_LIB_NAME} SHARED - ${PRELOAD_SRC} - ${PRELOAD_RCC_SOURCES} - ) - -# 由于 LIB 程序为本项目的功能实现部分,需要用到的第三方库都需要在此处添加。 -target_link_libraries(${PRELOAD_LIB_NAME} - Qt5::Quick - ${DtkDeclarative_LIBRARIES} - ) - -# Add install rule -install(TARGETS ${PRELOAD_LIB_NAME} DESTINATION ${DTK_QML_APP_PLUGIN_PATH}) diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/preloadplugin/preloadplugin.cpp dtkdeclarative-5.6.10/examples/qml-app-template/src/preloadplugin/preloadplugin.cpp --- dtkdeclarative-5.6.3/examples/qml-app-template/src/preloadplugin/preloadplugin.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/preloadplugin/preloadplugin.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -#include "preloadplugin.h" - -#include - -DQUICK_USE_NAMESPACE - -PreloadPlugin::PreloadPlugin(QObject *parent) - : QObject(parent) -{ - -} - -PreloadPlugin::~PreloadPlugin() -{ - -} - -QUrl PreloadPlugin::preloadComponentPath() const -{ - // 预览组件的 qml 路径 - return QUrl("qrc:///Preload.qml"); -} diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/preloadplugin/preloadplugin.h dtkdeclarative-5.6.10/examples/qml-app-template/src/preloadplugin/preloadplugin.h --- dtkdeclarative-5.6.3/examples/qml-app-template/src/preloadplugin/preloadplugin.h 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/preloadplugin/preloadplugin.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -#ifndef PRELOADPLUGIN_H -#define PRELOADPLUGIN_H - -#include - -class QQmlComponent; -class PreloadPlugin : public QObject, public DTK_QUICK_NAMESPACE::DQmlAppPreloadInterface -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID DQmlAppPreloadInterface_iid FILE "plugin.json") - Q_INTERFACES(DTK_QUICK_NAMESPACE::DQmlAppPreloadInterface) -public: - PreloadPlugin(QObject *parent = nullptr); - ~PreloadPlugin() override; - - virtual QUrl preloadComponentPath() const override; -}; - -#endif // PRELOADPLUGIN_H diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/preloadplugin/Preload.qml dtkdeclarative-5.6.10/examples/qml-app-template/src/preloadplugin/Preload.qml --- dtkdeclarative-5.6.3/examples/qml-app-template/src/preloadplugin/Preload.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/preloadplugin/Preload.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Window 2.0 -import org.deepin.dtk 1.0 -import "." - -/** - Preload 作为程序的主窗口被 AppLoader 提前加载,用于达到快速 - 启动的功能。 在使用时,可以配合 DWindow 的 overlayExited属性, - 进行流畅化动画设计。 - - Preload 中可以使用 ApplicationWindow; Window 和 DialogWindow - 作为主窗口,但请注意,每个程序只有一个 Preload 入口,而这个 Preload 入口 - 将作为程序的主界面显示,当程序存在多个 Window 窗口时,请将主窗口作为 Preload - 窗口。 - - Preload 中 loadingOverlay 作为流畅化过渡的组件属性,请不要在程序加载 - 完成之后使用它,也不要管理它的生命周期,其生命周期仅会在窗口过渡阶段。 loadingOverlay - 属性除了可以使用一般控件之外,也能使用静态图,动态图等内容。当不指定其大小和位置时, - 默认情况进行主窗口填充。当指定大小后,将按照控件大小和位置进行布局。 - */ -ApplicationWindow { - id: window - visible: true - width: 900 - height: 700 - title: qsTr("qml-demo") - flags: Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint - header: TitleBar {} - - DWindow.enabled: true - DWindow.loadingOverlay: Rectangle { - color: palette.window - BusyIndicator { - id: indicator - anchors.centerIn: parent - running: true - width: 64 - height: 64 - } - } - - DWindow.overlayExited: Transition { - NumberAnimation { - properties: "scale" - from: 1 - to: 0 - easing.type: Easing.InBack - } - } -} diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/src/preloadplugin/preload.qrc dtkdeclarative-5.6.10/examples/qml-app-template/src/preloadplugin/preload.qrc --- dtkdeclarative-5.6.3/examples/qml-app-template/src/preloadplugin/preload.qrc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/src/preloadplugin/preload.qrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ - - - Preload.qml - - diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/template.desktop dtkdeclarative-5.6.10/examples/qml-app-template/template.desktop --- dtkdeclarative-5.6.3/examples/qml-app-template/template.desktop 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/template.desktop 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -[Desktop Entry] -Name=%{ProjectName} -Exec=/usr/bin/%{ProjectName} -X-Deepin-TurboType=dtkqml diff -Nru dtkdeclarative-5.6.3/examples/qml-app-template/wizard.json dtkdeclarative-5.6.10/examples/qml-app-template/wizard.json --- dtkdeclarative-5.6.3/examples/qml-app-template/wizard.json 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-app-template/wizard.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,164 +0,0 @@ -{ - "version": 1, - "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject"], - "id": "A.Dtk QtQuick Application", - "category": "F.Project", - "trDescription": "Creates a Dtk QtQuick Application for UOS.", - "trDisplayName": "Dtk QtQuick Application", - "trDisplayCategory": "Dtk QML Application", - "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ], - "options": - [ - { "key": "DtkQmlAppMake", "value": "make" }, - { "key": "ProjectFile", "value": "%{CMakeFile}" }, - { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, - { "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.QtQuickVersion}" }, - { "key": "QtQuickWindowVersion", "value": "%{JS: %{QtVersion}.QtQuickWindowVersion}" }, - { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: %{QtVersion}.QtQuickVirtualKeyboardImport}" }, - { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, - { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0 || [ %{Plugins} ].indexOf('Boot2QtQdb') >= 0}" }, - { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" } - ], - "pages": - [ - { - "trDisplayName": "Project Location", - "trShortTitle": "Location", - "typeId": "Project" - }, - { - "trDisplayName": "Define Project Details", - "trShortTitle": "Details", - "typeId": "Fields", - "data": - [ - { - "name": "QtVersion", - "trDisplayName": "Minimal required Qt version:", - "type": "ComboBox", - "data": - { - "index": 3, - "items": - [ - { - "trKey": "Qt 5.12", - "value": - "({ - 'QtQuickVersion': '2.12', - 'QtQuickWindowVersion': '2.12', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' - })" - }, - { - "trKey": "Qt 5.11", - "value": - "({ - 'QtQuickVersion': '2.11', - 'QtQuickWindowVersion': '2.11', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" - }, - { - "trKey": "Qt 5.10", - "value": - "({ - 'QtQuickVersion': '2.10', - 'QtQuickWindowVersion': '2.10', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" - }, - { - "trKey": "Qt 5.9", - "value": - "({ - 'QtQuickVersion': '2.9', - 'QtQuickWindowVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.2' - })" - }, - { - "trKey": "Qt 5.8", - "value": - "({ - 'QtQuickVersion': '2.8', - 'QtQuickWindowVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' - })" - }, - { - "trKey": "Qt 5.7", - "value": - "({ - 'QtQuickVersion': '2.7', - 'QtQuickWindowVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' - })" - }, - { - "trKey": "Qt 5.6", - "value": - "({ - 'QtQuickVersion': '2.6', - 'QtQuickWindowVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 2.0' - })" - } - ] - } - }, - { - "name": "UseVirtualKeyboard", - "trDisplayName": "Use Qt Virtual Keyboard", - "type": "CheckBox", - "data": - { - "checked": "false" - } - } - ] - }, - { - "trDisplayName": "Kit Selection", - "trShortTitle": "Kits", - "typeId": "Kits", - "enabled": "%{JS: ! %{IsSubproject}}", - "data": { "projectFilePath": "%{ProjectFile}" }, - "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ] - }, - { - "trDisplayName": "Project Management", - "trShortTitle": "Summary", - "typeId": "Summary" - } - ], - "generators": - [ - { - "typeId": "File", - "data": - [ - { - "source": "./CMakeLists.txt", - "target": "CMakeLists.txt", - "openAsProject": true - }, - { - "source": "./src" - }, - { - "source": "./template.desktop", - "target": "./%{ProjectName}.desktop" - }, - { - "source": "./debian" - }, - { - "source": "../../git.ignore", - "target": ".gitignore", - "condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}" - } - ] - } - ] -} Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/examples/qml-inspect/built-in-icons/action_add.dci and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/examples/qml-inspect/built-in-icons/action_add.dci differ diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/CMakeLists.txt dtkdeclarative-5.6.10/examples/qml-inspect/CMakeLists.txt --- dtkdeclarative-5.6.3/examples/qml-inspect/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,17 @@ +set(BIN_NAME qml-inspect) + +find_package(Qt5 COMPONENTS Quick QuickControls2) +find_package(Dtk REQUIRED COMPONENTS Gui) + +add_executable(${BIN_NAME} + ${CMAKE_CURRENT_LIST_DIR}/main.cpp + ${CMAKE_CURRENT_LIST_DIR}/qml.qrc + ${CMAKE_CURRENT_LIST_DIR}/dciicons.qrc +) + +target_link_libraries(${BIN_NAME} PUBLIC + Qt5::Quick + Qt5::QuickControls2 + Dtk::Gui + ${LIB_NAME} +) diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/dciicons.qrc dtkdeclarative-5.6.10/examples/qml-inspect/dciicons.qrc --- dtkdeclarative-5.6.3/examples/qml-inspect/dciicons.qrc 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/dciicons.qrc 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,6 @@ + + + icons/bloom/org.deepin.Example/action_add.dci + built-in-icons/action_add.dci + + diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_1.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_1.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_1.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_1.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,505 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.11 +import org.deepin.dtk 1.0 + +Rectangle { + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + onClicked: { + if (mouse.button === Qt.RightButton) + contextMenu.popup() + } + onPressAndHold: { + if (mouse.source === Qt.MouseEventNotSynthesized) + contextMenu.popup() + } + + Menu { + id: contextMenu + MenuItem { + text: "Cut" + icon.name: "edit-cut" + display: AbstractButton.TextBesideIcon + } + MenuItem { + text: "Copy" + icon.name: "edit-copy" + display: IconLabel.IconBesideText + } + MenuItem { + text: "Paste" + checkable: true + checked: true + } + MenuSeparator { } + Menu { + title: "Find/Replace" + Action { text: "Find Next" } + Action { text: "Find Previous" } + Action { text: "Replace" } + } + MenuItem { text: "Exit" } + } + } + + Label { + id: btnLabel + anchors.leftMargin: 20 + anchors.top: parent.top + anchors.topMargin: 20 + height: btn.height + text: qsTr("Button:") + verticalAlignment: Text.AlignVCenter + } + + Button { + id: btn + anchors.left: btnLabel.right + anchors.leftMargin: 20 + anchors.top: parent.top + anchors.topMargin: 20 + text: "Button" + } + + WarningButton { + id: warningBtn + anchors.top: parent.top // @disable-check M16 + anchors.topMargin: 20 // @disable-check M16 + anchors.left: btn.right // @disable-check M16 + anchors.leftMargin: 20 // @disable-check M16 + text: "Warning" // @disable-check M16 + onPressed: console.log("WarningButton pressed") // @disable-check M16 + } + + RecommandButton { + id: highlightedionBtn + anchors.left: warningBtn.right // @disable-check M16 + anchors.leftMargin: 20 // @disable-check M16 + anchors.top: parent.top // @disable-check M16 + anchors.topMargin: 20 // @disable-check M16 + text: "Recommand" // @disable-check M16 + } + + ToolButton { + id: toolButton + anchors.left: highlightedionBtn.right // @disable-check M16 + anchors.leftMargin: 20 // @disable-check M16 + anchors.top: parent.top // @disable-check M16 + anchors.topMargin: 20 // @disable-check M16 + } + + IconButton { + id: iconButton + width: 36 // @disable-check M16 + anchors.left: toolButton.right // @disable-check M16 + anchors.leftMargin: 20 // @disable-check M16 + anchors.top: parent.top // @disable-check M16 + anchors.topMargin: 20 // @disable-check M16 + icon.name: "org.deepin.Example/test/action_add" + } + + IconButton { + id: iconButton1 + width: 36 // @disable-check M16 + anchors.left: iconButton.right // @disable-check M16 + anchors.leftMargin: 20 // @disable-check M16 + anchors.top: parent.top // @disable-check M16 + anchors.topMargin: 20 // @disable-check M16 + icon.name: "test/action_add" // @disable-check M16 + } + + IconButton { + id: iconButton2 + width: 36 // @disable-check M16 + anchors.left: iconButton1.right // @disable-check M16 + anchors.leftMargin: 20 // @disable-check M16 + anchors.top: parent.top // @disable-check M16 + anchors.topMargin: 20 // @disable-check M16 + flat: true // @disable-check M16 + icon.name: "action_add" // @disable-check M16 + } + + FloatingButton { + id: floatingButton + width: 36 // @disable-check M16 + anchors.left: iconButton2.right // @disable-check M16 + anchors.leftMargin: 20 // @disable-check M16 + anchors.top: parent.top // @disable-check M16 + anchors.topMargin: 20 // @disable-check M16 + icon.name: "action_add" + } + + DelayButton { + id: dlyBtn + anchors.left: floatingButton.right + anchors.leftMargin: 20 + anchors.top: parent.top + anchors.topMargin: 20 + text: "DelayButton" + + NumberAnimation on progress { + from: 0 + to: 1.0 + duration: 4000 + loops: Animation.Infinite + } + } + + RoundButton { + id: roundButton; + anchors.top: parent.top + anchors.left: dlyBtn.right + anchors.leftMargin: 20 + anchors.topMargin: 20 + + icon.name: "action_add" + } + + ButtonBox { + id: buttonBox + anchors.left: roundButton.right // @disable-check M16 + anchors.leftMargin: 20 // @disable-check M16 + anchors.top: parent.top // @disable-check M16 + anchors.topMargin: 20 // @disable-check M16 + + ToolButton { + checkable: true; icon.name: "go-previous"; checked: true // @disable-check M16 + } + ToolButton { + checkable: true; icon.name: "go-down" // @disable-check M16 + } + ToolButton { + checkable: true; icon.name: "go-next" // @disable-check M16 + } + } + + LineEdit { + id: lineEdit + anchors.left: parent.left + anchors.top: btnLabel.bottom + anchors.topMargin: 20 + text: "Testing the alert message in line edit." + + alertText: qsTr("This is a long sentence.") + alertDuration: 2000 // millisecond + showAlert: focus + } + + SearchEdit { + id: searcherEdit + anchors.left: lineEdit.right + anchors.top: lineEdit.top + anchors.leftMargin: 20 + } + + SpinBox { + id: spinBox + anchors.left: searcherEdit.right + anchors.top: searcherEdit.top + anchors.leftMargin: 20 + editable: true + alertText: qsTr("This is a long sentence.") + alertDuration: 2000 // millisecond + showAlert: focus + } + + SpinBox { + id: customSpinBox + anchors.left: spinBox.right + anchors.top: spinBox.bottom + anchors.leftMargin: 20 + editable: true + value: 1 + + up.indicator: Rectangle { + border.color: "green" + anchors.right: customSpinBox.right + anchors.rightMargin: 5 + width: 20 + height: 15 + } + } + + PlusMinusSpinBox { + id: plusMinusSpinBox + anchors.left: spinBox.right + anchors.top: spinBox.top + anchors.leftMargin: 20 + spinBox.editable: true + spinBox.alertText: qsTr("Only numbers can be entered.") + spinBox.alertDuration: 2000 // millisecond + spinBox.showAlert: focus + } + + ListView { + model: 5 + implicitHeight: 250 + + delegate: CheckDelegate { + text: index; + + icon.name: "action_add" + } + + anchors.top: btnLabel.bottom + anchors.left: plusMinusSpinBox.right + anchors.topMargin: 20 + anchors.leftMargin: 20 + } + + Row { + id: sliderRow + anchors { + top: lineEdit.bottom + topMargin: 20 + } + + spacing: 10 + height: 350 + + Slider { + highlightedPassedGroove: true + orientation: Qt.Vertical + height: parent.height + handleType: Slider.HandleType.NoArrowVertical + } + + Slider { + height: parent.height + orientation: Qt.Vertical + handleType: Slider.HandleType.ArrowLeft + } + + Slider { + height: parent.height + highlightedPassedGroove: true + orientation: Qt.Vertical + handleType: Slider.HandleType.ArrowRight + } + } + + Column { + id: sliderColum + anchors { + top: lineEdit.bottom + topMargin: 40 + left: sliderRow.right + leftMargin: 60 + } + spacing: 10 + width: 400 + + Slider { + highlightedPassedGroove: true + width: parent.width + } + + Slider { + width: parent.width + handleType: Slider.HandleType.ArrowBottom + } + + Slider { + width: parent.width + highlightedPassedGroove: true + handleType: Slider.HandleType.ArrowUp + } + + TipsSlider { + width: parent.width + tickDirection: TipsSlider.TickDirection.Back + slider.highlightedPassedGroove: true + slider.handleType: Slider.HandleType.ArrowBottom + + ticks: [SliderTipItem { + }, + SliderTipItem { + }, + SliderTipItem { + }, + SliderTipItem { + }] + } + + TipsSlider { + id: sliderTickTip2 + readonly property var tips: [qsTr("Fast"), qsTr("Slow")] + width: parent.width + tickDirection: TipsSlider.TickDirection.Back + slider.handleType: Slider.HandleType.ArrowBottom + + ticks: [SliderTipItem { + text: sliderTickTip2.tips[0] + }, + SliderTipItem { + text: sliderTickTip2.tips[1] + }] + + // test highlight Text + HighlightPanel { + id: __highlight + readonly property real highlightMargin: 20 + anchors.bottom: parent.bottom + x: parent.slider.value * (parent.width - parent.slider.handle.width) - width / 2 + + parent.slider.handle.width / 2 + width: __text.implicitWidth + height: __text.implicitHeight + Text { + id: __text + text: sliderTickTip2.tips[0] + color: palette.highlightedText + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } + } + } + + TipsSlider { + id: sliderTickTip3 + readonly property var tips: [qsTr("1m"), qsTr("5m"), qsTr("10m"), qsTr("15m"), qsTr("30m"), qsTr("1h"), qsTr("Never")] + width: parent.width + tickDirection: TipsSlider.TickDirection.Back + slider.handleType: Slider.HandleType.ArrowBottom + slider.stepSize: 10 + slider.from: 0 + slider.to: 60 + + ticks: [SliderTipItem { + text: sliderTickTip3.tips[0] + textHorizontalAlignment: Text.AlignLeft + }, + SliderTipItem { + text: sliderTickTip3.tips[1] + }, + SliderTipItem { + text: sliderTickTip3.tips[2] + }, + SliderTipItem { + text: sliderTickTip3.tips[3] + }, + SliderTipItem { + text: sliderTickTip3.tips[4] + }, + SliderTipItem { + text: sliderTickTip3.tips[5] + }, + SliderTipItem { + text: sliderTickTip3.tips[6] + textHorizontalAlignment: Text.AlignRight + }] + + // test end Indicator + Rectangle { + width: 30 + height: 30 + color: "blue" + anchors { + left: parent.right + leftMargin: 20 + verticalCenter: parent.slider.verticalCenter + } + + Text { + anchors.centerIn: parent + text: sliderTickTip3.slider.value.toFixed(1) + color: "white" + } + } + + // test start Indicator + Rectangle { + width: 30 + height: 30 + color: "red" + anchors { + right: parent.left + rightMargin: 20 + verticalCenter: parent.slider.verticalCenter + } + + Text { + anchors.centerIn: parent + text: "S" + color: "white" + } + } + } + } + + Row { + id: switchBtnRow + anchors { + top: sliderColum.bottom + left: sliderRow.right + topMargin: 30 + leftMargin: 40 + } + spacing: 10 + Switch { + checked: true + } + + Switch { + } + + Switch { + checked: true + enabled: false + } + + Switch { + enabled: false + } + } + + Row { + anchors { + top: sliderColum.bottom + left: switchBtnRow.right + topMargin: 30 + leftMargin: 20 + } + + spacing: 10 + + ComboBox { + id: nonEditComboBox + model: ["Banana", "Apple", "Coconut"] + } + + ComboBox { + id: editableComboBox + editable: true + model: ["Banana", "Apple", "Coconut"] + } + + ComboBox { + id: nonEditComboBoxWithIcon + textRole: "text" + iconNameRole: "icon" + + model: ListModel { + ListElement { text: "Banana"; icon: "go-previous" } + ListElement { text: "Apple"; icon: "go-down" } + ListElement { text: "Coconut"; icon: "go-next" } + } + } + + ComboBox { + id: editableComboBoxWithIcon + editable: true + textRole: "text" + iconNameRole: "icon" + + model: ListModel { + ListElement { text: "Banana"; icon: "go-previous" } + ListElement { text: "Apple"; icon: "go-down" } + ListElement { text: "Coconut"; icon: "go-next" } + } + } + } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_2.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_2.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_2.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_2.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,275 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.11 +import QtQuick.Window 2.11 +import QtQuick.Layouts 1.11 +import org.deepin.dtk 1.0 + +Rectangle { + + RowLayout { + id:row_layout_1 + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + QtIcon { + name: "button_voice" + sourceSize: Qt.size(50, 50) + } + QtIcon { + name: "search_indicator" + color: "red" + + MouseArea { + anchors.fill: parent + onClicked: { + if (Qt.colorEqual(parent.color, "red")) { + parent.color = "blue" + } else { + parent.color = "red" + } + } + } + } + + BusyIndicator { + running: true + } + BusyIndicator { + running: true + } + + RoundButton { + id:roundbutton + width: 28 + height: 28 + } + + Dial {} + + Rectangle { + id: frame + clip: true + width: 160 + height: 160 + border.color: "black" + + Text { + id: content + text: "HELLO WORLD" + font.pixelSize: 160 + x: -hbar.position * width + y: -vbar.position * height + } + + ScrollBar { + id: vbar + hoverEnabled: true + active: hovered || pressed + orientation: Qt.Vertical + size: frame.height / content.height + anchors.top: parent.top + anchors.right: parent.right + anchors.bottom: parent.bottom + + ToolTip.visible: hovered + ToolTip.delay: 1000 + ToolTip.timeout: 5000 + ToolTip.text: "This is a ScrollBar!!!" + } + + ScrollBar { + id: hbar + hoverEnabled: true + active: hovered || pressed + orientation: Qt.Horizontal + size: frame.width / content.width + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + } + } + + + StackView { + id: stackview_1 + width: 150 + height: 150 + + Component { + id: page + Rectangle { + property real hue: Math.random() + color: Qt.hsla(hue, 0.5, 0.8, 0.6) + border.color: Qt.hsla(hue, 0.5, 0.5, 0.9) + StackView.visible: true + } + } + + initialItem: page + + MouseArea { + id:area + anchors.fill: parent + onClicked: { + stackview_1.push(page) + } + } + } + + } + + + RectangularShadow { + anchors.fill: shadowSource + glowRadius: 20 + spread: 0 + color: "black" + cornerRadius: shadowSource.radius + } + + Rectangle { + id: shadowSource + + width: 300 + height: 150 + anchors { + left: parent.left + leftMargin: 50 + bottom: parent.bottom + bottomMargin: 200 + } + radius: 30 + color: "red" + } + + // test like DropShadow + BoxShadow { + anchors.fill: boxShadowSource + + shadowBlur : 20 + shadowColor : Qt.rgba(0, 0, 0, 0.9) + shadowOffsetX : 0 + shadowOffsetY : 0 + cornerRadius: boxShadowSource.radius + hollow: true + } + + Rectangle { + id: boxShadowSource + + width: 200 + height: 200 + anchors { + left: shadowSource.right + leftMargin: 50 + bottom: shadowSource.bottom + } + color: "red" + radius: 20 + } + + // test like InnerShadow + BoxInsetShadow { + anchors.fill: boxShadowSource + + shadowBlur : 20 + shadowColor : Qt.rgba(0, 0, 0, 0.6) + shadowOffsetX : 0 + shadowOffsetY : 0 + cornerRadius: boxShadowSource.radius + } + + ListView { + spacing: 10 + anchors { + left: boxShadowSource.right + leftMargin: 50 + verticalCenter: boxShadowSource.verticalCenter + } + width: 200 + height: 280 + + model: ListModel { + ListElement { + cornor: 1 + } + ListElement { + cornor: 2 + } + ListElement { + cornor: 4 + } + ListElement { + cornor: 8 + } + ListElement { + cornor: 3 + } + ListElement { + cornor: 5 + } + ListElement { + cornor: 10 + } + ListElement { + cornor: 12 + } + } + delegate: RoundRectangle { + width: 200 + height: 60 + color: "blue" + radius: 20 + antialiasing: true + corners: cornor + } + } + + Rectangle { + id:swipe_view + + width: 300 + height: 150 + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + + SwipeView { + id: view + + currentIndex: 1 + anchors.fill: parent + + Rectangle { + color: "red" + width: swipe_view.width + height: swipe_view.height + } + + Rectangle { + color: "green" + width: swipe_view.width + height: swipe_view.height + } + + Rectangle { + color: "blue" + width: swipe_view.width + height: swipe_view.height + } + } + + PageIndicator { + id: indicator + + count: view.count + currentIndex: view.currentIndex + + anchors.bottom: view.bottom + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_3.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_3.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_3.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_3.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,112 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.0 +import org.deepin.dtk 1.0 + +Item { + Image { + id: back + anchors.fill: parent + source: "file:///usr/share/wallpapers/deepin/desktop.jpg" + } + + Rectangle { + id: source + y: 50 + x: 50 + width: 200 + height: 200 + radius: 30 + color: "red" + visible: false + } + + Item { + id: maskSource + anchors.fill: source + visible: false + Rectangle { + anchors.centerIn: parent + width: 100 + height: 100 + radius: 40 + color: "blue" + } + } + + OpacityMask { + anchors.fill: source + source: source + maskSource: maskSource + invert: true + } + + ListView { + id: testView + + property color foreground: "#55ffffff" + model: 1 + spacing: 30 + clip: true + anchors { + fill: parent + margins: 10 + } + + delegate: Item { + property ListView view: ListView.view + + height: 50 + width: 300 + anchors.horizontalCenter: parent.horizontalCenter + + InWindowBlur { + id: blur + anchors.fill: parent + radius: 20 + offscreen: true + } + + ItemViewport { + id: roundBlur + anchors.fill: blur + fixed: true + sourceItem: blur + radius: 20 + hideSource: false + } + + Rectangle { + radius: roundBlur.radius + anchors.fill: roundBlur + color: view.foreground + } + + Text { + anchors.centerIn: parent + text: "InWindowBlur" + index + color: "white" + font.pixelSize: 22 + } + } + } + + Button { + text: "深浅切换" + onClicked: { + if (testView.foreground == "#55000000") + testView.foreground = "#55ffffff" + else + testView.foreground = "#55000000" + } + } + +// StyledArrowShapeBlur { +// anchors.centerIn: parent +// width: 100 +// height: 200 +// roundJoinRadius: 20 +// } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_colorselector.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_colorselector.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_colorselector.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_colorselector.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,451 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.11 +import org.deepin.dtk 1.0 + +Rectangle { + Label { + id: changePaletteLabel + anchors.left: parent.left + anchors.top: parent.top + anchors.topMargin: 20 + text: "Change Palette By object property" + font.pointSize: 14 + font.bold: true + } + + Control { + id: control1 + anchors.left: parent.left + anchors.top: changePaletteLabel.bottom + anchors.topMargin: 20 + width: 500 + height: 50 + + property Palette backgroundColor: Palette { + normal: "black" + } + property Palette backgroundColorClicked: Palette { + normal: "blue" + } + + property Palette textColorClicked: Palette { + normal: "yellow" + } + + Rectangle { + property Palette borderColor: Palette { + normal: "red" + } + id: rect1 + anchors.left: parent.left + anchors.top: control1.top + width: 250 + height: 50 + color: ColorSelector.backgroundColor + border.width: 1 + border.color: ColorSelector.borderColor + + Text { + property Palette textColor: Palette { + normal: "white" + } + + id: rect1Text + anchors.fill: parent + text: "Use it's control parent's palette.\n(Click to change.)" + color: ColorSelector.textColor + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + + MouseArea { + anchors.fill: parent + + onClicked: { + control1.backgroundColor.normal = "red" + rect1Text.textColor.normal = "black" + } + } + } + } + + Rectangle { + id: rect2 + property Palette borderColor: Palette { + normal: "red" + } + property Palette backgroundColor: Palette { + normal: "black" + } + property Palette backgroundColorClicked: Palette { + normal: "magenta" + } + + anchors.left: rect1.right + anchors.leftMargin: 20 + anchors.top: control1.top + width: 250 + height: 50 + color: ColorSelector.backgroundColor + border.width: 1 + border.color: ColorSelector.borderColor + + Text { + id: rect2Text + property Palette textColor: Palette { + normal: "yellow" + } + + property Palette textColorClicked: Palette { + normal: "blue" + } + + anchors.fill: parent + text: "Overwrite it's control parent palette.\n(Click to change.)" + color: ColorSelector.textColor + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + + MouseArea { + anchors.fill: parent + Palette { + id: otherBackgroundColor + normal: "darkRed" + } + Palette { + id: othertextColor + normal: "darkBlue" + } + + onClicked: { + rect2.backgroundColor = otherBackgroundColor + rect2Text.textColor = othertextColor + } + } + } + } + } + + Label { + id: changeObjectLabel + anchors.left: parent.left + anchors.top: control1.bottom + anchors.topMargin: 20 + text: "Change Palette By color selector" + font.pointSize: 14 + font.bold: true + } + + Control { + id: control2 + anchors.left: parent.left + anchors.top: changeObjectLabel.bottom + anchors.topMargin: 20 + width: 500 + height: 50 + + property Palette backgroundColor: Palette { + normal: "black" + } + property Palette backgroundColorClicked: Palette { + normal: "blue" + } + + property Palette textColorClicked: Palette { + normal: "cyan" + } + + Rectangle { + property Palette borderColor: Palette { + normal: "red" + } + id: rect3 + anchors.left: parent.left + anchors.top: control2.top + width: 250 + height: 50 + color: ColorSelector.backgroundColor + border.width: 1 + border.color: ColorSelector.borderColor + + Text { + property Palette textColor: Palette { + normal: "white" + } + id: rect3Text + anchors.fill: parent + text: "Use it's color seletor to change palette.\n(Click to change, double click restore)" + color: ColorSelector.textColor + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + + MouseArea { + anchors.fill: parent + + onClicked: { + rect3.ColorSelector.backgroundColor = control2.backgroundColorClicked + rect3Text.ColorSelector.textColor = control2.textColorClicked + } + + onDoubleClicked: { + rect3.ColorSelector.backgroundColor = undefined + rect3Text.ColorSelector.textColor = undefined + } + } + } + } + + Rectangle { + id: rect4 + anchors.left: rect3.right + anchors.top: control2.top + anchors.leftMargin: 20 + width: 250 + height: 50 + color: ColorSelector.backgroundColor + property Palette backgroundColor: Palette { + normal: "black" + } + property Palette backgroundColorClicked: Palette { + normal: "magenta" + } + + Text { + id: rect4Text + property Palette textColor: Palette { + normal: "yellow" + } + + property Palette textColorClicked: Palette { + normal: "blue" + } + + anchors.fill: parent + text: "Use CS to replace it's own palette.\n(Click to change, double click restore)" + color: ColorSelector.textColor + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + + MouseArea { + anchors.fill: parent + + onClicked: { + rect4.ColorSelector.backgroundColor = rect4.backgroundColorClicked + rect4Text.ColorSelector.textColor = control2 .textColorClicked + } + + onDoubleClicked: { + rect4.ColorSelector.backgroundColor = undefined + rect4Text.ColorSelector.textColor = undefined + } + } + } + } + + Label { + id: changeParentLabel + anchors.left: parent.left + anchors.top: control2.bottom + anchors.topMargin: 20 + text: "Change palette when parent changed" + font.pointSize: 14 + font.bold: true + } + + Rectangle { + id: changeParentRect + anchors.left: parent.left + anchors.top: changeParentLabel.bottom + anchors.topMargin: 20 + width: 500 + height: 50 + + Control { + id: control3 + width: 220 + height: 50 + anchors.left: parent.left + anchors.top: parent.top + property Palette backgroundColor: Palette { + normal: "gray" + } + + Rectangle { + property Palette borderColor: Palette { + normal: "red" + } + id: reparentRect1 + width: 50 + height: 50 + color: ColorSelector.backgroundColor + border.width: 1 + border.color: ColorSelector.borderColor + + Text { + property Palette textColor: Palette { + normal: "blue" + } + anchors.fill: parent + text: "Rect1" + color: ColorSelector.textColor + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + + MouseArea { + anchors.fill: parent + onClicked: { + if (reparentRect1.parent == control3) + reparentRect1.state = "reparent2" + else + reparentRect1.state = "reparent1" + } + } + } + + states: [ + State { + name: "reparent1" + ParentChange { + target: reparentRect1 + parent: control3 + x: 0 + y: 0 + } + }, + State { + name: "reparent2" + ParentChange { + target: reparentRect1 + parent: control4 + x: 60 + y: 0 + } + } + ] + } + } + + Control { + id: control4 + width: 220 + height: 50 + anchors.left: control3.right + anchors.leftMargin: 10 + anchors.top: parent.top + + property Palette backgroundColor: Palette { + normal: "red" + } + + Rectangle { + property Palette borderColor: Palette { + normal: "gray" + } + id: reparentRect2 + width: 50 + height: 50 + color: ColorSelector.backgroundColor + border.width: 1 + border.color: ColorSelector.borderColor + + Text { + property Palette textColor: Palette { + normal: "yellow" + } + anchors.fill: parent + text: "Rect2" + color: ColorSelector.textColor + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + + MouseArea { + anchors.fill: parent + onClicked: { + if (reparentRect2.parent == control3) + reparentRect2.state = "reparent2" + else + reparentRect2.state = "reparent1" + } + } + } + + states: [ + State { + name: "reparent1" + ParentChange { + target: reparentRect2 + parent: control3 + x: 60 + y: 0 + } + }, + State { + name: "reparent2" + ParentChange { + target: reparentRect2 + parent: control4 + x: 0 + y: 0 + } + } + ] + } + } + } + + Label { + id: customControlLabel + anchors.left: parent.left + anchors.top: changeParentRect.bottom + anchors.topMargin: 20 + text: "Custom control which used the color selector" + font.pointSize: 14 + font.bold: true + } + + Row { + id: dontOverwriteControls + width: parent.width + height: 50 + anchors.left: parent.left + anchors.top: customControlLabel.bottom + anchors.topMargin: 20 + spacing: 5 + + Repeater { + model: 5 + Example_customcontrolforcs { + width: 50 + height: 50 + text: modelData + } + } + } + + Row { + id: overwriteControls + width: parent.width + height: 50 + anchors.left: parent.left + anchors.top: dontOverwriteControls.bottom + anchors.topMargin: 20 + spacing: 5 + + Repeater { + model: 5 + Example_customcontrolforcs { + backgroundColor: Palette { + normal: Qt.hsla(Math.random(), 0.6, 0.6, 0.9) + hovered: Qt.hsla(Math.random(), 0.2, 0.2, 0.9) + } + + width: 50 + height: 50 + text: modelData + } + } + } + } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_config.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_config.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_config.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_config.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,107 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.0 +import org.deepin.dtk 1.0 + +Item { + + Config { + id: exampleConfig + name: "example" + subpath: "" + property int key2 : 1 + property string key3 : "key3 default" + onKey3Changed: { + key3Text.text = exampleConfig.key3 + console.info("Config key3Changed"); + } + } + Column { + id: config + spacing: 10 + Button{ + text: "generic function" + onClicked: { + console.info("configBtn pressed") + console.info(exampleConfig.isValid()) + console.info(exampleConfig.value("key3", "ddd")) + console.info(exampleConfig.value("key3")) + console.info(exampleConfig.keyList()) + console.info(exampleConfig.name) + console.info(exampleConfig.subpath) + + exampleConfig.setValue("key3", (new Date).getTime().toString()) + console.info(exampleConfig.value("key3", "ddd")) + } + } + + Row { + spacing: 10 + + Button{ + text: "write" + onClicked: { + exampleConfig.key3 = (new Date).getTime().toString() + } + } + + Label { + text: "property binding key3:" + exampleConfig.key3 + } + + Label { + text: "js binding key3:" + } + Label { + text: "exampleConfig.key3" + Component.onCompleted: { + text = Qt.binding(function(){return exampleConfig.key3}) + } + } + } + + Row { + spacing: 10 + + Button{ + text: "read" + onClicked: { + console.info("key3", exampleConfig.key3) + readKey3Text.text = exampleConfig.key3 + } + } + Label { + text: "key3:" + } + Label { + id: readKey3Text + } + + } + + Row { + spacing: 10 + + Label { + text: "Connections valueChanged:" + } + Label { + text: "key3:" + } + Label { + id: key3Text + text: "key3:" + } + Connections{ + target: exampleConfig + onKey3Changed: { + key3Text.text = exampleConfig.key3 + console.info("Connections key3Changed"); + } + } + } + + } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_customcontrolforcs.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_customcontrolforcs.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_customcontrolforcs.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_customcontrolforcs.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,45 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.0 +import org.deepin.dtk 1.0 + +Control { + id: control + hoverEnabled: true + property Palette backgroundColor: Palette { + normal: Qt.hsla(Math.random(), 0.2, 0.5, 0.9) + hovered: Qt.hsla(Math.random(), 0.1, 0.1, 0.9) + } + property Palette textColor: Palette { + normal: Qt.hsla(Math.random(), 0.5, 0.2, 0.4) + hovered: Qt.hsla(Math.random(), 0.6, 0.6, 0.9) + } + + property string text + + background: Rectangle { + color: control.ColorSelector.backgroundColor + Behavior on color { + ColorAnimation { + duration: 300 + } + } + } + + contentItem: Text { + id: textItem + anchors.fill: parent + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + text: control.text + color: control.ColorSelector.textColor + + Behavior on color { + ColorAnimation { + duration: 300 + } + } + } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_Flickable.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_Flickable.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_Flickable.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_Flickable.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,218 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.0 +import QtQuick.Layouts 1.11 +import org.deepin.dtk 1.0 + +Flow { + id: control + Row { + spacing: 20 + ScrollView { + id: scrollView + width: 200 + height: 400 + clip: true + ListView { + model: 20 + delegate: Button { + text: "index" + String(modelData) + } + } + background: Rectangle { + border.color: "green" + } + } + + Column { + Row { + spacing: 20 + ProgressBar { + from: 0 + to: 100 + formatText: ("已下载" + (value / to * 100).toFixed() + "%(点击暂停)") + NumberAnimation on value { + from: 0 + to: 100 + duration: 1000 + loops: Animation.Infinite + } + } + + ProgressBar { + from: 0 + to: 100 + height: 8 + + NumberAnimation on value { + from: 0 + to: 100 + duration: 1000 + loops: Animation.Infinite + } + } + + EmbeddedProgressBar { + from: 0 + to: 100 + NumberAnimation on value { + from: 0 + to: 100 + duration: 1000 + loops: Animation.Infinite + } + } + + WaterProgressBar { + NumberAnimation on value { + loops: Animation.Infinite + from: 0 + to: 100 + duration: 10000 + } + } + } + + Row { + spacing: 20 + ProgressBar { + from: 0 + to: 100 + height: 18 + indeterminate: true + } + + ProgressBar { + from: 0 + to: 100 + indeterminate: true + formatText: "正在准备(点击终止)" + + MouseArea { + anchors.fill: parent + onClicked: { + parent.animationStop = !parent.animationStop + } + } + } + } + + Column { + spacing: 10 + IpV4LineEdit { + + } + IpV4LineEdit { + width: 300 + height: 40 + showAlert: focus + alertText: "alert tips" + } + IpV4LineEdit { + width: 300 + height: 40 + text: "10.20.52.57" + } + + Row { + spacing: 10 + IpV4LineEdit { + id: idLineEditSetValueByText + width: 300 + height: 40 + } + + Button { + text: "set IP by Text" + onClicked: idLineEditSetValueByText.text = "10.20.52.57" + } + Text { + text: idLineEditSetValueByText.text + } + } + } + } + } + + Column { + width: 340 + height: 280 + + RowLayout { + TextField { + id: nameFilter + placeholderText: qsTr("Search by name...") + Layout.fillWidth: true + onTextChanged: sortFilterModel.update() + } + + Column { + RadioButton { + id: sortByName + checked: true + text: qsTr("Sort by name") + onCheckedChanged: sortFilterModel.update() + } + RadioButton { + text: qsTr("Sort by team") + onCheckedChanged: sortFilterModel.update() + } + } + } + + SortFilterModel { + id: sortFilterModel + model: ListModel { + ListElement { name: "Alice"; team: "Crypto" } + ListElement { name: "Bob"; team: "Crypto" } + ListElement { name: "Jane"; team: "QA" } + ListElement { name: "Victor"; team: "QA" } + ListElement { name: "Wendy"; team: "Graphics" } + } + delegate: Text { + text: name + " (" + team + ")" + } + filterAcceptsItem: function(item) { + return item.name.includes(nameFilter.text) + } + lessThan: function(left, right) { + var leftVal = sortByName.checked ? left.name : left.team; + var rightVal = sortByName.checked ? right.name : right.team; + return leftVal < rightVal ? -1 : 1; + } + } + + ListView { + height: 100 + width: parent.width + model: sortFilterModel + } + } + + Column { + KeySequenceEdit { + width: 504 + height: 36 + text: "切换键盘布局" + placeholderText: "请重新输入快捷键" + keys: ["CTRL", "SHIFT"] + } + + KeySequenceEdit { + width: 504 + height: 36 + text: "关闭窗口" + placeholderText: "请重新输入快捷键" + keys: ["ALT", "F4"] + } + + KeySequenceEdit { + width: 504 + height: 36 + text: "关闭窗口" + placeholderText: "请重新输入快捷键" + } + } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_Menu.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_Menu.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_Menu.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_Menu.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,125 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.0 +import QtQuick.Layouts 1.11 +import org.deepin.dtk 1.0 + +Column { + id: control + + Row{ + Button { + text: "Normal" + onClicked: normalMenu.popup(control, Qt.point(x, height)) + } + Button { + text: "Action checkd" + onClicked: { + var action = normalMenu.actionAt(4) + action.checked = !action.checked + } + } + Button { + text: "MenuItem checkd" + onClicked: { + var item = normalMenu.itemAt(1) + item.checked = !item.checked + } + } + Button { + text: "MenuItem Add" + onClicked: { + normalMenu.addItem(menuItem.createObject(normalMenu)) + } + + Component { + id: menuItem + MenuItem { + text: "Long long text menu" + } + } + } + } + Row { + SearchEdit { + id: filterSearchEdit + placeholder: qsTr("搜索") + onTextChanged: { + objectModelFilter.update() + } + } + Button { + text: "open menu" + onClicked: searchAndArrowMenu.popup() + } + } + + Menu { + id: normalMenu +// width: 300 + header: SearchEdit { + placeholder: qsTr("搜索") + } + maxVisibleItems: 4 + MenuItem { + icon.name: "music" + text: "icon" + onTriggered: console.log("trigger", text) + } + MenuItem { + icon.name: "music" + text: "Checked" + checked: true + } + + MenuSeparator { text: "文本" } + + MenuItem { + icon.name: "music" + text: "icon right" + display: IconLabel.IconBesideText + } + Action { text: "Action" ; /*checkable: true;*/ /*checked: true*/} + + MenuSeparator { } + + Menu { + title: "ShortText menu" + Action { text: "Find Next" /*; checked: true*/} + Action { text: "Find Previous" } + Action { text: "Replace" } + Menu { + title: "three" + Action { text: "Find Next" } + Action { text: "Find Previous" } + Action { text: "Replace" } + } + } + Menu { + title: "LongText menu" + Action { text: "Find Next" } + Action { text: "Find Previous" } + Action { text: "Replace" } + } + } + + Menu { + id: searchAndArrowMenu + closePolicy: Popup.NoAutoClose + model: ObjectModelProxy { + id: objectModelFilter + filterAcceptsItem: function(item) { + return item.text.includes(filterSearchEdit.text) + } + sourceModel: searchAndArrowMenu.contentModel + } + MenuItem { text: qsTr("Greek(cp869)") } + MenuItem { text: qsTr("Cyrillic (ISO 8859-5)") } + MenuItem { text: qsTr("Cyrillic(KOI8-R)") } + MenuItem { text: qsTr("Devanagari(x-mac-davanagari)") } + MenuItem { text: qsTr("Gurmukhi(x-mac-gurmukhi)") } + MenuItem { text: qsTr("Thai (ISO 8859-11)") } + } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_Notify.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_Notify.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_Notify.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_Notify.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,67 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.0 +import QtQuick.Window 2.11 +import QtQuick.Layouts 1.11 +import org.deepin.dtk 1.0 + +Column { + id: control + + property string longMessage: "Copyright 2014-2019 Adobe (http://www.adobe.com/), with Reserved FontName 'Source'. Source is a trademark of Adobe in the United States and/or other countries." + property string shortMessage: "short message" + + Button { + text: "FloatingMessage" + property int count: 0 + onClicked: { + if (count % 2) { + DTK.sendMessage(control, "message" + count) + DTK.sendMessage(Window.window, "message" + count, "music", 4000, "type1") + DTK.sendMessage(Window.window, "message" + count, "video", -1) + } else { + DTK.sendMessage(control, floatingMsgCom, {content: shortMessage}, -1) + DTK.sendMessage(Window.window, floatingMsgCom, {content: longMessage, iconName: "music"}, -1) + } + count++ + } + } + + Component { + id: floatingMsgCom + FloatingMessage { + id: floatMsg + contentItem: RowLayout { + spacing: 0 + + Label { + Layout.fillHeight: true + Layout.fillWidth: true + text: floatMsg.message.content + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft + Layout.alignment: Qt.AlignVCenter + font: DTK.fontManager.t6 + wrapMode: Text.Wrap + elide: Text.ElideRight + maximumLineCount: 1 + } + + Button { + text: "reload" + font: DTK.fontManager.t5 + Layout.alignment: Qt.AlignVCenter + } + } +// button: Button { +// text: "close" +// onClicked: { +// console.log("close clicked") +// DTK.closeMessage(floatMsg) +// } +// } + } + } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_Popup.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_Popup.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_Popup.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_Popup.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,217 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.0 +import QtQuick.Layouts 1.11 +import QtQuick.Window 2.11 +import QtQuick.Shapes 1.10 +import org.deepin.dtk 1.0 + +Column { + id: control + + Row { + Button { + text: "popup window" + onClicked: { + // popup.x = (Screen.desktopAvailableWidth - Window.window.width) / 2 + // popup.y = (Screen.desktopAvailableHeight - Window.window.height) / 2 + + // popupWindow.width = 400 + popupWindow.open() + // popupWindow.PopupWindow.window.hide() + // Window.window.hide() + // popup.PopupWindow.window.show() + // popupWindow.PopupWindow.close() + } + // Component.onCompleted: popupWindow.open() + } + Button { + text: "change x" + onClicked: { + popupWindow.x = 500 + popupWindow.open() + } + } + Button { + text: "change width" + onClicked: { + popupWindow.width = 400 + popupWindow.open() + } + } + + Button { + text: "popup control" + onClicked: { + // popupWindow.x = (Screen.desktopAvailableWidth - Window.window.width) / 2 + // popupWindow.y = (Screen.desktopAvailableHeight - Window.window.height) / 2 + + popup.open() + } + } + } + + Row { + Button { + text: "menu control" + onClicked: { + menu.open() + } + } + + Button { + text: "menu popupWindow" + onClicked: { + menuPopup.open() + } + } + } + Button { + text: "handle forceWindowMode" + onClicked: { + popupWindow.PopupHandle.forceWindowMode = !popupWindow.PopupHandle.forceWindowMode + } + } + + Popup { + id: popupWindow; objectName: "pupup window" + visible: false + x: 100 + y: 20 +// width: 200 +// height: 100 +// width: 300 +// height: 300 +// margins: 100 + PopupHandle.forceWindowMode: true + PopupHandle.delegate: PopupWindow { + blurControl: popupWindow + } + contentItem: Column { + spacing: 10 + Text { + text: "蓝牙" + anchors.horizontalCenter: parent.horizontalCenter + } + Button { + text: "打印机" + anchors.horizontalCenter: parent.horizontalCenter + } + } + } + Popup { + id: popup; objectName: "pupup" + x: 100 + y: 20 +// margins: 100 + contentItem: Column { + spacing: 10 + Text { + text: "蓝牙" + anchors.horizontalCenter: parent.horizontalCenter + } + Button { + text: "打印机" + anchors.horizontalCenter: parent.horizontalCenter + } + } + } + Menu { + id: menu + MenuItem { text: "Text" } + } + Menu { + id: menuPopup + MenuItem { text: "Text" } + + PopupHandle.forceWindowMode: true + } + ArrowShapePopup { + id: arrow + x: 50 + y: 50 + width: 100 + height: 100 + } + + Row { + Button { + text: "Up" + onClicked: { + arrow.arrowDirection = ArrowBoxPath.Up + arrow.arrowX = arrow.width / 2 + 10 + arrow.arrowY = 10 + arrow.open() + } + } + Button { + text: "Down" + onClicked: { + arrow.arrowDirection = ArrowBoxPath.Down + arrow.arrowX = arrow.width / 2 + 10 + arrow.arrowY = arrow.height - 10 + arrow.open() + } + } + Button { + text: "Left" + onClicked: { + arrow.arrowDirection = ArrowBoxPath.Left + arrow.arrowX = 10 + arrow.arrowY = arrow.height / 2 + 10 + arrow.open() + } + } + Button { + text: "Right" + onClicked: { + arrow.arrowDirection = ArrowBoxPath.Right + arrow.arrowX = arrow.width - 10 + arrow.arrowY = arrow.height / 2 + 10 + arrow.open() + } + } + } +// Shape { +// x: 20 +// y: 20 +// ShapePath { +// fillColor: "red" +// strokeColor: "transparent" +// ArrowBoxPath { +// id: arrow +// width: 60 +// height: 150 +// arrowX: 0 +// arrowY: 0 +// arrowWidth: 50 +// arrowHeight: 30 +// roundedRadius: 8 +// spread: -5 +// } +// } +// } + +// Shape { +// x: 20 +// y: 20 +//// visible: false +// ShapePath { +// fillColor: "green" +// strokeColor: "transparent" +// ArrowBoxPath { +// width: arrow.width +// height: arrow.height +// arrowDirection: arrow.arrowDirection +// arrowX: arrow.arrowX +// arrowY: arrow.arrowY +// arrowWidth: arrow.arrowWidth +// arrowHeight: arrow.arrowHeight +// roundedRadius: arrow.roundedRadius +//// spread: 15 +// } +// } +// } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_settingsdialog.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_settingsdialog.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_settingsdialog.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_settingsdialog.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,200 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.0 +import org.deepin.dtk 1.0 +import org.deepin.dtk.settings 1.0 as Settings + +Rectangle { + border.color: "blue" + + property list __groups: [ + Settings.SettingsGroup { + key: "group1" + name: "group1" + Settings.SettingsOption { + key: "option1" + name: "option1" + Label { + text: Settings.SettingsOption.name + } + } + } + ] + + Settings.SettingsDialog { + id: settingsDialog + height: 400 + width: 680 + visible: false + config: settingsConfig + + // container.groups: [ + // Settings.SettingsGroup { + // key: "group1" + // name: "group1" + // visible: true + // Settings.SettingsOption { + // key: "option1" + // name: "option1" + // Label { + // text: Settings.SettingsOption.name + // } + // } + // } + // ] + + // container: Settings.SettingsContainer { + // id: settingsContainer + // config: settingsConfig + // navigationTitle: NavigationTitle {} + // contentTitle: ContentTitle {} + // Settings.ContentBackground: Settings.ContentBackground {} + // groups: __groups + // } + container.contentBackground: Settings.ContentBackground { + border.color: "blue" + } + + groups: [ + Settings.SettingsGroup { + key: "group1" + name: "group1" + visible: true + background: Settings.ContentBackground { + border.color: "green" + radius: 8 + } + + children: [ + Settings.SettingsGroup { + key: "group1" + name: "group1" + visible: true + background: Settings.ContentBackground { + border.color: "red" + radius: 8 + } + Settings.SettingsOption { + key: "key2" + name: "ComboBox" + Settings.ComboBox { + model: ["first", "sceond", "three"] + } + } + Settings.SettingsOption { + key: "key3" + name: "LineEdit" + Settings.LineEdit {} + } + Settings.SettingsOption { + key: "canExit" + name: "CheckBox" + Settings.CheckBox {} + } + }, + Settings.SettingsGroup { + key: "group2" + name: "group2" + children: [ + Settings.SettingsGroup { + key: "group3" + name: "group1.group2.group3" + visible: true + + Settings.SettingsOption { + key: "option1" + name: "group2.group1.option1" + Settings.OptionDelegate { + LineEdit { + text: Settings.SettingsOption.name + onEditingFinished: { + Settings.SettingsOption.value = text + } + } + } + } + } + ] + } + ] + }, + Settings.SettingsGroup { + key: "group2" + name: "group2" + children: [ + Settings.SettingsGroup { + key: "group1" + name: "group1" + visible: true + Settings.SettingsOption { + key: "option1" + name: "option1" + Label { + text: Settings.SettingsOption.name + } + } + Settings.SettingsOption { + key: "option2" + name: "option2" + LineEdit { + text: Settings.SettingsOption.name + } + } + Settings.SettingsOption { + key: "option1" + name: "option1" + ComboBox { + model: ["first", "sceond", "three"] + } + } + } + ] + }, + Settings.SettingsGroup { + key: "group3" + name: "group3" + }, + Settings.SettingsGroup { + key: "group4" + name: "group4" + } + ] + } + + Column { + width: parent.width + anchors.leftMargin: 20 + anchors.top: parent.top + anchors.topMargin: 20 + Button { + text: "showSettingsDialog" + onClicked: { + settingsDialog.show() + } + } + + Row { + ComboBox { + id: groups + model: ["group1", "group1.group1", "group2.group1"] + } + Button { + property string groupKey: groups.currentText + text: groupKey + onClicked: { + settingsDialog.container.setGroupVisible(groupKey, !settingsDialog.container.groupVisible(groupKey)) + } + } + } + } + + // Config should be loaded first + Config { + id: settingsConfig + name: "example" + subpath: "" + property string key3 : "key3 default" + } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/Example_TitleBar.qml dtkdeclarative-5.6.10/examples/qml-inspect/Example_TitleBar.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/Example_TitleBar.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/Example_TitleBar.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,75 @@ +// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.0 +import QtQuick.Window 2.11 +import QtQuick.Layouts 1.11 +import org.deepin.dtk 1.0 + +TitleBar { + id: titleBar + icon.name: "music" + title: "title custom" + + property string appProductName: Qt.application.displayName + property string appLicense: "LGPL-3.0-or-later" + +// menu: Menu { +// delegate: MenuItem { +// icon.name: "emblem-checked" +// icon.color: palette.highlight +// } +// ThemeMenu {} + +// MenuSeparator { +// contentItem: Rectangle { +// implicitHeight: 1 +// color: "black" +// } +// } +// HelpAction {} +// AboutAction {} +// QuitAction {} + +// Action { +// text: qsTr("custom action") +// } +// MenuItem { +// text: qsTr("Window State") +// onTriggered: toggleWindowState() +// } +// } + aboutDialog: AboutDialog { + productIcon: "music" + modality: Qt.NonModal + productName: qsTr(appProductName) + companyLogo: "file://" + DTK.deepinDistributionOrgLogo + websiteName: DTK.deepinWebsiteName + websiteLink: DTK.deepinWebsiteLink + description: "qml inspect is used to developer as a debug tool." + license: appLicense === "" ? "" : qsTr(String("%1 is released under %2").arg(appProductName).arg(appLicense)) + } + + embedMode: false +// separatorVisible: false + autoHideOnFullscreen: true +// menuDisabled: true + +// content: RowLayout { +// LineEdit { +// text: "label2" +// } +// LineEdit { +// text: "center" +// Layout.alignment: Qt.AlignCenter +// } +// Button { +// text: "center custom" +// Layout.alignment: Qt.AlignRight +// } +// } + + focus: true + Keys.onSpacePressed: Window.window.visibility = Window.FullScreen +} Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/examples/qml-inspect/icons/bloom/org.deepin.Example/action_add.dci and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/examples/qml-inspect/icons/bloom/org.deepin.Example/action_add.dci differ diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/main.cpp dtkdeclarative-5.6.10/examples/qml-inspect/main.cpp --- dtkdeclarative-5.6.3/examples/qml-inspect/main.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/main.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,30 @@ +// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + + QGuiApplication app(argc, argv); + app.setOrganizationName("deepin"); + app.setApplicationName("Example"); + app.setApplicationVersion("1.0.0"); + + QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon"); + QQmlApplicationEngine engine; + qputenv("D_POPUP_MODE", "embed"); + +// QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software); + engine.addImportPath(CHAMELEON_PATH); + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + if (engine.rootObjects().isEmpty()) + return -1; + + return app.exec(); +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/main.qml dtkdeclarative-5.6.10/examples/qml-inspect/main.qml --- dtkdeclarative-5.6.3/examples/qml-inspect/main.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/main.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,188 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.11 +import QtQuick.Window 2.11 +import QtQuick.Controls 2.4 as V2 +import QtQuick.Layouts 1.11 +import org.deepin.dtk 1.0 as D + +D.ApplicationWindow { + id: root + visible: true + width: 1200 + height: 700 + title: qsTr("dtkdeclarative") + x:(Screen.desktopAvailableWidth - width) / 2 + y:(Screen.desktopAvailableHeight - height) / 2 +// D.DWindow.wmWindowTypes: D.WindowManagerHelper.DesktopType + header: Example_TitleBar{} + flags: Qt.Window | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint +// D.DWindow.motifFunctions: D.DWindow.motifFunctions & ~D.WindowManagerHelper.FUNC_MINIMIZE + + // 测试D.DWindow的属性 + D.DWindow.enabled: true + D.DWindow.windowRadius: 16 + D.DWindow.borderColor: palette.highlight + D.DWindow.borderWidth: 1 + D.DWindow.alphaBufferSize: 8 + + D.FontManager { + id: font_manager + baseFont: font_manager.get(13, Qt.application.font) + onFontChanged: { + console.log("font_manager fontChanged .........."); + } + } + +// D.MessageManager.layout: Column { +// anchors { +// bottom: parent.bottom +// right: parent.right +// } +// } +// D.MessageManager.capacity: 6 +// D.MessageManager.delegate: D.FloatingMessage { +// id: floatingMsg +// iconName: "error" +// type: D.FloatingMessage.TransientType +// contentItem: V2.Label { +// verticalAlignment: Text.AlignVCenter +// horizontalAlignment: Text.AlignLeft +// text: floatingMsg.content +// elide: Text.ElideRight +// maximumLineCount: 1 +// wrapMode: Text.Wrap +// } + +// duration: 3000 +// } + + Component.onCompleted: { + console.log(D.DWindow.wmWindowTypes) + console.log(D.DWindow.enabled ? "DPlatformHandle有效" : "DPlatformHandle无效!!!!"); + console.log("hasBlurWindow : ", D.DTK.hasBlurWindow ? "true" : "false"); + console.log("windowManagerNameString : ", D.DTK.windowManagerNameString); + + // 测试系统亮暗色(枚举类型) + if (D.DTK.themeType === D.ApplicationHelper.LightType) { + console.log("themeType : Light Theme"); + } else if (D.DTK.themeType === D.ApplicationHelper.DarkType) { + console.log("themeType : Dark Theme"); + } else { + console.log("themeType : Unknown Theme"); + } + D.DTK.themeTypeChanged.connect(function() { + console.log("themeNameChanged : ", D.DTK.themeType); + }); + + if (D.DTK.windowManagerName === D.WindowManagerHelper.DeepinWM) { + console.log("windowManagerName : DeepinWM"); + } else if (D.DTK.windowManagerName === D.WindowManagerHelper.KWinWM) { + console.log("windowManagerName : KWinWM"); + } else { + console.log("windowManagerName : OtherWM"); + } + + console.log("test platformTheme info : " , D.DTK.platformTheme.window, D.DTK.platformTheme.themeName); + + //测试DPlatformThemeProxy信号传递(控制中心切换主题测试) + D.DTK.platformTheme.themeNameChanged.connect(function(themeName) { + console.log("platformTheme themeNameChanged : ", themeName); + }); + + //在控制中心修改字体大小可以看到打印输出 + D.DTK.fontManager.fontChanged.connect(function() { + console.log("base font changed ....", D.DTK.fontManager.baseFont); + }); + console.log("fontManager t1 字体信息", D.DTK.fontManager.t1); + + // 测试 D.Palette 值 + console.log("D.Palette window value: ", root.palette.window) + console.log("D.Palette windowText value: ", root.palette.windowText) + console.log("D.Palette base value: ", root.palette.base) + console.log("D.Palette itemBackground value: ", root.palette.itemBackground) + console.log("D.Palette textTitle value: ", root.palette.textTitle) + console.log("D.Palette textTips value: ", root.palette.textTips) + } + + V2.TabBar { + id: tabBar + anchors.top: root.bottom + V2.TabButton { + text: qsTr("Example_1") + } + V2.TabButton { + text: qsTr("Example_2") + } + V2.TabButton { + text: qsTr("ItemViewport") + } + V2.TabButton { + text: qsTr("Config") + } + V2.TabButton { + text: qsTr("SettingsDialog") + } + V2.TabButton { + text: qsTr("Notify") + } + V2.TabButton { + text: qsTr("ColorSelector") + } + V2.TabButton { + text: qsTr("Menu") + } + V2.TabButton { + text: qsTr("Popup") + } + V2.TabButton { + text: qsTr("Flickable") + } + } + StackLayout { + anchors.left: parent.left + anchors.right: parent.right + anchors.top: tabBar.bottom + anchors.bottom: parent.bottom + anchors.margins: 4 + + currentIndex: tabBar.currentIndex + Example_1 {} + Example_2 {} + Example_3 {} + Example_config {} + Example_settingsdialog {} + Example_Notify {} + Example_colorselector {} + Example_Menu {} + Example_Popup {} + Example_Flickable {} + } + + D.BehindWindowBlur { + anchors { + fill: parent + topMargin: parent.height - 100 + } + blendColor: Qt.rgba(1, 0, 0, 0.3) + } + + D.StyledBehindWindowBlur { + control: root + anchors { + right: parent.right + rightMargin: 100 + bottom: parent.bottom + bottomMargin: 160 + } + width: 200 + height: 200 + cornerRadius: 30 + V2.Label { + anchors.centerIn: parent + text: qsTr("WMBlur") + } + } +} diff -Nru dtkdeclarative-5.6.3/examples/qml-inspect/qml.qrc dtkdeclarative-5.6.10/examples/qml-inspect/qml.qrc --- dtkdeclarative-5.6.3/examples/qml-inspect/qml.qrc 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/examples/qml-inspect/qml.qrc 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,17 @@ + + + main.qml + Example_1.qml + Example_2.qml + Example_3.qml + Example_config.qml + Example_TitleBar.qml + Example_settingsdialog.qml + Example_Notify.qml + Example_colorselector.qml + Example_customcontrolforcs.qml + Example_Menu.qml + Example_Popup.qml + Example_Flickable.qml + + diff -Nru dtkdeclarative-5.6.3/.github/ISSUE_TEMPLATE/config.yml dtkdeclarative-5.6.10/.github/ISSUE_TEMPLATE/config.yml --- dtkdeclarative-5.6.3/.github/ISSUE_TEMPLATE/config.yml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/.github/ISSUE_TEMPLATE/config.yml 2023-04-17 09:55:26.000000000 +0000 @@ -1 +1,20 @@ -blank_issues_enabled: true +blank_issues_enabled: false +contact_links: + - name: BUG Report | 缺陷报告 + url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=bug-report.yml + about: Please create bug reports to the issue board in our dtk repo. + + - name: docs-update | 文档补充 + url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=docs-update.yml + about: Please create docs-update to the issue board in our dtk repo. + + - name: unit-test-report | 单元测试报告 + url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=unit-test-report.yml + about: Please create unit-test-report to the issue board in our dtk repo. + + - name: Feature Request | 特性请求 + url: https://github.com/linuxdeepin/developer-center/discussions/new?category=features-request-ideas-%E7%89%B9%E6%80%A7%E8%AF%B7%E6%B1%82-%E5%A4%B4%E8%84%91%E9%A3%8E%E6%9A%B4 + about: Please create feature requests to the discussion board in our developer-center repo. + - name: General Discussion & Questions | 常规讨论与问答 + url: https://github.com/linuxdeepin/developer-center/discussions/categories/q-a-%E9%97%AE%E7%AD%94%E6%9D%BF%E5%9D%97 + about: Please use the discussion board in our developer-center repo. diff -Nru dtkdeclarative-5.6.3/.github/ISSUE_TEMPLATE/empty-issue.md dtkdeclarative-5.6.10/.github/ISSUE_TEMPLATE/empty-issue.md --- dtkdeclarative-5.6.3/.github/ISSUE_TEMPLATE/empty-issue.md 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/.github/ISSUE_TEMPLATE/empty-issue.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ ---- -name: Empty issue -about: File a Empty issue -title: '' -labels: '' -assignees: '' - ---- diff -Nru dtkdeclarative-5.6.3/.github/ISSUE_TEMPLATE/unit-test-report.md dtkdeclarative-5.6.10/.github/ISSUE_TEMPLATE/unit-test-report.md --- dtkdeclarative-5.6.3/.github/ISSUE_TEMPLATE/unit-test-report.md 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/.github/ISSUE_TEMPLATE/unit-test-report.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ ---- -name: Unit test report -about: File a unit test report. -title: 'Test: [class name]' -labels: '' -assignees: '' - ---- - -Path: [class file path] -Interface: [class interface name] - diff -Nru dtkdeclarative-5.6.3/.github/workflows/call-deploy-dev-doc.yml dtkdeclarative-5.6.10/.github/workflows/call-deploy-dev-doc.yml --- dtkdeclarative-5.6.3/.github/workflows/call-deploy-dev-doc.yml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/.github/workflows/call-deploy-dev-doc.yml 2023-04-17 09:55:26.000000000 +0000 @@ -1,7 +1,12 @@ +name: deploy docs on: push: branches: ["master"] workflow_dispatch: + inputs: + tag: + required: true + type: string permissions: contents: read @@ -16,3 +21,7 @@ jobs: deploydocs: uses: linuxdeepin/.github/.github/workflows/deploy-dev-doc.yml@master + with: + ref: ${{ inputs.tag }} + secrets: + APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} diff -Nru dtkdeclarative-5.6.3/.gitignore dtkdeclarative-5.6.10/.gitignore --- dtkdeclarative-5.6.3/.gitignore 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/.gitignore 2023-04-17 09:55:26.000000000 +0000 @@ -15,9 +15,8 @@ *_plugin_import.cpp /.qmake.cache /.qmake.stash -*.pro.user +*.user *.pro.user.* -*.qbs.user *.qbs.user.* *.moc moc_*.cpp @@ -49,3 +48,15 @@ src/dtkdeclarative_config.h src/qt_lib_dtkdeclarative.pri chameleon/imports/org + +*/.vscode/* +build + +#clangd +.cache + +#vscode +.vscode + +#idea +.idea diff -Nru dtkdeclarative-5.6.3/misc/DtkDeclarativeConfig.cmake.in dtkdeclarative-5.6.10/misc/DtkDeclarativeConfig.cmake.in --- dtkdeclarative-5.6.3/misc/DtkDeclarativeConfig.cmake.in 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/DtkDeclarativeConfig.cmake.in 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,13 @@ +@PACKAGE_INIT@ +include(CMakeFindDependencyMacro) +find_dependency(DtkCore) +find_dependency(DtkGui) +find_dependency(Qt5Core) +find_dependency(Qt5Quick) +include(${CMAKE_CURRENT_LIST_DIR}/DtkDeclarativeTargets.cmake) +set(DTK_QML_APP_PLUGIN_PATH @DTK_QML_APP_PLUGIN_PATH@) +get_target_property(DtkDeclarative_INCLUDE_DIRS Dtk::Declarative INTERFACE_INCLUDE_DIRECTORIES) +get_target_property(DtkDeclarative_LIBRARY_DIRS Dtk::Declarative INTERFACE_LINK_DIRECTORIES) +set(DTKDeclarative_INCLUDE_DIR ${DtkDeclarative_INCLUDE_DIRS}) +set(DtkDeclarative_LIBRARIES Dtk::Declarative) +check_required_components(DtkCore) diff -Nru dtkdeclarative-5.6.3/misc/dtkdeclarative.pc.in dtkdeclarative-5.6.10/misc/dtkdeclarative.pc.in --- dtkdeclarative-5.6.3/misc/dtkdeclarative.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/dtkdeclarative.pc.in 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@LIB_INSTALL_DIR@ +includedir=${prefix}/@INCLUDE_INSTALL_DIR@ + +Name: DtkDeclarative +Description: Deepin Tool Kit DtkDeclarative header files +Version: @CMAKE_PROJECT_VERSION@ +Libs: -L${libdir} -ldtkdeclarative +Cflags: -I${includedir} +Requires: dtkcore dtkgui Qt5Core Qt5Gui Qt5DBus Qt5Xml Qt5Quick diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/CMakeLists.txt dtkdeclarative-5.6.10/misc/qml-app-template/CMakeLists.txt --- dtkdeclarative-5.6.3/misc/qml-app-template/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) + +project(%{ProjectName} LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(DtkDeclarative REQUIRED) + +# Application +add_subdirectory(src) diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/debian/changelog dtkdeclarative-5.6.10/misc/qml-app-template/debian/changelog --- dtkdeclarative-5.6.3/misc/qml-app-template/debian/changelog 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/debian/changelog 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,5 @@ +%{ProjectName} (0.0.1) unstable; urgency=medium + + * Initial release. + + -- Deepin Packages Builder Wed, 01 Jul 2020 14:14:35 +0800 diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/debian/compat dtkdeclarative-5.6.10/misc/qml-app-template/debian/compat --- dtkdeclarative-5.6.3/misc/qml-app-template/debian/compat 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/debian/compat 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1 @@ +9 diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/debian/control dtkdeclarative-5.6.10/misc/qml-app-template/debian/control --- dtkdeclarative-5.6.3/misc/qml-app-template/debian/control 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/debian/control 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,19 @@ +Source: %{ProjectName} +Section: admin +Priority: optional +Maintainer: Deepin Packages Builder +Build-Depends: + debhelper (>= 9), + cmake, + pkg-config, + qtdeclarative5-dev, + libdtkdeclarative-dev +Standards-Version: 3.9.8 +Homepage: http://www.deepin.org + +Package: %{ProjectName} +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Simple description + A detailed description. + diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/debian/copyright dtkdeclarative-5.6.10/misc/qml-app-template/debian/copyright --- dtkdeclarative-5.6.3/misc/qml-app-template/debian/copyright 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/debian/copyright 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,7 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: %{ProjectName} +Source: https://github.com/linuxdeepin/%{ProjectName} + +Files: * +Copyright: UnionTech Software Technology Co., Ltd. +License: LGPL-3.0-or-later diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/debian/rules dtkdeclarative-5.6.10/misc/qml-app-template/debian/rules --- dtkdeclarative-5.6.3/misc/qml-app-template/debian/rules 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/debian/rules 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,23 @@ +#!/usr/bin/%{DtkQmlAppMake} -f +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk +export QT_SELECT = qt5 + +ifneq (,$(wildcard .git/config)) + CONFIG_VERSION= +else +VERSION = $(DEB_VERSION_UPSTREAM) +_PACK_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}') +_BUILD_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0-9]//g') +ifeq ($(_BUILD_VER),) + CONFIG_VERSION = $(_PACK_VER) +else + CONFIG_VERSION = $(_PACK_VER).$(_BUILD_VER) +endif +endif + +%: + dh $@ --parallel + +override_dh_auto_configure: + dh_auto_configure -- LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) VERSION=$(CONFIG_VERSION) diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/debian/source/format dtkdeclarative-5.6.10/misc/qml-app-template/debian/source/format --- dtkdeclarative-5.6.3/misc/qml-app-template/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/debian/source/format 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1 @@ +3.0 (native) diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/CMakeLists.txt dtkdeclarative-5.6.10/misc/qml-app-template/src/CMakeLists.txt --- dtkdeclarative-5.6.3/misc/qml-app-template/src/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1) + +# 同时生成 一个 exe 和 两个 lib 三个文件 +# lib 文件包含 Preload 插件和 MainComponent 插件 +# (1) Preload 插件保证程序启动的入口。 +# (2) MainCompnent 会在加载完毕自动添加到 Preload 中 + +# Application +if (NOT CMAKE_BUILD_TYPE STREQUAL "Release") + set(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/lib") + add_definitions(-DPLUGINPATH="${LIBRARY_OUTPUT_PATH}") +endif() + +add_subdirectory(main) +add_subdirectory(preloadplugin) +add_subdirectory(maincomponentplugin) diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/main/CMakeLists.txt dtkdeclarative-5.6.10/misc/qml-app-template/src/main/CMakeLists.txt --- dtkdeclarative-5.6.3/misc/qml-app-template/src/main/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/main/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.1) + +set(APP_BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin/) +set(APP_NAME ${CMAKE_PROJECT_NAME}) +add_definitions(-DAPP_NAME="${APP_NAME}") + +###! main目录创建出二进制可执行文件,但启动方式由 DAppLoader +###! 中提供, 请不要在 main 中实现额外内容,请将需要实现的部分 +###! 移动到 preload 插件和 maincomponent 插件中。 + +# Set sources +set(SRC + main.cpp + ) + +# Find the Qt5Quick library +find_package(Qt5Quick CONFIG REQUIRED) + +# Add EXE +add_executable(${APP_NAME} ${SRC}) + +# 由于 EXE 只是作为启动程序加载 LIB 使用,一般来说,只需链接 ${LIB_NAME} 既可。 +target_link_libraries(${APP_NAME} + Qt5::Quick + Dtk::Declarative + ) + +add_definitions(-DAPP_PLUGIN_PATH=\"${DTK_QML_APP_PLUGIN_PATH}\") + +set_target_properties(${APP_NAME} PROPERTIES INSTALL_RPATH ${DTK_QML_APP_PLUGIN_PATH}) +install(TARGETS ${APP_NAME} DESTINATION ${APP_BIN_INSTALL_DIR}) +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../${CMAKE_PROJECT_NAME}.desktop" DESTINATION share/applications) diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/main/main.cpp dtkdeclarative-5.6.10/misc/qml-app-template/src/main/main.cpp --- dtkdeclarative-5.6.3/misc/qml-app-template/src/main/main.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/main/main.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include +#include + +DQUICK_USE_NAMESPACE + +int main(int argc, char *argv[]) +{ + DAppLoader appLoader("org.deepin.%{ProjectName}"); +#ifdef PLUGINPATH + appLoader.addPluginPath(PLUGINPATH); +#endif +#ifdef APP_PLUGIN_PATH + appLoader.addPluginPath(APP_PLUGIN_PATH); +#endif + return appLoader.exec(argc, argv); +} diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/maincomponentplugin/CMakeLists.txt dtkdeclarative-5.6.10/misc/qml-app-template/src/maincomponentplugin/CMakeLists.txt --- dtkdeclarative-5.6.3/misc/qml-app-template/src/maincomponentplugin/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/maincomponentplugin/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,38 @@ +cmake_minimum_required(VERSION 3.1) + +set(MAINCOMPONENT_LIB_NAME ${CMAKE_PROJECT_NAME}-main) + +###! maincomponent 中可以添加应用的第三方依赖、注册 +###! 应用的c++和qml类型、进行耗时计算和加载等等。 +###! 但为了最大程度的启动(创建)组件,请保证在 main.qml +###! 中 AppLoader 结构的正确性,将互相独立的组件独立成 +###! 不同的 Component 进行并发加载。 + +# Set sources +set(MAINCOMPONENNT_SRC + maincomponentplugin.cpp + ) + +# Find the Qt5Quick library +find_package(Qt5Quick CONFIG REQUIRED) +find_package(Qt5QuickCompiler REQUIRED) + +qtquick_compiler_add_resources(MAINCOMPONENT_RCC_SOURCES maincomponent.qrc) + +# 保证 maincomponentplugin 目录下头文件全局可见 +include_directories(src/maincomponentplugin) + +# Add LIB +add_library(${MAINCOMPONENT_LIB_NAME} SHARED + ${MAINCOMPONENNT_SRC} + ${MAINCOMPONENT_RCC_SOURCES} + ) + +# 由于 LIB 程序为本项目的功能实现部分,需要用到的第三方库都需要在此处添加。 +target_link_libraries(${MAINCOMPONENT_LIB_NAME} + Qt5::Quick + Dtk::Declarative + ) + +# Add install rule +install(TARGETS ${MAINCOMPONENT_LIB_NAME} DESTINATION ${DTK_QML_APP_PLUGIN_PATH}) diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/maincomponentplugin/maincomponentplugin.cpp dtkdeclarative-5.6.10/misc/qml-app-template/src/maincomponentplugin/maincomponentplugin.cpp --- dtkdeclarative-5.6.3/misc/qml-app-template/src/maincomponentplugin/maincomponentplugin.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/maincomponentplugin/maincomponentplugin.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "maincomponentplugin.h" + +#include + +DQUICK_USE_NAMESPACE + +MainComponentPlugin::MainComponentPlugin(QObject *parent) + : QObject(parent) +{ + +} + +MainComponentPlugin::~MainComponentPlugin() +{ + +} + +QUrl MainComponentPlugin::mainComponentPath() const +{ + // 返回程序的主控件部分 qml 文件,请确保该文件存在 + return QUrl("qrc:///main.qml"); +} diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/maincomponentplugin/maincomponentplugin.h dtkdeclarative-5.6.10/misc/qml-app-template/src/maincomponentplugin/maincomponentplugin.h --- dtkdeclarative-5.6.3/misc/qml-app-template/src/maincomponentplugin/maincomponentplugin.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/maincomponentplugin/maincomponentplugin.h 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef MAINCOMPONENTPLUGIN_H +#define MAINCOMPONENTPLUGIN_H + +#include + +class QQmlComponent; +class MainComponentPlugin : public QObject, public DTK_QUICK_NAMESPACE::DQmlAppMainWindowInterface +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID DQmlAppMainWindowInterface_iid FILE "plugin.json") + Q_INTERFACES(DTK_QUICK_NAMESPACE::DQmlAppMainWindowInterface) +public: + MainComponentPlugin(QObject *parent = nullptr); + ~MainComponentPlugin() override; + + QUrl mainComponentPath() const override; +}; + +#endif // MAINCOMPONENTPLUGIN_H diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/maincomponentplugin/maincomponent.qrc dtkdeclarative-5.6.10/misc/qml-app-template/src/maincomponentplugin/maincomponent.qrc --- dtkdeclarative-5.6.3/misc/qml-app-template/src/maincomponentplugin/maincomponent.qrc 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/maincomponentplugin/maincomponent.qrc 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,5 @@ + + + main.qml + + diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/maincomponentplugin/main.qml dtkdeclarative-5.6.10/misc/qml-app-template/src/maincomponentplugin/main.qml --- dtkdeclarative-5.6.3/misc/qml-app-template/src/maincomponentplugin/main.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/maincomponentplugin/main.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,74 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.11 +import QtQuick.Controls 2.4 +import org.deepin.dtk 1.0 + +/** + AppLoader 用于动态创建组件,它在 Preaload 创建显示 + 出来后再进行创建操作,并将创建出来的组件放置在 Preload 的 + 窗口内部。开发过程过不需要处理 AppLoader 的处理过程,对于 + 需要使用到 Window 属性的情况,请使用其属性 AppLoader.window。 + + AppLoader 中请将相互独立的组件放置在不同 Component + 中,将相互引用的组件放在在一个 Component 内,将全局属性或 + 者创建逻辑不需要太复杂的控件放置在 AppLoader 的全局区域。 + + AppLoader 能够配合 Loader 等动态创建的控件一起使用, + 在使用时,Loader 的 active 属性可以配合 AppLoader 的 + loaded 属性达到控件加载先后顺序的效果。 + */ +AppLoader { + Component { + Row { + anchors.top: parent.top + anchors.topMargin: 20 + anchors.horizontalCenter: parent.horizontalCenter + width: 500 + height: 50 + spacing: 5 + + Repeater { + id: repeater + model: 10 + Rectangle { + color: (index == 0 || index == repeater.count - 1) ? "blue" : "cyan" + width: 50 + height: 50 + radius: Style.control.radius + } + } + } + } + + Component { + Button { + anchors.centerIn: parent + text: qsTr("Button") + } + } + + Component { + Row { + anchors.bottom: parent.bottom + anchors.bottomMargin: 20 + anchors.horizontalCenter: parent.horizontalCenter + width: 500 + height: 50 + spacing: 5 + + Repeater { + id: repeater + model: 10 + Rectangle { + color: (index == 0 || index == repeater.count - 1) ? "red" : "cyan" + width: 50 + height: 50 + radius: Style.control.radius + } + } + } + } +} diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/preloadplugin/CMakeLists.txt dtkdeclarative-5.6.10/misc/qml-app-template/src/preloadplugin/CMakeLists.txt --- dtkdeclarative-5.6.3/misc/qml-app-template/src/preloadplugin/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/preloadplugin/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.1) + +set(PRELOAD_LIB_NAME ${CMAKE_PROJECT_NAME}-preload) + +###! 请确保 preloadplugin 下仅依赖最少的三方内容, +###! 且不做额外的复杂操作,将第三方库和自定义类型放在 +###! maincomponentplugin 中,保证程序能够快速启动。 +# Set sources +set(PRELOAD_SRC + preloadplugin.cpp + ) + +# Find the Qt5Quick library +find_package(Qt5Quick CONFIG REQUIRED) +find_package(Qt5QuickCompiler REQUIRED) + +qtquick_compiler_add_resources(PRELOAD_RCC_SOURCES preload.qrc) + +# 保证 preloadplugin 目录下头文件全局可见 +include_directories(src/preloadplugin) + +# Add LIB +add_library(${PRELOAD_LIB_NAME} SHARED + ${PRELOAD_SRC} + ${PRELOAD_RCC_SOURCES} + ) + +# 由于 LIB 程序为本项目的功能实现部分,需要用到的第三方库都需要在此处添加。 +target_link_libraries(${PRELOAD_LIB_NAME} + Qt5::Quick + Dtk::Declarative + ) + +# Add install rule +install(TARGETS ${PRELOAD_LIB_NAME} DESTINATION ${DTK_QML_APP_PLUGIN_PATH}) diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/preloadplugin/preloadplugin.cpp dtkdeclarative-5.6.10/misc/qml-app-template/src/preloadplugin/preloadplugin.cpp --- dtkdeclarative-5.6.3/misc/qml-app-template/src/preloadplugin/preloadplugin.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/preloadplugin/preloadplugin.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "preloadplugin.h" + +#include + +DQUICK_USE_NAMESPACE + +PreloadPlugin::PreloadPlugin(QObject *parent) + : QObject(parent) +{ + +} + +PreloadPlugin::~PreloadPlugin() +{ + +} + +QUrl PreloadPlugin::preloadComponentPath() const +{ + // 预览组件的 qml 路径 + return QUrl("qrc:///Preload.qml"); +} diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/preloadplugin/preloadplugin.h dtkdeclarative-5.6.10/misc/qml-app-template/src/preloadplugin/preloadplugin.h --- dtkdeclarative-5.6.3/misc/qml-app-template/src/preloadplugin/preloadplugin.h 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/preloadplugin/preloadplugin.h 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef PRELOADPLUGIN_H +#define PRELOADPLUGIN_H + +#include + +class QQmlComponent; +class PreloadPlugin : public QObject, public DTK_QUICK_NAMESPACE::DQmlAppPreloadInterface +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID DQmlAppPreloadInterface_iid FILE "plugin.json") + Q_INTERFACES(DTK_QUICK_NAMESPACE::DQmlAppPreloadInterface) +public: + PreloadPlugin(QObject *parent = nullptr); + ~PreloadPlugin() override; + + virtual QUrl preloadComponentPath() const override; +}; + +#endif // PRELOADPLUGIN_H diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/preloadplugin/Preload.qml dtkdeclarative-5.6.10/misc/qml-app-template/src/preloadplugin/Preload.qml --- dtkdeclarative-5.6.3/misc/qml-app-template/src/preloadplugin/Preload.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/preloadplugin/Preload.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,55 @@ +// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.11 +import QtQuick.Controls 2.4 +import QtQuick.Window 2.0 +import org.deepin.dtk 1.0 +import "." + +/** + Preload 作为程序的主窗口被 AppLoader 提前加载,用于达到快速 + 启动的功能。 在使用时,可以配合 DWindow 的 overlayExited属性, + 进行流畅化动画设计。 + + Preload 中可以使用 ApplicationWindow; Window 和 DialogWindow + 作为主窗口,但请注意,每个程序只有一个 Preload 入口,而这个 Preload 入口 + 将作为程序的主界面显示,当程序存在多个 Window 窗口时,请将主窗口作为 Preload + 窗口。 + + Preload 中 loadingOverlay 作为流畅化过渡的组件属性,请不要在程序加载 + 完成之后使用它,也不要管理它的生命周期,其生命周期仅会在窗口过渡阶段。 loadingOverlay + 属性除了可以使用一般控件之外,也能使用静态图,动态图等内容。当不指定其大小和位置时, + 默认情况进行主窗口填充。当指定大小后,将按照控件大小和位置进行布局。 + */ +ApplicationWindow { + id: window + visible: true + width: 900 + height: 700 + title: qsTr("qml-demo") + flags: Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint + header: TitleBar {} + + DWindow.enabled: true + DWindow.loadingOverlay: Rectangle { + color: palette.window + BusyIndicator { + id: indicator + anchors.centerIn: parent + running: true + width: 64 + height: 64 + } + } + + DWindow.overlayExited: Transition { + NumberAnimation { + properties: "scale" + from: 1 + to: 0 + easing.type: Easing.InBack + } + } +} diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/src/preloadplugin/preload.qrc dtkdeclarative-5.6.10/misc/qml-app-template/src/preloadplugin/preload.qrc --- dtkdeclarative-5.6.3/misc/qml-app-template/src/preloadplugin/preload.qrc 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/src/preloadplugin/preload.qrc 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,5 @@ + + + Preload.qml + + diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/template.desktop dtkdeclarative-5.6.10/misc/qml-app-template/template.desktop --- dtkdeclarative-5.6.3/misc/qml-app-template/template.desktop 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/template.desktop 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=%{ProjectName} +Exec=/usr/bin/%{ProjectName} +X-Deepin-TurboType=dtkqml diff -Nru dtkdeclarative-5.6.3/misc/qml-app-template/wizard.json dtkdeclarative-5.6.10/misc/qml-app-template/wizard.json --- dtkdeclarative-5.6.3/misc/qml-app-template/wizard.json 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qml-app-template/wizard.json 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,164 @@ +{ + "version": 1, + "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject"], + "id": "A.Dtk QtQuick Application", + "category": "F.Project", + "trDescription": "Creates a Dtk QtQuick Application for UOS.", + "trDisplayName": "Dtk QtQuick Application", + "trDisplayCategory": "Dtk QML Application", + "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ], + "options": + [ + { "key": "DtkQmlAppMake", "value": "make" }, + { "key": "ProjectFile", "value": "%{CMakeFile}" }, + { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, + { "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.QtQuickVersion}" }, + { "key": "QtQuickWindowVersion", "value": "%{JS: %{QtVersion}.QtQuickWindowVersion}" }, + { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: %{QtVersion}.QtQuickVirtualKeyboardImport}" }, + { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, + { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0 || [ %{Plugins} ].indexOf('Boot2QtQdb') >= 0}" }, + { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" } + ], + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project" + }, + { + "trDisplayName": "Define Project Details", + "trShortTitle": "Details", + "typeId": "Fields", + "data": + [ + { + "name": "QtVersion", + "trDisplayName": "Minimal required Qt version:", + "type": "ComboBox", + "data": + { + "index": 3, + "items": + [ + { + "trKey": "Qt 5.12", + "value": + "({ + 'QtQuickVersion': '2.12', + 'QtQuickWindowVersion': '2.12', + 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' + })" + }, + { + "trKey": "Qt 5.11", + "value": + "({ + 'QtQuickVersion': '2.11', + 'QtQuickWindowVersion': '2.11', + 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' + })" + }, + { + "trKey": "Qt 5.10", + "value": + "({ + 'QtQuickVersion': '2.10', + 'QtQuickWindowVersion': '2.10', + 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' + })" + }, + { + "trKey": "Qt 5.9", + "value": + "({ + 'QtQuickVersion': '2.9', + 'QtQuickWindowVersion': '2.2', + 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.2' + })" + }, + { + "trKey": "Qt 5.8", + "value": + "({ + 'QtQuickVersion': '2.8', + 'QtQuickWindowVersion': '2.2', + 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' + })" + }, + { + "trKey": "Qt 5.7", + "value": + "({ + 'QtQuickVersion': '2.7', + 'QtQuickWindowVersion': '2.2', + 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' + })" + }, + { + "trKey": "Qt 5.6", + "value": + "({ + 'QtQuickVersion': '2.6', + 'QtQuickWindowVersion': '2.2', + 'QtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 2.0' + })" + } + ] + } + }, + { + "name": "UseVirtualKeyboard", + "trDisplayName": "Use Qt Virtual Keyboard", + "type": "CheckBox", + "data": + { + "checked": "false" + } + } + ] + }, + { + "trDisplayName": "Kit Selection", + "trShortTitle": "Kits", + "typeId": "Kits", + "enabled": "%{JS: ! %{IsSubproject}}", + "data": { "projectFilePath": "%{ProjectFile}" }, + "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ] + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": + [ + { + "typeId": "File", + "data": + [ + { + "source": "./CMakeLists.txt", + "target": "CMakeLists.txt", + "openAsProject": true + }, + { + "source": "./src" + }, + { + "source": "./template.desktop", + "target": "./%{ProjectName}.desktop" + }, + { + "source": "./debian" + }, + { + "source": "../../git.ignore", + "target": ".gitignore", + "condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + } + ] + } + ] +} diff -Nru dtkdeclarative-5.6.3/misc/qt_lib_dtkdeclarative.pri.in dtkdeclarative-5.6.10/misc/qt_lib_dtkdeclarative.pri.in --- dtkdeclarative-5.6.3/misc/qt_lib_dtkdeclarative.pri.in 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/misc/qt_lib_dtkdeclarative.pri.in 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,13 @@ +QT.dtkdeclarative.VERSION = @CMAKE_PROJECT_VERSION@ +QT.dtkdeclarative.MAJOR_VERSION = @PROJECT_VERSION_MAJOR@ +QT.dtkdeclarative.MINOR_VERSION = @PROJECT_VERSION_MINOR@ +QT.dtkdeclarative.PATCH_VERSION = @PROJECT_VERSION_PATCH@ +QT.dtkdeclarative.name = dtkdeclarative +QT.dtkdeclarative.module = dtkdeclarative +QT.dtkdeclarative.libs = @CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@ +QT.dtkdeclarative.includes = @CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_DIR@ +QT.dtkdeclarative.frameworks = +QT.dtkdeclarative.depends = core dbus xml gui dtkcore dtkgui quick quick_private +QT.dtkdeclarative.module_config = v2 ltcg +QT.dtkdeclarative.DEFINES = +QT_MODULES += diff -Nru dtkdeclarative-5.6.3/.obs/workflows.yml dtkdeclarative-5.6.10/.obs/workflows.yml --- dtkdeclarative-5.6.3/.obs/workflows.yml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/.obs/workflows.yml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,51 @@ +test_build: + steps: + - link_package: + source_project: deepin:Develop:dde + source_package: %{SCM_REPOSITORY_NAME} + target_project: deepin:CI + + - configure_repositories: + project: deepin:CI + repositories: + - name: deepin_develop + paths: + - target_project: deepin:CI + target_repository: deepin_develop + architectures: + - x86_64 + - aarch64 + + - name: debian + paths: + - target_project: deepin:CI + target_repository: debian_sid + architectures: + - x86_64 + + - name: archlinux + paths: + - target_project: deepin:CI + target_repository: archlinux + architectures: + - x86_64 + + filters: + event: pull_request + +tag_build: + steps: + - branch_package: + source_project: deepin:Develop:dde + source_package: %{SCM_REPOSITORY_NAME} + target_project: deepin:Unstable:dde + filters: + event: tag_push + +commit_build: + steps: + - trigger_services: + project: deepin:Develop:dde + package: %{SCM_REPOSITORY_NAME} + filters: + event: push diff -Nru dtkdeclarative-5.6.3/qmlplugin/CMakeLists.txt dtkdeclarative-5.6.10/qmlplugin/CMakeLists.txt --- dtkdeclarative-5.6.3/qmlplugin/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/qmlplugin/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,37 @@ +set(URI "org/deepin/dtk") +set(PLUGIN_INSTALL_DIR "${QML_INSTALL_DIR}/${URI}") +set(PLUGIN_NAME dtkdeclarativeplugin) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/plugins/${URI}") + + +add_library(${PLUGIN_NAME} SHARED + ${CMAKE_CURRENT_LIST_DIR}/qmlplugin_plugin.cpp + ${CMAKE_CURRENT_LIST_DIR}/qmlplugin_plugin.h + ${CMAKE_CURRENT_LIST_DIR}/qmldir +) + +find_package(Qt5 REQUIRED COMPONENTS Core Qml Quick) +find_package(Dtk REQUIRED COMPONENTS Core Gui) + +target_link_libraries(${PLUGIN_NAME} PRIVATE + Qt5::Qml + Qt5::QmlPrivate + Qt5::Quick + Qt5::QuickPrivate + Dtk::Core + Dtk::Gui + ${LIB_NAME} +) + +set(QML_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/qmldir") +# copy qmldir +add_custom_command(TARGET ${PLUGIN_NAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E + copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/qmldir" #in-file + "${QML_DIR}" #out-file +) + +install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR}) +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/qmldir" DESTINATION ${PLUGIN_INSTALL_DIR}) diff -Nru dtkdeclarative-5.6.3/qmlplugin/qmlplugin_plugin.cpp dtkdeclarative-5.6.10/qmlplugin/qmlplugin_plugin.cpp --- dtkdeclarative-5.6.3/qmlplugin/qmlplugin_plugin.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/qmlplugin/qmlplugin_plugin.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -341,6 +341,9 @@ dtkSettingsRegisterType(settingsUri, nullptr, 1, 0, "ContentTitle"); dtkSettingsRegisterType(settingsUri, nullptr, 1, 0, "ContentBackground"); + // for org.deepin.dtk.private + dtkRegisterType(privateUri, implUri, 1, 0, "ButtonPanel"); + // for custom type QMetaType::registerConverter(convertColorToQuickColorType); QMetaType::registerConverter(convertColorToDColorType); diff -Nru dtkdeclarative-5.6.3/qmlplugin/qmlplugin.pro dtkdeclarative-5.6.10/qmlplugin/qmlplugin.pro --- dtkdeclarative-5.6.3/qmlplugin/qmlplugin.pro 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/qmlplugin/qmlplugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -TEMPLATE = lib -TARGET = dtkdeclarativeplugin -QT += qml quick dtkcore dtkgui quick-private - -unix: LIBS += -L$$OUT_PWD/../src -ldtkdeclarative - -CONFIG(debug, debug|release) { - unix: QMAKE_RPATHDIR += $$OUT_PWD/../src -} - -CONFIG += plugin c++11 - -TARGET = $$qtLibraryTarget($$TARGET) -uri = org.deepin.dtk - -INCLUDEPATH += $$PWD/../src - -# Input -SOURCES += \ - qmlplugin_plugin.cpp - -HEADERS += \ - qmlplugin_plugin.h - -DISTFILES = qmldir - -!equals(_PRO_FILE_PWD_, $$OUT_PWD) { - copy_qmldir.target = $$_PRO_FILE_PWD_/../chameleon/imports//$$replace(uri, \\., /)/qmldir - copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir - copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" - QMAKE_EXTRA_TARGETS += copy_qmldir - PRE_TARGETDEPS += $$copy_qmldir.target -} - -qmldir.files = qmldir -unix { - installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) - qmldir.path = $$installPath - target.path = $$installPath - INSTALLS += target qmldir -} - -DESTDIR += $$_PRO_FILE_PWD_/../chameleon/imports/$$replace(uri, \\., /) diff -Nru dtkdeclarative-5.6.3/README.md dtkdeclarative-5.6.10/README.md --- dtkdeclarative-5.6.3/README.md 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/README.md 2023-04-17 09:55:26.000000000 +0000 @@ -8,7 +8,12 @@ 4. **Unified widget theme style** 5. **Abundant effects and colors** -[中文文档](README_zh_CN.md) +[中文介绍](README.zh_CN.md) + +## Document + +[dtkdeclarative 中文文档](https://linuxdeepin.github.io/dtkdeclarative/index.html) + ## Dependencies @@ -25,8 +30,6 @@ + qtdeclarative5-private-dev + qtbase5-private-dev -## Installation - ### Build from source 1. Please make sure that all dependencies are installed @@ -53,9 +56,15 @@ ## Getting Involved -We encourage you to report issues and contribute changes +Any usage issues can ask for help via -+ [Contribution guide for developers](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers-en)(English) +* [Telegram group](https://t.me/deepin) +* [Matrix](https://matrix.to/#/#deepin-community:matrix.org) +* [IRC (libera.chat)](https://web.libera.chat/#deepin-community) +* [Forum](https://bbs.deepin.org) +* [WiKi](https://wiki.deepin.org/) + If you find a definite bug, you can raise it by way of an issue and we will fix it as soon as possible. + If you have some development skills, you are welcome to submit a PR. ## License diff -Nru dtkdeclarative-5.6.3/README.zh_CN.md dtkdeclarative-5.6.10/README.zh_CN.md --- dtkdeclarative-5.6.3/README.zh_CN.md 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/README.zh_CN.md 2023-04-17 09:55:26.000000000 +0000 @@ -8,7 +8,11 @@ 4. **统一的控件主题风格** 5. **丰富的特效和色彩** -![img](./docs/introduce.png) +![img](./docs/images/introduction.png) + +## 文档 + ++ [dtkdeclarative 中文文档](https://linuxdeepin.github.io/dtkdeclarative/index.html) ## 依赖 @@ -25,8 +29,6 @@ + qtdeclarative5-private-dev + qtbase5-private-dev -## 安装 - ### 构建过程 1. 确保所有依赖安装完成 @@ -48,8 +50,14 @@ ## 帮助 -+ 遇到使用问题,可直接提出 issue -+ 在 [Deepin社区](https://bbs.deepin.org/)寻求帮助 +任何使用问题都可以通过以下方式寻求帮助: + +* [Telegram 群组](https://t.me/deepin) +* [Matrix](https://matrix.to/#/#deepin-community:matrix.org) +* [IRC (libera.chat)](https://web.libera.chat/#deepin-community) +* [Forum](https://bbs.deepin.org) +* [WiKi](https://wiki.deepin.org/) +如果你发现一个确定的bug,可以通过issue的方式提出,我们会尽快修复。如果你有一定的开发能力,欢迎提交PR。 ## 贡献指南 diff -Nru dtkdeclarative-5.6.3/.reuse/dep5 dtkdeclarative-5.6.10/.reuse/dep5 --- dtkdeclarative-5.6.3/.reuse/dep5 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/.reuse/dep5 2023-04-17 09:55:26.000000000 +0000 @@ -34,7 +34,7 @@ License: CC-BY-4.0 # ci -Files: .github/* *.yml *.yaml +Files: .github/* *.yml *.yaml .obs/* Copyright: None License: CC0-1.0 @@ -54,14 +54,14 @@ License: CC0-1.0 # cmake -Files: *.cmake *CMakeLists.txt +Files: *.cmake *CMakeLists.txt *.in Copyright: None License: CC0-1.0 # docs -Files: doc/* -Copyright: None -License: CC0-1.0 +Files: docs/* +Copyright: 2022-2023 deepin doc doc go SIG +License: CC-BY-4.0 #image Files: *.jpg *.png *.gif @@ -72,4 +72,3 @@ Files: *.ts .tx/* Copyright: None License: CC0-1.0 - diff -Nru dtkdeclarative-5.6.3/src/CMakeLists.txt dtkdeclarative-5.6.10/src/CMakeLists.txt --- dtkdeclarative-5.6.3/src/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/src/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,95 @@ +set(DTK_QML_APP_PLUGIN_PATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${LIB_NAME}/qml-app" CACHE STRING "dtk qml app plugin path") +set(DTK_QML_APP_PLUGIN_SUBPATH "dtkdeclarative/plugins" CACHE STRING "dtk qml app plugin subpath") +set(DDECLARATIVE_TRANSLATIONS_DIR "dtk5/DDeclarative/translations" CACHE STRING "DDeclarative translations directory") +set(DDECLARATIVE_TRANSLATIONS_PATH "share/${DDECLARATIVE_TRANSLATIONS_DIR}") +set(TRANSLATIONS_INSTALL_PATH "${DDECLARATIVE_TRANSLATIONS_PATH}") + +# Add secure compiler options +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all") +set(CMAKE_EXE_LINKER_FLAGS "-z relro -z now -z noexecstack -pie") +# For mips64 +if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips64") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -ftree-vectorize -march=loongson3a -mhard-float -mno-micromips -mno-mips16 -flax-vector-conversions -mloongson-ext2 -mloongson-mmi") +endif() + +find_package(Qt5 REQUIRED COMPONENTS Core Quick QuickCompiler DBus QuickControls2 LinguistTools) +find_package(Dtk REQUIRED COMPONENTS Core Gui) + +file(GLOB PUBLIC_HEADERS "./*.h") +file(GLOB_RECURSE HEADERS "./*.h") +file(GLOB_RECURSE SRCS "./*.cpp") +file(GLOB D_HEADERS "./D*") +file(GLOB QML_RCS ${CMAKE_CURRENT_LIST_DIR}/dtkdeclarative_qml.qrc) +file(GLOB ASSETS_RCS ${CMAKE_CURRENT_LIST_DIR}/dtkdeclarative_assets.qrc) +file(GLOB TS_FILES "translations/*.ts") +# Quick compiler gen qmlc +qtquick_compiler_add_resources(RESOURCES ${QML_RCS}) +# qtquick_compiler_add_resources(ASSETS_RESOURCES ${ASSETS_RCS}) +# Add translation source file +qt5_add_translation(QM_FILES ${TS_FILES}) + +add_library(${LIB_NAME} SHARED + ${SRCS} + ${HEADERS} + ${D_HEADERS} + ${QML_RCS} + ${ASSETS_RCS} + ${QM_FILES} +) + +set_target_properties(${LIB_NAME} PROPERTIES + VERSION ${CMAKE_PROJECT_VERSION} + SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR} + EXPORT_NAME Declarative +) + +target_compile_definitions(${LIB_NAME} PRIVATE + DTK_QML_APP_PLUGIN_PATH="${DTK_QML_APP_PLUGIN_PATH}" + DTK_QML_APP_PLUGIN_SUBPATH="${DTK_QML_APP_PLUGIN_SUBPATH}" + DDECLARATIVE_TRANSLATIONS_DIR="${DDECLARATIVE_TRANSLATIONS_DIR}" +) + +if(USE_QQuickStylePluginPrivate) + target_link_libraries(${LIB_NAME} PRIVATE + Qt5::QuickControls2Private + ) +endif() + +target_link_libraries(${LIB_NAME} +PUBLIC + Qt5::Core + Qt5::Quick + Dtk::Core + Dtk::Gui +PRIVATE + Qt5::QuickPrivate + Qt5::DBus +) + +target_include_directories(${LIB_NAME} PUBLIC + $ +) + +target_include_directories(${LIB_NAME} INTERFACE + $ +) + +target_link_directories(${LIB_NAME} INTERFACE + $ + $ +) + +# gen dtkdeclarative_config.h +include(DtkBuildConfig) +set(options MSG) # print MODULE_NAME D_HEADERS DEST_DIR +gen_dtk_config_header(MODULE_NAME ${LIB_NAME} HEADERS ${D_HEADERS}) + +# Install library +install(TARGETS ${LIB_NAME} EXPORT DtkDeclarativeTargets DESTINATION "${LIB_INSTALL_DIR}") +# Install headers +install(FILES ${PUBLIC_HEADERS} ${D_HEADERS} DESTINATION "${INCLUDE_INSTALL_DIR}") +# Install export targets +install(EXPORT DtkDeclarativeTargets NAMESPACE Dtk:: FILE DtkDeclarativeTargets.cmake DESTINATION "${CONFIG_INSTALL_DIR}") +# Install translations +install(FILES ${QM_FILES} DESTINATION "${TRANSLATIONS_INSTALL_PATH}") diff -Nru dtkdeclarative-5.6.3/src/dapploader.cpp dtkdeclarative-5.6.10/src/dapploader.cpp --- dtkdeclarative-5.6.3/src/dapploader.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/dapploader.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -513,7 +513,11 @@ d->engine = new QQmlApplicationEngine(this); auto graphics = d->preloadInstance->graphicsApi(); if (graphics == QSGRendererInterface::Unknown) { +#if defined __aarch64__ + const char *renderName = reinterpret_cast(glGetString(GL_RENDERER)); +#else const char *renderName = reinterpret_cast(glGetString(GL_RENDER)); +#endif if (renderName) { if (renderName != QByteArrayLiteral("LLVMPIPE") || renderName != QByteArrayLiteral("SWRAST")) Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/src/icons/bloom/slider_point_down.dci and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/src/icons/bloom/slider_point_down.dci differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/src/icons/bloom/slider_point_left.dci and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/src/icons/bloom/slider_point_left.dci differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/src/icons/bloom/slider_point_up.dci and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/src/icons/bloom/slider_point_up.dci differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/src/icons/bloom/slider_round_hor.dci and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/src/icons/bloom/slider_round_hor.dci differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/src/icons/bloom/slider_round_ver.dci and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/src/icons/bloom/slider_round_ver.dci differ Binary files /tmp/tmp97osq61n/Upot1om4IQ/dtkdeclarative-5.6.3/src/icons/bloom/switch_button.dci and /tmp/tmp97osq61n/miE6OtsztW/dtkdeclarative-5.6.10/src/icons/bloom/switch_button.dci differ diff -Nru dtkdeclarative-5.6.3/src/private/dblurimagenode.cpp dtkdeclarative-5.6.10/src/private/dblurimagenode.cpp --- dtkdeclarative-5.6.3/src/private/dblurimagenode.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/private/dblurimagenode.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -575,8 +575,7 @@ GLuint prevFbo = 0; context->functions()->glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *)&prevFbo); - if (prevFbo != targetFBO->handle()) - targetFBO->bind(); + targetFBO->bind(); QOpenGLFunctions *f = context->functions(); shader->bind(); @@ -616,9 +615,10 @@ f->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glDisable(GL_TEXTURE_2D); shader->release(); + targetFBO->release(); if (prevFbo != targetFBO->handle()) - context->functions()->glBindFramebuffer(GL_FRAMEBUFFER, prevFbo); + f->glBindFramebuffer(GL_FRAMEBUFFER, prevFbo); } void DOpenGLBlurEffectNode::applyNoise(GLuint sourceTexture, const QSGRenderNode::RenderState *state) diff -Nru dtkdeclarative-5.6.3/src/private/dquickcontrolpalette.cpp dtkdeclarative-5.6.10/src/private/dquickcontrolpalette.cpp --- dtkdeclarative-5.6.3/src/private/dquickcontrolpalette.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/private/dquickcontrolpalette.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -152,7 +152,7 @@ { public: CustomMetaObject(DQuickControlColorSelector *obj) - : QQmlOpenMetaObject(obj, new QQmlOpenMetaObjectType(obj->metaObject(), qmlEngine(obj))) + : QQmlOpenMetaObject(obj, new QQmlOpenMetaObjectType(obj->metaObject(), qmlEngine(obj->parent()))) { } @@ -192,7 +192,7 @@ } int metaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a) override { - if (_c == QMetaObject::ResetProperty) { + if (_c == QMetaObject::ResetProperty && _id >= propertyOffset()) { auto ownerObject = owner()->parent(); const QByteArray &proName = name((_id - propertyOffset())); int itemPropertyIndex = ownerObject->metaObject()->indexOfProperty(proName); @@ -213,7 +213,7 @@ if (builder.hasNotifySignal()) { int slotIndex = owner()->metaObject()->indexOfSlot(COLORPROPERTYCHANGEFUNC); if (slotIndex != -1) - QMetaObject::connect(owner(), type()->signalOffset() + id, owner(), slotIndex, Qt::UniqueConnection); + QMetaObject::connect(object(), type()->signalOffset() + id, owner(), slotIndex, Qt::UniqueConnection); } return QQmlOpenMetaObject::propertyCreated(id, builder); } @@ -233,6 +233,30 @@ } QQmlOpenMetaObject::propertyRead(id); } + + // Because set true for QQmlOpenMetaObject::setCached, the DQuickControlColorSelector's + // QQmlPropertyCache in QQmlData is from the QQmlOpenMetaObject. The QQmlData::propertyCache + // is released in QQmlOpenMetaObject::createProperty, If we not reset it to owner()->m_propertyCache, + // It's will reset by QQmlMetaTypeData::propertyCache's caller(qQmlPropertyCacheProperty), in Qt5, + // the QQmlMetaTypeData will store the QQmlOpenMetaObject to QQmlMetaTypeData::propertyCaches for + // a DynamicMetaObject(QQmlOpenMetaObject), and not update QQmlData::propertyCache when create new + // property in QQmlOpenMetaObject, this is a bug, so we must ensure the QQmlData::propertyCache awlays + // from QQmlOpenMetaObject. + int createProperty(const char *name, const char *data) override { + QQmlData *qmldata = QQmlData::get(owner()); + QQmlPropertyCache *cache = qmldata ? qmldata->propertyCache : nullptr; + Q_ASSERT(!cache || cache == owner()->m_propertyCache); + + int ret = QQmlOpenMetaObject::createProperty(name, data); + if (qmldata && qmldata->propertyCache != cache) { + Q_ASSERT(!qmldata->propertyCache); // It's released in QQmlOpenMetaObject::createProperty + // Ensure QQmlOpenMetaObject::setCached always take effect + qmldata->propertyCache = owner()->m_propertyCache; + qmldata->propertyCache->addref(); + } + + return ret; + } }; DQuickControlColorSelector::DQuickControlColorSelector(QQuickItem *parent) @@ -731,7 +755,7 @@ bool shouldInverseColor = false; do { if (disabled) { - targetColor = palette->colors.at(themeIndex + DQuickControlPalette::Disabled); + targetColor = palette->colors.at(themeIndex + familyIndex + DQuickControlPalette::Disabled); if (targetColor.isValid()) // Don't process the disabled's color, should direct uses it. break; // fallback to normal color @@ -791,7 +815,12 @@ return; m_metaObject = new CustomMetaObject(this); + // Must true, see CustomMetaObject::createProperty m_metaObject->setCached(true); + QQmlData *qmldata = QQmlData::get(this); + Q_ASSERT(qmldata); + // the cache object is from QQmlOpenMetaObjectTypePrivate + m_propertyCache = qmldata->propertyCache; } int DQuickControlColorSelector::indexOfPalette(const QByteArray &name) const diff -Nru dtkdeclarative-5.6.3/src/private/dquickcontrolpalette_p.h dtkdeclarative-5.6.10/src/private/dquickcontrolpalette_p.h --- dtkdeclarative-5.6.3/src/private/dquickcontrolpalette_p.h 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/private/dquickcontrolpalette_p.h 2023-04-17 09:55:26.000000000 +0000 @@ -18,6 +18,7 @@ QT_BEGIN_NAMESPACE class QQuickItem; class QQuickWindow; +class QQmlPropertyCache; QT_END_NAMESPACE DQUICK_BEGIN_NAMESPACE @@ -364,6 +365,7 @@ typedef QPair ControlPaletteData; QList m_palettes; CustomMetaObject *m_metaObject = nullptr; + QQmlPropertyCache *m_propertyCache = nullptr; struct PaletteState { PaletteState(DQuickControlColorSelector *owner) : owner(owner) diff -Nru dtkdeclarative-5.6.3/src/private/dquickiconlabel.cpp dtkdeclarative-5.6.10/src/private/dquickiconlabel.cpp --- dtkdeclarative-5.6.3/src/private/dquickiconlabel.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/private/dquickiconlabel.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -49,7 +49,7 @@ image->setName(icon.name()); image->setTheme(icon.theme()); image->setPalette(icon.palette()); - image->setSourceSize(QSize(icon.width(), icon.height())); + image->setSourceSize(iconSize()); image->setMode(icon.mode()); image->setFallbackToQIcon(icon.fallbackToQIcon()); image->imageItem()->setFallbackSource(icon.source()); @@ -91,7 +91,7 @@ image->setName(icon.name()); image->setMode(icon.mode()); - image->setSourceSize(QSize(icon.width(), icon.height())); + image->setSourceSize(iconSize()); image->setPalette(icon.palette()); image->setTheme(icon.theme()); image->setFallbackToQIcon(icon.fallbackToQIcon()); @@ -386,6 +386,18 @@ label = nullptr; } +QSize DQuickIconLabelPrivate::iconSize() const +{ + D_QC(DQuickIconLabel); + // If no size is specified for theme icons, it will use the smallest available size. + QSize size(icon.width(), icon.height()); + if (size.width() <= 0) + size.setWidth(q->width()); + if (size.height() <= 0) + size.setHeight(q->height()); + return size; +} + DQuickIconLabel::DQuickIconLabel(QQuickItem *parent) : QQuickItem(*(new DQuickIconLabelPrivate), parent) { diff -Nru dtkdeclarative-5.6.3/src/private/dquickiconlabel_p_p.h dtkdeclarative-5.6.10/src/private/dquickiconlabel_p_p.h --- dtkdeclarative-5.6.3/src/private/dquickiconlabel_p_p.h 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/private/dquickiconlabel_p_p.h 2023-04-17 09:55:26.000000000 +0000 @@ -45,6 +45,8 @@ void itemImplicitHeightChanged(QQuickItem *) override; void itemDestroyed(QQuickItem *item) override; + QSize iconSize() const; + bool mirrored = false; DQuickIconLabel::Display display = DQuickIconLabel::TextBesideIcon; Qt::Alignment alignment = Qt::AlignCenter; diff -Nru dtkdeclarative-5.6.3/src/private/private.pri dtkdeclarative-5.6.10/src/private/private.pri --- dtkdeclarative-5.6.3/src/private/private.pri 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/private/private.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -QT += concurrent - -HEADERS += $$PWD/dquickwindow_p.h \ - $$PWD/dapploader_p.h \ - $$PWD/dblitframebuffernode_p.h \ - $$PWD/dblurimagenode_p.h \ - $$PWD/dhandlecontextmenuwindow_p.h \ - $$PWD/dmaskeffectnode_p.h \ - $$PWD/dplatformthemeproxy_p.h \ - $$PWD/dqmlglobalobject_p.h \ - $$PWD/dqmlglobalobject_p_p.h \ - $$PWD/dquickarrowboxpath_p.h \ - $$PWD/dquickglobal_p.h \ - $$PWD/dquickglow_p.h \ - $$PWD/dquickglow_p_p.h \ - $$PWD/dquickimageprovider_p.h \ - $$PWD/dquickinwindowblur_p.h \ - $$PWD/dquickrectangle_p.h \ - $$PWD/dquickrectangle_p_p.h \ - $$PWD/dquicksystempalette_p.h \ - $$PWD/dquickiconimage_p.h \ - $$PWD/dquickiconimage_p_p.h \ - $$PWD/dquickiconlabel_p.h \ - $$PWD/dquickiconlabel_p_p.h \ - $$PWD/dquickitemviewport_p.h \ - $$PWD/drectanglenode_p.h \ - $$PWD/dshadownode_p.h \ - $$PWD/dsoftwareroundedimagenode_p.h \ - $$PWD/dconfigwrapper_p.h \ - $$PWD/dquickcontrolpalette_p.h \ - $$PWD/dquickdciiconimage_p.h \ - $$PWD/dquickdciicon_p.h \ - $$PWD/dsettingscontainer_p.h \ - $$PWD/dmessagemanager_p.h \ - $$PWD/dquickbehindwindowblur_p_p.h \ - $$PWD/dquickbehindwindowblur_p.h \ - $$PWD/dpopupwindowhandle_p.h \ - $$PWD/dquickdciiconimage_p_p.h \ - $$PWD/dobjectmodelproxy_p.h \ - $$PWD/dquickopacitymask_p.h \ - $$PWD/dquickopacitymask_p_p.h \ - $$PWD/dopacitymasknode.h \ - $$PWD/dquickkeylistener_p.h \ - $$PWD/dquickwaterprogressattribute_p.h \ - $$PWD/dcoloroverlaynode.h \ - $$PWD/dquickcoloroverlay_p.h \ - $$PWD/dsoftwareeffectrendernode.h \ - $$PWD/dquickapploaderitem_p.h \ - -SOURCES += $$PWD/dquickiconimage.cpp \ - $$PWD/dblitframebuffernode.cpp \ - $$PWD/dblurimagenode.cpp \ - $$PWD/dhandlecontextmenuwindow.cpp \ - $$PWD/dmaskeffectnode.cpp \ - $$PWD/dqmlglobalobject.cpp \ - $$PWD/dquickarrowboxpath.cpp \ - $$PWD/dquickglow.cpp \ - $$PWD/dquickiconlabel.cpp \ - $$PWD/dquickimageprovider.cpp \ - $$PWD/dquickinwindowblur.cpp \ - $$PWD/dquickrectangle.cpp \ - $$PWD/drectanglenode.cpp \ - $$PWD/dshadownode_p.cpp \ - $$PWD/dconfigwrapper.cpp \ - $$PWD/dquickcontrolpalette.cpp \ - $$PWD/dquickdciiconimage.cpp \ - $$PWD/dquickdciicon.cpp \ - $$PWD/dsettingscontainer.cpp \ - $$PWD/dmessagemanager.cpp \ - $$PWD/dsoftwareroundedimagenode.cpp \ - $$PWD/dquickbehindwindowblur.cpp \ - $$PWD/dpopupwindowhandle.cpp \ - $$PWD/dobjectmodelproxy.cpp \ - $$PWD/dquickopacitymask.cpp \ - $$PWD/dopacitymasknode.cpp \ - $$PWD/dquickkeylistener.cpp \ - $$PWD/dquickwaterprogressattribute.cpp \ - $$PWD/dquickcoloroverlay.cpp \ - $$PWD/dcoloroverlaynode.cpp \ - $$PWD/dsoftwareeffectrendernode.cpp \ - $$PWD/dquickapploaderitem.cpp \ diff -Nru dtkdeclarative-5.6.3/src/qml/AboutDialog.qml dtkdeclarative-5.6.10/src/qml/AboutDialog.qml --- dtkdeclarative-5.6.3/src/qml/AboutDialog.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/qml/AboutDialog.qml 2023-04-17 09:55:26.000000000 +0000 @@ -10,6 +10,8 @@ DialogWindow { id: control + width: DS.Style.aboutDialog.width + height: DS.Style.aboutDialog.height property alias windowTitle: control.title property alias productName: productNameLabel.text @@ -24,68 +26,105 @@ readonly property string __websiteLinkTemplate: "%2" - ScrollView { + RowLayout { id: contentView width: parent.width implicitHeight: contentLayout.implicitHeight - topPadding: DS.Style.aboutDialog.topMargin - bottomPadding: DS.Style.aboutDialog.bottomMargin - palette.window: "transparent" ColumnLayout { id: contentLayout spacing: 0 - width: contentView.width + Layout.preferredWidth: Math.max(control.width / 5 * 2, DS.Style.aboutDialog.leftAreaWidth) + Layout.bottomMargin: DS.Style.aboutDialog.bottomPadding D.IconLabel { id: logoLabel - Layout.fillWidth: true Layout.preferredHeight: DS.Style.aboutDialog.productIconHeight + Layout.preferredWidth: Layout.preferredHeight Layout.alignment: Qt.AlignHCenter Layout.topMargin: 0 display: D.IconLabel.IconOnly + icon.mode: control.D.ColorSelector.controlState + icon.theme: control.D.ColorSelector.controlTheme + icon.palette: D.DTK.makeIconPalette(control.palette) } Label { id: productNameLabel - Layout.alignment: Qt.AlignCenter - Layout.topMargin: 3 - } - Label { - id: versionLabel + font: D.DTK.fontManager.t5 Layout.alignment: Qt.AlignCenter Layout.topMargin: 8 } Image { id: companyLogoLabel Layout.alignment: Qt.AlignCenter - Layout.topMargin: 0 - } - Label { - id: websiteLabel - Layout.alignment: Qt.AlignCenter - Layout.topMargin: 5 - text: (websiteLink === "" || websiteName === "") ? - "" : __websiteLinkTemplate.arg(websiteLink).arg(websiteName) - } - Label { - id: descriptionLabel - Layout.fillWidth: true - Layout.alignment: Qt.AlignHCenter - Layout.topMargin: 12 - wrapMode: Text.Wrap + Layout.topMargin: 30 } Label { id: licenseLabel - Layout.alignment: Qt.AlignHCenter - Layout.topMargin: 7 + font: D.DTK.fontManager.t10 + Layout.preferredWidth: parent.width + Layout.alignment: Qt.AlignCenter + Layout.topMargin: 3 + Layout.leftMargin: 30 + wrapMode: Text.WordWrap + elide: Text.ElideRight visible: license !== "" } - - Component.onCompleted: { - websiteLabel.linkActivated.connect(D.ApplicationHelper.openUrl) - descriptionLabel.linkActivated.connect(D.ApplicationHelper.openUrl) - licenseLabel.linkActivated.connect(D.ApplicationHelper.openUrl) - console.log("logo path", D.DTK.deepinDistributionOrgLogo) - } + } + ColumnLayout { + Layout.alignment: Qt.AlignLeft | Qt.AlignTop + spacing: 10 + Layout.fillWidth: true + Layout.fillHeight: true + Layout.rightMargin: 20 + ColumnLayout { + spacing: 1 + Label { + font: D.DTK.fontManager.t10 + text: qsTr("Version") + } + Label { + id: versionLabel + font: D.DTK.fontManager.t8 + wrapMode: Text.WordWrap + text: Qt.application.version + Layout.fillWidth: true + } + } + ColumnLayout { + spacing: 1 + Label { + font: D.DTK.fontManager.t10 + text: qsTr("Homepage") + } + Label { + id: websiteLabel + font: D.DTK.fontManager.t8 + text: (control.websiteLink === "" || control.websiteName === "") ? + "" : control.__websiteLinkTemplate.arg(websiteLink).arg(control.websiteName) + wrapMode: Text.WordWrap + Layout.fillWidth: true + } + } + ColumnLayout { + spacing: 1 + Label { + font: D.DTK.fontManager.t10 + text: qsTr("Description") + } + Label { + id: descriptionLabel + Layout.fillWidth: true + font: D.DTK.fontManager.t8 + wrapMode: Text.WordWrap + elide: Text.ElideRight + } + } + } + + Component.onCompleted: { + websiteLabel.linkActivated.connect(D.ApplicationHelper.openUrl) + descriptionLabel.linkActivated.connect(D.ApplicationHelper.openUrl) + licenseLabel.linkActivated.connect(D.ApplicationHelper.openUrl) } focus: true diff -Nru dtkdeclarative-5.6.3/src/qml/BoxPanel.qml dtkdeclarative-5.6.10/src/qml/BoxPanel.qml --- dtkdeclarative-5.6.3/src/qml/BoxPanel.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/qml/BoxPanel.qml 2023-04-17 09:55:26.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -20,6 +20,8 @@ property int boxShadowBlur: 6 property int boxShadowOffsetY: 4 property int innerShadowOffsetY1: -1 + // Background color changes with hover state if `backgroundFlowingHovered` is `true`. + property bool backgroundFlowsHovered: true Loader { anchors.fill: backgroundRect @@ -36,7 +38,8 @@ id: backgroundRect property alias color1: control.color1 property alias color2: control.color2 - D.ColorSelector.hovered: false + D.ColorSelector.hovered: backgroundFlowsHovered ? undefined : false + objectName: "background" Gradient { id: backgroundGradient diff -Nru dtkdeclarative-5.6.3/src/qml/ButtonBox.qml dtkdeclarative-5.6.10/src/qml/ButtonBox.qml --- dtkdeclarative-5.6.3/src/qml/ButtonBox.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/qml/ButtonBox.qml 2023-04-17 09:55:26.000000000 +0000 @@ -27,5 +27,6 @@ background: BoxPanel { implicitWidth: DS.Style.buttonBox.width implicitHeight: DS.Style.buttonBox.height + backgroundFlowsHovered: D.ColorSelector.family === D.Palette.CrystalColor } } diff -Nru dtkdeclarative-5.6.3/src/qml/ControlBackground.qml dtkdeclarative-5.6.10/src/qml/ControlBackground.qml --- dtkdeclarative-5.6.3/src/qml/ControlBackground.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/qml/ControlBackground.qml 2023-04-17 09:55:26.000000000 +0000 @@ -4,11 +4,6 @@ import QtQuick 2.11 -/* - ControlBackground 控件: - 可以用作组合控件 button、edit 等的背景颜色以及焦点框的显示。 -*/ - Rectangle { id: control diff -Nru dtkdeclarative-5.6.3/src/qml/DialogWindow.qml dtkdeclarative-5.6.10/src/qml/DialogWindow.qml --- dtkdeclarative-5.6.3/src/qml/DialogWindow.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/qml/DialogWindow.qml 2023-04-17 09:55:26.000000000 +0000 @@ -30,6 +30,7 @@ property alias header: titleBar.sourceComponent property string icon default property alias content: contentLoader.children + property alias palette : content.palette Control { id: content diff -Nru dtkdeclarative-5.6.3/src/qml/FlowStyle.qml dtkdeclarative-5.6.10/src/qml/FlowStyle.qml --- dtkdeclarative-5.6.3/src/qml/FlowStyle.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/qml/FlowStyle.qml 2023-04-17 09:55:26.000000000 +0000 @@ -186,6 +186,7 @@ } normalDark { common: D.DTK.makeColor(D.Color.Highlight).saturation(+10).lightness(+10) + crystal: Qt.rgba(0, 0, 0, 0.1) } hovered { common: D.DTK.makeColor(D.Color.Highlight).lightness(+10).saturation(+20).lightness(+10) @@ -214,6 +215,7 @@ } normalDark { common: D.DTK.makeColor(D.Color.Highlight).saturation(+28).lightness(-2) + crystal: Qt.rgba(0, 0, 0, 0.1) } hovered { common: D.DTK.makeColor(D.Color.Highlight).lightness(+10).saturation(+15).lightness(-8) @@ -236,16 +238,25 @@ } property D.Palette dropShadow: D.Palette { - normal: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+30) + normal { + common: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+30) + crystal: Qt.rgba(0, 0, 0, 0.1) + } + normalDark: D.DTK.makeColor(D.Color.Highlight).saturation(+15).lightness(+12).opacity(+20) hovered: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+30) pressed: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+20) disabled: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+30) } property D.Palette innerShadow1: D.Palette { - normal: D.DTK.makeColor(D.Color.Highlight).lightness(-10) + normal { + common: D.DTK.makeColor(D.Color.Highlight).lightness(-10) + crystal: Qt.rgba(0, 0, 0, 0.1) + } + normalDark: D.DTK.makeColor(D.Color.Highlight).saturation(+25).lightness(-6) hovered: D.DTK.makeColor(D.Color.Highlight).lightness(+10).lightness(-10) pressed: D.DTK.makeColor(D.Color.Highlight).lightness(+10).lightness(-5) + pressedDark: D.DTK.makeColor(D.Color.Highlight).saturation(+36).lightness(-10) disabled: D.DTK.makeColor(D.Color.Highlight).lightness(-10) } @@ -255,18 +266,23 @@ property D.Palette text: D.Palette { normal { - common: Qt.rgba(1, 1, 1, 0.9) + common: Qt.rgba(1, 1, 1, 1) crystal: D.DTK.makeColor(D.Color.Highlight) } - hovered: "white" - pressed: Qt.rgba(1, 1, 1, 0.6) + normalDark: normal } property D.Palette border: D.Palette { normal { - common: Qt.rgba(0, 129 / 255.0, 1, 0.2) + common: D.DTK.makeColor(D.Color.Highlight).opacity(+20) crystal: Qt.rgba(1, 1, 1, 0.1) } + normalDark { + common: Qt.rgba(1, 1, 1, 0.2) + crystal: Qt.rgba(1, 1, 1, 0.1) + } + hovered: Qt.rgba(0, 0, 0, 0.03) + hoveredDark: Qt.rgba(1, 1, 1, 0.2) } } @@ -378,7 +394,7 @@ property int height: 36 property int padding: 8 property int spacing: 10 - property int iconSize: 16 + property int iconSize: 12 property int maxVisibleItems: 16 property QtObject edit: QtObject { @@ -511,11 +527,11 @@ } property QtObject aboutDialog: QtObject { - property int width: 200 - property int height: 380 - property int topPadding: 20 - property int bottomPadding: 10 - property int productIconHeight: 96 + property int width: 540 + property int height: 290 + property int leftAreaWidth: 220 + property int bottomPadding: 20 + property int productIconHeight: 128 } property QtObject popup: QtObject { diff -Nru dtkdeclarative-5.6.3/src/qml/RoundButton.qml dtkdeclarative-5.6.10/src/qml/RoundButton.qml --- dtkdeclarative-5.6.3/src/qml/RoundButton.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/qml/RoundButton.qml 2023-04-17 09:55:26.000000000 +0000 @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later - +//FIXME:此文件存在性存疑,roundbutton为圆button 与floatingbutton一样了 import QtQuick 2.11 import QtQuick.Templates 2.4 as T import "PixelMetric.js" as PM diff -Nru dtkdeclarative-5.6.3/src/qml/WindowButton.qml dtkdeclarative-5.6.10/src/qml/WindowButton.qml --- dtkdeclarative-5.6.3/src/qml/WindowButton.qml 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/qml/WindowButton.qml 2023-04-17 09:55:26.000000000 +0000 @@ -9,7 +9,7 @@ Control { id: control property alias icon: iconLoader - property alias pressed: mouseArea.pressed + readonly property bool pressed: mouseArea.pressed signal clicked property D.Palette textColor: DS.Style.button.text property D.Palette backgroundColor: DS.Style.windowButton.background diff -Nru dtkdeclarative-5.6.3/src/src.pri dtkdeclarative-5.6.10/src/src.pri --- dtkdeclarative-5.6.3/src/src.pri 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/src.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -HEADERS += \ - $$PWD/dtkdeclarative_global.h \ - $$PWD/dquickwindow.h \ - $$PWD/dapploader.h \ - $$PWD/dplatformthemeproxy.h \ - $$PWD/dquickitemviewport.h \ - $$PWD/dquickblitframebuffer.h \ - $$PWD/dqmlappmainwindowinterface.h \ - $$PWD/dqmlapppreloadinterface.h \ - -SOURCES += \ - $$PWD/dquickwindow.cpp \ - $$PWD/dapploader.cpp \ - $$PWD/dplatformthemeproxy.cpp \ - $$PWD/dquickitemviewport.cpp \ - $$PWD/dquickblitframebuffer.cpp \ - $$PWD/dqmlapppreloadinterface.cpp \ - $$PWD/dqmlappmainwindowinterface.cpp \ diff -Nru dtkdeclarative-5.6.3/src/src.pro dtkdeclarative-5.6.10/src/src.pro --- dtkdeclarative-5.6.3/src/src.pro 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/src.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -load(dtk_lib) -include(private/private.pri) -TARGET = dtkdeclarative -TEMPLATE = lib -QT += dtkcore dtkgui core quick quick-private -CONFIG += internal_module c++11 qtquickcompiler - -# 龙芯架构上没有默认添加PT_GNU_STACK-section,所以此处手动指定一下 -contains(QMAKE_HOST.arch, mips.*): QMAKE_LFLAGS_SHLIB += "-Wl,-z,noexecstack" - -# for debian -isEmpty(LIB_INSTALL_DIR) { - LIB_INSTALL_DIR = $$[QT_INSTALL_LIBS] -} - -isEmpty(DTK_QML_APP_PLUGIN_SUBPATH) { - DTK_QML_APP_PLUGIN_SUBPATH = dtkdeclarative/plugins -} - -DEFINES += DTK_QML_APP_PLUGIN_SUBPATH=\\\"'$$DTK_QML_APP_PLUGIN_SUBPATH'\\\" - -include(src.pri) - -includes.files += \ - $$PWD/*.h \ - $$PWD/DQuickWindow \ - $$PWD/DAppLoader \ - $$PWD/DQmlAppMainWindowInterface \ - $$PWD/DQmlAppPreloadInterface \ - $$PWD/DPlatformThemeProxy \ - $$PWD/DQuickItemViewport \ - $$PWD/DQuickBlitFramebuffer \ - -RESOURCES += $$PWD/dtkdeclarative_assets.qrc - -DTK_MODULE_NAME=$$TARGET -load(dtk_build) - -template.files += $$PWD/../examples/qml-app-template -template.path = /usr/share/qtcreator/templates/wizards/projects - -INSTALLS += includes target template - -CMAKE_CONTENT += "include(GNUInstallDirs)" -CMAKE_CONTENT += "set(DTK_QML_APP_PLUGIN_PATH ${CMAKE_INSTALL_FULL_LIBDIR}/$${DTK_QML_APP_PLUGIN_SUBPATH})" -MODULE_PRI_CONT += "QT.$${TARGET}.qml_apps = \$\$[QT_INSTALL_LIBS]/$${DTK_QML_APP_PLUGIN_SUBPATH}" - -DEFINES += DTK_QML_APP_PLUGIN_PATH=\\\"'$$[QT_INSTALL_LIBS]/$$DTK_QML_APP_PLUGIN_SUBPATH'\\\" - -load(dtk_cmake) -load(dtk_module) - -DISTFILES += \ - shaders/quickitemduplicator.frag \ - shaders/quickitemduplicator-opaque.frag - -RESOURCES += \ - dtkdeclarative_qml.qrc diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_az.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_az.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_az.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_az.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + Versiya + + + + Homepage + Ev səhifəsi + + + + Description + Təsviri + + + HelpAction @@ -47,17 +65,17 @@ Mövzu - + Light Theme İşıqlı mövzu - + Dark Theme Tutqun mövzu - + System Theme Sistem mövzusu diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_bo.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_bo.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_bo.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_bo.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + པར་གཞི། + + + + Homepage + གཙོ་ངོས། + + + + Description + ཞིབ་བརྗོད། + + + HelpAction @@ -47,17 +65,17 @@ བརྗོད་བྱ་གཙོ་བོ། - + Light Theme ཁ་དཀར་པོ། - + Dark Theme ཁ་སྨུག་པོ། - + System Theme མ་ལག་གི་རྗེས་འབྲངས་བ། diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_ca.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_ca.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_ca.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_ca.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + Versió + + + + Homepage + Pàgina inicial + + + + Description + Descripció + + + HelpAction @@ -47,17 +65,17 @@ Tema - + Light Theme Tema clar - + Dark Theme Tema fosc - + System Theme Tema del sistema diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_de.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_de.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_de.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_de.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + Version + + + + Homepage + + + + + Description + Beschreibung + + + HelpAction @@ -47,17 +65,17 @@ Thema - + Light Theme Helles Thema - + Dark Theme Dunkles Thema - + System Theme Systemthema diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_es.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_es.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_es.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_es.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + Versión + + + + Homepage + Página web + + + + Description + Descripción + + + HelpAction @@ -44,20 +62,20 @@ Theme - tema + Tema - + Light Theme Tema claro - + Dark Theme Tema oscuro - + System Theme Tema del sistema diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_fi.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_fi.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_fi.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_fi.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + Versio + + + + Homepage + Kotisivu + + + + Description + Kuvaus + + + HelpAction @@ -47,17 +65,17 @@ Teema - + Light Theme Vaalea - + Dark Theme Tumma - + System Theme Järjestelmän diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_hu.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_hu.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_hu.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_hu.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + Verzió + + + + Homepage + Kezdőoldal + + + + Description + Leírás + + + HelpAction @@ -47,17 +65,17 @@ Téma - + Light Theme Világos mód - + Dark Theme Sötét mód - + System Theme Rendszer téma diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_nl.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_nl.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_nl.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_nl.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + Versie + + + + Homepage + Website + + + + Description + Beschrijving + + + HelpAction @@ -47,17 +65,17 @@ Thema - + Light Theme Licht thema - + Dark Theme Donker thema - + System Theme Systeemthema diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_pl.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_pl.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_pl.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_pl.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + Wersja + + + + Homepage + Strona główna + + + + Description + Opis + + + HelpAction @@ -20,7 +38,7 @@ Exit - Wyjście + Wyjdź @@ -47,17 +65,17 @@ Motyw - + Light Theme Jasny - + Dark Theme Ciemny - + System Theme Systemowy diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_sq.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_sq.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_sq.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_sq.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + Version + + + + Homepage + Faqe hyrëse + + + + Description + Përshkrim + + + HelpAction @@ -47,17 +65,17 @@ Temë - + Light Theme Temë e Çelët - + Dark Theme Temë e Errët - + System Theme Temë Sistemi diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative.ts 2023-04-17 09:55:26.000000000 +0000 @@ -10,6 +10,24 @@ + AboutDialog + + + Version + + + + + Homepage + + + + + Description + + + + HelpAction @@ -49,17 +67,17 @@ - + Light Theme - + Dark Theme - + System Theme diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_ug.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_ug.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_ug.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_ug.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + نەشرى + + + + Homepage + باش بەت + + + + Description + تەسۋىر + + + HelpAction @@ -47,17 +65,17 @@ ئۇسلۇب - + Light Theme يورۇق ئۇسلۇب - + Dark Theme قارا ئۇسلۇب - + System Theme سېستىما ئۇسلۇبى diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_uk.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_uk.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_uk.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_uk.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + Версія + + + + Homepage + Домашня сторінка + + + + Description + Опис + + + HelpAction @@ -47,17 +65,17 @@ Тема - + Light Theme Світла тема - + Dark Theme Темна тема - + System Theme Тема системи diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_zh_CN.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_zh_CN.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_zh_CN.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_zh_CN.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + 版本 + + + + Homepage + 主页 + + + + Description + 描述 + + + HelpAction @@ -47,17 +65,17 @@ 主题 - + Light Theme 浅色 - + Dark Theme 深色 - + System Theme 跟随系统 diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_zh_HK.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_zh_HK.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_zh_HK.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_zh_HK.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + 版本 + + + + Homepage + 主頁 + + + + Description + 描述 + + + HelpAction @@ -47,17 +65,17 @@ 主題 - + Light Theme 淺色 - + Dark Theme 深色 - + System Theme 跟隨系統 diff -Nru dtkdeclarative-5.6.3/src/translations/dtkdeclarative_zh_TW.ts dtkdeclarative-5.6.10/src/translations/dtkdeclarative_zh_TW.ts --- dtkdeclarative-5.6.3/src/translations/dtkdeclarative_zh_TW.ts 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/src/translations/dtkdeclarative_zh_TW.ts 2023-04-17 09:55:26.000000000 +0000 @@ -8,6 +8,24 @@ + AboutDialog + + + Version + 版本 + + + + Homepage + 首頁 + + + + Description + 描述 + + + HelpAction @@ -47,17 +65,17 @@ 主題 - + Light Theme 淺色 - + Dark Theme 深色 - + System Theme 跟隨系統 diff -Nru dtkdeclarative-5.6.3/tests/CMakeLists.txt dtkdeclarative-5.6.10/tests/CMakeLists.txt --- dtkdeclarative-5.6.3/tests/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/tests/CMakeLists.txt 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,45 @@ +set(BIN_NAME unit-test) + +find_package(Dtk REQUIRED COMPONENTS Core Gui) +find_package(GTest REQUIRED) +find_package(Qt5 REQUIRED COMPONENTS Core Gui Quick QuickControls2 Qml Test) + +file(GLOB TEST_HEADER ut_.*h) +file(GLOB TEST_SOURCE *.cpp) + +set(CHAMELEON_PATH "${PROJECT_BINARY_DIR}/plugins") +add_definitions( + -DCHAMELEON_PATH="${CHAMELEON_PATH}" +) + +add_executable(${BIN_NAME} + ${TEST_HEADER} + ${TEST_SOURCE} + ${CMAKE_CURRENT_LIST_DIR}/data.qrc +) + +target_compile_definitions(${BIN_NAME} PRIVATE + BIN_NAME="${BIN_NAME}" +) + +target_compile_options(${BIN_NAME} PRIVATE + "-fno-access-control" +) + +add_definitions(-DQML_PLUGIN_PATH="${PROJECT_BINARY_DIR}/plugins/") + +target_link_libraries(${BIN_NAME} PRIVATE + Qt5::Gui + Qt5::Core + Qt5::CorePrivate + Qt5::Test + Qt5::Qml + Qt5::Quick + Qt5::QuickControls2 + Dtk::Core + Dtk::Gui + GTest::GTest + ${LIB_NAME} + pthread + dl +) diff -Nru dtkdeclarative-5.6.3/tests/data.qrc dtkdeclarative-5.6.10/tests/data.qrc --- dtkdeclarative-5.6.3/tests/data.qrc 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/tests/data.qrc 2023-04-17 09:55:26.000000000 +0000 @@ -1,5 +1,6 @@ data/dconf-example.meta.json + qml/ColorSelector_GetColorFromProperty.qml diff -Nru dtkdeclarative-5.6.3/tests/main.cpp dtkdeclarative-5.6.10/tests/main.cpp --- dtkdeclarative-5.6.3/tests/main.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/tests/main.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -5,13 +5,21 @@ #include #include +#include int main(int argc, char *argv[]) { // gerrit编译时没有显示器,需要指定环境变量 qputenv("QT_QPA_PLATFORM", "offscreen"); +#ifdef QT_NO_DEBUG + QQuickStyle::setStyle("Chameleon"); +#else + QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon"); +#endif + QGuiApplication app(argc, argv); + app.setApplicationName("tests"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff -Nru dtkdeclarative-5.6.3/tests/qml/ColorSelector_GetColorFromProperty.qml dtkdeclarative-5.6.10/tests/qml/ColorSelector_GetColorFromProperty.qml --- dtkdeclarative-5.6.3/tests/qml/ColorSelector_GetColorFromProperty.qml 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/tests/qml/ColorSelector_GetColorFromProperty.qml 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,18 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + + +import QtQuick 2.0 +import QtQuick.Controls 2.0 +import org.deepin.dtk 1.0 as D +import org.deepin.dtk.private 1.0 as DP + +ListView { + property DP.ButtonPanel buttonPanel: currentItem.background + + model: ["1"] + delegate: D.Button { + id: control + } +} diff -Nru dtkdeclarative-5.6.3/tests/ut_colorselector.cpp dtkdeclarative-5.6.10/tests/ut_colorselector.cpp --- dtkdeclarative-5.6.3/tests/ut_colorselector.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dtkdeclarative-5.6.10/tests/ut_colorselector.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -0,0 +1,48 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include + +#include +#include +#include +#include +#include + +class ut_ColorSelector : public ::testing::Test +{ +public: + virtual void SetUp(); + virtual void TearDown(); +}; + +void ut_ColorSelector::SetUp() +{ +} + +void ut_ColorSelector::TearDown() +{ +} + +TEST_F(ut_ColorSelector, getColorFromProperty) +{ + QQmlEngine engine; + engine.setImportPathList(QStringList {QString::fromLocal8Bit(QML_PLUGIN_PATH)} + engine.importPathList()); + + QQmlComponent component(&engine); + + component.loadUrl(QUrl("qrc:/qml/ColorSelector_GetColorFromProperty.qml"), QQmlComponent::PreferSynchronous); + ASSERT_TRUE(component.isReady()); + auto listView = component.create(); + ASSERT_NE(listView, nullptr); + + QObject *buttonPanel = qvariant_cast(listView->property("buttonPanel")); + ASSERT_NE(buttonPanel, nullptr); + + QObject *background = buttonPanel->findChild("background"); + ASSERT_NE(background, nullptr); + + engine.globalObject().setProperty("background", engine.newQObject(background)); + ASSERT_EQ(background->property("color"), engine.evaluate("background.color1.normal.common.color()").toVariant()); +} diff -Nru dtkdeclarative-5.6.3/tests/ut_dconfigwrapper.cpp dtkdeclarative-5.6.10/tests/ut_dconfigwrapper.cpp --- dtkdeclarative-5.6.3/tests/ut_dconfigwrapper.cpp 2022-12-30 02:49:21.000000000 +0000 +++ dtkdeclarative-5.6.10/tests/ut_dconfigwrapper.cpp 2023-04-17 09:55:26.000000000 +0000 @@ -10,7 +10,7 @@ #include "private/dconfigwrapper_p.h" static constexpr char const *LocalPrefix = "/tmp/example"; -static constexpr char const *APP_ID = "tests"; +static constexpr char const *APP_ID = BIN_NAME; static constexpr char const *FILE_NAME = "example"; class ut_DConfigWrapper : public ::testing::Test {