From b9a775f35e16897cee6f84c47dedb66b8d082209 Mon Sep 17 00:00:00 2001 From: Thomas Peterson Date: Fri, 18 Oct 2024 08:29:21 +0200 Subject: [PATCH] Backup --- app/App.php | 2 +- app/Components/CreateButton.php | 2 +- app/Components/CreateNewTask.php | 20 +++++++++++--------- app/Components/MainLayout.php | 2 +- app/Components/NoProjectSelectedTaskList.php | 2 +- app/Components/ProjectList.php | 4 ++-- app/Components/TaskList.php | 2 +- app/View/TestLayoutView.php | 10 +++++++--- app/View/WindowView.php | 2 +- 9 files changed, 26 insertions(+), 20 deletions(-) diff --git a/app/App.php b/app/App.php index f37aea9..a83d4e9 100644 --- a/app/App.php +++ b/app/App.php @@ -14,6 +14,6 @@ class App implements \PHPNative\Framework\App public function getStartWindow(): string { - return TestLayoutWindow::class; + return MainWindow::class; } } \ No newline at end of file diff --git a/app/Components/CreateButton.php b/app/Components/CreateButton.php index 0a6c1e8..fd02e62 100644 --- a/app/Components/CreateButton.php +++ b/app/Components/CreateButton.php @@ -15,7 +15,7 @@ class CreateButton extends Button public function __construct(public string $label, string $style = '') { - parent::__construct( style: "px-3 py-2 bg-sky-500 hover:bg-blue-800 text-white hover:text-green-500 m-10 p-8 w-full rounded-xl flex flex-row"); + parent::__construct( style: "px-3 py-2 bg-red-400 hover:bg-blue-800 hover:text-green-500 h-50 rounded m-5"); $this->icon = new Icon(\PHPNative\Tailwind\Data\Icon::plus, style: 'text-white'); $this->text = new Text($this->label, 'text-xl text-white m-3'); } diff --git a/app/Components/CreateNewTask.php b/app/Components/CreateNewTask.php index 385cd96..06eace0 100644 --- a/app/Components/CreateNewTask.php +++ b/app/Components/CreateNewTask.php @@ -16,22 +16,24 @@ class CreateNewTask extends Container public function __construct() { - $this->style = 'flex flex-row m-10 rounded w-full'; + parent::__construct(id: 'createnewtask'); + $this->style = 'flex flex-row m-10 rounded'; $this->saveButton = new Button(views: new Views([ new \PHPNative\UI\Widget\Icon(icon: Icon::save, style: 'text-white'), - new Text(text: 'save Task', style: 'text-2xl text-white ml-30') - ]), style: 'flex-none w-150 bg-green-500 rounded-xl p-4 ml-10 hover:bg-green-700'); + new Text(text: 'save Task', style: 'text-2xl text-white ml-5') + ]), style: 'flex-none w-190 bg-green-500 rounded-xl p-4 ml-10 hover:bg-green-700'); - $this->textEdit = new TextEdit(style: 'flex-1 w-100 text-2xl bg-slate-200 px-10 rounded-xl text-black p-6', placeholder: 'Placeholder'); - } - - public function getViews(): ?Views - { - return new Views([ + $this->textEdit = new TextEdit(style: 'flex-1 text-2xl bg-slate-200 px-10 rounded-xl text-black p-6', placeholder: 'Placeholder'); + $this->views = new Views([ $this->textEdit, $this->saveButton, ]); } + public function getViews(): ?Views + { + return $this->views; + } + } \ No newline at end of file diff --git a/app/Components/MainLayout.php b/app/Components/MainLayout.php index 4d868c4..5965620 100644 --- a/app/Components/MainLayout.php +++ b/app/Components/MainLayout.php @@ -14,7 +14,7 @@ class MainLayout extends Container public function __construct(public ProjectList $projectList, public TaskList $taskList, private NoProjectSelectedTaskList $noProjectSelectedTaskList) { parent::__construct(); - $this->style = "flex flex-row bg-slate-200"; + $this->style = "flex flex-row"; $this->noProjectSelectedViews = new Views([ $this->projectList, $this->noProjectSelectedTaskList diff --git a/app/Components/NoProjectSelectedTaskList.php b/app/Components/NoProjectSelectedTaskList.php index ae69089..6db96db 100644 --- a/app/Components/NoProjectSelectedTaskList.php +++ b/app/Components/NoProjectSelectedTaskList.php @@ -21,7 +21,7 @@ class NoProjectSelectedTaskList extends Container public function getViews(): ?Views { return new Views([ - $this->headline + // $this->headline ]); } } \ No newline at end of file diff --git a/app/Components/ProjectList.php b/app/Components/ProjectList.php index 11b4761..ace2e08 100644 --- a/app/Components/ProjectList.php +++ b/app/Components/ProjectList.php @@ -28,11 +28,11 @@ class ProjectList extends Container public function __construct(private Lifecycle $lifecycle, private \PHPNative\Container\Container $container) { parent::__construct(); - $this->style = 'flex-none w-100 bg-yellow-400 flex flex-col'; + $this->style = 'flex-none w-300 flex flex-col'; $this->createButton = new CreateButton("create Project"); $this->createButton->setOnClick(fn(Worker $worker) => $this->addProject($worker)); $this->listData = new ProjectListData(); - $this->headLine = new Text(text: 'Projects:', style: 'ml-10 mb-10 text-3xl'); + $this->headLine = new Text(text: 'Projects:', style: 'ml-10 mb-2 text-3xl text-black'); $this->loadProjects(); } diff --git a/app/Components/TaskList.php b/app/Components/TaskList.php index b528944..c12eef1 100644 --- a/app/Components/TaskList.php +++ b/app/Components/TaskList.php @@ -21,7 +21,7 @@ class TaskList extends Container public function __construct(private Lifecycle $lifecycle, private \PHPNative\Container\Container $container) { - $this->style = "basis-4/6 h-full flex flex-col"; + $this->style = "flex-1 flex flex-col"; $this->createNewTask = new CreateNewTask(); $this->listData = new TaskListData(); $this->headline = new Text(text:'', style: 'w-full bg-lime-200 text-4xl m-10 p-10 text-black'); diff --git a/app/View/TestLayoutView.php b/app/View/TestLayoutView.php index 7ee014f..5dc7b3d 100644 --- a/app/View/TestLayoutView.php +++ b/app/View/TestLayoutView.php @@ -40,16 +40,20 @@ class TestLayoutView extends BaseView implements View new Container(id: 'vertical', style: 'flex flex-col overflow-auto border border-black', views: new Views([ new Text(id:'third', text: 'third', style: 'bg-green-200'), new Text(id:'four', text: 'four', style: 'border border-black bg-slate-200'), - new Text(id:'five', text: 'five', style: 'border border-black bg-slate-200'), + new Text(id:'five', text: 'five', style: 'm-10 border border-black bg-slate-200'), new Text(id:'six', text: 'six', style: 'border border-black bg-slate-200'), - new Text(id:'seven', text: 'seven', style: 'border border-black bg-slate-200'), + new Text(id:'seven', text: 'seven', style: 'p-10 border border-black bg-slate-200'), new Text(id:'eight', text: 'eight', style: 'border border-black bg-slate-200'), new Text(id:'nine', text: 'nine', style: 'border border-black bg-slate-200'), new Text(id:'ten', text: 'ten', style: 'border border-black bg-slate-200'), new Text(id:'eleven', text: 'eleven', style: 'border border-black bg-slate-200'), ])) ])), - new Container(style: 'flex-1 bg-green-300 flex flex-row'), + new Container(style: 'flex-1 bg-green-300', views: new Views([ + new Button(new Views([ + new Text(text: 'Test Button', style: 'text-red-500 m-10') + ]), style: 'm-10 bg-green-200 p-10') + ])), new Container(style: 'flex-none w-100 bg-red-400'), ])), new Container(id: 'sky', style: 'flex-1 bg-sky-600 w-full m-5'), diff --git a/app/View/WindowView.php b/app/View/WindowView.php index 574cea1..d0e365e 100644 --- a/app/View/WindowView.php +++ b/app/View/WindowView.php @@ -9,7 +9,7 @@ use PHPNative\UI\View; class WindowView extends BaseView implements View { - public string $style = "bg-green-200 w-full h-full"; + public string $style = "bg-white"; public function __construct(public MainLayout $mainLayout) {