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
This commit is contained in:
2014-04-27 23:48:02 +02:00
parent 6a2e701a7a
commit b038d1b6c1

View File

@@ -76,7 +76,12 @@ void CComponentsIconForm::initVarIconForm( const int &x_pos, const int &y_pos, c
void CComponentsIconForm::addIcon(const std::string& icon_name) void CComponentsIconForm::addIcon(const std::string& icon_name)
{ {
//create new cc-picture item object //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); ccp->doPaintBg(false);
initChainItems(); initChainItems();
@@ -91,7 +96,11 @@ void CComponentsIconForm::addIcon(std::vector<std::string> icon_name)
void CComponentsIconForm::insertIcon(const uint& icon_id, const std::string& icon_name) void CComponentsIconForm::insertIcon(const uint& icon_id, const std::string& icon_name)
{ {
//create new cc-picture item object //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); ccp->doPaintBg(false);
insertCCItem(icon_id, ccp); insertCCItem(icon_id, ccp);