Merov Linden avatar Merov Linden committed 45a5c53 Merge

STORM-730, STORM-717, STORM-690 : pull into viewer-beta

Comments (0)

Files changed (13)

indra/llui/lluictrl.cpp

 	case TT_INACTIVE:
 		alpha = sInactiveControlTransparency;
 		break;
+
+	case TT_FADING:
+		alpha = sInactiveControlTransparency / 2;
+		break;
 	}
 
 	return alpha;

indra/llui/lluictrl.h

 	enum ETypeTransparency
 	{
 		TT_DEFAULT,
-		TT_ACTIVE,
-		TT_INACTIVE
+		TT_ACTIVE,		// focused floater
+		TT_INACTIVE,	// other floaters
+		TT_FADING,		// fading toast
 	};
 	/*virtual*/ ~LLUICtrl();
 

indra/newview/llcallfloater.cpp

 	//chrome="true" hides floater caption 
 	if (mDragHandle)
 		mDragHandle->setTitleVisible(TRUE);
+	updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
 	
 	updateSession();
 
 }
 
 // virtual
+void LLCallFloater::setFocus( BOOL b )
+{
+	LLTransientDockableFloater::setFocus(b);
+
+	// Force using active floater transparency (STORM-730).
+	// We have to override setFocus() for LLCallFloater because selecting an item
+	// of the voice morphing combobox causes the floater to lose focus and thus become transparent.
+	updateTransparency(TT_ACTIVE);
+}
+
+// virtual
 void LLCallFloater::onParticipantsChanged()
 {
 	if (NULL == mParticipants) return;

indra/newview/llcallfloater.h

 	/*virtual*/ BOOL postBuild();
 	/*virtual*/ void onOpen(const LLSD& key);
 	/*virtual*/ void draw();
+	/*virtual*/ void setFocus( BOOL b );
 
 	/**
 	 * Is called by LLVoiceClient::notifyParticipantObservers when voice participant list is changed.

indra/newview/llfloatercamera.cpp

 {
 	setIsChrome(TRUE);
 	setTitleVisible(TRUE); // restore title visibility after chrome applying
+	updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
 
 	mRotate = getChild<LLJoystickCameraRotate>(ORBIT);
 	mZoom = findChild<LLPanelCameraZoom>(ZOOM);

indra/newview/llmoveview.cpp

 {
 	setIsChrome(TRUE);
 	setTitleVisible(TRUE); // restore title visibility after chrome applying
+	updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
 	
 	LLDockableFloater::postBuild();
 	

indra/newview/llnearbychathandler.cpp

 	:	LLToast(p),
 	 	mNearbyChatScreenChannelp(nc_channelp)
 	{
+		updateTransparency();
+		setMouseEnterCallback(boost::bind(&LLNearbyChatToast::updateTransparency, this));
+		setMouseLeaveCallback(boost::bind(&LLNearbyChatToast::updateTransparency, this));
 	}
 
 	/*virtual*/ void onClose(bool app_quitting);
+	/*virtual*/ void setBackgroundOpaque(BOOL b);
+
+protected:
+	/*virtual*/ void setTransparentState(bool transparent);
 
 private:
+	void updateTransparency();
+
 	LLNearbyChatScreenChannel*	mNearbyChatScreenChannelp;
 };
 
 	mNearbyChatScreenChannelp->onToastDestroyed(this, app_quitting);
 }
 
+// virtual
+void LLNearbyChatToast::setBackgroundOpaque(BOOL b)
+{
+	// We don't want background changes: transparency is handled differently.
+	LLToast::setBackgroundOpaque(TRUE);
+}
+
+// virtual
+void LLNearbyChatToast::setTransparentState(bool transparent)
+{
+	LLToast::setTransparentState(transparent);
+	updateTransparency();
+}
+
+void LLNearbyChatToast::updateTransparency()
+{
+	ETypeTransparency transparency_type;
+
+	if (isHovered())
+	{
+		transparency_type = TT_ACTIVE;
+	}
+	else
+	{
+		transparency_type = getTransparentState() ? TT_FADING : TT_INACTIVE;
+	}
+
+	LLFloater::updateTransparency(transparency_type);
+}
+
 // EOF

indra/newview/llpanellandmarkinfo.cpp

 
 	populateFoldersList();
 
+	// Prevent the floater from losing focus (if the sidepanel is undocked).
+	setFocus(TRUE);
+
 	LLPanelPlaceInfo::setInfoType(type);
 }
 
 		// when it was enabled/disabled we set the text once again.
 		mNotesEditor->setText(mNotesEditor->getText());
 	}
+
+	// Prevent the floater from losing focus (if the sidepanel is undocked).
+	setFocus(TRUE);
 }
 
 const std::string& LLPanelLandmarkInfo::getLandmarkTitle() const

indra/newview/llpanelpicks.cpp

 		mNoPicks = false;
 		mNoClassifieds = false;
 
-		getChild<LLUICtrl>("picks_panel_text")->setValue(LLTrans::getString("PicksClassifiedsLoadingText"));
+		mNoItemsLabel->setValue(LLTrans::getString("PicksClassifiedsLoadingText"));
+		mNoItemsLabel->setVisible(TRUE);
 
 		mPicksList->clear();
 		LLAvatarPropertiesProcessor::getInstance()->sendAvatarPicksRequest(getAvatarId());
 		mNoClassifieds = !mClassifiedsList->size();
 	}
 
-	if (mNoPicks && mNoClassifieds)
+	bool no_data = mNoPicks && mNoClassifieds;
+	mNoItemsLabel->setVisible(no_data);
+	if (no_data)
 	{
 		if(getAvatarId() == gAgentID)
 		{
-			getChild<LLUICtrl>("picks_panel_text")->setValue(LLTrans::getString("NoPicksClassifiedsText"));
+			mNoItemsLabel->setValue(LLTrans::getString("NoPicksClassifiedsText"));
 		}
 		else
 		{
-			getChild<LLUICtrl>("picks_panel_text")->setValue(LLTrans::getString("NoAvatarPicksClassifiedsText"));
+			mNoItemsLabel->setValue(LLTrans::getString("NoAvatarPicksClassifiedsText"));
 		}
 	}
 }
 	mPicksList->setNoItemsCommentText(getString("no_picks"));
 	mClassifiedsList->setNoItemsCommentText(getString("no_classifieds"));
 
+	mNoItemsLabel = getChild<LLUICtrl>("picks_panel_text");
+
 	childSetAction(XML_BTN_NEW, boost::bind(&LLPanelPicks::onClickPlusBtn, this));
 	childSetAction(XML_BTN_DELETE, boost::bind(&LLPanelPicks::onClickDelete, this));
 	childSetAction(XML_BTN_TELEPORT, boost::bind(&LLPanelPicks::onClickTeleport, this));
 
 void LLPanelPicks::onPanelPickClose(LLPanel* panel)
 {
-	panel->setVisible(FALSE);
+	getProfilePanel()->closePanel(panel);
 }
 
 void LLPanelPicks::onPanelPickSave(LLPanel* panel)

indra/newview/llpanelpicks.h

 	LLPanelClassifiedInfo* mPanelClassifiedInfo;
 	LLPanelPickEdit* mPanelPickEdit;
 	LLToggleableMenu* mPlusMenu;
+	LLUICtrl* mNoItemsLabel;
 
 	// <classified_id, edit_panel>
 	typedef std::map<LLUUID, LLPanelClassifiedEdit*> panel_classified_edit_map_t;

indra/newview/llpanelprofile.cpp

 
 void LLPanelProfile::openPanel(LLPanel* panel, const LLSD& params)
 {
+	// Hide currently visible panel (STORM-690).
+	setAllChildrenVisible(FALSE);
+
+	// Add the panel or bring it to front.
 	if (panel->getParent() != this)
 	{
 		addChild(panel);
 	if (panel->getParent() == this) 
 	{
 		removeChild(panel);
+
+		// Make the underlying panel visible.
+		const child_list_t* child_list = getChildList();
+		if (child_list->size() > 0)
+		{
+			child_list->front()->setVisible(TRUE);
+			child_list->front()->setFocus(TRUE); // prevent losing focus by the floater
+		}
+		else
+		{
+			llwarns << "No underlying panel to make visible." << llendl;
+		}
 	}
 }
 

indra/newview/lltoast.cpp

 	// init callbacks if present
 	if(!p.on_delete_toast().empty())
 		mOnDeleteToastSignal.connect(p.on_delete_toast());
-
-	// *TODO: This signal doesn't seem to be used at all.
-	if(!p.on_mouse_enter().empty())
-		mOnMouseEnterSignal.connect(p.on_mouse_enter());
 }
 
 void LLToast::reshape(S32 width, S32 height, BOOL called_from_parent)
 		{
 			mHideBtn->setVisible(TRUE);
 		}
-		mOnMouseEnterSignal(this);
 		mToastMouseEnterSignal(this, getValue());
 	}
 }

indra/newview/lltoast.h

 										fading_time_secs; // Number of seconds while a toast is transparent
 
 
-		Optional<toast_callback_t>		on_delete_toast,
-										on_mouse_enter;
+		Optional<toast_callback_t>		on_delete_toast;
 		Optional<bool>					can_fade,
 										can_be_stored,
 										enable_hide_btn,
 	//
 	virtual void setVisible(BOOL show);
 
-	/*virtual*/ void setBackgroundOpaque(BOOL b);
+	virtual void setBackgroundOpaque(BOOL b);
 	//
 	virtual void hide();
 
 
 	// Registers signals/callbacks for events
 	toast_signal_t mOnFadeSignal;
-	toast_signal_t mOnMouseEnterSignal;
 	toast_signal_t mOnDeleteToastSignal;
 	toast_signal_t mOnToastDestroyedSignal;
 	boost::signals2::connection setOnFadeCallback(toast_callback_t cb) { return mOnFadeSignal.connect(cb); }
 
 	LLHandle<LLToast> getHandle() { mHandle.bind(this); return mHandle; }
 
+	bool			getTransparentState() const { return mIsTransparent; }
+	virtual void	setTransparentState(bool transparent);
+
+
 private:
 
 	void onToastMouseEnter();
 
 	void expire();
 
-	void setTransparentState(bool transparent);
-
 	LLUUID				mNotificationID;
 	LLUUID				mSessionID;
 	LLNotificationPtr	mNotification;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.