From 132f23976f1bb7a89140a1fe5a72fd9ee62ba2f9 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 05:01:59 +0200 Subject: interface.txt: Document the interface --- interface.txt | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 interface.txt (limited to 'interface.txt') diff --git a/interface.txt b/interface.txt new file mode 100644 index 0000000..a8d524f --- /dev/null +++ b/interface.txt @@ -0,0 +1,41 @@ +# Badwolf +- A tablist with a new tab button at the end, right-clicking on the tablist gives you the list in a context-menu format +- Each tab contains a Browser View or the Downloads View + +## Tab Labels +- An icon to indicate if a media is playing +- The title of the web view +- A close button + +## Browser View + +The Browser View contains the following items: +- Toolbar +- WebKit WebView +- Status Bar + +### Toolbar +- Backward navigation button followed by a smaller forward navigation button +- Separator +- Javascript-markup toggler marked "JS" followed by an image-loading toggler marked "IMG" +- Potentially some future elements +- Location entry linked to the WebKit WebView, with integrated progress indication also linked to the WebKit WebView +- Potentially some future elements + +The element focused by default is the location entry. + +### Status bar +- Search entry linked to the WebKit WebView +- Potentially some future elements +- Label showing where the mouse is pointing +- Potentially some future elements + +## Downloads View + +The download view is a table contains the following items on each row corresponding to each download: +- Icon linked to the network status +- Progress bar, with integrated received-size indication +- (when downloading) Cancelling button +- Label about the current status +- Link to download destination +- Potentially some future elements -- cgit v1.3.1-23-gd82d From 80751fafa0b2600e17c8d880f267d8afd36c9108 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 09:35:13 +0200 Subject: Add print button --- badwolf.c | 24 ++++++++++++++++++++++++ interface.txt | 2 ++ 2 files changed, 26 insertions(+) (limited to 'interface.txt') diff --git a/badwolf.c b/badwolf.c index 610b696..a94c56d 100644 --- a/badwolf.c +++ b/badwolf.c @@ -56,6 +56,7 @@ static gboolean javascriptCb_toggled(GtkButton *javascript, gpointer user_data); static gboolean auto_load_imagesCb_toggled(GtkButton *auto_load_images, gpointer user_data); static void backCb_clicked(GtkButton *back, gpointer user_data); static void forwardCb_clicked(GtkButton *forward, gpointer user_data); +static void printCb_clicked(GtkButton *forward, gpointer user_data); static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data); static gboolean SearchEntryCb_previous__match(GtkSearchEntry *search, gpointer user_data); static gboolean SearchEntryCb_search__changed(GtkSearchEntry *search, gpointer user_data); @@ -498,6 +499,18 @@ forwardCb_clicked(GtkButton *forward, gpointer user_data) webkit_web_view_go_forward(browser->webView); } +static void +printCb_clicked(GtkButton *print, gpointer user_data) +{ + (void)print; + struct Client *browser = (struct Client *)user_data; + + WebKitPrintOperation *print_operation = webkit_print_operation_new(browser->webView); + + webkit_print_operation_run_dialog(print_operation, GTK_WINDOW(browser->window)); +} + + static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data) { @@ -584,6 +597,9 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat browser->location = gtk_entry_new(); gtk_widget_set_name(browser->location, "browser__location"); + GtkWidget *print = gtk_button_new_from_icon_name("document-print-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_widget_set_name(browser->back, "browser__print"); + browser->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(browser->statusbar, "browser__statusbar"); @@ -660,6 +676,11 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat TRUE, TRUE, BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), + print, + FALSE, + FALSE, + BADWOLF_TOOLBAR_PADDING); gtk_container_set_focus_child(GTK_CONTAINER(browser->box), browser->toolbar); gtk_container_set_focus_child(GTK_CONTAINER(browser->toolbar), browser->location); @@ -707,6 +728,9 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat g_signal_connect( browser->auto_load_images, "toggled", G_CALLBACK(auto_load_imagesCb_toggled), browser); + /* signals for print button */ + g_signal_connect(print, "clicked", G_CALLBACK(printCb_clicked), browser); + /* signals for WebView widget */ g_signal_connect(browser->webView, "web-process-terminated", diff --git a/interface.txt b/interface.txt index a8d524f..76d9526 100644 --- a/interface.txt +++ b/interface.txt @@ -21,6 +21,8 @@ The Browser View contains the following items: - Potentially some future elements - Location entry linked to the WebKit WebView, with integrated progress indication also linked to the WebKit WebView - Potentially some future elements +- Print button +- Potentially some future elements The element focused by default is the location entry. -- cgit v1.3.1-23-gd82d