Added an option to draw an horizontal line above or below folded text.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@974 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2006-11-07 18:53:39 +00:00
parent aecd641ce3
commit 491288aec2
3 changed files with 57 additions and 14 deletions

View File

@ -2,6 +2,9 @@
* src/treeviews.c: Fixed unintentional appearance of sidebar after it
was hidden and the preferences dialog was closed.
* data/filetypes.common, src/highlighting.c:
Added an option to draw an horizontal line above or below folded
text.
2006-11-07 Nick Treleaven <nick.treleaven@btinternet.com>

View File

@ -3,22 +3,39 @@
# 3rd selection argument is true to override default foreground
# 4th selection argument is true to override default background
selection=0xc0c0c0;0x7f0000;false;false
# style for a matching brace
brace_good=0x0000ff;0xFFFFFF;true;false
# style for a non-matching brace (a brace without a counterpart)
brace_bad=0xff0000;0xFFFFFF;true;false
# the following settings define the colours of the margins on the left side
margin_linenumber=0x000000;0xd0d0d0;false;false
margin_folding=0x000000;0xdfdfdf;false;false
# background colour of the current line, only the second and third argument is interpreted
# use the third argument to enable or disable the highlighting of the current line (has to be true/false)
current_line=0x0;0xf0f0f0;true;false
# colour of the caret(the blinking cursor), only first argument is interpreted
caret=0x000000;0x0;false;false
# set foreground and background colour of indentation guides
indent_guide=0xc0c0c0;0xffffff;false;false
# the third argument defines whether to use these values or use the default values defined by the filetypes
white_space=0xc0c0c0;0xffffff;true;false
# style of folding icons, only first and second arguments are used, valid values are:
# first argument: 1 for boxes, 2 for circles
# second argument: 1 for straight lines, 2 for curved lines
folding_style=1;1;false;false
# should an horizontal line be drawn at the line where text is folded (only first argument is interpreted)
# 0 to disable
# 1 to draw the line above folded text
# 2 to draw the line below folded text
folding_horiz_line=0;0;false;false
# only first argument is interpreted, sets whether all defined colours should be inverted
invert_all=0;0;false;false

View File

@ -69,9 +69,10 @@ enum // Geany common styling
typedef struct
{
// can take values 1 or 2
// can take values 1 or 2 (or 3)
guchar marker:2;
guchar lines:2;
guchar draw_line:3;
} FoldingStyle;
static struct
@ -380,6 +381,9 @@ static void styleset_common_init(void)
get_keyfile_int(config, config_home, "styling", "invert_all",
0, 0, &tmp_style);
common_style_set.invert_all = tmp_style.foreground;
get_keyfile_int(config, config_home, "styling", "folding_horiz_line",
0, 0, &tmp_style);
common_style_set.folding_style.draw_line = tmp_style.foreground;
}
get_keyfile_wordchars(config, config_home, GEANY_WORDCHARS, &common_style_set.wordchars);
@ -434,25 +438,44 @@ void styleset_common(ScintillaObject *sci, gint style_bits)
// 2 -> folding marker, other folding settings
SSM(sci, SCI_SETMARGINTYPEN, 2, SC_MARGIN_SYMBOL);
SSM(sci, SCI_SETMARGINMASKN, 2, SC_MASK_FOLDERS);
SSM(sci, SCI_SETFOLDFLAGS, 0, 0);
// drawing a horizontal line when text if folded
switch (common_style_set.folding_style.draw_line)
{
case 1:
{
SSM(sci, SCI_SETFOLDFLAGS, 4, 0);
break;
}
case 2:
{
SSM(sci, SCI_SETFOLDFLAGS, 16, 0);
break;
}
default:
{
SSM(sci, SCI_SETFOLDFLAGS, 0, 0);
break;
}
}
// choose the folding style - boxes or circles, I prefer boxes, so it is default ;-)
switch (common_style_set.folding_style.marker)
{
case 2:
{
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_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED);
SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED);
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_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED);
SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED);
break;
}
default:
{
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_FOLDEREND, SC_MARK_BOXPLUSCONNECTED);
SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_BOXMINUSCONNECTED);
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_FOLDEREND, SC_MARK_BOXPLUSCONNECTED);
SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_BOXMINUSCONNECTED);
break;
}
}
@ -462,14 +485,14 @@ void styleset_common(ScintillaObject *sci, gint style_bits)
{
case 2:
{
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_FOLDERMIDTAIL, SC_MARK_TCORNERCURVE);
SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNERCURVE);
break;
}
default:
{
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_FOLDERMIDTAIL, SC_MARK_TCORNER);
SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNER);
break;
}
}