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

[Bug]: Navigator tabs ButtonSpecs on Navigator tabs are cut off #1843

Closed
MattH-Work opened this issue Nov 14, 2024 · 15 comments
Closed

[Bug]: Navigator tabs ButtonSpecs on Navigator tabs are cut off #1843

MattH-Work opened this issue Nov 14, 2024 · 15 comments
Labels
area:toolkit All issues related to the toolkit components. awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. bug Something isn't working fixed This issue has been fixed. regression Something was working in a previous release, but isn't working now. version:95 All things to do with V95. version:100 All things to do with V100.
Milestone

Comments

@MattH-Work
Copy link

Upgraded from 85.24.10.288 to 90.24.11.317, ButtonSpecs on Navigator tabs are cut off

Upper image shows 85.... ( desired ) result ( using a 16 x 16 image for the ButtonSpec)
Lower image shows 90..... ( erroneous ) result ( top row of image is cut, essentially 16 x 15 )

Both tabs are 25 high, nothing else changed during or after toolkit upgrade

image

@MattH-Work MattH-Work added the bug Something isn't working label Nov 14, 2024
@MattH-Work
Copy link
Author

Newly added ButtonSpecs show the full image, but it is squashed to 16 x 15
image

Issue is when ButtonSpec is Styled as List Item ( newly added buttons style as ButtonSpec / Inherited )

@Smurf-IV Smurf-IV added regression Something was working in a previous release, but isn't working now. version:90 All things to do with V90. version:100 All things to do with V100. area:toolkit All issues related to the toolkit components. labels Nov 15, 2024
@PWagner1 PWagner1 added this to the Version 95 milestone Nov 15, 2024
@giduac giduac changed the title [Bug]: Navigator tabs using latest 90..... toolkit [Bug]: Navigator tabs ButtonSpecs on Navigator tabs are cut off Nov 16, 2024
@giduac
Copy link
Contributor

giduac commented Nov 16, 2024

Hi @MattH-Work,

Thanks for posting.
I've had a quick look at it but can't reproduce this.

Could you please add a simple project that shows the error?

Thanks.

@giduac giduac added the awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. label Nov 16, 2024
@MattH-Work
Copy link
Author

MattH-Work commented Nov 21, 2024

How would I best go about uploading the solution? it zips to 26mb as it uses both Krypton.toolkit.lite & Krypton.Navigator.Lite, 25 is the git limit

@PWagner1
Copy link
Contributor

How would I best go about uploading the solution? it zips to 26mb as it uses both Krypton.toolkit.lite & Krypton.Navigator.Lite, 25 is the git limit

Is it possible to upload it to DropBox. or if you have Windows 11 24h2 it is possible to compress to 7z?

@MattH-Work
Copy link
Author

Now that's too obvious! ( was just wondering if there was any GitHub magic I wasn't aware of )

Here is a link to download a small example of the issue

https://autode.sk/4eFyNfd

@giduac giduac added version:95 All things to do with V95. and removed awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. version:90 All things to do with V90. labels Nov 23, 2024
@giduac giduac self-assigned this Nov 23, 2024
@giduac giduac added the awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. label Nov 23, 2024
@giduac
Copy link
Contributor

giduac commented Nov 23, 2024

Hi @Smurf-IV, @PWagner1,
cc: @MattH-Work

Been doing some testing on this;
The ButtonSpec image does also this on a textbox (probably other controls as well).
In the video it show that several styles produces a different size and make the button move slightly and even resize the textbox in this case.

All styles should be drawn in a rectangle of the same size.
I'd would please have some direction on this as where these buttons / styles are drawn/processed.

B849-UnboundCellCannotSetValue_vhtoT0Kaqu.mp4

@PWagner1
Copy link
Contributor

Hi @giduac

Is it possible to add a 'height' property to button specs?

@Smurf-IV
Copy link
Member

I'd would please have some direction on this as where these buttons / styles are drawn/processed.

@giduac try "playing with these settings" in each of the themes:
image

Also a lot of these will be "Demangled" if I manage to get #1807 done as it is getting quite involved, and will make some of these setting obsolete

@giduac
Copy link
Contributor

giduac commented Nov 24, 2024

@Smurf-IV

This is the problem (-1) at least for list item.
'private static readonly Padding _contentPaddingButtonListItem = new Padding(0, -1, 0, -1);'
and this solves it
' private static readonly Padding _contentPaddingButtonListItem = new Padding(0, 0, 0, 0);'

image

That would solve this problem.
But for some other states it seems that these paddings vary...

@giduac
Copy link
Contributor

giduac commented Nov 24, 2024

@Smurf-IV

This looks stable even when certain styles use different paddings.
So I will change this one setting for all themes.

What do you think of a size property as a new feature for a ButtonSpec which is handled like this:

        /// <summary>
        /// Gets the content image.
        /// </summary>
        /// <param name="state">The state for which the image is needed.</param>
        /// <returns>Image value.</returns>
        public Image? GetImage(PaletteState state)
        {
            // Get value from button spec passing inheritance redirector
            var baseImage = ButtonSpec.GetImage(_redirector, state);

            // Use the size property to resize the image to the requested size
            if (baseImage is not null)
            {
                baseImage = new Bitmap(baseImage, ButtonSpec.Size);
            }

            // No need to perform scaling as it will be done @
            // $\Standard-Toolkit\Source\Krypton Components\Krypton.Toolkit\Rendering\RenderStandard.cs
            // line 5779: memento.Image = CommonHelper.ScaleImageForSizedDisplay(memento.Image, currentWidth, currentHeight);
            return baseImage;
        }

@giduac
Copy link
Contributor

giduac commented Nov 24, 2024

@Smurf-IV

Maybe just one padding for buttonspecs regardless of the style might be an option for the V100 embedded themes...?
That would keep the size and position equal and the controls won' t be resized on a style change...?

@Smurf-IV
Copy link
Member

What do you think of a size property as a new feature for a ButtonSpec which is handled like this:

Not sure, As this will not then following the DPI size changing and might cause even more confusion !

@giduac
Copy link
Contributor

giduac commented Nov 24, 2024

What do you think of a size property as a new feature for a ButtonSpec which is handled like this:

Not sure, As this will not then following the DPI size changing and might cause even more confusion !

OK then that passes.
PRs underway

@PWagner1
Copy link
Contributor

Looks much better!

@giduac
Copy link
Contributor

giduac commented Nov 24, 2024

@PWagner1

That was the intention :).....

@giduac giduac closed this as completed Nov 24, 2024
@PWagner1 PWagner1 added the fixed This issue has been fixed. label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:toolkit All issues related to the toolkit components. awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. bug Something isn't working fixed This issue has been fixed. regression Something was working in a previous release, but isn't working now. version:95 All things to do with V95. version:100 All things to do with V100.
Projects
None yet
Development

No branches or pull requests

4 participants