implement _onButtonPressEvent method

This commit is contained in:
yggverse 2024-07-21 23:56:48 +03:00
parent ee2f8ba3b1
commit 6afc498186
3 changed files with 29 additions and 6 deletions

View file

@ -67,12 +67,14 @@ abstract class Markup
$this->gtk->connect( $this->gtk->connect(
'button-press-event', 'button-press-event',
function() function(
{ \GtkLabel $label,
// Markup container has focus disabled (to hide cursor position), \GdkEvent $event
// solution remove selection from request entry on click this area ) {
return $this->_onButtonPressEvent(
// @TODO $label,
$event
);
} }
); );
} }
@ -82,6 +84,11 @@ abstract class Markup
string $href string $href
): bool; ): bool;
abstract protected function _onButtonPressEvent(
\GtkLabel $label,
\GdkEvent $event
): bool;
abstract public function set( abstract public function set(
string $value string $value
): void; ): void;

View file

@ -267,6 +267,14 @@ class Gemtext extends Markup
); );
} }
protected function _onButtonPressEvent(
\GtkLabel $label,
\GdkEvent $event
): bool
{
return false;
}
private function _wrap( private function _wrap(
string $value string $value
): string ): string

View file

@ -29,4 +29,12 @@ class Plain extends Markup
{ {
return true; return true;
} }
protected function _onButtonPressEvent(
\GtkLabel $label,
\GdkEvent $event
): bool
{
return false;
}
} }