From 743a1473536bcbe4186e6d44a078c4a238421925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 3 Jun 2005 19:51:34 +0000 Subject: [PATCH] better ResizeToPreferred implementation git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12946 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/View.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index 275852a9e7..2781306061 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -945,7 +945,6 @@ BView::FrameResized(float new_width, float new_height) void BView::GetPreferredSize(float* width, float* height) { - // HOOK function STRACE(("\tHOOK: BView(%s)::GetPreferredSize()\n", Name())); *width = fBounds.Width(); *height = fBounds.Height(); @@ -955,10 +954,16 @@ BView::GetPreferredSize(float* width, float* height) void BView::ResizeToPreferred() { - // HOOK function STRACE(("\tHOOK: BView(%s)::ResizeToPreferred()\n", Name())); - ResizeTo(fBounds.Width(), fBounds.Height()); + // TODO: Test if this version of the implementation is + // in BView or BControl in R5. + + float width; + float height; + GetPreferredSize(&width, &height); + + ResizeTo(width, height); } @@ -1212,10 +1217,12 @@ BView::GetMouse(BPoint *location, uint32 *buttons, bool checkMessageQueue) owner->fLink->GetNextReply(&rCode); if (rCode == SERVER_TRUE) { owner->fLink->Read(location); - owner->fLink->Read((int32 *)buttons, sizeof(int32)); + owner->fLink->Read(buttons); // TODO: See above comment about coordinates ConvertFromScreen(location); + } else { + buttons = 0; } }