Skip to content

Commit

Permalink
ash: Channel indicator polish
Browse files Browse the repository at this point in the history
Set the status area login screen channel indicator pill's font weight
to medium.

Move the icon in the submit feedback button down one pixel.

Make the QS buttons anti-aliased.

Set ChannelIndicatorView's accessibility node "role" to kLabelText.

Bug: 1362920
Change-Id: I1693cec232da282886b6c004dd092e025f545090
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3892653
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Reviewed-by: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1046169}
  • Loading branch information
rogertinkoff authored and Chromium LUCI CQ committed Sep 13, 2022
1 parent 8abfcd8 commit 430f257
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ash/system/channel_indicator/channel_indicator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "base/strings/string_util.h"
#include "components/session_manager/session_manager_types.h"
#include "components/version_info/channel.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/canvas.h"
Expand Down Expand Up @@ -94,6 +95,7 @@ ChannelIndicatorView::ChannelIndicatorView(Shelf* shelf,
ChannelIndicatorView::~ChannelIndicatorView() = default;

void ChannelIndicatorView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->role = ax::mojom::Role::kLabelText;
node_data->SetName(accessible_name_);
}

Expand Down Expand Up @@ -208,6 +210,8 @@ void ChannelIndicatorView::SetImageOrText() {
channel_indicator_utils::GetChannelNameStringResourceID(
channel_,
/*append_channel=*/false)));
label()->SetFontList(
gfx::FontList().DeriveWithWeight(gfx::Font::Weight::MEDIUM));
PreferredSizeChanged();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ constexpr gfx::RoundedCornersF kStandaloneVersionButtonInkDropCorners(
kVersionButtonLargeCornerRadius,
kVersionButtonLargeCornerRadius);

constexpr int kSubmitFeedbackButtonMarginVertical = 4;
constexpr int kSubmitFeedbackButtonMarginTop = 5;
constexpr int kSubmitFeedbackButtonMarginBottom = 3;
constexpr int kSubmitFeedbackButtonMarginLeft = 6;
constexpr int kSubmitFeedbackButtonMarginRight = 8;

Expand Down Expand Up @@ -189,6 +190,7 @@ class VersionButton : public views::LabelButton {
cc::PaintFlags flags;
flags.setColor(channel_indicator_utils::GetBgColor(channel_));
flags.setStyle(cc::PaintFlags::kFill_Style);
flags.setAntiAlias(true);
canvas->DrawPath(
SkPath().addRoundRect(gfx::RectToSkRect(GetLocalBounds()),
content_corners_, SkPathDirection::kCW),
Expand Down Expand Up @@ -239,9 +241,8 @@ class SubmitFeedbackButton : public IconButton {
std::copy(content_corners, content_corners + kNumVersionButtonCornerRadii,
content_corners_);
SetBorder(views::CreateEmptyBorder(gfx::Insets::TLBR(
kSubmitFeedbackButtonMarginVertical, kSubmitFeedbackButtonMarginLeft,
kSubmitFeedbackButtonMarginVertical,
kSubmitFeedbackButtonMarginRight)));
kSubmitFeedbackButtonMarginTop, kSubmitFeedbackButtonMarginLeft,
kSubmitFeedbackButtonMarginBottom, kSubmitFeedbackButtonMarginRight)));
SetIconColor(channel_indicator_utils::GetFgColor(channel_));
SetIconSize(kSubmitFeedbackButtonIconSize);
SetPreferredSize(
Expand All @@ -261,6 +262,7 @@ class SubmitFeedbackButton : public IconButton {
cc::PaintFlags flags;
flags.setColor(channel_indicator_utils::GetBgColor(channel_));
flags.setStyle(cc::PaintFlags::kFill_Style);
flags.setAntiAlias(true);
canvas->DrawPath(
SkPath().addRoundRect(gfx::RectToSkRect(GetLocalBounds()),
content_corners_, SkPathDirection::kCW),
Expand Down

0 comments on commit 430f257

Please sign in to comment.