summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/lltextbox.cpp5
-rw-r--r--indra/llui/lltextbox.h3
-rw-r--r--indra/newview/llfloaterpreference.cpp11
-rw-r--r--indra/newview/llfloaterpreference.h1
4 files changed, 18 insertions, 2 deletions
diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp
index d175204e6d..01fe82e45d 100644
--- a/indra/llui/lltextbox.cpp
+++ b/indra/llui/lltextbox.cpp
@@ -43,7 +43,8 @@ template class LLTextBox* LLView::getChild<class LLTextBox>(
LLTextBox::LLTextBox(const LLTextBox::Params& p)
: LLTextBase(p),
- mClickedCallback(NULL)
+ mClickedCallback(NULL),
+ mShowCursorHand(true)
{}
LLTextBox::~LLTextBox()
@@ -103,7 +104,7 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask)
BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask)
{
BOOL handled = LLTextBase::handleHover(x, y, mask);
- if (!handled && mClickedCallback)
+ if (!handled && mClickedCallback && mShowCursorHand)
{
// Clickable text boxes change the cursor to a hand
LLUI::getWindow()->setCursor(UI_CURSOR_HAND);
diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h
index 071e18c638..061d2dd23d 100644
--- a/indra/llui/lltextbox.h
+++ b/indra/llui/lltextbox.h
@@ -68,11 +68,14 @@ public:
/*virtual*/ LLSD getValue() const;
/*virtual*/ BOOL setTextArg( const std::string& key, const LLStringExplicit& text );
+ void setShowCursorHand(bool show_cursor) { mShowCursorHand = show_cursor; }
+
protected:
void onUrlLabelUpdated(const std::string &url, const std::string &label);
LLUIString mText;
callback_t mClickedCallback;
+ bool mShowCursorHand;
};
// Build time optimization, generate once in .cpp file
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 7aff9fb586..f2e7058098 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -2329,6 +2329,11 @@ BOOL LLPanelPreference::postBuild()
bool show_favorites_at_login = LLPanelLogin::getShowFavorites();
getChild<LLCheckBoxCtrl>("favorites_on_login_check")->setValue(show_favorites_at_login);
}
+ if (hasChild("mute_chb_label", TRUE))
+ {
+ getChild<LLTextBox>("mute_chb_label")->setShowCursorHand(false);
+ getChild<LLTextBox>("mute_chb_label")->setClickedCallback(boost::bind(&toggleMuteWhenMinimized));
+ }
//////////////////////PanelAdvanced ///////////////////
if (hasChild("modifier_combo", TRUE))
@@ -2438,6 +2443,12 @@ void LLPanelPreference::handleFavoritesOnLoginChanged(LLUICtrl* checkbox, const
}
}
+void LLPanelPreference::toggleMuteWhenMinimized()
+{
+ std::string mute("MuteWhenMinimized");
+ gSavedSettings.setBOOL(mute, !gSavedSettings.getBOOL(mute));
+}
+
void LLPanelPreference::cancel()
{
for (control_values_map_t::iterator iter = mSavedValues.begin();
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index 8339a18296..a24b69ddbf 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -244,6 +244,7 @@ private:
//for "Show my Favorite Landmarks at Login"
static void handleFavoritesOnLoginChanged(LLUICtrl* checkbox, const LLSD& value);
+ static void toggleMuteWhenMinimized();
typedef std::map<std::string, LLColor4> string_color_map_t;
string_color_map_t mSavedColors;