diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index f20b0c125..b279ad136 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -40,10 +40,10 @@ class CComponents bool allowPaint(const int& i); protected: int x, y, height, width, corner_type, shadow_w; - int corner_rad, fr_thickness; + int corner_rad, fr_thickness, fr_thickness_sel; CFrameBuffer * frameBuffer; std::vector v_fbdata; - fb_pixel_t col_body, col_shadow, col_frame; + fb_pixel_t col_body, col_shadow, col_frame, col_frame_sel; bool firstPaint, shadow, is_painted, paint_bg; void initVarBasic(); @@ -128,7 +128,7 @@ class CComponentsItem : public CComponents virtual void kill(); virtual int getItemType(); virtual void syncSysColors(); - + ///setters for item select stats virtual void setSelected(bool selected){cc_item_selected = selected;}; virtual void setEnable(bool enabled){cc_item_enabled = enabled;}; @@ -216,7 +216,7 @@ class CComponentsText : public CComponentsItem virtual void removeLineBreaks(std::string& str); //get a Text Box object, so it's possible to get access directly to its methods - CTextBox* getCTextBoxObject() { return ct_textbox; }; + virtual CTextBox* getCTextBoxObject() { return ct_textbox; }; }; class CComponentsLabel : public CComponentsText diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index b5fda280c..f9d7bf9c9 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -16,7 +16,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the @@ -64,11 +64,13 @@ void CComponents::initVarBasic() col_body = COL_MENUCONTENT_PLUS_0; col_shadow = COL_MENUCONTENTDARK_PLUS_0; col_frame = COL_MENUCONTENT_PLUS_6; + col_frame_sel = COL_MENUCONTENTSELECTED_PLUS_0; corner_type = CORNER_ALL; corner_rad = 0; shadow = CC_SHADOW_OFF; shadow_w = SHADOW_OFFSET; fr_thickness = 0; + fr_thickness_sel = 3; firstPaint = true; is_painted = false; diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 43a7ddb46..ad7190263 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -72,12 +72,18 @@ void CComponentsItem::paintInit(bool do_save_bg) int sw = shadow ? shadow_w : 0; int th = fr_thickness; + int col_frame_cur = col_frame; + if (cc_item_selected){ + col_frame_cur = col_frame_sel; + th = max(fr_thickness_sel, fr_thickness); + } + comp_fbdata_t fbdata[] = { {CC_FBDATA_TYPE_BGSCREEN, x, y, width+sw, height+sw, 0, 0, 0, NULL, NULL}, {CC_FBDATA_TYPE_SHADOW, x+sw, y+sw, width, height, col_shadow, corner_rad, 0, NULL, NULL}, - {CC_FBDATA_TYPE_FRAME, x, y, width, height, col_frame, corner_rad, th, NULL, NULL}, + {CC_FBDATA_TYPE_FRAME, x, y, width, height, col_frame_cur, corner_rad, th, NULL, NULL}, {CC_FBDATA_TYPE_BOX, x+th, y+th, width-2*th, height-2*th, col_body, corner_rad-th, 0, NULL, NULL}, };