mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-06 05:08:29 +02:00
CComponentsWindow: use negative values for discret percental dimensions
Also add possibility to use placeholder for better readability and
better compatibilty with previous implementations.
See doc in source files for more details
Origin commit data
------------------
Branch: ni/coolstream
Commit: cf9a953b59
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-03-03 (Fri, 03 Mar 2017)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -169,13 +169,13 @@ void CComponentsWindow::initWindowSize()
|
||||
if (cc_parent)
|
||||
return;
|
||||
|
||||
if (width > 0 && width <= 100) //percentage conversion TODO: behavior inside parent
|
||||
width = frameBuffer->getScreenWidth()*width/100;
|
||||
if (width < 0 && width >= -100) //percentage conversion TODO: behavior inside parent
|
||||
width = frameBuffer->getScreenWidth()*abs(width)/100;
|
||||
if (width == 0 || (unsigned)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 && height >= -100) //percentage conversion TODO: behavior inside parent
|
||||
height = frameBuffer->getScreenHeight()*abs(height)/100;
|
||||
if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight())
|
||||
height = frameBuffer->getScreenHeight();
|
||||
}
|
||||
|
Reference in New Issue
Block a user