Commit c2a1c56e authored by Austin Tankiang's avatar Austin Tankiang Committed by Commit Bot

Add a margin to the "Open with" context menu item

The "Open with" context menu item can contain an icon displayed on the
right. This icon is implemented as a background image, so the text can
overlap the icon if it is too long. Fix this by adding a margin to the
end of the element when we show an icon.

Bug: 958719
Change-Id: Ic8108e8300cdd1c584d483ce442e2a6362814bae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1697001Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676320}
parent 372a6d2e
......@@ -443,11 +443,16 @@ class TaskController {
this.ui_.fileContextMenu.defaultTaskMenuItem.style.backgroundImage = '';
this.ui_.fileContextMenu.defaultTaskMenuItem.setAttribute(
'file-type-icon', defaultTask.iconType);
this.ui_.fileContextMenu.defaultTaskMenuItem.style.marginInlineEnd =
'28px';
} else if (defaultTask.iconUrl) {
this.ui_.fileContextMenu.defaultTaskMenuItem.style.backgroundImage =
'url(' + defaultTask.iconUrl + ')';
this.ui_.fileContextMenu.defaultTaskMenuItem.style.marginInlineEnd =
'28px';
} else {
this.ui_.fileContextMenu.defaultTaskMenuItem.style.backgroundImage = '';
this.ui_.fileContextMenu.defaultTaskMenuItem.style.marginInlineEnd = '';
}
if (defaultTask.taskId === FileTasks.ZIP_ARCHIVER_UNZIP_TASK_ID) {
......
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