Esempio n. 1
0
void
WinDecorator::_ResizeBy(BPoint offset, BRegion* dirty)
{
	// Move all internal rectangles the appropriate amount
	fFrame.right += offset.x;
	fFrame.bottom += offset.y;
	fTitleBarRect.right += offset.x;
	fTitleBarRect.bottom += offset.y;
	fResizeRect.OffsetBy(offset);
	fBorderRect.right += offset.x;
	fBorderRect.bottom += offset.y;

	for (int32 i = 0; i < fTabList.CountItems(); i++) {
		Decorator::Tab* tab = fTabList.ItemAt(i);

		tab->tabRect.right += offset.x;
		if (dirty != NULL)
			dirty->Include(tab->tabRect);
		//tab->zoomRect.right += offset.x;
		//tab->closeRect.right += offset.x;
		//tab->minimizeRect.right += offset.x;
	}
	if (dirty != NULL)
		dirty->Include(fBorderRect);

	// TODO probably some other layouting stuff here
	_DoLayout();
}
Esempio n. 2
0
WinDecorator::WinDecorator(DesktopSettings& settings, BRect rect,
		window_look look, uint32 flags)
	:
	Decorator(settings, rect, look, flags),
	taboffset(0)
{

	_UpdateFont(settings);

	// common colors to both focus and non focus state
	frame_highcol = (rgb_color){ 255, 255, 255, 255 };
	frame_midcol = (rgb_color){ 216, 216, 216, 255 };
	frame_lowcol = (rgb_color){ 110, 110, 110, 255 };
	frame_lowercol = (rgb_color){ 0, 0, 0, 255 };

	// state based colors
	fFocusTabColor = settings.UIColor(B_WINDOW_TAB_COLOR);
	fFocusTextColor = settings.UIColor(B_WINDOW_TEXT_COLOR);
	fNonFocusTabColor = settings.UIColor(B_WINDOW_INACTIVE_TAB_COLOR);
	fNonFocusTextColor = settings.UIColor(B_WINDOW_INACTIVE_TEXT_COLOR);

	// Set appropriate colors based on the current focus value. In this case,
	// each decorator defaults to not having the focus.
	_SetFocus();

	// Do initial decorator setup
	_DoLayout();
	
	textoffset=5;

	STRACE(("WinDecorator()\n"));
}
Esempio n. 3
0
/*!	\brief Updates the value of the decorator title
	\param string New title value
*/
void
Decorator::SetTitle(const char* string, BRegion* updateRegion)
{
	fTitle.SetTo(string);
	_DoLayout();
	// TODO: redraw?
}
Esempio n. 4
0
/*!	\brief Assigns a display driver to the decorator
	\param driver A valid DrawingEngine object
*/
void
Decorator::SetDrawingEngine(DrawingEngine* engine)
{
	fDrawingEngine = engine;
	// lots of subclasses will depend on the driver for text support, so call
	// _DoLayout() after we have it
	if (fDrawingEngine)
		_DoLayout();
}
Esempio n. 5
0
bool
TabDecorator::_RemoveTab(int32 index, BRegion* updateRegion)
{
	BRect oldTitle = fTitleBarRect;
	_DoLayout();
	if (updateRegion != NULL) {
		updateRegion->Include(oldTitle);
		updateRegion->Include(fTitleBarRect);
	}
	return true;
}
Esempio n. 6
0
bool
TabDecorator::_AddTab(DesktopSettings& settings, int32 index,
	BRegion* updateRegion)
{
	_UpdateFont(settings);

	_DoLayout();
	if (updateRegion != NULL)
		updateRegion->Include(fTitleBarRect);
	return true;
}
Esempio n. 7
0
void
MacDecorator::_SetFlags(uint32 flags, BRegion* updateRegion)
{
    // TODO: we could be much smarter about the update region

    // get previous extent
    if (updateRegion != NULL)
        updateRegion->Include(&GetFootprint());

    _DoLayout();

    _InvalidateFootprint();
    if (updateRegion != NULL)
        updateRegion->Include(&GetFootprint());
}
Esempio n. 8
0
void
MacDecorator::_FontsChanged(DesktopSettings& settings,
                            BRegion* updateRegion)
{
    // get previous extent
    if (updateRegion != NULL)
        updateRegion->Include(&GetFootprint());

    _UpdateFont(settings);
    _DoLayout();

    _InvalidateFootprint();
    if (updateRegion != NULL)
        updateRegion->Include(&GetFootprint());
}
Esempio n. 9
0
void
WinDecorator::FontsChanged(DesktopSettings& settings, BRegion* updateRegion)
{
	// get previous extent
	if (updateRegion != NULL) {
		BRegion extent;
		GetFootprint(&extent);
		updateRegion->Include(&extent);
	}

	_UpdateFont(settings);
	_DoLayout();

	if (updateRegion != NULL) {
		BRegion extent;
		GetFootprint(&extent);
		updateRegion->Include(&extent);
	}
}
Esempio n. 10
0
void
MacDecorator::_SetLook(DesktopSettings& settings, window_look look,
                       BRegion* updateRegion)
{
    // TODO: we could be much smarter about the update region

    // get previous extent
    if (updateRegion != NULL)
        updateRegion->Include(&GetFootprint());

    fLook = look;

    _UpdateFont(settings);
    _DoLayout();

    _InvalidateFootprint();
    if (updateRegion != NULL)
        updateRegion->Include(&GetFootprint());
}
Esempio n. 11
0
void
MacDecorator::_SetTitle(const char* string, BRegion* updateRegion)
{
    // TODO: we could be much smarter about the update region

    BRect rect = TabRect();

    _DoLayout();

    if (updateRegion == NULL)
        return;

    rect = rect | TabRect();

    rect.bottom++;
    // the border will look differently when the title is adjacent

    updateRegion->Include(rect);
}
Esempio n. 12
0
void
WinDecorator::ResizeBy(BPoint offset, BRegion* dirty)
{
	// Move all internal rectangles the appropriate amount
	fFrame.right += offset.x;
	fFrame.bottom += offset.y;

	fTabRect.right += offset.x;
	fBorderRect.right += offset.x;
	fBorderRect.bottom += offset.y;
	// 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();
}
Esempio n. 13
0
void
WinDecorator::SetFlags(uint32 flags, BRegion* updateRegion)
{
	// TODO: we could be much smarter about the update region

	// get previous extent
	if (updateRegion != NULL) {
		BRegion extent;
		GetFootprint(&extent);
		updateRegion->Include(&extent);
	}

	Decorator::SetFlags(flags, updateRegion);
	_DoLayout();

	if (updateRegion != NULL) {
		BRegion extent;
		GetFootprint(&extent);
		updateRegion->Include(&extent);
	}
}
Esempio n. 14
0
WinDecorator::WinDecorator(DesktopSettings& settings, BRect rect,
		window_look look, uint32 flags)
	:
	Decorator(settings, rect, look, flags)
{
	taboffset=0;

	frame_highcol = (rgb_color){ 255, 255, 255, 255 };
	frame_midcol = (rgb_color){ 216, 216, 216, 255 };
	frame_lowcol = (rgb_color){ 110, 110, 110, 255 };
	frame_lowercol = (rgb_color){ 0, 0, 0, 255 };

	fFocusTabColor = settings.UIColor(B_WINDOW_TAB_COLOR);
	fFocusTextColor = settings.UIColor(B_WINDOW_TEXT_COLOR);
	fNonFocusTabColor = settings.UIColor(B_WINDOW_INACTIVE_TAB_COLOR);
	fNonFocusTextColor = settings.UIColor(B_WINDOW_INACTIVE_TEXT_COLOR);

	_UpdateFont(settings);
	_DoLayout();
	
	textoffset=5;

	STRACE(("WinDecorator()\n"));
}
Esempio n. 15
0
void
WinDecorator::SetLook(DesktopSettings& settings, window_look look,
	BRegion* updateRegion)
{
	// TODO: we could be much smarter about the update region

	// get previous extent
	if (updateRegion != NULL) {
		BRegion extent;
		GetFootprint(&extent);
		updateRegion->Include(&extent);
	}

	fLook = look;

	_UpdateFont(settings);
	_DoLayout();

	if (updateRegion != NULL) {
		BRegion extent;
		GetFootprint(&extent);
		updateRegion->Include(&extent);
	}
}