Skip to content
Snippets Groups Projects
Commit a0e766da authored by Leyla Farazha's avatar Leyla Farazha
Browse files

EXT-1697 tab label type not to spec

EXT-1870 Remove default tooltips from tab_container widget
EXT-1699 right and left tab edges don't align with edges of tab content area
EXT-1869 tabs flash when your cursor passes over data fields

reviewed by richard
parent 7a7bc8d3
No related branches found
No related tags found
No related merge requests found
...@@ -153,7 +153,9 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) ...@@ -153,7 +153,9 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
mImageBottomUnselected(p.tab_bottom_image_unselected), mImageBottomUnselected(p.tab_bottom_image_unselected),
mImageBottomSelected(p.tab_bottom_image_selected), mImageBottomSelected(p.tab_bottom_image_selected),
mImageLeftUnselected(p.tab_left_image_unselected), mImageLeftUnselected(p.tab_left_image_unselected),
mImageLeftSelected(p.tab_left_image_selected) mImageLeftSelected(p.tab_left_image_selected),
mFontHalign(p.font_halign),
mFont(p.font.isProvided() ? p.font() : (mIsVertical ? LLFontGL::getFontSansSerif() : LLFontGL::getFontSansSerifSmall()))
{ {
static LLUICachedControl<S32> tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0); static LLUICachedControl<S32> tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0);
...@@ -399,12 +401,6 @@ void LLTabContainer::draw() ...@@ -399,12 +401,6 @@ void LLTabContainer::draw()
} }
} }
} }
LLUI::pushMatrix();
{
LLUI::translate((F32)tuple->mButton->getRect().mLeft, (F32)tuple->mButton->getRect().mBottom, 0.f);
tuple->mButton->draw();
}
LLUI::popMatrix();
idx++; idx++;
} }
...@@ -639,12 +635,6 @@ BOOL LLTabContainer::handleToolTip( S32 x, S32 y, MASK mask) ...@@ -639,12 +635,6 @@ BOOL LLTabContainer::handleToolTip( S32 x, S32 y, MASK mask)
} }
} }
} }
for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
{
LLTabTuple* tuple = *iter;
tuple->mButton->setVisible( FALSE );
}
} }
return handled; return handled;
} }
...@@ -811,8 +801,6 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) ...@@ -811,8 +801,6 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
// already a child of mine // already a child of mine
return; return;
} }
const LLFontGL* font =
(mIsVertical ? LLFontGL::getFontSansSerif() : LLFontGL::getFontSansSerifSmall());
// Store the original label for possible xml export. // Store the original label for possible xml export.
child->setLabel(label); child->setLabel(label);
...@@ -822,7 +810,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) ...@@ -822,7 +810,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
S32 button_width = mMinTabWidth; S32 button_width = mMinTabWidth;
if (!mIsVertical) if (!mIsVertical)
{ {
button_width = llclamp(font->getWidth(trimmed_label) + tab_padding, mMinTabWidth, mMaxTabWidth); button_width = llclamp(mFont->getWidth(trimmed_label) + tab_padding, mMinTabWidth, mMaxTabWidth);
} }
// Tab panel // Tab panel
...@@ -909,7 +897,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) ...@@ -909,7 +897,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
params.name(trimmed_label); params.name(trimmed_label);
params.rect(btn_rect); params.rect(btn_rect);
params.initial_value(trimmed_label); params.initial_value(trimmed_label);
params.font(font); params.font(mFont);
textbox = LLUICtrlFactory::create<LLTextBox> (params); textbox = LLUICtrlFactory::create<LLTextBox> (params);
LLButton::Params p; LLButton::Params p;
...@@ -925,12 +913,12 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) ...@@ -925,12 +913,12 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
p.rect(btn_rect); p.rect(btn_rect);
p.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); p.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT);
p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child)); p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child));
p.font(font); p.font(mFont);
p.label(trimmed_label); p.label(trimmed_label);
p.image_unselected(mImageLeftUnselected); p.image_unselected(mImageLeftUnselected);
p.image_selected(mImageLeftSelected); p.image_selected(mImageLeftSelected);
p.scale_image(true); p.scale_image(true);
p.font_halign = LLFontGL::LEFT; p.font_halign = mFontHalign;
p.tab_stop(false); p.tab_stop(false);
if (indent) if (indent)
{ {
...@@ -940,18 +928,13 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) ...@@ -940,18 +928,13 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
} }
else else
{ {
std::string tooltip = trimmed_label;
tooltip += "\n" + LLTrans::getString("TooltipAltLeft");
tooltip += "\n" + LLTrans::getString("TooltipAltRight");
LLButton::Params p; LLButton::Params p;
p.name(std::string(child->getName()) + " tab"); p.name(std::string(child->getName()) + " tab");
p.rect(btn_rect); p.rect(btn_rect);
p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child)); p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child));
p.font(font); p.font(mFont);
p.label(trimmed_label); p.label(trimmed_label);
p.visible(false); p.visible(false);
p.tool_tip(tooltip);
p.scale_image(true); p.scale_image(true);
p.image_unselected(tab_img); p.image_unselected(tab_img);
p.image_selected(tab_selected_img); p.image_selected(tab_selected_img);
...@@ -959,7 +942,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) ...@@ -959,7 +942,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
// Try to squeeze in a bit more text // Try to squeeze in a bit more text
p.pad_left(4); p.pad_left(4);
p.pad_right(2); p.pad_right(2);
p.font_halign = LLFontGL::LEFT; p.font_halign = mFontHalign;
p.follows.flags = FOLLOWS_LEFT; p.follows.flags = FOLLOWS_LEFT;
p.follows.flags = FOLLOWS_LEFT; p.follows.flags = FOLLOWS_LEFT;
...@@ -1445,7 +1428,6 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L ...@@ -1445,7 +1428,6 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L
if (!mIsVertical) if (!mIsVertical)
{ {
const LLFontGL* fontp = LLFontGL::getFontSansSerifSmall();
// remove current width from total tab strip width // remove current width from total tab strip width
mTotalTabWidth -= tuple->mButton->getRect().getWidth(); mTotalTabWidth -= tuple->mButton->getRect().getWidth();
...@@ -1456,7 +1438,7 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L ...@@ -1456,7 +1438,7 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L
tuple->mPadding = image_overlay_width; tuple->mPadding = image_overlay_width;
tuple->mButton->setRightHPad(6); tuple->mButton->setRightHPad(6);
tuple->mButton->reshape(llclamp(fontp->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth), tuple->mButton->reshape(llclamp(mFont->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth),
tuple->mButton->getRect().getHeight()); tuple->mButton->getRect().getHeight());
// add back in button width to total tab strip width // add back in button width to total tab strip width
mTotalTabWidth += tuple->mButton->getRect().getWidth(); mTotalTabWidth += tuple->mButton->getRect().getWidth();
......
...@@ -258,6 +258,9 @@ class LLTabContainer : public LLPanel ...@@ -258,6 +258,9 @@ class LLTabContainer : public LLPanel
LLPointer<LLUIImage> mImageBottomSelected; LLPointer<LLUIImage> mImageBottomSelected;
LLPointer<LLUIImage> mImageLeftUnselected; LLPointer<LLUIImage> mImageLeftUnselected;
LLPointer<LLUIImage> mImageLeftSelected; LLPointer<LLUIImage> mImageLeftSelected;
LLFontGL::HAlign mFontHalign;
const LLFontGL* mFont;
}; };
#endif // LL_TABCONTAINER_H #endif // LL_TABCONTAINER_H
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
follows="left|top|right|bottom" follows="left|top|right|bottom"
height="400" height="400"
layout="topleft" layout="topleft"
font="SansSerifSmall"
left="1" left="1"
tab_padding_right="5"
name="landtab" name="landtab"
tab_position="top" tab_position="top"
top="20" top="20"
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
type="string" type="string"
length="1" length="1"
follows="left|top" follows="left|top"
font="SansSerif" font="SansSerifSmall"
height="16" height="16"
layout="topleft" layout="topleft"
left_pad="7" left_pad="7"
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
</text> </text>
<button <button
height="23" height="23"
font="SansSerifSmall"
label="L$1" label="L$1"
label_selected="L$1" label_selected="L$1"
layout="topleft" layout="topleft"
...@@ -53,7 +54,8 @@ ...@@ -53,7 +54,8 @@
width="80" /> width="80" />
<button <button
height="23" height="23"
label="L$5" label="L$1"
font="SansSerif"
label_selected="L$5" label_selected="L$5"
layout="topleft" layout="topleft"
left_pad="15" left_pad="15"
...@@ -62,6 +64,7 @@ ...@@ -62,6 +64,7 @@
<button <button
height="23" height="23"
label="L$10" label="L$10"
font="SansSerifHuge"
label_selected="L$10" label_selected="L$10"
layout="topleft" layout="topleft"
left="25" left="25"
......
...@@ -49,11 +49,13 @@ background_visible="true" ...@@ -49,11 +49,13 @@ background_visible="true"
height="500" height="500"
layout="topleft" layout="topleft"
left="10" left="10"
font="SansSerifBigBold"
name="tabs" name="tabs"
tab_min_width="70" tab_min_width="70"
tab_height="30" tab_height="30"
tab_position="top" tab_position="top"
top_pad="10" top_pad="10"
halign="center"
width="313"> width="313">
<panel <panel
follows="all" follows="all"
......
...@@ -61,9 +61,7 @@ ...@@ -61,9 +61,7 @@
<string name="TooltipFlagGroupScripts">Group Scripts</string> <string name="TooltipFlagGroupScripts">Group Scripts</string>
<string name="TooltipFlagNoScripts">No Scripts</string> <string name="TooltipFlagNoScripts">No Scripts</string>
<string name="TooltipLand">Land:</string> <string name="TooltipLand">Land:</string>
<string name="TooltipMustSingleDrop">Only a single item can be dragged here</string> <string name="TooltipMustSingleDrop">Only a single item can be dragged here</string>
<string name="TooltipAltLeft">Alt+&#8592; for previous tab</string>
<string name="TooltipAltRight">Alt+&#8594; for next tab</string>
<!-- tooltips for Urls --> <!-- tooltips for Urls -->
<string name="TooltipHttpUrl">Click to view this web page</string> <string name="TooltipHttpUrl">Click to view this web page</string>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<tab_container tab_min_width="60" <tab_container tab_min_width="60"
tab_max_width="150" tab_max_width="150"
tab_height="16" tab_height="16"
font_halign="left"
tab_top_image_unselected="TabTop_Middle_Off" tab_top_image_unselected="TabTop_Middle_Off"
tab_top_image_selected="TabTop_Middle_Selected" tab_top_image_selected="TabTop_Middle_Selected"
tab_bottom_image_unselected="Toolbar_Left_Off" tab_bottom_image_unselected="Toolbar_Left_Off"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment