From d4e348b08e716fdf11d3b8b3008b8b8486ab9bf3 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 19 Oct 2015 14:06:03 -0700 Subject: [PATCH] Mail: Implement select all hook for subject This allows the Cmd+A key shortcut to select all text on the subject control. You could already Select All from the View menu but this is more convinient. Fixes #12361 --- src/apps/mail/Header.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/apps/mail/Header.cpp b/src/apps/mail/Header.cpp index 3165d1fd82..8681733233 100644 --- a/src/apps/mail/Header.cpp +++ b/src/apps/mail/Header.cpp @@ -112,6 +112,7 @@ public: virtual void AttachedToWindow(); virtual void SetEnabled(bool enabled); virtual void Draw(BRect updateRect); + virtual void MessageReceived(BMessage* message); private: void _UpdateTextViewColors(); @@ -223,6 +224,25 @@ HeaderTextControl::Draw(BRect updateRect) } +void +HeaderTextControl::MessageReceived(BMessage* message) +{ + switch (message->what) { + case M_SELECT: + { + BTextView* textView = TextView(); + if (textView != NULL) + textView->SelectAll(); + break; + } + + default: + BTextControl::MessageReceived(message); + break; + } +} + + void HeaderTextControl::_UpdateTextViewColors() {