diff options
Diffstat (limited to 'ui/views/controls/scrollbar')
| -rw-r--r-- | ui/views/controls/scrollbar/bitmap_scroll_bar.cc | 40 | ||||
| -rw-r--r-- | ui/views/controls/scrollbar/bitmap_scroll_bar.h | 6 | ||||
| -rw-r--r-- | ui/views/controls/scrollbar/scroll_bar.h | 2 |
3 files changed, 24 insertions, 24 deletions
diff --git a/ui/views/controls/scrollbar/bitmap_scroll_bar.cc b/ui/views/controls/scrollbar/bitmap_scroll_bar.cc index aa614ea..6caaac0 100644 --- a/ui/views/controls/scrollbar/bitmap_scroll_bar.cc +++ b/ui/views/controls/scrollbar/bitmap_scroll_bar.cc @@ -13,10 +13,10 @@ #include "base/utf_string_conversions.h" #include "build/build_config.h" #include "grit/ui_strings.h" -#include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/keycodes/keyboard_codes.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/canvas.h" +#include "ui/gfx/image/image_skia.h" #include "ui/views/controls/menu/menu.h" #include "ui/views/controls/scroll_view.h" #include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h" @@ -109,50 +109,50 @@ class BitmapScrollBarThumb : public BaseScrollBarThumb { // View overrides: virtual gfx::Size GetPreferredSize() OVERRIDE { - return gfx::Size(background_bitmap()->width(), - start_cap_bitmap()->height() + - end_cap_bitmap()->height() + - grippy_bitmap()->height()); + return gfx::Size(background_image()->width(), + start_cap_image()->height() + + end_cap_image()->height() + + grippy_image()->height()); } protected: // View overrides: virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { - canvas->DrawBitmapInt(*start_cap_bitmap(), 0, 0); - int top_cap_height = start_cap_bitmap()->height(); - int bottom_cap_height = end_cap_bitmap()->height(); + canvas->DrawBitmapInt(*start_cap_image(), 0, 0); + int top_cap_height = start_cap_image()->height(); + int bottom_cap_height = end_cap_image()->height(); int thumb_body_height = height() - top_cap_height - bottom_cap_height; - canvas->TileImageInt(*background_bitmap(), 0, top_cap_height, - background_bitmap()->width(), thumb_body_height); - canvas->DrawBitmapInt(*end_cap_bitmap(), 0, + canvas->TileImageInt(*background_image(), 0, top_cap_height, + background_image()->width(), thumb_body_height); + canvas->DrawBitmapInt(*end_cap_image(), 0, height() - bottom_cap_height); // Paint the grippy over the track. - int grippy_x = (width() - grippy_bitmap()->width()) / 2; - int grippy_y = (thumb_body_height - grippy_bitmap()->height()) / 2; - canvas->DrawBitmapInt(*grippy_bitmap(), grippy_x, grippy_y); + int grippy_x = (width() - grippy_image()->width()) / 2; + int grippy_y = (thumb_body_height - grippy_image()->height()) / 2; + canvas->DrawBitmapInt(*grippy_image(), grippy_x, grippy_y); } private: // Returns the image rendered at the start of the thumb. - gfx::ImageSkia* start_cap_bitmap() const { + gfx::ImageSkia* start_cap_image() const { return scroll_bar_->images_[BitmapScrollBar::THUMB_START_CAP][GetState()]; } // Returns the image rendered at the end of the thumb. - gfx::ImageSkia* end_cap_bitmap() const { + gfx::ImageSkia* end_cap_image() const { return scroll_bar_->images_[BitmapScrollBar::THUMB_END_CAP][GetState()]; } // Returns the image that is tiled in the background of the thumb between // the start and the end caps. - gfx::ImageSkia* background_bitmap() const { + gfx::ImageSkia* background_image() const { return scroll_bar_->images_[BitmapScrollBar::THUMB_MIDDLE][GetState()]; } // Returns the image that is rendered in the middle of the thumb - // transparently over the background bitmap. - gfx::ImageSkia* grippy_bitmap() const { + // transparently over the background image. + gfx::ImageSkia* grippy_image() const { return scroll_bar_->images_[BitmapScrollBar::THUMB_GRIPPY] [CustomButton::BS_NORMAL]; } @@ -265,7 +265,7 @@ void BitmapScrollBar::Layout() { // Preserve the height/width of the thumb (depending on orientation) as set // by the last call to |Update|, but coerce the width/height to be the - // appropriate value for the bitmaps provided. + // appropriate value for the images provided. if (IsHorizontal()) { thumb->SetBounds(thumb->x(), thumb->y(), thumb->width(), thumb_prefsize.height()); diff --git a/ui/views/controls/scrollbar/bitmap_scroll_bar.h b/ui/views/controls/scrollbar/bitmap_scroll_bar.h index 3c6a1b4..10fd6d1 100644 --- a/ui/views/controls/scrollbar/bitmap_scroll_bar.h +++ b/ui/views/controls/scrollbar/bitmap_scroll_bar.h @@ -18,8 +18,8 @@ class BitmapScrollBarThumb; // // BitmapScrollBar // -// A ScrollBar subclass that implements a scroll bar rendered using bitmaps -// that the user provides. There are bitmaps for the up and down buttons, as +// A ScrollBar subclass that implements a scroll bar rendered using images +// that the user provides. There are images for the up and down buttons, as // well as for the thumb and track. This is intended for creating UIs that // have customized, non-native appearances, like floating HUDs etc. // @@ -30,7 +30,7 @@ class VIEWS_EXPORT BitmapScrollBar : public BaseScrollBar, BitmapScrollBar(bool horizontal, bool show_scroll_buttons); virtual ~BitmapScrollBar() { } - // A list of parts that the user may supply bitmaps for. + // A list of parts that the user may supply images for. enum ScrollBarPart { // The button used to represent scrolling up/left by 1 line. PREV_BUTTON = 0, diff --git a/ui/views/controls/scrollbar/scroll_bar.h b/ui/views/controls/scrollbar/scroll_bar.h index 52bbb17..b34f4ed 100644 --- a/ui/views/controls/scrollbar/scroll_bar.h +++ b/ui/views/controls/scrollbar/scroll_bar.h @@ -91,7 +91,7 @@ class VIEWS_EXPORT ScrollBar : public View { protected: // Create new scrollbar, either horizontal or vertical. These are protected // since you need to be creating either a NativeScrollBar or a - // BitmapScrollBar. + // ImageScrollBar. explicit ScrollBar(bool is_horiz); private: |
