diff options
Diffstat (limited to 'indra/llui')
28 files changed, 178 insertions, 89 deletions
| diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 0a82bed896..e18c40e7c3 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -936,3 +936,20 @@ S32 LLAccordionCtrl::calcExpandedTabHeight(S32 tab_index /* = 0 */, S32 availabl  	expanded_tab_height /= num_expanded;  	return expanded_tab_height;  } + +void LLAccordionCtrl::collapseAllTabs()  +{ +    if (mAccordionTabs.size() > 0) +    { +        for (size_t i = 0; i < mAccordionTabs.size(); ++i) +        { +            LLAccordionCtrlTab *tab = mAccordionTabs[i]; + +            if (tab->getDisplayChildren()) +            { +                tab->setDisplayChildren(false); +            } +        } +        arrange(); +    } +} diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index 6a1989afba..f226d38bed 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -122,6 +122,8 @@ public:  	void	setComparator(const LLTabComparator* comp) { mTabComparator = comp; }  	void	sort(); +    void collapseAllTabs(); +  	/**  	 * Sets filter substring as a search_term for help text when there are no any visible tabs.  	 */ diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 896a34cac4..496c34c38b 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -126,12 +126,12 @@ public:  	void setSelected(bool is_selected); -	bool getCollapsible() {return mCollapsible;}; +	bool getCollapsible() { return mCollapsible; }; -	void setCollapsible(bool collapsible) {mCollapsible = collapsible;}; +	void setCollapsible(bool collapsible) { mCollapsible = collapsible; };  	void changeOpenClose(bool is_open); -	void canOpenClose(bool can_open_close) { mCanOpenClose = can_open_close;}; +	void canOpenClose(bool can_open_close) { mCanOpenClose = can_open_close; };  	bool canOpenClose() const { return mCanOpenClose; };  	virtual BOOL postBuild(); @@ -142,8 +142,8 @@ public:  	void draw(); -	void    storeOpenCloseState		(); -	void    restoreOpenCloseState	(); +	void storeOpenCloseState(); +	void restoreOpenCloseState();  protected:  	LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&); diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 9ef019840a..b93b92a2e7 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -58,10 +58,11 @@ static LLDefaultChildRegistry::Register<LLButton> r("button");  template class LLButton* LLView::getChild<class LLButton>(  	const std::string& name, BOOL recurse) const; -// globals loaded from settings.xml -S32	LLBUTTON_H_PAD	= 0; -S32 BTN_HEIGHT_SMALL= 0; -S32 BTN_HEIGHT		= 0; +// globals +S32	LLBUTTON_H_PAD	= 4; +S32 BTN_HEIGHT_SMALL= 23; +S32 BTN_HEIGHT		= 23; +S32 BTN_DROP_SHADOW = 2;  LLButton::Params::Params()  :	label_selected("label_selected"),				// requires is_toggle true @@ -92,8 +93,8 @@ LLButton::Params::Params()  	image_overlay_disabled_color("image_overlay_disabled_color", LLColor4::white % 0.3f),  	image_overlay_selected_color("image_overlay_selected_color", LLColor4::white),  	flash_color("flash_color"), -	pad_right("pad_right", LLUI::getInstance()->mSettingGroups["config"]->getS32("ButtonHPad")), -	pad_left("pad_left", LLUI::getInstance()->mSettingGroups["config"]->getS32("ButtonHPad")), +	pad_right("pad_right", LLBUTTON_H_PAD), +	pad_left("pad_left", LLBUTTON_H_PAD),  	pad_bottom("pad_bottom"),  	click_callback("click_callback"),  	mouse_down_callback("mouse_down_callback"), diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 257159f64f..5ab7f07ab8 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -43,10 +43,10 @@  //  // PLEASE please use these "constants" when building your own buttons. -// They are loaded from settings.xml at run time.  extern S32	LLBUTTON_H_PAD;  extern S32	BTN_HEIGHT_SMALL;  extern S32	BTN_HEIGHT; +extern S32	BTN_DROP_SHADOW;  //  // Helpful functions diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 9ca05a16f3..8bf1bb9c9f 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -188,6 +188,8 @@ LLComboBox::~LLComboBox()  	// explicitly disconect this signal, since base class destructor might fire top lost  	mTopLostSignalConnection.disconnect();      mImageLoadedConnection.disconnect(); + +    LLUI::getInstance()->removePopup(this);  } @@ -482,8 +484,6 @@ void LLComboBox::onFocusLost()  void LLComboBox::setButtonVisible(BOOL visible)  { -	static LLUICachedControl<S32> drop_shadow_button ("DropShadowButton", 0); -  	mButton->setVisible(visible);  	if (mTextEntry)  	{ @@ -491,7 +491,7 @@ void LLComboBox::setButtonVisible(BOOL visible)  		if (visible)  		{  			S32 arrow_width = mArrowImage ? mArrowImage->getWidth() : 0; -			text_entry_rect.mRight -= llmax(8,arrow_width) + 2 * drop_shadow_button; +			text_entry_rect.mRight -= llmax(8,arrow_width) + 2 * BTN_DROP_SHADOW;  		}  		//mTextEntry->setRect(text_entry_rect);  		mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), TRUE); @@ -530,19 +530,18 @@ void LLComboBox::setEnabledByValue(const LLSD& value, BOOL enabled)  void LLComboBox::createLineEditor(const LLComboBox::Params& p)  { -	static LLUICachedControl<S32> drop_shadow_button ("DropShadowButton", 0);  	LLRect rect = getLocalRect();  	if (mAllowTextEntry)  	{  		S32 arrow_width = mArrowImage ? mArrowImage->getWidth() : 0; -		S32 shadow_size = drop_shadow_button; +		S32 shadow_size = BTN_DROP_SHADOW;  		mButton->setRect(LLRect( getRect().getWidth() - llmax(8,arrow_width) - 2 * shadow_size,  								rect.mTop, rect.mRight, rect.mBottom));  		mButton->setTabStop(FALSE);  		mButton->setHAlign(LLFontGL::HCENTER);  		LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); -		text_entry_rect.mRight -= llmax(8,arrow_width) + 2 * drop_shadow_button; +		text_entry_rect.mRight -= llmax(8,arrow_width) + 2 * BTN_DROP_SHADOW;  		// clear label on button  		std::string cur_label = mButton->getLabelSelected();  		LLLineEditor::Params params = p.combo_editor; @@ -1081,13 +1080,11 @@ void LLComboBox::onSetHighlight() const  void LLComboBox::imageLoaded()  { -    static LLUICachedControl<S32> drop_shadow_button("DropShadowButton", 0); -      if (mAllowTextEntry)      {          LLRect rect = getLocalRect();          S32 arrow_width = mArrowImage ? mArrowImage->getWidth() : 0; -        S32 shadow_size = drop_shadow_button; +        S32 shadow_size = BTN_DROP_SHADOW;          mButton->setRect(LLRect(getRect().getWidth() - llmax(8, arrow_width) - 2 * shadow_size,              rect.mTop, rect.mRight, rect.mBottom));          if (mButton->getVisible()) @@ -1096,7 +1093,7 @@ void LLComboBox::imageLoaded()              if (mTextEntry)              {                  LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); -                text_entry_rect.mRight -= llmax(8, arrow_width) + 2 * drop_shadow_button; +                text_entry_rect.mRight -= llmax(8, arrow_width) + 2 * BTN_DROP_SHADOW;                  mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), TRUE);              }          } diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 460bd0945b..fd4c33df30 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -1361,26 +1361,28 @@ void LLFlatListViewEx::setForceShowingUnmatchedItems(bool show)  	mForceShowingUnmatchedItems = show;  } -void LLFlatListViewEx::setFilterSubString(const std::string& filter_str) +void LLFlatListViewEx::setFilterSubString(const std::string& filter_str, bool notify_parent)  {  	if (0 != LLStringUtil::compareInsensitive(filter_str, mFilterSubString))  	{  		mFilterSubString = filter_str;  		updateNoItemsMessage(mFilterSubString); -		filterItems(); +		filterItems(false, notify_parent);  	}  } -void LLFlatListViewEx::updateItemVisibility(LLPanel* item, const LLSD &action) +bool LLFlatListViewEx::updateItemVisibility(LLPanel* item, const LLSD &action)  { -	if (!item) return; +    if (!item) +        return false; + +	BOOL visible = TRUE;  	// 0 signifies that filter is matched,  	// i.e. we don't hide items that don't support 'match_filter' action, separators etc.  	if (0 == item->notify(action))  	{  		mHasMatchedItems = true; -		item->setVisible(true);  	}  	else  	{ @@ -1388,34 +1390,45 @@ void LLFlatListViewEx::updateItemVisibility(LLPanel* item, const LLSD &action)  		if (!mForceShowingUnmatchedItems)  		{  			selectItem(item, false); +			visible = FALSE;  		} -		item->setVisible(mForceShowingUnmatchedItems);  	} + +	if (item->getVisible() != visible) +	{ +		item->setVisible(visible); +		return true; +	} + +	return false;  } -void LLFlatListViewEx::filterItems() +void LLFlatListViewEx::filterItems(bool re_sort, bool notify_parent)  { -	typedef std::vector <LLPanel*> item_panel_list_t; -  	std::string cur_filter = mFilterSubString;  	LLStringUtil::toUpper(cur_filter);  	LLSD action;  	action.with("match_filter", cur_filter); -	item_panel_list_t items; -	getItems(items); -  	mHasMatchedItems = false; -    item_panel_list_t::iterator iter = items.begin(), iter_end = items.end(); -	while (iter < iter_end) +	bool visibility_changed = false; +	pairs_const_iterator_t iter = getItemPairs().begin(), iter_end = getItemPairs().end(); +	while (iter != iter_end)  	{ -		LLPanel* pItem = *(iter++); -		updateItemVisibility(pItem, action); +		LLPanel* pItem = (*(iter++))->first; +		visibility_changed |= updateItemVisibility(pItem, action);  	} -	sort(); -	notifyParentItemsRectChanged(); +    if (re_sort) +    { +        sort(); +    } + +    if (visibility_changed && notify_parent) +    { +        notifyParentItemsRectChanged(); +    }  }  bool LLFlatListViewEx::hasMatchedItems() diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h index d47c1cf333..adb0e3e553 100644 --- a/indra/llui/llflatlistview.h +++ b/indra/llui/llflatlistview.h @@ -300,6 +300,7 @@ public:  	virtual S32	notify(const LLSD& info) ;  	virtual ~LLFlatListView(); +  protected:  	/** Pairs LLpanel representing a single item LLPanel and LLSD associated with it */ @@ -375,7 +376,9 @@ protected:  	LLRect getLastSelectedItemRect(); -	void   ensureSelectedVisible(); +	void ensureSelectedVisible(); + +	const pairs_list_t& getItemPairs() { return mItemPairs; }  private: @@ -482,14 +485,14 @@ public:  	/**  	 * Sets up new filter string and filters the list.  	 */ -	void setFilterSubString(const std::string& filter_str); +	void setFilterSubString(const std::string& filter_str, bool notify_parent);  	std::string getFilterSubString() { return mFilterSubString; }  	/**  	 * Filters the list, rearranges and notifies parent about shape changes.  	 * Derived classes may want to overload rearrangeItems() to exclude repeated separators after filtration.  	 */ -	void filterItems(); +	void filterItems(bool re_sort, bool notify_parent);  	/**  	 * Returns true if last call of filterItems() found at least one matching item @@ -513,7 +516,7 @@ protected:  	* @param item - item we are changing  	* @param item - action - parameters to determin visibility from  	*/ -	void updateItemVisibility(LLPanel* item, const LLSD &action); +	bool updateItemVisibility(LLPanel* item, const LLSD &action);  private:  	std::string mNoFilteredItemsMsg; diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index de3de53569..5787bc5929 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2039,10 +2039,9 @@ void	LLFloater::drawShadow(LLPanel* panel)  	S32 right = panel->getRect().getWidth() - LLPANEL_BORDER_WIDTH;  	S32 bottom = LLPANEL_BORDER_WIDTH; -	static LLUICachedControl<S32> shadow_offset_S32 ("DropShadowFloater", 0);  	static LLUIColor shadow_color_cached = LLUIColorTable::instance().getColor("ColorDropShadow");  	LLColor4 shadow_color = shadow_color_cached; -	F32 shadow_offset = (F32)shadow_offset_S32; +	F32 shadow_offset = (F32)DROP_SHADOW_FLOATER;  	if (!panel->isBackgroundOpaque())  	{ diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 88f9e77777..17dde69de7 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -61,6 +61,10 @@ const BOOL CLOSE_NO = FALSE;  const BOOL ADJUST_VERTICAL_YES = TRUE;  const BOOL ADJUST_VERTICAL_NO = FALSE; +const F32 CONTEXT_CONE_IN_ALPHA = 0.f; +const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; +const F32 CONTEXT_CONE_FADE_TIME = .08f; +  namespace LLFloaterEnums  {  	enum EOpenPositioning diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 650ae9ae75..cbe8cf2dac 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -256,7 +256,13 @@ LLFolderView::LLFolderView(const Params& p)  // Destroys the object  LLFolderView::~LLFolderView( void )  { -	closeRenamer(); +    mRenamerTopLostSignalConnection.disconnect(); +    if (mRenamer) +    { +        // instead of using closeRenamer remove it directly, +        // since it might already be hidden +        LLUI::getInstance()->removePopup(mRenamer); +    }  	// The release focus call can potentially call the  	// scrollcontainer, which can potentially be called with a partly @@ -335,9 +341,9 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height )  void LLFolderView::filter( LLFolderViewFilter& filter )  {      LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; -    static LLCachedControl<S32> time_visible(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameVisible", 10); -    static LLCachedControl<S32> time_invisible(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameUnvisible", 1); -    filter.resetTime(llclamp((mParentPanel.get()->getVisible() ? time_visible() : time_invisible()), 1, 100)); +    const S32 TIME_VISIBLE = 10; // in milliseconds +    const S32 TIME_INVISIBLE = 1; +    filter.resetTime(llclamp((mParentPanel.get()->getVisible() ? TIME_VISIBLE : TIME_INVISIBLE), 1, 100));      // Note: we filter the model, not the view  	getViewModelItem()->filter(filter); @@ -765,7 +771,7 @@ void LLFolderView::removeSelectedItems()  			}  			else  			{ -				LL_INFOS() << "Cannot delete " << item->getName() << LL_ENDL; +				LL_DEBUGS() << "Cannot delete " << item->getName() << LL_ENDL;  				return;  			}  		} @@ -1072,7 +1078,10 @@ void LLFolderView::startRenamingSelectedItem( void )  		mRenamer->setVisible( TRUE );  		// set focus will fail unless item is visible  		mRenamer->setFocus( TRUE ); -		mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this)); +        if (!mRenamerTopLostSignalConnection.connected()) +        { +            mRenamerTopLostSignalConnection = mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this)); +        }  		LLUI::getInstance()->addPopup(mRenamer);  	}  } @@ -1598,7 +1607,11 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,  void LLFolderView::deleteAllChildren()  { -	closeRenamer(); +    mRenamerTopLostSignalConnection.disconnect(); +    if (mRenamer) +    { +        LLUI::getInstance()->removePopup(mRenamer); +    }  	if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();  	mPopupMenuHandle.markDead();  	mScrollContainer = NULL; diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 5f8a173889..f3c23ffc17 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -345,6 +345,8 @@ protected:  	LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* mCallbackRegistrar;  	LLUICtrl::EnableCallbackRegistry::ScopedRegistrar* mEnableRegistrar; +    boost::signals2::connection mRenamerTopLostSignalConnection; +      bool mForceArrange;  public: diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index bc9469cfad..de4fce86de 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -601,15 +601,13 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask )  BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )  { -	static LLCachedControl<S32> drag_and_drop_threshold(*LLUI::getInstance()->mSettingGroups["config"],"DragAndDropDistanceThreshold", 3); -  	mIsMouseOverTitle = (y > (getRect().getHeight() - mItemHeight));  	if( hasMouseCapture() && isMovable() )  	{  			LLFolderView* root = getRoot(); -		if( (x - mDragStartX) * (x - mDragStartX) + (y - mDragStartY) * (y - mDragStartY) > drag_and_drop_threshold() * drag_and_drop_threshold()  +		if( (x - mDragStartX) * (x - mDragStartX) + (y - mDragStartY) * (y - mDragStartY) > DRAG_N_DROP_DISTANCE_THRESHOLD * DRAG_N_DROP_DISTANCE_THRESHOLD  			&& root->getAllowDrag()  			&& root->getCurSelectedItem()  			&& root->startDrag()) diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp index f217b743a0..96aca62927 100644 --- a/indra/llui/llfolderviewmodel.cpp +++ b/indra/llui/llfolderviewmodel.cpp @@ -48,8 +48,8 @@ std::string LLFolderViewModelCommon::getStatusText(bool is_empty_folder)  void LLFolderViewModelCommon::filter()  { -    static LLCachedControl<S32> max_time(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameVisible", 10); -    getFilter().resetTime(llclamp(max_time(), 1, 100)); +    const S32 MAX_FILTER_TIME = 10; +    getFilter().resetTime(MAX_FILTER_TIME);      mFolderView->getViewModelItem()->filter(getFilter());  } diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 551a60e097..0f11560790 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -170,7 +170,7 @@ public:  	virtual BOOL isItemMovable( void ) const = 0;		// Can be moved to another folder  	virtual void move( LLFolderViewModelItem* parent_listener ) = 0; -	virtual BOOL isItemRemovable( void ) const = 0;		// Can be destroyed +	virtual BOOL isItemRemovable( bool check_worn = true ) const = 0;		// Can be destroyed  	virtual BOOL removeItem() = 0;  	virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch) = 0; diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 453fa29e7c..1928c0157e 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -96,6 +96,7 @@ LLLineEditor::Params::Params()  	commit_on_focus_lost("commit_on_focus_lost", true),  	ignore_tab("ignore_tab", true),  	is_password("is_password", false), +	allow_emoji("allow_emoji"),  	cursor_color("cursor_color"),  	use_bg_color("use_bg_color", false),  	bg_color("bg_color"), @@ -142,6 +143,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)  	mIgnoreArrowKeys( FALSE ),  	mIgnoreTab( p.ignore_tab ),  	mDrawAsterixes( p.is_password ), +	mAllowEmoji( p.allow_emoji ),  	mSpellCheck( p.spellcheck ),  	mSpellCheckStart(-1),  	mSpellCheckEnd(-1), @@ -416,8 +418,13 @@ void LLLineEditor::setText(const LLStringExplicit &new_text, bool use_size_limit  	all_selected = all_selected || (len == 0 && hasFocus() && mSelectAllonFocusReceived);  	std::string truncated_utf8 = new_text; +	if (!mAllowEmoji) +	{ +		// Cut emoji symbols if exist +        utf8str_remove_emojis(truncated_utf8); +	}  	if (use_size_limit && truncated_utf8.size() > (U32)mMaxLengthBytes) -	{	 +	{  		truncated_utf8 = utf8str_truncate(new_text, mMaxLengthBytes);  	}  	mText.assign(truncated_utf8); @@ -589,13 +596,21 @@ void LLLineEditor::replaceWithSuggestion(U32 index)  	{  		if ( (it->first <= (U32)mCursorPos) && (it->second >= (U32)mCursorPos) )  		{ +			LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]); +			if (!mAllowEmoji) +			{ +				// Cut emoji symbols if exist +				wstring_remove_emojis(suggestion); +			} +			if (suggestion.empty()) +				return; +  			deselect();  			// Delete the misspelled word  			mText.erase(it->first, it->second - it->first);  			// Insert the suggestion in its place -			LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]);  			mText.insert(it->first, suggestion);  			setCursor(it->first + (S32)suggestion.length()); @@ -958,9 +973,11 @@ void LLLineEditor::removeChar()  	}  } -  void LLLineEditor::addChar(const llwchar uni_char)  { +	if (!mAllowEmoji && LLStringOps::isEmoji(uni_char)) +		return; +  	llwchar new_c = uni_char;  	if (hasSelection())  	{ @@ -1260,6 +1277,11 @@ void LLLineEditor::pasteHelper(bool is_primary)  		if (!paste.empty())  		{ +			if (!mAllowEmoji) +			{ +				wstring_remove_emojis(paste); +			} +  			if (!prevalidateInput(paste))  				return; diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 5794b3c35a..40de9e155e 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -93,6 +93,7 @@ public:  										bg_image_always_focused,  										show_label_focused,  										is_password, +										allow_emoji,  										use_bg_color;  		// colors @@ -241,6 +242,7 @@ public:  	void			setIgnoreArrowKeys(BOOL b)		{ mIgnoreArrowKeys = b; }  	void			setIgnoreTab(BOOL b)			{ mIgnoreTab = b; }  	void			setPassDelete(BOOL b)			{ mPassDelete = b; } +	void			setAllowEmoji(BOOL b)			{ mAllowEmoji = b; }  	void			setDrawAsterixes(BOOL b);  	// get the cursor position of the beginning/end of the prev/next word in the text @@ -403,6 +405,7 @@ protected:  	BOOL 		mShowImageFocused;  	BOOL 		mShowLabelFocused; +	bool		mAllowEmoji;  	bool		mUseBgColor;  	LLWString	mPreeditWString; diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index fececa15cf..0803f0bd12 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -66,8 +66,8 @@  LLMenuHolderGL *LLMenuGL::sMenuContainer = NULL;  view_listener_t::listener_map_t view_listener_t::sListeners; -S32 MENU_BAR_HEIGHT = 0; -S32 MENU_BAR_WIDTH = 0; +S32 MENU_BAR_HEIGHT = 18; +S32 MENU_BAR_WIDTH = 410;  ///============================================================================  /// Local function declarations, constants, enums, and typedefs @@ -3234,10 +3234,9 @@ void LLMenuGL::draw( void )  	}  	if (mDropShadowed && !mTornOff)  	{ -		static LLUICachedControl<S32> drop_shadow_floater ("DropShadowFloater", 0);  		static LLUIColor color_drop_shadow = LLUIColorTable::instance().getColor("ColorDropShadow");  		gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0,  -			color_drop_shadow, drop_shadow_floater ); +			color_drop_shadow, DROP_SHADOW_FLOATER);  	}  	if( mBgVisible ) diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 3e5978eb59..c4dacd777e 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -67,6 +67,8 @@ LLModalDialog::~LLModalDialog()  	{  		LL_ERRS() << "Attempt to delete dialog while still in sModalStack!" << LL_ENDL;  	} + +    LLUI::getInstance()->removePopup(this);  }  // virtual @@ -284,10 +286,9 @@ BOOL LLModalDialog::handleKeyHere(KEY key, MASK mask )  void LLModalDialog::draw()  {  	static LLUIColor shadow_color = LLUIColorTable::instance().getColor("ColorDropShadow"); -	static LLUICachedControl<S32> shadow_lines ("DropShadowFloater", 0);  	gl_drop_shadow( 0, getRect().getHeight(), getRect().getWidth(), 0, -		shadow_color, shadow_lines); +		shadow_color, DROP_SHADOW_FLOATER);  	LLFloater::draw(); diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index d736aa6634..25062f2cad 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -88,6 +88,7 @@ LLNotificationForm::FormInput::FormInput()  :	type("type"),  	text("text"),  	max_length_chars("max_length_chars"), +	allow_emoji("allow_emoji"),  	width("width", 0),  	value("value")  {} @@ -1553,6 +1554,7 @@ bool LLNotifications::loadTemplates()  	if (!success || root.isNull() || !root->hasName( "notifications" ))  	{ +        LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"));  		LL_ERRS() << "Problem reading XML from UI Notifications file: " << base_filename << LL_ENDL;  		return false;  	} @@ -1563,6 +1565,7 @@ bool LLNotifications::loadTemplates()  	if(!params.validateBlock())  	{ +        LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"));  		LL_ERRS() << "Problem reading XUI from UI Notifications file: " << base_filename << LL_ENDL;  		return false;  	} @@ -1629,6 +1632,7 @@ bool LLNotifications::loadVisibilityRules()  	if(!params.validateBlock())  	{ +        LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"));  		LL_ERRS() << "Problem reading UI Notification Visibility Rules file: " << full_filename << LL_ENDL;  		return false;  	} diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 4d9a33f1d7..d44be65841 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -201,6 +201,7 @@ public:  		Mandatory<std::string>	type;  		Optional<S32>			width;  		Optional<S32>			max_length_chars; +		Optional<bool>			allow_emoji;  		Optional<std::string>	text;  		Optional<std::string>	value; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index cb36f72f6e..be40a5bb4f 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -225,7 +225,8 @@ LLTabContainer::Params::Params()  	tabs_flashing_color("tabs_flashing_color"),  	tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0),  	use_ellipses("use_ellipses"), -	font_halign("halign") +	font_halign("halign"), +    use_tab_offset("use_tab_offset", false)  {}  LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) @@ -264,7 +265,8 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)  	mTabIconCtrlPad(p.tab_icon_ctrl_pad),  	mEnableTabsFlashing(p.enable_tabs_flashing),  	mTabsFlashingColor(p.tabs_flashing_color), -	mUseTabEllipses(p.use_ellipses) +	mUseTabEllipses(p.use_ellipses), +    mUseTabOffset(p.use_tab_offset)  {  	static LLUICachedControl<S32> tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0); @@ -1023,11 +1025,10 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)  	}  	else  	{ -		tab_panel_rect = LLRect(LLPANEL_BORDER_WIDTH * 3, -								tab_panel_top, -								getRect().getWidth() - LLPANEL_BORDER_WIDTH * 2, -								tab_panel_bottom ); -	} +        S32 left_offset = mUseTabOffset ? LLPANEL_BORDER_WIDTH * 3 : LLPANEL_BORDER_WIDTH; +        S32 right_offset = mUseTabOffset ? LLPANEL_BORDER_WIDTH * 2 : LLPANEL_BORDER_WIDTH; +        tab_panel_rect = LLRect(left_offset, tab_panel_top, getRect().getWidth() - right_offset, tab_panel_bottom); +    }  	child->setFollowsAll();  	child->translate( tab_panel_rect.mLeft - child->getRect().mLeft, tab_panel_rect.mBottom - child->getRect().mBottom);  	child->reshape( tab_panel_rect.getWidth(), tab_panel_rect.getHeight(), TRUE ); @@ -1516,25 +1517,23 @@ BOOL LLTabContainer::selectTab(S32 which)  	LLTabTuple* selected_tuple = getTab(which);  	if (!selected_tuple) -	{  		return FALSE; -	} -	 +  	LLSD cbdata;  	if (selected_tuple->mTabPanel)  		cbdata = selected_tuple->mTabPanel->getName(); -	BOOL res = FALSE; -	if( !mValidateSignal || (*mValidateSignal)( this, cbdata ) ) +	BOOL result = FALSE; +	if (!mValidateSignal || (*mValidateSignal)(this, cbdata))  	{ -		res = setTab(which); -		if (res && mCommitSignal) +		result = setTab(which); +		if (result && mCommitSignal)  		{  			(*mCommitSignal)(this, cbdata);  		}  	} -	 -	return res; + +	return result;  }  // private diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index aa4a08c4ff..7d6fd15927 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -121,6 +121,8 @@ public:  		 */  		Optional<S32>						tab_icon_ctrl_pad; +        Optional<bool> use_tab_offset; +  		Params();  	}; @@ -321,6 +323,8 @@ private:  	S32								mTabIconCtrlPad;  	bool							mUseTabEllipses;      LLFrameTimer					mMouseDownTimer; + +    bool mUseTabOffset;  };  #endif  // LL_TABCONTAINER_H diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 092739a538..a247e8700a 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2694,6 +2694,7 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length )  	char* text = new char[ text_len + 1];  	if (text == NULL)  	{ +        LLError::LLUserWarningMsg::showOutOfMemory();  		LL_ERRS() << "Memory allocation failure." << LL_ENDL;			  		return FALSE;  	} diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 2707f7a15c..58ecf3e603 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -1134,8 +1134,7 @@ BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask)  	BOOL handled = FALSE;  	S32 mouse_distance_squared = (x - mMouseDownX) * (x - mMouseDownX) + (y - mMouseDownY) * (y - mMouseDownY); -	static LLCachedControl<S32> drag_threshold(*LLUI::getInstance()->mSettingGroups["config"], "DragAndDropDistanceThreshold", 3); -	if (mouse_distance_squared > drag_threshold * drag_threshold +	if (mouse_distance_squared > DRAG_N_DROP_DISTANCE_THRESHOLD * DRAG_N_DROP_DISTANCE_THRESHOLD  		&& hasMouseCapture() &&   		mStartDragItemCallback && mHandleDragItemCallback)  	{ diff --git a/indra/llui/lltransutil.cpp b/indra/llui/lltransutil.cpp index 5da722a72b..06760c4196 100644 --- a/indra/llui/lltransutil.cpp +++ b/indra/llui/lltransutil.cpp @@ -44,8 +44,13 @@ bool LLTransUtil::parseStrings(const std::string& xml_filename, const std::set<s  	bool success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root, LLDir::ALL_SKINS);  	if (!success)  	{ -		gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN); -		LL_ERRS() << "Couldn't load string table " << xml_filename << ". Please reinstall viewer from  https://secondlife.com/support/downloads/ and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL; +		//gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN); +        const std::string error_string = +            "Second Life viewer couldn't access some of the files it needs and will be closed." +            "\n\nPlease reinstall viewer from  https://secondlife.com/support/downloads/ and " +            "contact https://support.secondlife.com if issue persists after reinstall."; +        LLError::LLUserWarningMsg::show(error_string); +		LL_ERRS() << "Couldn't load string table " << xml_filename << " " << errno << LL_ENDL;  		return false;  	} @@ -60,6 +65,7 @@ bool LLTransUtil::parseLanguageStrings(const std::string& xml_filename)  	if (!success)  	{ +        LLError::LLUserWarningMsg::showMissingFiles();  		LL_ERRS() << "Couldn't load localization table " << xml_filename << LL_ENDL;  		return false;  	} diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 86b23c8c93..34a82387cd 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -53,7 +53,7 @@ class LLWindow;  class LLView;  class LLHelp; - +const S32 DRAG_N_DROP_DISTANCE_THRESHOLD = 3;  // this enum is used by the llview.h (viewer) and the llassetstorage.h (viewer and sim)   enum EDragAndDropType  { diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index cffb9933d4..4c47256519 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -41,6 +41,7 @@  const BOOL TAKE_FOCUS_YES = TRUE;  const BOOL TAKE_FOCUS_NO  = FALSE; +const S32 DROP_SHADOW_FLOATER = 5;  class LLUICtrl  	: public LLView, public boost::signals2::trackable | 
