summaryrefslogtreecommitdiff
path: root/indra/llui/llcombobox.cpp
diff options
context:
space:
mode:
authorEuclid Linden <euclid@lindenlab.com>2022-05-27 21:15:49 +0000
committerEuclid Linden <euclid@lindenlab.com>2022-05-27 21:15:49 +0000
commit3f98411c56f4daa06c9102346a8dd37af18d2cb6 (patch)
tree4255c2827cc3e07921275bfd7937f4f43f29d5fa /indra/llui/llcombobox.cpp
parent3f58ec2fdfb76ce2160884a3e97be49f60b6ac90 (diff)
parent02c71b0ac2f99dd1c26a649ffce2182b2fc9a7d9 (diff)
Merged in DV528-merge-6.6.1 (pull request #1000)
DRTVWR-528 merge up to 6.6.1
Diffstat (limited to 'indra/llui/llcombobox.cpp')
-rw-r--r--indra/llui/llcombobox.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index bcc653a602..9ca05a16f3 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -113,6 +113,10 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p)
}
mArrowImage = button_params.image_unselected;
+ if (mArrowImage.notNull())
+ {
+ mImageLoadedConnection = mArrowImage->addLoadedCallback(boost::bind(&LLComboBox::imageLoaded, this));
+ }
mButton = LLUICtrlFactory::create<LLButton>(button_params);
@@ -183,6 +187,7 @@ LLComboBox::~LLComboBox()
// explicitly disconect this signal, since base class destructor might fire top lost
mTopLostSignalConnection.disconnect();
+ mImageLoadedConnection.disconnect();
}
@@ -1074,6 +1079,30 @@ void LLComboBox::onSetHighlight() const
}
}
+void LLComboBox::imageLoaded()
+{
+ static LLUICachedControl<S32> drop_shadow_button("DropShadowButton", 0);
+
+ if (mAllowTextEntry)
+ {
+ LLRect rect = getLocalRect();
+ S32 arrow_width = mArrowImage ? mArrowImage->getWidth() : 0;
+ S32 shadow_size = drop_shadow_button;
+ mButton->setRect(LLRect(getRect().getWidth() - llmax(8, arrow_width) - 2 * shadow_size,
+ rect.mTop, rect.mRight, rect.mBottom));
+ if (mButton->getVisible())
+ {
+ // recalculate field size
+ if (mTextEntry)
+ {
+ LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0);
+ text_entry_rect.mRight -= llmax(8, arrow_width) + 2 * drop_shadow_button;
+ mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), TRUE);
+ }
+ }
+ }
+}
+
//============================================================================
// LLCtrlListInterface functions