mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-10 10:24:13 +00:00
implement update action for reload button
This commit is contained in:
parent
ae3cc7a7d5
commit
36c33e1ee6
@ -66,7 +66,7 @@ impl Navigation {
|
|||||||
pub fn update(&self) {
|
pub fn update(&self) {
|
||||||
self.base.update();
|
self.base.update();
|
||||||
self.history.update();
|
self.history.update();
|
||||||
self.reload.update();
|
self.reload.update(!self.request.is_empty());
|
||||||
self.request.update();
|
self.request.update();
|
||||||
self.bookmark.update();
|
self.bookmark.update();
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use gtk::Button;
|
use gtk::{prelude::WidgetExt, Button};
|
||||||
|
|
||||||
pub struct Reload {
|
pub struct Reload {
|
||||||
widget: Button,
|
widget: Button,
|
||||||
@ -18,8 +18,8 @@ impl Reload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
pub fn update(&self) {
|
pub fn update(&self, is_enabled: bool) {
|
||||||
// @TODO
|
self.widget.set_sensitive(is_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use gtk::Entry;
|
use gtk::{prelude::EntryExt, Entry};
|
||||||
|
|
||||||
pub struct Request {
|
pub struct Request {
|
||||||
widget: Entry,
|
widget: Entry,
|
||||||
@ -25,4 +25,8 @@ impl Request {
|
|||||||
pub fn widget(&self) -> &Entry {
|
pub fn widget(&self) -> &Entry {
|
||||||
&self.widget
|
&self.widget
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_empty(&self) -> bool {
|
||||||
|
0 == self.widget.text_length()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user