summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorseanparent@google.com <seanparent@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 21:30:40 +0000
committerseanparent@google.com <seanparent@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 21:30:40 +0000
commit51e18a108cb9556644975c9e980bb6cd824c9f93 (patch)
tree0f15664b25cd2f11619a848bb93a4699c8c7c744 /views
parent9aeaf7d69326ebfd4f1942db10eff113cb01fc7c (diff)
downloadchromium_src-51e18a108cb9556644975c9e980bb6cd824c9f93.zip
chromium_src-51e18a108cb9556644975c9e980bb6cd824c9f93.tar.gz
chromium_src-51e18a108cb9556644975c9e980bb6cd824c9f93.tar.bz2
Cleanup of about box
Removed redundent version from update string. Added a line break to the ChromeOS version on test builds to improve appearence (select and drag to see complete version). Added margins to multiline edit fields without borders to make them match single line edit fields in positioning. Fixed an issue with setting the initial focus for GTK based windows. This fixes the problem of the cursor showing up in the version field. BUG=chromium-os:3571 1589 2967 TEST=none Review URL: http://codereview.chromium.org/2620003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49322 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/textfield/native_textfield_gtk.cc7
-rw-r--r--views/window/window_gtk.cc7
-rw-r--r--views/window/window_gtk.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/views/controls/textfield/native_textfield_gtk.cc b/views/controls/textfield/native_textfield_gtk.cc
index f2f74a9..5da4b78 100644
--- a/views/controls/textfield/native_textfield_gtk.cc
+++ b/views/controls/textfield/native_textfield_gtk.cc
@@ -184,8 +184,13 @@ void NativeTextfieldGtk::UpdateBorder() {
return;
if (textfield_->IsMultiLine()) {
- if (!textfield_->draw_border())
+ if (!textfield_->draw_border()) {
gtk_container_set_border_width(GTK_CONTAINER(native_view()), 0);
+
+ // Use margin to match entry with no border
+ SetHorizontalMargins(kTextViewBorderWidth / 2 + 1,
+ kTextViewBorderWidth / 2 + 1);
+ }
} else {
if (!textfield_->draw_border())
gtk_entry_set_has_frame(GTK_ENTRY(native_view()), false);
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc
index 8a3e7b9..16d3148 100644
--- a/views/window/window_gtk.cc
+++ b/views/window/window_gtk.cc
@@ -366,6 +366,13 @@ gboolean WindowGtk::OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event) {
return WidgetGtk::OnLeaveNotify(widget, event);
}
+void WindowGtk::SetInitialFocus() {
+ View* v = window_delegate_->GetInitiallyFocusedView();
+ if (v) {
+ v->RequestFocus();
+ }
+}
+
// static
WindowGtk* WindowGtk::GetWindowForNative(GtkWidget* widget) {
gpointer user_data = g_object_get_data(G_OBJECT(widget), "chrome-window");
diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h
index fffa6cb..358116e 100644
--- a/views/window/window_gtk.h
+++ b/views/window/window_gtk.h
@@ -68,6 +68,7 @@ class WindowGtk : public WidgetGtk, public Window {
virtual gboolean OnWindowStateEvent(GtkWidget* widget,
GdkEventWindowState* event);
virtual gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event);
+ virtual void SetInitialFocus();
// Gets the WindowGtk in the userdata section of the widget.
static WindowGtk* GetWindowForNative(GtkWidget* widget);