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
2e86084a
Commit
2e86084a
authored
13 years ago
by
Merov Linden
Browse files
Options
Downloads
Plain Diff
Merge with main repo
parents
f9cda666
fbf886b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/llsidetray.cpp
+63
-36
63 additions, 36 deletions
indra/newview/llsidetray.cpp
indra/newview/llsidetray.h
+1
-1
1 addition, 1 deletion
indra/newview/llsidetray.h
with
64 additions
and
37 deletions
indra/newview/llsidetray.cpp
+
63
−
36
View file @
2e86084a
...
@@ -1192,6 +1192,38 @@ void LLSideTray::reshape(S32 width, S32 height, BOOL called_from_parent)
...
@@ -1192,6 +1192,38 @@ void LLSideTray::reshape(S32 width, S32 height, BOOL called_from_parent)
arrange
();
arrange
();
}
}
// This is just LLView::findChildView specialized to restrict the search to LLPanels.
// Optimization for EXT-4068 to avoid searching down to the individual item level
// when inventories are large.
LLPanel
*
findChildPanel
(
LLPanel
*
panel
,
const
std
::
string
&
name
,
bool
recurse
)
{
for
(
LLView
::
child_list_const_iter_t
child_it
=
panel
->
beginChild
();
child_it
!=
panel
->
endChild
();
++
child_it
)
{
LLPanel
*
child_panel
=
dynamic_cast
<
LLPanel
*>
(
*
child_it
);
if
(
!
child_panel
)
continue
;
if
(
child_panel
->
getName
()
==
name
)
return
child_panel
;
}
if
(
recurse
)
{
for
(
LLView
::
child_list_const_iter_t
child_it
=
panel
->
beginChild
();
child_it
!=
panel
->
endChild
();
++
child_it
)
{
LLPanel
*
child_panel
=
dynamic_cast
<
LLPanel
*>
(
*
child_it
);
if
(
!
child_panel
)
continue
;
LLPanel
*
found_panel
=
findChildPanel
(
child_panel
,
name
,
recurse
);
if
(
found_panel
)
{
return
found_panel
;
}
}
}
return
NULL
;
}
/**
/**
* Activate tab with "panel_name" panel
* Activate tab with "panel_name" panel
* if no such tab - return false, otherwise true.
* if no such tab - return false, otherwise true.
...
@@ -1221,23 +1253,50 @@ LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& para
...
@@ -1221,23 +1253,50 @@ LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& para
return
new_panel
;
return
new_panel
;
}
}
void
LLSideTray
::
hidePanel
(
const
std
::
string
&
panel_name
)
bool
LLSideTray
::
hidePanel
(
const
std
::
string
&
panel_name
)
{
{
bool
panelHidden
=
false
;
LLPanel
*
panelp
=
getPanel
(
panel_name
);
LLPanel
*
panelp
=
getPanel
(
panel_name
);
if
(
panelp
)
if
(
panelp
)
{
{
if
(
isTabAttached
(
panel_name
))
LLView
*
parentp
=
panelp
->
getParent
();
// Collapse the side bar if the panel or the panel's parent is an attached tab
if
(
isTabAttached
(
panel_name
)
||
(
parentp
&&
isTabAttached
(
parentp
->
getName
())))
{
{
collapseSideBar
();
collapseSideBar
();
panelHidden
=
true
;
}
}
else
else
{
{
LLFloaterReg
::
hideInstance
(
"side_bar_tab"
,
panel_name
);
panelHidden
=
LLFloaterReg
::
hideInstance
(
"side_bar_tab"
,
panel_name
);
if
(
!
panelHidden
)
{
// Look up the panel in the list of detached tabs.
for
(
child_vector_const_iter_t
child_it
=
mDetachedTabs
.
begin
();
child_it
!=
mDetachedTabs
.
end
();
++
child_it
)
{
LLPanel
*
detached_panel
=
dynamic_cast
<
LLPanel
*>
(
*
child_it
);
if
(
detached_panel
)
{
// Hide this detached panel if it is a parent of our panel
if
(
findChildPanel
(
detached_panel
,
panel_name
,
true
)
!=
NULL
)
{
panelHidden
=
LLFloaterReg
::
hideInstance
(
"side_bar_tab"
,
detached_panel
->
getName
());
break
;
}
}
}
}
}
}
}
}
return
panelHidden
;
}
}
void
LLSideTray
::
togglePanel
(
LLPanel
*
&
sub_panel
,
const
std
::
string
&
panel_name
,
const
LLSD
&
params
)
void
LLSideTray
::
togglePanel
(
LLPanel
*
&
sub_panel
,
const
std
::
string
&
panel_name
,
const
LLSD
&
params
)
{
{
if
(
!
sub_panel
)
if
(
!
sub_panel
)
...
@@ -1255,38 +1314,6 @@ void LLSideTray::togglePanel(LLPanel* &sub_panel, const std::string& panel_name,
...
@@ -1255,38 +1314,6 @@ void LLSideTray::togglePanel(LLPanel* &sub_panel, const std::string& panel_name,
}
}
}
}
// This is just LLView::findChildView specialized to restrict the search to LLPanels.
// Optimization for EXT-4068 to avoid searching down to the individual item level
// when inventories are large.
LLPanel
*
findChildPanel
(
LLPanel
*
panel
,
const
std
::
string
&
name
,
bool
recurse
)
{
for
(
LLView
::
child_list_const_iter_t
child_it
=
panel
->
beginChild
();
child_it
!=
panel
->
endChild
();
++
child_it
)
{
LLPanel
*
child_panel
=
dynamic_cast
<
LLPanel
*>
(
*
child_it
);
if
(
!
child_panel
)
continue
;
if
(
child_panel
->
getName
()
==
name
)
return
child_panel
;
}
if
(
recurse
)
{
for
(
LLView
::
child_list_const_iter_t
child_it
=
panel
->
beginChild
();
child_it
!=
panel
->
endChild
();
++
child_it
)
{
LLPanel
*
child_panel
=
dynamic_cast
<
LLPanel
*>
(
*
child_it
);
if
(
!
child_panel
)
continue
;
LLPanel
*
found_panel
=
findChildPanel
(
child_panel
,
name
,
recurse
);
if
(
found_panel
)
{
return
found_panel
;
}
}
}
return
NULL
;
}
LLPanel
*
LLSideTray
::
getPanel
(
const
std
::
string
&
panel_name
)
LLPanel
*
LLSideTray
::
getPanel
(
const
std
::
string
&
panel_name
)
{
{
// Look up the panel in the list of detached tabs.
// Look up the panel in the list of detached tabs.
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llsidetray.h
+
1
−
1
View file @
2e86084a
...
@@ -104,7 +104,7 @@ class LLSideTray : public LLPanel, private LLDestroyClass<LLSideTray>
...
@@ -104,7 +104,7 @@ class LLSideTray : public LLPanel, private LLDestroyClass<LLSideTray>
*/
*/
LLPanel
*
showPanel
(
const
std
::
string
&
panel_name
,
const
LLSD
&
params
=
LLSD
());
LLPanel
*
showPanel
(
const
std
::
string
&
panel_name
,
const
LLSD
&
params
=
LLSD
());
void
hidePanel
(
const
std
::
string
&
panel_name
);
bool
hidePanel
(
const
std
::
string
&
panel_name
);
/**
/**
* Toggling Side Tray tab which contains "sub_panel" child of "panel_name" panel.
* Toggling Side Tray tab which contains "sub_panel" child of "panel_name" panel.
...
...
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