Added the scrolling offset when a view is created.

This lightens the problem in bug #98 a bit, but doesn't completely fix it; you
still don't see any items in that list on the switch, but they now appear again
when you scroll around there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16997 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-04-04 01:51:16 +00:00
parent 31dc79a18b
commit 903936bcec
6 changed files with 19 additions and 12 deletions
+3
View File
@@ -3463,6 +3463,8 @@ BView::MoveTo(float x, float y)
void
BView::ResizeBy(float deltaWidth, float deltaHeight)
{
// TODO: this doesn't look like it would work correctly with scrolled views
// NOTE: I think this check makes sense, but I didn't
// test what R5 does.
if (fBounds.right + deltaWidth < 0)
@@ -3972,6 +3974,7 @@ BView::_CreateSelf()
fOwner->fLink->Attach<int32>(_get_object_token_(this));
fOwner->fLink->AttachString(Name());
fOwner->fLink->Attach<BRect>(Frame());
fOwner->fLink->Attach<BPoint>(LeftTop());
fOwner->fLink->Attach<uint32>(ResizingMode());
fOwner->fLink->Attach<uint32>(fEventMask);
fOwner->fLink->Attach<uint32>(fEventOptions);
+6 -3
View File
@@ -476,10 +476,12 @@ ServerWindow::_CreateLayerTree(BPrivate::LinkReceiver &link, ViewLayer **_parent
int32 parentToken;
char* name = NULL;
rgb_color viewColor;
BPoint scrollingOffset;
link.Read<int32>(&token);
link.ReadString(&name);
link.Read<BRect>(&frame);
link.Read<BPoint>(&scrollingOffset);
link.Read<uint32>(&resizeMask);
link.Read<uint32>(&eventMask);
link.Read<uint32>(&eventOptions);
@@ -496,10 +498,11 @@ ServerWindow::_CreateLayerTree(BPrivate::LinkReceiver &link, ViewLayer **_parent
if (link.Code() == AS_LAYER_CREATE_ROOT
&& (fWindowLayer->Flags() & kWorkspacesWindowFlag) != 0) {
// this is a workspaces window!
newLayer = new (nothrow) WorkspacesLayer(frame, name, token, resizeMask,
flags);
newLayer = new (nothrow) WorkspacesLayer(frame, scrollingOffset, name,
token, resizeMask, flags);
} else {
newLayer = new (nothrow) ViewLayer(frame, name, token, resizeMask, flags);
newLayer = new (nothrow) ViewLayer(frame, scrollingOffset, name, token,
resizeMask, flags);
}
free(name);
+3 -2
View File
@@ -34,14 +34,15 @@
using std::nothrow;
ViewLayer::ViewLayer(BRect frame, const char* name,
ViewLayer::ViewLayer(BRect frame, BPoint scrollingOffset, const char* name,
int32 token, uint32 resizeMode, uint32 flags)
:
fName(name),
fToken(token),
fFrame(frame),
fScrollingOffset(0.0, 0.0),
fScrollingOffset(scrollingOffset),
fViewColor(RGBColor(255, 255, 255)),
fDrawState(new (nothrow) DrawState),
+2 -2
View File
@@ -33,8 +33,8 @@ class ServerPicture;
class ViewLayer {
public:
ViewLayer(BRect frame, const char* name,
int32 token, uint32 resizeMode,
ViewLayer(BRect frame, BPoint scrollingOffset,
const char* name, int32 token, uint32 resizeMode,
uint32 flags);
virtual ~ViewLayer();
+3 -3
View File
@@ -19,9 +19,9 @@
#include <WindowPrivate.h>
WorkspacesLayer::WorkspacesLayer(BRect frame, const char* name,
int32 token, uint32 resizeMode, uint32 flags)
: ViewLayer(frame, name, token, resizeMode, flags),
WorkspacesLayer::WorkspacesLayer(BRect frame, BPoint scrollingOffset,
const char* name, int32 token, uint32 resizeMode, uint32 flags)
: ViewLayer(frame, scrollingOffset, name, token, resizeMode, flags),
fSelectedWindow(NULL),
fSelectedWorkspace(-1),
fHasMoved(false)
+2 -2
View File
@@ -16,8 +16,8 @@ class WindowLayer;
class WorkspacesLayer : public ViewLayer {
public:
WorkspacesLayer(BRect frame, const char* name, int32 token,
uint32 resize, uint32 flags);
WorkspacesLayer(BRect frame, BPoint scrollingOffset, const char* name,
int32 token, uint32 resize, uint32 flags);
virtual ~WorkspacesLayer();
virtual void Draw(DrawingEngine* drawingEngine,