UI cleanup.

-Added ui-local transformation matrix.
-Gutted legacy commitcallbacks throughout ui widget ctors.
-Created filter_editor ui widget which issues commit on keypress
   -search_editor commits on focus loss/enter press
   -search_editor and filter_editor now have a built in 'x' button to clear text.
-LLComboBox::setPrearrangeCallback now uses boost::function
-LLComboBox::setTextEntryCallback now uses boost::function
-LLLineEditor::setKeystrokeCallback now uses boost::function
-LLLineEditor::setPrevalidate now uses boost::function
-LLPanel::childSetKeystrokeCallback removed
-LLPanel::childSetPrevalidate removed
-LLPanel::childSetActionTextbox now uses boost::function
-LLTextBox::setClickedCallback now uses boost::function
-LLTextEditor::setKeystrokeCallback added.
-Cleaned up JCFloaterAreaSearch
This commit is contained in:
Shyotl
2013-04-16 00:25:59 -05:00
parent 4cbf8b16b6
commit a5dad6be5c
191 changed files with 3020 additions and 3456 deletions

View File

@@ -53,37 +53,8 @@
static LLRegisterWidget<LLColorSwatchCtrl> r("color_swatch");
LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const LLColor4& color,
void (*commit_callback)(LLUICtrl* ctrl, void* userdata),
void* userdata )
: LLUICtrl(name, rect, TRUE, commit_callback, userdata, FOLLOWS_LEFT | FOLLOWS_TOP),
mValid( TRUE ),
mColor( color ),
mBorderColor( gColors.getColor("DefaultHighlightLight") ),
mCanApplyImmediately(FALSE),
mOnCancelCallback(NULL),
mOnSelectCallback(NULL)
{
mCaption = new LLTextBox( name,
LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 ),
name,
LLFontGL::getFontSansSerifSmall() );
mCaption->setFollows( FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM );
addChild( mCaption );
// Scalable UI made this off-by-one, I don't know why. JC
LLRect border_rect(0, getRect().getHeight()-1, getRect().getWidth()-1, 0);
border_rect.mBottom += BTN_HEIGHT_SMALL;
mBorder = new LLViewBorder(std::string("border"), border_rect, LLViewBorder::BEVEL_IN);
addChild(mBorder);
mAlphaGradientImage = LLUI::getUIImage("color_swatch_alpha.tga");
}
LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLColor4& color,
void (*commit_callback)(LLUICtrl* ctrl, void* userdata),
void* userdata )
: LLUICtrl(name, rect, TRUE, commit_callback, userdata, FOLLOWS_LEFT | FOLLOWS_TOP),
LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLColor4& color)
: LLUICtrl(name, rect, TRUE, NULL, FOLLOWS_LEFT | FOLLOWS_TOP),
mValid( TRUE ),
mColor( color ),
mBorderColor( gColors.getColor("DefaultHighlightLight") ),
@@ -217,26 +188,34 @@ void LLColorSwatchCtrl::draw()
// Check state
if ( mValid )
{
// Draw the color swatch
gl_rect_2d_checkerboard( calcScreenRect(), interior );
gl_rect_2d(interior, mColor, TRUE);
LLColor4 opaque_color = mColor;
opaque_color.mV[VALPHA] = 1.f;
gGL.color4fv(opaque_color.mV);
if (mAlphaGradientImage.notNull())
if (!mColor.isOpaque())
{
gGL.pushMatrix();
gl_rect_2d_checkerboard( calcScreenRect(), interior );
// Draw the color swatch
}
gl_rect_2d(interior, mColor, TRUE);
if (!mColor.isOpaque())
{
LLColor4 opaque_color = mColor;
opaque_color.mV[VALPHA] = 1.f;
gGL.color4fv(opaque_color.mV);
if (mAlphaGradientImage.notNull())
{
mAlphaGradientImage->draw(interior, mColor);
gGL.pushMatrix();
{
mAlphaGradientImage->draw(interior, mColor);
}
gGL.popMatrix();
}
gGL.popMatrix();
}
}
else
{
if (!mFallbackImageName.empty())
{
LLPointer<LLViewerFetchedTexture> fallback_image = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName);
LLPointer<LLViewerFetchedTexture> fallback_image = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName, TRUE,
LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
if( fallback_image->getComponents() == 4 )
{
gl_rect_2d_checkerboard( calcScreenRect(), interior );
@@ -388,8 +367,6 @@ LLView* LLColorSwatchCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFa
BOOL can_apply_immediately = FALSE;
node->getAttributeBOOL("can_apply_immediately", can_apply_immediately);
LLUICtrlCallback callback = NULL;
if (label.empty())
{
label.assign(node->getValue());
@@ -399,9 +376,7 @@ LLView* LLColorSwatchCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFa
name,
rect,
label,
color,
callback,
NULL );
color );
color_swatch->setCanApplyImmediately(can_apply_immediately);
color_swatch->initFromXML(node, parent);