From e8ca0f132ccfb7b78bb431d138acb79ae22923d0 Mon Sep 17 00:00:00 2001 From: Eric Gregory Date: Mon, 24 Oct 2011 17:07:54 -0700 Subject: [PATCH] Title of composer window is now subject. Closes #4282 --- src/client/ui/composer-window.vala | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/client/ui/composer-window.vala b/src/client/ui/composer-window.vala index b2ddaadd..75fc44d1 100644 --- a/src/client/ui/composer-window.vala +++ b/src/client/ui/composer-window.vala @@ -6,6 +6,7 @@ // Window for sending messages. public class ComposerWindow : Gtk.Window { + private static string DEFAULT_TITLE = _("New Message"); private Gtk.Entry to_entry; private Gtk.Entry cc_entry; @@ -54,6 +55,9 @@ public class ComposerWindow : Gtk.Window { subject_entry = builder.get_object("subject") as Gtk.Entry; message_text = builder.get_object("message") as Gtk.TextView; + title = DEFAULT_TITLE; + subject_entry.changed.connect(on_subject_changed); + add(box); } @@ -67,4 +71,9 @@ public class ComposerWindow : Gtk.Window { send(this); } + private void on_subject_changed() { + title = Geary.String.is_empty(subject_entry.text.strip()) ? DEFAULT_TITLE : + subject_entry.text.strip(); + } + }