Support more folding icon styles: arrows, +/- and no lines

(#2935059).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4854 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2010-04-22 17:16:46 +00:00
parent cbf9813632
commit 751f8be508
5 changed files with 48 additions and 26 deletions

View File

@ -11,6 +11,10 @@
Support {pc} wildcard in snippets to escape percent char. Support {pc} wildcard in snippets to escape percent char.
* src/editor.c: * src/editor.c:
Recalculate line margin width when zooming (fixes #2990553). Recalculate line margin width when zooming (fixes #2990553).
* src/highlighting.c, doc/geany.txt, doc/geany.html,
data/filetypes.common:
Support more folding icon styles: arrows, +/- and no lines
(#2935059).
2010-04-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2010-04-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>

View File

@ -57,8 +57,8 @@ indent_guide=0xc0c0c0;;
white_space=0xc0c0c0;0xffffff;true;false white_space=0xc0c0c0;0xffffff;true;false
# style of folding icons, valid values are: # style of folding icons, valid values are:
# first argument: 1 for boxes, 2 for circles # first argument: 1 for boxes, 2 for circles, 3 for arrows, 4 for +/-
# second argument: 1 for straight lines, 2 for curved lines # second argument: 1 for straight lines, 2 for curved lines or 0 for none
folding_style=1;1; folding_style=1;1;
# should an horizontal line be drawn at the line where text is folded # should an horizontal line be drawn at the line where text is folded

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title>Geany</title> <title>Geany</title>
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" /> <meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" />
<meta name="date" content="2010-04-21" /> <meta name="date" content="2010-04-22" />
<style type="text/css"> <style type="text/css">
/* /*
@ -139,7 +139,7 @@ Stylesheet for Geany's documentation based on a version of John Gabriele.
<br />Nick Treleaven <br />Nick Treleaven
<br />Frank Lanitz</td></tr> <br />Frank Lanitz</td></tr>
<tr><th class="docinfo-name">Date:</th> <tr><th class="docinfo-name">Date:</th>
<td>2010-04-21</td></tr> <td>2010-04-22</td></tr>
<tr><th class="docinfo-name">Version:</th> <tr><th class="docinfo-name">Version:</th>
<td>0.19</td></tr> <td>0.19</td></tr>
</tbody> </tbody>
@ -4446,13 +4446,17 @@ used.</p>
<ul class="simple"> <ul class="simple">
<li>1 -- for boxes</li> <li>1 -- for boxes</li>
<li>2 -- for circles</li> <li>2 -- for circles</li>
<li>3 -- for arrows</li>
<li>4 -- for +/-</li>
</ul> </ul>
<p>Valid values for the second argument are:</p> <p>Valid values for the second argument are:</p>
<ul class="simple"> <ul class="simple">
<li>0 -- for no lines</li>
<li>1 -- for straight lines</li> <li>1 -- for straight lines</li>
<li>2 -- for curved lines</li> <li>2 -- for curved lines</li>
</ul> </ul>
<p class="last"><em>Example:</em> <tt class="docutils literal"><span class="pre">folding_style=1;1;false;false</span></tt></p> <p><em>Example:</em> <tt class="docutils literal"><span class="pre">folding_style=1;1;</span></tt></p>
<p class="last"><em>Example:</em> <tt class="docutils literal"><span class="pre">folding_style=3;0;</span></tt></p>
</dd> </dd>
<dt>folding_horiz_line</dt> <dt>folding_horiz_line</dt>
<dd><p class="first">Draw a thin horizontal line at the line where text is folded. Only <dd><p class="first">Draw a thin horizontal line at the line where text is folded. Only
@ -6001,7 +6005,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p>
<div class="footer"> <div class="footer">
<hr class="footer" /> <hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>. <a class="reference" href="geany.txt">View document source</a>.
Generated on: 2010-04-22 12:45 UTC. Generated on: 2010-04-22 16:49 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. 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> </div>

View File

@ -3807,13 +3807,18 @@ folding_style
* 1 -- for boxes * 1 -- for boxes
* 2 -- for circles * 2 -- for circles
* 3 -- for arrows
* 4 -- for +/-
Valid values for the second argument are: Valid values for the second argument are:
* 0 -- for no lines
* 1 -- for straight lines * 1 -- for straight lines
* 2 -- for curved lines * 2 -- for curved lines
*Example:* ``folding_style=1;1;false;false`` *Example:* ``folding_style=1;1;``
*Example:* ``folding_style=3;0;``
folding_horiz_line folding_horiz_line
Draw a thin horizontal line at the line where text is folded. Only Draw a thin horizontal line at the line where text is folded. Only

View File

@ -99,9 +99,11 @@ static struct
{ {
GeanyLexerStyle styling[GCS_MAX]; GeanyLexerStyle styling[GCS_MAX];
/* can take values 1 or 2 (or 3) */ /* icon style, 1-4 */
gint fold_marker; gint fold_marker;
/* vertical line style, 0-2 */
gint fold_lines; gint fold_lines;
/* horizontal line when folded, 0-2 */
gint fold_draw_line; gint fold_draw_line;
gchar *wordchars; gchar *wordchars;
@ -702,45 +704,52 @@ static void styleset_common(ScintillaObject *sci, filetype_id ft_id)
} }
/* choose the folding style - boxes or circles, I prefer boxes, so it is default ;-) */ /* choose the folding style - boxes or circles, I prefer boxes, so it is default ;-) */
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_EMPTY);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_EMPTY);
switch (common_style_set.fold_marker) switch (common_style_set.fold_marker)
{ {
case 2: case 2:
{ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_CIRCLEMINUS);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_CIRCLEMINUS); SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_CIRCLEPLUS);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_CIRCLEPLUS); SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED); SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED);
break; break;
}
default: default:
{ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_BOXMINUS);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_BOXMINUS); SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_BOXPLUS);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_BOXPLUS); SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_BOXPLUSCONNECTED);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_BOXPLUSCONNECTED); SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_BOXMINUSCONNECTED);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_BOXMINUSCONNECTED); break;
case 3:
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_ARROWDOWN);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_ARROW);
break;
case 4:
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_MINUS);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_PLUS);
break; break;
}
} }
/* choose the folding style - straight or curved, I prefer straight, so it is default ;-) */ /* choose the folding style - straight or curved, I prefer straight, so it is default ;-) */
switch (common_style_set.fold_lines) switch (common_style_set.fold_lines)
{ {
case 2: case 2:
{
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNERCURVE); SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNERCURVE);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNERCURVE); SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNERCURVE);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERSUB, SC_MARK_VLINE);
break; break;
}
default: default:
{
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNER); SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNER);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNER); SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNER);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERSUB, SC_MARK_VLINE);
break;
case 0:
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_EMPTY);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_EMPTY);
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERSUB, SC_MARK_EMPTY);
break; break;
}
} }
SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERSUB, SC_MARK_VLINE);
SSM(sci, SCI_MARKERSETFORE, SC_MARKNUM_FOLDEROPEN, 0xffffff); SSM(sci, SCI_MARKERSETFORE, SC_MARKNUM_FOLDEROPEN, 0xffffff);
SSM(sci, SCI_MARKERSETBACK, SC_MARKNUM_FOLDEROPEN, 0x000000); SSM(sci, SCI_MARKERSETBACK, SC_MARKNUM_FOLDEROPEN, 0x000000);
SSM(sci, SCI_MARKERSETFORE, SC_MARKNUM_FOLDER, 0xffffff); SSM(sci, SCI_MARKERSETFORE, SC_MARKNUM_FOLDER, 0xffffff);