[GH-ISSUE #72] Support padding of containers #54

Closed
opened 2026-03-03 16:21:57 +03:00 by kerem · 5 comments
Owner

Originally created by @mum4k on GitHub (Jan 15, 2019).
Original GitHub issue: https://github.com/mum4k/termdash/issues/72

So widgets can have some space around themselves.

Probably a separate padding for top, bottom, left, right. These can be implemented as new container options:
https://github.com/mum4k/termdash/blob/master/container/options.go

The size of the padding should be supplied in relative terms, so that this behaves well with terminal resize. I.e. percentage of the containers width / height.

Originally created by @mum4k on GitHub (Jan 15, 2019). Original GitHub issue: https://github.com/mum4k/termdash/issues/72 So widgets can have some space around themselves. Probably a separate padding for top, bottom, left, right. These can be implemented as new container options: https://github.com/mum4k/termdash/blob/master/container/options.go The size of the padding should be supplied in relative terms, so that this behaves well with terminal resize. I.e. percentage of the containers width / height.
kerem 2026-03-03 16:21:57 +03:00
Author
Owner

@nilathedragon commented on GitHub (Jan 25, 2019):

I've started experimenting with this.

Currently implemented are 4 new options:


// Adds 1 space of padding on the left
container.PaddingLeft(1)

// Adds 1 space of padding on the top
container.PaddingTop(1)

// Adds 1 space of padding on the right
container.PaddingRight(1)

// Adds 1 space of padding on the bottom
container.PaddingBottom(1)

On the testing part I might need some help. Currently not tested (Except for human testing)

Please see pull request #91 for code reviewing

<!-- gh-comment-id:457698264 --> @nilathedragon commented on GitHub (Jan 25, 2019): I've started experimenting with this. Currently implemented are 4 new options: ```go // Adds 1 space of padding on the left container.PaddingLeft(1) // Adds 1 space of padding on the top container.PaddingTop(1) // Adds 1 space of padding on the right container.PaddingRight(1) // Adds 1 space of padding on the bottom container.PaddingBottom(1) ``` On the testing part I might need some help. Currently not tested (Except for human testing) Please see pull request #91 for code reviewing
Author
Owner

@nilathedragon commented on GitHub (Jan 25, 2019):

Alright, I added a test which tests all 4 padding methods

<!-- gh-comment-id:457764763 --> @nilathedragon commented on GitHub (Jan 25, 2019): Alright, I added a test which tests all 4 padding methods
Author
Owner

@mum4k commented on GitHub (Jan 26, 2019):

Great, will respond on the PR shortly.

What do you think - should we also implement a margin for containers (i.e. a cleared area on the outside of the container)? If you think that's useful, we can file a separate issue and get to that separately / at a later time.

<!-- gh-comment-id:457806961 --> @mum4k commented on GitHub (Jan 26, 2019): Great, will respond on the PR shortly. What do you think - should we also implement a margin for containers (i.e. a cleared area on the outside of the container)? If you think that's useful, we can file a separate issue and get to that separately / at a later time.
Author
Owner

@nilathedragon commented on GitHub (Jan 26, 2019):

I think a margin sounds good. Will look at the coding part asap.

<!-- gh-comment-id:457807445 --> @nilathedragon commented on GitHub (Jan 26, 2019): I think a margin sounds good. Will look at the coding part asap.
Author
Owner

@mum4k commented on GitHub (Jan 26, 2019):

Thank you, I have filed #93 to track the margin feature. If you will be looking at that too, please send it in a separate PR.

<!-- gh-comment-id:457809247 --> @mum4k commented on GitHub (Jan 26, 2019): Thank you, I have filed #93 to track the margin feature. If you will be looking at that too, please send it in a separate PR.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termdash#54
No description provided.