summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/CMakeLists.txt2
-rw-r--r--indra/llui/lldockablefloater.cpp19
-rw-r--r--indra/llui/llpanel.cpp1
-rw-r--r--indra/llui/lltabcontainer.cpp13
-rw-r--r--indra/llui/lltabcontainer.h9
-rw-r--r--indra/llui/lltextbase.cpp8
-rw-r--r--indra/llui/lluictrlfactory.cpp1
-rw-r--r--indra/llui/lluictrlfactory.h26
8 files changed, 63 insertions, 16 deletions
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt
index 74b49b846e..82ec02d2eb 100644
--- a/indra/llui/CMakeLists.txt
+++ b/indra/llui/CMakeLists.txt
@@ -26,7 +26,6 @@ include_directories(
)
set(llui_SOURCE_FILES
- llalertdialog.cpp
llbutton.cpp
llcheckboxctrl.cpp
llclipboard.cpp
@@ -112,7 +111,6 @@ set(llui_SOURCE_FILES
set(llui_HEADER_FILES
CMakeLists.txt
- llalertdialog.h
llbutton.h
llcallbackmap.h
llcheckboxctrl.h
diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp
index 9c69e4f2b6..9dc7861992 100644
--- a/indra/llui/lldockablefloater.cpp
+++ b/indra/llui/lldockablefloater.cpp
@@ -38,6 +38,8 @@
//static
LLHandle<LLFloater> LLDockableFloater::sInstanceHandle;
+static const std::string VOICE_FLOATER("floater_voice_controls"), IM_FLOATER("panel_im");
+
//static
void LLDockableFloater::init(LLDockableFloater* thiz)
{
@@ -98,8 +100,15 @@ void LLDockableFloater::toggleInstance(const LLSD& sdname)
else if (instance != NULL)
{
instance->setMinimized(FALSE);
- instance->setVisible(TRUE);
- gFloaterView->bringToFront(instance);
+ if (instance->getVisible())
+ {
+ instance->setVisible(FALSE);
+ }
+ else
+ {
+ instance->setVisible(TRUE);
+ gFloaterView->bringToFront(instance);
+ }
}
}
@@ -107,9 +116,11 @@ void LLDockableFloater::resetInstance()
{
if (mUniqueDocking && sInstanceHandle.get() != this)
{
- if (sInstanceHandle.get() != NULL && sInstanceHandle.get()->isDocked())
+ if (sInstanceHandle.get() != NULL && sInstanceHandle.get()->isDocked()
+ && (getName() != VOICE_FLOATER || sInstanceHandle.get()->getName() != IM_FLOATER)
+ && (getName() != IM_FLOATER || sInstanceHandle.get()->getName() != VOICE_FLOATER))
{
- sInstanceHandle.get()->setVisible(FALSE);
+ sInstanceHandle.get()->setVisible(FALSE);
}
sInstanceHandle = getHandle();
}
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 750b190953..de2b43bf13 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -37,7 +37,6 @@
#define LLPANEL_CPP
#include "llpanel.h"
-#include "llalertdialog.h"
#include "llfocusmgr.h"
#include "llfontgl.h"
#include "llrect.h"
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 2d9106923e..83e2e3db50 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -120,6 +120,8 @@ LLTabContainer::Params::Params()
tab_min_width("tab_min_width"),
tab_max_width("tab_max_width"),
tab_height("tab_height"),
+ label_pad_bottom("label_pad_bottom"),
+ label_pad_left("label_pad_left"),
tab_position("tab_position"),
hide_tabs("hide_tabs", false),
tab_padding_right("tab_padding_right"),
@@ -145,6 +147,8 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
mMinTabWidth(0),
mMaxTabWidth(p.tab_max_width),
mTabHeight(p.tab_height),
+ mLabelPadBottom(p.label_pad_bottom),
+ mLabelPadLeft(p.label_pad_left),
mPrevArrowBtn(NULL),
mNextArrowBtn(NULL),
mIsVertical( p.tab_position == LEFT ),
@@ -906,7 +910,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
if (placeholder)
{
- btn_rect.translate(0, -3); // *TODO: make configurable
+ btn_rect.translate(0, -6); // *TODO: make configurable
LLTextBox::Params params;
params.name(trimmed_label);
params.rect(btn_rect);
@@ -933,6 +937,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
p.image_selected(mMiddleTabParams.tab_left_image_selected);
p.scale_image(true);
p.font_halign = mFontHalign;
+ p.pad_bottom( mLabelPadBottom );
p.tab_stop(false);
p.label_shadow(false);
if (indent)
@@ -956,8 +961,9 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
p.tab_stop(false);
p.label_shadow(false);
// Try to squeeze in a bit more text
- p.pad_left(4);
+ p.pad_left( mLabelPadLeft );
p.pad_right(2);
+ p.pad_bottom( mLabelPadBottom );
p.font_halign = mFontHalign;
p.follows.flags = FOLLOWS_LEFT;
p.follows.flags = FOLLOWS_LEFT;
@@ -1897,6 +1903,3 @@ void LLTabContainer::commitHoveredButton(S32 x, S32 y)
}
}
}
-
-
-
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index be9c6c7d06..5d0f194bf9 100644
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -79,7 +79,9 @@ public:
Optional<S32> tab_width,
tab_min_width,
tab_max_width,
- tab_height;
+ tab_height,
+ label_pad_bottom,
+ label_pad_left;
Optional<bool> hide_tabs;
Optional<S32> tab_padding_right;
@@ -261,6 +263,11 @@ private:
S32 mTotalTabWidth;
S32 mTabHeight;
+ // Padding under the text labels of tab buttons
+ S32 mLabelPadBottom;
+ // Padding to the left of text labels of tab buttons
+ S32 mLabelPadLeft;
+
LLFrameTimer mDragAndDropDelayTimer;
LLFontGL::HAlign mFontHalign;
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 1f120a1483..6c983fd92e 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1138,6 +1138,8 @@ void LLTextBase::reflow(S32 start_index)
line_height = llmax(line_height, segment_height);
remaining_pixels -= segment_width;
+ // getNumChars() and getDimensions() should return consistent results
+ llassert_always(remaining_pixels >= 0);
seg_offset += character_count;
S32 last_segment_char_on_line = segment->getStart() + seg_offset;
@@ -2464,6 +2466,12 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
{
LLWString text = mEditor.getWText();
+ LLUIImagePtr image = mStyle->getImage();
+ if( image.notNull())
+ {
+ num_pixels -= image->getWidth();
+ }
+
// search for newline and if found, truncate there
S32 last_char = mStart + segment_offset;
for (; last_char != mEnd; ++last_char)
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index 625d3c63e5..40b22f515a 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -396,6 +396,7 @@ BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const std::string& na
//static
void LLUICtrlFactory::setCtrlParent(LLView* view, LLView* parent, S32 tab_group)
{
+ if (tab_group == S32_MAX) tab_group = parent->getLastTabGroup();
parent->addChild(view, tab_group);
}
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 6dab9521bb..cad62c27de 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -201,7 +201,7 @@ public:
if (parent)
{
- S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : parent->getLastTabGroup();
+ S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : S32_MAX;
setCtrlParent(widget, parent, tab_group);
}
return widget;
@@ -309,9 +309,29 @@ fail:
// Apply layout transformations, usually munging rect
T::setupParams(params, parent);
- T* widget = createWidget<T>(params, parent);
+ if (!params.validateBlock())
+ {
+ llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl;
+ }
+ T* widget;
+ {
+ LLFastTimer timer(FTM_WIDGET_CONSTRUCTION);
+ widget = new T(params);
+ }
+ {
+ LLFastTimer timer(FTM_INIT_FROM_PARAMS);
+ widget->initFromParams(params);
+ }
+
+ if (parent)
+ {
+ S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : -1;
+ setCtrlParent(widget, parent, tab_group);
+ }
+
+ typedef typename T::child_registry_t registry_t;
- createChildren(widget, node, typename T::child_registry_t::instance(), output_node);
+ createChildren(widget, node, registry_t::instance(), output_node);
if (widget && !widget->postBuild())
{