diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-17 22:16:26 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-17 22:19:35 (EDT) |
commit | 885e5e9442bae1d790df9c870af3232a9ced840e (patch) | |
tree | 0f01b5cde0296598a8821dbb53ba67709ff1cc95 | |
parent | 4f7fa059f6fb02d4571614ccf54a9c0d535427a4 (diff) | |
download | marquee-885e5e9442bae1d790df9c870af3232a9ced840e.zip marquee-885e5e9442bae1d790df9c870af3232a9ced840e.tar.gz marquee-885e5e9442bae1d790df9c870af3232a9ced840e.tar.bz2 |
MqTabLabel: Use MqTabPage
-rw-r--r-- | src/tab-label.c | 32 | ||||
-rw-r--r-- | src/tab-label.h | 4 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/tab-label.c b/src/tab-label.c index b4c4d7b..5ca8e5e 100644 --- a/src/tab-label.c +++ b/src/tab-label.c @@ -25,12 +25,12 @@ #include <gtk/gtk.h> #include <webkit2/webkit2.h> -#include "tab.h" +#include "tab-page.h" #include "web-view.h" struct _MqTabLabel { GtkEventBox parent_instance; - MqTab *tab_page; + MqTabPage *tab_page; WebKitWebView *web_view; GtkWidget *image; GtkWidget *label; @@ -65,15 +65,15 @@ reload_tab_clicked_cb(GtkWidget G_GNUC_UNUSED *button, MqTabLabel *tab_label) static void new_tab_clicked_cb(GtkWidget G_GNUC_UNUSED *button, MqTabLabel *tab_label) { - mq_tab_new(NULL, tab_label->tab_page); + mq_tab_page_new(NULL, tab_label->tab_page); gtk_widget_hide(tab_label->popover); } static void new_window_clicked_cb(GtkWidget G_GNUC_UNUSED *button, MqTabLabel *tab_label) { - mq_application_add_window(mq_tab_get_application(tab_label->tab_page), - NULL); + mq_application_add_window( + mq_tab_page_get_application(tab_label->tab_page), NULL); gtk_widget_hide(tab_label->popover); } @@ -88,16 +88,16 @@ tab_list_button_toggled_cb(GtkToggleButton *toggle_button, GtkWidget *tab_list) } static void -create_tree_model_recurse(MqTab *node, GtkTreeStore *tree_store, +create_tree_model_recurse(MqTabPage *node, GtkTreeStore *tree_store, GtkTreeIter *parent_tree_iter) { GtkTreeIter tree_iter; - for (; node; node = mq_tab_next(node)) { + for (; node; node = mq_tab_page_next(node)) { gtk_tree_store_append(tree_store, &tree_iter, parent_tree_iter); gtk_tree_store_set(tree_store, &tree_iter, 0, node->title, -1); - create_tree_model_recurse(mq_tab_first_child(node), tree_store, - &tree_iter); + create_tree_model_recurse(mq_tab_page_first_child(node), + tree_store, &tree_iter); } } @@ -108,7 +108,7 @@ create_tree_model(MqTabLabel *tab_label) tree_store = gtk_tree_store_new(1, G_TYPE_STRING); - create_tree_model_recurse(mq_tab_root(tab_label->tab_page), + create_tree_model_recurse(mq_tab_page_root(tab_label->tab_page), tree_store, NULL); return GTK_TREE_MODEL(tree_store); @@ -124,7 +124,7 @@ row_activated_cb(GtkTreeView G_GNUC_UNUSED *tree_view, GtkTreePath *tree_path, indices = gtk_tree_path_get_indices_with_depth(tree_path, &depth); g_assert(depth == 1); - mq_window_set_current_tab(mq_tab_get_window(tab_label->tab_page), + mq_window_set_current_tab(mq_tab_page_get_window(tab_label->tab_page), indices[0] + 1); gtk_widget_hide(tab_label->popover); } @@ -142,7 +142,7 @@ create_tab_list(MqTabLabel *tab_label) gtk_tree_selection_set_mode(tree_selection, GTK_SELECTION_BROWSE); gtk_tree_selection_select_path(tree_selection, gtk_tree_path_new_from_indices( - mq_window_get_current_tab(mq_tab_get_window( + mq_window_get_current_tab(mq_tab_page_get_window( tab_label->tab_page)) - 1, -1)); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree_view), FALSE); gtk_tree_view_set_activate_on_single_click(GTK_TREE_VIEW(tree_view), @@ -416,8 +416,8 @@ mq_tab_label_class_init(MqTabLabelClass *klass) obj_properties[PROP_TAB_PAGE] = g_param_spec_pointer( "tab-page", - "MqTab", - "The ancestral MqTab instance", + "MqTabPage", + "The ancestral MqTabPage instance", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB); obj_properties[PROP_WEB_VIEW] = g_param_spec_object( @@ -470,10 +470,10 @@ mq_tab_label_init(MqTabLabel *tab_label) } GtkWidget * -mq_tab_label_new(MqTab *tab, MqWebView *web_view) +mq_tab_label_new(MqTabPage *tab_page, MqWebView *web_view) { return g_object_new(MQ_TYPE_TAB_LABEL, - "tab-page", tab, + "tab-page", tab_page, "web-view", web_view, NULL); } diff --git a/src/tab-label.h b/src/tab-label.h index 88392de..d7545b2 100644 --- a/src/tab-label.h +++ b/src/tab-label.h @@ -29,7 +29,7 @@ typedef struct _MqTabLabelClass MqTabLabelClass; #include <gtk/gtk.h> #include <webkit2/webkit2.h> -#include "tab.h" +#include "tab-page.h" #include "web-view.h" G_BEGIN_DECLS @@ -50,7 +50,7 @@ GType mq_tab_label_get_type(void); GtkWidget * -mq_tab_label_new(MqTab *tab, MqWebView *web_view); +mq_tab_label_new(MqTabPage *tab_page, MqWebView *web_view); void mq_tab_label_set_position(MqTabLabel *tab_label, guint position); |