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

Unified Diff: ui/views/controls/table/table_view.cc

Issue 2715813002: Change focus indicator for TableView and TreeView. (Closed)
Patch Set: rename Created 3 years, 10 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/scroll_view.cc ('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/table/table_view.cc
diff --git a/ui/views/controls/table/table_view.cc b/ui/views/controls/table/table_view.cc
index 94fe60c9bd560dccfb18cd4f10ac0cdd5a874369..ab17e37d723aad00bee65cb576e12a2cc833c984 100644
--- a/ui/views/controls/table/table_view.cc
+++ b/ui/views/controls/table/table_view.cc
@@ -546,8 +546,6 @@ void TableView::OnPaint(gfx::Canvas* canvas) {
const bool is_selected = selection_model_.IsSelected(model_index);
if (is_selected)
canvas->FillRect(GetRowBounds(i), selected_bg_color);
- if (selection_model_.active() == model_index && HasFocus())
- canvas->DrawFocusRect(GetRowBounds(i));
for (int j = region.min_column; j < region.max_column; ++j) {
const gfx::Rect cell_bounds(GetCellBounds(i, j));
int text_x = kTextHorizontalPadding + cell_bounds.x();
@@ -625,11 +623,18 @@ void TableView::OnPaint(gfx::Canvas* canvas) {
}
void TableView::OnFocus() {
+ ScrollView* scroll_view = ScrollView::GetScrollViewForContents(this);
+ if (scroll_view)
+ scroll_view->SetHasFocusIndicator(true);
SchedulePaintForSelection();
+
NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true);
}
void TableView::OnBlur() {
+ ScrollView* scroll_view = ScrollView::GetScrollViewForContents(this);
+ if (scroll_view)
+ scroll_view->SetHasFocusIndicator(false);
SchedulePaintForSelection();
}
« no previous file with comments | « ui/views/controls/scroll_view.cc ('k') | ui/views/controls/tree/tree_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698