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/native_table_win.h" | 5 #include "ui/views/controls/table/native_table_win.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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 if (IntersectRect(&intersection, &icon_rect, &client_rect)) { | 515 if (IntersectRect(&intersection, &icon_rect, &client_rect)) { |
516 gfx::CanvasSkia canvas(icon_rect.right - icon_rect.left, | 516 gfx::CanvasSkia canvas(icon_rect.right - icon_rect.left, |
517 icon_rect.bottom - icon_rect.top, false); | 517 icon_rect.bottom - icon_rect.top, false); |
518 | 518 |
519 // It seems the state in nmcd.uItemState is not correct. | 519 // It seems the state in nmcd.uItemState is not correct. |
520 // We'll retrieve it explicitly. | 520 // We'll retrieve it explicitly. |
521 int selected = ListView_GetItemState( | 521 int selected = ListView_GetItemState( |
522 native_view(), view_index, LVIS_SELECTED | LVIS_DROPHILITED); | 522 native_view(), view_index, LVIS_SELECTED | LVIS_DROPHILITED); |
523 bool drop_highlight = ((selected & LVIS_DROPHILITED) != 0); | 523 bool drop_highlight = ((selected & LVIS_DROPHILITED) != 0); |
524 int bg_color_index; | 524 int bg_color_index; |
525 if (!IsEnabled()) | 525 if (!enabled()) |
526 bg_color_index = COLOR_3DFACE; | 526 bg_color_index = COLOR_3DFACE; |
527 else if (drop_highlight) | 527 else if (drop_highlight) |
528 bg_color_index = COLOR_HIGHLIGHT; | 528 bg_color_index = COLOR_HIGHLIGHT; |
529 else if (selected) | 529 else if (selected) |
530 bg_color_index = HasFocus() ? COLOR_HIGHLIGHT : COLOR_3DFACE; | 530 bg_color_index = HasFocus() ? COLOR_HIGHLIGHT : COLOR_3DFACE; |
531 else | 531 else |
532 bg_color_index = COLOR_WINDOW; | 532 bg_color_index = COLOR_WINDOW; |
533 // NOTE: This may be invoked without the ListView filling in the | 533 // NOTE: This may be invoked without the ListView filling in the |
534 // background (or rather windows paints background, then invokes | 534 // background (or rather windows paints background, then invokes |
535 // this twice). As such, we always fill in the background. | 535 // this twice). As such, we always fill in the background. |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 | 905 |
906 //////////////////////////////////////////////////////////////////////////////// | 906 //////////////////////////////////////////////////////////////////////////////// |
907 // NativeTableWrapper, public: | 907 // NativeTableWrapper, public: |
908 | 908 |
909 // static | 909 // static |
910 NativeTableWrapper* NativeTableWrapper::CreateNativeWrapper(TableView2* table) { | 910 NativeTableWrapper* NativeTableWrapper::CreateNativeWrapper(TableView2* table) { |
911 return new NativeTableWin(table); | 911 return new NativeTableWin(table); |
912 } | 912 } |
913 | 913 |
914 } // namespace views | 914 } // namespace views |
OLD | NEW |