Commit 35e95fe3 authored by calamity's avatar calamity Committed by Commit bot

Make the app list speech view query able to span multiple lines.

This CL makes the app list speech view query able to span multiple lines.
This was made possible by a change in Label which drastically speeds up
layout of a label. which has to happen each time the query string changes.

BUG=443762

Review URL: https://codereview.chromium.org/1028023002

Cr-Commit-Position: refs/heads/master@{#321950}
parent d7763b11
...@@ -138,10 +138,9 @@ SpeechView::SpeechView(AppListViewDelegate* delegate) ...@@ -138,10 +138,9 @@ SpeechView::SpeechView(AppListViewDelegate* delegate)
// TODO(mukai): use BoundedLabel to cap 2 lines. // TODO(mukai): use BoundedLabel to cap 2 lines.
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
// TODO(calamity): make this label multiline once Label caches its RenderText.
// See http://crbug.com/450791.
speech_result_ = new views::Label( speech_result_ = new views::Label(
base::string16(), bundle.GetFontList(ui::ResourceBundle::LargeFont)); base::string16(), bundle.GetFontList(ui::ResourceBundle::LargeFont));
speech_result_->SetMultiLine(true);
speech_result_->SetHorizontalAlignment(gfx::ALIGN_LEFT); speech_result_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
container->AddChildView(speech_result_); container->AddChildView(speech_result_);
...@@ -223,6 +222,7 @@ void SpeechView::OnSpeechResult(const base::string16& result, ...@@ -223,6 +222,7 @@ void SpeechView::OnSpeechResult(const base::string16& result,
bool is_final) { bool is_final) {
speech_result_->SetText(result); speech_result_->SetText(result);
speech_result_->SetEnabledColor(kResultTextColor); speech_result_->SetEnabledColor(kResultTextColor);
Layout();
} }
void SpeechView::OnSpeechRecognitionStateChanged( void SpeechView::OnSpeechRecognitionStateChanged(
......
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