void LLDragHandleTop::draw() { /* Disable lines. Can drag anywhere in most windows. JC if( getVisible() && getEnabled() && mForeground) { const S32 BORDER_PAD = 2; const S32 HPAD = 2; const S32 VPAD = 2; S32 left = BORDER_PAD + HPAD; S32 top = getRect().getHeight() - 2 * VPAD; S32 right = getRect().getWidth() - HPAD; // S32 bottom = VPAD; // draw lines for drag areas const S32 LINE_SPACING = (DRAG_HANDLE_HEIGHT - 2 * VPAD) / 4; S32 line = top - LINE_SPACING; LLRect title_rect = mTitleBox->getRect(); S32 title_right = title_rect.mLeft + mTitleWidth; BOOL show_right_side = title_right < getRect().getWidth(); for( S32 i=0; i<4; i++ ) { gl_line_2d(left, line+1, title_rect.mLeft - LEADING_PAD, line+1, mDragHighlightColor); if( show_right_side ) { gl_line_2d(title_right, line+1, right, line+1, mDragHighlightColor); } gl_line_2d(left, line, title_rect.mLeft - LEADING_PAD, line, mDragShadowColor); if( show_right_side ) { gl_line_2d(title_right, line, right, line, mDragShadowColor); } line -= LINE_SPACING; } } */ // Colorize the text to match the frontmost state if (getTitleBox()) { getTitleBox()->setEnabled(getForeground()); } LLView::draw(); }
// assumes GL state is set for 2D void LLDragHandleLeft::draw() { /* Disable lines. Can drag anywhere in most windows. JC if( getVisible() && getEnabled() && mForeground ) { const S32 BORDER_PAD = 2; // const S32 HPAD = 2; const S32 VPAD = 2; const S32 LINE_SPACING = 3; S32 left = BORDER_PAD + LINE_SPACING; S32 top = getRect().getHeight() - 2 * VPAD; // S32 right = getRect().getWidth() - HPAD; S32 bottom = VPAD; // draw lines for drag areas // no titles yet //LLRect title_rect = mTitleBox->getRect(); //S32 title_right = title_rect.mLeft + mTitleWidth; //BOOL show_right_side = title_right < getRect().getWidth(); S32 line = left; for( S32 i=0; i<4; i++ ) { gl_line_2d(line, top, line, bottom, mDragHighlightColor); gl_line_2d(line+1, top, line+1, bottom, mDragShadowColor); line += LINE_SPACING; } } */ // Colorize the text to match the frontmost state if (getTitleBox()) { getTitleBox()->setEnabled(getForeground()); } LLView::draw(); }
void LLDragHandleTop::reshapeTitleBox() { if( ! getTitleBox()) { return; } const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); S32 title_width = font->getWidth( getTitleBox()->getText() ) + TITLE_PAD; if (getMaxTitleWidth() > 0) title_width = llmin(title_width, getMaxTitleWidth()); S32 title_height = llround(font->getLineHeight()); LLRect title_rect; title_rect.setLeftTopAndSize( LEFT_PAD, getRect().getHeight() - BORDER_PAD, getRect().getWidth() - LEFT_PAD - RIGHT_PAD, title_height); getTitleBox()->setRect( title_rect ); }
const std::string& LLDragHandleTop::getTitle() const { return getTitleBox() == NULL ? LLStringUtil::null : getTitleBox()->getText(); }