-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add click on canvas to jumpToEntry in multi-edit mode #49
base: main
Are you sure you want to change the base?
Add click on canvas to jumpToEntry in multi-edit mode #49
Conversation
… and can be turn on in `Preference - Editor`) along with chinese translation
@@ -474,6 +474,8 @@ fun Strings.en(): String = when (this) { | |||
PreferencesEditor -> "Editor" | |||
PreferencesEditorDescription -> "Customize the editor's appearance and behavior." | |||
PreferencesEditorPlayerCursorColor -> "Player cursor color" | |||
PreferencesEditorClickToJumToEntry -> | |||
"Jump to the cursor position entry by clicking it on canvas in multiple entry edit mode" |
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.
@@ -474,6 +474,8 @@ fun Strings.en(): String = when (this) { | |||
PreferencesEditor -> "Editor" | |||
PreferencesEditorDescription -> "Customize the editor's appearance and behavior." | |||
PreferencesEditorPlayerCursorColor -> "Player cursor color" | |||
PreferencesEditorClickToJumToEntry -> |
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.
typo: Jum
-> Jump
@@ -730,6 +730,12 @@ object PreferencesPages { | |||
select = { it.playerCursorColor }, | |||
update = { copy(playerCursorColor = it) }, | |||
) | |||
switch( |
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.
Let's place it over the color.
cursorStateValue.position?.let { position -> | ||
getEntryIndexByCursorPosition(position)?.let { index -> | ||
// having bugs here | ||
// if the cursor do not move, it would not jump |
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.
Do you mean, when only clicking and without any moving, this line is not executed?
It doesn't happen on my side.
Could you explain more?
@@ -597,6 +606,7 @@ private fun MarkerState.handleCursorPress( | |||
event: PointerEvent, | |||
labelerConf: LabelerConf, | |||
appConf: AppConf, | |||
editorState: EditorState, | |||
) { | |||
val action = keyboardState.getEnabledMouseClickAction(event) ?: return | |||
if (action.canMoveParameter()) { |
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.
I think we need to add another mouse action
instead of handling it over the existing moving actions, right now, if we enable this, it's very difficult to drag parameter lines, because when you press, it immediately causes the jumping.
Also, it might be better UX if we handle it on mouse release (up), not mouse press (down).
Even if we use another mouse action
, we should note that the action def might be the same for multiple actions (e.g. we can simply set Left Click
on this new action).
So, e.g. when we handle it on mouse release, we need to check whether this release event is a finishing event of a dragging, and only handle when it's not.
Thanks for all the advices and code review and I really appreciate them. I would look into them and try to push myself to finish them in a week or two. And again thanks for your work and the whole project. |
add click to jumpToEntry in multiple entry edit mode (default is off, and can be turn on in
Preference - Editor
) along with chinese translationAfter testing, I found a bug, if your mouse did not move, it would not "jump", I don't know how to fix that, but I would consider it doesn't really affect the actual experience.