saved_desks: Update button for saved desks to "Open desk"
In the grid, the button on a saved desk should say "Open desk" not "Use template". Bug: 1323373 Change-Id: I5f82e4ad658bcb3e0d1ddaa2c5e343ae99e68863 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3639275 Reviewed-by: Daniel Andersson <dandersson@chromium.org> Commit-Queue: Yongshun Liu <yongshun@chromium.org> Cr-Commit-Position: refs/heads/main@{#1001710}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
f5328f3be0
commit
2521eb3e32
ash
@@ -1847,6 +1847,9 @@ This file contains the strings for ash.
|
|||||||
<message name="IDS_ASH_DESKS_TEMPLATES_USE_TEMPLATE_BUTTON" desc="The text of the button to launch the template.">
|
<message name="IDS_ASH_DESKS_TEMPLATES_USE_TEMPLATE_BUTTON" desc="The text of the button to launch the template.">
|
||||||
Use template
|
Use template
|
||||||
</message>
|
</message>
|
||||||
|
<message name="IDS_ASH_DESKS_TEMPLATES_OPEN_DESK_BUTTON" desc="The text of the button to launch the saved desk.">
|
||||||
|
Open desk
|
||||||
|
</message>
|
||||||
<message name="IDS_ASH_DESKS_TEMPLATES_REACH_MAXIMUM_DESK_TOAST" desc="The text of the toast displayed when user tries to launch a template while maximum desk number is reached.">
|
<message name="IDS_ASH_DESKS_TEMPLATES_REACH_MAXIMUM_DESK_TOAST" desc="The text of the toast displayed when user tries to launch a template while maximum desk number is reached.">
|
||||||
Only <ph name="MAX_DESK_LIMIT">$1<ex>8</ex></ph> desks allowed. Remove a desk to open a new one.
|
Only <ph name="MAX_DESK_LIMIT">$1<ex>8</ex></ph> desks allowed. Remove a desk to open a new one.
|
||||||
</message>
|
</message>
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
32e1f86fbb63d7c726350dd894f7d856729a649c
|
@@ -203,11 +203,15 @@ SavedDeskItemView::SavedDeskItemView(const DeskTemplate* desk_template)
|
|||||||
SetPaintToLayer();
|
SetPaintToLayer();
|
||||||
layer()->SetFillsBoundsOpaquely(false);
|
layer()->SetFillsBoundsOpaquely(false);
|
||||||
|
|
||||||
|
const int button_text_id =
|
||||||
|
desk_template_->type() == DeskTemplateType::kTemplate
|
||||||
|
? IDS_ASH_DESKS_TEMPLATES_USE_TEMPLATE_BUTTON
|
||||||
|
: IDS_ASH_DESKS_TEMPLATES_OPEN_DESK_BUTTON;
|
||||||
launch_button_ = hover_container_->AddChildView(std::make_unique<PillButton>(
|
launch_button_ = hover_container_->AddChildView(std::make_unique<PillButton>(
|
||||||
base::BindRepeating(&SavedDeskItemView::OnGridItemPressed,
|
base::BindRepeating(&SavedDeskItemView::OnGridItemPressed,
|
||||||
weak_ptr_factory_.GetWeakPtr()),
|
weak_ptr_factory_.GetWeakPtr()),
|
||||||
l10n_util::GetStringUTF16(IDS_ASH_DESKS_TEMPLATES_USE_TEMPLATE_BUTTON),
|
l10n_util::GetStringUTF16(button_text_id), PillButton::Type::kIconless,
|
||||||
PillButton::Type::kIconless, /*icon=*/nullptr));
|
/*icon=*/nullptr));
|
||||||
|
|
||||||
// Users cannot delete admin templates.
|
// Users cannot delete admin templates.
|
||||||
if (!is_admin_managed) {
|
if (!is_admin_managed) {
|
||||||
|
Reference in New Issue
Block a user