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
[guilib] add justify alignment for grouplist controls #7809
Conversation
itemsCount++; | ||
} | ||
} | ||
m_itemGap = (Size() - itemsSize) / itemsCount; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Works as expected, thx |
a31cec6
to
5589fe3
Compare
Added the itemsCount check to avoid possible division by zero and rebased. |
I am not sure if the behaviour is ideal in case the width of all items combined is higher than the width of the grouplist. At the moment it seems to assign negative itemgap values (which leads to overlapping buttons). Perhaps scrolling would be nicer in that case? |
There should be a check probably that it only uses the calculated item gap if its higher than the item gap set in the grouplist? |
Jep, that's what i had in mind as well. Should it also modify the group width and start scrolling like @phil65 suggested? |
Yes that would be best I think to prevent cut off items. |
You want to adjust the width of the grouplist itself? I dont think it´s a good idea, better have cut-off items than to not respect the values the skinner has set. Ideally (but that´s perhaps out of scope) we would have something like |
I assumed the width would only get smaller because its supposed to scroll. It shouldn't exceed the width set in the grouplist width tag I agree. |
With last commit it doesnt overlap controls anymore. Note that this wont work as expected with images that have transparent borders. Eg, you will want to set the itemgap to a lesser value to compensate for the transparent borders, but the calculated itemgap is then higer and that will be picked. This is for me better than to have overlapping controls though. |
2faa4e2
to
adf90c3
Compare
Trying a test build later. |
All good here. Thanks. |
adf90c3
to
e68a21d
Compare
What's the status here. Is it working as intended and of any use? |
@@ -208,6 +208,8 @@ bool CGUIControlGroupList::OnMessage(CGUIMessage& message) | |||
|
|||
void CGUIControlGroupList::ValidateOffset() | |||
{ | |||
// calculate item gap |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
f34f6ee
to
cdf4471
Compare
Rebased. Do we want justified alignment for grouplists or should it be closed? jenkins build this please. |
cdf4471
to
8d661f9
Compare
I´d say yes, shove it in. |
It's working as intended so I see no reason not to include it. |
[guilib] add justify alignment for grouplist controls
Adds justified alignment for grouplist controls. This is done by re-calculating the item gap size based on the actual control width and the amount of items. Needs testing.
/cc @BigNoid, @HitcherUK, @phil65 and @ronie