From 0530eac42c8cbb4f41131e8d7796006b47ba1fa5 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 12 Jul 2013 17:57:31 -0700 Subject: ACME-701 : Align all social panels UX, recenter the preview in the photo panel --- indra/newview/llfloatersocial.cpp | 17 +++--- .../skins/default/xui/en/floater_social.xml | 14 ++--- .../skins/default/xui/en/panel_social_photo.xml | 66 ++++++++++++---------- .../skins/default/xui/en/panel_social_place.xml | 34 +++++++---- .../skins/default/xui/en/panel_social_status.xml | 14 ++--- 5 files changed, 82 insertions(+), 63 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 4c384efae1..c8c203fc25 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -168,6 +168,7 @@ mLocationCheckbox(NULL), mPostButton(NULL) { mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLSocialPhotoPanel::onSend, this)); + mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this)); } LLSocialPhotoPanel::~LLSocialPhotoPanel() @@ -186,7 +187,6 @@ BOOL LLSocialPhotoPanel::postBuild() mResolutionComboBox = getChild("resolution_combobox"); mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::updateResolution, this, TRUE)); mRefreshBtn = getChild("new_snapshot_btn"); - childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this)); mWorkingLabel = getChild("working_lbl"); mThumbnailPlaceholder = getChild("thumbnail_placeholder"); mCaptionTextBox = getChild("photo_caption"); @@ -217,15 +217,18 @@ void LLSocialPhotoPanel::draw() const S32 thumbnail_h = previewp->getThumbnailHeight(); // calc preview offset within the preview rect - const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ; + const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ; + const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ; // calc preview offset within the floater rect - S32 offset_x = thumbnail_rect.mLeft + local_offset_x; - // Hack : "15" is to compensate for "top=8" of "stack_photo" and "top=7" of "tabs" - S32 offset_y = thumbnail_rect.mBottom - 15; - + // Hack : To get the full offset, we need to take into account each and every offset of each widgets up to the floater. + // This is almost as arbitrary as using a fixed offset so that's what we do here for the sake of simplicity. + // *TODO : Get the offset looking through the hierarchy of widgets, should be done in postBuild() so to avoid traversing the hierarchy each time. + S32 offset_x = thumbnail_rect.mLeft + local_offset_x - 1; + S32 offset_y = thumbnail_rect.mBottom + local_offset_y - 39; + mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType()); - + gGL.matrixMode(LLRender::MM_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index c24e9a2194..65f738de1f 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -11,10 +11,10 @@ single_instance="true" reuse_instance="true" title="FACEBOOK" - height="465" + height="482" width="304"> + height="367"> - - Refreshing... - - + + Refreshing... + Comment (optional): @@ -114,9 +118,9 @@ initial_value="true" label="Include location in posting" name="add_location_cb" - left="6" + left="9" height="16" - top_pad="5"/> + top_pad="8"/> + height="181"> Say something about where you are: + height="186"> + + + height="367"> What's on your mind?