Commit e9a5646a authored by NiranV's avatar NiranV

Added: Ability to define a label (title) for separators.

parent 8448b6f7
......@@ -313,9 +313,9 @@ LLScrollListItem* LLComboBox::add(const std::string& name, LLSD value, EAddPosit
return item;
}
LLScrollListItem* LLComboBox::addSeparator(EAddPosition pos)
LLScrollListItem* LLComboBox::addSeparator(EAddPosition pos, std::string label)
{
return mList->addSeparator(pos);
return mList->addSeparator(pos, label);
}
void LLComboBox::sortByName(BOOL ascending)
......
......@@ -134,7 +134,7 @@ class LLComboBox
LLScrollListItem* add(const std::string& name, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE);
LLScrollListItem* add(const std::string& name, void* userdata, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE);
LLScrollListItem* add(const std::string& name, LLSD value, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE);
LLScrollListItem* addSeparator(EAddPosition pos = ADD_BOTTOM);
LLScrollListItem* addSeparator(EAddPosition pos = ADD_BOTTOM, std::string label = "");
BOOL remove( S32 index ); // remove item by index, return TRUE if found and removed
void removeall() { clearRows(); }
bool itemExists(const std::string& name);
......
......@@ -1232,14 +1232,15 @@ void LLScrollListCtrl::setCommentText(const std::string& comment_text)
getChild<LLTextBox>("comment_text")->setValue(comment_text);
}
LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos)
//BD - UI Improvements
LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos, std::string label)
{
LLScrollListItem::Params separator_params;
separator_params.enabled(false);
LLScrollListCell::Params column_params;
column_params.type = "icon";
column_params.value = "menu_separator";
column_params.color = LLColor4(0.f, 0.f, 0.f, 0.7f);
column_params.type = label == "menu_separator" ? "icon" : "text";
column_params.value = label;
column_params.color = LLColor4(0.3f, 0.63f, 0.97f, 1.0f);
column_params.font_halign = LLFontGL::HCENTER;
separator_params.columns.add(column_params);
return addRow( separator_params, pos );
......
......@@ -245,7 +245,7 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler,
S32 getItemIndex( const LLUUID& item_id ) const;
void setCommentText( const std::string& comment_text);
LLScrollListItem* addSeparator(EAddPosition pos);
LLScrollListItem* addSeparator(EAddPosition pos, std::string label = "menu_separator");
// "Simple" interface: use this when you're creating a list that contains only unique strings, only
// one of which can be selected at a time.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment