summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-12-05 20:26:26 -0800
committerMerov Linden <merov@lindenlab.com>2012-12-05 20:26:26 -0800
commit42a60e6ca5f4179738fa9a7376d1e842bc058ac4 (patch)
tree8e1f74ebf472a2ea9ae74f4ea65409c418555218 /indra/llui
parent3a49beed0e96a797a6d663bcae5e932437ca3661 (diff)
parent32d7131b1034d03fa9d3fdde8b86ee9880bb4f67 (diff)
Pull merge from dev repo
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llbutton.cpp2
-rw-r--r--indra/llui/llflashtimer.cpp9
-rw-r--r--indra/llui/llflashtimer.h6
-rwxr-xr-xindra/llui/llfolderviewitem.cpp46
-rwxr-xr-xindra/llui/llfolderviewitem.h10
-rw-r--r--indra/llui/llnotifications.cpp3
-rw-r--r--indra/llui/llnotifications.h13
-rw-r--r--indra/llui/lltabcontainer.cpp11
-rw-r--r--indra/llui/lltabcontainer.h4
9 files changed, 61 insertions, 43 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 97547208ec..f82cdc64a9 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -286,7 +286,7 @@ LLButton::~LLButton()
if (mFlashingTimer)
{
- delete mFlashingTimer;
+ mFlashingTimer->unset();
}
}
diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp
index de7a4ab265..e49628acd5 100644
--- a/indra/llui/llflashtimer.cpp
+++ b/indra/llui/llflashtimer.cpp
@@ -35,6 +35,7 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
, mCurrentTickCount(0)
, mIsFlashingInProgress(false)
, mIsCurrentlyHighlighted(false)
+ , mUnset(false)
{
mEventTimer.stop();
@@ -48,6 +49,12 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
}
}
+void LLFlashTimer::unset()
+{
+ mUnset = true;
+ mCallback = NULL;
+}
+
BOOL LLFlashTimer::tick()
{
mIsCurrentlyHighlighted = !mIsCurrentlyHighlighted;
@@ -62,7 +69,7 @@ BOOL LLFlashTimer::tick()
stopFlashing();
}
- return FALSE;
+ return mUnset;
}
void LLFlashTimer::startFlashing()
diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h
index 5c8860b097..c60f99a8ea 100644
--- a/indra/llui/llflashtimer.h
+++ b/indra/llui/llflashtimer.h
@@ -52,6 +52,11 @@ public:
bool isFlashingInProgress();
bool isCurrentlyHighlighted();
+ /*
+ * Use this instead of deleting this object.
+ * The next call to tick() will return true and that will destroy this object.
+ */
+ void unset();
private:
callback_t mCallback;
@@ -62,6 +67,7 @@ private:
S32 mCurrentTickCount;
bool mIsCurrentlyHighlighted;
bool mIsFlashingInProgress;
+ bool mUnset;
};
#endif /* LL_FLASHTIMER_H */
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 261f53d6b6..60a6d3e3ea 100755
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -47,16 +47,14 @@ static LLDefaultChildRegistry::Register<LLFolderViewItem> r("folder_view_item");
// statics
std::map<U8, LLFontGL*> LLFolderViewItem::sFonts; // map of styles to fonts
+bool LLFolderViewItem::sColorSetInitialized = false;
LLUIColor LLFolderViewItem::sFgColor;
LLUIColor LLFolderViewItem::sHighlightBgColor;
-LLUIColor LLFolderViewItem::sHighlightFgColor;
LLUIColor LLFolderViewItem::sFocusOutlineColor;
LLUIColor LLFolderViewItem::sMouseOverColor;
LLUIColor LLFolderViewItem::sFilterBGColor;
LLUIColor LLFolderViewItem::sFilterTextColor;
LLUIColor LLFolderViewItem::sSuffixColor;
-LLUIColor LLFolderViewItem::sLibraryColor;
-LLUIColor LLFolderViewItem::sLinkColor;
LLUIColor LLFolderViewItem::sSearchStatusColor;
// only integers can be initialized in header
@@ -106,6 +104,8 @@ LLFolderViewItem::Params::Params()
item_top_pad("item_top_pad"),
creation_date(),
allow_open("allow_open", true),
+ font_color("font_color"),
+ font_highlight_color("font_highlight_color"),
left_pad("left_pad", 0),
icon_pad("icon_pad", 0),
icon_width("icon_width", 0),
@@ -113,7 +113,7 @@ LLFolderViewItem::Params::Params()
text_pad_right("text_pad_right", 0),
arrow_size("arrow_size", 0),
max_folder_item_overlap("max_folder_item_overlap", 0)
-{}
+{ }
// Default constructor
LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
@@ -137,6 +137,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
mViewModelItem(p.listener),
mIsMouseOverTitle(false),
mAllowOpen(p.allow_open),
+ mFontColor(p.font_color),
+ mFontHighlightColor(p.font_highlight_color),
mLeftPad(p.left_pad),
mIconPad(p.icon_pad),
mIconWidth(p.icon_width),
@@ -145,17 +147,18 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
mArrowSize(p.arrow_size),
mMaxFolderItemOverlap(p.max_folder_item_overlap)
{
- sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
- sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
- sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE);
- sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE);
- sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE);
- sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE);
- sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", DEFAULT_WHITE);
- sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemColor", DEFAULT_WHITE);
- sLibraryColor = LLUIColorTable::instance().getColor("InventoryItemLibraryColor", DEFAULT_WHITE);
- sLinkColor = LLUIColorTable::instance().getColor("InventoryItemLinkColor", DEFAULT_WHITE);
- sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE);
+ if (!sColorSetInitialized)
+ {
+ sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
+ sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
+ sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE);
+ sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE);
+ sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE);
+ sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", DEFAULT_WHITE);
+ sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemColor", DEFAULT_WHITE);
+ sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE);
+ sColorSetInitialized = true;
+ }
if (mViewModelItem)
{
@@ -501,7 +504,7 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask )
// No handler needed for focus lost since this class has no
// state that depends on it.
gFocusMgr.setMouseCapture( this );
-
+
if (!mIsSelected)
{
if(mask & MASK_CONTROL)
@@ -518,6 +521,11 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask )
}
make_ui_sound("UISndClick");
}
+ //Just re-select the item since it is clicked without ctrl or shift
+ else if(!(mask & (MASK_CONTROL | MASK_SHIFT)))
+ {
+ getRoot()->setSelection(this, FALSE);
+ }
else
{
mSelectPending = TRUE;
@@ -780,10 +788,6 @@ void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeybo
void LLFolderViewItem::drawLabel(const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x)
{
- //TODO RN: implement this in terms of getColor()
- //if (highlight_link) color = sLinkColor;
- //if (gInventory.isObjectDescendentOf(getViewModelItem()->getUUID(), gInventory.getLibraryRootFolderID())) color = sLibraryColor;
-
//--------------------------------------------------------------------------------//
// Draw the actual label text
//
@@ -852,7 +856,7 @@ void LLFolderViewItem::draw()
box_image->draw(box_rect, sFilterBGColor);
}
- LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor;
+ LLColor4 color = (mIsSelected && filled) ? mFontHighlightColor : mFontColor;
drawLabel(font, text_left, y, color, right_x);
//--------------------------------------------------------------------------------//
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index 2e633a39e5..f33f21c8f8 100755
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -61,6 +61,9 @@ public:
Optional<time_t> creation_date;
Optional<bool> allow_open;
+ Optional<LLUIColor> font_color;
+ Optional<LLUIColor> font_highlight_color;
+
Optional<S32> left_pad,
icon_pad,
icon_width,
@@ -116,19 +119,20 @@ protected:
mIsMouseOverTitle,
mAllowOpen,
mSelectPending;
+
+ LLUIColor mFontColor;
+ LLUIColor mFontHighlightColor;
// For now assuming all colors are the same in derived classes.
+ static bool sColorSetInitialized;
static LLUIColor sFgColor;
static LLUIColor sFgDisabledColor;
static LLUIColor sHighlightBgColor;
- static LLUIColor sHighlightFgColor;
static LLUIColor sFocusOutlineColor;
static LLUIColor sMouseOverColor;
static LLUIColor sFilterBGColor;
static LLUIColor sFilterTextColor;
static LLUIColor sSuffixColor;
- static LLUIColor sLibraryColor;
- static LLUIColor sLinkColor;
static LLUIColor sSearchStatusColor;
// this is an internal method used for adding items to folders. A
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 66144671c9..fd9bfec203 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -475,7 +475,8 @@ LLNotification::LLNotification(const LLSDParamAdapter<Params>& p) :
mCancelled(false),
mIgnored(false),
mResponderObj(NULL),
- mId(p.id.isProvided() ? p.id : LLUUID::generateNewID())
+ mId(p.id.isProvided() ? p.id : LLUUID::generateNewID()),
+ mOfferFromAgent(p.offer_from_agent)
{
if (p.functor.name.isChosen())
{
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 088931858a..372b9ce46f 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -316,6 +316,7 @@ public:
expiry;
Optional<LLNotificationContext*> context;
Optional<void*> responder;
+ Optional<bool> offer_from_agent;
struct Functor : public LLInitParam::ChoiceBlock<Functor>
{
@@ -339,7 +340,8 @@ public:
payload("payload"),
form_elements("form"),
substitutions("substitutions"),
- expiry("expiry")
+ expiry("expiry"),
+ offer_from_agent("offer_from_agent", false)
{
time_stamp = LLDate::now();
responder = NULL;
@@ -352,7 +354,8 @@ public:
payload("payload"),
form_elements("form"),
substitutions("substitutions"),
- expiry("expiry")
+ expiry("expiry"),
+ offer_from_agent("offer_from_agent", false)
{
functor.name = _name;
name = _name;
@@ -378,6 +381,7 @@ private:
LLNotificationFormPtr mForm;
void* mResponderObj; // TODO - refactor/remove this field
LLNotificationResponderPtr mResponder;
+ bool mOfferFromAgent;
// a reference to the template
LLNotificationTemplatePtr mTemplatep;
@@ -513,6 +517,11 @@ public:
return mTimestamp;
}
+ bool getOfferFromAgent() const
+ {
+ return mOfferFromAgent;
+ }
+
std::string getType() const;
std::string getMessage() const;
std::string getFooter() const;
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 3c1dfc1184..91527c68f2 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1556,17 +1556,6 @@ BOOL LLTabContainer::setTab(S32 which)
return is_visible;
}
-
-void LLTabContainer::hideAllTabs()
-{
- setCurrentPanelIndex(-1);
- for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
- {
- (* iter)->mTabPanel->setVisible(FALSE);
- }
-}
-
-
BOOL LLTabContainer::selectTabByName(const std::string& name)
{
LLPanel* panel = getPanelByName(name);
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index a9cdf22b16..57862fc626 100644
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -192,7 +192,7 @@ public:
BOOL selectTabPanel( LLPanel* child );
BOOL selectTab(S32 which);
BOOL selectTabByName(const std::string& title);
- void hideAllTabs();
+ void setCurrentPanelIndex(S32 index) { mCurrentTabIdx = index; }
BOOL getTabPanelFlashing(LLPanel* child);
void setTabPanelFlashing(LLPanel* child, BOOL state);
@@ -243,8 +243,6 @@ private:
void setTabsHidden(BOOL hidden) { mTabsHidden = hidden; }
BOOL getTabsHidden() const { return mTabsHidden; }
-
- void setCurrentPanelIndex(S32 index) { mCurrentTabIdx = index; }
void scrollPrev() { mScrollPos = llmax(0, mScrollPos-1); } // No wrap
void scrollNext() { mScrollPos = llmin(mScrollPos+1, mMaxScrollPos); } // No wrap