diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2009-10-28 14:56:31 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2009-10-28 14:56:31 -0700 |
commit | a0e766da94d786d306a86667a27728524ca6eedb (patch) | |
tree | 2322fe78599d14024affef0dca93dcd84cd0af74 | |
parent | 7a7bc8d33bba19530bf71c210d996a3faf711cd1 (diff) |
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
-rw-r--r-- | indra/llui/lltabcontainer.cpp | 38 | ||||
-rw-r--r-- | indra/llui/lltabcontainer.h | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_about_land.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_pay.xml | 7 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_people.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/tab_container.xml | 1 |
7 files changed, 24 insertions, 33 deletions
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 10d89dc78d..05ef67f20a 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -153,7 +153,9 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) mImageBottomUnselected(p.tab_bottom_image_unselected), mImageBottomSelected(p.tab_bottom_image_selected), 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); @@ -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++; } @@ -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; } @@ -811,8 +801,6 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) // already a child of mine return; } - const LLFontGL* font = - (mIsVertical ? LLFontGL::getFontSansSerif() : LLFontGL::getFontSansSerifSmall()); // Store the original label for possible xml export. child->setLabel(label); @@ -822,7 +810,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) S32 button_width = mMinTabWidth; 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 @@ -909,7 +897,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) params.name(trimmed_label); params.rect(btn_rect); params.initial_value(trimmed_label); - params.font(font); + params.font(mFont); textbox = LLUICtrlFactory::create<LLTextBox> (params); LLButton::Params p; @@ -925,12 +913,12 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) p.rect(btn_rect); p.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child)); - p.font(font); + p.font(mFont); p.label(trimmed_label); p.image_unselected(mImageLeftUnselected); p.image_selected(mImageLeftSelected); p.scale_image(true); - p.font_halign = LLFontGL::LEFT; + p.font_halign = mFontHalign; p.tab_stop(false); if (indent) { @@ -940,18 +928,13 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) } else { - std::string tooltip = trimmed_label; - tooltip += "\n" + LLTrans::getString("TooltipAltLeft"); - tooltip += "\n" + LLTrans::getString("TooltipAltRight"); - LLButton::Params p; p.name(std::string(child->getName()) + " tab"); p.rect(btn_rect); p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child)); - p.font(font); + p.font(mFont); p.label(trimmed_label); p.visible(false); - p.tool_tip(tooltip); p.scale_image(true); p.image_unselected(tab_img); p.image_selected(tab_selected_img); @@ -959,7 +942,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) // Try to squeeze in a bit more text p.pad_left(4); p.pad_right(2); - p.font_halign = LLFontGL::LEFT; + p.font_halign = mFontHalign; 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 if (!mIsVertical) { - const LLFontGL* fontp = LLFontGL::getFontSansSerifSmall(); // remove current width from total tab strip width mTotalTabWidth -= tuple->mButton->getRect().getWidth(); @@ -1456,7 +1438,7 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L tuple->mPadding = image_overlay_width; 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()); // add back in button width to total tab strip width mTotalTabWidth += tuple->mButton->getRect().getWidth(); diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index e3af5384b1..9a9cf1f0d7 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -258,6 +258,9 @@ private: LLPointer<LLUIImage> mImageBottomSelected; LLPointer<LLUIImage> mImageLeftUnselected; LLPointer<LLUIImage> mImageLeftSelected; + + LLFontGL::HAlign mFontHalign; + const LLFontGL* mFont; }; #endif // LL_TABCONTAINER_H diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 072fafd06e..aa0b4094b4 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -28,7 +28,9 @@ follows="left|top|right|bottom" height="400" layout="topleft" + font="SansSerifSmall" left="1" + tab_padding_right="5" name="landtab" tab_position="top" top="20" diff --git a/indra/newview/skins/default/xui/en/floater_pay.xml b/indra/newview/skins/default/xui/en/floater_pay.xml index 5f70f09a34..69525d48d2 100644 --- a/indra/newview/skins/default/xui/en/floater_pay.xml +++ b/indra/newview/skins/default/xui/en/floater_pay.xml @@ -34,7 +34,7 @@ type="string" length="1" follows="left|top" - font="SansSerif" + font="SansSerifSmall" height="16" layout="topleft" left_pad="7" @@ -44,6 +44,7 @@ </text> <button height="23" + font="SansSerifSmall" label="L$1" label_selected="L$1" layout="topleft" @@ -53,7 +54,8 @@ width="80" /> <button height="23" - label="L$5" + label="L$1" + font="SansSerif" label_selected="L$5" layout="topleft" left_pad="15" @@ -62,6 +64,7 @@ <button height="23" label="L$10" + font="SansSerifHuge" label_selected="L$10" layout="topleft" left="25" diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 085b732473..fbf4810620 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -49,11 +49,13 @@ background_visible="true" height="500" layout="topleft" left="10" + font="SansSerifBigBold" name="tabs" tab_min_width="70" tab_height="30" tab_position="top" top_pad="10" + halign="center" width="313"> <panel follows="all" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index a57c9cd97f..37379923d8 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -61,9 +61,7 @@ <string name="TooltipFlagGroupScripts">Group Scripts</string> <string name="TooltipFlagNoScripts">No Scripts</string> <string name="TooltipLand">Land:</string> - <string name="TooltipMustSingleDrop">Only a single item can be dragged here</string> - <string name="TooltipAltLeft">Alt+← for previous tab</string> - <string name="TooltipAltRight">Alt+→ for next tab</string> + <string name="TooltipMustSingleDrop">Only a single item can be dragged here</string> <!-- tooltips for Urls --> <string name="TooltipHttpUrl">Click to view this web page</string> diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml index 25d85899a1..b3e7961d9c 100644 --- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml +++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml @@ -2,6 +2,7 @@ <tab_container tab_min_width="60" tab_max_width="150" tab_height="16" + font_halign="left" tab_top_image_unselected="TabTop_Middle_Off" tab_top_image_selected="TabTop_Middle_Selected" tab_bottom_image_unselected="Toolbar_Left_Off" |