diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-05-04 01:50:50 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-05-04 01:50:50 +0300 |
commit | 1c170381aea21cfd75d7b8789374f04f3a46d408 (patch) | |
tree | b1ec4c0b9749400157fcca0be1fc4a619bf22bd0 /indra | |
parent | db3e5afbfbbce73e8f8339e8b4f938f11023ca64 (diff) |
viewer#1300 Update Inventory Settings
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 23 | ||||
-rw-r--r-- | indra/llui/llfolderviewitem.h | 2 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 33 | ||||
-rw-r--r-- | indra/newview/llfloaterinventorysettings.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llfloaterinventorysettings.h | 5 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/colors.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/textures/icons/Icon_Pointer.png | bin | 0 -> 294 bytes | |||
-rw-r--r-- | indra/newview/skins/default/textures/textures.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_inventory_settings.xml | 168 |
10 files changed, 229 insertions, 32 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 682da226bd..b473b3b395 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -58,6 +58,7 @@ LLUIColor LLFolderViewItem::sFilterBGColor; LLUIColor LLFolderViewItem::sFilterTextColor; LLUIColor LLFolderViewItem::sSuffixColor; LLUIColor LLFolderViewItem::sSearchStatusColor; +LLUIColor LLFolderViewItem::sFavoriteColor; // only integers can be initialized in header const F32 LLFolderViewItem::FOLDER_CLOSE_TIME_CONSTANT = 0.02f; @@ -173,6 +174,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", DEFAULT_WHITE); sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemLinkColor", DEFAULT_WHITE); sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE); + sFavoriteColor = LLUIColorTable::instance().getColor("InventoryFavoriteColor", DEFAULT_WHITE); sColorSetInitialized = true; } @@ -764,6 +766,12 @@ void LLFolderViewItem::drawOpenFolderArrow(const Params& default_params, const L void LLFolderViewItem::drawFavoriteIcon(const Params& default_params, const LLUIColor& fg_color) { + static LLUICachedControl<bool> draw_star("InventoryFavoritesUseStar", true); + if (!draw_star) + { + return; + } + LLUIImage* favorite_image = NULL; if (mIsFavorite) { @@ -1019,7 +1027,20 @@ void LLFolderViewItem::draw() } } - LLColor4 color = (mIsSelected && filled) ? mFontHighlightColor : mFontColor; + static LLUICachedControl<bool> highlight_color("InventoryFavoritesColorText", true); + LLColor4 color; + if (mIsSelected && filled) + { + color = mFontHighlightColor; + } + else if (mIsFavorite && highlight_color) + { + color = sFavoriteColor; + } + else + { + color = mFontColor; + } if (isFadeItem()) { diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index fc19514615..462f703a9c 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -149,6 +149,8 @@ protected: static LLUIColor sFilterTextColor; static LLUIColor sSuffixColor; static LLUIColor sSearchStatusColor; + static LLUIColor sFavoriteColor; + // this is an internal method used for adding items to folders. A // no-op at this level, but reimplemented in derived classes. diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2f7c256b49..21afd37a35 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -17405,6 +17405,39 @@ <key>Value</key> <integer>0</integer> </map> + <key>InventoryFavoritesUseStar</key> + <map> + <key>Comment</key> + <string>Show star near favorited items in inventory</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>InventoryFavoritesColorText</key> + <map> + <key>Comment</key> + <string>render favorite items using InventoryFavoriteText as color</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>InventoryAddAttachmentBehavior</key> + <map> + <key>Comment</key> + <string>Defines behavior when hitting return on an inventory item</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>StatsReportMaxDuration</key> <map> <key>Comment</key> diff --git a/indra/newview/llfloaterinventorysettings.cpp b/indra/newview/llfloaterinventorysettings.cpp index 29d6e90a33..612953b6df 100644 --- a/indra/newview/llfloaterinventorysettings.cpp +++ b/indra/newview/llfloaterinventorysettings.cpp @@ -28,9 +28,13 @@ #include "llfloaterinventorysettings.h" +#include "llcolorswatch.h" + LLFloaterInventorySettings::LLFloaterInventorySettings(const LLSD& key) : LLFloater(key) { + mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", boost::bind(&LLFloaterInventorySettings::applyUIColor, this, _1, _2)); + mCommitCallbackRegistrar.add("ScriptPref.getUIColor", boost::bind(&LLFloaterInventorySettings::getUIColor, this, _1, _2)); } LLFloaterInventorySettings::~LLFloaterInventorySettings() @@ -38,7 +42,24 @@ LLFloaterInventorySettings::~LLFloaterInventorySettings() BOOL LLFloaterInventorySettings::postBuild() { - getChild<LLButton>("ok_btn")->setCommitCallback(boost::bind(&LLFloater::closeFloater, this, false)); + getChild<LLUICtrl>("favorites_color")->setCommitCallback(boost::bind(&LLFloaterInventorySettings::updateColorSwatch, this)); return TRUE; } +void LLFloaterInventorySettings::updateColorSwatch() +{ + bool val = getChild<LLUICtrl>("favorites_color")->getEnabled(); + getChild<LLUICtrl>("favorites_color")->setEnabled(val); +} + +void LLFloaterInventorySettings::applyUIColor(LLUICtrl* ctrl, const LLSD& param) +{ + LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue())); +} + +void LLFloaterInventorySettings::getUIColor(LLUICtrl* ctrl, const LLSD& param) +{ + LLColorSwatchCtrl* color_swatch = (LLColorSwatchCtrl*)ctrl; + color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString())); +} + diff --git a/indra/newview/llfloaterinventorysettings.h b/indra/newview/llfloaterinventorysettings.h index 50304276c7..87c61046e2 100644 --- a/indra/newview/llfloaterinventorysettings.h +++ b/indra/newview/llfloaterinventorysettings.h @@ -40,6 +40,11 @@ public: private: LLFloaterInventorySettings(const LLSD& key); ~LLFloaterInventorySettings(); + + void updateColorSwatch(); + + void applyUIColor(LLUICtrl* ctrl, const LLSD& param); + void getUIColor(LLUICtrl* ctrl, const LLSD& param); }; #endif diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 20b2e1334e..20d415cda9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -7851,7 +7851,8 @@ void LLObjectBridgeAction::attachOrDetach() } else { - LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding. + static LLCachedControl<bool> inventory_linking(gSavedSettings, "InventoryAddAttachmentBehavior", false); + LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, inventory_linking()); // Don't replace if adding. } } diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 92f63a1820..60d9a5da23 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -454,6 +454,9 @@ name="InventoryBackgroundColor" reference="DkGray2" /> <color + name="InventoryFavoriteColor" + reference="Yellow" /> + <color name="InventoryFocusOutlineColor" reference="White_25" /> <color diff --git a/indra/newview/skins/default/textures/icons/Icon_Pointer.png b/indra/newview/skins/default/textures/icons/Icon_Pointer.png Binary files differnew file mode 100644 index 0000000000..021942a8aa --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Icon_Pointer.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 7f3b9a8cee..c9dcaebeeb 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -907,4 +907,5 @@ with the same filename but different name <texture name="Single_Folder_Up" file_name="icons/single_folder_up.png" preload="true"/> <texture name="Icon_Color_Palette" file_name="icons/Icon_Color_Palette.png" preload="false"/> <texture name="Icon_Font_Size" file_name="icons/Icon_Font_Size.png" preload="false"/> + <texture name="Icon_Pointer" file_name="icons/Icon_Pointer.png" preload="false"/> </textures> diff --git a/indra/newview/skins/default/xui/en/floater_inventory_settings.xml b/indra/newview/skins/default/xui/en/floater_inventory_settings.xml index 156bba6c27..e027d7556f 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_settings.xml @@ -4,8 +4,8 @@ can_minimize="true" can_resize="false" save_rect="true" - height="370" - width="370" + height="460" + width="460" name="inventory_settings" title="INVENTORY SETTINGS"> <icon @@ -16,7 +16,7 @@ left="18" mouse_opaque="true" name="multi_folder_icon" - top="25" + top="20" width="18" /> <text type="string" @@ -40,10 +40,10 @@ font="SansSerifMedium" left="60" width="300" - height="70" + height="66" name="multi_double_click_setting"> <radio_item - height="20" + height="18" label="Expands & collapses folder" label_text.text_color="White" follows="left|top" @@ -51,24 +51,24 @@ name="0" width="200"/> <radio_item - height="20" + height="18" follows="left|top" label="Opens a new window" label_text.text_color="White" layout="topleft" left_delta="0" name="1" - top_pad ="5" + top_pad ="3" width="200" /> <radio_item - height="20" + height="18" follows="left|top" label="Switches view" label_text.text_color="White" layout="topleft" left_delta="0" name="2" - top_pad ="5" + top_pad ="3" width="200" /> </radio_group> <icon @@ -79,7 +79,7 @@ left="18" mouse_opaque="true" name="single_folder_icon" - top_pad="30" + top_pad="19" width="18" /> <text type="string" @@ -103,10 +103,10 @@ font="SansSerifMedium" left="60" width="300" - height="45" + height="44" name="single_double_click_setting"> <radio_item - height="20" + height="18" label="Stays in current window" label_text.text_color="White" follows="left|top" @@ -114,27 +114,37 @@ name="false" width="200"/> <radio_item - height="20" + height="18" follows="left|top" label="Opens a new window" label_text.text_color="White" layout="topleft" left_delta="0" name="true" - top_pad ="5" + top_pad ="3" width="200" /> </radio_group> + <icon + follows="top|left" + height="15" + image_name="Icon_Pointer" + layout="topleft" + left="20" + mouse_opaque="true" + name="single_folder_icon" + top_pad="20" + width="15" /> <text type="string" length="1" follows="left|top|right" height="13" layout="topleft" - left="48" + left_pad="13" name="find_original_txt" font="SansSerifMedium" text_color="White" - top_pad="30" + top_delta="1" width="300"> Clicking on "Show in inventory" or "Find original" </text> @@ -146,10 +156,10 @@ font="SansSerifMedium" left="60" width="300" - height="45" + height="44" name="find_original_settings"> <radio_item - height="20" + height="18" label="Shows item in main inventory window" label_text.text_color="White" follows="left|top" @@ -157,23 +167,123 @@ name="false" width="200"/> <radio_item - height="20" + height="18" follows="left|top" label="Opens a new single-folder window" label_text.text_color="White" layout="topleft" left_delta="0" name="true" - top_pad ="5" + top_pad ="3" width="200" /> </radio_group> - <button - height="20" - label="OK" - layout="topleft" - left="140" - bottom="-20" - name="ok_btn" - label_color="White" - width="90" /> + <icon + follows="top|left" + height="18" + image_name="Inv_Favorite_Star_Full" + layout="topleft" + left="18" + mouse_opaque="true" + name="favorites_icon" + top_pad="19" + width="18" /> + <text + type="string" + length="1" + layout="topleft" + follows="left|top|right" + height="13" + left_pad="12" + top_delta="2" + name="favorites_txt" + font="SansSerifMedium" + text_color="White" + width="300"> + Favorites + </text> + <check_box + control_name="InventoryFavoritesUseStar" + layout="topleft" + follows="left|top" + top_pad="8" + font="SansSerifMedium" + left="60" + width="300" + height="18" + label="Star" + name="favorite_star" + label_text.text_color="White" + initial_value="false"/> + <check_box + control_name="InventoryFavoritesColorText" + follows="left|top" + top_pad="5" + layout="topleft" + font="SansSerifMedium" + left="60" + width="150" + height="18" + label="Colored text" + name="favorites_color" + label_text.text_color="White" + initial_value="false"/> + <color_swatch + can_apply_immediately="true" + follows="left|top" + layout="topleft" + height="24" + label_height="0" + left_pad="40" + name="favorites_swatch" + top_delta="-6" + width="44" > + <color_swatch.init_callback + function="ScriptPref.getUIColor" + parameter="InventoryFavoriteColor" /> + <color_swatch.commit_callback + function="ScriptPref.applyUIColor" + parameter="InventoryFavoriteColor" /> + </color_swatch> + <icon + follows="top|left" + height="18" + image_name="Inv_Object" + layout="topleft" + left="18" + mouse_opaque="true" + name="obj_icon" + top_pad="19" + width="18" /> + <text + type="string" + length="1" + follows="left|top|right" + height="13" + layout="topleft" + left_pad="12" + top_delta="2" + name="single_folder_txt" + font="SansSerifMedium" + text_color="White" + width="300"> + Pressing return on an avatar attachment + </text> + <combo_box + control_name="InventoryAddAttachmentBehavior" + layout="topleft" + follows="left|top" + top_pad="8" + height="24" + left="60" + name="attach_combo" + width="300"> + <combo_box.item + label="Adds attachment (recommended)" + name="0" + value="0"/> + <combo_box.item + label="Wear (removes attachment at that point)" + name="1" + value="1"/> + </combo_box> </floater> |