diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 499e22edd1..fea1989e7e 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -927,7 +927,10 @@ BOOL LLPanelProfileSecondLife::postBuild() //mShowInSearchCombo = getChild("show_in_search"); mShowInSearchCheckbox = getChild("show_in_search"); // - mSecondLifePic = getChild("2nd_life_pic"); + // Allow proper texture swatch handling + // mSecondLifePic = getChild("2nd_life_pic"); + mSecondLifePic = getChild("2nd_life_pic"); + // mSecondLifePicLayout = getChild("image_panel"); mDescriptionEdit = getChild("sl_description_edit"); // mAgentActionMenuButton = getChild("agent_actions_menu"); // Fix LL UI/UX design accident @@ -981,7 +984,10 @@ BOOL LLPanelProfileSecondLife::postBuild() mCantSeeOnMapIcon->setMouseUpCallback([this](LLUICtrl*, S32 x, S32 y, MASK mask) { onShowAgentPermissionsDialog(); }); mCanEditObjectsIcon->setMouseUpCallback([this](LLUICtrl*, S32 x, S32 y, MASK mask) { onShowAgentPermissionsDialog(); }); mCantEditObjectsIcon->setMouseUpCallback([this](LLUICtrl*, S32 x, S32 y, MASK mask) { onShowAgentPermissionsDialog(); }); - mSecondLifePic->setMouseUpCallback([this](LLUICtrl*, S32 x, S32 y, MASK mask) { onShowAgentProfileTexture(); }); + // Allow proper texture swatch handling + // mSecondLifePic->setMouseUpCallback([this](LLUICtrl*, S32 x, S32 y, MASK mask) { onShowAgentProfileTexture(); }); + mSecondLifePic->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onSecondLifePicChanged, this)); + // // RLVa support mRlvBehaviorCallbackConnection = gRlvHandler.setBehaviourCallback(boost::bind(&LLPanelProfileSecondLife::updateRlvRestrictions, this, _1)); @@ -1074,6 +1080,9 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key) // Display agent ID getChild("user_key")->setValue(avatar_id.asString()); + // Allow proper texture swatch handling + mSecondLifePic->setEnabled(own_profile); + mAvatarNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileSecondLife::onAvatarNameCache, this, _1, _2)); } @@ -2283,6 +2292,13 @@ void LLPanelProfileSecondLife::onShowTexturePicker() } } +// Allow proper texture swatch handling +void LLPanelProfileSecondLife::onSecondLifePicChanged() +{ + onCommitProfileImage(mSecondLifePic->getImageAssetID()); +} +// + void LLPanelProfileSecondLife::onCommitProfileImage(const LLUUID& id) { if (mImageId == id) @@ -2511,7 +2527,10 @@ LLPanelProfileFirstLife::~LLPanelProfileFirstLife() BOOL LLPanelProfileFirstLife::postBuild() { mDescriptionEdit = getChild("fl_description_edit"); - mPicture = getChild("real_world_pic"); + // Allow proper texture swatch handling + // mPicture = getChild("real_world_pic"); + mPicture = getChild("real_world_pic"); + // mUploadPhoto = getChild("fl_upload_image"); mChangePhoto = getChild("fl_change_image"); @@ -2525,7 +2544,7 @@ BOOL LLPanelProfileFirstLife::postBuild() mSaveChanges->setCommitCallback([this](LLUICtrl*, void*) { onSaveDescriptionChanges(); }, nullptr); mDiscardChanges->setCommitCallback([this](LLUICtrl*, void*) { onDiscardDescriptionChanges(); }, nullptr); mDescriptionEdit->setKeystrokeCallback([this](LLTextEditor* caller) { onSetDescriptionDirty(); }); - mPicture->setMouseUpCallback([this](LLUICtrl*, S32 x, S32 y, MASK mask) { onShowPhoto(); }); // Make "first life" picture clickable + mPicture->setCommitCallback(boost::bind(&LLPanelProfileFirstLife::onFirstLifePicChanged, this)); // Allow proper texture swatch handling return TRUE; } @@ -2540,6 +2559,9 @@ void LLPanelProfileFirstLife::onOpen(const LLSD& key) mDescriptionEdit->setTabStop(FALSE); } + // Allow proper texture swatch handling + mPicture->setEnabled(getSelfProfile()); + resetData(); } @@ -2566,22 +2588,6 @@ void LLPanelProfileFirstLife::setProfileImageUploaded(const LLUUID &image_asset_ mPicture->setValue(image_asset_id); mImageId = image_asset_id; - // Make "first life" picture clickable - LLFloater *floater = mFloaterProfileTextureHandle.get(); - if (floater) - { - LLFloaterProfileTexture * texture_view = dynamic_cast(floater); - if (mImageId.notNull()) - { - texture_view->loadAsset(mImageId); - } - else - { - texture_view->resetAsset(); - } - } - // Make "first life" picture clickable - setProfileImageUploading(false); } @@ -2680,51 +2686,12 @@ void LLPanelProfileFirstLife::onRemovePhoto() } } -// Make "first life" picture clickable -void LLPanelProfileFirstLife::onShowPhoto() +// Allow proper texture swatch handling +void LLPanelProfileFirstLife::onFirstLifePicChanged() { - if (!getIsLoaded()) - { - return; - } - - LLFloater *floater = mFloaterProfileTextureHandle.get(); - if (!floater) - { - LLFloater* parent_floater = gFloaterView->getParentFloater(this); - if (parent_floater) - { - LLFloaterProfileTexture * texture_view = new LLFloaterProfileTexture(parent_floater); - mFloaterProfileTextureHandle = texture_view->getHandle(); - if (mImageId.notNull()) - { - texture_view->loadAsset(mImageId); - } - else - { - texture_view->resetAsset(); - } - texture_view->openFloater(); - texture_view->setVisibleAndFrontmost(TRUE); - parent_floater->addDependentFloater(mFloaterProfileTextureHandle); - } - } - else // already open - { - LLFloaterProfileTexture * texture_view = dynamic_cast(floater); - texture_view->setMinimized(FALSE); - texture_view->setVisibleAndFrontmost(TRUE); - if (mImageId.notNull()) - { - texture_view->loadAsset(mImageId); - } - else - { - texture_view->resetAsset(); - } - } + onCommitPhoto(mPicture->getImageAssetID()); } -// Make "first life" picture clickable +// void LLPanelProfileFirstLife::onCommitPhoto(const LLUUID& id) { @@ -2751,22 +2718,6 @@ void LLPanelProfileFirstLife::onCommitPhoto(const LLUUID& id) mPicture->setValue("Generic_Person_Large"); } - // Make "first life" picture clickable - LLFloater *floater = mFloaterProfileTextureHandle.get(); - if (floater) - { - LLFloaterProfileTexture * texture_view = dynamic_cast(floater); - if (mImageId == LLUUID::null) - { - texture_view->resetAsset(); - } - else - { - texture_view->loadAsset(mImageId); - } - } - // Make "first life" picture clickable - mRemovePhoto->setEnabled(mImageId.notNull()); } else diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 1ff9babe8c..691fcaae7a 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -201,6 +201,7 @@ private: void onShowAgentPermissionsDialog(); void onShowAgentProfileTexture(); void onShowTexturePicker(); + void onSecondLifePicChanged(); // Allow proper texture swatch handling void onCommitProfileImage(const LLUUID& id); // Fix LL UI/UX design accident @@ -217,7 +218,10 @@ private: //LLComboBox* mShowInSearchCombo; LLCheckBoxCtrl* mShowInSearchCheckbox; // - LLIconCtrl* mSecondLifePic; + // Allow proper texture swatch handling + // LLIconCtrl* mSecondLifePic; + LLTextureCtrl* mSecondLifePic; + // LLPanel* mSecondLifePicLayout; LLTextEditor* mDescriptionEdit; //LLMenuButton* mAgentActionMenuButton; // Fix LL UI/UX design accident @@ -341,6 +345,7 @@ protected: void onUploadPhoto(); void onChangePhoto(); void onRemovePhoto(); + void onFirstLifePicChanged(); // Allow proper texture swatch handling void onCommitPhoto(const LLUUID& id); void setDescriptionText(const std::string &text); void onSetDescriptionDirty(); @@ -348,7 +353,10 @@ protected: void onDiscardDescriptionChanges(); LLTextEditor* mDescriptionEdit; - LLIconCtrl* mPicture; + // Allow proper texture swatch handling + // LLIconCtrl* mPicture; + LLTextureCtrl* mPicture; + // LLButton* mUploadPhoto; LLButton* mChangePhoto; LLButton* mRemovePhoto; @@ -360,13 +368,6 @@ protected: std::string mCurrentDescription; LLUUID mImageId; bool mHasUnsavedChanges; - -// Make "first life" picture clickable -private: - LLHandle mFloaterProfileTextureHandle; - void onShowPhoto(); -// Make "first life" picture clickable - }; /** diff --git a/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml b/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml index 0263e76698..f535eb10a7 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml @@ -24,9 +24,8 @@ layout="topleft" visible="false" /> - - + layout="topleft" /> - + layout="topleft" />