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

[Feature Request]: Controls should have "min design heights" be the same. #615

Open
MattH-Work opened this issue Jan 28, 2022 · 26 comments
Open
Labels
area:designer All issues related to the designer. area:toolkit All issues related to the toolkit components. enhancement New feature or request new feature A new feature has been requested. suggestion A suggestion has been requested. version:100 All things to do with V100.
Milestone

Comments

@MattH-Work
Copy link

It would be beneficial to allow 'input' controls (ComboBoxes, TextBoxes, NumericUpDown, DateTimePicker etc) to have their heights modifiable independently of the Font size.

Textbox height can change if set to multiline, whereas ComboBoxes (my main reason for this post) and other controls are linked to their font size

Default Heights
Textbox 23
NumericUpDown 22
Combox 21
DateTimePicker 21

It’s only a pixel here and there ( slight OCD triggering, 1st world problems and all! ), but its noticeable when controls don't line up on forms

I do note that the height increases when using ButtonSpec, or adding Rounding to the borders, so it feels the code for manipulating the heights exists in the background

@MattH-Work MattH-Work added enhancement New feature or request new feature A new feature has been requested. suggestion A suggestion has been requested. labels Jan 28, 2022
@PWagner1
Copy link
Contributor

@Smurf-IV Is this possible?

@Smurf-IV
Copy link
Member

Probably, But I think having them all the same size would be a good start !

@MattH-Work
Copy link
Author

Recently found that changing Minimum & Maximum size

image

allows me to set the height of the control, which solves this particular issue for me

@Smurf-IV
Copy link
Member

Smurf-IV commented Jun 9, 2022

@MattH-Work Great find.
@Wagnerp Controls should have "min design heights" be the same.

@Smurf-IV Smurf-IV changed the title [Feature Request]: Control height to be customisable [Feature Request]: Controls should have "min design heights" be the same. Jun 9, 2022
@Smurf-IV
Copy link
Member

Smurf-IV commented Jun 9, 2022

@Smurf-IV Smurf-IV added version:85-lts All things to do with V85 LTS. version:90 All things to do with V90. labels Jul 7, 2024
@Smurf-IV Smurf-IV modified the milestones: Version 90, Version 85 Jul 7, 2024
@Smurf-IV Smurf-IV self-assigned this Jul 13, 2024
@Smurf-IV Smurf-IV added under investigation This bug/issue is currently under investigation. area:designer All issues related to the designer. area:toolkit All issues related to the toolkit components. labels Jul 13, 2024
@Smurf-IV
Copy link
Member

https://docs.microsoft.com/en-us/dotnet/core/compatibility/winforms#change-description Make all controls 27% bigger !

I'll make min heights to be 30, and that will cover both the above (i.e. 23 * 1.27 = 29.###) and when corners are used, and when a button spec is inserted.

@Smurf-IV
Copy link
Member

Smurf-IV commented Jul 13, 2024

The Problem is now that Up Downers and Drop Downs DO NOT FILL, into the larger space:
image

@Smurf-IV
Copy link
Member

Done and also make the NumUpDowner center when using a smaller font:
image

@Smurf-IV Smurf-IV assigned Smurf-IV and unassigned Smurf-IV Jul 14, 2024
@Smurf-IV
Copy link
Member

Note: Won;t fix for V85 as there are tooo many changes

@Smurf-IV Smurf-IV removed under investigation This bug/issue is currently under investigation. version:85-lts All things to do with V85 LTS. labels Jul 14, 2024
@Smurf-IV Smurf-IV modified the milestones: Version 85, Version 90 Jul 14, 2024
@MattH-Work
Copy link
Author

https://docs.microsoft.com/en-us/dotnet/core/compatibility/winforms#change-description Make all controls 27% bigger !

I'll make min heights to be 30, and that will cover both the above (i.e. 23 * 1.27 = 29.###) and when corners are used, and when a button spec is inserted.

I have all my krypton controls set to 25, will I still be able to reduce the height lower than the 30 ( standard ) minimum you have proposed via the controls minimum height designer setting?

@Smurf-IV
Copy link
Member

I have all my krypton controls set to 25, will I still be able to reduce the height lower than the 30 ( standard ) minimum you have proposed via the controls minimum height designer setting?

Short answer:
No.

Long Answer:
Yes, it would be possible, as you would have to override the virtual function that sets the minimum (In each control and the base), but then this would not be compatible with:

  • Segoe UI @ 9pt
  • The Way windows expects things to be more "Touch friendly" (Hence the 27% bigger thing)
  • Screen HDpi settings

@Ahmed-Abdelhameed
Copy link
Contributor

@MattH-Work

This is not specific to Krypton controls. The corresponding WinForms controls (read: ComboBox, NumericUpDown, etc.) work the same way. Changing how the height of these controls is managed is likely to cause other problems if you're not careful (read more in my other comment).

As to the alignment issue, I also like my controls to be aligned but the WinForms designer already has tools to help with this. Check the Format menu. I even have custom shortcuts to help me align controls quickly.

image
image

CC: @Smurf-IV
CC: @Wagnerp

@Smurf-IV Smurf-IV reopened this Jul 17, 2024
@Smurf-IV
Copy link
Member

Now that this is re-opened (due to reverting the code!), This needs to be dealt with:
image

@Ahmed-Abdelhameed
Copy link
Contributor

Hi @Smurf-IV

I might be missing something obvious but is this relevant? Hasn't Krypton Toolkit always used a different default font (which happens to be Segoe UI 9 pt as well. How does changing the default font of Microsoft's WinForms controls come into play here?

@MattH-Work
Copy link
Author

@MattH-Work

This is not specific to Krypton controls. The corresponding WinForms controls (read: ComboBox, NumericUpDown, etc.) work the same way. Changing how the height of these controls is managed is likely to cause other problems if you're not careful (read more in my other comment).

As to the alignment issue, I also like my controls to be aligned but the WinForms designer already has tools to help with this. Check the Format menu. I even have custom shortcuts to help me align controls quickly.

image image

CC: @Smurf-IV CC: @Wagnerp

I'm aware of the alignment controls and use them frequently, however, even with all controls aligned to 'tops', the bottoms are up and down, it just doesn't look professional, hence why I opted ( for an OCD pleasing ) 25 height for all my controls, small enough to fit all required controls on the page, large enough to see

@Smurf-IV
Copy link
Member

Thanks for all the comments .. Keep them coming.
What I see as problems for this are:

  • Controls when initially laid out int Krypton are different sizes (No argument there)
  • They need to work for different "Base Fonts" (which just happen to be Segoe UI for V9)
  • They need to be sensible min size
  • They need to be able to deal with the curvature of borders
  • and the insertion of buttons specs and not overly "Resize"
  • Maybe have some size that can be set (Not sure how that would work as designers [They are individual until runtime] know nothing of the runtime values during design !)

Proposal:

  • Set minSize to 25
  • Make sure that when using smaller fonts, that controls center their buttons correctly (See the original PR for the numUpDowner and ComboBox etc.)
  • Ignore "Extra" space requirements for the rounding of borders (As that should be applied to all controls so therefore the increase should be constant across them)

Thoughts ?

@giduac
Copy link
Contributor

giduac commented Jul 18, 2024

For interfaces with a lot of controls like VStudio controls that can/must be small are good to have like this one:
image

First do a proof of concept to see:

  • if it is possible to make all those controls resizable from a minimal fixed size to....?
  • what would be a minimal fixed size (to fit buttons specs)?
  • make all these controls react to the alignment properties
  • What will it take to make this a full fledged feature throughout the Toolkit?

From that PoC we can discuss further how to proceed.

@MattH-Work
Copy link
Author

is it is possible to make all those controls resizable from a minimal fixed size to....?

Agreed. I like the idea of a standard height, uniform across all controls, but still needing the option to reduce / increase on a case by case basis using Minimum & Maximum Size control

image

what would be a minimal fixed size (to fit buttons specs)?

Being selfish, as my button spec images are based on a standared icon size of 16x16, having the default standard control height set to 25 seems spot on

image

make all these controls react to the alignment properties

Not sure what you mean, don't they already align by tops, lefts, middles etc?

@giduac
Copy link
Contributor

giduac commented Jul 18, 2024

is it is possible to make all those controls resizable from a minimal fixed size to....?

Agreed. I like the idea of a standard height, uniform across all controls, but still needing the option to reduce / increase on a case by case basis using Minimum & Maximum Size control

image

what would be a minimal fixed size (to fit buttons specs)?

Being selfish, as my button spec images are based on a standared icon size of 16x16, having the default standard control height set to 25 seems spot on

image

make all these controls react to the alignment properties

Not sure what you mean, don't they already align by tops, lefts, middles etc?

Yes, some control's alignments properties IIRC need a check.
The minimum height can be a constraint.
The standard sizes used by each control should be the same as it's WinForms counterpart or as close to it as can be.

@Ahmed-Abdelhameed
Copy link
Contributor

Ahmed-Abdelhameed commented Jul 18, 2024

Hi @Smurf-IV
CC: @giduac & @MattH-Work

Note that even when Microsoft made the change you referred to above in .NET Core 3.0, they didn't increase the MinimumSize of the controls. They changed the font, which increased the default (not minimum) size of some controls.

I'm not opposed to making changes to the default size, but I don't see a good reason to change the minimum size of all control. Maybe some controls need to have their size constrained (for example, a KTextBox with ButtonSpecs currently, doesn't shrink even if you use the smallest font possible, which is good), but this should be done on a control-by-control basis (where warranted), to avoid unintended side effects.

They need to work for different "Base Fonts" (which just happen to be Segoe UI for V9)

Is there a problem with that currently?

They need to be sensible min size

Default size? Maybe. Min size? I don't know. Why?

and the insertion of buttons specs and not overly "Resize"

Maybe having a max size for button specs would help here?

@PWagner1
Copy link
Contributor

Hi @MattH-Work, @Smurf-IV, @giduac & @Ahmed-Abdelhameed

Should I turn this into a discussion?

@MattH-Work
Copy link
Author

See some additional thoughts here
#1636 (comment)

@Smurf-IV
Copy link
Member

Smurf-IV commented Jul 20, 2024

@MattH-Work

So to wrap it up, give us a consistent default height, but still allow it to be altered ( reduced & increased ) via Minimum & Maximum height setting in the designer, which would then give correct 'alignment' results

Is that not what you already have ? (AS you have already demonstrated via you use of MinSize !)

Thanks for the Layout diagrams you did in the merge conversation,
Can I ask that you perform a "Max Size" reduction as well ? to see what Winforms and Krypton do ?

@Smurf-IV
Copy link
Member

Hi @MattH-Work, @Smurf-IV, @giduac & @Ahmed-Abdelhameed

Should I turn this into a discussion?

No, AS things get lost "Over there"
As "New things are discovered" then just create related linked articles..
i.e. #1651

@Smurf-IV
Copy link
Member

Smurf-IV commented Jul 20, 2024

@MattH-Work
My 1.5 cents on this.

1 If you go for a fixed initial height existing interfaces need to be reformatted, imo that's undesired.
2 Making all controls sizeable would be a great plus.
3 If a proof of concept is done minimum / maximum size and corresponding font heights can be explored and tested.

1 - Agreed, Hence V90 only work.
2 - That is currently possible as has been demonstrated via the use of MinSize
3a - Not sure what this means, but as has already been seen Winforms and Krypton both have quirks !
3b - What could be done (And hence via related articles) is

@Smurf-IV
Copy link
Member

Hi @Smurf-IV CC: @giduac & @MattH-Work

1 - Note that even when Microsoft made the change you referred to above in .NET Core 3.0, they didn't increase the MinimumSize of the controls. They changed the font, which increased the default (not minimum) size of some controls.

2 - I'm not opposed to making changes to the default size, but I don't see a good reason to change the minimum size of all control. Maybe some controls need to have their size constrained (for example, a KTextBox with ButtonSpecs currently, doesn't shrink even if you use the smallest font possible, which is good), but this should be done on a control-by-control basis (where warranted), to avoid unintended side effects.

They need to work for different "Base Fonts" (which just happen to be Segoe UI for V9)

3 - Is there a problem with that currently?

They need to be sensible min size

4 - Default size? Maybe. Min size? I don't know. Why?

and the insertion of buttons specs and not overly "Resize"

5 - Maybe having a max size for button specs would help here?

1 - Ok, So Krypton accidentally did the same by also using Segoe UI 9pt ;-)
2 / 4 - As above: "Have the minSize recommendation set for new controls, (but not an enforced minsize as per original PR) that can be "reset" to Original Winform "messed up" heights"
3 - Yes, Still using a 9pt font but using "Small characters" then controls like the number up downer "Get confused":
image
The image shows what happens with the PR - Before it was rolled back. Now that is has been rolled back, the font and the buttons will be "Rammed" into the top of the control but because it's still a 9pt layout the "Height" of the control will still be the same !!!
5 - I think it is based on the image ans having a padding around it, then the "Height" of the control has to be able to "Take it!"

@PWagner1 PWagner1 added version:95 All things to do with V95. and removed version:90 All things to do with V90. labels Oct 21, 2024
@Smurf-IV Smurf-IV added version:100 All things to do with V100. and removed version:95 All things to do with V95. labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:designer All issues related to the designer. area:toolkit All issues related to the toolkit components. enhancement New feature or request new feature A new feature has been requested. suggestion A suggestion has been requested. version:100 All things to do with V100.
Projects
None yet
Development

No branches or pull requests

5 participants