Commit 7db124c8 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Unified: Night Light and Rotation Lock labels

This CL replaces UI strings of Night Light and Rotation Lock buttons in
UnifiedSystemTray.

TEST=manual
BUG=813499

Change-Id: Ibd191ef921e2e4041a83891c4fb4124110655f7d
Reviewed-on: https://chromium-review.googlesource.com/1102221Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567566}
parent 802a7bb3
...@@ -980,6 +980,21 @@ This file contains the strings for ash. ...@@ -980,6 +980,21 @@ This file contains the strings for ash.
<message name="IDS_ASH_STATUS_TRAY_ROTATION_LOCK_PORTRAIT" desc="The text shown in the tray menu when rotation is set locked to portrait."> <message name="IDS_ASH_STATUS_TRAY_ROTATION_LOCK_PORTRAIT" desc="The text shown in the tray menu when rotation is set locked to portrait.">
Portrait Portrait
</message> </message>
<message name="IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED_LABEL" desc="The label text shown under the tray menu button when screen rotation is locked.">
Lock
</message>
<message name="IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED_VERTICAL_SUBLABEL" desc="The sub label text shown under the tray menu button when screen rotation is locked to vertical.">
Vertical
</message>
<message name="IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED_HORIZONTAL_SUBLABEL" desc="The sub label text shown under the tray menu button when screen rotation is locked to horizontal.">
Horizontal
</message>
<message name="IDS_ASH_STATUS_TRAY_ROTATION_LOCK_AUTO_LABEL" desc="The label text shown under the tray menu button when screen rotation is set to auto.">
Auto-rotate
</message>
<message name="IDS_ASH_STATUS_TRAY_ROTATION_LOCK_AUTO_SUBLABEL" desc="The sub label text shown under the tray menu button when screen rotation is set to auto.">
On
</message>
<message name="IDS_ASH_STATUS_TRAY_KEYBOARD_DISABLED" desc="The text shown in the tray menu when the virtual keyboard is disabled."> <message name="IDS_ASH_STATUS_TRAY_KEYBOARD_DISABLED" desc="The text shown in the tray menu when the virtual keyboard is disabled.">
On-screen keyboard disabled On-screen keyboard disabled
</message> </message>
......
...@@ -46,6 +46,9 @@ void NightLightFeaturePodController::UpdateButton() { ...@@ -46,6 +46,9 @@ void NightLightFeaturePodController::UpdateButton() {
button_->SetToggled(is_enabled); button_->SetToggled(is_enabled);
button_->SetVectorIcon(is_enabled ? kSystemMenuNightLightOnIcon button_->SetVectorIcon(is_enabled ? kSystemMenuNightLightOnIcon
: kSystemMenuNightLightOffIcon); : kSystemMenuNightLightOffIcon);
button_->SetSubLabel(l10n_util::GetStringUTF16(
is_enabled ? IDS_ASH_STATUS_TRAY_NIGHT_LIGHT_ON_STATE
: IDS_ASH_STATUS_TRAY_NIGHT_LIGHT_OFF_STATE));
} }
} // namespace ash } // namespace ash
...@@ -29,8 +29,6 @@ RotationLockFeaturePodController::~RotationLockFeaturePodController() { ...@@ -29,8 +29,6 @@ RotationLockFeaturePodController::~RotationLockFeaturePodController() {
FeaturePodButton* RotationLockFeaturePodController::CreateButton() { FeaturePodButton* RotationLockFeaturePodController::CreateButton() {
DCHECK(!button_); DCHECK(!button_);
button_ = new FeaturePodButton(this); button_ = new FeaturePodButton(this);
button_->SetLabel(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ROTATION_LOCK));
UpdateButton(); UpdateButton();
return button_; return button_;
} }
...@@ -75,16 +73,22 @@ void RotationLockFeaturePodController::UpdateButton() { ...@@ -75,16 +73,22 @@ void RotationLockFeaturePodController::UpdateButton() {
if (rotation_locked && is_portrait) { if (rotation_locked && is_portrait) {
button_->SetVectorIcon(kSystemMenuRotationLockPortraitIcon); button_->SetVectorIcon(kSystemMenuRotationLockPortraitIcon);
button_->SetSubLabel( button_->SetLabel(l10n_util::GetStringUTF16(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ROTATION_LOCK_PORTRAIT)); IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED_LABEL));
button_->SetSubLabel(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED_VERTICAL_SUBLABEL));
} else if (rotation_locked && !is_portrait) { } else if (rotation_locked && !is_portrait) {
button_->SetVectorIcon(kSystemMenuRotationLockLandscapeIcon); button_->SetVectorIcon(kSystemMenuRotationLockLandscapeIcon);
button_->SetSubLabel( button_->SetLabel(l10n_util::GetStringUTF16(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LANDSCAPE)); IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED_LABEL));
button_->SetSubLabel(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED_HORIZONTAL_SUBLABEL));
} else { } else {
button_->SetVectorIcon(kSystemMenuRotationLockAutoIcon); button_->SetVectorIcon(kSystemMenuRotationLockAutoIcon);
button_->SetSubLabel( button_->SetLabel(l10n_util::GetStringUTF16(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ROTATION_LOCK_AUTO)); IDS_ASH_STATUS_TRAY_ROTATION_LOCK_AUTO_LABEL));
button_->SetSubLabel(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_ROTATION_LOCK_AUTO_SUBLABEL));
} }
} }
......
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