summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llaccordionctrl.cpp25
-rw-r--r--indra/llui/llaccordionctrl.h1
-rw-r--r--indra/llui/llcheckboxctrl.cpp30
-rw-r--r--indra/llui/llfloater.cpp8
-rw-r--r--indra/llui/llfloater.h2
-rw-r--r--indra/llui/llmenugl.cpp6
-rw-r--r--indra/llui/llmenugl.h1
-rw-r--r--indra/llui/llresmgr.cpp4
8 files changed, 58 insertions, 19 deletions
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index 673631f99a..2bc8ea054a 100644
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -811,6 +811,31 @@ void LLAccordionCtrl::reset ()
mScrollbar->setDocPos(0);
}
+void LLAccordionCtrl::expandDefaultTab()
+{
+ if (mAccordionTabs.size() > 0)
+ {
+ LLAccordionCtrlTab* tab = mAccordionTabs.front();
+
+ if (!tab->getDisplayChildren())
+ {
+ tab->setDisplayChildren(true);
+ }
+
+ for (size_t i = 1; i < mAccordionTabs.size(); ++i)
+ {
+ tab = mAccordionTabs[i];
+
+ if (tab->getDisplayChildren())
+ {
+ tab->setDisplayChildren(false);
+ }
+ }
+
+ arrange();
+ }
+}
+
void LLAccordionCtrl::sort()
{
if (!mTabComparator)
diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h
index b5fdf796cd..8241ee1518 100644
--- a/indra/llui/llaccordionctrl.h
+++ b/indra/llui/llaccordionctrl.h
@@ -122,6 +122,7 @@ public:
S32 notifyParent(const LLSD& info);
void reset ();
+ void expandDefaultTab();
void setComparator(const LLTabComparator* comp) { mTabComparator = comp; }
void sort();
diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp
index 3d32157406..0c524cd470 100644
--- a/indra/llui/llcheckboxctrl.cpp
+++ b/indra/llui/llcheckboxctrl.cpp
@@ -81,17 +81,6 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p)
// must be big enough to hold all children
setUseBoundingRect(TRUE);
- // Label (add a little space to make sure text actually renders)
- const S32 FUDGE = 10;
- S32 text_width = mFont->getWidth( p.label ) + FUDGE;
- S32 text_height = llround(mFont->getLineHeight());
- LLRect label_rect;
- label_rect.setOriginAndSize(
- llcheckboxctrl_hpad + llcheckboxctrl_btn_size + llcheckboxctrl_spacing,
- llcheckboxctrl_vpad + 1, // padding to get better alignment
- text_width + llcheckboxctrl_hpad,
- text_height );
-
// *HACK Get rid of this with SL-55508...
// this allows blank check boxes and radio boxes for now
std::string local_label = p.label;
@@ -101,7 +90,6 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p)
}
LLTextBox::Params tbparams = p.label_text;
- tbparams.rect(label_rect);
tbparams.initial_value(local_label);
if (p.font.isProvided())
{
@@ -111,6 +99,17 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p)
mLabel = LLUICtrlFactory::create<LLTextBox> (tbparams);
addChild(mLabel);
+ S32 text_width = mLabel->getTextBoundingRect().getWidth();
+ S32 text_height = llround(mFont->getLineHeight());
+ LLRect label_rect;
+ label_rect.setOriginAndSize(
+ llcheckboxctrl_hpad + llcheckboxctrl_btn_size + llcheckboxctrl_spacing,
+ llcheckboxctrl_vpad + 1, // padding to get better alignment
+ text_width + llcheckboxctrl_hpad,
+ text_height );
+ mLabel->setShape(label_rect);
+
+
// Button
// Note: button cover the label by extending all the way to the right.
LLRect btn_rect;
@@ -190,8 +189,7 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)
static LLUICachedControl<S32> llcheckboxctrl_vpad ("UICheckboxctrlVPad", 0);
static LLUICachedControl<S32> llcheckboxctrl_btn_size ("UICheckboxctrlBtnSize", 0);
- const S32 FUDGE = 10;
- S32 text_width = mFont->getWidth( mLabel->getText() ) + FUDGE;
+ S32 text_width = mLabel->getTextBoundingRect().getWidth();
S32 text_height = llround(mFont->getLineHeight());
LLRect label_rect;
label_rect.setOriginAndSize(
@@ -199,7 +197,7 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)
llcheckboxctrl_vpad,
text_width,
text_height );
- mLabel->setRect(label_rect);
+ mLabel->setShape(label_rect);
LLRect btn_rect;
btn_rect.setOriginAndSize(
@@ -207,7 +205,7 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)
llcheckboxctrl_vpad,
llcheckboxctrl_btn_size + llcheckboxctrl_spacing + text_width,
llmax( text_height, llcheckboxctrl_btn_size() ) );
- mButton->setRect( btn_rect );
+ mButton->setShape( btn_rect );
LLUICtrl::reshape(width, height, called_from_parent);
}
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 39a6855273..22d6f6ca52 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -451,6 +451,14 @@ void LLFloater::enableResizeCtrls(bool enable)
}
}
+void LLFloater::destroy()
+{
+ // LLFloaterReg should be synchronized with "dead" floater to avoid returning dead instance before
+ // it was deleted via LLMortician::updateClass(). See EXT-8458.
+ LLFloaterReg::removeInstance(mInstanceName, mKey);
+ die();
+}
+
// virtual
LLFloater::~LLFloater()
{
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 3ea035777c..42f422f91c 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -308,7 +308,7 @@ protected:
BOOL getAutoFocus() const { return mAutoFocus; }
LLDragHandle* getDragHandle() const { return mDragHandle; }
- void destroy() { die(); } // Don't call this directly. You probably want to call closeFloater()
+ void destroy(); // Don't call this directly. You probably want to call closeFloater()
virtual void onClickCloseBtn();
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index b4a1bcb7c5..8610d79142 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -218,6 +218,12 @@ void LLMenuItemGL::setValue(const LLSD& value)
}
//virtual
+LLSD LLMenuItemGL::getValue() const
+{
+ return getLabel();
+}
+
+//virtual
BOOL LLMenuItemGL::handleAcceleratorKey(KEY key, MASK mask)
{
if( getEnabled() && (!gKeyboard->getKeyRepeated(key) || mAllowKeyRepeat) && (key == mAcceleratorKey) && (mask == (mAcceleratorMask & MASK_NORMALKEYS)) )
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 7668f301ea..a484405eaa 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -95,6 +95,7 @@ public:
// LLUICtrl overrides
/*virtual*/ void setValue(const LLSD& value);
+ /*virtual*/ LLSD getValue() const;
virtual BOOL handleAcceleratorKey(KEY key, MASK mask);
diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp
index ed870d46d5..9158bc70f5 100644
--- a/indra/llui/llresmgr.cpp
+++ b/indra/llui/llresmgr.cpp
@@ -298,11 +298,11 @@ void LLResMgr::getIntegerString( std::string& output, S32 input ) const
{
if (fraction == remaining_count)
{
- fraction_string = llformat("%d%c", fraction, getThousandsSeparator());
+ fraction_string = llformat_to_utf8("%d%c", fraction, getThousandsSeparator());
}
else
{
- fraction_string = llformat("%3.3d%c", fraction, getThousandsSeparator());
+ fraction_string = llformat_to_utf8("%3.3d%c", fraction, getThousandsSeparator());
}
output = fraction_string + output;
}