From 2a3c0d9ceac54c9f6d9312c610d2a161a4bb37c9 Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Tue, 9 Aug 2022 22:04:22 +0300 Subject: some renames --- src/bar.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/bar.rs') diff --git a/src/bar.rs b/src/bar.rs index f3dc95c..b157190 100644 --- a/src/bar.rs +++ b/src/bar.rs @@ -20,7 +20,7 @@ use crate::{ }; pub struct Bar { - pub first_configure: bool, + pub configured: bool, pub width: u32, pub height: u32, pub scale: i32, @@ -35,12 +35,12 @@ pub struct Bar { impl Bar { pub fn configure(&mut self, ss: &mut SharedState, width: u32) { - if self.width != width { + if self.width != width && width != 0 { self.width = width; self.layer.set_exclusive_zone(self.height as i32); } - self.first_configure = false; + self.configured = true; self.draw(ss); } @@ -84,7 +84,7 @@ impl Bar { } pub fn draw(&mut self, ss: &mut SharedState) { - if self.first_configure { + if !self.configured { return; } -- cgit v1.3.1