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

Minimum Size for Auto-Checking 'In selection' tooltip stay on screen #14287

Closed
rddim opened this issue Oct 28, 2023 · 11 comments
Closed

Minimum Size for Auto-Checking 'In selection' tooltip stay on screen #14287

rddim opened this issue Oct 28, 2023 · 11 comments
Assignees

Comments

@rddim
Copy link
Contributor

rddim commented Oct 28, 2023

Description of the Issue

When I hover the field for adding the minimum size for auto-checking the tooltip appear on the screen and dissapear after about 30 seconds. If I hover on it it will dissapear immediatly. Also it doesn't dissapear if I click on other tabs in the Preferences window. Also keep on the screen even if I close the Preferences.

Steps to Reproduce the Issue

  1. Go to Settings > Preferences... > Searching
  2. Hover the field next to the Minimum Size for Auto-Checking 'In selection' to show the tooltip
  3. Click on other tabs like Backup, Print etc

Expected Behavior

I expect the tooltip to hide as soon as I move the cursor from the field.

Actual Behavior

The tooltip stay on screen.

Debug Information

Notepad++ v8.5.8   (64-bit)
Build time : Oct 15 2023 - 21:43:56
Path : \npp.8.5.8.portable.minimalist.x64\notepad++.exe
Command Line : 
Admin mode : ON
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 10 Enterprise LTSC 2019 (64-bit)
OS Version : 1809
OS Build : 17763.316
Current ANSI codepage : 1251
Plugins : none

Other Info

Animation

@alankilborn
Copy link
Contributor

Tooltip for in-selection integer is done the same way as tips on the "Editing" subpage of "Preferences". One difference is that this is an edit control -- does that matter? Maybe @xomx has some idea for this...?

@xomx
Copy link
Contributor

xomx commented Oct 29, 2023

@alankilborn

edit control -- does that matter?

It could be the reason.

As N++ uses here automatic subclassing (TTF_SUBCLASS):

toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS;

it relies on the inherent tooltip-ctrl subclassing of that edit-ctrl wnd to intercept its mouse messages for the correct tooltip functionality.

It looks like to me that the Windows OS does not automatically send the WM_MOUSELEAVE message to the edit controls. Possible solution - subclassing of the IDC_INSELECTION_THRESHOLD_EDIT ctrl and then, when the mouse enters its ctrl-area, calling the TrackMouseEvent to get it to notify when the WM_MOUSELEAVE occurs and act (hiding the tooltip manually etc).

But if I were you, I would choose a much simpler solution like (just add such btn-ctrl next to the edit-ctrl):

npp-tt

Obviously someone here probably solved a similar problem ...

@alankilborn
Copy link
Contributor

I would choose a much simpler solution like (just add such btn-ctrl next to the edit-ctrl)

Yes, will do. Thanks for your insights.

@alankilborn
Copy link
Contributor

@donho Please assign me to this issue and I'll fix it -- thank you.

@alankilborn
Copy link
Contributor

alankilborn commented Nov 3, 2023

@xomx One more tiny detail...

For the ? button in the Word character list area that you showed, I noticed that if I use the tab key in that dialog, the ? button will get stopped upon (i.e., gets input focus) in the tab order. However, it does not have the WS_TABSTOP style as you can see HERE.

Now I see that most controls in that same area don't have the WS_TABSTOP style on them, but yet the tab key cycles between them...hmm.

I'm not out to change/fix the "word list" area, but I was thinking that, for the "in selection" version of the ? button, it should NOT get input focus as the tab key is pressed, i.e., it should be skipped -- because only the mouse will cause the tooltip to appear, and otherwise the button does nothing (so tabbing input focus to it is not useful). Does this make sense to you? If so, any idea on how to achieve said "skipping" in the tab order for the ? button?

@xomx
Copy link
Contributor

xomx commented Nov 3, 2023

@alankilborn

I noticed that discrepancy (WS_TABSTOP) too.
I think that there are some common rules to explain the observed behavior, but I no longer remember them, sorry.

the ? button, it should NOT get input focus as the tab key is pressed, i.e., it should be skipped

IMO - it is ok that this ? button can be "tab-focused". One could always e.g. assign a keyboard shortcut to simulate the mouse-hover action (to obtain the tooltip by keyboard only). E.g. I think that the VSCode has some key-combo exactly for that...

@alankilborn
Copy link
Contributor

@xomx

it is ok that this ? button can be "tab-focused"

I can live with it. :-)

One could always e.g. assign a keyboard shortcut to simulate the mouse-hover action (to obtain the tooltip by keyboard only)

That would be a very strange person indeed! :-)

Thanks for your thoughts (again).

@Yaron10
Copy link

Yaron10 commented Nov 3, 2023

@alankilborn,

Regardless of your final decision, have you tried NOT WS_TABSTOP?

@alankilborn
Copy link
Contributor

Regardless of your final decision, have you tried NOT WS_TABSTOP?

No, but I will.
I have never seen "NOT something" in an RC file before!

But I would have seen it if my model had been IDC_BUTTON_NPC_NOTE instead of IDD_WORDCHAR_QUESTION_BUTTON:

PUSHBUTTON      "?",IDC_BUTTON_NPC_NOTE,339,14,16,14,NOT WS_TABSTOP

@Yaron10
Copy link

Yaron10 commented Nov 3, 2023

We should always chose the correct role model. :)

@xomx
Copy link
Contributor

xomx commented Nov 3, 2023

@alankilborn

That would be a very strange person indeed! :-)

Found it ;-)

Show Hover Ctrl+K Ctrl+I editor.action.showHover

https://code.visualstudio.com/docs/getstarted/keybindings#_rich-languages-editing

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

Successfully merging a pull request may close this issue.

4 participants