Rename box now properly aligned in the inventory panel. Commented out some ascent stuff pertaining to drag and drop because, well, it seemed weird.
This commit is contained in:
@@ -3580,7 +3580,7 @@ void LLAppViewer::badNetworkHandler()
|
|||||||
std::string grid_support_msg = "";
|
std::string grid_support_msg = "";
|
||||||
if (!gHippoGridManager->getCurrentGrid()->getSupportUrl().empty())
|
if (!gHippoGridManager->getCurrentGrid()->getSupportUrl().empty())
|
||||||
{
|
{
|
||||||
grid_support_msg = "\n\nOr visit the gird support page at: \n "
|
grid_support_msg = "\n\nOr visit the grid support page at: \n "
|
||||||
+ gHippoGridManager->getCurrentGrid()->getSupportUrl();
|
+ gHippoGridManager->getCurrentGrid()->getSupportUrl();
|
||||||
}
|
}
|
||||||
std::ostringstream message;
|
std::ostringstream message;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
///----------------------------------------------------------------------------
|
///----------------------------------------------------------------------------
|
||||||
|
|
||||||
const S32 RENAME_WIDTH_PAD = 4;
|
const S32 RENAME_WIDTH_PAD = 4;
|
||||||
const S32 RENAME_HEIGHT_PAD = 6;
|
const S32 RENAME_HEIGHT_PAD = 1;
|
||||||
const S32 AUTO_OPEN_STACK_DEPTH = 16;
|
const S32 AUTO_OPEN_STACK_DEPTH = 16;
|
||||||
const S32 MIN_ITEM_WIDTH_VISIBLE = LLFolderViewItem::ICON_WIDTH
|
const S32 MIN_ITEM_WIDTH_VISIBLE = LLFolderViewItem::ICON_WIDTH
|
||||||
+ LLFolderViewItem::ICON_PAD
|
+ LLFolderViewItem::ICON_PAD
|
||||||
@@ -89,6 +89,9 @@ const S32 MIN_ITEM_WIDTH_VISIBLE = LLFolderViewItem::ICON_WIDTH
|
|||||||
+ /*first few characters*/ 40;
|
+ /*first few characters*/ 40;
|
||||||
const S32 MINIMUM_RENAMER_WIDTH = 80;
|
const S32 MINIMUM_RENAMER_WIDTH = 80;
|
||||||
|
|
||||||
|
// *TODO: move in params in xml if necessary. Requires modification of LLFolderView & LLInventoryPanel Params.
|
||||||
|
const S32 STATUS_TEXT_HPAD = 6;
|
||||||
|
const S32 STATUS_TEXT_VPAD = 8;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SIGNAL_NO_KEYBOARD_FOCUS = 1,
|
SIGNAL_NO_KEYBOARD_FOCUS = 1,
|
||||||
@@ -102,30 +105,6 @@ void copy_selected_item(void* user_data);
|
|||||||
void open_selected_items(void* user_data);
|
void open_selected_items(void* user_data);
|
||||||
void properties_selected_items(void* user_data);
|
void properties_selected_items(void* user_data);
|
||||||
void paste_items(void* user_data);
|
void paste_items(void* user_data);
|
||||||
void renamer_focus_lost( LLFocusableElement* handler, void* user_data );
|
|
||||||
|
|
||||||
///----------------------------------------------------------------------------
|
|
||||||
/// Class LLFolderViewItem
|
|
||||||
///----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@@ -231,8 +210,9 @@ LLFolderView::LLFolderView( const std::string& name,
|
|||||||
mDragAndDropThisFrame(FALSE),
|
mDragAndDropThisFrame(FALSE),
|
||||||
mParentPanel(parent_view),
|
mParentPanel(parent_view),
|
||||||
mUseEllipses(FALSE),
|
mUseEllipses(FALSE),
|
||||||
|
mDraggingOverItem(NULL),
|
||||||
|
mStatusTextBox(NULL),
|
||||||
mSearchType(1)
|
mSearchType(1)
|
||||||
|
|
||||||
{
|
{
|
||||||
mRoot = this;
|
mRoot = this;
|
||||||
|
|
||||||
@@ -266,6 +246,16 @@ LLFolderView::LLFolderView( const std::string& name,
|
|||||||
mRenamer->setVisible(FALSE);
|
mRenamer->setVisible(FALSE);
|
||||||
addChild(mRenamer);
|
addChild(mRenamer);
|
||||||
|
|
||||||
|
LLFontGL* font = getLabelFontForStyle(mLabelStyle);
|
||||||
|
LLRect new_r = LLRect(rect.mLeft + ICON_PAD,
|
||||||
|
rect.mTop - TEXT_PAD,
|
||||||
|
rect.mRight,
|
||||||
|
rect.mTop - TEXT_PAD - llfloor(font->getLineHeight()));
|
||||||
|
mStatusTextBox = new LLTextBox(name, new_r, std::string(), font, false);
|
||||||
|
mStatusTextBox->setVisible(true);
|
||||||
|
mStatusTextBox->setHPad(STATUS_TEXT_HPAD);
|
||||||
|
mStatusTextBox->setVPad(STATUS_TEXT_VPAD);
|
||||||
|
mStatusTextBox->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
|
||||||
// make the popup menu available
|
// make the popup menu available
|
||||||
LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_inventory.xml", parent_view);
|
LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_inventory.xml", parent_view);
|
||||||
if (!menu)
|
if (!menu)
|
||||||
@@ -294,6 +284,7 @@ LLFolderView::~LLFolderView( void )
|
|||||||
mScrollContainer = NULL;
|
mScrollContainer = NULL;
|
||||||
mRenameItem = NULL;
|
mRenameItem = NULL;
|
||||||
mRenamer = NULL;
|
mRenamer = NULL;
|
||||||
|
mStatusTextBox = NULL;
|
||||||
|
|
||||||
mAutoOpenItems.removeAllNodes();
|
mAutoOpenItems.removeAllNodes();
|
||||||
gIdleCallbacks.deleteFunction(idle, this);
|
gIdleCallbacks.deleteFunction(idle, this);
|
||||||
@@ -523,12 +514,12 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(!mHasVisibleChildren)// is there any filtered items ?
|
if(!mHasVisibleChildren)// is there any filtered items ?
|
||||||
{
|
{
|
||||||
//Nope. We need to display status textbox, let's reserve some place for it
|
//Nope. We need to display status textbox, let's reserve some place for it
|
||||||
running_height = mStatusTextBox->getTextPixelHeight();
|
running_height = mStatusTextBox->getTextPixelHeight();
|
||||||
target_height = running_height;
|
target_height = running_height;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
mRunningHeight = running_height;
|
mRunningHeight = running_height;
|
||||||
LLRect scroll_rect = mScrollContainer->getContentWindowRect();
|
LLRect scroll_rect = mScrollContainer->getContentWindowRect();
|
||||||
@@ -961,20 +952,37 @@ void LLFolderView::draw()
|
|||||||
|| mFilter->getShowFolderState() == LLInventoryFilter::SHOW_ALL_FOLDERS)
|
|| mFilter->getShowFolderState() == LLInventoryFilter::SHOW_ALL_FOLDERS)
|
||||||
{
|
{
|
||||||
mStatusText.clear();
|
mStatusText.clear();
|
||||||
|
mStatusTextBox->setVisible( FALSE );
|
||||||
}
|
}
|
||||||
else if (mShowEmptyMessage)
|
else if (mShowEmptyMessage)
|
||||||
{
|
{
|
||||||
const LLFontGL* font = getLabelFontForStyle(mLabelStyle);
|
|
||||||
static LLCachedControl<LLColor4> sSearchStatusColor(gColors, "InventorySearchStatusColor", LLColor4::white );
|
static LLCachedControl<LLColor4> sSearchStatusColor(gColors, "InventorySearchStatusColor", LLColor4::white );
|
||||||
if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration())
|
if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration())
|
||||||
{
|
{
|
||||||
mStatusText = std::string("Searching..."); // *TODO:translate
|
mStatusText = std::string("Searching..."); // *TODO:translate
|
||||||
font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mStatusText = std::string("No matching items found in inventory."); // *TODO:translate
|
mStatusText = std::string("No matching items found in inventory."); // *TODO:translate
|
||||||
font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE );
|
}
|
||||||
|
mStatusTextBox->setWrappedText(mStatusText);
|
||||||
|
mStatusTextBox->setVisible( TRUE );
|
||||||
|
|
||||||
|
// firstly reshape message textbox with current size. This is necessary to
|
||||||
|
// LLTextBox::getTextPixelHeight works properly
|
||||||
|
const LLRect local_rect = getLocalRect();
|
||||||
|
mStatusTextBox->setShape(local_rect);
|
||||||
|
|
||||||
|
// get preferable text height...
|
||||||
|
S32 pixel_height = mStatusTextBox->getTextPixelHeight();
|
||||||
|
bool height_changed = local_rect.getHeight() != pixel_height;
|
||||||
|
if (height_changed)
|
||||||
|
{
|
||||||
|
// ... if it does not match current height, lets rearrange current view.
|
||||||
|
// This will indirectly call ::arrange and reshape of the status textbox.
|
||||||
|
// We should call this method to also notify parent about required rect.
|
||||||
|
// See EXT-7564, EXT-7047.
|
||||||
|
arrangeFromRoot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1581,10 +1589,26 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
|
|||||||
{
|
{
|
||||||
if (next == last_selected)
|
if (next == last_selected)
|
||||||
{
|
{
|
||||||
|
//special case for LLAccordionCtrl
|
||||||
|
if(notifyParent(LLSD().with("action","select_next")) > 0 )//message was processed
|
||||||
|
{
|
||||||
|
clearSelection();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
setSelection( next, FALSE, TRUE );
|
setSelection( next, FALSE, TRUE );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//special case for LLAccordionCtrl
|
||||||
|
if(notifyParent(LLSD().with("action","select_next")) > 0 )//message was processed
|
||||||
|
{
|
||||||
|
clearSelection();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
scrollToShowSelection();
|
scrollToShowSelection();
|
||||||
mSearchString.clear();
|
mSearchString.clear();
|
||||||
@@ -1629,6 +1653,13 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
|
|||||||
{
|
{
|
||||||
if (prev == this)
|
if (prev == this)
|
||||||
{
|
{
|
||||||
|
// If case we are in accordion tab notify parent to go to the previous accordion
|
||||||
|
if(notifyParent(LLSD().with("action","select_prev")) > 0 )//message was processed
|
||||||
|
{
|
||||||
|
clearSelection();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
setSelection( prev, FALSE, TRUE );
|
setSelection( prev, FALSE, TRUE );
|
||||||
@@ -1959,6 +1990,8 @@ void LLFolderView::deleteAllChildren()
|
|||||||
mScrollContainer = NULL;
|
mScrollContainer = NULL;
|
||||||
mRenameItem = NULL;
|
mRenameItem = NULL;
|
||||||
mRenamer = NULL;
|
mRenamer = NULL;
|
||||||
|
mStatusTextBox = NULL;
|
||||||
|
|
||||||
clearSelection();
|
clearSelection();
|
||||||
LLView::deleteAllChildren();
|
LLView::deleteAllChildren();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -331,6 +331,8 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static F32 sAutoOpenTime;
|
static F32 sAutoOpenTime;
|
||||||
|
LLTextBox* mStatusTextBox;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool sort_item_name(LLFolderViewItem* a, LLFolderViewItem* b);
|
bool sort_item_name(LLFolderViewItem* a, LLFolderViewItem* b);
|
||||||
|
|||||||
@@ -852,7 +852,6 @@ void LLTaskCategoryBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
|||||||
{
|
{
|
||||||
std::vector<std::string> items;
|
std::vector<std::string> items;
|
||||||
std::vector<std::string> disabled_items;
|
std::vector<std::string> disabled_items;
|
||||||
//items.push_back(std::string("Task Open")); // *TODO: Translate
|
|
||||||
hide_context_entries(menu, items, disabled_items);
|
hide_context_entries(menu, items, disabled_items);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -912,21 +911,17 @@ BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop,
|
|||||||
case DAD_GESTURE:
|
case DAD_GESTURE:
|
||||||
case DAD_CALLINGCARD:
|
case DAD_CALLINGCARD:
|
||||||
case DAD_MESH:
|
case DAD_MESH:
|
||||||
// *HACK: In order to resolve SL-22177, we need to block
|
|
||||||
// drags from notecards and objects onto other
|
|
||||||
// objects. uncomment the simpler version when we have
|
|
||||||
// that right.
|
|
||||||
accept = LLToolDragAndDrop::isInventoryDropAcceptable(object, (LLViewerInventoryItem*)cargo_data);
|
accept = LLToolDragAndDrop::isInventoryDropAcceptable(object, (LLViewerInventoryItem*)cargo_data);
|
||||||
// <edit> testzone
|
// <edit> testzone
|
||||||
//if(LLToolDragAndDrop::isInventoryDropAcceptable(
|
//if(LLToolDragAndDrop::isInventoryDropAcceptable(
|
||||||
// object, (LLViewerInventoryItem*)cargo_data)
|
// object, (LLViewerInventoryItem*)cargo_data)
|
||||||
if(object->permModify()
|
/*if(object->permModify()
|
||||||
// </edit>
|
// </edit>
|
||||||
&& (LLToolDragAndDrop::SOURCE_WORLD != LLToolDragAndDrop::getInstance()->getSource())
|
&& (LLToolDragAndDrop::SOURCE_WORLD != LLToolDragAndDrop::getInstance()->getSource())
|
||||||
&& (LLToolDragAndDrop::SOURCE_NOTECARD != LLToolDragAndDrop::getInstance()->getSource()))
|
&& (LLToolDragAndDrop::SOURCE_NOTECARD != LLToolDragAndDrop::getInstance()->getSource()))
|
||||||
{
|
{
|
||||||
accept = TRUE;
|
accept = TRUE;
|
||||||
}
|
}*/
|
||||||
if(accept && drop)
|
if(accept && drop)
|
||||||
{
|
{
|
||||||
LLToolDragAndDrop::dropInventory(object,
|
LLToolDragAndDrop::dropInventory(object,
|
||||||
|
|||||||
Reference in New Issue
Block a user