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
0bfee2e4
Commit
0bfee2e4
authored
15 years ago
by
James Cook
Browse files
Options
Downloads
Patches
Plain Diff
EXT-2980 Made location history menu items XML-configurable
Reviewed with Leyla
parent
4b2e892c
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/llnavigationbar.cpp
+33
-13
33 additions, 13 deletions
indra/newview/llnavigationbar.cpp
indra/newview/skins/default/xui/en/widgets/teleport_history_menu_item.xml
+12
-0
12 additions, 0 deletions
...ins/default/xui/en/widgets/teleport_history_menu_item.xml
with
45 additions
and
13 deletions
indra/newview/llnavigationbar.cpp
+
33
−
13
View file @
0bfee2e4
...
...
@@ -82,9 +82,24 @@ class LLTeleportHistoryMenuItem : public LLMenuItemCallGL
struct
Params
:
public
LLInitParam
::
Block
<
Params
,
LLMenuItemCallGL
::
Params
>
{
Mandatory
<
EType
>
item_type
;
Params
()
{}
Mandatory
<
EType
>
item_type
;
Optional
<
const
LLFontGL
*>
back_item_font
,
current_item_font
,
forward_item_font
;
Optional
<
std
::
string
>
back_item_image
,
forward_item_image
;
Optional
<
S32
>
image_hpad
,
image_vpad
;
Params
()
:
item_type
(),
back_item_font
(
"back_item_font"
),
current_item_font
(
"current_item_font"
),
forward_item_font
(
"forward_item_font"
),
back_item_image
(
"back_item_image"
),
forward_item_image
(
"forward_item_image"
),
image_hpad
(
"image_hpad"
),
image_vpad
(
"image_vpad"
)
{}
};
/*virtual*/
void
draw
();
...
...
@@ -97,33 +112,38 @@ class LLTeleportHistoryMenuItem : public LLMenuItemCallGL
static
const
S32
ICON_WIDTH
=
16
;
static
const
S32
ICON_HEIGHT
=
16
;
static
const
std
::
string
ICON_IMG_BACKWARD
;
static
const
std
::
string
ICON_IMG_FORWARD
;
LLIconCtrl
*
mArrowIcon
;
};
const
std
::
string
LLTeleportHistoryMenuItem
::
ICON_IMG_BACKWARD
(
"teleport_history_
backward.tga
"
);
const
std
::
string
LLTeleportHistoryMenuItem
::
ICON_IMG_FORWARD
(
"teleport_history_forward.tga"
);
static
LLDefaultChildRegistry
::
Register
<
LLTeleportHistoryMenuItem
>
r
(
"teleport_history_
menu_item
"
);
LLTeleportHistoryMenuItem
::
LLTeleportHistoryMenuItem
(
const
Params
&
p
)
:
LLMenuItemCallGL
(
p
),
mArrowIcon
(
NULL
)
{
// Set appearance depending on the item type.
if
(
p
.
item_type
==
TYPE_CURRENT
)
if
(
p
.
item_type
==
TYPE_BACKWARD
)
{
setFont
(
p
.
back_item_font
);
setLabel
(
std
::
string
(
" "
)
+
std
::
string
(
p
.
label
));
}
else
if
(
p
.
item_type
==
TYPE_CURRENT
)
{
setFont
(
LLFontGL
::
getFontSansSerifBold
()
);
setFont
(
p
.
current_item_font
);
}
else
{
setFont
(
LLFontGL
::
getFontSansSerif
()
);
setFont
(
p
.
forward_item_font
);
setLabel
(
std
::
string
(
" "
)
+
std
::
string
(
p
.
label
));
}
LLIconCtrl
::
Params
icon_params
;
icon_params
.
name
(
"icon"
);
icon_params
.
rect
(
LLRect
(
0
,
ICON_HEIGHT
,
ICON_WIDTH
,
0
));
LLRect
rect
(
0
,
ICON_HEIGHT
,
ICON_WIDTH
,
0
);
rect
.
translate
(
p
.
image_hpad
,
p
.
image_vpad
);
icon_params
.
rect
(
rect
);
icon_params
.
mouse_opaque
(
false
);
icon_params
.
follows
.
flags
(
FOLLOWS_LEFT
|
FOLLOWS_TOP
);
icon_params
.
visible
(
false
);
...
...
@@ -132,9 +152,9 @@ LLTeleportHistoryMenuItem::LLTeleportHistoryMenuItem(const Params& p)
// no image for the current item
if
(
p
.
item_type
==
TYPE_BACKWARD
)
mArrowIcon
->
setValue
(
ICON_IMG_BACKWARD
);
mArrowIcon
->
setValue
(
p
.
back_item_image
()
);
else
if
(
p
.
item_type
==
TYPE_FORWARD
)
mArrowIcon
->
setValue
(
ICON_IMG_FORWARD
);
mArrowIcon
->
setValue
(
p
.
forward_item_image
()
);
addChild
(
mArrowIcon
);
}
...
...
This diff is collapsed.
Click to expand it.
indra/newview/skins/default/xui/en/widgets/teleport_history_menu_item.xml
0 → 100644
+
12
−
0
View file @
0bfee2e4
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!-- Menu items for the back button drop-down menu of locations.
Based on menu_item_call.xml -->
<teleport_history_menu_item
back_item_font=
"SansSerif"
current_item_font=
"SansSerifBold"
forward_item_font=
"SansSerif"
back_item_image=
"teleport_history_backward.tga"
forward_item_image=
"teleport_history_forward.tga"
image_hpad=
"1"
image_vpad=
"0"
/>
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