MacDecorator : fix a liitle drawing bug (missing border under window tab) and make resizing work.
I see no other bug now, but testing welcome. You can change the decorator using the setdecor command, but you have to add MacDecorator in /home/config/add-ons/decorators first. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34761 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -172,36 +172,16 @@ MacDecorator::ResizeBy(BPoint offset, BRegion* dirty)
|
|||||||
fTabRect.right += offset.x;
|
fTabRect.right += offset.x;
|
||||||
fBorderRect.right += offset.x;
|
fBorderRect.right += offset.x;
|
||||||
fBorderRect.bottom += offset.y;
|
fBorderRect.bottom += offset.y;
|
||||||
fZoomRect.OffsetBy(offset.x,0);
|
// fZoomRect.OffsetBy(offset.x,0);
|
||||||
fMinimizeRect.OffsetBy(offset.x,0);
|
// fMinimizeRect.OffsetBy(offset.x,0);
|
||||||
|
if (dirty) {
|
||||||
// handle invalidation of resize rect
|
dirty->Include(fTabRect);
|
||||||
if (dirty && !(fFlags & B_NOT_RESIZABLE)) {
|
dirty->Include(fBorderRect);
|
||||||
BRect realResizeRect;
|
|
||||||
switch (fLook) {
|
|
||||||
case B_DOCUMENT_WINDOW_LOOK:
|
|
||||||
realResizeRect = fResizeRect;
|
|
||||||
// resize rect at old location
|
|
||||||
dirty->Include(realResizeRect);
|
|
||||||
realResizeRect.OffsetBy(offset);
|
|
||||||
// resize rect at new location
|
|
||||||
dirty->Include(realResizeRect);
|
|
||||||
break;
|
|
||||||
case B_TITLED_WINDOW_LOOK:
|
|
||||||
case B_FLOATING_WINDOW_LOOK:
|
|
||||||
case B_MODAL_WINDOW_LOOK:
|
|
||||||
// resize rect at old location
|
|
||||||
dirty->Include(fBorderRect);
|
|
||||||
fBorderRect.OffsetBy(offset);
|
|
||||||
// resize rect at new location
|
|
||||||
dirty->Include(fBorderRect);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO probably some other layouting stuff here
|
// TODO probably some other layouting stuff here
|
||||||
|
_DoLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
// settablocation
|
// settablocation
|
||||||
@@ -282,14 +262,11 @@ MacDecorator::Clicked(BPoint point, int32 buttons, int32 modifiers)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We got this far, so user is clicking on the border?
|
// We got this far, so user is clicking on the border?
|
||||||
BRect srect(fFrame);
|
|
||||||
srect.top+=19;
|
|
||||||
BRect clientrect(srect.InsetByCopy(3,3));
|
|
||||||
if (!(fFlags & B_NOT_RESIZABLE)
|
if (!(fFlags & B_NOT_RESIZABLE)
|
||||||
&& (fLook == B_TITLED_WINDOW_LOOK
|
&& (fLook == B_TITLED_WINDOW_LOOK
|
||||||
|| fLook == B_FLOATING_WINDOW_LOOK
|
|| fLook == B_FLOATING_WINDOW_LOOK
|
||||||
|| fLook == B_MODAL_WINDOW_LOOK)
|
|| fLook == B_MODAL_WINDOW_LOOK)
|
||||||
&& srect.Contains(point) && !clientrect.Contains(point)) {
|
&& fBorderRect.Contains(point) && !fFrame.Contains(point)) {
|
||||||
STRACE(("MacDecorator():Clicked() - Resize\n"));
|
STRACE(("MacDecorator():Clicked() - Resize\n"));
|
||||||
return DEC_RESIZE;
|
return DEC_RESIZE;
|
||||||
}
|
}
|
||||||
@@ -341,10 +318,10 @@ MacDecorator::_DoLayout(void)
|
|||||||
|
|
||||||
// TODO the tab is drawn in a fixed height for now
|
// TODO the tab is drawn in a fixed height for now
|
||||||
fTabRect.Set(fFrame.left - fBorderWidth,
|
fTabRect.Set(fFrame.left - fBorderWidth,
|
||||||
fFrame.top - 20,
|
fFrame.top - 23,
|
||||||
((fFrame.right - fFrame.left) < 32.0 ?
|
((fFrame.right - fFrame.left) < 32.0 ?
|
||||||
fFrame.left + 32.0 : fFrame.right) + fBorderWidth,
|
fFrame.left + 32.0 : fFrame.right) + fBorderWidth,
|
||||||
fFrame.top);
|
fFrame.top - 3);
|
||||||
|
|
||||||
fZoomRect=fTabRect;
|
fZoomRect=fTabRect;
|
||||||
fZoomRect.left=fZoomRect.right-12;
|
fZoomRect.left=fZoomRect.right-12;
|
||||||
|
|||||||
Reference in New Issue
Block a user