Hi,
I would like to add the possibility for new editor's tabs to be added
before/after the current tab, since I'm often annoyed by tabs added far
from my working one. This is quite easy to do, but I have some questions
about how to make this a preference.
Currently, the tab positioning (before/after all other tabs) is controlled
by the boolean preference tab_order_ltr. Fine, but not to extend it. Then,
I see two ways to go:
1. Change this to an integer (or something) that represent an enumeration:
before all, before current, after all, after current.
2. Add a second preference to choose whether the tabs are added
before/after the current or all tabs.
I think that 1 is probably a little better from the user's point of view
(not sure), but it would probably be a pain to implement, because it would
need to change the type of a preference... the problem is to keep
compatibility with previous configuration version.
2 is then probably the way to go; the pref UI could even hide the
complexity. But then, some question comes to my mind:
a. Which name give to this preference?
b. How to show it to the user?
Then as usual, I ask for your wise answers :)
And as a bonus question, what do you think of the feature?
Thanks!
Colomban
PS: I join a proposed implementation that lacks the preference but works
fine (as far as I can think/say/see).
Index: src/notebook.c
===================================================================
--- src/notebook.c (revision 4904)
+++ src/notebook.c (working copy)
@@ -466,6 +466,7 @@
GtkWidget *hbox, *ebox;
gint tabnum;
GtkWidget *page;
+ gint cur_page;
g_return_val_if_fail(this != NULL, -1);
@@ -513,12 +514,16 @@
document_update_tab_label(this);
+ if (TRUE /* preference */)
+ cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook));
+ else
+ cur_page = file_prefs.tab_order_ltr ? -2 /* hack: -2 + 1 = -1, last page */ : 0;
if (file_prefs.tab_order_ltr)
- tabnum = gtk_notebook_append_page_menu(GTK_NOTEBOOK(main_widgets.notebook), page,
- ebox, NULL);
+ tabnum = gtk_notebook_insert_page_menu(GTK_NOTEBOOK(main_widgets.notebook), page,
+ ebox, NULL, cur_page + 1);
else
tabnum = gtk_notebook_insert_page_menu(GTK_NOTEBOOK(main_widgets.notebook), page,
- ebox, NULL, 0);
+ ebox, NULL, cur_page);
tab_count_changed();
_______________________________________________
Geany-devel mailing list
[email protected]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel