From 0834dd807f88b3228ea6eb54745a5f9a194f507c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 28 Mar 2009 19:30:39 +0000 Subject: [PATCH] * Use B_DRAW_ON_CHILDREN for the Desktop pose view. * Draw the selection rect in DrawAfterChildren(). * Call DrawAfterChildren() manually in Draw(), if B_DRAW_ON_CHILDREN is not set. This change allows replicants, in case they want to be aware of being embedded in the desktop, to use alpha blending to draw on top of the desktop pose view. For replicants which do not care, this patch changes nothing. When views with B_DRAW_ON_CHILDREN invalidate themselves, they will automatically trigger an update of children that sit on top the invalidated area, at least with our app_server. So this change works just like one would expect, ie like compositing views. Of course it should have flickering when app_server does not run in double buffered mode. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29759 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/DesktopPoseView.cpp | 6 +++--- src/kits/tracker/PoseView.cpp | 8 ++++++++ src/kits/tracker/PoseView.h | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/kits/tracker/DesktopPoseView.cpp b/src/kits/tracker/DesktopPoseView.cpp index 8ccef5aad7..33dc1f38e8 100644 --- a/src/kits/tracker/DesktopPoseView.cpp +++ b/src/kits/tracker/DesktopPoseView.cpp @@ -80,9 +80,9 @@ DesktopEntryListCollection::DesktopEntryListCollection() // #pragma mark - -DesktopPoseView::DesktopPoseView(Model *model, BRect frame, uint32 viewMode, - uint32 resizeMask) - : BPoseView(model, frame, viewMode, resizeMask) +DesktopPoseView::DesktopPoseView(Model *model, BRect frame, uint32 resizeMask, + uint32 flags) + : BPoseView(model, frame, resizeMask, flags | B_DRAW_ON_CHILDREN) { SetWidgetTextOutline(true); } diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index 47de858d77..49ac96cc9c 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -8101,6 +8101,14 @@ BPoseView::Draw(BRect updateRect) } DrawViewCommon(updateRect); + if ((Flags() & B_DRAW_ON_CHILDREN) == 0) + DrawAfterChildren(updateRect); +} + + +void +BPoseView::DrawAfterChildren(BRect updateRect) +{ if (fTransparentSelection && fSelectionRect.IsValid()) { SetDrawingMode(B_OP_ALPHA); SetHighColor(255, 255, 255, 128); diff --git a/src/kits/tracker/PoseView.h b/src/kits/tracker/PoseView.h index 9f48ac4da8..3c446e7cfa 100644 --- a/src/kits/tracker/PoseView.h +++ b/src/kits/tracker/PoseView.h @@ -161,6 +161,7 @@ class BPoseView : public BView { virtual void MakeFocus(bool = true); virtual void MouseMoved(BPoint, uint32, const BMessage *); virtual void Draw(BRect update_rect); + virtual void DrawAfterChildren(BRect update_rect); virtual void MouseDown(BPoint where); virtual void KeyDown(const char *, int32); virtual void Pulse();