diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/main.rs b/src/main.rs index 9bae187..a74f0bd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,15 +1,12 @@ use gtk4::prelude::*; -use gtk4::{Application, - ApplicationWindow, - Box, - Button, - Entry, - HeaderBar, - Orientation, - ScrolledWindow}; +use gtk4::{ + Application, ApplicationWindow, Box, Button, Entry, HeaderBar, Orientation, ScrolledWindow, +}; -use webkit6::prelude::*; use webkit6::WebView; +use webkit6::prelude::*; + +mod settings_window; const APP_ID: &str = "com.namilsk.i2p-browser"; @@ -50,9 +47,7 @@ fn build_ui(app: &Application) { let web_view = WebView::new(); - let scrolled_window = ScrolledWindow::builder() - .child(&web_view) - .build(); + let scrolled_window = ScrolledWindow::builder().child(&web_view).build(); main_box.append(&scrolled_window); @@ -74,7 +69,6 @@ fn build_ui(app: &Application) { url_entry_for_entry.set_text(&full_url); }); - let web_view_for_back = web_view.clone(); button_back.connect_clicked(move |_| { if web_view_for_back.can_go_back() { @@ -82,7 +76,6 @@ fn build_ui(app: &Application) { } }); - let web_view_for_forward = web_view.clone(); button_forward.connect_clicked(move |_| { if web_view_for_forward.can_go_forward() { @@ -95,11 +88,10 @@ fn build_ui(app: &Application) { web_view_for_reload.reload(); }); - let web_view_for_home = web_view.clone(); let url_entry_for_home = url_entry.clone(); button_home.connect_clicked(move |_| { - let home_url = "http://reg.i2p/"; + let home_url = "http://reg.i2p/"; web_view_for_home.load_uri(home_url); url_entry_for_home.set_text(home_url); }); @@ -114,4 +106,4 @@ fn build_ui(app: &Application) { web_view.load_uri("http://legwork.i2p/"); window.present(); -}
\ No newline at end of file +} |
