Merge branch 'cst-next' of git://coolstreamtech.de/cst-public-gui-neutrino into ni/cst-next

Origin commit data
------------------
Branch: ni/coolstream
Commit: e13549e11d
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-08-16 (Tue, 16 Aug 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2016-08-16 10:08:27 +02:00
29 changed files with 176 additions and 136 deletions

View File

@@ -143,5 +143,5 @@ void CComponentsDetailLine::paint(bool do_save_bg)
void CComponentsDetailLine::syncSysColors()
{
col_body = COL_MENUCONTENT_PLUS_6;
col_shadow = COL_MENUCONTENTDARK_PLUS_0;
col_shadow = COL_SHADOW_PLUS_0;
}

View File

@@ -57,7 +57,7 @@ class CComponentsDetailLine : public CComponents
public:
CComponentsDetailLine( const int& x_pos = 1,const int& y_pos_top = 1, const int& y_pos_down = 1,
const int& h_mark_top_ = CC_HEIGHT_MIN , const int& h_mark_down_ = CC_HEIGHT_MIN,
fb_pixel_t color_line = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_line = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
~CComponentsDetailLine();
///set colors

View File

@@ -38,7 +38,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha)
width = width_old = CC_WIDTH_MIN;
col_body = col_body_old = COL_MENUCONTENT_PLUS_0;
col_shadow = col_shadow_old = COL_MENUCONTENTDARK_PLUS_0;
col_shadow = col_shadow_old = COL_SHADOW_PLUS_0;
col_frame = col_frame_old = COL_MENUCONTENT_PLUS_6;
col_frame_sel = col_frame_sel_old = COL_MENUCONTENTSELECTED_PLUS_0;

View File

@@ -63,7 +63,7 @@
* @li CFrameBuffer::advanced
* @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6
* @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF
* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0
* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0
*
* @return
* True if painted
@@ -88,7 +88,7 @@ bool paintBoxRel( const int& x,
const int& w_frame = 0,
const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6,
int shadow_mode = CC_SHADOW_OFF,
const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0);
const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0);
/** Paint a box on screen.
* @param[in] x position
@@ -110,7 +110,7 @@ bool paintBoxRel( const int& x,
* @li CORNER_ALL
* @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6
* @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF
* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0
* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0
*
* @return
* True if painted
@@ -131,7 +131,7 @@ bool paintBoxRel0( const int& x,
const int& w_frame = 0,
const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6,
int shadow_mode = CC_SHADOW_OFF,
const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0);
const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0);
/** Paint a text box on screen.
* @param[in] std::string& text
@@ -175,7 +175,7 @@ bool paintBoxRel0( const int& x,
* @li CFrameBuffer::advanced
* @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6
* @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF
* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0
* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0
*
* @return
* True if painted
@@ -206,7 +206,7 @@ bool paintTextBoxRel( const std::string& text,
const int& gradient_intensity = CColorGradient::normal,
const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6,
int shadow_mode = CC_SHADOW_OFF,
const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0);
const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0);
/** Paint an image on screen.
* @param[in] std::string& full path or filename
@@ -250,7 +250,7 @@ bool paintTextBoxRel( const std::string& text,
* @li CFrameBuffer::advanced
* @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6
* @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF
* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0
* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0
*
* @return
* True if painted
@@ -272,5 +272,5 @@ bool paintImage( const std::string& image_name,
const int& corner_type = CORNER_NONE,
const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6,
int shadow_mode = CC_SHADOW_OFF,
const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0);
const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0);
#endif

View File

@@ -68,7 +68,7 @@ class CComponentsForm : public CComponentsItem
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
virtual ~CComponentsForm();
///paints current form on screen, for paint a page use paintPage()

View File

@@ -103,7 +103,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h,
const neutrino_locale_t& caption_locale,
@@ -112,7 +112,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h,
const neutrino_locale_t& caption_locale,
@@ -121,7 +121,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h,
const std::string& caption,
@@ -130,7 +130,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
///set text color
virtual void setButtonTextColor(fb_pixel_t text_color, fb_pixel_t text_color_disabled = COL_MENUCONTENTINACTIVE_TEXT){cc_btn_capt_col = text_color; cc_btn_capt_disable_col = text_color_disabled;}
@@ -204,7 +204,7 @@ class CComponentsButtonRed : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_RED;
@@ -215,7 +215,7 @@ class CComponentsButtonRed : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_RED;
@@ -235,7 +235,7 @@ class CComponentsButtonGreen : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_GREEN;
@@ -246,7 +246,7 @@ class CComponentsButtonGreen : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_GREEN;
@@ -266,7 +266,7 @@ class CComponentsButtonYellow : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW;
@@ -277,7 +277,7 @@ class CComponentsButtonYellow : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW;
@@ -297,7 +297,7 @@ class CComponentsButtonBlue : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_BLUE;
@@ -308,7 +308,7 @@ class CComponentsButtonBlue : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_BLUE;

View File

@@ -69,7 +69,7 @@ class CComponentsFrmChain : public CComponentsForm
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t& color_body = COL_MENUHEAD_PLUS_0,
fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0);
// ~CComponentsFrmChain(); //inherited from CComponentsForm
///defines mode for arrangement direction of items, see also chn_direction

View File

@@ -104,7 +104,7 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_LIGHT_GRAY,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
int font_style = CNeutrinoFonts::FONT_STYLE_BOLD
);
virtual ~CComponentsFrmClock();

View File

@@ -84,7 +84,7 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen
fb_pixel_t text_color = COL_MENUCONTENT_TEXT,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
// ~CComponentsExtTextForm(); //inherited from CComponentsForm
///assigns texts for label and text, parameter as string, parameter Font is optional for required font type, default font is dependently from defined item height
@@ -145,7 +145,7 @@ class CComponentsExtTextFormLocalized : public CComponentsExtTextForm
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT,
fb_pixel_t text_color = COL_MENUCONTENT_TEXT,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
};
#endif

View File

@@ -66,7 +66,7 @@ class CComponentsFooter : public CComponentsHeader
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUFOOT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
///show button frame and background, default false
bool btn_contour;
@@ -87,7 +87,7 @@ class CComponentsFooter : public CComponentsHeader
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUFOOT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
///add button labels with string label type as content, count as size_t, chain_width as int, label width as int
void setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0);

View File

@@ -48,7 +48,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUHEAD_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
protected:
///object: icon object, see also setIcon()
@@ -126,7 +126,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUHEAD_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
virtual ~CComponentsHeader();
@@ -264,7 +264,7 @@ class CComponentsHeaderLocalized : public CComponentsHeader
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUHEAD_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
};
#endif

View File

@@ -39,7 +39,7 @@ class CComponentsIconForm : public CComponentsFrmChain
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUHEAD_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
public:
CComponentsIconForm(CComponentsForm *parent = NULL);
@@ -48,7 +48,7 @@ class CComponentsIconForm : public CComponentsFrmChain
CComponentsForm *parent = NULL,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
// ~CComponentsIconForm(); //inherited from CComponentsForm
void addIcon(const std::string& icon_name);

View File

@@ -65,7 +65,7 @@ class CComponentsScrollBar : public CComponentsFrmChain
CComponentsForm *parent = NULL,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_3,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
// ~CComponentsScrollBar(); //inherited from CComponentsForm
///set marked segment, 1st = 0, 2nd = 1 ...

View File

@@ -69,7 +69,7 @@ class CComponentsSlider : public CComponentsForm
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t& color_body = COL_MENUHEAD_PLUS_0,
fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0);
// ~CComponentsSlider(); //inherited from CComponentsForm
void setValuePos(const int& current_value);

View File

@@ -112,7 +112,7 @@ class CComponentsWindow : public CComponentsForm
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
///initialize width and height
void initWindowSize();
///initialize position
@@ -137,7 +137,7 @@ class CComponentsWindow : public CComponentsForm
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
///advanced constructor for CComponentsWindow, provides parameters for the most required properties, and caption from locales, x_pos or y_pos = 0 will center window
CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h,
@@ -147,7 +147,7 @@ class CComponentsWindow : public CComponentsForm
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
///add item to body object, also usable is addCCItem() to add items to the windo object
int addWindowItem(CComponentsItem* cc_Item);
@@ -233,7 +233,7 @@ class CComponentsWindowMax : public CComponentsWindow
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
///simple constructor for CComponentsWindow, provides parameters for caption from locales and icon, this shows a centered window based up current screen settings
CComponentsWindowMax( neutrino_locale_t locale_caption, const std::string& iconname = "",
@@ -241,7 +241,7 @@ class CComponentsWindowMax : public CComponentsWindow
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
};
#endif

View File

@@ -145,7 +145,7 @@ void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent, const
void CComponentsItem::syncSysColors()
{
col_body = COL_MENUCONTENT_PLUS_0;
col_shadow = COL_MENUCONTENTDARK_PLUS_0;
col_shadow = COL_SHADOW_PLUS_0;
col_frame = COL_MENUCONTENT_PLUS_6;
}

View File

@@ -74,7 +74,7 @@ class CComponentsInfoBox : public CComponentsText
fb_pixel_t color_text = COL_MENUCONTENT_TEXT,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
~CComponentsInfoBox();

View File

@@ -114,7 +114,7 @@ class CComponentsPicture : public CComponentsItem
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
int transparent = CFrameBuffer::TM_NONE);
/*!
@@ -130,7 +130,7 @@ class CComponentsPicture : public CComponentsItem
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
int transparent = CFrameBuffer::TM_NONE);
virtual~CComponentsPicture()
{
@@ -198,7 +198,7 @@ class CComponentsPictureScalable : public CComponentsPicture
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
int transparent = CFrameBuffer::TM_NONE)
: CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){};
};
@@ -233,7 +233,7 @@ class CComponentsChannelLogo : public CComponentsPicture
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
int transparent = CFrameBuffer::TM_BLACK);
/*!
@@ -249,7 +249,7 @@ class CComponentsChannelLogo : public CComponentsPicture
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
int transparent = CFrameBuffer::TM_BLACK);
///set channel id and/or channel name, NOTE: channel name is prefered
@@ -282,7 +282,7 @@ class CComponentsChannelLogoScalable : public CComponentsChannelLogo
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
int transparent = CFrameBuffer::TM_BLACK)
: CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){};
};

View File

@@ -104,7 +104,7 @@ class CProgressBar : public CComponentsItem
const int h = -1,
fb_pixel_t color_frame = 0,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
const fb_pixel_t active_col = COL_INFOBAR_PLUS_7,
const fb_pixel_t passive_col = COL_INFOBAR_PLUS_3,
const int R = 40,

View File

@@ -47,7 +47,7 @@ class CComponentsShapeCircle : public CComponentsItem
CComponentsShapeCircle( const int x_pos, const int y_pos, const int diam,
CComponentsForm *parent = NULL,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
///set property: diam
inline void setDiam(const int& diam){d=width=height=diam, corner_rad=d/2;};
@@ -64,7 +64,7 @@ class CComponentsShapeSquare : public CComponentsItem
CComponentsShapeSquare( const int x_pos, const int y_pos, const int w, const int h,
CComponentsForm *parent = NULL,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
};

View File

@@ -109,7 +109,7 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox
const int& font_style = CComponentsText::FONT_STYLE_REGULAR,
CComponentsForm *parent = NULL,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
CComponentsText( CComponentsForm *parent,
const int x_pos = 10, const int y_pos = 10, const int w = 150, const int h = 50,
@@ -118,7 +118,7 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox
Font* font_text = NULL,
const int& font_style = CComponentsText::FONT_STYLE_REGULAR,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
virtual ~CComponentsText();
@@ -134,7 +134,7 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox
virtual void setTextColor(const fb_pixel_t& color_text);
///set all basic framebuffer element colors at once
///Note: Possible color values are defined in "gui/color.h" and "gui/customcolor.h"
virtual void setColorAll(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, fb_pixel_t color_text = COL_MENUCONTENT_TEXT)
virtual void setColorAll(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, fb_pixel_t color_text = COL_MENUCONTENT_TEXT)
{
CCDraw::setColorAll(color_frame, color_body, color_shadow);
setTextColor(color_text);
@@ -256,7 +256,7 @@ class CComponentsLabel : public CComponentsText
fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_TEXT,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsText(x_pos, y_pos, w, h, text, mode, font_text, font_style, parent, shadow_mode, color_text, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_LABEL;

View File

@@ -54,7 +54,7 @@ class CComponentsPIP : public CComponentsItem
CComponentsPIP( const int x_pos = 0, const int y_pos = 0, const int percent = 30,
CComponentsForm *parent = NULL,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_BLACK, fb_pixel_t color_body = COL_BACKGROUND_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
fb_pixel_t color_frame = COL_BLACK, fb_pixel_t color_body = COL_BACKGROUND_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
~CComponentsPIP();
///set property: width of tv box in pixel

View File

@@ -76,7 +76,7 @@ int CLuaInstCCHeader::CCHeaderNew(lua_State *L)
std::string caption, icon;
lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6;
lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0;
lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0;
lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0;
tableLookup(L, "parent", (void**)&parent);
tableLookup(L, "x", x);

View File

@@ -78,7 +78,7 @@ int CLuaInstCCPicture::CCPictureNew(lua_State *L)
lua_Integer alignment = 0;
lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6;
lua_Unsigned color_background = (lua_Unsigned)COL_MENUCONTENT_PLUS_0;
lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0;
lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0;
/*
transparency = CFrameBuffer::TM_BLACK (2): Transparency when black content ('pseudo' transparency)

View File

@@ -85,7 +85,7 @@ int CLuaInstCCText::CCTextNew(lua_State *L)
lua_Unsigned color_text = (lua_Unsigned)COL_MENUCONTENT_TEXT;
lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6;
lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0;
lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0;
lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0;
tableLookup(L, "parent", (void**)&parent);
tableLookup(L, "x", x);

View File

@@ -74,7 +74,7 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L)
std::string name, icon = std::string(NEUTRINO_ICON_INFO);
lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6;
lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0;
lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0;
lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0;
std::string tmp1 = "false";
std::string btnRed = "";
std::string btnGreen = "";

View File

@@ -365,9 +365,9 @@ void CThemes::getTheme(CConfigFile &configfile)
t.menu_Foot_green = configfile.getInt32( "menu_Foot_green", 0x10 );
t.menu_Foot_blue = configfile.getInt32( "menu_Foot_blue", 0x10 );
t.menu_Foot_Text_alpha = configfile.getInt32( "menu_Foot_Text_alpha", 0x00 );
t.menu_Foot_Text_red = configfile.getInt32( "menu_Foot_Text_red", 0x28 );
t.menu_Foot_Text_green = configfile.getInt32( "menu_Foot_Text_green", 0x28 );
t.menu_Foot_Text_blue = configfile.getInt32( "menu_Foot_Text_blue", 0x28 );
t.menu_Foot_Text_red = configfile.getInt32( "menu_Foot_Text_red", 0x40 );
t.menu_Foot_Text_green = configfile.getInt32( "menu_Foot_Text_green", 0x40 );
t.menu_Foot_Text_blue = configfile.getInt32( "menu_Foot_Text_blue", 0x40 );
t.menu_Hint_gradient = configfile.getInt32( "menu_Hint_gradient", CC_COLGRAD_COL_B_2_COL_A);
t.menu_Hint_gradient_direction = configfile.getInt32( "menu_Hint_gradient_direction", CFrameBuffer::gradientVertical);

View File

@@ -87,6 +87,8 @@ CUpnpBrowserGui::CUpnpBrowserGui()
CFrameBuffer::getInstance()->OnAfterSetPallette.connect(reinit);
}
#define INNER_OFFSET SHADOW_OFFSET
void CUpnpBrowserGui::Init()
{
topbox.enableFrame(true, 2);
@@ -94,38 +96,68 @@ void CUpnpBrowserGui::Init()
topbox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUHEAD_PLUS_0, COL_MENUCONTENTDARK_PLUS_0, COL_MENUHEAD_TEXT);
topbox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]);
topbox.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Head_gradient_direction);
//topbox.enableShadow();
ibox.enableFrame(true, 2);
ibox.setCorner(RADIUS_LARGE);
ibox.setColorAll(topbox.getColorFrame(), COL_MENUCONTENTDARK_PLUS_0);
ibox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]);
ibox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction);
infobox.enableFrame(true, 2);
infobox.setCorner(RADIUS_LARGE);
infobox.setColorAll(topbox.getColorFrame(), COL_MENUCONTENTDARK_PLUS_0);
infobox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]);
infobox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction);
//infobox.enableShadow();
timebox.enableFrame(true, 2);
timebox.setCorner(RADIUS_LARGE);
timebox.setColorAll(ibox.getColorFrame(), ibox.getColorBody());
timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]);
timebox.setColorAll(infobox.getColorFrame(), infobox.getColorBody());
timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]);
timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction);
//timebox.enableShadow();
m_width = m_frameBuffer->getScreenWidthRel();
m_height = m_frameBuffer->getScreenHeightRel();
m_iheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight();
m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
m_buttonHeight = m_theight;
m_mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
m_fheight = g_Font[font_item]->getHeight();
m_title_height = m_iheight*3 + 20; // 3 lines + offset
m_info_height = m_mheight*2;
m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight);
m_height = m_theight + m_info_height + m_title_height + 2*m_buttonHeight + m_listmaxshow * m_fheight; // recalc height
int _top_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight();
int _title_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
int _info_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
footer.setHeight(m_buttonHeight);
m_item_height = g_Font[font_item]->getHeight();
m_header_height = _title_height;
m_footer_height = _title_height;
m_topbox_height = _top_height*3 + 10; // topbox: 3 lines + inner offset + shadow
m_infobox_height = _info_height*2 + 20; // infobox/timebox: 2 lines + inner offset + shadow
/* From top to bottom we have:
*
* topbox (with shadow)
* INNER_OFFSET
* mainwindow (with shadow)
* - header
* - body (items*listshowmax)
* - footer
* INNER_OFFSET
* infobox/timebox (with shadow)
*
* Note: box shadows are disabled atm, so it looks like double offset between boxes
* box shadows seems buggy in ccomponents classes
*/
m_listmaxshow = (m_height - m_topbox_height - SHADOW_OFFSET - INNER_OFFSET - m_header_height - m_footer_height - SHADOW_OFFSET - INNER_OFFSET - m_infobox_height - SHADOW_OFFSET) / (m_item_height);
// recalc height
m_height = m_topbox_height + SHADOW_OFFSET + INNER_OFFSET + m_header_height + (m_listmaxshow * m_item_height) + m_footer_height + SHADOW_OFFSET + INNER_OFFSET + m_infobox_height + SHADOW_OFFSET;
footer.setHeight(m_footer_height);
m_x=getScreenStartX(m_width);
if (m_x < ConnectLineBox_Width)
if (m_x < ConnectLineBox_Width) // shouldn't happen
m_x = ConnectLineBox_Width;
m_y=getScreenStartY(m_height);
// calc positions
m_header_y = m_y + m_topbox_height + SHADOW_OFFSET + INNER_OFFSET;
m_item_y = m_header_y + m_header_height;
m_footer_y = m_item_y + (m_listmaxshow * m_item_height);
m_infobox_y = m_footer_y + m_footer_height + SHADOW_OFFSET + INNER_OFFSET;
}
CUpnpBrowserGui::~CUpnpBrowserGui()
@@ -909,14 +941,14 @@ void CUpnpBrowserGui::paintDeviceInfo()
// third line
tmp += m_devices[m_selecteddevice].modelurl;
topbox.setDimensionsAll(m_x, m_y, m_width, m_title_height-10);
topbox.setDimensionsAll(m_x, m_y, m_width, m_topbox_height);
topbox.setText(tmp, CTextBox::AUTO_WIDTH);
topbox.paint0();
}
void CUpnpBrowserGui::paintDevice(unsigned int _pos)
{
int ypos = m_y + m_title_height + m_theight + _pos*m_fheight;
int ypos = m_item_y + _pos*m_item_height;
fb_pixel_t color;
fb_pixel_t bgcolor;
@@ -932,7 +964,7 @@ void CUpnpBrowserGui::paintDevice(unsigned int _pos)
color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
}
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor);
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor);
if (pos >= m_devices.size())
return;
@@ -944,52 +976,53 @@ void CUpnpBrowserGui::paintDevice(unsigned int _pos)
std::string name = m_devices[pos].friendlyname;
int w = g_Font[font_item]->getRenderWidth(name) + 5;
g_Font[font_item]->RenderString(m_x + 10, ypos + m_fheight, m_width - 30 - w,
num, color, m_fheight);
g_Font[font_item]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight,
w, name, color, m_fheight);
g_Font[font_item]->RenderString(m_x + 10, ypos + m_item_height, m_width - 30 - w,
num, color, m_item_height);
g_Font[font_item]->RenderString(m_x + m_width - 15 - w, ypos + m_item_height,
w, name, color, m_item_height);
}
void CUpnpBrowserGui::paintDevices()
{
int ypos, top;
// LCD
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, "Select UPnP Device");
// Head
CComponentsHeaderLocalized header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP);
CComponentsHeaderLocalized header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP);
if (CNeutrinoApp::getInstance()->isMuted()) //TODO: consider mute mode on runtime
header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL);
else
header.removeContextButtons();
//header.enableShadow();
header.paint(CC_SAVE_SCREEN_NO);
// Items
for (unsigned int count=0; count<m_listmaxshow; count++)
paintDevice(count);
ypos = m_y + m_title_height + m_theight;
int sb = m_fheight * m_listmaxshow;
m_frameBuffer->paintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
int sb = m_item_height * m_listmaxshow;
m_frameBuffer->paintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_MENUCONTENT_PLUS_1);
unsigned int tmp_max = m_listmaxshow;
if(!tmp_max)
tmp_max = 1;
int sbc = ((m_devices.size() - 1) / tmp_max) + 1;
int sbs = ((m_selecteddevice) / tmp_max);
m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
m_frameBuffer->paintBoxRel(m_x + m_width - 13, m_item_y + 2 + sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
//shadow
//m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + SHADOW_OFFSET, SHADOW_OFFSET, sb, COL_SHADOW_PLUS_0);
// Foot
top = m_y + (m_height - m_info_height - 2 * m_buttonHeight);
footer.paintButtons(m_x, top, m_width, m_buttonHeight, 1, &RescanButton, m_width/2);
//footer.enableShadow();
footer.paintButtons(m_x, m_footer_y, m_width, m_footer_height, 1, &RescanButton, m_width/2);
paintItem2DetailsLine (-1); // clear it
}
void CUpnpBrowserGui::paintItem(std::vector<UPnPEntry> *entries, unsigned int pos, unsigned int selected)
{
int ypos = m_y + m_title_height + m_theight + pos*m_fheight;
int ypos = m_item_y + pos*m_item_height;
fb_pixel_t color;
fb_pixel_t bgcolor;
@@ -1003,7 +1036,7 @@ void CUpnpBrowserGui::paintItem(std::vector<UPnPEntry> *entries, unsigned int po
color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
}
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor);
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor);
if (pos >= (*entries).size())
return;
@@ -1053,10 +1086,10 @@ void CUpnpBrowserGui::paintItem(std::vector<UPnPEntry> *entries, unsigned int po
if (icon_w && icon_h)
{
icon_o = icon_w + 10;
m_frameBuffer->paintIcon(fileicon, m_x + 10, ypos + (m_fheight - icon_h) / 2);
m_frameBuffer->paintIcon(fileicon, m_x + 10, ypos + (m_item_height - icon_h) / 2);
}
g_Font[font_item]->RenderString(m_x + m_width - 15 - 10 - w, ypos + m_fheight, w, info, color, m_fheight);
g_Font[font_item]->RenderString(m_x + 10 + icon_o, ypos + m_fheight, m_width - icon_o - 15 - 2*10 - w, name, color, m_fheight);
g_Font[font_item]->RenderString(m_x + m_width - 15 - 10 - w, ypos + m_item_height, w, info, color, m_item_height);
g_Font[font_item]->RenderString(m_x + 10 + icon_o, ypos + m_item_height, m_width - icon_o - 15 - 2*10 - w, name, color, m_item_height);
}
void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry)
@@ -1099,8 +1132,8 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry)
if(lastname != entry->albumArtURI){
tmpname = lastname = entry->albumArtURI.c_str();
tmpname = g_PicViewer->DownloadImage(tmpname);
int h_image = ibox.getHeight()- SHADOW_OFFSET - ibox.getCornerRadius();
int y_image = ibox.getYPos() + ibox.getHeight()/2 - h_image/2;
int h_image = infobox.getHeight() - INNER_OFFSET - infobox.getCornerRadius();
int y_image = infobox.getYPos() + infobox.getHeight()/2 - h_image/2;
if (!image){
image = new CComponentsPicture(100, y_image, tmpname, NULL, CC_SHADOW_OFF, COL_MENUCONTENTDARK_PLUS_0);
image->doPaintBg(false);
@@ -1108,7 +1141,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry)
}
image->setPicture(tmpname);
image->setHeight(h_image, true);
int x_image = ibox.getXPos() + ibox.getWidth()- image->getWidth()- SHADOW_OFFSET - ibox.getCornerRadius();
int x_image = infobox.getXPos() + infobox.getWidth() - image->getWidth() - INNER_OFFSET - infobox.getCornerRadius();
image->setXPos(x_image);
}
}else{
@@ -1123,8 +1156,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry)
void CUpnpBrowserGui::paintItems(std::vector<UPnPEntry> *entry, unsigned int selected, unsigned int max, unsigned int offset)
{
printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, max, offset);
int ypos, top;
printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, max, offset);
//block infoclock
CInfoClock::getInstance()->block();
@@ -1136,18 +1168,18 @@ printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected,
std::string name = g_Locale->getText(LOCALE_UPNPBROWSER_HEAD);
name += " : ";
name += m_devices[m_selecteddevice].friendlyname;
CComponentsHeader header(m_x, m_y + m_title_height, m_width, m_theight, name, NEUTRINO_ICON_UPNP);
CComponentsHeader header(m_x, m_header_y, m_width, m_header_height, name, NEUTRINO_ICON_UPNP);
if (CNeutrinoApp::getInstance()->isMuted())
header.setContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL);
//header.enableShadow();
header.paint(CC_SAVE_SCREEN_NO);
// Items
for (unsigned int count=0; count<m_listmaxshow; count++)
paintItem(entry, count, selected);
ypos = m_y + m_title_height + m_theight;
int sb = m_fheight * m_listmaxshow;
m_frameBuffer->paintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
int sb = m_item_height * m_listmaxshow;
m_frameBuffer->paintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_MENUCONTENT_PLUS_1);
unsigned int tmp = m_listmaxshow ? m_listmaxshow : 1;//avoid division by zero
int sbc = ((max + offset - 1) / tmp) + 1;
int sbs = ((selected + offset) / tmp);
@@ -1155,24 +1187,27 @@ printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected,
int sbh = 0;
if ((sbc > 0) && (sbc > sb-4))
sbh = 2;
m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*((sb-4)/sbc+sbh), 11, (sb-4)/sbc + sbh, COL_MENUCONTENT_PLUS_3);
m_frameBuffer->paintBoxRel(m_x + m_width - 13, m_item_y + 2 + sbs*((sb-4)/sbc+sbh), 11, (sb-4)/sbc + sbh, COL_MENUCONTENT_PLUS_3);
//shadow
//m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + SHADOW_OFFSET, SHADOW_OFFSET, sb, COL_SHADOW_PLUS_0);
// Foot buttons
top = m_y + (m_height - m_info_height - 2 * m_buttonHeight);
size_t numbuttons = sizeof(BrowseButtons)/sizeof(BrowseButtons[0]);
footer.paintButtons(m_x, top, m_width, m_buttonHeight, numbuttons, BrowseButtons, m_width/numbuttons);
//footer.enableShadow();
footer.paintButtons(m_x, m_footer_y, m_width, m_footer_height, numbuttons, BrowseButtons, m_width/numbuttons);
}
void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing)
{
// Foot info
int i_height = 2 * m_buttonHeight;
ibox.setDimensionsAll(m_x, footer.getYPos()+ footer.getHeight()+SHADOW_OFFSET, m_width-i_height-SHADOW_OFFSET, i_height);
timebox.setDimensionsAll(m_x + m_width - i_height, ibox.getYPos(), i_height, i_height);
int timebox_width = m_infobox_height; // maybe not enough
infobox.setDimensionsAll(m_x, m_infobox_y, m_width - SHADOW_OFFSET - INNER_OFFSET - timebox_width, m_infobox_height);
timebox.setDimensionsAll(m_x + m_width - timebox_width, infobox.getYPos(), m_infobox_height, timebox_width);
printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown);
if ((!use_playing) && entry->isdir){
ibox.kill();
infobox.kill();
m_playing_entry_is_shown = false;
}else{
string text = "";
@@ -1182,8 +1217,8 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing)
text = m_playing_entry.title;
text += !m_playing_entry.artist.empty() ? " - " + m_playing_entry.artist : "";
text += "\n" + m_playing_entry.album;
ibox.setText(text, CTextBox::AUTO_WIDTH);
ibox.paint0();
infobox.setText(text, CTextBox::AUTO_WIDTH);
infobox.paint0();
}
}else{
if (!entry)
@@ -1192,8 +1227,8 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing)
text = entry->title;
text += !entry->artist.empty() ? " - " + entry->artist : "";
text += "\n" + entry->album;
ibox.setText(text, CTextBox::AUTO_WIDTH);
ibox.paint0();
infobox.setText(text, CTextBox::AUTO_WIDTH);
infobox.paint0();
}
if (image)
image->paint0();
@@ -1207,14 +1242,14 @@ void CUpnpBrowserGui::paintItem2DetailsLine (int pos)
return;
int xpos = m_x - ConnectLineBox_Width;
int ypos1 = m_y + m_title_height+0 + m_theight + pos*m_fheight;
int ypos2 = ibox.getYPos()+ ibox.getHeight()-ibox.getHeight()/2;
int ypos1 = m_item_y + pos*m_item_height;
int ypos2 = infobox.getYPos() + infobox.getHeight() - infobox.getHeight()/2;
int ypos1a = ypos1 + (m_fheight/2);
int ypos1a = ypos1 + (m_item_height/2);
if (!dline)
dline = new CComponentsDetailLine();
dline->setDimensionsAll(xpos, ypos1a, ypos2, m_fheight/2, ibox.getHeight()-RADIUS_LARGE*3);
dline->setDimensionsAll(xpos, ypos1a, ypos2, m_item_height/2, infobox.getHeight()-RADIUS_LARGE*3);
dline->paint();
}

View File

@@ -79,14 +79,19 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers
unsigned int m_listmaxshow;
unsigned int m_deviceliststart;
unsigned int m_selecteddevice;
int m_fheight; // items font height
int m_theight; // title font height
int m_mheight; // lower box font height
int m_iheight; // upper box font height
int font_item;
int m_buttonHeight;
int m_title_height;
int m_info_height;
int m_topbox_height;
int m_header_height;
int m_header_y;
int m_item_height;
int m_item_y;
int m_footer_height;
int m_footer_y;
int m_infobox_height;
int m_infobox_y;
bool m_folderplay;
std::string m_playfolder;
int m_playid;
@@ -95,7 +100,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers
time_t timeout;
CComponentsDetailLine * dline;
CComponentsFooter footer;
CComponentsInfoBox ibox, timebox, topbox;
CComponentsInfoBox topbox, infobox, timebox;
CComponentsPicture *image;
bool discoverDevices();