Skip to content
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

[ui] Right click on text element in AttributeEditor open Copy/Paste menu #2366

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Just-Kiel
Copy link
Contributor

Right click on text element in AttributeEditor open Copy/Paste menu

  • Able to paste nodeContent in text element

@Just-Kiel Just-Kiel added the UI label Apr 11, 2024
@Just-Kiel Just-Kiel self-assigned this Apr 11, 2024
Copy link
Contributor

@cbentejac cbentejac left a comment

Choose a reason for hiding this comment

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

The "paste" menu should be disabled even if the clipboard has a valid content when the target is a read-only text field.

Otherwise, everything works fine.

meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml Outdated Show resolved Hide resolved
@cbentejac cbentejac added this to the Meshroom 2024.1.0 milestone Apr 19, 2024
@cbentejac cbentejac marked this pull request as draft April 19, 2024 16:00
@Just-Kiel Just-Kiel force-pushed the dev/copyPasteAttributeEditor branch from d8627e1 to 4c6cc4f Compare April 24, 2024 14:00
@Just-Kiel Just-Kiel marked this pull request as ready for review April 24, 2024 14:00
@fabiencastan
Copy link
Member

The selection of the text should work with the mouse.
If we select using the keyboard, the copy/paste is working.

Comment on lines +251 to +252
Clipboard.clear()
Clipboard.setText(attribute.value)
Copy link
Member

Choose a reason for hiding this comment

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

Not tested:

Suggested change
Clipboard.clear()
Clipboard.setText(attribute.value)
textField.copy()

@@ -206,6 +206,7 @@ RowLayout {
Component {
id: textField_component
TextField {
id: textField
Copy link
Member

Choose a reason for hiding this comment

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

The problem comes from the root.forceActiveFocus() in the onAccepted event.

}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.AllButtons
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
acceptedButtons: Qt.AllButtons
acceptedButtons: Qt.RightButton

if (mouse.button == Qt.RightButton) {
var menu = menuCopy.createObject(parameterLabel)
menu.parent = parameterLabel
menu.popup()
Copy link
Member

Choose a reason for hiding this comment

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

This kills the text selection, I'm not sure how to fix that.

Copy link
Member

Choose a reason for hiding this comment

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

maybe with persistentSelection...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants