diff options
-rw-r--r-- | indra/llui/llpanel.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llradiogroup.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llscrolllistcolumn.cpp | 15 | ||||
-rw-r--r-- | indra/llui/llscrolllistcolumn.h | 15 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 29 | ||||
-rw-r--r-- | indra/llui/lltextbase.h | 3 | ||||
-rw-r--r-- | indra/llui/lltexteditor.cpp | 34 | ||||
-rw-r--r-- | indra/llui/lltooltip.cpp | 32 | ||||
-rw-r--r-- | indra/llui/lltooltip.h | 15 | ||||
-rw-r--r-- | indra/llui/llui.cpp | 5 | ||||
-rw-r--r-- | indra/llui/llui.h | 14 | ||||
-rw-r--r-- | indra/llui/lluictrl.cpp | 3 | ||||
-rw-r--r-- | indra/llui/lluictrl.h | 3 | ||||
-rw-r--r-- | indra/newview/llexpandabletextbox.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llexpandabletextbox.h | 10 | ||||
-rw-r--r-- | indra/newview/llpanelpicks.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 22 | ||||
-rw-r--r-- | indra/newview/skins/default/textures/textures.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_bottomtray.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_pick_list_item.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/expandable_text.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/panel.xml | 3 |
22 files changed, 132 insertions, 98 deletions
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 0d340699c5..07c0f3ce84 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -110,8 +110,6 @@ LLPanel::LLPanel(const LLPanel::Params& p) // *NOTE: Be sure to also change LLPanel::initFromParams(). We have too // many classes derived from LLPanel to retrofit them all to pass in params. { - setIsChrome(FALSE); - if (p.has_border) { addBorder(p.border); diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index f9f0307d17..86bd2f05ce 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -106,7 +106,7 @@ void LLRadioGroup::setIndexEnabled(S32 index, BOOL enabled) child->setEnabled(enabled); if (index == mSelectedIndex && enabled == FALSE) { - mSelectedIndex = -1; + setSelectedIndex(-1); } break; } diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp index 073e14386f..ba53f84877 100644 --- a/indra/llui/llscrolllistcolumn.cpp +++ b/indra/llui/llscrolllistcolumn.cpp @@ -47,6 +47,21 @@ const S32 MIN_COLUMN_WIDTH = 20; //--------------------------------------------------------------------------- // LLScrollColumnHeader //--------------------------------------------------------------------------- +LLScrollColumnHeader::Params::Params() +: column("column") +{ + name = "column_header"; + image_unselected.name("square_btn_32x128.tga"); + image_selected.name("square_btn_selected_32x128.tga"); + image_disabled.name("square_btn_32x128.tga"); + image_disabled_selected.name("square_btn_selected_32x128.tga"); + image_overlay.name("combobox_arrow.tga"); + image_overlay_alignment("right"); + font_halign = LLFontGL::LEFT; + tab_stop(false); + scale_image(true); +} + LLScrollColumnHeader::LLScrollColumnHeader(const LLScrollColumnHeader::Params& p) : LLButton(p), // use combobox params to steal images diff --git a/indra/llui/llscrolllistcolumn.h b/indra/llui/llscrolllistcolumn.h index 23318fd7c4..5aef6e8e94 100644 --- a/indra/llui/llscrolllistcolumn.h +++ b/indra/llui/llscrolllistcolumn.h @@ -50,20 +50,7 @@ public: { Mandatory<LLScrollListColumn*> column; - Params() - : column("column") - { - name = "column_header"; - image_unselected.name("square_btn_32x128.tga"); - image_selected.name("square_btn_selected_32x128.tga"); - image_disabled.name("square_btn_32x128.tga"); - image_disabled_selected.name("square_btn_selected_32x128.tga"); - image_overlay.name("combobox_arrow.tga"); - image_overlay_alignment("right"); - font_halign = LLFontGL::LEFT; - tab_stop(false); - scale_image(true); - } + Params(); }; LLScrollColumnHeader(const Params&); ~LLScrollColumnHeader(); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 2b1d677ffb..9a26f0b472 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -933,13 +933,16 @@ BOOL LLTextBase::handleToolTip(S32 x, S32 y, MASK mask) void LLTextBase::reshape(S32 width, S32 height, BOOL called_from_parent) { - LLUICtrl::reshape( width, height, called_from_parent ); + if (width != getRect().getWidth() || height != getRect().getHeight()) + { + LLUICtrl::reshape( width, height, called_from_parent ); - // do this first after reshape, because other things depend on - // up-to-date mTextRect - updateRects(); - - needsReflow(); + // do this first after reshape, because other things depend on + // up-to-date mTextRect + updateRects(); + + needsReflow(); + } } void LLTextBase::draw() @@ -1193,11 +1196,10 @@ void LLTextBase::reflow(S32 start_index) //llassert_always(getLocalRectFromDocIndex(mScrollIndex).mBottom == first_char_rect.mBottom); } } - } - - // reset desired x cursor position - updateCursorXPos(); + // reset desired x cursor position + updateCursorXPos(); + } } LLRect LLTextBase::getContentsRect() @@ -2108,9 +2110,12 @@ LLRect LLTextBase::getVisibleDocumentRect() const } else { - // entire document rect when not scrolling + // entire document rect is visible when not scrolling + // but offset according to height of widget LLRect doc_rect = mDocumentView->getLocalRect(); - doc_rect.translate(-mDocumentView->getRect().mLeft, -mDocumentView->getRect().mBottom); + doc_rect.mLeft -= mDocumentView->getRect().mLeft; + // adjust for height of text above widget baseline + doc_rect.mBottom = llmin(0, doc_rect.getHeight() - mTextRect.getHeight()); return doc_rect; } } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 14fd786127..4cca522a23 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -154,6 +154,9 @@ public: LLRect getContentsRect(); LLRect getVisibleDocumentRect() const; + S32 getVPad() { return mVPad; } + S32 getHPad() { return mHPad; } + S32 getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const; LLRect getLocalRectFromDocIndex(S32 pos) const; diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index f0238dba49..3ce5a0320b 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -652,6 +652,13 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; + // set focus first, in case click callbacks want to change it + // RN: do we really need to have a tab stop? + if (hasTabStop()) + { + setFocus( TRUE ); + } + // Let scrollbar have first dibs handled = LLTextBase::handleMouseDown(x, y, mask); @@ -694,12 +701,6 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) handled = TRUE; } - if (hasTabStop()) - { - setFocus( TRUE ); - handled = TRUE; - } - // Delay cursor flashing resetCursorBlink(); @@ -708,29 +709,32 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) { - BOOL handled = LLTextBase::handleRightMouseDown(x, y, mask); - if (!handled && hasTabStop()) + if (hasTabStop()) + { + setFocus(TRUE); + } + if (!LLTextBase::handleRightMouseDown(x, y, mask)) { - setFocus( TRUE ); showContextMenu(x, y); - handled = TRUE; } - return handled; + return TRUE; } BOOL LLTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) { - BOOL handled = FALSE; - handled = LLTextBase::handleMouseDown(x, y, mask); + if (hasTabStop()) + { + setFocus(TRUE); + } - if (!handled) + if (!LLTextBase::handleMouseDown(x, y, mask)) { - setFocus( TRUE ); if( canPastePrimary() ) { setCursorAtLocalPos( x, y, true ); + // does not rely on focus being set pastePrimary(); } } diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 34501ae080..23c87c7522 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -161,10 +161,7 @@ LLToolTip::Params::Params() web_based_media("web_based_media", false), media_playing("media_playing", false) { - name = "tooltip"; - font = LLFontGL::getFontSansSerif(); - bg_opaque_color = LLUIColorTable::instance().getColor( "ToolTipBgColor" ); - background_visible = true; + chrome = true; } LLToolTip::LLToolTip(const LLToolTip::Params& p) @@ -208,6 +205,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) icon_params.rect = icon_rect; //icon_params.follows.flags = FOLLOWS_LEFT | FOLLOWS_BOTTOM; icon_params.image_unselected(imagep); + icon_params.image_selected(imagep); icon_params.scale_image(true); icon_params.flash_color(icon_params.highlight_color()); mInfoButton = LLUICtrlFactory::create<LLButton>(icon_params); @@ -221,7 +219,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) mTextBox->translate(TOOLTIP_ICON_SIZE + mPadding, 0); } - if (p.time_based_media.isProvided() && p.time_based_media == true) + if (p.time_based_media) { LLButton::Params p_button; p_button.name(std::string("play_media")); @@ -238,17 +236,14 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) { mPlayMediaButton->setCommitCallback(boost::bind(p.click_playmedia_callback())); } - if(p.media_playing.isProvided()) - { - mPlayMediaButton->setToggleState(p.media_playing); - } + mPlayMediaButton->setToggleState(p.media_playing); addChild(mPlayMediaButton); // move text over to fit image in mTextBox->translate(TOOLTIP_PLAYBUTTON_SIZE + mPadding, 0); } - if (p.web_based_media.isProvided() && p.web_based_media == true) + if (p.web_based_media) { LLButton::Params p_w_button; p_w_button.name(std::string("home_page")); @@ -455,7 +450,10 @@ void LLToolTipMgr::show(const std::string& msg) void LLToolTipMgr::show(const LLToolTip::Params& params) { - if (!params.validateBlock()) + // fill in default tooltip params from tool_tip.xml + LLToolTip::Params params_with_defaults(params); + params_with_defaults.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLToolTip>()); + if (!params_with_defaults.validateBlock()) { llwarns << "Could not display tooltip!" << llendl; return; @@ -467,12 +465,12 @@ void LLToolTipMgr::show(const LLToolTip::Params& params) // are we ready to show the tooltip? if (!mToolTipsBlocked // we haven't hit a key, moved the mouse, etc. - && LLUI::getMouseIdleTime() > params.delay_time) // the mouse has been still long enough + && LLUI::getMouseIdleTime() > params_with_defaults.delay_time) // the mouse has been still long enough { - bool tooltip_changed = mLastToolTipParams.message() != params.message() - || mLastToolTipParams.pos() != params.pos() - || mLastToolTipParams.time_based_media() != params.time_based_media() - || mLastToolTipParams.web_based_media() != params.web_based_media(); + bool tooltip_changed = mLastToolTipParams.message() != params_with_defaults.message() + || mLastToolTipParams.pos() != params_with_defaults.pos() + || mLastToolTipParams.time_based_media() != params_with_defaults.time_based_media() + || mLastToolTipParams.web_based_media() != params_with_defaults.web_based_media(); bool tooltip_shown = mToolTip && mToolTip->getVisible() @@ -480,7 +478,7 @@ void LLToolTipMgr::show(const LLToolTip::Params& params) mNeedsToolTip = tooltip_changed || !tooltip_shown; // store description of tooltip for later creation - mNextToolTipParams = params; + mNextToolTipParams = params_with_defaults; } } diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 4a5f60f93d..30d251266c 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -78,16 +78,13 @@ public: visible_time_far; // time for which tooltip is visible while mouse moved away Optional<LLRect> sticky_rect; Optional<const LLFontGL*> font; - - Optional<click_callback_t> click_callback; Optional<LLUIImage*> image; - - - Optional<bool> time_based_media; - Optional<bool> web_based_media; - Optional<bool> media_playing; - Optional<click_callback_t> click_playmedia_callback; - Optional<click_callback_t> click_homepage_callback; + Optional<bool> time_based_media, + web_based_media, + media_playing; + Optional<click_callback_t> click_callback, + click_playmedia_callback, + click_homepage_callback; Optional<S32> max_width; Optional<S32> padding; Optional<bool> wrap; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 48504a1e54..a82e6eb372 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1953,11 +1953,6 @@ namespace LLInitParam } } - if (mData.mValue == NULL) - { - mData.mValue = LLFontGL::getFontDefault(); - } - // default to current value return mData.mValue; } diff --git a/indra/llui/llui.h b/indra/llui/llui.h index efb1b0a36f..5ec07f1941 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -404,6 +404,20 @@ namespace LLInitParam LLUIColor getValueFromBlock() const; }; + // provide a better default for Optional<const LLFontGL*> than NULL + template <> + struct DefaultInitializer<const LLFontGL*> + { + // return reference to a single default instance of T + // built-in types will be initialized to zero, default constructor otherwise + static const LLFontGL* get() + { + static const LLFontGL* sDefaultFont = LLFontGL::getFontDefault(); + return sDefaultFont; + } + }; + + template<> class TypedParam<const LLFontGL*> : public BlockValue<const LLFontGL*> diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 0faff5eff6..08fc8fb784 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -42,6 +42,7 @@ static LLDefaultChildRegistry::Register<LLUICtrl> r("ui_ctrl"); LLUICtrl::Params::Params() : tab_stop("tab_stop", true), + chrome("chrome", false), label("label"), initial_value("value"), init_callback("init_callback"), @@ -86,6 +87,7 @@ void LLUICtrl::initFromParams(const Params& p) { LLView::initFromParams(p); + setIsChrome(p.chrome); setControlName(p.control_name); if(p.enabled_controls.isProvided()) { @@ -582,7 +584,6 @@ void LLUICtrl::setIsChrome(BOOL is_chrome) // virtual BOOL LLUICtrl::getIsChrome() const { - LLView* parent_ctrl = getParent(); while(parent_ctrl) { diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 45fe47772b..dd22851100 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -126,7 +126,8 @@ public: struct Params : public LLInitParam::Block<Params, LLView::Params> { Optional<std::string> label; - Optional<bool> tab_stop; + Optional<bool> tab_stop, + chrome; Optional<LLSD> initial_value; Optional<CommitCallbackParam> init_callback, diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 48b5fc11b7..7bc48185e6 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -51,7 +51,7 @@ public: /*virtual*/ void getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { // more label always spans width of text box - width = mEditor.getTextRect().getWidth(); + width = mEditor.getTextRect().getWidth() - mEditor.getHPad(); height = llceil(mStyle->getFont()->getLineHeight()); } /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const @@ -153,6 +153,11 @@ void LLExpandableTextBox::LLTextBoxEx::showExpandText() { if (!mExpanderVisible) { + // make sure we're scrolled to top when collapsing + if (mScroller) + { + mScroller->goToTop(); + } // get fully visible lines std::pair<S32, S32> visible_lines = getVisibleLines(true); S32 last_line = visible_lines.second - 1; diff --git a/indra/newview/llexpandabletextbox.h b/indra/newview/llexpandabletextbox.h index d45527aabb..3fe646c29c 100644 --- a/indra/newview/llexpandabletextbox.h +++ b/indra/newview/llexpandabletextbox.h @@ -69,16 +69,6 @@ protected: virtual S32 getVerticalTextDelta(); /** - * Returns text vertical padding - */ - virtual S32 getVPad() { return mVPad; } - - /** - * Returns text horizontal padding - */ - virtual S32 getHPad() { return mHPad; } - - /** * Shows "More" link */ void showExpandText(); diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index aa6909560d..6181531f82 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -73,10 +73,10 @@ LLPanelPicks::LLPanelPicks() mPopupMenu(NULL), mProfilePanel(NULL), mPickPanel(NULL), - mPicksList(NULL) - , mPanelPickInfo(NULL) - , mPanelPickEdit(NULL) - , mOverflowMenu(NULL) + mPicksList(NULL), + mPanelPickInfo(NULL), + mPanelPickEdit(NULL), + mOverflowMenu(NULL) { } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ba32e07464..b574a9c110 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2424,19 +2424,35 @@ void LLViewerWindow::updateUI() BOOL handled_by_top_ctrl = FALSE; LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); + LLView* captor_view = dynamic_cast<LLView*>(mouse_captor); + + //FIXME: only include captor and captor's ancestors if mouse is truly over them --RN //build set of views containing mouse cursor by traversing UI hierarchy and testing //screen rect against mouse cursor view_handle_set_t mouse_hover_set; - // start at current mouse captor (if is a view) or UI root - LLView* root_view = NULL; - root_view = dynamic_cast<LLView*>(mouse_captor); + // constraint mouse enter events to children of mouse captor + LLView* root_view = captor_view; + + // if mouse captor doesn't exist or isn't a LLView + // then allow mouse enter events on entire UI hierarchy if (!root_view) { root_view = mRootView; } + // include all ancestors of captor_view as automatically having mouse + if (captor_view) + { + LLView* captor_parent_view = captor_view->getParent(); + while(captor_parent_view) + { + mouse_hover_set.insert(captor_parent_view->getHandle()); + captor_parent_view = captor_parent_view->getParent(); + } + } + // aggregate visible views that contain mouse cursor in display order // while the top_ctrl contains the mouse cursor, only it and its descendants will receive onMouseEnter events diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 79c70c4d8f..05f7c5205d 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -734,4 +734,7 @@ <texture name="media_panel_bg.png" preload="true" scale_left="9" scale_top="9" scale_right="9" scale_bottom="9" /> <texture name="media_panel_hoverrectangle.png" preload="true" scale_left="9" scale_top="9" scale_right="9" scale_bottom="9" /> + <texture name="square_btn_32x128.tga" scale_left="2" scale_bottom="2" scale_right="126" scale_top="30"/> + <texture name="square_btn_selected_32x128.tga" scale_left="2" scale_bottom="2" scale_right="126" scale_top="30"/> + </textures> diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 9065c6b3e8..73a1bae1c6 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -10,6 +10,7 @@ left="0" name="bottom_tray" top="28" + chrome="true" border_visible="false" width="1000"> <layout_stack diff --git a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml index 1074dd4627..38ea6b6196 100644 --- a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml @@ -57,7 +57,7 @@ use_ellipses="false" width="197" word_wrap="false" /> - <text + <expandable_text follows="top|left|right" font="SansSerifSmall" height="40" diff --git a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml index 319beac291..f59c46b2f5 100644 --- a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml +++ b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml @@ -3,7 +3,7 @@ max_height="300" > <textbox more_label="More" - follows="left|top" + follows="left|top|right" name="text" allow_scroll="true" use_ellipses="true" diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml index 1bd5a5bda2..7262c0dc5c 100644 --- a/indra/newview/skins/default/xui/en/widgets/panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/panel.xml @@ -7,4 +7,5 @@ <panel bg_opaque_color="PanelFocusBackgroundColor" bg_alpha_color="PanelDefaultBackgroundColor" background_visible="false" - background_opaque="false"/> + background_opaque="false" + chrome="false"/>
\ No newline at end of file |