[haiku-commits] r34761 - haiku/trunk/src/add-ons/decorators/MacDecorator

  • From: pulkomandy@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 23 Dec 2009 22:25:42 +0100 (CET)

Author: pulkomandy
Date: 2009-12-23 22:25:42 +0100 (Wed, 23 Dec 2009)
New Revision: 34761
Changeset: http://dev.haiku-os.org/changeset/34761/haiku

Modified:
   haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp
Log:
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.


Modified: haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp
===================================================================
--- haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp    
2009-12-23 20:31:40 UTC (rev 34760)
+++ haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp    
2009-12-23 21:25:42 UTC (rev 34761)
@@ -172,36 +172,16 @@
        fTabRect.right += offset.x;
        fBorderRect.right += offset.x;
        fBorderRect.bottom += offset.y;
-       fZoomRect.OffsetBy(offset.x,0);
-       fMinimizeRect.OffsetBy(offset.x,0);
-
-       // handle invalidation of resize rect
-       if (dirty && !(fFlags & B_NOT_RESIZABLE)) {
-               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;
-               }
+       // fZoomRect.OffsetBy(offset.x,0);
+       // fMinimizeRect.OffsetBy(offset.x,0);
+       if (dirty) {
+               dirty->Include(fTabRect);
+               dirty->Include(fBorderRect);
        }
 
+
        // TODO probably some other layouting stuff here
+       _DoLayout();
 }
 
 // settablocation
@@ -282,14 +262,11 @@
        }
 
        // 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)
                && (fLook == B_TITLED_WINDOW_LOOK
                        || fLook == B_FLOATING_WINDOW_LOOK
                        || fLook == B_MODAL_WINDOW_LOOK)
-               && srect.Contains(point) && !clientrect.Contains(point)) {
+               && fBorderRect.Contains(point) && !fFrame.Contains(point)) {
                STRACE(("MacDecorator():Clicked() - Resize\n"));
                return DEC_RESIZE;
        }
@@ -341,10 +318,10 @@
 
                // TODO the tab is drawn in a fixed height for now
                fTabRect.Set(fFrame.left - fBorderWidth,
-                       fFrame.top - 20,
+                       fFrame.top - 23,
                        ((fFrame.right - fFrame.left) < 32.0 ?
                                fFrame.left + 32.0 : fFrame.right) + 
fBorderWidth,
-                       fFrame.top);
+                       fFrame.top - 3);
 
                fZoomRect=fTabRect;
                fZoomRect.left=fZoomRect.right-12;


Other related posts: