0

[ChromeOS] Polish ontask pod with correct radius, spacing, button background

Bug: b:400842133
Change-Id: I88f1a834c5fcd4f61c19d11fe25bd76b152141b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6350722
Commit-Queue: Luke Cao <caott@google.com>
Reviewed-by: Vignesh Shenvi <vshenvi@google.com>
Cr-Commit-Position: refs/heads/main@{#1432869}
This commit is contained in:
caott
2025-03-14 10:56:52 -07:00
committed by Chromium LUCI CQ
parent 887ffd997f
commit 72cebee3d2

@ -25,15 +25,17 @@ namespace ash {
namespace { namespace {
// Parameters for the OnTask pod. // Parameters for the OnTask pod.
constexpr int kPodBorderRadius = 12; constexpr int kPodBorderRadius = 26;
constexpr int kPodVerticalPadding = 10; constexpr int kPodVerticalPadding = 10;
constexpr int kPodHorizontalPadding = 12; constexpr int kPodHorizontalPadding = 12;
constexpr int kPodElementSpace = 8;
// Parameters for the separator in the OnTask pod. // Parameters for the separator in the OnTask pod.
constexpr int kSeparatorVerticalPadding = 0; constexpr int kSeparatorVerticalPadding = 0;
constexpr int kSeparatorHorizontalPadding = 12; constexpr int kSeparatorHorizontalPadding = 4;
// Parameters for the label button in the OnTask pod. // Parameters for the label button in the OnTask pod.
constexpr int kLabelButtonRadius = 16;
constexpr int kLabelButtonTopPadding = 0; constexpr int kLabelButtonTopPadding = 0;
constexpr int kLabelButtonLeftPadding = 12; constexpr int kLabelButtonLeftPadding = 12;
constexpr int kLabelButtonButtomPadding = 0; constexpr int kLabelButtonButtomPadding = 0;
@ -67,7 +69,7 @@ std::unique_ptr<views::LabelButton> CreateLabelButton(
button->SetHorizontalAlignment(gfx::ALIGN_CENTER); button->SetHorizontalAlignment(gfx::ALIGN_CENTER);
button->SetImageLabelSpacing(kLabelButtonIconTextSpace); button->SetImageLabelSpacing(kLabelButtonIconTextSpace);
button->SetBackground(views::CreateRoundedRectBackground( button->SetBackground(views::CreateRoundedRectBackground(
cros_tokens::kCrosSysSystemOnBaseOpaque, kPodBorderRadius)); cros_tokens::kCrosSysSystemOnBaseOpaque, kLabelButtonRadius));
return button; return button;
} }
@ -82,6 +84,7 @@ OnTaskPodView::OnTaskPodView(OnTaskPodController* pod_controller)
cros_tokens::kCrosSysSystemBaseElevated, kPodBorderRadius)); cros_tokens::kCrosSysSystemBaseElevated, kPodBorderRadius));
SetInsideBorderInsets( SetInsideBorderInsets(
gfx::Insets::VH(kPodVerticalPadding, kPodHorizontalPadding)); gfx::Insets::VH(kPodVerticalPadding, kPodHorizontalPadding));
SetBetweenChildSpacing(kPodElementSpace);
AddShortcutButtons(); AddShortcutButtons();
} }
@ -148,7 +151,7 @@ void OnTaskPodView::UpdatePinTabStripButton() {
pin_tab_strip_button_->SetText(l10n_util::GetStringUTF16( pin_tab_strip_button_->SetText(l10n_util::GetStringUTF16(
IDS_ON_TASK_POD_UNPIN_TAP_STRIP_ACCESSIBLE_NAME)); IDS_ON_TASK_POD_UNPIN_TAP_STRIP_ACCESSIBLE_NAME));
pin_tab_strip_button_->SetBackground(views::CreateRoundedRectBackground( pin_tab_strip_button_->SetBackground(views::CreateRoundedRectBackground(
cros_tokens::kCrosSysSystemPrimaryContainer, kPodBorderRadius)); cros_tokens::kCrosSysSystemPrimaryContainer, kLabelButtonRadius));
pin_tab_strip_button_->SetEnabledTextColors( pin_tab_strip_button_->SetEnabledTextColors(
cros_tokens::kCrosSysSystemOnPrimaryContainer); cros_tokens::kCrosSysSystemOnPrimaryContainer);
} else { } else {
@ -156,7 +159,7 @@ void OnTaskPodView::UpdatePinTabStripButton() {
pin_tab_strip_button_->SetText(l10n_util::GetStringUTF16( pin_tab_strip_button_->SetText(l10n_util::GetStringUTF16(
IDS_ON_TASK_POD_PIN_TAP_STRIP_ACCESSIBLE_NAME)); IDS_ON_TASK_POD_PIN_TAP_STRIP_ACCESSIBLE_NAME));
pin_tab_strip_button_->SetBackground(views::CreateRoundedRectBackground( pin_tab_strip_button_->SetBackground(views::CreateRoundedRectBackground(
cros_tokens::kCrosSysSystemOnBaseOpaque, kPodBorderRadius)); cros_tokens::kCrosSysSystemOnBaseOpaque, kLabelButtonRadius));
pin_tab_strip_button_->SetEnabledTextColors(cros_tokens::kCrosSysOnSurface); pin_tab_strip_button_->SetEnabledTextColors(cros_tokens::kCrosSysOnSurface);
} }
} }
@ -172,7 +175,13 @@ void OnTaskPodView::ToggleSnapLocation() {
void OnTaskPodView::OnPageNavigationContextUpdate() { void OnTaskPodView::OnPageNavigationContextUpdate() {
back_button_->SetEnabled(pod_controller_->CanNavigateToPreviousPage()); back_button_->SetEnabled(pod_controller_->CanNavigateToPreviousPage());
if (!back_button_->GetEnabled()) {
back_button_->SetBackground(nullptr);
}
forward_button_->SetEnabled(pod_controller_->CanNavigateToNextPage()); forward_button_->SetEnabled(pod_controller_->CanNavigateToNextPage());
if (!forward_button_->GetEnabled()) {
forward_button_->SetBackground(nullptr);
}
} }
void OnTaskPodView::OnLockedModeUpdate() { void OnTaskPodView::OnLockedModeUpdate() {