Index: ui/app_list/views/speech_view.cc |
diff --git a/ui/app_list/views/speech_view.cc b/ui/app_list/views/speech_view.cc |
index 926bec24ac9452040171afd0698abb3c897abd2d..c42897ef9400fe9fd579d132dc99f1267a00d87a 100644 |
--- a/ui/app_list/views/speech_view.cc |
+++ b/ui/app_list/views/speech_view.cc |
@@ -163,8 +163,6 @@ SpeechView::SpeechView(AppListViewDelegate* delegate) |
} |
indicator_ = new SoundLevelIndicator(); |
- indicator_->SetVisible(false); |
- container->AddChildView(indicator_); |
mic_button_ = new MicButton(this); |
container->AddChildView(mic_button_); |
@@ -246,10 +244,11 @@ void SpeechView::OnSpeechSoundLevelChanged(uint8 level) { |
origin.Offset(-radius, -radius + kIndicatorCenterOffsetY); |
gfx::Rect indicator_bounds = |
gfx::Rect(origin, gfx::Size(radius * 2, radius * 2)); |
- if (indicator_->visible()) { |
+ if (indicator_->parent()) { |
indicator_animator_->AnimateViewTo(indicator_, indicator_bounds); |
} else { |
- indicator_->SetVisible(true); |
+ views::View* container = child_at(0); |
+ container->AddChildViewAt(indicator_, container->GetIndexOf(mic_button_)); |
indicator_->SetBoundsRect(indicator_bounds); |
} |
} |
@@ -272,7 +271,7 @@ void SpeechView::OnSpeechRecognitionStateChanged( |
if (new_state == SPEECH_RECOGNITION_NETWORK_ERROR) { |
text_resource_id = IDS_APP_LIST_SPEECH_NETWORK_ERROR_HINT_TEXT; |
- indicator_->SetVisible(false); |
xiyuan
2014/06/18 23:13:05
Would a "indicator_->SchedulePaint()" here help?
Jun Mukai
2014/06/18 23:13:51
I tried SchedulePaint but it didn't help.
xiyuan
2014/06/18 23:16:02
Try put it before "indicator_->SetVisible(false);"
Jun Mukai
2014/06/19 00:58:14
Tried all pattern of SchedulePaint(), child_at(0)-
Jun Mukai
2014/06/19 01:00:57
Ah, I think I've found why. indicator_animator_ m
Jun Mukai
2014/06/19 02:20:15
Turns out I was totally pointless :(
Everything wa
|
+ child_at(0)->RemoveChildView(indicator_); |
} |
speech_result_->SetText(l10n_util::GetStringUTF16(text_resource_id)); |
speech_result_->SetEnabledColor(kHintTextColor); |