mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
neutrino: make button bar use available space intelligently
modify the paintButtons() function, so that it spreads the buttons over the available width with constant space between them. Port over all users to the new method and clean up quite some custom button drawing code on the way. Conflicts: src/gui/audioplayer.cpp src/gui/bouquetlist.cpp src/gui/channellist.cpp src/gui/epgview.cpp src/gui/eventlist.cpp src/gui/filebrowser.cpp src/gui/widget/buttons.cpp src/gui/widget/stringinput.cpp
This commit is contained in:
committed by
[CST] Focus
parent
87abc0d1c4
commit
e09bc260da
@@ -1736,50 +1736,51 @@ const struct button_label ScondLineButtons[3] =
|
||||
else
|
||||
top = m_y + (m_height - 2 * m_buttonHeight);
|
||||
|
||||
int ButtonWidth = (m_width - 20) / 5;
|
||||
//int ButtonWidth = (m_width - 20) / 5;
|
||||
|
||||
m_frameBuffer->paintBoxRel(m_x, top, m_width, 2 * m_buttonHeight, COL_INFOBAR_SHADOW_PLUS_1, c_rad_mid, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL));
|
||||
// why? m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_INFOBAR_SHADOW_PLUS_1);
|
||||
|
||||
int bwidth = m_width - (2*c_rad_mid);
|
||||
if (!m_playlist.empty())
|
||||
::paintButtons(m_x + c_rad_mid, top+m_buttonHeight, m_width - (2*c_rad_mid), 3, ScondLineButtons, m_buttonHeight, ButtonWidth);
|
||||
::paintButtons(m_x + c_rad_mid, top+m_buttonHeight, bwidth, 3, ScondLineButtons, bwidth, m_buttonHeight);
|
||||
|
||||
if (m_key_level == 0)
|
||||
{
|
||||
if (m_playlist.empty())
|
||||
{
|
||||
if (m_inetmode)
|
||||
::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[7], m_buttonHeight, ButtonWidth);
|
||||
::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[7], bwidth, m_buttonHeight);
|
||||
else
|
||||
::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 1, &(AudioPlayerButtons[7][0]), m_buttonHeight, ButtonWidth);
|
||||
::paintButtons(m_x + c_rad_mid, top, bwidth, 1, &(AudioPlayerButtons[7][0]), bwidth, m_buttonHeight);
|
||||
}
|
||||
else if (m_inetmode)
|
||||
::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 4, AudioPlayerButtons[8], m_buttonHeight, ButtonWidth);
|
||||
::paintButtons(m_x + c_rad_mid, top, bwidth, 4, AudioPlayerButtons[8], bwidth, m_buttonHeight);
|
||||
else
|
||||
::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 4, AudioPlayerButtons[1], m_buttonHeight, ButtonWidth);
|
||||
::paintButtons(m_x + c_rad_mid, top, bwidth, 4, AudioPlayerButtons[1], bwidth, m_buttonHeight);
|
||||
}
|
||||
else if (m_key_level == 1)
|
||||
{
|
||||
if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO)
|
||||
::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 4, AudioPlayerButtons[0], m_buttonHeight, ButtonWidth);
|
||||
::paintButtons(m_x + c_rad_mid, top, bwidth, 4, AudioPlayerButtons[0], bwidth, m_buttonHeight);
|
||||
else
|
||||
::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[6], m_buttonHeight, ButtonWidth);
|
||||
::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[6], bwidth, m_buttonHeight);
|
||||
}
|
||||
else
|
||||
{ // key_level == 2
|
||||
if (m_state == CAudioPlayerGui::STOP)
|
||||
{
|
||||
if (m_select_title_by_name)
|
||||
::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[5], m_buttonHeight, ButtonWidth);
|
||||
::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[5], bwidth, m_buttonHeight);
|
||||
else
|
||||
::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[4], m_buttonHeight, ButtonWidth);
|
||||
::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[4], bwidth, m_buttonHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_select_title_by_name)
|
||||
::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[3], m_buttonHeight, ButtonWidth);
|
||||
::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[3], bwidth, m_buttonHeight);
|
||||
else
|
||||
::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[2], m_buttonHeight, ButtonWidth);
|
||||
::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[2], bwidth, m_buttonHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user