From bbfcd83bde39638396cbdf891e9f1d221966387c Mon Sep 17 00:00:00 2001 From: Alex Wilson Date: Sat, 18 Jun 2011 01:52:29 +0000 Subject: [PATCH] Make the 'Long description' textview in FileTypes use the BScrollView::SetBorderHighlighted() method when it is focused, also enable tab-key navigation (which was the whole purpose of creating the custom class used for the field) with the B_NAVIGABLE flag. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42228 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../filetypes/ApplicationTypeWindow.cpp | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/preferences/filetypes/ApplicationTypeWindow.cpp b/src/preferences/filetypes/ApplicationTypeWindow.cpp index ed09375317..400debe2ee 100644 --- a/src/preferences/filetypes/ApplicationTypeWindow.cpp +++ b/src/preferences/filetypes/ApplicationTypeWindow.cpp @@ -70,8 +70,14 @@ public: virtual ~TabFilteringTextView(); virtual void KeyDown(const char* bytes, int32 count); + virtual void TargetedByScrollView(BScrollView* scroller); + virtual void MakeFocus(bool focused = true); + +private: + BScrollView* fScrollView; }; + class SupportedTypeItem : public BStringItem { public: SupportedTypeItem(const char* type); @@ -90,6 +96,7 @@ private: ::Icon fIcon; }; + class SupportedTypeListView : public DropTargetListView { public: SupportedTypeListView(const char* name, @@ -109,7 +116,8 @@ public: TabFilteringTextView::TabFilteringTextView(const char* name) : - BTextView(name, B_WILL_DRAW | B_PULSE_NEEDED) + BTextView(name, B_WILL_DRAW | B_PULSE_NEEDED | B_NAVIGABLE), + fScrollView(NULL) { } @@ -129,6 +137,23 @@ TabFilteringTextView::KeyDown(const char* bytes, int32 count) } +void +TabFilteringTextView::TargetedByScrollView(BScrollView* scroller) +{ + fScrollView = scroller; +} + + +void +TabFilteringTextView::MakeFocus(bool focused) +{ + BTextView::MakeFocus(focused); + + if (fScrollView) + fScrollView->SetBorderHighlighted(focused); +} + + // #pragma mark -