Merge UIText into UILabel / add scale to UILayout#36
Merged
mcmonkey4eva merged 45 commits intomasterfrom Mar 31, 2026
Merged
Conversation
UIText into UILabel / add scale to UILayoutUIText into UILabel / add scale to UILayout
- fix hover info to bottom left - give element classes proper debug names - only show top 5 hover entries - tab based on hierarchy (tree) level
| /// <summary>The debug name of this element.</summary> | ||
| public virtual string Name { get; set; } = null; | ||
|
|
||
| /// <summary>Whether this element displays additional information in debug mode.</summary> |
Member
There was a problem hiding this comment.
Either flip the bool (AllowDebug = true) or rewrite the doc here to make sense for the negative state
| // hold any right or permission to use this software until such time as the official license is identified. | ||
| // | ||
|
|
||
| using BepuUtilities.Collections; |
Member
There was a problem hiding this comment.
i think the imports here are wonked
|
|
||
| public UIStyling HighlightStyling; | ||
|
|
||
| public new string Content |
Member
There was a problem hiding this comment.
This is dirty. Why does this elem extend UIParagraph and then replace or ignore most of the things that make UIParagraph what it is?
Contributor
Author
There was a problem hiding this comment.
discussed on discord -- noted and I will probably change it to encapsulate a UIParagraph in the future
| IEnumerable<(int, IEnumerable<string>)> topDebugStack = debugInfoStack.Take(Math.Min(5, debugInfoStack.Count)); | ||
| int minimumTreeLevel = topDebugStack.Min(entry => entry.Item1); | ||
| string debugInfo = topDebugStack | ||
| .Select(entry => |
| public string Name = _name.ToLowerFast(); | ||
|
|
||
| /// <summary>Size of the font set.</summary> | ||
| public int Size;// = fontsize; |
| this(lines, | ||
| lines.Length > 0 ? lines.Max(line => line?.Width ?? 0) : 0, | ||
| lines.Sum(line => line?.Height ?? 0)) | ||
| { } |
|
|
||
| /// <summary>Implements <see cref="Object.ToString"/> to make a "\n" separated string of the contents.</summary> | ||
| public override string ToString() => string.Join<RenderableTextLine>('\n', Lines); | ||
| } No newline at end of file |
| : this(parts, | ||
| (int)parts.Sum(part => part?.Width), | ||
| parts.Length > 0 ? parts.Max(part => part?.Font.Height ?? 0) : height) | ||
| { } |
| return (label, image, list); | ||
| } | ||
| } | ||
| } |
| using OpenTK; | ||
| using OpenTK.Mathematics; | ||
| using FreneticUtilities.FreneticExtensions; | ||
| using System; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RenderableText*classes to be easier to work withUILayout's definition and the computed coordinates stored on an individualUIElementUITextand integrated the required functionality intoUILabeldirectlyUILayoutfloatvalue that expands or contracts the size of a particular elementUILabels try to find the closest font size to the desired scaleUIElement.ScaleSizecontrols whether to scale an element (default:true) -- the scale value is propagated to children regardless