예제 #1
0
void LLAccordionCtrlTab::draw()
{
	if(mFitPanel)
		LLUICtrl::draw();
	else
	{
		LLRect root_rect = getRootView()->getRect();
		drawChild(root_rect,mHeader);
		drawChild(root_rect,mScrollbar );
		{
			LLRect child_rect;

			S32 width = getRect().getWidth();
			S32 height = getRect().getHeight();

			child_rect.setLeftTopAndSize(
				getPaddingLeft(),
				height - getHeaderHeight() - getPaddingTop(),
				width - getPaddingLeft() - getPaddingRight(), 
				height - getHeaderHeight() - getPaddingTop() - getPaddingBottom() );

			LLLocalClipRect clip(child_rect);
			drawChild(root_rect,mContainerPanel);
		}
	}
}
예제 #2
0
void LLAccordionCtrlTab::adjustContainerPanel	()
{
	S32 width = getRect().getWidth();
	S32 height = getRect().getHeight();

	LLRect child_rect;
	child_rect.setLeftTopAndSize(
		getPaddingLeft(),
		height - getHeaderHeight() - getPaddingTop(),
		width - getPaddingLeft() - getPaddingRight(), 
		height - getHeaderHeight() - getPaddingTop() - getPaddingBottom() );

	adjustContainerPanel(child_rect);
}
예제 #3
0
void	LLAccordionCtrlTab::onScrollPosChangeCallback(S32, LLScrollbar*)
{
	LLRect child_rect;

	S32 width = getRect().getWidth();
	S32 height = getRect().getHeight();

	child_rect.setLeftTopAndSize(
		getPaddingLeft(),
		height - getHeaderHeight() - getPaddingTop(),
		width - getPaddingLeft() - getPaddingRight(), 
		height - getHeaderHeight() - getPaddingTop() - getPaddingBottom() );

	updateLayout(child_rect);
}
예제 #4
0
S32	LLAccordionCtrlTab::notifyParent(const LLSD& info)
{
	if(info.has("action"))
	{
		std::string str_action = info["action"];
		if(str_action == "size_changes")
		{
			//
			S32 height = info["height"];
			height = llmax(height,10) + HEADER_HEIGHT + getPaddingTop() + getPaddingBottom();
			
			mExpandedHeight = height;
			
			if(isExpanded())
			{
				LLRect panel_rect = getRect();
				panel_rect.setLeftTopAndSize( panel_rect.mLeft, panel_rect.mTop, panel_rect.getWidth(), height);
				reshape(getRect().getWidth(),height);
				setRect(panel_rect);
			}
			
			//LLAccordionCtrl should rearrange accordion tab if one of accordion change its size
			if (getParent()) // A parent may not be set if tabs are added dynamically.
				getParent()->notifyParent(info);
			return 1;
		}
		else if(str_action == "select_prev") 
		{
			showAndFocusHeader();
			return 1;
		}
	}
	else if (info.has("scrollToShowRect"))
	{
		LLAccordionCtrl* parent = dynamic_cast<LLAccordionCtrl*>(getParent());
		if (parent && parent->getFitParent())
		{
			//	EXT-8285 ('No attachments worn' text appears at the bottom of blank 'Attachments' accordion)
			//	The problem was in passing message "scrollToShowRect" IN LLAccordionCtrlTab::notifyParent
			//	FROM child LLScrollContainer TO parent LLAccordionCtrl with "it_parent" set to true.

			//	It is wrong notification for parent accordion which leads to recursive call of adjustContainerPanel
			//	As the result of recursive call of adjustContainerPanel we got LLAccordionCtrlTab
			//	that reshaped and re-sized with different rectangles.

			//	LLAccordionCtrl has own scrollContainer and LLAccordionCtrlTab has own scrollContainer
			//	both should handle own scroll container's event.
			//	So, if parent accordion "fit_parent" accordion tab should handle its scroll container events itself.

			return 1;
		}
	}

	return LLUICtrl::notifyParent(info);
}
예제 #5
0
int LinearLayoutActor::animatePaddingIncrease(qreal topIncrease, qreal rightIncrease, qreal bottomIncrease, qreal leftIncrease, int duration, int initialDelay)
{
	QParallelAnimationGroup* groupAnimation = new QParallelAnimationGroup(this);
	groupAnimation->addAnimation( createPaddingAnimation("paddingTop", topIncrease, getPaddingTop(), duration, initialDelay) );
	groupAnimation->addAnimation( createPaddingAnimation("paddingRight", rightIncrease, getPaddingRight(), duration, initialDelay) );
	groupAnimation->addAnimation( createPaddingAnimation("paddingBottom", bottomIncrease, getPaddingBottom(), duration, initialDelay) );
	groupAnimation->addAnimation( createPaddingAnimation("paddingLeft", leftIncrease, getPaddingLeft(), duration, initialDelay) );

	groupAnimation->start();
	return VisualizationSpeed::getInstance().adjust(duration);
}
예제 #6
0
void LLAccordionCtrlTab::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */)
{
	LLRect headerRect;

	headerRect.setLeftTopAndSize(
		0,height,width,HEADER_HEIGHT);
	mHeader->setRect(headerRect);
	mHeader->reshape(headerRect.getWidth(), headerRect.getHeight());

	if(!mDisplayChildren)
		return;

	LLRect childRect;

	childRect.setLeftTopAndSize(
		getPaddingLeft(),
		height - getHeaderHeight() - getPaddingTop(),
		width - getPaddingLeft() - getPaddingRight(), 
		height - getHeaderHeight() - getPaddingTop() - getPaddingBottom() );

	adjustContainerPanel(childRect);
}
float ofxDOMLayoutHelper::getPaddingVertical(DOM::Element *e){
	return getPaddingTop(e) + getPaddingBottom(e);
}