Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
cb0828bd
Commit
cb0828bd
authored
Apr 22, 2003
by
Olivier Teulière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ./modules/gui/skins/src/theme.cpp: fixed a bug with anchored windows
parent
171966e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
23 deletions
+21
-23
modules/gui/skins/src/anchor.cpp
modules/gui/skins/src/anchor.cpp
+7
-12
modules/gui/skins/src/theme.cpp
modules/gui/skins/src/theme.cpp
+14
-11
No files found.
modules/gui/skins/src/anchor.cpp
View file @
cb0828bd
...
...
@@ -2,7 +2,7 @@
* anchor.cpp: Anchor class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: anchor.cpp,v 1.
2 2003/04/21 21:51:16 asmax
Exp $
* $Id: anchor.cpp,v 1.
3 2003/04/22 22:57:40 ipkiss
Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -39,9 +39,9 @@
// Anchors
//---------------------------------------------------------------------------
Anchor
::
Anchor
(
intf_thread_t
*
_p_intf
,
int
x
,
int
y
,
int
len
,
int
priority
,
SkinWindow
*
parent
)
SkinWindow
*
parent
)
{
p_intf
=
_p_intf
;
p_intf
=
_p_intf
;
Parent
=
parent
;
Left
=
x
;
Top
=
y
;
...
...
@@ -55,7 +55,7 @@ bool Anchor::IsInList( Anchor *anc )
list
<
Anchor
*>::
const_iterator
elt
;
// Iterate through list
for
(
elt
=
HangList
.
begin
();
elt
!=
HangList
.
end
();
elt
++
)
for
(
elt
=
HangList
.
begin
();
elt
!=
HangList
.
end
();
elt
++
)
{
if
(
(
*
elt
)
==
anc
)
return
true
;
...
...
@@ -80,16 +80,11 @@ bool Anchor::Hang( Anchor *anc, int mx, int my )
int
x
,
y
,
px
,
py
;
Parent
->
GetPos
(
px
,
py
);
anc
->
GetPos
(
x
,
y
);
x
+=
mx
-
px
;
y
+=
my
-
py
;
x
+=
mx
-
px
-
Left
;
y
+=
my
-
py
-
Top
;
// Len of 0 is equal to unactivate anchor
if
(
Len
>
0
&&
sqrt
(
(
Left
-
x
)
*
(
Left
-
x
)
+
(
Top
-
y
)
*
(
Top
-
y
)
)
<=
Len
)
{
return
true
;
}
return
false
;
return
(
Len
>
0
&&
sqrt
(
x
*
x
+
y
*
y
)
<=
Len
);
}
//---------------------------------------------------------------------------
void
Anchor
::
GetPos
(
int
&
x
,
int
&
y
)
...
...
modules/gui/skins/src/theme.cpp
View file @
cb0828bd
...
...
@@ -2,7 +2,7 @@
* theme.cpp: Theme class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: theme.cpp,v 1.1
1 2003/04/21 21:51:16 asmax
Exp $
* $Id: theme.cpp,v 1.1
2 2003/04/22 22:57:40 ipkiss
Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -242,7 +242,7 @@ void Theme::MoveSkin( SkinWindow *wnd, int left, int top )
for
(
anc
=
wnd
->
AnchorList
.
begin
();
anc
!=
wnd
->
AnchorList
.
end
();
anc
++
)
{
for
(
hang
=
(
*
anc
)
->
HangList
.
begin
();
hang
!=
(
*
anc
)
->
HangList
.
end
();
hang
++
)
hang
++
)
{
win
=
(
*
hang
)
->
GetParent
();
win
->
GetPos
(
x
,
y
);
...
...
@@ -339,16 +339,16 @@ void Theme::HangToAnchors( SkinWindow *wnd, int &x, int &y, bool init )
{
// Parent anchor is win and child is wnd !!!
if
(
!
(
*
win_anchor
)
->
Hang
(
(
*
wnd_anchor
),
x
,
y
)
)
{
// If child is in parent list and parent doesn't hang ch
// If child is in parent list and parent doesn't hang
// child
if
(
(
*
win_anchor
)
->
IsInList
(
(
*
wnd_anchor
)
)
)
(
*
win_anchor
)
->
Remove
(
(
*
wnd_anchor
)
);
}
else
{
// If parent hang
child and child is not still
in list
// If parent hang
s child and child is not yet
in list
if
(
!
(
*
win_anchor
)
->
IsInList
(
(
*
wnd_anchor
)
)
)
{
(
*
win_anchor
)
->
Add
(
(
*
wnd_anchor
)
);
...
...
@@ -368,13 +368,16 @@ void Theme::HangToAnchors( SkinWindow *wnd, int &x, int &y, bool init )
}
else
if
(
(
*
win_anchor
)
->
Hang
(
(
*
wnd_anchor
),
x
,
y
)
)
{
// Move window to stick anchor
(
*
wnd_anchor
)
->
GetPos
(
wnd_anchor_x
,
wnd_anchor_y
);
(
*
win_anchor
)
->
GetPos
(
win_anchor_x
,
win_anchor_y
);
(
*
win
)
->
GetPos
(
win_x
,
win_y
);
if
(
!
(
*
wnd_anchor
)
->
IsInList
(
*
win_anchor
)
)
{
// Move window to stick anchor
(
*
wnd_anchor
)
->
GetPos
(
wnd_anchor_x
,
wnd_anchor_y
);
(
*
win_anchor
)
->
GetPos
(
win_anchor_x
,
win_anchor_y
);
(
*
win
)
->
GetPos
(
win_x
,
win_y
);
x
=
win_x
+
win_anchor_x
-
wnd_anchor_x
;
y
=
win_y
+
win_anchor_y
-
wnd_anchor_y
;
x
=
win_x
+
win_anchor_x
-
wnd_anchor_x
;
y
=
win_y
+
win_anchor_y
-
wnd_anchor_y
;
}
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment