GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
Implement set_rect for Dropdown to account for label offset
src/widget/input/dropdown.rs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/widget/input/dropdown.rs b/src/widget/input/dropdown.rs
index 12a9937..c2367b8 100644
--- a/src/widget/input/dropdown.rs
+++ b/src/widget/input/dropdown.rs
@@ -176,6 +176,13 @@ impl Default for Dropdown {
impl Element for Dropdown {
crate::impl_widget_base!(Dropdown);
+ 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 get_value_string(&self) -> Option<String> {
self.options.get(self.selected).cloned()
}