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

Unified Diff: ui/views/controls/scroll_view.cc

Issue 2411693002: views: add focus ring to TreeView (Closed)
Patch Set: relayout focusring in scrollview Created 4 years, 2 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 | « ui/views/controls/focus_ring.h ('k') | ui/views/controls/tree/tree_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/scroll_view.cc
diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc
index 68ee68fee3eaa8561e097be266a8ec202f448155..cd09df95662eae55a5bf8fdaf1bb266ce13cac7c 100644
--- a/ui/views/controls/scroll_view.cc
+++ b/ui/views/controls/scroll_view.cc
@@ -12,6 +12,7 @@
#include "ui/native_theme/native_theme.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
+#include "ui/views/controls/focus_ring.h"
#include "ui/views/style/platform_style.h"
#include "ui/views/widget/widget.h"
@@ -294,6 +295,11 @@ int ScrollView::GetHeightForWidth(int width) const {
}
void ScrollView::Layout() {
+ // If there's a focus ring, lay it out first.
+ for (int i = 0; i < child_count(); ++i)
sky 2016/10/12 20:08:53 I suspect tree isn't the only place that wants scr
Elly Fong-Jones 2016/10/12 21:10:22 Done.
+ if (child_at(i)->GetClassName() == FocusRing::kViewClassName)
+ child_at(i)->Layout();
+
gfx::Rect available_rect = GetContentsBounds();
if (is_bounded()) {
int content_width = available_rect.width();
« no previous file with comments | « ui/views/controls/focus_ring.h ('k') | ui/views/controls/tree/tree_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698