Add parameter to texture picker swatch to allow hiding the label at the bottom, expanding the texture to full height

meow-7.2.2
Zi Ree 2022-09-24 03:43:08 +02:00
parent ea4126614f
commit 9f0fb244cc
2 changed files with 13 additions and 4 deletions

View File

@ -1389,7 +1389,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
// <FS:Ansariel> Mask texture if desired
mIsMasked(FALSE)
{
mCaptionHeight = p.show_caption ? BTN_HEIGHT_SMALL : 0; // <FS:Zi> leave some room underneath the image for the caption
// Default of defaults is white image for diff tex
//
LLUUID whiteImage( gSavedSettings.getString( "UIImgWhiteUUID" ) );
@ -1408,7 +1408,9 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
addChild( mCaption );
S32 image_top = getRect().getHeight();
S32 image_bottom = BTN_HEIGHT_SMALL;
// <FS:Zi> leave some room underneath the image for the caption
// S32 image_bottom = BTN_HEIGHT_SMALL;
S32 image_bottom = mCaptionHeight;
S32 image_middle = (image_top + image_bottom) / 2;
S32 line_height = LLFontGL::getFontSansSerifSmall()->getLineHeight();
@ -1427,7 +1429,9 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
addChild( mTentativeLabel );
LLRect border_rect = getLocalRect();
border_rect.mBottom += BTN_HEIGHT_SMALL;
// <FS:Zi> leave some room underneath the image for the caption
// border_rect.mBottom += BTN_HEIGHT_SMALL;
border_rect.mBottom += mCaptionHeight;
LLViewBorder::Params vbparams(p.border);
vbparams.name("border");
vbparams.rect(border_rect);
@ -1893,7 +1897,9 @@ void LLTextureCtrl::draw()
}
// Border
LLRect border( 0, getRect().getHeight(), getRect().getWidth(), BTN_HEIGHT_SMALL );
// <FS:Zi> leave some room underneath the image for the caption
// LLRect border( 0, getRect().getHeight(), getRect().getWidth(), BTN_HEIGHT_SMALL );
LLRect border( 0, getRect().getHeight(), getRect().getWidth(), mCaptionHeight );
gl_rect_2d( border, mBorderColor.get(), FALSE );
// Interior

View File

@ -98,6 +98,7 @@ public:
caption_text;
Optional<LLViewBorder::Params> border;
Optional<bool> show_caption; // <FS:Zi> leave some room underneath the image for the caption
Params()
: image_id("image"),
@ -110,6 +111,7 @@ public:
border_color("border_color"),
fallback_image("fallback_image"),
multiselect_text("multiselect_text"),
show_caption("show_caption", true), // <FS:Zi> leave some room underneath the image for the caption
caption_text("caption_text"),
border("border")
{}
@ -241,6 +243,7 @@ private:
LLHandle<LLFloater> mFloaterHandle;
LLTextBox* mTentativeLabel;
LLTextBox* mCaption;
S32 mCaptionHeight; // <FS:Zi> leave some room underneath the image for the caption
std::string mLabel;
BOOL mAllowNoTexture; // If true, the user can select "none" as an option
BOOL mAllowLocalTexture;