oleg-shilo / cs-script.npp

CS-Script (C# Intellisense) plugin for Notepad++ (x86/x64)
MIT License
246 stars 52 forks source link

Impossible to hide CS-Script's main panel #16

Closed dinkumoil closed 6 years ago

dinkumoil commented 6 years ago

After CS-Script's main panel has switched to be visible it is not possible to switch it back to be invisible. Also the toolbar button doesn't reflect the panel's state, the toolbar button is always "Not pressed".

Npp version: 7.5.5 64-Bit CS-Script version: 1.7.8.0 64-Bit

Same problem with 32-Bit versions. This bug was introduced around a year ago.

oleg-shilo commented 6 years ago

I assume you are not talking about not being able to close the panel with the panel close button.

image

Because if you do then closing the panel this way cannot be controlled by the plugin and is entirely up to Npp.

I assume you are refereeing to the toggling the plugin panel visibility by the plugin button/menu:

image

If it is the case then indeed toggle panel visibility has been disabled quite some time ago. It's been replaced with show panel. And this has been reflected in the button tooltip and the menu titles (es well as the release notes at that time).

Interestingly enough, toggling the panel visibility was the initial approach that was active for ~3 years. Though it had to be replaced as it could not deliver predictable user experience. The problem is that Npp does not offer any API for determining if the panel is visible at the time of clicking the "toggle" button. Just keeping track of the hide/show commands is also impossible as it will go out of sync immediately when user uses Npp button instead of the plugin button.

Saying that, I have no problem with having an option for doing toggling instead of showing for the users who prefers this behavior even by sacrificing some elements of User Experience.

I will restore the toggling in the incoming (in a few days) release.

dinkumoil commented 6 years ago

Indeed, I meant toggling the plugin panel visibility by the plugin button/menu (case 2). Case 1 I completly overlooked and I understand the difficulties.

I will restore the toggling in the incoming (in a few days) release.

This would be fine (seems like you did already). Thank you in advance.

The problem is that Npp does not offer any API for determining if the panel is visible at the time of clicking the "toggle" button.

I have installed the MarkdownViewer++ plugin too. It also provides a toolbar button to toggle its panel. This plugin is able to sync the status of its toolbar button and clicking the panel close button (your case 1). Might be interesting for you.

oleg-shilo commented 6 years ago

I had a look at MarkdownViewer++, txs. BTW a very useful plugin. It is using override void WndProc to detect panel closing. A hardcore approach but completely justified in this case.

I have reworked the current implementation and now CS-Script plugin uses the same technique to detect the panel closing.

oleg-shilo commented 6 years ago

The release is now available: https://github.com/oleg-shilo/cs-script.npp/releases/tag/v1.7.9.0

dinkumoil commented 6 years ago

Thanks, that was fast. :1st_place_medal: