diff options
-rw-r--r-- | indra/newview/llpanelprofile.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llpreviewtexture.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llpreviewtexture.h | 2 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 33 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.h | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_preview_texture.xml | 208 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_profile_secondlife.xml | 1 |
7 files changed, 166 insertions, 99 deletions
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 472285e3d9..86b6163f45 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -324,6 +324,8 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key) mGroupList->setShowNone(!own_profile); mGiveInvPanel->setVisible(!own_profile); + mSecondLifePic->setOpenTexPreview(!own_profile); + if (own_profile && !getEmbedded()) { // Group list control cannot toggle ForAgent loading @@ -716,7 +718,6 @@ void LLPanelProfileSecondLife::updateButtons() mShowInSearchCheckbox->setVisible(TRUE); mShowInSearchCheckbox->setEnabled(TRUE); mDescriptionEdit->setEnabled(TRUE); - mSecondLifePic->setEnabled(TRUE); } if (!getSelfProfile()) diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 9d8be4b2fe..90cc18fbe9 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -328,7 +328,10 @@ void LLPreviewTexture::reshape(S32 width, S32 height, BOOL called_from_parent) // add space for dimensions and aspect ratio S32 info_height = dim_rect.mTop + CLIENT_RECT_VPAD; - + if (getChild<LLLayoutPanel>("buttons_panel")->getVisible()) + { + info_height += getChild<LLLayoutPanel>("buttons_panel")->getRect().getHeight(); + } LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0); client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD); client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ; @@ -373,6 +376,16 @@ void LLPreviewTexture::openToSave() mPreviewToSave = TRUE; } +void LLPreviewTexture::hideCtrlButtons() +{ + getChildView("desc txt")->setVisible(false); + getChildView("desc")->setVisible(false); + getChild<LLLayoutStack>("preview_stack")->collapsePanel(getChild<LLLayoutPanel>("buttons_panel"), true); + getChild<LLLayoutPanel>("buttons_panel")->setVisible(false); + getChild<LLComboBox>("combo_aspect_ratio")->setCurrentByIndex(0); //unconstrained + reshape(getRect().getWidth(), getRect().getHeight()); +} + // static void LLPreviewTexture::onFileLoadedForSave(BOOL success, LLViewerFetchedTexture *src_vi, diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index ad77d9e118..e8bba63cb2 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -66,6 +66,8 @@ public: static void onSaveAsBtn(void* data); + void hideCtrlButtons(); + /*virtual*/ void setObjectID(const LLUUID& object_id); protected: void init(); diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 1396a8546d..f5b96a3b5a 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -47,6 +47,7 @@ #include "llui.h" #include "llviewerinventory.h" #include "llpermissions.h" +#include "llpreviewtexture.h" #include "llsaleinfo.h" #include "llassetstorage.h" #include "lltextbox.h" @@ -997,6 +998,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mNeedsRawImageData( FALSE ), mValid( TRUE ), mShowLoadingPlaceholder( TRUE ), + mOpenTexPreview(false), mImageAssetID(p.image_id), mDefaultImageAssetID(p.default_image_id), mDefaultImageName(p.default_image_name), @@ -1249,12 +1251,31 @@ BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask) if (!handled && mBorder->parentPointInView(x, y)) { - showPicker(FALSE); - //grab textures first... - LLInventoryModelBackgroundFetch::instance().start(gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE)); - //...then start full inventory fetch. - LLInventoryModelBackgroundFetch::instance().start(); - handled = TRUE; + if (!mOpenTexPreview) + { + showPicker(FALSE); + //grab textures first... + LLInventoryModelBackgroundFetch::instance().start(gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE)); + //...then start full inventory fetch. + LLInventoryModelBackgroundFetch::instance().start(); + handled = TRUE; + } + else + { + if (getImageAssetID().notNull()) + { + LLPreviewTexture* preview_texture = LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", getValue()); + if (preview_texture && !preview_texture->isDependent()) + { + LLFloater* root_floater = gFloaterView->getParentFloater(this); + if (root_floater) + { + root_floater->addDependentFloater(preview_texture); + preview_texture->hideCtrlButtons(); + } + } + } + } } return handled; diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 6bcf9c3a75..6c11e1ecc3 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -160,6 +160,8 @@ public: void setBlankImageAssetID( const LLUUID& id ) { mBlankImageAssetID = id; } const LLUUID& getBlankImageAssetID() const { return mBlankImageAssetID; } + void setOpenTexPreview(bool open_preview) { mOpenTexPreview = open_preview; } + void setCaption(const std::string& caption); void setCanApplyImmediately(BOOL b); @@ -237,6 +239,7 @@ private: BOOL mShowLoadingPlaceholder; std::string mLoadingPlaceholderString; S32 mLabelWidth; + bool mOpenTexPreview; }; ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml index e1e7e1c8c8..048cf7df62 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_texture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml @@ -17,94 +17,122 @@ name="Copy"> Copy To Inventory </floater.string> - <text - type="string" - length="1" - follows="left|top" - font="SansSerif" - height="19" - layout="topleft" - left="10" - name="desc txt" - top="21" - width="90"> - Description: - </text> - <line_editor - border_style="line" - border_thickness="1" - follows="left|top|right" - font="SansSerif" - height="19" - layout="topleft" - left_pad="0" - max_length_bytes="127" - name="desc" - width="190" /> - <text - type="string" - halign="right" - length="1" - follows="right|bottom" - height="16" - layout="topleft" - left="110" - name="dimensions" - top="255" - width="200"> - [WIDTH]px x [HEIGHT]px - </text> - <text - type="string" - halign="right" - length="1" - follows="right|bottom" - height="16" - layout="topleft" - left_delta="-110" - name="aspect_ratio" - top_pad="5" - width="200"> - Preview aspect ratio - </text> - <combo_box - allow_text_entry="true" - top_delta="-3" - follows="right|bottom" - height="23" - left_pad="10" - max_chars="20" - mouse_opaque="true" - enabled="true" - width="108" - name="combo_aspect_ratio" - tool_tip="Preview at a fixed aspect ratio"> - </combo_box> - <button - follows="right|bottom" - height="22" - label="OK" - layout="topleft" - left="6" - name="Keep" - top_pad="5" - width="110" /> - <button - follows="right|bottom" - height="22" - label="Discard" - layout="topleft" - left_pad="5" - name="Discard" - top_delta="0" - width="110" /> - <button - follows="right|bottom" - height="22" - label="Save As" - layout="topleft" - left_pad="5" - name="save_tex_btn" - top_delta="0" - width="110" /> + <layout_stack + animate="false" + name="preview_stack" + top_pad="15" + left="0" + follows="all" + orientation="vertical" + height="350" + width="370" + layout="topleft"> + <layout_panel + name="texture_panel" + height="305" + top_pad="0" + left="0" + follows="left|top" + layout="topleft"> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="19" + layout="topleft" + left="10" + name="desc txt" + top="6" + width="90"> + Description: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + font="SansSerif" + height="19" + layout="topleft" + left_pad="0" + max_length_bytes="127" + name="desc" + width="190" /> + <text + type="string" + halign="right" + length="1" + follows="right|bottom" + height="16" + layout="topleft" + left="110" + name="dimensions" + bottom="-40" + width="200"> + [WIDTH]px x [HEIGHT]px + </text> + <text + type="string" + halign="right" + length="1" + follows="right|bottom" + height="16" + layout="topleft" + left_delta="-110" + name="aspect_ratio" + top_pad="5" + width="200"> + Preview aspect ratio + </text> + <combo_box + allow_text_entry="true" + top_delta="-3" + follows="right|bottom" + height="23" + left_pad="10" + max_chars="20" + mouse_opaque="true" + enabled="true" + width="108" + name="combo_aspect_ratio" + tool_tip="Preview at a fixed aspect ratio"> + </combo_box> + </layout_panel> + <layout_panel + name="buttons_panel" + height="45" + bottom="-40" + left="0" + follows="right|bottom" + auto_resize="false" + layout="topleft"> + <button + follows="right|bottom" + height="22" + label="OK" + layout="topleft" + left="6" + name="Keep" + top_pad="0" + width="110" /> + <button + follows="right|bottom" + height="22" + label="Discard" + layout="topleft" + left_pad="5" + name="Discard" + top_delta="0" + width="110" /> + <button + follows="right|bottom" + height="22" + label="Save As" + layout="topleft" + left_pad="5" + name="save_tex_btn" + top_delta="0" + width="110" /> + </layout_panel> + </layout_stack> </floater> diff --git a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml index f7d3353786..214f89b7af 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml @@ -179,7 +179,6 @@ <!-- 23 pixels (BTN_HEIGHT_SMALL) are reserved by label field of texture and shouldn't be visible--> <texture_picker name="2nd_life_pic" - enabled="false" top="0" left="0" right="-1" |