summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorNamilskyy <alive6863@gmail.com>2025-12-04 16:47:12 +0300
committerNamilskyy <alive6863@gmail.com>2025-12-04 16:47:12 +0300
commitb5cd950218d6deadd46bd3d1529a3cabeac2220f (patch)
tree1a6381e1dada971c7634d993cc8db1abc41ced0d /src/main.rs
parentd70de444665cb79bc36f9acc807aef5d9706dac1 (diff)
Fixes in main window, started settings window. Added CI workflow.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs26
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
+}