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

Fix drag issues #8

Merged
merged 40 commits into from
Jul 12, 2023
Merged

Fix drag issues #8

merged 40 commits into from
Jul 12, 2023

Conversation

Moosems
Copy link
Owner

@Moosems Moosems commented Apr 14, 2023

To fix:

.in_widget_select_mouse_drag():

  • If I click and start dragging and then drag into the Text widget it highlights kinda weirdly until back in TkLineNums
  • If I drag outside of the TkLineNumbers widget (left or right) and keep dragging, sel is not added

Fighting between .in_widget_select_mouse_drag() and .mouse_off_screen_scroll().

  • Dragging down and exiting line numbers causes weird selection

Unknown origin (either in .in_widget_select_mouse_drag(), .mouse_off_screen_scroll(), or .select_text()):

  • If I drag outside of the TkLineNumbers widget (left or right) and keep dragging up or down, the following issues occur:
    • It doesn't scroll
    • Fast movement outruns the selection.

Video of no-scrolling issue outside of line numbers issue:

Screen.Recording.2023-04-21.at.12.37.52.PM.mov

Video of left-right dragging fast movement issue:

Screen.Recording.2023-04-19.at.7.39.40.PM.mov

Video and image of drag exit issue:

Screen.Recording.2023-04-21.at.12.34.35.PM.mov

Screen Shot 2023-04-30 at 4 07 53 PM

@Moosems Moosems added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Apr 14, 2023
@Moosems
Copy link
Owner Author

Moosems commented Apr 14, 2023

Fixes #4

tklinenums/tklinenums.py Outdated Show resolved Hide resolved
@Moosems Moosems changed the title Fix bugs in click drag Fix bugs in .auto_scroll() Apr 15, 2023
(Noticed yesterday)
tests/example.py Outdated Show resolved Hide resolved
Co-authored-by: rdbende <rdbende@proton.me>
@Moosems
Copy link
Owner Author

Moosems commented Apr 17, 2023

We need to get movement events happening outside of the line numbers to be passed to it.

@rdbende
Copy link
Collaborator

rdbende commented Apr 17, 2023

<Button1-Motion> does that

@Moosems
Copy link
Owner Author

Moosems commented Apr 17, 2023

<Button1-Motion> does that

@rdbende If I exit the Line Numbers it stops getting that specific event.

@Moosems Moosems requested a review from rdbende April 18, 2023 18:52
@Moosems Moosems changed the title Fix bugs in .auto_scroll() Fix drag issues Apr 19, 2023
@Moosems Moosems mentioned this pull request Apr 22, 2023
@Moosems
Copy link
Owner Author

Moosems commented Apr 22, 2023

A better form of the select code can be found here. However, at this point in time, I have been unable to port it properly. I will give it another try tonight and see how I do. Any results will be provided. If none are given, assume I met my old friend Failure again and give me a few days before I attempt it again.

Moosems and others added 16 commits April 22, 2023 09:54
Correct tkinter Linux installation instructions for 2023
Co-authored-by: Akuli <akuviljanen17@gmail.com>
@Akuli Can you look over the documentation for me and provide any comments? Should I add a section explaining the redraw() function and how it is to be used?
Co-authored-by: Akuli <akuviljanen17@gmail.com>
Add color choosing
@rdbende A bit better. Need to be shortened but they could help out.
Copy link

@mtik00 mtik00 left a comment

Choose a reason for hiding this comment

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

Let a few questions/thoughts.

I haven't done any tikinter stuff in a long time, for what that's worth.

# The scroll events passed by MacOS are different from Windows and Linux
# so it must to be rectified to work properly when dealing with the events.
# Originally found here: https://stackoverflow.com/a/17457843/17053202
return -delta if system() == "Darwin" else delta / 120
Copy link

Choose a reason for hiding this comment

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

I like this much better than the global; good call!

tklinenums/tklinenums.py Outdated Show resolved Hide resolved
tklinenums/tklinenums.py Outdated Show resolved Hide resolved
tklinenums/tklinenums.py Outdated Show resolved Hide resolved
@Moosems
Copy link
Owner Author

Moosems commented Jun 23, 2023

I should probably redo the off screen method as it likes kinda messy in retrospect.

Moosems and others added 5 commits June 23, 2023 18:58
For some reason scrolling up isn't working on this or the previous commit
* set x and y from B1-Motion as original tcl text does
* removed check_side_scroll as it's unnecessary
* fixed select_text to highlight from clicked position to dragged position
* ported logic for out of widget drag - text_auto_scan
@Moosems
Copy link
Owner Author

Moosems commented Jul 12, 2023

All bugs are fixed. Time to merge.

@Moosems Moosems merged commit 9fe06de into main Jul 12, 2023
@Moosems Moosems deleted the click-drag-bugs branch July 12, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants