From 38cb571189b0424ad01a0a9f88f151f2a31a4e34 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 7 Jul 2024 01:14:16 +0300 Subject: [PATCH] implement viewport to integrate scrolled window features for data label --- .../Browser/Container/Tab/Page/Content.php | 16 +++++++++++-- .../Container/Tab/Page/Content/Viewport.php | 23 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 src/Entity/Browser/Container/Tab/Page/Content/Viewport.php diff --git a/src/Entity/Browser/Container/Tab/Page/Content.php b/src/Entity/Browser/Container/Tab/Page/Content.php index c299a2b9..a9b95ebe 100644 --- a/src/Entity/Browser/Container/Tab/Page/Content.php +++ b/src/Entity/Browser/Container/Tab/Page/Content.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page; use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content\Data; +use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content\Viewport; class Content { @@ -15,6 +16,7 @@ class Content // Requirements public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content\Data $data; + public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content\Viewport $viewport; // Defaults private int $_margin = 8; @@ -43,14 +45,24 @@ class Content true ); - // Init label + // Init viewport + // to integrate scrolled window features for data label + $this->viewport = new Viewport( + $this + ); + + // Init data label $this->data = new Data( $this ); - $this->gtk->add( + $this->viewport->gtk->add( $this->data->gtk ); + + $this->gtk->add( + $this->viewport->gtk + ); } public function refresh() diff --git a/src/Entity/Browser/Container/Tab/Page/Content/Viewport.php b/src/Entity/Browser/Container/Tab/Page/Content/Viewport.php new file mode 100644 index 00000000..656cf91b --- /dev/null +++ b/src/Entity/Browser/Container/Tab/Page/Content/Viewport.php @@ -0,0 +1,23 @@ +content = $content; + + // Init viewport + $this->gtk = new \GtkViewport; + } +} \ No newline at end of file