0

focus-mode: Add tooltip for truncated congratulatory title

This CL will add the tooltip only for the title truncated on the
contextual panel.

Bug: b/362369851
Test: Manual
Change-Id: I8ebbea7b68c3497ff5198db542420b2490091bb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5854507
Commit-Queue: Hongyu Long <hongyulong@chromium.org>
Reviewed-by: Richard Chui <richui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1354855}
This commit is contained in:
Hongyu Long
2024-09-12 22:24:14 +00:00
committed by Chromium LUCI CQ
parent aabd38ffda
commit 6c937d0692
8 changed files with 17 additions and 12 deletions

@ -881,22 +881,22 @@ Style notes:
Send feedback
</message>
<message name="IDS_ASH_STATUS_TRAY_FOCUS_MODE_ENDING_MOMENT_TITLE" desc="The text used for the ending moment, as well as the tooltip. [CHAR_LIMIT=22]">
Time's up. Great job!
Great job!
</message>
<message name="IDS_ASH_STATUS_TRAY_FOCUS_MODE_ENDING_MOMENT_TITLE_1" desc="The text used for the ending moment, as well as the tooltip. [CHAR_LIMIT=22]">
Time's up. You did it!
You did it!
</message>
<message name="IDS_ASH_STATUS_TRAY_FOCUS_MODE_ENDING_MOMENT_TITLE_2" desc="The text used for the ending moment, as well as the tooltip. [CHAR_LIMIT=22]">
Time's up. You're on a roll!
You're on a roll!
</message>
<message name="IDS_ASH_STATUS_TRAY_FOCUS_MODE_ENDING_MOMENT_TITLE_3" desc="The text used for the ending moment, as well as the tooltip. [CHAR_LIMIT=22]">
All done. Way to go!
Way to go!
</message>
<message name="IDS_ASH_STATUS_TRAY_FOCUS_MODE_ENDING_MOMENT_TITLE_4" desc="The text used for the ending moment, as well as the tooltip. [CHAR_LIMIT=22]">
All done. Keep it up!
Keep it up!
</message>
<message name="IDS_ASH_STATUS_TRAY_FOCUS_MODE_ENDING_MOMENT_TITLE_5" desc="The text used for the ending moment, as well as the tooltip. [CHAR_LIMIT=22]">
Time's up. Done and done!
Done and done!
</message>
<message name="IDS_ASH_STATUS_TRAY_FOCUS_MODE_ENDING_MOMENT_NUDGE_ALERT" desc="The accessibility alert for the ending moment nudge.">
<ph name="TITLE">$1<ex>Time's up. Great job!</ex></ph> You've just focused for <ph name="FOCUSED_TIME">$2<ex>24 minutes</ex></ph>. Open Quick settings to focus again.

@ -1 +1 @@
36bc950e45dcfd5967637cbe3120e4e64d998174
882b65d18ef25cae53d3bf32f1288d97493ad10c

@ -1 +1 @@
1bde115f9ff1a01bb7c6ca623da19fc5f9e22301
82de84b2c0e1cd9bb5fd7ea44468042621e46d9a

@ -1 +1 @@
e7320b980020fe65578769537e1b3d79ba5b133d
d9dc93c3407940244c6da274e58a1dcdb239ecf1

@ -1 +1 @@
e2d66b46bdea71a68b56dc41ef6a3b42ac6bdc64
547e88289dbf799b964763365acec8569bd957e9

@ -1 +1 @@
65fa345c502a4a9ddd7f0a271e5b2bf28c7752f6
7e5d7011bb4c5835357d1fcb5a9d23803742773a

@ -1 +1 @@
6674efe90b1ad6383b052b931b065b239f466a5c
9ccbb87106fdc66051c2c23cab01a3b018c8bd55

@ -107,6 +107,11 @@ FocusModeEndingMomentView::FocusModeEndingMomentView() {
focus_mode_util::GetCongratulatoryText(congratulatory_index)));
title_label->SetMaximumWidthSingleLine(kTitleMaximumWidth);
// Show the tooltip for the truncated title.
if (title_label->IsDisplayTextTruncated()) {
title_label->SetTooltipText(title_label->GetText());
}
emoji_label_ = title_and_emoji_box->AddChildView(CreateTextLabel(
gfx::ALIGN_LEFT, TypographyToken::kCrosHeadline1,
cros_tokens::kCrosSysOnSurface,