rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.91k stars 299 forks source link

VBE Toolbars Position & Visibility Aren't Persisted #3215

Open PowerWeb5 opened 7 years ago

PowerWeb5 commented 7 years ago

Rubberduck's VBE toolbars are the only toolbars ones which don't persist where they were placed or whether they were hidden. MZ-Tools, other addins, built-in toolbars, etc. all do so correctly. Also, Rubberduck seems to be the only one to create its own toolbar row, even when there is sufficient space in existing toolbar row.

If you try moving the toolbar to a different row or in between 2 other toolbars (from add-ins and/or built-in ones) you restart Access, Excel, etc. you will see it going right back to its original install location. Also if you hide it and then restart, it gets shown again anyways.

tiny rubberduck toolbar

ThunderFrame commented 7 years ago

this lack of persistence is probably related to the tear-down issue.

PowerWeb5 commented 7 years ago

I was wondering that as well, so I had tested with repositioning built-in and other add-in toolbars to see if crash-on-exit killed prevented them from being persisted, and those layout changes for non-Rubberduck toolbars still do get persisted, regardless of the crash, unlike Rubberduck. Do you have your own toolbar positioning persistence code or registry entries? If so, it seems likely would be tear-down / crash-on-exit related, but I suppose even if not it could be related to that.

PowerWeb5 commented 7 years ago

One possibly quick way to workaround the most annoying aspect of this issue (especially if related to harder to fix tear-down issues) would be to just have the toolbar added to the end (eg. right side) of the existing toolbar row(s), instead of adding it as its own row.

Actually, if you are somehow registering the toolbar as its own row, there is a chance changing that to only add to existing row might even fix the root issue for placement / merging into another row not being persisted, but either way I think will help make this less annoying so doesn't always take up vertical screen space.

Also, are you recreating the toolbar each time instead of just one-time adding and letting VBE manage/persist it?

ThunderFrame commented 7 years ago

This might be because we add the toolbars as Temporary.

PowerWeb5 commented 7 years ago

Ah, that would do it! :smile: Can the toolbar be added permanently instead and/or with default placement into existing toolbar row, if no other major reasons preventing that?

retailcoder commented 7 years ago

That would be a trivial fix.. not sure about placement though - we just .Add the commandbar, nothing tells anything to put it anywhere specific.

PowerWeb5 commented 7 years ago

Great. Just making permanent would be fine, as users can easily reposition one time after that if wanted.

daFreeMan commented 7 years ago

Wow, if that's all it takes!?!?!?