mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
add progressbar margin, set step as public const
This commit is contained in:
parent
55afbcdab4
commit
1a37ddcb9c
1 changed files with 15 additions and 2 deletions
|
|
@ -20,7 +20,8 @@ class Progressbar
|
||||||
// Defaults
|
// Defaults
|
||||||
private bool $_active = false;
|
private bool $_active = false;
|
||||||
|
|
||||||
private float $_step = 0.02;
|
public const MARGIN = 8;
|
||||||
|
public const STEP = 0.02;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Page $page,
|
Page $page,
|
||||||
|
|
@ -31,6 +32,18 @@ class Progressbar
|
||||||
// Init container
|
// Init container
|
||||||
$this->gtk = new GtkProgressBar;
|
$this->gtk = new GtkProgressBar;
|
||||||
|
|
||||||
|
$this->gtk->set_margin_start(
|
||||||
|
$this::MARGIN
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->gtk->set_margin_end(
|
||||||
|
$this::MARGIN
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->gtk->set_margin_bottom(
|
||||||
|
$this::MARGIN
|
||||||
|
);
|
||||||
|
|
||||||
$this->gtk->show(); // fixed block height, show always
|
$this->gtk->show(); // fixed block height, show always
|
||||||
|
|
||||||
$this->gtk->set_opacity(0); // init transparently
|
$this->gtk->set_opacity(0); // init transparently
|
||||||
|
|
@ -119,7 +132,7 @@ class Progressbar
|
||||||
{
|
{
|
||||||
// Update fraction step
|
// Update fraction step
|
||||||
$this->gtk->set_fraction(
|
$this->gtk->set_fraction(
|
||||||
$fraction = $this->gtk->get_fraction() + $this->_step
|
$fraction = $this->gtk->get_fraction() + $this::STEP
|
||||||
);
|
);
|
||||||
|
|
||||||
// Deactivate loop on progress complete
|
// Deactivate loop on progress complete
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue