Krypton-Suite / Standard-Toolkit

An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 to .NET 8 - 9
BSD 3-Clause "New" or "Revised" License
408 stars 62 forks source link

[Bug]: MinimumWidth (and possibly MaximumWidth) on ribbon group not DPI aware. #374

Closed Tape-Worm closed 2 years ago

Tape-Worm commented 3 years ago

I added a single button to a ribbon group, and because the group does not seem to resize based on the group caption (there should be an option for this btw), I set the MinimumWidth property on the group to 90 pixels.

In 96 DPI, I get this: image And this is correct.

But, when I run it at my native DPI in 4k (150%): image As you can see, the group text is now clipped.

If you don't mind a suggestion: Instead of jumping through the hoops required to make it DPI aware, fix it up so that the group min width is based on the caption size (and if MinimumWidth > -1, then use that instead).

Smurf-IV commented 3 years ago

It seems to be thinking that there are invisible buttons to take into account, I have not experienced this (As it also appears in your 96dpi picture.

Tape-Worm commented 3 years ago

Yeah, if you set the MinimumWidth to -1, it will squish the group down and cut off the text even in 96 DPI. I forgot to mention that.

I went through the code, and it appears it doesn't take the caption into account at all when trying to get the size. In fact, it was very difficult to retrieve the size of the caption, and even then, it clips that size to the width of the group.

Smurf-IV commented 3 years ago

It would also be nice if the caption is bigger, for the buttons to then be placed centrally in the group.. But small steps first :-)

Smurf-IV commented 2 years ago

@Tape-Worm Can you raise a "Feature request" for the min to take into account the Caption size please

Smurf-IV commented 2 years ago

Using todays alpha dev code base, and the Ribbon Controls 2022 sample in HDPI OS screen gives the following: image

Will aim to set tracking to have a minimum width, and have a look at the other examples that use single buttons to see if they can be set also.

Smurf-IV commented 2 years ago

Min width is now respected: image

In Ribbon Tooltips; setting "Include" have a min of 300 causes the scrollbar to appears, (i.e. preventing shrink to small first) image

Seems like #393 Fixed this issue.