mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +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
@@ -70,10 +70,13 @@
|
||||
extern cVideo * videoDecoder;
|
||||
|
||||
const struct button_label RescanButton = {NEUTRINO_ICON_BUTTON_BLUE , LOCALE_UPNPBROWSER_RESCAN};
|
||||
const struct button_label StopButton = {NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_STOP};
|
||||
const struct button_label PUpButton = {NEUTRINO_ICON_BUTTON_RED , LOCALE_FILEBROWSER_NEXTPAGE};
|
||||
const struct button_label PDownButton = {NEUTRINO_ICON_BUTTON_GREEN , LOCALE_FILEBROWSER_PREVPAGE};
|
||||
const struct button_label PPlayButton = {NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY};
|
||||
const struct button_label BrowseButtons[4] =
|
||||
{
|
||||
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_STOP },
|
||||
{ NEUTRINO_ICON_BUTTON_RED , LOCALE_FILEBROWSER_NEXTPAGE },
|
||||
{ NEUTRINO_ICON_BUTTON_GREEN , LOCALE_FILEBROWSER_PREVPAGE },
|
||||
{ NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
@@ -1039,7 +1042,7 @@ void CUpnpBrowserGui::paintDevice()
|
||||
//int ButtonWidth = (m_width - 20) / 4;
|
||||
m_frameBuffer->paintBoxRel(m_x, top, m_width, m_buttonHeight+2, COL_INFOBAR_SHADOW_PLUS_1, c_rad_mid, CORNER_BOTTOM);
|
||||
// m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_INFOBAR_SHADOW_PLUS_0);
|
||||
::paintButtons(m_x, top, 0, 1, &RescanButton, m_buttonHeight);
|
||||
::paintButtons(m_x, top, 0, 1, &RescanButton, m_width, m_buttonHeight);
|
||||
|
||||
clearItem2DetailsLine(); // clear it
|
||||
}
|
||||
@@ -1160,14 +1163,8 @@ void CUpnpBrowserGui::paintItem(std::vector<UPnPEntry> *entry, unsigned int sele
|
||||
|
||||
// Foot buttons
|
||||
top = m_y + (m_height - m_info_height - 2 * m_buttonHeight);
|
||||
int ButtonWidth = (m_width - 20) / 4;
|
||||
m_frameBuffer->paintBoxRel(m_x, top, m_width, m_buttonHeight+2, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM);
|
||||
// m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_INFOBAR_SHADOW_PLUS_0);
|
||||
|
||||
::paintButtons(m_x, top, 0, 1, &StopButton, m_buttonHeight);
|
||||
::paintButtons(m_x + ButtonWidth, top, 0, 1, &PUpButton, m_buttonHeight);
|
||||
::paintButtons(m_x + 2 * ButtonWidth, top, 0, 1, &PDownButton, m_buttonHeight);
|
||||
::paintButtons(m_x + 3 * ButtonWidth, top, 0, 1, &PPlayButton, m_buttonHeight);
|
||||
::paintButtons(m_x, top, 0, 4, BrowseButtons, m_width, m_buttonHeight);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user