Kaydet (Commit) 6dc14025 authored tarafından Enrico Tröger's avatar Enrico Tröger

Add hidden pref to hide symbol list treeview expander (GTK >= 2.12).

Double click on symbol list sections now expands/collapses them.      


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2054 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 47c1c7e0
2007-11-18 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* doc/geany.html, doc/geany.txt, src/keyfile.c, src/plugindata.h,
src/prefs.h, src/treeviews.c:
Add hidden pref to hide symbol list treeview expander (GTK >= 2.12).
Double click on symbol list sections now expands/collapses them.
2007-11-17 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/templates.c, src/utils.c, src/utils.h:
......
......@@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.4.1: http://docutils.sourceforge.net/" />
<title>Geany</title>
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" />
<meta name="date" content="2007-11-12" />
<meta name="date" content="2007-11-17" />
<style type="text/css">
/*
......@@ -133,7 +133,7 @@ dt {
<br />Nick Treleaven
<br />Frank Lanitz</td></tr>
<tr><th class="docinfo-name">Date:</th>
<td>2007-11-12</td></tr>
<td>2007-11-17</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>0.13</td></tr>
</tbody>
......@@ -1499,7 +1499,8 @@ like:</p>
<pre class="literal-block">
gtk-print-preview-command = &quot;epdfview %f&quot;
</pre>
<p>at the end of the file. Of course, you can also use xpdf, kpdf or whatever.</p>
<p>at the end of the file. Of course, you can also use xpdf, kpdf or whatever
as the print preview command.</p>
<p>Unfortunately, native GTK printing support is only available if Geany was
built against GTK 2.10 (or above) <strong>and</strong> is running with GTK 2.10 (or above).
If not, Geany provides basic printing support. This means you can print a
......@@ -2603,6 +2604,12 @@ commands</a>).</td>
an existing line.</td>
<td>false</td>
</tr>
<tr><td>show_symbol_list_expanders</td>
<td>Whether to show or hide the small expander
icons on the symbol list treeview (only
available with GTK 2.12 or above).</td>
<td>true</td>
</tr>
<tr><td><strong>[VTE]</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
......@@ -3127,7 +3134,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p>
<div class="footer">
<hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>.
Generated on: 2007-11-17 13:39 UTC.
Generated on: 2007-11-18 15:02 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
......
......@@ -2349,6 +2349,9 @@ use_gtk_word_boundaries Whether to look for the end of a word when
commands`_).
auto_complete_whilst_editing Whether to allow autocompletion when editing false
an existing line.
show_symbol_list_expanders Whether to show or hide the small expander true
icons on the symbol list treeview (only
available with GTK 2.12 or above).
**[VTE]**
enable_bash_keys Whether to allow bash shell keyboard true
shortcuts like Ctrl-W to delete the last
......
......@@ -339,6 +339,9 @@ static void save_hidden_prefs(GKeyFile *config)
write_hidden_pref_boolean(config, PACKAGE, "brace_match_ltgt", editor_prefs.brace_match_ltgt);
write_hidden_pref_boolean(config, PACKAGE, "use_gtk_word_boundaries", editor_prefs.use_gtk_word_boundaries);
write_hidden_pref_boolean(config, PACKAGE, "auto_complete_whilst_editing", editor_prefs.auto_complete_whilst_editing);
#if GTK_CHECK_VERSION(2, 12, 0)
write_hidden_pref_boolean(config, PACKAGE, "show_symbol_list_expanders", prefs.show_symbol_list_expanders);
#endif
#ifdef HAVE_VTE
if (vte_info.have_vte)
write_hidden_pref_boolean(config, "VTE", "enable_bash_keys", vc->enable_bash_keys);
......@@ -459,6 +462,9 @@ static void load_dialog_prefs(GKeyFile *config)
prefs.editor_font = utils_get_setting_string(config, PACKAGE, "editor_font", GEANY_DEFAULT_FONT_EDITOR);
prefs.tagbar_font = utils_get_setting_string(config, PACKAGE, "tagbar_font", GEANY_DEFAULT_FONT_SYMBOL_LIST);
prefs.msgwin_font = utils_get_setting_string(config, PACKAGE, "msgwin_font", GEANY_DEFAULT_FONT_MSG_WINDOW);
#if GTK_CHECK_VERSION(2, 12, 0)
prefs.show_symbol_list_expanders = utils_get_setting_boolean(config, PACKAGE, "show_symbol_list_expanders", TRUE);
#endif
// display, editor
editor_prefs.long_line_type = utils_get_setting_integer(config, PACKAGE, "long_line_type", 0);
......
......@@ -71,12 +71,12 @@
/* The API version should be incremented whenever any plugin data types below are
* modified or appended to. */
static const gint api_version = 29;
static const gint api_version = 30;
/* The ABI version should be incremented whenever existing fields in the plugin
* data types below have to be changed or reordered. It should stay the same if fields
* are only appended, as this doesn't affect existing fields. */
static const gint abi_version = 14;
static const gint abi_version = 15;
/* This performs runtime checks that try to ensure:
* 1. Geany ABI data types are compatible with this plugin.
......
......@@ -53,6 +53,7 @@ typedef struct GeanyPrefs
gint tab_pos_msgwin;
gint tab_pos_sidebar;
gboolean statusbar_visible;
gboolean show_symbol_list_expanders;
/* toolbar */
gboolean toolbar_visible;
......@@ -82,7 +83,6 @@ typedef struct GeanyPrefs
gchar *tools_browser_cmd;
gchar *tools_make_cmd;
gchar *tools_term_cmd;
gchar *tools_print_cmd; /// TODO unused: remove this at next abi_verison change
gchar *tools_grep_cmd;
gchar *context_action_cmd;
......
......@@ -120,6 +120,10 @@ static void prepare_taglist(GtkWidget *tree, GtkTreeStore *store)
gtk_tree_view_set_enable_search(GTK_TREE_VIEW(tree), FALSE);
#if GTK_CHECK_VERSION(2, 12, 0)
gtk_tree_view_set_show_expanders(GTK_TREE_VIEW(tree), prefs.show_symbol_list_expanders);
#endif
// selection handling
select = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE);
......@@ -643,17 +647,39 @@ static gboolean on_taglist_tree_selection_changed(GtkTreeSelection *selection)
static gboolean on_treeviews_button_press_event(GtkWidget *widget, GdkEventButton *event,
gpointer user_data)
gpointer user_data)
{
if (event->button == 1 && GPOINTER_TO_INT(user_data) == TREEVIEW_SYMBOL)
{ // allow reclicking of taglist treeview item
if (event->type == GDK_2BUTTON_PRESS && GPOINTER_TO_INT(user_data) == TREEVIEW_SYMBOL)
{ // double click on parent node(section) expands/collapses it
GtkTreeModel *model;
GtkTreeSelection *selection;
GtkTreeIter iter;
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget));
if (gtk_tree_selection_get_selected(selection, &model, &iter))
{
if (gtk_tree_model_iter_has_child(model, &iter))
{
GtkTreePath *path = gtk_tree_model_get_path(model, &iter);
if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(widget), path))
gtk_tree_view_collapse_row(GTK_TREE_VIEW(widget), path);
else
gtk_tree_view_expand_row(GTK_TREE_VIEW(widget), path, FALSE);
gtk_tree_path_free(path);
return TRUE;
}
}
}
else if (event->button == 1 && GPOINTER_TO_INT(user_data) == TREEVIEW_SYMBOL)
{ // allow reclicking of taglist treeview item
GtkTreeSelection *select = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget));
// delay the query of selection state because this callback is executed before GTK
// changes the selection (g_signal_connect_after would be better but it doesn't work)
g_idle_add((GSourceFunc) on_taglist_tree_selection_changed, select);
}
if (event->button == 3)
else if (event->button == 3)
{ // popupmenu to hide or clear the active treeview
if (GPOINTER_TO_INT(user_data) == TREEVIEW_OPENFILES)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment