Browse Source

adding

master
Björn 3 years ago
parent
commit
1cbffce8ed
2 changed files with 44 additions and 5 deletions
  1. +11
    -5
      app/Commands/SettingsMenuCommand.php
  2. +33
    -0
      app/Menus/StylesFactory.php

+ 11
- 5
app/Commands/SettingsMenuCommand.php View File

@ -28,10 +28,16 @@ class SettingsMenuCommand extends Command
*/ */
public function handle() public function handle()
{ {
$option = $this->menu('Settings', [
'Freshly baked muffins',
'Freshly baked croissants',
'Turnovers, crumb cake, cinnamon buns, scones',
])->open();
// create menu
$builder = $this->menu('Settings')
->addSubMenu('Sources', [
'd',
'e'
]);
$builder->addLineBreak('-');
$mainmenu = $builder->build();
$mainmenu->open();
} }
} }

+ 33
- 0
app/Menus/StylesFactory.php View File

@ -0,0 +1,33 @@
<?php
namespace App\Menus;
use PhpSchool\CliMenu\Builder\CliMenuBuilder;
/**
* Default Styles
*
* @author Björn Hase, Tentakelfabrik
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://gitea.tentakelfabrik.de/Tentakelfabrik/mcp
*
*/
class StylesFactory
{
/**
* Adding default styles for menus
*
*
* @param CliMenuBuilder $builder [description]
*/
public function setMenuStyles(CliMenuBuilder $builder)
{
$builder->setWidth($builder->getTerminal()->getWidth());
$builder->setBorderLeftWidth(4);
$builder->setBorderColour('magenta');
$builder->setMargin(2);
$builder->setPadding(2, 4);
return $builder;
}
}

Loading…
Cancel
Save