Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
c5ca8aa0
Commit
c5ca8aa0
authored
Apr 25, 2013
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: sliderBg (same issue as slider wrt to notifyLayout)
parent
56d4e908
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
8 deletions
+27
-8
modules/gui/skins2/controls/ctrl_slider.cpp
modules/gui/skins2/controls/ctrl_slider.cpp
+23
-8
modules/gui/skins2/controls/ctrl_slider.hpp
modules/gui/skins2/controls/ctrl_slider.hpp
+4
-0
No files found.
modules/gui/skins2/controls/ctrl_slider.cpp
View file @
c5ca8aa0
...
...
@@ -171,6 +171,7 @@ void CtrlSliderCursor::notifyLayout( int width, int height,
}
}
void
CtrlSliderCursor
::
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
,
void
*
arg
)
{
(
void
)
rVariable
;
(
void
)
arg
;
...
...
@@ -473,6 +474,26 @@ void CtrlSliderBg::associateCursor( CtrlSliderCursor &rCursor )
}
void
CtrlSliderBg
::
notifyLayout
(
int
width
,
int
height
,
int
xOffSet
,
int
yOffSet
)
{
if
(
width
>
0
&&
height
>
0
)
{
CtrlGeneric
::
notifyLayout
(
width
,
height
,
xOffSet
,
yOffSet
);
}
else
{
// Compute the resize factors
float
factorX
,
factorY
;
getResizeFactors
(
factorX
,
factorY
);
// real background size
int
width
=
m_bgWidth
-
(
int
)(
m_padHoriz
*
factorX
);
int
height
=
m_bgHeight
-
(
int
)(
m_padVert
*
factorY
);
CtrlGeneric
::
notifyLayout
(
width
,
height
);
}
}
void
CtrlSliderBg
::
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
,
void
*
arg
)
{
(
void
)
rVariable
;
(
void
)
arg
;
...
...
@@ -482,14 +503,8 @@ void CtrlSliderBg::onUpdate( Subject<VarPercent> &rVariable, void*arg )
m_position
=
position
;
// Compute the resize factors
float
factorX
,
factorY
;
getResizeFactors
(
factorX
,
factorY
);
// real background size
int
width
=
m_bgWidth
-
(
int
)(
m_padHoriz
*
factorX
);
int
height
=
m_bgHeight
-
(
int
)(
m_padVert
*
factorY
);
notifyLayout
(
width
,
height
);
// redraw the entire control
notifyLayout
();
}
...
...
modules/gui/skins2/controls/ctrl_slider.hpp
View file @
c5ca8aa0
...
...
@@ -157,6 +157,10 @@ public:
/// Method called when the control is resized
virtual
void
onResize
();
/// Method called to notify are to be updated
virtual
void
notifyLayout
(
int
witdh
=
-
1
,
int
height
=
-
1
,
int
xOffSet
=
0
,
int
yOffSet
=
0
);
/// Get the type of control (custom RTTI)
virtual
string
getType
()
const
{
return
"slider_bg"
;
}
...
...
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