From 481cd5a0cdb86661417918bebe8ca2029bc752ab Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 3 Jan 2024 14:46:40 -0500 Subject: [PATCH] fix: position of input label --- examples/cosmic/src/window/demo.rs | 6 ++++++ src/widget/text_input/input.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/cosmic/src/window/demo.rs b/examples/cosmic/src/window/demo.rs index adc2fb73..4efe5afa 100644 --- a/examples/cosmic/src/window/demo.rs +++ b/examples/cosmic/src/window/demo.rs @@ -478,6 +478,12 @@ impl State { .size(20) .id(INPUT_ID.clone()) .into(), + cosmic::widget::text_input("", &self.entry_value) + .label("Test Input") + .on_input(Message::InputChanged) + .size(20) + .id(INPUT_ID.clone()) + .into(), self.color_picker_model .picker_button(Message::ColorPickerUpdate, None) .width(Length::Fixed(128.0)) diff --git a/src/widget/text_input/input.rs b/src/widget/text_input/input.rs index 1b756d13..04215d76 100644 --- a/src/widget/text_input/input.rs +++ b/src/widget/text_input/input.rs @@ -1902,7 +1902,7 @@ pub fn draw<'a, Message>( line_height, shaping: text::Shaping::Advanced, }, - bounds.position(), + label_layout.bounds().position(), appearance.label_color, *viewport, );