* The (right-most moved) tab no longer goes away when resizing the window to a size
smaller than the tab size. This fixes bug #642. * There are remaining issues while resizing the window, though. * Fixed warning. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17637 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -19,11 +19,11 @@
|
|||||||
#include "PatternHandler.h"
|
#include "PatternHandler.h"
|
||||||
#include "RGBColor.h"
|
#include "RGBColor.h"
|
||||||
|
|
||||||
|
#include <WindowPrivate.h>
|
||||||
|
|
||||||
#include <Rect.h>
|
#include <Rect.h>
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
|
|
||||||
#include <WindowPrivate.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
//#define DEBUG_DECORATOR
|
//#define DEBUG_DECORATOR
|
||||||
@@ -319,6 +319,8 @@ DefaultDecorator::ResizeBy(BPoint pt, BRegion* dirty)
|
|||||||
tabSize = fBottomBorder.bottom - fTopBorder.top;
|
tabSize = fBottomBorder.bottom - fTopBorder.top;
|
||||||
maxLocation = tabSize - _tabrect.Height();
|
maxLocation = tabSize - _tabrect.Height();
|
||||||
}
|
}
|
||||||
|
if (maxLocation < 0)
|
||||||
|
maxLocation = 0;
|
||||||
|
|
||||||
float tabOffset = floorf(fTabLocation * maxLocation);
|
float tabOffset = floorf(fTabLocation * maxLocation);
|
||||||
float delta = tabOffset - fTabOffset;
|
float delta = tabOffset - fTabOffset;
|
||||||
@@ -698,7 +700,7 @@ DefaultDecorator::_DoLayout()
|
|||||||
if (fTabOffset < 0)
|
if (fTabOffset < 0)
|
||||||
fTabOffset = 0;
|
fTabOffset = 0;
|
||||||
if (fTabOffset > (fRightBorder.right - fLeftBorder.left - _tabrect.Width()))
|
if (fTabOffset > (fRightBorder.right - fLeftBorder.left - _tabrect.Width()))
|
||||||
fTabOffset = (fRightBorder.right - fLeftBorder.left - _tabrect.Width());
|
fTabOffset = uint32(fRightBorder.right - fLeftBorder.left - _tabrect.Width());
|
||||||
_tabrect.OffsetBy(fTabOffset, 0);
|
_tabrect.OffsetBy(fTabOffset, 0);
|
||||||
|
|
||||||
// finally, layout the buttons and text within the tab rect
|
// finally, layout the buttons and text within the tab rect
|
||||||
@@ -710,8 +712,8 @@ DefaultDecorator::_DoLayout()
|
|||||||
void
|
void
|
||||||
DefaultDecorator::_DrawFrame(BRect invalid)
|
DefaultDecorator::_DrawFrame(BRect invalid)
|
||||||
{
|
{
|
||||||
STRACE(("_DrawFrame(%f,%f,%f,%f)\n", invalid.left, invalid.top,
|
STRACE(("_DrawFrame(%f,%f,%f,%f)\n", invalid.left, invalid.top,
|
||||||
invalid.right, invalid.bottom));
|
invalid.right, invalid.bottom));
|
||||||
|
|
||||||
// NOTE: the DrawingEngine needs to be locked for the entire
|
// NOTE: the DrawingEngine needs to be locked for the entire
|
||||||
// time for the clipping to stay valid for this decorator
|
// time for the clipping to stay valid for this decorator
|
||||||
|
|||||||
Reference in New Issue
Block a user