application/window.c

changeset 15
78684a24dc52
parent 13
5a8762fcfecc
child 17
7cfd36aa005b
--- a/application/window.c	Tue Jan 30 14:01:04 2024 +0100
+++ b/application/window.c	Tue Jan 30 16:01:44 2024 +0100
@@ -56,8 +56,8 @@
 
 	// navigation bar
 	ui_hbox(obj, .fill = UI_OFF, .margin = 8) {
-		ui_button(obj, .icon = "Back");
-		ui_button(obj, .icon = "Forward");
+		ui_button(obj, .icon = "Back", .onclick = action_go_back);
+		ui_button(obj, .icon = "Forward", .onclick = action_go_forward);
 
 		ui_path_textfield(obj, .fill = UI_ON, .getpathelm = dav_get_pathelm, .onactivate = action_path_selected ,.varname = "path");
 
@@ -182,6 +182,15 @@
 }
 
 
+void action_go_back(UiEvent *event, void *data) {
+	DavBrowser *browser = event->document;
+	davbrowser_navigation_back(event->obj, browser);
+}
+
+void action_go_forward(UiEvent *event, void *data) {
+	DavBrowser *browser = event->document;
+	davbrowser_navigation_forward(event->obj, browser);
+}
 
 void action_path_selected(UiEvent *event, void *data) {
 	DavBrowser *browser = event->document;

mercurial