Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
c57f698d
Commit
c57f698d
authored
Nov 16, 2005
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ctrl_slider.cpp: take the resize factor into account to refresh
the window (fixed the bug of the disappearing slider)
parent
de10515e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
51 deletions
+28
-51
modules/gui/skins2/controls/ctrl_slider.cpp
modules/gui/skins2/controls/ctrl_slider.cpp
+23
-49
modules/gui/skins2/controls/ctrl_slider.hpp
modules/gui/skins2/controls/ctrl_slider.hpp
+5
-2
No files found.
modules/gui/skins2/controls/ctrl_slider.cpp
View file @
c57f698d
...
...
@@ -162,15 +162,7 @@ void CtrlSliderCursor::draw( OSGraphics &rImage, int xDest, int yDest )
void
CtrlSliderCursor
::
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
)
{
// The position has changed
if
(
m_pImg
)
{
notifyLayout
(
m_rCurve
.
getWidth
()
+
m_pImg
->
getWidth
(),
m_rCurve
.
getHeight
()
+
m_pImg
->
getHeight
(),
-
m_pImg
->
getWidth
()
/
2
,
-
m_pImg
->
getHeight
()
/
2
);
}
else
notifyLayout
();
refreshLayout
();
}
...
...
@@ -195,16 +187,7 @@ void CtrlSliderCursor::CmdOverDown::execute()
m_pParent
->
captureMouse
();
m_pParent
->
m_pImg
=
m_pParent
->
m_pImgDown
;
if
(
m_pParent
->
m_pImg
)
{
m_pParent
->
notifyLayout
(
m_pParent
->
m_rCurve
.
getWidth
()
+
m_pParent
->
m_pImg
->
getWidth
(),
m_pParent
->
m_rCurve
.
getHeight
()
+
m_pParent
->
m_pImg
->
getHeight
(),
-
m_pParent
->
m_pImg
->
getWidth
()
/
2
,
-
m_pParent
->
m_pImg
->
getHeight
()
/
2
);
}
else
m_pParent
->
notifyLayout
();
m_pParent
->
refreshLayout
();
}
...
...
@@ -215,48 +198,21 @@ void CtrlSliderCursor::CmdDownOver::execute()
m_pParent
->
releaseMouse
();
m_pParent
->
m_pImg
=
m_pParent
->
m_pImgUp
;
if
(
m_pParent
->
m_pImg
)
{
m_pParent
->
notifyLayout
(
m_pParent
->
m_rCurve
.
getWidth
()
+
m_pParent
->
m_pImg
->
getWidth
(),
m_pParent
->
m_rCurve
.
getHeight
()
+
m_pParent
->
m_pImg
->
getHeight
(),
-
m_pParent
->
m_pImg
->
getWidth
()
/
2
,
-
m_pParent
->
m_pImg
->
getHeight
()
/
2
);
}
else
m_pParent
->
notifyLayout
();
m_pParent
->
refreshLayout
();
}
void
CtrlSliderCursor
::
CmdUpOver
::
execute
()
{
m_pParent
->
m_pImg
=
m_pParent
->
m_pImgOver
;
if
(
m_pParent
->
m_pImg
)
{
m_pParent
->
notifyLayout
(
m_pParent
->
m_rCurve
.
getWidth
()
+
m_pParent
->
m_pImg
->
getWidth
(),
m_pParent
->
m_rCurve
.
getHeight
()
+
m_pParent
->
m_pImg
->
getHeight
(),
-
m_pParent
->
m_pImg
->
getWidth
()
/
2
,
-
m_pParent
->
m_pImg
->
getHeight
()
/
2
);
}
else
m_pParent
->
notifyLayout
();
m_pParent
->
refreshLayout
();
}
void
CtrlSliderCursor
::
CmdOverUp
::
execute
()
{
m_pParent
->
m_pImg
=
m_pParent
->
m_pImgUp
;
if
(
m_pParent
->
m_pImg
)
{
m_pParent
->
notifyLayout
(
m_pParent
->
m_rCurve
.
getWidth
()
+
m_pParent
->
m_pImg
->
getWidth
(),
m_pParent
->
m_rCurve
.
getHeight
()
+
m_pParent
->
m_pImg
->
getHeight
(),
-
m_pParent
->
m_pImg
->
getWidth
()
/
2
,
-
m_pParent
->
m_pImg
->
getHeight
()
/
2
);
}
else
m_pParent
->
notifyLayout
();
m_pParent
->
refreshLayout
();
}
...
...
@@ -332,6 +288,24 @@ void CtrlSliderCursor::getResizeFactors( float &rFactorX,
}
void
CtrlSliderCursor
::
refreshLayout
()
{
if
(
m_pImg
)
{
// Compute the resize factors
float
factorX
,
factorY
;
getResizeFactors
(
factorX
,
factorY
);
notifyLayout
(
(
int
)(
m_rCurve
.
getWidth
()
*
factorX
)
+
m_pImg
->
getWidth
(),
(
int
)(
m_rCurve
.
getHeight
()
*
factorY
)
+
m_pImg
->
getHeight
(),
-
m_pImg
->
getWidth
()
/
2
,
-
m_pImg
->
getHeight
()
/
2
);
}
else
notifyLayout
();
}
CtrlSliderBg
::
CtrlSliderBg
(
intf_thread_t
*
pIntf
,
const
Bezier
&
rCurve
,
VarPercent
&
rVariable
,
int
thickness
,
GenericBitmap
*
pBackground
,
...
...
modules/gui/skins2/controls/ctrl_slider.hpp
View file @
c57f698d
...
...
@@ -100,8 +100,11 @@ class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>
/// Method called when the position variable is modified
virtual
void
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
);
/// Method
e
to compute the resize factors
/// Method to compute the resize factors
void
getResizeFactors
(
float
&
rFactorX
,
float
&
rFactorY
)
const
;
/// Call notifyLayout
void
refreshLayout
();
};
...
...
@@ -156,7 +159,7 @@ class CtrlSliderBg: public CtrlGeneric, public Observer<VarPercent>
/// Method called when the observed variable is modified
virtual
void
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
);
/// Method
e
to compute the resize factors
/// Method to compute the resize factors
void
getResizeFactors
(
float
&
rFactorX
,
float
&
rFactorY
)
const
;
};
...
...
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