From 1c170381aea21cfd75d7b8789374f04f3a46d408 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 4 May 2024 01:50:50 +0300 Subject: viewer#1300 Update Inventory Settings --- indra/llui/llfolderviewitem.cpp | 23 ++- indra/llui/llfolderviewitem.h | 2 + indra/newview/app_settings/settings.xml | 33 ++++ indra/newview/llfloaterinventorysettings.cpp | 23 ++- indra/newview/llfloaterinventorysettings.h | 5 + indra/newview/llinventorybridge.cpp | 3 +- indra/newview/skins/default/colors.xml | 3 + .../skins/default/textures/icons/Icon_Pointer.png | Bin 0 -> 294 bytes indra/newview/skins/default/textures/textures.xml | 1 + .../default/xui/en/floater_inventory_settings.xml | 168 +++++++++++++++++---- 10 files changed, 229 insertions(+), 32 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Icon_Pointer.png 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 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 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 @@ Value 0 + InventoryFavoritesUseStar + + Comment + Show star near favorited items in inventory + Persist + 0 + Type + Boolean + Value + 1 + + InventoryFavoritesColorText + + Comment + render favorite items using InventoryFavoriteText as color + Persist + 0 + Type + Boolean + Value + 1 + + InventoryAddAttachmentBehavior + + Comment + Defines behavior when hitting return on an inventory item + Persist + 0 + Type + Boolean + Value + 0 + StatsReportMaxDuration Comment 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("ok_btn")->setCommitCallback(boost::bind(&LLFloater::closeFloater, this, false)); + getChild("favorites_color")->setCommitCallback(boost::bind(&LLFloaterInventorySettings::updateColorSwatch, this)); return TRUE; } +void LLFloaterInventorySettings::updateColorSwatch() +{ + bool val = getChild("favorites_color")->getEnabled(); + getChild("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 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 @@ -453,6 +453,9 @@ + diff --git a/indra/newview/skins/default/textures/icons/Icon_Pointer.png b/indra/newview/skins/default/textures/icons/Icon_Pointer.png new file mode 100644 index 0000000000..021942a8aa Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Icon_Pointer.png differ 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 + 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"> + Clicking on "Show in inventory" or "Find original" @@ -146,10 +156,10 @@ font="SansSerifMedium" left="60" width="300" - height="45" + height="44" name="find_original_settings"> -