From b038d1b6c1b7979e19a6ba7a4364a1578b7f7112 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Apr 2014 23:48:02 +0200 Subject: [PATCH] CComponentsIconForm: consider relevant paint direction, don't use 0 values Value 0 can not be used without problems here, because explicit values are required since a9a6a925240675c44243754e82dbee79f2d84698 --- src/gui/components/cc_frm_icons.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_icons.cpp b/src/gui/components/cc_frm_icons.cpp index 67349abf8..c8c3d52c5 100644 --- a/src/gui/components/cc_frm_icons.cpp +++ b/src/gui/components/cc_frm_icons.cpp @@ -76,7 +76,12 @@ void CComponentsIconForm::initVarIconForm( const int &x_pos, const int &y_pos, c void CComponentsIconForm::addIcon(const std::string& icon_name) { //create new cc-picture item object - CComponentsPicture *ccp = new CComponentsPicture(0, 0, 0, 0, icon_name, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, this); + CComponentsPicture *ccp = new CComponentsPicture(chn_direction == CC_DIR_X ? CC_APPEND : CC_CENTERED, + chn_direction == CC_DIR_Y ? CC_APPEND : CC_CENTERED, + 0, 0, + icon_name, + CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, + this); ccp->doPaintBg(false); initChainItems(); @@ -91,7 +96,11 @@ void CComponentsIconForm::addIcon(std::vector icon_name) void CComponentsIconForm::insertIcon(const uint& icon_id, const std::string& icon_name) { //create new cc-picture item object - CComponentsPicture *ccp = new CComponentsPicture(0, 0, 0, 0, icon_name, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER); + CComponentsPicture *ccp = new CComponentsPicture(chn_direction == CC_DIR_X ? CC_APPEND : CC_CENTERED, + chn_direction == CC_DIR_Y ? CC_APPEND : CC_CENTERED, + 0, 0, + icon_name, + CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER); ccp->doPaintBg(false); insertCCItem(icon_id, ccp);