summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/lldraghandle.cpp10
-rw-r--r--indra/llui/lldraghandle.h8
-rw-r--r--indra/llui/llfloater.cpp10
-rw-r--r--indra/llui/llfloater.h6
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/skins/default/xui/en/widgets/floater.xml2
6 files changed, 26 insertions, 21 deletions
diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp
index 15536178ab..d8d1791dca 100644
--- a/indra/llui/lldraghandle.cpp
+++ b/indra/llui/lldraghandle.cpp
@@ -59,7 +59,9 @@ LLDragHandle::LLDragHandle(const LLDragHandle::Params& p)
mMaxTitleWidth( 0 ),
mForeground( true ),
mDragHighlightColor(p.drag_highlight_color()),
- mDragShadowColor(p.drag_shadow_color())
+ mDragShadowColor(p.drag_shadow_color()),
+ mFont(p.font),
+ mLabelVPad(p.label_vpad())
{
static LLUICachedControl<S32> snap_margin ("SnapMargin", 0);
@@ -98,12 +100,11 @@ void LLDragHandleTop::setTitle(const std::string& title)
}
else
{
- const LLFontGL* font = LLFontGL::getFontSansSerif();
LLTextBox::Params params;
params.name("Drag Handle Title");
params.rect(getRect());
params.initial_value(trimmed_title);
- params.font(font);
+ params.font(mFont);
params.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT);
params.font_shadow(LLFontGL::DROP_SHADOW_SOFT);
params.use_ellipses = true;
@@ -236,7 +237,6 @@ void LLDragHandleLeft::draw()
void LLDragHandleTop::reshapeTitleBox()
{
- static LLUICachedControl<S32> title_vpad("UIFloaterTitleVPad", 0);
if( ! mTitleBox)
{
return;
@@ -248,7 +248,7 @@ void LLDragHandleTop::reshapeTitleBox()
LLRect title_rect;
title_rect.setLeftTopAndSize(
LEFT_PAD,
- getRect().getHeight() - title_vpad,
+ getRect().getHeight() - mLabelVPad,
title_width,
title_height);
diff --git a/indra/llui/lldraghandle.h b/indra/llui/lldraghandle.h
index 73211d5292..f768839749 100644
--- a/indra/llui/lldraghandle.h
+++ b/indra/llui/lldraghandle.h
@@ -43,13 +43,17 @@ public:
: public LLInitParam::Block<Params, LLView::Params>
{
Optional<std::string> label;
+ Optional<S32> label_vpad;
Optional<LLUIColor> drag_highlight_color;
Optional<LLUIColor> drag_shadow_color;
+ Optional<const LLFontGL*> font;
Params()
: label("label"),
+ label_vpad("label_vpad", 7),
drag_highlight_color("drag_highlight_color", LLUIColorTable::instance().getColor("DefaultHighlightLight")),
- drag_shadow_color("drag_shadow_color", LLUIColorTable::instance().getColor("DefaultShadowDark"))
+ drag_shadow_color("drag_shadow_color", LLUIColorTable::instance().getColor("DefaultShadowDark")),
+ font("font", LLFontGL::getFontSansSerif())
{
changeDefault(mouse_opaque, true);
changeDefault(follows.flags, FOLLOWS_ALL);
@@ -82,6 +86,8 @@ protected:
protected:
LLTextBox* mTitleBox;
+ const LLFontGL* mFont;
+ S32 mLabelVPad;
private:
LLRect mButtonsRect;
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 52a5e3dbd6..62c5f60015 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -183,8 +183,10 @@ LLFloater::Params::Params()
show_title("show_title", true),
auto_close("auto_close", false),
positioning("positioning", LLFloaterEnums::POSITIONING_RELATIVE),
+ header_font("header_font", LLFontGL::getFontSansSerif()),
header_height("header_height", 0),
legacy_header_height("legacy_header_height", 0),
+ header_vpad("header_vpad", 7),
close_image("close_image"),
restore_image("restore_image"),
minimize_image("minimize_image"),
@@ -293,7 +295,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
memset(mButtonsEnabled, 0, BUTTON_COUNT * sizeof(bool));
memset(mButtons, 0, BUTTON_COUNT * sizeof(LLButton*));
- addDragHandle();
+ addDragHandle(p);
addResizeCtrls();
initFromParams(p);
@@ -336,7 +338,7 @@ void LLFloater::initFloater(const Params& p)
}
}
-void LLFloater::addDragHandle()
+void LLFloater::addDragHandle(const LLFloater::Params& floater_params)
{
if (!mDragHandle)
{
@@ -346,6 +348,8 @@ void LLFloater::addDragHandle()
p.name("drag");
p.follows.flags(FOLLOWS_ALL);
p.label(mTitle);
+ p.font(floater_params.header_font);
+ p.label_vpad(floater_params.header_vpad);
mDragHandle = LLUICtrlFactory::create<LLDragHandleLeft>(p);
}
else // drag on top
@@ -354,6 +358,8 @@ void LLFloater::addDragHandle()
p.name("Drag Handle");
p.follows.flags(FOLLOWS_ALL);
p.label(mTitle);
+ p.font(floater_params.header_font);
+ p.label_vpad(floater_params.header_vpad);
mDragHandle = LLUICtrlFactory::create<LLDragHandleTop>(p);
}
addChild(mDragHandle);
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 9e1594bdd2..bda2531b43 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -172,8 +172,10 @@ public:
Optional<LLFloaterEnums::EOpenPositioning> positioning;
+ Optional<const LLFontGL*> header_font;
Optional<S32> header_height,
- legacy_header_height; // HACK see initFromXML()
+ legacy_header_height, // HACK see initFromXML()
+ header_vpad;
Optional<F32> rel_x,
rel_y;
@@ -442,7 +444,7 @@ private:
bool offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButton index);
void addResizeCtrls();
void layoutResizeCtrls();
- void addDragHandle();
+ void addDragHandle(const LLFloater::Params& p);
void layoutDragHandle(); // repair layout
static void updateActiveFloaterTransparency();
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5a1a1187a0..8c8a6ebd4d 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12273,17 +12273,6 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>UIFloaterTitleVPad</key>
- <map>
- <key>Comment</key>
- <string>Distance from top of floater to top of title string, pixels</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>S32</string>
- <key>Value</key>
- <real>7</real>
- </map>
<key>UIImgDefaultEyesUUID</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/skins/default/xui/en/widgets/floater.xml b/indra/newview/skins/default/xui/en/widgets/floater.xml
index 11758556d6..f72c9a14fb 100644
--- a/indra/newview/skins/default/xui/en/widgets/floater.xml
+++ b/indra/newview/skins/default/xui/en/widgets/floater.xml
@@ -9,7 +9,9 @@
bg_alpha_image="Window_Background"
background_visible="true"
background_opaque="false"
+ header_font="SansSerif"
header_height="25"
+ header_vpad="7"
close_image="Icon_Close_Foreground"
restore_image="Icon_Restore_Foreground"
minimize_image="Icon_Minimize_Foreground"