Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
8ca50502
Commit
8ca50502
authored
13 years ago
by
Oz Linden
Browse files
Options
Downloads
Plain Diff
merge changes for vmrg-206
parents
4d7d5825
16b6a472
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/newview/llappviewer.cpp
+2
-0
2 additions, 0 deletions
indra/newview/llappviewer.cpp
indra/newview/lltoast.cpp
+82
-64
82 additions, 64 deletions
indra/newview/lltoast.cpp
indra/newview/lltoast.h
+5
-3
5 additions, 3 deletions
indra/newview/lltoast.h
with
89 additions
and
67 deletions
indra/newview/llappviewer.cpp
+
2
−
0
View file @
8ca50502
...
...
@@ -75,6 +75,7 @@
//#include "llfirstuse.h"
#include
"llrender.h"
#include
"llteleporthistory.h"
#include
"lltoast.h"
#include
"lllocationhistory.h"
#include
"llfasttimerview.h"
#include
"llvector4a.h"
...
...
@@ -4051,6 +4052,7 @@ void LLAppViewer::idle()
LLFrameTimer
::
updateFrameTime
();
LLFrameTimer
::
updateFrameCount
();
LLEventTimer
::
updateClass
();
LLNotificationsUI
::
LLToast
::
updateClass
();
LLCriticalDamp
::
updateInterpolants
();
LLMortician
::
updateClass
();
LLFilePickerThread
::
clearDead
();
//calls LLFilePickerThread::notify()
...
...
This diff is collapsed.
Click to expand it.
indra/newview/lltoast.cpp
+
82
−
64
View file @
8ca50502
...
...
@@ -140,7 +140,9 @@ LLToast::LLToast(const LLToast::Params& p)
// init callbacks if present
if
(
!
p
.
on_delete_toast
().
empty
())
{
mOnDeleteToastSignal
.
connect
(
p
.
on_delete_toast
());
}
}
void
LLToast
::
reshape
(
S32
width
,
S32
height
,
BOOL
called_from_parent
)
...
...
@@ -236,7 +238,9 @@ void LLToast::setCanFade(bool can_fade)
{
mCanFade
=
can_fade
;
if
(
!
mCanFade
)
{
mTimer
->
stop
();
}
}
//--------------------------------------------------------------------------
...
...
@@ -328,55 +332,6 @@ void LLToast::draw()
drawChild
(
mHideBtn
);
}
}
updateHoveredState
();
LLToastLifeTimer
*
timer
=
getTimer
();
if
(
!
timer
)
{
return
;
}
// Started timer means the mouse had left the toast previously.
// If toast is hovered in the current frame we should handle
// a mouse enter event.
if
(
timer
->
getStarted
()
&&
mIsHovered
)
{
mOnToastHoverSignal
(
this
,
MOUSE_ENTER
);
updateTransparency
();
//toasts fading is management by Screen Channel
sendChildToFront
(
mHideBtn
);
if
(
mHideBtn
&&
mHideBtn
->
getEnabled
())
{
mHideBtn
->
setVisible
(
TRUE
);
}
mToastMouseEnterSignal
(
this
,
getValue
());
}
// Stopped timer means the mouse had entered the toast previously.
// If the toast is not hovered in the current frame we should handle
// a mouse leave event.
else
if
(
!
timer
->
getStarted
()
&&
!
mIsHovered
)
{
mOnToastHoverSignal
(
this
,
MOUSE_LEAVE
);
updateTransparency
();
//toasts fading is management by Screen Channel
if
(
mHideBtn
&&
mHideBtn
->
getEnabled
())
{
if
(
mHideBtnPressed
)
{
mHideBtnPressed
=
false
;
return
;
}
mHideBtn
->
setVisible
(
FALSE
);
}
mToastMouseLeaveSignal
(
this
,
getValue
());
}
}
//--------------------------------------------------------------------------
...
...
@@ -440,28 +395,80 @@ void LLToast::updateHoveredState()
{
// mouse is not over this toast
mIsHovered
=
false
;
return
;
}
else
{
bool
is_overlapped_by_other_floater
=
false
;
bool
is_overlapped_by_other_floater
=
false
;
const
child_list_t
*
child_list
=
gFloaterView
->
getChildList
();
const
child_list_t
*
child_list
=
gFloaterView
->
getChildList
();
// find this toast in gFloaterView child list to check whether any floater
// with higher Z-order is visible under the mouse pointer overlapping this toast
child_list_const_reverse_iter_t
r_iter
=
std
::
find
(
child_list
->
rbegin
(),
child_list
->
rend
(),
this
);
if
(
r_iter
!=
child_list
->
rend
())
{
// skip this toast and proceed to views above in Z-order
for
(
++
r_iter
;
r_iter
!=
child_list
->
rend
();
++
r_iter
)
// find this toast in gFloaterView child list to check whether any floater
// with higher Z-order is visible under the mouse pointer overlapping this toast
child_list_const_reverse_iter_t
r_iter
=
std
::
find
(
child_list
->
rbegin
(),
child_list
->
rend
(),
this
);
if
(
r_iter
!=
child_list
->
rend
())
{
LLView
*
view
=
*
r_iter
;
is_overlapped_by_other_floater
=
view
->
isInVisibleChain
()
&&
view
->
calcScreenRect
().
pointInRect
(
x
,
y
);
if
(
is_overlapped_by_other_floater
)
break
;
// skip this toast and proceed to views above in Z-order
for
(
++
r_iter
;
r_iter
!=
child_list
->
rend
();
++
r_iter
)
{
LLView
*
view
=
*
r_iter
;
is_overlapped_by_other_floater
=
view
->
isInVisibleChain
()
&&
view
->
calcScreenRect
().
pointInRect
(
x
,
y
);
if
(
is_overlapped_by_other_floater
)
{
break
;
}
}
}
mIsHovered
=
!
is_overlapped_by_other_floater
;
}
mIsHovered
=
!
is_overlapped_by_other_floater
;
LLToastLifeTimer
*
timer
=
getTimer
();
if
(
timer
)
{
// Started timer means the mouse had left the toast previously.
// If toast is hovered in the current frame we should handle
// a mouse enter event.
if
(
timer
->
getStarted
()
&&
mIsHovered
)
{
mOnToastHoverSignal
(
this
,
MOUSE_ENTER
);
updateTransparency
();
//toasts fading is management by Screen Channel
sendChildToFront
(
mHideBtn
);
if
(
mHideBtn
&&
mHideBtn
->
getEnabled
())
{
mHideBtn
->
setVisible
(
TRUE
);
}
mToastMouseEnterSignal
(
this
,
getValue
());
}
// Stopped timer means the mouse had entered the toast previously.
// If the toast is not hovered in the current frame we should handle
// a mouse leave event.
else
if
(
!
timer
->
getStarted
()
&&
!
mIsHovered
)
{
mOnToastHoverSignal
(
this
,
MOUSE_LEAVE
);
updateTransparency
();
//toasts fading is management by Screen Channel
if
(
mHideBtn
&&
mHideBtn
->
getEnabled
())
{
if
(
mHideBtnPressed
)
{
mHideBtnPressed
=
false
;
return
;
}
mHideBtn
->
setVisible
(
FALSE
);
}
mToastMouseLeaveSignal
(
this
,
getValue
());
}
}
}
void
LLToast
::
setBackgroundOpaque
(
BOOL
b
)
...
...
@@ -553,3 +560,14 @@ S32 LLToast::notifyParent(const LLSD& info)
return
LLModalDialog
::
notifyParent
(
info
);
}
//static
void
LLToast
::
updateClass
()
{
for
(
LLInstanceTracker
<
LLToast
>::
instance_iter
iter
=
LLInstanceTracker
<
LLToast
>::
beginInstances
();
iter
!=
LLInstanceTracker
<
LLToast
>::
endInstances
();
)
{
LLToast
&
toast
=
*
iter
++
;
toast
.
updateHoveredState
();
}
}
This diff is collapsed.
Click to expand it.
indra/newview/lltoast.h
+
5
−
3
View file @
8ca50502
...
...
@@ -27,7 +27,7 @@
#ifndef LL_LLTOAST_H
#define LL_LLTOAST_H
#include
"llinstancetracker.h"
#include
"llpanel.h"
#include
"llmodaldialog.h"
#include
"lleventtimer.h"
...
...
@@ -69,7 +69,7 @@ private :
* Represents toast pop-up.
* This is a parent view for all toast panels.
*/
class
LLToast
:
public
LLModalDialog
class
LLToast
:
public
LLModalDialog
,
public
LLInstanceTracker
<
LLToast
>
{
friend
class
LLToastLifeTimer
;
public:
...
...
@@ -102,6 +102,8 @@ class LLToast : public LLModalDialog
Params
();
};
static
void
updateClass
();
LLToast
(
const
LLToast
::
Params
&
p
);
virtual
~
LLToast
();
...
...
@@ -221,7 +223,7 @@ class LLToast : public LLModalDialog
F32
mToastLifetime
;
// in seconds
F32
mToastFadingTime
;
// in seconds
LLPanel
*
mPanel
;
LLButton
*
mHideBtn
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment