OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/controls/table/table_view.h" | 5 #include "ui/views/controls/table/table_view.h" |
6 | 6 |
7 #include <commctrl.h> | 7 #include <commctrl.h> |
8 #include <windowsx.h> | 8 #include <windowsx.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 if (IntersectRect(&intersection, &icon_rect, &client_rect)) { | 1238 if (IntersectRect(&intersection, &icon_rect, &client_rect)) { |
1239 gfx::CanvasSkia canvas(icon_rect.right - icon_rect.left, | 1239 gfx::CanvasSkia canvas(icon_rect.right - icon_rect.left, |
1240 icon_rect.bottom - icon_rect.top, false); | 1240 icon_rect.bottom - icon_rect.top, false); |
1241 | 1241 |
1242 // It seems the state in nmcd.uItemState is not correct. | 1242 // It seems the state in nmcd.uItemState is not correct. |
1243 // We'll retrieve it explicitly. | 1243 // We'll retrieve it explicitly. |
1244 int selected = ListView_GetItemState( | 1244 int selected = ListView_GetItemState( |
1245 list_view_, view_index, LVIS_SELECTED | LVIS_DROPHILITED); | 1245 list_view_, view_index, LVIS_SELECTED | LVIS_DROPHILITED); |
1246 bool drop_highlight = ((selected & LVIS_DROPHILITED) != 0); | 1246 bool drop_highlight = ((selected & LVIS_DROPHILITED) != 0); |
1247 int bg_color_index; | 1247 int bg_color_index; |
1248 if (!IsEnabled()) | 1248 if (!enabled()) |
1249 bg_color_index = COLOR_3DFACE; | 1249 bg_color_index = COLOR_3DFACE; |
1250 else if (drop_highlight) | 1250 else if (drop_highlight) |
1251 bg_color_index = COLOR_HIGHLIGHT; | 1251 bg_color_index = COLOR_HIGHLIGHT; |
1252 else if (selected) | 1252 else if (selected) |
1253 bg_color_index = HasFocus() ? COLOR_HIGHLIGHT : COLOR_3DFACE; | 1253 bg_color_index = HasFocus() ? COLOR_HIGHLIGHT : COLOR_3DFACE; |
1254 else | 1254 else |
1255 bg_color_index = COLOR_WINDOW; | 1255 bg_color_index = COLOR_WINDOW; |
1256 // NOTE: This may be invoked without the ListView filling in the | 1256 // NOTE: This may be invoked without the ListView filling in the |
1257 // background (or rather windows paints background, then invokes | 1257 // background (or rather windows paints background, then invokes |
1258 // this twice). As such, we always fill in the background. | 1258 // this twice). As such, we always fill in the background. |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 } | 1636 } |
1637 | 1637 |
1638 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { | 1638 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { |
1639 if (view_index_ == -1) | 1639 if (view_index_ == -1) |
1640 model_index_ = -1; | 1640 model_index_ = -1; |
1641 else | 1641 else |
1642 model_index_ = table_view_->ViewToModel(view_index_); | 1642 model_index_ = table_view_->ViewToModel(view_index_); |
1643 } | 1643 } |
1644 | 1644 |
1645 } // namespace views | 1645 } // namespace views |
OLD | NEW |