Browse Source

implement update action for reload button

master
yggverse 2 months ago
parent
commit
36c33e1ee6
  1. 2
      src/browser/main/tab/page/navigation/mod.rs
  2. 6
      src/browser/main/tab/page/navigation/reload/mod.rs
  3. 6
      src/browser/main/tab/page/navigation/request/mod.rs

2
src/browser/main/tab/page/navigation/mod.rs

@ -66,7 +66,7 @@ impl Navigation { @@ -66,7 +66,7 @@ impl Navigation {
pub fn update(&self) {
self.base.update();
self.history.update();
self.reload.update();
self.reload.update(!self.request.is_empty());
self.request.update();
self.bookmark.update();
}

6
src/browser/main/tab/page/navigation/reload/mod.rs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
use gtk::Button;
use gtk::{prelude::WidgetExt, Button};
pub struct Reload {
widget: Button,
@ -18,8 +18,8 @@ impl Reload { @@ -18,8 +18,8 @@ impl Reload {
}
// Actions
pub fn update(&self) {
// @TODO
pub fn update(&self, is_enabled: bool) {
self.widget.set_sensitive(is_enabled);
}
// Getters

6
src/browser/main/tab/page/navigation/request/mod.rs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
use gtk::Entry;
use gtk::{prelude::EntryExt, Entry};
pub struct Request {
widget: Entry,
@ -25,4 +25,8 @@ impl Request { @@ -25,4 +25,8 @@ impl Request {
pub fn widget(&self) -> &Entry {
&self.widget
}
pub fn is_empty(&self) -> bool {
0 == self.widget.text_length()
}
}

Loading…
Cancel
Save