diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 7a59e11d08..2f568025ab 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -122,10 +122,6 @@ LLFolderViewItem::Params::Params() // Inventory specials for_inventory("for_inventory", false) { - // User-definable item height in folder views - static LLCachedControl FolderViewItemHeight(*LLUI::sSettingGroups["config"], "FSFolderViewItemHeight"); - item_height = (S32)FolderViewItemHeight; - // } // Default constructor @@ -164,7 +160,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mArrowSize(p.arrow_size), mMaxFolderItemOverlap(p.max_folder_item_overlap), // Inventory specials - mForInventory(p.for_inventory) + mForInventory(p.for_inventory), + mItemTopPad(p.item_top_pad) { if (!sColorSetInitialized) { @@ -745,7 +742,9 @@ void LLFolderViewItem::drawOpenFolderArrow(const Params& default_params, const L //--------------------------------------------------------------------------------// // Draw open folder arrow // - const S32 TOP_PAD = default_params.item_top_pad; + // Inventory specials + //const S32 TOP_PAD = default_params.item_top_pad; + const S32 TOP_PAD = mItemTopPad; if (hasVisibleChildren() || !isFolderComplete()) { @@ -905,7 +904,9 @@ void LLFolderViewItem::draw() const BOOL filled = show_context || (getRoot() ? getRoot()->getParentPanel()->hasFocus() : FALSE); // If we have keyboard focus, draw selection filled const Params& default_params = LLUICtrlFactory::getDefaultParams(); - const S32 TOP_PAD = default_params.item_top_pad; + // Inventory specials + //const S32 TOP_PAD = default_params.item_top_pad; + const S32 TOP_PAD = mItemTopPad; const LLFontGL* font = getLabelFontForStyle(mLabelStyle); diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index 00a4856481..51d07769fc 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -135,6 +135,7 @@ protected: // Inventory specials bool mForInventory; + S32 mItemTopPad; // For now assuming all colors are the same in derived classes. static bool sColorSetInitialized; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index fc5665231c..c5f7a2a63e 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -211,6 +211,12 @@ LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) // Inventory specials p.for_inventory = true; + static LLCachedControl fsFolderViewItemHeight(*LLUI::sSettingGroups["config"], "FSFolderViewItemHeight"); + const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + p.item_height = fsFolderViewItemHeight; + p.item_top_pad = default_params.item_top_pad - (default_params.item_height - fsFolderViewItemHeight) / 2 - 1; + // + return LLUICtrlFactory::create(p); } @@ -857,6 +863,12 @@ LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * br // Inventory specials params.for_inventory = true; + static LLCachedControl fsFolderViewItemHeight(*LLUI::sSettingGroups["config"], "FSFolderViewItemHeight"); + const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + params.item_height = fsFolderViewItemHeight; + params.item_top_pad = default_params.item_top_pad - (default_params.item_height - fsFolderViewItemHeight) / 2 - 1; + // + return LLUICtrlFactory::create(params); } @@ -876,6 +888,12 @@ LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge // Inventory specials params.for_inventory = true; + + static LLCachedControl fsFolderViewItemHeight(*LLUI::sSettingGroups["config"], "FSFolderViewItemHeight"); + const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + params.item_height = fsFolderViewItemHeight; + params.item_top_pad = default_params.item_top_pad - (default_params.item_height - fsFolderViewItemHeight) / 2 - 1; + // return LLUICtrlFactory::create(params); } diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index cda4e06a91..86a69acc7e 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -77,6 +77,15 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge params.font_color = item_color; params.font_highlight_color = item_color; params.allow_drop = allow_drop; + + // Inventory specials + params.for_inventory = true; + + static LLCachedControl fsFolderViewItemHeight(*LLUI::sSettingGroups["config"], "FSFolderViewItemHeight"); + const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + params.item_height = fsFolderViewItemHeight; + params.item_top_pad = default_params.item_top_pad - (default_params.item_height - fsFolderViewItemHeight) / 2 - 1; + // return LLUICtrlFactory::create(params); } @@ -96,6 +105,15 @@ LLFolderViewItem * LLInboxInventoryPanel::createFolderViewItem(LLInvFVBridge * b params.font_color = item_color; params.font_highlight_color = item_color; + // Inventory specials + params.for_inventory = true; + + static LLCachedControl fsFolderViewItemHeight(*LLUI::sSettingGroups["config"], "FSFolderViewItemHeight"); + const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + params.item_height = fsFolderViewItemHeight; + params.item_top_pad = default_params.item_top_pad - (default_params.item_height - fsFolderViewItemHeight) / 2 - 1; + // + return LLUICtrlFactory::create(params); } diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 9b729a2e3c..f1dc79c7a6 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1736,6 +1736,12 @@ void LLPanelObjectInventory::reset() // Inventory specials p.for_inventory = true; + static LLCachedControl fsFolderViewItemHeight(*LLUI::sSettingGroups["config"], "FSFolderViewItemHeight"); + const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + p.item_height = fsFolderViewItemHeight; + p.item_top_pad = default_params.item_top_pad - (default_params.item_height - fsFolderViewItemHeight) / 2 - 1; + // + mFolders = LLUICtrlFactory::create(p); mFolders->setCallbackRegistrar(&mCommitCallbackRegistrar); @@ -1900,6 +1906,12 @@ void LLPanelObjectInventory::createFolderViews(LLInventoryObject* inventory_root // Inventory specials p.for_inventory = true; + static LLCachedControl fsFolderViewItemHeight(*LLUI::sSettingGroups["config"], "FSFolderViewItemHeight"); + const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + p.item_height = fsFolderViewItemHeight; + p.item_top_pad = default_params.item_top_pad - (default_params.item_height - fsFolderViewItemHeight) / 2 - 1; + // + LLFolderViewFolder* new_folder = LLUICtrlFactory::create(p); new_folder->addToFolder(mFolders); new_folder->toggleOpen(); @@ -1950,6 +1962,12 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li // Inventory specials p.for_inventory = true; + static LLCachedControl fsFolderViewItemHeight(*LLUI::sSettingGroups["config"], "FSFolderViewItemHeight"); + const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + p.item_height = fsFolderViewItemHeight; + p.item_top_pad = default_params.item_top_pad - (default_params.item_height - fsFolderViewItemHeight) / 2 - 1; + // + view = LLUICtrlFactory::create(p); child_categories.push_back(new obj_folder_pair(obj, (LLFolderViewFolder*)view)); @@ -1969,6 +1987,12 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li // Inventory specials params.for_inventory = true; + static LLCachedControl fsFolderViewItemHeight(*LLUI::sSettingGroups["config"], "FSFolderViewItemHeight"); + const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + params.item_height = fsFolderViewItemHeight; + params.item_top_pad = default_params.item_top_pad - (default_params.item_height - fsFolderViewItemHeight) / 2 - 1; + // + view = LLUICtrlFactory::create (params); } view->addToFolder(folder);