Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(935)

Unified Diff: ash/common/system/chromeos/audio/volume_view.cc

Issue 2671593003: Re-layout Chrome OS audio row when headphone connected (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/audio/volume_view.cc
diff --git a/ash/common/system/chromeos/audio/volume_view.cc b/ash/common/system/chromeos/audio/volume_view.cc
index 30ed63db42e22d847cd746d9be5621ad1f6d2cff..22132d96465da226d8a9f44ae993a181dcd03c4d 100644
--- a/ash/common/system/chromeos/audio/volume_view.cc
+++ b/ash/common/system/chromeos/audio/volume_view.cc
@@ -256,6 +256,8 @@ void VolumeView::UpdateDeviceTypeAndMore() {
if (!show_more)
return;
+ bool was_visible = device_type_->visible();
+
// Show output device icon if necessary.
device_type_->SetVisible(false);
if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
@@ -275,6 +277,8 @@ void VolumeView::UpdateDeviceTypeAndMore() {
device_type_->SetVisible(true);
}
}
+ if (device_type_->visible() != was_visible)
+ device_type_->InvalidateLayout();
sadrul 2017/02/02 21:25:34 Setting the visibility can trigger a repaint. For
mohsen 2017/02/02 21:35:31 Sure. That makes a lot of sense. Done.
}
void VolumeView::HandleVolumeUp(int level) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698