Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: ui/views/controls/combobox/combobox.cc

Issue 2261593002: Use ScopedRTLFlipCanvas more pervasively for RTL flipping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix namespace Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/scoped_canvas.cc ('k') | ui/views/style/mac/combobox_background_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/combobox/combobox.h" 5 #include "ui/views/controls/combobox/combobox.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 arrow_bounds = 762 arrow_bounds =
763 PositionArrowWithinContainer(arrow_bounds, ArrowSize(), style_); 763 PositionArrowWithinContainer(arrow_bounds, ArrowSize(), style_);
764 AdjustBoundsForRTLUI(&arrow_bounds); 764 AdjustBoundsForRTLUI(&arrow_bounds);
765 765
766 canvas->DrawImageInt(arrow_image_, arrow_bounds.x(), arrow_bounds.y()); 766 canvas->DrawImageInt(arrow_image_, arrow_bounds.x(), arrow_bounds.y());
767 } 767 }
768 768
769 void Combobox::PaintButtons(gfx::Canvas* canvas) { 769 void Combobox::PaintButtons(gfx::Canvas* canvas) {
770 DCHECK(style_ == STYLE_ACTION); 770 DCHECK(style_ == STYLE_ACTION);
771 771
772 gfx::ScopedRTLFlipCanvas scoped_canvas(canvas, bounds()); 772 gfx::ScopedRTLFlipCanvas scoped_canvas(canvas, width());
773 773
774 bool focused = HasFocus(); 774 bool focused = HasFocus();
775 const std::vector<const gfx::ImageSkia*>& arrow_button_images = 775 const std::vector<const gfx::ImageSkia*>& arrow_button_images =
776 menu_button_images_[focused][ 776 menu_button_images_[focused][
777 arrow_button_->state() == Button::STATE_HOVERED ? 777 arrow_button_->state() == Button::STATE_HOVERED ?
778 Button::STATE_NORMAL : arrow_button_->state()]; 778 Button::STATE_NORMAL : arrow_button_->state()];
779 779
780 int text_button_hover_alpha = 780 int text_button_hover_alpha =
781 text_button_->state() == Button::STATE_PRESSED ? 0 : 781 text_button_->state() == Button::STATE_PRESSED ? 0 :
782 static_cast<int>(static_cast<TransparentButton*>(text_button_)-> 782 static_cast<int>(static_cast<TransparentButton*>(text_button_)->
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 } 905 }
906 906
907 int Combobox::GetArrowContainerWidth() const { 907 int Combobox::GetArrowContainerWidth() const {
908 int padding = style_ == STYLE_NORMAL 908 int padding = style_ == STYLE_NORMAL
909 ? PlatformStyle::kComboboxNormalArrowPadding * 2 909 ? PlatformStyle::kComboboxNormalArrowPadding * 2
910 : kActionLeftPadding + kActionRightPadding; 910 : kActionLeftPadding + kActionRightPadding;
911 return ArrowSize().width() + padding; 911 return ArrowSize().width() + padding;
912 } 912 }
913 913
914 } // namespace views 914 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/scoped_canvas.cc ('k') | ui/views/style/mac/combobox_background_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698