Skip to content

Conversation

@portfiend
Copy link
Contributor

@portfiend portfiend commented Jan 5, 2026

This PR cleans up the initialization code of ColorSelectorSliders.cs by turning it into a Robust XAML control, which, from what I can gather, is something we are aiming to do eventually anyway.

It also adds a new hex color field to the control, allowing players to (for once!) actually copy-paste colors to/from the color sliders, which is IMO pretty important for QOL

color.mp4

@portfiend portfiend marked this pull request as ready for review January 6, 2026 19:05
@portfiend
Copy link
Contributor Author

ready for review

Comment on lines 7 to 9
/// A LineEdit control that displays in a monospace font.
/// Because the font is monospace, this allows you to resize the control based on the size
/// of a given "test string", using <see cref="MeasureText"/>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhm, that has nothing to do with it being monospace?

Also this API is too niche to be public.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holy copy paste

@portfiend portfiend requested a review from PJB3005 January 10, 2026 21:29
@portfiend
Copy link
Contributor Author

tried my best to address the reviews


[GenerateTypedNameReferences]
[Access(typeof(ColorSelectorSliders))]
public sealed partial class AlphaSliderChannel : BoxContainer, ISliderChannel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be public


[GenerateTypedNameReferences]
[Access(typeof(ColorSelectorSliders))]
public sealed partial class ColorSliderChannel : BoxContainer, ISliderChannel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be public

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to be clear:

  1. robust xaml can't generate controls that aren't public, right
  2. if yes, then in this case, we want these controls to be pure c#?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robust xaml can't generate controls that aren't public, right

Yes it can?

Copy link
Contributor Author

@portfiend portfiend Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh huh, i feel like i was getting errors last time i tried. i could give it a shot later...? are there examples in the code where this is done?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there examples in the code where this is done?

All over the place in engine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants