From dde10e451942993f3d48b9bccf2b777815efea79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 6 Dec 2005 13:46:50 +0000 Subject: [PATCH] fixes for various controls to remove or show focus indication when the window active status changes git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15362 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/ListView.cpp | 5 +++-- src/kits/interface/ScrollView.cpp | 5 ++++- src/kits/interface/TextControl.cpp | 9 +++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/kits/interface/ListView.cpp b/src/kits/interface/ListView.cpp index 435ec83022..4d33d1b8da 100644 --- a/src/kits/interface/ListView.cpp +++ b/src/kits/interface/ListView.cpp @@ -1042,8 +1042,9 @@ BListView::WindowActivated(bool state) { BView::WindowActivated(state); - if (IsFocus()) - Draw(Bounds()); + if (IsFocus()) { + Invalidate(); + } } // MouseUp diff --git a/src/kits/interface/ScrollView.cpp b/src/kits/interface/ScrollView.cpp index f272c2f21b..c3b8e063a0 100644 --- a/src/kits/interface/ScrollView.cpp +++ b/src/kits/interface/ScrollView.cpp @@ -226,7 +226,7 @@ BScrollView::Draw(BRect updateRect) SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_2_TINT)); StrokeRect(bounds.InsetByCopy(1, 1)); - if (fHighlighted) { + if (fHighlighted && Window()->IsActive()) { SetHighColor(ui_color(B_NAVIGATION_BASE_COLOR)); StrokeRect(bounds); } else { @@ -565,6 +565,9 @@ BScrollView::ModifyFlags(int32 flags, border_style border) void BScrollView::WindowActivated(bool active) { + if (fHighlighted) + Invalidate(); + BView::WindowActivated(active); } diff --git a/src/kits/interface/TextControl.cpp b/src/kits/interface/TextControl.cpp index 3581abe4d9..321fab31db 100644 --- a/src/kits/interface/TextControl.cpp +++ b/src/kits/interface/TextControl.cpp @@ -554,9 +554,14 @@ void BTextControl::WindowActivated(bool active) { if (fText->IsFocus()) { - BRect rect(fText->Frame()); - rect.InsetBy(-1.0, -1.0); + // invalidate to remove/show focus indication + BRect rect = Bounds(); + rect.left = fDivider; Invalidate(rect); + + // help out embedded text view which doesn't + // get notified of this + fText->Invalidate(); } }