From bb7b9e2207a062e52d3e063c8654c48b59d6c101 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 28 Jun 2017 11:29:03 +0200 Subject: [PATCH] - audioplayer: fix round borders in footer when playlist is hidden ... and use large roundings as in the other gui-elements cherry-picked from 8a3d8f8b51a8bd97966f8b0708f0a0a631d07bc8 Signed-off-by: Thilo Graf --- src/gui/audioplayer.cpp | 44 ++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index c4ae07f58..c360a281f 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1605,7 +1605,6 @@ void CAudioPlayerGui::paintHead() CComponentsHeader header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); - header.setCorner(RADIUS_MID, CORNER_TOP); if (m_inetmode) header.setCaption(LOCALE_INETRADIO_NAME); @@ -1630,52 +1629,61 @@ void CAudioPlayerGui::paintFoot() { NEUTRINO_ICON_BUTTON_INFO, LOCALE_PICTUREVIEWER_HEAD } }; + int radius = RADIUS_LARGE; int button_y = m_y + m_height - OFFSET_SHADOW - m_info_height - OFFSET_INTER - OFFSET_SHADOW - 2*m_button_height; + int button_x = m_x; + int button_width = m_width; + + // ensure to get round corners in footer + if (!m_show_playlist && radius) + { + button_x += radius; + button_width -= 2*radius; + } // shadow - m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, button_y + OFFSET_SHADOW, m_width, 2*m_button_height, COL_SHADOW_PLUS_0, RADIUS_MID, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); - - m_frameBuffer->paintBoxRel(m_x, button_y, m_width, 2*m_button_height, COL_MENUFOOT_PLUS_0, RADIUS_MID, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); + m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, button_y + OFFSET_SHADOW, m_width, 2*m_button_height, COL_SHADOW_PLUS_0, radius, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); + m_frameBuffer->paintBoxRel(m_x, button_y, m_width, 2*m_button_height, COL_MENUFOOT_PLUS_0, radius, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); if (!m_playlist.empty()) - ::paintButtons(m_x, button_y + m_button_height, m_width, 3, SecondLineButtons, m_width, m_button_height); + ::paintButtons(button_x, button_y + m_button_height, button_width, 3, SecondLineButtons, button_width, m_button_height); if (m_key_level == 0) { if (m_playlist.empty()) { if (m_inetmode) - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[7], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[7], button_width, m_button_height); else - ::paintButtons(m_x, button_y, m_width, 1, &(AudioPlayerButtons[7][0]), m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 1, &(AudioPlayerButtons[7][0]), button_width, m_button_height); } else if (m_inetmode) - ::paintButtons(m_x, button_y, m_width, 4, AudioPlayerButtons[8], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 4, AudioPlayerButtons[8], button_width, m_button_height); else - ::paintButtons(m_x, button_y, m_width, 4, AudioPlayerButtons[1], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 4, AudioPlayerButtons[1], button_width, m_button_height); } else if (m_key_level == 1) { if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO) - ::paintButtons(m_x, button_y, m_width, 4, AudioPlayerButtons[0], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 4, AudioPlayerButtons[0], button_width, m_button_height); else - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[6], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[6], button_width, m_button_height); } else // key_level == 2 { if (m_state == CAudioPlayerGui::STOP) { if (m_select_title_by_name) - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[5], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[5], button_width, m_button_height); else - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[4], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[4], button_width, m_button_height); } else { if (m_select_title_by_name) - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[3], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[3], button_width, m_button_height); else - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[2], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[2], button_width, m_button_height); } } } @@ -1702,10 +1710,10 @@ void CAudioPlayerGui::paintTitleBox() else { // shadow - m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, m_y + OFFSET_SHADOW, m_width, m_title_height, COL_SHADOW_PLUS_0, RADIUS_MID); + m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, m_y + OFFSET_SHADOW, m_width, m_title_height, COL_SHADOW_PLUS_0, RADIUS_LARGE); - m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height, COL_MENUHEAD_PLUS_0, RADIUS_MID); - m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height, OFFSET_INNER_MIN, COL_FRAME_PLUS_0, RADIUS_MID); + m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height, COL_MENUHEAD_PLUS_0, RADIUS_LARGE); + m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height, 2, COL_FRAME_PLUS_0, RADIUS_LARGE); paintCover();