Commit bbbddb5c authored by David Black's avatar David Black Committed by Chromium LUCI CQ

Fix pin button margins in screen capture item views.

Previously the pin button was 8dip from the edge of the view. The spec
calls for 4dip.

This CL also reduces scope of screen capture related constants.h

Bug: 1165348
Change-Id: I585b332e82735ecad2dcc2707928a39a2ebbc76c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2624030Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#842642}
parent a0f90686
......@@ -24,12 +24,7 @@ constexpr int kHoldingSpaceDownloadsHeaderSpacing = 16;
constexpr int kHoldingSpaceFocusCornerRadius = 12;
constexpr int kHoldingSpaceFocusInsets = -4;
constexpr int kHoldingSpaceIconSize = 20;
constexpr gfx::Insets kHoldingSpaceScreenCapturePadding(8);
constexpr gfx::Size kHoldingSpaceScreenCapturePinButtonSize(24, 24);
constexpr gfx::Size kHoldingSpaceScreenCapturePlayIconSize(32, 32);
constexpr int kHoldingSpaceScreenCaptureSpacing = 8;
constexpr gfx::Size kHoldingSpaceScreenCaptureSize(104, 80);
constexpr gfx::Insets kHoldingSpaceScreenCapturesContainerPadding(8, 0);
constexpr int kHoldingSpaceSectionChildSpacing = 16;
constexpr float kHoldingSpaceSelectedOverlayOpacity = 0.24f;
constexpr int kHoldingSpaceTrayIconMaxVisiblePreviews = 3;
......
......@@ -23,6 +23,11 @@
namespace ash {
// Appearance.
constexpr gfx::Insets kPinButtonMargins(4);
constexpr gfx::Size kPinButtonSize(24, 24);
constexpr gfx::Size kPlayIconSize(32, 32);
HoldingSpaceItemScreenCaptureView::HoldingSpaceItemScreenCaptureView(
HoldingSpaceItemViewDelegate* delegate,
const HoldingSpaceItem* item)
......@@ -48,8 +53,7 @@ HoldingSpaceItemScreenCaptureView::HoldingSpaceItemScreenCaptureView(
auto* layout =
pin_button_container->SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kHorizontal,
kHoldingSpaceScreenCapturePadding));
views::BoxLayout::Orientation::kHorizontal, kPinButtonMargins));
layout->set_main_axis_alignment(views::BoxLayout::MainAxisAlignment::kEnd);
layout->set_cross_axis_alignment(
views::BoxLayout::CrossAxisAlignment::kStart);
......@@ -59,8 +63,8 @@ HoldingSpaceItemScreenCaptureView::HoldingSpaceItemScreenCaptureView(
// Create contrasting background for the pin icon.
pin->SetBackground(views::CreateRoundedRectBackground(
HoldingSpaceColorProvider::Get()->GetBackgroundColor(),
kHoldingSpaceScreenCapturePinButtonSize.width() / 2));
pin->SetPreferredSize(kHoldingSpaceScreenCapturePinButtonSize);
kPinButtonSize.width() / 2));
pin->SetPreferredSize(kPinButtonSize);
}
HoldingSpaceItemScreenCaptureView::~HoldingSpaceItemScreenCaptureView() =
......@@ -108,12 +112,12 @@ void HoldingSpaceItemScreenCaptureView::AddPlayIcon() {
vector_icons::kPlayArrowIcon, kHoldingSpaceIconSize,
AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kButtonIconColor)));
play_icon->SetPreferredSize(kHoldingSpaceScreenCapturePlayIconSize);
play_icon->SetPreferredSize(kPlayIconSize);
// Create contrasting background for the play icon.
play_icon->SetBackground(views::CreateRoundedRectBackground(
HoldingSpaceColorProvider::Get()->GetBackgroundColor(),
kHoldingSpaceScreenCapturePlayIconSize.width() / 2));
kPlayIconSize.width() / 2));
}
BEGIN_METADATA(HoldingSpaceItemScreenCaptureView, HoldingSpaceItemView)
......
......@@ -17,6 +17,9 @@
namespace ash {
// Appearance.
constexpr int kChildSpacing = 8;
ScreenCapturesSection::ScreenCapturesSection(
HoldingSpaceItemViewDelegate* delegate)
: HoldingSpaceItemViewsSection(delegate,
......@@ -47,7 +50,7 @@ std::unique_ptr<views::View> ScreenCapturesSection::CreateContainer() {
->SetOrientation(views::LayoutOrientation::kHorizontal)
.SetDefault(views::kMarginsKey,
gfx::Insets(/*top=*/0, /*left=*/0, /*bottom=*/0,
/*right=*/kHoldingSpaceScreenCaptureSpacing));
/*right=*/kChildSpacing));
return container;
}
......
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