summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-05-19 13:43:12 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-05-19 13:43:12 +0300
commit2c817f0b40aa22209b498e5e42dca8eab6439f4e (patch)
treed86f5574202c7415c93fc45c7a5cd1f7fe892d06 /indra/llui
parenta4fc76a0f749e07d703ddb7ed923d7c4ea94ab7e (diff)
parent8e474b095a9d228d62101540433937abdf623842 (diff)
Manual merge from default branch
Resolved conflicts in: - indra/newview/skins/default/xui/en/floater_world_map.xml - indra/newview/skins/default/xui/en/notifications.xml --HG-- branch : product-engine
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfloater.cpp9
-rw-r--r--indra/llui/llfloater.h4
-rw-r--r--indra/llui/llview.cpp58
-rw-r--r--indra/llui/llview.h3
4 files changed, 20 insertions, 54 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 79c47a1136..6babaf936b 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -169,6 +169,7 @@ LLFloater::Params::Params()
save_rect("save_rect", false),
save_visibility("save_visibility", false),
can_dock("can_dock", false),
+ open_centered("open_centered", false),
header_height("header_height", 0),
legacy_header_height("legacy_header_height", 0),
close_image("close_image"),
@@ -763,6 +764,13 @@ void LLFloater::applySavedVariables()
void LLFloater::applyRectControl()
{
+ // first, center on screen if requested
+ if (mOpenCentered)
+ {
+ center();
+ }
+
+ // override center if we have saved rect control
if (mRectControl.size() > 1)
{
const LLRect& rect = LLUI::sSettingGroups["floater"]->getRect(mRectControl);
@@ -2711,6 +2719,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
mLegacyHeaderHeight = p.legacy_header_height;
mSingleInstance = p.single_instance;
mAutoTile = p.auto_tile;
+ mOpenCentered = p.open_centered;
if (p.save_rect)
{
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 444711de81..654164ddc0 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -110,7 +110,8 @@ public:
save_rect,
save_visibility,
save_dock_state,
- can_dock;
+ can_dock,
+ open_centered;
Optional<S32> header_height,
legacy_header_height; // HACK see initFromXML()
@@ -373,6 +374,7 @@ private:
BOOL mCanClose;
BOOL mDragOnLeft;
BOOL mResizable;
+ bool mOpenCentered;
S32 mMinWidth;
S32 mMinHeight;
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index e67f0ec3fc..c091686ffb 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -107,8 +107,6 @@ LLView::Params::Params()
top_delta("top_delta", S32_MAX),
left_pad("left_pad"),
left_delta("left_delta", S32_MAX),
- center_horiz("center_horiz", false),
- center_vert("center_vert", false),
from_xui("from_xui", false),
user_resize("user_resize"),
auto_resize("auto_resize"),
@@ -2501,7 +2499,6 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
p.layout = parent->getLayout();
}
-
if (parent)
{
LLRect parent_rect = parent->getLocalRect();
@@ -2509,60 +2506,21 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
LLRect last_rect = parent->getLocalRect();
bool layout_topleft = (p.layout() == "topleft");
- if (layout_topleft)
- {
- //invert top to bottom
- if (p.rect.top.isProvided()) p.rect.top = parent_rect.getHeight() - p.rect.top;
- if (p.rect.bottom.isProvided()) p.rect.bottom = parent_rect.getHeight() - p.rect.bottom;
- }
// convert negative or centered coordinates to parent relative values
// Note: some of this logic matches the logic in TypedParam<LLRect>::setValueFromBlock()
+ if (p.rect.left.isProvided() && p.rect.left < 0) p.rect.left = p.rect.left + parent_rect.getWidth();
+ if (p.rect.right.isProvided() && p.rect.right < 0) p.rect.right = p.rect.right + parent_rect.getWidth();
+ if (p.rect.bottom.isProvided() && p.rect.bottom < 0) p.rect.bottom = p.rect.bottom + parent_rect.getHeight();
+ if (p.rect.top.isProvided() && p.rect.top < 0) p.rect.top = p.rect.top + parent_rect.getHeight();
- if (p.center_horiz)
- {
- if (p.rect.left.isProvided() && p.rect.right.isProvided())
- {
- S32 width = p.rect.right - p.rect.left;
- width = llmax(width, 0);
- S32 offset = parent_rect.getWidth()/2 - width/2;
- p.rect.left = p.rect.left + offset;
- p.rect.right = p.rect.right + offset;
- }
- else
- {
- p.rect.left = p.rect.left + parent_rect.getWidth()/2 - p.rect.width/2;
- p.rect.right.setProvided(false); // recalculate the right
- }
- }
- else
- {
- if (p.rect.left.isProvided() && p.rect.left < 0) p.rect.left = p.rect.left + parent_rect.getWidth();
- if (p.rect.right.isProvided() && p.rect.right < 0) p.rect.right = p.rect.right + parent_rect.getWidth();
- }
- if (p.center_vert)
- {
- if (p.rect.bottom.isProvided() && p.rect.top.isProvided())
- {
- S32 height = p.rect.top - p.rect.bottom;
- height = llmax(height, 0);
- S32 offset = parent_rect.getHeight()/2 - height/2;
- p.rect.bottom = p.rect.bottom + offset;
- p.rect.top = p.rect.top + offset;
- }
- else
- {
- p.rect.bottom = p.rect.bottom + parent_rect.getHeight()/2 - p.rect.height/2;
- p.rect.top.setProvided(false); // recalculate the top
- }
- }
- else
+ if (layout_topleft)
{
- if (p.rect.bottom.isProvided() && p.rect.bottom < 0) p.rect.bottom = p.rect.bottom + parent_rect.getHeight();
- if (p.rect.top.isProvided() && p.rect.top < 0) p.rect.top = p.rect.top + parent_rect.getHeight();
+ //invert top to bottom
+ if (p.rect.top.isProvided()) p.rect.top = parent_rect.getHeight() - p.rect.top;
+ if (p.rect.bottom.isProvided()) p.rect.bottom = parent_rect.getHeight() - p.rect.bottom;
}
-
// DEPRECATE: automatically fall back to height of MIN_WIDGET_HEIGHT pixels
if (!p.rect.height.isProvided() && !p.rect.top.isProvided() && p.rect.height == 0)
{
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index efae00f0e5..3779fedf34 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -143,9 +143,6 @@ public:
left_pad, // from last right to my left
left_delta; // from last left to my left
- Optional<bool> center_horiz,
- center_vert;
-
// these are nested attributes for LLLayoutPanel
//FIXME: get parent context involved in parsing traversal
Ignored user_resize,