diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-07-14 20:38:22 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-07-14 20:38:22 -0600 |
commit | 002870620a38b08c71598b82a767601fd8328240 (patch) | |
tree | 58c1e64b7bc58470b1bf88d348043f5c5d803f35 | |
parent | daaa3cba9f05b90c3ee082b0bc03a34b6fdbca5a (diff) | |
download | nuttx-002870620a38b08c71598b82a767601fd8328240.tar.gz nuttx-002870620a38b08c71598b82a767601fd8328240.tar.bz2 nuttx-002870620a38b08c71598b82a767601fd8328240.zip |
NxWM::CMediaPlayer now uses the new CImage methods to align media controls in buttons
-rw-r--r-- | NxWidgets/nxwm/src/cmediaplayer.cxx | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/NxWidgets/nxwm/src/cmediaplayer.cxx b/NxWidgets/nxwm/src/cmediaplayer.cxx index 8f377ba8f..1190cee19 100644 --- a/NxWidgets/nxwm/src/cmediaplayer.cxx +++ b/NxWidgets/nxwm/src/cmediaplayer.cxx @@ -382,7 +382,7 @@ bool CMediaPlayer::createPlayer(void) nxgl_coord_t fwdButtonW; #ifdef CONFIG_NXWM_MEDIAPLAYER_BORDERS - // With the widest button + // Set the width to the widest button nxgl_coord_t buttonW = playBitmap->getWidth(); @@ -436,6 +436,14 @@ bool CMediaPlayer::createPlayer(void) CImage(control, playControlX, (nxgl_coord_t)controlY, 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 nxgl_coord_t rewControlX = playControlX - rewButtonW - @@ -445,6 +453,14 @@ bool CMediaPlayer::createPlayer(void) CImage(control, rewControlX, (nxgl_coord_t)controlY, 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 nxgl_coord_t fwdControlX = playControlX + playButtonW + @@ -454,15 +470,12 @@ bool CMediaPlayer::createPlayer(void) CImage(control, fwdControlX, (nxgl_coord_t)controlY, 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_rew->setBorderless(true); + m_fwd->alignHorizontalCenter(); + m_fwd->alignVerticalCenter(); +#ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS m_fwd->setBorderless(true); #else - m_playPause->setBorderless(false); - m_rew->setBorderless(false); m_fwd->setBorderless(false); #endif |