mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 00:11:08 +02:00
CComponentsForm: add predefine CC_CENTERED for auto positions
This saves explicit position calculations to arrange items centered
Origin commit data
------------------
Branch: ni/coolstream
Commit: 3ff09c88bd
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-10-11 (Fri, 11 Oct 2013)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -309,23 +309,35 @@ void CComponentsForm::paintCCItems()
|
||||
int xpos = cc_item->getXPos();
|
||||
int ypos = cc_item->getYPos();
|
||||
|
||||
//set required x-position to item
|
||||
//set required x-position to item:
|
||||
//append vertical
|
||||
if (xpos == CC_APPEND){
|
||||
auto_x += append_h_offset;
|
||||
cc_item->setRealXPos(auto_x + xpos + 1);
|
||||
auto_x += w_item;
|
||||
}
|
||||
//positionize vertical centered
|
||||
else if (xpos == CC_CENTERED){
|
||||
auto_x = width/2 - cc_item->getWidth()/2;
|
||||
cc_item->setRealXPos(this_x + auto_x);
|
||||
}
|
||||
else{
|
||||
cc_item->setRealXPos(this_x + xpos);
|
||||
auto_x = (cc_item->getRealXPos() + w_item);
|
||||
}
|
||||
|
||||
//set required y-position to item
|
||||
//append hor
|
||||
if (ypos == CC_APPEND){
|
||||
auto_y += append_v_offset;
|
||||
cc_item->setRealYPos(auto_y + ypos + 1);
|
||||
auto_y += h_item;
|
||||
}
|
||||
//positionize hor centered
|
||||
else if (ypos == CC_CENTERED){
|
||||
auto_y = height/2 - cc_item->getHeight()/2;
|
||||
cc_item->setRealYPos(this_y + auto_y);
|
||||
}
|
||||
else{
|
||||
cc_item->setRealYPos(this_y + ypos);
|
||||
auto_y = (cc_item->getRealYPos() + h_item);
|
||||
|
Reference in New Issue
Block a user