mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
grab focus on set
This commit is contained in:
parent
179cad9a57
commit
d1c8afd83f
1 changed files with 3 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ pub struct Widget {
|
|||
impl Widget {
|
||||
// Construct
|
||||
pub fn new_arc() -> Arc<Self> {
|
||||
let gobject = Entry::builder().hexpand(true).build();
|
||||
let gobject = Entry::builder().editable(true).hexpand(true).build();
|
||||
|
||||
Arc::new(Self { gobject })
|
||||
}
|
||||
|
|
@ -20,7 +20,8 @@ impl Widget {
|
|||
pub fn set(&self, placeholder_text: &str, sensitive: bool) {
|
||||
self.gobject.set_text(&""); // reset
|
||||
self.gobject.set_placeholder_text(Some(placeholder_text));
|
||||
self.gobject.set_sensitive(sensitive);
|
||||
// self.gobject.set_sensitive(sensitive);
|
||||
self.gobject.grab_focus();
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue