gd/gio: Add subtitle for Game Controls set up
This CL adds localized string as subtitle for Game Controls set up which means no active action. Bug: b/274690042 Test: manual test Change-Id: I5a2f760cca3e0e2d7eefaa7859056df2a012980c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4867178 Auto-Submit: Cici Ruan <cuicuiruan@google.com> Commit-Queue: Cici Ruan <cuicuiruan@google.com> Reviewed-by: Ahmed Fakhry <afakhry@chromium.org> Cr-Commit-Position: refs/heads/main@{#1197285}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
cf9d99e7be
commit
e7130bb96c
ash
@ -7114,6 +7114,11 @@ To shut down the device, press and hold the power button on the device again.
|
||||
Toolbar
|
||||
</message>
|
||||
|
||||
<!-- Game Dashboard / Game Controls strings -->
|
||||
<message name="IDS_ASH_GAME_DASHBOARD_GC_SET_UP_SUB_TITLE" desc="The subtitle on the menu details row of Game Controls when no action is set up and Setup button shows up.">
|
||||
Keys, buttons, and more
|
||||
</message>
|
||||
|
||||
<!-- Input device settings notifications -->
|
||||
<message name="IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_ALT_RIGHT_CLICK" desc="The message shown to notify a user that the shortcut used to simulate a right-click using touchpad and keyboard has changed.">
|
||||
The right-click shortcut is updated to <ph name="LAUNCHER_KEY_NAME">$1<ex>launcher</ex></ph> key + click from alt + click
|
||||
|
@ -0,0 +1 @@
|
||||
3e272b4fab17b9bd8a5a5eddf497a50ff83e694a
|
@ -433,13 +433,10 @@ void GameDashboardMainMenuView::MaybeAddGameControlsDetailsRow(
|
||||
IDS_ASH_GAME_DASHBOARD_CONTROLS_TILE_BUTTON_TITLE)));
|
||||
game_controls_details_->SetID(VIEW_ID_GD_CONTROLS_DETAILS_ROW);
|
||||
|
||||
const bool is_flag_set =
|
||||
game_dashboard_utils::IsFlagSet(*flags, ArcGameControlsFlag::kEnabled);
|
||||
// TODO(b/279117180): Include application name in the subtitle.
|
||||
// TODO(b/274690042): Replace the strings with localized strings.
|
||||
game_controls_details_->SetSubtitle(is_flag_set ? u"On" : u"Off");
|
||||
|
||||
if (game_dashboard_utils::IsFlagSet(*flags, ArcGameControlsFlag::kEmpty)) {
|
||||
game_controls_details_->SetSubtitle(
|
||||
l10n_util::GetStringUTF16(IDS_ASH_GAME_DASHBOARD_GC_SET_UP_SUB_TITLE));
|
||||
|
||||
// Add "Set up" button for empty state.
|
||||
// TODO(b/274690042): Replace the strings with localized strings.
|
||||
game_controls_setup_button_ = game_controls_details_->AddCustomizedTailView(
|
||||
@ -453,6 +450,13 @@ void GameDashboardMainMenuView::MaybeAddGameControlsDetailsRow(
|
||||
game_controls_setup_button_->SetProperty(views::kMarginsKey,
|
||||
gfx::Insets::TLBR(0, 20, 0, 0));
|
||||
} else {
|
||||
const bool is_game_controls_enabled =
|
||||
game_dashboard_utils::IsFlagSet(*flags, ArcGameControlsFlag::kEnabled);
|
||||
// TODO(b/279117180): Include application name in the subtitle.
|
||||
// TODO(b/274690042): Replace the strings with localized strings.
|
||||
game_controls_details_->SetSubtitle(is_game_controls_enabled ? u"On"
|
||||
: u"Off");
|
||||
|
||||
// Add toggle button and arrow icon for non-empty state.
|
||||
auto* edit_container = game_controls_details_->AddCustomizedTailView(
|
||||
std::make_unique<views::View>());
|
||||
@ -474,7 +478,7 @@ void GameDashboardMainMenuView::MaybeAddGameControlsDetailsRow(
|
||||
l10n_util::GetStringUTF16(IDS_APP_LIST_FOLDER_NAME_PLACEHOLDER));
|
||||
game_controls_feature_switch_->SetProperty(views::kMarginsKey,
|
||||
gfx::Insets::TLBR(0, 0, 0, 18));
|
||||
game_controls_feature_switch_->SetIsOn(is_flag_set);
|
||||
game_controls_feature_switch_->SetIsOn(is_game_controls_enabled);
|
||||
// Add arrow icon.
|
||||
edit_container->AddChildView(
|
||||
std::make_unique<views::ImageView>(ui::ImageModel::FromVectorIcon(
|
||||
|
Reference in New Issue
Block a user