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

Update directory_tree.py: Fixed double clicking #1512

Merged
merged 5 commits into from
Jun 23, 2024
Merged

Conversation

celltoolz
Copy link
Contributor

Fixed double click to work properly

Fixed double click to work properly
@celltoolz celltoolz changed the title Update directory_tree.py Update directory_tree.py: Fixed double clicking Jun 21, 2024
@Akuli
Copy link
Owner

Akuli commented Jun 21, 2024

Thanks for working on this! Your solution is nicer than calculating milliseconds.

I noticed two differences to how this behaved before. Can you look into whether we can keep the old behavior?

  1. Clicking an arrow shouldn't require a double-click, so that you can open folders with a single click. Now I need a double-click to open a folder when clicking the arrow. Here's how it worked before:
a-2024-06-21_13.05.56.mp4
  1. Double-clicking a folder should open it, so that if you don't mind clicking twice, you don't have to aim the mouse accurately on top of a tiny arrow. Like this:
b-2024-06-21_13.07.16.mp4

These probably have something to do with return "break". Let me know if you need help :)

single click now expands folder without needing to click on arrow
@celltoolz
Copy link
Contributor Author

It's working as you described now, was as simple as adding or not item.startswith('file') to line 142. Now when you single click anywhere on a folder name it'll expand showing the contents

@Akuli
Copy link
Owner

Akuli commented Jun 22, 2024

I pushed a couple small changes. You will need to run git pull locally. I'm now happy with how it behaves.


little_arrow_clicked = self.identify_element(event.x, event.y) == "Treeitem.indicator"

if little_arrow_clicked or not item.startswith("file"):
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think we need little_arrow_clicked anymore, because directories open regardless of where you click, and files don't have the arrow.

celltoolz and others added 2 commits June 22, 2024 14:21
removed little_arrow_clicked and changed if statement to if item.startswith(("dir", "project")):
@celltoolz
Copy link
Contributor Author

Was thinking of maybe adding a symbols table to this this, something that looks like:
(06-22-2024) 14:26:55
Let me know what you think, i've already got a class that i wrote for another project that'd work wonderfully for just this thing. I'd only need to modify it to work with the other languages as it only works for python at the moment.

@Akuli Akuli merged commit 7b6d7e8 into Akuli:main Jun 23, 2024
@Akuli Akuli mentioned this pull request Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants