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
This commit is contained in:
Stephan Aßmus
2005-12-06 13:46:50 +00:00
parent a2b387ad6e
commit dde10e4519
3 changed files with 14 additions and 5 deletions
+3 -2
View File
@@ -1042,8 +1042,9 @@ BListView::WindowActivated(bool state)
{ {
BView::WindowActivated(state); BView::WindowActivated(state);
if (IsFocus()) if (IsFocus()) {
Draw(Bounds()); Invalidate();
}
} }
// MouseUp // MouseUp
+4 -1
View File
@@ -226,7 +226,7 @@ BScrollView::Draw(BRect updateRect)
SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_2_TINT)); SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_2_TINT));
StrokeRect(bounds.InsetByCopy(1, 1)); StrokeRect(bounds.InsetByCopy(1, 1));
if (fHighlighted) { if (fHighlighted && Window()->IsActive()) {
SetHighColor(ui_color(B_NAVIGATION_BASE_COLOR)); SetHighColor(ui_color(B_NAVIGATION_BASE_COLOR));
StrokeRect(bounds); StrokeRect(bounds);
} else { } else {
@@ -565,6 +565,9 @@ BScrollView::ModifyFlags(int32 flags, border_style border)
void void
BScrollView::WindowActivated(bool active) BScrollView::WindowActivated(bool active)
{ {
if (fHighlighted)
Invalidate();
BView::WindowActivated(active); BView::WindowActivated(active);
} }
+7 -2
View File
@@ -554,9 +554,14 @@ void
BTextControl::WindowActivated(bool active) BTextControl::WindowActivated(bool active)
{ {
if (fText->IsFocus()) { if (fText->IsFocus()) {
BRect rect(fText->Frame()); // invalidate to remove/show focus indication
rect.InsetBy(-1.0, -1.0); BRect rect = Bounds();
rect.left = fDivider;
Invalidate(rect); Invalidate(rect);
// help out embedded text view which doesn't
// get notified of this
fText->Invalidate();
} }
} }