本文整理汇总了C++中LLPanel::reshape方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPanel::reshape方法的具体用法?C++ LLPanel::reshape怎么用?C++ LLPanel::reshape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPanel
的用法示例。
在下文中一共展示了LLPanel::reshape方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onTabChange
void LLPanelMarketplaceListings::onTabChange()
{
// Find active panel
LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel();
if (panel)
{
// If the panel doesn't allow drop on root, it doesn't allow the creation of new folder on root either
LLButton* add_btn = getChild<LLButton>("add_btn");
add_btn->setEnabled(panel->getAllowDropOnRoot());
// Set filter string on active panel
panel->setFilterSubString(mFilterSubString);
// Show/hide the drop zone and resize the inventory tabs panel accordingly
LLPanel* drop_zone = (LLPanel*)getChild<LLPanel>("marketplace_drop_zone");
bool drop_zone_visible = drop_zone->getVisible();
bool allow_drop_on_root = panel->getAllowDropOnRoot() && gSavedSettings.getBOOL("LiruEnableWIPUI");
if (drop_zone_visible != allow_drop_on_root)
{
LLPanel* tabs = (LLPanel*)getChild<LLPanel>("tab_container_panel");
S32 delta_height = drop_zone->getRect().getHeight();
delta_height = (drop_zone_visible ? delta_height : -delta_height);
tabs->reshape(tabs->getRect().getWidth(),tabs->getRect().getHeight() + delta_height);
tabs->translate(0,-delta_height);
}
drop_zone->setVisible(allow_drop_on_root);
}
}
示例2: updateLayout
void LLLayoutStack::updateLayout(BOOL force_resize)
{
LLFastTimer ft(FTM_UPDATE_LAYOUT);
static LLUICachedControl<S32> resize_bar_overlap ("UIResizeBarOverlap", 0);
calcMinExtents();
createResizeBars();
// calculate current extents
S32 total_width = 0;
S32 total_height = 0;
e_panel_list_t::iterator panel_it;
for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
{
LLPanel* panelp = (*panel_it);
if (panelp->getVisible())
{
if (mAnimate)
{
if (!mAnimatedThisFrame)
{
(*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant));
if ((*panel_it)->mVisibleAmt > 0.99f)
{
(*panel_it)->mVisibleAmt = 1.f;
}
}
}
else
{
(*panel_it)->mVisibleAmt = 1.f;
}
}
else // not visible
{
if (mAnimate)
{
if (!mAnimatedThisFrame)
{
(*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant));
if ((*panel_it)->mVisibleAmt < 0.001f)
{
(*panel_it)->mVisibleAmt = 0.f;
}
}
}
else
{
(*panel_it)->mVisibleAmt = 0.f;
}
}
if ((*panel_it)->mCollapsed)
{
(*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 1.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant));
}
else
{
(*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant));
}
if (mOrientation == HORIZONTAL)
{
// enforce minimize size constraint by default
if (panelp->getRect().getWidth() < (*panel_it)->mMinDim)
{
panelp->reshape((*panel_it)->mMinDim, panelp->getRect().getHeight());
}
total_width += llround(panelp->getRect().getWidth() * (*panel_it)->getCollapseFactor(mOrientation));
// want n-1 panel gaps for n panels
if (panel_it != mPanels.begin())
{
total_width += mPanelSpacing;
}
}
else //VERTICAL
{
// enforce minimize size constraint by default
if (panelp->getRect().getHeight() < (*panel_it)->mMinDim)
{
panelp->reshape(panelp->getRect().getWidth(), (*panel_it)->mMinDim);
}
total_height += llround(panelp->getRect().getHeight() * (*panel_it)->getCollapseFactor(mOrientation));
if (panel_it != mPanels.begin())
{
total_height += mPanelSpacing;
}
}
}
S32 num_resizable_panels = 0;
S32 shrink_headroom_available = 0;
S32 shrink_headroom_total = 0;
for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
{
// panels that are not fully visible do not count towards shrink headroom
if ((*panel_it)->getCollapseFactor(mOrientation) < 1.f)
{
continue;
}
//.........这里部分代码省略.........
示例3: rearrangeItems
void LLFlatListView::rearrangeItems()
{
static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0);
setNoItemsCommentVisible(mItemPairs.empty());
if (mItemPairs.empty()) return;
//calculating required height - assuming items can be of different height
//list should accommodate all its items
S32 height = 0;
S32 invisible_children_count = 0;
pairs_iterator_t it = mItemPairs.begin();
for (; it != mItemPairs.end(); ++it)
{
LLPanel* item = (*it)->first;
// skip invisible child
if (!item->getVisible())
{
++invisible_children_count;
continue;
}
height += item->getRect().getHeight();
}
// add paddings between items, excluding invisible ones
height += mItemPad * (mItemPairs.size() - invisible_children_count - 1);
LLRect rc = mItemsPanel->getRect();
S32 width = mItemsNoScrollWidth;
// update width to avoid horizontal scrollbar
if (height > getRect().getHeight() - 2 * mBorderThickness)
width -= scrollbar_size;
//changes the bottom, end of the list goes down in the scroll container
rc.setLeftTopAndSize(rc.mLeft, rc.mTop, width, height);
mItemsPanel->setRect(rc);
//reshaping items
S32 item_new_top = height;
pairs_iterator_t it2, first_it = mItemPairs.begin();
for (it2 = first_it; it2 != mItemPairs.end(); ++it2)
{
LLPanel* item = (*it2)->first;
// skip invisible child
if (!item->getVisible())
continue;
LLRect rc = item->getRect();
rc.setLeftTopAndSize(rc.mLeft, item_new_top, width, rc.getHeight());
item->reshape(rc.getWidth(), rc.getHeight());
item->setRect(rc);
// move top for next item in list
item_new_top -= (rc.getHeight() + mItemPad);
}
// Stretch selected item rect to ensure it won't be clipped
mSelectedItemsBorder->setRect(getLastSelectedItemRect().stretch(-1));
}