There is no UI preference for setting the fold margin colors, but there is a way to do this through the Komodo JavaScript API. Create a new JavaScript macro in Komodo's toolbox named "set margin color" with the following code contents:
// Note that the color value is BGR, not RGB!
ko.views.manager.currentView.scimoz.setFoldMarginColour(1, 0x0000FF);
// Note that the color value is BGR, not RGB!
ko.views.manager.currentView.scimoz.setFoldMarginColour(1, 0x0000FF);
Where can I find the current set of images? Would I be correct in assuming they are in one of the jars or archives somewhere?
I would like something to base my images off of.
/**
* @type {Components.interfaces.ISciMoz}
*/ var scimoz = ko.views.manager.currentView.scimoz; // Note that the color value is BGR, not RGB!
scimoz.markerSetBack(scimoz.SC_MARKNUM_FOLDER, 0xFFFFFF);
scimoz.markerSetFore(scimoz.SC_MARKNUM_FOLDER, 0x000000); // Or you may want to just set all the marker types in one go: for(var i=0; i <= scimoz.MARKER_MAX; i++){
scimoz.markerSetBack(i, 0xFFFFFF);
scimoz.markerSetFore(i, 0x000000); }
/**
* @type {Components.interfaces.ISciMoz}
*/
var scimoz = ko.views.manager.currentView.scimoz;
// Note that the color value is BGR, not RGB!
scimoz.markerSetBack(scimoz.SC_MARKNUM_FOLDER, 0xFFFFFF);
scimoz.markerSetFore(scimoz.SC_MARKNUM_FOLDER, 0x000000);
// Or you may want to just set all the marker types in one go:
for (var i=0; i <= scimoz.MARKER_MAX; i++) {
scimoz.markerSetBack(i, 0xFFFFFF);
scimoz.markerSetFore(i, 0x000000);
}
On _FOLDER, _FOLEROPEN, _FOLDEROPENMID, and _FOLDEREND, the setting the foreground sets the fill color.
Setting the background on all of them will set the (out)line color.
There is no UI preference for setting the fold margin colors, but there is a way to do this through the Komodo JavaScript API. Create a new JavaScript macro in Komodo's toolbox named "set margin color" with the following code contents:
ko.views.manager.currentView.scimoz.setFoldMarginColour(1, 0x0000FF);
Triggering this macro will change the color of the margin. You can find out more Scintilla (scimoz) api methods here:
http://scintilla.sourceforge.net/ScintillaDoc.html#SCI_SETFOLDMARGINCOLO...
Cheers,
Todd
That works for the background of the folds (which you need the following to produce a solid color, for the record:
)
I would also like to be able to change the colors of the fold markers (the lines on the fold margin indicating collapsible areas) as well. Any ideas?
These are actual images (in xpm format), so you'll need to create your own images for this purpose, see:
http://scintilla.sourceforge.net/ScintillaDoc.html#SCI_MARKERDEFINE
http://scintilla.sourceforge.net/ScintillaDoc.html#SCI_MARKERDEFINEPIXMA...
The existing fold markers can be selected in the Komodo UI through Komodo's "Editor->Smart Editing->Folding" preferences.
Cheers,
Todd
Thanks for the quick responses. I'll take a look.
Where can I find the current set of images? Would I be correct in assuming they are in one of the jars or archives somewhere?
I would like something to base my images off of.
After examing marker the code "LineMarker::Draw" in:
http://svn.openkomodo.com/openkomodo/view/openkomodo/trunk/contrib/scint...
These fold markers are just drawn in directory as blocks/glyphs and as such do not have an xpm image.
It seems you should be then able to set the marker color using the following API methods:
http://scintilla.sourceforge.net/ScintillaDoc.html#SCI_MARKERSETFORE
* @type {Components.interfaces.ISciMoz}
*/
var scimoz = ko.views.manager.currentView.scimoz;
// Note that the color value is BGR, not RGB!
scimoz.markerSetBack(scimoz.SC_MARKNUM_FOLDER, 0xFFFFFF);
scimoz.markerSetFore(scimoz.SC_MARKNUM_FOLDER, 0x000000);
// Or you may want to just set all the marker types in one go:
for (var i=0; i <= scimoz.MARKER_MAX; i++) {
scimoz.markerSetBack(i, 0xFFFFFF);
scimoz.markerSetFore(i, 0x000000);
}
/** * @type {Components.interfaces.ISciMoz} */ var scimoz = ko.views.manager.currentView.scimoz; // Note that the color value is BGR, not RGB! scimoz.markerSetBack(scimoz.SC_MARKNUM_FOLDER, 0xFFFFFF); scimoz.markerSetFore(scimoz.SC_MARKNUM_FOLDER, 0x000000); // Or you may want to just set all the marker types in one go: for (var i=0; i <= scimoz.MARKER_MAX; i++) { scimoz.markerSetBack(i, 0xFFFFFF); scimoz.markerSetFore(i, 0x000000); }Is that working for you?
Cheers,
Todd
Perfect, thanks.
On _FOLDER, _FOLEROPEN, _FOLDEROPENMID, and _FOLDEREND, the setting the foreground sets the fill color.
Setting the background on all of them will set the (out)line color.