Skip to content

Bring back the terminal backend to life. #210

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

migueldeicaza
Copy link

It renames 'CursesBackend' to TermKit, as now TermKit has various console drivers, and curses is just one of them.

The challenge is that TermKit deals with screen sizes like 80x24, not things like 600x400, so both the default sizes and spacing in the codebase will need to compensate for that.

The AppBackend introduces a defaultStackSpacingAmount which is the spacing that VStack and HStack would use, it is currently kept as a default to the existing value, but for the TermKit backend, this value is set to zero.

Now HStack and VStack rather than storing a resolved value like 'spacing: Int', they store the request 'spacing: Int?', which is resolved before it is actually needed by querying the backend for this data.

There is also a new 'limitScreenBounds' that is a no-op for most, but on the curses cases, ensures that a misuse of the defaultSize does not trickle up and down the stack with unrealistic view sizes.

It renames 'CursesBackend' to TermKit, as now TermKit has various
console drivers, and curses is just one of them.

The challenge is that TermKit deals with screen sizes like 80x24, not
things like 600x400, so both the default sizes and spacing in the
codebase will need to compensate for that.

The AppBackend introduces a defaultStackSpacingAmount which is the
spacing that VStack and HStack would use, it is currently kept as a
default to the existing value, but for the TermKit backend, this value
is set to zero.

Now HStack and VStack rather than storing a resolved value like
'spacing: Int', they store the request 'spacing: Int?', which is
resolved before it is actually needed by querying the backend for this
data.

There is also a new 'limitScreenBounds' that is a no-op for most, but
on the curses cases, ensures that a misuse of the defaultSize does not
trickle up and down the stack with unrealistic view sizes.
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.

1 participant