Browse Source

require _onConfigure event implementation for custom wordwrap

PHP-GTK3
yggverse 4 months ago
parent
commit
88e77e6b80
  1. 18
      src/Abstract/Entity/Browser/Container/Page/Content/Markup.php
  2. 10
      src/Entity/Browser.php
  3. 8
      src/Entity/Browser/Container/Page/Content/Gemtext.php
  4. 8
      src/Entity/Browser/Container/Page/Content/Plain.php

18
src/Abstract/Entity/Browser/Container/Page/Content/Markup.php

@ -76,6 +76,19 @@ abstract class Markup @@ -76,6 +76,19 @@ abstract class Markup
);
}
);
$this->gtk->connect(
'configure-event',
function(
GtkWindow $window,
GdkEvent $event
) {
return $this->_onConfigure(
$label,
$event
);
}
);
}
protected function _onActivateLink(
@ -94,6 +107,11 @@ abstract class Markup @@ -94,6 +107,11 @@ abstract class Markup
return false;
}
abstract protected function _onConfigure(
GtkLabel $label,
GdkEvent $event
): bool;
abstract public function set(
string $value
): void;

10
src/Entity/Browser.php

@ -75,16 +75,6 @@ class Browser @@ -75,16 +75,6 @@ class Browser
$this->gtk->show();
// Init events
$this->gtk->connect(
'configure-event',
function(
GtkWindow $window,
// GdkEvent $event
) {
// @TODO render data wordwrap by $window->get_size()
}
);
$this->gtk->connect(
'destroy',
function()

8
src/Entity/Browser/Container/Page/Content/Gemtext.php

@ -248,6 +248,14 @@ class Gemtext extends Markup @@ -248,6 +248,14 @@ class Gemtext extends Markup
);
}
protected function _onConfigure(
GtkLabel $label,
GdkEvent $event
): bool
{
// @TODO
}
protected function _onActivateLink(
GtkLabel $label,
string $href

8
src/Entity/Browser/Container/Page/Content/Plain.php

@ -24,4 +24,12 @@ class Plain extends Markup @@ -24,4 +24,12 @@ class Plain extends Markup
)
);
}
protected function _onConfigure(
GtkLabel $label,
GdkEvent $event
): bool
{
// @TODO
}
}
Loading…
Cancel
Save