From 6afc4981864b08a0513c36eef25e6aac8e8c331b Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 21 Jul 2024 23:56:48 +0300 Subject: [PATCH] implement _onButtonPressEvent method --- .../Browser/Container/Page/Content/Markup.php | 19 +++++++++++++------ .../Container/Page/Content/Gemtext.php | 8 ++++++++ .../Browser/Container/Page/Content/Plain.php | 8 ++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/Abstract/Entity/Browser/Container/Page/Content/Markup.php b/src/Abstract/Entity/Browser/Container/Page/Content/Markup.php index 1d99513b..5b59115c 100644 --- a/src/Abstract/Entity/Browser/Container/Page/Content/Markup.php +++ b/src/Abstract/Entity/Browser/Container/Page/Content/Markup.php @@ -67,12 +67,14 @@ abstract class Markup $this->gtk->connect( 'button-press-event', - function() - { - // Markup container has focus disabled (to hide cursor position), - // solution remove selection from request entry on click this area - - // @TODO + function( + \GtkLabel $label, + \GdkEvent $event + ) { + return $this->_onButtonPressEvent( + $label, + $event + ); } ); } @@ -82,6 +84,11 @@ abstract class Markup string $href ): bool; + abstract protected function _onButtonPressEvent( + \GtkLabel $label, + \GdkEvent $event + ): bool; + abstract public function set( string $value ): void; diff --git a/src/Entity/Browser/Container/Page/Content/Gemtext.php b/src/Entity/Browser/Container/Page/Content/Gemtext.php index a757ac2f..4ed64f28 100644 --- a/src/Entity/Browser/Container/Page/Content/Gemtext.php +++ b/src/Entity/Browser/Container/Page/Content/Gemtext.php @@ -267,6 +267,14 @@ class Gemtext extends Markup ); } + protected function _onButtonPressEvent( + \GtkLabel $label, + \GdkEvent $event + ): bool + { + return false; + } + private function _wrap( string $value ): string diff --git a/src/Entity/Browser/Container/Page/Content/Plain.php b/src/Entity/Browser/Container/Page/Content/Plain.php index 8e191701..b0e2d36c 100644 --- a/src/Entity/Browser/Container/Page/Content/Plain.php +++ b/src/Entity/Browser/Container/Page/Content/Plain.php @@ -29,4 +29,12 @@ class Plain extends Markup { return true; } + + protected function _onButtonPressEvent( + \GtkLabel $label, + \GdkEvent $event + ): bool + { + return false; + } } \ No newline at end of file