Sometimes UI get this syncing feeling... but then everything seems fine.
This commit is contained in:
@@ -626,12 +626,12 @@ BOOL LLMenuItemSeparatorGL::handleMouseDown(S32 x, S32 y, MASK mask)
|
|||||||
{
|
{
|
||||||
// the menu items are in the child list in bottom up order
|
// the menu items are in the child list in bottom up order
|
||||||
LLView* prev_menu_item = parent_menu->findNextSibling(this);
|
LLView* prev_menu_item = parent_menu->findNextSibling(this);
|
||||||
return prev_menu_item ? prev_menu_item->handleMouseDown(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;
|
return (prev_menu_item && prev_menu_item->getVisible() && prev_menu_item->getEnabled()) ? prev_menu_item->handleMouseDown(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LLView* next_menu_item = parent_menu->findPrevSibling(this);
|
LLView* next_menu_item = parent_menu->findPrevSibling(this);
|
||||||
return next_menu_item ? next_menu_item->handleMouseDown(x, 0, mask) : FALSE;
|
return (next_menu_item && next_menu_item->getVisible() && next_menu_item->getEnabled()) ? next_menu_item->handleMouseDown(x, 0, mask) : FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -641,12 +641,12 @@ BOOL LLMenuItemSeparatorGL::handleMouseUp(S32 x, S32 y, MASK mask)
|
|||||||
if (y > getRect().getHeight() / 2)
|
if (y > getRect().getHeight() / 2)
|
||||||
{
|
{
|
||||||
LLView* prev_menu_item = parent_menu->findNextSibling(this);
|
LLView* prev_menu_item = parent_menu->findNextSibling(this);
|
||||||
return prev_menu_item ? prev_menu_item->handleMouseUp(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;
|
return (prev_menu_item && prev_menu_item->getVisible() && prev_menu_item->getEnabled()) ? prev_menu_item->handleMouseUp(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LLView* next_menu_item = parent_menu->findPrevSibling(this);
|
LLView* next_menu_item = parent_menu->findPrevSibling(this);
|
||||||
return next_menu_item ? next_menu_item->handleMouseUp(x, 0, mask) : FALSE;
|
return (next_menu_item && next_menu_item->getVisible() && next_menu_item->getEnabled()) ? next_menu_item->handleMouseUp(x, 0, mask) : FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,8 @@ BOOL LLMultiFloater::closeAllFloaters()
|
|||||||
//Tab did not actually close, possibly due to a pending Save Confirmation dialog..
|
//Tab did not actually close, possibly due to a pending Save Confirmation dialog..
|
||||||
//so try and close the next one in the list...
|
//so try and close the next one in the list...
|
||||||
tabToClose++;
|
tabToClose++;
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
//Tab closed ok.
|
//Tab closed ok.
|
||||||
lastTabCount = mTabContainer->getTabCount();
|
lastTabCount = mTabContainer->getTabCount();
|
||||||
@@ -252,7 +253,7 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater,
|
|||||||
else if (floaterp->getHost())
|
else if (floaterp->getHost())
|
||||||
{
|
{
|
||||||
// floaterp is hosted by somebody else and
|
// floaterp is hosted by somebody else and
|
||||||
// this is adding it, so remove it from it's old host
|
// this is adding it, so remove it from its old host
|
||||||
floaterp->getHost()->removeFloater(floaterp);
|
floaterp->getHost()->removeFloater(floaterp);
|
||||||
}
|
}
|
||||||
else if (floaterp->getParent() == gFloaterView)
|
else if (floaterp->getParent() == gFloaterView)
|
||||||
@@ -302,8 +303,21 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater,
|
|||||||
{
|
{
|
||||||
floaterp->setVisible(FALSE);
|
floaterp->setVisible(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tabs sometimes overlap resize handle
|
||||||
|
moveResizeHandlesToFront();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLMultiFloater::updateFloaterTitle(LLFloater* floaterp)
|
||||||
|
{
|
||||||
|
S32 index = mTabContainer->getIndexForPanel(floaterp);
|
||||||
|
if (index != -1)
|
||||||
|
{
|
||||||
|
mTabContainer->setPanelTitle(index, floaterp->getShortTitle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
BOOL selectFloater(LLFloater* floaterp)
|
BOOL selectFloater(LLFloater* floaterp)
|
||||||
|
|
||||||
@@ -329,8 +343,9 @@ void LLMultiFloater::selectPrevFloater()
|
|||||||
mTabContainer->selectPrevTab();
|
mTabContainer->selectPrevTab();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLMultiFloater::showFloater(LLFloater* floaterp)
|
void LLMultiFloater::showFloater(LLFloater* floaterp, LLTabContainer::eInsertionPoint insertion_point)
|
||||||
{
|
{
|
||||||
|
if(!floaterp) return;
|
||||||
// we won't select a panel that already is selected
|
// we won't select a panel that already is selected
|
||||||
// it is hard to do this internally to tab container
|
// it is hard to do this internally to tab container
|
||||||
// as tab selection is handled via index and the tab at a given
|
// as tab selection is handled via index and the tab at a given
|
||||||
@@ -338,7 +353,7 @@ void LLMultiFloater::showFloater(LLFloater* floaterp)
|
|||||||
if (floaterp != mTabContainer->getCurrentPanel() &&
|
if (floaterp != mTabContainer->getCurrentPanel() &&
|
||||||
!mTabContainer->selectTabPanel(floaterp))
|
!mTabContainer->selectTabPanel(floaterp))
|
||||||
{
|
{
|
||||||
addFloater(floaterp, TRUE);
|
addFloater(floaterp, TRUE, insertion_point);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,6 +432,13 @@ BOOL LLMultiFloater::handleKeyHere(KEY key, MASK mask)
|
|||||||
if (floater && floater->canClose() && floater->isCloseable())
|
if (floater && floater->canClose() && floater->isCloseable())
|
||||||
{
|
{
|
||||||
floater->close();
|
floater->close();
|
||||||
|
|
||||||
|
// EXT-5695 (Tabbed IM window loses focus if close any tabs by Ctrl+W)
|
||||||
|
// bring back focus on tab container if there are any tab left
|
||||||
|
if(mTabContainer->getTabCount() > 0)
|
||||||
|
{
|
||||||
|
mTabContainer->setFocus(TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -468,12 +490,17 @@ void LLMultiFloater::setFloaterFlashing(LLFloater* floaterp, BOOL flashing)
|
|||||||
|
|
||||||
void LLMultiFloater::onTabSelected()
|
void LLMultiFloater::onTabSelected()
|
||||||
{
|
{
|
||||||
tabOpen((LLFloater*)mTabContainer->getCurrentPanel());
|
LLFloater* floaterp = dynamic_cast<LLFloater*>(mTabContainer->getCurrentPanel());
|
||||||
|
if (floaterp)
|
||||||
|
{
|
||||||
|
tabOpen(floaterp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLMultiFloater::setCanResize(BOOL can_resize)
|
void LLMultiFloater::setCanResize(BOOL can_resize)
|
||||||
{
|
{
|
||||||
LLFloater::setCanResize(can_resize);
|
LLFloater::setCanResize(can_resize);
|
||||||
|
if (!mTabContainer) return;
|
||||||
if (isResizable() && mTabContainer->getTabPosition() == LLTabContainer::BOTTOM)
|
if (isResizable() && mTabContainer->getTabPosition() == LLTabContainer::BOTTOM)
|
||||||
{
|
{
|
||||||
mTabContainer->setRightTabBtnOffset(RESIZE_HANDLE_WIDTH);
|
mTabContainer->setRightTabBtnOffset(RESIZE_HANDLE_WIDTH);
|
||||||
@@ -510,16 +537,9 @@ void LLMultiFloater::updateResizeLimits()
|
|||||||
// initialize minimum size constraint to the original xml values.
|
// initialize minimum size constraint to the original xml values.
|
||||||
S32 new_min_width = mOrigMinWidth;
|
S32 new_min_width = mOrigMinWidth;
|
||||||
S32 new_min_height = mOrigMinHeight;
|
S32 new_min_height = mOrigMinHeight;
|
||||||
// possibly increase minimum size constraint due to children's minimums.
|
|
||||||
for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx)
|
computeResizeLimits(new_min_width, new_min_height);
|
||||||
{
|
|
||||||
LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(tab_idx);
|
|
||||||
if (floaterp)
|
|
||||||
{
|
|
||||||
new_min_width = llmax(new_min_width, floaterp->getMinWidth() + LLPANEL_BORDER_WIDTH * 2);
|
|
||||||
new_min_height = llmax(new_min_height, floaterp->getMinHeight() + LLFLOATER_HEADER_SIZE + TABCNTR_HEADER_HEIGHT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setResizeLimits(new_min_width, new_min_height);
|
setResizeLimits(new_min_width, new_min_height);
|
||||||
|
|
||||||
S32 cur_height = getRect().getHeight();
|
S32 cur_height = getRect().getHeight();
|
||||||
@@ -545,3 +565,17 @@ void LLMultiFloater::updateResizeLimits()
|
|||||||
gFloaterView->adjustToFitScreen(this, TRUE);
|
gFloaterView->adjustToFitScreen(this, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLMultiFloater::computeResizeLimits(S32& new_min_width, S32& new_min_height)
|
||||||
|
{
|
||||||
|
// possibly increase minimum size constraint due to children's minimums.
|
||||||
|
for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx)
|
||||||
|
{
|
||||||
|
LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(tab_idx);
|
||||||
|
if (floaterp)
|
||||||
|
{
|
||||||
|
new_min_width = llmax(new_min_width, floaterp->getMinWidth() + LLPANEL_BORDER_WIDTH * 2);
|
||||||
|
new_min_height = llmax(new_min_height, floaterp->getMinHeight() + LLFLOATER_HEADER_SIZE + TABCNTR_HEADER_HEIGHT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public:
|
|||||||
virtual void growToFit(S32 content_width, S32 content_height);
|
virtual void growToFit(S32 content_width, S32 content_height);
|
||||||
virtual void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
|
virtual void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
|
||||||
|
|
||||||
virtual void showFloater(LLFloater* floaterp);
|
virtual void showFloater(LLFloater* floaterp, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
|
||||||
virtual void removeFloater(LLFloater* floaterp);
|
virtual void removeFloater(LLFloater* floaterp);
|
||||||
|
|
||||||
virtual void tabOpen(LLFloater* opened_floater);
|
virtual void tabOpen(LLFloater* opened_floater);
|
||||||
@@ -76,6 +76,7 @@ public:
|
|||||||
void onTabSelected();
|
void onTabSelected();
|
||||||
|
|
||||||
virtual void updateResizeLimits();
|
virtual void updateResizeLimits();
|
||||||
|
virtual void updateFloaterTitle(LLFloater* floaterp);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
struct LLFloaterData
|
struct LLFloaterData
|
||||||
@@ -94,6 +95,9 @@ protected:
|
|||||||
LLTabContainer::TabPosition mTabPos;
|
LLTabContainer::TabPosition mTabPos;
|
||||||
BOOL mAutoResize;
|
BOOL mAutoResize;
|
||||||
S32 mOrigMinWidth, mOrigMinHeight; // logically const but initialized late
|
S32 mOrigMinWidth, mOrigMinHeight; // logically const but initialized late
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual void computeResizeLimits(S32& new_min_width, S32& new_min_height);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LL_MULTI_FLOATER_H
|
#endif // LL_MULTI_FLOATER_H
|
||||||
|
|||||||
Reference in New Issue
Block a user