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

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

Issue 2620003: Cleanup of about box (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Split conditional Created 10 years, 6 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 | « chrome/browser/views/about_chrome_view.cc ('k') | views/window/window_gtk.h » ('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) 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } else { 177 } else {
178 gtk_editable_select_region(GTK_EDITABLE(native_view()), 0, 0); 178 gtk_editable_select_region(GTK_EDITABLE(native_view()), 0, 0);
179 } 179 }
180 } 180 }
181 181
182 void NativeTextfieldGtk::UpdateBorder() { 182 void NativeTextfieldGtk::UpdateBorder() {
183 if (!native_view()) 183 if (!native_view())
184 return; 184 return;
185 185
186 if (textfield_->IsMultiLine()) { 186 if (textfield_->IsMultiLine()) {
187 if (!textfield_->draw_border()) 187 if (!textfield_->draw_border()) {
188 gtk_container_set_border_width(GTK_CONTAINER(native_view()), 0); 188 gtk_container_set_border_width(GTK_CONTAINER(native_view()), 0);
189
190 // Use margin to match entry with no border
191 SetHorizontalMargins(kTextViewBorderWidth / 2 + 1,
192 kTextViewBorderWidth / 2 + 1);
193 }
189 } else { 194 } else {
190 if (!textfield_->draw_border()) 195 if (!textfield_->draw_border())
191 gtk_entry_set_has_frame(GTK_ENTRY(native_view()), false); 196 gtk_entry_set_has_frame(GTK_ENTRY(native_view()), false);
192 } 197 }
193 } 198 }
194 199
195 void NativeTextfieldGtk::UpdateTextColor() { 200 void NativeTextfieldGtk::UpdateTextColor() {
196 if (textfield_->use_default_text_color()) { 201 if (textfield_->use_default_text_color()) {
197 // Passing NULL as the color undoes the effect of previous calls to 202 // Passing NULL as the color undoes the effect of previous calls to
198 // gtk_widget_modify_text. 203 // gtk_widget_modify_text.
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 //////////////////////////////////////////////////////////////////////////////// 385 ////////////////////////////////////////////////////////////////////////////////
381 // NativeTextfieldWrapper, public: 386 // NativeTextfieldWrapper, public:
382 387
383 // static 388 // static
384 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 389 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
385 Textfield* field) { 390 Textfield* field) {
386 return new NativeTextfieldGtk(field); 391 return new NativeTextfieldGtk(field);
387 } 392 }
388 393
389 } // namespace views 394 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/views/about_chrome_view.cc ('k') | views/window/window_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698