summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2011-10-14 18:25:30 -0700
committerRichard Nelson <richard@lindenlab.com>2011-10-14 18:25:30 -0700
commit0976964f8315aab5879678f07318267b6887ed95 (patch)
tree4d9f82393756de80880d5708a2226f022db11c5a /indra/llui
parentcf98cdf69f481dd473363d4a80a80f27e96f87e8 (diff)
EXP-1336 FIX Move Notifications to upper right
also made toolbar buttons not trigger if enabled callback returns false
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltoolbar.cpp14
-rw-r--r--indra/llui/lltoolbar.h4
2 files changed, 13 insertions, 5 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 7fcd1da7b1..bd2b55c105 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -668,6 +668,7 @@ void LLToolBar::draw()
if (command && btn->mIsEnabledSignal)
{
const bool button_command_enabled = (*btn->mIsEnabledSignal)(btn, command->isEnabledParameters());
+ // TODO: make button appear disabled but have it still respond to drag and drop
btn->setEnabled(button_command_enabled);
}
@@ -941,6 +942,16 @@ void LLToolBarButton::onMouseCaptureLost()
mIsDragged = false;
}
+void LLToolBarButton::onCommit()
+{
+ LLCommand* command = LLCommandManager::instance().getCommand(mId);
+
+ if (!mIsEnabledSignal || (*mIsEnabledSignal)(this, command->isEnabledParameters()))
+ {
+ LLButton::onCommit();
+ }
+}
+
void LLToolBarButton::reshape(S32 width, S32 height, BOOL called_from_parent)
{
LLButton::reshape(mWidthRange.clamp(width), height, called_from_parent);
@@ -967,6 +978,3 @@ const std::string LLToolBarButton::getToolTip() const
-
-
-
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 3be252298d..5fac613f50 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -72,9 +72,9 @@ public:
void onMouseEnter(S32 x, S32 y, MASK mask);
void onMouseCaptureLost();
- virtual const std::string getToolTip() const;
-
+ void onCommit();
+ virtual const std::string getToolTip() const;
private:
LLCommandId mId;