summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-24 03:49:51 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-24 03:49:51 (EDT)
commit876ad44ae0e5f89952e92783e2993c7233feff07 (patch)
tree08bbb53a98b30e23fd847cb3ccf464ed168d20fb /src
parent17aa4945ac8cfda4e2349c627abc60ce6129dce8 (diff)
downloadmarquee-876ad44ae0e5f89952e92783e2993c7233feff07.zip
marquee-876ad44ae0e5f89952e92783e2993c7233feff07.tar.gz
marquee-876ad44ae0e5f89952e92783e2993c7233feff07.tar.bz2
mq_notebook_set_current_page(): Make page_num 1-based
Diffstat (limited to 'src')
-rw-r--r--src/notebook.c6
1 files changed, 3 insertions, 3 deletions
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