sync: from linuxdeepin/dtkdeclarative#294
Merged
18202781743 merged 1 commit intomasterfrom Aug 28, 2025
Merged
Conversation
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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR syncs QML sources from linuxdeepin/dtkdeclarative and enhances text input components by introducing copy/cut enable flags with corresponding setters, and updates menu item behaviors to respect those flags. Class diagram for updated TextField and PasswordEdit QML componentsclassDiagram
class TextField {
+bool copyMenuEnabled = true
+bool cutMenuEnabled = true
...
}
class PasswordEdit {
+setCopyEnable(enable)
+setCutEnable(enable)
...
}
PasswordEdit --> TextField : uses
Flow diagram for Copy and Cut menu item enablement logicflowchart TD
A[User selects text in TextField] --> B{Is echoMode Normal?}
B -- No --> D[Copy/Cut disabled]
B -- Yes --> C{Are copyMenuEnabled/cutMenuEnabled true?}
C -- No --> D[Copy/Cut disabled]
C -- Yes --> E[Copy/Cut enabled]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
40e09c0 to
1f39766
Compare
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#522
1f39766 to
1a373d5
Compare
Contributor
Author
deepin pr auto review我来对这段代码进行审查,并提出改进意见: 语法逻辑
代码质量
代码性能
代码安全
改进建议
Keys.enabled: canCopy || canCut // 当任一操作可用时,按键应该启用
// 当复制或剪切可用时,启用键盘快捷键
Keys.enabled: canCopy || canCut
Keys.onPressed: function(event) {
if (!event) return;
if (event.matches(StandardKey.Copy)) {
if (!canCopy) {
event.accepted = true
return
}
} else if (event.matches(StandardKey.Cut)) {
if (!canCut) {
event.accepted = true
return
}
}
}
function handleKeyEvent(event) {
if (!event) return false;
if (event.matches(StandardKey.Copy)) {
return canCopy;
} else if (event.matches(StandardKey.Cut)) {
return canCut;
}
return false;
}
Keys.onPressed: function(event) {
if (!handleKeyEvent(event)) {
event.accepted = true;
}
}这些改进将使代码更加健壮、可维护,并且逻辑更加清晰。 |
|
/forcemerge |
Contributor
|
Permission denied |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Synchronize source files from linuxdeepin/dtkdeclarative.
Source-pull-request: linuxdeepin/dtkdeclarative#522
Summary by Sourcery
Expose configurable flags for enabling or disabling copy and cut actions in text input components by synchronizing updates from linuxdeepin/dtkdeclarative.
New Features:
Enhancements: