mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-05 16:04:15 +00:00
fix input redraw
This commit is contained in:
parent
ec86a9ecd0
commit
b8b5eee4fe
@ -158,8 +158,8 @@ impl Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn navigation_reload(&self) {
|
pub fn navigation_reload(&self) {
|
||||||
// Reset components
|
// Reset widgets
|
||||||
self.input.hide();
|
self.input.unset();
|
||||||
|
|
||||||
// Init globals
|
// Init globals
|
||||||
let request_text = self.navigation.request_text();
|
let request_text = self.navigation.request_text();
|
||||||
@ -284,8 +284,7 @@ impl Page {
|
|||||||
let description = gformat!("{placeholder}");
|
let description = gformat!("{placeholder}");
|
||||||
|
|
||||||
// Make input form
|
// Make input form
|
||||||
input.use_response(action_page_open, uri, Some(&description), Some(1024));
|
input.set_new_response(action_page_open, uri, Some(&description), Some(1024));
|
||||||
input.show();
|
|
||||||
|
|
||||||
// Update meta
|
// Update meta
|
||||||
meta.borrow_mut().status = Some(status);
|
meta.borrow_mut().status = Some(status);
|
||||||
|
@ -23,23 +23,19 @@ impl Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
pub fn show(&self) {
|
pub fn unset(&self) {
|
||||||
self.widget.show()
|
self.widget.update(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn hide(&self) {
|
// Setters
|
||||||
self.widget.hide()
|
pub fn set_new_response(
|
||||||
}
|
|
||||||
|
|
||||||
// Variant switcher
|
|
||||||
pub fn use_response(
|
|
||||||
&self,
|
&self,
|
||||||
action_page_open: Arc<SimpleAction>,
|
action_page_open: Arc<SimpleAction>,
|
||||||
base: Uri,
|
base: Uri,
|
||||||
title: Option<&str>,
|
title: Option<&str>,
|
||||||
size_limit: Option<usize>,
|
size_limit: Option<usize>,
|
||||||
) {
|
) {
|
||||||
self.widget.set_child(Some(
|
self.widget.update(Some(
|
||||||
&Response::new_arc(action_page_open, base, title, size_limit).gobject(),
|
&Response::new_arc(action_page_open, base, title, size_limit).gobject(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -19,19 +19,12 @@ impl Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
pub fn show(&self) {
|
pub fn update(&self, child: Option<&Box>) {
|
||||||
self.gobject.set_visible(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn hide(&self) {
|
|
||||||
self.gobject.set_visible(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn set_child(&self, child: Option<&Box>) {
|
|
||||||
if child.is_some() {
|
if child.is_some() {
|
||||||
|
self.gobject.set_visible(true); // widget may be hidden, make it visible to child redraw
|
||||||
self.gobject.set_child(child);
|
self.gobject.set_child(child);
|
||||||
} else {
|
} else {
|
||||||
self.hide()
|
self.gobject.set_visible(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user