diff --git a/src/client/ui/background-box.vala b/src/client/ui/background-box.vala
new file mode 100644
index 00000000..46ee802d
--- /dev/null
+++ b/src/client/ui/background-box.vala
@@ -0,0 +1,26 @@
+/* Copyright 2011 Yorba Foundation
+ *
+ * This software is licensed under the GNU Lesser General Public License
+ * (version 2.1 or later). See the COPYING file in this distribution.
+ */
+
+// A single-child container that renders its a background color.
+public class BackgroundBox : Gtk.Frame {
+ public BackgroundBox() {
+ Object(label: null);
+ shadow_type = Gtk.ShadowType.NONE;
+ }
+
+ public override bool draw(Cairo.Context cr) {
+ Gtk.StyleContext sc = get_style_context();
+
+ sc.save();
+ sc.set_state(get_state_flags());
+ Gtk.render_background(sc, cr, 0, 0, get_allocated_width(), get_allocated_height());
+ sc.restore();
+
+ base.draw(cr);
+ return false;
+ }
+}
+
diff --git a/src/client/ui/message-viewer.vala b/src/client/ui/message-viewer.vala
index 91d2d261..6b3f8693 100644
--- a/src/client/ui/message-viewer.vala
+++ b/src/client/ui/message-viewer.vala
@@ -34,6 +34,7 @@ public class MessageViewer : Gtk.Viewport {
set_border_width(0);
message_box.set_border_width(0);
message_box.spacing = 0;
+ resize_mode = Gtk.ResizeMode.IMMEDIATE;
}
// Removes all displayed e-mails from the view.
@@ -120,7 +121,7 @@ public class MessageViewer : Gtk.Viewport {
debug("Could not get message text. %s", err.message);
}
- Gtk.EventBox box = new Gtk.EventBox();
+ BackgroundBox box = new BackgroundBox();
box.add(container);
box.margin = MESSAGE_BOX_MARGIN;
@@ -144,6 +145,8 @@ public class MessageViewer : Gtk.Viewport {
label_title.set_line_wrap(true);
label_value.set_line_wrap(true);
+ label_title.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR);
+ label_value.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR);
label_title.set_alignment(1.0f, 0.0f);
label_value.set_alignment(0.0f, 0.0f);
label_title.selectable = true;
diff --git a/src/client/wscript_build b/src/client/wscript_build
index c840da41..8cb182f5 100644
--- a/src/client/wscript_build
+++ b/src/client/wscript_build
@@ -8,6 +8,7 @@ client_src = [
'geary-config.vala',
'main.vala',
+'ui/background-box.vala',
'ui/composer-window.vala',
'ui/geary-login.vala',
'ui/folder-list-store.vala',
diff --git a/ui/message.glade b/ui/message.glade
index 64c77ab8..84ec8d25 100644
--- a/ui/message.glade
+++ b/ui/message.glade
@@ -14,6 +14,9 @@
False
@@ -40,7 +43,7 @@
True
True
False
- word
+ word-char
False