From 397acefd336ccdba81d312a7dcd5e4fed5850edd Mon Sep 17 00:00:00 2001 From: Kadah Date: Sun, 20 Mar 2011 18:54:49 -0700 Subject: [PATCH] Added dynamic positioning to status bar parcel info, Fixed parcel info bleed thru on right-side controls, Reenabled status bar parcel info by default --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llstatusbar.cpp | 26 +++++++++++++++++++ indra/newview/llstatusbar.h | 9 +++++++ .../skins/default/xui/en/panel_status_bar.xml | 19 ++++++++++++-- 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index cd05837cbe..1144cecc47 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13216,7 +13216,7 @@ Change of this parameter will affect the layout of buttons in notification toast Type Boolean Value - 0 + 1 UseLegacyCursors diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index afe0482e99..61087c1e73 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -286,6 +286,7 @@ BOOL LLStatusBar::postBuild() mInfoBtn = getChild("place_info_btn"); mInfoBtn->setClickedCallback(boost::bind(&LLStatusBar::onInfoButtonClicked, this)); + mParcelInfoPanel = getChild("parcel_info_panel"); mParcelInfoText = getChild("parcel_info_text"); mDamageText = getChild("damage_text"); @@ -364,6 +365,11 @@ void LLStatusBar::refresh() { gMenuBarView->reshape(MENU_RIGHT, gMenuBarView->getRect().getHeight()); } + // also update the parcel info panel pos -KC + if ((MENU_RIGHT + MENU_PARCEL_SPACING) != mParcelInfoPanel->getRect().mLeft) + { + updateParcelPanel(); + } mSGBandwidth->setVisible(net_stats_visible); mSGPacketLoss->setVisible(net_stats_visible); @@ -703,6 +709,18 @@ void LLStatusBar::update() setParcelInfoText(new_text); updateParcelIcons(); + updateParcelPanel(); +} + +void LLStatusBar::updateParcelPanel() +{ + const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge(); + S32 left = MENU_RIGHT + MENU_PARCEL_SPACING; + LLRect rect = mParcelInfoPanel->getRect(); + rect.mRight = left + rect.getWidth(); + rect.mLeft = left; + + mParcelInfoPanel->setRect(rect); } void LLStatusBar::updateParcelInfoText() @@ -916,3 +934,11 @@ void LLStatusBar::onParcelWLClicked() { KCWindlightInterface::instance().onClickWLStatusButton(); } + +// hack -KC +void LLStatusBar::setBackgroundColor( const LLColor4& color ) +{ + LLPanel::setBackgroundColor(color); + getChild("balance_bg")->setBackgroundColor(color); + getChild("time_and_media_bg")->setBackgroundColor(color); +} \ No newline at end of file diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index caab678c51..c795a7f80b 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -45,6 +45,7 @@ class LLPanelVolumePulldown; class LLPanelNearByMedia; class LLIconCtrl; class LLParcelChangeObserver; +class LLPanel; class LLRegionDetails @@ -125,6 +126,8 @@ public: LLRegionDetails mRegionDetails; LLPanelNearByMedia* getNearbyMediaPanel() { return mPanelNearByMedia; } + + void setBackgroundColor( const LLColor4& color ); private: @@ -199,6 +202,11 @@ private: public: + /** + * Updates parcel panel pos (mParcelPanel). + */ + void updateParcelPanel(); + /** * Updates parcel icons (mParcelIcon[]). */ @@ -256,6 +264,7 @@ private: LLPanelVolumePulldown* mPanelVolumePulldown; LLPanelNearByMedia* mPanelNearByMedia; + LLPanel* mParcelInfoPanel; LLButton* mInfoBtn; LLTextBox* mParcelInfoText; LLTextBox* mDamageText; 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 70313c2d1c..aad3076587 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -174,7 +174,10 @@ width="95" top="0" follows="right|top" - name="balance_bg"> + name="balance_bg" + background_opaque="true" + background_visible="true" + bg_opaque_color="MouseGray"> + + @@ -249,4 +263,5 @@ name="volume_btn" tool_tip="Global Volume Control" width="16" /> +