Skip to content

Conversation

@deepin-ci-robot
Copy link
Contributor

@deepin-ci-robot deepin-ci-robot commented Jun 6, 2025

Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#488

Summary by Sourcery

Sync in the updated ScrollView implementation from linuxdeepin/dtkdeclarative with QML imports, sizing logic, and ScrollBar attachments, enhance TextArea's implicit sizing, and register the new ScrollView component in the build and plugin infrastructure.

New Features:

  • Introduce ScrollView QML component using T.ScrollView with integrated D.ScrollBar for vertical and horizontal scrolling.

Enhancements:

  • Expand TextArea implicitWidth and implicitHeight calculations to account for content, background, and placeholder dimensions.

Build:

  • Add ScrollView.qml to chameleon QML resources and CMakeLists.
  • Register ScrollView type in the QML plugin (qmlplugin_plugin.cpp).

Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#488
@deepin-ci-robot
Copy link
Contributor Author

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-ci-robot

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai
Copy link

sourcery-ai bot commented Jun 6, 2025

Reviewer's Guide

This PR syncs components from linuxdeepin/dtkdeclarative, updating the ScrollView implementation, enhancing TextArea implicit sizing, and integrating the new ScrollView into the build system and plugin registration.

Class Diagram of Modified QML Components

classDiagram
    direction TB

    class QtQuick_Templates_ScrollView {
        <<QML Base Class>>
        +id: control
        +implicitWidth: number
        +implicitHeight: number
        +availableWidth: number
        +availableHeight: number
        +mirrored: bool
        +contentWidth: number
        +contentHeight: number
        +leftPadding: number
        +rightPadding: number
        +topPadding: number
        +bottomPadding: number
        +leftInset: number
        +rightInset: number
        +topInset: number
        +bottomInset: number
        +implicitBackgroundWidth: number
        +implicitBackgroundHeight: number
    }

    class ScrollView_QML {
        <<Component: qt6/src/qml/ScrollView.qml>>
        +implicitWidth: number // Modified formula
        +implicitHeight: number // Modified formula
        +D_ScrollBar_vertical: D_ScrollBar // Added
        +D_ScrollBar_horizontal: D_ScrollBar // Added
    }
    ScrollView_QML --|> QtQuick_Templates_ScrollView : extends (Base changed from QtQuick.Controls.ScrollView)

    class D_ScrollBar {
        <<Component: org.deepin.dtk.ScrollBar>>
        +active: bool
        +parent: Control
        +x: number
        +y: number
        +width: number
        +height: number
    }
    ScrollView_QML "1" o-- "2" D_ScrollBar : aggregates

    class QtQuick_Templates_TextArea {
        <<QML Base Class>>
        +implicitWidth: number
        +implicitHeight: number
        +contentWidth: number
        +contentHeight: number
        +leftPadding: number
        +rightPadding: number
        +topPadding: number
        +bottomPadding: number
        +leftInset: number
        +rightInset: number
        +topInset: number
        +bottomInset: number
        +implicitBackgroundWidth: number
        +implicitBackgroundHeight: number
        +placeholder_implicitWidth: number
        +placeholder_implicitHeight: number
    }

    class TextArea_QML {
        <<Component: qt6/src/qml/TextArea.qml>>
        +implicitWidth: number // Modified formula
        +implicitHeight: number // Modified formula
        +placeholderTextPalette: D_Palette
        +placeholderTextColor: color
    }
    TextArea_QML --|> QtQuick_Templates_TextArea : extends

    class D_Palette {
        <<DTK Type>>
    }
    TextArea_QML *-- D_Palette : uses
Loading

File-Level Changes

Change Details Files
Overhauled ScrollView QML implementation for Qt6
  • Switched to T.ScrollView with explicit id and updated imports
  • Added implicitWidth/implicitHeight calculations using Math.max for content and background
  • Defined D.ScrollBar.vertical and D.ScrollBar.horizontal attached properties
qt6/src/qml/ScrollView.qml
Expanded TextArea implicit sizing logic
  • Incorporated contentWidth and implicitBackgroundWidth into implicitWidth
  • Incorporated contentHeight and implicitBackgroundHeight into implicitHeight
  • Retained placeholder size calculations alongside new dimensions
qt6/src/qml/TextArea.qml
Integrated new ScrollView component into build and plugin
  • Added ScrollView.qml to chameleon QML file list
  • Registered ScrollView type in qmlplugin_plugin.cpp
  • Introduced empty themable ScrollView wrapper in chameleon resources
chameleon/CMakeLists.txt
qmlplugin/qmlplugin_plugin.cpp
chameleon/qml.qrc
chameleon/ScrollView.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @deepin-ci-robot - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@18202781743 18202781743 merged commit d5f2c23 into master Jun 6, 2025
8 of 13 checks passed
@18202781743 18202781743 deleted the sync-pr-488-nosync branch June 6, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants