mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
buttons.cpp:workaround for to small screen
Origin commit data
------------------
Commit: 4be74a3fac
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-05-02 (Wed, 02 May 2012)
This commit is contained in:
@@ -130,6 +130,12 @@ int paintButtons( const int &x,
|
||||
//calculate button width
|
||||
w_button = buttonwidth == 0 ? (w_max_icon + w_space + w_max_text) : buttonwidth;
|
||||
|
||||
//workaround for to small screen (1)
|
||||
int skip_last_button_txt = false;
|
||||
if((w_button*cnt) >(uint) w_footer){
|
||||
w_button= ((w_footer+w_max_icon)/(cnt));
|
||||
skip_last_button_txt = true;
|
||||
}
|
||||
//calculate button heigth
|
||||
h_button = std::max(h_max_icon, h_max_text); //calculate optimal button height
|
||||
|
||||
@@ -157,6 +163,10 @@ int paintButtons( const int &x,
|
||||
else
|
||||
caption = content[j].locale ? g_Locale->getText(content[j].locale) : "";
|
||||
|
||||
//workaround for to small screen (2)
|
||||
if(skip_last_button_txt && j == cnt-1)
|
||||
caption="";
|
||||
|
||||
const char * icon = content[j].button ? content[j].button : "";
|
||||
|
||||
//get height/width of icon
|
||||
|
Reference in New Issue
Block a user