GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
Implement set_rect for ProgressBar to account for label offset
src/widget/display/progress_bar.rs | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/widget/display/progress_bar.rs b/src/widget/display/progress_bar.rs
index 2aa8db0..8c22a67 100644
--- a/src/widget/display/progress_bar.rs
+++ b/src/widget/display/progress_bar.rs
@@ -22,6 +22,14 @@ impl ProgressBar {
impl Element for ProgressBar {
crate::impl_widget_base!(ProgressBar);
+
+ fn set_rect(&mut self, x: f32, y: f32, w: f32, h: f32) {
+ self.base.x = x;
+ self.base.y = y;
+ self.base.w = w;
+ self.base.h = h + self.base.label_offset();
+ }
+
fn highlight_quad(&self, _ctx: &UiContext) -> Option<(f32, f32, f32, f32, [f32; 4])>{ None }
fn color(&self) -> [f32; 4] { colors::PROGRESS_BG }