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

More complete mouse support #840

Closed
5 tasks done
ThomasFrans opened this issue Jun 14, 2022 · 2 comments
Closed
5 tasks done

More complete mouse support #840

ThomasFrans opened this issue Jun 14, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@ThomasFrans
Copy link
Contributor

ThomasFrans commented Jun 14, 2022

Is your feature request related to a problem? Please describe.
Currently there are two mouse actions available: clicking at the bottom for play pause, and scrolling with the bar on the side. It would be nice if there were other options, like selecting a tab with the mouse, or playing a song with the mouse. Good mouse support would also allow new TUI users to more easily use ncspot.

Describe the solution you'd like
Some nice mouse additions would be:

  • Playing a song by clicking it
  • Selecting a tab by clicking it
  • Scrolling through tabs by scrolling on them (expected behavior for tabs)
  • Opening context menu by right clicking an item
  • Mouse support inside the context menu

Additional context
I know, mouse support in a TUI, I must be crazy, but sometimes the mouse is just more fun and easier 😄. Especially during active music listening, 'Vim-ing' through the library is a bit annoying. It also feels like the current mouse support is only half functional (only for things near the edges). I was looking through the code a bit and from the limited time, I noticed it may be a bit hard to implement this without some refactoring work on the UI, because there is no relative positions for Views. If this would be a welcome addition, I'd be happy to (try and) help 🙂.

@ThomasFrans ThomasFrans added the enhancement New feature or request label Jun 14, 2022
hrkfdn added a commit that referenced this issue Aug 9, 2022
hrkfdn added a commit that referenced this issue Aug 9, 2022
hrkfdn added a commit to ayushjaipuriyar/ncspot that referenced this issue Aug 9, 2022
@hrkfdn
Copy link
Owner

hrkfdn commented Aug 9, 2022

Hey @ThomasFrans, I decided to take a look at the tab area mouse handling. Feel free to have a go at the rest if you like :)

hrkfdn added a commit that referenced this issue Aug 16, 2022
hrkfdn added a commit that referenced this issue Aug 18, 2022
hrkfdn added a commit that referenced this issue Aug 18, 2022
The previous behavior would select and open the last item if the user clicked a
row after the last item. This change prevents such a behavior as it can be
misleading.

Related to #840
@hrkfdn
Copy link
Owner

hrkfdn commented Aug 18, 2022

Hey again, I have implemented a variation of this:
Left click will open an album/playlist/etc., right click will open the context menu. I've decided against playing items directly on left click as I feel like this could be undesired, i.e. as it will clear the current queue when an item is clicked accidentally. Hope this is still useful for you.

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

No branches or pull requests

2 participants