Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
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
JennaHuntsman
XDG Integration
Commits
c14aa1b6
Commit
c14aa1b6
authored
13 years ago
by
Merov Linden
Browse files
Options
Downloads
Patches
Plain Diff
EXP-1331 : Avoid showing the caret if the tool is dragged over itself
parent
40ebe180
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llui/lltoolbar.cpp
+26
-3
26 additions, 3 deletions
indra/llui/lltoolbar.cpp
indra/llui/lltoolbar.h
+1
-0
1 addition, 0 deletions
indra/llui/lltoolbar.h
with
27 additions
and
3 deletions
indra/llui/lltoolbar.cpp
+
26
−
3
View file @
c14aa1b6
...
@@ -418,6 +418,7 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
...
@@ -418,6 +418,7 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
while
(
it_button
!=
end_button
)
while
(
it_button
!=
end_button
)
{
{
button_rect
=
(
*
it_button
)
->
getRect
();
button_rect
=
(
*
it_button
)
->
getRect
();
mDragCommand
=
(
*
it_button
)
->
mId
;
S32
point_x
,
point_y
;
S32
point_x
,
point_y
;
if
(
orientation
==
LLLayoutStack
::
HORIZONTAL
)
if
(
orientation
==
LLLayoutStack
::
HORIZONTAL
)
{
{
...
@@ -436,7 +437,6 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
...
@@ -436,7 +437,6 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
{
{
break
;
break
;
}
}
mDragCommand
=
(
*
it_button
)
->
mId
;
rank
++
;
rank
++
;
++
it_button
;
++
it_button
;
}
}
...
@@ -480,6 +480,27 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
...
@@ -480,6 +480,27 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
return
rank
;
return
rank
;
}
}
int
LLToolBar
::
getRankFromPosition
(
const
LLCommandId
&
id
)
{
if
(
!
hasCommand
(
id
))
{
return
RANK_NONE
;
}
int
rank
=
0
;
std
::
list
<
LLToolBarButton
*>::
iterator
it_button
=
mButtons
.
begin
();
std
::
list
<
LLToolBarButton
*>::
iterator
end_button
=
mButtons
.
end
();
while
(
it_button
!=
end_button
)
{
if
((
*
it_button
)
->
mId
==
id
)
{
break
;
}
rank
++
;
++
it_button
;
}
return
rank
;
}
void
LLToolBar
::
updateLayoutAsNeeded
()
void
LLToolBar
::
updateLayoutAsNeeded
()
{
{
if
(
!
mNeedsLayout
)
return
;
if
(
!
mNeedsLayout
)
return
;
...
@@ -826,10 +847,12 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
...
@@ -826,10 +847,12 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
LLAssetType
::
EType
type
=
inv_item
->
getType
();
LLAssetType
::
EType
type
=
inv_item
->
getType
();
if
(
type
==
LLAssetType
::
AT_WIDGET
)
if
(
type
==
LLAssetType
::
AT_WIDGET
)
{
{
LLCommandId
dragged_command
(
inv_item
->
getUUID
());
int
orig_rank
=
getRankFromPosition
(
dragged_command
);
mDragRank
=
getRankFromPosition
(
x
,
y
);
mDragRank
=
getRankFromPosition
(
x
,
y
);
// Don't DaD if we're dragging a command on itself
// Don't DaD if we're dragging a command on itself
mDragAndDropTarget
=
(
mDrag
Command
.
uuid
(
)
!
=
inv_item
->
getUUID
()
);
mDragAndDropTarget
=
(
(
mDrag
Rank
==
orig_rank
)
||
((
mDragRank
-
1
)
=
=
orig_rank
)
?
false
:
true
);
//
llinfos << "Merov debug : DaD, rank = " << mDragRank << ", hit uuid = " << mDragCommand.uuid() << ", dragged uui = " << inv_item->getUUID() << llendl;
llinfos
<<
"Merov debug : DaD, rank = "
<<
mDragRank
<<
", hit uuid = "
<<
mDragCommand
.
uuid
()
<<
", dragged uui = "
<<
inv_item
->
getUUID
()
<<
llendl
;
/* Do the following if you want to animate the button itself
/* Do the following if you want to animate the button itself
LLCommandId dragged_command(inv_item->getUUID());
LLCommandId dragged_command(inv_item->getUUID());
removeCommand(dragged_command);
removeCommand(dragged_command);
...
...
This diff is collapsed.
Click to expand it.
indra/llui/lltoolbar.h
+
1
−
0
View file @
c14aa1b6
...
@@ -157,6 +157,7 @@ class LLToolBar
...
@@ -157,6 +157,7 @@ class LLToolBar
void
draw
();
void
draw
();
void
reshape
(
S32
width
,
S32
height
,
BOOL
called_from_parent
=
TRUE
);
void
reshape
(
S32
width
,
S32
height
,
BOOL
called_from_parent
=
TRUE
);
int
getRankFromPosition
(
S32
x
,
S32
y
);
int
getRankFromPosition
(
S32
x
,
S32
y
);
int
getRankFromPosition
(
const
LLCommandId
&
id
);
BOOL
handleRightMouseDown
(
S32
x
,
S32
y
,
MASK
mask
);
BOOL
handleRightMouseDown
(
S32
x
,
S32
y
,
MASK
mask
);
virtual
BOOL
handleDragAndDrop
(
S32
x
,
S32
y
,
MASK
mask
,
BOOL
drop
,
virtual
BOOL
handleDragAndDrop
(
S32
x
,
S32
y
,
MASK
mask
,
BOOL
drop
,
EDragAndDropType
cargo_type
,
EDragAndDropType
cargo_type
,
...
...
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