Skip to content

Commit

Permalink
fix activated logic
Browse files Browse the repository at this point in the history
  • Loading branch information
msparkles committed Jul 2, 2024
1 parent 5dc9232 commit b1a5e7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/yakui-widgets/src/widgets/textbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub struct TextBoxResponse {
render_text: RenderText,
scroll: Option<cosmic_text::Scroll>,
pub text: Option<String>,
/// Whether the user pressed "Enter" in this box
/// Whether the user pressed "Enter" in this box, only makes sense in inline
pub activated: bool,
/// Whether the box lost focus
pub lost_focus: bool,
Expand Down Expand Up @@ -298,7 +298,6 @@ impl Widget for TextBoxWidget {
match event {
WidgetEvent::FocusChanged(focused) => {
self.active = *focused;
self.activated = *focused;
if !*focused {
self.lost_focus = true;
}
Expand Down Expand Up @@ -523,6 +522,7 @@ impl Widget for TextBoxWidget {
if modifiers.shift() {
editor.action(font_system, cosmic_text::Action::Enter);
} else {
self.activated = true;
ctx.input.set_selection(None);
}
} else {
Expand Down

0 comments on commit b1a5e7c

Please sign in to comment.