From 4f92a3222efac36b2355550ed55ca0a2fcb9591d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 3 Jun 2022 21:24:09 +0300 Subject: SL-15312 Updated picks's layout - better emphasis onto saving - better resize logic - ability to discard changes --- indra/newview/llpanelprofilepicks.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelprofilepicks.cpp') diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index 69f6ac0407..4b2d32ac60 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -549,6 +549,8 @@ BOOL LLPanelProfilePick::postBuild() mPickName = getChild("pick_name"); mPickDescription = getChild("pick_desc"); mSaveButton = getChild("save_changes_btn"); + mCreateButton = getChild("create_changes_btn"); + mCancelButton = getChild("cancel_changes_btn"); mSetCurrentLocationButton = getChild("set_to_curr_location_btn"); mSnapshotCtrl = getChild("pick_snapshot"); @@ -558,6 +560,8 @@ BOOL LLPanelProfilePick::postBuild() childSetAction("show_on_map_btn", boost::bind(&LLPanelProfilePick::onClickMap, this)); mSaveButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSave, this)); + mCreateButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSave, this)); + mCancelButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickCancel, this)); mSetCurrentLocationButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSetLocation, this)); mPickName->setKeystrokeCallback(boost::bind(&LLPanelProfilePick::onPickChanged, this, _1), NULL); @@ -676,8 +680,11 @@ void LLPanelProfilePick::onClickTeleport() void LLPanelProfilePick::enableSaveButton(BOOL enable) { - mSaveButton->setEnabled(enable); - mSaveButton->setVisible(enable); + childSetVisible("save_changes_lp", enable); + + childSetVisible("save_btn_lp", enable && !mNewPick); + childSetVisible("create_btn_lp", enable && mNewPick); + childSetVisible("cancel_btn_lp", enable && !mNewPick); } void LLPanelProfilePick::onSnapshotChanged() @@ -752,6 +759,13 @@ void LLPanelProfilePick::onClickSave() mLocationChanged = false; } +void LLPanelProfilePick::onClickCancel() +{ + LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(getAvatarId(), getPickId()); + mLocationChanged = false; + enableSaveButton(FALSE); +} + std::string LLPanelProfilePick::getLocationNotice() { static const std::string notice = getString("location_notice"); -- cgit v1.2.3