-
Notifications
You must be signed in to change notification settings - Fork 6
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
[FEATURE] Adjustable modules #8
Comments
Looking at termui's docs quickly, looks like it doesn't support relative sizing, only absolute, unlike tview, which is surprising. But I assume it shouldn't be too difficult to calculate manually by using x/term to calculate the terminal's size 🙂 |
it does x, y := ui.TerminalDimensions()
l.SetRect(0, 4, x, y) |
That's what I get for only searching "Size" 😅 x, _ := ui.TerminalDimensions()
ratio := 220 / x
if ratio < 1 {
ratio = 1
}
myWidget.SetRect(xCoord / ratio, yCoord, width / ratio, height) should roughly accomplish sizing based on terminal width. If, for example, the terminal is 110 wide, then ratio is 2, and width of This is just a lazy example, and you'll probably want to use floating points instead to get more precise sizing (e.g. if |
Ignore my previous comment, it's probably better to use termui's Grid than to manually resize everything based on terminal size. See #9.
I was wrong about this, too! 😅 |
Its a little annoying, but is it possible for the little modules/boxes to adjust to the terminal width instead of being cut off. Also, it would be really cool to be able to modify which modules/boxes show.
The text was updated successfully, but these errors were encountered: