Akuli / porcupine

A decent editor written in tkinter
MIT License
162 stars 49 forks source link

Update directory_tree.py: Fixed double clicking #1512

Closed celltoolz closed 5 months ago

celltoolz commented 5 months ago

Fixed double click to work properly

Akuli commented 5 months ago

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:

https://github.com/Akuli/porcupine/assets/18505570/9240bf15-2025-4d74-8157-03ceba84bcb1

  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:

https://github.com/Akuli/porcupine/assets/18505570/b326580a-90c7-42d5-9948-cfdec2f6a23b

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

celltoolz commented 5 months ago

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 commented 5 months ago

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

celltoolz commented 5 months ago

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.