summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llbutton.cpp5
-rw-r--r--indra/llui/llbutton.h4
-rw-r--r--indra/llui/lldockablefloater.cpp15
-rw-r--r--indra/llui/lldockcontrol.cpp45
-rw-r--r--indra/llui/lldockcontrol.h2
-rw-r--r--indra/llui/llflatlistview.cpp18
-rw-r--r--indra/llui/llflatlistview.h2
-rw-r--r--indra/llui/lliconctrl.cpp7
-rw-r--r--indra/llui/lliconctrl.h5
-rw-r--r--indra/llui/lllayoutstack.cpp28
-rw-r--r--indra/llui/lllayoutstack.h3
-rw-r--r--indra/llui/lltabcontainer.cpp99
-rw-r--r--indra/llui/lltabcontainer.h32
-rw-r--r--indra/llui/llui.cpp8
-rw-r--r--indra/llui/llui.h8
-rw-r--r--indra/llui/lluicolortable.cpp23
-rw-r--r--indra/llui/lluicolortable.h23
17 files changed, 272 insertions, 55 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index f28fca35c5..fd369730d6 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -147,7 +147,8 @@ LLButton::LLButton(const LLButton::Params& p)
mHoverGlowStrength(p.hover_glow_amount),
mCommitOnReturn(p.commit_on_return),
mFadeWhenDisabled(FALSE),
- mForcePressedState(FALSE)
+ mForcePressedState(FALSE),
+ mLastDrawCharsCount(0)
{
static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0);
static Params default_params(LLUICtrlFactory::getDefaultParams<LLButton>());
@@ -814,7 +815,7 @@ void LLButton::draw()
// LLFontGL::render expects S32 max_chars variable but process in a separate way -1 value.
// Due to U32_MAX is equal to S32 -1 value I have rest this value for non-ellipses mode.
// Not sure if it is really needed. Probably S32_MAX should be always passed as max_chars.
- mGLFont->render(label, 0, (F32)x, (F32)(LLBUTTON_V_PAD + y_offset),
+ mLastDrawCharsCount = mGLFont->render(label, 0, (F32)x, (F32)(LLBUTTON_V_PAD + y_offset),
label_color % alpha,
mHAlign, LLFontGL::BOTTOM,
LLFontGL::NORMAL,
diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h
index 7ca520b935..7fc4997133 100644
--- a/indra/llui/llbutton.h
+++ b/indra/llui/llbutton.h
@@ -210,6 +210,9 @@ public:
void setFont(const LLFontGL *font)
{ mGLFont = ( font ? font : LLFontGL::getFontSansSerif()); }
+
+ S32 getLastDrawCharsCount() const { return mLastDrawCharsCount; }
+
void setScaleImage(BOOL scale) { mScaleImage = scale; }
BOOL getScaleImage() const { return mScaleImage; }
@@ -260,6 +263,7 @@ private:
S32 mMouseHeldDownCount; // Counter for parameter passed to held-down callback
F32 mHeldDownDelay; // seconds, after which held-down callbacks get called
S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called
+ S32 mLastDrawCharsCount;
LLPointer<LLUIImage> mImageOverlay;
LLFontGL::HAlign mImageOverlayAlignment;
diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp
index 35b3e486af..f56cb2eee7 100644
--- a/indra/llui/lldockablefloater.cpp
+++ b/indra/llui/lldockablefloater.cpp
@@ -136,7 +136,15 @@ void LLDockableFloater::setMinimized(BOOL minimize)
{
setVisible(FALSE);
}
- setCanDock(!minimize);
+
+ if (minimize)
+ {
+ setCanDock(false);
+ }
+ else if (!minimize && mDockControl.get() != NULL && mDockControl.get()->isDockVisible())
+ {
+ setCanDock(true);
+ }
LLFloater::setMinimized(minimize);
}
@@ -158,7 +166,10 @@ void LLDockableFloater::onDockHidden()
void LLDockableFloater::onDockShown()
{
- setCanDock(TRUE);
+ if (!isMinimized())
+ {
+ setCanDock(TRUE);
+ }
}
void LLDockableFloater::setDocked(bool docked, bool pop_on_undock)
diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp
index cdcd823b1c..35a854267a 100644
--- a/indra/llui/lldockcontrol.cpp
+++ b/indra/llui/lldockcontrol.cpp
@@ -37,7 +37,7 @@
LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater,
const LLUIImagePtr& dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_allowed_rect_callback) :
- mDockWidget(dockWidget), mDockableFloater(dockableFloater), mDockTongue(dockTongue)
+ mDockWidget(dockWidget), mDockableFloater(dockableFloater), mDockTongue(dockTongue)
{
mDockAt = dockAt;
@@ -63,6 +63,15 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater,
{
repositionDockable();
}
+
+ if (mDockWidget != NULL)
+ {
+ mDockWidgetVisible = isDockVisible();
+ }
+ else
+ {
+ mDockWidgetVisible = false;
+ }
}
LLDockControl::~LLDockControl()
@@ -75,6 +84,11 @@ void LLDockControl::setDock(LLView* dockWidget)
if (mDockWidget != NULL)
{
repositionDockable();
+ mDockWidgetVisible = isDockVisible();
+ }
+ else
+ {
+ mDockWidgetVisible = false;
}
}
@@ -88,11 +102,10 @@ void LLDockControl::repositionDockable()
LLRect dockRect = mDockWidget->calcScreenRect();
LLRect rootRect;
mGetAllowedRectCallback(rootRect);
- static BOOL prev_visibility = !mDockWidget->getVisible();
// recalculate dockable position if dock position changed, dock visibility changed,
// root view rect changed or recalculation is forced
- if (mPrevDockRect != dockRect || prev_visibility != mDockWidget->getVisible()
+ if (mPrevDockRect != dockRect || mDockWidgetVisible != isDockVisible()
|| mRootRect != rootRect || mRecalculateDocablePosition)
{
// undock dockable and off() if dock not visible
@@ -125,7 +138,7 @@ void LLDockControl::repositionDockable()
mPrevDockRect = dockRect;
mRootRect = rootRect;
mRecalculateDocablePosition = false;
- prev_visibility = mDockWidget->getVisible();
+ mDockWidgetVisible = isDockVisible();
}
}
@@ -143,6 +156,8 @@ bool LLDockControl::isDockVisible()
switch (mDockAt)
{
+ case LEFT: // to keep compiler happy
+ break;
case TOP:
// check is dock inside parent rect
LLRect dockParentRect =
@@ -170,8 +185,27 @@ void LLDockControl::moveDockable()
LLRect dockableRect = mDockableFloater->calcScreenRect();
S32 x = 0;
S32 y = 0;
+ LLRect dockParentRect;
switch (mDockAt)
{
+ case LEFT:
+ x = dockRect.mLeft;
+ y = dockRect.mTop + mDockTongue->getHeight() + dockableRect.getHeight();
+ // check is dockable inside root view rect
+ if (x < rootRect.mLeft)
+ {
+ x = rootRect.mLeft;
+ }
+ if (x + dockableRect.getWidth() > rootRect.mRight)
+ {
+ x = rootRect.mRight - dockableRect.getWidth();
+ }
+
+ mDockTongueX = x + dockableRect.getWidth()/2 - mDockTongue->getWidth() / 2;
+
+ mDockTongueY = dockRect.mTop;
+ break;
+
case TOP:
x = dockRect.getCenterX() - dockableRect.getWidth() / 2;
y = dockRect.mTop + mDockTongue->getHeight() + dockableRect.getHeight();
@@ -187,8 +221,7 @@ void LLDockControl::moveDockable()
// calculate dock tongue position
- LLRect dockParentRect =
- mDockWidget->getParent()->calcScreenRect();
+ dockParentRect = mDockWidget->getParent()->calcScreenRect();
if (dockRect.getCenterX() < dockParentRect.mLeft)
{
mDockTongueX = dockParentRect.mLeft - mDockTongue->getWidth() / 2;
diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h
index 756a2900d3..eaedb4c307 100644
--- a/indra/llui/lldockcontrol.h
+++ b/indra/llui/lldockcontrol.h
@@ -48,6 +48,7 @@ public:
enum DocAt
{
TOP
+ ,LEFT
};
public:
@@ -80,6 +81,7 @@ private:
get_allowed_rect_callback_t mGetAllowedRectCallback;
bool mEnabled;
bool mRecalculateDocablePosition;
+ bool mDockWidgetVisible;
DocAt mDockAt;
LLView* mDockWidget;
LLRect mPrevDockRect;
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index bba5464b00..19f203b80c 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -92,7 +92,7 @@ bool LLFlatListView::addItem(LLPanel * item, const LLSD& value /*= LLUUID::null*
//_4 is for MASK
item->setMouseDownCallback(boost::bind(&LLFlatListView::onItemMouseClick, this, new_pair, _4));
- item->setRightMouseDownCallback(boost::bind(&LLFlatListView::onItemMouseClick, this, new_pair, _4));
+ item->setRightMouseDownCallback(boost::bind(&LLFlatListView::onItemRightMouseClick, this, new_pair, _4));
rearrangeItems();
notifyParentItemsRectChanged();
@@ -137,7 +137,7 @@ bool LLFlatListView::insertItemAfter(LLPanel* after_item, LLPanel* item_to_add,
//_4 is for MASK
item_to_add->setMouseDownCallback(boost::bind(&LLFlatListView::onItemMouseClick, this, new_pair, _4));
- item_to_add->setRightMouseDownCallback(boost::bind(&LLFlatListView::onItemMouseClick, this, new_pair, _4));
+ item_to_add->setRightMouseDownCallback(boost::bind(&LLFlatListView::onItemRightMouseClick, this, new_pair, _4));
rearrangeItems();
notifyParentItemsRectChanged();
@@ -459,6 +459,20 @@ void LLFlatListView::onItemMouseClick(item_pair_t* item_pair, MASK mask)
selectItemPair(item_pair, select_item);
}
+void LLFlatListView::onItemRightMouseClick(item_pair_t* item_pair, MASK mask)
+{
+ if (!item_pair)
+ return;
+
+ // Forbid deselecting of items on right mouse button click if mMultipleSelection flag is set on,
+ // because some of derived classes may have context menu and selected items must be kept.
+ if ( !(mask & MASK_CONTROL) && mMultipleSelection && isSelected(item_pair) )
+ return;
+
+ // else got same behavior as at onItemMouseClick
+ onItemMouseClick(item_pair, mask);
+}
+
LLFlatListView::item_pair_t* LLFlatListView::getItemPair(LLPanel* item) const
{
llassert(item);
diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h
index 888258efdc..97772bc677 100644
--- a/indra/llui/llflatlistview.h
+++ b/indra/llui/llflatlistview.h
@@ -304,6 +304,8 @@ protected:
/** Manage selection on mouse events */
void onItemMouseClick(item_pair_t* item_pair, MASK mask);
+ void onItemRightMouseClick(item_pair_t* item_pair, MASK mask);
+
/**
* Updates position of items.
* It does not take into account invisible items.
diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp
index 0330a2b374..66c2ba682f 100644
--- a/indra/llui/lliconctrl.cpp
+++ b/indra/llui/lliconctrl.cpp
@@ -56,7 +56,8 @@ LLIconCtrl::Params::Params()
LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p)
: LLUICtrl(p),
mColor(p.color()),
- mImagep(p.image)
+ mImagep(p.image),
+ mPriority(0)
{
if (mImagep.notNull())
{
@@ -93,11 +94,11 @@ void LLIconCtrl::setValue(const LLSD& value )
LLUICtrl::setValue(tvalue);
if (tvalue.isUUID())
{
- mImagep = LLUI::getUIImageByID(tvalue.asUUID());
+ mImagep = LLUI::getUIImageByID(tvalue.asUUID(), mPriority);
}
else
{
- mImagep = LLUI::getUIImage(tvalue.asString());
+ mImagep = LLUI::getUIImage(tvalue.asString(), mPriority);
}
}
diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h
index ff25b0d53e..90f1693060 100644
--- a/indra/llui/lliconctrl.h
+++ b/indra/llui/lliconctrl.h
@@ -72,10 +72,13 @@ public:
std::string getImageName() const;
void setColor(const LLColor4& color) { mColor = color; }
+
+protected:
+ S32 mPriority;
private:
LLUIColor mColor;
- LLPointer<LLUIImage> mImagep;
+ LLPointer<LLUIImage> mImagep;
};
#endif
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 24fd380bb1..bac5491943 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -401,6 +401,16 @@ void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed)
panel_container->mCollapsed = collapsed;
}
+void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize)
+{
+ LayoutPanel* panel = findEmbeddedPanelByName(panel_name);
+
+ if (panel)
+ {
+ panel->mAutoResize = auto_resize;
+ }
+}
+
void LLLayoutStack::updateLayout(BOOL force_resize)
{
static LLUICachedControl<S32> resize_bar_overlap ("UIResizeBarOverlap", 0);
@@ -713,6 +723,24 @@ LLLayoutStack::LayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) co
return NULL;
}
+LLLayoutStack::LayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) const
+{
+ LayoutPanel* result = NULL;
+
+ for (e_panel_list_t::const_iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
+ {
+ LayoutPanel* p = *panel_it;
+
+ if (p->mPanel->getName() == name)
+ {
+ result = p;
+ break;
+ }
+ }
+
+ return result;
+}
+
// Compute sum of min_width or min_height of children
void LLLayoutStack::calcMinExtents()
{
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index 49cbe7270f..9ded48ef6a 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -80,6 +80,7 @@ public:
void collapsePanel(LLPanel* panel, BOOL collapsed = TRUE);
S32 getNumPanels() { return mPanels.size(); }
+ void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize);
protected:
LLLayoutStack(const Params&);
friend class LLUICtrlFactory;
@@ -96,7 +97,9 @@ private:
typedef std::vector<LayoutPanel*> e_panel_list_t;
e_panel_list_t mPanels;
+
LayoutPanel* findEmbeddedPanel(LLPanel* panelp) const;
+ LayoutPanel* findEmbeddedPanelByName(const std::string& name) const;
S32 mMinWidth; // calculated by calcMinExtents
S32 mMinHeight; // calculated by calcMinExtents
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 3ca05ff0ff..732c01614b 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -105,6 +105,15 @@ struct LLPlaceHolderPanel : public LLPanel
static LLDefaultChildRegistry::Register<LLPlaceHolderPanel> r1("placeholder");
static LLDefaultChildRegistry::Register<LLTabContainer> r2("tab_container");
+LLTabContainer::TabParams::TabParams()
+: tab_top_image_unselected("tab_top_image_unselected"),
+ tab_top_image_selected("tab_top_image_selected"),
+ tab_bottom_image_unselected("tab_bottom_image_unselected"),
+ tab_bottom_image_selected("tab_bottom_image_selected"),
+ tab_left_image_unselected("tab_left_image_unselected"),
+ tab_left_image_selected("tab_left_image_selected")
+{}
+
LLTabContainer::Params::Params()
: tab_width("tab_width"),
tab_min_width("tab_min_width"),
@@ -113,12 +122,9 @@ LLTabContainer::Params::Params()
tab_position("tab_position"),
hide_tabs("hide_tabs", false),
tab_padding_right("tab_padding_right"),
- tab_top_image_unselected("tab_top_image_unselected"),
- tab_top_image_selected("tab_top_image_selected"),
- tab_bottom_image_unselected("tab_bottom_image_unselected"),
- tab_bottom_image_selected("tab_bottom_image_selected"),
- tab_left_image_unselected("tab_left_image_unselected"),
- tab_left_image_selected("tab_left_image_selected")
+ first_tab("first_tab"),
+ middle_tab("middle_tab"),
+ last_tab("last_tab")
{
name(std::string("tab_container"));
mouse_opaque = false;
@@ -147,12 +153,9 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
mRightTabBtnOffset(p.tab_padding_right),
mTotalTabWidth(0),
mTabPosition(p.tab_position),
- mImageTopUnselected(p.tab_top_image_unselected),
- mImageTopSelected(p.tab_top_image_selected),
- mImageBottomUnselected(p.tab_bottom_image_unselected),
- mImageBottomSelected(p.tab_bottom_image_selected),
- mImageLeftUnselected(p.tab_left_image_unselected),
- mImageLeftSelected(p.tab_left_image_selected)
+ mFirstTabParams(p.first_tab),
+ mMiddleTabParams(p.middle_tab),
+ mLastTabParams(p.last_tab)
{
static LLUICachedControl<S32> tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0);
@@ -791,6 +794,29 @@ void LLTabContainer::addTabPanel(LLPanel* panelp)
addTabPanel(TabPanelParams().panel(panelp));
}
+// function to update images
+void LLTabContainer::update_images(LLTabTuple* tuple, TabParams params, LLTabContainer::TabPosition pos)
+{
+ if (tuple && tuple->mButton)
+ {
+ if (pos == LLTabContainer::TOP)
+ {
+ tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_top_image_unselected));
+ tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_top_image_selected));
+ }
+ else if (pos == LLTabContainer::BOTTOM)
+ {
+ tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_bottom_image_unselected));
+ tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_bottom_image_selected));
+ }
+ else if (pos == LLTabContainer::LEFT)
+ {
+ tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_left_image_unselected));
+ tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_left_image_selected));
+ }
+ }
+}
+
void LLTabContainer::addTabPanel(const TabPanelParams& panel)
{
LLPanel* child = panel.panel();
@@ -888,14 +914,14 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
else if( getTabPosition() == LLTabContainer::TOP )
{
btn_rect.setLeftTopAndSize( 0, getRect().getHeight() - getTopBorderHeight() + tab_fudge, button_width, mTabHeight);
- tab_img = mImageTopUnselected.get();
- tab_selected_img = mImageTopSelected.get();
+ tab_img = mMiddleTabParams.tab_top_image_unselected;
+ tab_selected_img = mMiddleTabParams.tab_top_image_selected;
}
else
{
btn_rect.setOriginAndSize( 0, 0 + tab_fudge, button_width, mTabHeight);
- tab_img = mImageBottomUnselected.get();
- tab_selected_img = mImageBottomSelected.get();
+ tab_img = mMiddleTabParams.tab_bottom_image_unselected;
+ tab_selected_img = mMiddleTabParams.tab_bottom_image_selected;
}
LLTextBox* textbox = NULL;
@@ -926,8 +952,8 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child));
p.font(font);
p.label(trimmed_label);
- p.image_unselected(mImageLeftUnselected);
- p.image_selected(mImageLeftSelected);
+ p.image_unselected(mMiddleTabParams.tab_left_image_unselected);
+ p.image_selected(mMiddleTabParams.tab_left_image_selected);
p.scale_image(true);
p.font_halign = LLFontGL::LEFT;
p.tab_stop(false);
@@ -983,6 +1009,31 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
LLTabTuple* tuple = new LLTabTuple( this, child, btn, textbox );
insertTuple( tuple, insertion_point );
+ // if new tab was added as a first or last tab, update button image
+ // and update button image of any tab it may have affected
+ if (tuple == mTabList.front())
+ {
+ update_images(tuple, mFirstTabParams, getTabPosition());
+
+ if (mTabList.size() == 2)
+ {
+ update_images(mTabList[1], mLastTabParams, getTabPosition());
+ }
+ else if (mTabList.size() > 2)
+ {
+ update_images(mTabList[1], mMiddleTabParams, getTabPosition());
+ }
+ }
+ else if (tuple == mTabList.back())
+ {
+ update_images(tuple, mLastTabParams, getTabPosition());
+
+ if (mTabList.size() > 2)
+ {
+ update_images(mTabList[mTabList.size()-2], mMiddleTabParams, getTabPosition());
+ }
+ }
+
//Don't add button and textbox if tab buttons are invisible(EXT - 576)
if (!getTabsHidden())
{
@@ -1064,7 +1115,17 @@ void LLTabContainer::removeTabPanel(LLPanel* child)
LLTabTuple* tuple = *iter;
if( tuple->mTabPanel == child )
{
- removeChild( tuple->mButton );
+ // update tab button images if removing the first or last tab
+ if ((tuple == mTabList.front()) && (mTabList.size() > 1))
+ {
+ update_images(mTabList[1], mFirstTabParams, getTabPosition());
+ }
+ else if ((tuple == mTabList.back()) && (mTabList.size() > 2))
+ {
+ update_images(mTabList[mTabList.size()-2], mLastTabParams, getTabPosition());
+ }
+
+ removeChild( tuple->mButton );
delete tuple->mButton;
removeChild( tuple->mTabPanel );
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index e3af5384b1..a81974cd42 100644
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -61,6 +61,17 @@ public:
static void declareValues();
};
+ struct TabParams : public LLInitParam::Block<TabParams>
+ {
+ Optional<LLUIImage*> tab_top_image_unselected,
+ tab_top_image_selected,
+ tab_bottom_image_unselected,
+ tab_bottom_image_selected,
+ tab_left_image_unselected,
+ tab_left_image_selected;
+ TabParams();
+ };
+
struct Params
: public LLInitParam::Block<Params, LLPanel::Params>
{
@@ -73,12 +84,9 @@ public:
Optional<bool> hide_tabs;
Optional<S32> tab_padding_right;
- Optional<LLUIImage*> tab_top_image_unselected,
- tab_top_image_selected,
- tab_bottom_image_unselected,
- tab_bottom_image_selected,
- tab_left_image_unselected,
- tab_left_image_selected;
+ Optional<TabParams> first_tab,
+ middle_tab,
+ last_tab;
Params();
};
@@ -215,6 +223,9 @@ private:
void updateMaxScrollPos();
void commitHoveredButton(S32 x, S32 y);
+ // updates tab button images given the tuple, tab position and the corresponding params
+ void update_images(LLTabTuple* tuple, TabParams params, LLTabContainer::TabPosition pos);
+
// Variables
typedef std::vector<LLTabTuple*> tuple_list_t;
@@ -252,12 +263,9 @@ private:
LLFrameTimer mDragAndDropDelayTimer;
- LLPointer<LLUIImage> mImageTopUnselected;
- LLPointer<LLUIImage> mImageTopSelected;
- LLPointer<LLUIImage> mImageBottomUnselected;
- LLPointer<LLUIImage> mImageBottomSelected;
- LLPointer<LLUIImage> mImageLeftUnselected;
- LLPointer<LLUIImage> mImageLeftSelected;
+ TabParams mFirstTabParams;
+ TabParams mMiddleTabParams;
+ TabParams mLastTabParams;
};
#endif // LL_TABCONTAINER_H
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index da9384f876..48504a1e54 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -1807,11 +1807,11 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen)
}
//static
-LLPointer<LLUIImage> LLUI::getUIImageByID(const LLUUID& image_id)
+LLPointer<LLUIImage> LLUI::getUIImageByID(const LLUUID& image_id, S32 priority)
{
if (sImageProvider)
{
- return sImageProvider->getUIImageByID(image_id);
+ return sImageProvider->getUIImageByID(image_id, priority);
}
else
{
@@ -1820,10 +1820,10 @@ LLPointer<LLUIImage> LLUI::getUIImageByID(const LLUUID& image_id)
}
//static
-LLPointer<LLUIImage> LLUI::getUIImage(const std::string& name)
+LLPointer<LLUIImage> LLUI::getUIImage(const std::string& name, S32 priority)
{
if (!name.empty() && sImageProvider)
- return sImageProvider->getUIImage(name);
+ return sImageProvider->getUIImage(name, priority);
else
return NULL;
}
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index 6ab78ab3cd..efb1b0a36f 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -195,8 +195,8 @@ public:
static void getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y);
static void setScaleFactor(const LLVector2& scale_factor);
static void setLineWidth(F32 width);
- static LLPointer<LLUIImage> getUIImageByID(const LLUUID& image_id);
- static LLPointer<LLUIImage> getUIImage(const std::string& name);
+ static LLPointer<LLUIImage> getUIImageByID(const LLUUID& image_id, S32 priority = 0);
+ static LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority = 0);
static LLVector2 getWindowSize();
static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y);
static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y);
@@ -241,8 +241,8 @@ protected:
LLImageProviderInterface() {};
virtual ~LLImageProviderInterface() {};
public:
- virtual LLPointer<LLUIImage> getUIImage(const std::string& name) = 0;
- virtual LLPointer<LLUIImage> getUIImageByID(const LLUUID& id) = 0;
+ virtual LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority) = 0;
+ virtual LLPointer<LLUIImage> getUIImageByID(const LLUUID& id, S32 priority) = 0;
virtual void cleanUp() = 0;
};
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index 5827c0d627..851091f0ca 100644
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -3,7 +3,30 @@
* @brief brief LLUIColorTable class implementation file
*
* $LicenseInfo:firstyear=2009&license=viewergpl$
+ *
* Copyright (c) 2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
diff --git a/indra/llui/lluicolortable.h b/indra/llui/lluicolortable.h
index f102a573b8..59be0c4f9a 100644
--- a/indra/llui/lluicolortable.h
+++ b/indra/llui/lluicolortable.h
@@ -3,7 +3,30 @@
* @brief brief LLUIColorTable class header file
*
* $LicenseInfo:firstyear=2009&license=viewergpl$
+ *
* Copyright (c) 2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/