| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/common/shelf/shelf_button.h" | 5 #include "ash/common/shelf/shelf_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/ash_constants.h" | 9 #include "ash/common/ash_constants.h" |
| 10 #include "ash/common/shelf/ink_drop_button_listener.h" | 10 #include "ash/common/shelf/ink_drop_button_listener.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 DCHECK_EQ(width(), height()); | 147 DCHECK_EQ(width(), height()); |
| 148 DCHECK_EQ(kIndicatorRadiusDip, width() / 2); | 148 DCHECK_EQ(kIndicatorRadiusDip, width() / 2); |
| 149 const float dsf = canvas->UndoDeviceScaleFactor(); | 149 const float dsf = canvas->UndoDeviceScaleFactor(); |
| 150 const int kStrokeWidthPx = 1; | 150 const int kStrokeWidthPx = 1; |
| 151 gfx::PointF center = gfx::RectF(GetLocalBounds()).CenterPoint(); | 151 gfx::PointF center = gfx::RectF(GetLocalBounds()).CenterPoint(); |
| 152 center.Scale(dsf); | 152 center.Scale(dsf); |
| 153 | 153 |
| 154 // Fill the center. | 154 // Fill the center. |
| 155 cc::PaintFlags flags; | 155 cc::PaintFlags flags; |
| 156 flags.setColor(kIndicatorColor); | 156 flags.setColor(kIndicatorColor); |
| 157 flags.setAntiAlias(true); | 157 flags.setFlags(cc::PaintFlags::kAntiAlias_Flag); |
| 158 canvas->DrawCircle(center, dsf * kIndicatorRadiusDip - kStrokeWidthPx, | 158 canvas->DrawCircle(center, dsf * kIndicatorRadiusDip - kStrokeWidthPx, |
| 159 flags); | 159 flags); |
| 160 | 160 |
| 161 // Stroke the border. | 161 // Stroke the border. |
| 162 flags.setColor(SkColorSetA(SK_ColorBLACK, 0x4D)); | 162 flags.setColor(SkColorSetA(SK_ColorBLACK, 0x4D)); |
| 163 flags.setStyle(cc::PaintFlags::kStroke_Style); | 163 flags.setStyle(SkPaint::kStroke_Style); |
| 164 canvas->DrawCircle( | 164 canvas->DrawCircle( |
| 165 center, dsf * kIndicatorRadiusDip - kStrokeWidthPx / 2.0f, flags); | 165 center, dsf * kIndicatorRadiusDip - kStrokeWidthPx / 2.0f, flags); |
| 166 } | 166 } |
| 167 | 167 |
| 168 // ShelfButtonAnimation::Observer | 168 // ShelfButtonAnimation::Observer |
| 169 void AnimationProgressed() override { | 169 void AnimationProgressed() override { |
| 170 UpdateAnimating(); | 170 UpdateAnimating(); |
| 171 SchedulePaint(); | 171 SchedulePaint(); |
| 172 } | 172 } |
| 173 | 173 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 icon_view_->SetHorizontalAlignment(is_horizontal_shelf | 505 icon_view_->SetHorizontalAlignment(is_horizontal_shelf |
| 506 ? views::ImageView::CENTER | 506 ? views::ImageView::CENTER |
| 507 : views::ImageView::LEADING); | 507 : views::ImageView::LEADING); |
| 508 icon_view_->SetVerticalAlignment(is_horizontal_shelf | 508 icon_view_->SetVerticalAlignment(is_horizontal_shelf |
| 509 ? views::ImageView::LEADING | 509 ? views::ImageView::LEADING |
| 510 : views::ImageView::CENTER); | 510 : views::ImageView::CENTER); |
| 511 SchedulePaint(); | 511 SchedulePaint(); |
| 512 } | 512 } |
| 513 | 513 |
| 514 } // namespace ash | 514 } // namespace ash |
| OLD | NEW |