Rendering: improve tile sizes, fullscreen mode

This commit is contained in:
Thomas Gelf 2016-12-09 16:59:25 +01:00
parent 135197cc45
commit 72e7aa798c
4 changed files with 36 additions and 10 deletions

View file

@ -102,7 +102,9 @@ class ProcessController extends Controller
);
}
$controls->add($this->getProcessTabs($bp, $renderer));
if (! ($this->showFullscreen || $this->view->compact)) {
$controls->add($this->getProcessTabs($bp, $renderer));
}
if (! $this->view->compact) {
$controls->add(Element::create('h1')->setContent($this->view->title));
}
@ -141,9 +143,6 @@ class ProcessController extends Controller
protected function getProcessTabs(BusinessProcess $bp, Renderer $renderer)
{
if ($this->showFullscreen || $this->view->compact) {
return;
}
$tabs = $this->singleTab($bp->getTitle());
if (! $renderer->isLocked()) {
@ -175,6 +174,9 @@ class ProcessController extends Controller
{
$action = $this->params->get('action');
$form = null;
if ($this->showFullscreen) {
return;
}
if ($action === 'add') {
$form =$this->loadForm('AddNode')

View file

@ -86,6 +86,30 @@ abstract class Renderer extends Html
return $this->parent->getParents();
}
/**
* @return BpNode[]
*/
public function getChildNodes()
{
if ($this->wantsRootNodes()) {
return $this->bp->getRootNodes();
} else {
return $this->parent->getChildren();
}
}
/**
* @return int
*/
public function countChildNodes()
{
if ($this->wantsRootNodes()) {
return $this->bp->countChildren();
} else {
return $this->parent->countChildren();
}
}
/**
* @param $summary
* @return Container

View file

@ -63,12 +63,12 @@ class TileRenderer extends Renderer
*/
protected function howMany()
{
$count = $this->bp->countChildren();
$count = $this->countChildNodes();
$howMany = 'normal';
if ($count < 20) {
if ($count <= 6) {
$howMany = 'few';
} elseif ($count > 50) {
} elseif ($count > 12) {
$howMany = 'many';
}

View file

@ -505,13 +505,13 @@ div.bp .badges {
}
.tiles.few { font-size: 3em; }
.tiles.normal { font-size: 2em; }
.tiles.many { font-size: 1.5em; }
.tiles.normal { font-size: 2.4em; }
.tiles.many { font-size: 1.8em; }
#layout.twocols, #layout.layout-minimal, .compact {
.tiles.few { font-size: 1.8em; }
.tiles.normal { font-size: 1.4em; }
.tiles.many { font-size: 0.9em; }
.tiles.many { font-size: 1.2em; }
}
#layout.fullscreen-layout .controls {