Skip to content

Conversation

@GongHeng2017
Copy link
Contributor

@GongHeng2017 GongHeng2017 commented Apr 21, 2025

-- Dtk enables the font size of upper-layer applications to change with the control center
through DApplication.
-- The desktop program has embedded dde-shell, but dde-shell uses QApplication, causing the
font size of upper-layer applications not to follow changes when the control center's font
size is adjusted.
-- Modify dde-shell's QApplication to DApplication.

Log: fix issue
PMS: BUG-285621

Summary by Sourcery

Replace QApplication with DApplication in dde-shell to enable font size synchronization with the control center

Bug Fixes:

  • Fix font size change synchronization issue between dde-shell and control center by switching from QApplication to DApplication

Enhancements:

  • Update application initialization to use DApplication for better integration with Deepin desktop environment

Build:

  • Add Dtk Widget package dependency in CMakeLists.txt
  • Update target link libraries to include Dtk Widget library

-- Dtk enables the font size of upper-layer applications to change with the control center
   through DApplication.
-- The desktop program has embedded dde-shell, but dde-shell uses QApplication, causing the
   font size of upper-layer applications not to follow changes when the control center's font
   size is adjusted.
-- Modify dde-shell's QApplication to DApplication.

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-285621.html
@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • CMakeLists.txt文件中新增了find_package(Dtk${DTK_VERSION_MAJOR} COMPONENTS Widget REQUIRED)Dtk${DTK_VERSION_MAJOR}::Widget的引用,需要确认DTK_VERSION_MAJOR是否已定义且正确。
  • main.cpp文件中,将QApplication替换为DApplication,需要确保DApplication的引入和使用是正确的,并且与现有的代码兼容。

是否建议立即修改:

  • 是,需要确保新增的依赖和替换的类是正确的,并且不会引入新的问题。

@sourcery-ai
Copy link

sourcery-ai bot commented Apr 21, 2025

Reviewer's Guide by Sourcery

This pull request modifies dde-shell to use DApplication instead of QApplication. This change allows the font size of upper-layer applications to change with the control center. Additionally, the CMakeLists.txt file was updated to include the Widget component from Dtk.

Sequence diagram for font size change propagation

sequenceDiagram
    actor User
    participant ControlCenter
    participant DApplication
    participant UpperLayerApp

    User->>ControlCenter: Adjusts font size
    ControlCenter->>DApplication: Sets new font size
    DApplication->>UpperLayerApp: Propagates font size change
    UpperLayerApp->>UpperLayerApp: Updates UI with new font size
Loading

Updated class diagram for QApplication and DApplication

classDiagram
    class QApplication {
        -- Removed --
    }
    class DApplication {
        -- Added --
    }

    DApplication --|> QApplication : inherits from
Loading

File-Level Changes

Change Details Files
Replaced QApplication with DApplication in dde-shell to enable font size changes from the control center.
  • Replaced QApplication a(argc, argv) with DApplication a(argc, argv) in main.cpp.
  • Added DWIDGET_USE_NAMESPACE in main.cpp.
shell/main.cpp
Added the Widget component from Dtk to the CMakeLists.txt file.
  • Added find_package(Dtk${DTK_VERSION_MAJOR} COMPONENTS Widget REQUIRED) to find the Dtk Widget package.
  • Added Dtk${DTK_VERSION_MAJOR}::Widget to the target link libraries.
shell/CMakeLists.txt

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!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

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 @GongHeng2017 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a comment explaining why UseInactiveColorGroup is being set to false.
  • It might be helpful to add a brief explanation about why QT_SCALE_FACTOR is being unset.
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.

@GongHeng2017
Copy link
Contributor Author

@BLumia 麻烦review一下

@GongHeng2017
Copy link
Contributor Author

@18202781743

@BLumia BLumia requested a review from 18202781743 April 22, 2025 01:44
@BLumia
Copy link
Member

BLumia commented Apr 22, 2025

Commit message 需要改成 PMS: BUG-285621(不能直接贴链接)

@18202781743 这里只能用 dtkwidget 的 DApplication 吗?

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, GongHeng2017

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

@18202781743
Copy link
Contributor

18202781743 commented Apr 23, 2025

Commit message 需要改成 PMS: BUG-285621(不能直接贴链接)

@18202781743 这里只能用 dtkwidget 的 DApplication 吗?

fontSize 在DApplication里做的,不然的话widget的很多应用用之前的接口就有问题了,需要手动去用dtkgui的实现,
之后dde-shell不支持widget后,再把qaplication改成qguiapplication,

@BLumia BLumia merged commit 3a55b95 into linuxdeepin:master Apr 23, 2025
7 of 10 checks passed
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.

4 participants