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

Skin padding implementation #4195

Merged
merged 10 commits into from Jan 13, 2020
Merged

Conversation

@qwertychouskie
Copy link
Contributor

qwertychouskie commented Jan 4, 2020

Needed for my new theme. Tested with all existing themes, and all should be well.

Agreement

By creating a pull request in stk-code, you hereby agree to dual-license your contribution as
GNU General Public License version 3 or any later version and
Mozilla Public License version 2 or any later version.

This includes your previous contribution(s) under the same name of contributor.

Keep the above statement in the pull request comment for agreement.

@CodingJellyfish

This comment has been minimized.

Copy link
Contributor

CodingJellyfish commented Jan 4, 2020

Ok i'll close mine.
(Looks like it's Qwerty's biggest PR ever!)

@Benau

This comment has been minimized.

Copy link
Member

Benau commented Jan 8, 2020

image
now it has gaps between tabs

@qwertychouskie

This comment has been minimized.

Copy link
Contributor Author

qwertychouskie commented Jan 9, 2020

If the gaps bother you, they can be removed by setting a negative h_margin, e.g. -8.

@Benau

This comment has been minimized.

Copy link
Member

Benau commented Jan 10, 2020

if any negative values don't matter then it should not be a -8 (too arbitrary!), maybe all those padding values just need a fixed set of values for old skin

(Also removed a couple duplicated files.)
@Benau

This comment has been minimized.

Copy link
Member

Benau commented Jan 10, 2020

image
Still problemtic....
LHS your branch, RHS original, seems that your branch doesn't seem to use available space in a good way...

Uses `vborder_out_portion`, which is how it was done before.
float width = (float)total_width * layout_proportions[i][j]
/ total_proportions - margin;

char width_str[100];
sprintf(width_str, "%i", (int)roundf(width));
sprintf(width_str, "%i", (int)roundf(width / (SkinConfig::getHorizontalInnerPadding(button->getType(), button)+1.0f)));

This comment has been minimized.

Copy link
@auriamg

auriamg Jan 11, 2020

Member

why +1.0f ?

This comment has been minimized.

Copy link
@Benau

Benau Jan 13, 2020

Member

qwerty said in irc btw:

1.0f is the height of the button with no inner padding, so (SkinConfig::getHorizontalInnerPadding(button->getType(), button)+1.0f) is the real height of the button
@qwertychouskie qwertychouskie force-pushed the STK-helper:skin-padding-impl branch from 85f4403 to 88f486b Jan 11, 2020
@Benau

This comment has been minimized.

Copy link
Member

Benau commented Jan 12, 2020

image
still bad space usage

@Benau Benau merged commit a68e652 into supertuxkart:master Jan 13, 2020
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@qwertychouskie qwertychouskie deleted the STK-helper:skin-padding-impl branch Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.