Skip to content

Add disable option to TextInput - #3449

Open
1-fr33 wants to merge 7 commits into
PixelGuys:masterfrom
1-fr33:textInput-disable-option
Open

Add disable option to TextInput#3449
1-fr33 wants to merge 7 commits into
PixelGuys:masterfrom
1-fr33:textInput-disable-option

Conversation

@1-fr33

@1-fr33 1-fr33 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Mistakenly delated the branch previously, so had to create a new pull request.

@Wunka Wunka moved this to Easy to Review in PRs to review Jul 31, 2026
@IntegratedQuantum

Copy link
Copy Markdown
Member

Could you explain the point of a disabled text input?
I think it would make more sense to add the desired functionality (selecting, copying) to the label, instead of manually disabling all function that edit its contents (and requiring every future contributor of TextInput to know and apply this check)

@IntegratedQuantum IntegratedQuantum moved this from Easy to Review to In review in PRs to review Aug 2, 2026
@1-fr33

1-fr33 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Could you explain the point of a disabled text input? I think it would make more sense to add the desired functionality (selecting, copying) to the label, instead of manually disabling all function that edit its contents (and requiring every future contributor of TextInput to know and apply this check)

The reason for having to add a disabled option is to tell the player that the content of the field cannot be edited. When making the edit_world window, I was thinking of showing the seed value as a Label but it didnt look good. The TextInput changes work without changing any previous code.

@IntegratedQuantum

Copy link
Copy Markdown
Member

So it's mainly the visual difference between a label and a text field? So the background color and (optionally) the scrollbar?
Wouldn't it then be more useful to allow vertical/HorizontalLists to overwrite the background color?

@1-fr33

1-fr33 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Yes, that can be done but It will help us in the long run, I have used a few UI libraries that give us an option to disable the text field, so I think that maybe it is better than changing the background color of of a list.

@IntegratedQuantum

Copy link
Copy Markdown
Member

right, that makes sense.

Comment thread src/gui/components/TextInput.zig Outdated
Comment thread src/gui/components/TextInput.zig
Comment thread src/gui/components/TextInput.zig Outdated
}

fn ensureCursorVisibility(self: *TextInput) void {
self.showCusor = true;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unintended removal

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

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants