mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 18:01:13 +02:00
cc_frm: don't consider parent frame inside render of items for child forms
This commit is contained in:
@@ -492,52 +492,41 @@ void CComponentsForm::paintCCItems()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//move item x-position, if we have a frame on parent, TODO: other constellations not considered at the moment
|
|
||||||
w_parent_frame = xpos <= fr_thickness ? fr_thickness : w_parent_frame;
|
|
||||||
|
|
||||||
//set required x-position to item:
|
//set required x-position to item:
|
||||||
//append vertical
|
//append vertical
|
||||||
if (xpos == CC_APPEND){
|
if (xpos == CC_APPEND){
|
||||||
auto_x += append_x_offset;
|
auto_x += append_x_offset;
|
||||||
v_cc_items.at(i)->setRealXPos(auto_x + xpos + w_parent_frame);
|
v_cc_items.at(i)->setRealXPos(auto_x + xpos);
|
||||||
auto_x += w_item;
|
auto_x += w_item;
|
||||||
}
|
}
|
||||||
//positionize vertical centered
|
//positionize vertical centered
|
||||||
else if (xpos == CC_CENTERED){
|
else if (xpos == CC_CENTERED){
|
||||||
auto_x = this_w/2 - w_item/2 - w_parent_frame/2;
|
auto_x = this_w/2 - w_item/2;
|
||||||
v_cc_items.at(i)->setRealXPos(this_x + auto_x);
|
v_cc_items.at(i)->setRealXPos(this_x + auto_x);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
v_cc_items.at(i)->setRealXPos(this_x + xpos + w_parent_frame);
|
v_cc_items.at(i)->setRealXPos(this_x + xpos);
|
||||||
auto_x = (v_cc_items.at(i)->getRealXPos() + w_item);
|
auto_x = (v_cc_items.at(i)->getRealXPos() + w_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
//move item y-position, if we have a frame on parent, TODO: other constellations not considered at the moment
|
|
||||||
w_parent_frame = ypos <= fr_thickness ? fr_thickness : w_parent_frame;
|
|
||||||
|
|
||||||
//set required y-position to item
|
//set required y-position to item
|
||||||
//append hor
|
//append hor
|
||||||
if (ypos == CC_APPEND){
|
if (ypos == CC_APPEND){
|
||||||
auto_y += append_y_offset;
|
auto_y += append_y_offset;
|
||||||
// FIXME: ypos is probably wrong here, because it is -1
|
// FIXME: ypos is probably wrong here, because it is -1
|
||||||
v_cc_items.at(i)->setRealYPos(auto_y + ypos + w_parent_frame);
|
v_cc_items.at(i)->setRealYPos(auto_y + ypos);
|
||||||
auto_y += h_item;
|
auto_y += h_item;
|
||||||
}
|
}
|
||||||
//positionize hor centered
|
//positionize hor centered
|
||||||
else if (ypos == CC_CENTERED){
|
else if (ypos == CC_CENTERED){
|
||||||
auto_y = height/2 - h_item/2 - w_parent_frame/2;
|
auto_y = height/2 - h_item/2;
|
||||||
v_cc_items.at(i)->setRealYPos(this_y + auto_y);
|
v_cc_items.at(i)->setRealYPos(this_y + auto_y);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
v_cc_items.at(i)->setRealYPos(this_y + ypos + w_parent_frame);
|
v_cc_items.at(i)->setRealYPos(this_y + ypos);
|
||||||
auto_y = (v_cc_items.at(i)->getRealYPos() + h_item);
|
auto_y = (v_cc_items.at(i)->getRealYPos() + h_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
//reduce corner radius, if we have a frame around parent item, ensure matching corners inside of embedded item, this avoids ugly unpainted spaces between frame and item border
|
|
||||||
//TODO: other constellations not considered at the moment
|
|
||||||
if (w_parent_frame)
|
|
||||||
v_cc_items.at(i)->setCorner(max(0, v_cc_items.at(i)->getCornerRadius()- w_parent_frame), v_cc_items.at(i)->getCornerType());
|
|
||||||
|
|
||||||
//These steps check whether the element can be painted into the container.
|
//These steps check whether the element can be painted into the container.
|
||||||
//Is it too wide or too high, it will be shortened and displayed in the log.
|
//Is it too wide or too high, it will be shortened and displayed in the log.
|
||||||
//This should be avoid!
|
//This should be avoid!
|
||||||
|
Reference in New Issue
Block a user