| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_header.h" | 5 #include "ui/views/controls/table/table_header.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/paint/paint_flags.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "third_party/skia/include/core/SkPaint.h" | |
| 11 #include "third_party/skia/include/core/SkPath.h" | 11 #include "third_party/skia/include/core/SkPath.h" |
| 12 #include "ui/base/cursor/cursor.h" | 12 #include "ui/base/cursor/cursor.h" |
| 13 #include "ui/gfx/canvas.h" | 13 #include "ui/gfx/canvas.h" |
| 14 #include "ui/gfx/text_utils.h" | 14 #include "ui/gfx/text_utils.h" |
| 15 #include "ui/native_theme/native_theme.h" | 15 #include "ui/native_theme/native_theme.h" |
| 16 #include "ui/views/background.h" | 16 #include "ui/views/background.h" |
| 17 #include "ui/views/controls/table/table_utils.h" | 17 #include "ui/views/controls/table/table_utils.h" |
| 18 #include "ui/views/controls/table/table_view.h" | 18 #include "ui/views/controls/table/table_view.h" |
| 19 #include "ui/views/native_cursor.h" | 19 #include "ui/views/native_cursor.h" |
| 20 | 20 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 width -= kSortIndicatorWidth; | 98 width -= kSortIndicatorWidth; |
| 99 } | 99 } |
| 100 | 100 |
| 101 canvas->DrawStringRectWithFlags( | 101 canvas->DrawStringRectWithFlags( |
| 102 columns[i].column.title, font_list_, text_color, | 102 columns[i].column.title, font_list_, text_color, |
| 103 gfx::Rect(GetMirroredXWithWidthInView(x, width), kVerticalPadding, | 103 gfx::Rect(GetMirroredXWithWidthInView(x, width), kVerticalPadding, |
| 104 width, height() - kVerticalPadding * 2), | 104 width, height() - kVerticalPadding * 2), |
| 105 TableColumnAlignmentToCanvasAlignment(columns[i].column.alignment)); | 105 TableColumnAlignmentToCanvasAlignment(columns[i].column.alignment)); |
| 106 | 106 |
| 107 if (paint_sort_indicator) { | 107 if (paint_sort_indicator) { |
| 108 SkPaint paint; | 108 cc::PaintFlags paint; |
| 109 paint.setColor(text_color); | 109 paint.setColor(text_color); |
| 110 paint.setStyle(SkPaint::kFill_Style); | 110 paint.setStyle(cc::PaintFlags::kFill_Style); |
| 111 paint.setAntiAlias(true); | 111 paint.setAntiAlias(true); |
| 112 | 112 |
| 113 int indicator_x = 0; | 113 int indicator_x = 0; |
| 114 ui::TableColumn::Alignment alignment = columns[i].column.alignment; | 114 ui::TableColumn::Alignment alignment = columns[i].column.alignment; |
| 115 if (base::i18n::IsRTL()) { | 115 if (base::i18n::IsRTL()) { |
| 116 if (alignment == ui::TableColumn::LEFT) | 116 if (alignment == ui::TableColumn::LEFT) |
| 117 alignment = ui::TableColumn::RIGHT; | 117 alignment = ui::TableColumn::RIGHT; |
| 118 else if (alignment == ui::TableColumn::RIGHT) | 118 else if (alignment == ui::TableColumn::RIGHT) |
| 119 alignment = ui::TableColumn::LEFT; | 119 alignment = ui::TableColumn::LEFT; |
| 120 } | 120 } |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 if (index > 0 && x >= column.x - kResizePadding && | 280 if (index > 0 && x >= column.x - kResizePadding && |
| 281 x <= column.x + kResizePadding) { | 281 x <= column.x + kResizePadding) { |
| 282 return index - 1; | 282 return index - 1; |
| 283 } | 283 } |
| 284 const int max_x = column.x + column.width; | 284 const int max_x = column.x + column.width; |
| 285 return (x >= max_x - kResizePadding && x <= max_x + kResizePadding) ? | 285 return (x >= max_x - kResizePadding && x <= max_x + kResizePadding) ? |
| 286 index : -1; | 286 index : -1; |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace views | 289 } // namespace views |
| OLD | NEW |