Enlarge the clickable area of the disclosure widget in the Database Navigator view
Description
Currently the clickable area of the disclosure widget in the Database Navigator view is too small and it starts not even from the left edge of the disclosure widget, but from the center of it, that is very confusing because when you mouse over the widget and click it you expect it to collapse/expand the tree item, but it does nothing unless you generously move your mouse to the position right from the disclosure widget (to the empty space between the widget and the item's text).
On the image above with a red line I marked the leftmost edge of the area where mouse click works (and mouse overing hightlights the disclosure widget). A little to the left and it doesn't work anymore.
Here is the video that I hope makes it easier to undertsand the issue. Pay attention to the mouse and when the disclosure widget starts and stops to be dark. When it is dark it means it is clickable. When it is white - it is not clickable, as if the mouse wasn't even over it.
https://github.com/user-attachments/assets/279dd593-0005-4937-8065-d9e8b5521ef0
It would be great to make an empty space to the left from the "disclosure widget" clickable too. So, basically the widget could start from the left edge of the Database Navigator view. This empty space is not used anyway. So I think it would be a better UX because you would not need to pixel-snipe the correct area anymore.
But, even if you disagree with this idea, I think it still worth to make at least the whole widget to be clickable (and maybe a small area of empty space to the left of it). Currently half of the "arrow" is unclickable and behaves as if we click an empty space.
DBeaver Version
Community Edition 24.3.5.202502162012
Operating System
Windows 11 23H2
Database and driver
Irrelevent.
Steps to reproduce
- Try to mouse over any "disclosure widget" (an arrow to the left of a list item in the tree) in the Database Navigator.
- You will notice that the "disclosure widget" is highligted (so, it registers a mouseover event) only when you at the center of the widget and to the right. If you mouse over it to the left from its center, it stops to be highlighted and clicking on it doesn't work anymore. Like you are just clicking on the background, so the click doesn't do anything.
Additional context
I use 150% DPI in the settings of my Monitor. So, maybe the incorrect calculations of the left edge are related to this. But I tried to change the DPI to 100% and the problem didn't disappear. So, maybe DPI is irrelevant.
Also, I have 2 monitors with one set to 200% DPI, while other is 150%. The problem is observable on both of them. Probably it is not important, but who knows.
Update I tried to change the DPI again on the 2nd monitor (that I usually use) and when I set it to 100% and restarted DBeaver, the issue disappeared. The "disclosure widget" and a small empty space (2-3 pixels) left of it became clickable and work as expected. So, I think the problem definitely related to DPI. I tried to enable "Monitor-specific UI scaling" in the "User Interface > Appearance" settings, but it didn't help. With this setting enabled the behavior exactly the same as with it disabled. So, with 100% DPI there is no issue and with 150% DPI there is the issue.
Hello @xak2000
We can't do anything with that, it is a system widget. But you can switch property "Double click on node"
Hello @IvanGorshechnikov
I was afraid of this answer. :)
Yes, I'm aware of "Double click on node" setting, but is not a viable solution because it works globally - for all types of tree nodes. It could be viable for some of them, but specifically for tables it is not, because I need to be able to double-click a table to open its properties/data.
Are you sure this is a system widget and nothing can be done? For instance in the "Preferences" window (on your screenshot) the "disclosure widget" in the preferences tree works fine! It looks slightly different, though. More anti-aliased and slightly bigger (overall it not only works better, but also looks better). So, I assume it is a different "disclosure widget" than what is used in the "Database Navigator" view. Maybe it is possible to use this widget, then, instead?
I assume that the widget used in the "Preferences" window is the standard SWT widget, while the widget in the "Database Navigator" view is some other, custom widget? Just an assumption, of course. I didn't look into the source code.
Update: I checked Eclipse behavior (also uses SWT) and the problem is present here as well. It looks like there are 2 types of tree widgests. One with an icon on the left of each item and one without an icon.
- The one without an icon works fine in both Eclipse and DBeaver. An example is Preferences window in both apps.
- The one with an icon works incorrectly with non-default DPI and the arrow itself looks totally different, so I assume the implementation of the component is totally different.
I don't know which components exatly are used for the one and for the other. I didn't touch SWT for the last 15+ years, so I don't know when to start to investigate this problem. If this is really a bug in SWT, then maybe it is worth to create a bug upstream?
If somebody knows what components exactly are used in both trees (the good one and bad one) and can show me the places in the code where the arrow widget is drawed, please do. :)
This is indeed an Eclipse issue and little to nothing we can do about it. It's caused by using fractional scaling (other than 100%). The same issue was discussed in another ticket: https://github.com/dbeaver/dbeaver/issues/37668
@ShadelessFox
little to nothing we can do about it
Can't we at least create a bug in the Ecplise project and link this and the other issue to it?
I agree that this is Eclipse bug and it must be fixed in SWT, not in DBeaver, but the problem is really annoying and my setup is not very strange/rare. I think many developers have 2+ monitors with more than 100% DPI because 2k and 4k monitors are becoming the norm these days.
Therefore, I think it would be great if DBeaver team coopearte with Eclipse team to fix this problem.
Personally I tried to search Eclipse Bug tracker but it is a mess. I was unable to find an issue that describes exatly this problem. And I'm not sure how to properly create a new bug in the Eclipse bugtracker because I have no idea how the component used by DBeaver is called. Too many technical details needed to properly describe the problem and my knowledge of Eclipse and SWT is too little. :(
@ShadelessFox Another idea is to add additional option to the Preferences for single click action.
Like we see on the screenshot above.
Behaviour:
- Double-click on node.
- Double-click on connection.
We can add a new option:
- Single-click on node:
- Do nothing
- Open properties
- Expand / Collapse
Currently the single click on a node just selects the node, but does nothing else. If it would be possible to "Open properties" on a single click, then it would be totally viable solution to set Double-click on node option to Expand / Collapse as @IvanGorshechnikov suggested, and never suffer from pixel-hunting again.
@xak2000 please create a new ticket
Or I guess we can reopen that one.