NxWM::CMediaPlayer now uses the new CImage methods to align media controls in buttons
This commit is contained in:
parent
322a3df832
commit
ae4ffd5d55
@ -382,7 +382,7 @@ bool CMediaPlayer::createPlayer(void)
|
|||||||
nxgl_coord_t fwdButtonW;
|
nxgl_coord_t fwdButtonW;
|
||||||
|
|
||||||
#ifdef CONFIG_NXWM_MEDIAPLAYER_BORDERS
|
#ifdef CONFIG_NXWM_MEDIAPLAYER_BORDERS
|
||||||
// With the widest button
|
// Set the width to the widest button
|
||||||
|
|
||||||
nxgl_coord_t buttonW = playBitmap->getWidth();
|
nxgl_coord_t buttonW = playBitmap->getWidth();
|
||||||
|
|
||||||
@ -436,6 +436,14 @@ bool CMediaPlayer::createPlayer(void)
|
|||||||
CImage(control, playControlX, (nxgl_coord_t)controlY,
|
CImage(control, playControlX, (nxgl_coord_t)controlY,
|
||||||
playButtonW, buttonH, playBitmap);
|
playButtonW, buttonH, playBitmap);
|
||||||
|
|
||||||
|
m_playPause->alignHorizontalCenter();
|
||||||
|
m_playPause->alignVerticalCenter();
|
||||||
|
#ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS
|
||||||
|
m_playPause->setBorderless(true);
|
||||||
|
#else
|
||||||
|
m_playPause->setBorderless(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Create the Rewind Image
|
// Create the Rewind Image
|
||||||
|
|
||||||
nxgl_coord_t rewControlX = playControlX - rewButtonW -
|
nxgl_coord_t rewControlX = playControlX - rewButtonW -
|
||||||
@ -445,6 +453,14 @@ bool CMediaPlayer::createPlayer(void)
|
|||||||
CImage(control, rewControlX, (nxgl_coord_t)controlY,
|
CImage(control, rewControlX, (nxgl_coord_t)controlY,
|
||||||
rewButtonW, buttonH, rewBitmap);
|
rewButtonW, buttonH, rewBitmap);
|
||||||
|
|
||||||
|
m_rew->alignHorizontalCenter();
|
||||||
|
m_rew->alignVerticalCenter();
|
||||||
|
#ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS
|
||||||
|
m_rew->setBorderless(true);
|
||||||
|
#else
|
||||||
|
m_rew->setBorderless(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Create the Forward Image
|
// Create the Forward Image
|
||||||
|
|
||||||
nxgl_coord_t fwdControlX = playControlX + playButtonW +
|
nxgl_coord_t fwdControlX = playControlX + playButtonW +
|
||||||
@ -454,15 +470,12 @@ bool CMediaPlayer::createPlayer(void)
|
|||||||
CImage(control, fwdControlX, (nxgl_coord_t)controlY,
|
CImage(control, fwdControlX, (nxgl_coord_t)controlY,
|
||||||
fwdButtonW, buttonH, fwdBitmap);
|
fwdButtonW, buttonH, fwdBitmap);
|
||||||
|
|
||||||
#ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS
|
|
||||||
// Make the images boarder-less if that is how we are configured
|
|
||||||
|
|
||||||
m_playPause->setBorderless(true);
|
m_fwd->alignHorizontalCenter();
|
||||||
m_rew->setBorderless(true);
|
m_fwd->alignVerticalCenter();
|
||||||
|
#ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS
|
||||||
m_fwd->setBorderless(true);
|
m_fwd->setBorderless(true);
|
||||||
#else
|
#else
|
||||||
m_playPause->setBorderless(false);
|
|
||||||
m_rew->setBorderless(false);
|
|
||||||
m_fwd->setBorderless(false);
|
m_fwd->setBorderless(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user