mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-11 05:01:44 +00:00
hide input on page reload
This commit is contained in:
parent
d06538726b
commit
cf86cc2a14
@ -158,6 +158,9 @@ impl Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn navigation_reload(&self) {
|
pub fn navigation_reload(&self) {
|
||||||
|
// Reset components
|
||||||
|
self.input.hide();
|
||||||
|
|
||||||
// Init globals
|
// Init globals
|
||||||
let request_text = self.navigation.request_text();
|
let request_text = self.navigation.request_text();
|
||||||
|
|
||||||
@ -282,6 +285,7 @@ impl Page {
|
|||||||
|
|
||||||
// Make input form
|
// Make input form
|
||||||
input.set_default(action_page_open, uri, Some(&description), Some(1024));
|
input.set_default(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,6 +23,14 @@ impl Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
pub fn show(&self) {
|
||||||
|
self.widget.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn hide(&self) {
|
||||||
|
self.widget.hide()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn set_default(
|
pub fn set_default(
|
||||||
&self,
|
&self,
|
||||||
action_page_open: Arc<SimpleAction>,
|
action_page_open: Arc<SimpleAction>,
|
||||||
@ -30,7 +38,7 @@ impl Input {
|
|||||||
title: Option<&str>,
|
title: Option<&str>,
|
||||||
size_limit: Option<usize>,
|
size_limit: Option<usize>,
|
||||||
) {
|
) {
|
||||||
self.widget.update(Some(
|
self.widget.set_child(Some(
|
||||||
&Default::new_arc(action_page_open, base, title, size_limit).gobject(),
|
&Default::new_arc(action_page_open, base, title, size_limit).gobject(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -19,12 +19,19 @@ impl Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
pub fn update(&self, child: Option<&Box>) {
|
pub fn show(&self) {
|
||||||
|
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_child(child);
|
self.gobject.set_child(child);
|
||||||
self.gobject.set_visible(true);
|
|
||||||
} else {
|
} else {
|
||||||
self.gobject.set_visible(false)
|
self.hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user