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

Side by Side Diff: ui/app_list/views/search_box_view.cc

Issue 516943003: Add textfield internal padding from FocusableBorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. 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 unified diff | Download patch
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/app_list/views/search_box_view.h" 5 #include "ui/app_list/views/search_box_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ui/app_list/app_list_model.h" 9 #include "ui/app_list/app_list_model.h"
10 #include "ui/app_list/app_list_switches.h" 10 #include "ui/app_list/app_list_switches.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 speech_button_(NULL), 87 speech_button_(NULL),
88 search_box_(new views::Textfield), 88 search_box_(new views::Textfield),
89 contents_view_(NULL) { 89 contents_view_(NULL) {
90 if (switches::IsExperimentalAppListEnabled()) { 90 if (switches::IsExperimentalAppListEnabled()) {
91 set_background(new SearchBoxBackground()); 91 set_background(new SearchBoxBackground());
92 } else { 92 } else {
93 icon_view_ = new views::ImageView; 93 icon_view_ = new views::ImageView;
94 AddChildView(icon_view_); 94 AddChildView(icon_view_);
95 } 95 }
96 96
97 views::BoxLayout* layout = new views::BoxLayout( 97 views::BoxLayout* layout =
98 views::BoxLayout::kHorizontal, kPadding, 0, kPadding); 98 new views::BoxLayout(views::BoxLayout::kHorizontal,
99 kPadding,
100 0,
101 kPadding - views::Textfield::kTextPadding);
calamity 2014/09/08 03:37:50 This will change the horizontal spacing of everyth
Peter Kasting 2014/09/08 17:45:59 Practically-speaking, what's the problematic effec
calamity 2014/09/09 00:46:38 I see. In that case, we should leave the code as i
Peter Kasting 2014/09/09 01:33:29 But the textfield padding is increasing. Compensa
calamity 2014/09/09 02:34:32 Ah ok. Yeah. It will reduce that padding. At the m
99 SetLayoutManager(layout); 102 SetLayoutManager(layout);
100 layout->set_cross_axis_alignment( 103 layout->set_cross_axis_alignment(
101 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); 104 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
102 layout->set_minimum_cross_axis_size(switches::IsExperimentalAppListEnabled() 105 layout->set_minimum_cross_axis_size(switches::IsExperimentalAppListEnabled()
103 ? kExperimentalSearchBoxHeight 106 ? kExperimentalSearchBoxHeight
104 : kPreferredHeight); 107 : kPreferredHeight);
105 108
106 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 109 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
107 110
108 search_box_->SetBorder(views::Border::NullBorder()); 111 search_box_->SetBorder(views::Border::NullBorder());
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 NotifyQueryChanged(); 270 NotifyQueryChanged();
268 } 271 }
269 272
270 void SearchBoxView::OnSpeechRecognitionStateChanged( 273 void SearchBoxView::OnSpeechRecognitionStateChanged(
271 SpeechRecognitionState new_state) { 274 SpeechRecognitionState new_state) {
272 SpeechRecognitionButtonPropChanged(); 275 SpeechRecognitionButtonPropChanged();
273 SchedulePaint(); 276 SchedulePaint();
274 } 277 }
275 278
276 } // namespace app_list 279 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698