summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-12 16:08:15 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-12 16:08:15 (EDT)
commit38246d857a1b8e7d51d985e793fea5268aed7684 (patch)
treec756d2f3b683fdd62f327931c7c83aeaf4efa765 /src
parenta0565464d7acf2ab2ca15697b7dbb797e65dc2c6 (diff)
downloadmarquee-38246d857a1b8e7d51d985e793fea5268aed7684.zip
marquee-38246d857a1b8e7d51d985e793fea5268aed7684.tar.gz
marquee-38246d857a1b8e7d51d985e793fea5268aed7684.tar.bz2
mq_tab_chrome_new(): Get and save MqFindToolbar from caller
Also change member type in struct. And update call in MqTab.
Diffstat (limited to 'src')
-rw-r--r--src/tab-chrome.c10
-rw-r--r--src/tab-chrome.h6
-rw-r--r--src/tab.c3
3 files changed, 10 insertions, 9 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index 40f7ed2..6b3e2ad 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -344,7 +344,7 @@ zoom_in_clicked_cb(GtkButton G_GNUC_UNUSED *button, MqTabChrome *chrome)
static void
find_clicked_cb(GtkButton G_GNUC_UNUSED *button, MqTabChrome *chrome)
{
- mq_find_toolbar_reveal(MQ_FIND_TOOLBAR(chrome->find_toolbar));
+ mq_find_toolbar_reveal(chrome->find_toolbar);
gtk_widget_hide(chrome->menu_popover);
}
@@ -752,23 +752,21 @@ navigation_toolbar_new(MqTabChrome *chrome, const gchar *uri)
}
MqTabChrome *
-mq_tab_chrome_new(MqTab *tab, MqWebView *web_view, const gchar *uri)
+mq_tab_chrome_new(MqTab *tab, MqFindToolbar *find_toolbar, MqWebView *web_view,
+ const gchar *uri)
{
MqTabChrome *chrome;
chrome = malloc(sizeof(*chrome));
chrome->config = mq_application_get_config(mq_tab_get_application(tab));
chrome->tab = tab;
+ chrome->find_toolbar = find_toolbar;
chrome->web_view = web_view;
chrome->container = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start(GTK_BOX(chrome->container),
navigation_toolbar_new(chrome, uri), FALSE, FALSE, 0);
- chrome->find_toolbar = mq_find_toolbar_new(web_view);
- gtk_box_pack_start(GTK_BOX(chrome->container), chrome->find_toolbar,
- FALSE, FALSE, 0);
-
return chrome;
}
diff --git a/src/tab-chrome.h b/src/tab-chrome.h
index 25ac888..3333453 100644
--- a/src/tab-chrome.h
+++ b/src/tab-chrome.h
@@ -28,6 +28,7 @@ typedef struct MqTabChrome MqTabChrome;
#include <webkit2/webkit2.h>
#include "tab.h"
+#include "find-toolbar.h"
#include "web-view.h"
struct MqTabChrome {
@@ -42,8 +43,8 @@ struct MqTabChrome {
GtkToolItem *stop_reload_button;
GtkWidget *uri_entry;
PangoAttrList *hovered_link_style;
+ MqFindToolbar *find_toolbar;
MqWebView *web_view;
- GtkWidget *find_toolbar;
gboolean load_failed;
gint back_items;
GtkToolItem *menu_button;
@@ -53,7 +54,8 @@ struct MqTabChrome {
};
MqTabChrome *
-mq_tab_chrome_new(MqTab *tab, MqWebView *web_view, const gchar *uri);
+mq_tab_chrome_new(MqTab *tab, MqFindToolbar *find_toolbar, MqWebView *web_view,
+ const gchar *uri);
GtkWidget *
mq_tab_chrome_get_container(MqTabChrome *chrome);
diff --git a/src/tab.c b/src/tab.c
index c3eb7c5..f99ca91 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -446,7 +446,8 @@ init_non_root(const gchar *uri, MqTab *source)
find_toolbar = mq_find_toolbar_new(MQ_WEB_VIEW(tab->web_view));
- tab->chrome = mq_tab_chrome_new(tab, MQ_WEB_VIEW(tab->web_view), uri);
+ tab->chrome = mq_tab_chrome_new(tab, MQ_FIND_TOOLBAR(find_toolbar),
+ MQ_WEB_VIEW(tab->web_view), uri);
tab->container = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start(GTK_BOX(tab->container),