From 876ad44ae0e5f89952e92783e2993c7233feff07 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 24 Oct 2017 03:49:51 -0400 Subject: mq_notebook_set_current_page(): Make page_num 1-based --- (limited to 'src') diff --git a/src/notebook.c b/src/notebook.c index b0854ee..8ef5733 100644 --- a/src/notebook.c +++ b/src/notebook.c @@ -176,7 +176,7 @@ tab_tree_row_activated_cb(GtkTreeView G_GNUC_UNUSED *tree_view, tree_model = gtk_tree_view_get_model(tree_view); if (gtk_tree_model_get_iter(tree_model, &tree_iter, tree_path)) { gtk_tree_model_get(tree_model, &tree_iter, 0, &position, -1); - mq_notebook_set_current_page(notebook, position - 1); + mq_notebook_set_current_page(notebook, position); } else { g_assert_not_reached(); } @@ -403,9 +403,9 @@ mq_notebook_set_current_page(MqNotebook *notebook, gint page_num) { MqTabTree *node; - node = MQ_TAB_TREE(mq_tree_seek(MQ_TREE(notebook->tree), page_num + 1)); + node = MQ_TAB_TREE(mq_tree_seek(MQ_TREE(notebook->tree), page_num)); notebook->current_page = node->page; - gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), page_num); + gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), page_num - 1); } void -- cgit v0.9.1