| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 width -= kSortIndicatorWidth; | 102 width -= kSortIndicatorWidth; |
| 103 } | 103 } |
| 104 | 104 |
| 105 canvas->DrawStringRectWithFlags( | 105 canvas->DrawStringRectWithFlags( |
| 106 columns[i].column.title, font_list_, kTextColor, | 106 columns[i].column.title, font_list_, kTextColor, |
| 107 gfx::Rect(GetMirroredXWithWidthInView(x, width), kVerticalPadding, | 107 gfx::Rect(GetMirroredXWithWidthInView(x, width), kVerticalPadding, |
| 108 width, height() - kVerticalPadding * 2), | 108 width, height() - kVerticalPadding * 2), |
| 109 TableColumnAlignmentToCanvasAlignment(columns[i].column.alignment)); | 109 TableColumnAlignmentToCanvasAlignment(columns[i].column.alignment)); |
| 110 | 110 |
| 111 if (paint_sort_indicator) { | 111 if (paint_sort_indicator) { |
| 112 SkPaint paint; | 112 cc::PaintFlags paint; |
| 113 paint.setColor(kTextColor); | 113 paint.setColor(kTextColor); |
| 114 paint.setStyle(SkPaint::kFill_Style); | 114 paint.setStyle(cc::PaintFlags::kFill_Style); |
| 115 paint.setAntiAlias(true); | 115 paint.setAntiAlias(true); |
| 116 | 116 |
| 117 int indicator_x = 0; | 117 int indicator_x = 0; |
| 118 ui::TableColumn::Alignment alignment = columns[i].column.alignment; | 118 ui::TableColumn::Alignment alignment = columns[i].column.alignment; |
| 119 if (base::i18n::IsRTL()) { | 119 if (base::i18n::IsRTL()) { |
| 120 if (alignment == ui::TableColumn::LEFT) | 120 if (alignment == ui::TableColumn::LEFT) |
| 121 alignment = ui::TableColumn::RIGHT; | 121 alignment = ui::TableColumn::RIGHT; |
| 122 else if (alignment == ui::TableColumn::RIGHT) | 122 else if (alignment == ui::TableColumn::RIGHT) |
| 123 alignment = ui::TableColumn::LEFT; | 123 alignment = ui::TableColumn::LEFT; |
| 124 } | 124 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 if (index > 0 && x >= column.x - kResizePadding && | 279 if (index > 0 && x >= column.x - kResizePadding && |
| 280 x <= column.x + kResizePadding) { | 280 x <= column.x + kResizePadding) { |
| 281 return index - 1; | 281 return index - 1; |
| 282 } | 282 } |
| 283 const int max_x = column.x + column.width; | 283 const int max_x = column.x + column.width; |
| 284 return (x >= max_x - kResizePadding && x <= max_x + kResizePadding) ? | 284 return (x >= max_x - kResizePadding && x <= max_x + kResizePadding) ? |
| 285 index : -1; | 285 index : -1; |
| 286 } | 286 } |
| 287 | 287 |
| 288 } // namespace views | 288 } // namespace views |
| OLD | NEW |