-
Notifications
You must be signed in to change notification settings - Fork 317
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
Text input widget #8873
Text input widget #8873
Conversation
const editedValue = ref(props.modelValue) | ||
watch( | ||
() => props.modelValue, | ||
(newValue) => { | ||
editedValue.value = newValue | ||
}, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as in NumericInput
wouldn't hurt, I think.
app/gui2/src/util/measurement.ts
Outdated
/** Helper function to get text width to make sure that labels on the x axis do not overlap, | ||
* and keeps it readable. */ | ||
export function getTextWidthByFont(text: string | null | undefined, font: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update docs in this and getTextWidthByFont
First, they should differ a bit, second it's no longer used for axes only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always assumed widgets in this directory are a "general-usage" widgets. Now, this one is very specific: for editing Enso text literals (not just any text). So I think it could be merged with WidgetText, or renamed to EnsoTextInputWidget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not keen on merging it with WidgetText, at least yet. So I just renamed it.
Pull Request Description
Closes #8823
text.editing.mp4
Adds a basic text widget for text literals.
Important Notes
Several known restrictions:
Text
types, but does not work forText | Integer
, for example)Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.