mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
CComponentsForm: reduce corner radius on frame border
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 are not considered at the moment!
This commit is contained in:
@@ -423,6 +423,7 @@ void CComponentsForm::paintCCItems()
|
||||
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 : 0;
|
||||
|
||||
//set required x-position to item:
|
||||
@@ -442,6 +443,7 @@ void CComponentsForm::paintCCItems()
|
||||
auto_x = (cc_item->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 : 0;
|
||||
|
||||
//set required y-position to item
|
||||
@@ -461,6 +463,13 @@ void CComponentsForm::paintCCItems()
|
||||
auto_y = (cc_item->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){
|
||||
if(xpos <= fr_thickness || ypos <= fr_thickness)
|
||||
cc_item->setCorner(max(0, cc_item->getCornerRadius()-w_parent_frame), cc_item->getCornerType());
|
||||
}
|
||||
|
||||
//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.
|
||||
//This should be avoid!
|
||||
|
Reference in New Issue
Block a user