Commit 2ae7fb30 authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

[UI] MenuItemView space after icon

This is a follow up to crrev.com/c/2254319

By using the layout constants instead of the hard coded values.

For the combobox, this however affects only Mac
The reason for that is on Mac both
config.icons_in_label and type_ == Type::kCheckbox evaluated to true.
while on Linux both were false.

Screenshots:
Before: https://screenshot.googleplex.com/YC96zjVu2Cx
After: https://screenshot.googleplex.com/Uusea7yG6wd

Bug: 1044038
Change-Id: I20ee4e2aa416e0405df7a660e419b2b3a01e16e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264335Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782016}
parent 1188e9d6
......@@ -1266,7 +1266,9 @@ int MenuItemView::GetLabelStartForThisItem() const {
if ((config.icons_in_label || type_ == Type::kCheckbox ||
type_ == Type::kRadio) &&
icon_view_->GetVisible()) {
label_start += icon_view_->size().width() + config.item_horizontal_padding;
label_start +=
icon_view_->size().width() + LayoutProvider::Get()->GetDistanceMetric(
DISTANCE_RELATED_LABEL_HORIZONTAL);
}
return label_start;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment