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

Unified Diff: ui/views/controls/combobox/combobox.cc

Issue 516943003: Add textfield internal padding from FocusableBorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore Insets const ref. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/views/search_box_view.cc ('k') | ui/views/controls/focusable_border.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/combobox/combobox.cc
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc
index bbba555a3e711aa57bcd738b1608a2493c353ea7..81b3ae5d2f29d7bbe0677b3ea6d9e07994a9ce1e 100644
--- a/ui/views/controls/combobox/combobox.cc
+++ b/ui/views/controls/combobox/combobox.cc
@@ -32,6 +32,7 @@
#include "ui/views/controls/menu/menu_runner_handler.h"
#include "ui/views/controls/menu/submenu_view.h"
#include "ui/views/controls/prefix_selector.h"
+#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/ime/input_method.h"
#include "ui/views/mouse_constants.h"
#include "ui/views/painter.h"
@@ -410,6 +411,10 @@ gfx::Size Combobox::GetPreferredSize() const {
// The preferred size will drive the local bounds which in turn is used to set
// the minimum width for the dropdown list.
gfx::Insets insets = GetInsets();
+ insets += gfx::Insets(Textfield::kTextPadding,
+ Textfield::kTextPadding,
+ Textfield::kTextPadding,
+ Textfield::kTextPadding);
int total_width = std::max(kMinComboboxWidth, content_size_.width()) +
insets.width() + GetDisclosureArrowLeftPadding() +
ArrowSize().width() + GetDisclosureArrowRightPadding();
@@ -628,7 +633,7 @@ void Combobox::UpdateFromModel() {
void Combobox::UpdateBorder() {
scoped_ptr<FocusableBorder> border(new FocusableBorder());
if (style_ == STYLE_ACTION)
- border->SetInsets(8, 13, 8, 13);
+ border->SetInsets(5, 10, 5, 10);
if (invalid_)
border->SetColor(kWarningColor);
SetBorder(border.PassAs<Border>());
@@ -640,6 +645,7 @@ void Combobox::AdjustBoundsForRTLUI(gfx::Rect* rect) const {
void Combobox::PaintText(gfx::Canvas* canvas) {
gfx::Insets insets = GetInsets();
+ insets += gfx::Insets(0, Textfield::kTextPadding, 0, Textfield::kTextPadding);
gfx::ScopedCanvas scoped_canvas(canvas);
canvas->ClipRect(GetContentsBounds());
« no previous file with comments | « ui/app_list/views/search_box_view.cc ('k') | ui/views/controls/focusable_border.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698