Add top margin and resize selection icons.
This also replaces the image selection icon with a more standard type.
The top margin should only apply to selection icons that contain a cross
cursor.
General Selection Icon Screenshot: https://screenshot.googleplex.com/ByV3iF83t4pbLG9
Image Selection Icon Screenshot: https://screenshot.googleplex.com/55fJz9ctpHMR8u6
Bug: b:243549841, 1358727
Change-Id: If97e6ba0a37e99f130ef1f4a3d10bdb01667a3ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3866602
Reviewed-by: Ali Stanfield <stanfield@google.com>
Reviewed-by: Thomas Lukaszewicz <tluk@chromium.org>
Commit-Queue: Juan Mojica <juanmojica@google.com>
Cr-Commit-Position: refs/heads/main@{#1042300}
diff --git a/chrome/browser/ui/views/lens/lens_region_search_instructions_view.cc b/chrome/browser/ui/views/lens/lens_region_search_instructions_view.cc
index b319b543..36fde07 100644
--- a/chrome/browser/ui/views/lens/lens_region_search_instructions_view.cc
+++ b/chrome/browser/ui/views/lens/lens_region_search_instructions_view.cc
@@ -33,7 +33,7 @@
constexpr int kCloseButtonSize = 17;
constexpr int kCornerRadius = 18;
constexpr int kLabelExtraLeftMargin = 2;
-constexpr int kSelectionIconSize = 16;
+constexpr int kSelectionIconTopMargin = 2;
int GetLensInstructionChipString() {
if (features::UseAltChipString()) {
@@ -123,7 +123,17 @@
auto selection_icon_view =
std::make_unique<views::ImageView>(ui::ImageModel::FromVectorIcon(
selection_icon, kColorFeatureLensPromoBubbleForeground,
- kSelectionIconSize));
+ layout_provider->GetDistanceMetric(
+ DISTANCE_BUBBLE_HEADER_VECTOR_ICON_SIZE)));
+ // TODO(b/244610006): We need to set a top margin to make sure our icons
+ // feel properly centered even though they are vertically centered. Only
+ // needed for the selection icons which contain a cross cursor. Asset should
+ // be updated in the future to make this unnecessary.
+ selection_icon_view->SetProperty(
+ views::kMarginsKey,
+ gfx::Insets::TLBR(
+ features::UseSelectionIconWithImage() ? 0 : kSelectionIconTopMargin,
+ 0, 0, 0));
AddChildView(std::move(selection_icon_view));
}
diff --git a/ui/views/vector_icons/drag_general_selection.icon b/ui/views/vector_icons/drag_general_selection.icon
index f27a6ae..c4a1aba 100644
--- a/ui/views/vector_icons/drag_general_selection.icon
+++ b/ui/views/vector_icons/drag_general_selection.icon
@@ -2,93 +2,94 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-CANVAS_DIMENSIONS, 16,
-MOVE_TO, 10, 2,
-H_LINE_TO, 8.67f,
-V_LINE_TO, 0.67f,
-H_LINE_TO, 10,
-V_LINE_TO, 2,
+CANVAS_DIMENSIONS, 20,
+MOVE_TO, 12.5f, 2.5f,
+R_H_LINE_TO, -1.67f,
+V_LINE_TO, 0.83f,
+H_LINE_TO, 12.5f,
+V_LINE_TO, 2.5f,
CLOSE,
-R_MOVE_TO, 1.33f, 2.67f,
-R_H_LINE_TO, 1.33f,
-V_LINE_TO, 3.33f,
-R_H_LINE_TO, -1.33f,
-R_V_LINE_TO, 1.33f,
+R_MOVE_TO, 1.67f, 3.33f,
+R_H_LINE_TO, 1.67f,
+V_LINE_TO, 4.17f,
+R_H_LINE_TO, -1.67f,
+R_V_LINE_TO, 1.67f,
CLOSE,
-R_MOVE_TO, 0, 2.67f,
-R_H_LINE_TO, 1.33f,
-V_LINE_TO, 6,
-R_H_LINE_TO, -1.33f,
-R_V_LINE_TO, 1.33f,
+R_MOVE_TO, 0, 3.33f,
+R_H_LINE_TO, 1.67f,
+V_LINE_TO, 7.5f,
+R_H_LINE_TO, -1.67f,
+R_V_LINE_TO, 1.67f,
CLOSE,
-MOVE_TO, 6, 12.67f,
-R_H_LINE_TO, 1.33f,
-R_V_LINE_TO, -1.33f,
-H_LINE_TO, 6,
-R_V_LINE_TO, 1.33f,
+MOVE_TO, 7.5f, 15.83f,
+H_LINE_TO, 9.17f,
+R_V_LINE_TO, -1.67f,
+H_LINE_TO, 7.5f,
+R_V_LINE_TO, 1.67f,
CLOSE,
-MOVE_TO, 3.33f, 2,
-R_H_LINE_TO, 1.33f,
-V_LINE_TO, 0.67f,
-H_LINE_TO, 3.33f,
-V_LINE_TO, 2,
+MOVE_TO, 4.17f, 2.5f,
+R_H_LINE_TO, 1.67f,
+V_LINE_TO, 0.83f,
+H_LINE_TO, 4.17f,
+V_LINE_TO, 2.5f,
CLOSE,
-MOVE_TO, 0.67f, 10,
-H_LINE_TO, 2,
-V_LINE_TO, 8.67f,
-H_LINE_TO, 0.67f,
-V_LINE_TO, 10,
+MOVE_TO, 0.83f, 12.5f,
+H_LINE_TO, 2.5f,
+R_V_LINE_TO, -1.67f,
+H_LINE_TO, 0.83f,
+R_V_LINE_TO, 1.67f,
CLOSE,
-MOVE_TO, 2, 12.67f,
-R_V_LINE_TO, -1.33f,
-H_LINE_TO, 0.67f,
-R_CUBIC_TO, 0, 0.73f, 0.6f, 1.33f, 1.33f, 1.33f,
+R_MOVE_TO, 1.67f, 3.33f,
+R_V_LINE_TO, -1.67f,
+H_LINE_TO, 0.83f,
+R_CUBIC_TO, 0, 0.92f, 0.75f, 1.67f, 1.67f, 1.67f,
CLOSE,
-R_MOVE_TO, 9.33f, -12,
-V_LINE_TO, 2,
-R_H_LINE_TO, 1.33f,
-R_CUBIC_TO, 0, -0.73f, -0.6f, -1.33f, -1.33f, -1.33f,
+MOVE_TO, 14.17f, 0.83f,
+V_LINE_TO, 2.5f,
+R_H_LINE_TO, 1.67f,
+R_CUBIC_TO, 0, -0.92f, -0.75f, -1.67f, -1.67f, -1.67f,
CLOSE,
-MOVE_TO, 6, 2,
-R_H_LINE_TO, 1.33f,
-V_LINE_TO, 0.67f,
-H_LINE_TO, 6,
-V_LINE_TO, 2,
+MOVE_TO, 7.5f, 2.5f,
+H_LINE_TO, 9.17f,
+V_LINE_TO, 0.83f,
+H_LINE_TO, 7.5f,
+V_LINE_TO, 2.5f,
CLOSE,
-MOVE_TO, 0.67f, 4.67f,
-H_LINE_TO, 2,
-V_LINE_TO, 3.33f,
-H_LINE_TO, 0.67f,
-R_V_LINE_TO, 1.33f,
+MOVE_TO, 0.83f, 5.83f,
+H_LINE_TO, 2.5f,
+V_LINE_TO, 4.17f,
+H_LINE_TO, 0.83f,
+R_V_LINE_TO, 1.67f,
CLOSE,
-R_MOVE_TO, 2.67f, 8,
-R_H_LINE_TO, 1.33f,
-R_V_LINE_TO, -1.33f,
-H_LINE_TO, 3.33f,
-R_V_LINE_TO, 1.33f,
+MOVE_TO, 4.17f, 15.83f,
+R_H_LINE_TO, 1.67f,
+R_V_LINE_TO, -1.67f,
+H_LINE_TO, 4.17f,
+R_V_LINE_TO, 1.67f,
CLOSE,
-MOVE_TO, 0.67f, 7.33f,
-H_LINE_TO, 2,
-V_LINE_TO, 6,
-H_LINE_TO, 0.67f,
-R_V_LINE_TO, 1.33f,
+MOVE_TO, 0.83f, 9.17f,
+H_LINE_TO, 2.5f,
+V_LINE_TO, 7.5f,
+H_LINE_TO, 0.83f,
+R_V_LINE_TO, 1.67f,
CLOSE,
-MOVE_TO, 0.67f, 2,
-H_LINE_TO, 2,
-V_LINE_TO, 0.67f,
-CUBIC_TO, 1.27f, 0.67f, 0.67f, 1.27f, 0.67f, 2,
+R_MOVE_TO, 0, -6.67f,
+H_LINE_TO, 2.5f,
+V_LINE_TO, 0.83f,
+R_CUBIC_TO, -0.92f, 0, -1.67f, 0.75f, -1.67f, 1.67f,
CLOSE,
-R_MOVE_TO, 8, 9.33f,
-R_V_LINE_TO, 1.33f,
-R_H_LINE_TO, 2.67f,
-R_LINE_TO, -0.01f, 2.67f,
-R_H_LINE_TO, 1.33f,
-R_LINE_TO, 0.01f, -2.66f,
-R_LINE_TO, 2.66f, -0.01f,
-R_V_LINE_TO, -1.34f,
-R_LINE_TO, -2.67f, 0.01f,
-V_LINE_TO, 8.67f,
-R_H_LINE_TO, -1.33f,
-R_V_LINE_TO, 2.67f,
-H_LINE_TO, 8.67f,
-CLOSE
+MOVE_TO, 10.83f, 14.17f,
+R_V_LINE_TO, 1.67f,
+R_H_LINE_TO, 3.34f,
+R_LINE_TO, -0.01f, 3.33f,
+R_H_LINE_TO, 1.67f,
+R_LINE_TO, 0.01f, -3.33f,
+R_LINE_TO, 3.33f, -0.01f,
+R_V_LINE_TO, -1.67f,
+R_LINE_TO, -3.33f, 0.01f,
+R_V_LINE_TO, -3.33f,
+R_H_LINE_TO, -1.67f,
+R_V_LINE_TO, 3.33f,
+R_H_LINE_TO, -3.33f,
+CLOSE,
+NEW_PATH
diff --git a/ui/views/vector_icons/drag_image_selection.icon b/ui/views/vector_icons/drag_image_selection.icon
index 3dd706054..fe9f3b5 100644
--- a/ui/views/vector_icons/drag_image_selection.icon
+++ b/ui/views/vector_icons/drag_image_selection.icon
@@ -2,58 +2,63 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-CANVAS_DIMENSIONS, 16,
-MOVE_TO, 12, 10.67f,
-V_LINE_TO, 8,
-R_H_LINE_TO, -1.33f,
-R_V_LINE_TO, 2.67f,
-H_LINE_TO, 8,
-V_LINE_TO, 12,
-R_H_LINE_TO, 2.67f,
-R_V_LINE_TO, 2.67f,
-H_LINE_TO, 12,
-R_LINE_TO, 0.01f, -2.66f,
-R_LINE_TO, 2.66f, -0.01f,
-R_V_LINE_TO, -1.34f,
-R_LINE_TO, -2.67f, 0.01f,
+CANVAS_DIMENSIONS, 20,
+MOVE_TO, 4.5f, 17,
+R_QUADRATIC_TO, -0.62f, 0, -1.06f, -0.44f,
+QUADRATIC_TO, 3, 16.13f, 3, 15.5f,
+V_LINE_TO, 6,
+R_H_LINE_TO, 11,
+R_V_LINE_TO, 11,
CLOSE,
-MOVE_TO, 10.67f, 0,
-R_V_LINE_TO, 1.33f,
-H_LINE_TO, 12,
-CUBIC_TO, 12, 0.6f, 11.4f, 0, 10.67f, 0,
+R_MOVE_TO, 11, 0,
+R_V_LINE_TO, -1.5f,
+H_LINE_TO, 17,
+R_QUADRATIC_TO, 0, 0.63f, -0.44f, 1.06f,
+QUADRATIC_TO, 16.13f, 17, 15.5f, 17,
CLOSE,
-R_MOVE_TO, -8, 12,
-R_H_LINE_TO, 4,
-R_V_LINE_TO, -1.33f,
-H_LINE_TO, 5.34f,
-V_LINE_TO, 12,
-H_LINE_TO, 4.01f,
-R_V_LINE_TO, -1.33f,
-H_LINE_TO, 2.68f,
-V_LINE_TO, 12,
-MOVE_TO, 1.33f, 6.67f,
+R_MOVE_TO, -11, -2,
R_H_LINE_TO, 8,
-V_LINE_TO, 0,
-R_H_LINE_TO, -8,
-CUBIC_TO, 0.6f, 0, 0, 0.6f, 0, 1.33f,
-R_V_LINE_TO, 9.34f,
-R_CUBIC_TO, 0, 0.62f, 0.43f, 1.11f, 1, 1.27f,
-R_CUBIC_TO, 0.11f, 0.03f, 0.22f, 0.07f, 0.33f, 0.07f,
-R_MOVE_TO, 0, -6.68f,
-R_LINE_TO, 2.16f, -3.5f,
-R_LINE_TO, 1.29f, 1.5f,
-R_LINE_TO, 1.29f, -2,
-R_LINE_TO, 2.59f, 4,
-H_LINE_TO, 1.33f,
+R_LINE_TO, -2.62f, -3.5f,
+LINE_TO, 8, 14,
+R_LINE_TO, -1.37f, -1.83f,
CLOSE,
-NEW_PATH,
-MOVE_TO, 10.67f, 2.67f,
-H_LINE_TO, 12,
-V_LINE_TO, 4,
-R_H_LINE_TO, -1.33f,
+R_MOVE_TO, 11, -1.12f,
+R_V_LINE_TO, -1.5f,
+H_LINE_TO, 17,
+R_V_LINE_TO, 1.5f,
CLOSE,
-R_MOVE_TO, 0, 2.66f,
-H_LINE_TO, 12,
-R_V_LINE_TO, 1.33f,
-R_H_LINE_TO, -1.33f,
+R_MOVE_TO, 0, -3.12f,
+R_V_LINE_TO, -1.5f,
+H_LINE_TO, 17,
+R_V_LINE_TO, 1.5f,
+CLOSE,
+R_MOVE_TO, 0, -3.12f,
+R_V_LINE_TO, -1.5f,
+H_LINE_TO, 17,
+R_V_LINE_TO, 1.5f,
+CLOSE,
+MOVE_TO, 3, 4.5f,
+R_QUADRATIC_TO, 0, -0.62f, 0.44f, -1.06f,
+QUADRATIC_TO, 3.88f, 3, 4.5f, 3,
+R_V_LINE_TO, 1.5f,
+CLOSE,
+R_MOVE_TO, 3.13f, 0,
+V_LINE_TO, 3,
+R_H_LINE_TO, 1.5f,
+R_V_LINE_TO, 1.5f,
+CLOSE,
+R_MOVE_TO, 3.13f, 0,
+V_LINE_TO, 3,
+R_H_LINE_TO, 1.5f,
+R_V_LINE_TO, 1.5f,
+CLOSE,
+R_MOVE_TO, 3.13f, 0,
+V_LINE_TO, 3,
+R_H_LINE_TO, 1.5f,
+R_V_LINE_TO, 1.5f,
+CLOSE,
+R_MOVE_TO, 3.13f, 0,
+V_LINE_TO, 3,
+R_QUADRATIC_TO, 0.63f, 0, 1.06f, 0.44f,
+QUADRATIC_TO, 17, 3.88f, 17, 4.5f,
CLOSE