better ResizeToPreferred implementation
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12946 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
59345e264f
commit
743a147353
@ -945,7 +945,6 @@ BView::FrameResized(float new_width, float new_height)
|
|||||||
void
|
void
|
||||||
BView::GetPreferredSize(float* width, float* height)
|
BView::GetPreferredSize(float* width, float* height)
|
||||||
{
|
{
|
||||||
// HOOK function
|
|
||||||
STRACE(("\tHOOK: BView(%s)::GetPreferredSize()\n", Name()));
|
STRACE(("\tHOOK: BView(%s)::GetPreferredSize()\n", Name()));
|
||||||
*width = fBounds.Width();
|
*width = fBounds.Width();
|
||||||
*height = fBounds.Height();
|
*height = fBounds.Height();
|
||||||
@ -955,10 +954,16 @@ BView::GetPreferredSize(float* width, float* height)
|
|||||||
void
|
void
|
||||||
BView::ResizeToPreferred()
|
BView::ResizeToPreferred()
|
||||||
{
|
{
|
||||||
// HOOK function
|
|
||||||
STRACE(("\tHOOK: BView(%s)::ResizeToPreferred()\n", Name()));
|
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);
|
owner->fLink->GetNextReply(&rCode);
|
||||||
if (rCode == SERVER_TRUE) {
|
if (rCode == SERVER_TRUE) {
|
||||||
owner->fLink->Read<BPoint>(location);
|
owner->fLink->Read<BPoint>(location);
|
||||||
owner->fLink->Read((int32 *)buttons, sizeof(int32));
|
owner->fLink->Read<uint32>(buttons);
|
||||||
|
|
||||||
// TODO: See above comment about coordinates
|
// TODO: See above comment about coordinates
|
||||||
ConvertFromScreen(location);
|
ConvertFromScreen(location);
|
||||||
|
} else {
|
||||||
|
buttons = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user