Exemplo 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();
}
Exemplo 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"));
}
Exemplo 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?
}
Exemplo 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();
}
Exemplo 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;
}
Exemplo n.º 6
0
bool
TabDecorator::_AddTab(DesktopSettings& settings, int32 index,
	BRegion* updateRegion)
{
	_UpdateFont(settings);

	_DoLayout();
	if (updateRegion != NULL)
		updateRegion->Include(fTitleBarRect);
	return true;
}
Exemplo 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());
}
Exemplo 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());
}
Exemplo 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);
	}
}
Exemplo 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());
}
Exemplo 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);
}
Exemplo 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();
}
Exemplo 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);
	}
}
Exemplo 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"));
}
Exemplo 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);
	}
}