summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-09-20 16:12:28 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2012-09-20 16:12:28 -0700
commit381c13d0e51c3c054fdf2afeff8a8bcb6fc7aa11 (patch)
tree53d1883c760ce238ab2e11146c505150b10be7ab /indra/newview
parent5cb0a6221613f1a2f1181cea0fb8bd526ab872bf (diff)
CHUI-283: Refactor of how the layout is determined for LLFolderViewItem. Changed constant members that defined the layout to non-const member varaibles, which are populated using a .xml file.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llconversationview.cpp24
-rwxr-xr-xindra/newview/llconversationview.h2
-rw-r--r--indra/newview/skins/default/xui/en/panel_outbox_inventory.xml9
-rwxr-xr-xindra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml11
-rw-r--r--indra/newview/skins/default/xui/en/widgets/conversation_view_session.xml9
-rw-r--r--indra/newview/skins/default/xui/en/widgets/folder_view_item.xml8
-rw-r--r--indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml8
7 files changed, 53 insertions, 18 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 721abd5892..6860415377 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -109,8 +109,8 @@ void LLConversationViewSession::draw()
{
LLUIImage* arrow_image = default_params.folder_arrow_image;
gl_draw_scaled_rotated_image(
- mIndentation, getRect().getHeight() - ARROW_SIZE - TEXT_PAD - TOP_PAD,
- ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, arrow_image->getImage(), sFgColor);
+ mIndentation, getRect().getHeight() - mArrowSize - mTextPad - TOP_PAD,
+ mArrowSize, mArrowSize, mControlLabelRotation, arrow_image->getImage(), sFgColor);
}
@@ -227,7 +227,7 @@ void LLConversationViewSession::draw()
// virtual
S32 LLConversationViewSession::arrange(S32* width, S32* height)
{
- LLRect rect(getIndentation() + ARROW_SIZE,
+ LLRect rect(getIndentation() + mArrowSize,
getLocalRect().mTop,
getLocalRect().mRight,
getLocalRect().mTop - getItemHeight());
@@ -336,7 +336,7 @@ void LLConversationViewParticipant::initFromParams(const LLConversationViewParti
applyXUILayout(avatar_icon_params, this);
LLAvatarIconCtrl * avatarIcon = LLUICtrlFactory::create<LLAvatarIconCtrl>(avatar_icon_params);
addChild(avatarIcon);
-
+
LLButton::Params info_button_params(params.info_button());
applyXUILayout(info_button_params, this);
LLButton * button = LLUICtrlFactory::create<LLButton>(info_button_params);
@@ -381,16 +381,11 @@ void LLConversationViewParticipant::draw()
const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE);
const BOOL filled = show_context || (getRoot() ? getRoot()->getParentPanel()->hasFocus() : FALSE); // If we have keyboard focus, draw selection filled
- const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
- const S32 TOP_PAD = default_params.item_top_pad;
-
const LLFontGL* font = getLabelFontForStyle(mLabelStyle);
F32 right_x = 0;
- //TEXT_PAD, TOP_PAD, ICON_PAD and mIndentation are temporary values and will non-const eventually since they don't
- //apply to every single layout
- F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD;
- F32 text_left = (F32)(mAvatarIcon->getRect().mRight + ICON_PAD + mIndentation);
+ F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
+ F32 text_left = (F32)getLabelXPos();
LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor;
drawHighlight(show_context, filled, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor);
@@ -448,6 +443,11 @@ void LLConversationViewParticipant::onMouseLeave(S32 x, S32 y, MASK mask)
LLFolderViewItem::onMouseEnter(x, y, mask);
}
+S32 LLConversationViewParticipant::getLabelXPos()
+{
+ return mAvatarIcon->getRect().mRight + mIconPad;
+}
+
// static
void LLConversationViewParticipant::initChildrenWidths(LLConversationViewParticipant* self)
{
@@ -465,7 +465,7 @@ void LLConversationViewParticipant::initChildrenWidths(LLConversationViewPartici
void LLConversationViewParticipant::computeLabelRightPadding()
{
- mLabelPaddingRight = DEFAULT_TEXT_PADDING_RIGHT;
+ mLabelPaddingRight = DEFAULT_LABEL_PADDING_RIGHT;
LLView* control;
S32 ctrl_width;
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index 075ad09d5b..5bc4678b7b 100755
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -101,6 +101,8 @@ public:
void onMouseEnter(S32 x, S32 y, MASK mask);
void onMouseLeave(S32 x, S32 y, MASK mask);
+ /*virtual*/ S32 getLabelXPos();
+
protected:
friend class LLUICtrlFactory;
LLConversationViewParticipant( const Params& p );
diff --git a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
index 203febbf18..c80e5b168a 100644
--- a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
@@ -20,6 +20,13 @@
folder_indentation="8"
item_height="20"
item_top_pad="4"
- selection_image="Rounded_Square"/>
+ selection_image="Rounded_Square"
+ left_pad="5"
+ icon_pad="2"
+ icon_width="16"
+ text_pad="1"
+ text_pad_right="4"
+ arrow_size="12"
+ max_folder_item_overlap="2"/>
<item allow_open="false"/>
</inventory_panel>
diff --git a/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml b/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml
index 7ddcfe3b03..a28d6e0209 100755
--- a/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml
+++ b/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml
@@ -1,12 +1,19 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<conversation_view_participant
- folder_arrow_image="ForSale_Badge"
+ folder_arrow_image="Folder_Arrow"
folder_indentation="0"
item_height="24"
- item_top_pad="4"
+ item_top_pad="0"
selection_image="Rounded_Square"
mouse_opaque="true"
follows="left|top|right"
+ left_pad="0"
+ icon_pad="10"
+ icon_width="20"
+ text_pad="7"
+ text_pad_right="4"
+ arrow_size="12"
+ max_folder_item_overlap="2"
>
<avatar_icon
follows="left"
diff --git a/indra/newview/skins/default/xui/en/widgets/conversation_view_session.xml b/indra/newview/skins/default/xui/en/widgets/conversation_view_session.xml
index f44731ea3d..b8c39eec1d 100644
--- a/indra/newview/skins/default/xui/en/widgets/conversation_view_session.xml
+++ b/indra/newview/skins/default/xui/en/widgets/conversation_view_session.xml
@@ -6,4 +6,11 @@
item_top_pad="4"
selection_image="Rounded_Square"
mouse_opaque="true"
- follows="left|top|right"/>
+ follows="left|top|right"
+ left_pad="5"
+ icon_pad="2"
+ icon_width="16"
+ text_pad="1"
+ text_pad_right="4"
+ arrow_size="12"
+ max_folder_item_overlap="2"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
index 6fa74f403d..bbd53ccb12 100644
--- a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
@@ -7,4 +7,10 @@
selection_image="Rounded_Square"
mouse_opaque="true"
follows="left|top|right"
- />
+ left_pad="5"
+ icon_pad="2"
+ icon_width="16"
+ text_pad="1"
+ text_pad_right="4"
+ arrow_size="12"
+ max_folder_item_overlap="2"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
index 77d8024cb2..590a4730a9 100644
--- a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
+++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
@@ -5,7 +5,13 @@
item_height="20"
item_top_pad="4"
selection_image="Rounded_Square"
- >
+ left_pad="5"
+ icon_pad="2"
+ icon_width="16"
+ text_pad="1"
+ text_pad_right="4"
+ arrow_size="12"
+ max_folder_item_overlap="2">
<new_badge
label="New"
label_offset_horiz="-1"