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]: KryptonForm's background color is not controllable, anchoring to the bottom needs a little help. #1979

Open
giduac opened this issue Dec 20, 2024 · 10 comments
Labels
bug Something isn't working version:100 All things to do with V100.
Milestone

Comments

@giduac
Copy link
Contributor

giduac commented Dec 20, 2024

Describe the bug
Since the addition of the internal panel to KForm the background color of the panel cannot be controlled.

Expected behavior

  • The State* properties should map or propagate corresponding/connected settings to the internal panel
    When the back color is changed in the StateCommon (in the image) the border only is has it's color changed.

  • When a custom PaletteMode is set on the form, this is not propagated to the internal panel. Controls normally only apply the PaletteMode themselves but in this case it should be.

  • Possibly to be tested, the internal panel's PanelBackStyle property could be exposed via the KForm. Dev's using a panel in the 'old' way might want to do that.

  • On the second and third image it is show that the control is still pulled tot the bottom edge of the form when the bottom anchor is set.
    In the example the grid on the right is set slightly above the bottom and should remain there. When maximized (third image) the grid pulled down to the edge.

  • Since this change is fresh. My idea would've been to control the back colour of the form through the state properties. This would've been a non breaking change for dev's since the old way was to add a panel to get the back color. This way there's no need for programming the behaviour of the internal panel....

On the left grid the KForm properties, on the right the internal panel.
image

The form is in the normal state (on the right) how it's in the designer (on the left).
image

The form is maximized in this case:
image

@giduac giduac added bug Something isn't working version:100 All things to do with V100. labels Dec 20, 2024
@giduac giduac added this to the Version 100 milestone Dec 20, 2024
@Smurf-IV
Copy link
Member

@giduac

Since this change is fresh. My idea would've been to control the back colour of the form through the state properties. This would've been a non breaking change for dev's since the old way was to add a panel to get the back color. This way there's no need for programming the behaviour of the internal panel....

That is what the first attempt at this did, but due to the need for lot's of things to be set (Font's / colours, states) it turned into a flashing monster, and still did not work as expecte for when ribbons are attached !
Also, Most of the existing state#### are for the borders and nothing to do with actual KForm contents !
It's all a bit of a mess, and probably best to undo this and state that a dev "Has" to add a KPanel themselves !

@giduac
Copy link
Contributor Author

giduac commented Dec 20, 2024

@Smurf-IV

When setting the back in State* I would expect the back colour to change.

image

Leave it to the dev (for now?) or for full granular control...
.... public KryptonPanel InternalKryptonPanel => _internalKryptonPanel;

@giduac
Copy link
Contributor Author

giduac commented Dec 20, 2024

That is what the first attempt at this did, but due to the need for lot's of things to be set (Font's / colours, states) it turned into a flashing monster, and still did not work as expecte for when ribbons are attached !
Also, Most of the existing state#### are for the borders and nothing to do with actual KForm contents !
It's all a bit of a mess, and probably best to undo this and state that a dev "Has" to add a KPanel themselves !

Then mapping the state* back properties to the panel's state properties might be the way to go.

@Smurf-IV
Copy link
Member

Then mapping the state* back properties to the panel's state properties might be the way to go.

Agreed. Can this be split into a related Item please ?

Not sure what to do about the anchoring... (yet!)

@giduac
Copy link
Contributor Author

giduac commented Dec 20, 2024

@Smurf-IV

The anchoring is correct within the panel (looking a bit further). The positioning against the border on maximize is correct. It only behaves a bit different. Setting the panel's padding to 1 or 2 should solve this. Needs checking how this relates to the other three edges.

image

@giduac
Copy link
Contributor Author

giduac commented Dec 20, 2024

6 might be the right value (for the bottom):
Adding that panel property would be a good idea since that can be the cure for new tickets...

TestForm_vGIWSubtZX.mp4

@giduac
Copy link
Contributor Author

giduac commented Dec 20, 2024

But that padding should only be applied when the window is maximized....

@PWagner1
Copy link
Contributor

Hi @Smurf-IV & @giduac

Is it possible to just control the BackColor?

@giduac
Copy link
Contributor Author

giduac commented Dec 26, 2024

Hi @Smurf-IV & @giduac

Is it possible to just control the BackColor?
@PWagner1
I also suggested that, but smurf thinks it really needs kpanel.

@PWagner1
Copy link
Contributor

Hi @Smurf-IV & @giduac

Is it possible to just control the BackColor?
@PWagner1
I also suggested that, but smurf thinks it really needs kpanel.

@giduac

What about testing it on a separate branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working version:100 All things to do with V100.
Projects
None yet
Development

No branches or pull requests

3 participants