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

Style on hovered tab is not removed when you leave it by moving up #4893

Open
pintassilgo opened this issue Mar 13, 2023 · 44 comments
Open

Style on hovered tab is not removed when you leave it by moving up #4893

pintassilgo opened this issue Mar 13, 2023 · 44 comments

Comments

@pintassilgo
Copy link

When you hover a tab, it gets special background color (white ish for default theme, while normal tabs are gray ish).

When cursor leaves the tab, background color should get back to normal. This happens when you move from tab to tab, from tab to the editor...

But it's not working when you move to above the tab.

cuda.mp4

This video was recorded with menubar visible, but the issue is still reproducible even after disabling it.

@pintassilgo pintassilgo changed the title Style on hovered is not removed when you leave it by moving up Style on hovered tab is not removed when you leave it by moving up Mar 13, 2023
@Alexey-T
Copy link
Owner

I see it; but I cannot do the fix: OnMouseMove is not called in this case.

@Alexey-T
Copy link
Owner

this is wont-fix because of OnMouseMove is not called for tabs-control.

@pintassilgo
Copy link
Author

pintassilgo commented May 6, 2023

There's another issue that is annoying me. Commenting here because perhaps the root cause is the same.

One feature of Cuda is that if you hover the status message, a tooltip appears showing the history of previous messages. But at least for me, this tooltip shows up even when mouse quickly crossed status bar,

This happens to me when I move the mouse from inside out of Cuda window (from the editor to below Cuda window, crossing status bar). When I move mouse pointer in the opposite direction (from below Cuda window to Cuda editor, also crossing status bar), this issue doesn't happen.

So my guess is that Cuda currently is able to detect mouse moved out status bar only if the destination position of the mouse is within Cuda window.

It would be good if this can be fixed. If it's hard, I'd like to suggest a way (option?) to disable this popup from showing up on hover, maybe requiring user to click the status bar to show the tooltip instead of showing on hover.

@pintassilgo
Copy link
Author

cuda.mp4

@Alexey-T Alexey-T reopened this May 6, 2023
@Alexey-T
Copy link
Owner

Alexey-T commented May 6, 2023

Tested it more, on gtk2+qt5 versions. it works already ok for me. I did not stop the mouse cursor over the statusbar, I just moved it (slowly) from top to the bottom, and vice versa. and hint did not appear. hint appears only if I stop the cursor over the statusbar and wait a little.

@veksha What is your test result (linux or windows)?

@veksha
Copy link
Contributor

veksha commented May 6, 2023

on Windows, tooltip disappears when mouse moves out of window.

@pintassilgo
Copy link
Author

pintassilgo commented May 6, 2023

I use Cuda Qt5 on Wayland Linux (KDE Plasma). But I prefix with the var QT_QPA_PLATFOR=xcb to run Cuda as Xwayland window instead of Wayland because currently that's the only proper way I know to not be affected by #4955. The other way would be using Cuda GTK, but then I'd suffer from #5003.

@pintassilgo
Copy link
Author

I just tested in Cuda Qt5 Wayland (i.e. without QT_QPA_PLATFOR=xcb) and tooltip still appears when I stop cursor out of window. This should be fixed. The difference is that tooltip is only visible while cursor is still. Once I move it at least 1px, the tooltip hides.

So apparently, tooltip doesn't use mouse position to decide if it should be displayed, but it should. It appears anyway after the "tooltip delay", but hides if it detects on MOUSEMOVE that mouse is out of window.

@pintassilgo
Copy link
Author

pintassilgo commented May 6, 2023

This tooltip grows very large after using Cuda a bit, it's really annoying.

It would be good to have an option to display it only on click instead of on hover, supposing there's no other easy fix.

image

@Alexey-T
Copy link
Owner

Alexey-T commented May 6, 2023

Maybe the option "count of lines in tooltip of last statusbar cell" is good? I may add it. if 0: tooltip is disabled.

@pintassilgo
Copy link
Author

pintassilgo commented May 6, 2023

I just tested Cuda GTK and it's affected the same way as in my video. Tooltip doesn't hide even after moving the mouse out of the window.

@pintassilgo
Copy link
Author

pintassilgo commented May 6, 2023

Maybe the option "count of lines in tooltip of last statusbar cell" is good? I may add it. if 0: tooltip is disabled.

The way it stands I'd need to set it as 0. But then I'd lose completely the ability to see status history. The optimal solution would be what I proposed: an option to change it to display when you click status message instead of on hover (maybe changing from tooltip to a dumb menulist, if that's the only way to prevent from appearing on hover).

@Alexey-T
Copy link
Owner

Alexey-T commented May 6, 2023

I could not yet make hint showing by click. sorry. but I added the option -

default.json:

  //Max count of lines in the tooltip of last statusbar cell.
  //If 0: tooltip is disabled.
  "ui_statusbar_hint_lines": 35,

new binaries for gtk2/qt5:
http://uvviewsoft.com/c/

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

About original issue- Lazarus event (onMouseLeave) is not called when we move mouse out of the window , so I cannot solve it.

about newly added option - let’s discuss it in new topic.
Closing.

@Alexey-T Alexey-T closed this as completed May 7, 2023
@pintassilgo
Copy link
Author

About original issue- Lazarus event (onMouseLeave) is not called when we move mouse out of the window , so I cannot solve it.

Tab highlighting shouldn't be removed on leaving Cuda window. Above tabs there is menubar. Highlighting should be removed when we move mouse over menubar (or simply out of the tab).

I don't know the code, but it's strange for me this to not be fixable:

  • If you move mouse to the left, when you hover the arrow buttons (scroll tabs left/right) the tab highlight is removed;
  • If you move mouse to the right of the last tab, tab highlight is removed.
  • If you move mouse to below the hovered tab, tab highlight is removed too.

Is menubar really that special type of element?

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

Is menubar really that special type of element?

Yes, it’s painted by OS (only on windows I can change its painting)

@pintassilgo
Copy link
Author

pintassilgo commented May 7, 2023

Is Cuda able to check mouse position?

Example: a timer of 1s is triggered in loop while a tab is hovered. After the interval, mouse position is checked. If it doesn't match tab coordinates (i.e. mouse is no longer hovering the tab), highlight is removed.

@Alexey-T Alexey-T reopened this May 7, 2023
@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

It’s nice idea, timer, I can reuse existing AppIdleTimer.

@pintassilgo
Copy link
Author

pintassilgo commented May 7, 2023

Good to know. Just remembering this issue is not restricted to tabs, it also affects clickable statusbar elements such as Lexer (language) and other elements in window edges (sidebar buttons and maybe others).

@pintassilgo
Copy link
Author

about newly added option - let’s discuss it in new topic.

Should I open a new issue requesting the option to make status message tooltip to be displayed on click instead of on hover?

By the way, maybe the idea above can also be applied to this. Maybe, right before the tooltip showing up, Cuda could check mouse position, so that tooltip should only by displayed if mouse is still over status message. Currently, I proved in video tooltip is appearing even when mouse is out of statusbar.

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

I don’t know how to show hint by click , I tried it. So new issue won’t help.

@pintassilgo
Copy link
Author

pintassilgo commented May 7, 2023

I don’t know how to show hint by click ,

Then I see two possibilities.

  1. One is the second part of my previous comment:

right before the tooltip showing up, Cuda could check mouse position, so that tooltip should only by displayed if mouse is still over status message

  1. The other is a different way to make the hint to show by click: the option would transform the status message into a clickable menu just like the Tab/Spaces button in statusbar. Just with disabled items, as clicking any item would have no effect, being read-only (just to read status message history).

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

Way 2 is good. Made the popup menu on click. Wait for the update pls.

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

Made changes. let's test linux beta.
timer's removing of mouseover highlight must work.
http://uvviewsoft.com/c/

@pintassilgo
Copy link
Author

pintassilgo commented May 7, 2023

  • Timer for highlight removal: works only for statusbar elements. Doesn't work for tabs (initial issue) or sidebar buttons.

  • Status messages list on click: works, but the annoying tooltip is still also appearing. It shouldn't. The menu with messages must replace the tooltip.

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

works only for statusbar elements. Doesn't work for tabs (initial issue) or sidebar buttons.

For me it works in all 3 cases. Gtk2 and Qt5. Try on X session?

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

works, but the annoying tooltip is still also appearing.

Disable the tooltip then, using newly added option which I mentioned

@pintassilgo
Copy link
Author

Disable the tooltip then, using newly added option which I mentioned

I tried, but with "ui_statusbar_hint_lines": 0, the menu on click doesn't work.

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

Ops, I forgot to support all option values!

@pintassilgo
Copy link
Author

For me it works in all 3 cases. Gtk2 and Qt5. Try on X session?

I use Wayland session:

  • Cuda Qt5 Wayland: works in all 3 cases IF I can skip the tooltip. Most of the time the tooltip appears just like in this video and in this case the highlight is not removed.
  • Cuda GTK Wayland: works only for status buttons and with the same limitation of not removing when tooltip appears.
  • Cuda Qt5 Xwayland (this is the one I use): the same as above.
  • Cuda GTK Xwayland: the same as the previous two.

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

Updated betas on the same URL. now you can set new option (statusbar hint lines) to 0 and still have popup on clicking the statusbar-cell.

Cuda Qt5 Xwayland (this is the one I use): the same as above.

I cannot see the issue now - for me on X session, gtk2/qt5, all ok.

@pintassilgo
Copy link
Author

Statusbar messages: fixed, thanks.

Regarding the highlight issue, I'll try to record a video showing my experience.

@pintassilgo
Copy link
Author

cuda.mp4

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

You need to wait for timer-delay==1000ms. maybe you waited less?

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

(Also: you did not leave the window entirely!)

@pintassilgo
Copy link
Author

pintassilgo commented May 7, 2023

You need to wait for timer-delay==1000ms. maybe you waited less?

No. It's how I said: highlight is only removed for status buttons and even there it's only for the random cases the tooltip doesn't appear.

  • Tabs: highlight is never removed.
  • Sidebar: highlight is never removed
  • Status buttons: highlight is removed IF tooltip doesn't show.

(Also: you did not leave the window entirely!)

It doesn't change the results, I can assure you.

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

Tabs: highlight is never removed.

I see it now on Wayland session. sometimes its removed though.

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

I see that on Wayland session getting of mouse coords works bad - if I move cursor out of the window. old coords of mouse are returned....

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2023

I made isolated demo and posted bugreport
https://forum.lazarus.freepascal.org/index.php?topic=63318.new#new

@Alexey-T
Copy link
Owner

Alexey-T commented Apr 25, 2024

I see it is worked around already (Cud 1.213.1 beta). after I move mouse upper, and wait 2-3 secs, tab hover highlight disappears by itself.
gtk2+qt5.
confirmed?

@pintassilgo
Copy link
Author

pintassilgo commented Apr 25, 2024

No. At least for me, using latest beta Qt5, tab hover highlight is never removed if mouse is still above tab bar, even if wait a few seconds without moving the mouse.

@pintassilgo
Copy link
Author

Is any event called when mouse is over file menu (or any of its items)? If it does, it can fix this issue.

@Alexey-T
Copy link
Owner

on Wayland - it's still bad.
tried now to update/repaint Tabs when TimerIdle ticks, did not help.

@pintassilgo
Copy link
Author

pintassilgo commented Apr 25, 2024

Actually what you said is true, but only if I run CudaText without the envvar QT_QPA_PLATFORM=xcb. But I need to set this value to prevent a few other Cuda issues:

  • Without it, Cuda fails to bring the window to the front (window focus) when I open a text file externally while Cuda is already open. For instance by double clicking the file in file explorer.
  • Without it, dialogs such as Command palette are displayed as an extra taskbar window when it shouldn't, because of "ui_dialogs_in_taskbar__linux": false.

If you can fix these two issues, then I can run Cuda as a true Wayland application, without needing to set QT_QPA_PLATFORM=xcb, this way the tab highlighting disappears after a few seconds and I can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants