diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-01-30 10:23:06 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-01-30 10:23:06 -0500 |
commit | 9bbaf3ab14cf131a1938455c99d3cf0f4abc176c (patch) | |
tree | 4292dd5c7fe667ef23e8c0ed821c973818726363 /indra/newview/llfloateruipreview.cpp | |
parent | a2544b18e8e1d49092a32833ddfc39826d1a5495 (diff) | |
parent | 4ef9277761b5faee2825177112939b72c563a4ea (diff) |
merge
Diffstat (limited to 'indra/newview/llfloateruipreview.cpp')
-rw-r--r-- | indra/newview/llfloateruipreview.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 4c9c4cb154..d741b5b133 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -915,14 +915,16 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) { panel->buildFromFile(path); // build it LLRect new_size = panel->getRect(); // get its rectangle - panel->setOrigin(0,0); // reset its origin point so it's not offset by -left or other XUI attributes + panel->setOrigin(2,2); // reset its origin point so it's not offset by -left or other XUI attributes (*floaterp)->setTitle(path); // use the file name as its title, since panels have no guaranteed meaningful name attribute panel->setUseBoundingRect(TRUE); // enable the use of its outer bounding rect (normally disabled because it's O(n) on the number of sub-elements) panel->updateBoundingRect(); // update bounding rect LLRect bounding_rect = panel->getBoundingRect(); // get the bounding rect LLRect new_rect = panel->getRect(); // get the panel's rect new_rect.unionWith(bounding_rect); // union them to make sure we get the biggest one possible - (*floaterp)->reshape(new_rect.getWidth(), new_rect.getHeight() + floater_header_size); // reshape floater to match the union rect's dimensions + LLRect floater_rect = new_rect; + floater_rect.stretch(4, 4); + (*floaterp)->reshape(floater_rect.getWidth(), floater_rect.getHeight() + floater_header_size); // reshape floater to match the union rect's dimensions panel->reshape(new_rect.getWidth(), new_rect.getHeight()); // reshape panel to match the union rect's dimensions as well (both are needed) (*floaterp)->addChild(panel); // add panel as child (*floaterp)->openFloater(); // open floater (needed?) |