mitchcapper / KPEntryTemplates

KeePass Entry Templates for custom gui displays of your entries.
302 stars 27 forks source link

Scrollbars in Template Creation are not being taken into account #41

Closed iamhammer closed 5 years ago

iamhammer commented 6 years ago

On the Template tab of creating a new template, it looks like there are two elements at fault for created unnecessary vertical and horizontal scroll bars.

  1. The horizontal scrollbar looks to be created by the width of the table. Even though it is a fixed width table, it looks to not take into account the width of the 'Option' column. See issue #40
  2. The vertical scrollbar is created due to a vertical filler space placed beneath the fields. It looks like the height calculation used to fill the available vertical space does not take the presence of horizontal scrollbar into account, and subsequently the Remove as Template button is always obscured by the horizontal scrollbar.

2018-05-11_13-27-38

In Templates with many fields this even causes nested scroll bars. 2018-05-11_13-14-39

mitchcapper commented 6 years ago

What platform are you on? What resolution, what DPI/scaling, what keepass version? This does not happen for me on keepass 2.39 win10.

iamhammer commented 6 years ago

On Windows 8.1: 1920 x 1080. Scaling isn't presented in the same way from settings, but if I select advanced and "Let me choose one scaling level for all my displays", it says I'm at the default 125%

image

On Windows 8.1 I don't get the horizontal scrollbar, and can see the Option column, but there is still a vertical scrollbar.

image

iamhammer commented 6 years ago

On Windows 10: Monitor 1: 3840 x 2160 with 250% scaling Monitor 2: 1920 x 1080 with 100% scaling The previous images were taken.

mitchcapper commented 6 years ago

Is the windows 10 machine one machine or two machines? I wonder if it i somehow specific to the scaling / dual monitors (Ie if it was just monitor 2 and no monitor 1 after a restart would it be fine).

iamhammer commented 6 years ago

It's a laptop with an external monitor plugged in. I've disconnected the monitor, reduced the resolution and scaling to match the Windows 8.1 settings. No change. I've tried a number of resolutions and scalings with just the built in display and nothing seems to make a difference in the appearance... I am still getting the horizontal and vertical scrollbars.

mitchcapper commented 6 years ago

Is monitor 1 the laptop monitor (3840x2160) or is it the 1920x1080. Also you might have to log off and back on after making a change for DPI. KeePass also does various DPI tricks.

iamhammer commented 6 years ago

The laptop is monitor 1, which I believe the native resolution is 3840x2160. I disconnected the external monitor. Set the resolution to 1920x1080 and reduced the scaling before rebooting. I think I got everything in the right order, not sure what KeePass does.

On Fri, May 11, 2018, 6:33 PM Mitch Capper notifications@github.com wrote:

Is monitor 1 the laptop monitor (3840x2160) or is it the 1920x1080. Also you might have to log off and back on after making a change for DPI. KeePass also does various DPI tricks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mitchcapper/KPEntryTemplates/issues/41#issuecomment-388501786, or mute the thread https://github.com/notifications/unsubscribe-auth/ABn8zMNrm36J8e_O3wZbuxA9AXmNfgyEks5txhGogaJpZM4T7z1_ .

mitchcapper commented 6 years ago

@iamhammer to confirm after rebooting with scaling at 1920x1080 it still was an issue?

iamhammer commented 6 years ago

Yes sir.

On Sun, May 13, 2018, 8:34 AM Mitch Capper notifications@github.com wrote:

@iamhammer https://github.com/iamhammer to confirm after rebooting with scaling at 1920x1080 it still was an issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mitchcapper/KPEntryTemplates/issues/41#issuecomment-388623634, or mute the thread https://github.com/notifications/unsubscribe-auth/ABn8zP9jZs1teTsyGnNpTK-oo8dNSGh-ks5tyCg5gaJpZM4T7z1_ .

mitchcapper commented 6 years ago

Do you run any keepass plugins that affect the windows like keeresize? Any windows theming applications or custom window managers?

Things like this are odd as it should autodetect the max size and fit to form. Technically we don't use DGV scrollbars for anything so I have patched it lets see if that fixes it. NOTE to make sure you are running this PLGX you should see the Opt field has been renamed Zpt. Try this plgx: KPEntryTemplates.zip

mitchcapper commented 6 years ago

Actually try this one instead, should show the OPT field with the name Npt. KPEntryTemplates.zip

iamhammer commented 6 years ago

I created a new folder for KP 2.39 portable as a blank slate. There are no other plugins in this setup. I changed my resolution back to 1920 x 1080 with 125% scaling and restarted.

No scrollbars! Looking good.

I don't have Keeresize, or any desktop theming software that I believe would interfere, but I will continue testing resolution, scaling, and adding back in the other KP plugins I do use to see if I can nail down the issue.

mitchcapper commented 6 years ago

@iamhammer Thanks! As a side note try the patched version I attached above. To clarify on the template screen rather than "Opt" you should see Npt. It may prevent the vertical/horizontal scrollbars in your original config as well. Will be curious to here what was causing it though.

iamhammer commented 6 years ago

Yep, this was using the patched version with the Npt column header. I had a better write up but then accidentally closed the tab. Immediate motivation to go out and find a plugin akin to my old favorite Lazarus for form recovery.

Anyhow, it appears to be solely driven by scaling at this point. I can change the resolution without having scrollbars appear. When I adopt Window's recommended resolution of 3840x2160 because this is a high DPI monitor (laptop), it pushes a recommended scale of 250%. I can have that native recommended resolution (3840x2160) or 1920x1080 and not show scrollbars when the scaling is set to 125%. Setting the scaling to 250% though has the scrollbars appear.

iamhammer commented 6 years ago

I think I'll wind up taking the resolution down eventually. The high resolution has been good for screen captures.

Using the 3840x2160 and scaling of:

mitchcapper commented 6 years ago

Ok. With the original 2.39 version @ 175% do scrollbars appear? I am mainly trying to determine if the Npt version is beneficial in any way.

Unfortunately DPI/Scaling/WinForms/KeePass is not the most fun to troubleshoot. If I get my hands on a machine that requires that level of scaling at some point I may see if I can troubleshoot further, but as it is only on template design and fairly tricky to probably fully fix (if not a winforms bug) it may last a bit.

iamhammer commented 6 years ago

The scrollbars do not appear in the 2.39 preview version either. But if I bumped it up to 200% they probably would. The resolution switch between 3840x2160 vs 1920x1080 produces identical results. Could be because one is exactly a quarter of the other and makes for clean division. 1920 3840

mitchcapper commented 6 years ago

Ok and on the NPT version @ 200% you get both horizontal and vertical scrollbars and a double vertical scrollbar with lots of entries right?

iamhammer commented 6 years ago

The behavior of the outer horizontal and vertical scrollbars is consistent across the initial 2.39 preview version, the NPT and the ZPT versions:

For templates with many fields the double vertical appears in the initial 2.39 preview, but not the NPT nor the ZPT versions.

rangerxusa commented 6 years ago

I posted the following in a related thread. Adding to this issue that I did try the plugin above with NTP as the OPT column name and it did not resolve the problem with unnecessary scroll bars in the edit template parent window. I am not using KeeResize.plgx but do scale Windows 10 to 125%.

Just adding that I am having the same issues. Windows 10 (will try Windows 8.1 but in the past have had the same problem. The Edit Entry window of template child is distorted until I resize the windows (and then the buttons are wrongly aligned to the right) and also the edit entry template parent windows has unnecessary vertical and horizontal scroll bars. •Using KeePass 2.39.1 with Windows 10 display scaling at 100% or 125% and KPEntryTemplate.plgx 7.8 beta and no KeeResize.pglx - template child is fine and template parent has unnecessary scroll bars. •Using KeePass 2.39.1 with Windows 10 display scaling at 100% or 125% and KPEntryTemplate.plgx 7.8 beta AND KeeResize.pglx - template child is distorted and resize of window makes it somewhat better but the remove as template child button is right justified and the OK button is not visible. Template parent has unnecessary scroll bars.

So the display scaling seems to have no impact on the problem. Without KeeResize.pglx the only issue is the unnecessary scroll bars in the template parent. With KeeResize.pglx the template child (and other edit entry windows are distorted. Resizing windows helps somewhat but still not very usable.

mitchcapper commented 6 years ago

@rangerxusa I have tried a few scaling factors without being able to recreate the problem. @iamhammer indicated it was only on >= 200 that it became an issue. I am surprised @ 100 or 125% you are having a problem.

I do not use keeresize but will grab it to test as well.

Is there anything else you are aware of that could be altering your windows (window management tools, theming, etc?).

The NPT plugin version disables horizontal scrollbars completely both on the page and on the datagridview. The fact they show up is very curious especially if they are showing up at lower scales something most users would have happening. The datagridview sets the size of a few columns but then the others just fill the space which should make it near impossible for the scrollbar to show up there. The datagridview itself is set to the width and height of the tab but could be set smaller.

rangerxusa commented 6 years ago

I will retest tonight on both windows 10 and windows 8.1 just to be sure I was accurate in my results and then post my findings here. I can't think of anything special on my machines that would alter my display. I will try different DPIs also. Regarding the impact of KeeResize.plgx it does seem to cause real incompatibilities with your plugin. I only use the free version which only allows changing the edit entry window (which includes your template edit windows). Between the two I will forego the KeeResize.plgx if necessary to use your plugin but being able to use both would be best of course.

mitchcapper commented 6 years ago

No need to test 8.1. KeeResize support is horrid, I didn't test the changes (as I don't use that module) but after installing it, it does not work well. It may work OK for paid versions where resizing occurs on form load but this certainly has problem. I will see if I can make it usable but I can say it seems to have some scaling issues to start I am not sure if I can fix due to how the KP DPI scaling is done.

rangerxusa commented 6 years ago

I did a test on Windows 8.1 using plugin with NTP as opt column header. Did not use KeeResize.plgx. At both display scaling of 100% and 125% I saw the unnecessary scroll bars on the edit parent template form window. Don't know why I get them when you thought it was resolved especially on Windows 8.1. I have nothing special on my device nor customizations. BTW did you see in the other post my comment that your 7.8 beta template is showing for Rich Boxtext type one line more than specified in it's OPT setting?

iamhammer commented 6 years ago

@RangerXus What resolution is your monitor set to?

mitchcapper commented 6 years ago

@rangerxusa Win 8.1 was not needed testing on, for that was just iamhammers other machine. As you see scrollbars at 100 and 125 where most don't however is what is confusing. Do you have any accessibility features turned on?

rangerxusa commented 6 years ago

Because of your insistence that it works for everyone else under Windows 8.1 I took a different approach. I removed all plugins except yours, cleared the plugincache and your plugin worked fine. I continued testing and determined that the unnecessary scrollbars appeared in the parent template entry when I loaded a plugin called KeyAgent 0.10.1 by David Lechner. KeyAgent also adds a new tab to the entry window. There apparently is a conflict between KeyAgent and KPEntryTemplates.

mitchcapper commented 6 years ago

@rangerxusa Thank you! I downloaded KeyAgent and have been able to repro the scrollbars at the lower resolution/scaling.

One of the problems may be related to the scaling call. As KPEntryTemplates dynamically generates the form tab it has to call to scale it after it is loaded. This does not seem to have any negative effects on the rest of the form (which has scaling attributes set) but might be to blame. Now that I can repro your issue will see if I can figure out a solution.

rangerxusa commented 6 years ago

Great! I too am glad I was able to identify what was causing the problem with scroll bars. I don't use the functionality of KeeResize very often so if you cannot resolve the compatibility with that plugin at least for me that is not a big deal and I won't load KeeResize as your plugin's functionality is more important. I do use KeeAgent as a replacement for PuTTy Pageant so I need to use that plugin. But the impact on KeeEntryTemplate is more a minor visual annoyance than anything functional so if you can't resolve the conflict both are still usable together. If you need me to test or to open an issue with the KeyAgent plugin author let me know. Thanks for looking further into this.

iamhammer commented 6 years ago

Sorry I've been go so long. I've been out of state, but I am back now. The scrollbar issues did not present for me as a result of another plugin.

iamhammer commented 6 years ago

I've been tinkering around with the compatibility settings and have found some improvement... image image