mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
draft new events, rename returned variables to native, fix data types
This commit is contained in:
parent
dfd37dcef4
commit
61a492c6c9
1 changed files with 31 additions and 9 deletions
|
|
@ -50,18 +50,40 @@ class Tab
|
||||||
$this->gtk->connect(
|
$this->gtk->connect(
|
||||||
'switch-page',
|
'switch-page',
|
||||||
function (
|
function (
|
||||||
\GtkNotebook $entity,
|
?\GtkNotebook $self,
|
||||||
\GtkWidget $child,
|
?\GtkWidget $child,
|
||||||
int $index
|
int $page_num
|
||||||
) {
|
) {
|
||||||
// Update header bar title
|
// Update header bar title
|
||||||
$this->container->browser->header->setTitle(
|
$this->container->browser->header->setTitle(
|
||||||
$this->getPage($index)->title->getValue(),
|
$this->getPage($page_num)->title->getValue(),
|
||||||
$this->getPage($index)->title->getSubtitle()
|
$this->getPage($page_num)->title->getSubtitle()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Keep current selection
|
// Keep current selection
|
||||||
$entity->grab_focus();
|
$self->grab_focus();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->gtk->connect(
|
||||||
|
'page-removed',
|
||||||
|
function (
|
||||||
|
?\GtkNotebook $self,
|
||||||
|
?\GtkWidget $child,
|
||||||
|
int $page_num
|
||||||
|
) {
|
||||||
|
// @TODO
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->gtk->connect(
|
||||||
|
'page-reordered',
|
||||||
|
function (
|
||||||
|
?\GtkNotebook $self,
|
||||||
|
?\GtkWidget $child,
|
||||||
|
int $page_num
|
||||||
|
) {
|
||||||
|
// @TODO
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -117,14 +139,14 @@ class Tab
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPage(
|
public function getPage(
|
||||||
int $index
|
int $page_num
|
||||||
): ?\Yggverse\Yoda\Entity\Browser\Container\Page
|
): ?\Yggverse\Yoda\Entity\Browser\Container\Page
|
||||||
{
|
{
|
||||||
if (empty($this->_page[$index]))
|
if (empty($this->_page[$page_num]))
|
||||||
{
|
{
|
||||||
throw new \Exception;
|
throw new \Exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->_page[$index];
|
return $this->_page[$page_num];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue