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

Side by Side Diff: views/controls/textfield/native_textfield_gtk.cc

Issue 4151012: Prevent needless vertical margin change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/chromeos/login
Patch Set: Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <gtk/gtk.h> 5 #include <gtk/gtk.h>
6 6
7 #include "views/controls/textfield/native_textfield_gtk.h" 7 #include "views/controls/textfield/native_textfield_gtk.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 293
294 void NativeTextfieldGtk::SetHorizontalMargins(int left, int right) { 294 void NativeTextfieldGtk::SetHorizontalMargins(int left, int right) {
295 if (!native_view()) 295 if (!native_view())
296 return; 296 return;
297 if (textfield_->IsMultiLine()) { 297 if (textfield_->IsMultiLine()) {
298 GtkTextView* text_view = GTK_TEXT_VIEW(native_view()); 298 GtkTextView* text_view = GTK_TEXT_VIEW(native_view());
299 gtk_text_view_set_left_margin(text_view, left); 299 gtk_text_view_set_left_margin(text_view, left);
300 gtk_text_view_set_right_margin(text_view, right); 300 gtk_text_view_set_right_margin(text_view, right);
301 } else { 301 } else {
302 GtkBorder border = { left, right, 0, 0 }; 302 gfx::Insets insets = GetEntryInnerBorder(GTK_ENTRY(native_view()));
303 GtkBorder border = {left, right, insets.top(), insets.bottom()};
303 gtk_entry_set_inner_border(GTK_ENTRY(native_view()), &border); 304 gtk_entry_set_inner_border(GTK_ENTRY(native_view()), &border);
304 } 305 }
305 } 306 }
306 307
307 void NativeTextfieldGtk::SetFocus() { 308 void NativeTextfieldGtk::SetFocus() {
308 Focus(); 309 Focus();
309 } 310 }
310 311
311 View* NativeTextfieldGtk::GetView() { 312 View* NativeTextfieldGtk::GetView() {
312 return this; 313 return this;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 //////////////////////////////////////////////////////////////////////////////// 392 ////////////////////////////////////////////////////////////////////////////////
392 // NativeTextfieldWrapper, public: 393 // NativeTextfieldWrapper, public:
393 394
394 // static 395 // static
395 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 396 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
396 Textfield* field) { 397 Textfield* field) {
397 return new NativeTextfieldGtk(field); 398 return new NativeTextfieldGtk(field);
398 } 399 }
399 400
400 } // namespace views 401 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698