Commit 13c4690e authored by My Nguyen's avatar My Nguyen Committed by Commit Bot

Fix annotation label hover issue

Same issue as suggestion label.

Fix: b/165755383
Change-Id: I144b0a4e7bb3c4c3c1a5eccd3894ae2774e90e0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366379
Commit-Queue: My Nguyen <myy@chromium.org>
Reviewed-by: default avatarKeith Lee <keithlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800030}
parent 72f59947
...@@ -55,8 +55,8 @@ std::unique_ptr<views::StyledLabel> CreateSuggestionLabel() { ...@@ -55,8 +55,8 @@ std::unique_ptr<views::StyledLabel> CreateSuggestionLabel() {
views::CreateEmptyBorder(gfx::Insets(kPadding / 2, 0))); views::CreateEmptyBorder(gfx::Insets(kPadding / 2, 0)));
suggestion_label->SetAutoColorReadabilityEnabled(false); suggestion_label->SetAutoColorReadabilityEnabled(false);
// StyledLabel eats event, probably because it has to handle links. // StyledLabel eats event, probably because it has to handle links.
// Explicitly sets below to false for SuggestionView's hover to work // Explicitly sets can_process_events_within_subtree to false for
// correctly. // SuggestionView's hover to work correctly.
suggestion_label->set_can_process_events_within_subtree(false); suggestion_label->set_can_process_events_within_subtree(false);
return suggestion_label; return suggestion_label;
...@@ -119,6 +119,10 @@ std::unique_ptr<views::View> SuggestionView::CreateAnnotationLabel() { ...@@ -119,6 +119,10 @@ std::unique_ptr<views::View> SuggestionView::CreateAnnotationLabel() {
label->AddChildView(CreateKeyContainer())->AddChildView(CreateDownIcon()); label->AddChildView(CreateKeyContainer())->AddChildView(CreateDownIcon());
arrow_icon_ = label->AddChildView(std::make_unique<views::ImageView>()); arrow_icon_ = label->AddChildView(std::make_unique<views::ImageView>());
label->AddChildView(CreateKeyContainer())->AddChildView(CreateEnterLabel()); label->AddChildView(CreateKeyContainer())->AddChildView(CreateEnterLabel());
// AnnotationLabel's ChildViews eat events simmilar to StyledLabel.
// Explicitly sets can_process_events_within_subtree to false for
// AnnotationLabel's hover to work correctly.
label->set_can_process_events_within_subtree(false);
return label; return label;
} }
......
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