summaryrefslogtreecommitdiffstats
path: root/src/toolbars
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-11-12 21:39:02 (EST)
committer Patrick McDermott <pj@pehjota.net>2017-11-12 21:39:02 (EST)
commit615547fe9d0f2121d91cb43c3886fe96c441a9eb (patch)
tree96f9fe308d4edbf3a4cf275404b7ac3bcbaabe5d /src/toolbars
parent35ff9090a188d2445bbedcc188378c65eac61925 (diff)
downloadmarquee-615547fe9d0f2121d91cb43c3886fe96c441a9eb.zip
marquee-615547fe9d0f2121d91cb43c3886fe96c441a9eb.tar.gz
marquee-615547fe9d0f2121d91cb43c3886fe96c441a9eb.tar.bz2
MqFindToolbar: Add a spinner
Diffstat (limited to 'src/toolbars')
-rw-r--r--src/toolbars/find-toolbar.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/toolbars/find-toolbar.c b/src/toolbars/find-toolbar.c
index 2534afa..a793b7c 100644
--- a/src/toolbars/find-toolbar.c
+++ b/src/toolbars/find-toolbar.c
@@ -30,6 +30,7 @@
struct _MqFindToolbar {
GtkRevealer parent_instance;
GtkWidget *search_entry;
+ GtkSpinner *spinner;
GtkWidget *matches_label;
gboolean match_case;
WebKitFindController *find_controller;
@@ -63,6 +64,7 @@ search(MqFindToolbar *find_toolbar, gboolean forward)
webkit_find_controller_search(find_toolbar->find_controller,
gtk_entry_get_text(GTK_ENTRY(find_toolbar->search_entry)),
find_options, G_MAXUINT);
+ gtk_spinner_start(find_toolbar->spinner);
}
static void
@@ -138,6 +140,7 @@ found_text_cb(WebKitFindController G_GNUC_UNUSED *find_controller,
{
gchar *text;
+ gtk_spinner_stop(find_toolbar->spinner);
if (match_count == 1) {
text = g_strdup("1 match");
} else {
@@ -151,6 +154,7 @@ static void
failed_to_find_text_cb(WebKitFindController G_GNUC_UNUSED *find_controller,
MqFindToolbar *find_toolbar)
{
+ gtk_spinner_stop(find_toolbar->spinner);
gtk_label_set_text(GTK_LABEL(find_toolbar->matches_label),
"No matches");
}
@@ -262,6 +266,9 @@ mq_find_toolbar_init(MqFindToolbar *find_toolbar)
g_signal_connect(match_case_button, "toggled",
G_CALLBACK(match_case_toggled_cb), find_toolbar);
+ /* Spinner */
+ find_toolbar->spinner = GTK_SPINNER(gtk_spinner_new());
+
/* Matches label */
find_toolbar->matches_label = gtk_label_new(NULL);
@@ -281,6 +288,8 @@ mq_find_toolbar_init(MqFindToolbar *find_toolbar)
gtk_box_pack_start(GTK_BOX(box), prev_button, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(box), next_button, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(box), match_case_button, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(find_toolbar->spinner),
+ FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(box), find_toolbar->matches_label,
FALSE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(box), close_button, FALSE, FALSE, 0);