SL-15312 Updated picks's layout

- better emphasis onto saving
- better resize logic
- ability to discard changes
master
Andrey Kleshchev 2022-06-03 21:24:09 +03:00
parent 3f51644466
commit 4f92a3222e
7 changed files with 278 additions and 330 deletions

View File

@ -1246,11 +1246,11 @@ void LLPanelProfileSecondLife::fillNameAgeData(const LLAvatarName &av_name, cons
args_name["[NAME]"] = av_name.getAccountName();
LLStringUtil::format(name_and_date, args_name);
getChild<LLUICtrl>("user_name_date")->setValue(name_and_date);
std::string register_date = getString("age_format");
LLSD args_age;
LLSD args_age;
args_age["[AGE]"] = LLDateUtil::ageFromDate(born_on, LLDate::now());
LLStringUtil::format(register_date, args_age);
LLStringUtil::format(register_date, args_age);
getChild<LLUICtrl>("user_age")->setValue(register_date);
}

View File

@ -549,6 +549,8 @@ BOOL LLPanelProfilePick::postBuild()
mPickName = getChild<LLLineEditor>("pick_name");
mPickDescription = getChild<LLTextEditor>("pick_desc");
mSaveButton = getChild<LLButton>("save_changes_btn");
mCreateButton = getChild<LLButton>("create_changes_btn");
mCancelButton = getChild<LLButton>("cancel_changes_btn");
mSetCurrentLocationButton = getChild<LLButton>("set_to_curr_location_btn");
mSnapshotCtrl = getChild<LLTextureCtrl>("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");

View File

@ -207,10 +207,15 @@ protected:
void onClickSetLocation();
/**
* Callback for "Save" button click
* Callback for "Save" and "Create" button click
*/
void onClickSave();
/**
* Callback for "Save" button click
*/
void onClickCancel();
std::string getLocationNotice();
/**
@ -225,6 +230,8 @@ protected:
LLTextEditor* mPickDescription;
LLButton* mSetCurrentLocationButton;
LLButton* mSaveButton;
LLButton* mCreateButton;
LLButton* mCancelButton;
LLVector3d mPosGlobal;
LLUUID mParcelId;

View File

@ -1,227 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
bg_opaque_color="DkGray2"
background_visible="true"
background_opaque="true"
follows="all"
height="571"
label="Picks"
layout="topleft"
left="8"
name="panel_picks"
top_pad="0"
width="313">
<string
name="no_picks"
value="No Picks" />
<string
name="no_classifieds"
value="No Classifieds" />
<text
type="string"
follows="all"
height="535"
layout="topleft"
left="6"
name="picks_panel_text"
wrap="true"
top="10"
width="313"/>
<accordion
fit_parent="true"
follows="all"
height="514"
layout="topleft"
left="0"
name="accordion"
top="0"
single_expansion="true"
width="313">
<accordion_tab
layout="topleft"
height="235"
min_height="150"
name="tab_picks"
title="Picks"
visible="false">
<flat_list_view
color="DkGray2"
follows="all"
layout="topleft"
left="0"
name="picks_list"
opaque="true"
top="0"
width="313" />
</accordion_tab>
<accordion_tab
layout="topleft"
height="235"
name="tab_classifieds"
title="Classifieds"
visible="false">
<flat_list_view
color="DkGray2"
follows="all"
layout="topleft"
left="0"
name="classifieds_list"
opaque="true"
top="0"
width="313" />
</accordion_tab>
</accordion>
<panel
bg_opaque_color="DkGray2"
background_visible="true"
background_opaque="true"
bevel_style="none"
enabled="false"
follows="bottom|left|right"
left="1"
height="27"
label="bottom_panel"
layout="topleft"
name="edit_panel"
top_pad="0"
width="312">
<layout_stack
follows="bottom|left|right"
height="23"
layout="bottomleft"
name="edit_panel_ls"
left="10"
orientation="horizontal"
top_pad="0"
width="293">
<layout_panel
follows="bottom|left"
height="18"
layout="bottomleft"
left="0"
name="gear_menu_btn"
auto_resize="true"
width="51">
<button
follows="bottom|left"
height="18"
image_disabled="AddItem_Disabled"
image_selected="AddItem_Press"
image_unselected="AddItem_Off"
layout="topleft"
left="0"
name="new_btn"
tool_tip="Create a new pick or classified at the current location"
top="0"
width="18" />
</layout_panel>
<layout_panel
follows="bottom|right"
height="18"
layout="bottomleft"
name="trash_btn_lp"
auto_resize="true"
width="18">
<button
follows="bottom|right"
height="18"
image_disabled="TrashItem_Disabled"
image_selected="TrashItem_Press"
image_unselected="TrashItem_Off"
layout="topleft"
name="trash_btn"
top="0"
width="18" />
</layout_panel>
</layout_stack>
</panel>
<panel
bg_opaque_color="DkGray"
background_visible="true"
background_opaque="true"
follows="bottom|left|right"
layout="topleft"
left="0"
height="30"
name="buttons_cucks"
top_pad="0"
width="313">
<layout_stack
follows="bottom|left|right"
height="28"
layout="topleft"
left="2"
name="buttons_cucks_ls"
orientation="horizontal"
top="0"
width="313">
<layout_panel
follows="bottom|left|right"
height="28"
layout="topleft"
left="0"
name="info_btn_lp"
auto_resize="true"
top="0"
width="95">
<button
enabled="false"
follows="top|left|right"
height="23"
label="Info"
layout="topleft"
name="info_btn"
tab_stop="false"
tool_tip="Show pick information"
width="95" />
</layout_panel>
<layout_panel
follows="bottom|left|right"
height="28"
layout="bottomleft"
left_pad="2"
name="teleport_btn_lp"
auto_resize="true"
width="117">
<button
enabled="false"
follows="top|left|right"
height="23"
label="Teleport"
layout="topleft"
name="teleport_btn"
tab_stop="false"
tool_tip="Teleport to the corresponding area"
width="117" />
</layout_panel>
<layout_panel
follows="bottom|left|right"
height="28"
layout="bottomleft"
name="show_on_map_btn_lp"
auto_resize="true"
left_pad="2"
width="90">
<button
enabled="false"
follows="top|left|right"
height="23"
label="Map"
layout="topleft"
name="show_on_map_btn"
tab_stop="false"
tool_tip="Show the corresponding area on the World Map"
width="88" />
</layout_panel>
</layout_stack>
</panel>
</panel>

View File

@ -746,7 +746,7 @@
<layout_panel
follows="all"
width="310"
height="40"
height="41"
layout="topleft"
name="publish_layout_panel"
auto_resize="false">
@ -757,13 +757,13 @@
layout="topleft"
left="0"
name="publish_emphasis_border"
top="4"
top="5"
width="310"/>
<layout_stack
name="publish_stack"
left="1"
right="-1"
top="10"
top="11"
height="25"
follows="left|top|right"
layout="topleft"

View File

@ -67,7 +67,7 @@
<tab_container
name="tab_classifieds"
top="0"
bottom="-2"
bottom="-1"
left="4"
right="-4"
follows="all"

View File

@ -14,98 +14,252 @@
>
(will update after save)
</panel.string>
<texture_picker
name="pick_snapshot"
top="10"
left="10"
height="161"
width="260"
follows="left|top"
layout="topleft"
fallback_image="default_land_picture.j2c"
/>
<line_editor
name="pick_name"
enabled="false"
top_pad="-15"
left="10"
height="20"
width="290"
follows="left|right|top"
layout="topleft"
/>
<text_editor
name="pick_desc"
trusted_content="false"
always_show_icons="true"
enabled="false"
top_pad="8"
left="10"
height="102"
width="290"
<layout_stack
name="main_pick_stack"
left="1"
right="-1"
top="0"
bottom="-1"
follows="all"
layout="topleft"
orientation="vertical"
animate="false">
<layout_panel
follows="all"
layout="topleft"
allow_html="true"
border_visible="true"
h_pad="4"
max_length="1023"
v_pad="3"
word_wrap="true"
/>
<line_editor
name="pick_location"
enabled="false"
left="10"
height="20"
width="290"
follows="left|right|bottom"
layout="topleft"
length="1"
type="string"
>
Loading...
</line_editor>
<button
name="teleport_btn"
label="Teleport"
bottom="-27"
left="10"
height="20"
width="100"
follows="left|bottom"
layout="topleft"
/>
<button
name="show_on_map_btn"
label="Show on Map"
bottom_delta="0"
left_pad="7"
height="20"
width="100"
follows="left|bottom"
layout="topleft"
/>
<button
name="set_to_curr_location_btn"
label="Set Location"
tool_tip="Set to Current Location"
bottom="-3"
left="10"
height="20"
width="100"
follows="left|bottom"
layout="topleft"
visible="false"
/>
<button
name="save_changes_btn"
label="Save Pick"
bottom_delta="0"
left_pad="7"
height="20"
width="100"
follows="left|bottom"
layout="topleft"
visible="false"
/>
layout="bottomleft"
left_pad="2"
name="main_pick_lp"
auto_resize="true"
height="314">
<texture_picker
name="pick_snapshot"
top="10"
left="10"
height="161"
width="260"
follows="left|top"
layout="topleft"
fallback_image="default_land_picture.j2c"
/>
<line_editor
name="pick_name"
enabled="false"
top_pad="-15"
left="10"
height="20"
width="290"
follows="left|right|top"
layout="topleft"
/>
<text_editor
name="pick_desc"
trusted_content="false"
always_show_icons="true"
enabled="false"
top_pad="8"
left="10"
height="102"
width="290"
follows="all"
layout="topleft"
allow_html="true"
border_visible="true"
h_pad="4"
max_length="1023"
v_pad="3"
word_wrap="true"
/>
<line_editor
name="pick_location"
enabled="false"
left="10"
height="23"
width="290"
follows="left|right|bottom"
layout="topleft"
length="1"
type="string"
>
Loading...
</line_editor>
</layout_panel>
<layout_panel
follows="all"
layout="bottomleft"
name="save_changes_lp"
auto_resize="false"
height="25">
<layout_stack
name="save_changes_stack"
left="1"
right="-1"
top="0"
height="25"
follows="left|top|right"
layout="topleft"
orientation="horizontal"
animate="false">
<layout_panel
follows="all"
layout="topleft"
name="util_resizer_left"
auto_resize="true"
width="1">
</layout_panel>
<layout_panel
follows="all"
layout="bottomleft"
left_pad="2"
name="map_btn_lp"
auto_resize="false"
width="100">
<button
name="show_on_map_btn"
label="Show on Map"
left="0"
top="0"
height="23"
width="100"
follows="left|top"
layout="topleft"
/>
</layout_panel>
<layout_panel
follows="all"
layout="bottomleft"
left_pad="2"
name="tp_btn_lp"
auto_resize="false"
width="100">
<button
name="teleport_btn"
label="Teleport"
left="0"
top="0"
height="23"
width="100"
follows="left|top"
layout="topleft"
/>
</layout_panel>
<layout_panel
follows="all"
layout="topleft"
name="util_resizer_right"
auto_resize="true"
width="1">
</layout_panel>
</layout_stack>
</layout_panel>
<layout_panel
follows="all"
layout="bottomleft"
name="save_changes_lp"
auto_resize="false"
height="41">
<view_border
bevel_style="none"
height="0"
follows="left|top|right"
layout="topleft"
left="0"
name="save_emphasis_border"
top="5"
width="310"/>
<layout_stack
name="save_changes_stack"
left="1"
right="-1"
top="11"
height="25"
follows="left|top|right"
layout="topleft"
orientation="horizontal"
animate="false">
<layout_panel
follows="all"
layout="topleft"
name="save_resizer_left"
auto_resize="true"
width="1">
</layout_panel>
<layout_panel
follows="all"
layout="bottomleft"
left_pad="2"
name="create_btn_lp"
auto_resize="false"
width="130">
<button
name="create_changes_btn"
label="Create Pick"
left="0"
top="0"
height="23"
width="130"
follows="left|top"
layout="topleft"
/>
</layout_panel>
<layout_panel
follows="all"
layout="bottomleft"
left_pad="2"
name="save_btn_lp"
auto_resize="false"
width="130">
<button
name="save_changes_btn"
label="Save Pick"
left="0"
top="0"
height="23"
width="130"
follows="left|top"
layout="topleft"
/>
</layout_panel>
<layout_panel
follows="all"
layout="bottomleft"
left_pad="2"
name="cancel_btn_lp"
auto_resize="false"
width="130">
<button
name="cancel_changes_btn"
label="Cancel"
left="0"
top="0"
height="23"
width="130"
follows="left|top"
layout="topleft"
/>
</layout_panel>
<layout_panel
follows="all"
layout="topleft"
name="save_resizer_right"
auto_resize="true"
width="1">
</layout_panel>
</layout_stack>
</layout_panel>
</layout_stack>
</panel>