mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
CComponentsWindow: use percentage conversion for dimension values
Dimension values for windows below a certain size are often not really useful, even with regard to different resolutions. Usage of percent values could be easier to handle. In the constructor, the argument values für dimesions must be only between 1 and 100 to achieve this. TODO: behavior inside parents
This commit is contained in:
@@ -169,9 +169,13 @@ void CComponentsWindow::initWindowSize()
|
|||||||
if (cc_parent)
|
if (cc_parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (width > 0 && width <= 100) //percentage conversion TODO: behavior inside parent
|
||||||
|
width = frameBuffer->getScreenWidth()*width/100;
|
||||||
if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth())
|
if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth())
|
||||||
width = frameBuffer->getScreenWidth();
|
width = frameBuffer->getScreenWidth();
|
||||||
|
|
||||||
|
if (height > 0 && height <= 100) //percentage conversion TODO: behavior inside parent
|
||||||
|
height = frameBuffer->getScreenHeight()*height/100;
|
||||||
if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight())
|
if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight())
|
||||||
height = frameBuffer->getScreenHeight();
|
height = frameBuffer->getScreenHeight();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user