From 23d310436a664f7303d627095f8972de6cb17334 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 24 May 2022 00:35:22 +0300 Subject: SL-15312 Change permission status to be icons instead of buttons --- indra/newview/llpanelprofile.cpp | 47 +++++++----- indra/newview/llpanelprofile.h | 9 ++- .../default/xui/en/panel_profile_secondlife.xml | 85 ++++++++++++++++------ 3 files changed, 95 insertions(+), 46 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 7a28dd11f8..38308f2498 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -828,9 +828,12 @@ BOOL LLPanelProfileSecondLife::postBuild() mAgentActionMenuButton = getChild("agent_actions_menu"); mSaveDescriptionChanges = getChild("save_description_changes"); mDiscardDescriptionChanges = getChild("discard_description_changes"); - mSeeOnlineToggle = getChild("allow_to_see_online"); - mSeeOnMapToggle = getChild("allow_to_see_on_map"); - mEditObjectsToggle = getChild("allow_edit_my_objects"); + mCanSeeOnlineIcon = getChild("can_see_online"); + mCantSeeOnlineIcon = getChild("cant_see_online"); + mCanSeeOnMapIcon = getChild("can_see_on_map"); + mCantSeeOnMapIcon = getChild("cant_see_on_map"); + mCanEditObjectsIcon = getChild("can_edit_objects"); + mCantEditObjectsIcon = getChild("cant_edit_objects"); mShowInSearchCombo->setCommitCallback([this](LLUICtrl*, void*) { onShowInSearchCallback(); }, nullptr); mGroupList->setDoubleClickCallback([this](LLUICtrl*, S32 x, S32 y, MASK mask) { LLPanelProfileSecondLife::openGroupProfile(); }); @@ -838,9 +841,6 @@ BOOL LLPanelProfileSecondLife::postBuild() mSaveDescriptionChanges->setCommitCallback([this](LLUICtrl*, void*) { onSaveDescriptionChanges(); }, nullptr); mDiscardDescriptionChanges->setCommitCallback([this](LLUICtrl*, void*) { onDiscardDescriptionChanges(); }, nullptr); mDescriptionEdit->setKeystrokeCallback([this](LLTextEditor* caller) { onSetDescriptionDirty(); }); - mSeeOnlineToggle->setMouseUpCallback([this](LLUICtrl*, const LLSD&) { onShowAgentPermissionsDialog(); }); - mSeeOnMapToggle->setMouseUpCallback([this](LLUICtrl*, const LLSD&) { onShowAgentPermissionsDialog(); }); - mEditObjectsToggle->setMouseUpCallback([this](LLUICtrl*, const LLSD&) { onShowAgentPermissionsDialog(); }); getChild("open_notes")->setCommitCallback([this](LLUICtrl*, void*) { onOpenNotes(); }, nullptr); @@ -933,9 +933,13 @@ void LLPanelProfileSecondLife::resetData() mGroups.clear(); mGroupList->setGroups(mGroups); - mSeeOnlineToggle->setToggleState(false); - mSeeOnMapToggle->setToggleState(false); - mEditObjectsToggle->setToggleState(false); + mCanSeeOnlineIcon->setVisible(false); + mCantSeeOnlineIcon->setVisible(true); + mCanSeeOnMapIcon->setVisible(false); + mCantSeeOnMapIcon->setVisible(true); + mCanEditObjectsIcon->setVisible(false); + mCantEditObjectsIcon->setVisible(true); + childSetVisible("permissions_panel", false); } @@ -1115,16 +1119,25 @@ void LLPanelProfileSecondLife::fillRightsData() if (relation) { S32 rights = relation->getRightsGrantedTo(); + bool can_see_online = LLRelationship::GRANT_ONLINE_STATUS & rights; + bool can_see_on_map = LLRelationship::GRANT_MAP_LOCATION & rights; + bool can_edit_objects = LLRelationship::GRANT_MODIFY_OBJECTS & rights; - mSeeOnlineToggle->setToggleState(LLRelationship::GRANT_ONLINE_STATUS & rights ? TRUE : FALSE); - mSeeOnMapToggle->setToggleState(LLRelationship::GRANT_MAP_LOCATION & rights ? TRUE : FALSE); - mEditObjectsToggle->setToggleState(LLRelationship::GRANT_MODIFY_OBJECTS & rights ? TRUE : FALSE); + mCanSeeOnlineIcon->setVisible(can_see_online); + mCantSeeOnlineIcon->setVisible(!can_see_online); + mCanSeeOnMapIcon->setVisible(can_see_on_map); + mCantSeeOnMapIcon->setVisible(!can_see_on_map); + mCanEditObjectsIcon->setVisible(can_edit_objects); + mCantEditObjectsIcon->setVisible(!can_edit_objects); } else { - mSeeOnlineToggle->setToggleState(false); - mSeeOnMapToggle->setToggleState(false); - mEditObjectsToggle->setToggleState(false); + mCanSeeOnlineIcon->setVisible(false); + mCantSeeOnlineIcon->setVisible(true); + mCanSeeOnMapIcon->setVisible(false); + mCantSeeOnMapIcon->setVisible(true); + mCanEditObjectsIcon->setVisible(false); + mCantEditObjectsIcon->setVisible(true); } childSetVisible("permissions_panel", NULL != relation); @@ -1614,10 +1627,6 @@ void LLPanelProfileSecondLife::onShowAgentPermissionsDialog() { floater->closeFloater(); } - - mSeeOnlineToggle->setFocus(false); - mSeeOnMapToggle->setFocus(false); - mEditObjectsToggle->setFocus(false); } void LLPanelProfileSecondLife::onOpenNotes() diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 0237a537de..b53a892ba6 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -193,9 +193,12 @@ private: LLMenuButton* mAgentActionMenuButton; LLButton* mSaveDescriptionChanges; LLButton* mDiscardDescriptionChanges; - LLButton* mSeeOnlineToggle; - LLButton* mSeeOnMapToggle; - LLButton* mEditObjectsToggle; + LLIconCtrl* mCanSeeOnlineIcon; + LLIconCtrl* mCantSeeOnlineIcon; + LLIconCtrl* mCanSeeOnMapIcon; + LLIconCtrl* mCantSeeOnMapIcon; + LLIconCtrl* mCanEditObjectsIcon; + LLIconCtrl* mCantEditObjectsIcon; LLHandle mFloaterPermissionsHandle; 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 c63bf835ff..56cf673e19 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml @@ -205,48 +205,85 @@ Account: [ACCTTYPE] width="26" auto_resize="false" user_resize="false"> - - -