summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-05-24 00:35:22 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-05-24 00:35:22 +0300
commit23d310436a664f7303d627095f8972de6cb17334 (patch)
treef3422a3c204485293d33ecd5c5012a09eba7e0d6 /indra/newview
parentf15ad900e45bef02783f209e5b8ba5137447ab27 (diff)
SL-15312 Change permission status to be icons instead of buttons
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelprofile.cpp47
-rw-r--r--indra/newview/llpanelprofile.h9
-rw-r--r--indra/newview/skins/default/xui/en/panel_profile_secondlife.xml85
3 files changed, 95 insertions, 46 deletions
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<LLMenuButton>("agent_actions_menu");
mSaveDescriptionChanges = getChild<LLButton>("save_description_changes");
mDiscardDescriptionChanges = getChild<LLButton>("discard_description_changes");
- mSeeOnlineToggle = getChild<LLButton>("allow_to_see_online");
- mSeeOnMapToggle = getChild<LLButton>("allow_to_see_on_map");
- mEditObjectsToggle = getChild<LLButton>("allow_edit_my_objects");
+ mCanSeeOnlineIcon = getChild<LLIconCtrl>("can_see_online");
+ mCantSeeOnlineIcon = getChild<LLIconCtrl>("cant_see_online");
+ mCanSeeOnMapIcon = getChild<LLIconCtrl>("can_see_on_map");
+ mCantSeeOnMapIcon = getChild<LLIconCtrl>("cant_see_on_map");
+ mCanEditObjectsIcon = getChild<LLIconCtrl>("can_edit_objects");
+ mCantEditObjectsIcon = getChild<LLIconCtrl>("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<LLButton>("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<LLFloater> 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">
- <!--Todo: progress indicator-->
- <!--Todo: Waits for icons. Current behavior is suboptimal and is a placeholder-->
- <button
- name="allow_to_see_online"
- image_pressed="Profile_Perm_Online_Disabled"
- image_pressed_selected="Profile_Perm_Online_Enabled"
- image_unselected="Profile_Perm_Online_Disabled"
- image_selected="Profile_Perm_Online_Enabled"
+ <icon
+ tool_tip="Can see online status"
+ mouse_opaque="true"
+ name="can_see_online"
+ image_name="Profile_Perm_Online_Enabled"
+ layout="topleft"
+ follows="left|top"
+ top="0"
+ left="0"
+ height="24"
+ width="24"
+ left_pad="2" />
+
+ <icon
+ tool_tip="Can not see online status"
+ mouse_opaque="true"
+ name="cant_see_online"
+ image_name="Profile_Perm_Online_Disabled"
layout="topleft"
follows="left|top"
top="0"
left="0"
+ height="24"
width="24"
- height="24"/>
+ left_pad="2" />
- <button
- name="allow_to_see_on_map"
- image_pressed="Profile_Perm_Find_Disabled"
- image_pressed_selected="Profile_Perm_Find_Enabled"
- image_unselected="Profile_Perm_Find_Disabled"
- image_selected="Profile_Perm_Find_Enabled"
+ <icon
+ tool_tip="Can see on map"
+ mouse_opaque="true"
+ name="can_see_on_map"
+ image_name="Profile_Perm_Find_Enabled"
layout="topleft"
follows="left|top"
top_pad="7"
left="0"
+ height="24"
width="24"
- height="24"/>
+ left_pad="2" />
- <button
- name="allow_edit_my_objects"
- image_pressed="Profile_Perm_Objects_Disabled"
- image_pressed_selected="Profile_Perm_Objects_Enabled"
- image_unselected="Profile_Perm_Objects_Disabled"
- image_selected="Profile_Perm_Objects_Enabled"
+ <icon
+ tool_tip="Can not see on map"
+ mouse_opaque="true"
+ name="cant_see_on_map"
+ image_name="Profile_Perm_Find_Disabled"
+ layout="topleft"
+ follows="left|top"
+ top_delta="0"
+ left="0"
+ height="24"
+ width="24"
+ left_pad="2" />
+
+ <icon
+ tool_tip="Can edit my objects"
+ mouse_opaque="true"
+ name="can_edit_objects"
+ image_name="Profile_Perm_Objects_Enabled"
layout="topleft"
follows="left|top"
top_pad="7"
left="0"
+ height="24"
width="24"
- height="24"/>
-
+ left_pad="2" />
+
+ <icon
+ tool_tip="Can not edit my objects"
+ mouse_opaque="true"
+ name="cant_edit_objects"
+ image_name="Profile_Perm_Objects_Disabled"
+ layout="topleft"
+ follows="left|top"
+ top_delta="0"
+ left="0"
+ height="24"
+ width="24"
+ left_pad="2" />
+
</layout_panel>
</layout_stack>