Alexey-T/CudaText

Cuda shouldn't scroll tab bar on tab mousedown

Closed this issue · 8 comments

  1. Have many open documents so that tab bar can scroll.
  2. Activate the right-most tab.
  3. Look at the left-most visible tab, which should be only partially visible, with its left part hidden. Click it and hold, so that you intend to move (drag) the tab.

Current result:
As soon as you click and hold, before you move the mouse after the click, the tab you just clicked is no longer under mouse pointer, which is bad UI.

Expected result:
I understand the reasoning in making the entire tab visible when it's active, but this should only be processed on click release (mouseup), not on mousedown. Or, at least, the scrolled amount should be just the enough to make the tab visible, so that tab is still under the mouse before you drag (this is VSCode's behavior).

One more thing about this: as soon as you click, the new tab under the mouse, which isn't the one you clicked, becomes highlighted (at least on Cuda Qt5), which is also misleading.
image
In the screenshot above, the highlighted tab under the cursor is not the one I'm dragging, this is the one at the right starting with letter "B".

scrolled amount should be just the enough to make the tab visible, so that tab is still under the mouse before you drag (this is VSCode's behavior).

made this.
beta:
cudatext.zip

Looks good, thank you.

now I also did the same for the right-most partially visible tab.

cudatext.zip

new beta, what you can test now:

  • make the same fix for ui-tab partially visible on the right
  • make the same fix for vertical tabs: "ui_tab_position"
  • consider "ui_tab_angled":true now

Thanks.

While testing this, I noticed a bad behavior, not sure if it was caused by the new code or if it was always there.

The mark between tabs while you're dragging a tab is supposed to show position of the tab when you drop it. This is VSCode behavior, also the same for every tab based app except those that actually move the tab while you're dragging (examples: Firefox, Sublime).

But Cuda is not following this. If you drag a tab (let's say the first tab) to the position before the last tab, so that the mark appears at the left of last tab, releasing click there means the moved tab should be placed before the last tab. But Cuda is placing this tab AFTER last tab. This is wrong.

fixed beta:
cudatext.zip

Fixed, thanks.

I still see room for one improvement: current behavior is that mark is always at the left of hovered tab. So if mouse is near the right edge of the tab, mark is still at the left. This doesn't look good. Cuda, just like VSCode, should split the tab area in half: if cursor is at the right half of hovered tab, mark should be at the right; if cursor is at the left half of hovered tab, mark should be at the left.

I moved this request to a new issue #5647. closing this issue.