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 "chrome/browser/chromeos/panels/panel_scroller_header.h" | 5 #include "chrome/browser/chromeos/panels/panel_scroller_header.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/chromeos/panels/panel_scroller.h" | 8 #include "chrome/browser/chromeos/panels/panel_scroller.h" |
9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 void PanelScrollerHeader::OnMouseCaptureLost() { | 33 void PanelScrollerHeader::OnMouseCaptureLost() { |
34 scroller_->HeaderClicked(this); | 34 scroller_->HeaderClicked(this); |
35 } | 35 } |
36 | 36 |
37 gfx::Size PanelScrollerHeader::GetPreferredSize() { | 37 gfx::Size PanelScrollerHeader::GetPreferredSize() { |
38 return gfx::Size(size().width(), 18); | 38 return gfx::Size(size().width(), 18); |
39 } | 39 } |
40 | 40 |
41 void PanelScrollerHeader::OnPaint(gfx::Canvas* canvas) { | 41 void PanelScrollerHeader::OnPaint(gfx::Canvas* canvas) { |
42 // TODO(brettw) fill this out with real styling. | 42 // TODO(brettw) fill this out with real styling. |
43 canvas->FillRectInt(0xFFFFFFFF, 0, 0, size().width(), size().height()); | 43 canvas->FillRect(0xFFFFFFFF, gfx::Rect(GetLocalBounds())); |
Peter Kasting
2011/10/27 19:17:29
Nit: GetLocalBounds() already returns a rect, you
tfarina
2011/10/27 20:46:03
Done.
| |
44 canvas->DrawLineInt(0xFFE6E6E6, 0, size().height() - 1, | 44 canvas->DrawLineInt(0xFFE6E6E6, 0, size().height() - 1, |
45 size().width(), size().height() - 1); | 45 size().width(), size().height() - 1); |
46 | 46 |
47 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 47 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
48 gfx::Font font = | 48 gfx::Font font = |
49 rb.GetFont(ResourceBundle::BaseFont).DeriveFont(0, gfx::Font::BOLD); | 49 rb.GetFont(ResourceBundle::BaseFont).DeriveFont(0, gfx::Font::BOLD); |
50 int font_top = 1; | 50 int font_top = 1; |
51 canvas->DrawStringInt(title_, font, 0xFF000000, 3, font_top, | 51 canvas->DrawStringInt(title_, font, 0xFF000000, 3, font_top, |
52 size().width(), size().height() - font_top); | 52 size().width(), size().height() - font_top); |
53 } | 53 } |
OLD | NEW |