From 7c340079ef679fa4b459cbe2ec0404b3a9a911df Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 25 Nov 2009 10:22:39 +0000
Subject: [PATCH] more attempts to panelize the volume pulldown, but why won't
 it show?

---
 indra/newview/llstatusbar.cpp                    | 16 +++++++++++++---
 indra/newview/llstatusbar.h                      |  3 ++-
 .../skins/default/xui/en/panel_status_bar.xml    | 11 +++++++++++
 3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 8289930d97b..6178ca6da07 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -124,6 +124,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
 	mSGPacketLoss(NULL),
 	mBtnBuyCurrency(NULL),
 	mBtnVolume(NULL),
+	mPanelVolume(NULL),
 	mBalance(0),
 	mHealth(100),
 	mSquareMetersCredit(0),
@@ -159,6 +160,8 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
 	mBtnVolume = getChild<LLButton>( "volume_btn" );
 	mBtnVolume->setClickedCallback( onClickVolume, this );
 
+	mPanelVolume = getChild<LLPanel>( "volume_pulldown" );
+
 	gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2));
 
 	childSetAction("scriptout", onClickScriptDebug, this);
@@ -511,10 +514,17 @@ static void onClickVolume(void* data)
 	gSavedSettings.setBOOL("MuteAudio", !mute_audio);
 	
 	// toggle the master volume pull-down
+
 	//LLFloaterReg::showInstance("volume_pulldown"); //tmp
-	LLPanelVolumePulldown *foo=
-		new LLPanelVolumePulldown();
-	foo->setVisible(TRUE);
+	//LLPanelVolumePulldown *foo=
+		//new LLPanelVolumePulldown();
+	//LLPanel* container = getRootView();//->getChild<LLPanel>("nav_bar_container");
+	//container->addChild(foo);
+	LLStatusBar *sb = (LLStatusBar*)(data);
+	llassert_always(sb);
+	sb->mPanelVolume->setRect(LLRect(1,1,100,100));
+	sb->mPanelVolume->setVisible(TRUE);
+	sb->mPanelVolume->setEnabled(TRUE);
 }
 
 // sets the static variables necessary for the date
diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h
index 3ce35499615..d7641633848 100644
--- a/indra/newview/llstatusbar.h
+++ b/indra/newview/llstatusbar.h
@@ -87,6 +87,8 @@ class LLStatusBar
 	S32 getSquareMetersCommitted() const;
 	S32 getSquareMetersLeft() const;
 
+	LLPanel         *mPanelVolume;	
+
 private:
 	// simple method to setup the part that holds the date
 	void setupDate();
@@ -94,7 +96,6 @@ class LLStatusBar
 	void onVolumeChanged(const LLSD& newvalue);
 
 	static void onClickStatGraph(void* data);
-	
 
 private:
 	LLTextBox	*mTextHealth;
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index b1afe76500d..f1e8f7ebd7e 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -82,6 +82,17 @@
      name="volume_btn"
      tool_tip="Global Volume Control"
      width="16" />
+    <panel
+     class="panel_volume_pulldown"
+     filename="panel_volume_pulldown.xml"
+     follows="all"
+     height="533"
+     layout="topleft"
+     left="0"
+     name="volume_pulldown"
+     top="5"
+     visible="false"
+     width="313" />
     <text
      enabled="true"
      follows="right|bottom"
-- 
GitLab