summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
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);