-
Notifications
You must be signed in to change notification settings - Fork 21
sync: from linuxdeepin/dtkdeclarative #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
[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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
40e09c0 to
1f39766
Compare
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#522
1f39766 to
1a373d5
Compare
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 |
|
Permission denied |
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: