Skip to content
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

Widgets: flag to omit column padding #58543

Merged
merged 2 commits into from Jun 20, 2022

Conversation

dseguin
Copy link
Member

@dseguin dseguin commented Jun 19, 2022

Summary

None

Purpose of change

The behaviour in the issue is usually intentional: each column is separated by 2 spaces, including columns nested within columns. The best way to optionally omit these spaces is with a flag, which would cause that widget and all of its nested widgets to be printed without extra padding:

Before

w_padding

After

no_padding

The example above uses the sidebar JSON provided in the issue, with the W_NO_PADDING to remove all padding from the !_bp_status_top_row widget and sub-widgets. This allows creating layouts that are much more compact.

Describe alternatives you've considered

Allow asymmetrical columns-within-columns. That wouldn't actually fix the issue, though.

Testing

Added test cases to verify padding differences when the flag is/isn't present:

./tests/cata_test -d yes --rng-seed time "W_NO_PADDING widget flag"

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs Code: Tests Measurement, self-control, statistics, balancing. labels Jun 19, 2022
@dseguin dseguin marked this pull request as ready for review June 20, 2022 03:57
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 20, 2022
@dseguin dseguin force-pushed the w_nopad_flag branch 2 times, most recently from 8152f1a to 5e98cdf Compare June 20, 2022 04:32
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 20, 2022
@bombasticSlacks bombasticSlacks merged commit 6ac3704 into CleverRaven:master Jun 20, 2022
@dseguin dseguin deleted the w_nopad_flag branch June 20, 2022 20:57
BrettDong added a commit that referenced this pull request Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weird column behavior in sidebar UI
2 participants