mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-09-10 22:11:52 +00:00
fix proxy resolver update on request entry autocomplete
This commit is contained in:
parent
500ae1a20a
commit
7de33557f1
@ -51,7 +51,7 @@ impl Request {
|
||||
|
||||
update_primary_icon(&entry, profile);
|
||||
|
||||
let suggestion = Rc::new(Suggestion::build(profile, &entry));
|
||||
let suggestion = Rc::new(Suggestion::build(&entry, profile, &proxy_resolver));
|
||||
|
||||
entry.add_controller({
|
||||
use gtk::{
|
||||
@ -464,12 +464,14 @@ fn update_blocked(
|
||||
entry: &Entry,
|
||||
signal_handler_id: >k::glib::SignalHandlerId,
|
||||
text: &str,
|
||||
resolver: &RefCell<Option<ProxyResolver>>,
|
||||
) {
|
||||
use gtk::prelude::ObjectExt;
|
||||
entry.block_signal(signal_handler_id);
|
||||
entry.set_text(text);
|
||||
entry.select_region(0, -1);
|
||||
update_primary_icon(entry, profile);
|
||||
refresh_proxy_resolver(entry, profile, resolver);
|
||||
entry.unblock_signal(signal_handler_id);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,11 @@ impl Suggestion {
|
||||
// Constructors
|
||||
|
||||
/// Create new `Self`
|
||||
pub fn build(profile: &Rc<Profile>, entry: &Entry) -> Self {
|
||||
pub fn build(
|
||||
entry: &Entry,
|
||||
profile: &Rc<Profile>,
|
||||
resolver: &Rc<RefCell<Option<gtk::gio::ProxyResolver>>>,
|
||||
) -> Self {
|
||||
let signal_handler_id = Rc::new(RefCell::new(None));
|
||||
let list_store = ListStore::new::<Item>();
|
||||
let single_selection = {
|
||||
@ -44,6 +48,7 @@ impl Suggestion {
|
||||
ss.connect_selected_notify({
|
||||
let e = entry.clone();
|
||||
let p = profile.clone();
|
||||
let r = resolver.clone();
|
||||
let signal_handler_id = signal_handler_id.clone();
|
||||
move |this| {
|
||||
if let Some(selected_item) = this.selected_item() {
|
||||
@ -53,6 +58,7 @@ impl Suggestion {
|
||||
&e,
|
||||
signal_handler_id,
|
||||
&selected_item.downcast_ref::<Item>().unwrap().request(),
|
||||
&r,
|
||||
);
|
||||
}
|
||||
} // @TODO find signal to handle selected item only
|
||||
|
Loading…
x
Reference in New Issue
Block a user