From 1a37ddcb9c78f8ee7159964d0341ec7b1ac4401f Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 25 Jul 2024 02:25:37 +0300 Subject: [PATCH] add progressbar margin, set step as public const --- .../Browser/Container/Page/Progressbar.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Entity/Browser/Container/Page/Progressbar.php b/src/Entity/Browser/Container/Page/Progressbar.php index e4e6d7e..9356f44 100644 --- a/src/Entity/Browser/Container/Page/Progressbar.php +++ b/src/Entity/Browser/Container/Page/Progressbar.php @@ -20,7 +20,8 @@ class Progressbar // Defaults private bool $_active = false; - private float $_step = 0.02; + public const MARGIN = 8; + public const STEP = 0.02; public function __construct( Page $page, @@ -31,6 +32,18 @@ class Progressbar // Init container $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->set_opacity(0); // init transparently @@ -119,7 +132,7 @@ class Progressbar { // Update fraction step $this->gtk->set_fraction( - $fraction = $this->gtk->get_fraction() + $this->_step + $fraction = $this->gtk->get_fraction() + $this::STEP ); // Deactivate loop on progress complete