From 4b161b8839fa115947d8d580c575d9b91c88fbc9 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Wed, 17 Feb 2010 16:00:28 +0200 Subject: Fixed low bug EXT-4246 - Close button on notification toast is larger than host spot. Close button is partially positioned out of toast(floater). Usually, hovering or clicking that "outer" part of the button can not be handled. The workaround is to position the button on the floater and make the floater background invisible. Now close button is properly handled, but toast is transparent. To fix this i added wrapper_panel that looks and behaves like a floater. --HG-- branch : product-engine --- indra/newview/lltoast.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'indra/newview/lltoast.h') diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 3d25fd4f02..64855020a9 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -86,8 +86,6 @@ public: // Toast handlers virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual void onMouseEnter(S32 x, S32 y, MASK mask); - virtual void onMouseLeave(S32 x, S32 y, MASK mask); //Fading @@ -97,6 +95,7 @@ public: /** Start fading timer */ virtual void startFading(); + bool isHovered(); // Operating with toasts // insert a panel to a toast @@ -118,10 +117,22 @@ public: virtual void draw(); // virtual void setVisible(BOOL show); + + /*virtual*/ void setBackgroundOpaque(BOOL b); // virtual void hide(); + /*virtual*/ void onFocusLost(); + + /*virtual*/ void onFocusReceived(); + /** + * Returns padding between floater top and wrapper_panel top. + * This padding should be taken into account when positioning or reshaping toasts + */ + S32 getTopPad(); + + S32 getRightPad(); // get/set Toast's flags or states // get information whether the notification corresponding to the toast is valid or not @@ -154,9 +165,15 @@ public: toast_hover_check_signal_t mOnToastHoverSignal; boost::signals2::connection setOnToastHoverCallback(toast_hover_check_callback_t cb) { return mOnToastHoverSignal.connect(cb); } + boost::signals2::connection setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { return mToastMouseEnterSignal.connect(cb); }; + boost::signals2::connection setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { return mToastMouseLeaveSignal.connect(cb); }; private: + void onToastMouseEnter(); + + void onToastMouseLeave(); + void handleTipToastClick(S32 x, S32 y, MASK mask); // check timer @@ -168,6 +185,8 @@ private: LLUUID mSessionID; LLNotificationPtr mNotification; + LLPanel* mWrapperPanel; + // timer counts a lifetime of a toast LLTimer mTimer; F32 mToastLifetime; // in seconds @@ -184,6 +203,9 @@ private: bool mHideBtnPressed; bool mIsHidden; // this flag is TRUE when a toast has faded or was hidden with (x) button (EXT-1849) bool mIsTip; + + commit_signal_t mToastMouseEnterSignal; + commit_signal_t mToastMouseLeaveSignal; }; } -- cgit v1.2.3